| Thejesh GN | A Blog, A Website and A container for all my views with excerpts from technology, travel, films, india, photography, kannada, friends and other interests. I am Thejesh GN. Friends call me Thej..more. |
![]() |
Archive for June, 2008
Note:This is test post from kablog j2me mobile blog client. I have seen developers writing toString method in each of their bean class. The purpose is to print the bean variables for logging or debugging purposes. I thought of reducing their effort by writing a generic toString method to have in their base bean class. It works for simple bean classes. Its no-brainer you can modify to work for others.
public String toString() {
String lineSeaparator = System.getProperty("line.separator");
StringBuffer buffer = new StringBuffer(lineSeaparator);
buffer.append("|---------");
buffer.append(this.getClass());
buffer.append("---------|");
buffer.append(lineSeaparator);
Method[] methods = this.getClass().getMethods();
if(methods != null && methods.length >0){
Method method = null;
for(int i =0; i< methods.length; i++){
method = methods[i];
if(method.getName().startsWith("get")
&& !method.getName().startsWith("getClass")){
buffer.append
(method.getName().replaceAll("get",""));
buffer.append(" = ");
Object[] params=null;
try {
buffer.append
(method.invoke(this, params));
} catch (Exception e) {
buffer.append(" ");
}
buffer.append(lineSeaparator);
}
}
}
buffer.append("|---------------------------------------------|");
buffer.append(lineSeaparator);
return buffer.toString();
}
Any suggestions to improve are welcome. Note: This was the most read blog post on TechMag. Unfortunately lost all the content there. I have reproduced the same post here for the readers benefit. Thanks. VLC is a player but also can be used to record a screen cast ( capture the screen as video).Here is the small how to do that. This works with portable VLC too. Start the VLC By going to the installation folder and running the command >> vlc screen:// It will open the VLC and shows the screen exactly. It actually is streaming the screen I just read this new article by Anand about the SMSGupsgup. Even though I don’t agree with the traffic/numbers used for comparison I was forced to re look at Gupshup. I had an account at SMS Gupshup almost an year back. My last msg there was 359 days back and I had 84 subscribers then. Year back it was simple one to many SMS application. It didn’t have other ways of interacting than sending an expensive SMS. At the same time twitter had all those things which I needed. So the obvious choice was twitter.
I still think it needs an API to get more people attracted. By looking at the way they have introduced features in last one year, they may have it very soon.
Update: Added some more with reader contribution. Lets make it List of 101 Things you did not know about Kannada Movies. Put those interesting stuff in comments. I will add to the main article. |