<?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>My Blog - My Thoughts</title>
	<atom:link href="http://faisalferoz.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://faisalferoz.wordpress.com</link>
	<description>My tech Ramblings.</description>
	<lastBuildDate>Sat, 29 Oct 2011 15:22:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='faisalferoz.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/1d3a6c16bb23da5ca3e26027932c1c68?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>My Blog - My Thoughts</title>
		<link>http://faisalferoz.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://faisalferoz.wordpress.com/osd.xml" title="My Blog - My Thoughts" />
	<atom:link rel='hub' href='http://faisalferoz.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Goals</title>
		<link>http://faisalferoz.wordpress.com/2011/09/02/goals/</link>
		<comments>http://faisalferoz.wordpress.com/2011/09/02/goals/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 08:22:43 +0000</pubDate>
		<dc:creator>Faisal Feroz</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[goals dilbert]]></category>

		<guid isPermaLink="false">http://faisalferoz.wordpress.com/?p=345</guid>
		<description><![CDATA[Filed under: Java Tagged: goals dilbert<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=345&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/100000/30000/3000/100/133182/133182.strip.gif" title="Goals" class="aligncenter" width="640" height="199" /></p>
<br />Filed under: <a href='http://faisalferoz.wordpress.com/category/java/'>Java</a> Tagged: <a href='http://faisalferoz.wordpress.com/tag/goals-dilbert/'>goals dilbert</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/faisalferoz.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/faisalferoz.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/faisalferoz.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/faisalferoz.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/faisalferoz.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/faisalferoz.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/faisalferoz.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/faisalferoz.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/faisalferoz.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/faisalferoz.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/faisalferoz.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/faisalferoz.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/faisalferoz.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/faisalferoz.wordpress.com/345/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=345&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://faisalferoz.wordpress.com/2011/09/02/goals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/598af744ae204eea473b78d2ce872929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Faisal Feroz</media:title>
		</media:content>

		<media:content url="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/100000/30000/3000/100/133182/133182.strip.gif" medium="image">
			<media:title type="html">Goals</media:title>
		</media:content>
	</item>
		<item>
		<title>2010 in review</title>
		<link>http://faisalferoz.wordpress.com/2011/01/02/2010-in-review/</link>
		<comments>http://faisalferoz.wordpress.com/2011/01/02/2010-in-review/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 07:04:53 +0000</pubDate>
		<dc:creator>Faisal Feroz</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://faisalferoz.wordpress.com/?p=343</guid>
		<description><![CDATA[The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here&#8217;s a high level summary of its overall blog health: The Blog-Health-o-Meter™ reads Wow. Crunchy numbers A helper monkey made this abstract painting, inspired by your stats. A Boeing 747-400 passenger jet can hold 416 passengers. This blog was viewed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=343&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here&#8217;s a high level summary of its overall blog health:</p>
<p><img style="border:1px solid #ddd;background:#f5f5f5;padding:20px;" src="http://s0.wp.com/i/annual-recap/meter-healthy5.gif" alt="Healthy blog!" width="250" height="183" /></p>
<p>The <em>Blog-Health-o-Meter™</em> reads Wow.</p>
<h2>Crunchy numbers</h2>
<div style="width:288px;float:right;border:1px solid #ddd;background:#fff;margin:0 0 1em 1em;padding:6px;">
<p><img src="http://s0.wp.com/i/annual-recap/abstract-stats-1.png" alt="Featured image" /></p>
<p><em>A helper monkey made this abstract painting, inspired by your stats.</em></p>
</div>
<p>A Boeing 747-400 passenger jet can hold 416 passengers.  This blog was viewed about <strong>8,600</strong> times in 2010.  That&#8217;s about 21 full 747s.</p>
<p>&nbsp;</p>
<p>In 2010, there were <strong>28</strong> new posts, growing the total archive of this blog to 71 posts. There were <strong>34</strong> pictures uploaded, taking up a total of 10mb. That&#8217;s about 3 pictures per month.</p>
<p>The busiest day of the year was December 6th with <strong>941</strong> views. The most popular post that day was <a style="color:#08c;" href="http://faisalferoz.wordpress.com/2010/12/04/questions-you-should-ask-your-interviewer/">Questions you should ask your interviewer</a>.</p>
<h2>Where did they come from?</h2>
<p>The top referring sites in 2010 were <strong>dzone.com</strong>, <strong>jroller.com</strong>, <strong>facebook.com</strong>, <strong>stumbleupon.com</strong>, and <strong>en.wordpress.com</strong>.</p>
<p>Some visitors came searching, mostly for <strong>c++ bool &#8220;== true&#8221;</strong>, <strong>netpace</strong>, <strong>java 7 automatic resource management</strong>, <strong>who has the biggest brain swf</strong>, and <strong>secure code</strong>.</p>
<h2>Attractions in 2010</h2>
<p>These are the posts and pages that got the most views in 2010.</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">1</div>
<p><a style="margin-right:10px;" href="http://faisalferoz.wordpress.com/2010/12/04/questions-you-should-ask-your-interviewer/">Questions you should ask your interviewer</a> <span style="color:#999;font-size:8pt;">December 2010</span><br />
7 comments</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">2</div>
<p><a style="margin-right:10px;" href="http://faisalferoz.wordpress.com/2010/10/14/how-to-write-secure-java-code/">How to write Secure Java Code</a> <span style="color:#999;font-size:8pt;">October 2010</span><br />
15 comments and 2 Likes on WordPress.com</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">3</div>
<p><a style="margin-right:10px;" href="http://faisalferoz.wordpress.com/2010/10/11/how-websites-handle-multiple-users-simultaneously/">How websites handle multiple users simultaneously? </a> <span style="color:#999;font-size:8pt;">October 2010</span><br />
5 comments</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">4</div>
<p><a style="margin-right:10px;" href="http://faisalferoz.wordpress.com/2010/10/24/why-double-checked-locking-is-flawed/">Why Double Checked Locking is flawed</a> <span style="color:#999;font-size:8pt;">October 2010</span><br />
20 comments and 1 Like on WordPress.com,</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">5</div>
<p><a style="margin-right:10px;" href="http://faisalferoz.wordpress.com/2010/11/28/qa-friendly-java-profiler/">QA Friendly Java Profiler</a> <span style="color:#999;font-size:8pt;">November 2010</span><br />
1 comment</p>
<br />Filed under: <a href='http://faisalferoz.wordpress.com/category/general/'>General</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/faisalferoz.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/faisalferoz.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/faisalferoz.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/faisalferoz.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/faisalferoz.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/faisalferoz.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/faisalferoz.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/faisalferoz.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/faisalferoz.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/faisalferoz.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/faisalferoz.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/faisalferoz.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/faisalferoz.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/faisalferoz.wordpress.com/343/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=343&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://faisalferoz.wordpress.com/2011/01/02/2010-in-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/598af744ae204eea473b78d2ce872929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Faisal Feroz</media:title>
		</media:content>

		<media:content url="http://s0.wp.com/i/annual-recap/meter-healthy5.gif" medium="image">
			<media:title type="html">Healthy blog!</media:title>
		</media:content>

		<media:content url="http://s0.wp.com/i/annual-recap/abstract-stats-1.png" medium="image">
			<media:title type="html">Featured image</media:title>
		</media:content>
	</item>
		<item>
		<title>The Guy Infront of You</title>
		<link>http://faisalferoz.wordpress.com/2010/12/11/the-guy-infront-of-you/</link>
		<comments>http://faisalferoz.wordpress.com/2010/12/11/the-guy-infront-of-you/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 15:22:08 +0000</pubDate>
		<dc:creator>Faisal Feroz</dc:creator>
				<category><![CDATA[Interview Questions]]></category>
		<category><![CDATA[discussion]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://faisalferoz.wordpress.com/?p=326</guid>
		<description><![CDATA[This entry is dedicated to my friend &#8211; sali Note: This is a rant so if you are not interested in reading you can have a look at other posts It is just a rant about how not to conduct an interview and also realize that interviews shouldn&#8217;t be taken lightly especially when it comes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=326&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>This entry is dedicated to my friend &#8211; sali</strong><br />
<em><strong>Note:</strong> This is a rant so if you are not interested in reading you can have a look at other posts</em> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It is just a rant about how not to conduct an interview and also realize that interviews shouldn&#8217;t be taken lightly especially when it comes to interviewing a senior person. Anyways here goes the story&#8230;</p>
<p>Once upon a time in there was a Oracle Financials person (yea I would call him person) was given the task to develop a Oracle Financials for a Customer in Java. Without showing any concerns the person went on to find Java resources from the local market. He was referred different people and was so excited about developing the team that he didn&#8217;t even reviewed the resumes forwarded to him and just went on calling people for the interview. Again in excitement he didn&#8217;t even care to send out official emails for interview schedule and company address etc.</p>
<p>Anyways the process went on and a senior resource was called for the interview. Here comes the interesting part of the story &#8211; the actual interview conversation:</p>
<p><strong>Q: So how are you? Did you have any problems finding our office?</strong><br />
A: Hi, I am very good. Yes, I did had problems finding the office. There is no board identifying the office. (The only landmark near the office is actually a vegetable shop and a burger shop) Anyways I am here.</p>
<p><strong>Q: So can you tell me about your experience?</strong><br />
A: Yea, I am working on JEE for past N years and have worked on these many technologies&#8230;</p>
<p><strong>Q: (Interrupting the interviewee) You haven&#8217;t worked on Eclipse?!?!</strong><br />
A: (Thinking why is he asking for the IDE?!?!) Yes I have worked on Eclipse. It is basically a RCP but the biggest reason for its fame is as the premier Java IDE. But you can use any IDE if you are talking about it as an IDE. Its up to the user/developer what IDE he wants to work on as almost everyone has its own preferences.</p>
<p><strong>Q: So you worked in this company as well?</strong><br />
A: Yea, I worked there as a [Job Title] and worked for N years. Major responsibilities were&#8230;</p>
<p><strong>Q: (Again Interrupting) Did you know this guy there? He worked as [his Job Title]</strong><br />
A: While I was there he wasn&#8217;t there. I guess he joined after I left. (Thinking either this guy is totally dumb or hes really smart as this was a good attempt to verify if I actually worked there or not)</p>
<p><strong>Q: So why are you looking to switch from your current employer?</strong><br />
A: (Amazed &#8211; anyways till this time it was clear that this guy is dumb) I think you guys called me for a discussion. Anyways basic reasons for any switch are:<br />
1) Learning Opportunities.<br />
2) Growth.<br />
3) Monetary benefits.</p>
<p><strong>Q: So how much are you earning?</strong><br />
A: My basic salary is this much and I am entitled to these benefits.</p>
<p><strong>Q: Actually we are looking for a Software Engineer&#8230;</strong><br />
A: (Totally shocked and angry at the same time) Wait. Did you had the time to check my resume? I am not interested in joining as a Software Engineer. I would like to tell you somethings that should have been followed so that the waste of time that is going on here wouldn&#8217;t have happened. The standard process is to send an email and tell the person that you are hiring/interviewing for this position so that there isn&#8217;t a waste of time. Here the interviewer started to give all sort of reasons of why he wasn&#8217;t following the procedure and started to blame different people. <span style="text-decoration:underline;">Oh &#8211; wow so you are blaming your own team that they don&#8217;t do what they are supposed to do. Just imagine what he would have been saying after hiring. This is definitely a NO in the interview process &#8211; Never do that in front of the resource you are hiring. Tells a lot about your personality.</span></p>
<p><strong>Q: If you have any questions I am here to answer.</strong><br />
A: (Thinking although this was a total waste of time anyways lets ask about the business and his experience &#8211; never waste an opportunity) Yea, I have many. Heres the conversation:</p>
<p><strong>Q: Please tell me about the products and business are of the company?</strong><br />
A: We are in Investment Banking. We provide support for banks in this area.</p>
<p><strong>Q: Which part of Investment Banking are you guys in and are there any plans to grow/enter in any other areas?</strong><br />
A: We are in every part of Investment banking. We are hiring for a project where the customer wants us to develop (the already developed product) in Java. Proudly saying We say Yes to everything the customer says.</p>
<p><strong>Q: So actually customer is deciding what the company does?</strong><br />
A: Yea, it is the Customer who takes decision.</p>
<p><strong>Q: How much experience do yo have? Can you please give a brief introduction of yourself.</strong><br />
A: I have 12+ years of experience in Oracle Financials. And I worked in this this this countries before coming back here.</p>
<p><strong>Q: How much experience in Java?</strong><br />
A: None. I have never worked on Java (feeling very proud about this statement)</p>
<p><strong>Q: So who is the Architect of this Application?</strong><br />
A: The Guy in front of you.</p>
<p>Closing remarks by the interviewee &#8211; So you are the Architect of an application in a technology that you haven&#8217;t worked on. This answered all the questions as to why he was very concerned about using Eclipse. As he himself has no idea of Java so he thought Eclipse was Java.</p>
<p>I guess this was it. This <span style="text-decoration:underline;">Guy Infront of You</span> answered every question asked and completely silenced that interviewee. Good work on that <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://faisalferoz.wordpress.com/category/interview-questions-2/'>Interview Questions</a> Tagged: <a href='http://faisalferoz.wordpress.com/tag/discussion/'>discussion</a>, <a href='http://faisalferoz.wordpress.com/tag/interview/'>Interview</a>, <a href='http://faisalferoz.wordpress.com/tag/java/'>Java</a>, <a href='http://faisalferoz.wordpress.com/tag/opinion/'>opinion</a>, <a href='http://faisalferoz.wordpress.com/tag/rant/'>rant</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/faisalferoz.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/faisalferoz.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/faisalferoz.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/faisalferoz.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/faisalferoz.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/faisalferoz.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/faisalferoz.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/faisalferoz.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/faisalferoz.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/faisalferoz.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/faisalferoz.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/faisalferoz.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/faisalferoz.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/faisalferoz.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=326&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://faisalferoz.wordpress.com/2010/12/11/the-guy-infront-of-you/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/598af744ae204eea473b78d2ce872929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Faisal Feroz</media:title>
		</media:content>
	</item>
		<item>
		<title>How to screw your workforce</title>
		<link>http://faisalferoz.wordpress.com/2010/12/05/how-to-screw-your-workforce/</link>
		<comments>http://faisalferoz.wordpress.com/2010/12/05/how-to-screw-your-workforce/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 14:48:26 +0000</pubDate>
		<dc:creator>Faisal Feroz</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[resource management]]></category>
		<category><![CDATA[technology managment]]></category>

		<guid isPermaLink="false">http://faisalferoz.wordpress.com/?p=109</guid>
		<description><![CDATA[There are three ways of screwing the workforce and here are those golden points for everyone: Always try to eat the credit of others. And obviously if you are lucky this news will get to the people whos credit you ate. When this happens make sure that you try your best to convince them that what [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=109&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are three ways of screwing the workforce and here are those golden points for everyone:</p>
<ol>
<li>Always try to eat the credit of others. And obviously if you are lucky this news will get to the people whos credit you ate. When this happens make sure that you try your best to convince them that what a good job they did and how impressed you were by their efforts.<br />
But make sure that you don&#8217;t have to appreciate anyone on writing and keep these discussions off the records i.e, written emails, letter of appreciations are not appreciated at all.</li>
<li>Pay them as low as possible. When they come crying that their salary is not even comparable to their peers in the market convince them that they are working on a very unique project and they won&#8217;t be able to find anything similar in the market. If that doesn&#8217;t work tell them that it is always bad to take money as the motivation factor and working for money won&#8217;t get them high up the career ladder.</li>
<li>Last but not the least. Whenever they make any mistake make sure that you told this to them &#8211; yea that is a good thing &#8211; but theres a twist here. Don&#8217;t tell this to them in Person, pinpoint them in front of everyone so that every other person also knows that mistakes are not appreciated here.</li>
</ol>
<p>These are just the starting points but I am pretty sure that these will do the job more often then not. Feel free to share thoughts, suggestions and share the Golden rules you have come across to make this the ultimate Golden List for making the lives of the Employees a living hell.</p>
<br />Filed under: <a href='http://faisalferoz.wordpress.com/category/general/'>General</a> Tagged: <a href='http://faisalferoz.wordpress.com/tag/management/'>management</a>, <a href='http://faisalferoz.wordpress.com/tag/rant/'>rant</a>, <a href='http://faisalferoz.wordpress.com/tag/resource-management/'>resource management</a>, <a href='http://faisalferoz.wordpress.com/tag/technology-managment/'>technology managment</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/faisalferoz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/faisalferoz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/faisalferoz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/faisalferoz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/faisalferoz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/faisalferoz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/faisalferoz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/faisalferoz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/faisalferoz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/faisalferoz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/faisalferoz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/faisalferoz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/faisalferoz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/faisalferoz.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=109&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://faisalferoz.wordpress.com/2010/12/05/how-to-screw-your-workforce/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/598af744ae204eea473b78d2ce872929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Faisal Feroz</media:title>
		</media:content>
	</item>
		<item>
		<title>Questions you should ask your interviewer</title>
		<link>http://faisalferoz.wordpress.com/2010/12/04/questions-you-should-ask-your-interviewer/</link>
		<comments>http://faisalferoz.wordpress.com/2010/12/04/questions-you-should-ask-your-interviewer/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 04:30:41 +0000</pubDate>
		<dc:creator>Faisal Feroz</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Interview Questions]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Interview-Questions]]></category>
		<category><![CDATA[offshore]]></category>
		<category><![CDATA[offshoring]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://faisalferoz.wordpress.com/2008/07/27/questions-you-should-ask-your-interviewer/</guid>
		<description><![CDATA[Anyone who is or has done some job has most probably gone through an interview, where the interviewer asks some questions to judge your capabilities. Before applying for a job one should do proper research about the company where you applied. It is not easy as sometimes there isn’t much information available as the only [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=85&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Anyone who is or has done some job has most probably gone through an interview, where the interviewer asks some questions to judge your capabilities. Before applying for a job one should do proper research about the company where you applied. It is not easy as sometimes there isn’t much information available as the only resource usually available is the company’s web site which as expected is nothing but a marketing band wagon.</p>
<p>In such situations the interview is the best possible source for information. Good interviewers always takes candidate’s question and answer these honestly. So one should not waste this opportunity, you must be 100% sure about the company you are applying for as you will be spending a part of your life there so never take these decisions light heartedly. I have compiled a set of questions that should always be asked in order to judge how good the company is. Since I am a developer (Technical Architect to be exact) these questions are mostly related to development processes.</p>
<p><strong>Inquire if the company has presence in other countries? and if they have any development centers else where?</strong><br />
This tells if the company believes in offshore model or not. Off shoring is done to reduce cost and shows good business sense. But there are exceptions. Some company&#8217;s just have marketing offices in other countries, in any case you need to be sure that you are going to get constant work in future or in other words is there are any chance of your work getting off-shored or not.</p>
<p><strong>If the company has more than one development centers and you happen to be applying for the one than make sure that you ask about the presence of the CTO or any of the owners at the place where you are applying.<br />
</strong>The answer to this tells a lot about the amount and type of work you are going to get. If there is a presence of the CTO in your part then it shows that they are serious about developing/growing this offshore center. If there is no presence then you are done. Mark my words, <span style="text-decoration:underline;">no matter how good this job sounds you won’t have interesting work to do or in other words you won’t be involved in mission critical tasks</span>. Most probably your job description will be (obviously not written on your offer letter &#8211; these things are written between the lines) a bug fixer or trash cleaner <img src="http://faisalferoz.files.wordpress.com/2008/07/smile3.gif?w=600" alt="" /> The main reason why I am saying this is because all the decisions will be made in other part of the world and since you are not there you won’t be part of these meetings and analysis sessions.</p>
<p>There are exceptions as properly managing the offshore model needs a lot of time from these decision makers. But most of these people are not that good at it. They start off with the offshore model to save cost but as soon as they have secured some good investment they don’t pay much attention to it and in the end the team at that center is orphaned and there is not much charm in that job.</p>
<p><strong>Inquire about how much involved is CTO/Executives/Directors in the code i.e., do they actually write code?<br />
</strong>The answer shows how much they trust the team. Just imagine that CTO/Executive/Director wrote some code which is based on some assumption which in the near future is not going to hold true or in short doesn&#8217;t qualify as good code. Just imagine how hard it will be to change that code. Sometimes the whole framework or basis of the product is written by them. These frameworks/code sometimes contain some basic flaws and it takes nerves of steel to propose changes in such pieces of code. First the code is written by the CTO and if you propose a change in his code that suggestion is taken personally (there are exceptions but usually that is not the case) and you cannot imagine at what level he is going to go to protect his code from getting wiped out. I usually call this as the <em>married to code syndrome. </em>So make sure that the CTO/CEO of company you are targeting are not affected by that syndrome.</p>
<p><strong>How does the company manages the offshore development?<br />
Do they have separate offshore managers? What about the meetings?<br />
Are the developers in the offshore center involved in the analysis phase of the development?<br />
Where are most of the customers situated?</strong><br />
It is not easy to get the answers right during the interview and most of the time you find the real answers only after joining and this is pretty late. In my opinion it is best to ask these questions straight away and you can come to the conclusion by comparing the answers with the answers of you previous questions. If the CTO is very much involved in coding phase then there is not much of the analysis phase in the offshore center. If the customers are also far away from the offshore center then also, you are not going to get much customer exposure. If there is a 12–hour time difference between the offshore center and where the owners are then there is very high chance that there aren’t going to many meetings. As the owners (CTO/managers) will have to take pain in staying up late for you so that you can understand the requirements and come up with a quality solution. Usually this never happens and the offshore center is merely a bug-fixing department and nothing else.</p>
<p>I think these are some of the most important questions that you should ask the interviewer and take your decision accordingly as you future depends on it.</p>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/interview+questions">interview+questions</a>, <a rel="tag" href="http://technorati.com/tag/offshoring">offshoring</a>, <a rel="tag" href="http://technorati.com/tag/offshore">offshore</a>, <a rel="tag" href="http://technorati.com/tag/development">development</a></div>
<br />Filed under: <a href='http://faisalferoz.wordpress.com/category/general/'>General</a>, <a href='http://faisalferoz.wordpress.com/category/interview-questions-2/'>Interview Questions</a> Tagged: <a href='http://faisalferoz.wordpress.com/tag/development/'>development</a>, <a href='http://faisalferoz.wordpress.com/tag/interview/'>Interview</a>, <a href='http://faisalferoz.wordpress.com/tag/interview-questions/'>Interview-Questions</a>, <a href='http://faisalferoz.wordpress.com/tag/offshore/'>offshore</a>, <a href='http://faisalferoz.wordpress.com/tag/offshoring/'>offshoring</a>, <a href='http://faisalferoz.wordpress.com/tag/software-development/'>Software Development</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/faisalferoz.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/faisalferoz.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/faisalferoz.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/faisalferoz.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/faisalferoz.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/faisalferoz.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/faisalferoz.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/faisalferoz.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/faisalferoz.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/faisalferoz.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/faisalferoz.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/faisalferoz.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/faisalferoz.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/faisalferoz.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=85&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://faisalferoz.wordpress.com/2010/12/04/questions-you-should-ask-your-interviewer/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/598af744ae204eea473b78d2ce872929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Faisal Feroz</media:title>
		</media:content>

		<media:content url="http://faisalferoz.files.wordpress.com/2008/07/smile3.gif" medium="image" />
	</item>
		<item>
		<title>My Canada Trip – Niagara Parks</title>
		<link>http://faisalferoz.wordpress.com/2010/11/28/my-canada-trip-%e2%80%93-niagara-parks/</link>
		<comments>http://faisalferoz.wordpress.com/2010/11/28/my-canada-trip-%e2%80%93-niagara-parks/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 09:56:11 +0000</pubDate>
		<dc:creator>Faisal Feroz</dc:creator>
				<category><![CDATA[Travel]]></category>
		<category><![CDATA[Canada]]></category>
		<category><![CDATA[Niagara Falls]]></category>
		<category><![CDATA[Park]]></category>

		<guid isPermaLink="false">http://faisalferoz.wordpress.com/?p=295</guid>
		<description><![CDATA[Niagara Parks &#8211; beautifully maintained  parkland, spectacular gardens and rare floral displays. Trees, shrubs, perennials and annuals have been arranged to beautify the landscape with a variety of form, texture and colour designed to accentuate each season. Here are some of the videos of the Parks: From natural areas with native flora to picnic areas and highly sculpted [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=295&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Niagara Parks &#8211; beautifully maintained  parkland, spectacular gardens and rare floral displays. Trees, shrubs, perennials and annuals have been arranged to beautify the landscape with a variety of form, texture and colour designed to accentuate each season.</p>
<p>Here are some of the videos of the Parks:</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='600' height='368' src='http://www.youtube.com/embed/_i6BZBPU9_c?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span>
<p>From natural areas with native flora to picnic areas and highly sculpted horticulture masterpieces, Niagara Parks has it all. The diverse plant collections number in the thousands and the Park provides a fitting backdrop for the beauty of the Falls.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='600' height='368' src='http://www.youtube.com/embed/t0lwxKmv_Yw?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span>
<br />Filed under: <a href='http://faisalferoz.wordpress.com/category/travel/'>Travel</a> Tagged: <a href='http://faisalferoz.wordpress.com/tag/canada/'>Canada</a>, <a href='http://faisalferoz.wordpress.com/tag/niagara-falls/'>Niagara Falls</a>, <a href='http://faisalferoz.wordpress.com/tag/park/'>Park</a>, <a href='http://faisalferoz.wordpress.com/tag/travel/'>Travel</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/faisalferoz.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/faisalferoz.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/faisalferoz.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/faisalferoz.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/faisalferoz.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/faisalferoz.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/faisalferoz.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/faisalferoz.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/faisalferoz.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/faisalferoz.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/faisalferoz.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/faisalferoz.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/faisalferoz.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/faisalferoz.wordpress.com/295/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=295&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://faisalferoz.wordpress.com/2010/11/28/my-canada-trip-%e2%80%93-niagara-parks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/598af744ae204eea473b78d2ce872929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Faisal Feroz</media:title>
		</media:content>
	</item>
		<item>
		<title>Auto Name Suggestion Horror</title>
		<link>http://faisalferoz.wordpress.com/2010/11/28/auto-name-suggestion-horror/</link>
		<comments>http://faisalferoz.wordpress.com/2010/11/28/auto-name-suggestion-horror/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 03:31:58 +0000</pubDate>
		<dc:creator>Faisal Feroz</dc:creator>
				<category><![CDATA[Horror Code]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://faisalferoz.wordpress.com/2008/01/20/auto-name-suggestion-horror/</guid>
		<description><![CDATA[Recently a Bug was reported in our product about a certain swing window taking a lot of time to appear. Naturally the first thing you do is debug out the issue to find out what is going on behind the scenes that a simple window is taking that long to appear. As I was stepping [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=60&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently a Bug was reported in our product about a certain swing window taking a lot of time to appear. Naturally the first thing you do is debug out the issue to find out what is going on behind the scenes that a simple window is taking that long to appear.</p>
<p>As I was stepping through the code using the eclipse debugger i found a call to a method getUniqueName() which was taking a hell of a time to return and the CPU was going mad while I was waiting for the call to return. Inside the method I found this beautifu piece of code that I would like to share with everyone. Here is the master piece:</p>
<p><pre class="brush: java;">
private String getUniqueName(String baseName, BranchObject newBranch)
{
    String retVal = baseName;
    IBranchLink [] branches = m_javaCommand.getUtilBranches();

    for (int iCheck = 1; iCheck &lt; Integer.MAX_VALUE; iCheck++)
    {
        for (int iBranch = 0; iBranch &lt; branches.length; iBranch++)
        {
            BranchObject branch = (BranchObject)branches[iBranch];
            if ((newBranch != branch) &amp;&amp; branch.toString().equals(retVal))
            {
                retVal += iCheck;
            }
            else
            {
                break;
            }
        }
    }
}
</pre></p>
<p>The purpose of the code was to search for a unique name to be given to the object that was created wnen the save button was hit on the swing window. For example if the base name is Image then this code will search out the objects to see if there is any object named Image if yes then it tries Image1 and then Image2 until it finds a unique name. Altough the code above doesn&#8217;t do this but there is one obvious mistake in the code.</p>
<p>I have fixed the problem but lets see if anyone out there can find the most obvious mistake in the code which was trying was driving the CPU crazy?</p>
<br />Filed under: <a href='http://faisalferoz.wordpress.com/category/horror-code/'>Horror Code</a>, <a href='http://faisalferoz.wordpress.com/category/java/'>Java</a> Tagged: <a href='http://faisalferoz.wordpress.com/tag/horror-code/'>Horror Code</a>, <a href='http://faisalferoz.wordpress.com/tag/java/'>Java</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/faisalferoz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/faisalferoz.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/faisalferoz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/faisalferoz.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/faisalferoz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/faisalferoz.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/faisalferoz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/faisalferoz.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/faisalferoz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/faisalferoz.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/faisalferoz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/faisalferoz.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/faisalferoz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/faisalferoz.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=60&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://faisalferoz.wordpress.com/2010/11/28/auto-name-suggestion-horror/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/598af744ae204eea473b78d2ce872929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Faisal Feroz</media:title>
		</media:content>
	</item>
		<item>
		<title>See if you can spot the mistake in this code?</title>
		<link>http://faisalferoz.wordpress.com/2010/11/28/see-if-you-can-spot-the-mistake-in-this-code/</link>
		<comments>http://faisalferoz.wordpress.com/2010/11/28/see-if-you-can-spot-the-mistake-in-this-code/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 03:20:49 +0000</pubDate>
		<dc:creator>Faisal Feroz</dc:creator>
				<category><![CDATA[Horror Code]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[infinite loop]]></category>

		<guid isPermaLink="false">http://faisalferoz.wordpress.com/2007/12/19/see-if-you-can-spot-the-mistake-in-this-code/</guid>
		<description><![CDATA[Heres the code&#8230; Hint: Infinite loop !!! Filed under: Horror Code, Java Tagged: code, infinite loop, Java<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=41&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Heres the code&#8230;</p>
<p><pre class="brush: java;">
public void fillSlots(String s, ScriptEntity.ScriptEntityType t, int startHour, int startMinute, int frequency)
{
    frequency = frequency / MINUTES_IN_ONE_HOUR;
    if (frequency == 0) {
        return;
    }

    int iX = startMinute / MINUTES_IN_ONE_SLOT; 
    // X index: 0 minute -- iX (0); 15 minute -- iX (1);
    // 30 minute -- iX (2); 45 minute -- iX (3).
    int iY = startHour % Y_INDEX; // Y index

    for (int i = iY; i &lt; Y_INDEX; ) {
        fillSlot(s, t, iX);
        i =+ frequency;
    }
}
</pre></p>
<p><em>Hint: Infinite loop !!!</em></p>
<br />Filed under: <a href='http://faisalferoz.wordpress.com/category/horror-code/'>Horror Code</a>, <a href='http://faisalferoz.wordpress.com/category/java/'>Java</a> Tagged: <a href='http://faisalferoz.wordpress.com/tag/code/'>code</a>, <a href='http://faisalferoz.wordpress.com/tag/infinite-loop/'>infinite loop</a>, <a href='http://faisalferoz.wordpress.com/tag/java/'>Java</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/faisalferoz.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/faisalferoz.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/faisalferoz.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/faisalferoz.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/faisalferoz.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/faisalferoz.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/faisalferoz.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/faisalferoz.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/faisalferoz.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/faisalferoz.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/faisalferoz.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/faisalferoz.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/faisalferoz.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/faisalferoz.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=41&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://faisalferoz.wordpress.com/2010/11/28/see-if-you-can-spot-the-mistake-in-this-code/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/598af744ae204eea473b78d2ce872929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Faisal Feroz</media:title>
		</media:content>
	</item>
		<item>
		<title>QA Friendly Java Profiler</title>
		<link>http://faisalferoz.wordpress.com/2010/11/28/qa-friendly-java-profiler/</link>
		<comments>http://faisalferoz.wordpress.com/2010/11/28/qa-friendly-java-profiler/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 02:32:07 +0000</pubDate>
		<dc:creator>Faisal Feroz</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[QA]]></category>

		<guid isPermaLink="false">http://faisalferoz.wordpress.com/?p=72</guid>
		<description><![CDATA[We have been experiencing some issues with our product under a reasonable load. So our QA department jumped in and decided to load test the product. They decided to run our servers under a profiler and put a massive load on these servers inorder to find out what is going on. I was having a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=72&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have been experiencing some issues with our product under a reasonable load. So our QA department jumped in and decided to load test the product. They decided to run our servers under a profiler and put a massive load on these servers inorder to find out what is going on.</p>
<p>I was having a discussion with the QA manager about this and I was asked to recommend <a href="http://www.ej-technologies.com/products/jprofiler/overview.html" target="_blank">JProfiler</a> to the management so that a license could be acquired. To be frank I am not a very big fan of JProfiler. I usually don&#8217;t go with these commercial profilers unless the tools available with the JDK are simply not enough &#8211; which is rare. Even in that situation I use the <a href="http://www.yourkit.com/" target="_blank">YourKit</a> Java Profiler. This is when I was asked &#8220;<strong>Is it QA friendly?</strong>&#8220;</p>
<p>Well, this seems to me a wrong question because:</p>
<ul>
<li>The profilers are never QA firendly as their target audience is never QA people, they are meant for the developers as its the developers who have written all the code and they who know their code the best and can put all the information to good use that the profilers produce.</li>
<li>Since the developers know how their code works they know what to profile and what not to profile. Profilers usually make the product slow and it really helps if you know what to profile. As you you don&#8217;t waste a lot of time waiting for the test case to complete and analyzing results.</li>
<li>QA generally regards everything as bug, if the profiler produces a dump having tons of byte[] than QA files this as a bug/root cause of the load issues. But in fact this can be wrong. And developers have to find out the root cause by themselves and it turns out that they end up wasting time finding the root cause of a problem which never existed.</li>
</ul>
<p>So in my opinion all these activities should be left to the developers and the QA should act as a helping hand in these scenarios coming up with a reproducible test case that the developrs can use to find out the root cause be it using profilers or reviewing the code.</p>
<br />Filed under: <a href='http://faisalferoz.wordpress.com/category/general/'>General</a>, <a href='http://faisalferoz.wordpress.com/category/java/'>Java</a>, <a href='http://faisalferoz.wordpress.com/category/technology/'>Technology</a> Tagged: <a href='http://faisalferoz.wordpress.com/tag/java/'>Java</a>, <a href='http://faisalferoz.wordpress.com/tag/profiler/'>profiler</a>, <a href='http://faisalferoz.wordpress.com/tag/qa/'>QA</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/faisalferoz.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/faisalferoz.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/faisalferoz.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/faisalferoz.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/faisalferoz.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/faisalferoz.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/faisalferoz.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/faisalferoz.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/faisalferoz.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/faisalferoz.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/faisalferoz.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/faisalferoz.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/faisalferoz.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/faisalferoz.wordpress.com/72/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=72&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://faisalferoz.wordpress.com/2010/11/28/qa-friendly-java-profiler/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/598af744ae204eea473b78d2ce872929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Faisal Feroz</media:title>
		</media:content>
	</item>
		<item>
		<title>Why Double Checked Locking is flawed</title>
		<link>http://faisalferoz.wordpress.com/2010/10/24/why-double-checked-locking-is-flawed/</link>
		<comments>http://faisalferoz.wordpress.com/2010/10/24/why-double-checked-locking-is-flawed/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 11:12:55 +0000</pubDate>
		<dc:creator>Faisal Feroz</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[DCL]]></category>
		<category><![CDATA[double checked locking]]></category>
		<category><![CDATA[singleton]]></category>
		<category><![CDATA[synchronized]]></category>

		<guid isPermaLink="false">http://faisalferoz.wordpress.com/?p=286</guid>
		<description><![CDATA[I was having a discussion with fellow developers friends about how to implement Singleton and many things came up. In the discussion I soon realized that not many developers are aware of the fact that Double Checked Locking (DCL) is flawed. Many developers say that they have never seen any issues with it and hence [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=286&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was having a discussion with fellow developers friends about how to implement Singleton and many things came up. In the discussion I soon realized that not many developers are aware of the fact that <a href="http://en.wikipedia.org/wiki/Double-checked_locking" target="_blank">Double Checked Locking (DCL)</a> is flawed. Many developers say that they have never seen any issues with it and hence they use it everywhere in order to overcome the Synchronization over head. So I thought this would be a good topic to discuss here at my blog and this post is going to focus on it.</p>
<p>Before moving forward lets first talk about what is Double Checked Locking. To understand where the double-checked locking idiom originated, you must understand the common singleton creation idiom, which is illustrated below:</p>
<p><pre class="brush: java;">
import java.util.*;
class Singleton
{
  private static Singleton instance;
  private Vector v;

  private Singleton()
  {
    v = new Vector();
    v.addElement(new Object());
  }

  public static Singleton getInstance()
  {
    if (instance == null)          //1
      instance = new Singleton();  //2
    return instance;               //3
  }
}
</pre></p>
<p>The design for this class is suitable for single thread usage but when it comes to multi-thread usage. Since threads can get preempted we can have multiple instances of Singleton object. The solution is to protect the <code>getInstance()</code> method through synchronization as shown below:</p>
<p><pre class="brush: java;">
  public static synchronized Singleton getInstance()
  {
    if (instance == null)          //1
      instance = new Singleton();  //2
    return instance;               //3
  }
</pre></p>
<p>This code works perfectly fine for multi-threaded access to <code>getInstance()</code> method. But if you look at the code deeply, synchronization is required only once, when the variable is initialized. Rest of the time there is no need for synchronization and hence we get the synchronization overhead for other threads since the whole method is synchronized.</p>
<p>In an effort to make this method more efficient (avoiding the synchronization on common, the read path) an idiom called Double Checked Locking was born. The idea is to avoid the costly synchronization for all invocations of the method except the first. The cost of synchronization differs from JVM to JVM. In the early days, the cost could be quite high. As more advanced JVMs have emerged, the cost of synchronization has decreased, but there is still a performance penalty for entering and leaving a synchronized method or block. Regardless of the advancements in JVM technology, programmers never want to waste processing time unnecessarily.</p>
<p>Here is how DCL is implemented:</p>
<p><pre class="brush: java;">
public static Singleton getInstance()
{
  if (instance == null)
  {
    synchronized(Singleton.class) {  //1
      if (instance == null)          //2
        instance = new Singleton();  //3
    }
  }
  return instance;
}
</pre></p>
<p>The theory behind double-checked locking is that the second check at //2 makes it impossible for two different Singleton objects to be created and we also avoid the synchronization overhead for the most frequent read path by check at // 1.</p>
<p>The theory behind DCL is perfect but reality is entirely different. The problem with double-checked locking is that there is no guarantee it will work on single or multi-processor machines. The issue of the failure of double-checked locking is not due to implementation bugs in JVMs but to the current Java platform memory model. The memory model allows what is known as &#8220;out-of-order writes&#8221; and is a prime reason why this idiom fails.</p>
<h3>What is out of order writes?</h3>
<p>To illustrate the problem, you need to re-examine line //3 from the code above. This line of code creates a Singleton object and initializes the variable instance to refer to this object. The problem with this line of code is that the variable instance can become non-null before the body of the Singleton constructor executes.</p>
<p>Before explaining how this happens, accept this fact for a moment while examining how this breaks the double-checked locking idiom. Consider the following sequence of events with the code above:</p>
<ul>
<li>Thread 1 enters the <code>getInstance()</code> method.</li>
<li>Thread 1 enters the synchronized block at //1 because instance is null.</li>
<li>Thread 1 proceeds to //3 and makes instance non-null, but before the constructor executes.   Thread 1 is preempted by thread 2.</li>
<li>Thread 2 checks to see if instance is null. Because it is not, thread 2 returns the instance reference to a fully constructed, but partially initialized, Singleton object.</li>
<li>Thread 2 is preempted by thread 1.  Thread 1 completes the initialization of the Singleton object by running its constructor and returns a reference to it.</li>
</ul>
<p>These sequence of events results in a period of time where Thread 2 returned an object whose constructor had not executed. To show how this occurs, consider the following pseudo code for the line: <code>instance = new Singleton();</code></p>
<p><pre class="brush: java;">
mem = allocate();             //Allocate memory for Singleton object.
instance = mem;               //Note that instance is now non-null, but
                              //has not been initialized.
ctorSingleton(instance);      //Invoke constructor for Singleton passing
                              //instance.
</pre></p>
<p><em><span style="text-decoration:underline;">This pseudo code is not only possible, but is exactly what happens on some JIT compilers.</span></em> To prove the point I am showing a stripped down version of <code>getInstance()</code> method and its assembly code.</p>
<p><pre class="brush: java;">
class Singleton
{
  private static Singleton instance;
  private boolean inUse;
  private int val;

  private Singleton()
  {
    inUse = true;
    val = 5;
  }
  public static Singleton getInstance()
  {
    if (instance == null)
      instance = new Singleton();
    return instance;
  }
}
</pre></p>
<p>Here is the assembly code for the above code:</p>
<p><pre class="brush: plain;">
;asm code generated for getInstance
054D20B0   mov         eax,[049388C8]      ;load instance ref
054D20B5   test        eax,eax             ;test for null
054D20B7   jne         054D20D7
054D20B9   mov         eax,14C0988h
054D20BE   call        503EF8F0            ;allocate memory
054D20C3   mov         [049388C8],eax      ;store pointer in
                                           ;instance ref. instance
                                           ;non-null and ctor
                                           ;has not run
054D20C8   mov         ecx,dword ptr [eax]
054D20CA   mov         dword ptr [ecx],1   ;inline ctor - inUse=true;
054D20D0   mov         dword ptr [ecx+4],5 ;inline ctor - val=5;
054D20D7   mov         ebx,dword ptr ds:[49388C8h]
054D20DD   jmp         054D20B0
</pre></p>
<p>For those who are not hands on Assembly language here is a summary of the code sequence:</p>
<ul>
<li>The first two lines of assembly code at B0 and B5 load the instance reference from memory location 049388C8 into eax and test for null. This corresponds to the first line of the <code>getInstance()</code> method.</li>
<li>The first time this method is called, instance is null and the code proceeds to B9.</li>
<li>The code at BE allocates the memory from the heap for the Singleton object and stores a pointer to that memory in eax.</li>
<li>The next line, C3, takes the pointer in eax and stores it back into the instance reference at memory location 049388C8. As a result, instance is now non-null and refers to a valid Singleton object.</li>
<li>However, the constructor for this object has not run yet, which is precisely the situation that breaks double-checked locking.</li>
<li>Then at line C8, the instance pointer is dereferenced and stored in ecx.</li>
<li>Lines CA and D0 represent the inline constructor storing the values true and 5 into the Singleton object.</li>
<li>If this code is interrupted by another thread after executing line C3 but before completing the constructor, double-checked locking fails.</li>
</ul>
<p>Not all JIT compilers generate the code as above. Some generate code such that <code>instance</code> becomes non-<code>null</code> only after the constructor executes. However, this does not mean you should use double-checked locking in these instances. There are other reasons it could fail. In addition, you do not always know which JVMs your code will run on, and the JIT compiler could always change to generate code that breaks this idiom.</p>
<p>So how do we solve the issue. Some developers come up with the following code:</p>
<p><pre class="brush: java;">
        public static Singleton getInstance() {
		if (instance == null) {
		    instance = this.getInstanceSlow();
		}
		return instance;
	}

	private static synchronized Singleton getInstanceSlow() {
		if (instance == null) {
		    instance = new Singleton();
		}
		return instance;
	}
</pre></p>
<p>In other words, delegate the locking to another method. This is entirely equivalent to the inline version, and fails for the same reasons.</p>
<h3>Volatile?</h3>
<p>Another idea is to use the keyword volatile for the variables inst and instance. According to the <a href="http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html" target="_blank">JLS </a>, variables declared volatile are supposed to be sequentially consistent, and therefore, not reordered. But two problems occur with trying to use volatile to fix the problem with double-checked locking:</p>
<ol>
<li>The problem here is not with sequential consistency. Code is being moved, not reordered.</li>
<li>Many JVMs do not implement volatile correctly regarding sequential consistency anyway.</li>
</ol>
<p>The second point is worth expanding upon. Consider the code:</p>
<p><pre class="brush: java;">
class Test
{
  private volatile boolean stop = false;
  private volatile int num = 0;

  public void foo()
  {
    num = 100;    //This can happen second
    stop = true;  //This can happen first
    //...
  }

  public void bar()
  {
    if (stop)
      num += num;  //num can == 0!
  }
  //...
}
</pre></p>
<p>According to the JLS, because stop and num are declared volatile, they should be sequentially consistent. This means that if stop is ever true, num must have been set to 100. However, because many JVMs do not implement the sequential consistency feature of volatile, you cannot count on this behavior. Therefore, if Thread 1 called foo and Thread 2 called bar concurrently, Thread 1 might set stop to true before num is set to 100. This could lead thread 2 to see stop as true, but num still set to 0. There are additional problems with volatile and the atomicity of 64-bit variables, I wont go in to the details as it is out of scope for this post.</p>
<p>This is it from me for now. Stay tuned for the next post in which I will discuss various solutions available for fixing this and pros and cons of those solution.</p>
<p>Until then Happy Coding !</p>
<br />Filed under: <a href='http://faisalferoz.wordpress.com/category/java/'>Java</a> Tagged: <a href='http://faisalferoz.wordpress.com/tag/concurrency/'>Concurrency</a>, <a href='http://faisalferoz.wordpress.com/tag/dcl/'>DCL</a>, <a href='http://faisalferoz.wordpress.com/tag/double-checked-locking/'>double checked locking</a>, <a href='http://faisalferoz.wordpress.com/tag/java/'>Java</a>, <a href='http://faisalferoz.wordpress.com/tag/singleton/'>singleton</a>, <a href='http://faisalferoz.wordpress.com/tag/synchronized/'>synchronized</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/faisalferoz.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/faisalferoz.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/faisalferoz.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/faisalferoz.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/faisalferoz.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/faisalferoz.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/faisalferoz.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/faisalferoz.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/faisalferoz.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/faisalferoz.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/faisalferoz.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/faisalferoz.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/faisalferoz.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/faisalferoz.wordpress.com/286/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=faisalferoz.wordpress.com&amp;blog=2094736&amp;post=286&amp;subd=faisalferoz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://faisalferoz.wordpress.com/2010/10/24/why-double-checked-locking-is-flawed/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/598af744ae204eea473b78d2ce872929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Faisal Feroz</media:title>
		</media:content>
	</item>
	</channel>
</rss>
