February 26, 2012

Google Reader for Android is awful

I basically stopped consuming RSS on my Android phone because it is so bad. If you click anything, it does some kind of reload, so what you see immediately is what the folder/feed looked like last time you updated. You click on a folder with 34 new items and what it takes you to is a the list of feeds in that folder, with probably one or two new items, and then after a few seconds it updates. This makes me sad. Even if it is trying not to go too hard on my data connection, it's taking it too far. I want responsiveness. Even on wireless the wait time is way too much.

I have another problem. This one is a little more subjective. When I click mark all as read, I want my RSS reader to jump back out to the level above whatever I just marked as read. If I mark a feed as read, I want to jump out to the folder/tag containing that feed. If I mark a whole tag full of posts as read, I want to be back out to the root level. I don't want to have to hit back twice or three times to get there (and then wait for the refresh). If I hit mark as read, I'm done with whatever I'm reading. I'm ready to go on to something else. Why else would I have hit the button? Maybe other people have some strange workflow where they mark as read and then read things, but those people are doing it wrong. If I remember correctly, Reeder on iOS does this the way I like.

Anyways, rant over.

February 25, 2012

Down with CommandT! Long live CtrlP!

I received a tip from my friend John Hawthorn. I tossed out CommandT yesterday, and swapped in ctrlp.vim. CtrlP has a couple of features that make it a better solution than CommandT. First, it is written in pure VimScript. I was working on remote Linux machines at the University of Victoria, and the Vim package they use is compiled with Ruby, among other things, making it impossible to use CommadT. I did compile Vim myself on the machine to get the other missing features, but the box didn’t even have the Ruby headers on it, so it was too much work just for that feature. With CtrlP, I no longer have to worry about that.

CtrlP is also extensible. I’ve already thought of a few ideas for extensions, and maybe I’ll take a couple hours one of these days and implement them. In the meantime, I’ve mapped CtrlP to my fav binding, and added some quick Rails bindings to my vimrc.

"""ctrlp.vim"""
let g:ctrlp_working_path_mode = 0
nmap <leader><leader> :CtrlP<cr>
"RoR CtrlP stuff
nmap <leader>ec :CtrlP app/controllers<cr>
nmap <leader>ea :CtrlP app<cr>
nmap <leader>em :CtrlP app/models<cr>
nmap <leader>ev :CtrlP app/views<cr>

Note: I do this so all my file opening techniques start with the same keystrokes:

nmap <leader>ee :e

February 21, 2012

Textmate's niceties in Vim

Textmate is a pretty well designed editor, but it lacks some features that I consider necessary in a programming text-editor. That said, it comes stock with some things that my favourite text-editor, Vim, lacks.

Command-T (familiar for serious Textmate users, I’m sure) is a huge time saver. It allows me to get to the files I’m looking for so much faster than being forced to do

:e typity<tab>type<tab><tab><tab>type<tab><cr>

or the equivalent :b command. Suddently I’m just typing a few characters from each path element and hitting enter as soon as I see what I want. It removes scanning for the file I’m looking for (with my eyes) which is actually pretty slow. As soon as there is only one thing in the list I know I can stop typing. I’ve even done this:

:nmap <leader><leader> :CommandTFlush<cr>:CommandT<cr>

With that in my .vimrc I can double tap my leader and type some gibberish and get the file I’m looking for.

The other plugin I just started using today is snipMate. SnipMate provides the snippet functionality that TextMate has to Vim. It is pretty handy, not having to type all that boilerplate code.

Here’s a low quality, no sound, screencast showing what it does:

The moral of the story?

Real nerds do it in Vim.

Now that isn’t quite as sexy sounding as I’d hoped it would be, but Vim is worth learning. I swear it’s true. Give it time. The other day, I refactored some RSpec tests someone had (poorly) written with a couple of macros in less than 30 seconds, where without the macros it would have taken me 25 seconds times the number of tests (which was a lot).

I save so much time with Vim (and spend that time writing blog posts like this).

February 16, 2012

I picked up jarednorman.ca

Every good variant of my name with the .com extension is already taken, so .ca it is. I guess I'll move this blog over to that site and throw up some kind of professional page. Hopefully, I'll have time to do that before reading break is over. I have plenty of studying to do and I'm currently getting all Rails 3.x updated. I admit it, I haven't touched Rails since shortly before 3 came out, so I'm trying to get all the changes into my brain and get refreshed on it in general.

February 15, 2012

Quick pasting from graphical environment into Vim

Anyone who has autoindent enabled in Vim has seen what it does if you just paste something into the terminal. You end up with something with completly incorrect indentations and commenting tends to get out of hand too. That's not something you're supposed to do. It turns out you can access your graphical environment's clipboard via the * register. I've done this:

    :nmap <leader>c "*p

Tada! Now I can paste into Vim easily without having to hit that awful to type key combination, with comma c (\ c by default).

My time as a Vim user

Excluding my brief attempt at learning MSVC++ when I was in elementary school (I sure wish I’d stuck with that) the bulk of my learning to program time was in the summer before grade 11. At the end of the previous school year, I had realized that I wanted to learn how to program, and specifically make games. That summer I learned C. The first real program I wrote was a pong-clone that matched my KDE theme (an awful purple theme that I can’t believe I ever used).

At the beginning I used gedit, kate, and a variety of other editors common on Linux. At some point very early on I tried Vim, went through the tutorial, decided that it was neat, but too hard to use. I didn’t come back to Vim until some time in grade 12.

Continue reading My time as a Vim user.

February 11, 2012

Keeping the APM up

It's Friday night, and I'm exactly where I want to be. I'm playing with Rails, and some associated frameworks that I've never played with before. I'm learning. I'm drinking some fantastic beer from Hoyne Brewing Company. I'm listening to some wicked tunes. My little brother just left, and he was here working on Project Euler problems to familiarize himself with Ruby (most of the coding he has done has been in either Java or Lua), and drinking beers. 

I like Starcraft 2. I'm a Gold league player, though in my last season before I went back to school I had a roughly 85% win ratio, so maybe I was ready for Platinum. I do the tap. I cycle through all my hotkeys, making sure that none of them need attention, repositioning the elements of my army. I watch the minimap. I'm not bad at the game, but I'm not nearly as good as some of my friends (or my brother). 

On the desktop, I use Arch Linux. I'm comfortable on any operating system, but I like the control I have on Linux. I one of those guys that uses a tiling window manager. Most of the time I'm just using it to keep the current window maxed with no borders. That's how I like to work, no distractions, just the task at hand and nothing else. 

Well, there's an overlap. Where in Starcraft 2 tapping the number keys selects the associated hotkeyed units and buildings, alt-1 through alt-9 switch between my virtual workspaces.

So when I'm waiting on something I do the tap. I hold alt and tap 1213121312131. This results in me swapping very rapidly switching between Chrome, and my working terminal, and some other random window.

My screen basically becomes a strobe light.

One day I'm going to give a observer of this a seizure.

February 9, 2012

Review: The Ruby Programming Language

Okay, so maybe I'm just filling this blog with content so that I don't have to think about my midterm tomorrow (I'm actually confident that I will do well, I swear), but hear me out on this one.

I just finished reading The Ruby Programming Language, from O'Reilly. It's written by David Flanagan & Matz, and is a significantly expanded version of Matz's Ruby in a Nutshell. I've done some amount of Ruby programming before: I've written test scripts using it, extending my ZSH using it, experimented with Ruby on Rails, and various other things. I once wrote a Ruby script that, at a single keystroke, would re-theme my desktop environment semi-randomly, using some preset metrics. I could just tap the keystroke until my theme matched my mood at the particular moment. Silly, but it was really easy to do using Ruby and its kitchen-sink standard library.
Continue reading Review: The Ruby Programming Language.

PeepCode

I just got a subscription to PeepCode. Between studying differential equations, combinatorics, operating system design, and processor design, I've somehow managed to watch a few of the videos start to finish.

PeepCode puts out high quality, well produced screencasts, primarily on web-development related topics, with some general software development topics mixed in too. You'll find casts on Ruby, Rails, CoffeeScript, Node.js, Git, Vim, Emacs, Capistrano, RSpec, and more. The really nice thing, is that while the casts are mostly about learning the basics of frameworks and tools, they also have more specific and advanced topics, for example, "XMPP/Jabber with Ruby." 

Continue reading PeepCode.

February 4, 2012

On being someone else

Up until about a year ago, I had an awful attitude. My attitude isn’t perfect now, but I’m working on it. When I graduated from high school, I had already completed a couple of University courses at the 1st and 2nd year level and had done well. I was basically given an auto-100% in Information Technology 11 and 12 at my high school. I thought I was better than everyone else.

Continue reading On being someone else.