Mickey on Flycheck

If you’re a Flymake user, Mickey over at Mastering Emacs has some advice for you: switch to Flycheck. It’s a drop in replacement for Flymake that has better out-of-the-box language support and is faster. Mickey says that for him the replacement was seamless. “One moment I was using my own duct taped Flymake handlers, and the next I was simply using Flychecks’.”

See Mickey’s post for more details and keybindings. If you like to have your code’s syntax checked on the fly, this is definitely worth a look. And, of course, while you’re there, check out some of Mickey’s other offerings. They’re an extraordinarily good resource.

Posted in General | Tagged | 2 Comments

Diffing Regions in the Same File

A Nice tip from Aaron Fischr:

This works for relatively small regions. For larger regions (over 200 lines, say) use ediff-regions-linewise.

Posted in General | Tagged | 1 Comment

Oracle on Finding Exploits

Via Matt Blaze:

Oracle’s Mary Ann Davidson wrote an astoundingly foolish and arrogant post on why customers are wrong to find and report vulnerabilities in Oracle. It’s so bad, in fact, that it’s since been taken down (the link above is to the Internet Archive).

The post cries out for a good Fisking but no analysis could do it justice. You should really read it for yourself. The arrogant tone and lack of respect for their customers should give any Oracle user pause.

I don’t understand Oracle’s obsession with reverse engineering. We’re talking about well understood technology; There really aren’t any secrets. I’m not a database guy so I’m interested in why enterprises continue to use Oracle. Are there any reasons—other than the usual stupid ones—to prefer Oracle to, say, PostgreSQL?

Blaze has a followup Tweet on why all this matters:

Posted in General | Tagged | Leave a comment

Yasnippets Tutorial

Lefteris Karapetsas has an interesting tutorial on using yasnippets for entering boilerplate code. A lot of us use small snippets for minor tasks such as filling in a for or while loop. Karapetsas shows how to use it for large portions of boilerplate.

The examples he gives are from C but the techniques are equally applicable to other languages. The idea is that code for defining a structure and functions to allocate it, initialize it, and free it is usually pretty much the same so a snippet can “write” most of the code for you. The snippet parameters fill in many of the unique parts, leaving only the application specific code to write. The same ideas apply, of course, in other common situations.

Karapetsas also has links to another tutorial and the Yasnippet Development Manual. If you aren’t using yasnippets or are only using them in trivial ways, take a look at Karapetsas’ post.

UPDATE: Added missing link.

Posted in General | Tagged | 5 Comments

The Origin of STDERR

Most (all?) modern operating systems have the notion of STDERR, a separate output channel that programs can use to output error messages. It’s especially important for Operating Systems that have some notion of “pipe” where the output of one program is automatically used as the input to another. Obviously, you don’t want error messages corrupting the data stream.

Until recently, I didn’t know—or even think about—the origin of STDERR. It just seemed a natural and necessary facility to have. It turns out that it all started with the C/A/T typesetter and troff at Bell Labs. Diomidis D. Spinellis tells the story of how the combination of troff and the C/A/T typesetter lead to the implementation of STDERR.

Spinellis’ post also serves to remind us how easy we have it now. It wasn’t that long ago that producing a typeset document was a long and messy process. Take a look at the post; it’s an interesting and amusing story.

Posted in General | Tagged | Leave a comment

XML Parsing

Always use the best tool available. (via Karl Voit)

Posted in General | Tagged | Leave a comment

Installing Org 8.3

Org 8.3 is ready on Elpa so those of you installing it with the package manager can upgrade at your convenience. When I upgraded and reloaded Org I got the error message

Invalid function: org-babel-header-args-safe-fn

After some experimentation, I gave up and started trawling the Internet. It turns out that if you’re trying to use R in Babel, you need to byte recompile ob-R.el to make things work.

I’m not sure what the optimal procedure is but after discovering the problem when updating my iMac, I followed these steps on my MacBook

  • Updated as usual with the package manager
  • byte compiled ob-R.el by calling 【Meta+xbyte-compile-file <path to org>/ob-R.el
  • Restarted Emacs. Still got the error so I byte compiled ob-R.el again and
  • Restarted Emacs

The main thing is to do the byte compile. After that, you can enjoy the new and wonderful Org mode.

Posted in General | Tagged , | 1 Comment

CNN on Encryption Policy

The CNN Website has a deeply dishonest Op Ed by Mike Rogers on Encryption. Rogers is the former Congressman who served as the head of the Select Committee on Intelligence. You may remember him as the apologist for the NSA’s phone metadata collection program who claimed you have nothing to be concerned about because the metadata does not include your name, only your phone number, so the records can’t be tied back to you. Who knew about phone books?

That sort of dishonestly is already reason enough to disregard anything he has to say on the matter but even taken on its own terms, the Op Ed is disingenuous. He makes the reasonable observation that sometimes the public good outweighs a company’s desire to make a profit. For example, even though trafficking in child pornography or money laundering might be profitable, everyone agrees that it’s sound public policy to prohibit them. It’s the same, he says, with encryption. But, of course, that ignores the fact that encryption, unlike child pornography or money laundering, serves a useful public purpose as Mike McConnell, Michael Chertoff, and William Lynn—experienced government officials with intelligence backgrounds—explained in a recent Op Ed in the Washington Post. Note, also, the insulting and dishonest intimation that the only reason for resistance to the backdoors is a desire on the part of tech companies to profit at the public’s expense.

Of course, no piece like this would be complete without waving the terrorism banner. The Op Ed starts with a video of FBI director Comey testifying that we risk “going dark,” a perennial FBI talking point that is debunked every time it’s raised. The video is labeled “FBI: U.S. can’t crack secret terror messages from ISIS.” If only the tech companies would install backdoors, this couldn’t happen. Except, of course, it would. ISIS doesn’t care very much about U.S. laws and will simply use one of the many open source encryption programs available to communicate securely while the rest of us suffer from decreased security. It is, really, just another example of the dishonesty of the piece. It’s too bad CNN chose to publish such a flawed and deceitful Op Ed. We deserve better.

Posted in General | Leave a comment

Diff a Buffer with its On-Disk File

Ben Maughan over at Pragmatic Emacs has a handy tip that I didn’t know about. Sometimes it’s convenient to see the differences between the current buffer and the underlying on-disk file. Emacs, of course, has you covered. Just call ediff-current-file to get a diff between the buffer and the file.

It’s not hard to understand how this handy command escaped my notice; it’s not in the ediff menu. I don’t use the menu for operations, of course, but it’s a good way of discovering commands for a particular area. Even if you read the ediff menu, it’s easy to miss particular commands but the menu makes them stand out.

In any event, thanks to Maughan for pointing out this useful command. If you aren’t already following Pragmatic Emacs, you really should add it to your feed. It’s full of good material.

Posted in General | Tagged | 1 Comment

Finally. The Mysteries are Solved

Heh.

Posted in General | Tagged | Leave a comment