Timeboxing as a Way of Making Steady Progress

We’re all overloaded. We’re all short on time. Too much to do, too little time.

This seems to be a common complaint in today’s information age. Information workers are paid to innovate and produce new things, which means long hours at work, brainstorming and working. In turn, this often requires that they invest in their professional growth/ skill development in their personal time. Some (like me) invest in themselves anyway, because that’s one of the better things one could do with their time and energy. On top of that, self care and self nurturing (exercising, eating healthy, sleeping well) are very much required because without a fully functioning body and mind, it would be impossible to make any substantial progress or impact in any area. Then, there’s household stuff to do – cooking, laundry, cleaning, errands, etc. etc. Oh, and maybe you want to enjoy that show on Netflix with an occasional snifter on cold rainy days?

And I haven’t even talked about those of us with a family to take care of.

So how do we ensure that we make consistent progress in all the areas that we want to make progress in? How do we make sure that we don’t fall behind in anything? How can we make it so everything keeps running smoothly, in a balanced way? How do we play an equally good role in all the roles we have to play in life?

There’s a lot of articles written about busy professionals taking care of career, health, and family at the same time. For example, this one right here talks about outsourcing certain areas of your life, prioritizing what’s important, making self care non-negotiable, reducing watching TV, spending minimal time in the kitchen, etc.

The Organized Mind talks about something called ‘active sorting’ – which is a daily exercise in prioritizing and re-prioritizing what’s important. David Allen’s Getting Things Done basically advocates the same idea – write everything down, prioritize, categorize, simplify, identify atomic items, and then divide and conquer (along with a lot of other good advice). The other extreme is the concept of ‘essentialism’, demonstrated in this wonderful book, which says take on little but do a good job at it.

I agree with all those ‘productivity hacks’, but would like to emphasize a certain productivity technique here. This isn’t my invention – it’s stuff that I’ve picked up from here and there – a certain snippet read from a book, a certain paragraph read somewhere on a blog, a little bit of introspection, and a smattering of experience have culminated in the following advice.

The one important productivity hack that I want to talk about is time-boxing. It’s an indispensable technique for anybody who wants to do a bunch of things every day. The closest analog to this is the Pomodoro technique. The idea is to use some kind of a timer (on your smart device or using a Website on the computer) to block periods of time (called ‘power hours’ in Getting Results the Agile Way) and give your undivided attention to the task at hand for that period of time, eliminating all distractions.

Without such a structured time-boxed approach to incrementally tackling all tasks on your list every day, you run two risks. The first possibility is that you only spend only a few minutes on the task, because your brain is overloaded and distracted by everything else you have to do. This leads to essentially no progress on the task at hand, because you spend the few minutes just ‘warming up’ to where you left the task off last time. The other possibility is that you end up losing yourself in the task, and spend so much time that you have none left over for all the other items on your list. Time-boxing saves you from both of these potential errors. You can fully concentrate on the task at hand because you know you’re not spending either too little or too much time on the task, and that the timer will sound to announce the end of your session. And somehow psychologically, this technique also tends to make you work faster because you want to get done before the timer sounds.

Have a productive day!

Advertisements

An important difference between different genres of books

Last year, I read more books cover-to-cover than I ever did before. This year, my goal is to read even more than before, and I’ve signed up for a reading challenge pledging 80 books in 2015. I’m making good progress so far. I’m at a phase where I want to consume as much information as possible, and synthesize valuable content out of it. In my pursuit of bettering myself professionally and intellectually, I’ve therefore really been doubling down on reading books, and I’ve been utilizing DRM-free PDF books (technical books, in particular related to programming/ computers, purchased from sites such as OReilly, Manning, and the Pragmatic Bookshelf), books purchased through Apple (iBooks on the iPad), and Kindle books, apart from old fashioned printed books. Most of the books I’ve been trying to read are technical books related to my profession, but many are also the latest bestsellers in non-fiction, biographies and memoirs, and occasionally novels – anything that happens to catch my attention when I’m on a book-buying spree (or whatever the ‘algorithm’ recommends).

Out of all this, I’ve noticed a trend. It seems to me that while there is a lot of technical detail in books on programming, and while there are a lot of plot twists in most novels, and while there’s a lot to the story of an individual in a biography/ autobiography/ memoir, when it comes to nonfiction books, for instance those on psychology or business, it seems to me that it’s possible to summarize the entire content from those books in ten minutes or so. Not that these books in the latter category are less voluminous than their technical/ fictional/ biographical counterparts. On the contrary, these books tend to be filled with studies, research, anecdotes, and such. Yet somehow it seems that the anecdotes don’t really add to the meat of the topic, and are dispensable in a way. Only the principal claims need to be remembered/ noted for posterity. Given this observation, and given that my objective is to maximize learning new things and not necessarily reading as many pages as possible, is it really worth investing time in the nonfiction/ business/ psychology genre at all?

For me, I think at least for the time being, going forward my focus is going to be almost exclusively on technical/ professional books. My bias might be influenced by the fact that gaining as much expertise as possible in the profession of software development/ production of technical artifacts is the most beneficial to my career in the future, as opposed to learning all the nuances of every research ever conducted to corroborate a claim in the realm of human psychology or the world of business. Yet I can’t shake off the feeling that it’s difficult to summarize content from a certain kind of books versus content from another kind of books, because in certain areas, the details are important, and in other areas, while the details might be used to support claims, they are not as important as the principal claims and might easily be forgotten with impunity.

Happy reading!

My first foray into Google Go, and a URL shortener

I’ve been interested in Google’s Go for a while now. It feels like one of those new languages that are very promising and are here to stay. Certain developers I look up to in the community have also been talking about how Go is great for concurrency and a great language to work with in general.

So far I’m only done with An Introduction to Programming in Go (a short, free, online book), and halfway through Go by Example, but it was enough for me to start creating toy programs of my own. There’s a lot more to read and learn in Go – but I recommend both of the above resources as quick getting started guides for intermediate programmers.

I’ve also been interested in expanding my horizons a bit more than the day to day of my day job, so I was wanting to explore a new algorithm, say, e.g. a URL shortening algorithm. I found a good explanation on StackOverflow, so I decided to give it a go.

Here is the result. It’s a very primitive piece, to be sure, and it can be improved in a gazillion ways. I’ll be sure to check back as I learn more Go and more effective Go, and will be adding to both the functionality and cleanliness of the code. For now, I’ve crafted some functions at best, that try to create maps between digits and letters, and do some division and string concatenation, and that’s pretty much it for now. Maybe there’s a lot better way of creating the alphabet map than the way I’m doing it. But it does seem to get the job done for a given alphabet.

Finally, I’d like to say that I’ve really been liking Go so far. It feels like a cleaner C. It has some aspects of more modern programming languages too, e.g. interfaces. But it has no classes, only structs. It also seems to be a simpler language, e.g. it doesn’t confuse you with three to four different ways of constructing loops – there’s only for, nothing else. I like the panic and defer mechanisms, and I also like goroutines and channels. I’m not the most experienced person when it comes to concurrency, but so far it has been a pretty smooth ride for me, with no surprises (well, only pleasant ones). Go is also more powerful than a lot of other languages out there in terms of memory management – it combines the best of two worlds – it has garbage collection, but it also provides you pointers. A great language overall, I must say.

I’d just use Vim for everything whenever possible. Most of my Go adventures have also been in Vim – there are some plugins out there that make it easier for you to import stuff, but I haven’t tried any plugins so far apart from color coding. I’ve had a brief stint with the LiteIDE – it’s not bad – it does a fantastic job of performing Intellisense of sorts, but the visuals are not the greatest (I believe it’s Qt-based), nor the shortcuts or text-editing shortcuts impressive. I’d use it if I must, but I can stick with Vim otherwise.

I have a feeling that there’s going to be more to come from me in GoLang. Here’s something funny to keep the spirit up 🙂

Books Read in 2014 etc.: A Retrospective

Since it’s very fashionable these days, here’s a list of some of the best books I read in 2014.

Technology

1. Paul Gries, Jennifer Campbell, Jason Montojo; Practical Programming, The Pragmatic Bookshelf

2. Tim Ottinger, Use Vim Like a Pro, LeanPub

3. Josh Carter, New Programmer’s Survival Manual, The Pragmatic Bookshelf

4. Kent Beck, Test Driven Development by Example, Addison-Wesley

5. Casey Reas and Ben Fry,  Getting Started with Processing, OReilly

6. Bruce Tate, Seven Languages in Seven Weeks, The Pragmatic Bookshelf

7. Corey Haines, Understanding the Four Rules of Simple Design, LeanPub

8. Steven Pousty and Katie J Miller, Getting Started with OpenShift, OReilly

9. Kent Beck, Implementation Patterns, InformIt

10. Kathy Sierra and Bert Bates, Head First Java, OReilly

11. Jeroen Janssens, Data Science at the Command Line, OReilly

Non-fiction

1. Mason Currey, Daily Rituals: How Artists Work – (audio book)

2. Seth Godin,  Tribes: We Need You to Lead Us – (audio book)

3. Victor Frankl, Man’s Search for Meaning – (audio book)

4. Chip Heath and Dan Heath, Made to Stick (audio book)

5. Chris Guillebeau, The Art of Non-Conformity (audio book)

6. Sally Hogshead, Fascinate (audio book)

7. Cal Newport, So Good They Can’t Ignore You (audio book)

8. Sylvia Ann Hewlett, Executive Presence (audio book)

9. Ken Segall, Insanely Simple: The Obsession that Drives Apple’s Success (audio book)

10. Don Miguel Ruiz, The Four Agreements (audio book)

11. Phil Pallen, Shut Up and Tweet (audio book)

12. Gretchen Rubin, The Happiness Project, Harper

13. Stephen Hawking and Leonard Mlodinow, The Grand Design, Bantam Books

Health and Fitness

1. Joe Kutner, The Healthy Programmer, The Pragmatic Bookshelf

3. Chrissie Wellington, A Life Without Limits (iBooks)

4. Martin Rooney, Train to Win,

Additionally, I watched upwards of 100 long-ish educational videos, got certified in two Coursera courses (Machine Learning and Nutrition & Physical Activity for Health), went through several technical tutorials, and picked up a tiny bit of some new programming languages (Io, Prolog, Rust, Go, etc.). I also attended the ACL conference in Baltimore, and met Prof. Dan Jurafsky. At work too I got to play with some new technologies and got to travel a lot for work. There was some other stuff too but this much makes sense on a professional blog 🙂 Here’s to an even more intense 2015!

GNU Parallel on OSX and Linux

GNU Parallel is a great utility to parallelize any computation through the command line. The book Data Science at the Command Line discusses, amongst several other things, how to use GNU Parallel to distribute your data over different machines. The toy example/ tutorial in the book makes three assumptions:

(1) all machines you are using are running Ubuntu or some variant of Linux

(2) you are using a bunch of Amazon EC2 instances to do your parallelization (and hence need to find out the IPs of all your instances in a non-straightforward way)

(3) you are using GNU paste that comes pre-installed on all Ubuntu systems

I am presenting a tutorial that works with the premise that

(1) you are primarily using OS X and might have some Ubuntu machines as some of your instances

(2) all your machines are local (as in connected through a LAN)

(3) you are using the OS X variant of paste (which has a nuance compared to the Ubuntu version)

Here is a walkthrough that basically replicates the toy example in the book, but highlights the differences you’ll need to incorporate in an OS X environment.

First, you can install GNU Parallel on OS X through Homebrew:

$ (sudo) brew install parallel

Next, create your instances file (named ‘instances’), and add the hostnames of your local machines as shown in the screenshot. In my case, Cadmius happens to be Ubuntu 14.04, and macusers-Macbook is running OS X Mavericks. The main machine through which I am parallelizing things is also running OS X Mavericks.

The instances file

The instances file

You do not need to have Parallel installed on the ‘slave’ machines, but you might want to in case you want finer control.

Also, in case you don’t want to repeatedly enter your SSH password when Parallel is talking to the slave machines (it uses SSH underneath), you might want to enable password-free login to your slaves.

Also notice how in this case I’ve put in the username along with the hostnames; another difference from the book which uses EC2 instances and doesn’t need different usernames for the different IPs.

Great, now we’re ready to test if everything went well. Run the following command on the master machine:

$ seq 1000 | parallel -N100 –pipe –slf instances “(hostname; wc -l) | paste -sd: -“

Testing GNU Parallel

Testing GNU Parallel

Notice the additional ‘-‘ after the arguments to paste. That is a necessity on OS X. The book doesn’t have it because you do not need it on Linux. Without it though, OS X will complain. With it, both OS X and Ubuntu seem happy (yet you can see the differences in the outputs from the two kinds of machines).

Apart from that difference, the command is copied from the book; it is basically generating a sequence of 1000 numbers, and distributing them to the slaves. The output shows the hostnames and the number of numbers passed over to the slaves. Notice the error message. I’ve mentioned how Parallel doesn’t need to be installed on all machines for basic usage. In this case I did install Parallel on the master and two slaves, but it seems Parallel doesn’t like the fact that macusers-Macbook is an older machine with a Core 2 Duo? Not sure about that. Cadmius happens to have 8 CPUs (and 32 cores).

Finally, run the following to sum the numbers in parallel and then sum the 10 sums on the host machine:

$ seq 1000 | parallel -N100 –pipe –slf instances “paste -sd+ – | bc” | paste -sd+ – | bc

This command is also from the book and will give you the sum – you basically just summed 100 numbers each separately on the slave machines through different parallel processes, and then summed the 10 sums locally. (Again, notice the additional ‘-‘ in the paste commands).

The purpose of this post has been to essentially highlight all the changes I had to make in order to successfully run the toy example from the book on a mixture of OS X and Linux machines all running locally. Thanks for reading.

Productivity Boost on Macs with Quicksilver

Here’s a quick post about enhancing your productivity in OS X. Along the lines of the Vim philosophy, that it should be easy to navigate between things and you shouldn’t need to reach out for the mouse, I’ve set up a simple workflow that I use to switch between open applications at a blazing speed.

I use Quicksilver, which is a free app for the Mac platform. It enables you to set system-wide hotkeys that don’t only open an app, but also shift focus to an already open app rather than open a new instance of it (something that annoys me endlessly with application launchers on Linux). The Mac keyboard is so structured that it’s easy to type Cmd+Option – those are the only two control keys to the right of the space bar. These two can be combined with any key to the left of the keyboard to set up a shortcut that’s easy to type with two hands. You can have a similar setup with Ctrl+Cmd+Option (to the left of the space bar) and a key to the right of the keyboard. You can pick a letter depicting an application, e.g. W for Webstorm, and use it like so: Cmd+Option+W and voilà, it comes to the foreground (or opens if not already open). The best of course is being able to use just the Ctrl key (you have mapped the Ctrl key to be used in place of Caps Lock, right??) – Ctrl+F for Finder, Ctrl+B for my browser, etc. But you also don’t want to override some of the shell shortcuts like Ctrl-a, Ctrl-c, Ctrl-c etc. Enter multiple control key combinations like the example above for Webstorm. Or you could do Ctrl+Cmd+Option+o for Omnifocus, for instance.

Attached is a screenshot of my current configuration. Set this up, and you’ll never go back to switching between apps using Exposé, Option+Tab, or the mouse ever again.

My setup with Quicksilver triggers

My setup with Quicksilver triggers

Happy app-switching!