Eight Sorts Animated

Animations showing the action of sort algorithms are common. Indeed, there’s even one using Hungarian folk dancers. The other day, I stumbled across the best animation that I’ve seen.

It’s an animation of 8 different sort algorithms with 4 different initial conditions. By default, all 32 animations run at once so that you can see how they compare. It’s also possible to run a single algorithm or even a single algorithm with a given initial condition.

If you want to see how the algorithms compare or just be entertained, this is a great page to visit. Just run the full animation once and you’ll be hooked. One thing for sure, you’ll never run a selection sort again. Definitely worth a look.

Posted in Programming | Leave a comment

Channeling George Orwell

Karl Voit brings us a message from George Orwell:

Posted in General | Tagged | Leave a comment

Why I Use Emacs

One of the salient features of Emacs is how much I enjoy using it. I suspect many Emacsers feel the same; that’s why they try to move every task they can into Emacs.

Posted in General | Tagged | 4 Comments

Surveillance Karma

Remember a year ago when the CIA was shown to have spied on the Senate Intelligence Committee? Senator Dianne Feinstein, a vocal apologist for NSA snooping, was beside herself demanding investigations into the nation-threatening lawlessness on the part of the snoopers. Sadly, her indignation was short lived and she’s back to telling us that NSA surveillance is no big deal and for our own good.

Now we’re into round two, this time with Representative Peter Hoekstra, a very reliable and outspoken supporter of the NSA’s spying on American citizens, demanding the investigation and prosecution of the NSA for the effrontery of spying on Congress instead of just ordinary citizens. Don’t they know who he is?

Of course, we here at Irreal welcome Representative Hoekstra’s come-to-Jesus revelation; we just wish it would last more than a couple of weeks and translate into some concrete action. In the mean time, we’re enjoying our moment of schadenfreude and the spectacle of seeing Hoekstra’s own ox being gored.

Follow the link above and read Glenn Greenwald’s righteous takedown of the political elite who believe that surveillance is just fine for us ordinary folks but a constitutional travesty when applied to them. As much as we might hope that this will result in some legislation reining in our runaway intelligence community, the more likely outcome is that we’ll get a law making it illegal to spy on Congress.

Posted in General | Tagged | Leave a comment

I Have Nothing to Hide is the Wrong Way to Thing about Surveillance

Moxie Marlinspike, whom I’ve written about before, has a nice article on Wired about Why I Have Nothing to Hide is the Wrong Way to Think About Surveillance. In the first place, you have no idea of whether you have something to hide or not. There are an estimated 27,000 pages of federal law and another 10,000 regulations that have the force of federal law1. Some of these laws are about obscure matters that you probably wouldn’t think would be illegal—see Marlinspike’s example concerning lobsters, for example.

If government lawyers don’t know how many laws there are, how is the average person to know if any given action is illegal? Harvey Silverglate estimates that the average American commits three felonies a day. Not nuisance misdemeanors but civil-rights-canceling, prison-punishable crimes. And you don’t even know you’re doing anything wrong. The point here is that whenever someone says they have nothing to hide, they’re almost certainly wrong.

Next, Marlinspike suggests that we should have something to hide. People breaking bad laws is how bad laws get changed. Consider the sodomy laws, for example. Until very recently it was against the law in most jurisdictions to have same sex relations. Now, of course, it’s not only allowed but the right for same sex couples to marry is the law of the land. Marlinspike makes the case that things would be very different with ubiquitous surveillance.

Finally, Marlinspike says that privacy advocates are facing an enormous steamroller built on careers and billions of dollars of surveillance related contracts. There is no compromise. The efforts of those who claim they have the right to examine our every action must be resisted at every turn. The alternative is 1984 writ large.

Footnotes:

1

Nobody, including the government, knows how many laws there are. You’d think it would be fairly easy to count them but laws are so complex and convoluted that nobody can.

Posted in General | Tagged | 1 Comment

Functional Programming

A couple of years ago, I wrote about Kris Jenkins’ wonderful video that demonstrated interactive programming while building a Spotify client in Emacs Lisp. It’s one of my favorite videos and I’m still seeing it mentioned as new people discover it. Now Jenkins has a two-part post on functional programming that’s also worth your time.

Part One considers the question of what, exactly, functional programming is. Jenkins shapes his answer for the working programmer. It’s not, he says, about map and reduce or anonymous functions—although functional languages generally support these—but about recognizing and controlling side effects. This is more subtle than you might suppose but Jenkins does a good job of explaining what it means and why it’s important. All programmers should read this whether or not they’re interested in functional programming.

Part Two looks at several programming languages and asks to what extent they could be considered functional. These range from Java, the anti-functional language, to Haskell, a functional language on steroids. He also considers, JavaScript, Scala, Clojure, Perl, and Python. Of course, it’s possible to write in a functional manner in almost any language but some, like Java, actively discourage it.

If you’re a working programmer, you should definitely take a look at these two posts. Jenkins raises issues that you should consider regardless of the language you’re writing in or the paradigm you’re using.

Posted in Programming | Tagged , | 2 Comments

Integrating iCal and Org Mode

Rob Rohan has a very nice video up on integrating Org mode and OS X1 iCal. In his case, he wants to create a physical training schedule that will be reflected in his desktop calendar as well as on his iOS devices. Even if your idea of exercise is getting up to get another cup or coffee, you can use the same ideas to export Org events to your calendar for any purpose.

As the Org Manual puts it, “Some people use Org mode for keeping track of projects, but still prefer a standard calendar application for anniversaries and appointments.” In this case the techniques that Rohan describes make it easy to integrate Org mode with iCal. Even if you keep everything in Org mode, you may want to export it to iCal so you can see it on your iOS (or other remote) devices.

The video is short (7 minutes, 46 seconds) so it’s easy to watch. If you’ve been wishing for a way to get Org events into your calendar or your New Year’s resolution involves getting serious about your exercise regime, take a look at Rohan’s video.

Footnotes:

1

Since iCal uses the standard icalendar format, you could probably make this work on any platform and calendar application that supports the icalendar standard.

Posted in General | Tagged , | 1 Comment

Operator Precedence

This seems funny until you realize that it’s true:

Posted in General | Tagged | 2 Comments

The Eighties Called…

…with a message for today’s new Luddites moaning about smart phones and the end of times.

Just as calculators didn’t result in widespread innumeracy, I’m pretty confident that we’ll somehow muddle through the smart phone apocalypse. Not that that will make the new Luddites leave us alone.

Posted in General | Tagged | Leave a comment

Learning the Right Tools

I was going to let this go

but it kept bothering me so here we are.

I don’t understand this attitude and I find it insulting not only to those who have bothered to master their tools but also to younger engineers who are assumed to be too stupid or lazy to do the same.

If you want a best-in-class editor then you take the effort to learn Emacs, Vim, or perhaps one or two others. You don’t declare that Notepad++ is good enough and you certainly don’t, if you know what you’re talking about, declare that Notepad++ won the Vim/Emacs holy war.

Today’s younger engineers are not, in any real sense, kids. Nor are they special snowflakes that need to be protected from the disciplines of our profession. If you want to be more than today’s equivalent of yesteryear’s “Web specialists” that ran scripts to build rudimentary Web sites, then you better learn and master the basic tools. That means learning some language in addition to Javascript, moving beyond Eclipse, and getting comfortable with the command line.

Call me a dinosaur but if your idea of software engineering is pushing a button to generate great glops of code that you don’t understand then your idea of our profession is very different from mine.

Posted in General | Tagged | 6 Comments