Dummy’s Guide to Url redirections…

Something is amiss with the way tinyUrl shortens its URLs

I tinyURL-ify this URL http://ibnlive.in.com/news/vijay-mallaya-buys-gandhi-items-f
or-18-mn/86943-3.html and I get this output http://tinyurl.com/dfqtql . For some reason, rather just out of curiosity I repeat the process and this time I get a new output http://tinyurl.com/78llkl

Something is amiss here.

So lets quickly try to guess how tinyurl works.

There are a class of functions called hashing functions, which is a m x n mapping, where m > n. So a hash operation is performed on an url and the output is stored in what is called a hash table.

You are taught in elementary classes in Data Structures that a hash table lookup is O(1) operation that is to say, it is largely independent of the number of entries.

Now we get back to the hash function, since m > n a hashing function is not one to one, rather is many to one.

Now because of this more than one url will hash on to one value. Therefore while storing the key(the hashed value) in your hash table you would also store the url, where you would want to redirect the user to.

Now lets see what would happen when someone lands at your page with an url like http://tinyurl.com/abcdef. Simple all you do is look up abcdef and the value you get is the url where you would redirect an user to.

Now lets see when an user comes to us with a request to tiny-ify an url http://longweblink.com.

You hash the url, and the value you get you look it up in the hash table( o(1) operation) and if the lookup fails you insert the key and url into the hash table and return the key to the user as the shortened url.

By doing this what are you ensuring? Simple. When two different users come to you with http://longweblink.com you are ensuring that you return the same shortened url to them. Therefore saving on duplicate links.

But what happens with tinyurl.com? when an user comes to tinyurl with the same http://longweblink.com, each time he gets a new shortened url. Every time. Yes a new url everytime.

Now lets see what kind of urls are shortened. My guess would be long urls of course… but basically interesting sites which you want to share with somebody else. And knowing the internet, there is a always a very high probability that more than one person finds a link interesting and usually this commonality numbers are pretty huge.

So doesnt it make sense for tinyurl.com to eliminate duplicates and assign shortened urls in the manner that we have learnt in this article this far?

I see only one reason…tinyurl.com wants to overstate numbers!!! if it has not done already, very soon you would see a proclamation saying - A billion urls shortened by tinyurl.com! Now that you have read this article you know what to do dont you? Yes, discount those figures!

Addendum: tinyurl.com has a nifty feature called ‘enable previews’ … please enable that. This would ensure that any redirection is first notified to you before its done. This is a MUST to prevent malice to your computer. An evil guy can tinyurlify http://thiswebsitewilldobadthingstoyourcomputer.com and he would get an url http://tinyurl.com/random and the unsuspecting you will click on it…hallelujah…

PS:
1. Tried the functioning of another url shortener http://is.gd and this site works good, no duplication - http://is.gd/mbfM
2. Tried the functioning of another url shortener http://snipurl.com and this site works good, no duplication - http://snipurl.com/dae7k
3. Tried the functioning of another url shortener http://bit.ly and this site works good, no duplication - http://bit.ly/2QBop

PS2: If you were asked to monetize the services of http://tinyurl.com how would you do so? Leave your comments.

PS3: Something definitely amiss…now two urls hashed to the same value at tinyurl.com!!!(That would nullify my accusation) This still doesnt explain http://tinyurl.com/dfqtql and http://tinyurl.com/78llkl

Maybe I should sleep. Good night

Take time off from whatever it is that you are doing. I assure you, you wouldnt regret it. Three short films. Brilliant…each one of them.

Signs: Patrick Hughes

Strangers (2004)- A Short film by: Erez Tadmor & Guy Nattiv

Offside - A Film by Erez Tadmor & Guy Nattiv

PS: Thanks Shreyas for the first link…

On the Rocks…



Jack Daniels diluted with three cubes of ice; “On the rocks” he called it. With a swagger, a long draw of the midway burnt Rothmans Mild, the MBA of two years announced “Its nothing but a placebo; What frikkin geniuses of us to build a brand around that!”. Thumping of backs, laughter and long puffs of
the Rothmans Mild ensue.

Far away from that cocktail circuit, in a land where rains had failed for three seasons in a row, and the parched cakes of soil made farming untenable, she took a rupee coin and put it into the earthen box.

She counted the five days of manual  labour, carrying crushed rocks on her head and walking bare foot on blazing earth.

“Ten more days and I can buy a tube of ‘Fair and Lovelier’; the next boy shall not say that the girl was too dark to interest him!”

Sathyanarayanan Chandrasekar, whom you would remember as a coding monkey , frustrated with the state of Bangalore roads; these days is an aspiring MBA. This article is about the addiction in India, to the desire for fair skin and its corresponding exploitation in the marriage market. This article is also about the genius of MBAs to find new markets and innovative ways to sell fairness products amongst the poor in the rural hinterland of the country. One prominent ‘management guru’, had even given it a name… “Fortune at the base of the pyramid”. The author blogs at http://kaisertalk.in

This was an entry I sent to the six sentences blog…didnt get published…hence posting it here. Six Sentences Blog is a novel attempt at exploring literature within Six Sentences… You can read it here.

The Free Spirit…



He would work all night, sleep all day and walk all the way to work by noon. Rugged with long hair he would tell tales of how his bike found its way back to the mechanic yet again and how the helmet developed a crack. He would sit over juice breaks and narrate how all he wanted to do was buy a Big Bike(Numbers bigger than R61) and someday just bike across asia and to europe. He was the free spirit, who had it in him to take the bike a single bag and go all the way to Kargil. Would narrate tales of the creativity of the folks at the Border Roads Organization. If I want to see Ladakh, Leh and lands beyond , its because of him. Promised to learn Snooker with me, he did learn… while I walked over to this place. RIP.

To the concerned,



In the course of the two years that we spend here, we dedicate our time and efforts to several pursuits, some academic and several non academic. With each step that we take along this path, knowingly or unknowingly we move closer to our end objective of achieving our own personal goals. All along we are goaded and guided by several forces, some harsh and a few tender. Amongst these support systems are the infrastructure facilities available to us here within the campus. Probably when we look back at our days, as a snapshot from a period in time into the future – it would be these settings that would warm the recesses of our mind and seek to remind us of the beautiful place and the wonderful incidents that truly enriched two glorious years of our life here. Needless to say the theatre of most of these dreams would be the hostels!

Even as we go about doing our daily activities, we are fortunate to have the services of an extremely dedicated support staff – who meticulously go about their daily activities so that our essential services are available sans any disruption, minor or otherwise. Think of the folks who clear up all traces of midnight celebrations from the L^2, think of the folks who ensure that the corridors of our hostels remain clear from any debris from the previous night’s celebration. Think of the folks who you may never see, but who work in the background to ensure that life in hostel is as smooth as it can ever be. It’s a link between these folks and the student community that I seek to become as I humbly present myself as a candidate for the post of Hostel Secretary.

A man of vision creates castles and a man of action creates them on the ground. I would want to present myself as not someone who “promises the moon”, but someone who has the determination and zeal to see plans materialize into actions and into ground realities. I have had the privilege of working at close quarters with the present hostel secretary and I am aware of the nature of work that this position demands and the relationships I have built with folks at ground level – will undoubtedly hold me in good stead, if I am voted into this position of great responsibility.

I offer myself as candidate who is approachable to suggestions, reproaches, and means and alter means to fix a problem. For it’s in this magic of co-creation that a valuable two years of our hostel life exists. I humbly request you to do the needful, if you see promise in my words; and my promise is – I would strive my best to ensure that I don’t let you down.
Thanks,

Sathyanarayanan C

The Week Ahead…



Quite a few things to look forward to. 3 Exams, 2 Weddings, and 1 weekend(ok… I couldnt come up with something funky). Will post details as they occur. Until then. Tata…

This is a test post



This is just to show-off that wordpress has a plugin for Yahoo! Mail. I can now post to the wordpress blog right from Yahoo! Mail.
Cheers,
More … some other day…

This long…



Its been a real long time(20+ years) and hate as I may to admit it - I still haven’t managed to. I am sorry to all those who I’ve let down - which includes primarily only myself. The walk ahead is beset with all the difficulties that the path this far was. Nevertheless time will be a quick healer. Might be I will survive, might be I will make that critical difference, might be I will just be a brick on a giant wall. But this far…I really havent made it. Holding back a few thoughts… I dont have the resolve of a Santiago to stand there and wait for the fish…

Shameful…Just when you thought the country has gone to dogs, it sinks deeper into the abyss.

We dont have roads, We attack places of worship, We use moral policing as an excuse to beat up defenseless youngsters(women or otherwise), We emulate the famous preoccupants of present day Afghanistan in their acts of moral and cultural tolerance, We lack a spine!!!

Mangalore deserves better, we as a nation deserve better than a few goons and hooligans enforcing their might on us! We deserve better! Spine, anyone?

Read more

http://churumuri.wordpress.com/2009/01/25/churumuri-poll-girls-drinking-beer-not-hindu/

http://www.daijiworld.com/news/news_disp.asp?n_id=56075

http://www.ndtv.com/convergence/ndtv/story.aspx?id=NEWEN20090081377

http://timesnow.tv/Newsdtls.aspx?NewsID=27576

Did a decent task at learning Poker yesternight. Started at half past one yesternight and played all through the  night and beyond sunrise till Nine this morning. Even with little knowledge about the game, immediately realized why gambling is such an addictive indulgence!!! You lose, you want to put more at stake and try to make a comeback. You lose more in the process. You tell yourself … of course gambler’s fallacy exists, but there has to be a beginners’ luck and in no time you are down dark red.  As dawn progresses to dawn you wager more and play a few cards good to emerge even(almost even, actually). You tell yourself “phew, it has been quite a night!”. Clean poker, replete with those colored chips and rules consulted off wikipedia;, sans alcohol! It was a pleasant night. Except that I am not sure if my risk appetite would allow me to play again! On the table, I hear of narratives of high stake games happening not too far away - just a few blocks away. Gambling is exactly what they make it out to be. An indulgence that is not for the faint hearted. I shall stick to owning DLF, ICICI Bank and Reliance Power Shares(ok now I may as well buy RIL)



. If you are a connoisseur of classical music living somewhere close to Bangalore, there is a dusk to dawn music festival happening here on 25th Night and 26th morning. I would be more than happy to get you the passes. Read more about the artistes performing and other details about the fest itself here.

« Previous PageNext Page »