Wonderful

This is just wonderful. Reuters is reporting that for the first time NPEs (more commonly known as Patent Trolls) are bringing the majority of U.S. patent lawsuits. Can someone please explain that part about the public interest to me again? Can we have a serious discussion on patent reform now? If not, what will it take?

Posted in General | Leave a comment

Solution To Yesterday’s Challenge

Yesterday’s post asked you to turn 26 lines of

a b c d e f g h i j k l m n o p q r s t u v w x y z

into 26 lines of

a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z

by replacing the blanks with a series of 4 blanks.

The best Vim solution (13 keystrokes ignoring the file saving) on the VimGolf site uses a substitute operation to replace a single blank with 4 blanks. If we use the same strategy in Emacs we get

Meta+%
Return
Return
!

for 9 keystrokes. That’s good but if we replace 【 】 with 【Ctrl+4 】 we get it down to 7.

Update: 【Ctrl】 → 【Meta

Posted in General | Tagged | 5 Comments

Another VimGolf in Emacs Challenge

Here’s another VimGolf in Emacs from a recent challenge on the VimGolf site. Your task is to replace the blanks between the letters with 4 blanks and to do it for each line. Here’s the starting file

a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z

and the ending file

a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z
a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v    w    x    y    z

Disregarding the keystrokes necessary to save the buffer to a file, the best Vim solution is 13 keystrokes. I can do it in 7 with Emacs. Can you beat that? I’ll post my solution in the next day or two.

Posted in General | Tagged | 5 Comments

Exploratory Data Analysis with Unix

Seth Brown over at Dr. Bunsen has a great post on how the ordinary Unix coreutils can be used for exploratory data analysis. His first example

(head -5; tail -5) < data

to show the first and last 5 lines of a file is something that we all understand immediately but might not think of doing ourselves.

He moves on to showing how to change the shape of data using utilities like paste, and to enumerate data with wc and simple awk scripts. Then he has some examples that show how to massage data into useful forms for input to statistical analysis and plotting programs.

There are a lot of Unix utilities that many of us have forgotten or have only dim remembrances of. That’s too bad because as Brown demonstrates, they can be extraordinarily useful. As one of the commenters remarked, “…far more people need to get back to basics and learn coreutils.” I couldn’t agree more.

Posted in General | Tagged | Leave a comment

Is The TSA Finished?

I know, I know: I’m courting a comeuppance from Betteridge’s Law but this is too good to ignore. Christopher Elliot at Linked in has an interesting post in which he posits that the TSA, as we know it today, can’t continue to exist.

The central theme of the post is a hearing of the House Aviation subcommittee. A hearing which TSA head John Pistole refused to attend. The striking thing about the hearing is the hostility of the panel members to the TSA and the near universal consensus that the mission of the TSA needs to be radically revamped.

Anyone who knows anything about security realizes that what the TSA is currently engaged in is security theater. While providing no realistic protection from terrorists, the TSA is actually increasing our chances of being killed. I don’t know if Elliot is correct but I certainly hope so. The sooner the current TSA is eliminated the better off and safer we will all be. Take a look at Elliot’s post; it’s short and very interesting.

Posted in General | Tagged | Leave a comment

Let’s Play Ivmgolf

After my last VimGolf post I thought it would be fun to try another so I headed over to the VimGolf site to find a challenge. The first one I stumbled across was Let’s play some Imvgolf. The challenge is simple: starting with

Ivm is an awesome text editor based on
Iv, and is used to play a game called
Ivmgolf. A challenge, simple for many
Ivmgolfers, can still hide secrets.

transform it to

Vim is an awesome text editor based on
Vi, and is used to play a game called
Vimgolf. A challenge, simple for many
Vimgolfers, can still hide secrets.

in the smallest number of keystrokes possible.

My first thought was that it was too simple. Surely, it would hard to beat a simple query-replace: 【Meta+%ivReturnviReturn】 【!】 for a total of 8 keystrokes. Hard to see how you could do much better than that. Except that the winning VimGolf entries solved it in only 5 keystrokes1

Using Magnor Sveen’s awesome multiple-cursors package, which should and probably will be part of Emacs core, I was able to get that down to 6 keystrokes.

It’s easy to see what you need to do: switch the first two characters of each line and adjust the capitalization. I tried that using keyboard macros and even apply-macro-to-region-lines but I couldn’t do better than query-replace using core Emacs functionality. The problem is that any macro that requires typing in Vi has already used 4 keystrokes, and if you use a macro and something like 【Ctrl+t】 to switch characters you’ve used 3 keystrokes and still have to adjust the capitalization, get to the start of the next line, and run the macro on the rest of the lines. If you can do better than 8 keystrokes with stock Emacs, be sure to leave a comment.

Footnotes:

1 The VimGolf rules say you have to save the file too so that adds an extra 2 keystrokes in both Vim and Emacs but I’m ignoring them since they add nothing useful to the challenge. All scores in this post are without saving the file.

Posted in General | Tagged | 5 Comments

Autocompleting

Xah Lee has a nice post on the various methods of autocompleting in Emacs (search for 2012-12-01). Most Emacs users will be familiar with the majority of the material but it’s helpful to have it all written down in one place. For most of the methods he gives pointers to additional material that he’s written for that particular mode or package. Very helpful.

Of the minibuffer methods that he mentions, I use ido and smex and I’m experimenting with icomplete. For the general methods, I use hippie-expand, dabbrev-expand, and abbrev-mode. I couldn’t live without ido and smex and I use the others regularly. I find them all very handy so if you aren’t already using them you should give them a try.

I don’t use YASnippet but I’ve been meaning to install it. When guys like Lee and Magnar Sveen keep recommending it, that’s a pretty good indication that I’d find it useful. What do you think? If you have any strong feelings about the above packages or use something else that really works for you, leave a comment.

Update:

Lee has made the post a standalone page.

Posted in General | Tagged | 3 Comments

New Emacs Movie: Dired

Noufal Ibrahim has started “season two” of his Emacs Movies. This is the second section that will describe various Emacs modes and tools such as

  1. Dired
  2. Org-mode
  3. Eshell
  4. Diary
  5. Calc
  6. Ediff
  7. Gnus
  8. Vmail
  9. Erc
  10. BBDB
  11. Info

His latest movie is an excellent summary of Dired. He covers all the usual Dired tricks but includes a few that I didn’t know. For example, it’s possible to bring up a thumbnail of an image in Dired and then, if you like, open the image in another window The video is about 20 minutes long and well worth watching. Unless you’re already very familiar with Dired, you’re sure to learn something new. Definitely recommended.

Posted in General | Tagged | 1 Comment

More News From the Cursive Front

Yahoo News has an interesting article on the cursive wars. Should cursive handwriting be abandoned as an anachronism or should it be preserved as an important life skill? Regular Irreal readers already know where I stand on the matter but might want to see the arguments for the other side in Yahoo’s article.

Some schools are hanging onto cursive tenaciously, insisting that their students receive at least some instruction in it. All the usual reasons are given but there’s a new entrant in the article: cursive is necessary to teach fine motor skills. The same folks pushing that idea would doubtless become apoplectic if someone suggested that improving fine motor skills was a good reason to encourage video games.

By far the most interesting thing about the article was the comments. I read a couple of pages worth and didn’t see a single comment that wasn’t hostile to the idea of eliminating cursive. People feel extraordinarily threatened by the idea. I’ve suggested before that this has a lot to do with “I suffered through learning it, why shouldn’t they?” but no one admits to that. Instead they all give the usual silly arguments such as “this is dumbing down our students,” “if they don’t learn cursive they won’t be able to sign their names” and others that are just too embarrassing to repeat. Many are simply irrational and brimming with anger. If you’re interested and feel up to it, see the comments to Yahoo’s article; it has a good representation.

There’s another Yahoo article that explores these points a little further and discusses various home-based resources for parents who feel their children need instruction in cursive. It’s worth looking at these two articles if only to see what arguments can be brought to bear in favor of cursive.

Posted in General | 9 Comments

Icomplete Mode

Per Xah Lee (search for 2012-11-28), I’ve experimentally turned on icomplete-mode. I’m not sure how I like it so I haven’t included it in my init.el file yet.

According the internal documentation, icomplete-mode “implements a more fine-grained minibuffer completion feedback scheme.” You can toggle it with 【Meta+xicomplete-mode or turn it on/off unconditionally with a positive/non-positive prefix argument.

Lee says it’s part of Emacs 24.2 but the source file indicates it’s been around a lot longer. If you have an older version of Emacs and it works for you (or you get documentation for it with 【Ctrl+h ficomplete-mode) leave a comment so that others will know.

Posted in General | Tagged | 3 Comments