Vim adventures

An interactive web game to help you become familiar with Vim commands. Very nicely done!

I found it a little frustrating to get through because I know the basics, but the player is made to “unlock” commands such as w and b. Worse, the first “maze” you navigate with hjkl encourages you to mash those buttons (can’t put a number in front to repeat commands). That said, though, very fun and great production values. “YIPPEE”, as they say.

C’est la Z: Anyone can cook

Mike Zamansky on the recent spate of online programming education offerings, specifically the more “vocational” ones such as Codecademy:

‘The premise seems to be that anyone can code and that everyone should code. I’ve been thinking about this for a while and I keep coming back to the question, “what’s the endgame?”‘

This post articulates the fear I’ve been having about trying to make programming more accessible to everyone: to what end? For users, is there any value in this knowledge? (Conversely, though, what’s the value in learning basic science and humanities for “users”, i.e. people existing in the physical world and society?)

An argument for teaching Computer Science over basic Math

An interesting argument: that calculating devices are now ubiquitous, and math should focus on computational problem-solving instead of drilling and memorisation. An example the author cites:

Computer languages allow students to transform ideas into action. Here is a simple rule that a math teacher might describe to her students:
If the number is greater than 9, carry the 10’s place; otherwise add the number to the bottom row.

The solution for this can be expressed as an if/else statement:

if number > 9:
carry += number / 10
bottom += number

There are, as expected, plenty of opposing views in the comments, but it’s good food for thought. Also noteworthy: the comments aren’t completely stupid. Not-completely-stupid comments! On the Internet! WHAT IS THIS WORLD WE’RE LIVING IN

Nobody Wants to Learn How to Program

From the blog behind the “Invent Your Own Computer Games with Python” book:

“[For] the casually interested or schoolchildren with several activities competing for their attention, programming concepts like variables and loops and data types aren’t interesting in themselves. They don’t want to learn how to program just for the sake of programming. They don’t want to learn about algorithm complexity or implicit casting. They want to make Super Mario or Twitter or Angry Birds.”

We’ve actually found that our students are usually quite happy to spend lots of time making silly console-output programs, like printing a pyramid of asterisks. However, the intro programming courses we’ve conducted have been for a fairly self-selected bunch.

The book is available online for free, and it certainly looks like a great instructional resource.

Re-enabling J/K keyboard navigation on Google search

Google runs a series of Experimental Search trials which any user can join — “new features aimed at improving the search experience”. A short while ago, they had one called “keyboard navigation”, which allowed users to navigate results using the keys J (down), K (up), and O (open). I loved this to bits, and used it all the time… until it went away, replaced by an enhanced “accessibility” feature which makes search results look hideous:

Omg ugly  Google Search

So I went and tried DuckDuckGo as my primary search engine for a while. It looks great, is highly customisable, and has my beloved keyboard shortcuts… but I can’t quite get behind it because: (a) it’s a bit slow, especially compared to Google, (b) there isn’t native Safari support for it (I have to go through a GlimmerBlocker script), and (c) I just can’t shake the feeling that Google’s search results might be better, so I end up switching to another browser and checking on Google, just in case. This, naturally, was a recipe for madness, so I started looking into how to get back my beloved keyboard shortcuts in Google.

Thankfully, I wasn’t alone in my tribulations: the Google Experimental Search forum had quite a few others sharing my pain of having to use their mice while searching. One thread led me to this post on a blog called “Not Quite Zero”, where the author found Google’s original JavaScript for keyboard shortcuts, and re-injected it into the webpage using a user script, hence re-enabling the plugin. Yesss!

If you’re on Firefox or Chrome, the script linked in that post is all you need, but I did edit it to fix a couple of things for myself:

  • Re-aligned the search arrow to get it in line with the searched item; and
  • Packaged it as a Safari extension.

Here are my new versions. Once again, all credit goes to the original author; all I did were some minor styling fixes and packaging. MIT/X licensed.

Important: For these to work, you do need to disable Google Instant, first at Google’s search preferences and, if you’re using Chrome, in its browser preferences. Otherwise, Instant’s search bar will grab focus when the page loads.

Note that Google’s original extension JavaScript is still hosted on their servers, so if they remove it, these extensions will do nothing! Let me know if that happens, and I’ll fix it ASAP. (As I was finishing this post, the author replied to say he put up his extensions on Github — might want to take a look there instead, if you’re interested in the original JS version. I’ll probably fork it with the styling changes.)

Update, July 2012: I’ve updated the extension for Safari 6. The above download links should point to the new version, but this link explains the differences.