Posts

encyption-decryption using DES

 Example of encyption-decryption using DES  ---------------------------------------------------------- package com.example.des; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import javax.crypto.Cipher; import javax.crypto.CipherInputStream; import javax.crypto.CipherOutputStream; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESKeySpec; public class CipherExample {     public static void main(String[] args) {         try {             String key = "y1$ab??x";            // your key , needs to be at least 8 characters for DES                         FileInputStream fis = new FileInputStream("Ori...

User Service RPC call failed: 500 The call failed on the server

GWT: User Service RPC call failed: 500 The call failed on the server Solution: If you are using objectify then make sure that you have added it's jar file ( objectify-2.2.1.jar ) into WEB-INF/lib as well as you have put this file in classpath (using java build path in case of eclipse) Also don't forget to include: <inherits name="com.googlecode.objectify.Objectify" /> in your project-name.gwt.xml file.

Fishbone: A GWT and Google App Engine Blog: An Objectify example to store data in the Google A...

Fishbone: A GWT and Google App Engine Blog: An Objectify example to store data in the Google A... : If you're like me, then you've searched for a complete working example using Objectify with Google App Engine to persist data and utilize th...

Site down: Time out erro (Apache server with tomcat 6)

Can any one find the solution for  this ????? error.log file........................ [Tue Apr 24 17:19:28 2012] [error] [client 66.249.68.225] (104)Connection reset by peer: proxy: error reading status line from remote server localhost [Tue Apr 24 17:19:28 2012] [error] [client 66.249.68.225] proxy: Error reading from remote server returned by /robots.txt [Tue Apr 24 17:19:58 2012] [error] [client 175.41.139.6] (104)Connection reset by peer: proxy: error reading status line from remote server localhost [Tue Apr 24 17:19:58 2012] [error] [client 175.41.139.6] proxy: Error reading from remote server returned by / [Tue Apr 24 17:23:19 2012] [error] [client 175.41.139.6] (104)Connection reset by peer: proxy: error reading status line from remote server localhost [Tue Apr 24 17:23:19 2012] [error] [client 175.41.139.6] proxy: Error reading from remote server returned by /Home.action access.log file............ 175.41.139.6 - - [24/Apr/2012:17:16:24 +0000] "GET / HTTP/1.0" 5...

Facebook error response of type OAuthException: Error validating application. Invalid application ID

Console error:   Facebook responded with HTTP status code 400 and response body: {"error":{"message":"Error validating application. Invalid application ID.","type":"OAuthException","code":190}} --------------------------------------------------------------------------- com.restfb.exception.FacebookOAuthException: Received Facebook error response of type OAuthException: Error validating application. Invalid application ID. com.restfb.DefaultFacebookClient$DefaultGraphFacebookExceptionMapper.exceptionForTypeAndMessage(DefaultFacebookClient.java:576) com.restfb.DefaultFacebookClient.throwFacebookResponseStatusExceptionIfNecessary(DefaultFacebookClient.java:537) com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:485) com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:445) com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:405) com.restfb.De...

Java Script: Remove space in a String

How to remove spaces from a string in java script? Add the following code snippet in your your java script code: String.prototype.contains = function(it) { return this.indexOf(it) != -1; }; function removeSpace(text){    while(text.contains(' ')){        text=text.replace(' ','');    } }

Google map: calculate distance between two points(Marker)

rad = function(x) {             return x*Math.PI/180;          } distanceUsingHaversine = function(sourcePoint, destinationPoint) {      var RADIUS = 6371;    // earth's mean radius in km     var diff_Lat  = rad(destinationPoint.lat() - sourcePoint.lat());     var diff_Long = rad(destinationPoint.lng() - sourcePoint.lng());     var a = Math.sin(diff_Lat/2) * Math.sin(diff_Lat/2) +           Math.cos(rad(sourcePoint.lat())) * Math.cos(rad(destinationPoint.lat())) * Math.sin(diff_Long/2) *     Math.sin(diff_Long/2);   var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));   var dist =RADIUS * c;   return dist.toFixed(3); }