<?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>a peek into my MIND</title>
	<atom:link href="http://merereflections.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://merereflections.wordpress.com</link>
	<description>my Thoughts on everyTHING</description>
	<lastBuildDate>Sun, 02 Oct 2011 02:54:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='merereflections.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>a peek into my MIND</title>
		<link>http://merereflections.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://merereflections.wordpress.com/osd.xml" title="a peek into my MIND" />
	<atom:link rel='hub' href='http://merereflections.wordpress.com/?pushpress=hub'/>
		<item>
		<title>GodMode in Windows7</title>
		<link>http://merereflections.wordpress.com/2011/08/10/godmode-in-windows7/</link>
		<comments>http://merereflections.wordpress.com/2011/08/10/godmode-in-windows7/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 15:41:26 +0000</pubDate>
		<dc:creator>Bharat Kondeti</dc:creator>
				<category><![CDATA[screams]]></category>

		<guid isPermaLink="false">http://merereflections.wordpress.com/?p=272</guid>
		<description><![CDATA[This gives quick access to all the administrative tools and pretty much all the things you can do to customize windows 7. To get to this mode create a new folder on desktop and name it as &#8220;GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}&#8221; or open Windows Explorer and enter GodMode in the tool bar.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=272&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This gives quick access to all the administrative tools and pretty much all the things you can do to customize windows 7. To get to this mode create a new folder on desktop and name it as &#8220;GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}&#8221; or open Windows Explorer and enter GodMode in the tool bar.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merereflections.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merereflections.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merereflections.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merereflections.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/merereflections.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/merereflections.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/merereflections.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/merereflections.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merereflections.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merereflections.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merereflections.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merereflections.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merereflections.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merereflections.wordpress.com/272/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=272&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://merereflections.wordpress.com/2011/08/10/godmode-in-windows7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30ca871ed909d324b286b35131aceec4?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">merereflections</media:title>
		</media:content>
	</item>
		<item>
		<title>Book on modern meetings</title>
		<link>http://merereflections.wordpress.com/2011/08/08/book-on-modern-meetings/</link>
		<comments>http://merereflections.wordpress.com/2011/08/08/book-on-modern-meetings/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 06:46:03 +0000</pubDate>
		<dc:creator>Bharat Kondeti</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://merereflections.wordpress.com/?p=266</guid>
		<description><![CDATA[Meetings are one of the expenses for an organization. Since time is money, unproductive meetings are waste of time and in turn waste of money. People call for meeting for various reasons and often times people attend them with out knowing its purpose. Some meetings are convenience meetings which could have been avoided by sending [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=266&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Meetings are one of the expenses for an organization. Since time is money, unproductive meetings are waste of time and in turn waste of money. People call for meeting for various reasons and often times people attend them with out knowing its purpose. Some meetings are convenience meetings which could have been avoided by sending a email or writing a document, some are formal meetings like meetings called by managers for status updates or to disseminate some information and some are just social meetings. Often times meetings are called to make a decision or to distribute effort between people and organization&#8217;s. </p>
<p>Meetings do provide a value but sometimes they do not justify the cost of interruption and loss of productivity. Some of the problems with traditional meetings is that it creates a culture of compromise and they kill our sense of urgency. People would avoid making a decision and leave it for the people attending the meeting, or people would avoid taking up a responsibility and leave it to the people attending the meeting.</p>
<p>More often people call for meetings with out any preparation or proper agenda. They would often invite people with out understanding the value they would bring to the table. Also not having a proper agenda will bring attendees unprepared. </p>
<p>In the book &#8220;Read This Before Our Next Meeting&#8221; author Al Pittampalli lays out some ground rules for modern meetings. Following are the ground rules for a meeting</p>
<p>1) Modern meetings supports a decision that has already been taken.<br />
   A decision should not be left for a meeting. A tentative decision should have already been made by consulting people if required. A meeting should be held to ratify the decision or to make amendments to the decision. This will result in having a meeting with clear purpose and clear outcome.  </p>
<p>2) Modern meetings moves fast and ends on schedule.<br />
   As the rule says meetings should be kept on track and on the purpose. </p>
<p>3) Modern meetings limits the number of attendees.<br />
   This is very important. Invite people who are absolutely necessary. If required one can convey the outcome of a meeting for rest of the people in a formal email. If more people are invoked it creates uncertainty in the decision.      </p>
<p>4) Modern meetings rejects the unprepared.<br />
   As the rule says no attendee can come to meeting with out understanding his / her role in the meeting. Everyone should come prepared to the meeting. For ex. modern meeting is not a place to bring people up to speed.</p>
<p>5) Modern meetings produces committed action plan.<br />
   Every meeting should have a outcome and committed action plan.</p>
<p>6) Modern meetings refuses to be informal. reading memos is important.<br />
   This means people should take meetings quite seriously. They should read all the memos / documents that are sent regarding the meeting. Meetings should be very formal and should not be a place for personal conversation.</p>
<p>7) Modern meetings works only alongside a culture of brainstorming.<br />
   New ideas should come out of the meetings. </p>
<p>For detailed explanation I would recommend reading this book. As a promotion Kindle version is available free for limited time.</p>
<p><a href="http://www.amazon.com/gp/product/B0057ZER34/ref=as_li_ss_tl?ie=UTF8&amp;tag=mwshead-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=B0057ZER34" title="Read This Before Our Next Meeting">Read This Before Our Next Meeting [Kindle Edition]</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merereflections.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merereflections.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merereflections.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merereflections.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/merereflections.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/merereflections.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/merereflections.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/merereflections.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merereflections.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merereflections.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merereflections.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merereflections.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merereflections.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merereflections.wordpress.com/266/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=266&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://merereflections.wordpress.com/2011/08/08/book-on-modern-meetings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30ca871ed909d324b286b35131aceec4?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">merereflections</media:title>
		</media:content>
	</item>
		<item>
		<title>Finally Java 7 is out</title>
		<link>http://merereflections.wordpress.com/2011/07/11/finally-java-7-is-out/</link>
		<comments>http://merereflections.wordpress.com/2011/07/11/finally-java-7-is-out/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 23:25:51 +0000</pubDate>
		<dc:creator>Bharat Kondeti</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Java7]]></category>

		<guid isPermaLink="false">http://merereflections.wordpress.com/?p=258</guid>
		<description><![CDATA[Finally after almost 5 years, new version of Java i.e. Java7 is out for developer preview. Unfortunately many of the promised features were left out in this release, features like Lambda, Jigsaw and some part of Coin initiative are moved to Java 8 release which is expected sometime year end of 2012. Of course with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=258&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Finally after almost 5 years, new version of Java i.e. Java7 is out for developer preview. Unfortunately many of the promised features were left out in this release, features like Lambda, Jigsaw and some part of Coin initiative are moved to Java 8 release which is expected sometime year end of 2012.</p>
<p>Of course with every new release comes new features, better performance, new syntax etc. Some of the noteworthy features</p>
<p>1) One of the biggest feature is invokeDynamic. This makes interactions between Java and other dynamic languages like JRuby, Jython, Groovy and other 200 languages that are on JVM seamless. Now JVM can optimize the bytecode produced by these languages. We can choose to write code in any language that best solves the problem and compile it against JVM to get all the JVM capabilities like optimization, garbage collection etc</p>
<p>2) Second big feature is language enhancements. Biggest complaint about java is that its verbose / or has lot of ceremony in writing code. With project “coin” in Java7 we will see some language enhancements. For ex</p>
<p>Improved type inference for generic instance creation</p>
<p><pre class="brush: java;">
//In Java 6
Map&lt;String, List&lt;String&gt;&gt; mapoflists = new HashMap&lt;String, List&lt;String&gt;&gt;();

//In Java 7
Map&lt;String, List&lt;String&gt;&gt; mapoflists = new HashMap&lt;&gt;();
</pre></p>
<p>Similarly Multi Catch blocks<br />
<pre class="brush: java;">
try {
//Do Something;
catch(Exp1 | Exp2 |Exp3) {
//Do something
}
</pre><br />
more enhancements like strings in switch statements, Binary Integral literals and underscore literals, try with resource statements etc</p>
<p>3) We are in an age where servers with multiple cores are very common. Having language features that enables us to use all these processing power is very helpful. Java7 has enhancements for Concurrent and Collections API that enable us to write applications to use multiple processors.</p>
<p>4) Enhanced NIO</p>
<p>For more features and information follow these links </p>
<p><a href="http://www.oracle.com/us/corporate/events/java7/index.html" title="Oracle Java 7 page">Oracle Java 7 page</a></p>
<p><a href="http://java.dzone.com/articles/introducing-java-7-moving" title="Javalobby Introducing Java 7 ">Javalobby Introducing Java 7</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merereflections.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merereflections.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merereflections.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merereflections.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/merereflections.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/merereflections.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/merereflections.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/merereflections.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merereflections.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merereflections.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merereflections.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merereflections.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merereflections.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merereflections.wordpress.com/258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=258&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://merereflections.wordpress.com/2011/07/11/finally-java-7-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30ca871ed909d324b286b35131aceec4?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">merereflections</media:title>
		</media:content>
	</item>
		<item>
		<title>Android tutorials</title>
		<link>http://merereflections.wordpress.com/2011/02/25/android-tutorials/</link>
		<comments>http://merereflections.wordpress.com/2011/02/25/android-tutorials/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 20:57:46 +0000</pubDate>
		<dc:creator>Bharat Kondeti</dc:creator>
				<category><![CDATA[screams]]></category>

		<guid isPermaLink="false">http://merereflections.wordpress.com/?p=251</guid>
		<description><![CDATA[If you are new to Android development watch this tutorial. Learn how to develop for Android, Beyond HelloWorld Want to learn some best practices. Title of the video is wrong, its actually not a &#8216;Beginners guide to Android&#8217;. Presenter changes the talk after 5 minutes into it. Android best practices for beginners<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=251&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are new to Android development watch this tutorial.</p>
<p><strong><a href="http://www.youtube.com/watch?v=rm-hNlTD1H0">Learn how to develop for Android, Beyond HelloWorld</a></strong></p>
<p>Want to learn some best practices. Title of the video is wrong, its actually not a &#8216;Beginners guide to Android&#8217;. Presenter changes the talk after 5 minutes into it. </p>
<p><strong><a href="http://www.youtube.com/watch?v=yqCj83leYRE">Android best practices for beginners</a> </strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merereflections.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merereflections.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merereflections.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merereflections.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/merereflections.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/merereflections.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/merereflections.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/merereflections.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merereflections.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merereflections.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merereflections.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merereflections.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merereflections.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merereflections.wordpress.com/251/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=251&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://merereflections.wordpress.com/2011/02/25/android-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30ca871ed909d324b286b35131aceec4?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">merereflections</media:title>
		</media:content>
	</item>
		<item>
		<title>Keep Flash player full screen while working on dual monitors.</title>
		<link>http://merereflections.wordpress.com/2010/12/24/keep-flash-player-full-screen-while-working-on-dual-monitors/</link>
		<comments>http://merereflections.wordpress.com/2010/12/24/keep-flash-player-full-screen-while-working-on-dual-monitors/#comments</comments>
		<pubDate>Fri, 24 Dec 2010 22:08:16 +0000</pubDate>
		<dc:creator>Bharat Kondeti</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://merereflections.wordpress.com/?p=246</guid>
		<description><![CDATA[Sometimes I like to watch videos on my second monitor while working on another monitor. But when ever I click on my working screen the Flash player closes the full screen mode which is very annoying. There is a patch that one can apply on Flash to alleviate this problem. Its called IgnoFlash patch. http://deve.loping.net/projects/ignoflash/ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=246&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes I like to watch videos on my second monitor while working on another monitor. But when ever I click on my working screen the Flash player closes the full screen mode which is very annoying. There is a patch that one can apply on Flash to alleviate this problem. Its called <a href="http://static.loping.net/bcode/downloads/ignoflash/IgnoFlash-1.4.0.zip">IgnoFlash</a> patch.</p>
<p><a href="http://deve.loping.net/projects/ignoflash/">http://deve.loping.net/projects/ignoflash/</a></p>
<p>It&#8217;s was very easy to apply the patch and now I can play my videos in full screen while working. Thank you very much Mr. <a href="http://deve.loping.net/imprint/">Alex Gembe</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merereflections.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merereflections.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merereflections.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merereflections.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/merereflections.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/merereflections.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/merereflections.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/merereflections.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merereflections.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merereflections.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merereflections.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merereflections.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merereflections.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merereflections.wordpress.com/246/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=246&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://merereflections.wordpress.com/2010/12/24/keep-flash-player-full-screen-while-working-on-dual-monitors/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30ca871ed909d324b286b35131aceec4?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">merereflections</media:title>
		</media:content>
	</item>
		<item>
		<title>Resolving conflicts</title>
		<link>http://merereflections.wordpress.com/2010/12/07/resolving-conflicts/</link>
		<comments>http://merereflections.wordpress.com/2010/12/07/resolving-conflicts/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 02:34:02 +0000</pubDate>
		<dc:creator>Bharat Kondeti</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://merereflections.wordpress.com/?p=240</guid>
		<description><![CDATA[Heard a very interesting story in one of the TED talks. A man left his three children with 17 camels. According to the will first son gets half of the camels, second son gets third of the camels and the youngest gets ninth of the camels. Three sons got into negotiations, realizing they cannot split [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=240&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Heard a very interesting story in one of the <a href="http://www.ted.com/talks/william_ury.html">TED talks</a>.</p>
<p>A man left his three children with 17 camels. According to the will first son gets half of the camels, second son gets third of the camels and the youngest gets ninth of the camels. Three sons got into negotiations, realizing they cannot split without killing the camels they started to argue and finally in desperation they consulted a wise old women.</p>
<p>Wise old women thought about their problem for long time and finally she came back and said, I don&#8217;t know if I can help, but at least if you want you can have my camel.</p>
<p>So now they had 18 camels&#8230;. </p>
<p>First son took his half, half of 18 is 9; Second son took his third, third of 18 is 6; finally youngest took his ninth, ninth of 18 is 2 and yet the total was only 17 and there was one camel left over which they gave it back to old wise women.</p>
<p>The moral of the story is every problem or conflict can be resolved with a fresh look. Every conflict has two sides but it&#8217;s the third side &#8216;us&#8217; who should participate in resolving the conflict.   </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merereflections.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merereflections.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merereflections.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merereflections.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/merereflections.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/merereflections.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/merereflections.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/merereflections.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merereflections.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merereflections.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merereflections.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merereflections.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merereflections.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merereflections.wordpress.com/240/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=240&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://merereflections.wordpress.com/2010/12/07/resolving-conflicts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30ca871ed909d324b286b35131aceec4?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">merereflections</media:title>
		</media:content>
	</item>
		<item>
		<title>Managing Google Spreadsheets using Documents List API and Spreadsheet API &#8211; Part 1</title>
		<link>http://merereflections.wordpress.com/2010/08/19/managing-google-spreadsheets-using-documents-list-api-and-spreadsheet-api-part-1/</link>
		<comments>http://merereflections.wordpress.com/2010/08/19/managing-google-spreadsheets-using-documents-list-api-and-spreadsheet-api-part-1/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 23:36:20 +0000</pubDate>
		<dc:creator>Bharat Kondeti</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[google docs]]></category>
		<category><![CDATA[google spreadsheets]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://merereflections.wordpress.com/?p=176</guid>
		<description><![CDATA[This tutorial is first part in a series of tutorials for managing and writing into Google spreadsheet. Each post is a problem and a way to solve it. Example code in these tutorials are for single client JavaScript applications. Once concepts are understood, it’s very easy to implement the same in any language and for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=176&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This tutorial is first part in a series of tutorials for managing and writing into Google spreadsheet. Each post is a problem and a way to solve it. Example code in these tutorials are for single client JavaScript applications. Once concepts are understood, it’s very easy to implement the same in any language and for any application type. Comments or feedback are very much appreciated. </p>
<p>Google provides API to manage any documents on Google docs and different API to manage spreadsheets.  API’s are in the form of restful services where in client application’s can manage documents by making HTTP requests to Google.</p>
<p><a href="http://code.google.com/apis/documents/">Google Documents List API</a>: This API provides functionalities for managing documents. This includes searching, retrieving, uploading, updating, copying, downloading and deleting of documents, creating and moving folders, modifying folder and document permissions, managing document revisions and finally some special features like document translation and Optical character recognition. </p>
<p><a href="http://code.google.com/apis/spreadsheets/">Google Spreadsheet API</a>: This API is specifically for managing data inside a spreadsheet. Clients can use this API to manage worksheets, tables, records and cells inside a spreadsheet. This API does not provide functionality to create and delete a spreadsheet, but this can be easily done by using documents list API.</p>
<p>To interact with these API’s one has to have a Google account and client needs to pass in an authorization key with every request. Before a client can start using the API  it has to authenticate the user by passing in username and password along with the service name for which it needs authorization key for. An authorization key obtained for one service <strong>cannot be used</strong> for other service. <a href="http://code.google.com/apis/gdata/faq.html#clientlogin">Click</a> for complete list of API’s and their respective service names. </p>
<p>Google provides couple of different ways to authenticate a client application. One is by using <a href="http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html">ClientLogin </a>specifically for single user client applications and other is by using <a href="http://code.google.com/apis/accounts/docs/AuthSub.html">AuthSub proxy authentication</a> for multi user web applications. Either way the idea is to acquire an authorization key or token that has to be passed for every client interaction with the API.</p>
<p>Every request a client makes to Google docs, it has to specify the GData-Version in the headers of the request. Current version is 3.0. Every document created or uploaded to Google docs is given a unique document ID. Clients has to use this ID to perform any further actions on the document.</p>
<p><strong>Problem 1:</strong><br />
<span id="more-176"></span><br />
Create an empty spread sheet in Google docs by name ‘<em>Example.xls</em>’ and return the document ID. Before, check to see if the spreadsheet is already present in Google docs, if present return its document ID without creating new one again. </p>
<ul>
<li>1)	Authenticate with Documents List API and get a Auth key</li>
<li>2)	Search for the spreadsheet by name ‘<em>Example.xls</em>’, If spreadsheet exists retrieve the ID</li>
<li>3)	If spreadsheet is not found create the a blank spreadsheet by name ‘<em>Example.xls</em>’</li>
</ul>
<p>Document’s List API is a service of type ‘<strong><em>writely</em></strong>’.  A HTTP post request is made to ClentLogin URL to get the auth key.<br />
<pre class="brush: jscript;">
//URL for ClientLogin
var url = 'https://www.google.com/accounts/ClientLogin';

//Content type has to be this
var ct = 'application/x-www-form-urlencoded';

// account type is HOSTED or GOOGLE when unsure use following
var at = 'HOSTED_OR_GOOGLE';

var un = 'your Google email';
var pwd = 'your password';

var serv = 'writely'

//This can be any fixed string. Used for logging by Google
var src = 'application identifier’

var request = new Ajax.Request(url, {
  method: 'post',
  contentType: ct,
  parameters: {accountType: at, Email: un, Passwd: pwd, service: serv, source: src},
  
  onSuccess: function(response){
    // Parse the auth key from response and save it somewhere
    //do something else like call search method to find the spreadsheet
  }.bind(this),
     onFailure: function(response){
     // puke, look for status and act accordingly
  }.bind(this)
});

</pre></p>
<p>To determine authorization key one has to parse the response. The response is returned as Key = Value pairs and client needs to look for &#8216;Auth&#8217; key. If for any reason Google fails to authenticate the user it returns a response along with <a href="http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Errors">error code</a>.</p>
<p><pre class="brush: jscript;">
var a = null;
var pairs = response.responseText.split(&quot;\n&quot;);
	 
for (var i=0; i &lt;pairs.length; i++){
  var fields = pairs[i].split(&quot;=&quot;);
  var key = fields[0];
  if(fields[0] == 'Auth') {
    a = fields[1]
    break;
  }
}
</pre></p>
<p><a href="http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#SearchingDocs">Searching for documents</a> is very straight forward. One can perform queries on document types, names , locations and meta-data. For our example I am looking for a spreadsheet with name &#8216;Example.xls&#8217; in my private folders.</p>
<p><pre class="brush: jscript;">
var spreadsheetName = 'Example.xls';

// authWritely is the key obtained as part of ClientLogin
var auth = 'GoogleLogin auth='+this.authWritely;

var url = &quot;https://docs.google.com/feeds/default/private/full/-/spreadsheet?title=&quot;+spreadsheetName+&quot;&amp;title-exact=true&amp;showdeleted=false&quot;;

//Content type
var ct = 'application/atom+xml';

var request = new Ajax.Request(url,{
   method: 'get',
   evalJSON: 'false',
   contentType:ct,
   requestHeaders:{ Authorization: auth , 'GData-Version':'3.0'},
   onSuccess: function(response){
     //Search for document Id
     //If no spreadsheet is returned create one 	
   }.bind(this),
   onFailure: function(response){
     // puke, look for status and act accordingly
   }.bind(this)
 });
</pre></p>
<p>If a document is found with the search criteria a list of document entries are returned along with document ID and URL&#8217;s to manipulate the document. The easiest way to determine the document ID is to search for &#8216;resourceId&#8217; in the response XML.</p>
<p><pre class="brush: jscript;">
var id = null;
var resp = response.responseXML;
var entries = resp.getElementsByTagName('entry');
	
for(var i=0; i&lt;entries.length; i++) {
  var resourceId = entries[i].getElementsByTagName('resourceId')[0].firstChild.nodeValue;
  var resourceIdSplit = resourceId.split(':');
  if (resourceIdSplit[0] == 'spreadsheet') {
    id = resourceIdSplit[1];
    break;
  } 			 				
}
</pre>    </p>
<p>To create a new document one has to post an entry request to Google docs. Following code snippet creates a new spreadsheet with name &#8216;Example.xls&#8217; in private/full location. Using same approach clients can create any type of document under any location.</p>
<p><pre class="brush: jscript;">

var spreadsheetName = 'Example.xls';

//Content type
var ct = 'application/atom+xml';

var pbody = '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\
		    &lt;entry xmlns=&quot;http://www.w3.org/2005/Atom&quot;&gt;\
		    &lt;category scheme=&quot;http://schemas.google.com/g/2005#kind&quot;\
		          term=&quot;http://schemas.google.com/docs/2007#spreadsheet&quot;/&gt;\
		      &lt;title&gt;'+this.spreadsheetName+'&lt;/title&gt;\
		    &lt;/entry&gt;';
	
var auth = 'GoogleLogin auth='+this.authWritely;

var url = &quot;https://docs.google.com/feeds/default/private/full&quot;;

var request = new Ajax.Request(url, {
  method: 'post',
  contentType:ct,
  evalJSON: 'false',
  contentLength: pbody.length,
  postBody: pbody,
  requestHeaders:{ Authorization: auth , 'GData-Version':'3.0'},
  onSuccess: function(response){
    // Document is created
    // Get the document id 
  }.bind(this),
  onFailure: function(response){
    // puke, look for status and act accordingly
  }.bind(this)
}); 
</pre></p>
<p>This completes the problem to authenticate a user, search for a spreadsheet and create a new spread sheet.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merereflections.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merereflections.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merereflections.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merereflections.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/merereflections.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/merereflections.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/merereflections.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/merereflections.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merereflections.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merereflections.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merereflections.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merereflections.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merereflections.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merereflections.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=176&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://merereflections.wordpress.com/2010/08/19/managing-google-spreadsheets-using-documents-list-api-and-spreadsheet-api-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30ca871ed909d324b286b35131aceec4?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">merereflections</media:title>
		</media:content>
	</item>
		<item>
		<title>MySql sorting fields in a certain order.</title>
		<link>http://merereflections.wordpress.com/2010/08/19/mysql-sorting-fields-in-a-certain-order/</link>
		<comments>http://merereflections.wordpress.com/2010/08/19/mysql-sorting-fields-in-a-certain-order/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 18:39:00 +0000</pubDate>
		<dc:creator>Bharat Kondeti</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://merereflections.wordpress.com/?p=208</guid>
		<description><![CDATA[MySql provides nice functionality to sort fields in certain order. This is very useful in scenarios where we have an enum Field represented as varchar and the values that it can hold are fairly static. CHANNELS &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#124; ID &#124; NAME &#124; TYPE &#124; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; TYPE field is a varchar that can take only SD, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=208&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>MySql provides nice functionality to sort fields in certain order. This is very useful in scenarios where we have an enum Field represented as varchar and the values that it can hold are fairly static.</p>
<p>CHANNELS<br />
 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| ID |  NAME | TYPE |<br />
 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>TYPE field is a varchar that can take only SD, HD and 3D. </p>
<p><strong>PROBLEM:</strong></p>
<p>To get a list of channels sorted by TYPE in an order of SD, HD and 3D. This can be done in couple of different ways:</p>
<p><pre class="brush: sql;">

-- Using by FIELD
SELECT * FROM CHANNELS ORDER BY FIELD(TYPE, 'SD', 'HD', '3D'); 

-- Using by FIND_IN_SET
SELECT * FROM CHANNELS ORDER BY FIND_IN_SET(TYPE, 'SD,HD,3D');
</pre></p>
<p>If you know any other way please leave a comment</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merereflections.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merereflections.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merereflections.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merereflections.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/merereflections.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/merereflections.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/merereflections.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/merereflections.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merereflections.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merereflections.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merereflections.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merereflections.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merereflections.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merereflections.wordpress.com/208/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=208&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://merereflections.wordpress.com/2010/08/19/mysql-sorting-fields-in-a-certain-order/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30ca871ed909d324b286b35131aceec4?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">merereflections</media:title>
		</media:content>
	</item>
		<item>
		<title>DbUnit and setting up changing data.</title>
		<link>http://merereflections.wordpress.com/2010/08/16/dbunit-and-setting-up-changing-data/</link>
		<comments>http://merereflections.wordpress.com/2010/08/16/dbunit-and-setting-up-changing-data/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 22:52:44 +0000</pubDate>
		<dc:creator>Bharat Kondeti</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[DbUnit]]></category>
		<category><![CDATA[Junit]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://merereflections.wordpress.com/?p=193</guid>
		<description><![CDATA[DbUnit is used to set up test data for integration tests that rely on a database. One way of importing and exporting database data in DbUnit is by XML data-sets. Assuming we have a table like this&#8230; CUSTOMER &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#124; ID &#124; FirstName &#124; LastName &#124; LicenceExpiryDate &#124; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; We are testing a method called [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=193&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dbunit.org/">DbUnit </a>is used to set up test data for integration tests that rely on a database. One way of importing and exporting database data in DbUnit is by XML data-sets. Assuming we have a table like this&#8230;</p>
<p>            <strong>CUSTOMER</strong><br />
 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| ID | FirstName | LastName | LicenceExpiryDate |<br />
 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>We are testing a method called <strong>isLicenceExpired(id)</strong>. To unit test this method we can setup some dummy data using DbUnits.<br />
<pre class="brush: xml;">
&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;dataset&gt;
  &lt;CUSTOMER ID=&quot;1&quot; FIRSTNAME=&quot;FirstName1&quot; LASTNAME=&quot;LastName1&quot; LICENCEEXPIRTDATE=&quot;2010-08-25&quot; 
  &lt;CUSTOMER ID=&quot;2&quot; FIRSTNAME=&quot;FirstName2&quot; LASTNAME=&quot;LastName2&quot; LICENCEEXPIRTDATE=&quot;2010-09-15&quot; 
  &lt;CUSTOMER ID=&quot;3&quot; FIRSTNAME=&quot;FirstName3&quot; LASTNAME=&quot;LastName3&quot; LICENCEEXPIRTDATE=&quot;2011-01-01&quot; 
&lt;/dataset&gt;
</pre></p>
<p>Problem with above setup is test-cases would eventually fail because of &#8216;LicenceExpiryDate&#8217;. We need to setup this date such that it&#8217;s relative to current date. This is where <a href="http://www.dbunit.org/apidocs/org/dbunit/dataset/ReplacementDataSet.html">ReplacementDataSet</a> comes into picture. This class decorates <a href="http://www.dbunit.org/apidocs/org/dbunit/dataset/xml/FlatXmlDataSet.html">FlatXmlDataSet</a> class to provide replacement functionality. Now we can define your data set as<br />
<span id="more-193"></span><br />
<pre class="brush: xml;">
&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;dataset&gt;
  &lt;CUSTOMER ID=&quot;1&quot; FIRSTNAME=&quot;FirstName1&quot; LASTNAME=&quot;LastName1&quot; LICENCEEXPIRTDATE=&quot;${today+10}&quot; 
  &lt;CUSTOMER ID=&quot;2&quot; FIRSTNAME=&quot;FirstName2&quot; LASTNAME=&quot;LastName2&quot; LICENCEEXPIRTDATE=&quot;${today+30}&quot; 
  &lt;CUSTOMER ID=&quot;3&quot; FIRSTNAME=&quot;FirstName3&quot; LASTNAME=&quot;LastName3&quot; LICENCEEXPIRTDATE=&quot;${today+100}&quot; 
&lt;/dataset&gt;
</pre></p>
<p>and example <strong>setupDataWithReplacement</strong> method would look like</p>
<p><pre class="brush: java;">
public static void setupDataWithReplacement(String fileName, Map&lt;String,Object&gt; replacements) throws Exception {
  
  //Get database connection.
  Connection conn = ds.getConnection();
  //When there are multiple databases 
  conn.setCatalog(DATABASE_NAME);
  try {
    IDatabaseConnection connection = new DatabaseConnection(conn,DATABASE_NAME);
    connection.getConfig().setProperty(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, true);

    IDataSet dataSet = new FlatXmlDataSet(AbstractTransactionalDasDataTests.class.getClassLoader().getResourceAsStream(fileName));

    //Decorate the class and call addReplacementObject method
    ReplacementDataSet rDataSet = new ReplacementDataSet(dataSet);
    for (String key : replacements.keySet()) {
      rDataSet.addReplacementObject(&quot;${&quot;+key+&quot;}&quot;, replacements.get(key));
    }

    DatabaseOperation.INSERT.execute(connection, rDataSet);
			
  } catch (Exception e) {
    e.printStackTrace();
  } finally {
    DataSourceUtils.releaseConnection(conn, ds);
  }
}

</pre></p>
<p>Now we can setup data like before we run our tests</p>
<p><pre class="brush: java;">
Date today = new Date();
Map&lt;String,Object&gt; replacements = new HashMap&lt;String,Object&gt;();
replacements.put(&quot;today+10&quot;, DateUtils.addDays(today, 10));
replacements.put(&quot;today+30&quot;, DateUtils.addDays(today, 30));
replacements.put(&quot;today+100&quot;, DateUtils.addDays(today, 100));
setupDataWithReplacement(&quot;customer-test-data.xml&quot;,replacements);
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merereflections.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merereflections.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merereflections.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merereflections.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/merereflections.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/merereflections.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/merereflections.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/merereflections.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merereflections.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merereflections.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merereflections.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merereflections.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merereflections.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merereflections.wordpress.com/193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=193&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://merereflections.wordpress.com/2010/08/16/dbunit-and-setting-up-changing-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30ca871ed909d324b286b35131aceec4?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">merereflections</media:title>
		</media:content>
	</item>
		<item>
		<title>Programming Language Wars</title>
		<link>http://merereflections.wordpress.com/2010/06/29/programming-language-wars/</link>
		<comments>http://merereflections.wordpress.com/2010/06/29/programming-language-wars/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 18:49:53 +0000</pubDate>
		<dc:creator>Bharat Kondeti</dc:creator>
				<category><![CDATA[screams]]></category>

		<guid isPermaLink="false">http://merereflections.wordpress.com/?p=172</guid>
		<description><![CDATA[Programming language wars are very interesting. Some take their programming language very religiously and vehemently argue how cool it is. This is what I would say; of course my own opinions and I have every right to have them. Language is just a tool: Many times people forget that programming language is just a tool [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=172&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Programming language wars are very interesting. Some take their programming language very religiously and vehemently argue how cool it is. This is what I would say; of course my own opinions and I have every right to have them.</p>
<p><strong>Language is just a tool:</strong>  Many times people forget that programming language is just a tool to solve problems. In the end it boils down to problem and a right solution. A problem can be solved in any language, but certain problem’s can be best solved by using certain languages while others are best suited for other problems. It depends upon using right programming language for solving a particular problem.<br />
<span id="more-172"></span><br />
<strong>Be a polyglot programmer:</strong>   Languages are evolving continuously. Each new language that is created tries to solve some complexities with old languages. Even advancement in chip and memory technologies is driving creation of new programming languages. Once many of the popular languages are compiled, now many modern languages are interpreted. Languages are becoming more abstract. If we look at modern languages, we are writing less code either via plugging in code or configuring (via xml or annotations) code or by auto-generating code. Being a polyglot programmer does not mean gaining expertise in many different languages but more of understanding capabilities of different programming languages and using them appropriately.</p>
<p><strong>Understand your problem and time-lines:</strong>  A problem can be solved in an optimal way or bad way or all the ways in between.  Balancing a solution and time-line is the key. One can take a month to come up with best solution or a day to come up with a crappy one, but coming up with working solution, that solves the current needs in the given time line is important. It’s all in knowing what language to pick to solve a particular problem.</p>
<p><strong>Don’t be scared:</strong>  Core programming concepts are the same in all programming languages. Some languages might support these concepts well while others don’t. Playing with many different languages and understanding its capabilities makes a good software developer.</p>
<p>A fun video for those who do not agree with me…</p>
<span style="text-align:center; display: block;"><a href="http://merereflections.wordpress.com/2010/06/29/programming-language-wars/"><img src="http://img.youtube.com/vi/fzza-ZbEY70/2.jpg" alt="" /></a></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merereflections.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merereflections.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merereflections.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merereflections.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/merereflections.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/merereflections.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/merereflections.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/merereflections.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merereflections.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merereflections.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merereflections.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merereflections.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merereflections.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merereflections.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merereflections.wordpress.com&amp;blog=4808163&amp;post=172&amp;subd=merereflections&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://merereflections.wordpress.com/2010/06/29/programming-language-wars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30ca871ed909d324b286b35131aceec4?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">merereflections</media:title>
		</media:content>
	</item>
	</channel>
</rss>
