Making MacVim open files in vertical splits

When coding, I like to use [MacVim](http://code.google.com/p/macvim/) with PeepCode’s little [PeepOpen app](http://peepcode.com/products/peepopen) as my auto-completing filename browser. It’s like TextMate’s Cmd-T “Go to file” functionality, and it’s awfully fast and convenient.

One problem I’ve had, however, is that MacVim’s preferences (as at snapshot 61)* only allow you to open files from other applications (in this case, PeepOpen) in the same window, a new tab, or in a horizontal split. Here’s how you set MacVim to open files in vertical splits — open a terminal, and enter:

defaults write org.vim.MacVim MMVerticalSplit YES

While I’m at it, here’s another useful one: [this link](http://webexpose.org/2008/10/13/open-macvim-tabs-from-command-line/comment-page-1/#comment-95424) shows you how to edit `mvim`, the command line script to open MacVim, so that it doesn’t open new windows when called multiple times from the command line.

\* There’s a [pull request](https://github.com/alloy/macvim/pull/29) to make MacVim’s “open files” preference a bit more sensible: in a new window, in the current window, in tabs, in horizontal splits or in vertical splits. Hopefully this makes it into future builds, because seriously, who the hell understands “open files and set the arglist” as “open in current buffer”?

Fixing Samba shares in Lion

My parents’ Mac mini is their media centre — it’s hooked up, via a ridiculously long ethernet cable, to a modded (classic) Xbox in the living room running a horrendously outdated early build of Xbox Media Centre (now [XBMC](http://xbmc.org)).

With my usual cautious upgrade habits, I updated the Mac mini to Lion the day after release. (What? It was _a whole day_!) It installed fine, but broke media sharing between that and the Xbox, as Apple had dropped Samba networking from Lion (should’ve read [this article](http://www.tuaw.com/2011/03/24/apple-to-drop-samba-networking-tools-from-lion/) earlier). For current XBMC users, this shouldn’t be a problem, as newer builds should be able to read NFS shares… but my super-old box is super-old and not conventionally upgradeable*. Thankfully, someone figured out how to fix it by reinstalling the samba3 package, and I’m just reposting the link here in case anyone needed to stumble across this solution.

(The media centre used to be a Linux desktop, until the fan broke and I got tired of fixing X11 problems every 3 weeks. A slight pity, though, that I can no longer tell people my parents use Linux.)

\* I vaguely recall that these builds weren’t legal, and I had to FTP into some secret server after jumping through a few hoops to find a username and password. Fun times. Also, nobody cares about the legality of modding the original Xbox any more, right? …right? Umm.

Ruined by antibiotics

I’ve been having a cough. It’s one of those super annoying ones where you lie down and are ready to go to sleep, and then your throat relaxes and you proceed to cough your brains out.

So I went to see the doctor, and picked up this set of antibiotics that I’m supposed to take before meals.

Medicine bah

But wait! Not _just_ before meals — that would be too simple — _half an hour_ before meals.

This, naturally, drives me insane:

* I mean, what am I supposed to do if I forget, and eat first? Do I stop eating, take the medicine, and wait half an hour looking sadly at my food going cold?
* What if I don’t wait a full half hour before having my meal — does that render the medicine ineffective?
* Or, if I tried to plan it out, what if I take the medicine, _expecting_ to have food in half an hour, but then I _fail to procure anything edible_? Can I snack on something, does that even count? But it’s not a meal, and the instructions say “before meals”!
* Also, when does the half hour countdown start? From when the pill enters my throat? But I have to take _two_ — do I start timing from the first or second? Should I take both at the same time? What if they don’t reach my stomach at the sae time? Wait, that’s right, what if the timing’s not from the point of swallowing, and that’s just an estimate for when it reaches the stomach? WHAT IF MY OESOPHAGUS IS ABNORMALLY LONG??!

My life is now an endless tormented guessing game. Thanks a lot, doctor.

Drawing: Meow

Drew our cat for some wedding collaterals:

Meow

Although to be more realistic, I would’ve made the “MEOW” 40 times his size. To see more of the cat, go to my [repurposed cat photo Tumblr](http://yjsoon.tumblr.com).

Learning programming: the deep end of the pool

Computer Science Prof Zack Kurmas writes about the challenge of teaching introductory programming:

> I believe that expecting a student to learn to program well enough to study Computer Science in a single 15-week course is almost as absurd as expecting a student with no instrumental musical experience to be ready to join the university orchestra after 15 weeks. There are, of course, musical prodigies that can handle this challenge. Likewise, there are many “natural born programmers” who learn how to program with very little apparent effort.

Kurmas makes some very good points: that almost every other college programme has some basis of preparation in a standard high school curriculum, hence creating a much steeper learning curve for CS; that CS education could be better modelled after a foreign language learning framework; and finally, that he might just not be very well-suited to teaching intro CS, as a “natural-born” programmer.

This post was linked from Steve Losh’s [response](http://stevelosh.com/blog/2011/05/on-learning-and-teaching/), which is also a good read for CS students and educators. Losh provides an interesting analogy about the difficulty of learning programming and dancing:

> The first plateau of programming is the syntax and the first plateau of dancing is footwork. The bad part about this is that dancing when you only know footwork or programming when you only know syntax isn’t much fun. You can’t do all of the most interesting things that make these skills so rewarding.

LOLMAO

You might have already seen this, since [mrbrown](http://mrbrown.com) linked to it on Twitter. Posting on the blog for posterity anyway:

Lolcat9dce5677436502d890d6d7281964d0c7b8ffcb58

It’s been a lifelong* ambition of mine to get a [LOLcat](http://icanhascheezburger.com) picture published**, but this will have to do for now.

\* _Mild_ exaggeration.

\** This may or may not have influenced how much I supported Joey when she adopted our ridiculous cat. Shh, don’t tell her.

DFLL now integrates with Twitter Tools

…or, another edition of “OMG SHUT UP WHO CARES ABOUT YOUR STUPID PLUGIN!!!!1”.

Anyway, I’ve updated the [DF Linked List WordPress plugin](http://yjsoon.com/dfll-plugin) again:

* Fixed RSS feed validation. Many thanks to [Michael Camilleri](http://inqk.net) for pointing this out and pushing a fix! Getting to discover blogs like [his](http://inqk.net/weblog) is one of those happy unintended results of having written this plugin.
* Added [Twitter Tools](http://crowdfavorite.com/wordpress/plugins/twitter-tools/) integration. Now you can add a glyph in front of tweets that link to non-linked-list posts, just like how Gruber does it for the [DF Twitter account](http://twitter.com/daringfireball). In addition, you can also add a glyph or text (e.g. “Link:”) in front of linked list item tweets. Thanks to [Ben Brooks](http://brooksreview.net) for the suggestion on this one.

Escalating enrolment in Computer Science

Prof Eric Roberts on how the intro CS courses at Stanford have surpassed even pre-tech bubble numbers. He notes that the students coming in seem different this time round:

> The students who are now inflating the ranks of CS106A are, it seems, deciding to take a computer science course as a way of bolstering their credentials before they emerge into a weak economy. Most have majors in other areas but recognize, probably correctly, that having programming skills will likely increase their chances of gaining employment in their own field. A surprising number of those students, however, once they get into our introductory courses fall completely in love with the material and continue on to double the size of the downstream courses in the curriculum.

I didn’t take many CS courses back in the day, but I have great memories of being part of the CS106 course assistant team. After having planned and taught my own intro programming curricula, I’m now even more impressed by how effective CS106 was, with its engaging assignments, well-planned structure and overall strong pedagogy. I’m glad more students are giving this course, and computer science, a shot.

The courses are available [online](http://see.stanford.edu/see/courses.aspx) for free, if anyone’s curious.