Thursday, November 11, 2010

Using Spaced Repetition Software to Master Vim

I've been a vim user for about 20 years. During that time I've used IDEs and other text editors, but I've never found one to fit my needs better than vim does, and I always end up finding my way back to vim. As a developer's editor, it's really making inroads in the Ruby community, which I love because it means there are lots of great vim plugins being developed and improved right now, and my experience with vim is getting better all the time.

However, I've also found that I'm often aware that a particular command exists, but I don't remember it long enough to be able to use it when I need it. It's a pain to have to look up a command when what I really want to do is to write code. So, I've gotten to a set of core commands that I know, and when I get that particular itch, I take the time to look up a particular command, use it, and usually forget it sometime in the next 24-48 hours. It turns out that when you learn something, if you fail to reinforce or exercise that knowledge you will inevitably forget it. When was the last time you tried to remember a list of capitol cities that you memorized in grade school? You use it, or you lose it.

Spaced Repetition Software

Spaced Repetition Software, SRS for short, is software that keeps track of how long it takes for you to forget something, whether it's vocabulary in a foreign language, state capitols, or other facts, and refreshes your memory at just the right time to keep you from forgetting. I first learned of SRS through Piotr Wozniak's SuperMemo (which is about incremental reading as much as it is about SRS), but there are many flashcard-only systems out there that will drill you on things you want to remember.

I asked on Twitter if anyone knew about flashcards for vim and didn't get much response. I think the very notion of SRS is new to people (it was new to me), so there's not much activity in this area. Still, I started to think that this could be an excellent solution to my problem of learning new vim commands: If I could simply memorize a bunch of commands, those commands would be ready at my beck and call when I was writing code. It was time for an experiment.

Enter Anki

I checked out a few different SRS systems before settling on Anki , which is free and open source, and available on Mac, Windows, Linux, and Android. There is also an iPhone version that will set you back $25, and an open source program called Mnemosyne that does SRS.

Vim Commands Stack

So, the Vim Commands flashcard stack was born. I started adding commands that I wanted to learn, guided by quick reference cards, vim's own excellent help system, and my own vague notion that "there's a command for that, if only I could remember what it is…"

I started spending just a few minutes a day memorizing and reviewing commands, and collecting more commands, until I had a pretty decent collection. The experiment started bearing fruit almost immediately. I was able to remember some of the more obscure cursor movements, search commands, advanced undo commands, and so on. Before long I was giving my co-workers tips on advanced commands that would help them out.

Today the stack has 241 commands, many of which I knew existed but never could remember when it was time to use them. I regularly pause to remember a command and it comes to me quickly. Some of these commands have already become part of my muscle memory, and it feels like many more are on their way.

Github Project

I've exported the stack from Anki and am keeping it in a text format that is easy to edit and re-import to Anki. I've reordered the facts in the deck to start with Basic commands, progress through Beginner commands, to Intermediate and Advanced commands. The Github project is called vim_flashcards and the all_cards.txt file is suitable for import directly into Anki.

Currently the cards are all stored in a flat file, but I'm thinking about creating a Ruby gem for managing SRS flashcard stacks and exporting them to multiple systems. Please contact me if you are interested in helping out with this effort.

Getting Started With Anki

You can begin by downloading Anki and installing it. Once it starts up, click on the "Download" button and search for "Vim Commands". Alternatively, clone the github repository and import the cards into Anki from the all_cards.txt file.

When you open the deck, be sure to tune the goals to your liking. For beginners, I would recommend no more than 5 new commands per day; expert users might want to stick with 20 or even set the value higher. Remember, if you're trying too hard, you might fatigue out.

Conclusion

My vim flashcard experiment is still in its early stages. I'm still adding new commands on a regular basis, and still trying to organize the stack so that it is presented in an order of increasing difficulty, with the easiest and most useful commands at the beginning, and the harder and more esoteric commands at the end. It will be interesting to see how relevant the stack is to me in the long term: will it be necessary to keep commands in mind, or will I use all of them regularly enough that refreshing them with Anki becomes redundant?

I invite you to participate in the experiment and provide feedback. If you use the vim deck, let me know if you find it helpful, whether you're brand new to vim or an old hand. Actually, if you're brand new to vim, I recommend that you first go through vimtutor (type "vimtutor" at the command line and start reading) before trying out the Anki deck.

If you use a different text editor, like emacs or TextMate, you might want to create your own flashcard stack to help you remember all the commands for your editor.

Happy editing!

Tuesday, October 19, 2010

Where is all the Linux Shareware?

I'm back on Linux. No, really. After about 8 years of OS X, I've made the move back to Linux. Ubuntu, to be specific. Don't get me wrong — it's not that I have something against OS X. It's Apple and Apple Fandom I don't like (and the fact that Steve Jobs has recently taken over as the Evil Sith Lord).

It's only been a few days, but so far I'm really liking Ubuntu. It installed pretty easily on my '07 MacBook Pro, and although the trackpad is a little spotty, I can live with it. I'm even ok with the minor glitches in the video display and other little bugs I can work around. It's all cool, and frankly, it's a heck of a lot better than Linux was 8 years ago.

So what do I do when I come back to this somewhat edgy environment? I start looking for shareware. You know, handy programs written by independent developers that you can try out for a time before deciding to pay for it. There's plenty of it for Windows, and there's plenty of it for OS X as well. In fact, I'm especially impressed with the quality of software available from independent developers for OS X. It turns out there's not much software that you can actually pay for, if you have a Linux desktop machine.

I know, you're thinking this Alf guy is pretty crazy, wanting to pay for Linux software when Linux is all about Free-As-In-Speech. But guess what? There's no money in Free. Oh, but you already knew that.

Open Source software is wonderful. I make my living as a software developer using (and sometimes releasing) Open Source Free-As-In-Speech software. I believe standards should be Free. But I'm also practical, and my time is very limited. Creating something that's fun and scratches an Itch is really important, and I do that when I can. And I release it free of charge. And yet, I want to pay other developers for software. Why?

Well, here's the rub: Creating something that mostly works is fun, even if it's kind of buggy for cases that I don't care about too much. Creating something that's flawless, and works smoothly for a broad class of users takes real work. And at the end of the day, software developers only get paid for doing real work. Sometimes I need software that's more or less flawless, and it's hard to find that kind of software for Linux.

This week I read an article about how Linux on the desktop is dead. I know it's not really true, but if Linux is going to ever really thrive on the desktop, it's not going to happen on Free software alone. So take a few moments to seek out useful Linux software that's useful and NOT free, and spend a few bucks (or euros or pounds) in support of an independent software developer.

In the end, we'll all benefit if you do.

Monday, August 9, 2010

U.S. Go Congress 2010 Report

At the beginning of August, I attended my first U.S. Go Congress. After a few years of telling people that "I'd like to go" and "I can never quite seem to make it happen", I realized that I simply wasn't trying hard enough. So, I did what I needed to do to make it to the Go Congress this year.

Background

If you don't know what Go is, check out the American Go Association's description of Go. I also highly recommend The Interactive Way to Go, which will teach you about the rules and basics of the game, and give you simple puzzles to test yourself.

This year the 28th annual U.S. Go Congress was held in Colorado Springs. The Congress is a week-long convention where people from all over the United States (and in some cases other nearby countries like Canada or Mexico) come together to play, talk about, and study Go. Professional players come from all over the United States, as well as Japan, China, and Korea, to teach and to play.

Eight Days of Go, not Nine

Back when I got my plane tickets for the Congress, I made a rookie mistake: I scheduled myself to fly back home on Sunday night, figuring I wouldn't miss anything that way. Well, it turns out that after the banquet and awards ceremony on Saturday night, there's basically nothing else to do. People fly out the same night, or the next morning. When I mentioned this to people at the Congress, I found this is actually a fairly common mistake. This year's Congress went from Saturday, July 31st, through Saturday, August 7th.

The Main Event: The U.S. Open

The main event at the U.S. Go Congress is the U.S. Open. This week-long tournament runs from Sunday through Saturday, and consists of six games with a day off on Wednesday. The time limit is one and a half hours per side (2 hours per side in the upper dan divisions), with 5 30-second byo yomi periods. That's twice the typical time limit in a Go tournament! I wasn't sure if I could handle the longer game, but I actually used up all of my time in the first two games of the tournament, and hardly noticed that the time limit was so much longer.

Professional Game Reviews

In the afternoons, there are a lot of opportunities to attend scheduled game review sessions, where professional players would go over your game with you and help you to understand how to improve your game. I found this extremely helpful, and sometimes when a professional would point out the best move, it turned out to be the next move I played. Other times, the response would be "I played that later". In fact, it seemed to become kind of a running joke, with players admitting "I played that later" as opposed to as the next move in the game. Still, it's good to feel that we were finding the right moves, even if the timing wasn't perfect.

I attended game reviews by Jennie Shen, Mingjiu Jiang, and Xuefen Lin. In fact, I was lucky enough to attend a review by Xuefen Lin with only one other person, and it turned into something more like a private lesson, a game review where we had enough time to go over the entire games and lots of variations. She also shared a favorite tesuji from a recent professional game that she had studied. It was really a rare opportunity to get to know a professional player a little bit better.

Other Tournaments

There are a number of other tournaments that take place at the Congress, including 9x9 and 13x13 tournaments, the Die Hard Tournament (a 1-day tournament that takes place on the day off from the U.S. Open), the Redmond Cup (a youth tournament named for Michael Redmond, the only non-Asian in history to achieve the professional rank of 9 dan), and the Ing Masters Tournament (attended both by professionals and strong amateur players).

The Lectures

I attended lectures by several professionals, including Ryo Maeda, whose series of lectures has been very popular among kyu players for the last 10 years, Yilun Yang, and Mingjiu Jiang. I walked away from all of the lectures with valuable lessons about how to approach my game, and in my recent games I'm still applying the principles I learned.

Other Events

There are other presentations at the Congress that gave me a chance to learn about events going on in the world of Go. This is another area where the Congress materials could be a little bit clearer! Before the Congress, I was wondering if there was room to do discussions about community projects, but it was hard to find anything about this on the Congress site. There were presentations from GoGoD, GoClubsOnline, and there was one scheduled for IgoLocal.net, but unfortunately Chuck Thomas couldn't make it to the Congress. If you're not familiar with IgoLocal.net, it's basically the same service as the PromoteGo.org project that I've been working on, on and off, for the last couple of years. I'll talk a little more about that in a future post.

Next Year

I had a great time at the U.S. Go Congress this year! It definitely made me a stronger player, and it really inspired me to work on my game again. I also met some great people in the U.S. Go community, and made some new friends. I really wish I had gone to some of the previous Congresses now.

Next year's U.S. Go Congress will be taking place in Santa Barbara! Santa Barbara is one of my favorite vacation spots. Hopefully this beautiful city will inspire a lot of Go players to come, and to bring their families. We need lots of volunteers, from Saturday-only registration volunteers (which doesn't interfere with the Congress at all...there's not much that happens on Saturday) to Treasurer and Tournament Director positions, which require a much larger commitment. If you're interested, please see the list of available U.S. Go Congress Volunteer Positions.

Monday, May 31, 2010

Bilski, Software Patents, and Patent Reform

In the last month, I've been hearing more about software patents. I've always thought software patents were stupid since I first discovered that someone had managed to get a patent on "backing store", the notion that windowing systems could save a copy of the pixels that have been obscured by a graphical window in order to display them back more quickly once the window was moved away again. Anyway, it turns out that the Supreme Court is about to rule on In re Bernard L. Bilski and Rand A. Warsaw, which stands to be a landmark ruling of the SCOTUS. The patent claim has been rejected by the court of appeals, and it's expected that sometime in the month of June, the Supreme Court will rule on the Bilski patent application.

It's largely expected that the Supreme Court will uphold the decision of the lower court, and it's possible that the Supreme Court will decide that business methods cannot be patented. Since business methods are very similar to software algorithms, it seems possible that the Court will decide that software is also not patentable, but however hopeful I am that this may happen, that seems unlikely.

So, I'm continuing my self-education about software patents. It seems that there is plenty of innovation in software, and that patents are not necessary to promote innovation. The software industry moves so fast that even a 1-year head start can be a huge boon for a company, so maybe that's a reform to consider: reduce the patent lifetime for a software patent down to 1 year. That would be a step in the right direction!

For a great summary of how software patents got to the state they're in today, watch the Patent Absurdity video. There's also a lot going on over at End Software Patents, and I also found out where you can donate to the FSF's Fund to End Software Patents. Are you involved in software patent reform? Have some good resources? Post them here!

Sunday, April 25, 2010

Keeping up with all those habits

At the beginning of the year, I announced on this blog that I would average a blog entry per month, and two Facebook updates per week. The idea is that there are a lot of things that I would like to be in the habit of doing regularly, and starting a new habit for a new year has worked well for me in the past.

I'm happy to say that I'm doing reasonably well with those two habits, but thinking about those habits and all the other things I'd like to be doing regularly got me to thinking: Wouldn't it be great to have a tool to help track all those habits? So, being a web developer, I started writing exactly such a tool. It's helped to remind me when I'm overdue for updating this blog, and when it's time to take the dog for a walk, when it's time to check the oil in the car, do the bills, take out the trash, etc. I even have a habit set up to remind me when it's time to work on the app itself!

Well, it's very much a work in progress. There's not yet a way to keep track of accounts, so at the moment it's only good for one user, but I plan on adding user accounts soon. Let me know if you're interested in beta testing it!

Saturday, March 6, 2010

Life with Nexus One, part II

I still love my Nexus One! I just wanted to comment on a couple of things:

  1. Battery life
  2. Swype beta
  3. QR Codes

Battery life

Regarding battery life...I was at a LARubyConf a couple of weeks ago, and my battery drained like crazy all day both days, even though I wasn't really using it all that much. My theory? 3G signals were weak but present, so the phone was constantly trying to connect to a 3G network. Solution? Turn off 3G, problem solved!

Seriously, do we really need 3G anyway? I mean, it's nice to have faster networking, but that's why God invented WiFi, right? I'd much rather have WiFi than some proprietary cell network.

Swype beta

I joined the Swype beta this morning. So far I haven't used it much, but it really is a lot faster than typing on a touch keyboard. You basically just drag your finger from letter to letter and the predictive text system does the rest. Check out this smackdown video and prepare to be impressed!

QR Codes

I really love the QR codes that often go along with reviews of Android apps. It's so easy to just scan the QR code off the screen and go right to the download for the app. It's really sweet.

Saturday, February 6, 2010

Life with the Nexus One, part I

I bought a Nexus One directly from Google for full price, the week after it came out. I had been waiting for an Android phone for most of 2009, and the Nexus One looked like the phone for me.

A phone that doesn't suck too much

My primary goal for getting an Android phone was to find a phone that doesn't suck significantly more than the iPhone. I mean, let's face it: walled gardens suck. Also, you can't use it on any network besides AT&T without jailbreaking your phone. The way I see it, smart phones are computers, plain and simple. I wouldn't dream of buying a computer that wouldn't let me run whatever I want to run on it.

So the iPhone sucks, but then so do most Android phones. Look at how ugly and clunky the G1 and MyTouch are. And the screens are so small. And don't forget, you have to buy them from T-Mobile!

The Nexus One is the first of the current generation of smart phones that you can buy without a contract. It's an open platform. And nobody is trying to tell me what I can or can't run on it. The touchscreen is actually the same size as the iPhone, and the touch buttons directly beneath the touch screen give you some good contextual actions that you can take, so most apps are able to make better use of the screen real estate than the iPhone allows.

Don't get me wrong, the Nexus One still sucks. The battery life isn't what I would want. There's also a slight design flaw with the location of the speaker pointing towards the back of the phone. In loud environments, I find myself wanting to point the screen away from me so I can hear the speaker. Pretty annoying.

The Camera

The Nexus One comes with a 5 megapixel camera. I've had trouble sometimes with the automatic white balance making pictures more yellow than they should be, but overall it takes really great pictures, and the autofocus lets it take really close pictures, really sharp.

Autofocus combined with the 5MP camera leads to really fast decoding of bar codes and QR codes.

The Apps

As a Go enthusiast, I'm a little bit disappointed by the number of Go applications on the Android market. I haven't yet found a great app for recording Go games, although an open source app called "gobandroid" appears to be making some really great progress.

There are tons of both free and for-pay apps in the Android Market. I don't see any shortage of applications really.

Battery Life

The battery doesn't seem to last as long as the battery in my iPhone 3G did. I'm not sure what the reason for this is, but it could be due to a number of factors, not least of which is the fact that I'm always messing around with the phone. Background processing may account for some of that, but I don't really know.

Email

One of the things I really hated about the iPhone is the fact that it took me so many steps to check email:

  1. Unlock the phone
  2. Run the "Mail" app
  3. Select the correct email account
  4. Select the inbox
  5. Wait for the client to connect to the mail server
On my Nexus One, there's only one step, thanks to background processing and a helpful status bar:
  1. Press the "standby" button
  2. There is no step 2

The Verdict Thus Far

So far, I really love my Nexus one. I'm still discovering new apps and new things about the phone, but I really use it a lot more than I ever used my iPhone.