You are hereBlogs / alif's blog
alif's blog
Custom List Views with icons and Listeners in Android
Customizing List Views in Android is very useful for most applications, but, there aren't many good tutorials on the web which explains how to properly customize list views (especially cases where there are Listeners with every element of ListView). So, I decided to write one.
DFA / NFA to Regular Expression (without using GNFA)
The general approach to get a Regular expression (regex) from DFA/NFA is to convert a DFA to a GNFA by reducing states. Read more on wikipedia. However, for not too complicated DFA, it is often easier to get a regex from NFA instead of going through GNFA (which btw makes regex big).
Check if a database exist (android sqlite3_open_v2 failed)
Recently, I have been developing an android application where I shipped an sqlite database with the application.
Getting Lat and Lon from Address in Google Maps Using PHP
Recently, I am working on an application where I have to convert addresses to their corresponding Lat and Lon. So, I decided to write on how to get Latitude and Longitude in Google Maps using only PHP.
To use the technique explained below, you need to have a Google Maps Key.
Scaling Application - Ultimate Fishing Town
Its been a while since I last wrote a blog, so I decided to write something random.
Good Javascript Practices
I decided to share some of the best practices of Javascript which I have learned from various blogs and books over the years.
Canada Postal Code & US Zip Code Regex
I decided to write a simple Canadian Postal Code and US Zip Code Regex. There are already good ones on the web, like here for example. But, I decided to write my own to make it slightly more accurate.
ezMark: jQuery Checkbox & Radiobutton Plugin
ezMark is a jQuery Plugin that allows you to stylize Radio button and Checkbox easily. Its very small (minified version is ~1.5kb) compared to other similar scripts.
Show Play Icon on Mouse over Thumbnail using CSS
I decided to share a simple trick on how to display a "Play" image when mouse is hovered over a video Thumbnail using only CSS. (Sites like Metacafe and similar ones have this feature). Its very easy to implement.
At first, lets declare a simple CSS class for a thumbnail inside an anchor Tag.
jImdb: jQuery Imdb Grabber Plugin
This jQuery Plugin (jimdb) allows you to Grab Movie Details from an IMDB Webpage very easily. It grabs the basic details (Title, Director, Writers, Release Date, Tag line, Plot, Runtime, MPAA, Language, Aspect Ratio, Country) from the IMDB Page and Returns the data in JSON Format.
To overcome Javascript Cross-domain restriction, a server-side proxy file has been provided in PHP with the plugin.