You are reading ‘Technology’ ....

Jun
24
Filed Under (Technology) by Thejesh GN on 24-06-2008

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.



Jun
24
Filed Under (Technology) by Thejesh GN on 24-06-2008

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


Read the rest of this entry »



Jun
15
Filed Under (Technology) by Thejesh GN on 15-06-2008

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.

web ui for sending updates
Smsgupshup has grown a lot in this one year to prove my this comment almost wrong. Now it has web interface which can be used for posting text or images to group. It has Gchat (I would have loved more general jabber) interface to post. Now I can subscribe to any other gupshuppers with a click of a button. It has a mobile site which is usable and friendly. Which means I revived my account at smsgupshup and sent another welcome/warning message to all my subscribers.
I guess I am going to use it more regularly now.

profile page for user

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.
I am going to be there on twitter as long as the community around me stays there.  As well now I am going to maintain the gupshup account too. I need to figure out how can I use both of them! BTW send JOIN thejeshgn 567673434 to *follow me* on gupshup.



Jun
05
Filed Under (Technology) by Thejesh GN on 05-06-2008

Reusing the code/frameworks ( either the in public domain or FOSS licensed code) is pretty common. But searching for useful code online is not very easy.The regular search engines like Google or Yahoo are not designed for code searching. Now there are few specialized code search engines which can fetch better result. Here are the top five code search engines

  1. Google Code Search
  2. Krugle
  3. Koders
  4. Oreilly Code Search
  5. CodeBase
  6. CodeFetch

All the above engines allow you to search on Language (like Java, C etc) and license (like GPL, MIT etc). Except for oreilly code search, rest of them search the internet. Oreilly code search contains the code from their books.Which currently contains over 123,000 individual examples, composed of 2.6 million lines of code all edited and ready to use. CodeFetch allows you to search all source code examples included in all books on all languages.

But be sure about license terms and conditions before reusing the code.



May
27
Filed Under (Technology) by Thejesh GN on 27-05-2008

On the fourth day of Developer Summit myself and Veetrag spent some time with Alessandro CTO of Lightstreamer. We talked about comet architecture and its application in various fields. Comment is sometimes referred as reverse AJAX and is a set of technologies used to push the live data from server to http clients.

Lightstreamer is a scalable and reliable Server for pushing live data to Rich Internet Applications. Its based on AJAX-Comet paradigm and pushes the live data to http/flex clients. A free version of Lightstreamer is available for download and can be used evaluation.