Your own URL shortener!

So I was checking out bit.ly, and I noticed that the bit.ly Pro is free for individual users. Turns out you can have your own short url running with bit.ly’s engine.

Out came my credit card and kdkk.in was bought. Now all the urls that I shorten using bit.ly will be on this domain. The configuration is through your bit.ly account and could not be simpler. All you have to do is verify that you own both the domains and point your main domain to the shortened domain.

A simple two step process and voila, my own url shortener, powered by the good folks at bit.ly!!

The Parity Bit

Here’s an interesting mind bender for you (do note that this question is used in a lot of job interviews) –

A warlord has captured 1000 villagers, and has decided to put their wits to test. He has put 4 different coloured hats (say Red, Blue, Black and White) on these thousand villagers and arranged them randomly in a long queue. The arrangement of this queue is such that each villager can see all the villager’s hats in front of him, but he cannot see the villagers behind him.

Each of them now have to guess what colour their hat is. If it is the right colour then the villager is allowed to live and is freed, if not … then let’s just say he won’t be having any more headaches.

The villagers are allowed to discuss as a group to decide on a protocol (an algorithm of sorts) to decide how to call the colours so that the maximum no. of villagers survive. What is this algorithm and how many villagers will survive?

Hint: The title of the post

Taken from Wikipedia,

A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is even or odd. Parity bits are used as the simplest form of error detecting code.

The villagers have to use the concept of parity in their answers. Instead of taking a guess at what colour his hat is, the last villager is the parity bit. His answer gives an indication to everyone else in the queue as to what could be their colours. How? Here is so –

Each colour is denoted a no. (Red=1, Blue=2, Black=3, White=4). Since the last man can see all the hats in front of him, he takes a total of all the number before him and does an operation (total mod 4). This is the parity (or the error-correction answer). Now the man in front of him can see all the hats (except his of course) and also knows this value error-correction value. What he has to do is do the same operation for all the hats in front of him, and subtract that value from the previous mod. That’s the colour of his hat.

The cool thing about this is that even if there is one fool of a villager who miscalculates, the villager next to him can detect this error and can correct it immediately.

Now, where would we be using this? (In other words, why did I bother with this problem?)

Networks! Computer networks use the concept of parity bit to detect transmission errors for quite some time now (have you ever faced that pesky CRC error? That’s your parity bit right there).

Intensity of technology adoption

Everybody you know, will probably agree with this, that Technology can be a great enabler.

It’s one of those motherhood statements (like “Shit happens” or “Life sucks”) that arguably can’t be denied. As someone who has often taken upon himself to forge this enablement with the demands of the business, I want to take a different stand.

Technology CAN be an enabler, only if you possess the know-how of implementation and your audience possesses the temerity to bear the brunt of teething and adoption problems, then can it be an enabler. How many cases have we seen that an organization wide technology upgrade has failed simply because the intended audience does not adopt it, but merely reverts to the easily available alternative.

My mother heads the medical department of State Bank of India, she in fact is the Chief Medical Officer. She tells me that they had tried three times to implement some form of an enterprise system for their department, Each time it had failed. Why did it fail? Not because the implementation was incorrect. We can’t say that, the moment we do – the implementation partner will pull out the requirements sheet, the scope document or some form of agreement which indicates that there was no breach of contract from their side.

And that is the problem I want to point out. Technology is not a function which can run in a silo. It permeates through the organization, from the most mundane of activities like checking email, to most complex of them like implementing a Decision Support System to help the top brass in strategic decision making.

Technology adoption therefore has to be intense. So intense that it should change the identity of the organization. If done properly, it can vault the firm into the next level.

The next time someone tells me that technology CAN be a great enabler, I will tell them that if my aunt had a moustache, then she CAN be my uncle.

Mastering a Mammoth

As part of my work, I am also maintaining the corporate blog these days. Sadly, the content management system (CMS) on which the blog is based on is kinda out of date. So much so that it has become virtually impossible to recreate the same environment on my own desktop.

What this means as a software person, I have to make changes and edits on a production platform. Not only does this give me the heeby jeebies, but also it makes the task a bit too tedious. Any one who has worked on an online server knows the PITA (pain-in-the-ass) it is to edit code files online.

Over the past week, I have been trying to handle this mammoth. I so miss my own agile and flexible WP 3.04 platform!!

In fact typing this blog has made me de-stress :-)

One of the great things about working with legacy CMS is that you get to (or rather have to) understand the exact workings of the CMS, you suddenly start seeing a plethora of possibilities and that gives you a sense of fulfillment.

1984 to 2010

1984

We are in the process of formalizing our IT and Electronic Access Policies. In this process, often the team drafting the initial proposal finds it pretty easy to switch to the Orwellian mode of 1984, wherein Big Brother is always watching.

Although the intent of these people often stems from the fact that they desire to protect both the system and it’s users, but that sometimes requires that extra bit of control. However, it becomes extremely difficult to tell the need for control from genuine to paranoia.

Further, due to some unforeseen events happening in the recent past, these rules are doubly strict ensuring that the past mistakes of a few have to be borne by the entire team. Only to ensure that something that happens out of the blue should not happen again (and rightly so!).

The problem at hand is how to ensure that people are enabled to work and co-create with each other, but are still protected from any malicious ill will that might exist outside (and even within the system). How can Big Brother start co-operating instead of watching?

One clear method is to assume that all people are good and need to be enabled. The other is to work closely with them step-by-step and layout a simplified process and get the end-user buy-in on each of the steps. Till that happens, Big Brother will continue to exist … we are watching you!

Google Fonts!

Came across Google Webfonts, decided to try it out on this blog.

Instructions are pretty simple, as long as you are using CSS on your site. Otherwise you will be forced to CSSify your site first before implementing Google’s webfonts.

Include the Google Font definition in your head section, and simply update the “font-family” attribute in your body CSS definition to the desired font family.

Pretty simple and elegant. Trust Google to come up with this.

PS – A friendly visitor also pointed me to this guide on fonts.

Automating workflows

So you are stuck with submitting lots of data over and over again through a long web-based forms … sigh!! Wondering whether this can be automated.

OR

You have entered into this community based competition where people register and vote on different entries (you see a lot of these competition these days … crowdsourcing the judgement to the community … another brilliant way out of making judgements!!), how do you win when your entry is hopelessly late and others are way ahead??

Well you see, all of these are workflows, and especially on a web environment they can be automated. The IT industry already does this, through regression testing. When they have to test and re-test the same thing over and over, they finally realized that an automated testing tool needs to be built which can do this task. Plus, we want to do this for free, right … enter open source.

I was tinkering with the open source regression testing tool, called Sahi and I realized the beauty of this application. Consider these scenarios –

  • A friend has participated in a competition. It is a crowdsourced competition where users register and vote for their favorite entries. Hmmm … all you need is a set of valid email-ids and voila!! From 500 votes to 2500 votes in no time!!
  • You are part of a web development team and in charge of testing all the minute details. The changes in the scope are coming left, right and center … you have to keep on testing the application repeatedly. Well, now its a one time thing!! Create different scripts for each functionality, and voila!!

Basically, if you are creative enough, and wherever there is a need to do something repeatedly, you can use this tool. Also, be on the lookout for captchas, I dont think it works with them.