<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>zParacha.com</title>
	
	<link>http://www.zparacha.com</link>
	<description>Effective programming and blogging tips by Zaheer Paracha</description>
	<lastBuildDate>Wed, 09 Nov 2011 00:52:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/zparacha" /><feedburner:info uri="zparacha" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>zparacha</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>How to redirect homepage in Joomla</title>
		<link>http://feedproxy.google.com/~r/zparacha/~3/OTeUp3mNX7E/</link>
		<comments>http://www.zparacha.com/how-to-redirect-homepage-in-joomla/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 18:29:18 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/how-to-redirect-homepage-in-joomla/</guid>
		<description><![CDATA[Joomla is a wonderful platform to publish websites. With readily available templates you can have your website up and running in no time. Sometimes though you may need to direct your visitors to a different page than your regular home page, for instance you may want to direct all the visitors to a promotion page [...]<p><a href="http://www.zparacha.com/how-to-redirect-homepage-in-joomla/">How to redirect homepage in Joomla</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>

<span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/how-to-limit-number-of-posts-on-your-wordpress-homepage/' rel='bookmark' title='How to limit number of posts on your WordPress homepage.'>How to limit number of posts on your WordPress homepage.</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><div style="float:left;margin-right:10px;padding-right:10px;">
<script type="text/javascript"><!--
google_ad_client = "pub-8906446563553931";
/* 250By250GreyPostLeftAd, created 2/27/08 */
google_ad_slot = "9337619139";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div><br />
Joomla is a wonderful platform to publish websites. With readily available templates you can have your website up and running in no time. Sometimes though you may need to direct your visitors to a different page than your regular home page, for instance you may want to direct all the visitors to a promotion page during special sales events. There is a very simple and easy way of doing this in Joomla.<span id="more-1338"></span></p>
<ol>
<li>Create and upload the standalone webpage to your domain.
	</li>
<li>
Backup your index.php file in templates/YOUR_TEMPLATE_FOLDER.	</li>
<li>
<p>Add following lines to the index.php file under the templates/YOUR_TEMPLATE_FOLDER.</li>
<pre name="code" class="php">
<?php
if ( JURI::base()==JURI::current() )
 { header( 'Location: http://www.yourdomainname.com/NEW_PAGE.php' ); }
?></pre>
</ol>
<p>Now when the visitors come to your website they will be taken to NEW_PAGE.php.<br />
After the need to redirect the traffic is over simply replace the index.php file with the file you backed up in step 1.</p>
<p>Happy coding..<br />
<script type="text/javascript"><!--
google_ad_client = "pub-8906446563553931";
/* wpDesignerPostBanner468x60, created 3/10/08 */
google_ad_slot = "8550933363";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!--
<br><br/>
<script type="text/javascript">
/* <![CDATA[ */
function affiliateLink(str){ str = unescape(str); var r = ''; for(var i = 0; i < str.length; i++) r += String.fromCharCode(3^str.charCodeAt(i)); document.write(r); }
affiliateLink('%3Fb%23kqfe%3E%21kwws9%2C%2Cttt-wf%7Bw.ojmh.bgp-%60ln%2C%3Cqfe%3E201231%21%3D%3Fjnd%23pq%60%3E%21kwws9%2C%2Cttt-wf%7Bw.ojmh.bgp-%60ln%2Cjnbdfp%2Cwf%7Bw%5Cojmh%5Cbgp%5C@%5C75%3B%7B53-dje%21%23alqgfq%3E%213%21%23bow%3E%21Wf%7Bw%23Ojmh%23Bgp%21%3D%3F%2Cb%3D');
/* ]]&gt; */
</script>
-->
<br><p />
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fhow-to-redirect-homepage-in-joomla%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fhow-to-redirect-homepage-in-joomla%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="How to redirect homepage in Joomla" alt=" How to redirect homepage in Joomla" /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/how-to-redirect-homepage-in-joomla/">How to redirect homepage in Joomla</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'How to redirect homepage in Joomla on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/how-to-redirect-homepage-in-joomla/',contentID: 'post-1338',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'Joomla',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="How to redirect homepage in Joomla" alt="article clipper vert How to redirect homepage in Joomla" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/how-to-limit-number-of-posts-on-your-wordpress-homepage/' rel='bookmark' title='How to limit number of posts on your WordPress homepage.'>How to limit number of posts on your WordPress homepage.</a></li>
</ul></p>
<p><a href="http://feedads.g.doubleclick.net/~a/HNhtvQWSctUvCxBydzwSvz962eE/0/da"><img src="http://feedads.g.doubleclick.net/~a/HNhtvQWSctUvCxBydzwSvz962eE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HNhtvQWSctUvCxBydzwSvz962eE/1/da"><img src="http://feedads.g.doubleclick.net/~a/HNhtvQWSctUvCxBydzwSvz962eE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/zparacha?a=OTeUp3mNX7E:ISiS8-YIYlY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/zparacha?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=OTeUp3mNX7E:ISiS8-YIYlY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/zparacha?i=OTeUp3mNX7E:ISiS8-YIYlY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=OTeUp3mNX7E:ISiS8-YIYlY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/zparacha?i=OTeUp3mNX7E:ISiS8-YIYlY:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/zparacha/~4/OTeUp3mNX7E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/how-to-redirect-homepage-in-joomla/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.zparacha.com/how-to-redirect-homepage-in-joomla/</feedburner:origLink></item>
		<item>
		<title>Get 99% off first month of hosting service fee.</title>
		<link>http://feedproxy.google.com/~r/zparacha/~3/e9NOCFcMjyI/</link>
		<comments>http://www.zparacha.com/get-99-off-first-month-of-hosting-service-fee/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 23:09:54 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Best Sites]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1305</guid>
		<description><![CDATA[ <p><a href="http://www.zparacha.com/get-99-off-first-month-of-hosting-service-fee/">Get 99% off first month of hosting service fee.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>

No related posts.]]></description>
			<content:encoded><![CDATA[<p><!--adsense#336By280--></p>
<p>Are you looking for an affordable yet reliable web hosting company? Let me introduce you to <a href="http://www.eleven2.com/211.html">eleven2.com</a>. About 3 years ago I moved my website to them and since then I am one of their many happy and satisfied customers. While searching for a web hosting company three years ago to move my blogs from my previous host I stumbled upon <a href="http://www.eleven2.com/211.html">eleven2</a>. <span id="more-1305"></span><br />
Since I hadn&#8217;t heard of this company before I was somewhat reluctant to sign up with <a href="http://www.eleven2.com/211.html">eleven2</a>. So I emailed them few questions late one night and to my pleasant surprise they responded within few minutes. We exchanged few quick emails and they convinced me that <a href="http://www.eleven2.com/211.html">eleven2</a> is a customer-centric host with 24/7 tech support. Fifteen minutes later I became their customer. I can vouch for their excellent customer service. I did not face any major issues but whenever I had a question or complaint they responded almost instantaneously. Tech support team is knowledgeable.<br />
Because of my positive experience with <a href="http://www.eleven2.com/211.html">eleven2.com</a> I strongly recommend it to all my friends. Couple of friends took my advice and they too are satisfied with eleven2.<br />
With their 60 days money back guarantee you can give them a try and see for yourself.<br />
And if that is not enough I have some 25% and 99% off first month fee coupons to sweeten the deal. if you are interested contact me and I&#8217;ll gladly email you the coupon code. But hurry up these are limited time offers.</p>
<p><span style="font-size:90%;font-style:italic;">Disclaimer: I wrote this post with complete honesty. I do like eleven2 and I am very satisfied with their service. I feel it is my moral obligation to disclose that I am eleven2 affiliate and if you sign up for their service through one of the links in this article I may receive affiliate fee.</span>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fget-99-off-first-month-of-hosting-service-fee%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fget-99-off-first-month-of-hosting-service-fee%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="Get 99% off first month of hosting service fee. " alt=" Get 99% off first month of hosting service fee. " /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/get-99-off-first-month-of-hosting-service-fee/">Get 99% off first month of hosting service fee.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Get 99% off first month of hosting service fee. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/get-99-off-first-month-of-hosting-service-fee/',contentID: 'post-1305',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: '',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="Get 99% off first month of hosting service fee. " alt="article clipper vert Get 99% off first month of hosting service fee. " />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/P5LXf1tfzEZX6tjCPYt34hc6Q3Y/0/da"><img src="http://feedads.g.doubleclick.net/~a/P5LXf1tfzEZX6tjCPYt34hc6Q3Y/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/P5LXf1tfzEZX6tjCPYt34hc6Q3Y/1/da"><img src="http://feedads.g.doubleclick.net/~a/P5LXf1tfzEZX6tjCPYt34hc6Q3Y/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/zparacha?a=e9NOCFcMjyI:6mvtU00F524:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/zparacha?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=e9NOCFcMjyI:6mvtU00F524:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/zparacha?i=e9NOCFcMjyI:6mvtU00F524:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=e9NOCFcMjyI:6mvtU00F524:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/zparacha?i=e9NOCFcMjyI:6mvtU00F524:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/zparacha/~4/e9NOCFcMjyI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/get-99-off-first-month-of-hosting-service-fee/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.zparacha.com/get-99-off-first-month-of-hosting-service-fee/</feedburner:origLink></item>
		<item>
		<title>Sort numbers in Java to find minimum and maximum values without using Array</title>
		<link>http://feedproxy.google.com/~r/zparacha/~3/W8FLUHaADN8/</link>
		<comments>http://www.zparacha.com/sort-numbers-in-java-find-minimum-and-maximum-values-without-using-array/#comments</comments>
		<pubDate>Sat, 22 May 2010 04:27:21 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1274</guid>
		<description><![CDATA[Recently a reader contacted me with a question about sorting numbers in Java. After sorting the number the program then needs to print the largest and smallest values. I have written a post earlier that shows one way of finding largest and smallest numbers. That approach used Arrays but the reader wanted to find largest [...]<p><a href="http://www.zparacha.com/sort-numbers-in-java-find-minimum-and-maximum-values-without-using-array/">Sort numbers in Java to find minimum and maximum values without using Array</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>

<span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/minimum-maximum-array-value/' rel='bookmark' title='Three ways to find minimum and maximum values in a Java array.'>Three ways to find minimum and maximum values in a Java array.</a></li>
<li><a href='http://www.zparacha.com/sort_numeric_arrays/' rel='bookmark' title='Sort numbers in Javascript array'>Sort numbers in Javascript array</a></li>
<li><a href='http://www.zparacha.com/determine-smallest-largest-number-java/' rel='bookmark' title='How to determine smallest and largest number in Java'>How to determine smallest and largest number in Java</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><!--adsense#greyLeft--><br />
Recently a reader contacted me with a question about sorting numbers in Java. After sorting the number the program then needs to print the largest and smallest values.  I have written a <a href="http://www.zparacha.com/minimum-maximum-array-value/"> post </a> earlier that shows one way of finding largest and smallest numbers. That approach used Arrays but the reader wanted to find largest and smallest values from a group of numbers without using Arrays. So here is another approach. </p>
<p>This program accepts input from the user and then prints out the largest and smallest numbers. </p>
<pre><code>

import java.util.*;
public class NumberSorter{
	public static void main(String args[]){
	  double a, b, c, x, y;
	  Scanner console = new Scanner(System.in);
	  System.out.print("Enter the first number: " );
	  a = console.nextDouble() ;
	  System.out.print("Enter the second number: " );
	  b  = console.nextDouble() ;
	  System.out.print("Enter the third number: " );
	  c = console.nextDouble();
	  x= Math.min(a, Math.min(b, c));
	  y= Math.max(a, Math.max(b, c));
	  System.out.println("\n" +x + " is the smallest number.\n" + y
	                     +" is the largest number.");
	}
}

</code></pre>
<p>Hope you find this useful. Share your ideas on how else can we find largest and smallest values from a group of numbers Java.
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fsort-numbers-in-java-find-minimum-and-maximum-values-without-using-array%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fsort-numbers-in-java-find-minimum-and-maximum-values-without-using-array%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="Sort numbers in Java to find minimum and maximum values without using Array" alt=" Sort numbers in Java to find minimum and maximum values without using Array" /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/sort-numbers-in-java-find-minimum-and-maximum-values-without-using-array/">Sort numbers in Java to find minimum and maximum values without using Array</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Sort numbers in Java to find minimum and maximum values without using Array on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/sort-numbers-in-java-find-minimum-and-maximum-values-without-using-array/',contentID: 'post-1274',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'Java',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="Sort numbers in Java to find minimum and maximum values without using Array" alt="article clipper vert Sort numbers in Java to find minimum and maximum values without using Array" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/minimum-maximum-array-value/' rel='bookmark' title='Three ways to find minimum and maximum values in a Java array.'>Three ways to find minimum and maximum values in a Java array.</a></li>
<li><a href='http://www.zparacha.com/sort_numeric_arrays/' rel='bookmark' title='Sort numbers in Javascript array'>Sort numbers in Javascript array</a></li>
<li><a href='http://www.zparacha.com/determine-smallest-largest-number-java/' rel='bookmark' title='How to determine smallest and largest number in Java'>How to determine smallest and largest number in Java</a></li>
</ul></p>
<p><a href="http://feedads.g.doubleclick.net/~a/a4IFwNlxQbGxjFh43NYVCmGtrII/0/da"><img src="http://feedads.g.doubleclick.net/~a/a4IFwNlxQbGxjFh43NYVCmGtrII/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/a4IFwNlxQbGxjFh43NYVCmGtrII/1/da"><img src="http://feedads.g.doubleclick.net/~a/a4IFwNlxQbGxjFh43NYVCmGtrII/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/zparacha?a=W8FLUHaADN8:aj0q9Rks6QA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/zparacha?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=W8FLUHaADN8:aj0q9Rks6QA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/zparacha?i=W8FLUHaADN8:aj0q9Rks6QA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=W8FLUHaADN8:aj0q9Rks6QA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/zparacha?i=W8FLUHaADN8:aj0q9Rks6QA:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/zparacha/~4/W8FLUHaADN8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/sort-numbers-in-java-find-minimum-and-maximum-values-without-using-array/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.zparacha.com/sort-numbers-in-java-find-minimum-and-maximum-values-without-using-array/</feedburner:origLink></item>
		<item>
		<title>Java String comparison. The difference between == and equals().</title>
		<link>http://feedproxy.google.com/~r/zparacha/~3/GmLt8pqk2u4/</link>
		<comments>http://www.zparacha.com/java-string-comparison/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 06:02:54 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1250</guid>
		<description><![CDATA[Many Java beginners find it difficult to differentiate between == operator and the &#8220;equals()&#8221; method when comparing String variables in Java. They assume that both operations perform the same function and either one can be used to compare two string variables. I have even seen many experienced programmers committing the mistake of using &#8220;==&#8221; to [...]<p><a href="http://www.zparacha.com/java-string-comparison/">Java String comparison. The difference between == and equals().</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>

<span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/best-way-to-check-if-a-java-string-is-a-number/' rel='bookmark' title='Best way to check if a Java String is a number.'>Best way to check if a Java String is a number.</a></li>
<li><a href='http://www.zparacha.com/extract-substring-from-end-of-a-java-string/' rel='bookmark' title='Extract substring from end of a Java String'>Extract substring from end of a Java String</a></li>
<li><a href='http://www.zparacha.com/search-string-file-java-regular-expression/' rel='bookmark' title='How to search for a string in a file using Java regular expression.'>How to search for a string in a file using Java regular expression.</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zparacha.com/java-string-comparison/javastring-2/" rel="attachment wp-att-1266"><img src="http://www.zparacha.com/wp-content/uploads/2010/02/javaString1-300x297.jpg" alt="javaString1 300x297 Java String comparison. The difference between == and equals()." title="javaString" width="300" height="297" class="alignleft size-medium wp-image-1266" /></a>Many Java beginners find it difficult to differentiate between == operator and the &#8220;equals()&#8221; method when comparing String variables in Java. They assume that both operations perform the same function and either one can be used to compare two string variables. I have even seen many experienced programmers committing the mistake of using &#8220;==&#8221; to compare the values of two strings.</p>
<p>So what is the difference between &#8220;==&#8221; and &#8220;equals()&#8221; and what is the correct method of comparing two string variables?<br />
<span id="more-1250"></span></p>
<h2> The == operator:</h2>
<p> The &#8220;<strong>==</strong>&#8221; operator compares the references of two objects in memory. It returns true if both objects point to exact same location in memory. Remember that Strings are immutable in Java, so if you have a String variable <em>str1 </em>with a value of &#8220;abc&#8221; and then you create another variable <em>str2 </em>with value &#8220;abc&#8221;, rather than creating a new String variable with same value, Java will simply point <em>str2 </em>to same memory location that holds the value for <em>str1</em>.</p>
<p>In this scenario <strong>str1==str2</strong> will return <em>true </em>because both <em>str1 </em>and str2 are referencing the same object in memory.</p>
<p>However, if you create a new variable using the String constructor, like String str3=new String(&#8220;abc&#8221;); Java will allocate new memory space for str3. Now although str1 and str3 have exact same value, str1==str3 will return false because they are two distinct objects in the memory.</p>
<p><!--adsense#greyLeft--></p>
<h2>The equals() method:</h2>
<p> The <em><strong>equals </strong></em>method compare the text content  or the value of two string variables. If both variables have exact same value, equals() will return true, otherwise it will return false.<br />
So, str1.equals(str2) , str1.equals(str3), and  str2.equals(str3) will all return true.<br />
 str1.equals(&#8220;xyz&#8221;) will return false.</p>
<p> Here is an example to help you understand the difference between &#8220;==&#8221; and equals().</p>
<pre><code>
public class StringComparison{
	public static void main(String args[]){
		String str1 =  new String("abc");
		String str2 =  new String ("abc");
		if(str1==str2){
			System.out.println("str1==str2 is true");
		}else{
			System.out.println("str1==str2 is false");
		}

		if(str1.equals(str2)){
			System.out.println("str1.equals(str2) is true");
		}else{
			System.out.println("str1.equals(str2) is false");
		}

		String str3="abc",
		str4 ="abc";
		if(str3==str4){
			System.out.println("str3==str4 is true");
		}else{
			System.out.println("str3==str4 is false");
		}
	}
}
</code> </pre>
<p> Here is the output from this program.</p>
<pre><code>
 str1==str2 is false
 str1.equals(str2) is true
 str3==str4 is true
 </code></pre>
<p>
 Most of the time you need to compare the values of the variable so you will need the equals() method. In situations where you need to check if two variables reference same memory location then you will use &#8220;==&#8221; operator.
 </p>
<p> I hope this will help you understand when to use &#8220;==&#8221; or equals() for Java string comparison.</p>
<p><span style="font-size:11px;">Image credit: <a href="http://www.flickr.com/photos/nivuniconnu/">Martyne</a></span>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fjava-string-comparison%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fjava-string-comparison%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="Java String comparison. The difference between == and equals()." alt=" Java String comparison. The difference between == and equals()." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/java-string-comparison/">Java String comparison. The difference between == and equals().</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Java String comparison. The difference between == and equals(). on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/java-string-comparison/',contentID: 'post-1250',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'Java,String',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="Java String comparison. The difference between == and equals()." alt="article clipper vert Java String comparison. The difference between == and equals()." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/best-way-to-check-if-a-java-string-is-a-number/' rel='bookmark' title='Best way to check if a Java String is a number.'>Best way to check if a Java String is a number.</a></li>
<li><a href='http://www.zparacha.com/extract-substring-from-end-of-a-java-string/' rel='bookmark' title='Extract substring from end of a Java String'>Extract substring from end of a Java String</a></li>
<li><a href='http://www.zparacha.com/search-string-file-java-regular-expression/' rel='bookmark' title='How to search for a string in a file using Java regular expression.'>How to search for a string in a file using Java regular expression.</a></li>
</ul></p>
<p><a href="http://feedads.g.doubleclick.net/~a/GLSnL4cR8R5lGyR259q-6UmtHrQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/GLSnL4cR8R5lGyR259q-6UmtHrQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/GLSnL4cR8R5lGyR259q-6UmtHrQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/GLSnL4cR8R5lGyR259q-6UmtHrQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/zparacha?a=GmLt8pqk2u4:lWeFRLSS6PI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/zparacha?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=GmLt8pqk2u4:lWeFRLSS6PI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/zparacha?i=GmLt8pqk2u4:lWeFRLSS6PI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=GmLt8pqk2u4:lWeFRLSS6PI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/zparacha?i=GmLt8pqk2u4:lWeFRLSS6PI:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/zparacha/~4/GmLt8pqk2u4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/java-string-comparison/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		<feedburner:origLink>http://www.zparacha.com/java-string-comparison/</feedburner:origLink></item>
		<item>
		<title>An HTML element you don't want to omit.</title>
		<link>http://feedproxy.google.com/~r/zparacha/~3/wxpWRkDlE5A/</link>
		<comments>http://www.zparacha.com/doctype-explained/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 04:57:51 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[doctype]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1203</guid>
		<description><![CDATA[As web developers we have the tendency to blame web browsers for inconsistencies and for not displaying the pages as designed. Most of the time the blame is justified, but there are instances when the blame lies at the feet of the web developers. For example, incorrect CSS declarations, missing closing tags in HTML documents [...]<p><a href="http://www.zparacha.com/doctype-explained/">An HTML element you don&#39;t want to omit.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>

<span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/' rel='bookmark' title='How to position HTML element in the center using CSS.'>How to position HTML element in the center using CSS.</a></li>
<li><a href='http://www.zparacha.com/encode-decode-html-entities/' rel='bookmark' title='Encode / Decode HTML Entities'>Encode / Decode HTML Entities</a></li>
<li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_1222" class="wp-caption alignleft" style="width: 210px"><a href="http://www.zparacha.com/doctype-explained/doctypes/" rel="attachment wp-att-1222"><img src="http://www.zparacha.com/wp-content/uploads/2010/02/doctypes.gif" alt="doctypes An HTML element you don&#39;t want to omit. " title="doctypes" width="200" height="228" class="size-full wp-image-1222" /></a><p class="wp-caption-text">Doctypes</p></div>As web developers we have the tendency to blame web browsers for inconsistencies and for not displaying the pages as designed. Most of the time the blame is justified,  but there are instances when the blame lies at the feet of the web developers.  For example, incorrect CSS declarations, missing closing tags in HTML documents will break you website. Another common and often overlooked reason of broken web pages is the missing or incorrect DOCYTYPE declaration. <span id="more-1203"></span></p>
<p>  If your website is not rendered properly by some browsers,  the first thing you need to check is the first line in your HTML document. <!--more--></p>
<p>The first line of every HTML document should have a valid DOCTYPE declaration. A missing or invalid DOCTYPE sends browsers in to the quirks mode and then the web browser uses its own methods to parse and render your page.</p>
<h2>What is DOCTYPE?</h2>
<p>A <strong>Document Type Declaration (DOCTYPE)</strong> informs the browsers which version of (X)HTML your web page is using. Browsers use this information to validate and render your documents. All compliant web pages must begin with a valid DOCTYPE declaration. If you don&#8217;t include a DOCTYPE declaration or if it is not valid, your web pages will not be validated and the web browser won&#8217;t be able to render your web pages properly.</p>
<h2>Why DOCTYPE is important?</h2>
<p>All standard-compliant browser need some information about the page to validate its content and then display it properly. There are several versions of HTML and XHTML and browsers need to know the version you are using.<br />
A DOCTYPE tells browsers which (X)HTML version you are using and help them to render your page in standards–compliant mode. This will ensure that your pages are displayed by all browsers like you want them.</p>
<p>[ad#GreyLeft]But if you don&#8217;t include the DOCTYPE or if your DOCTYPE declaration is invalid, most browsers will assume that you are using an older version HTML and your page does not meet latest standards. The browser will then try to parse and render your page in backward compatible fashion (known as quirks mode) and may use browser-specific DOM.<br />
Of course, you don&#8217;t want this. So save yourself some time and frustration by adding one of the following DOCTYPES in all your HTML page.</p>
<table  style="background:none repeat scroll 0 0 #FFFFBE;border:1px solid #333;margin-bottom:2em;font-size: 0.9em;">
<tbody>
<tr style="font-size:1.0em;background:#eee;color:#000;">
<th>Version</th>
<th>DTD list</th>
<th>DOCTYPE Declaration in documents</th>
</tr>
<tr>
<td class="html"><a href="http://www.w3.org/TR/html401/">HTML&nbsp;4.01</a></td>
<td class="dtd"><a href="http://www.w3.org/TR/html401/strict.dtd">Strict</a>, <a href="http://www.w3.org/TR/html401/loose.dtd">Transitional</a>, <a href="http://www.w3.org/TR/html401/frameset.dtd">Frameset</a></td>
<td class="htmlcmt">
<pre>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd"&gt;
	</pre>
</td>
</tr>
<tr>
<td class="html"><a href="http://www.w3.org/TR/xhtml1/">XHTML&nbsp;1.0</a></td>
<td class="dtd"><a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" class="broken_link">Strict</a>, <a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" class="broken_link">Transitional</a>, <a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">Frameset</a></td>
<td class="htmlcmt">
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;
	</pre>
</td>
</tr>
</tbody>
</table>
<p>I copied these DOCTYPE declarations from W3C website. You can find complete table of DOCTYPE declarations at <a href="http://www.w3.org/QA/2002/04/Web-Quality">http://www.w3.org/QA/2002/04/Web-Quality</a>.</p>
<p>This one line in all your HTML pages will make your relationship with browsers a little less stressful. My advise to all web developers, &#8220;Don&#8217;t publish a web page without DOCTYPE.&#8221;</p>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fdoctype-explained%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fdoctype-explained%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="An HTML element you don&#39;t want to omit. " alt=" An HTML element you don&#39;t want to omit. " /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/doctype-explained/">An HTML element you don&#39;t want to omit.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'An HTML element you don\&#039;t want to omit. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/doctype-explained/',contentID: 'post-1203',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'doctype,html,Web Development',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="An HTML element you don&#39;t want to omit. " alt="article clipper vert An HTML element you don&#39;t want to omit. " />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/' rel='bookmark' title='How to position HTML element in the center using CSS.'>How to position HTML element in the center using CSS.</a></li>
<li><a href='http://www.zparacha.com/encode-decode-html-entities/' rel='bookmark' title='Encode / Decode HTML Entities'>Encode / Decode HTML Entities</a></li>
<li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a></li>
</ul></p>
<p><a href="http://feedads.g.doubleclick.net/~a/8PkR6DHWlb5DYAU0gbk7YrCc4Es/0/da"><img src="http://feedads.g.doubleclick.net/~a/8PkR6DHWlb5DYAU0gbk7YrCc4Es/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8PkR6DHWlb5DYAU0gbk7YrCc4Es/1/da"><img src="http://feedads.g.doubleclick.net/~a/8PkR6DHWlb5DYAU0gbk7YrCc4Es/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/zparacha?a=wxpWRkDlE5A:bxO54Rgm0xI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/zparacha?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=wxpWRkDlE5A:bxO54Rgm0xI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/zparacha?i=wxpWRkDlE5A:bxO54Rgm0xI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=wxpWRkDlE5A:bxO54Rgm0xI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/zparacha?i=wxpWRkDlE5A:bxO54Rgm0xI:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/zparacha/~4/wxpWRkDlE5A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/doctype-explained/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.zparacha.com/doctype-explained/</feedburner:origLink></item>
		<item>
		<title>A fresh new look.</title>
		<link>http://feedproxy.google.com/~r/zparacha/~3/wJKtqUNqEAQ/</link>
		<comments>http://www.zparacha.com/a-fresh-new-look/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:48:10 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[thesis]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1196</guid>
		<description><![CDATA[Welcome to redesigned and improved zParacha.com. I have been thinking of giving my blog a face-lift for some time. I considered several options including designing/developing a new theme from scratch, buying Thesis and then modifying it, or buying a premium theme. Since I have several options I kept considering pros and cons of each one [...]<p><a href="http://www.zparacha.com/a-fresh-new-look/">A fresh new look.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>

No related posts.]]></description>
			<content:encoded><![CDATA[<p>Welcome to redesigned and improved zParacha.com. I have been thinking of giving my blog a face-lift for some time. I considered several options including designing/developing a new theme from scratch, buying <a href="http://www.zparacha.com/thesisRedir.php">Thesis</a> and then modifying it, or buying a premium theme. Since I have several options I kept considering pros and cons of each one and in the process the planned upgrade was delayed. Basically I was just procrastinating. </p>
<p>Finally, I decided to get it down and settled on this elegant, free premium theme. I am still working on some minor customization but I believe this is a nice, professional-looking theme that meets my requirements. </p>
<p>Share your thoughts on this new design. Do you like the color scheme, page layout? What do you not like? What elements do you think I can change to further improve the look?</p>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fa-fresh-new-look%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fa-fresh-new-look%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="A fresh new look." alt=" A fresh new look." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/a-fresh-new-look/">A fresh new look.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'A fresh new look. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/a-fresh-new-look/',contentID: 'post-1196',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'theme,thesis',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="A fresh new look." alt="article clipper vert A fresh new look." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/xusyXaXWVTp9Hl6iFcubvnGuGgw/0/da"><img src="http://feedads.g.doubleclick.net/~a/xusyXaXWVTp9Hl6iFcubvnGuGgw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xusyXaXWVTp9Hl6iFcubvnGuGgw/1/da"><img src="http://feedads.g.doubleclick.net/~a/xusyXaXWVTp9Hl6iFcubvnGuGgw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/zparacha?a=wJKtqUNqEAQ:SkWmXNu3pIo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/zparacha?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=wJKtqUNqEAQ:SkWmXNu3pIo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/zparacha?i=wJKtqUNqEAQ:SkWmXNu3pIo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=wJKtqUNqEAQ:SkWmXNu3pIo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/zparacha?i=wJKtqUNqEAQ:SkWmXNu3pIo:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/zparacha/~4/wJKtqUNqEAQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/a-fresh-new-look/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.zparacha.com/a-fresh-new-look/</feedburner:origLink></item>
		<item>
		<title>Why you should stop using onload method.</title>
		<link>http://feedproxy.google.com/~r/zparacha/~3/5EQMmdQSXmw/</link>
		<comments>http://www.zparacha.com/better-alternative-to-onload/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 03:46:27 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[onload]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1127</guid>
		<description><![CDATA[It is amazing that many web developers still use onload method embedded in the BODY tag, like &#60;HEAD&#62; &#60;BODY onload="document.contact.userID.focus();"&#62; &#60;form name="contact"&#62; &#60;input type="text" name="userID" &#62; &#60;/form&#62; &#60;/BODY&#62; &#60;/HEAD&#62; There are two problems with this line of code. Embedding code (behavior) with HTML (structure) makes it difficult to maintain the page. onload() method will executes [...]<p><a href="http://www.zparacha.com/better-alternative-to-onload/">Why you should stop using onload method.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>

<span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a></li>
<li><a href='http://www.zparacha.com/ajax-contact-from/' rel='bookmark' title='AJAX Contact Form'>AJAX Contact Form</a></li>
<li><a href='http://www.zparacha.com/alexa-new-rank-system/' rel='bookmark' title='Has Alexa new method changed your rank?'>Has Alexa new method changed your rank?</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div id="attachment_1152" class="wp-caption alignleft" style="width: 286px"><a href="http://www.zparacha.com/better-alternative-to-onload/onload-2/" rel="attachment wp-att-1152"><img src="http://www.zparacha.com/wp-content/uploads/2010/02/onload1-276x300.png" alt="onload1 276x300 Why you should stop using onload method." title="onload" width="276" height="300" class="size-medium wp-image-1152" /></a><p class="wp-caption-text">Onload</p></div>
<p>It is amazing that many web developers still use onload method embedded in the BODY tag, like</p>
<pre><code>
 &lt;HEAD&gt;
 &lt;BODY onload="document.contact.userID.focus();"&gt;
  &lt;form name="contact"&gt;
   &lt;input type="text" name="userID" &gt;
  &lt;/form&gt;
  &lt;/BODY&gt;
 &lt;/HEAD&gt;
</code></pre>
<p>There are two problems with this line of code. </p>
<ol>
<li>
Embedding code (behavior) with HTML (structure) makes it difficult to maintain the page.</li>
<li>onload() method will executes only after the page is fully displayed.</li>
</ul>
<p>Let&#8217;s see how to fix these problems.<span id="more-1127"></span><br />
Fixing problem # is quite simple. Just move your JavaScript code to the header section of you HTML page.</p>
<pre><code>
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;script language="javascript"&gt;
function setFocus(){
	document.contact.userID.focus();
}
&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY onload="setFocus();"&gt;
&lt;form name="contact"&gt;
&lt;input type="text" name="userID" &gt;
&lt;/form&gt;
&lt;/BODY>
&lt;/HTML&gt;
</pre>
<p></code></p>
<p>Even better approach would be to move the code to an external Javascript file and add a reference to that file in the header section of the HTML document. For example, if the code is in script.js you can import the code like</p>
<pre><code>
&lt;HTML&gt;
&lt;HEAD&gt;&lt;script language="javascript" ref="scripts/script.js"&gt;
&lt;/HEAD&gt;
&lt;BODY onload="setFocus();"&gt;
&lt;form name="contact"&gt;
&lt;input type="text" name="userID" &gt;
&lt;/form&gt;
&lt;/BODY>&lt;
/HTML&gt;
</code></pre>
<p><!--adsense#greyLeft--></p>
<p>This approach will make your HTML code clutter-free and the code will be more manageable. But this does not address the fact the there is a delay in the exectuion of the code. onload method executes after the page is completely loaded.  For instance, if you want to set focus to a text field on your web page using onload method, the foucs will be set after the page is completly downloaded.</p>
<p>If your web page is a simple text page with no images or multimedia elements then using onload might be OK. However, nowadays almost all web pages have at least few images, some even have embedded audio, video, Flash or other rich multimedia resources. These large resources take considerably long time to be fully loaded. And until all the content of the page is fully downloaded and the DOM tree is constructed, onload will not be fired. </p>
<h3>Set focus to the text field without onload:</h3>
<p>There is nothing wrong with the onload method, the problem is the large size of page elements that need to be downloaded by the browser. The browser needs to construct the DOM tree, load all the images and other multi-media resources and when everything is done then it will execute the onload method. A DOM tree is constructed instantly by the browser, but the large size of other elements take a while to be fully loaded. It means these external multilmedia files keep browser from executing the code triggred my onload event. The best approach would be to wait just long enough to let browser contstuct the DOM tree and then execute your code without waiting for all the objects to be completely downloaded. This can be done by using jQuery's <b>ready()</b> function.</p>
<pre><code>
  &lt;script type="text/javascript" src="scripts/jquery-1.3.2.min.js"&gt;
  &lt;/script&gt;
    &lt;script type="text/javascript"&gt;
      jQuery(document).ready(function() {
        document.contact.userID.focus();
      });
    &lt;/script&gt;
</code></pre>
<p>or more formally.</p>
<pre><code>
$(function(){
	document.contact.userID.focus();
}
</code></pre>
<p>So now your HTML code will be like</p>
<pre><code>
 &lt;HTML&gt;
 &lt;HEAD&gt;
  &lt;script type="text/javascript" src="scripts/jquery-1.3.2.min.js"&gt;
  &lt;/script&gt;
    &lt;script type="text/javascript"&gt;
      jQuery(document).ready(function() {
        document.contact.userID.focus();
      });
    &lt;/script&gt;
 &lt;/HEAD&gt;
 &lt;BODY &gt;
 &lt;form name="contact"&gt;
 &lt;input type="text" name="userID" &gt;
 &lt;/form&gt;
 &lt;/BODY>
 &lt;/HTML&gt;
</pre>
<p></code></p>
<p>Now our JavaScript code will be executed as soon as the DOM is fully constructed, without waiting for images and other multimedia resources. In this example the focus will be set to your input text field almost instantly and user can start typing in the information without waiting for rest of the page to be downloaded. This is a simple but effective way of improving your website's usability. </p>
<p><!--adsense#tla-->
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fbetter-alternative-to-onload%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fbetter-alternative-to-onload%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="Why you should stop using onload method." alt=" Why you should stop using onload method." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/better-alternative-to-onload/">Why you should stop using onload method.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Why you should stop using onload method. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/better-alternative-to-onload/',contentID: 'post-1127',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'focus,Javascript,jQuery,JS,onload',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="Why you should stop using onload method." alt="article clipper vert Why you should stop using onload method." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a></li>
<li><a href='http://www.zparacha.com/ajax-contact-from/' rel='bookmark' title='AJAX Contact Form'>AJAX Contact Form</a></li>
<li><a href='http://www.zparacha.com/alexa-new-rank-system/' rel='bookmark' title='Has Alexa new method changed your rank?'>Has Alexa new method changed your rank?</a></li>
</ul></p>
<p><a href="http://feedads.g.doubleclick.net/~a/eEM4yPg-d1-4QUpDtEUG9-ceL0E/0/da"><img src="http://feedads.g.doubleclick.net/~a/eEM4yPg-d1-4QUpDtEUG9-ceL0E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/eEM4yPg-d1-4QUpDtEUG9-ceL0E/1/da"><img src="http://feedads.g.doubleclick.net/~a/eEM4yPg-d1-4QUpDtEUG9-ceL0E/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/zparacha?a=5EQMmdQSXmw:yfRQwdzSv3Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/zparacha?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=5EQMmdQSXmw:yfRQwdzSv3Y:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/zparacha?i=5EQMmdQSXmw:yfRQwdzSv3Y:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=5EQMmdQSXmw:yfRQwdzSv3Y:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/zparacha?i=5EQMmdQSXmw:yfRQwdzSv3Y:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/zparacha/~4/5EQMmdQSXmw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/better-alternative-to-onload/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.zparacha.com/better-alternative-to-onload/</feedburner:origLink></item>
		<item>
		<title>Google says Adios to IE6.</title>
		<link>http://feedproxy.google.com/~r/zparacha/~3/yyfx-kHDzio/</link>
		<comments>http://www.zparacha.com/google-says-goodbye-to-ie6/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 17:31:31 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[IE6]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1119</guid>
		<description><![CDATA[Google agrees that the time has come for us to lay IE6 to rest. Google announced in a blog post that it will stop supporting IE6 from March 01, 2010. Google will start by phasing out IE6 support for Google Docs and Google Sites, but I believe eventually all Google products will stop supporting IE6. [...]<p><a href="http://www.zparacha.com/google-says-goodbye-to-ie6/">Google says Adios to IE6.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>

<span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/how-to-incorporate-google-custom-search-engine-with-adsense-into-your-wordpress-blog/' rel='bookmark' title='How to incorporate Google Custom Search engine with Adsense into your WordPress blog.'>How to incorporate Google Custom Search engine with Adsense into your WordPress blog.</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><img title="ie6 die jpg" src="http://www.zparacha.com/images/ie6_die.jpg " style="border: 0px none;" height="214px" width="300px" alt=" Google says Adios to IE6." /><br />
Google agrees that the time has come for us to lay IE6 to rest. Google <a href="http://googleenterprise.blogspot.com/2010/01/modern-browsers-for-modern-applications.html"> announced </a> in a blog post that it will stop supporting IE6 from March 01, 2010. Google will start by phasing out IE6 support for Google Docs and Google Sites, but I believe eventually all Google products will stop supporting IE6.<br />
<span id="more-1119"></span></p>
<p><!--adsense#tla--></p>
<p>From Google&#8217;s official blog:</p>
<blockquote><p>Many other companies have already stopped supporting older browsers like Internet Explorer 6.0 as well as browsers that are not supported by their own manufacturers. We’re also going to begin phasing out our support, starting with Google Docs and Google Sites. As a result you may find that from March 1 key functionality within these products &#8212; as well as new Docs and Sites features &#8212; won’t work properly in older browsers.</p></blockquote>
<p>Even Microsoft itself <a href="http://blogs.technet.com/srd/archive/2010/01/15/assessing-risk-of-ie-0day-vulnerability.aspx">recommends</a> users to stop using IE6. Many corporations have already stopped supporting or using IE6, with the addition of an Internet giant like Google I hope the drive to abandon the aging IE6 will get some momentum. Hopefully 2010 will be year where wen can move away from IE6.  That would be an awesome news for all web developers. </p>
<p>What are your thoughts on IE6?</p>
<p><!--adsense#tla--></p>
<p><span style="font-size:10px;">Image src: http://www.ferdychristant.com</span></p>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fgoogle-says-goodbye-to-ie6%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fgoogle-says-goodbye-to-ie6%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="Google says Adios to IE6." alt=" Google says Adios to IE6." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/google-says-goodbye-to-ie6/">Google says Adios to IE6.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Google says Adios to IE6. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/google-says-goodbye-to-ie6/',contentID: 'post-1119',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'browsers,Google,IE6',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="Google says Adios to IE6." alt="article clipper vert Google says Adios to IE6." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/how-to-incorporate-google-custom-search-engine-with-adsense-into-your-wordpress-blog/' rel='bookmark' title='How to incorporate Google Custom Search engine with Adsense into your WordPress blog.'>How to incorporate Google Custom Search engine with Adsense into your WordPress blog.</a></li>
</ul></p>
<p><a href="http://feedads.g.doubleclick.net/~a/I6IMijwmcLkYMKZ5JNkMlIAeo1k/0/da"><img src="http://feedads.g.doubleclick.net/~a/I6IMijwmcLkYMKZ5JNkMlIAeo1k/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/I6IMijwmcLkYMKZ5JNkMlIAeo1k/1/da"><img src="http://feedads.g.doubleclick.net/~a/I6IMijwmcLkYMKZ5JNkMlIAeo1k/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/zparacha?a=yyfx-kHDzio:aS1mf3d2KUI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/zparacha?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=yyfx-kHDzio:aS1mf3d2KUI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/zparacha?i=yyfx-kHDzio:aS1mf3d2KUI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=yyfx-kHDzio:aS1mf3d2KUI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/zparacha?i=yyfx-kHDzio:aS1mf3d2KUI:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/zparacha/~4/yyfx-kHDzio" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/google-says-goodbye-to-ie6/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.zparacha.com/google-says-goodbye-to-ie6/</feedburner:origLink></item>
		<item>
		<title>Five free tools to choose perfect colors for your website.</title>
		<link>http://feedproxy.google.com/~r/zparacha/~3/7jOeW0OSWPc/</link>
		<comments>http://www.zparacha.com/free-color-tools-for-webdesigners/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 06:03:07 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Most Popular Posts]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[color wheel]]></category>
		<category><![CDATA[colorrotate]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[colourlovers]]></category>
		<category><![CDATA[kuler]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1061</guid>
		<description><![CDATA[Color coordination plays a big role in the look and feel of a website. An appealing color scheme is an important prerequisite for eye catching web design. Dull or very sharp colors or mismatch colors will not only look ugly it may overshadow other nice elements of your website. Choosing vibrant, harmonious colors that are [...]<p><a href="http://www.zparacha.com/free-color-tools-for-webdesigners/">Five free tools to choose perfect colors for your website.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>

<span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/best-twitter-tools/' rel='bookmark' title='Best free tools for Twitter'>Best free tools for Twitter</a></li>
<li><a href='http://www.zparacha.com/css-color-chart/' rel='bookmark' title='Colors by name with hex and RGB codes.'>Colors by name with hex and RGB codes.</a></li>
<li><a href='http://www.zparacha.com/javascript-tools-web-developers/' rel='bookmark' title='Nine Must Have JavaScript Tools For Every Web Developer'>Nine Must Have JavaScript Tools For Every Web Developer</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_1155" class="wp-caption alignleft" style="width: 310px"><a href="http://www.zparacha.com/free-color-tools-for-webdesigners/rainbow-colors/" rel="attachment wp-att-1155"><img src="http://www.zparacha.com/wp-content/uploads/2010/01/rainbow-colors-300x225.jpg" alt="rainbow colors 300x225 Five free tools to choose perfect colors for your website." title="rainbow-colors" width="300" height="225" class="size-medium wp-image-1155" /></a><p class="wp-caption-text">Rainbow colors</p></div><br />
Color coordination plays a big role in the look and feel of a website. An appealing color scheme is an important prerequisite for eye catching web design. Dull or very sharp colors or mismatch colors  will not only look ugly it may overshadow other nice elements of your website. Choosing vibrant, harmonious colors that are pleasant to eyes enhance the aesthetics appeal of a website. Following is a list of online resources you can use to construct the color schemes for your next web design project.<br />
<span id="more-1061"></span></p>
<p/>
<h4><a href="http://kuler.adobe.com/"> Kuler</a></h4>
<p><img src="http://www.zparacha.com/images/kuler.png" alt="kuler Five free tools to choose perfect colors for your website."  title="Five free tools to choose perfect colors for your website." /></p>
<p/>
Kuler is a featured-rich online color free tool from Adobe that you can use to create your color themes or browse through thousands of themes generated by community members. As a registered user you can save your themes and then view them in MyKuler. You can create themes using single color or by using color wheel.  You can also extract color scheme from your images, for that you can upload your images or import them from Flickr. Kuler is my favorite. </p>
<p/>
<h4><a href="http://www.colorotate.org/">ColorRotate:</a></h4>
<p><img src="http://www.zparacha.com/images/colorrotate.png" alt="colorrotate Five free tools to choose perfect colors for your website."  title="Five free tools to choose perfect colors for your website." />
<p/>
Like Adobe Kuler, Colorrotate is also a free, online tool to generate color templates, but this is a 3D tool. Its intuitive 3D interface is fun to use and it enables you to quickly see the multidimensional nature of your colors and the relationships between colors. You can use its drag-and-drop option to adjust hue, brightness, and saturation. You can load color themes from you images. It also has a vast collection of community generated themes that you can browse to get some inspiration. </p>
<p/>
<p><!--adsense#top--></p>
<h4><a href="http://colorschemedesigner.com">ColorSchemeDesinger</a></h4>
<p><img src="http://www.zparacha.com/images/colorscheme.png" alt="colorscheme Five free tools to choose perfect colors for your website."  title="Five free tools to choose perfect colors for your website." /></p>
<p/>ColorSchemeDesigner is another free, online tool to generate color palettes.  Its unique, easy-to-use color theme creator packs many useful featuers. You can generate single monochromatic, complimentary, triad, tetrad, analogic, and accented analogic color palettes.  Not only you can create the color palette , you can also user their preview function to apply your palette to a dummy web page, to see how your colors will look on your website. This will definitely save many designers lot of time.<br />
Another great feature is the ability to export  your color palette as a Photoshop palette, HTML+CSS, XML, TXT, and GPL .<br />
This tool does not work in IE6.</p>
<p/>
<h4><a href="http://www.colourlovers.com/">ColourLovers</a></h4>
<p><img src="http://www.zparacha.com/images/colorlover.png" alt="colorlover Five free tools to choose perfect colors for your website."  title="Five free tools to choose perfect colors for your website." /></p>
<p/>If you need color inspiration, you will love ColourLovers. Designers from all over the world share their creative ideas on this website. It has over 286,866 members and showcase more than 2,407,124 colors, 1,090,882 palettes and 732,299 patterns. You can create your own color palettes or just pick one from this enormous collection. </p>
<blockquote><p>
COLOURlovers  is a resource that monitors and influences color trends. COLOURlovers gives the people who use color &#8211; whether for ad campaigns, product design, or in architectural specification &#8211; a place to check out a world of color, compare color palettes, submit news and comments, and read color related articles and interviews.
</p></blockquote>
<p/>
<h4><a href="http://www.ficml.org/jemimap/style/color/wheel.html">4096 Color Wheel</a></h4>
<p><img src="http://www.zparacha.com/images/colorwheel.png" alt="colorwheel Five free tools to choose perfect colors for your website." style="border:1px solid #333;" title="Five free tools to choose perfect colors for your website." /></p>
<p/>If you don&#8217;t want all the bells and whistles of above mentioned tools, you may want to try Color Wheel. This is a simple web-based tool to view and choose web-safe colors. It offers you a palette of seven colors, displayed on the left side of the screen. You can change these 7 colors one by one by clicking on a color wheel. It is a nice little tool to generate a color palette.  </p>
<p>What are your favorite tools for creating color schemes?</p>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Ffree-color-tools-for-webdesigners%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Ffree-color-tools-for-webdesigners%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="Five free tools to choose perfect colors for your website." alt=" Five free tools to choose perfect colors for your website." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/free-color-tools-for-webdesigners/">Five free tools to choose perfect colors for your website.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Five free tools to choose perfect colors for your website. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/free-color-tools-for-webdesigners/',contentID: 'post-1061',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'color wheel,colorrotate,colors,colourlovers,kuler,tools,webdesign',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="Five free tools to choose perfect colors for your website." alt="article clipper vert Five free tools to choose perfect colors for your website." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/best-twitter-tools/' rel='bookmark' title='Best free tools for Twitter'>Best free tools for Twitter</a></li>
<li><a href='http://www.zparacha.com/css-color-chart/' rel='bookmark' title='Colors by name with hex and RGB codes.'>Colors by name with hex and RGB codes.</a></li>
<li><a href='http://www.zparacha.com/javascript-tools-web-developers/' rel='bookmark' title='Nine Must Have JavaScript Tools For Every Web Developer'>Nine Must Have JavaScript Tools For Every Web Developer</a></li>
</ul></p>
<p><a href="http://feedads.g.doubleclick.net/~a/M2dFD3UfF_DW_S4SejfHIhTumzo/0/da"><img src="http://feedads.g.doubleclick.net/~a/M2dFD3UfF_DW_S4SejfHIhTumzo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/M2dFD3UfF_DW_S4SejfHIhTumzo/1/da"><img src="http://feedads.g.doubleclick.net/~a/M2dFD3UfF_DW_S4SejfHIhTumzo/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/zparacha?a=7jOeW0OSWPc:us3mEn50q30:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/zparacha?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=7jOeW0OSWPc:us3mEn50q30:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/zparacha?i=7jOeW0OSWPc:us3mEn50q30:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=7jOeW0OSWPc:us3mEn50q30:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/zparacha?i=7jOeW0OSWPc:us3mEn50q30:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/zparacha/~4/7jOeW0OSWPc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/free-color-tools-for-webdesigners/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<feedburner:origLink>http://www.zparacha.com/free-color-tools-for-webdesigners/</feedburner:origLink></item>
		<item>
		<title>How to position HTML element in the center using CSS.</title>
		<link>http://feedproxy.google.com/~r/zparacha/~3/xwEGApm5X5Y/</link>
		<comments>http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 04:56:58 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cascading_style_sheet]]></category>
		<category><![CDATA[positioning]]></category>
		<category><![CDATA[web development tools]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1035</guid>
		<description><![CDATA[Positioning text in the center of an element is easily done using text-align:center property. But how do you position an entire element, for e.g; a div or an image in the center of the containing parent element? For example, if you want to put an image at the center of your header div how do [...]<p><a href="http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/">How to position HTML element in the center using CSS.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>

<span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/ad_placement/' rel='bookmark' title='Position Ad Units in Posts'>Position Ad Units in Posts</a></li>
<li><a href='http://www.zparacha.com/doctype-explained/' rel='bookmark' title='An HTML element you don&#039;t want to omit.'>An HTML element you don&#39;t want to omit.</a></li>
<li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><!--adsense#greyLeft-->Positioning text in the center of an element is easily done using text-align:center property. But how do you position an entire element, for e.g; a div or an image in the center of the containing parent element?</p>
<p>For example, if you want to put an image at the center of your header div how do you accomplish this?</p>
<p>There are several ways to align an element in the center but the preferred and elegant method is to use <b>margin</b> property. <span id="more-1035"></span></p>
<p>By setting left and right margin widths to &#8220;auto&#8221; you tell the browser to put this element at the horizontal center of the the parent element.</p>
<div style="border:1px solid #333;background:#fff;width:450px;">
<h4>Outer DIV</h4>
<div style="margin:auto; background:#eee;width:50%">
THIS DIV is in the center of the parent div. We used following CSS declaration to align this div.</p>
<pre>
#outerDiv{
 background:#fff;
 border:1px solid #333;
 width:450px;

}
#innerDiv{
  <strong>margin:auto;</strong>
  background:#eee;
  width:50%
}
</div>
</div>
</pre>
<p>Piece of cake, huh? Not so fast. This approach will work in all browsers except, you guessed it, in IE6. I am sure you are not surprised that IE6 will not render this div as you would have expected. But there is a workaround for this IE6 behavior. You can set <strong>text-align</strong> property of the outer div to center and this will align your inner div nicely in the center in IE6. </p>
<p><!--adsense#tla--></p>
<p>This will, however, introduce a side effect. Since you are setting text-align property of the parent element to center, your inner div (the child) will inherit this property also and the text will be center-aligned. If you don&#8217;t want your text to be in the center, reset text-align property at the child level by adding <strong>text-align:left;</strong></p>
<p>So your final style sheet will have this declaration.</p>
<div style="border:1px solid #333;background:#fff;width:450px;text-align:center;">
<h4 style="text-align:left;">Outer DIV</h4>
<div style="margin:auto; background:#eee;width:50%;text-align:left;">
THIS DIV is in the center of the parent div. We used following CSS declaration to align this div.
<pre>
#outerDiv{
 background:#fff;
 border:1px solid #333;
 width:450px;
<strong> text-align:center;</strong>
}
#innerDiv{
 margin:auto;
 background:#eee;
 width:50%
 <strong>text-align:left;</strong>
}
</div>
</div>
</pre>
<p>Good luck!</p>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fhow-to-position-html-element-in-the-center-using-css%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fhow-to-position-html-element-in-the-center-using-css%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="How to position HTML element in the center using CSS." alt=" How to position HTML element in the center using CSS." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/">How to position HTML element in the center using CSS.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'How to position HTML element in the center using CSS. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/',contentID: 'post-1035',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'cascading_style_sheet,CSS,positioning,web development tools',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="How to position HTML element in the center using CSS." alt="article clipper vert How to position HTML element in the center using CSS." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><span style="font-weight:bold;"> Related posts:</span><ul>
<li><a href='http://www.zparacha.com/ad_placement/' rel='bookmark' title='Position Ad Units in Posts'>Position Ad Units in Posts</a></li>
<li><a href='http://www.zparacha.com/doctype-explained/' rel='bookmark' title='An HTML element you don&#039;t want to omit.'>An HTML element you don&#39;t want to omit.</a></li>
<li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a></li>
</ul></p>
<p><a href="http://feedads.g.doubleclick.net/~a/4XfPA6neARI9V1odAauYINywssk/0/da"><img src="http://feedads.g.doubleclick.net/~a/4XfPA6neARI9V1odAauYINywssk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4XfPA6neARI9V1odAauYINywssk/1/da"><img src="http://feedads.g.doubleclick.net/~a/4XfPA6neARI9V1odAauYINywssk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/zparacha?a=xwEGApm5X5Y:6HoJR4oAhsM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/zparacha?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=xwEGApm5X5Y:6HoJR4oAhsM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/zparacha?i=xwEGApm5X5Y:6HoJR4oAhsM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/zparacha?a=xwEGApm5X5Y:6HoJR4oAhsM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/zparacha?i=xwEGApm5X5Y:6HoJR4oAhsM:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/zparacha/~4/xwEGApm5X5Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/</feedburner:origLink></item>
	</channel>
</rss>

