Thursday, April 15, 2010

5 Ways to Reduce Social Media

5 Ways to Reduce Social Media Distractions and Be More Productive: http://bit.ly/bouhsh

Posted via email from Sravan's posterous

Sunday, April 11, 2010

TIME Mobile: The Maruti 800 and the Bajaj Chetak: The End of the Road for Two Indian Classics

The Maruti 800 and the Bajaj Chetak: The End of the Road for Two Indian Classics : http://bit.ly/dlUJix

This article was sent from TIME's mobile app. To download the FREE TIME iPhone or Blackberry application, click here: http://app.time.com

Posted via email from Sravan's posterous

Friday, April 09, 2010

Tuesday, April 06, 2010

JDK 6.0 Light Weight HTTP Server

Using JDK 6.0 Light Weight HTTP Server

Inorder to resolve a strange scenario at my work, I was pushed to search for something which exposes the functions in my java app as a webservice without actually using a webserver. After a lot of Googling, I have realized that I was searching for something which is already in my pocket.

Light Weight HTTP Server in JDK 6.0

In short, if you have a java app, and want to quickly expose few methods as a WebService without the hassles of having a Web Server, this is the solution. All you need to do is

1.       Identify the Java Class which u want to expose as webservice

2.       Annotate with @WebService and other WS related annotations

3.       Write a small method to publish your java object as web service

Hello World!

Create a Java Class which you want to expose as WebService

TestService.Java

package test;

import javax.jws.WebService;

@WebService

public class TestService{

                public String echo(String message){

                return message;

}

}

Inorder to publish the above method as Service, all you need to do is,

PublishProxy.java

package test;

import javax.xml.ws.Endpoint;

public class PublishService{

                public void publish(){

                                //Endpoint.publish(URL to which you want to bind the service, instance of object to be invoked)

Endpoint.publish(“http://localhost:8080/TestService”,new TestService());

                }

}

Bangon! Launch your fav browser, open the url http://localhost:8080/TestService?WSDL, you will see a freshly baked WSDL for your Service, ready for consumption!

Posted via email from My Hello World!

7 Best Code Comments ever seen

The best code comments seen in source code ......
 
1.
  /// <remarks>
  /// The point of this is to work around his poor design so that paging will
  /// work on a mobile control. The main problem is the BindCompany() method,
  /// which he hoped would be able to do everything. I hope he dies.
  /// </remarks>
 
2.
 
// I dedicate all this code, all my work, to my wife, Darlene, who will
// have to support me and our three children and the dog once it gets
// released into the public.
 
3.
 
// Magic. Do not touch.
 
4.
 
return 1; // returns 1
 
5.
 
/* This is O(scary), but seems quick enough in practice. */
 
6.
 
/*
* You may think you know what the following code does.
* But you dont. Trust me.
* Fiddle with it, and youll spend many a sleepless
* night cursing the moment you thought youd be clever
* enough to "optimize" the code below.
* Now close this file and go play with something else.
*/
 
7.  and here comes best one......
 
//When I wrote this, only God and I understood what I was doing
//Now, God only knows

Posted via email from Sravan's posterous

Monday, April 05, 2010

TIME Mobile: Do We Need the iPad? A TIME Review

Do We Need the iPad? A TIME Review : http://www.time.com/time/business/article/0,8599,1976932,00.html

This article was sent from TIME's mobile app. To download the FREE TIME iPhone or Blackberry application, click here: http://app.time.com

Posted via email from Sravan's posterous

Friday, April 02, 2010

Few facts........Just for fun (Source : Forward Mail)

If you kiss her,

you are not a gentleman

If you don't,

you are not a man

 

 

If you praise her,

she thinks you are lying

If you don't,

you are good for nothing

 

If you agree to all her likes,

you are a wimp

If you don't,

you are not understanding

 

 

If you visit her often,

she thinks you are boring

If you don't,

she accuses you of double-crossing

 

 

If you are well dressed,

she says you are a playboy

If you don't,

you are a dull boy

 

If you are jealous,

she says it's bad

If you don't,

she thinks you do not love her

 

If you attempt a romance,

she says you didn't respect her

If you don't,

she thinks you do not like her

 

If you are a minute late,

she complains it's hard to wait

If she is late,

she says that's a girl's way

 

If you visit another man,

you're not putting in "quality time"

If she is visited by another woman,

"oh it's natural, we are girls"

 

If you kiss her once in a while,

she professes you are cold

If you kiss her often,

she yells that you are taking advantage

 

 

If you fail to help her in crossing the street,

you lack ethics

If you do,

she thinks it's just one of men's tactics for seduction

 

 

If you stare at another woman,

she accuses you of flirting

If she is stared by other men,

she says that they are just admiring

 

 

If you talk,

she wants you to listen

If you listen,

she wants you to talk

Posted via email from Sravan's posterous