Friday, December 28, 2012

Developing WebServices using JAX-WS

http://www.sivalabs.in/2011/09/developing-webservices-using-jax-ws.html

Thursday, December 20, 2012

How set Max_allowed_packet in mysql


Set Max_allowed_packet:
--------------------------

mysql>SET GLOBAL max_allowed_packet

Get Max_allowed_packet:
-----------------------


mysql> SELECT @@max_allowed_packet;

Tuesday, December 11, 2012

Difference between two days

Calendar calendar1 = Calendar.getInstance();
    Calendar calendar2 = Calendar.getInstance();
    calendar1.set(<your earlier date>);
    calendar2.set(<your current date>);
    long milliseconds1 = calendar1.getTimeInMillis();
    long milliseconds2 = calendar2.getTimeInMillis();
    long diff = milliseconds2 - milliseconds1;
    long diffSeconds = diff / 1000;
    long diffMinutes = diff / (60 * 1000);
    long diffHours = diff / (60 * 60 * 1000);
    long diffDays = diff / (24 * 60 * 60 * 1000);
    System.out.println("\nThe Date Different Example");
    System.out.println("Time in milliseconds: " + diff
 + " milliseconds.");
    System.out.println("Time in seconds: " + diffSeconds
 + " seconds.");
    System.out.println("Time in minutes: " + diffMinutes 
+ " minutes.");
    System.out.println("Time in hours: " + diffHours 
+ " hours.");
    System.out.println("Time in days: " + diffDays 
+ " days.");
  }

Friday, December 7, 2012

Clear Cache When made an Ajax Request?


Best choice is add the timestamp to ajax url.its perfect working
var timestamp=Number(new Date());
var url="YoursUrl? timekey="+timestamp;


     OR

Below code is also working but not gurrente

$.ajax({
    type: "POST",
    async: true,
    url: "/manage/update_position/",
    data: {
        "action": action.
        "model": model,
        "object_id": object_id,
        "position": position
    },
    cache: false,
    dataType: "json",
    success: function(data){
        //[snip]
    }
});