Google+ Sandeepa On Life: gwt

Pages

Search this blog

Showing posts with label gwt. Show all posts
Showing posts with label gwt. Show all posts

Tuesday, May 31, 2011

How to generate a random string in java

Want to generate a random alpha-numeric string in Java? Here's how you can do it.
If you are into coding, sooner or later you will run into this!

There are many ways to do it. Here's the one I used recently in my code.

import java.security.SecureRandom;
import java.math.BigInteger;

SecureRandom srandom = new SecureRandom();
String rand = new BigInteger(176, srandom).toString(32);
/* and you have your random string in 'rand' */

What random libraries/functions do you use?
Write in comments.

Tuesday, March 22, 2011

Accessing Local Data Store In GWT/Eclipse Development Environment

Surprisingly, not many developers know that you can browse the local data store in Java/Eclipse/GWT environment.

So, here's how you can  do it. Just point your browser to
http://localhost:8888/_ah/admin/datastore



P.S: Make sure you are Running/Debugging your app while trying this.

Leave a comment if this helped you!

Cheers,

--
Sandeepa Nadahalli