Your daily dose of Java and related technologies.
News, Releases, Reviews, Tutorials, Articles, Events, Contests, Comments, Code and much more.
This java weblog is maintained by Xyling Technologies, making life simpler.

Wednesday, September 26, 2007

Check for a string to be in English using Java


This is useful especially if you are insanely bugged by the smart testers who love international characters being filled at the places where it is not required.

Here is the simple checking code. As always, if you have something better to share, please use comments.


public static boolean canEncode(String s, String cs)
{
try
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Writer w = new OutputStreamWriter(baos, cs);
w.write(s);
w.close();
String t = baos.toString(cs);
return s.equals(t);
}
catch(Exception e)
{
return false;
}
}

Thursday, August 16, 2007

AJAX Activity Indicators

Do you want images like the one below to display during your Ajax calls?



Point to the title of this post to get many such activity indicators.

Tuesday, August 14, 2007

Java accounts for 2.1% of India's GDP

A report called "Java Economy in India: A Pessimistic Estimate", conducted by Prof Rajanish Dass and Prof Rashi Goyal of the Indian Institute of Management, Ahmedabad, has estimated the size of Indian Java economy at $14.65 billion for 2006, up from $11.27 billion a year ago.

Full story at the title of this post.

Monday, May 21, 2007

Snap with Scott McNealy

This could be the first time that my blog readers would be seeing me and that too with Scott McNealy, the co-founder and Chairman of Sun Microsystems.




Friday, May 18, 2007

Highlights of the day in Sun Technology Summit 07 at Bangalore

A fantastic day at the Sun Technolgoy Summit with Scott McNealy at Bangalore!


Registration area.



Waiting for scott...


Delegate!



Decent crowd.



Dias.

Anand Agarwalla has noted down points on his blog http://angraze.wordpress.com/2007/05/18/sun-technology-summit-07-bangalore/

[Resource-Type: Event; Category: Java; XRating: 4]

Free! Free! Free!... the mantra of McNealy

I was lucky to get in to the Hall1 of the Ball Room where more than 400 delegates were eagerly waiting to see McNealy. Sometimes arriving earlier helps :)



Scott McNealy Arrives


What he had to say:
Sun has open sourced many of the leading technolgoy and tools for the community out there.
Click and Wait...
Free... Free... Free... is the mantra! from Sun. Any legal issues can be directed to Sun and Sun will take the bullet for you.
The software is for mankind.

Indian developers form 25% of the membership in SDN yet the amount of contribution in Open Source projects is not enough. He would like to come back and see at least 25% of contribution from India.

Indian developers now have access to the supercomputers set up by Sun in US. Go to network.com and register.



Scott McNealy holds the Sun Spark Micro-processor.

The room was quite dark and the zoom level too was very high.


I must confess, Scott is a great human being. He is so down to earth and calm that I am just a fan of him.
Here is the page where you can virtually stay in touch with him www.sun.com/scott

Some of his quote during the session could be found here: http://www.sun.com/aboutsun/executives/mcnealy/myvoice.jsp#Quotes

Thursday, May 10, 2007

Sun Technology Summit '07 - India

Get ready to meet the legend - Chairman and Co-founder of Sun Microsystems, Scott McNealy - an innovator and leader in the IT industry.

He is going to be in town (Bangalore) to talk about the latest and hottest stuff relating to Java. Interested in joining?

Here are the details.

Venue: Taj Westend, Race Course Road, Bangalore
Date: 18th May, 2007
Timings: 09:00 am - 04:00 pm

Full details are registration can be found at the title of this post.

[Resource-Type: Events; Category: Java; XRating: 5]

Monday, May 07, 2007

Encrypting your password before storing in to the database.

Have you ever felt the need to encrypt those plain text passwords you store in the database for your application authentication?
Would you like to encrypt the plain text in such a way that it can only be interpreted by your application and does not make sense for a naked eye?
Here is a simple code to encrypt a plain text.

public synchronized String encrypt(String plaintext) throws SystemUnavailableException
{
MessageDigest md = null;
try
{
md = MessageDigest.getInstance("SHA"); //step 2
}
catch(NoSuchAlgorithmException e)
{
throw new SystemUnavailableException(e.getMessage());
}
try
{
md.update(plaintext.getBytes("UTF-8")); //step 3
}
catch(UnsupportedEncodingException e)
{
throw new SystemUnavailableException(e.getMessage());
}

byte raw[] = md.digest(); //step 4
String hash = (new BASE64Encoder()).encode(raw); //step 5
return hash; //step 6
}

While comparing, ecrypting the comparing plain text using the same code.
For a detailed analysis, point to the title of this post.
Thanks to James Shvarts.

[Resource-Type: Source Code; Category: J2EE/cryptography; XRating: 4]