<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hari Gangadharan's Blog</title>
	<atom:link href="http://www.harinair.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.harinair.com</link>
	<description>From the desk of a gadget lover</description>
	<lastBuildDate>Wed, 25 Aug 2010 18:42:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Spring (Acegi) Security Account Lockout</title>
		<link>http://www.harinair.com/2010/02/spring-acegi-security-account-lockout/</link>
		<comments>http://www.harinair.com/2010/02/spring-acegi-security-account-lockout/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 07:28:22 +0000</pubDate>
		<dc:creator>Hari Gangadharan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.harinair.com/?p=167</guid>
		<description><![CDATA[Due to my previous articles in Spring Security, some has asked me how to implement the Account Lockout on too many failed login attempts. The best way to do this is to listen for Spring events and update your User object on a failed login.  Let us start with your User object. It must be [...]]]></description>
			<content:encoded><![CDATA[<p>Due to my previous articles in Spring Security, some has asked me how to implement the Account Lockout on too many failed login attempts. The best way to do this is to listen for Spring events and update your User object on a failed login.  Let us start with your User object. It must be implementing the UserDetails interface and you might have already noticed that it has a method isAccountNonLocked(). You might be currently returning true in the implementation. Now we have to change the logic here to implement locked status.<br />
<span id="more-167"></span></p>
<pre name="code" class="java">
// User.java
public class User implements Serializable,
     org.springframework.security.userdetails.UserDetails {
    // let us put max failed login attempts at 5
    public static final short MAX_FAILED_LOGIN_ATTEMPTS = 5;

    /**
     * An attribute to track the number of failed login attempts
     */
    private int failedLoginAttempts;

    // all other attributes and the getters and setters.

    /**
     * Implementation for the UserDetails interface. Verifies that
     * the account is not locked. Returns true if account is not
     * locked. Otherwise returns false.
     */
    public boolean isAccountNonLocked() {
        if (this.getFailedLoginAttempts()
                   >= MAX_FAILED_LOGIN_ATTEMPTS) {
            return false;
        }
        return true;
    }
}
</pre>
<p>That takes care of the actual locking of the account. Now we have to increment the failedLoginAttempts every time an user enters the wrong credentials. Luckily, Spring Security creates an AuthenticationFailureBadCredentialsEvent every time a user tries to login with wrong credentials. Now we have to implement an ApplicationListener to listen for this event. This class shall implement the Spring ApplicationListener interface.  Actually you need only one application listener for your whole application:</p>
<pre name="code" class="java">
public class ApplicationEventListener implements
    org.springframework.context.ApplicationListener {
    public void onApplicationEvent(ApplicationEvent event) {
        if (event instanceof AuthenticationFailureBadCredentialsEvent){
            // do everything for bad login
            // (increment failedLoginAttempts)
        else if (event instanceof SomeOtherEvent) {
            // handle the "some other event"!
        }
    }
}
</pre>
<p>However somebody with a little bit of Object Oriented Programming knowledge can tell that this is a bad design. The reason is this class handles too many events and this class has to be modified whenever your application has to listen for a new event. Hence we will refactor the code in an Object Oriented way. We will modify this class to listen for the application events and to dispatch it to an appropriate listener. We will then create one listener for every Event we have to handle. To begin, an abstract class EventListener is created. All event listeners extend this class and implement the abstract methods. This could have been an interface but it has been created as an abstract class so that I can add the code to automatically register the listener with the main application event dispatcher.</p>
<pre name="code" class="java">
// EventListener.java
package wisdom.web.event;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * An abstract class that is the parent for event listeners
 * in this application. Any event listener should extend
 * this class.
 *
 * @author Hari Gangadharan
 */
public abstract class EventListener implements InitializingBean {

    Log log = LogFactory.getLog(this.getClass());

   // the instance of the event dispatcher will be
   // auto-wired by spring
   @Autowired
   EventDispatcher eventDispatcher;

   // Spring will call this method after auto-
   // wiring is complete.
   public void afterPropertiesSet() throws Exception {
       // let us register this instance with
       // event dispatcher
       eventDispatcher.registerListener(this);
   }

   /**
    * Implementation of this method checks whether the given event can
    * be handled in this class. This method will be called by the event
    * dispatcher.
    *
    * @param event the event to handle
    * @return true if the implementing subclass can handle the event
    */
   public abstract boolean canHandle(Object event);

   /**
    * This method is executed by the event dispatcher with the
    * event object.
    *
    * @param event the event to handle
    */
   public abstract void handle(Object event);
}
</pre>
<p>Here you will see that this bean auto-wires the EventDispatcher (which we have not written yet). Also we register this instance to the EventDispatcher after the properties are set. Now we will write an Event Dispatcher that receives Spring Events and dispatches it to the appropriate Listener.</p>
<pre name="code" class="java">
// EventDispatcher.java
package wisdom.web.event;

import java.util.ArrayList;
import java.util.List;
import org.springframework.context.ApplicationEvent;
import org.springframework.stereotype.Component;

/**
 * This class implements the Spring ApplicationListener interface and
 * hence it receives application event notifications. This in turn
 * dispatches the events to listeners that have registered with
 * this object.
 *
 * @author Hari Gangadharan
 */
@Component("eventDispatcher")
public class EventDispatcher implements
     org.springframework.context.ApplicationListener {

    List&lt;EventListener&gt; listeners = new ArrayList&lt;EventListener&gt;();

    /**
     * Method that allows registering of an Event Listener.
     */
    public void registerListener(EventListener listener) {
        listeners.add(listener);
    }

    /**
     * Spring executes this method with the event object.
     * This method iterates though the list of registered
     * Listeners and checks whether any listener can
     * handle the event. Calls handle method of the
     * Listener if it can handle the event.
     */
    public void onApplicationEvent(ApplicationEvent event) {
        for (EventListener listener: listeners) {
            if (listener.canHandle(event)) {
                listener.handle(event);
            }
        }
    }
</pre>
<p>Now we are ready to write the code that will listen for the login failures. As you know this code will increment the failedLoginAttempt of User object.</p>
<pre name="code" class="java">
// LoginFailureEventListener.java
package wisdom.web.event;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.event.authentication
      .AuthenticationFailureBadCredentialsEvent;
import org.springframework.stereotype.Component;
import wisdom.api.model.User;
import wisdom.api.service.UserManager;

/**
 * A listener that listens for the Login Failure Event. This listener
 * updates the failed login attempt count which in turn locks out
 * the user.
 *
 * @author Hari Gangadharan
 */
@Component("loginFailureEventListener")
public class LoginFailureEventListener extends EventListener {
    // this is your User Service. We call a method
    // in this to update the User object.
    @Autowired
    UserManager userManager;

    @Override
    public boolean canHandle(Object event) {
        return event instanceof
             AuthenticationFailureBadCredentialsEvent;
    }

    @Override
    public void handle(Object event) {
        AuthenticationFailureBadCredentialsEvent loginFailureEvent
             = (AuthenticationFailureBadCredentialsEvent) event;
        Object name = loginFailureEvent.getAuthentication()
                  .getPrincipal();
        User user = userManager.getUser((String) name);
        if (user != null) {
            // update the failed login count
            short failedLoginAttempts = user.getFailedLoginAttempts();
            user.setFailedLoginAttempts(++failedLoginAttempts);
            // update user
            userManager.updateUser(user);
        }
    }
}
</pre>
<p>We are almost there&#8230; Now the we have to do two more things. Can you guess? The first one is to create another listener for successful authentication event. If the user is successful in logging in and if the failedLoginAttempts count is greater than 0 then we have reset the count (to 0). Otherwise the failedLoginAttempts may get accumulated over time with occasional login failures and finally the account may become locked. The second  thing to do is to alert the user if the account is locked. Let us do the first thing viz. the listener now:</p>
<pre name="code" class="java">
// LoginSuccessEventListener.java
package wisdom.web.event;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.event.authorization.AuthorizedEvent;
import org.springframework.stereotype.Component;
import wisdom.api.model.User;
import wisdom.api.service.UserManager;

/**
 * Listens for the Login Success.
 * This class resets the failed login count.
 *
 * @author Hari Gangadharan
 */
@Component("loginSuccessEventListener")
public class LoginSuccessEventListener extends EventListener {

    @Autowired
    UserManager userManager;
    /**
     * A private method that gets the User object
     * from the event if it is an AuthorizedEvent.
     * Otherwise returns null.
     */
    private User getPrincipal(Object event) {
        if (event instanceof AuthorizedEvent) {
            AuthorizedEvent authorizedEvent = (AuthorizedEvent) event;
            Object principal = authorizedEvent.getAuthentication()
                     .getPrincipal();
            if (principal instanceof User) {
                return (User) principal;
            }
        }
        return null;
    }

    @Override
    public boolean canHandle(Object event) {
        User principal = this.getPrincipal(event);
        return (principal != null);
    }

    @Override
    public void handle(Object event) {
        User user = this.getPrincipal(event);
        try {
            if (user.getFailedLoginAttempts() > 0) {
                // reset failed login count to zero
                // on a successful login
                user.setFailedLoginAttempts((short) 0);
                // update user
                userManager.updateUser(user);
            }
        } catch (Exception ex) {
            // just log the exception
            log.error("Failure in login success event handling", ex);
        }
    }
}
</pre>
<p>That completes the listener. Now we have to do the last thing &#8211; alert the user that the account is locked and direct the user to further actions like contacting customer care or verifying account. Depending on the framework used, you may have to figure out where the code is to be added:</p>
<pre name="code" class="java">
ExternalContext externalContext = FacesUtils.getExternalContext();
Exception e = (Exception) externalContext.getSessionMap().get(
         AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY);
// check if there is a Bad Cred Exception
if (e instanceof BadCredentialsException) {
    // add code to show the Login Invalid Error Message
// check if it is Account Locked
} else if (e instanceof LockedException) {
    // add code to show Account Locked Error Message
}
// reset the last exception key
externalContext.getSessionMap().put(
     AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY, null);
</pre>
<p>If the framework used is JSF the above code can go into the Phase Listener or on the the form binding variable setter for the login form.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harinair.com/2010/02/spring-acegi-security-account-lockout/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Six Softwares I cannot live without!</title>
		<link>http://www.harinair.com/2009/07/six-softwares-i-cannot-live-without/</link>
		<comments>http://www.harinair.com/2009/07/six-softwares-i-cannot-live-without/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 00:07:08 +0000</pubDate>
		<dc:creator>Hari Gangadharan</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.harinair.com/?p=146</guid>
		<description><![CDATA[I thought this time I will write about some not so popular but very useful software. This list is in no particular order but I use all of these everyday!
1. XMind http://www.xmind.net
XMind is a mind-mapping and brainstorming software. It was a big help to chart our thoughts, during the time we were running the startup.


2. [...]]]></description>
			<content:encoded><![CDATA[<p>I thought this time I will write about some not so popular but very useful software. This list is in no particular order but I use all of these everyday!</p>
<p>1. <strong>XMind</strong> <a href="http://www.xmind.net">http://www.xmind.net</a><br />
XMind is a mind-mapping and brainstorming software. It was a big help to chart our thoughts, during the time we were running the startup.<br />
<span id="more-146"></span><br />
<img src="http://www.harinair.com/wp-content/uploads/2009/07/webos.png" alt="A Mind-Map created with Jing" title="A Mind-Map created with Jing" width="521" height="509" class="alignnone size-full wp-image-163" /></p>
<p>2. <strong>7-zip</strong> <a href="http://www.7-zip.org/">http://www.7-zip.org</a><br />
This is the one zip / unzip software that can unzip all the zip files from rar, zip, tar, gzip and even its own 7z format.</p>
<p>3. <strong>Techsmith Jing</strong> <a href="http://www.jingproject.com/">http://www.jingproject.com/</a><br />
Jing allows you to take screen shots, make screen casts and even annotate your screen shots. Web developers spend time writing back and forth comments about a screen without clearly explaining what they mean. &#8220;Instead of talking at people, show them what you see&#8230;&#8221;. It is a must have for all people who work in web development, testing or design.<br />
<img src="http://www.harinair.com/wp-content/uploads/2009/07/spotadventurequestions.png" alt="Screen shots created using Jing" title="Screen shots created using Jing" width="518" height="411" class="alignnone size-full wp-image-156" /></p>
<p>4. <strong>Keepass</strong> <a href="http://keepass.info">http://keepass.info</a><br />
How many of you use the same password in all of your accounts so that it is easy to remember them? Most people I know share passwords keeping only a maximum of 3 easy to remember passwords. There were some commercially available password safes where you can encrypt and save your passwords. But I was not comfortable using a proprietary software from some unknown company. Now we have a popular open source password safe. Since its code is open source it would have been reviewed by many developers. Better yet Keepass is available in most platforms including mobile platforms like Blackberry and Windows Mobile. An iPhone app is also user development. I now use that to remember all my passwords and I no longer use a single password for all sites <img src='http://www.harinair.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>5. <strong>Dropbox </strong><a href="https://www.getdropbox.com/referrals/NTEwOTY4NjA5">https://www.getdropbox.com</a><br />
Dropbox allow you to synchronize your files among multiple computers. One easy way to synchronize my Keepass file and other files between my home and work PC! It also keeps the versions of your changes to the files. They also support multiple OS including Windows, Mac and Linux. A 2 GB basic account is free.</p>
<p>6. <strong>Vim for Windows</strong> <a href="http://www.vim.org">http://www.vim.org</a><br />
I love Unix and I always say the old line lifted from some unknown author: &#8220;Unix is User friendly&#8230; but it chooses its friends&#8221;. If you learn how to use vi, it becomes a necessity. I love the easiness by which I can repeat a command or record a macro. For people who are vi-challenged, I recommend Notepad++ <a href="http://notepad-plus.sourceforge.net">http://notepad-plus.sourceforge.net</a>. It is also a wonderful text editor which I use. It is a must have editor for all developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harinair.com/2009/07/six-softwares-i-cannot-live-without/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back in US!</title>
		<link>http://www.harinair.com/2009/07/back-in-us/</link>
		<comments>http://www.harinair.com/2009/07/back-in-us/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 19:40:22 +0000</pubDate>
		<dc:creator>Hari Gangadharan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.harinair.com/?p=140</guid>
		<description><![CDATA[After a month long journey and two kids with dysentery, I am happy to be back home in California. I am still recovering from my jet-lag. These days I am sleeping very early, probably by 8:30 PM because of the jet-lag. Hopefully I will over with that by the end of this week.
On my way [...]]]></description>
			<content:encoded><![CDATA[<p>After a month long journey and two kids with dysentery, I am happy to be back home in California. I am still recovering from my jet-lag. These days I am sleeping very early, probably by 8:30 PM because of the jet-lag. Hopefully I will over with that by the end of this week.</p>
<p>On my way back from India we stayed 4 days in Dubai, UAE. It is amazing how they have constructed that huge city in the middle of a desert. The Burj Dubai, Burj Al Arab and the Palm Jumeriah are impressive. Dubai seemed to be an extension of Kerala since we could go into any store and start talking in Malayalam. Probably half of Dubai residents are people from Kerala, India. The food there is cheap and good. The third day, we went on a desert safari which we all enjoyed. My kids had a blast riding ATV on desert.</p>
<p>However I am amazed by the lack of the concept of a family (at least in the public), especially among local population. It is hard to find a family go together to a mall or a restaurant. You can see groups of men and groups of ladies roaming separately which is hard to see in US or any other western country.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harinair.com/2009/07/back-in-us/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Visakhapatnam visit</title>
		<link>http://www.harinair.com/2009/06/my-visakhapatnam-visit/</link>
		<comments>http://www.harinair.com/2009/06/my-visakhapatnam-visit/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 17:14:41 +0000</pubDate>
		<dc:creator>Hari Gangadharan</dc:creator>
				<category><![CDATA[Travel]]></category>
		<category><![CDATA[india]]></category>
		<category><![CDATA[visakhapatnam]]></category>

		<guid isPermaLink="false">http://www.harinair.com/?p=135</guid>
		<description><![CDATA[Last week I visited Visakhapatnam, the place where I started my career. That was so long back. I went there after 15 years to visit my old friends, my colleagues and above all to show my kids what I did in those days. I worked in the Visakhapatnam Steel Plant. I was so proud to [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I visited <a href="http://en.wikipedia.org/wiki/Visakhapatnam">Visakhapatnam</a>, the place where I started my career. That was so long back. I went there after 15 years to visit my old friends, my colleagues and above all to show my kids what I did in those days. I worked in the Visakhapatnam Steel Plant. I was so proud to show my kids the basics of Steel Making&#8230; the Blast Furnace, the Linz-Donawitz Converter, the Continuous Cast Machines and the Rolling Mills. I am pretty sure my wife and kids never thought that the Steel Plant was that huge.<br />
<span id="more-135"></span><br />
Visakhapatnam and the Steel City (the Ukkunagaram) looked totally different. The Steel City looked so nice and clean 15 years back. Now it looks pretty much beat up. The roads are well maintained but the houses seemed to be lacking quality maintenance. All the trees have grown up and is hiding the buildings.</p>
<p>The Visakhapatnam city looked marvelous &#8211; all single lane roads are now 2 lanes each-way with good dividers. Politicians in Visakhapatnam should be given some credit since the changes in my home state Kerala is close to none. We visited some nice beaches and had fun. The unfortunate thing is that both of my kids came down with Amoebic dysentery.</p>
<p>Now I am back in Kerala and kids are home resting. They still have not fully recovered from their dysentery. My wife and I hit the road again for social visits.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harinair.com/2009/06/my-visakhapatnam-visit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Look what I was working on!</title>
		<link>http://www.harinair.com/2009/05/look-what-i-was-working-on/</link>
		<comments>http://www.harinair.com/2009/05/look-what-i-was-working-on/#comments</comments>
		<pubDate>Tue, 05 May 2009 18:41:54 +0000</pubDate>
		<dc:creator>Hari Gangadharan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.harinair.com/?p=97</guid>
		<description><![CDATA[We recently created a SPOT Live Widget that can be embedded in your blog or your web page. Here is my SPOT Live widget and it tells me where I am:

div#ext-gen76 {
    display: none;
}





If you are a SPOT User, you can easily get the SPOT Widget running on your site.

First create a [...]]]></description>
			<content:encoded><![CDATA[<p>We recently created a SPOT Live Widget that can be embedded in your blog or your web page. Here is my SPOT Live widget and it tells me where I am:</p>
<style class="text/css">
div#ext-gen76 {
    display: none;
}
</style>
<p><script src="http://maps.google.com/maps?oe=utf-8&amp;file=api&amp;v=2&amp;key=ABQIAAAAr8rJyh2fK15gFa0tbS4cphS3Zeu2Vh4_6NEAQ7nj21r4XYWguxRI41KD_TWtHEFOvfIGsm1quk9DuA" type="text/javascript"></script><br />
<script type="text/javascript" src="http://static.findmespot.com/live-widget/1.1/js/SpotMain.js"></script><br />
<script type="text/javascript"><!--
 var widget = new Spot.Ui.LiveWidget({ renderTo: "spot-live-widget",
   feeds: [ "0o0VYWuQkoUvs9dj04qhOxFOgavQXdAEP" ],
   height: 500,
   width: 570
 });
// --></script></p>
<div id="spot-live-widget"></div>
<p>If you are a SPOT User, you can easily get the SPOT Widget running on your site.</p>
<ol>
<li>First create a share page by logging into your SPOT Account and then clicking the &#8220;Share&#8221; tab.</li>
<li>Now note the glId of the share link created (share links are of the format http://share.findmespot.com/shared/faces/gogl.jsp?glId=xxxxx &#8211; here xxxxx is your glId or guest link Id).</li>
<li>Sign up for a <a href="http://code.google.com/apis/maps/signup.html" target="_blank">Google Maps API key</a>. You need to provide the URL of your site.</li>
<li>Return to this page and click on the &#8220;Share this&#8221; button on the bottom of this widget and copy the code from that and paste it to your blog or webpage. Make sure you are pasting the code in HTML mode (not visual mode).</li>
<li>Replace the <strong>feeds: [ "0o0VYWuQkoUvs9dj04qhOxFOgavQXdAEP" ]</strong> in the copied code with<strong> feeds: [ "xxxxx" ]</strong> where <strong>xxxx </strong>is the glId obtained from step 2.</li>
<li>Replace <strong>your-gmap-key</strong> in the copied code with the key obtained in Step 3.</li>
</ol>
<p>Sure, it sounds complicated since I explained it too much <img src='http://www.harinair.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . For people with some knowlege of HTML it is quick and easy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harinair.com/2009/05/look-what-i-was-working-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Kindle 2 Finally Arrived!</title>
		<link>http://www.harinair.com/2009/03/my-kindle-2-finally-arrived/</link>
		<comments>http://www.harinair.com/2009/03/my-kindle-2-finally-arrived/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 08:06:26 +0000</pubDate>
		<dc:creator>Hari Gangadharan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.harinair.com/?p=56</guid>
		<description><![CDATA[From late December, I was planning to order Kindle but I put it off just because of the rumors of Kindle 2 being out. I also noticed the huge waiting period for Kindle last month (almost 13 weeks). From that I was pretty sure Kindle 2 is on the way. Finally the day they announced, [...]]]></description>
			<content:encoded><![CDATA[<p>From late December, I was planning to order Kindle but I put it off just because of the rumors of Kindle 2 being out. I also noticed the huge waiting period for Kindle last month (almost 13 weeks). From that I was pretty sure Kindle 2 is on the way. Finally the day they announced, I ordered my Kindle 2. I have seen Kindle 1 and I liked it too but I heard that the major flaws with Kindle 1 is resolved in this version.</p>
<p><img style="float: left; padding: 10px;" title="Kindle - in the package" src="http://www.harinair.com/wp-content/uploads/2009/03/074.jpg" alt="Kindle - in the package" width="440" height="332" />Kindle 2 came in a very nice packing. After opening, I was surprised by the iPhone like thin look and its tiny bright keys. The keys actually fits nicely compared to the Kindle 1.It came powered on and the screen had instruction on how to start using Kindle! I initially thought that it was plastic paper stuck on the screen of Kindle!</p>
<p>The shorter paging button is much better and it does not accidentally turn a page. The kindle 2 feels like it is marginally faster&#8230; the page rendering seems to be faster and the accidental page flip is not as annoying since we can flip back fairly quickly.</p>
<p>I understand that with today&#8217;s thin devices the possibility of replacing batteries is even more difficult. However I am not happy that the Kindle 2 does not have a replaceable battery. The other biggest drawback and is a downgrade from the version 1 is the missing expansion slots. The Kindle 1 had a SD slot. I hoped that Kindle 2 had at least the micro-SD slot. But without the expansion slot your Kindle is stuck with 1.5 GB capacity. Right now with around 30 books and manuals stored in Kindle, I have not even used 20 MB. But someday you have to swap some stuff out to make room for other books. I am also unhappy that I cannot organize books in folders &#8211; I am too used to folders. Even if I create folders in the Kindle internal disk everything shows up flat in the Home screen.</p>
<p><span id="more-56"></span></p>
<p><img style="float: left; padding: 10px;" title="Kindle - unpacked" src="http://www.harinair.com/wp-content/uploads/2009/03/075.jpg" alt="Kindle - unpacked" width="444" height="341" />Kindle 2 has put a small joystick on the bottom for you to move your cursor. Not being a big fan of joysticks or buttons, I would have liked a thumb wheel or a roller instead. Similarly for $359, I would expect a little more bigger screen. The current screen is sufficient but it would have been much better if it were as big as the device itself. Personally the 16-shade gray scale is fine for me and I did not have difficulty reading figures in my manuals. The electronic ink is completely strain free and you could read for hours without straining your eyes. One of the features, non-native English readers like me and the young reader appreciate is the instant dictionary lookup. As soon as you place the cursor before a word you are unsure, the definition from the dictionary will be shown in the bottom. You can press enter key to see the full definition. However, I would have liked a few more lines for that popup (for the lack of a better word) that shows the definition. Many cases the definition shown is not complete and I had to press enter and see the full definition.</p>
<p><img style="float: left; padding: 10px;" title="Kindle - Charger amd micro-USB cable" src="http://www.harinair.com/wp-content/uploads/2009/03/111.jpg" alt="Kindle - Charger amd micro-USB cable" width="480" height="360" />Connecting the Kindle to the computer is very easy &#8211; just like any thumb drives. I initially was disappointed to see that Amazon was not using the mini-USB for the sync cable. I am not a fan of proprietary interfaces and hate carrying a bunch of cables when I travel. Soon I realized that the cable Amazon was using is the micro-USB the new USB interface for small devices like phones. The Kindle&#8217;s charger is the best I have seen. My guess is I can use that for charging all my USB devices. It is a plug with a USB slot. You can connect the Kindle USB cable into that plug to start the charging.</p>
<p><img class="alignnone size-full wp-image-64" style="float: left; padding: 10px;" title="Kindle" src="http://www.harinair.com/wp-content/uploads/2009/03/077.jpg" alt="Kindle" width="360" height="480" />Kindle does not have native PDF support but your PDF books and manuals can be sent to name@kindle.com or name@free.kindle.com (where name is the Kindle id you have chosen) and the Amazon Kindle service will convert it to Kindle format. The first email address will sent the converted book directly to your Kindle using Whispernet and they charge 10 cents per book. In the other case it will be converted and sent to the primary email address in the Amazon account. You can download it and manually transfer it to your Kindle. I have converted a bunch of technical books in PDF format using this service and all of them looked OK in Kindle. Conversion service took an average of 2 minutes to convert each book. The cool thing is you can even send a zip file of all the documents you have to convert. The Amazon service will unzip, convert the documents and send them to you.</p>
<p>Overall I am satisfied by this product. The price is a little too steep but I am OK with it since it comes with lifetime subscription to Whispernet. I even can browse the internet using the Whispernet. However I can give only a 70% approval rating just because of the following three annoyances:</p>
<ul>
<li>Screen not big enough to hold a full page of a manual or text book</li>
<li>Lack of expansion slots</li>
<li>Lack of replaceable battery</li>
</ul>
<p>According to me the following are the pros:</p>
<ul>
<li>Thin, sleek device &#8211; fits everywhere</li>
<li>Better page flip and handles easily</li>
<li>Sufficient internal memory</li>
<li>Great compact charger &#8211; all other devices should use make use of this compact charger</li>
<li>Whispernet and Internet connection</li>
<li>Read to Me feature</li>
<li>The instant dictionary lookup</li>
<li>Saves Trees</li>
</ul>
<p><strong>And now the cons:</strong></p>
<ul>
<li>No expansion slot! What was Amazon thinking?</li>
<li>Battery cannot be replaced (by the end user)</li>
<li>Screen not big enough to hold a full page</li>
<li>What my Lexus don&#8217;t come with floor mats? They sell the Kindle cover for $30? That&#8217;s unreasonable. I already paid $360</li>
<li>Could be a little more elegant</li>
<li>No privacy settings &#8211; password protection, password protecting books, or hiding books you don&#8217;t want others to see.</li>
</ul>
<p><strong>Nice to have:</strong></p>
<ul>
<li>Touch screen</li>
<li>Color screen</li>
<li>Native PDF support</li>
<li>Blackberry like Roller or a track ball instead of the Joystick</li>
<li>More lines in the dictionary lookup popup</li>
</ul>
<p><img style="float: left; padding: 10px;" title="Kindle - connected" src="http://www.harinair.com/wp-content/uploads/2009/03/083.jpg" alt="Kindle - connected" width="480" height="360" /><br />
<img class="alignnone size-full wp-image-66" title="Kindle" src="http://www.harinair.com/wp-content/uploads/2009/03/079.jpg" alt="Kindle" width="480" height="360" /></p>
<p><img class="alignnone size-full wp-image-65" title="Kindle - keyboard" src="http://www.harinair.com/wp-content/uploads/2009/03/078.jpg" alt="Kindle - keyboard" width="480" height="360" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.harinair.com/2009/03/my-kindle-2-finally-arrived/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Unusual Oscar and a big day for India</title>
		<link>http://www.harinair.com/2009/02/unusual-oscar-and-a-big-day-for-india/</link>
		<comments>http://www.harinair.com/2009/02/unusual-oscar-and-a-big-day-for-india/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 07:41:00 +0000</pubDate>
		<dc:creator>Hari Gangadharan</dc:creator>
				<category><![CDATA[Movies]]></category>

		<guid isPermaLink="false">http://www.harinair.com/?p=50</guid>
		<description><![CDATA[This time the Oscar was entertaining&#8230; not because my favorite, Slumdog has won 8 out of the 8 categories it was nominated in. Hugh Jackman&#8217;s vision of a &#8220;more show less biz&#8221; Oscar turned this year&#8217;s Oscar as one of the best. Especially I liked it better than the normal version where comics try their [...]]]></description>
			<content:encoded><![CDATA[<p>This time the Oscar was entertaining&#8230; not because my favorite, Slumdog has won 8 out of the 8 categories it was nominated in. Hugh Jackman&#8217;s vision of a &#8220;more show less biz&#8221; Oscar turned this year&#8217;s Oscar as one of the best. Especially I liked it better than the normal version where comics try their old beaten comedy lines that are sometimes more disgusting than entertaining. Hugh&#8217;s theatrical talents were seen in couple of acts. Yes &#8211; As a host, Hugh Jackman is a big winner in this Oscar. I hope Academy will call him again the next year.</p>
<p><span id="more-50"></span>Another big winner is India and Bollywood. Even though it produces more movies and more viewers than Hollywood, it was never recognized. Yes  &#8211; I agree that many movies made in India are not Oscar material but there were many that has never got a nomination. AR Rahman&#8217;s talents got a big recognition when he bagged both the musical categories viz, the original score and the original song. Razul Pookutti got one for sound mixing. Above all the Slumdog Millionaire grabbed the coveted best director and the best film awards. Megan Mylan&#8217;s Smile Pinki fetches the Oscar for the Best Short Documentary. No wonder some say &#8220;Earth is flatter&#8221;.</p>
<p>Kate Winslet received her deserving best actress award for her role in the &#8220;The Reader&#8221;.  She got six nominations but this is her first Oscar. It is surprising that Kate did not win the best actress award for her role in Titanic even though she was nominated. I had a feeling that she may loose it this time too and Meryl Streep may win with her performance in &#8220;Doubt&#8221;. That is why Kate said &#8220;For you Meryl, you have to suck up to that&#8221;.  Keith Ledger was honored posthumously with his supporting actor role in Dark Knight. Sean Penn&#8217;s win of best actor is expected. Kate&#8217;s and Sean&#8217;s win will again start that usual question &#8220;Is it easier to win Oscar with a Holocaust or a Gay themed movie ?&#8221;.</p>
<p>Most other categories I cared was as expected except for the visual effects. I never thought the &#8220;Curious case of Benjamin Button&#8221; will win. My favorite for that category was the Dark Knight. But I have been wrong before too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harinair.com/2009/02/unusual-oscar-and-a-big-day-for-india/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Garmin nuvi 760 GPS</title>
		<link>http://www.harinair.com/2009/02/garmin-nuvi-760-gps/</link>
		<comments>http://www.harinair.com/2009/02/garmin-nuvi-760-gps/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 08:27:47 +0000</pubDate>
		<dc:creator>Hari Gangadharan</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[gadget]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[traffic]]></category>

		<guid isPermaLink="false">http://www.harinair.com/?p=32</guid>
		<description><![CDATA[Recently purchased a Garmin nuvi 760 from Costco &#8211; cost $249 + tax. I could have got it a little more cheaper than that from online stores but being a staunch Costco supporter in the recent days, I do not buy from Costco only if they don&#8217;t carry the product with features I look for [...]]]></description>
			<content:encoded><![CDATA[<p>Recently purchased a Garmin nuvi 760 from Costco &#8211; cost $249 + tax. I could have got it a little more cheaper than that from online stores but being a staunch Costco supporter in the recent days, I do not buy from Costco only if they don&#8217;t carry the product with features I look for or I don&#8217;t like the brand they carry. This time, lucky for me I was looking for a reasonably good GPS with following features</p>
<ol>
<li>Must be able to carry it in my pocket</li>
<li>Get the real time traffic</li>
<li>Have a FM transmitter</li>
<li> MP3 player</li>
<li>SD Card slot</li>
<li>Optional Bluetooth connectivity</li>
</ol>
<p>Lucky for me,  Garmin nuvi 760 had all the features I wanted. After unpacking, figuring out how it works was pretty easy. I loved the compact size its black sleek look and its nice UI. However I was not very happy that it did not have a good user manual. Probably gadget challenged users may find it difficult.</p>
<p><span id="more-32"></span>First the cons: The map is not great &#8211; some roads which were in my older Honda GPS were missing, it is too slow to startup and I would have liked a faster processor in it. Sometimes the search takes a long time to complete. Above that, many screens does not have the Main Menu shortcut. Hence in some cases, we have to click Back button multiple times to get to the Main Menu (or Main Screen).</p>
<p>Due to the lack of user guide I was not sure why the traffic did not work some of the time. Later I found the Clearchannel traffic FM receiver is embedded in the car charger. So the traffic icon will disappear if you do not connect it to the car charger. The traffic functionality is great &#8211; I liked the fact that it tells me the delay on the right and it reroutes based on traffic. But the unfortunate thing is, it does not have the right traffic information on many of the surface roads and hence it reroutes to a surface street when there is traffic in the freeway. Unfortunately in some case we get stuck on surface road due to heavy traffic there!</p>
<p>The phone bluetooth connectivity was easy to setup and I was amazed to find that it could show the phone contact in the screen. After using iPhone and Blackberry, it is pretty inconvenient to use an up/down arrow in screen to browse through the phone book. It would be great if it had the iPhone like scroll interface or a thumb wheel on right to scroll through the list. Same is felt in the zooming of map. Panning can be done using your fingers but zooming can be done only by pressing the zoom in/out button. It would have been great if there was the iPhone like &#8220;pinch&#8221; functionality or even a press and rotate thumb ball to zoom.</p>
<p>MP3 player is pretty reasonable and loading music into an SD card and installing it in nuvi is a snap. Since it has FM transmitter, we can hear the songs in the FM radio. It is sad that the FM transmitter is not great and has lot of interference due to other FM radio stations. This will be especially true when you are driving beyond 20 miles. You have to constantly tune the FM transmitter to find an unused band. I hope FCC will create a few bands for personal use and that will only improve this situation.</p>
<p>After using it for few days, I can can definitely say that it is a great buy for $250.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harinair.com/2009/02/garmin-nuvi-760-gps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slumdog Millionaire</title>
		<link>http://www.harinair.com/2009/02/slumdog-millionaire/</link>
		<comments>http://www.harinair.com/2009/02/slumdog-millionaire/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 20:14:51 +0000</pubDate>
		<dc:creator>Hari Gangadharan</dc:creator>
				<category><![CDATA[Movies]]></category>

		<guid isPermaLink="false">http://www.harinair.com/?p=24</guid>
		<description><![CDATA[Few days back I saw the movie &#8220;Slumdog Millionaire&#8221;. Today I came across Priyadarshan&#8217;s statement &#8216;Slumdog Millionaire&#8217; is mediocre, trashy.. That made me write this blog. I respect Priyadarshan and loved some of the movies he made. With no disrespect I would say that Priyadarshan&#8217;s movies are entertainers not Academy Award material.
A artwork becomes great [...]]]></description>
			<content:encoded><![CDATA[<p>Few days back I saw the movie &#8220;Slumdog Millionaire&#8221;. Today I came across Priyadarshan&#8217;s statement<a title="Slumdog Millionaire is mediocre, trashy" href="http://entertainment.in.msn.com/bollywood/article.aspx?cp-documentid=1810557" target="_blank"> &#8216;Slumdog Millionaire&#8217; is mediocre, trashy</a>.. That made me write this blog. I respect Priyadarshan and loved some of the movies he made. With no disrespect I would say that Priyadarshan&#8217;s movies are entertainers not Academy Award material.</p>
<p>A artwork becomes great when the artist puts in a lot detail in the background. Artwork with plain canvas is not amazing. The same way a movie becomes great when there is a lot of vibrant background. A story without a colorful background is not Oscar material. That is the same reason the &#8216;Gone with the Wind&#8217; is a great book. It takes us through the civil war era with a simple love story. Similarly with a simple story, Slumdog shows the environment an orphan kid has to go through in India. It made me remember another great movie &#8220;Life is Beautiful&#8221; by Roberto Benigni.</p>
<p><span id="more-24"></span>I understand that many Indians in India did not like that movie and personally I also did not like the &#8220;too real&#8221;, &#8220;too cruel&#8221; aspects of some of the scenes. But many of those are very much possible in India. I still remember those days when my parents used to warn me about &#8220;strangers catching kids, cutting their hands and making them beg&#8221;. But unfortunately no one discusses about that in public. That is the Indian culture&#8230; Don&#8217;t discuss about anything which is uncomfortable to discuss.</p>
<p>I recommend everyone to watch that movie and many times even the funny scenes cannot make you laugh. But the director has sketched the real life in the slums through the stories of two ophan kids.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harinair.com/2009/02/slumdog-millionaire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to my new blog</title>
		<link>http://www.harinair.com/2009/02/welcome-to-my-new-blog/</link>
		<comments>http://www.harinair.com/2009/02/welcome-to-my-new-blog/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 23:51:14 +0000</pubDate>
		<dc:creator>Hari Gangadharan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[harinair]]></category>
		<category><![CDATA[new]]></category>

		<guid isPermaLink="false">http://www.harinair.com/?p=6</guid>
		<description><![CDATA[I used to have a blog running in jroller.com and today I decided that it is time to upgrade. Hence after some deliberations, I started my *new* blog in my domain harinair.com.
I am sure you will ask what is harinair? My original name is supposed to be Hari G. Nair; the middle initial G for [...]]]></description>
			<content:encoded><![CDATA[<p>I used to have a blog running in jroller.com and today I decided that it is time to upgrade. Hence after some deliberations, I started my *new* blog in my domain harinair.com.</p>
<p>I am sure you will ask what is harinair? My original name is supposed to be Hari G. Nair; the middle initial G for Gangadharan (my dad&#8217;s first name). Nair is our family&#8217;s last name but my parents decided to drop it since it identifies the caste. In late 60s and early 70s there was a sentiment against using caste in the names, at least in the state of India I was born in. In that state, the last name was not important. Hence my name became Hari G.</p>
<p>When I moved out and started working in other countries, I found that the last name is important and I finally expanded my middle initial to make my full name Hari Gangadharan. Later when I got married, fortunately or unfortunately, my wife&#8217;s last name was already Nair and we decided not to change her last name to Gangadharan.  When our kids were born, to reduce confusion and to keep the naming a standard (yeah &#8211; I like that!) both of my kid&#8217;s last name became Nair. Now I am the odd person out! Meanwhile since harigangadharan is too long (I too misspell it) and hari is always taken, I always use harinair for all my online identities. That way I feel I still belong in the family. Few years back, I registered this domain but I am putting this to work only now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harinair.com/2009/02/welcome-to-my-new-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
