<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>PODIDEA - Diary of Pragmatic Programmer</title>
	<atom:link href="http://fantastic.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://fantastic.wordpress.com</link>
	<description>Kaizen</description>
	<lastBuildDate>Tue, 03 Jan 2012 15:29:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='fantastic.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>PODIDEA - Diary of Pragmatic Programmer</title>
		<link>http://fantastic.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://fantastic.wordpress.com/osd.xml" title="PODIDEA - Diary of Pragmatic Programmer" />
	<atom:link rel='hub' href='http://fantastic.wordpress.com/?pushpress=hub'/>
		<item>
		<title>2012 Resolutions</title>
		<link>http://fantastic.wordpress.com/2012/01/03/2012-resolutions/</link>
		<comments>http://fantastic.wordpress.com/2012/01/03/2012-resolutions/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 15:29:20 +0000</pubDate>
		<dc:creator>fantastic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fantastic.wordpress.com/2012/01/03/2012-resolutions/</guid>
		<description><![CDATA[2012 is upon us and now is the time to make or declare resolutions.  Below is a list of resolutions for 2012: Write 12 blogs &#8211; one per month (one down and 11 more to go ) Finish the Algorithmic &#8230; <a href="http://fantastic.wordpress.com/2012/01/03/2012-resolutions/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=264&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>2012 is upon us and now is the time to make or declare resolutions.  </p>
<p>Below is a list of resolutions for 2012:</p>
<ol>
<li>Write 12 blogs &#8211; one per month (one down and 11 more to go <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</li>
<li>Finish the <a href="http://www.amazon.com/Algorithmic-Puzzles-ebook/dp/B005WSNU84/ref=sr_1_3?ie=UTF8&amp;qid=1325603768&amp;sr=8-3">Algorithmic Puzzles</a> book I got over the holiday break</li>
<li>Complete the news4spring application</li>
<li>Be more proactive in participating in conversations</li>
<li>Teach a new course</li>
<li>Seek a promotion</li>
<li>Give a tech talk</li>
<li>Learn MongoDB</li>
<li>Revisit the resolutions every quarter</li>
<li>Continue six-pack journey</li>
</ol>
<p>The above list should be enough to keep me busy for the entire 2012.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fantastic.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fantastic.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fantastic.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fantastic.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fantastic.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fantastic.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fantastic.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fantastic.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fantastic.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fantastic.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fantastic.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fantastic.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fantastic.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fantastic.wordpress.com/264/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=264&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fantastic.wordpress.com/2012/01/03/2012-resolutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edfc42d1f94fc2c71088abe12c34fee7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fantastic</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Spring Social To Update Status On Facebook, Twiiter and LinkedIn</title>
		<link>http://fantastic.wordpress.com/2011/01/01/using-spring-social-to-update-status-on-facebook-twiiter-and-linkedin/</link>
		<comments>http://fantastic.wordpress.com/2011/01/01/using-spring-social-to-update-status-on-facebook-twiiter-and-linkedin/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 16:35:54 +0000</pubDate>
		<dc:creator>fantastic</dc:creator>
				<category><![CDATA[Spring Framework]]></category>
		<category><![CDATA[Social Networking]]></category>

		<guid isPermaLink="false">http://fantastic.wordpress.com/?p=149</guid>
		<description><![CDATA[A few short months back I learned about the new and exciting Spring Social project and now I finally have a chance play with it.  My goal was to integrate Spring Social into my small Spring MVC application called &#8220;Project &#8230; <a href="http://fantastic.wordpress.com/2011/01/01/using-spring-social-to-update-status-on-facebook-twiiter-and-linkedin/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=149&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few short months back I learned about the new and exciting <a title="Spring Social" href="http://www.springsource.org/spring-social" target="_blank">Spring Social project</a> and now I finally have a chance play with it.  My goal was to integrate Spring Social into my small Spring MVC application called &#8220;Project Voting&#8221;, which lets users update their Facebook wall, send a tweet to Twitter and send a network update to LinkedIn. I would like use this blog to share what I learned from this small experiment and some personal comments about Spring Social M1 release.</p>
<p>This blog will cover the following topics:</p>
<ul>
<li>OAuth dance overview</li>
<li>OAuth dance with Twitter, LinkedIn and Facebook</li>
<li>Using Spring Social templates</li>
</ul>
<p>Spring Social&#8217;s main objective is to make it easy for Java applications to integrate with social network platforms, i.e. Facebook, Twitter, LinkedIn, etc.  It uses the same template technique that was used to make it very simple to work with JDBC or REST operations.  The templates I am referring to are FacebookTemplate.java, TwitterTemplate.java, and LinkedInTemplate.java.  Before you can use any of these templates, you need to provide an access token and/or access token secret.  What is an access token you ask?  Well, it all starts with OAuth dance.</p>
<p><strong>OAuth Dance Overview</strong></p>
<p>In a nutshell, OAuth allows you to share your private data reside on Facebook, Twitter, or LinkedIn with another site without having to hand out your user name and password.  OAuth protocol defines a series of steps to acquire an access token and these steps are known as the OAuth dance.  The OAuth dance is kind of like the &#8220;Texas Two Step&#8221; dance, it consists mainly of three steps (OAuth 1.0), which seem deceptively simple, but require time and dedication to master them.</p>
<p>Here is a short list of resources about OAuth dance:</p>
<ul>
<li><a title="OAuth Community Site" href="http://oauth.net/" target="_blank">OAuth community site</a></li>
<li><a title="Beginner's Guide to OAuth" href="http://hueniverse.com/oauth/" target="_blank">Beginner&#8217;s guide to OAuth</a></li>
<li><a href="http://developer.linkedin.com/docs/DOC-1008" target="_blank">LinkedIn OAuth Authentication</a></li>
</ul>
<p>The OAuth dance consists of three steps and the last step is when the access token is handed out.</p>
<ol>
<li>Establish request token</li>
<li>Redirect user to authorization server &#8211; this is when user will enter his/her user name and password as well as granting authorizations for a website to access his/her data on his/her behalf</li>
<li>Request access token</li>
</ol>
<p>All major social network platforms implement OAuth protocol (some are on OAuth 1.0 and a few are on OAuth 2.0), which requires them to expose URLs for the above steps.  The beauty about a standard protocol is once you figure out how to work with one of these platforms, working with the next one is just a mattering of using the correct URLs.  OAuth libraries are widely available and there is a good chance you will find more than one  library for your favorite language.</p>
<p><strong>OAuth Dance With Twitter, LinkedIn and Facebook</strong></p>
<p>In my Java Spring powered web application,  I used a Java OAuth library called <a href="https://github.com/fernandezpablo85/scribe-java">scribe</a>.  One thing I really like about this library is that it provides examples to demonstrate how the OAuth dance works.  You just plugin the api key and api secret key into the sample code, and you are ready to go.   Another thing I like about scribe is that it has built in support for LinkedIn and Twitter, where the LinkedInApi.java and TwitterApi.java classes contain the appropriate request token and access token URLs.  Before showing the code I would like to mention a couple of important classes in scribe for dealing OAuth dance.  They are ServiceBuilder.java and OAuthService.java.  ServiceBuilder.java uses builder design pattern to build an implementation of OAuthService for a specific OAuth version (currently 1.0) implementation.  OAuthService.java interface defines a set of methods for the retrieval of request and access tokens and for the signing of HTTP requests.</p>
<p>The code below is for a use case where a user clicks on &lt;a href=&#8221;liStartOAuth.htm&#8221;&gt;Sign In with LinkedIn&#8221;&lt;/a&gt;,  and this request goes to a Spring MVC  handler, which then initiates the request token process by asking SocialNetworkOAuthManager factory to create an instance of SocialNetworkOAuthManger for LinkedIn.  Once the request token is successfully retrieved from LinkedIn,  this handler returns a URL to LinkedIn OAuth authorization server, which displays a form to require user to enter user name and password, and to authorize access to his/her profile on LinkedIn.  After the authorization step is successful, LinkedIn OAuth server will redirect user to a provided callback URL &#8220;liEndOAuth.htm&#8221; with OAuth verifier token.  A handler for &#8220;liEndOAuth.htm&#8221; URL then goes and request  an access token and access token secret using the provided verifier token. That concludes the OAuth dance.</p>
<p><pre class="brush: java;">
@Controller
@SessionAttributes({ &quot;userLinkedInProfile&quot;, &quot;linkedIn&quot; })
public class LinkedInController {
   @RequestMapping(value = &quot;/liStartOAuth.htm&quot;, method = RequestMethod.GET)
   public ModelAndView startAuthentication() throws TwitterException {
     SocialNetworkOAuthManager linkedInOAuthMgr =
       SocialNetworkFactory.getLinkedInOAuthManager(
         linkedInApiKeyPair.getApiKey(),
         linkedInApiKeyPair.getApiKeySecret());

     ModelAndView mv = new ModelAndView(&quot;redirect:&quot; + linkedInOAuthMgr.getAuthorizationURL());
     mv.addObject(&quot;linkedIn&quot;, linkedInOAuthMgr);
     return mv;
  }

 @RequestMapping(value = &quot;/liEndOAuth.htm&quot;, method = RequestMethod.GET)
 public ModelAndView endAuthentication(
      @RequestParam(value = &quot;oauth_token&quot;, required = false) String oauth_token,
      @RequestParam(value = &quot;oauth_verifier&quot;) String oauth_verifier,
      @ModelAttribute(&quot;linkedIn&quot;) SocialNetworkOAuthManager linkedInOAuthMgr) {

      AccessToken accessToken = linkedInOAuthMgr.getOAuthAccessToken(oauth_verifier);

      UserLinkedInProfile userLinkedInProfile = new UserLinkedInProfile();
      userLinkedInProfile.setAccessToken(accessToken.getAccessCode());
      userLinkedInProfile.setAccessTokenSecret(accessToken.getAccessSecretCode());

      ModelAndView mv = new ModelAndView(&quot;close&quot;);
      mv.addObject(&quot;userLinkedInProfile&quot;, userLinkedInProfile);
      return mv;
 }
}
</pre></p>
<p>The actual work of dealing OAuth dance is in the following classes: SocialNetworkOAuthManager.java, LinkedInOAuthManager.java and SocialNetworkFactory.java.</p>
<p><pre class="brush: java;">
public class SocialNetworkFactory {
 public static SocialNetworkOAuthManager getLinkedInOAuthManager(String apiKey,
                                            String apiSecretKey) {
    return new LinkedInOAuthManager(apiKey, apiSecretKey);
 }
}

import org.scribe.builder.ServiceBuilder;
import org.scribe.builder.api.LinkedInApi;
import org.scribe.model.Token;
import org.scribe.model.Verifier;
import org.scribe.oauth.OAuthService;

public class LinkedInOAuthManager extends AbstractOAuthManager {
 private static final String AUTHORIZE_URL = &quot;https://api.linkedin.com/uas/oauth/authorize?oauth_token=&quot;;

 private OAuthService service;
 private Token requestToken;

 public LinkedInOAuthManager(String apiKey, String apiSecretKey) {
   super(apiKey, apiSecretKey);

   service = new ServiceBuilder()
                 .provider(LinkedInApi.class)
                 .apiKey(getApiKey())
                 .apiSecret(getApiSecretKey())
                 .callback(&quot;http://myserver.myapp.com:8080/myapp/liEndOAuth.htm&quot;)
                 .build();
 }

 public String getAuthorizationURL() {
   requestToken = service.getRequestToken();
   return AUTHORIZE_URL + requestToken.getToken();
 }

 public AccessToken getOAuthAccessToken(String verifierCode) {
   Verifier verifier = new Verifier(verifierCode);
   Token token = service.getAccessToken(requestToken, verifier);
   AccessToken accessToken = new AccessToken(token.getToken(), token.getSecret());

   return accessToken;
 }
}
</pre></p>
<p>As you can see, the scribe library makes it pretty easy to deal with OAuth dance.<br />
Once the access token is available, it is just a matter of providing that to Spring Social<br />
LinkedInTemplate.java.  Below is an example of retrieving LinkedIn member profile URL and using TwitterTemplate.java to tweet.</p>
<p><pre class="brush: java;">
  LinkedInTemplate linkedInTemplate = LinkedInTemplate(apiKey, apiSecret, accessToken, accessTokenSecret);
  linkedInTemplate.getProfileUrl();

  TwitterTemplate twitterTemplate = TwitterTemplate(apiKey, apiSecret, accessToken, accessTokenSecret);
  twitterTemplate.updateStatus(&quot;This is amazing!!&quot;);
</pre></p>
<p>Unfortunately the LinkedInTemplate.java in Spring Social M1 doesn&#8217;t have a method to update network status. However it is not difficult to add such functionality yourself or see how that is done in this <a href="http://www.emforge.net/web/akakunin/blogs/-/blogs/update-status-in-facebook-twitter-and-linkedin-with-spring-social" target="_blank">blog</a>.</p>
<p>The code to implement the OAuth dance with Twitter is nearly identical to the code above so I won&#8217;t bore you with that code.  The Spring Social TwitterTemplate.java does have a method to send a tweet, so it is fairly trivial to send tweets.</p>
<p>The OAuth dance with Facebook is a bit different from LinkedIn and Twitter.  I guess because Facebook is now on OAuth 2.0.  There are two ways (that I know of) to get an access token from Facebook.  The first way is very simple, but it requires using Facebook JavaScript SDK and the second way is directly interacting with Facebook OAuth server via RESTful API.  In this blog, I will only go over the details of the first approach, which is based on the documentation at<a href="http://developers.facebook.com/docs/authentication/" target="_blank"> Facebook Developers site</a>.</p>
<p>At a high level, FB JavaScript SDK provides an easy way using custom tag to display FB login/logout button and handles the redirection to their authorization server.  One important thing to know is once the authorization is successfully completed, the access token is saved in a cookie with name as fbs_&lt;your Facebook app id&gt;.  This means the server side of your application can easily get its hand on the access token.  Spring Social comes with a handler method argument resolver (FacebookWebArgumentResolver.java) to extract the access token and user id out of the FB access token cookie for you.</p>
<p>Here is JavaScript code snippet.</p>
<p><pre class="brush: jscript;">
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
  FB.init({appId: '&lt;your app id&gt;', status: true, cookie: true, xfbml: true});
&lt;/script&gt;
&lt;fb:login-button autologoutlink=&quot;true&quot; perms=&quot;publish_stream&quot; &gt;&lt;/fb:login-button&gt;
</pre></p>
<p>The &#8220;perms&#8221; attribute of the &lt;fb:login-button&gt; tag is a very important attribute because there is where you can specify what are the different resources that your application would like to have access to on behalf of users of your application.</p>
<p>The snippet of Java code below shows how to get to the access token and user id using Spring Social custom annotations @FacebookAccessToken and @FacebookUserId.</p>
<p><pre class="brush: java;">
@RequestMapping(value=&quot;/fbUpdateStatus.htm&quot;, method = RequestMethod.POST)
public ModelAndView updateStatus(@RequestParam(&quot;status&quot;) String fbStatus,
                                 @FacebookAccessToken String accessToken,
                                 @FacebookUserId String userId) {
   ModelAndView mv = null;
   try {
     FacebookTemplate facebook = new FacebookTemplate(accessToken);
     facebook.updateStatus(fbStatus);

     mv = ModelAndViewUtil.buildSuccessfulAjaxStatus();
   } catch (Exception e) {
     mv = ModelAndViewUtil.buildFailedAjaxStatus(e.getMessage());
   }

   return mv;
}
</pre></p>
<p>NOTE: In order to get @FacebookAccessToken and @FacebookUserId annotations to work correctly, the FacebookWebArgumentResolver.java must be properly configured. There are two ways to do this, but the end goal is the same, which is to set FacebookWebArgumentResolver.java as one of the custom argument resolvers in AnnotationMethodHandlerAdapter.java.  The first way is if you are using the convenient &lt;mvc:annotation-driven&gt; tag, then pass an instance of FacebookWebArgumentResolver.java to AnnotationMethodHandlerAdapter inside a custom BeanPostProcessor.  The second way is don&#8217;t use the convenient &lt;mvc:annotation-driven&gt; tag and define both the DefaultAnnotationHandlerMapping bean and AnnotationMethodHandlerAdapter bean manually.  This way you can wire in an instance of FacebookWebArgumentResolver to the property customArgumentResolver of AnnotationMethodHandlerAdapter.</p>
<p>In my application I want to provide a small popup with a text box so a user can quickly send a tweet or send an update to his/her FB wall or send a network update on their LinkedIn member profile.  I stumbled upon qTip library, a tooltip plugin for jQuery framework and really like the functionality <a title="qTip" href="http://craigsworks.com/projects/qtip/" target="_blank">this library</a> provides.  It makes it so easy to display a very professional looking tool tip.</p>
<p><a href="http://fantastic.files.wordpress.com/2011/01/fb_status.jpg"><img class="alignnone size-medium wp-image-192" title="fb_status" src="http://fantastic.files.wordpress.com/2011/01/fb_status.jpg?w=300&#038;h=121" alt="" width="300" height="121" /></a><a href="http://fantastic.files.wordpress.com/2011/01/twitter_status.jpg"><img class="alignnone size-medium wp-image-193" title="twitter_status" src="http://fantastic.files.wordpress.com/2011/01/twitter_status.jpg?w=300&#038;h=123" alt="" width="300" height="123" /></a></p>
<p>This blog is getting long and it has pretty much I wanted to write. I am going to end this blog with an observations about the M1 of Spring Social project.</p>
<p>As a Java developer and a big fan of Spring Framework, I am really happy to see the existence of Spring Social project. However, in its current state, it lacks one important feature that I was expecting and that is to make it dead simple to deal with the OAuth dance.  I am sure this feature is going to be available in future release.</p>
<p>If you have any questions or suggestions, I would love to hear them.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fantastic.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fantastic.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fantastic.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fantastic.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fantastic.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fantastic.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fantastic.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fantastic.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fantastic.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fantastic.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fantastic.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fantastic.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fantastic.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fantastic.wordpress.com/149/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=149&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fantastic.wordpress.com/2011/01/01/using-spring-social-to-update-status-on-facebook-twiiter-and-linkedin/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edfc42d1f94fc2c71088abe12c34fee7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fantastic</media:title>
		</media:content>

		<media:content url="http://fantastic.files.wordpress.com/2011/01/fb_status.jpg?w=300" medium="image">
			<media:title type="html">fb_status</media:title>
		</media:content>

		<media:content url="http://fantastic.files.wordpress.com/2011/01/twitter_status.jpg?w=300" medium="image">
			<media:title type="html">twitter_status</media:title>
		</media:content>
	</item>
		<item>
		<title>Great Eclipse Tutorial Video</title>
		<link>http://fantastic.wordpress.com/2010/11/09/great-eclipse-tutorial-video/</link>
		<comments>http://fantastic.wordpress.com/2010/11/09/great-eclipse-tutorial-video/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 06:39:50 +0000</pubDate>
		<dc:creator>fantastic</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fantastic.wordpress.com/?p=140</guid>
		<description><![CDATA[I recently watched a video about Eclipse IDE and I must say it is fairly good.  Scott, the presenter, covered a lot of good stuff in Eclipse that both new and experience Eclipse IDE users may not be aware of. &#8230; <a href="http://fantastic.wordpress.com/2010/11/09/great-eclipse-tutorial-video/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=140&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently watched a video about Eclipse IDE and I must say it is fairly good.  Scott, the presenter, covered a lot of good stuff in Eclipse that both new and experience Eclipse IDE users may not be aware of.</p>
<p>Here is a list of areas in Eclipse that Scott covered:</p>
<ul>
<li>General Eclipse shortcuts</li>
<li>Setting up commonly used Java related settings to improve productivity</li>
<li>Useful debugging tips, i.e display Java monitors to detect deadlock</li>
</ul>
<p>It is often said that good Software Engineers need to constantly keep his or her tool box updated.  In mind opinion, watching this video is one of the ways to keep one&#8217;s tool box updated.</p>
<p>Here is the link to that video - <a href="http://vimeo.com/11887305">http://vimeo.com/11887305</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fantastic.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fantastic.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fantastic.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fantastic.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fantastic.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fantastic.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fantastic.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fantastic.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fantastic.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fantastic.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fantastic.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fantastic.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fantastic.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fantastic.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=140&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fantastic.wordpress.com/2010/11/09/great-eclipse-tutorial-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edfc42d1f94fc2c71088abe12c34fee7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fantastic</media:title>
		</media:content>
	</item>
		<item>
		<title>Simulating Network Problem Using iptables Command</title>
		<link>http://fantastic.wordpress.com/2009/10/19/simulating-network-problem-using-iptables-command/</link>
		<comments>http://fantastic.wordpress.com/2009/10/19/simulating-network-problem-using-iptables-command/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 18:26:58 +0000</pubDate>
		<dc:creator>fantastic</dc:creator>
				<category><![CDATA[Distributed Programming]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Flex HTTPService REST]]></category>
		<category><![CDATA[Linux Ubuntu]]></category>

		<guid isPermaLink="false">http://fantastic.wordpress.com/?p=132</guid>
		<description><![CDATA[In a distributed system where communication between services are happening at all time and at the same time network issues or hiccups occur frequently.  A well designed service consumer should able to handle the network connection or timeout issues in &#8230; <a href="http://fantastic.wordpress.com/2009/10/19/simulating-network-problem-using-iptables-command/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=132&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a distributed system where communication between services are happening at all time and at the same time network issues or hiccups occur frequently.  A well designed service consumer should able to handle the network connection or timeout issues in a graceful manner.  This issue is magnified to multiple folds if a service client is time bound and expects responses to come back in milliseconds.  So what are the general guidelines or best practices for dealing with the issues outlined above?</p>
<p>Here is a short list of possible solutions.  One must carefully pick the right solution for one&#8217;s specific application needs.</p>
<ul>
<li>Exponential backoff &#8211; <a href="http://en.wikipedia.org/wiki/Exponential_backoff" target="_blank">more info</a></li>
<li>Denied access gate with background pinging thread</li>
</ul>
<p>Regardless of which solution is chosen, what is a good way to simulate the network issues.  This is where the &#8220;iptable&#8221; command comes in. &#8220;iptable&#8221; command is generally used by network administrators to administer the tables of IP packet filter rules.  The rule that is useful for our purpose is &#8220;DROP&#8221;, which drops the packets on the floor.    To simulate a network connection, we can setup a filter rule for a specific host such that all packets that are supposed to go this host will be dropped on the floor.</p>
<p>In short here is the command to set up such filter rule:</p>
<p><!-- BODY { FONT-FAMILY:Tahoma; FONT-SIZE:10pt } P { FONT-FAMILY:Tahoma; FONT-SIZE:10pt } DIV { FONT-FAMILY:Tahoma; FONT-SIZE:10pt } TD { FONT-FAMILY:Tahoma; FONT-SIZE:10pt } --><span style="font-family:monospace;">sudo iptables -A OUTPUT -p tcp -d &lt;remote host ip&gt; &#8211;dport &lt;remote port&gt; -j DROP</span></p>
<p>When testing is done, make sure to remove the packet filter rule with the following command:</p>
<p><!-- BODY { FONT-FAMILY:Tahoma; FONT-SIZE:10pt } P { FONT-FAMILY:Tahoma; FONT-SIZE:10pt } DIV { FONT-FAMILY:Tahoma; FONT-SIZE:10pt } TD { FONT-FAMILY:Tahoma; FONT-SIZE:10pt } --><span style="font-family:monospace;">sudo iptables -D OUTPUT -p tcp -d &lt;remote host ip&gt; &#8211;dport &lt;remote port&gt; -j DROP</span></p>
<p>Now we know how to simulate network connection issue and this should help in testing the connection issue error handling code.</p>
<br /> Tagged: Flex HTTPService REST, Linux Ubuntu <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fantastic.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fantastic.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fantastic.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fantastic.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fantastic.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fantastic.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fantastic.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fantastic.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fantastic.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fantastic.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fantastic.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fantastic.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fantastic.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fantastic.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=132&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fantastic.wordpress.com/2009/10/19/simulating-network-problem-using-iptables-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edfc42d1f94fc2c71088abe12c34fee7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fantastic</media:title>
		</media:content>
	</item>
		<item>
		<title>Ten Things About Groovy Java Developers Should Know</title>
		<link>http://fantastic.wordpress.com/2009/07/15/ten-things-about-groovy-java-developers-should-know/</link>
		<comments>http://fantastic.wordpress.com/2009/07/15/ten-things-about-groovy-java-developers-should-know/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 15:03:26 +0000</pubDate>
		<dc:creator>fantastic</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Script Language]]></category>

		<guid isPermaLink="false">http://fantastic.wordpress.com/?p=127</guid>
		<description><![CDATA[In recent years, there has been an explosion of new scripting languages on the programming landscape and as a developer one needs to be alert of what they are and their strengths and weaknesses.  I recently started  reading about Groovy &#8230; <a href="http://fantastic.wordpress.com/2009/07/15/ten-things-about-groovy-java-developers-should-know/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=127&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In recent years, there has been an explosion of new scripting languages on the programming landscape and as a developer one needs to be alert of what they are and their strengths and weaknesses.  I recently started  reading about Groovy and below is a synopsis of what I just learned.</p>
<ol>
<li>Groovy is designed for Java developers and its foundation is the standard APIs of the Java Platform</li>
<li>Features in Groovy are inspired by languages like Python, Ruby and Smalltalk</li>
<li>Groovy brings advanced features such as closures, dynamic typing and the meta object protocol to Java platform</li>
<li>Groovy is Java&#8217;s newest best friend
<ul>
<li>Seamless integration with Java Runtime Environment</li>
<li>Groovy syntax is aligned with Java</li>
</ul>
</li>
<li>Every Groovy type is a subtype of java.lang.Object</li>
<li>A Groovy  class is a Java class</li>
<li>XML handling in Groovy is so easy that make Java developers drool</li>
<li>Groovy brings the fun of programming back to Java developers</li>
<li>Groovy classes are compiled into Java bytecodes</li>
<li>Groovy has integration with Ant and Maven and is well supported by major editors like Eclipse, IntelliJ and NetBeans</li>
</ol>
<p>I am looking forward to dive into the some of Groovy advanced features.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fantastic.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fantastic.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fantastic.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fantastic.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fantastic.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fantastic.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fantastic.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fantastic.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fantastic.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fantastic.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fantastic.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fantastic.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fantastic.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fantastic.wordpress.com/127/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=127&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fantastic.wordpress.com/2009/07/15/ten-things-about-groovy-java-developers-should-know/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edfc42d1f94fc2c71088abe12c34fee7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fantastic</media:title>
		</media:content>
	</item>
		<item>
		<title>Google App Engine for Java</title>
		<link>http://fantastic.wordpress.com/2009/04/20/google-app-engine-for-java/</link>
		<comments>http://fantastic.wordpress.com/2009/04/20/google-app-engine-for-java/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 00:31:55 +0000</pubDate>
		<dc:creator>fantastic</dc:creator>
				<category><![CDATA[Spring Framework]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[GAE]]></category>
		<category><![CDATA[Google App Engine]]></category>

		<guid isPermaLink="false">http://fantastic.wordpress.com/?p=120</guid>
		<description><![CDATA[By now I am sure everyone has heard that Google App Engine has supported Java and this is totally exciting for Java developers including myself.  Not only Java is supported, but one can use JPA to store/retrieve data from Google &#8230; <a href="http://fantastic.wordpress.com/2009/04/20/google-app-engine-for-java/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=120&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>By now I am sure everyone has heard that Google App Engine has supported Java and this is totally exciting for Java developers including myself.  Not only Java is supported, but one can use JPA to store/retrieve data from Google DataStore.  The current support has pretty much most of what one needs to build a useful Java web based application running on Google App Engine.</p>
<p>The next thing we need is some MVC framework for the presentation tier.  Surprisingly, there is a lot of folks trying to  use Spring MVC and Spring framework.  This seems to make sense because Spring Framework provides both web-tier support and back-send support like JPA integration and transaction management.  Maybe that&#8217;s why I haven&#8217;t seen many folks using Struts or JSF with Google App Engine.</p>
<p>There is a lot of buzz on google-appengine-java-group forum. Folks are trying out different technologies and exchanging tips and tricks.</p>
<p>As for myself, I ported the JDO Guestbook example to use Spring MVC + JPA and it is working just fine.  <a title="Guestbook - Google App Engine Application" href="http://guestbook-spring-jpa.appspot.com/" target="_blank">Check</a> it out when you get a chance.</p>
<p>From what I have been seeing, the following technologies are working on GAE:</p>
<p>Spring MVC, Tile 2.0.7.</p>
<p>One of the most frustrating things that most folks encountered is that their GAE applications work on their local box and it doesn&#8217;t work when running on GAE production.  Most of the time it is related to security issue.  GAE allows a subset of JRE classes and their white list is on <a href="http://code.google.com/appengine/docs/java/jrewhitelist.html" target="_blank">their site</a>.</p>
<p>I have an application in mind and I will be busy in the next several weeks developing it.  Stay tune.</p>
<br /> Tagged: GAE, Google App Engine <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fantastic.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fantastic.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fantastic.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fantastic.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fantastic.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fantastic.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fantastic.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fantastic.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fantastic.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fantastic.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fantastic.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fantastic.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fantastic.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fantastic.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=120&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fantastic.wordpress.com/2009/04/20/google-app-engine-for-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edfc42d1f94fc2c71088abe12c34fee7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fantastic</media:title>
		</media:content>
	</item>
		<item>
		<title>Small Stuff That Matters &#8211; Ubuntu File Associations</title>
		<link>http://fantastic.wordpress.com/2009/03/10/small-stuff-that-matters-ubuntu-file-associations/</link>
		<comments>http://fantastic.wordpress.com/2009/03/10/small-stuff-that-matters-ubuntu-file-associations/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 20:08:39 +0000</pubDate>
		<dc:creator>fantastic</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Ubuntu]]></category>

		<guid isPermaLink="false">http://fantastic.wordpress.com/?p=108</guid>
		<description><![CDATA[Often times there is a little thing that you would like to figure out how to do it and because it is little you tend to delay trying to figure out due to your busy schedule. An example of this &#8230; <a href="http://fantastic.wordpress.com/2009/03/10/small-stuff-that-matters-ubuntu-file-associations/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=108&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Often times there is a little thing that you would like to figure out how to do it and because it is little you tend to delay trying to figure out due to your busy schedule.</p>
<p>An example of this little thing is figuring out how to associate an application to a file based on file type on Ubuntu.  In my case is PDF files.  By default &#8220;Document Viewer&#8221; is used to display the content of a PDF file and it works, but I prefer to use Acrobat Reader.  Of course the solution is already out there if you search for it, but what I am amazed at is people are really happy when they found that solution and I know this because of their thank you notes.</p>
<p>Following the DRY principle, here is the <a title="Linux File Associations" href="http://linuxfud.wordpress.com/2006/09/03/ubuntu-linux-file-associations/" target="_blank">link</a> to the solution that I found.</p>
<br /> Tagged: Linux Ubuntu <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fantastic.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fantastic.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fantastic.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fantastic.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fantastic.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fantastic.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fantastic.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fantastic.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fantastic.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fantastic.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fantastic.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fantastic.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fantastic.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fantastic.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=108&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fantastic.wordpress.com/2009/03/10/small-stuff-that-matters-ubuntu-file-associations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edfc42d1f94fc2c71088abe12c34fee7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fantastic</media:title>
		</media:content>
	</item>
		<item>
		<title>Hiring &amp; Acceptance Test</title>
		<link>http://fantastic.wordpress.com/2009/03/09/hiring-acceptance-test/</link>
		<comments>http://fantastic.wordpress.com/2009/03/09/hiring-acceptance-test/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 16:22:49 +0000</pubDate>
		<dc:creator>fantastic</dc:creator>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Extreme Programming Testing]]></category>

		<guid isPermaLink="false">http://fantastic.wordpress.com/?p=97</guid>
		<description><![CDATA[I came across this posting on a Yahoo! group recently and it was too good not to pass it along.  It is about writing an acceptance for hiring a senior developer in the spirit of Extreme Programming. class SeniorDeveloperAcceptanceTest extends &#8230; <a href="http://fantastic.wordpress.com/2009/03/09/hiring-acceptance-test/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=97&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I came across this posting on a Yahoo! group recently and it was too good not to pass it along.  It is about writing an acceptance for hiring a senior developer in the spirit of Extreme Programming.</p>
<p><code><br />
class SeniorDeveloperAcceptanceTest extends TestCase{<br />
&nbsp;&nbsp;&nbsp;Developer candidate;<br />
&nbsp;&nbsp;&nbsp;Collection team;</p>
<p>&nbsp;&nbsp;&nbsp;public void setUp() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;candidate = new Developer();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;team = YourCompany.getTeam();<br />
&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;public void testTechnicalSkills() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertTrue(candidate.isJavaExpert());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertTrue(candidate.canDesignLargeApplication());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertTrue(candidate.canReduceTechnicalDebt());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertTrue(candidate.practiceTDD());<br />
&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;public void testTeachingSkills() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertTrue(candidate.canImproveTeamSkills());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertTrue(candidate.canArgueAboutAgility());<br />
&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;public void testHumanBehavior() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertTrue(candidate.canPairProgram());<br />
&nbsp;&nbsp;&nbsp;assertTrue(candidate.canIntegrateWith(team));<br />
&nbsp;&nbsp;&nbsp;assertTrue(candidate.hasPositiveAttitude());<br />
&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;public void testMethodologySkills() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertTrue(candidate.knowExtremeProgramming());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertTrue(candidate.canImproveTeamVelocity());<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;}<br />
</code></p>
<br /> Tagged: Extreme Programming Testing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fantastic.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fantastic.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fantastic.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fantastic.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fantastic.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fantastic.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fantastic.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fantastic.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fantastic.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fantastic.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fantastic.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fantastic.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fantastic.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fantastic.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=97&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fantastic.wordpress.com/2009/03/09/hiring-acceptance-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edfc42d1f94fc2c71088abe12c34fee7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fantastic</media:title>
		</media:content>
	</item>
		<item>
		<title>Java Concurrency Synchronizers</title>
		<link>http://fantastic.wordpress.com/2008/11/05/java-concurrency-synchronizers/</link>
		<comments>http://fantastic.wordpress.com/2008/11/05/java-concurrency-synchronizers/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 00:27:40 +0000</pubDate>
		<dc:creator>fantastic</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[Thread]]></category>

		<guid isPermaLink="false">http://fantastic.wordpress.com/?p=85</guid>
		<description><![CDATA[Java Concurrency Utilities provides a number of powerful and high-performance threading utiities.  At the high level they can be grouped into four categories and this article will cover one of the categories. Thread Pools and Task Scheduling Concurrent Collections Locks &#8230; <a href="http://fantastic.wordpress.com/2008/11/05/java-concurrency-synchronizers/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=85&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Java Concurrency Utilities provides a number of powerful and high-performance threading utiities.  At the high level they can be grouped into four categories and this article will cover one of the categories.</p>
<ol>
<li>Thread Pools and Task Scheduling</li>
<li>Concurrent Collections</li>
<li>Locks and Synchronizers</li>
<li>Atomic Variables</li>
</ol>
<p>We all know that Java supports synchronization since day one through the <em><strong>synchronized </strong></em>keyword, but the limitation is that this mechanism works at the block level and is limited to a single thread at a time.  A number of new mechanisms were introduced.  Among them are semaphore, barrier, latch and exchanger.</p>
<p>Semaphore are used to control or limit the number of activities that can access a certain resource or perform a given action at the same time.  An easier way to understanding and remembering what a Semaphore is by associating Semaphore with permits.  A semaphore maintains a set of permits and a thread must acquire a permit from the semaphore before it can obtain a resource or perform a certain activity.  The permit is returned to the semaphore when thread is done accessing a resource or perform a certain activity.  If all the permits were already given out, then the next thread that asks fro a permit will be blocked.</p>
<p>Latch is used to allow one or more thread to wait for a set of threads to complete an action.  Once a latch is set, it never changes.  Latch is commonly used to coordinate certain threads and the common use case for latch is start several threads and have them wait until a signal is received from a coordinating thread.  Another example in a multiplayer games is you don&#8217;t want the game to start until all the players have joined.</p>
<p>CyclicBarrier is used to create a barrier and there are two different kinds of barrier.  The first kind is a barrier with a number of threads and the other is a number of threads and a barrier action.  The barrier action is a Runnable task that runs when all the threads have joined together.  Basically a barrier is used stop a set of threads from running until they all reach a specified point.  Comparing to a latch, which is used to let threads run wild, a barrier is used stop a set of thread.</p>
<p>Out of the four kinds of synchronizers, exchanger is a unique one.  It is used to allow two threads to exchange data in thread-safe manner.  Imagine the producer and consumer problem,  an exchanger can be used to allow producer and consumer to exhange the buffer that contains tasks to do in one shot, instead of consumer picks one task out of the task queue at a time.</p>
<p>Next article will cover Atomic Variables.</p>
<br /> Tagged: Concurrency, Thread <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fantastic.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fantastic.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fantastic.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fantastic.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fantastic.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fantastic.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fantastic.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fantastic.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fantastic.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fantastic.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fantastic.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fantastic.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fantastic.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fantastic.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=85&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fantastic.wordpress.com/2008/11/05/java-concurrency-synchronizers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edfc42d1f94fc2c71088abe12c34fee7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fantastic</media:title>
		</media:content>
	</item>
		<item>
		<title>My First Writable With Hadoop</title>
		<link>http://fantastic.wordpress.com/2008/10/20/my-first-writable-with-hadoop/</link>
		<comments>http://fantastic.wordpress.com/2008/10/20/my-first-writable-with-hadoop/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 21:35:43 +0000</pubDate>
		<dc:creator>fantastic</dc:creator>
				<category><![CDATA[Lucene Hadoop]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Hadoop Writable]]></category>

		<guid isPermaLink="false">http://fantastic.wordpress.com/?p=75</guid>
		<description><![CDATA[Hadoop uses a simple and efficient serialization protocol to serialize data between the map and reduce steps.  There is a lot going on between these two steps, but this article is not about that.  Rather it focuses on what a &#8230; <a href="http://fantastic.wordpress.com/2008/10/20/my-first-writable-with-hadoop/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=75&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hadoop uses a simple and efficient serialization protocol to serialize data between the map and reduce steps.  There is a lot going on between these two steps, but this article is not about that.  Rather it focuses on what a developer needs to know in order to write a custom Writable class.  Just for the folks that are new to MapReduce in Hadoop, the OutputCollector in the Map and Reduce step accepts only the value as of type Writable.</p>
<p>Writable is an interface in Hadoop and it has two methods: void readFields(DataInput in) and void write(DataOutput out).  If you browse Hadoop Javadocs, ther are roughly about 43 classes in Hadoop that implements the Writable interface.</p>
<p>Depending on what your MapReduce application needs, one of the out-of-box Writables will do the job, but if there isn&#8217;t one, then it is fairly straight forward to write a custom Writable.  That&#8217;s what I had to do for my project.  What I discovered and there isn&#8217;t that much documentation on it is in addition to the two methods defined in the Writable interface, you also need to implement the toString() method if you want the data in your custom Writable to appear in the output file (this took me sometime to figure out).</p>
<p>One of the interesting Writables is the GenericWritable.  This comes in handy when the Map and Combiner output the same key type, but different value type.  The requirement in Hadoop is the values that are mapped out to reduce, only one value type is allowed.  The GenericWritable basically helps you wrap instances of value of different types.  See GenericWritable JavaDoc for more details.</p>
<br /> Tagged: Hadoop Writable <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fantastic.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fantastic.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fantastic.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fantastic.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fantastic.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fantastic.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fantastic.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fantastic.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fantastic.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fantastic.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fantastic.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fantastic.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fantastic.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fantastic.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fantastic.wordpress.com&amp;blog=48015&amp;post=75&amp;subd=fantastic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fantastic.wordpress.com/2008/10/20/my-first-writable-with-hadoop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edfc42d1f94fc2c71088abe12c34fee7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fantastic</media:title>
		</media:content>
	</item>
	</channel>
</rss>
