<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-31358316</id><updated>2011-08-12T19:38:36.370+05:30</updated><category term='OOP'/><category term='Ubuntu'/><category term='Collections'/><category term='TDD'/><category term='WAI'/><category term='Java'/><category term='refactoring'/><category term='MIsc'/><category term='Groovy'/><category term='Programming'/><title type='text'>Keep Sipping</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-31358316.post-3928128055510996662</id><published>2009-06-28T12:40:00.007+05:30</published><updated>2009-06-28T13:36:21.498+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><category scheme='http://www.blogger.com/atom/ns#' term='refactoring'/><title type='text'>No If No else Only OOP ;)</title><content type='html'>While going through the &lt;a href="http://www.dzone.com"&gt;Dzone&lt;/a&gt; links , i was happy and amazed to found &lt;a href="http://www.antiifcampaign.com/"&gt;Anti-IF Campaign&lt;/a&gt; . The overall aim of the campaign is to promote OOP usage in place of procedural If's and other conditional programming constructs.This would make you agile and keep complexity under control.&lt;br /&gt;&lt;br /&gt;In my current and many of past project , i have seen lots and lots of this happening as this is an easy way for a developer at any level to rationalize behavior using this constructs.But the maintenance hell you get with such crap is huge, even when you are still in System Integration or UAT stage of your project.&lt;br /&gt;&lt;br /&gt;To start with applying OOP in your cases ,try to get the abstractions right.This may take some time as this will involve understanding a bit about the domain ,if you already have not.&lt;br /&gt;Another of the best way to get into this mode is refactoring your current code with strong tests under your belt. As i am currently reading &lt;a href="http://www.refactoring.com/"&gt;Refactoring&lt;/a&gt; by &lt;a href="http://www.martinfowler.com/"&gt;Martin Fowler&lt;/a&gt;,there is one complete chapter dedicated to removing such rote ,repeating and tangled constructs with delegation and polymorphism .There are other refactorings that talk about putting behaviors in proper classes which again makes this If-else clutter go away and distributes responsibility uniformly across classes.&lt;br /&gt;&lt;br /&gt;Hurry!!! &lt;a href="http://www.antiifcampaign.com/join-the-campaign.html"&gt;Join&lt;/a&gt; the Campaign and involve your team.Feel free to share your experiences and thoughts of aligning with Anti-IF Campaign.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-3928128055510996662?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/3928128055510996662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=3928128055510996662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/3928128055510996662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/3928128055510996662'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2009/06/no-if-no-else-only-oop.html' title='No If No else Only OOP ;)'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31358316.post-5372546931320047927</id><published>2009-05-19T00:13:00.001+05:30</published><updated>2009-05-19T00:22:04.282+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Collections'/><category scheme='http://www.blogger.com/atom/ns#' term='Groovy'/><title type='text'>More Groovier collections</title><content type='html'>Ranges are a beautiful ways of mangaing feinite sequence with a defined start and end.&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;a=1..5&lt;br /&gt;println a // prints [1,2,3,4,5]&lt;br /&gt;println a.size() // prints 5&lt;br /&gt;println a.from // prints 1&lt;br /&gt;println a.to  //prints 5&lt;br /&gt;&lt;br /&gt;x='a'..'f'&lt;br /&gt;println x // prints [a,b,c,d,e,f]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can also use ranges in subscript way to get part of a list.&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;a=[1,2,3,4,5,6]&lt;br /&gt;x = 2&lt;br /&gt;println a[0..2] // printrs [1,2,3]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can also loop over each element of a range simple as follows&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;a=[1,2,3,4,5,6]&lt;br /&gt;a.each{&lt;br /&gt;    println it&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;this prints all elements on new line.&lt;br /&gt;&lt;br /&gt;Ranges can work with any objects whose class implments the Commprable interface having next and previous methods.&lt;br /&gt;&lt;br /&gt;Another interesting thing that happens with all collections in any programming langugae is looping over it.Groovy has various options to this in many elegant ways.&lt;br /&gt;&lt;br /&gt;Classical for .&lt;br /&gt;This is usual for loop found in C,C++,JAVA,etc.this makes you feel home&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;for(int i=0;i&lt;5;i++)&lt;br /&gt; println i // you know what it prints&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Iterable for.&lt;br /&gt;This for works with any class that implments iterable like ranges,lists,maps,etc.&lt;br /&gt;For on ranges&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;for(i in 0..5)&lt;br /&gt; println i&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For on lists&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;for(i in [1,2,3,4,5])&lt;br /&gt; println i&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For on maps&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;m=[a:"ant",b:"bat",c:"cat"]&lt;br /&gt;for(e in m)&lt;br /&gt;    println e.key + "=" + e.value&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For on strings&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;for(i in "Groovy")&lt;br /&gt;    println i // prints ewach character on newline&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Another flexible and intuitive nature added to collections in groovy is that all Empty collections are evaluated to false in all boolean checks. &lt;br /&gt;Following all prints true .(trick question :  try removing ! :)&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;println ![]&lt;br /&gt;println !''&lt;br /&gt;println ![:]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Feel free to share your Groovy tips and tricks in the comments section&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-5372546931320047927?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/5372546931320047927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=5372546931320047927' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/5372546931320047927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/5372546931320047927'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2009/05/more-groovier-collections.html' title='More Groovier collections'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31358316.post-6301068591474242118</id><published>2009-04-19T18:26:00.007+05:30</published><updated>2009-04-19T18:50:01.863+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Collections'/><category scheme='http://www.blogger.com/atom/ns#' term='Groovy'/><title type='text'>Groovier collections</title><content type='html'>I have been &lt;a href="http://groovy.codehaus.org/"&gt;groovying&lt;/a&gt; almost over a year now.There are many remarkable things that groovy do in a very simple and intuitive manner .If you haven't start using it, you are already late.Today , i am going to discuss how groovy takes using collection to another level.Currently, i use it for routine scripts and code generation.&lt;br /&gt;Java &lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/collections/"&gt;Collections&lt;/a&gt; framework is one of the most used SDK API (esp. in enterprise applications).This Api  allows you do handle ,manipulate and represent the Collection of any Java objects.This greatly reduces programming effort where as boosting programming performance and fostering reuse.&lt;br /&gt;Groovy adds to this many useful operators and tweaks to make working with collection api more entertaining experience.&lt;br /&gt;Following is the ways you create a List in groovy:&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;L=[0,1,2,3]&lt;br /&gt;println L.class //prints class java.util.ArrayList&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This showing that ArrayList is used by groovy behind the scenes to create a List representation.&lt;br /&gt;&lt;br /&gt;To work with LinkedList do this&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;L = new LinkedList([0,1,2,3]);&lt;br /&gt;println L.class&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To access, any element from the List , you can use array-like notation familiar to most of Java developers.Other ways to retrieve the elements are get and getAt methods expecting the index (-ve index allowed).&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;println L[2] //prints 2&lt;br /&gt;println L[-3] //prints 1&lt;br /&gt;println L.get(0) //prints 0&lt;br /&gt;println L.getAt(1) //prints 1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The most frequent operation done on a list is to add elements to it.This can be acheived using +=,&lt;&lt; or using add method.To merge 2 lists use, addAll or + operator.&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;L = [0,1,2,3]&lt;br /&gt;L += 4&lt;br /&gt;L &lt;&lt; 5&lt;br /&gt;L.add(6)&lt;br /&gt;println L //prints [0,1,2,3,4,5,6]&lt;br /&gt;L.addAll(["a","b"])&lt;br /&gt;println L // prints [0,1,2,3,4,5,6,a,b]&lt;br /&gt;K = L + [99,100]&lt;br /&gt;println K // prints [0,1,2,3,4,5,6,a,b.99.100]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Removing an element is equally easy.Use -,-= or call minus.remove() method of list is too supported.&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;L = [0,1,2,3]&lt;br /&gt;L -= [3]&lt;br /&gt;println L //prints [0,1,2]&lt;br /&gt;L = L.minus(2)&lt;br /&gt;println L //prints [0,1]&lt;br /&gt;L.remove(0)&lt;br /&gt;println L //prints [1]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Reversing the content of the list can be done as&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;L = [0,1,2,3]&lt;br /&gt;println L.reverse() //prints [3,2,1,0]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Using map is easier than ever, the content left to the : is the key and to the right is the value.&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;M= ['a':'A','b':'B','c':'C']&lt;br /&gt;println M // prints [a:A,b:B,c:C]&lt;br /&gt;println M.getClass() //prints java.util.LinkedHashMap.We cannot use .class as . is reserved to access the key-values&lt;br /&gt;println new HashMap(['a':'A','b':'B','c':'C']) // prints [a:A,b:B,c:C]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Retreiving value can be done numerous ways.&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;M= ['a':'A','b':'B','c':'C']&lt;br /&gt;println M.a // prints A&lt;br /&gt;println M['a'] // prints A&lt;br /&gt;println M.get('c') // prints C&lt;br /&gt;println M.getAt('b') // prints B&lt;br /&gt;println M.getAt('x') // prints null as no key is matched.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Adding new key-value pairs too has various alternative.&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;M= ['a':'A','b':'B','c':'C']&lt;br /&gt;M['d'] = 'D'&lt;br /&gt;println M // prints ['a':'A','b':'B','c':'C','d':'D']&lt;br /&gt;M.put('e','E')&lt;br /&gt;println M // prints ['a':'A','b':'B','c':'C','d':'D','e':'E']&lt;br /&gt;M.putAt('f','F')&lt;br /&gt;println M // prints ['a':'A','b':'B','c':'C','d':'D','e':'E','f':'F']&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Remove a pair with remove method paasing the Key.&lt;br /&gt;&lt;pre name="code" class="groovy"&gt;&lt;br /&gt;M= ['a':'A','b':'B','c':'C']&lt;br /&gt;M.remove('b') = 'D'&lt;br /&gt;println M // prints ['a':'A','c':'C']&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;i'll cover more groovy stuff in upcoming posts.&lt;br /&gt;till then...happy Groovying ;)&lt;br /&gt;&lt;br /&gt;P.S : Syntax high lighting help from &lt;a href="http://fahdshariff.blogspot.com/2008/07/syntax-highlighting-code-in-webpages.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-6301068591474242118?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/6301068591474242118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=6301068591474242118' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/6301068591474242118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/6301068591474242118'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2009/04/groovier-collections.html' title='Groovier collections'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31358316.post-4450952319290218130</id><published>2009-04-04T22:10:00.006+05:30</published><updated>2009-04-19T18:48:59.780+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Freemind on Ubuntu</title><content type='html'>Today i installed JDK6u13 and wanted to try out &lt;a href="http://freemind.sourceforge.net/"&gt;Freemind&lt;/a&gt; , one of the best free mind mapping tools.As i am still very new to mind mapping but a seasoned Java developer , i thought that i will start rolling soon with this tool.But , it turned otherwise.&lt;br /&gt;&lt;br /&gt;After unzipping the freemind (binaries for any operating system - max - all inclusive) version to /opt,i chmodED it as executable.Now ,i tried to start it with the shell script file provided and what i got was&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size:85%;"&gt;Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;  at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;  at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(libgcj.so.70)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;  at java.awt.Window.&lt;/span&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;(libgcj.so.70)&lt;/span&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;  at java.awt.Frame.&lt;/span&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;(libgcj.so.70)&lt;/span&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;  at javax.swing.JFrame.&lt;/span&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;(libgcj.so.70)&lt;/span&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;  at freemind.main.FreeMind.&lt;/span&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;(FreeMind.java:107)&lt;/span&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;  at freemind.main.FreeMind.main(FreeMind.java:647)&lt;/span&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;Caused by: java.lang.UnsatisfiedLinkError: libgtkpeer: libgtkpeer.so: cannot open shared object file: No such file or directory&lt;/span&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;  at java.lang.Runtime._load(libgcj.so.70)&lt;/span&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;  at java.lang.Runtime.loadLibrary(libgcj.so.70)&lt;/span&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;  at java.lang.System.loadLibrary(libgcj.so.70)&lt;/span&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;span style="font-size:85%;"&gt;  at gnu.java.awt.peer.gtk.GtkToolkit.&lt;/span&gt;&lt;clinit&gt;&lt;span style="font-size:85%;"&gt;(libgcj.so.70)&lt;/span&gt;&lt;/clinit&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;clinit&gt;&lt;span style="font-size:85%;"&gt;  at java.lang.Class.initializeClass(libgcj.so.70)&lt;/span&gt;&lt;/clinit&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;clinit&gt;&lt;span style="font-size:85%;"&gt;  at java.lang.Class.forName(libgcj.so.70)&lt;/span&gt;&lt;/clinit&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;clinit&gt;&lt;span style="font-size:85%;"&gt;  at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)&lt;/span&gt;&lt;/clinit&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;clinit&gt;&lt;span style="font-size:85%;"&gt;  ...6 more&lt;/span&gt;&lt;/clinit&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;br /&gt;&lt;/div&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;clinit&gt;&lt;/clinit&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/div&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;init&gt;&lt;clinit&gt;&lt;br /&gt;&lt;br /&gt;Even though , i installed JDK6u13 and had it as my default java executable after updating the .profile file, then to some how this script was picking up the java from gcj package.&lt;br /&gt;&lt;br /&gt;so i started to dig and find out is this happening.Sooner using sudo update-java-alternatives -l i was able to find out that i only had gcj installed and registerd in ubuntu.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;X@X-desktop:/opt/Freemind$ sudo update-java-alternatives -l&lt;br /&gt;java-gcj 1041 /usr/lib/jvm/java-gcj&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now, i was in search of a resource which will show me how to get java from JDK6u13 to be my default.After a quick google , i found &lt;a href="http://www.64bitjungle.com/ubuntu/install-java-jre-160-update-x-on-hardy-as-the-default-java-runtime/"&gt;this&lt;/a&gt;.So next set i ran&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;X@X-desktop:/opt/Freemind$ sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.6.0_13/bin/java" 1&lt;br /&gt;X@X-desktop:/opt/Freemind$ sudo update-alternatives --set java /opt/jdk1.6.0_13/bin/java&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;And then started the shell script..VOILA..it started&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8IxRMbq1IS8/SdeU9WRyEGI/AAAAAAAAAOs/CSIy8PqbbFI/s1600-h/freemind.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_8IxRMbq1IS8/SdeU9WRyEGI/AAAAAAAAAOs/CSIy8PqbbFI/s200/freemind.png" alt="" id="BLOGGER_PHOTO_ID_5320885266434625634" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Drop me a cooment if this helps you , or you have good mind mapping sites/online book urls.&lt;br /&gt;&lt;/clinit&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-4450952319290218130?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/4450952319290218130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=4450952319290218130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/4450952319290218130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/4450952319290218130'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2009/04/freemind-on-ubuntu.html' title='Freemind on Ubuntu'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8IxRMbq1IS8/SdeU9WRyEGI/AAAAAAAAAOs/CSIy8PqbbFI/s72-c/freemind.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31358316.post-8063293708722935088</id><published>2009-02-01T21:45:00.004+05:30</published><updated>2009-02-01T21:56:56.857+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='TDD'/><title type='text'>Want to begin TDD?</title><content type='html'>i have joined the &lt;a href="mailto:testdrivendevelopment-subscribe@yahoogroups.com"&gt;Test-driven development&lt;/a&gt; yahoo mailing group.Its a great place to see all levels of TDD practitioners out there and their innovative ideas.&lt;br /&gt;One of the thread there mentioned a resource which may help you kickstart the TDD.&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;a href="http://sites.google.com/site/tddproblems/"&gt;TDD Problems&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;This present programmer with problems that will help them learn and improve their TDD skills.The problem categorization is huge and divided into games,Web related,and many more.&lt;br /&gt;This is worth a check for any TDD practitioners .This will help beginners improvise their skills whereas advanced user to guide their colleagues to follow TDD.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-8063293708722935088?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/8063293708722935088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=8063293708722935088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/8063293708722935088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/8063293708722935088'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2009/02/want-to-begin-tdd.html' title='Want to begin TDD?'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31358316.post-4442193276154605356</id><published>2008-10-21T23:01:00.008+05:30</published><updated>2009-02-01T21:57:40.630+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Loading Jars Dynamically</title><content type='html'>Post after really long time..from now on ..i ''ll be frequently updating this with random but interesting java posts.&lt;br /&gt;Earlier this week i had a requirement to dynamically load some classes in the current JVM's classpath from some external Jar files.&lt;br /&gt;The way to load classes dynamically from any particular location is to use a java.net.URLClassLoader.&lt;br /&gt;Lets see some code.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" id="code" class="java"&gt;//Here u specify the URL for a jar on the file system&lt;br /&gt;String filePath = "jar:file:///" + sysfilePath + "!/";&lt;br /&gt;//Make a URL out of It.&lt;br /&gt;URL url = new URL(filePath);&lt;br /&gt;//Use the ClassLoder to Load that Jar&lt;br /&gt;//You can pass in as many URL you want to the classloader&lt;br /&gt;URLClassLoader clazzLoader = new URLClassLoader(new URL[]{url});&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I am thinking to build a fluent interface on this classloader which will allow me to dynamically load more jars as the application goes along.&lt;br /&gt;&lt;br /&gt;While researching and googling for this, i  upon this &lt;a href="http://jcloader.sourceforge.net/"&gt;JCL&lt;/a&gt;.Worth a try.&lt;br /&gt;&lt;br /&gt;Do you have any recommendations or alternative approaches?Do comment below.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-4442193276154605356?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/4442193276154605356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=4442193276154605356' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/4442193276154605356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/4442193276154605356'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2008/10/post-after-really-long-time.html' title='Loading Jars Dynamically'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31358316.post-116383282472023424</id><published>2006-11-18T12:14:00.000+05:30</published><updated>2009-04-19T18:49:21.419+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='MIsc'/><title type='text'>LIFE..........its just about having FUN..</title><content type='html'>I just &lt;a href="http://www.stumbleupon.com/"&gt;StumbledUpon&lt;/a&gt; this thing in morning while surfing @ HOME.&lt;br /&gt;It really shook me.&lt;br /&gt;It showed simple 8 reasons of having fun in life which all of us unKnowingly (sometimes even Knowingly)just ignore or forget.&lt;br /&gt;Just spend some minutes through this simple but really interesting flash movie.&lt;br /&gt;Really it will make you lot more comfortable and make you know what are you really missing in life.&lt;br /&gt;&lt;a href="http://www.eightprinciples.com/"&gt;http://www.eightprinciples.com/&lt;/a&gt;&lt;sup&gt;*&lt;/sup&gt;&lt;br /&gt;&lt;br /&gt;Enjoy&lt;br /&gt;&lt;br /&gt;&lt;sup&gt;*&lt;/sup&gt;If you have sound, you can also hear the soothing music :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-116383282472023424?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/116383282472023424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=116383282472023424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/116383282472023424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/116383282472023424'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2006/11/lifeits-just-about-having-fun.html' title='LIFE..........its just about having FUN..'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31358316.post-115790799510454680</id><published>2006-09-10T21:45:00.000+05:30</published><updated>2009-04-19T18:48:21.765+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WAI'/><title type='text'>WAI Tools I Used</title><content type='html'>Finally, i compeleted my WAI related things and here to share my experiences.&lt;br /&gt;The tools that really helped me are again &lt;a href="http://www.w3.org/"&gt;W3C &lt;/a&gt;&lt;a href="http://validator.w3.org/"&gt;validator&lt;/a&gt;(BTW W3C itself rollsout the spec) and ATRC &lt;a href="http://checker.atrc.utoronto.ca/index.html"&gt;Accessibility Checker &lt;/a&gt;which is developed by  Adaptive Technology Resource Centre  based upon the proposed Open Accessibility Checks (OAC).&lt;br&gt;&lt;br /&gt;I used W3CValidator to check WAI and XHTML markup validation.It is a great tool and you can provide either the url to validate or directly upload the content through file or inpput textarea.The result of validation shows level of violation(Error,warning,etc) with the line number of the content provided.&lt;br&gt;&lt;br /&gt;Here's an example,&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/215/3390/1600/waierror.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/215/3390/320/waierror.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;p&gt;Accessibility Checker tool was setup on a machine ,it gave results in a browsable manner dividing pages int ot tables,frames,images,etc.It also shows the part with violation in results.The installation is trivial.It requires JAVA and Apache Tomcat for working.&lt;br /&gt;&lt;br /&gt;Bobby(from &lt;a href="http://www.watchfire.com/"&gt;WatchFire&lt;/a&gt;) is a windows desktop tool which spiders the particular web application and runs checks on all html pages.But as we were not working on pure HTML it was not useful for us.Reports are again browsable with abilty to make projects ,have scheduled checks, nad many more features.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-115790799510454680?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/115790799510454680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=115790799510454680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/115790799510454680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/115790799510454680'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2006/09/wai-tools-i-used.html' title='WAI Tools I Used'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31358316.post-115425018445606278</id><published>2006-07-30T14:19:00.000+05:30</published><updated>2009-04-19T18:48:37.041+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>ANTic Problem</title><content type='html'>Last week working on a continuous buils setup for a project, i stumbled upon a issue with &lt;a href="http://ant.apache.org"&gt;ANT&lt;/a&gt;(Another Neat Tool), Java build tool.&lt;br /&gt;The buildfile was working from the current directory where the file was , but was failing if ant was invoked from outside the directory.&lt;br /&gt;So when i said &lt;br/&gt;&lt;span style="font-style:italic;"&gt;ant &lt;/span&gt;&lt;br/&gt;in the current folder the build would happen successfully, but if i triggered  the build from any other location using &lt;br/&gt;&lt;span style="font-style:italic;"&gt;ant -f some_dir/build.xml&lt;/span&gt; &lt;br/&gt;it would fail.&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;I digged into the build file and found that all the property declarations were using value attribute to refer relative paths.Here the problem lied.&lt;br /&gt;I changed the value attribute to location and Voila....... it started working.So it seems that sometimes minor mishaps can cause a blunder(and posssible time waste) while automating any actvity.&lt;br /&gt;&lt;br /&gt;Just to summarize,&lt;span style="font-weight:bold;"&gt;&lt;blockquote&gt;&lt;/blockquote&gt;Always use location attributes for properties , if you are refereing to paths in your buildfile&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-115425018445606278?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/115425018445606278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=115425018445606278' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/115425018445606278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/115425018445606278'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2006/07/antic-problem.html' title='ANTic Problem'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31358316.post-115424932491182693</id><published>2006-07-30T14:07:00.000+05:30</published><updated>2009-04-19T18:48:21.765+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WAI'/><title type='text'>Looking for WAI Tools</title><content type='html'>For past couple of weeks i am working on WAI-fying web applications. i have come across couple of good online tools the &lt;a href="http://www.w3.org/"&gt;W3C &lt;/a&gt;&lt;a href="http://validator.w3.org/"&gt;validator&lt;/a&gt;  and ATRC &lt;a href="http://checker.atrc.utoronto.ca/index.html"&gt;Accessibility              Checker&lt;/a&gt; Java based Server Side tool.&lt;br /&gt;&lt;br /&gt;Have any body used other Open Source WAI Tools?&lt;br /&gt;Can u share those with me?&lt;br /&gt;What are your experiences?&lt;br /&gt;&lt;br /&gt;I'll be putting my experience here....so stay tuned for more WAI.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-115424932491182693?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/115424932491182693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=115424932491182693' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/115424932491182693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/115424932491182693'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2006/07/looking-for-wai-tools.html' title='Looking for WAI Tools'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31358316.post-115332002793564875</id><published>2006-07-19T20:02:00.000+05:30</published><updated>2006-07-19T20:10:27.943+05:30</updated><title type='text'>Here i go...........</title><content type='html'>Atlast a blog, me and my thoughts  which doesn't always makes it where its intended.&lt;br /&gt;So Let me start.&lt;br /&gt;Here, i'll be blogging about &lt;a href="http://java.sun.com"&gt;Java&lt;/a&gt;,Programming,hobbies,etc.&lt;br /&gt;Seems like everyday things.&lt;br /&gt;So till next time.....&lt;br /&gt;Keep Sipping..Keep Coding :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31358316-115332002793564875?l=sunnyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunnyjava.blogspot.com/feeds/115332002793564875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31358316&amp;postID=115332002793564875' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/115332002793564875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31358316/posts/default/115332002793564875'/><link rel='alternate' type='text/html' href='http://sunnyjava.blogspot.com/2006/07/here-i-go.html' title='Here i go...........'/><author><name>Santosh Gokak</name><uri>http://www.blogger.com/profile/08040588164060074962</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
