Eazy Gnuplot Cookbook

Via Jean-Philippe Paradis I found this gnuplot cookbook companion for eazy-gnuplot. I really like gnuplot and its ability to produce a large variety of excellent plots. Unfortunately, I don’t use it often enough to internalize its documentation and it’s always a chore to figure out how to get even a simple graph plotted.

Eazy-gnuplot is a Common Lisp interface to gnuplot that seems easier to use than gnuplot itself. Take a look at the companion to see how easy and natural it is to use the eazy-gnuplot package. My usual strategy to interface some language to a package like gnuplot would be to write a small library that generates gnuplot input and then arrange to run to gnuplot automatically. That’s pretty much what eazy-gnuplot does so you can just install the package and use it.

As a final word, the cookbook companion mentions the Gnuplot Cookbook. That book deals with gnuplot itself rather than a Lisp interface to it. It’s a bargain at $5 for a digital copy. I got myself a copy so that the next time I have to use gnuplot directly I have a better way than wading through the voluminous documentation trying to find the proper magic spell.

Posted in General | Tagged , | Leave a comment

Doing Away with Autosave Files

I don’t like the loss of control but if you’d rather not worry about recover-file, Anna Pawlicka has you covered:

Posted in General | Tagged | 2 Comments

Calling Applescript from Emacs

In this thread concerning adding certain OS X features to Emacs, I learned something I didn’t know. Daniel Colascione points out that Emacs supports invokng Applescript directly. To invoke Applescript with the string SCRIPT you make the call

(do-applescript SCRIPT)

Strictly speaking, the do-applescript call isn’t necessary because you can always shell out to osascript as I did in my jcs-get-link function that gets a link to the current Web page, like so:

(shell-command-to-string
                  "osascript -e 'tell application \"Safari\" to return URL of document 1'")

With do-applescript you can simplify that to:

(do-applescript "tell application \"Safari\" to return URL of document 1")

As far as I can see looking at the code, this does avoid starting a new shell to execute the code. It’s not a huge win but it does tell us how capable Emacs is as well as being a bit faster.

Of course, if your platform isn’t OS X you don’t care but if you have similar needs you should investigate whether or not Emacs already has a way for you to accomplish it without invoking a shell.

Posted in General | Tagged | 1 Comment

Karma

It’s never nice to revel in schadenfreude, I suppose, but sometimes karma just feels so right.

Posted in General | Tagged | Leave a comment

Learn From Your Tools

N0v0id (Karl Voit) mentioned my post Learning the Right Tools and made an excellent point

One of the advantages of learning first class tools is that you also learn from them. I’ve found that to be the case on a couple of levels.

First, you learn how the great tools handle their UI issues. That may be as simple as a command line calling sequence or as complex as a multiple screen graphical interface. The good tools get this aspect mostly right and it’s worth paying attention to how they do it.

More important, perhaps, is that they give you a chance to see how to build great tools by examining their source code. I learned almost all my “tricks of the trade” by observing how the masters did it. Want to know how to write operating system code? Take a look at the Unix or Linux source code and see how guys like Dennis Ritchie, Ken Thompson, and Linux Torvalds do it. Interested in editors? Look at the Emacs source code. You will, I promise you, learn a lot.

In the case of Emacs, you get a bonus. You can read the code and if you want to try out an alternate algorithm or you want to add or change some functionality you can try it out in a scratch buffer without changing, or even restarting, Emacs itself1. If you like the change, you can add the code to your .emacs or init.el file and make it permanent. If your change is generally applicable, you can submit it as a patch. Almost for free you’ve become a contributor and, in the mean time, learned a lot about software engineering.

As I indicated in my original post, you can be content with using tools like Notepad and still get work done but if you want to be a great engineer, you’ll learn—and learn from—the great tools.

Footnotes:

1

Although the case could be made that since Emacs is a Lisp environment, you are changing Emacs itself even in this case. Perhaps I should say something like stock Emacs here.

Posted in General | Tagged , | Leave a comment

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