<?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-1910783444548034466</id><updated>2012-01-09T07:17:34.812-08:00</updated><title type='text'>Bits of whatever</title><subtitle type='html'>This is my blog in English, about the stuff I do for a living, and about the stuff I read about the stuff I do for a living - when I am not working.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-4359903050283224957</id><published>2012-01-09T07:10:00.000-08:00</published><updated>2012-01-09T07:17:34.823-08:00</updated><title type='text'>Wow, 2012</title><content type='html'>It is already 2012. I though I'd have more posts written on this blog, but to be honest I have been a consumer and not a producer of Internet content in the recent past. I am not even listing this blog anywhere else anymore.&lt;br /&gt;&lt;br /&gt;But let's not cry over spilled milk. 2012 is here, and what does that mean? It means that I need to learn something new, and I am going towards learning HTML 5 and start porting a custom Flex/ Java app to Java only using HTML 5 and Wicket. This is going to be interesting because:&lt;br /&gt;&lt;br /&gt;. The application is fairly complex; It has menus and a MDI interface that is completely customizable;&lt;br /&gt;. It will have a very large number of forms;&lt;br /&gt;. At times it will display a very large number of components on the screen;&lt;br /&gt;. It has charts!&lt;br /&gt;&lt;br /&gt;So basically this is what I have in mind:&lt;br /&gt;&lt;br /&gt;. Create the basic navigation structure using Wicket (base pages, views, etc...);&lt;br /&gt;. Use Wicket/ JavaScript/ CSS to handle the layout of the pages/ forms, using some framework to do that if such thing exists;&lt;br /&gt;. Use the same "engine" code used today in the Flex application. We tried to keep a clear separation of what is "engine" and what is "presentation" so that any transition would be made smoothly as possible. Ideally the transition can be partial (for example, one could see charts in a HTML 5 but all the editing is done in Flex).&lt;br /&gt;&lt;br /&gt;This is a very interesting project that my employer wants. So let's see where that will get me.&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;I have been working in a home-office in the past 4 months and it has been working very well so far. I need to get a new chair but everything else has been working just fine, although I have 2 UPS units to prevent the computer from dying ever again during a power outage (a big one is used in the CPU and the smaller ones are using for monitors/ lamp/ etc...).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-4359903050283224957?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/4359903050283224957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2012/01/wow-2012.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/4359903050283224957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/4359903050283224957'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2012/01/wow-2012.html' title='Wow, 2012'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-2653891263770984659</id><published>2010-03-04T12:23:00.000-08:00</published><updated>2010-03-04T12:47:32.615-08:00</updated><title type='text'>Me, Android and Google Apps</title><content type='html'>It is funny how much I want to do something but how little time I can dedicate to that task - there are other things that come in front - family, spend the weekend together, movies, educating the kid, that sort of thing. But I spent my fair hour trying to make the Android phone send me events about its accelerometer (I figured out I was probably using the wrong mechanism, or I should be using GAME speed, or I don't know much about the platform as I thought I would), and then I decided to make a bouncing ball using their renderer engine and an object shape.&lt;br /&gt;&lt;br /&gt;It is a ball.&lt;br /&gt;&lt;br /&gt;It bounces.&lt;br /&gt;&lt;br /&gt;It is green.&lt;br /&gt;&lt;br /&gt;That is the sort of thing when I didn't know what to do and I was learning to program Basic. It starts simple, then you start playing with sin and cosin (this more or less draws something that will remind you of a bycicle wheel):&lt;br /&gt;&lt;br /&gt;(pseudo-code)&lt;br /&gt;&lt;code&gt;&lt;br /&gt;for (float rad = 0; rad &lt;= 2 * pi; rad += pi / 64) {&lt;br /&gt;   float x = horizontalCenter + radius * sin(pi);&lt;br /&gt;   float y = verticalCenter + radius * cos(pi);&lt;br /&gt;   line(horizontalCenter, verticalCenter, x, y)&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then you play more and more and more and you get a cool application that does nothing.&lt;br /&gt;&lt;br /&gt;But in today's world a mobile application should do something with the Internet. IMHO. It should get a picture somewhere, update your status someplace, turn your house light off, I don't know, something. But your mobile phone doesn't know how to handle the external world. The external world changes often, it maybe a lot of trouble to connect to some 3rd platform, and else. So you create your own server app and make your client communicate with it, and then your app communicates with 3rd parties.&lt;br /&gt;&lt;br /&gt;Opera does that in their mobile browser.&lt;br /&gt;&lt;br /&gt;The PersonalAssistant at PageOnce probably does the same.&lt;br /&gt;&lt;br /&gt;PixelPipe probably implements it like that.&lt;br /&gt;&lt;br /&gt;And the reason for that is that their mobile app won't break if any of the 25 services they connect to changes their API or gets offline. Do you have to upload a picture and Picasa doesn't want it for any reason? Keep it on your server until it can be uploaded (this is what PixelPipe does, it is a great small app).&lt;br /&gt;&lt;br /&gt;But weekend Android developers (unfortunatelly, I am in that category) don't have a server available there, and I found it hard to find free Java Web Application servers. But now there is Google Apps!&lt;br /&gt;&lt;br /&gt;... and I have to figure out what I will do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-2653891263770984659?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/2653891263770984659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2010/03/me-android-and-google-apps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/2653891263770984659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/2653891263770984659'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2010/03/me-android-and-google-apps.html' title='Me, Android and Google Apps'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-6707494368657800422</id><published>2009-10-10T10:26:00.000-07:00</published><updated>2009-10-10T10:52:16.415-07:00</updated><title type='text'>Wicket wicket wicket!</title><content type='html'>The folks at my current company were stuck with Struts 1.2, as was I. I never used Struts 2, so I really cannot say anything about it, but Struts 1 was great a while ago.&lt;br /&gt;&lt;br /&gt;But, man, all that XML to add validation to your pages, complicated JSP files - either with the JSTL library or with embedded code, all those small pieces when you use tiles...&lt;br /&gt;&lt;br /&gt;Anyway, we got this product where we had complex JSP pages and not-so-complex action pages. There was a lot of input fields but no validation - and the developer in charge decided to use JavaScript to add these validations, forgetting about the server-side of things, and we had a stream of endless problems:&lt;br /&gt;&lt;br /&gt;. The validations started growing more and more complex - for example, the field "C" would be disabled if "A" &gt; "B" but only if "D" = "E";&lt;br /&gt;. This field is to be disabled with JavaScript, so when the user enters a value in "A", the field "C" is disabled;&lt;br /&gt;. If the field "C" is disabled, then any values entered by the user have to be discarded, for that field - so the same rules that were created in JavaScript have to be added on the server.&lt;br /&gt;&lt;br /&gt;I got really upset with that. Most times, we end up chasing our own tails in poor decisions like that, and all that trouble could be avoided by doing some research before starting. So I talked to management and I did some research on which web frameworks are being used right now - and I've found Wicket. We got the book (Wicket in Action), and I got a very simple page to build.&lt;br /&gt;&lt;br /&gt;So, I start. I read the first chapters of the book, which are well written, and I understand the main bullet points of Wicket:&lt;br /&gt;&lt;br /&gt;. Everything in Wicket is based in pages - you have a pair MyPage.html and MyPage.java, similar to what you would have in .Net, and far away from the concept of action classes/ JSP pages that you have in Struts;&lt;br /&gt;. The "MyPage.html" is a HTML page where you add a wicket attribute (wicket:id) to each of the components that you will also add to the Java class of that page;&lt;br /&gt;. One of the things I first learned is that the page class is constructed only once for each user that is accessing it - much like a desktop application. Wicket will keep the state of that page automatically and you don't need to worry about it; And, because of that, if you have a component that holds a list (like a tree or a SELECT component), and that list may change according to what the user does, you need to provide the list of items from a model and not simply send it to the constructor of the component you are creating;&lt;br /&gt;. Validation is so easy it almost feel like cheating; Really. You create the text component, and then you write "component.setRequired(true)", and there you go. You can create your own custom validators, you can run your validation in the model class after the basic validation went ok.&lt;br /&gt;&lt;br /&gt;Wicket is shipped with Ajax features. It's really easy to use - everything around Wicket can be made with no much effort. You just have to take care with your code when using lists, otherwise it can really have a lot of nesting levels.&lt;br /&gt;&lt;br /&gt;So far, so good. I am creating a second application, bigger, and I am planning on using it from now ow.&lt;br /&gt;&lt;br /&gt;PS: I would put code samples in here but it's Saturday morning and I have errands to run.&lt;br /&gt;&lt;br /&gt;Interesting articles:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ptrthomas.wordpress.com/2007/03/02/wicket-impressions-moving-from-spring-mvc-webflow/"&gt;http://ptrthomas.wordpress.com/2007/03/02/wicket-impressions-moving-from-spring-mvc-webflow/&lt;/a&gt;;&lt;br /&gt;&lt;a href="http://www.infoq.com/news/2006/12/wicket-vs-springmvc-and-jsf"&gt;http://www.infoq.com/news/2006/12/wicket-vs-springmvc-and-jsf&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-6707494368657800422?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/6707494368657800422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/10/wicket-wicket-wicket.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/6707494368657800422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/6707494368657800422'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/10/wicket-wicket-wicket.html' title='Wicket wicket wicket!'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-8099841317376276324</id><published>2009-05-29T22:32:00.000-07:00</published><updated>2009-05-29T23:07:47.771-07:00</updated><title type='text'>About java exception handling</title><content type='html'>These days I started working with Java Desktop, Swing, JTables and similar components. I have done a lot of things using Java, but they were either console apps or web apps - so it was already time I started working with Desktop applications.&lt;br /&gt;&lt;br /&gt;There are some problems with the model that they use to build the dialogs and applications, some of the components have &lt;i&gt;lots&lt;/i&gt; of deprecated methods, the dialog class is not responsible for its events (you have to define it yourself), but the worst thing I noticed is that exceptions that are not catched in methods that are called in response to events are silently ignored, completely swallowed. During some research I found &lt;a href="http://www.javapractices.com/topic/TopicAction.do?Id=229"&gt;this page&lt;/a&gt; that describes a way to add an uncaught exception handler, but it's some sort of workaround.&lt;br /&gt;&lt;br /&gt;So, when I work with dialogs, I try to make the dialogs just part of the flow of the application, but in a way that each dialog is responsible for collecting some user data or outputting some information, but never being responsible for complex business logic or by important application flow.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'courier new';font-size:small"&gt;&lt;br /&gt;public static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;final LoginDialog loginDlg = new LoginDialog();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;final LoginCredentials loginCredentials = loginDlg.getLoginCredentials(); // Displays the login dialog and will return only when the user presses the "ok" button or close the dialog&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (loginCredentials == null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return; // The user cancelled the login - we should just leave the app&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Depending on how the login is performed some sort of user message has to be displayed here&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;final LoginToken loginToken;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;loginToken = performLogin(loginCredentials);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch(CannotLoginException ex) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GUIUtils.messageBox("Cannot perform login (" + ex.getMessage() + ")");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return; // More friendly would be to try again&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// We are authenticated. Let's collect user data&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;final UserDataEntryDialog dataEntryDialog = new UserDataEntryDialog();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;final UserData userData = dataEntryDialog.collectUserData();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Do something with the user data&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;final SomeBusinessLogic someBusinessLogic = new SomeBusinessLogic();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// It would be nice to display some sort of progress information - that can either be achieved through the last dialog displayed, or through some sort of progress window&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;someBusinessLogic.doYourStuff(userData);&lt;br /&gt;&amp;nbsp;&amp;nbsp;catch(Exception unexpected) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GUIUtils.displayErrorMessage("Unexpected error (sorry buddy)", unexpected); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;loggerInstance.error("Unexpected error", unexpected);&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The "progress window" is rather important, that can either be obtained by using a "global progress window" (it's the easiest approach), or by defining an interface that will be implemented by all dialogs:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'courier new';font-size:small"&gt;&lt;br /&gt;public interface ProgressDisplayDialog {&lt;br /&gt;&amp;nbsp;&amp;nbsp;void display(String msg);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;(the user should always know that something is happening and that the application hasn't simply died)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The important thing about the example above is the fact that there's no dialog chaining. Each dialog only knows about itself and is responsible for retrieving some sort of data that will be used by the business class or the main method, or whoever needs it. It's some crude form of MVC. The main advantage of this approach resides on the fact that dialogs &lt;span style="font-weight:bold;"&gt;do not invoke&lt;/span&gt; business methods. So, if in the action method of some dialog there's an exception that was not catched (or catched and ignored, something not so hard to do on UI classes as they tend to have a lot of boilerplate code), then the damage will be restricted to that dialog only - probably some event will not be completed - something like changing the selected index of a drop down list or coloring a cell in a table. In UI classes, the right thing to do in event methods is to catch the exceptions and &lt;span style="font-weight:bold;"&gt;tell the user&lt;/span&gt; about it.&lt;br /&gt;&lt;br /&gt;It also makes the navigation on the application very clear and it makes it easy to replace blocks of code if you need to.&lt;br /&gt;&lt;br /&gt;Also about exceptions, in my current company we use this API where almost every method on every class throws 3 or 4 checked exceptions, which is a pain in the butt. When I am working with this API, I make all my private methods throw an Exception (so whatever happens will be propagated to the caller), and I make my public methods either throw Exceptions, RuntimeExceptions, or some Exception class that is related to the business purpose of the class that contains the method being executed. At least by making your private methods throw Exception, your free yourself from a lot of boilerplate code. Alternativelly, if you're not too lazy or if you use some smart IDE, you can add 5 or 6 exceptions to the method signature and let other deals with that.&lt;br /&gt;&lt;br /&gt;I don't like checked exceptions :-).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-8099841317376276324?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/8099841317376276324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/05/about-java-exception-handling.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/8099841317376276324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/8099841317376276324'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/05/about-java-exception-handling.html' title='About java exception handling'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-7447466840572641167</id><published>2009-03-19T22:00:00.001-07:00</published><updated>2009-03-19T22:02:34.358-07:00</updated><title type='text'>I learned a new thing today...</title><content type='html'>I finally understood what weak references are for:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html"&gt;http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Simply put, the referenced object (by one of the &lt;span style="font-style: italic;"&gt;reference&lt;/span&gt; classes) can be claimed by the garbage collector at any time, and you wouldn`t have that object anymore. Why the hell would I want to use that, then?&lt;br /&gt;&lt;br /&gt;The answer is simply: &lt;span style="font-weight: bold;"&gt;caching&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;By doing some hack around the class &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/ref/SoftReference.html"&gt;SoftReference&lt;/a&gt;, you could have a caching mechanism that would delete objects from the cache when the Java VM needs more memory. Instead of crashing, you would lose some objects from the cache, which would have to be obtained later, but no big deal - that`s just a small performance penalty.&lt;br /&gt;&lt;br /&gt;I would like to have that knowledge 5 years ago. It would have been useful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-7447466840572641167?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/7447466840572641167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/i-learned-new-thing-today.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/7447466840572641167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/7447466840572641167'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/i-learned-new-thing-today.html' title='I learned a new thing today...'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-1187764245015206008</id><published>2009-03-13T17:06:00.001-07:00</published><updated>2009-03-13T17:06:13.729-07:00</updated><title type='text'>8 rules to discourage your employees</title><content type='html'>If you are committed to pissing off your employees, but can’t quite find the way to do so, you can follow these rules and achieve success...&lt;br/&gt;&lt;br/&gt;&lt;a href='http://www.geekstuffdaily.com/2009/03/12/8-rules-to-discourage-your-employees/'&gt;read more&lt;/a&gt; | &lt;a href='http://digg.com/programming/8_rules_to_discourage_your_employees_2'&gt;digg story&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-1187764245015206008?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/1187764245015206008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/8-rules-to-discourage-your-employees_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/1187764245015206008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/1187764245015206008'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/8-rules-to-discourage-your-employees_13.html' title='8 rules to discourage your employees'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-1243376571304413461</id><published>2009-03-09T17:09:00.001-07:00</published><updated>2009-03-09T17:09:27.383-07:00</updated><title type='text'>LINQ</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Language_Integrated_Query"&gt;Pretty interesting stuff&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Too bad I am not working with C# anymore :-(.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-1243376571304413461?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/1243376571304413461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/linq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/1243376571304413461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/1243376571304413461'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/linq.html' title='LINQ'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-2491611081983238421</id><published>2009-03-06T12:09:00.000-08:00</published><updated>2009-03-06T12:10:24.541-08:00</updated><title type='text'>Interesting stuff...</title><content type='html'>&lt;a href="http://www.finalbuilder.com/Resources/Blogs/tabid/77/EntryId/264/Top-10-Version-Control-Systems.aspx"&gt;http://www.finalbuilder.com/Resources/Blogs/tabid/77/EntryId/264/Top-10-Version-Control-Systems.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.finalbuilder.com/images/2008-survey-charts/2008-survey-source-control-current.png"/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-2491611081983238421?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/2491611081983238421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/interesting-stuff.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/2491611081983238421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/2491611081983238421'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/interesting-stuff.html' title='Interesting stuff...'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-610641017648668932</id><published>2009-03-05T22:03:00.000-08:00</published><updated>2009-03-06T11:54:14.465-08:00</updated><title type='text'>Why does Google messes up with my iGoogle page?</title><content type='html'>Every now and then I open my homepage (which is an iGoogle page), and everything is messed up - ugly frames, ugly check-boxes, and now tabs on the side of the page instead of the top.&lt;br /&gt;&lt;br /&gt;Is it beta, is it lab or is it just an annoyance?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;EDIT:&lt;/span&gt; Add the &lt;span style="font-family: courier new;"&gt;gl=all&lt;/span&gt; parameter to your home page URL, such as in: &lt;span style="font-family: courier new;"&gt;http://www.google.com/ig?gl=all&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;That should solve this annoyance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-610641017648668932?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/610641017648668932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/why-does-google-messes-up-with-my.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/610641017648668932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/610641017648668932'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/why-does-google-messes-up-with-my.html' title='Why does Google messes up with my iGoogle page?'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-5873579165539402252</id><published>2009-03-05T12:57:00.000-08:00</published><updated>2009-03-05T12:59:00.472-08:00</updated><title type='text'>Stack Overflow and the human developers</title><content type='html'>We are all human! We all like to be recognized.&lt;br /&gt;&lt;br /&gt;In my humble opinion that's why &lt;a href="http://stackoverflow.com"&gt;Stack Overflow&lt;/a&gt; is such a huge success.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-5873579165539402252?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/5873579165539402252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/stack-overflow-and-human-developers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/5873579165539402252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/5873579165539402252'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/stack-overflow-and-human-developers.html' title='Stack Overflow and the human developers'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-4051599179640135471</id><published>2009-03-05T11:15:00.000-08:00</published><updated>2009-03-05T11:18:12.227-08:00</updated><title type='text'>I am leaving, I am leaving</title><content type='html'>Today it's being announced that I am going to leave my current company to work on a different company. From Voice applications in Java using Eclipse to Corporate applications in Java using IntelliJ. It's going to be fine as well, closer to home, probably not as challenging as Voice but still a programming job with all the perks that it brings.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-4051599179640135471?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/4051599179640135471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/i-am-leaving-i-am-leaving.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/4051599179640135471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/4051599179640135471'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/i-am-leaving-i-am-leaving.html' title='I am leaving, I am leaving'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-6799472839306068325</id><published>2009-03-04T15:49:00.001-08:00</published><updated>2009-03-04T16:07:47.803-08:00</updated><title type='text'>Maven with Eclipse, not anymore...</title><content type='html'>I am a happier person now. I've disabled Maven + Eclipse integration in my current Eclipse installation and I went a little bit further - I haven't installed the Maven plugin in my current Eclipse installation.&lt;br /&gt;&lt;br /&gt;How is that possible? Here is the answer: &lt;a href="http://maven.apache.org/plugins/maven-dependency-plugin/"&gt;http://maven.apache.org/plugins/maven-dependency-plugin/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I associated the plugin execution with the phase "validate" in Maven, so every time I run the targets "validate" or "generate-sources" (or with the compilation targets "compile" or "build"), all the maven dependencies are copied to an output folder inside the "target" folder. After that, I can add these copied dependencies statically to the Eclipse project from Eclipse. And here you go, no Maven + Eclipse integration is needed anymore.&lt;br /&gt;&lt;br /&gt;Advantages:&lt;br /&gt;&lt;br /&gt;. Eclipse works better - the ammount of annoyance generated by eclipse is directly related to the number of plugins that are installed on it;&lt;br /&gt;. It's common that all the versions of a dependency are include in the classpath when running a project with Maven integration enabled - for example, commons-lang-2.1 and commons-lang-2.4. When the dependencies are copied to the target folder, only the &lt;span style="font-style: italic;"&gt;resolved&lt;/span&gt; dependencies are copied (in that case, it probably will be commons-lang-2.4);&lt;br /&gt;. Less heuristic, more deterministic - things magically start happening in the way there are supposed to.&lt;br /&gt;&lt;br /&gt;Disadvantages:&lt;br /&gt;&lt;br /&gt;. You have to remember to invoke the "mvn validate" or "mvn generate-sources" on the command-line before trying to compile your project inside Eclipse.&lt;br /&gt;&lt;br /&gt;So far, it's paying off. I have way less bugs to worry about and a lot of "down-time" was saved after I started using Eclipse without Maven.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-6799472839306068325?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/6799472839306068325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/maven-with-eclipse-not-anymore.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/6799472839306068325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/6799472839306068325'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/maven-with-eclipse-not-anymore.html' title='Maven with Eclipse, not anymore...'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-9097255315777567401</id><published>2009-03-04T15:26:00.000-08:00</published><updated>2009-03-04T15:49:01.820-08:00</updated><title type='text'>Eclipse for software development...</title><content type='html'>...is a good tool, but with a lot of bugs (particularly if using WTP).&lt;br /&gt;&lt;br /&gt;I started playing with IntelliJ now - a good tool, but with a weird "feeling" after working for so many years with Visual Studio and Eclipse.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-9097255315777567401?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/9097255315777567401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/eclipse-for-software-development.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/9097255315777567401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/9097255315777567401'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/eclipse-for-software-development.html' title='Eclipse for software development...'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1910783444548034466.post-3742305794767395808</id><published>2009-03-04T15:25:00.001-08:00</published><updated>2009-03-04T15:25:35.676-08:00</updated><title type='text'>This is going to be...</title><content type='html'>... a blog of short posts about technical stuff and not much yada-yada-yada. I am not good at that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1910783444548034466-3742305794767395808?l=bitsofwhatever.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitsofwhatever.blogspot.com/feeds/3742305794767395808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/this-is-going-to-be.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/3742305794767395808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1910783444548034466/posts/default/3742305794767395808'/><link rel='alternate' type='text/html' href='http://bitsofwhatever.blogspot.com/2009/03/this-is-going-to-be.html' title='This is going to be...'/><author><name>Ravi</name><uri>http://www.blogger.com/profile/07794427101311234936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://lh5.google.com/raviaw/RwiDKwrZqPI/AAAAAAAAJVs/NyXC0G_noFA/IMG_2169.jpg?imgmax=800'/></author><thr:total>0</thr:total></entry></feed>
