Storm WordCountTopology Error: Cannot run program “python”

Programming January 22nd, 2012

I have been playing around with Storm which was opensourced by Twitter recently.(Checkout the github code). It is dubbed as a realtime map reduce system but it is very generic to perform a variety of operations.

I explored Storm-Starter which has some examples storm topologies to help get your feet wet. Most java examples worked fine for me but I got issues in running the WordCountTopology. The WordCountTopology example uses the python language to write its bolt. I kept getting the error below:

Cannot run program “python” (in directory “/tmp/cf2bf9a …

The problem was solved by adding the “multilang” directory in Storm-Starter project to the class path.

Removing HTML tags

Programming January 16th, 2012

The code snippet below is a function in python for removing html tags from a text. It can be used from a python terminal as shown in the image or within a python module.

Usage:

1) Remove ‘a’ tags: Type the commands as shown in the image below in a python terminal

Removing HTML tags

Thunderbird RSS Notification

hackinghabits December 30th, 2011

Thunderbird is a wonderful mail client but I missed something really important to me – Growl like notifications for RSS feeds. When I received new emails, Thunderbird would notify me but it would not notify when I received new RSS updates. I looked online but I could not find a good one solution to enable notifications for RSS feeds (I must be totally blind). I decided to write my own and here it is, a linux growl like feature that sends notifications on new RSS and email messages.

https://addons.mozilla.org/en-US/thunderbird/addon/linux-growl/

Screenshot:

OSQA 1.0rc on Django 1.3

Programming November 25th, 2011

OSQA is a stack overflow clone in Django. It is pretty well featured and easy to use compared to a number of other counterparts. Though the next release is waiting for even, there are release candidates and the development version on trunk. If you are planning to use the 1.0 release candidate along with Django 1.3, there are few things that you might likely need to get it working. The primary changes are related to modules being moved around on Django 1.3.

In settings.p, you will require the following changes.

TEMPLATE_LOADERS = [
-'django.template.loaders.filesystem.Loader',
-'django.template.loaders.app_directories.Loader',
+'django.template.loaders.filesystem.Loader',
+'django.template.loaders.app_directories.Loader',
'forum.modules.template_loader.module_templates_loader',
'forum.skins.load_template_source',
]
TEMPLATE_CONTEXT_PROCESSORS = [
'django.core.context_processors.request',
'forum.context.application_settings',
'forum.user_messages.context_processors.user_messages',
-'django.core.context_processors.auth',
+'django.contrib.auth.context_processors.auth',
]