tungwaiyip.info

 

home

about me

links

my software

Media

Yucatán Photos

St Lucia Photos

Photo Album

Videos

Blog

< May 2009 >
SuMoTuWeThFrSa
      1 2
3 4 5 6 7 8 9
10111213141516
17181920212223
24252627282930
31      

past articles »

Click for San Francisco, California Forecast

San Francisco, USA

 

The World's Shortest Short URL Generator

(2009-07-07 Update: I have suspended this demo program because I find spammers has started to exploit it. What a lesson for me to learn.)

There was a long winding discussion about a short URL generator bit.ly. Many people are familiar with the pioneer in this field tinyurl.com, which for many people, is the synonym of this service. Nevertheless, with fast raising popularity, many people see a lot of promises in bit.ly as a business. On the hand, just as many people brush off it as a trivial service easy to replicate. Someone dismiss it as an application that can be done in 10 lines of code. This prompted the posting and set off a discussion on Fred Wilson's blog.

I should say I agree with most of the comments from both sides :) But as a geek, the idea of building a short URL generator in 10 lines has latched on my head. So I set out to work. An hour later out came http://tungwaiyip.info/shorturl. In just 10 lines of code, it is the world's shortest short URL generator, or so I thought.

This is a real application. It has UI, URL shortening algorithm and database persistence, all in 10 lines of code. Feel free to check out the source code. I have a lot of fun doing this. There is a fatal flaw though. It does not handle concurrent update very well. To squeeze the code even more to handle concurrency does not seem fun. So I just stopped there.

2009.05.12 [] - comments (0)

 

 

Comments (0)

past articles »

 

BBC News

 

US eyes chance for Mid-East peace (09 Mar 2010)

 

Indian MPs approve women's bill (09 Mar 2010)

 

Prince fined over Kenya assault (09 Mar 2010)

 

Raids 'kill Indonesia militants' (09 Mar 2010)

 

Burma refugees 'face starvation' (09 Mar 2010)

 

Hard drive evolution could hit XP (09 Mar 2010)

 

'Ransom bid' in Cyprus body theft (09 Mar 2010)

 

US seeks Nigeria massacre trial (09 Mar 2010)

 

Chameleon's tongue beats the cold (09 Mar 2010)

 

Porn domain name plan resurrected (09 Mar 2010)

more »

 

Slashdot News for nerds, stuff that matters

 

Apple's iPhone Developer License Agreement Revealed (2010-03-09T14:40:00+00:00)

 

US Immigration Bill May Bring a National Biometric ID Card (2010-03-09T13:56:00+00:00)

 

50% Efficiency Boost From New Fuel Injection System (2010-03-09T13:14:00+00:00)

 

Making Sense of CPU and GPU Model Numbers? (2010-03-09T10:20:00+00:00)

 

NSA Still Ahead In Crypto, But Not By Much (2010-03-09T07:22:00+00:00)

 

Jobs Says No Tethering iPad To iPhone (2010-03-09T04:31:00+00:00)

 

Why Microsoft Can't Afford To Let Novell Die (2010-03-09T02:37:00+00:00)

 

AIDS Virus Can Hide In Bone Marrow (2010-03-09T00:42:00+00:00)

more »

 

TechPsychic Tech Rumors and Invented News

 

TechPsychic: Disclosure and as CEO job, NSFW. (09 Mar 2010)

 

TechPsychic: The HP Shows in the Nexus One Facebook iPhone iTunes link. (08 Mar 2010)

 

TechPsychic: Subscription rates, engineers, Socialcast which ended the Web Spends 8 Billion. (08 Mar 2010)

 

TechPsychic: Bing lets brands, is a long time. (08 Mar 2010)

 

TechPsychic: Twitter: Twitter's Chirp Conference: Job. (08 Mar 2010)

 

TechPsychic: Android Apps Bloom - a Hulu CEO David Rusenko says Twitter is. (07 Mar 2010)

 

TechPsychic: Microsoft CEO Talks The Future. (06 Mar 2010)

 

TechPsychic: Apple announced a beta Launch a status online is trying to which has. (06 Mar 2010)

more »

 

SF Gate

 

Proposed initiative aims at Muni drivers' pay (2010-03-09T08:07:24UTC)

 

Presented By: (09 Mar 2010)

 

Sixth Street says ooh la la to Passion Cafe (2010-03-09T08:22:54UTC)

 

Stanford considers bringing ROTC back (2010-03-09T08:07:29UTC)

 

Exploratorium gets million to prep for move (2010-03-09T08:22:54UTC)

 

Dad accused of shaking wailing baby to death (2010-03-09T08:07:13UTC)

 

Tow truck in S.F. rolls away, damages 10 cars (2010-03-09T08:07:04UTC)

 

Oscars 2010: Historic win for 'Hurt Locker' (2010-03-08T14:02:26UTC)

 

EU warns US against protectionism in Pentagon deal (2010-03-09T14:53:33UTC)

 

Amazon cuts off Colo. affiliates because of tax (2010-03-09T14:51:33UTC)

 

Stocks fall early on 1-year anniversary of low (2010-03-09T14:46:29UTC)

 

EU APNewsAlert (2010-03-09T14:38:29UTC)

 

Probe of PG&E meters to begin soon (2010-03-09T14:30:29UTC)

 

WuXi PharmaTech moves to 4th-quarter profit (2010-03-09T14:25:27UTC)

more »

 

Asia Times Online

 

Marjah, the city that never was (Tue 9 Mar 2010 19:00:00 +0700)

 

THE ROVING EYE : Oscar night in Baghdad (Tue 9 Mar 2010 19:00:00 +0700)

 

Atrocities may fill Iraqi power vacuum (Tue 9 Mar 2010 19:00:00 +0700)

 

SUN WUKONG : Limp arm of the body politic (Tue 9 Mar 2010 19:00:00 +0700)

 

'Bless you Mr Obama' on Myanmar (Tue 9 Mar 2010 19:00:00 +0700)

 

COMMENT : Alternative reading of Hamas murder (Tue 9 Mar 2010 19:00:00 +0700)

 

Politicians in bed with India's 'pimp gurus' (Tue 9 Mar 2010 19:00:00 +0700)

 

South Korea back on track (Tue 9 Mar 2010 19:00:00 +0700)

 

US ponders China's Southeast Asian rise (Tue 9 Mar 2010 19:00:00 +0700)

 

The great game - asset-trader style (Tue 9 Mar 2010 19:00:00 +0700)

 

THE BEAR'S LAIR : Accelerator jammed (Tue 9 Mar 2010 19:00:00 +0700)

 

THE MOGAMBO GURU : Supply-side madness (Tue 9 Mar 2010 19:00:00 +0700)

more »

 


Site feed Updated: 2010-Mar-09 07:15