Browsed by
Month: February 2011

Your First Chome Extension

Your First Chome Extension

I made my first browser extension recently. Turns out that it is refreshingly easy.

I use Google Chrome. One of my favorite websites is SlickDeals.net, which I must admit to occasionally browsing at work. The problem is that SlickDeals makes its money via referrals. i.e. if I post a link to newegg.com, SlickDeals parses the URL and generates a redirect via a referral URL.

So:

http://www.newegg.com/Product/Product.aspx?Item=N82E16889005129

becomes:

http://slickdeals.net/?sdtid=2702819&sdfpid=47595&sdop=1&sdfid=9&u2=http://www.newegg.com/Product/....

This would be fine, however my work blocks all the intermediate sites the modified link redirects via, so it is necessary to copy the http://www.newegg.com/…. URL, which fortunately is in plaintext, from the modified URL and paste it into a new window.

After doing this 100 times or so I was pretty fed up so I wrote an extension to parse the modified URLs and return them to their original form.

Creating a Chrome extension to parse and modify page content

Android & SQLite – 1MB limit, IOException and general woes.

Android & SQLite – 1MB limit, IOException and general woes.

This long weekend I worked on an app: Scrabble For Anagrams. The UI took about 8 hours. The engine to generate and perform rapid lookups of character permutations took about 8 hours. After 2 days of hard work I believed the app was working great and was nearly ready to go on the market. The dictionary was converted into a SQLite DB outside of the android application and was included as an asset.

However, my original dictionary (found online) contained only 10K words and I pretty rapidly found some word combinations that were valid but weren’t in the dictionary – clearly unacceptable. No problem! I found a freely available 400K word dictionary, generated the new DB and placed it in the asset folder. Build, run and bam! IOException.

Dump, Split and Rebuild the DB