<?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 Technology Blog</title>
	<atom:link href="http://sulabhjain.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sulabhjain.wordpress.com</link>
	<description>A casual collection of some useful codes</description>
	<lastBuildDate>Sun, 10 Apr 2011 10:58:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sulabhjain.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/df6c4ff2d54f2513d77b721a42a35c1d?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>My Technology Blog</title>
		<link>http://sulabhjain.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sulabhjain.wordpress.com/osd.xml" title="My Technology Blog" />
	<atom:link rel='hub' href='http://sulabhjain.wordpress.com/?pushpress=hub'/>
		<item>
		<title>At the bottom of the pyramid</title>
		<link>http://sulabhjain.wordpress.com/2010/04/19/at-the-bottom-of-the-pyramid/</link>
		<comments>http://sulabhjain.wordpress.com/2010/04/19/at-the-bottom-of-the-pyramid/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 11:12:20 +0000</pubDate>
		<dc:creator>sulabhjain</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[at the bottom of the pyramid]]></category>
		<category><![CDATA[c k prahalad bottom of the pyramid]]></category>
		<category><![CDATA[the fortune at the bottom of the pyramid]]></category>

		<guid isPermaLink="false">http://sulabhjain.wordpress.com/?p=83</guid>
		<description><![CDATA[“The Bottom of the Pyramid belongs at the top of the reading list for business people, academics, and experts pursuing the elusive goal of sustainable growth in the developing world. C. K. Prahalad writes with uncommon insight about consumer needs in poor societies and opportunities for the private sector to serve important public purposes while [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=83&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>“The Bottom of the Pyramid belongs at the top of the reading list for business<br />
people, academics, and experts pursuing the elusive goal of sustainable growth in<br />
the developing world. C. K. Prahalad writes with uncommon insight about<br />
consumer needs in poor societies and opportunities for the private sector to serve<br />
important public purposes while enhancing its own bottom line. If you are<br />
looking for fresh thinking about emerging markets, your search is ended. This is<br />
the book for you.”</p>
<p>Enjoy the book,</p>
<h3><a href="http://sulabhjain.files.wordpress.com/2010/04/the_fortune_at_the_bottom_of_the_pyramid.pdf"><span style="color:#ff0000;">The_Fortune_at_the_Bottom_of_the_Pyramid</span></a></h3>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sulabhjain.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sulabhjain.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sulabhjain.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sulabhjain.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sulabhjain.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sulabhjain.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sulabhjain.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sulabhjain.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sulabhjain.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sulabhjain.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sulabhjain.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sulabhjain.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sulabhjain.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sulabhjain.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=83&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sulabhjain.wordpress.com/2010/04/19/at-the-bottom-of-the-pyramid/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/32ef24506b40e16de9099c954fa7c51e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sulabhjain</media:title>
		</media:content>
	</item>
		<item>
		<title>Cannot find symbol</title>
		<link>http://sulabhjain.wordpress.com/2010/02/06/cannot-find-symbol/</link>
		<comments>http://sulabhjain.wordpress.com/2010/02/06/cannot-find-symbol/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 13:16:21 +0000</pubDate>
		<dc:creator>sulabhjain</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[cannot find class]]></category>
		<category><![CDATA[cannot find symbol class]]></category>
		<category><![CDATA[cannot find symbol method]]></category>

		<guid isPermaLink="false">http://sulabhjain.wordpress.com/?p=76</guid>
		<description><![CDATA[In Java while programming, there is a common error which the developers faces and it is, &#8221; javac : Cannot find Symbol&#8220; These errors are due to variables going out of their scope. Scoping errors come in many shapes and sizes. One common mistake happens when a variable is shadowed and two scopes overlaps. Just [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=76&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In Java while programming, there is a common error which the developers faces and it is,</p>
<p>&#8221; javac : <strong>Cannot find Symbol</strong>&#8220;</p>
<p>These errors are due to variables going out of their scope. Scoping errors come in many shapes and sizes. One common mistake happens when a variable is shadowed and two scopes overlaps. Just go through <a href="http://sulabhjain.wordpress.com/2010/02/06/scope-of-variable/" target="_blank">Scope of Variable</a> to revise your concept on Java variables and their scopes.</p>
<p>The most common reason for scoping errors is when you attempt to access a variable that is not in scope. In this post, I will note down the three most common errors which appears due to the variables scope.</p>
<p><strong>Attempting to access an instance variable from a Static Context :</strong></p>
<blockquote><p>class MyClass {</p>
<p>int x = 3;</p>
<p>public static void main ( String[] args ) {</p>
<p>x++;</p>
<p>// <span style="color:#ff0000;">This would not compile because x is an &#8216;instance&#8217; variable, it could not be accessed <span style="color:#000000;">//</span>from within a static context.</span></p>
<p>}</p>
<p>}</p></blockquote>
<p><strong>Accessing Local variable from Nested Method :</strong></p>
<blockquote><p>class MyClass {</p>
<p>public static void main ( String[] args) {</p>
<p>MyClass c = new MyClass(); // reference variable c referring to an Object of class MyClass</p>
<p>c.methodA();</p>
<p>}</p>
<p>void methodA() {</p>
<p>int x = 4 ;</p>
<p>methodB();</p>
<p>x++;  // Once methodB completes x comes back in scope.</p>
<p>}</p>
<p>void methodB () {</p>
<p>x++; // <span style="color:#ff0000;">would not compile, In method B, scope of variables of method A (ie x) ends.</span></p>
<p>}</p>
<p>}</p></blockquote>
<p><strong>Using a block variable, out of the block :<br />
</strong></p>
<blockquote><p>void MyMethod() {</p>
<p>for (int i =0; i&lt;=5 ; i++){</p>
<p>boolean test;  // By default a boolean variable is given the value &#8216;false&#8217;</p>
<p>}</p>
<p>System.out.print(test);  // <span style="color:#ff0000;">would not compile, test variable has it&#8217;s scope only within <span style="color:#333333;">//</span>the for loop</span></p>
<p>}</p></blockquote>
<p>In the last two examples the compiler will say something like this :</p>
<p><span style="color:#ff0000;"><strong>&#8220;cannot find symbol&#8221;</strong></span></p>
<p><strong>References : </strong></p>
<p>1. <strong>Scope of Variable :</strong> <a href="http://ezdia.com/Scope_of_Variables_in_Java/Content.do?id=1300" target="_blank">http://ezdia.com/Scope_of_Variables_in_Java/Content.do?id=1300</a></p>
<p>2. <strong>Java Static Variables :</strong> <a href="http://ezdia.com/Java_Static_Variable/Content.do?id=1301" target="_blank">http://ezdia.com/Java_Static_Variable/Content.do?id=1301</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sulabhjain.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sulabhjain.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sulabhjain.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sulabhjain.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sulabhjain.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sulabhjain.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sulabhjain.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sulabhjain.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sulabhjain.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sulabhjain.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sulabhjain.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sulabhjain.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sulabhjain.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sulabhjain.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=76&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sulabhjain.wordpress.com/2010/02/06/cannot-find-symbol/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/32ef24506b40e16de9099c954fa7c51e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sulabhjain</media:title>
		</media:content>
	</item>
		<item>
		<title>Scope of Variable</title>
		<link>http://sulabhjain.wordpress.com/2010/02/06/scope-of-variable/</link>
		<comments>http://sulabhjain.wordpress.com/2010/02/06/scope-of-variable/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 12:27:04 +0000</pubDate>
		<dc:creator>sulabhjain</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[array variable]]></category>
		<category><![CDATA[c# variables]]></category>
		<category><![CDATA[string variable]]></category>
		<category><![CDATA[value variable]]></category>
		<category><![CDATA[variable function]]></category>

		<guid isPermaLink="false">http://sulabhjain.wordpress.com/?p=64</guid>
		<description><![CDATA[With the declaration of every variable in Java, a natural question arises as soon as the variable is declared, &#8220;How long this variable be around ?&#8221;  This question is answered by the Scope of Variable. All the variables in Java have their scope or which may be called as the &#8216;Expiry date of a variable&#8217; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=64&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#003300;">With the declaration of every variable in Java, a natural question arises as soon as the variable is declared, &#8220;How long this variable be around ?&#8221;  This question is answered by the <strong>Scope of Variable</strong>.</span></p>
<p><span style="color:#003300;">All the variables in Java have their scope or which may be called as the &#8216;Expiry date of a variable&#8217;</span></p>
<p><span style="color:#003300;">In terms of the <strong>Scope of Variable</strong>, we can classify the Java variables in 4 parts :</span></p>
<ul>
<li><span style="color:#800000;"><em><strong>Static Variables</strong></em></span></li>
</ul>
<p><span style="color:#993300;"> <span style="color:#003300;">Static variables have the longest scope among all. They are created when a class is loaded </span></span></p>
<p><span style="color:#003300;"> and survives as long as the class stays loaded in the Java Virtual Machine (JVM)</span></p>
<ul>
<li><span style="color:#800000;"><em><strong>Instance Variables</strong></em></span></li>
</ul>
<p><span style="color:#003300;"> They are next most lived variables. They are created when a new Instance is created and </span></p>
<p><span style="color:#003300;"> survives until the instance is removed. </span></p>
<ul>
<li><span style="color:#800000;"><em><strong>Local Variables</strong></em></span></li>
</ul>
<p><span style="color:#003300;"> Unlike Objects and Instance variables, Local variables are stored in the Stack of the </span></p>
<p><span style="color:#003300;"> memory. These variables lives as long as the methods in which they are declared, remains </span></p>
<p><span style="color:#993300;"><span style="color:#003300;"> on the stack.</span> </span></p>
<p><span style="color:#003300;">However, we can have local variables alive and still out of scope. For more information please read, <a href="http://sulabhjain.wordpress.com/2010/02/06/cannot-find-symbol/" target="_blank">Errors due to <strong>Scope of Variable</strong>.</a></span></p>
<ul>
<li><span style="color:#800000;"><em><strong>Block Variables</strong></em></span></li>
</ul>
<p><span style="color:#003300;"> These variables are those which are defined within &#8216;for&#8217; block or &#8216;if-else&#8217; block. There scope </span></p>
<p><span style="color:#003300;"> ends as soon as the command comes out of the block.</span></p>
<p><span style="color:#003300;">A programmer must take care of the errors which appears due to calls to the variables when the command goes out the <strong>Scope of Variable</strong>. One common mistakes occurs when one variable is shadowed and two scopes overlap. For learning more on shadowing, please read <a href="http://sulabhjain.wordpress.com/2010/02/06/cannot-find-symbol/" target="_blank">Errors due to Scope of Variable.</a></span><br />
<strong> </strong></p>
<p><strong>References :</strong></p>
<p>1. <strong><em>Scope of Variables</em> :</strong> <a href="http://ezdia.com/Scope_of_Variables_in_Java/Content.do?id=1300" target="_blank">http://ezdia.com/Scope_of_Variables_in_Java/Content.do?id=1300</a></p>
<p>2. <strong><em>Java Static Variable </em>:</strong><a href="http://ezdia.com/Java_Static_Variable/Content.do?id=1301" target="_blank"> http://ezdia.com/Java_Static_Variable/Content.do?id=1301</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sulabhjain.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sulabhjain.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sulabhjain.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sulabhjain.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sulabhjain.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sulabhjain.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sulabhjain.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sulabhjain.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sulabhjain.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sulabhjain.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sulabhjain.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sulabhjain.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sulabhjain.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sulabhjain.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=64&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sulabhjain.wordpress.com/2010/02/06/scope-of-variable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/32ef24506b40e16de9099c954fa7c51e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sulabhjain</media:title>
		</media:content>
	</item>
		<item>
		<title>Foreign keys and Referential Integrity in database</title>
		<link>http://sulabhjain.wordpress.com/2010/02/01/foreign-keys-and-referential-integrity-in-database/</link>
		<comments>http://sulabhjain.wordpress.com/2010/02/01/foreign-keys-and-referential-integrity-in-database/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 14:25:00 +0000</pubDate>
		<dc:creator>sulabhjain</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[foreign key constraints]]></category>
		<category><![CDATA[foreign keys]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://sulabhjain.wordpress.com/?p=56</guid>
		<description><![CDATA[Foreign keys in a database : A foreign key in a My Sql database is a field (or fields) of a table that points to a primary key of an other table. Such keys are defined in a database to ensure that only fields that supposed to appear in a database may be permitted. What [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=56&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Foreign keys in a database :</strong></p>
<p>A foreign key in a My Sql database is a field (or fields) of a table that points to a primary key of an other table. Such keys are defined in a database to ensure that only fields that supposed to appear in a database may be permitted.</p>
<p><strong>What is the need of a foreign key :</strong></p>
<p>For a long time MySQL do not support foreign keys being afraid of the fact that it would erode the speed and performance of the RDBMS. But considering the fact that foreign key relationships can play an important role in catching data entry errors and may result in a stronger and better-integrated database, MySQL included the foreign keys.</p>
<p>In order to set up a foreign key relationship between two MySQL tables, three conditions must be met:</p>
<ol type="1">
<li><span style="color:#333300;">Both tables must be of the InnoDB table type.</span></li>
<li><span style="color:#333300;">The fields used in the foreign key      relationship must be indexed.</span></li>
<li><span style="color:#333300;">The fields used in the foreign key      relationship must be similar in data type.</span></li>
</ol>
<p>Following examples may help you understand the need and use of foreign keys.</p>
<p><em><strong>EXAMPLE :</strong></em></p>
<p>We have two tables, say Students and Marks.</p>
<p><strong>Students Table :-</strong></p>
<pre><span style="color:#008080;">Roll No.                  Name                        Surname</span></pre>
<pre><span style="color:#008080;">001                       Sulabh                      Jain</span></pre>
<pre><span style="color:#008080;">002                       Pratik                      Verma</span></pre>
<pre><span style="color:#008080;">003                       Kuldeep                     Kumar</span></pre>
<pre><span style="color:#008080;">004                       Anupam                      Jain</span></pre>
<p><strong>Marks Table :-</strong></p>
<p><span style="color:#008080;">S No                         Name                         Roll No                    Subject                        Marks</span></p>
<p><span style="color:#008080;">1                                Sulabh                       001                          Maths                           87</span></p>
<p><span style="color:#008080;">2                                Sulabh                      001                           English                         76</span></p>
<p><span style="color:#008080;">3                                Kuldeep                   003                           English                         81</span></p>
<p><span style="color:#008080;">4                                Pratik                        002                          Chemistry                   72</span></p>
<p>In the Marks table, the field Roll No is a foreign key referenced to the Roll No field of Students table.</p>
<p><strong>Creating a table with a foreign key :</strong></p>
<p><span style="color:#000000;"><em>CREATE TABLE `marks` </em></span></p>
<p><span style="color:#000000;"><em>(<strong> </strong> `S No` int(10) unsigned NOT NULL AUTO_INCREMENT, </em></span></p>
<p><span style="color:#000000;"><em>`Name` varchar(45) NOT NULL, </em></span></p>
<p><span style="color:#000000;"><em>`Roll No` int(10) unsigned NOT NULL, </em></span></p>
<p><span style="color:#000000;"><em>`Subject` varchar(45) NOT NULL, </em></span></p>
<p><span style="color:#000000;"><em>`Marks` int(10) unsigned NOT NULL, </em></span></p>
<p><span style="color:#000000;"><em>PRIMARY KEY (`S No`), KEY `Roll No` (`Roll No`), </em></span></p>
<p><span style="color:#000000;"><em>CONSTRAINT `Roll No` FOREIGN KEY (`Roll No`) </em></span></p>
<p><span style="color:#000000;"><em>REFERENCES `Students` (`Roll No`) ) </em></span></p>
<p><span style="color:#000000;"><em>ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;</em></span></p>
<p><strong>Foreign Key Constraints :</strong></p>
<p>Try the following query,</p>
<p><em>INSERT INTO TABLE  Marks (S No, Name, Roll No, Subject, Marks) values (5, &#8216;Anupam&#8217;, 005, &#8216;Quantum&#8217;, 81);</em></p>
<p>(Notice that there is no value like 005 in the Roll No column of Students table to which the Roll No column of Marks table is referenced)</p>
<p>If we try to enter a value for the field Roll No in II table (Marks) which do not exists in the Roll No column of I table (Students), in such a case we will get an error like,</p>
<p><em><strong><span style="color:#ff0000;">Cannot add or update a child row: a foreign key  constraint fails</span></strong></em></p>
<p><strong>How to drop a FOREIGN KEY :</strong></p>
<p>We use the <strong><em>ALTER TABLE</em></strong> command with the <strong><em>DROP FOREIGN KEY</em></strong> clause, for dropping a foreign key,</p>
<p><em>ALTER TABLE  Marks  DROP FOREIGN KEY Roll No ;</em><br />
Query OK, 1 row affected (0.11 sec)<br />
Records: 1  Duplicates: 0  Warnings: 0</p>
<p>Whether any key is a foreign key or not, could be easily checked by using the <strong>SHOW CREATE TABLE</strong> query.</p>
<p><strong>References :</strong></p>
<p>1. <strong>SQL Foreign Keys</strong>,<a href="http://ezdia.com/SQL_Foreign_Key/Content.do?id=1294" target="_blank"> http://ezdia.com/SQL_Foreign_Key/Content.do?id=1294</a></p>
<p>2.<strong> Referential Integrity</strong>,<a href="http://ezdia.com/Referential_Integrity_in_databases/Content.do?id=1295" target="_blank"> http://ezdia.com/Referential_Integrity_in_databases/Content.do?id=1295</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sulabhjain.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sulabhjain.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sulabhjain.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sulabhjain.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sulabhjain.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sulabhjain.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sulabhjain.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sulabhjain.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sulabhjain.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sulabhjain.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sulabhjain.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sulabhjain.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sulabhjain.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sulabhjain.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=56&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sulabhjain.wordpress.com/2010/02/01/foreign-keys-and-referential-integrity-in-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/32ef24506b40e16de9099c954fa7c51e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sulabhjain</media:title>
		</media:content>
	</item>
		<item>
		<title>Open Source Applications on Internet</title>
		<link>http://sulabhjain.wordpress.com/2010/01/15/open-source-applications/</link>
		<comments>http://sulabhjain.wordpress.com/2010/01/15/open-source-applications/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 08:00:48 +0000</pubDate>
		<dc:creator>sulabhjain</dc:creator>
				<category><![CDATA[softwares]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[openfire]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[tortoise]]></category>

		<guid isPermaLink="false">http://sulabhjain.wordpress.com/?p=50</guid>
		<description><![CDATA[Hello friends, In this post I want to share some of the open source software and applications which are widely used by different web developers. These software and IDE with included default servers are available on internet for free downloading. Many well known websites who are attracting huge number of users are based on these [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=50&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello friends, In this post I want to share some of the open source software and applications which are widely used by different web developers. These software and IDE with included default servers are available on internet for free downloading. Many well known websites who are attracting huge number of users are based on these platforms.</p>
<h1><strong><span style="font-size:medium;">Netbeans : <a href="http://www.ezdia.com/Netbeans_and_Kenai/Content.do?id=997"><img class="alignright" title="Netbeans" src="http://blogs.sun.com/sunclub/resource/launch_netbeans.png" alt="" width="286" height="191" /></a></span></strong></h1>
<p>The latest edition which I have worked upon is Netbeans 6.7.1</p>
<p>The <strong>NetBeans IDE</strong> is an <a title="Open source" href="http://en.wikipedia.org/wiki/Open_source">open-source</a> integrated development environment. NetBeans IDE supports development of all Java application types (<a title="Java Platform, Standard Edition" href="http://en.wikipedia.org/wiki/Java_Platform,_Standard_Edition">Java SE</a> including JavaFX, (<a title="Java Platform, Mobile Edition (page does not exist)" href="http://en.wikipedia.org/w/index.php?title=Java_Platform,_Mobile_Edition&amp;action=edit&amp;redlink=1">Java ME</a>, <a title="Web application" href="http://en.wikipedia.org/wiki/Web_application">web</a>, <a title="EJB" href="http://en.wikipedia.org/wiki/EJB">EJB</a> and <a title="MIDlet" href="http://en.wikipedia.org/wiki/MIDlet">mobile</a> applications) out of the box. Among other features are an <a title="Apache Ant" href="http://en.wikipedia.org/wiki/Apache_Ant">Ant</a>-based project system, Maven support, <a title="Refactoring" href="http://en.wikipedia.org/wiki/Refactoring">refactorings</a>, <a title="Version control system" href="http://en.wikipedia.org/wiki/Version_control_system">version control</a> (supporting <a title="Concurrent Versions System" href="http://en.wikipedia.org/wiki/Concurrent_Versions_System">CVS</a>, <a title="Subversion (software)" href="http://en.wikipedia.org/wiki/Subversion_%28software%29">Subversion</a>, <a title="Mercurial (software)" href="http://en.wikipedia.org/wiki/Mercurial_%28software%29">Mercurial</a> and <a title="Clearcase" href="http://en.wikipedia.org/wiki/Clearcase">Clearcase</a>).</p>
<p>Features of Netbeans 6.7,</p>
<ul>
<li>The newest features in NetBeans 6.7 involve the integration of <strong>Project Kenai</strong> &#8211; a collaborative environment for developers to host their open-source projects &#8211; native Maven support and Hudson integration.(Read more on Kenai .. <a href="http://ezdia.com/Netbeans_and_Kenai/Content.do?id=997" target="_blank">http://ezdia.com/Netbeans_and_Kenai/Content.do?id=997</a>)</li>
<li> It offers enhancements for Java, PHP, Ruby, JavaScript, Groovy and C/C++</li>
<li>It brings support for SVG Rich Components, remote debugging in Ruby and the latest version of GlassFish</li>
</ul>
<p>Minor updates with Netbeans 6.7.1 are that it does add support for the latest features of JavaFX with JavaFX SDK 1.2 being bundled with the IDE. It also incorporates bug fixes included in Patch 1 for the NetBeans 6.7 release.</p>
<p><strong>Netbeans 6.8 is also released</strong></p>
<p>Why Netbeans and not Eclipse ?</p>
<ul>
<li>Netbeans is very fast (atleast on Linux, it is way faster than Eclipse, One can say that it should approach Eclipse on Windows)</li>
</ul>
<p><strong>License</strong>: From July 2006 through 2007, NetBeans IDE was licensed under Sun&#8217;s <a title="Common Development and Distribution License" href="http://en.wikipedia.org/wiki/Common_Development_and_Distribution_License">Common Development and Distribution License</a> (CDDL), a license based on the <a title="Mozilla Public License" href="http://en.wikipedia.org/wiki/Mozilla_Public_License">Mozilla Public License</a> (MPL). In October 2007, Sun announced that NetBeans would henceforth be offered under a <a title="Dual license" href="http://en.wikipedia.org/wiki/Dual_license">dual license</a> of the CDDL and the <a title="GPL" href="http://en.wikipedia.org/wiki/GPL">GPL</a> version 2 licenses, with the <a title="GPL linking exception" href="http://en.wikipedia.org/wiki/GPL_linking_exception">GPL linking exception</a> for <a title="GNU Classpath" href="http://en.wikipedia.org/wiki/GNU_Classpath">GNU Classpath</a></p>
<p><span style="font-size:medium;"><strong> </strong></span></p>
<p>Download Links :</p>
<p>http://netbeans.org/downloads/</p>
<p><span style="font-size:medium;"><strong>MySQL : </strong></span></p>
<p>MySQL Client Version 5.1.11 (it is the latest)<a href="http://www.ezdia.com/About_My_SQL/Content.do?id=1168"><img class="alignright" title="MySQL" src="http://blog.securitymonks.com/images/mysql1.png" alt="" width="199" height="199" /></a></p>
<p>MySQL is the world&#8217;s most popular open source database software, with over 100 million copies of its software downloaded or distributed throughout its history. With its superior speed, reliability, and ease of use, MySQL has become the preferred choice for Web, Web 2.0, SaaS, ISV, Telecom companies and forward-thinking corporate IT Managers because it eliminates the major problems associated with downtime, maintenance and administration for modern, online applications.</p>
<ul>
<li>MySQL is the world&#8217;s most popular open source database software, with over 100 million copies of its software downloaded or distributed throughout its history</li>
<li>With its superior speed, reliability, and ease of use, MySQL has become the preferred choice for Web, Web 2.0, SaaS, ISV, Telecom companies and forward-thinking corporate IT Managers.</li>
<li>It eliminates the major problems associated with downtime, maintenance and administration for modern, online applications.</li>
<li>MySQL is a key part of LAMP (Linux, Apache, MySQL, PHP / Perl / Python), the fast-growing open source enterprise software stack.</li>
</ul>
<p><strong>MySql advantages over Oracle :</strong></p>
<p>MySQL is characterised as a fast, robust database with a good feature set, but one which lacks all the extras of something like Oracle &#8230; So if we are writing code that&#8217;s designed to be portable it&#8217;s a pretty good choice.  Admin / security are effective but the setup of these and othe features isn&#8217;t over-complicated.</p>
<p>Download Links :</p>
<p>http://dev.mysql.com/downloads/</p>
<p><span style="font-size:medium;"><strong>Tortoise SVN version is 1.6.6.<a href="http://www.ezdia.com/TortoiseSVN_downloads/Content.do?id=1169"><img class="alignright" title="Tortoise SVN" src="http://www.cis.utas.edu.au/projects/2006/dsms/img/TortoiseSVN.gif" alt="" width="183" height="158" /></a></strong></span></p>
<p><em>TortoiseSVN 1.6.6, Build 17493 &#8211; 32 Bit<br />
Subversion 1.6.6,<br />
apr 1.3.8<br />
apr-utils 1.3.9<br />
neon 0.28.6<br />
OpenSSL 0.9.8k 25 Mar 2009<br />
zlib 1.2.3</em></p>
<p>This software includes software developed by collabnet (<a href="http://www.collab.net/" target="_blank">www.Collab.Net</a>)</p>
<p>This software includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href="http://www.openssl.org/" target="_blank">www.openssl.org</a>)</p>
<p>Open-source website &#8211; <a href="http://tortoisesvn.net/downloads" target="_blank">http://tortoisesvn.net/downloads</a><br />
<strong><br />
Tortoise Advantages over other CVS Clients:-</strong></p>
<ol>
<li>Subversion gives us the confidence that when we commit, everything went into the repository.</li>
<li>The ability to back out changes before going to production&#8211;using an  activity branching model, we can allow developers to branch per activity  and only merge to the main source base after code reviews have been  performed.</li>
<li>If there are problems, we have one revision we can back out that  includes the full change-set for that change. While the repository level  re-visioning was a shift for my developers to make that didn&#8217;t happen  immediately, it begins to make sense when an activity had to be removed  from the build-it&#8217;s easier to see what people are working on as the  commits hit our internal commit mailing list. Since we tag each release,  we&#8217;re able to determine which source code contributed to a release.</li>
<li>It&#8217;s easier to see what people are working on as the commits hit our  internal commit mailing list. Since we tag each release, we&#8217;re able to  determine which source code contributed to a release.</li>
</ol>
<p><span style="font-size:medium;"><strong>Openfire 3.6.4 (Chat Server)<a href="http://eZdia.com"><img class="alignright" title="Openfire" src="http://t0.gstatic.com/images?q=tbn:WxzYsfVT_u6JEM:https://svn.igniterealtime.org/svn/repos/openfire/branches/openfire_3_5_2/build/osx/openfire-512.png" alt="" width="184" height="163" /></a></strong></span></p>
<p>Openfire is an open source real time communication (RTC) server. Openfire uses the only widely adopted open protocol for instant messaging and group chat, XMPP (also called Jabber). Openfire is incredibly easy to setup and administer, but offers rock-solid security and performance. Jive Software leads the open source source project at Igniterealtime.org  and uses the technology to power real- time features in their Clearspace products.<br />
Openfire and Spark use the open XMPP protocol (also called &#8220;Jabber&#8221;), the only broadly-adopted instant messaging protocol and an approved standard by the IETF. With many server implementations and dozens of clients, it&#8217;s also the only protocol with proven interoperability. The XMPP protocol is supported and continually enhanced by the active XMPP Software Foundation community.</p>
<p><strong>Opensource Website </strong>- <a href="http://www.igniterealtime.org/projects/openfire/index.jsp" target="_blank">http://www.igniterealtime.org/projects/openfire/index.jsp</a></p>
<p><strong>References:</strong></p>
<ol>
<li>Netbeans and Kenai : <a href="http://www.ezdia.com/Netbeans_and_Kenai/Content.do?id=997" target="_blank">http://www.ezdia.com/Netbeans_and_Kenai/Content.do?id=997</a></li>
<li>Netbeans Keyboard Shortcut keys : <a href="http://www.ezdia.com/Netbeans_Keyboard_Shortcut_keys/Content.do?id=1119" target="_blank">http://www.ezdia.com/Netbeans_Keyboard_Shortcut_keys/Content.do?id=1119</a></li>
<li>About MySQL : <a href="http://www.ezdia.com/About_My_SQL/Content.do?id=1168" target="_blank">http://www.ezdia.com/About_My_SQL/Content.do?id=1168</a></li>
<li>Books on MySQL : <a href="http://www.ezdia.com/Recommended_Books_of_MySQL/Content.do?id=60" target="_blank">http://www.ezdia.com/Recommended_Books_of_MySQL/Content.do?id=60</a></li>
<li>PHP and MySQL Guide for beginners :<a href="http://www.ezdia.com/PHP_and_MySQL_Guide_for_Beginners/Content.do?id=601" target="_blank"> http://www.ezdia.com/PHP_and_MySQL_Guide_for_Beginners/Content.do?id=601</a></li>
<li>Tortoise SVN Downloads: <a href="http://www.ezdia.com/TortoiseSVN_downloads/Content.do?id=1169" target="_blank">http://www.ezdia.com/TortoiseSVN_downloads/Content.do?id=1169</a></li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sulabhjain.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sulabhjain.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sulabhjain.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sulabhjain.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sulabhjain.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sulabhjain.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sulabhjain.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sulabhjain.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sulabhjain.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sulabhjain.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sulabhjain.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sulabhjain.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sulabhjain.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sulabhjain.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=50&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sulabhjain.wordpress.com/2010/01/15/open-source-applications/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/32ef24506b40e16de9099c954fa7c51e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sulabhjain</media:title>
		</media:content>

		<media:content url="http://blogs.sun.com/sunclub/resource/launch_netbeans.png" medium="image">
			<media:title type="html">Netbeans</media:title>
		</media:content>

		<media:content url="http://blog.securitymonks.com/images/mysql1.png" medium="image">
			<media:title type="html">MySQL</media:title>
		</media:content>

		<media:content url="http://www.cis.utas.edu.au/projects/2006/dsms/img/TortoiseSVN.gif" medium="image">
			<media:title type="html">Tortoise SVN</media:title>
		</media:content>

		<media:content url="http://t0.gstatic.com/images?q=tbn:WxzYsfVT_u6JEM:https://svn.igniterealtime.org/svn/repos/openfire/branches/openfire_3_5_2/build/osx/openfire-512.png" medium="image">
			<media:title type="html">Openfire</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert String Array to Arraylist</title>
		<link>http://sulabhjain.wordpress.com/2010/01/01/convert-string-array-to-arraylist/</link>
		<comments>http://sulabhjain.wordpress.com/2010/01/01/convert-string-array-to-arraylist/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 21:10:11 +0000</pubDate>
		<dc:creator>sulabhjain</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sulabhjain.wordpress.com/?p=48</guid>
		<description><![CDATA[Hello friends, Converting a String Array to an ArrayList,  is sometimes a tricky job.  If you have a Array of Strings with you and you want to return a ArrayList, you can do it by following command, ArrayList al = new ArrayList ( Arrays.asList ( StringArray )  ); References : 1. Array Library Methods,  http://ezdia.com/Array_Library_Methods/Content.do?id=1141 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=48&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#333300;">Hello friends, </span></p>
<p><span style="color:#333300;">Converting a String Array to an ArrayList,  is sometimes a tricky job.  If you have a Array of Strings with you and you want to return a ArrayList, you can do it by following command, </span></p>
<p><strong><span style="color:#003300;">ArrayList al = new ArrayList ( Arrays.asList ( StringArray )  );</span></strong></p>
<p><strong><span style="color:#003300;">References :</span></strong></p>
<p><span style="color:#003300;">1. </span><strong>Array Library Methods</strong>, <a href="http://ezdia.com/Array_Library_Methods/Content.do?id=1141" target="_blank"> http://ezdia.com/Array_Library_Methods/Content.do?id=1141</a></p>
<p>2. <strong>Array Class and methods</strong>,  <a href="http://ezdia.com/Array_Class_and_Methods/Content.do?id=1142" target="_blank">http://ezdia.com/Array_Class_and_Methods/Content.do?id=1142</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sulabhjain.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sulabhjain.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sulabhjain.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sulabhjain.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sulabhjain.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sulabhjain.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sulabhjain.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sulabhjain.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sulabhjain.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sulabhjain.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sulabhjain.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sulabhjain.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sulabhjain.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sulabhjain.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=48&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sulabhjain.wordpress.com/2010/01/01/convert-string-array-to-arraylist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/32ef24506b40e16de9099c954fa7c51e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sulabhjain</media:title>
		</media:content>
	</item>
		<item>
		<title>Defining new Logger Object</title>
		<link>http://sulabhjain.wordpress.com/2010/01/01/defining-new-logger-object/</link>
		<comments>http://sulabhjain.wordpress.com/2010/01/01/defining-new-logger-object/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 20:51:34 +0000</pubDate>
		<dc:creator>sulabhjain</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sulabhjain.wordpress.com/?p=44</guid>
		<description><![CDATA[If you are importing org.apache.log4j.Logger class for printing logs, there is a different way of defining a Logger Object. You can not define it like, Logger logger = new Logger(); The right way of doing so is, Logger logger = Logger.getLogger(ClassName.class); where, ClassName is the name of the class in which you are defining the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=44&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are importing org.apache.log4j.Logger class for printing logs, there is a different way of defining a <a href="http://ezdia.com/Logger_Class_and_Object/Content.do?id=1140" target="_blank">Logger Object</a>.</p>
<p>You can not define it like,</p>
<p><strong><span style="color:#ff0000;">Logger logger = new Logger();</span></strong></p>
<p>The right way of doing so is,</p>
<p><strong><span style="color:#00ff00;">Logger logger = Logger.getLogger(ClassName.class);</span></strong></p>
<p>where,  ClassName is the name of the class in which you are defining the Logger object.<br />
<strong><br />
Loggers, Appenders and Layouts:</strong></p>
<p><span style="color:#993300;">Log4j has three main components: <em>loggers</em>, <em>appenders</em> and <em>layouts</em>. These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported.</span></p>
<p><strong>Other methods of Logger Class :</strong></p>
<p>Logger.getRootLogger -</p>
<p>The root logger resides at the top of the logger hierarchy. It is exceptional in two ways:</p>
<ol type="1">
<li> <span style="color:#003300;">it always exists,</span></li>
<li><span style="color:#003300;"> it cannot be retrieved by name.</span></li>
</ol>
<p>It can be retrieved only by the above method provided.</p>
<p><strong>Possible Levels assigned to Loggers,</strong></p>
<p>The set of <a href="http://ezdia.com/Intorduction_to_Logger/Content.do?id=1139" target="_blank">possible levels</a>, that is:</p>
<p><span style="color:#003300;">TRACE,</span></p>
<p><span style="color:#003300;">DEBUG,</span></p>
<p><span style="color:#003300;">INFO,</span></p>
<p><span style="color:#003300;">WARN,</span></p>
<p><span style="color:#003300;">ERROR and</span></p>
<p><span style="color:#003300;">FATAL</span></p>
<p>One may define his own levels by sub-classing the <code>Level</code> class.</p>
<p><strong><span style="color:#800000;">References:</span></strong></p>
<p>1. <strong>Introduction to Logger,</strong> <a href="http://ezdia.com/Intorduction_to_Logger/Content.do?id=1139" target="_blank">http://ezdia.com/Intorduction_to_Logger/Content.do?id=1139</a></p>
<p>2.<strong> Logger Class and Object, </strong><a href="http://ezdia.com/Logger_Class_and_Object/Content.do?id=1140">http://ezdia.com/Logger_Class_and_Object/Content.do?id=1140</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sulabhjain.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sulabhjain.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sulabhjain.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sulabhjain.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sulabhjain.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sulabhjain.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sulabhjain.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sulabhjain.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sulabhjain.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sulabhjain.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sulabhjain.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sulabhjain.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sulabhjain.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sulabhjain.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=44&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sulabhjain.wordpress.com/2010/01/01/defining-new-logger-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/32ef24506b40e16de9099c954fa7c51e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sulabhjain</media:title>
		</media:content>
	</item>
		<item>
		<title>Difference between an ArrayList and an Array</title>
		<link>http://sulabhjain.wordpress.com/2009/12/09/difference-between-an-arraylist-and-an-array/</link>
		<comments>http://sulabhjain.wordpress.com/2009/12/09/difference-between-an-arraylist-and-an-array/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 07:17:17 +0000</pubDate>
		<dc:creator>sulabhjain</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[arraylist]]></category>
		<category><![CDATA[arrays]]></category>

		<guid isPermaLink="false">http://sulabhjain.wordpress.com/?p=31</guid>
		<description><![CDATA[Hello Friends, I wrote a function yesterday, and defined an String array there. I defined it like, String[] arr = null; No error was shown by my IDE. I thought to move ahead. But when I tried to increase the size of my array, I was caught. Now I learned the difference b/w Array &#38; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=31&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#808000;">Hello Friends,</span></p>
<p><span style="color:#808000;">I wrote a function yesterday, and defined an String array there. I defined it like,</span></p>
<p><span style="color:#339966;">String[] arr = null;</span></p>
<p><span style="color:#808000;">No error was shown by my IDE. I thought to move ahead. But when I tried to <em>increase the size of my array,</em> I was caught.</span></p>
<p><span style="color:#808000;">Now I learned the difference b/w Array &amp; an Array List.</span></p>
<p><span style="color:#808000;">In Java, standard arrays are of a fixed length. After arrays are created, they cannot grow or shrink, which means that you must know in advance how many elements an array will hold. But, sometimes, you may not know until run time precisely how large of an array you need. To handle this situation, the collections framework defines <strong>ArrayList.</strong></span></p>
<p><span style="color:#000000;"><strong>An Array List </strong></span></p>
<ul>
<li><span style="color:#993300;">The <strong>ArrayList </strong>class extends <strong>AbstractList </strong>and implements the <strong>List </strong>interface.</span></li>
<li><span style="color:#993300;"><strong> </strong><strong> </strong>An <strong>ArrayList </strong>is a variable-length array of object references. That is, an <strong>ArrayList </strong>can dynamically increase or decrease in size.</span></li>
<li><span style="color:#993300;"><strong>Array lists</strong> are created with an initial size. When this size is exceeded, the collection is automatically enlarged. When objects are removed, the array may be shrunk.</span></li>
</ul>
<p><span style="color:#000000;"><strong>Constructors of Array List</strong></span></p>
<ul>
<li><span style="color:#993300;">ArrayList( )</span></li>
<li><span style="color:#993300;">ArrayList(Collection <em>c</em>)</span></li>
<li><span style="color:#993300;">ArrayList(int <em>capacity</em>)</span></li>
</ul>
<p><span style="color:#808000;">The first constructor builds an empty array list. The second constructor builds an array list that is initialized with the elements of the collection <em>c</em>. The third constructor builds an array list that has the specified initial <em>capacity</em>. The capacity grows automatically as elements are added to an array list.</span></p>
<p><span style="color:#993300;"><br />
</span></p>
<p><span style="color:#993300;">The following program will show How an Array Lists grows and How we define an Array.</span></p>
<p><span style="color:#008000;">import java.util.*;<br />
/**<br />
*<br />
* @author Sulabh<br />
*/<br />
public class ArrayListDemo {<br />
public static void main(String args[]){<br />
// Creating an Array List<br />
ArrayList arrlist = new ArrayList();                   // Stating the initial size in not mandatory.<br />
String[] arr = new String[2];                                   // We need to state the size of an Array.</span></p>
<p><span style="color:#008000;">System.out.println(&#8220;Size of Array List = &#8220;+arrlist.size());<br />
System.out.println(&#8220;Size of String array = &#8220;+arr.length);</span></p>
<p><span style="color:#008000;">arrlist.add(&#8220;Sulabh&#8221;);<br />
arrlist.add(&#8220;Pratik&#8221;);<br />
arrlist.add(&#8220;Kuldeep&#8221;);</span></p>
<p><span style="color:#008000;">System.out.println(&#8220;Size of Array List = &#8220;+arrlist.size());<br />
}<br />
}</span></p>
<p><span style="color:#808000;">The output of the program will be :</span></p>
<p><span style="color:#808000;">Size of Array List = 0<br />
Size of String array = 2<br />
Size of Array List = 3</span></p>
<p><span style="color:#000000;"><strong>ensureCapacity()  for ArrayLists : </strong></span></p>
<p><span style="color:#808000;">Although the capacity of an <strong>ArrayList </strong>object increases automatically as objects are stored in it, you can increase the capacity of an <strong>ArrayList </strong>object manually by calling <strong> ensureCapacity( )</strong></span></p>
<p><span style="color:#008000;">arrlist.ensureCapacity( int minimunCapacity );</span><br />
<span style="color:#808000;">By increasing its capacity once, at the start, you can prevent several reallocations later. Because reallocations are costly in terms of time, preventing unnecessary ones improves performance.</span></p>
<p><span style="color:#000080;"><br />
</span></p>
<p><span style="color:#000000;"><em><strong>References :</strong></em></span></p>
<p><strong><span style="color:#993300;">1. How to use Array Lists in Java :</span></strong> <a href="http://www.ezdia.com/How_to_use_Array_List_in_Java/Content.do?id=1022" target="_blank">http://www.ezdia.com/How_to_use_Array_List_in_Java/Content.do?id=1022</a></p>
<p><strong><span style="color:#993300;">2. Array Lists in Java :<a href="http://www.ezdia.com/Array_List_in_Java/Content.do?id=1023" target="_blank"> http://www.ezdia.com/Array_List_in_Java/Content.do?id=1023</a></span></strong></p>
<p><strong><span style="color:#993300;">3. Differences b/w Array &amp; ArrayLists : </span></strong><a href="http://www.ezdia.com/Array_and_ArrayLists/Content.do?id=1024" target="_blank">http://www.ezdia.com/Array_and_ArrayLists/Content.do?id=1024</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sulabhjain.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sulabhjain.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sulabhjain.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sulabhjain.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sulabhjain.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sulabhjain.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sulabhjain.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sulabhjain.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sulabhjain.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sulabhjain.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sulabhjain.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sulabhjain.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sulabhjain.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sulabhjain.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=31&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sulabhjain.wordpress.com/2009/12/09/difference-between-an-arraylist-and-an-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/32ef24506b40e16de9099c954fa7c51e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sulabhjain</media:title>
		</media:content>
	</item>
		<item>
		<title>Passing parameters to another JSP</title>
		<link>http://sulabhjain.wordpress.com/2009/11/29/calling-new-jsp/</link>
		<comments>http://sulabhjain.wordpress.com/2009/11/29/calling-new-jsp/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 21:06:34 +0000</pubDate>
		<dc:creator>sulabhjain</dc:creator>
				<category><![CDATA[HTML and Javascript]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[pages]]></category>

		<guid isPermaLink="false">http://sulabhjain.wordpress.com/?p=17</guid>
		<description><![CDATA[Since past few days, I was working on some Java Server Pages, which are linked with each other. Many times I have to include some JSPs in one JSP. While doing so, I need to call the variables defined in one JSP, in those JSP&#8217;s which are included one. I thus have to pass these [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=17&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#008080;">Since past few days, I was working on some Java Server Pages, which are linked with each other. Many times I have to include some JSPs in one JSP. While doing so, I need to call the variables defined in one JSP, in those JSP&#8217;s which are included one. I thus have to pass these parameters from one JSP to another at the time of Including those.<br />
</span></p>
<p><span style="color:#008080;">I searched for the solutions, and found many different ways of doing so.<br />
</span></p>
<p><span style="color:#008080;">For including another JSP into a JSP I used the following command in FirstJSP.jsp</span></p>
<p><span style="color:#666699;">&lt;jsp:include page=&#8221;SecondJSP.jsp&#8221;/&gt;</span></p>
<p><span style="color:#008080;">I searched for it and found many different ways of doing so.</span></p>
<h2><span style="color:#333399;"><strong>1. JSP:Param</strong></span></h2>
<p><span style="color:#666699;">&lt;jsp:include page=</span><span style="color:#666699;"><em>&#8220;SecondJSP.jsp&#8221;</em></span><span style="color:#666699;"> /&gt;</span></p>
<p><span style="color:#666699;"> &lt;jsp:param name=</span><span style="color:#666699;"><em>&#8220;name&#8221;</em></span><span style="color:#666699;"> value=</span><span style="color:#666699;"><em>&#8220;Sulabh Jain&#8221;</em></span><span style="color:#666699;"> /&gt;</span></p>
<p><span style="color:#666699;"> &lt;jsp:param name=</span><span style="color:#666699;"><em>&#8220;age&#8221;</em></span><span style="color:#666699;"> value=</span><span style="color:#666699;"><em>&#8220;24&#8243;</em></span><span style="color:#666699;"> /&gt;</span></p>
<p><span style="color:#666699;">&lt;/jsp:include&gt;</span></p>
<p><span style="color:#008080;">The above code will help in setting the values of param1 and param2 as value1 and value2</span></p>
<p><span style="color:#008080;"> which can be called or retrieved in SecondJSP.jsp using,</span></p>
<p><span style="color:#666699;">&lt;% </span></p>
<p><span style="color:#666699;">String myName= request.getParameter(&#8220;name&#8221;)</span></p>
<p><span style="color:#666699;">String myAge= request.getParameter(&#8220;age&#8221;) </span></p>
<p><span style="color:#666699;">%&gt;</span></p>
<p><span style="color:#008080;">These can be printed in JSP using &#8216;equals to&#8217; sign (=) with percentage tags,</span></p>
<p><span style="color:#666699;">My Name  is &lt;%=myName%&gt;<br />
My   Age    is &lt;%=myAge%&gt;</span></p>
<h2><span style="color:#333399;">2. JSP:Forward</span></h2>
<p><span style="color:#008080;">It also behaves similar to jsp:param</span></p>
<p><span style="color:#666699;">&lt;jsp: forward page=&#8221;SecondJSP.jsp&#8221;&gt;<br />
&lt;jsp: param name=&#8221;name&#8221; value=&#8221;Amar Patel&#8221;/&gt;<br />
&lt;jsp: param name=&#8221;age&#8221; value=&#8221;15&#8243;/&gt;<br />
&lt;/jsp: forward&gt;</span></p>
<h3><span style="color:#333399;">Limitations of above two methods :</span></h3>
<p><span style="color:#008080;"><br />
This method of passing parameters can be used only for Static variables. For eg.<br />
if we have a dynamic variable declared in JSP we cannot pass it using jsp:param</span></p>
<p><span style="color:#008080;">Here it got little difficult,</span></p>
<p><span style="color:#008080;">Now I need to pass dynamic variables which I defined in the first JSP.<br />
The third method provides solution to it.</span></p>
<h2><span style="color:#333399;">3. request.setAttribute</span></h2>
<p><span style="color:#008080;">Here we will use an object of javax.servlet.http.HttpServletRequest class named as request.<br />
calling the public abstract void setAttribute(java.lang.String name, java.lang.Object o) method we can set the String name as an attribute.</span></p>
<p><span style="color:#666699;">&lt;% </span></p>
<p><span style="color:#666699;"> String name = &#8220;Sulabh Jain&#8221;; </span></p>
<p><span style="color:#666699;"> request.setAttribute(&#8220;myName&#8221;, name);</span></p>
<p><span style="color:#666699;"> %&gt;</span></p>
<p><span style="color:#008080;">Now we can easily get in in SecondJSP as</span></p>
<p><span style="color:#666699;">&lt;%</span></p>
<p><span style="color:#666699;"> String nameInNewJSP = request.getAttribute(&#8220;myName&#8221;).toString();</span></p>
<p><span style="color:#666699;">%&gt;<br />
</span></p>
<p><span style="color:#008080;">toString is used here to convert the object into string.</span></p>
<p><span style="color:#993300;">References: </span></p>
<p><span style="color:#993300;"><span style="color:#000000;">1. Passing parameters, </span></span><a title="eZdia content" href="http://www.ezdia.com/Passing_parameters_to_JSP_using_jsp%3Aparam/Content.do?id=968" target="_blank">http://www.ezdia.com/Passing_parameters_to_JSP_using_jsp%3Aparam/Content.do?id=968</a></p>
<p>2. Calling a new JSP, <a title="eZdia content" href="http://www.ezdia.com/Calling_a_new_JSP/Content.do?id=969" target="_blank">http://www.ezdia.com/Calling_a_new_JSP/Content.do?id=969</a></p>
<p>3. JSP exercises, <a title="eZdia content" href="http://www.ezdia.com/JSP_Exercises/Content.do?id=806" target="_blank">http://www.ezdia.com/JSP_Exercises/Content.do?id=806</a></p>
<p><strong><span style="color:#008080;">Please post your comments, on the above provided code, and suggest if there exists better or more options.</span></strong></p>
<p><span style="color:#008080;">Thanks</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sulabhjain.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sulabhjain.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sulabhjain.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sulabhjain.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sulabhjain.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sulabhjain.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sulabhjain.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sulabhjain.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sulabhjain.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sulabhjain.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sulabhjain.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sulabhjain.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sulabhjain.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sulabhjain.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=17&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sulabhjain.wordpress.com/2009/11/29/calling-new-jsp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/32ef24506b40e16de9099c954fa7c51e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sulabhjain</media:title>
		</media:content>
	</item>
		<item>
		<title>Displaying hidden Divs on Mouse Clicks</title>
		<link>http://sulabhjain.wordpress.com/2009/11/10/showing-hidden-divs-on-mouse-clicks/</link>
		<comments>http://sulabhjain.wordpress.com/2009/11/10/showing-hidden-divs-on-mouse-clicks/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 12:11:42 +0000</pubDate>
		<dc:creator>sulabhjain</dc:creator>
				<category><![CDATA[HTML and Javascript]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The blog provides code used for displaying and hiding div frames in HTML, on simple mouse click.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=1&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#339966;">Hello Guys, I was trying to create a Mail Box, where on clicking at every Row, I can read the mail content there itself. </span></p>
<p><span style="color:#339966;">As I click on a div, one Div opens right below it, and when I click on it again the Div must hide again. </span></p>
<p><span style="color:#339966;">I am providing the HTML code for such functionality.</span></p>
<div id="attachment_7" class="wp-caption aligncenter" style="width: 310px"><a href="http://eZdia.com/profile/sulabh" target="_blank"><img class="size-medium wp-image-7" title="Image" src="http://sulabhjain.files.wordpress.com/2009/11/2009-11-21_01452.png?w=300&#038;h=140" alt="" width="300" height="140" /></a><p class="wp-caption-text">Hidden Div for row one is appearing</p></div>
<p><span style="color:#666699;">&lt;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.0 Transitional//EN&#8221;&gt;<br />
&lt;HTML&gt;<br />
&lt;HEAD&gt;<br />
&lt;TITLE&gt; Opening and Hiding Divs on Mouse Clicks &lt;/TITLE&gt;<br />
&lt;script&gt;<br />
function showHiddenDiv(divid){<br />
var visibility = document.getElementById(divid).style.display;<br />
if(visibility == &#8220;none&#8221;){<br />
document.getElementById(divid).style.display = &#8221;;<br />
}<br />
else{<br />
document.getElementById(divid).style.display = &#8216;none&#8217;;<br />
}<br />
}<br />
&lt;/script&gt;<br />
&lt;/HEAD&gt;</span></p>
<p><span style="color:#666699;">&lt;BODY&gt;<br />
&lt;table width=&#8221;350&#8243; border=&#8221;1&#8243; datasrc=&#8221;#cdcat&#8221;&gt;</span></p>
<p><span style="color:#666699;">&lt;tr&gt;&lt;td id=&#8221;row1&#8243; onclick=&#8221;showHiddenDiv(&#8216;hiddenRow1&#8242;);&#8221; align=&#8221;center&#8221;&gt;Row One&lt;/td&gt;&lt;/tr&gt;<br />
&lt;tr id=&#8221;hiddenRow1&#8243; style=&#8221;display:none&#8221; height=&#8221;50&#8243;&gt;&lt;td align=&#8221;center&#8221;&gt;&#8221;hidden content for row one&#8221;&lt;/td&gt;&lt;/tr&gt;<br />
&lt;tr&gt;&lt;td id=&#8221;row2&#8243; onclick=&#8221;showHiddenDiv(&#8216;hiddenRow2&#8242;);&#8221; align=&#8221;center&#8221;&gt;Row Two&lt;/td&gt;&lt;/tr&gt;<br />
&lt;tr id=&#8221;hiddenRow2&#8243; style=&#8221;display:none&#8221; height=&#8221;50&#8243;&gt;&lt;td align=&#8221;center&#8221;&gt;&#8221;hidden content for row two&#8221;&lt;/td&gt;&lt;/tr&gt;<br />
&lt;tr&gt;&lt;td id=&#8221;row3&#8243; onclick=&#8221;showHiddenDiv(&#8216;hiddenRow3&#8242;);&#8221; align=&#8221;center&#8221;&gt;Row Three&lt;/td&gt;&lt;/tr&gt;<br />
&lt;tr id=&#8221;hiddenRow3&#8243; style=&#8221;display:none&#8221; height=&#8221;50&#8243;&gt;&lt;td align=&#8221;center&#8221;&gt;&#8221;hidden content for row three&#8221;&lt;/td&gt;&lt;/tr&gt;<br />
&lt;tr&gt;&lt;td id=&#8221;row4&#8243; onclick=&#8221;showHiddenDiv(&#8216;hiddenRow4&#8242;);&#8221; align=&#8221;center&#8221;&gt;Row Four&lt;/td&gt;&lt;/tr&gt;<br />
&lt;tr id=&#8221;hiddenRow4&#8243; style=&#8221;display:none&#8221; height=&#8221;50&#8243;&gt;&lt;td align=&#8221;center&#8221;&gt;&#8221;hidden content for row four&#8221;&lt;/td&gt;&lt;/tr&gt;</span></p>
<p><span style="color:#666699;">&lt;/table&gt;<br />
&lt;/BODY&gt;<br />
&lt;/HTML&gt;</span></p>
<p><span style="color:#666699;"><span style="color:#339966;">This code has been used at various places and uses simplest functions possible.</span></span></p>
<p><span style="color:#993366;">function showHiddenDiv(divid) <span style="color:#000000;">is used for displaying and hiding the div whose Id has been passed as divid where ever the function is called.</span></span></p>
<p><span style="color:#993366;">document.getElementById(divid).style.display <span style="color:#000000;">is used to get the display style status of the Div whose Id is divid. It will be &#8220;none&#8221; is Div is hidden &amp; it will be blank if the div is Displayed.</span></span></p>
<h2><em>References :</em></h2>
<p>1. <strong><span style="color:#993300;">Drop Down Menu boxes</span></strong> : <a href="http://www.ezdia.com/Drop_down_menus_in_HTML/Content.do?id=495" target="_blank">http://www.ezdia.com/Drop_down_menus_in_HTML/Content.do?id=495</a></p>
<p>2. <strong><span style="color:#993300;">All about element display in html</span></strong> : <a href="http://www.ezdia.com/All_about_showelementbyid_in_html/Content.do?id=946" target="_blank">http://www.ezdia.com/All_about_showelementbyid_in_html/Content.do?id=946</a></p>
<p>3. <span style="color:#993300;"><strong>Working examples with explanations</strong></span> : <a href="http://www.ezdia.com/Favorite_Javascripts_for_designers/Content.do?id=947" target="_blank">http://www.ezdia.com/Favorite_Javascripts_for_designers/Content.do?id=947</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sulabhjain.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sulabhjain.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sulabhjain.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sulabhjain.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sulabhjain.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sulabhjain.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sulabhjain.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sulabhjain.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sulabhjain.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sulabhjain.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sulabhjain.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sulabhjain.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sulabhjain.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sulabhjain.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sulabhjain.wordpress.com&amp;blog=10406460&amp;post=1&amp;subd=sulabhjain&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sulabhjain.wordpress.com/2009/11/10/showing-hidden-divs-on-mouse-clicks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/32ef24506b40e16de9099c954fa7c51e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sulabhjain</media:title>
		</media:content>

		<media:content url="http://sulabhjain.files.wordpress.com/2009/11/2009-11-21_01452.png?w=300" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>
	</item>
	</channel>
</rss>
