How do you know when your site get indexed in Google search engine. You can actually use Google search engine to find out how your site is indexed. For example: to know the indexed pages in www.snipetit.com, simply query site:www.snippetit.com at Google search engine. to know the pages that link to your www.snipetit.com's front page, simply query link:www.snippetit.com at … [Read more...]
Java: Randomly sort values in a array (the generic way) in single pass
Few years back (yes, about 4 years back), I wrote an article about randomly sort query results in MySQL. The main problem in randomly sort query results is that when you have a very large data in your database and the statement to sort the result may change the data execution plan causing DMBS does not choose the right plan. Therefore, sometime it is more wise to sort it in … [Read more...]
Java: Format integer into number of decimal places and performance
For certain reasons (e.g. precision issue), some programmer may store a float value (e.g. money) in integer variable. For example -12345678.90 is stored as -1234567890. To convert the integer value to number with number of decimal places is a problem. There are several way to do it. You can simply use the Java's String.format(), DecimalFormat or Float.toString(). Most of … [Read more...]
Java Static Constructor
Recently I wrote a Java class that maps ISO 3166-1-alpha-2 country code to country name and encountered a static constructor initialization problem. My code is as following: … [Read more...]