The NSF Questions

Last Saturday I wrote about the National Science Foundation poll that asked respondents 10 questions about the biological and physical sciences. The most astounding finding was that one in four Americans don’t know that the earth revolves around the sun. Another interesting result was that the average American score was 6.5, which is pretty depressing.

When I wrote that post I couldn’t find anything showing the actual questions. Now The Atlantic has an article that lists the questions. As you’ll see, the questions are nothing special and I’m sure the average score of Irreal readers would approach if not reach 10 of 10. The Atlantic has another bit of interesting information: the scores of other developed nations. It’s a small—very small—consolation that the United States wasn’t the worst performer on all the questions.

Take a look at the Atlantic Article. It’s an interesting read.

Posted in General | Tagged | Leave a comment

Prompting for Repository in Magit Status

I found another great tip from Leonardo Etcheverry. Sometimes I want to call magit-status but the current buffer isn’t associated with the proper repository. That happens, for example, when I’m in the agenda buffer and want to commit one of the associated files that just got updated by Org. Usually, I just switch to a buffer with a file associated with the desired repository. That works but it’s a little inconvenient.

It turns out that if you put a list of your repositories in magit-repo-dirs and call magit-status with the universal argument prefix, magit will prompt you for the repository. That’s really convenient; I can’t believe I’m just now learning about it.

Check out Etcheverry’s post for the details on how to set things up. I really love this tip.

Posted in General | Tagged , | 2 Comments

Resolving Git Merge Conflicts with Ediff

Leonardo Etcheverry has an excellent short post on how to resolve merge conflicts with Magit and ediff. For various reasons, I don’t often encounter merge conflicts so I always struggle with getting them resolved. Etcheverry’s post shows how easy this is using Magit and Ediff.

You get three buffers. One for each of the conflicting files and the third for the merge. You can use 【n】 and 【p】 to move between conflicts and then 【a】 or 【b】 to choose the change. Read the post for the details. The whole process looks easy enough that even the occasional user should be able to remember it.

Posted in Programming | Tagged , | 2 Comments

Running Emacs in the OS X Terminal

Most of us, these days, prefer to run everything from a GUI. Of course, there are plenty of times when we need to use a terminal. That can be a problem for Emacs users on OS X because there is no way to choose a terminal key for 【Meta】 from Emacs itself. This means that by default you must use 【Esc】 for 【Meta】, which I find clumsy.

Fortunately, Terminal.app has a preference that allows the 【⌥ Opt】 key to be mapped to 【Meta】. That works out well for me because I use 【⌥ Opt】 for 【Meta】 when running Emacs in the GUI.

Lots of people like to use 【⌘ Cmd】 for 【Meta】 though. What can they do? If you’re an OS X user who prefers to map 【⌘ Cmd】 to the【Meta】 key, this post and its comments on the Emacs subreddit has some suggestions. It also explains how to set the Terminal.app preference that I mentioned above. If you’re using Linux, there are also some suggestions to help you with that too.

Posted in General | Tagged | 1 Comment

Scientific Illiteracy

A little while ago I wrote about mathematical literacy and disturbing indications of a lack of it in American life. Now there’s evidence of American’s scientific illiteracy as well. The National Science Foundation recently polled 2,200 people on some basic scientific questions. The poll included a quiz with 10 questions on physical and biological science.

The first piece of bad news was that the average score was 6.5 correct answers. That’s not very impressive, especially given that the respondents were generally supportive of scientific research and favored increased funding. Not everyone can or wants to be a scientist, of course, but if you want a healthy society, its citizens need to know how the world works—at least in general terms.

You’re probably thinking this post is about how many people reject evolution. It’s not, although fewer than half of the respondents knew that human beings evolved from other species. No, this post is about the fact that 1 in 4 Americans didn’t know that the earth revolves around the sun.

At first I thought it was a joke or some writer being ironic. It wasn’t. Only 74% of those 2,200 people knew the fundamental fact of our solar system. It’s like Galileo never existed.

It’s profoundly depressing to find that so many of my fellow citizens are this scientifically illiterate. It’s even more depressing that the fact of our heliocentric solar system is not religiously charged like evolution. It’s merely a quotidian fact that I can’t ever remember not knowing. It’s probably true that this sort of scientific illiteracy occurs everywhere in the world; I just wish I’d hear about it somewhere other than the U.S.

Posted in General | Tagged | Leave a comment

Git Bisect Tutorial

Back in December, I wrote about Randy Fay’s screencast on Git bisect. Now Matt Honeycutt has posted his own tutorial. It’s in the form of a blog post so if Fay’s video moved too quickly for you to follow, you may find Honeycutt’s post useful.

As I wrote before, Git’s bisect command is a really excellent way of finding the commit that introduced an error and it’s very easy to use. You can follow along as Matt zeroes in on the offending commit. If you aren’t familiar with Git bisect, it will be well worth your time to spend a few minutes with Honeycutt’s post.

Posted in Programming | Tagged | Leave a comment

Nanopass Compilers

For the 2013 Clojure Conj, Andy Keep gave a great talk on nanopass compilers. The idea is that rather than having the normal 2, 3, or 4 passes in a compiler, you have several passes each of which does one small task. Each nanopass is basically a rewrite rule driven by a pattern matcher.

The talk is centered around a Scheme-to-C compiler that compiles a subset of Scheme to C. Keep put the compiler together over three days using a nanopass framework. The nice thing is that the compiler and the nanopass framework are available on Github for those who would like to experiment with it. The framework was developed for the compiler class at Indiana University and then used to rewrite the Chez Scheme compiler, a commercial compiler that compiles to machine code. This shows that the nanopass idea can definitely be used to build non-trivial compilers.

The talk is about 40 minutes so plan accordingly. If you like compilers or you’re interested in writing compilers in Lisp this is a video you will want to watch.

Posted in Programming | Tagged , | Leave a comment

Lisp Debugging with Slime

Rainer Joswig has a nice video up demonstrating how to debug Lisp with Slime. In a sense there’s nothing new here: most Slime users are pretty much aware of the facilities that he uses. Nevertheless, it’s very useful to see someone put them to use on a real problem.

Joswig makes the point that the Emacs/Slime combination is equal to any dedicated Lisp IDE. Not being an IDE user, I can’t verify that from personal experience but I do know for sure that I don’t want to deal with more than one editor. If the only thing you do is program Lisp then by all means use an IDE if it meets your needs. But if you’re like me and use your editor for darn near everything and if, also like me, you are easily confused by multiple editor interfaces, then stick with Emacs and Slime and be happy.

The video is a bit over 15 minutes so it’s easy to fit into a coffee or lunch break. If you use Lisp and Slime this is definitely worth a few minutes of your time.

Posted in Programming | Tagged , , | Leave a comment

The Hypocrisy of Governments

Governments all over the world are sparing no effort to discover and prosecute members of Anonymous. It only makes sense. After all they do patently illegal things like launching DOS attacks against sites they don’t like or have a grievance with. Clearly bad guys who deserve no leniency.

Except, it turns out that governments are doing the same things. Not only are they doing the same things they claim it’s perfectly justified in the pursuit of justice. Why should their hands be tied, after all?

Yes, but they’re going after bad guys so it’s justified. Actually not. There appears to be a lot of innocent bystanders suffering too. This particular case comes from Britain so I’m not as familiar with the legal system but it’s hard to see how they can justify doing things for which they jail others. Just remember this the next time your government is in high dungeon about those criminal hackers sullying our sacred Internet.

Posted in General | Tagged | Leave a comment

State of the Irreal Site

I think I have finally ironed out all the problems with Irreal. Ironically, the latest snafu held the key to resolving all the other problems. WordPress now automatically updates minor versions and although they notify me with an email, it pretty much flies under the radar. After the last automatic update, comments stopped working and after a bit of debugging I discovered that the NuCaptcha plugin was having problems with the Twenty Ten theme that Irreal uses.

Although I keep the WordPress software up-to-date, having learned my lesson the hard way, I didn’t keep the theme up-to-date because I didn’t think it had security or operational implications and because I had made some tweaks to the CSS. That finally bit me in the butt when comments stopped working. I thought. Actually, I think it had significant negative impact long before that.

After I fixed the comment problem by adding a Child Theme with my custom CSS tweaks, I noticed that the latency problem completely disappeared. I disabled the caching plugin and I still had near-instantaneous page loading. It appears that the loading latency problem was somehow related to the out-of-date theme.

I think I’ve finally learned my lesson: keep all your software current. If you’re running a WordPress site, it’s imperative that you keep WordPress and your theme up-to-date. Updating WordPress means you have to (or at least should) backup your database. Updating your theme is even easier. If you want to change the CSS you should do it by creating a child theme. That’s easy and you only have to do it once. Thereafter, you just need to update the theme when WordPress tells you a new one is available.

Please let me know if you experience any problems with the site. It should load quickly and be fully functional. If it falls short in any way, I’d like to know about it.

Posted in General | Tagged | 4 Comments