Shortcodes in Ahimsa for WordPress
May 31st, 2010 by ravi

For a couple of releases now, the Ahimsa theme for WordPress has included two shortcodes which I have been too lazy to document, and this post attempts to rectify that.

Quick Fancybox Gallery

If you are not happy with just simple old Lightbox for displaying images (and image galleries), then the Fancybox is what you need, and happily for you, and using Fancybox in your blog is trivial with the Ahimsa theme using the qfgallery shortcode.

Here’s what it’s supposed to do:

QFGallery Shortcode Demo

And here’s how:

    [qfgallery title=”Photographs from Spain” scale=”0″ orient=”landscape” float=”left|right”]
    URL to image 1|title1
    URL to image 2|title2
    URL to image 3|title2

As is perhaps obvious, what the above does is create a thumbnail gallery (the thumbnails are sized at 128×128 pixels) of the three images, and attaches the Fancybox trigger to them, so that when a thumbnail is clicked the original picture pops up in a Fancybox window (which also provides navigation).

All arguments to the shortcode are optional.

The argument scale specifies if the image should be scaled down for the thumbnail or just a 128×128 part of it should be displayed in the thumbnail (the latter is the default). This is a good time to mention that thumbnails are generated in a hacky way: they are not created at all, but are merely browser scaled down versions of the original image. I admit this is a bad idea, especially if you have lots of images, and my only defence (if it can be called that) is that I created this shortcode to make it easy for me to post a few images without having to worry about scaling them to thumbnails, or having to use WordPress’s media manager, etc.

The orient argument specifies if the thumbnails should be displayed left to right and then in additional rows if necessary (“landscape” mode, which is the default) or in a thin vertical strip with one thumbnail per row (“portrait” mode).

The float argument translates to an equivalent setting for the CSS float property. If you want the thumbnail box to be to the right of the content, use the value “right”. Etc.

You can specify a name or title for each image by adding a “|” (pipe) symbol after the URL and then the text for the title.


FAQinWay is a trivial implementation of a FAQ (a list of answers to Frequently Asked Questions) in a page or post. The answers to each question is revealed below when the reader clicks on the question. For an example, see the Ahimsa FAQ page. Questions and answers are added using the FAQinWay shortcode thus:

    This is the first question
    This is an answer to the first question
    This is a second question
    Answer to the second question
The state of the web (apps)
May 25th, 2010 by ravi

Joe Hewitt is not without credentials. Pretty solid credentials. The man participated in Firefox development, worked at Netscape (remember Netscape?), and was the author of the Facebook application for iPhone. And that’s just some of the stuff he has done. Of importance to what follows, he quit development on the iPhone Facebook app in protest over Apple’s review policies; so he is not to be confused with the standard issue Apple fanboy blogger.

I bring him up because he has given a significant voice to what is (or at least should be!) any web developer’s lament: that HTML/CSS/JavaScript trail desktop development environments by years, perhaps decades. Thus spake he on Twitter:

I want desperately to be a web developer again, but if I have to wait until 2020 for browsers to do what Cocoa can do in 2010, I won’t wait.

and truer words haven’t been spoken (despite the sterling work of Cappucino, SproutCore, et al). Many of the simplest capabilities that have come to be familiar and necessary to the end user are as yet unavailable in web apps, nor do the most advanced toolkits provide abstractions that make implementation of sophisticated interfaces structured and pain free. The preponderance of sites that document CSS or JavaScript hacks to overcome this or that failing or lack testifies to this state of affairs.

Google, whose entire existence is, by this time, predicated on the success of the web app paradigm, has been quick to respond to Hewitt, claiming that his criticisms apply more to the web of two years ago (you know the web sans Chrome!). But it was only few days later that one of Google’s flagship products, Gmail, was outfitted with a feature that has existed on desktops for more than a decade: drag and drop file attachments to email messages.

Unfortunately for web surfing humanity, Hewitt’s youthful angst is directed not at the rush to web applications or at the purveyors of the interface products (namely browsers, extensions and toolkits), but the W3C and web standardisation “commies”. Defending the many “innovations” of Microsoft Internet Explorer at the turn of the millennium, Hewitt bemoans the persecution (“bullying”) of the anti-commie crusading innovator and underdog (Microsoft, as per Hewitt, is an underdog because IE’s share was a meagre 10% in comparison to Netscape’s 90%) by the lethargic standards bodies and the Department of Justice, and finally web developers themselves crying out for less innovation, putting at peril the future of the web.

I am not sure how much of this argument needs refutation or commentary. On the one hand, they are cobbled together from snippets of Hewitt’s thoughts (tweets) and it would be a misrepresentation of Hewitt to present them as a cohesive argument or factual record. On the other hand, many of the exaggerated terms employed by Hewitt are self-refuting: does it need pointing out that web developers call[ed] for standardisation not as a cry for lesser innovation, but as a requisite for stable development? Or that Microsoft’s unchallenged domination of the desktop endowed their free browser a tremendous advantage (not captured by initial market share numbers), long before Netscape’s hubris destroyed their product?

From the introduction of platform specific extensions on the part of Microsoft which haunt many of us today (requiring us to launch Internet Explorer, in turn often requiring launch of Windows) to the plethora of extensions implemented by many browsers while they await standardisation (e.g: the -moz, -webkit, etc CSS properties, or the browser specific JavaScript features that have ironically enough served as a means of browser identification), innovation, at least of this variety, has not been lacking. What these hacks point to is not that an interminable standardisation process is holding back progress that would get web interfaces to match what Cocoa offers today. To the contrary, they expose the weakness of a particular long-running trend in web development: namely, the reliance on hacks in lieu of robust frameworks.

Cocoa is a sophisticated user interface and development framework backed by a powerful development tool (XCode). Before Microsoft was Hewitt’s innovation leader in web technology, they pushed desktop development using languages and IDEs such as the Visual* suite. Even the much-maligned (and unfairly so) X Windows environment came with Openlook or Motif (among other options). Together, these libraries and IDEs also provided a higher-level interface and necessary abstractions that rid the developer of mundane and low-level chores. And this is where web development finds itself at disadvantage in comparison to the desktop.

A related thought: another inherent problem of web development is the problem of re-inventing the wheel (user interface) but while confined to the feature-poor sandbox of a browser (itself a special instance of a desktop application). Earlier Internet applications (for there were/are indeed such things before, and after, the browser came into existence) leveraged the rich capabilities of desktop development (innovations like Cocoa) while enjoying the benefits of networking, through the use of protocols. Standards based open protocols. It is arguable that such a model bests the web application model (and I will take a shot at that argument when time permits), but it should not be forgotten that the push to web applications, often with lesser capabilities (see above regarding Gmail), was not driven merely by the advantages of “cloud computing”, but also by the perceived benefits of a standardised UI and programming language (HTML/CSS/JavaScript) that afforded platform-independence.

Download: Ahimsa 3.2 for WordPress
May 25th, 2010 by ravi

You can now download Version 3.2 of the Ahimsa for WordPress theme from the link below, or from the site shortly (once it is approved). If you are upgrading from a version of Ahimsa older than 3.1 and you have made customisations and created custom skins, you should first upgrade to Ahimsa 3.1.1 after reading about it.

  • Tested: Safari4, Chrome 3 on Win, Chrome 5 for Mac, Firefox 3.6, IE7, IE8, Opera 10.53, PHP 4.3 and above, WP 2.8 and above
  • No longer supported: IE6, Safari < 3.1
  • Internationalisation support (potential translators: please see included POT file)
  • Rotated text in sidebar tab
  • Support for header logo
  • Changes for rounded corners on Opera 10.53 and higher
  • More robust parsing by QFGallery shortcode
  • Theme now uses jQuery bundled into WordPress
  • Removed jQuery conflicts with MooTools (and MooTools based plugins), etc
  • Sidebar show/hide effect is now “slide” rather than “fade”
  • Added hint on permitted tags when focus is on comment response form
  • New screenshot! ;-)
  • Various other fixes

I am yet to write up instructions on how to use the two shortcodes (QFGallery and FAQinway) built into Ahimsa. I will get to that as soon as I get this post out.

Screenshots: Ahimsa 3.2 for WordPress
May 25th, 2010 by ravi

Below are screenshots of Ahimsa 3.2 (download link coming next) for WordPress. The first screenshot highlights the two new visible changes (there are others under the hood): rotated text in the sidebar tab and logo support in the header. The others are screenshots of the theme as it appears on various browsers and platforms (click on image and check image title at the bottom for platform/browser information). Some of the screenshots are with a single sidebar setting and others with two sidebars — this is not an error, but a result of the screenshots being taken with different Ahimsa settings.

Ahimsa 3.2 for WordPress

Apple iCal, Google Calendar, CalDAV and SOCKS
May 21st, 2010 by ravi

A breakthrough in my long-running quest to reach Google Calendar via CalDAV through SOCKS from behind a firewall! If that’s a mouthful the solution is equally contrived, but quite worth it… for me.

The problem: iCal, Apple’s calendar client, is capable of connecting to Google Calendar via CalDAV (support for CalDAV was recently added by Google) but incapable of using the SOCKS/proxy settings in Mac OS X. Huh? Well, that’s Apple engineering for you.

The solution, for the unfaint of heart, assuming your SOCKS proxy is achieved using SSH:

Step 1

Tunnel port 443 (HTTPS) on your desktop to 443 on

ssh -D .... -L ....

Step 2

Configure iCal. Fire it up, bring up Preferences, click on “+”  under Accounts. Fill out as below, replacing your Google or Google Apps email address for “”:

Clicking on Create will cause iCal to whine about not finding the server or calendars. Ignore that and click again to proceed to the next screen:

The full Server Path (obscured above) is: /calendar/dav/ (the email address, as mentioned earlier, should be replaced with yours).
And that’s it.
Google [finally!] brings beauty to the Web
May 20th, 2010 by ravi

I confess I am not much enamoured of Google design, what with that choice of startling blue and all, but they have taken a great step in the direction of redemption:

The Google Font Directory lets you browse all the fonts available via the Google Font API. All fonts in the directory are available for use on your website under an open source license and served by Google servers.

If ever you have suffered the [non] choice between Verdana and Arial, shuddered at the inability to rely on at least Helvetica, then this is emancipatory news. How does this magic work. See CSS:@font-face.

[Link: Google Font Directory]

A fundamentally flawed defence of the Apple app store
May 20th, 2010 by ravi

In a climate where the market reigns supreme and the mantra “nothing succeeds like success” has never been truer, it should be unsurprising to see someone write:

Thomas Fitzgerald responds to Ted Landau:

I think Ted’s problem, like that of many analysts/bloggers/journalists/geeks etc on the issue is that they’re confusing fundamental flaws with not liking something. People like Ted don’t like the closed nature of the App store, but that doesn’t mean it’s fundamentally flawed, or a lack of choice.

It occurs to me that the App Store’s restrictions and control are to this coming mobile era what Windows’s inferior user interface was to the PC era: something that offends some critics to a degree such that they will insist for years, despite the success and popularity of the platform, that it’s a fatal flaw that will ultimately doom it.

That’s John Gruber, and his distaste for certain types of FOSS is not new (see: 1, 2), though his growing stridence in defence of most things Apple is a bit disappointing. The real confusion here seems to be on the part of Gruber and Landau:

Landau writes that “not liking… closed nature of the App store … doesn’t mean it’s fundamentally flawed”. That is correct – not liking something does not imply that said thing is “fundamentally flawed, but that’s a strawman since nobody I can think of would claim such an implication. Landau has performed a causal sleight of hand, for in the real world, it is often a fundamental flaw that makes people not like something. And what is the possible fundamental flaw of the App Store? That it is closed. One could argue the merits of such a claim (“closed” = “fundamentally flawed”) but that would mean stifling the penchant for personalising arguments.

Gruber, for his part, equates the success of a platform with the absence of fundamental flaws in it. The choiceless and information starved consumer and mindless corporate IT tsars have rendered the verdict. And Microsoft Windows is the winner. The emperor cannot be naked, for he is the emperor. Gruber knows better than that: he spends a good part of his output (including the very post quoted above) defending Apple, a “loser” in this desktop game.

[Link: Daring Fireball Linked List: ‘I Want Choice, but Only if I Agree With Your Choice’]

Google Voice and Lysenkoism
May 16th, 2010 by ravi

Back at the height of the Soviet Union, the story goes, a biologist named Lysenko won the favour of über-dictator Stalin, in major part due to his notion (not original to him, see: Lamarckism) that acquired traits can be passed on genetically i.e., inherited. This scientifically unsubstantiated but emotionally appealing idea, which served the general philosophy of the Soviet Union and communism well, was declared unquestionable and academies were purged of dissenters, and so on. As most historical stories go, there are all sorts of simplifications and misrepresentations at play with this one, but nonetheless, the moral of the story is worth consideration: don’t let your ideological commitments unduly influence your research and development.

Which brings me to Google Voice, a telephony service that offers many attractive features (such as using a single number to ring at multiple locations), but one crippling weakness. The weakness is not a technical or design one, but an ideological one: Google’s commitment to the web (and web browser) as the primary, and often only, interface to its applications. The result (made worse by Apple’s self-serving rejection of Google Voice app for the iPhone) is that making a telephone call involves (in my usage pattern, YMMV):

  • Switching to the web browser
  • Opening a new tab
  • Clicking on a bookmark or entering the Google Voice URL
  • Possibly logging in, or worse:
    • Reaching a Google FAQ page because I am logged in as a different user
    • Logging out, and re-logging in as the “correct” user
    • Being returned to the FAQ page! (because that’s where I was at)
    • Returning to the Google Voice URL

  • Clicking on Contacts
  • Navigating to the right person, clicking on his or her entry
  • Selecting the right number and clicking on Call

Some of these steps can be eliminated, but I am fairly certain not enough of them can be, to get the workflow down to the simplicity of using Skype instead:

  • Switching to the Skype app
  • Double clicking a contact list entry to call the person (or right clicking and selecting “Call”)

It would take less than a week for one of Google’s highly skilled developers to whip up a native Mac App, a cross-platform AIR application, or a Dashboard widget, that would provide the same simplicity as Skype’s application does. It is not technical ability, but, I suspect, Google’s commitment to replacing the desktop and desktop OS and application environment with the browser and browser based applications that lies behind the lack of such tools.

Which returns us to the Lysenkoism analogy. It is not that Lamarckism is provably wrong and therefore a wrong route to pursue even if dictated by one’s other commitments. Rather, it was not, at the time, [anywhere near] provably right and, for that reason, the wrong basket to put all of one’s eggs in. Recently, in response to a set of tweeted criticisms (of the failings of HTML/CSS for building serious user interfaces) from celebrity developer and blogger Joe Hewitt, Google countered that such criticisms were perhaps applicable two years ago, but not any longer. A few days later, Google added (and advertised with some gusto) a feature to one of their flagship products, Gmail: drag and drop file attachment to a message. A feature that has been available in desktop applications for more than a decade (two decades, arguably).

Once again, the moral: Lamarckism, or web applications (such as Gmail or Google Voice) are not destined to failure. It is quite possible that they (web apps) are destined to succeed, given the many advantages they offer (universal access, zero user software maintenance, so on). However, if one just added drag and drop to one’s mail interface, that future is distant enough to warrant a more pluralist approach. A failure to do so is in effect a punishment of one’s [academic] biology and biotech, in the case of the Soviet Union, or one’s users, in the case of Google.

»  Substance: WordPress  »  Style: Ahren Ahimsa