SQL Update Statement can go crazy!!!

We had a production issue today and to rectify it i need to update some  records in production. As I dont have access to production database , I  raised a help desk ticket with the SQL statements. I have to provide two statement which are as follows [1] Update the “active”  column value to 1 and reference id column to NULL for for ONE  payer (example payer with primary Key : 100). [2] Mark the “active” column to 0 and referenced id column to 100 (referencing payer with... more →
Posted in: Programming

Java 7 : Using String in switch statement

At last java 7 started supporting String object as a parameter to switch statement. Previously it was numbers and enumerations. I am sure this will be a welcoming change to the Java community. [code] public class WeekTeller { public static void main (String [] args) { String weekCode = args[0]; switch (weekCode) { case "M": { System.out.println("Monday"); break; } case "T": { System.out.println("Tuesday"); break; } case "W": { System.out.println("Wednesday"); break; } case... more →
Posted in: Java, Programming

ImageMagick: Splitting Multi-Page Tiff to Single Page, but first Image name suffix is not Zero!!!

We have a requirement to split multi-page Tiff to single pages and we are using ImageMagick “convert” function. Example: [code] Convert abc.tif abc_%d.tif [/code] if abc.tif has 5 pages then on successful execution of the above command it will create five single pages with images names as abc_0.tif,abc_1.tif,abc_2.tif,abc_3.tif and abc_4.tif This function was working fine and once in a while for certain images it will create images starting with suffix 1 (ONE) instead of 0 (Zero) However... more →
Posted in: Programming

Generating latest sitemap of your WordPress blog for Google Webmaster without plugins

I was depending on a WordPress plugin to generate the sitemap of my blog. However I noticed that it is not getting updated automatically. I searched the forums and I could see many people posting this issue.  Some of the popular issues are new posts are not getting reflected in sitemap, pages are not shown in sitemap etc. I could see various solutions like WordPress plugins, using crons to re-submit the sitemap every time etc. My suggestion is to create a small PHP page which can render the sitemap... more →
Posted in: Internet, Programming