I don't actually expect it to lead to a flamewar here, but I am nevertheless invoking one of the longstanding Internet disputes with this announcement: I have recently switched from emacs to vi1.
For the uninitiated: emacs and vi are the two most common text editors in Unix environments. They're meant for editing unformatted text such as computer programs. I'm doing a lot of Unix programming these days (in Perl and C++) so a good text editor is essential. The two have fairly different philosophies: emacs does more or less what you would expect, in that you can type words and they appear on the screen, but it also has a ton of extra functions (such as programming with butterflies). Unfortunately even simple ones like, say, "save" have to be accessed by typing a sequence of obscure key commands, usually while holding down the control key.
On the other hand, if you open up a file with vi and start typing, words will not appear on the screen. If you're lucky it'll just beep at you repeatedly; it might also start deleting portions of your file apparently at random. Fortunately you'll never figure out the command to save, so your original file will be unharmed; unfortunately you'll never figure out how to quit either, and be stuck there forever (or until you open up Google and look it up).
At least, that was my first experience with vi, and having concluded that it was designed by alien intelligences I quickly became a convert to emacs. However, I recently began to question that decision, for a number of reasons:
Anyway, I went home one night and went through the vim tutorial, and discovered that it's not as hard as I thought, and ended up switching entirely.
Rather than actually make this an editor wars thread, consider this a place to suggest your favorite Unix programs for software development (or whatever else).
1 Actually, vim2.
2 Well, technically gvim.
3 Except that the diagonal movement keys do other, more drastic things in vi, which can cause trouble when I forget I'm not playing nethack.
I learned C back in high school but never got around to C++, since it was never something I needed for my physics studies. However, many of the jobs I've been applying for list C++ proficiency as strongly preferred (if not required), so now seems like a good time to learn something about it. Can anyone recommend a book on the subject? Or is reading a book the wrong way to approach the problem? I should note that as an undergrad I was familiar with C and had done a bit of object-oriented programming in Java, but I haven't used either very much since.
Friday night my laptop abruptly died. ("I don't remember turning it off... uh oh.") Luckily the hard drive is undamaged so I was able to recover the data (and I had a sorta-recent backup). Thus, it's not a disaster, but I do want to replace it. I'm finding myself very indecisive at the moment, so any advice is welcome.
In descending order of priority, the new computer will primarily be used for:
(That's for the next six months, after that it may or may not get pressed into a whole new set of tasks depending on what sort of job I end up taking.)
The old computer was a Dell Latitude D600.
Here are some options (mainly driven by what I can get at a discount through UCB):
Apple Macbook Pro
Pro: Visually appealing, OS X seems nifty (but I haven't used it enough to know for sure), Apple still the lesser evil as far as business practices.
Con: Expensive, all my current software is for Windows.
Dell Latitude
Pro: Familiar, customizable.
Con: My previous Latitude had three motherboard failures, for a lifetime of about 15 months, which does not give me confidence in their reliability. (The extended warranty was terrific, but I wish I didn't have to use it so much.)
Dell Inspiron
Pro: Inexpensive, can get Ubuntu preinstalled (but will probably want a Windows partition as well).
Con: Reliability concerns as with the Latitude.
Lenovo Thinkpad
Pro: Good reputation.
Con: Visually unappealing.
I'm leaning towards the Macbook Pro, but since I can't get one instantly (they're backordered). I have a few days to think about it. What other factors should I be considering? What other options have I overlooked?
There's been some buzz lately about D-Wave's sixteen-qubit quantum computer that they're planning to demonstrate tomorrow. Instead of writing a post on this I'm just going to link to (and endorse) Scott Aaronson's post on the subject. There's a lot of skepticism about D-Wave in the community.
Via Boing Boing, a website to generate images of custom-labeled audiocassettes. I am totally going to use this for the cover art on a mix CD.
Last week Lawyers, Guns, and Money linked to an article about simulations of crowd behavior:
McKenzie has devised Crowd Federate, a model that will add a crowd component to a variety of defense simulations. “The intent is to provide a real-time, realistic, psychologically based crowd model to provide interactions with control forces.”Based on extensive psychological research, Crowd Federate works at several levels. At the smallest, the model tracks individual people, although only for navigation within the city at this point. The psychological aspects kick in at the group level, with groups typically composed of 10 people.
“There are different types of groups,” McKenzie said. “There is the protester group which protests for a cause. They’re the ones holding the banners. The agitator group is there to cause trouble. The bystanders are just there and don’t want to get involved. Then there is the curious group that will move toward anything interesting and stick their noses in. If something violent should erupt, they will probably run away.”
I bet it's much more sophisticated than this one.
I have been in Baltimore for a couple of days now; I would have posted earlier but my computer has chosen an inopportune time to refuse to turn on. This was distressing not just because I had several items to post to the blog, but also because I planned to use my computer for my talk this afternoon.
Fortunately my roommate had experienced a similar problem with his desktop, and had a trick for getting it started: hold down the power button while plugging it into the wall. This sounded crazy, but when I tried this (inserting the battery instead of plugging in the power cord) it booted right up.
So I should be in good shape as long as I don't shut it down again... Meanwhile, I am still under extended warranty and Dell is sending a technician to my hotel to fix the problem this week.
Some of you know Steve Koonin from his days as Caltech's provost. He's now chief scientist at BP International, and gave the colloquium at Berkeley today under the title "A Physicist's View of the World's Energy Situation". The talk was extremely interesting and seemed like a very realistic assessment. Some of the points I took away (in a bit of random order):
On the software I use to run our qubit experiments, there is a checkbox labeled "Inverted Pulses". Two or possibly three years ago I added this feature to the software, so that the option is available to operate our readout scheme under the opposite electrical polarity. Normally our readout pulses go to positive voltage, but occasionally it is interesting to see what happens with negative voltage pulses. Ideally the behavior should be completely symmetric, but in practice there are asymmetries that should generate different results.
But when I say "occasionally" I mean very occasionally; to the best of my recollection I used this feature for a couple of days after I installed it, and then never checked the box again. In the meantime I have added many other features to the increasingly bloated software, without caring very much whether they were compatible with the rarely-used inverted pulses. Of course, this has all come back to haunt me now that I again want to reverse the polarity on the readout pulses, and am faced with the question: Does the "Inverted Pulses" box still work?
After some testing it's clear that the answer is "no", and furthermore it's not obvious why it ever worked. (The crucial command to the instrument contained a syntax error!) Or maybe it didn't ever work and I had forgotten this, or it was one of those pieces of software I wrote anticipating a potential experiment and then never actually used. I seem to have fixed the bugs, but there are still some quirks in the startup sequence that should probably be ironed out...
(Since my former CS 1 TA reads this, I will remark that these problems could be avoided with properly documented and tested code. Ha! Unfortunately, the culture of experimental physics does not value properly documented and tested code. The culture of experimental physics values code which can be produced five minutes after a postdoc says, "Wouldn't it be interesting to try [a complicated new pulse sequence while sweeping over three separate parameters]?" And so three years later I'm looking at my own software wondering what the hell that switch does.)
I've had like three posts I've wanted to put up today (including the open thread), and have been prevented from doing so by severe computer problems. Posting from the lab computer is somewhat more annoying (lacking my usual software and bookmarks) so I'll write up the post with the fewest number of links.
So I'd decided to acquire the new album by My Morning Jacket, which ordinarily would have been a straightforward matter, but this time I ran into an ethical dilemma. The problem, of course, is that My Morning Jacket is on a Sony label. Hence:
My advisor has a powerful dislike of digital electronics, partly due to the additional electrical noise generated by such circuits. Another issue is that manufacturers of high-precision digital equipment are often tempted to add dubious "enhancements" to their products. Consider, for example, our Tektronix digital oscilloscope. It has a lot of useful features, most importantly a 1 GHz bandwidth. On the other hand, it runs Microsoft Windows.
Now, this does allow me to play solitaire during an extended measurement. And in principle the ability to run programs like Labview could be very useful, and the scope connects to the network very easily. On the other hand, this means that the software that actually runs the core oscilloscope functions is Windows software.
Recently, when booting up the scope, the aforementioned software has been exiting immediately with an "unrecoverable system error". This effectively converts the instrument into an ordinary PC with a tiny screen (and a $30,000 price tag). This was the first time I have attempted to repair a scientific instrument by reinstalling Windows. Unfortunately, this had no effect on the problem, leading me to guess that it was a hardware malfunction on the acquisition board. Time to run the scope diagnostics... which only exist inside the software that refuses to run.
So we're sending the thing to Tektronix where they will repair it for a hefty fee. Meanwhile, I am starting to appreciate the simplicity of purely analog electronics.
If you have a mobile phone with a browser, you may know that Google will translate your search results into mobile-readable WML. I discovered yesterday that they've improved this service, adding text formatting and form capability. This relieves me of the need to put together a WML version of this blog.
How to read Arcane Gazebo on a WML-capable mobile phone: Go to google.com and search for arcane gazebo. Follow the link on the first result. It actually looks pretty good (on my Motorola V551), blockquotes and italics are preserved, and posting comments should work (I haven't tried it yet myself).
Something else I meant to post on Friday: Brad DeLong recommends a fascinating article by Jared Diamond (the Guns, Germs, and Steel guy) arguing that many of mankind's historical woes—famine, war, tyranny—stem from a catastrophic event: the invention of agriculture.
Apparently there's a lot of evidence that the hunter-gatherer lifestyle is quite a bit healthier than that of the typical peasant-famer, but agricultural societies were able to dominate since they can support a larger population, albeit at a lower level of nutrition. (Sort of like McDonald's, I guess.)
The article is originally from 1987, so it's not so new, but I hadn't seen it before, and I found it really interesting. Here's an excerpt:
There are at least three sets of reasons to explain the findings that agriculture was bad for health. First, hunter-gatherers enjoyed a varied diet, while early farmers obtained most of their food from one or a few starchy crops. The farmers gained cheap calories at the cost of poor nutrition. (today just three high-carbohydrate plants–wheat, rice, and corn–provide the bulk of the calories consumed by the human species, yet each one is deficient in certain vitamins or amino acids essential to life.) Second, because of dependence on a limited number of crops, farmers ran the risk of starvation if one crop failed. Finally, the mere fact that agriculture encouraged people to clump together in crowded societies, many of which then carried on trade with other crowded societies, led to the spread of parasites and infectious disease. (Some archaeologists think it was the crowding, rather than agriculture, that promoted disease, but this is a chicken-and-egg argument, because crowding encourages agriculture and vice versa.) Epidemics couldn’t take hold when populations were scattered in small bands that constantly shifted camp. Tuberculosis and diarrheal disease had to await the rise of farming, measles and bubonic plague the appearnce of large cities.Besides malnutrition, starvation, and epidemic diseases, farming helped bring another curse upon humanity: deep class divisions. Hunter-gatherers have little or no stored food, and no concentrated food sources, like an orchard or a herd of cows: they live off the wild plants and animals they obtain each day. Therefore, there can be no kings, no class of social parasites who grow fat on food seized from others. Only in a farming population could a healthy, non-producing élite set itself above the disease-ridden masses. Skeletons from Greek tombs at Mycenae c. 1500 B. C. suggest that royals enjoyed a better diet than commoners, since the royal skeletons were two or three inches taller and had better teeth (on the average, one instead of six cavities or missing teeth). Among Chilean mummies from c. A. D. 1000, the élite were distinguished not only by ornaments and gold hair clips but also by a fourfold lower rate of bone lesions caused by disease.