Thematic: the final word in WordPress themes

Modular, Extensible

I’m a sucker for clean, well-designed code. I like modular, extensible architectures. I like change.

As a consequence, I struggle periodically with the theme of my website. Not that I am a designer and it is certainly not the most productive use of my time, but what can I say. The point is, I was never really happy with the infrastructure I had at my disposal (I am never happy with the designs that I come up with, so thats another story). Until now.

One of the main barriers in designing a custom theme is that you don’t want to scratch. It is just too much work, and why do it when so many others have already done all the hard work for you? It pays to be lazy! So I have always looked around for good starting points to build up custom themes on.

I started out with Sandbox, a semantically rich theme that allowed extensive customization just using CSS. However, styling via CSS can only get you so far. Sometimes you really do want to make changes to the underlying PHP, for instance.

My next setup involved a base copy of Sandbox on which I layered my changes. In order to accommodate changes to the underlying Sandbox code, I used Mercurial with patch queues (the mq extension). This was much nicer, since it was easy to keep up with changes to the core Sandbox and leverage the work that was being done by others. But it was still cumbersome, since once in a while I would run into conflicts that I would have to merge manually. And it was still not a clean setup.

My ideal setup would have been to keep my changes completely distinct and isolated from the underlying theme. A setup that would allow the underlying theme to evolve independently, while my changes continue to work without any additional work.

Thanks to improved support for child themes in WordPress 2.7, and some fantastic work done by these fine folk, I have realized this ideal setup.

You see, I recently started working on a new website for my wife (it is not live yet, but will be soon). In the process of building her website, I was exploring the so-called WordPress Theme Frameworks. After some playing around, I settled on using Thematic. I started out by cloning the Thematic repository. Locally, I was using git-svn to manage the code changes. Thanks to git-rebase, it was not that hard to keep my changes up-to-date relative to a rapidly evolving Thematic code base.

But soon enough, Thematic had enough hooks, filters and features that I could do all the modifications without modifying a single line of Thematic itself. Now, all my changes are contained entirely within a child theme. How it is possible? Well, Thematic happens to be pretty much the most child-theme friendly framework that I could find. It is really easy to customize.  Several child themes are already available for immediate use, and it is trivial to develop your own child theme.

This blog is going to run on a Thematic child theme. Changes are going to be incremental, but I don’t need to worry about keeping them in sync with Thematic, and I get to leverage the improvements being done in the core them for free! You can also take a sneak peak at how we are using Thematic for my wife’s new website

Above the clouds

A few days back, this whitepaper made the rounds of the blogosphere. It is basically a survey report of cloud computing by some folks at RADLabs in UC Berkeley. I had the paper on my reading list since then and I finally go around to reading it today.

It was a good read, but nothing in the paper should come as a surprise to anyone who has been following the cloud computing space. Content aside, I had quite a few (albeit, minor) issues with the writing of the paper. I am guessing it might be due, in part, to the long list of authors.

  • lots and lots of repetition (such as Table 1 and Table 6)
  • sloppy writing in many places, broken sentences, undefined acronyms and such
  • you get the idea

But I think the paper does a very good job of laying out the landscape for people who want to learn about cloud computing, and also gives a high “big picture” view for people who are already in this space. I particularly liked the discussions on how to decide whether a move to the cloud is worth it, financially and otherwise.

The list of the top-10 challenges and opportunities is also interesting. I’m always intrigued by how problems can always be distilled down to “top 3″ or “top 5″ or “top 10″ :-) I personally think that debugging distributed systems should have been ranked higher in the list. Data lock-in, and overall visibility/transparency are I think the biggest inhibitors for adoption, especially in the enterprise.

Virtualization is playing a key role in pretty much all cloud computing efforts. But we are far from the “perfect isolation” promise of VMs. I did some work back in 2006 on improving the performance isolation among VMs in Xen and many of those issues still remain.

How is TV viewership measured?

I’m sure you must have read the headlines. You know, the kind where we get to hear how badly a highly anticipated show did, just hours after it came on TV. Or how well a particular show is doing against shows on competing TV networks? My question is, how do these people measure these numbers, and measure them so quickly?

Ranking

Think about it for a second. Television is, for the most part, a broadcast medium. That is, our television sets mostly just receive data and hardly ever send anything back. You could say that this communication channel is mostly one way.

The Wikipedia page on Nielson ratings sheds some light on the matter:

One involves the use of viewer “diaries,” in which a target audience self-records its viewing (or listening) habits.

I’m not sure how much trust I can put in this methodology. But there is hope:

A more technologically sophisticated system has used Set Meters, which are small devices connected to every television in selected homes. These devices gather the viewing habits of the home and transmit the information nightly to Nielsen through a “Home Unit” connected to a phone line.

But this still doesn’t sound like a good solution. I also read somewhere that another popular methodology involves calling up randomly selected people and questioning them about their viewing habits!!

These days the situation is still a little bit better. Set-top boxes and  DVRs are becoming increasingly prevalent. These devices are significant more powerful and smarter than their ancestors, in the sense that they already do a fair bit of communication with your cable company, and hence it is conceivable that they enable collection of more accurate usage statistics.

Overall, it seems like a hard problem to me, since television has traditionally not been a connection oriented medium. This might change moving forward as IPTV and on-demand videos become more common. If you have some more information on the nitty-gritties of how this all works, please do share!

Milestones

I have been away from this blog for quite a while now and much has happened since then. The past few months have been extremely busy but also quite eventful. 2008 was a very important year for me as I hit several big milestones. Each of these warrant posts of their own, but these one-liners will do for now.

Milestones

First, I successfully defended my PhD on October 31st. I have since finished all the paperwork and filed my dissertation. I am now, officially, Dr. Gupta! :-)

PhD

Second, I had a blast doing job interviews, and was in the difficult, but fortunate position of having to choose among several excellent offers, especially given the current economy. I will be joining Aster Data in a few days!

Work

And finally, I got married to this most wonderful woman! While our wedding was crazy and intense and hectic and a ton of fun, I have come to believe that the reason marriages are more successful in India is that just one marriage drains you so much that you can’t even think about ever getting married again :-D

Diwaker and Surabhi

Amarok ate your stats?

I have a reasonably large music collection. In a desire to trim this collection down to stuff that I really like, over the years I have painstakingly rated my songs in Amarok. But twice, now, I have had Amarok eat up all my ratings and scores and play counts and other stats. This post will show you how to recover from such a loss.

Amarok

The first solution is for a situation where an Amarok upgrade caused the stats to be lost. I was using the default Amarok setup — that is, all the stats are stored in a file on disk using sqlite. During my Amarok upgrade, Amarok decided to create a new database. Fortunately, it left the old sqlite database file lying around. If you have an old version of your database, you can restore the stats using the following script:

The next scenario arose when I switched to using Amrok2 recently. Now, granted that Amarok2 is still under heavy development and hence the requisite migration paths might not be in place. But I still hate to lose all my stats. Amarok2 uses embedded MySQL instead of sqlite to store all its data. The following script uses your old database to restore all the stats in the new database.

Note that for this to work, you need to first start a MySQL server using the embedded MySQL directory as the data backend, as pointed out here.

Hope that helps!