<?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>VivekMishra</title>
	<atom:link href="http://vivekwin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://vivekwin.wordpress.com</link>
	<description>The winner is he who give himself,to his work,body &#38; soul</description>
	<lastBuildDate>Wed, 12 Nov 2008 11:22:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='vivekwin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>VivekMishra</title>
		<link>http://vivekwin.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://vivekwin.wordpress.com/osd.xml" title="VivekMishra" />
	<atom:link rel='hub' href='http://vivekwin.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Make a lightbox with css</title>
		<link>http://vivekwin.wordpress.com/2008/11/12/make-a-lightbox-with-css/</link>
		<comments>http://vivekwin.wordpress.com/2008/11/12/make-a-lightbox-with-css/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 11:22:36 +0000</pubDate>
		<dc:creator>vivekwin</dc:creator>
				<category><![CDATA[Student]]></category>
		<category><![CDATA[How to make light box with css and js]]></category>
		<category><![CDATA[How to Make LightBox without Java script]]></category>

		<guid isPermaLink="false">http://vivekwin.wordpress.com/?p=38</guid>
		<description><![CDATA[/*Light boxcss Start */ .black_overlay{ position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; /*width: 1004px;*/ /*height: 665px;*/ width: auto; min-width: 1024px; _width: 1024px; height: auto; min-height: 665px; _height: 665px; background-color: black; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); display: none; z-index:9999; } .white_content { position: absolute; top: 20%; left: 35%; width: 320px; height: 350px; padding: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=38&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>/*Light boxcss Start */</p>
<p>.black_overlay{<br />
position: absolute;<br />
top: 0px;<br />
left: 0px;<br />
right: 0px;<br />
bottom: 0px;<br />
/*width: 1004px;*/<br />
/*height: 665px;*/<br />
width: auto;<br />
min-width: 1024px;<br />
_width: 1024px;<br />
height: auto;<br />
min-height: 665px;<br />
_height: 665px;<br />
background-color: black;<br />
-moz-opacity: 0.8;<br />
opacity:.80;<br />
filter: alpha(opacity=80);<br />
display: none;<br />
z-index:9999;<br />
}</p>
<p>.white_content {<br />
position: absolute;<br />
top: 20%;<br />
left: 35%;<br />
width: 320px;<br />
height: 350px;<br />
padding: 5px;<br />
border: 5px solid #D3D3D6;<br />
background-color: white;<br />
z-index:99999;<br />
overflow: auto;<br />
display: none;<br />
}</p>
<p>/* End */</p>
<p>/Show Light Box  Script */</p>
<p>&lt;a href = &#8220;javascript:void(0)&#8221; onclick = &#8220;document.getElementById(&#8216;light&#8217;).style.display=&#8217;block&#8217;;document.getElementById(&#8216;fade&#8217;).style.display=&#8217;block&#8217;&#8221; class=&#8221;normal_link&#8221;&gt;edit&lt;/a&gt;<br />
&lt;div id=&#8221;light&#8221; class=&#8221;white_content&#8221; &gt;</p>
<p>// Write your content here ///</p>
<p>&lt;div align=&#8221;right&#8221;&gt;&lt;a href = &#8220;javascript:void(0)&#8221; onclick = &#8220;document.getElementById(&#8216;light&#8217;).style.display=&#8217;none&#8217;;document.getElementById(&#8216;fade&#8217;).style.display=&#8217;none&#8217;&#8221;&gt;&lt;img src=&#8221;images/closelabel.gif&#8221; border=&#8221;0&#8243; /&gt;&lt;/a&gt;&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>&lt;div id=&#8221;fade&#8221; class=&#8221;black_overlay&#8221;&gt;&lt;/div&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekwin.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekwin.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekwin.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekwin.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekwin.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekwin.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekwin.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekwin.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekwin.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekwin.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekwin.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekwin.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekwin.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekwin.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=38&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekwin.wordpress.com/2008/11/12/make-a-lightbox-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e079a4593ca3302d9debe92e3f1af016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekwin</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL SELECT statement</title>
		<link>http://vivekwin.wordpress.com/2008/07/24/mysql-select-statement/</link>
		<comments>http://vivekwin.wordpress.com/2008/07/24/mysql-select-statement/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 13:28:42 +0000</pubDate>
		<dc:creator>vivekwin</dc:creator>
				<category><![CDATA[Student]]></category>
		<category><![CDATA[MySQL SELECT statement]]></category>

		<guid isPermaLink="false">http://vivekwin.wordpress.com/?p=23</guid>
		<description><![CDATA[The Mysql SELECT command is something like a print or write command of other languages.. Displaying the MySQL version number select version();   +-----------+ &#124; version() &#124; +-----------+ &#124; 5.00.00   &#124; +-----------+ 1 row in set (0.00 sec)   Displaying the current date and time select now();   +---------------------+ &#124; now()               &#124; +---------------------+ &#124; 2008-05-31 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=23&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The Mysql SELECT command is something like a <em>print</em> or <em>write</em> command of other languages..</p>
<p><span class="imp">Displaying the MySQL version number</span></p>
<pre><span style="font-size:12pt;">select version();</span>
<span style="font-size:12pt;"> </span>
<span style="font-size:12pt;">+-----------+</span>
<span style="font-size:12pt;">| version() |</span>
<span style="font-size:12pt;">+-----------+</span>
<span style="font-size:12pt;">| 5.00.00<span>   </span>|</span>
<span style="font-size:12pt;">+-----------+</span>
<span style="font-size:12pt;">1 row in set (0.00 sec)</span>
<span style="font-size:12pt;"> </span></pre>
<p><span class="imp">Displaying the current date and time</span></p>
<pre><span style="font-size:12pt;">select now();</span>
<span style="font-size:12pt;"> </span>
<span style="font-size:12pt;">+---------------------+</span>
<span style="font-size:12pt;">| now()<span>               </span>|</span>
<span style="font-size:12pt;">+---------------------+</span>
<span style="font-size:12pt;">| 2008-05-31 00:36:24 |</span>
<span style="font-size:12pt;">+---------------------+</span>
<span style="font-size:12pt;">1 row in set (0.00 sec)</span>
<span style="font-size:12pt;"> </span></pre>
<p><span class="imp">Displaying the current Day, Month and Year</span></p>
<pre><span style="font-size:12pt;">SELECT DAYOFMONTH(CURRENT_DATE);</span>
<span style="font-size:12pt;">+--------------------------+</span>
<span style="font-size:12pt;">| DAYOFMONTH(CURRENT_DATE) |</span>
<span style="font-size:12pt;">+--------------------------+</span>
<span style="font-size:12pt;">| <span>                      </span>5 |</span>
<span style="font-size:12pt;">+--------------------------+</span>
<span style="font-size:12pt;">1 row in set (0.01 sec)</span>
<span style="font-size:12pt;"> </span>
<span style="font-size:12pt;">SELECT MONTH(CURRENT_DATE);</span>
<span style="font-size:12pt;">+---------------------+</span>
<span style="font-size:12pt;">| MONTH(CURRENT_DATE) |</span>
<span style="font-size:12pt;">+---------------------+</span>
<span style="font-size:12pt;">|<span>                   </span>2 |</span>
<span style="font-size:12pt;">+---------------------+</span>
<span style="font-size:12pt;">1 row in set (0.00 sec)</span>
<span style="font-size:12pt;"> </span>
<span style="font-size:12pt;">SELECT YEAR(CURRENT_DATE);</span>
<span style="font-size:12pt;">+--------------------+</span>
<span style="font-size:12pt;">| YEAR(CURRENT_DATE) |</span>
<span style="font-size:12pt;">+--------------------+</span>
<span style="font-size:12pt;">|<span>               </span>2008 |</span>
<span style="font-size:12pt;">+--------------------+</span>
<span style="font-size:12pt;">1 row in set (0.00 sec)</span>
<span style="font-size:12pt;"> </span></pre>
<p><span class="imp">Displaying text strings</span></p>
<pre><span style="font-size:12pt;">select 'I am MySQL';</span>
<span style="font-size:12pt;"> </span>
<span style="font-size:12pt;">+--------------+</span>
<span style="font-size:12pt;">| I am MySQL |</span>
<span style="font-size:12pt;">+--------------+</span>
<span style="font-size:12pt;">| I am MySQL |</span>
<span style="font-size:12pt;">+--------------+</span>
<span style="font-size:12pt;">1 row in set (0.00 sec)</span>
<span style="font-size:12pt;"> </span></pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekwin.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekwin.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekwin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekwin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekwin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekwin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekwin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekwin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekwin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekwin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekwin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekwin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekwin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekwin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekwin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekwin.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=23&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekwin.wordpress.com/2008/07/24/mysql-select-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e079a4593ca3302d9debe92e3f1af016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekwin</media:title>
		</media:content>
	</item>
		<item>
		<title>All type of javascript validation functions</title>
		<link>http://vivekwin.wordpress.com/2008/07/24/all-type-of-javascript-validation-functions/</link>
		<comments>http://vivekwin.wordpress.com/2008/07/24/all-type-of-javascript-validation-functions/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 13:20:49 +0000</pubDate>
		<dc:creator>vivekwin</dc:creator>
				<category><![CDATA[Student]]></category>
		<category><![CDATA[Javascript functions]]></category>

		<guid isPermaLink="false">http://vivekwin.wordpress.com/?p=19</guid>
		<description><![CDATA[These all function are use when you use client side validation in your page .these are very  simple   and use it with your javascript code   // function for checking string function checkString(str_temp, str_fld) {       temp=new String(str_temp);       if(str_temp=="")       {            window.alert("Please enter the " + str_fld);            return false;       } [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=19&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre><span style="font-size:14pt;">These all function are use when you use client side validation in your page .these are very<span>  </span>simple </span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">and use it with your javascript code</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">// function for checking string</span>
<span style="font-size:14pt;">function checkString(str_temp, str_fld)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>temp=new String(str_temp);</span>
<span style="font-size:14pt;"><span>      </span>if(str_temp=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>window.alert("Please enter the " + str_fld);</span>
<span style="font-size:14pt;"><span>           </span>return false;</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>if(temp.charAt(0)==" ")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>window.alert("The " + str_fld + " cannot start with a space");</span>
<span style="font-size:14pt;"><span>           </span>return false;</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>str=new String("'\"");</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>var flag=1;</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>for (c=0; c&lt;temp.length; c++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if(str.indexOf(temp.charAt(c))&gt;=0)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>flag=0;</span>
<span style="font-size:14pt;"><span>                 </span>break;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>if (flag==0)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>window.alert("The " + str_fld + " cannot contain single/double quotes");</span>
<span style="font-size:14pt;"><span>           </span>return false;</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return true;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function IsNumeric(sText)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>   </span>var ValidChars = "0123456789";</span>
<span style="font-size:14pt;"><span>   </span>var IsNumber=true;</span>
<span style="font-size:14pt;"><span>   </span>var Char;</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>   </span>for (i = 0; i &lt; sText.length &amp;&amp; IsNumber == true; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>      </span>Char = sText.charAt(i);</span>
<span style="font-size:14pt;"><span>      </span>if (ValidChars.indexOf(Char) == -1)</span>
<span style="font-size:14pt;"><span>         </span>{</span>
<span style="font-size:14pt;"><span>         </span>IsNumber = false;</span>
<span style="font-size:14pt;"><span>         </span>}</span>
<span style="font-size:14pt;"><span>  </span><span>    </span>}</span>
<span style="font-size:14pt;"><span>   </span>return IsNumber;</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function IsZip(sText)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>   </span>var ValidChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";</span>
<span style="font-size:14pt;"><span>   </span>var IsNumber=true;</span>
<span style="font-size:14pt;"><span>   </span>var Char;</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>   </span>for (i = 0; i &lt; sText.length &amp;&amp; IsNumber == true; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>      </span>Char = sText.charAt(i);</span>
<span style="font-size:14pt;"><span>      </span>if (ValidChars.indexOf(Char) == -1)</span>
<span style="font-size:14pt;"><span>         </span>{</span>
<span style="font-size:14pt;"><span>         </span>IsNumber = false;</span>
<span style="font-size:14pt;"><span>         </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>   </span>return IsNumber;</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">// function for checking number</span>
<span style="font-size:14pt;">function checkNumber(str_temp, str_fld)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>temp=new String(str_temp);</span>
<span style="font-size:14pt;"><span>      </span>msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(str_temp=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>//window.alert("Please enter the " + str_fld);</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter the "+ str_fld;</span>
<span style="font-size:14pt;"><span>           </span>return msg;</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>if(temp.charAt(0)==" ")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>//window.alert("The " + str_fld + " cannot start with a space");</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter the "+ str_fld + " cannot start with a space";</span>
<span style="font-size:14pt;"><span>           </span>return msg;</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>if (isNaN(str_temp))</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>//window.alert("The " + str_fld + " can contain only numbers");</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter the "+ str_fld + " can contain only numbers";</span>
<span style="font-size:14pt;"><span>           </span>return msg;</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">// returns the filename(Thumbnail/Blowup name)</span>
<span style="font-size:14pt;">function funName(str_temp)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>temp=new String(str_temp);</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>li=temp.lastIndexOf("\\");</span>
<span style="font-size:14pt;"><span>      </span>if(li!=-1)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>li++;</span>
<span style="font-size:14pt;"><span>           </span>temp=temp.substr(li);</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>if(temp.indexOf(".")==-1)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>return("");</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return(temp);</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">//</span>
<span style="font-size:14pt;">function Trim(trimstr)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>if(trimstr.length &lt; 1)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>return"";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>trimstr = RTrim(trimstr);</span>
<span style="font-size:14pt;"><span>      </span>trimstr = LTrim(trimstr);</span>
<span style="font-size:14pt;"><span>      </span>if(trimstr=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>return "";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>return trimstr;</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;">} //End Function</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function RTrim(VALUE)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var w_space = String.fromCharCode(32);</span>
<span style="font-size:14pt;"><span>      </span>var v_length = VALUE.length;</span>
<span style="font-size:14pt;"><span>      </span>var strTemp = "";</span>
<span style="font-size:14pt;"><span>      </span>if(v_length &lt; 0)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>return"";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>var iTemp = v_length -1;</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>while(iTemp &gt; -1)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if(VALUE.charAt(iTemp) == w_space)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>           </span>else</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>strTemp = VALUE.substring(0,iTemp +1);</span>
<span style="font-size:14pt;"><span>                 </span>break;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>           </span>iTemp = iTemp-1;</span>
<span style="font-size:14pt;"><span>      </span>} //End While</span>
<span style="font-size:14pt;"><span>      </span>return strTemp;</span>
<span style="font-size:14pt;">} //End Function</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function LTrim(VALUE)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var w_space = String.fromCharCode(32);</span>
<span style="font-size:14pt;"><span>      </span>if(v_length &lt; 1)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>return"";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>var v_length = VALUE.length;</span>
<span style="font-size:14pt;"><span>      </span>var strTemp = "";</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>var iTemp = 0;</span>
<span style="font-size:14pt;"><span>      </span>while(iTemp &lt; v_length)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if(VALUE.charAt(iTemp) == w_space)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>           </span>else</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>strTemp = VALUE.substring(iTemp,v_length);</span>
<span style="font-size:14pt;"><span>                 </span>break;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>           </span>iTemp = iTemp + 1;</span>
<span style="font-size:14pt;"><span>      </span>} //End While</span>
<span style="font-size:14pt;"><span>      </span>return strTemp;</span>
<span style="font-size:14pt;">} //End Function</span>
<span style="font-size:14pt;">function checkspecialcharacter(str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var iChars = "!@#$%^&amp;*()+=[]\\\';,./{}|\":&lt;&gt;? ";</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 0; i &lt; str.length; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if (iChars.indexOf(str.charAt(i)) != -1)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>return false;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function checkspecialcharfirstname(str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var iChars = "!@#$%^&amp;*()+=[]\\;,./{}|\":&lt;&gt;?";</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 0; i &lt; str.length; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if (iChars.indexOf(str.charAt(i)) != -1)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>return false;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function checkspecialcharacterforname(str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var iChars = "!@#$%^&amp;*()+=[]\\;/{}|\":&lt;&gt;?";</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 0; i &lt; str.length; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if (iChars.indexOf(str.charAt(i)) != -1)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>return false;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function checknumericcharacterforname(str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var iChars = "0123456789";</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 0; i &lt; str.length; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if (iChars.indexOf(str.charAt(i)) != -1)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>return false;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function checkspecialcharacterforaddress(str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var iChars = "!@#$%^&amp;*()+=[]\\\;./{}|\":&lt;&gt;?";</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 0; i &lt; str.length; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if (iChars.indexOf(str.charAt(i)) != -1)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>return false;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function checkspecialcharacterfortitle(str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var iChars = "!@#$%^&amp;*()+=[]\\\;./{}|\"&lt;&gt;?";</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 0; i &lt; str.length; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if (iChars.indexOf(str.charAt(i)) != -1)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>return false;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function checkspecialcharacterfordesc(str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var iChars = "";</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 0; i &lt; str.length; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if (iChars.indexOf(str.charAt(i)) != -1)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>return false;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function checkspecialcharacterforimage(str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var iChars = "!@#$%^&amp;*()+=[]\';,/{}|\"&lt;&gt;?";</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 0; i &lt; str.length; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if (iChars.indexOf(str.charAt(i)) != -1)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>return false;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function checkspecialcharacterforUsername(str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var iChars = "!@^()+=[]\';,/{}|\"&lt;&gt;?";</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 0; i &lt; str.length; i++)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if (iChars.indexOf(str.charAt(i)) != -1)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>           </span><span>      </span>return false;</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function isEmailAddr(email)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var result = false</span>
<span style="font-size:14pt;"><span>  </span><span>    </span>var theStr = new String(email)</span>
<span style="font-size:14pt;"><span>  </span><span>    </span>var index = theStr.indexOf("@");</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"> <span>     </span>if (index &gt; 0)</span>
<span style="font-size:14pt;"><span>  </span><span>    </span>{</span>
<span style="font-size:14pt;"><span>    </span><span>  </span>var pindex = theStr.indexOf(".",index);</span>
<span style="font-size:14pt;"><span>    </span><span>  </span>if ((pindex &gt; index+1) &amp;&amp; (theStr.length &gt; pindex+1))</span>
<span style="font-size:14pt;"><span>           </span>result = true;</span>
<span style="font-size:14pt;"> <span>     </span>}</span>
<span style="font-size:14pt;"><span>  </span>return result;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function CheckEmail(Email)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>//var match = (/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/i);</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>var match = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9_-]+\.)+[a-zA-Z0-9.-]{2,5}$/;</span>
<span style="font-size:14pt;"><span>      </span>if(match.test(Email)){return true}</span>
<span style="font-size:14pt;"><span>      </span>else</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>return false</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function emailfield(email)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(!CheckEmail(email))</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter a complete email address in the form: yourname@yourdomain.com!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(email)=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Email can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function namefield(name)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(checkspecialcharacterforname(name)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Name can not contain special character!"; //document.getElementById("divname").innerHTML</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(name)=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Name can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(checknumericcharacterforname(name)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Name can not contain numeric character!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function fnamefield(name)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(checkspecialcharacterforname(name)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="First name can not contain special character!"; //document.getElementById("divname").innerHTML</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(name)=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="First name can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(checknumericcharacterforname(name)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="First name can not contain numeric character!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function lnamefield(name)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(checkspecialcharacterforname(name)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Last name<span>  </span>can not contain special character!"; //document.getElementById("divname").innerHTML</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(name)=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Last name can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(checknumericcharacterforname(name)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Last name can not contain numeric character!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function usernamefield(name)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(checkspecialcharacterforUsername(name)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Username can not contain special character!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(name)=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Username can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(name.length &lt; 5 )</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter username in 5 character!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function passwordfield(password, confirmpassword)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(checkspecialcharacterforUsername(password)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Password can not contain special character!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(password)=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Password can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(password.length &lt; 5 )</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter password in 5 character!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(password!=confirmpassword)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Your confirm password is not matched!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function titledfield(name,str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(checkspecialcharacterfortitle(name)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg=str + " can not contain special character!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(name)=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg=str + " can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function titledfield2(name,str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(checkspecialcharacterfortitle(name)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg=str + " can not contain special character!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(name)=="1234567654")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg=str + " can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function addressfield(name)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(checkspecialcharacterforaddress(name)==false)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Address can not contain special character!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(name)=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Address can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function validateFileExtension(fvalue)</span>
<span style="font-size:14pt;"> {</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(fvalue!="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if(!/(\.jpg|\.jpeg\.JPG|\.JPEG)$/i.test(fvalue))</span>
<span style="font-size:14pt;"><span>           </span> {</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>                 </span>msg="Please select a JPG file";</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function logofilefield(name)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if(name!="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if (name.toUpperCase().indexOf(".JPG") &lt; 0 &amp;&amp; name.toUpperCase().indexOf(".JPEG") &lt; 0)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>msg="Please select a JPG file";</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function phonefield(phone, str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>var temp=phone;</span>
<span style="font-size:14pt;"><span>      </span>var stripped = temp.replace(/[\(\)\.\-\ ]/g, '');</span>
<span style="font-size:14pt;"><span>      </span>if (phone== "") {</span>
<span style="font-size:14pt;"><span>        </span>msg=str + " can not be blank!";</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if (!IsNumeric(stripped)) {</span>
<span style="font-size:14pt;"><span>        </span>msg=str + " can contain only hyphen and digits!";</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(phone)=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span> msg=str + " can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if((phone.length &lt; 11 ) || (phone.length &gt; 11 ))</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter " + str + " Number in 11 digits!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function blankfieldnotcompulsory(name,str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if (name!= "")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>if(checkspecialcharacterfortitle(name)==false)</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>msg=str + " can not contain special character!";</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>           </span>else if(Trim(name)=="")</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>msg=str + " can not be blank!";</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function phonefieldnotcompulsory(phone, str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>var temp=phone;</span>
<span style="font-size:14pt;"><span>      </span>var stripped = temp.replace(/[\(\)\.\-\ ]/g, '');</span>
<span style="font-size:14pt;"><span>      </span>if (phone!= "")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>      </span>//<span>  </span>msg=str + " can not be blank!";</span>
<span style="font-size:14pt;"><span>           </span>if (!IsNumeric(stripped)) {</span>
<span style="font-size:14pt;"><span>                 </span>msg=str + " can contain only hyphen and digits!";</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>           </span>else if(Trim(phone)=="")</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span> msg=str + " can not be blank!";</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>      </span> }</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function zipfield(zip, str)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>var temp=zip;</span>
<span style="font-size:14pt;"><span>      </span>var stripped = temp.replace(/[\(\)\.\-\ ]/g, '');</span>
<span style="font-size:14pt;"><span>  </span><span>    </span>if (zip== "") {</span>
<span style="font-size:14pt;"><span>        </span>msg=str + " can not be blank!";</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if (!IsZip(stripped)) {</span>
<span style="font-size:14pt;"><span>        </span>msg=str + " can not contain special charaters !";</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>      </span>else if(Trim(zip)=="")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span> msg=str + " can not be blank!";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>/*else if(zip.length&gt;6)</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span> msg=str + " no can contain only 6 digits!";</span>
<span style="font-size:14pt;"><span>      </span>}*/</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function isWebSite(website)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var result = false</span>
<span style="font-size:14pt;"><span>  </span><span>    </span>var theStr = new String(website)</span>
<span style="font-size:14pt;"><span>  </span><span>    </span>var index = theStr.indexOf(".");</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>if (index &gt; 0)</span>
<span style="font-size:14pt;"><span>  </span><span>    </span>{</span>
<span style="font-size:14pt;"><span>    </span><span>  </span>pin=theStr.length;</span>
<span style="font-size:14pt;"><span>           </span>if (pin &gt; index+4){ result = true; }</span>
<span style="font-size:14pt;"> <span>     </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>  </span>return result;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function websitefield(website)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if (website== "") {</span>
<span style="font-size:14pt;"><span>        </span>msg="Website can not be blank!";</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function websitefieldnotcompulsary(website)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if (website!= "")</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>        </span>if (!isWebSite(website))</span>
<span style="font-size:14pt;"><span>           </span>{</span>
<span style="font-size:14pt;"><span>                 </span>msg="Invalid Website address ! ";</span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function tocheckblankfield(str, field)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if (str=="") {</span>
<span style="font-size:14pt;"><span>        </span>msg=field + " can not be blank!";</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function tocheckblankselection(str, field)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if (str=="") {</span>
<span style="font-size:14pt;"><span>        </span>msg=field + " can not be blank!";</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function tocheckblankselectionv(str, field)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if (str=="v") {</span>
<span style="font-size:14pt;"><span>        </span>msg=field + " can not be Please Select Option!";</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function descriptionfield(website)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if (website== "") {</span>
<span style="font-size:14pt;"><span>        </span>msg="Description can not be blank!";</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function tocheckfiletype(filetype,file)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>var temp=filetype.toUpperCase();</span>
<span style="font-size:14pt;"><span>      </span>var temp1=file.toUpperCase();</span>
<span style="font-size:14pt;"><span>      </span>if ((temp1.indexOf(temp)) &lt; 0 )</span>
<span style="font-size:14pt;"><span>      </span>{</span>
<span style="font-size:14pt;"><span>           </span>msg="Please select " + filetype + " file";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function validateFiledocExtension(fvalue)</span>
<span style="font-size:14pt;"> {</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>           </span>if(!/(\.DOC|\.doc\.Doc)$/i.test(fvalue))</span>
<span style="font-size:14pt;"><span>           </span> {</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>                 </span>msg="Please select a Doc extension file";</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>           </span>}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;"><span>      </span>return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">/**</span>
<span style="font-size:14pt;"> * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)</span>
<span style="font-size:14pt;"> */</span>
<span style="font-size:14pt;">// Declaring valid date character, minimum year and maximum year</span>
<span style="font-size:14pt;">var dtCh= "-";</span>
<span style="font-size:14pt;">var minYear=1900;</span>
<span style="font-size:14pt;">var maxYear=2100;</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function isInteger(s){</span>
<span style="font-size:14pt;"><span>      </span>var i;</span>
<span style="font-size:14pt;"><span>    </span>for (i = 0; i &lt; s.length; i++){</span>
<span style="font-size:14pt;"><span>        </span>// Check that current character is number.</span>
<span style="font-size:14pt;"><span>        </span>var c = s.charAt(i);</span>
<span style="font-size:14pt;"><span>        </span>if (((c &lt; "0") || (c &gt; "9"))) return false;</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>    </span>// All characters are numbers.</span>
<span style="font-size:14pt;"><span>    </span>return true;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function stripCharsInBag(s, bag){</span>
<span style="font-size:14pt;"><span>      </span>var i;</span>
<span style="font-size:14pt;"><span>    </span>var returnString = "";</span>
<span style="font-size:14pt;"><span>    </span>// Search through string's characters one by one.</span>
<span style="font-size:14pt;"><span>    </span>// If character is not in bag, append to returnString.</span>
<span style="font-size:14pt;"><span>    </span>for (i = 0; i &lt; s.length; i++){</span>
<span style="font-size:14pt;"><span>        </span>var c = s.charAt(i);</span>
<span style="font-size:14pt;"><span>        </span>if (bag.indexOf(c) == -1) returnString += c;</span>
<span style="font-size:14pt;"><span>    </span>}</span>
<span style="font-size:14pt;"><span>    </span>return returnString;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function daysInFebruary (year){</span>
<span style="font-size:14pt;"><span>      </span>// February has 29 days in any year evenly divisible by four,</span>
<span style="font-size:14pt;"><span>    </span>// EXCEPT for centurial years which are not also divisible by 400.</span>
<span style="font-size:14pt;"><span>    </span>return (((year % 4 == 0) &amp;&amp; ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function DaysArray(n) {</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 1; i &lt;= n; i++) {</span>
<span style="font-size:14pt;"><span>           </span>this[i] = 31</span>
<span style="font-size:14pt;"><span>           </span>if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}</span>
<span style="font-size:14pt;"><span>           </span>if (i==2) {this[i] = 29}</span>
<span style="font-size:14pt;"><span>   </span>}</span>
<span style="font-size:14pt;"><span>   </span>return this</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function isDate(dtStr){</span>
<span style="font-size:14pt;"><span>      </span>dtStr=Trim(dtStr);</span>
<span style="font-size:14pt;"><span>      </span>var daysInMonth = DaysArray(12)</span>
<span style="font-size:14pt;"><span>      </span>var pos1=dtStr.indexOf(dtCh)</span>
<span style="font-size:14pt;"><span>      </span>var pos2=dtStr.indexOf(dtCh,pos1+1)</span>
<span style="font-size:14pt;"><span>      </span>var strYear=dtStr.substring(0,pos1)</span>
<span style="font-size:14pt;"><span>      </span>var strMonth=dtStr.substring(pos1+1,pos2)</span>
<span style="font-size:14pt;"><span>      </span>var strDay=dtStr.substring(pos2+1)</span>
<span style="font-size:14pt;"><span>      </span>strYr=strYear</span>
<span style="font-size:14pt;"><span>      </span>if (strDay.charAt(0)=="0" &amp;&amp; strDay.length&gt;1) strDay=strDay.substring(1)</span>
<span style="font-size:14pt;"><span>      </span>if (strMonth.charAt(0)=="0" &amp;&amp; strMonth.length&gt;1) strMonth=strMonth.substring(1)</span>
<span style="font-size:14pt;"><span>      </span>for (var i = 1; i &lt;= 3; i++) {</span>
<span style="font-size:14pt;"><span>           </span>if (strYr.charAt(0)=="0" &amp;&amp; strYr.length&gt;1) strYr=strYr.substring(1)</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>month=parseInt(strMonth);</span>
<span style="font-size:14pt;"><span>      </span>day=parseInt(strDay);</span>
<span style="font-size:14pt;"><span>      </span>year=parseInt(strYr);</span>
<span style="font-size:14pt;"><span>      </span>var msg="";</span>
<span style="font-size:14pt;"><span>      </span>if (pos1==-1 || pos2==-1){</span>
<span style="font-size:14pt;"><span>           </span>msg="The date format should be : mm/dd/yyyy";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>if (strMonth.length&lt;1 || month&lt;1 || month&gt;12){</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter a valid month";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>if (strDay.length&lt;1 || day&lt;1 || day&gt;31 || (month==2 &amp;&amp; day&gt;daysInFebruary(year)) || day &gt; daysInMonth[month]){</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter a valid day";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>if (strYear.length != 4 || year==0 || year&lt;minYear || year&gt;maxYear){</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter a valid 4 digit year between "+ minYear +" and "+ maxYear;</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){</span>
<span style="font-size:14pt;"><span>           </span>msg="Please enter a valid date";</span>
<span style="font-size:14pt;"><span>      </span>}</span>
<span style="font-size:14pt;"><span>      </span>return msg</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function expfield(workexpx, workexpy)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;">var msg="";</span>
<span style="font-size:14pt;">//alert(workexpx);</span>
<span style="font-size:14pt;">//alert(workexpy);</span>
<span style="font-size:14pt;">if(parseInt(workexpx) &gt; parseInt(workexpy))</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;">msg="Please correct the minimum and maximum experiance value!";</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">function validateFiledocExtensionnotcompulsory(fvalue)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;">var msg="";</span>
<span style="font-size:14pt;">if(fvalue!="")</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;">if(!/(\.DOC|\.doc\.Doc)$/i.test(fvalue))</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">msg="Please select a word file(.doc extension)";</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">return msg;</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">function validateDOB(d,m,y){</span>
<span style="font-size:14pt;">var error = false;</span>
<span style="font-size:14pt;">//alert(d + '--' + m + '--' + y);</span>
<span style="font-size:14pt;">if (d == "" &amp;&amp; m == "" &amp;&amp; y == "") error = 'Date of birth can not be blank';</span>
<span style="font-size:14pt;">else if(d == "") error = 'Date can not be blank';</span>
<span style="font-size:14pt;">else if(m == "") error = 'Month can not be blank';</span>
<span style="font-size:14pt;">else if(y == "") error = 'Year can not be blank';</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">// Check for valid date</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">if(d &gt; 28 &amp;&amp; y != "")</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;">if(m == 02)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;">febdays = daysInFebruary(y);</span>
<span style="font-size:14pt;">//if (parseInt(febdays) &lt; 29)</span>
<span style="font-size:14pt;">if (d &gt; parseInt(febdays) )</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;">error = "invalid Date Of Birth";</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">else</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;">if(d &gt; 30)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;">if (m==4 || m==6 || m==9 || m==11)</span>
<span style="font-size:14pt;">{</span>
<span style="font-size:14pt;">error = "invalid Date Of Birth";</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;">}</span>
<span style="font-size:14pt;"> </span>
<span style="font-size:14pt;">return error;</span>
<span style="font-size:14pt;">}</span></pre>
<p class="MsoNormal"><span style="font-size:14pt;"> </span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekwin.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekwin.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekwin.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekwin.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekwin.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekwin.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekwin.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekwin.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekwin.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekwin.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekwin.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekwin.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekwin.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekwin.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekwin.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekwin.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=19&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekwin.wordpress.com/2008/07/24/all-type-of-javascript-validation-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e079a4593ca3302d9debe92e3f1af016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekwin</media:title>
		</media:content>
	</item>
		<item>
		<title>The Validation on .Net , C#</title>
		<link>http://vivekwin.wordpress.com/2008/07/24/the-validation-on-net-c/</link>
		<comments>http://vivekwin.wordpress.com/2008/07/24/the-validation-on-net-c/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 13:15:14 +0000</pubDate>
		<dc:creator>vivekwin</dc:creator>
				<category><![CDATA[Student]]></category>
		<category><![CDATA[ASP.Net Server side validation]]></category>

		<guid isPermaLink="false">http://vivekwin.wordpress.com/?p=16</guid>
		<description><![CDATA[Make this script according to your need in code this is server side script which use in ASP.Net server side validation Email validation &#60;asp:RegularExpressionValidator runat=&#8221;server&#8221; ID=&#8221;rev_email&#8221; ControlToValidate=&#8221;txt_email&#8221; ErrorMessage=&#8221;your entry is not a valid email address&#8221; ValidationExpression=&#8221;.*@.*\..*&#8221;&#62; &#60;/asp:RegularExpressionValidator&#62; &#60;asp:RequiredFieldValidator runat=&#8221;server&#8221; ID=&#8221;rfv_email&#8221; ControlToValidate=&#8221;txt_email&#8221; ErrorMessage=&#8221;please enter your email address&#8221;&#62;&#60;/asp:RequiredFieldValidator&#62; &#60;asp:TextBox ID=&#8221;txt_email&#8221; runat=&#8221;server&#8221;&#62;&#60;/asp:TextBox&#62; &#60;asp:RegularExpressionValidator ID=&#8221;regExEmail&#8221; runat=&#8221;server&#8221; ControlToValidate=&#8221;txtEmail&#8221; Display=&#8221;Dynamic&#8221; ErrorMessage=&#8221;Please [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=16&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Make this script according to your need in code this is server side script which use in ASP.Net server side validation</p>
<p class="MsoNormal"><strong><span style="text-decoration:underline;"><span style="font-size:10pt;font-family:&quot;color:black;">Email validation </span></span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:10pt;font-family:&quot;color:maroon;">asp</span><span style="font-size:10pt;font-family:&quot;color:blue;">:</span><span style="font-size:10pt;font-family:&quot;color:maroon;">RegularExpressionValidator</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;rev_email&#8221;</span> <span style="color:red;">ControlToValidate</span><span style="color:blue;">=&#8221;txt_email&#8221;</span> <span style="color:red;">ErrorMessage</span><span style="color:blue;">=&#8221;your entry is not a valid email address&#8221;</span> <span style="color:red;">ValidationExpression</span><span style="color:blue;">=&#8221;.*@.*\..*&#8221;&gt;</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:10pt;font-family:&quot;color:maroon;">asp</span><span style="font-size:10pt;font-family:&quot;color:blue;">:</span><span style="font-size:10pt;font-family:&quot;color:maroon;">RegularExpressionValidator</span><span style="font-size:10pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:10pt;font-family:&quot;color:maroon;">asp</span><span style="font-size:10pt;font-family:&quot;color:blue;">:</span><span style="font-size:10pt;font-family:&quot;color:maroon;">RequiredFieldValidator</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;rfv_email&#8221;</span> <span style="color:red;">ControlToValidate</span><span style="color:blue;">=&#8221;txt_email&#8221;</span> <span style="color:red;">ErrorMessage</span><span style="color:blue;">=&#8221;please enter your email address&#8221;&gt;&lt;/</span><span style="color:maroon;">asp</span><span style="color:blue;">:</span><span style="color:maroon;">RequiredFieldValidator</span><span style="color:blue;">&gt;</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:10pt;font-family:&quot;color:maroon;">asp</span><span style="font-size:10pt;font-family:&quot;color:blue;">:</span><span style="font-size:10pt;font-family:&quot;color:maroon;">TextBox</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;txt_email&#8221;</span> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;&gt;&lt;/</span><span style="color:maroon;">asp</span><span style="color:blue;">:</span><span style="color:maroon;">TextBox</span><span style="color:blue;">&gt;</span></span><span style="font-size:10pt;font-family:Arial;"></span></p>
<p class="MsoNormal">
<p class="MsoNormal">&lt;asp:RegularExpressionValidator<span> </span>ID=&#8221;regExEmail&#8221; runat=&#8221;server&#8221; ControlToValidate=&#8221;txtEmail&#8221; Display=&#8221;Dynamic&#8221; ErrorMessage=&#8221;Please enter a valid Email Address&#8221; ValidationExpression=&#8221;\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*&#8221;&gt;</p>
<p class="MsoNormal">&lt;/asp:RegularExpressionValidator&gt;</p>
<p class="MsoNormal">
<p class="MsoNormal"><strong><span style="text-decoration:underline;">Blank validation </span></strong></p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:10pt;font-family:&quot;color:maroon;">asp</span><span style="font-size:10pt;font-family:&quot;color:blue;">:</span><span style="font-size:10pt;font-family:&quot;color:maroon;">RequiredFieldValidator</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:red;">id</span><span style="color:blue;">=&#8221;rfv_region_name&#8221;</span> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <span style="color:red;">ErrorMessage</span><span style="color:blue;">=&#8221;Must be select region name&#8221; </span><span style="color:red;">ControlToValidate</span><span style="color:blue;">=&#8221;ddl_region&#8221;&gt;</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:10pt;font-family:&quot;color:maroon;">asp</span><span style="font-size:10pt;font-family:&quot;color:blue;">:</span><span style="font-size:10pt;font-family:&quot;color:maroon;">RequiredFieldValidator</span><span style="font-size:10pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><strong><span style="text-decoration:underline;">Website validation </span></strong></p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:10pt;font-family:&quot;color:maroon;">asp</span><span style="font-size:10pt;font-family:&quot;color:blue;">:</span><span style="font-size:10pt;font-family:&quot;color:maroon;">RegularExpressionValidator</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;reg_website&#8221;</span> <span style="color:red;">ControlToValidate</span><span style="color:blue;">=&#8221;txt_website&#8221;</span> <span style="color:red;">ValidationExpression</span><span style="color:blue;">=&#8221;http://([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?&#8221;</span> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <span style="color:red;">ErrorMessage</span><span style="color:blue;">=&#8221;Invalid URL&#8221;&gt;</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:10pt;font-family:&quot;color:maroon;">asp</span><span style="font-size:10pt;font-family:&quot;color:blue;">:</span><span style="font-size:10pt;font-family:&quot;color:maroon;">RegularExpressionValidator</span><span style="font-size:10pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;color:blue;"> </span></p>
<p class="MsoNormal"><strong><span style="text-decoration:underline;"><span style="font-size:10pt;color:black;">File Uloading validation </span></span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;color:blue;"> </span></p>
<p class="MsoNormal">&lt;asp:RegularExpressionValidator<span> </span>id=&#8221;RegularExpressionValidator1&#8243; runat=&#8221;server&#8221;<br />
ErrorMessage=&#8221;Only zip file is allowed!&#8221; ValidationExpression =&#8221;^.+(.zip|.ZIP)$&#8221;<br />
ControlToValidate=&#8221;FileUpload1&#8243;&gt;</p>
<p class="MsoNormal">&lt;/asp:RegularExpressionValidator&gt;</p>
<p class="MsoNormal">
<p class="MsoNormal"><strong><span style="text-decoration:underline;">Phone Number </span></strong></p>
<p class="MsoNormal">
<p class="MsoNormal">&lt;asp:RegularExpressionValidator <span> </span>ID=&#8221;regExTelephone&#8221; runat=&#8221;server&#8221; ControlToValidate=&#8221;txtTelNumber&#8221; Display=&#8221;Dynamic&#8221; ErrorMessage=&#8221;Please enter a valid Telephone Number&#8221; ValidationExpression=&#8221;^(\()?(011|012)(\)|-)?([0-9]{3})?([0-9]{4}|[0-9]{4})$&#8221;&gt;</p>
<p class="MsoNormal">&lt;/asp:RegularExpressionValidator&gt;</p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><strong><span style="text-decoration:underline;">Numeric value :</span></strong></p>
<p class="MsoNormal"><strong><span style="text-decoration:underline;"><span style="text-decoration:none;"> </span></span></strong></p>
<p class="MsoNormal">&lt;asp:RegularExpressionValidator <span> </span>ID=&#8221;regExTelephone&#8221; runat=&#8221;server&#8221; ControlToValidate=&#8221;txtTelNumber&#8221; Display=&#8221;Dynamic&#8221; ErrorMessage=&#8221;Please enter a valid Telephone Number&#8221; ValidationExpression=&#8221;^[0-9]$&#8221;&gt; &lt;/asp:RegularExpressionValidator&gt;</p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><strong><span style="text-decoration:underline;">Radio field validation</span></strong></p>
<p class="MsoNormal"><strong><span style="text-decoration:underline;"><span style="text-decoration:none;"> </span></span></strong></p>
<p class="MsoNormal">&lt;asp:RequiredFieldValidator ID=&#8221;RequiredFieldValidator2&#8243; runat=&#8221;server&#8221; ControlToValidate=&#8221;Gender&#8221; Display=&#8221;Dynamic&#8221; EnableViewState=&#8221;False&#8221; ErrorMessage=&#8221;Please select one of the &#8216;Gender&#8217; options&#8221;&gt; &lt;/asp:RequiredFieldValidator&gt;</p>
<p class="MsoNormal">
<p class="MsoNormal">&lt;asp:RadioButtonList runat=&#8221;server&#8221; ID=&#8221;Gender&#8221; Font-Size=&#8221;91%&#8221;&gt;</p>
<p class="MsoNormal">&lt;asp:ListItem Value=&#8221;Female&#8221; Text=&#8221;Female&#8221;&gt;&lt;/asp:ListItem&gt;</p>
<p class="MsoNormal">&lt;asp:ListItem Value=&#8221;Male&#8221; Text=&#8221;Male&#8221;&gt;&lt;/asp:ListItem&gt;</p>
<p class="MsoNormal">&lt;/asp:RadioButtonList&gt;</p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal">If You wand client side validation use java script function .</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekwin.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekwin.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekwin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekwin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekwin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekwin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekwin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekwin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekwin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekwin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekwin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekwin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekwin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekwin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekwin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekwin.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=16&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekwin.wordpress.com/2008/07/24/the-validation-on-net-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e079a4593ca3302d9debe92e3f1af016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekwin</media:title>
		</media:content>
	</item>
		<item>
		<title>Inheritance In Php</title>
		<link>http://vivekwin.wordpress.com/2008/03/09/inheritance-in-php/</link>
		<comments>http://vivekwin.wordpress.com/2008/03/09/inheritance-in-php/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 05:43:37 +0000</pubDate>
		<dc:creator>vivekwin</dc:creator>
				<category><![CDATA[Student]]></category>

		<guid isPermaLink="false">http://vivekwin.wordpress.com/2008/03/09/inheritance-in-php/</guid>
		<description><![CDATA[The include() Function PHP gives you the ability to &#8220;hide&#8221; code. This is particularly helpful when creating large web environments with numerous pages that require a lot of maintenance. Think of hiding in terms of an HTML template — with an HTML template, you can guarantee uniformity across large numbers of pages as well as [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=4&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin-left:0.1in;"><b><span style="font-size:10pt;font-family:Verdana;color:#ff6600;"> The include() Function </span></b></p>
<div class="MsoNormal" style="margin-left:0.1in;text-align:center;" align="center">
<hr align="center" size="1" width="100%" /></div>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">PHP gives you the ability to &#8220;hide&#8221; code. This is particularly helpful when creating large web environments with numerous pages that require a lot of maintenance. Think of hiding in terms of an HTML template — with an HTML template, you can guarantee uniformity across large numbers of pages as well as save coding time and effort by eliminating redundancy. By hiding code with PHP, you can feed the equivalent of a template to any given page simply by using the </span><code><span style="font-size:10pt;">include()</span></code><span style="font-size:10pt;font-family:Verdana;"> function. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">For instance, if you have a standard heading for all pages on a site you can create a document named </span><code><span style="font-size:10pt;">header.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> like the following: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">&lt;?php</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>echo '&lt;html&gt;';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>echo '&lt;title&gt;Bob's&lt;/title&gt;';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>echo '&lt;body&gt;';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>echo 'Bob's Towing Yard &lt;img src="bobs_logo.jpg"&gt;';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">?&gt;</span></pre>
<p style="margin:0 0 5pt 0.1in;"><code><span style="font-size:10pt;font-family:Verdana;">header.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> sets the title of the page to &#8220;Bob&#8217;s&#8221; and begins the body content of the page with &#8220;Bob&#8217;s Towing Yard&#8221; and Bob&#8217;s logo (bobs_logo.jpg). You then include this code by calling the function </span><code><span style="font-size:10pt;">include()</span></code><span style="font-size:10pt;font-family:Verdana;"> in the appropriate section of your PHP page. We&#8217;ll call the page </span><code><span style="font-size:10pt;">index.php</span></code><span style="font-size:10pt;font-family:Verdana;">: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">&lt;?php</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>include(header.inc);</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">?&gt;</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">After you call the </span><code><span style="font-size:10pt;">include()</span></code><span style="font-size:10pt;font-family:Verdana;"> function you can add any unique content you desire. <i><span style="font-family:Verdana;">Viola</span></i>, you have header uniformity across any page that includes </span><code><span style="font-size:10pt;">header.inc</span></code><span style="font-size:10pt;font-family:Verdana;">. Of course, it isn&#8217;t a stretch to see that this can also be applied to uniform sections such as the footer of a web page, navigation menus, side panels, etc. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">This immediately makes each page a 6-10 line project instead of a 20-40 line project. Once you have the included elements all dialed in, the only part of a web page you have to update is the content that is unique to the situation. In addition, if you need to change something miniscule, like Bob&#8217;s logo, or even the name Bob, the only place you have to make the change is in </span><code><span style="font-size:10pt;">header.inc</span></code><span style="font-size:10pt;font-family:Verdana;">. All of the pages using </span><code><span style="font-size:10pt;">header.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> will be automatically updated. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Note: It bears mentioning that the extension </span><code><span style="font-size:10pt;">.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> is primarily used to differentiate include files from </span><code><span style="font-size:10pt;">.php</span></code><span style="font-size:10pt;font-family:Verdana;"> files. When looking at a directory of files it can be a bit daunting to pick out which files are merely include files and which are valid PHP pages. There is a difference in how browsers read these files however, and that difference should be kept in mind when creating a webpage. </span><code><span style="font-size:10pt;">.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> files are treated as plain text and are therefore sent through the browser as plain text. If you view source on a page using </span><code><span style="font-size:10pt;">.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> files, you will see the contents of these files. If the information contained in the </span><code><span style="font-size:10pt;">.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> file is sensitive (i.e. passwords, personal information) it is best to use the </span><code><span style="font-size:10pt;">.php</span></code><span style="font-size:10pt;font-family:Verdana;"> extension so that the information is not readily available. You can also save </span><code><span style="font-size:10pt;">.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> files outside of the directory, but I have always preferred to keep information that I want to be invisible under the </span><code><span style="font-size:10pt;">.php</span></code><span style="font-size:10pt;font-family:Verdana;"> extension. Files using the </span><code><span style="font-size:10pt;">.php</span></code><span style="font-size:10pt;font-family:Verdana;"> extension are treated exactly the same when called by the </span><code><span style="font-size:10pt;">include()</span></code><span style="font-size:10pt;font-family:Verdana;"> function: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">include(header.inc)</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;"><span style="font-size:10pt;font-family:Verdana;">and </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">include('header.php')</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;"><span style="font-size:10pt;font-family:Verdana;">will give you the same results. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">If you are using an <a href="http://www.phpbuilder.com/annotate/message.php3?id=1002577" target="_blank"><span style="font-size:12pt;">Apache server</span></a>, you can also manipulate the server configuration so that a user may not access </span><code><span style="font-size:10pt;">.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> files. </span></p>
<p class="MsoNormal" style="margin-left:0.1in;"><b><span style="font-size:10pt;font-family:Verdana;color:#ff6600;">Classes in Session </span></b></p>
<div class="MsoNormal" style="margin-left:0.1in;text-align:center;" align="center">
<hr align="center" size="1" width="100%" /></div>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Now we know that we can feed whatever redundant elements we like into any number of pages by simply invoking a single function, let&#8217;s take it a step further and introduce classes. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Classes start using the Object-Oriented Programming (OOP) methodology in PHP (OOP is only available in PHP versions 4.0 and later). Briefly, OOP uses objects, which are unique and identifiable collections of stored data and operations that operate on that data. These objects are not unlike real-life objects, such as a chair, or a table. An object can also be a navigation menu, a button, a text field or a style sheet. Objects can further be grouped into classes. Classes are collections of objects that share certain criteria but may vary from object to object. For example, using horses as a class, certain criteria are necessary for an object to be classified as a horse: four legs, hooves, mane. However, many aspects of these criteria can have different values: black mane, brown mane, white mane, and so on. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">This is the basic structure of a class: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class classname</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">To create a class in PHP, we begin with the keyword class, and the classname will follow. Next we will create attributes and operations for our class and place them between the brackets. Attributes are declared as follows: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class classname</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>var $attribute1;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>var $attribute2;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;"><span style="font-size:10pt;font-family:Verdana;">Operations are created by declaring functions within the class definition: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class classname</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function operation1()</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function operation2($param1, $param2)</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">The function </span><code><span style="font-size:10pt;">operation1</span></code><span style="font-size:10pt;font-family:Verdana;"> takes no parameters, while </span><code><span style="font-size:10pt;">operation2</span></code><span style="font-size:10pt;font-family:Verdana;"> takes two parameters (</span><code><span style="font-size:10pt;">param1</span></code><span style="font-size:10pt;font-family:Verdana;">, </span><code><span style="font-size:10pt;">param2</span></code><span style="font-size:10pt;font-family:Verdana;">). </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Most classes will have a special operation called a constructor. A constructor is called as soon as an object is created and serves the purpose of setting reasonable values for attributes or creating other objects needed by the parent object. A constructor is called in the same way a class is called, but it shares the name of the class. A constructor can be called manually, but its main purpose is to be called automatically when an object is created. This is the structure of a class that uses a constructor: </span></p>
<p><span style="font-size:10pt;font-family:Verdana;"><br />
</span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class classname</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function classname($param)</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>      </span>echo "The Constructor will be called with the</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>            </span>parameter $param";</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Now that we have declared a class, we need to create an object that belongs to that class. This is also called instantiation, creating an instance of the class. So we&#8217;ll declare a class, give it a constructor, and then create two objects. The object is created using the keyword new: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class classname</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function classname($param)</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>      </span>echo "The Constructor will be called with the</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>      </span>parameter $param";</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$x = new classname('Ego');</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$y = new classname('Sum');</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Our constructor is called by both objects, so the output will look like this: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">The Constructor will be called with the parameter Ego</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">The Constructor will be called with the parameter Sum</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;">&nbsp;</p>
<p class="MsoNormal" style="margin-left:0.1in;">&nbsp;</p>
<p><b><span style="font-size:10pt;font-family:Verdana;color:#ff6600;"><br />
</span></b></p>
<p class="MsoNormal" style="margin-left:0.1in;"><b><span style="font-size:10pt;font-family:Verdana;color:#ff6600;"> Attributes and Operations </span></b></p>
<div class="MsoNormal" style="margin-left:0.1in;text-align:center;" align="center">
<hr align="center" size="1" width="100%" /></div>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Earlier, when we discussed the nature of objects we compared them to horses. In order to qualify as a &#8220;horse&#8221; an object must meet certain criteria such as four legs, hooves, mane. These are our object&#8217;s attributes. Without these atributes nothing will differentiate a &#8220;horse&#8221; from a &#8220;lizard&#8221;. Thank you Captain Obvious, no one will ever mistake a horse for a lizard! That is true, but it&#8217;s very easy to mix up a &#8220;home&#8221; button that takes a user to </span><code><span style="font-size:10pt;">index.php</span></code><span style="font-size:10pt;font-family:Verdana;"> and a &#8220;home&#8221; button that takes them to </span><code><span style="font-size:10pt;">my_personal_index.php</span></code><span style="font-size:10pt;font-family:Verdana;">. While both buttons may look identical to the user, their individual purposes are quite different, and thus their individual attributes make all the difference in the world. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Variables allow us to keep elements our of code dynamic by replacing static values with values that change according to user intervention. Attributes are no different, and as such can be written to change fluidly as the user interacts with the page. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Within a class, you have access to a special variable called </span><code><span style="font-size:10pt;">$this</span></code><span style="font-size:10pt;font-family:Verdana;">. If you have an attribute called </span><code><span style="font-size:10pt;">$decide</span></code><span style="font-size:10pt;font-family:Verdana;">, you refer to it as </span><code><span style="font-size:10pt;">$this-&gt;decide</span></code><span style="font-size:10pt;font-family:Verdana;"> when you are setting the attribute from an operation within the class. For example: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class classname</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>var $decide;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function form($param)</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span><span>   </span>$this-&gt;decide = $param;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>      </span>echo $this-&gt;decide;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">This class declares a variable </span><code><span style="font-size:10pt;">$decide</span></code><span style="font-size:10pt;font-family:Verdana;">, then uses the operation form (which is passed the parameter </span><code><span style="font-size:10pt;">$param</span></code><span style="font-size:10pt;font-family:Verdana;">) to set the parameter to </span><code><span style="font-size:10pt;">$decide</span></code><span style="font-size:10pt;font-family:Verdana;">. Written in code-speak, the class looks like so: </span><code><span style="font-size:10pt;">$this-&gt;decide = $param</span></code><span style="font-size:10pt;font-family:Verdana;">. Fianlly, it accesses the attribute by printing it: </span><code><span style="font-size:10pt;">echo $this-&gt;decide</span></code><span style="font-size:10pt;font-family:Verdana;">. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Operations are called in the same way attributes are called. First we declare our class: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class classname</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function form1()</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function form2($param1, $param2)</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;"><span style="font-size:10pt;font-family:Verdana;">Then create an object: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$z = new classname();</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Finally, we call the operations in the same way we call other functions, by name. However, because these operations belong to an object rather than a normal function, we must identify the object to which they pertain. We use the object&#8217;s name in the same way as the object&#8217;s attributes: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$z-&gt;form1();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$z-&gt;form2(2, 3);</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;"><span style="font-size:10pt;font-family:Verdana;">If our operations return values we can retrieve them as variables like so: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$a = $z-&gt;form1();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$b = $z-&gt;form2(2, 3);</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Still with me? All of this is pretty simple, mostly thanks to PHP&#8217;s logical nature. Pretty soon, we&#8217;ll see how complete classes can be used to load major elements of a page. First, let&#8217;s see how classes inherit attributes and operations from the classes above them. </span></p>
<p><b><span style="font-size:10pt;font-family:Verdana;color:#ff6600;"><br />
</span></b></p>
<p class="MsoNormal" style="margin-left:0.1in;"><b><span style="font-size:10pt;font-family:Verdana;color:#ff6600;">Page 5 — Inheritance </span></b></p>
<div class="MsoNormal" style="margin-left:0.1in;text-align:center;" align="center">
<hr align="center" size="1" width="100%" /></div>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Inheritance is what makes using classes more robust than simply using an include file. With inheritance, we can create a hierarchal relationship between classes and subclasses. A subclass inherits attributes and operations from its superclass, (the class above it in the hierarchy). Once again, we can save time and effort by writing a base superclass instead of spreading redundant operations over several classes. This base can then be inherited by subclasses and refined to meet even more specialized criteria. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">To implement inheritance in PHP we use the keyword extends. For instance, the statement &#8220;class B extends class A&#8221; creates a Class B that inherits from Class A. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">So if we have these classes: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class A</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>var $decide1;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function form1()</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class B extends A</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>var $decide2;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function form2()</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">The following are valid accesses of operations and attributes from an object of type &#8220;B&#8221;: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$b = new B();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$b-&gt;form1();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$b-&gt;form2();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$b-&gt;decide1 = x;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$b-&gt;decide2 = y;</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">In addition, the following are valid for an object of the type &#8220;A&#8221;: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$a = new A();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$a-&gt;form1();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$a-&gt;decide1 = x;</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;"><span style="font-size:10pt;font-family:Verdana;">However, inheritance only works one-way, so the following: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$a-&gt;form2();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$a-&gt;decide2 = y;</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">are not valid because </span><code><span style="font-size:10pt;">form2()</span></code><span style="font-size:10pt;font-family:Verdana;"> and </span><code><span style="font-size:10pt;">$decide2</span></code><span style="font-size:10pt;font-family:Verdana;"> were created in class B. Class A does not inherit from Class B. This inheritance dynamic is also used to override values. For instance, if we declare a class A and class B again: </span></p>
<p><span style="font-size:10pt;font-family:Verdana;"><br />
</span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class A</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>var $y = 'the first value';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function form1()</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>      </span>echo "Our variable is $this-&gt;y";</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class B extends A</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>var $y = 'the new value';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>function form1()</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>      </span>echo "Our variable is $this-&gt;y";</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">class A is unaffected by declaring class B. The following is still the output of declaring Class A and creating an object of type A: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$a = new A();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$a-&gt;form1();</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;"><span style="font-size:10pt;font-family:Verdana;">The above declaration will return: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">Our variable is the first value</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;"><span style="font-size:10pt;font-family:Verdana;">If we create an object of type B, like this: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$b = new B();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$b-&gt;form1();</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;"><span style="font-size:10pt;font-family:Verdana;">it will return: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">Our variable is the new value</span></pre>
<p class="MsoNormal" style="margin-left:0.1in;">&nbsp;</p>
<p class="MsoNormal" style="margin-left:0.1in;">&nbsp;</p>
<p><b><span style="font-size:10pt;font-family:Verdana;color:#ff6600;"><br />
</span></b></p>
<p class="MsoNormal" style="margin-left:0.1in;"><b><span style="font-size:10pt;font-family:Verdana;color:#ff6600;"> Classes Put Into Action </span></b></p>
<div class="MsoNormal" style="margin-left:0.1in;text-align:center;" align="center">
<hr align="center" size="1" width="100%" /></div>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Now, with your knowledge of classes and of the </span><code><span style="font-size:10pt;">include()</span></code><span style="font-size:10pt;font-family:Verdana;"> function, you can start setting up pages which contain objects that reference classes contained in included files. It all sounds a little complicated, but trust me. You&#8217;ll thank me shortly. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Let&#8217;s begin by creating a simple navigation menu to display on all of our site&#8217;s pages. We&#8217;ll name this document </span><code><span style="font-size:10pt;">mainmenu.inc</span></code><span style="font-size:10pt;font-family:Verdana;">: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">&lt;?php</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class mainmenu</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>function mainmenu()</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                   </span>echo '&lt;table align="center" width="360" cellpadding="0"</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>  </span>cellspacing="5"&gt;';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                   </span>echo '&lt;td&gt;&lt;h2&gt;&lt;center&gt;&lt;a </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">href="home.php"&gt;HOME&lt;/a&gt;&lt;/h2&gt;&lt;/td&gt;';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                   </span>echo '&lt;td&gt;&lt;h2&gt;&lt;center&gt;&lt;a</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>  </span>href="services.php"&gt;SERVICES&lt;/a&gt;&lt;/h2&gt;&lt;/td&gt;';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                   </span>echo '&lt;td&gt;&lt;h2&gt;&lt;center&gt;&lt;a</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>  </span>href="portfolio.php"&gt;PORTFOLIO&lt;/a&gt;&lt;/h2&gt;&lt;/td&gt;';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                   </span>echo '&lt;td&gt;&lt;h2&gt;&lt;center&gt;&lt;a</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>  </span>href="contact.php"&gt;CONTACT&lt;/a&gt;&lt;/h2&gt;&lt;/td&gt;';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                   </span>echo '&lt;/table&gt;';</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">?&gt;</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">We have created a class named </span><code><span style="font-size:10pt;">mainmenu</span></code><span style="font-size:10pt;font-family:Verdana;">, we have also created a constructor named </span><code><span style="font-size:10pt;">mainmenu</span></code><span style="font-size:10pt;font-family:Verdana;"> so that when an object of the mainmenu type is created, it will perform the code within the class. The code within the function </span><code><span style="font-size:10pt;">mainmenu</span></code><span style="font-size:10pt;font-family:Verdana;"> is a pretty straightforward horizontal menu. There are different methods for producing this effect, such as storing the button names and URLs as a variable array, but we&#8217;ll keep it simple for the sake of introduction and let you go wild on it when you put it into practice. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Let&#8217;s create one more class before we create the page, shall we? Let&#8217;s tackle a stylesheet. We&#8217;ll call this </span><code><span style="font-size:10pt;">styles.inc</span></code><span style="font-size:10pt;font-family:Verdana;">: </span></p>
<p><span style="font-size:10pt;font-family:Verdana;"><br />
</span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">&lt;?php</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">class stylesMainMenu</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>function stylesMainMenu()</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>{</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">?&gt;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>&lt;style type="text/css"&gt;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>h1 {font-family:Arial, Helvetica, sans-serif;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>font-size:14pt; color:#666666}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>h2 {font-family:Arial, Helvetica, sans-serif;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>font-size:10pt; color:#820000}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>a:link {color:#820000; text-decoration:none}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>a:visited {color:#820000; text-decoration:none}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>a:hover {color:#666666; text-decoration:none}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>a:active {color:#820000; text-decoration:none}<span>                                  </span></span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>   </span>&lt;/style&gt;</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">&lt;?php</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"><span>                </span>}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">}</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">?&gt;</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Notice that </span><code><span style="font-size:10pt;">?&gt;</span></code><span style="font-size:10pt;font-family:Verdana;"> precedes the actual stylesheet, and </span><code><span style="font-size:10pt;">&lt;?php</span></code><span style="font-size:10pt;font-family:Verdana;"> follows the </span><code><span style="font-size:10pt;">&lt;/style&gt;</span></code><span style="font-size:10pt;font-family:Verdana;"> tag. This escapes from PHP so that the content will be read as HTML and treated accordingly. Just remember that you must return to PHP to close the function and also close the class. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">Alright, now comes the fun part. Let&#8217;s create </span><code><span style="font-size:10pt;">index.php</span></code><span style="font-size:10pt;font-family:Verdana;"> which will contain a menu that is formatted by our stylesheet: </span></p>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">&lt;?php</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">include('mainmenu.inc');</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">include('styles.inc');</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$page = new mainmenu();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">$page = new stylesMainMenu();</span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;"> </span></pre>
<pre style="margin-left:0.1in;"><span style="font-family:Verdana;">?&gt;</span></pre>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">That&#8217;s it. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">No, really, that&#8217;s it! We included </span><code><span style="font-size:10pt;">mainmenu.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> and </span><code><span style="font-size:10pt;">styles.inc</span></code><span style="font-size:10pt;font-family:Verdana;">, these provide us with the code for the menu and for our stylesheet. We then created a new object named </span><code><span style="font-size:10pt;">$page</span></code><span style="font-size:10pt;font-family:Verdana;"> by calling our constructors from within the </span><code><span style="font-size:10pt;">mainmenu</span></code><span style="font-size:10pt;font-family:Verdana;"> and </span><code><span style="font-size:10pt;">stylesMainMenu</span></code><span style="font-size:10pt;font-family:Verdana;"> classes. Objects do not always need to share their name (</span><code><span style="font-size:10pt;">$page</span></code><span style="font-size:10pt;font-family:Verdana;"> in this case), however, in order for the stylesheet to apply to the menu they need the same name. </span></p>
<p style="margin:0 0 5pt 0.1in;"><span style="font-size:10pt;font-family:Verdana;">You can make this operation as complicated or as simple as you like. In this example, we separated the classes into two files, </span><code><span style="font-size:10pt;">mainmenu.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> and </span><code><span style="font-size:10pt;">styles.inc</span></code><span style="font-size:10pt;font-family:Verdana;">, but they can both be stored in the same </span><code><span style="font-size:10pt;">.inc</span></code><span style="font-size:10pt;font-family:Verdana;"> files if you prefer. Furthermore, you can keep an entire library of stylesheets in a file called </span><code><span style="font-size:10pt;">styles.inc</span></code><span style="font-size:10pt;font-family:Verdana;">. By making each stylesheet its own class, you can call on the attributes from that stylesheet simply by calling on its classname or contructor and including </span><code><span style="font-size:10pt;">styles.inc</span></code><span style="font-size:10pt;font-family:Verdana;">. The same pertains to libraries of functions as well as redundant page elements such as menus, picture displays and information bars. </span></p>
<p style="margin:0 0 5pt 0.1in;">You can also make the menu itself dynamic by manipulating the operations within the <code><span style="font-size:10pt;">mainmenu</span></code> class. Treat these operations as instructed on page three of this lesson, and write them to conform to specific parameters and situations. For instance, you can create a conditional menu. Write the mainmenu operation so that if you are on <code><span style="font-size:10pt;">index.php</span></code> all of the buttons leading to the pages will be present in the menu, but if you are on services page, all buttons will be available except &#8220;services,” if you are on the portfolio page all buttons will be available except &#8220;portfolio&#8221;, and so on. Or perhaps you would like a different background for the menu depending on the page.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekwin.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekwin.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekwin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekwin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekwin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekwin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekwin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekwin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekwin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekwin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekwin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekwin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekwin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekwin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekwin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekwin.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=4&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekwin.wordpress.com/2008/03/09/inheritance-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e079a4593ca3302d9debe92e3f1af016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekwin</media:title>
		</media:content>
	</item>
		<item>
		<title>About Dot Net And C #</title>
		<link>http://vivekwin.wordpress.com/2008/03/08/function-arguments/</link>
		<comments>http://vivekwin.wordpress.com/2008/03/08/function-arguments/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 14:01:56 +0000</pubDate>
		<dc:creator>vivekwin</dc:creator>
				<category><![CDATA[Student]]></category>
		<category><![CDATA[Dot Net And C #]]></category>

		<guid isPermaLink="false">http://vivekwin.wordpress.com/?p=3</guid>
		<description><![CDATA[A little more on the MySQL SELECT statement . Introduction 1.1 What is C#? C# is a programming language designed by Microsoft. It is loosely based on C/C++, and bears a striking similarity to Java. Microsoft describe C# as follows: &#8220;C# is a simple, modern, object oriented, and type-safe programming language derived from C and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=3&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1><span style="font-size:12pt;color:black;">A little more on the MySQL SELECT statement</span></h1>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">. Introduction</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">1.1 What is C#?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">C# is a programming language designed by Microsoft. It is loosely based on C/C++, and bears a striking similarity to Java. Microsoft describe C# as follows:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">&#8220;C# is a simple, modern, object oriented, and type-safe programming language derived from C and C++. C# (pronounced &#8216;C sharp&#8217;) is firmly planted in the C and C++ family tree of languages, and will immediately be familiar to C and C++ programmers. C# aims to combine the high productivity of Visual Basic and the raw power of C++.&#8221;</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">You can get the ECMA C# spec in PDF form here, or use Jon Jagger&#8217;s html version.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">1.2 How do I develop C# apps?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">The (free) .NET SDK contains the C# command-line compiler (csc.exe). Visual Studio has fully integrated support for C# development. On Linux you can use Mono.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">1.3 Does C# replace C++?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">There are three options open to the Windows developer from a C++ background:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">• Stick with standard C++. Don&#8217;t use .NET at all. </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">• Use C++ with .NET. Microsoft supply a .NET C++ compiler that produces IL rather than machine code. However to make full use of the .NET environment (e.g. garbage collection), a set of extensions are required to standard C++. In .NET 1.x this extended language is called Managed Extensions for C++. In .NET 2.0 ME C++ has been completely redesigned under the stewardship of Stan Lippman, and renamed C++/CLI. </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">• Forget C++ and use C#.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Each of these options has merits, depending on the developer and the application. For my own part, I intend to use C# where possible, falling back to C++ only where necessary. ME C++ (soon to be C++/CLI) is very useful for interop between new .NET code and old C++ code &#8211; simply write a managed wrapper class using ME C++, then use the managed class from C#. From experience, this works well.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">1.4 Does C# have its own class library?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Not exactly. The .NET Framework has a comprehensive class library, which C# can make use of. C# does not have its own class library.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">2. Types</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">2.1 What standard types does C# use?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">C# supports a very similar range of basic types to C++, including int, long, float, double, char, string, arrays, structs and classes. However, don&#8217;t assume too much. The names may be familiar, but many of the details are different. For example, a long is 64 bits in C#, whereas in C++ the size of a long depends on the platform (typically 32 bits on a 32-bit platform, 64 bits on a 64-bit platform). Also classes and structs are almost the same in C++ &#8211; this is not true for C#. Finally, chars and strings in .NET are 16-bit (Unicode/UTF-16), not 8-bit like C++.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">2.2 Is it true that all C# types derive from a common base class?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Yes and no. All types can be treated as if they derive from object (System.Object), but in order to treat an instance of a value type (e.g. int, float) as object-derived, the instance must be converted to a reference type using a process called &#8216;boxing&#8217;. In theory a developer can forget about this and let the run-time worry about when the conversion is necessary, but in reality this implicit conversion can have side-effects that may trip up the unwary.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">2.3 So I can pass an instance of a value type to a method that takes an object as a parameter?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Yes. For example:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">class CApplication</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">public static void Main()</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">int x = 25; </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">string s = &#8220;fred&#8221;; </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">DisplayMe( x ); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">DisplayMe( s ); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">} </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">static void DisplayMe( object o ) </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">System.Console.WriteLine( &#8220;You are {0}&#8221;, o ); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">} </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">This would display:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">You are 25</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">You are fred</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">2.4 What are the fundamental differences between value types and reference types?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">C# divides types into two categories &#8211; value types and reference types. Most of the intrinsic types (e.g. int, char) are value types. Structs are also value types. Reference types include classes, arrays and strings. The basic idea is straightforward &#8211; an instance of a value type represents the actual data, whereas an instance of a reference type represents a pointer or reference to the data.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">The most confusing aspect of this for C++ developers is that C# has predetermined which types are represented as values, and which are represented as references. A C++ developer expects to take responsibility for this decision.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">For example, in C++ we can do this:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">int x1 = 3; // x1 is a value on the stack</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">int *x2 = new int(3) // x2 is a pointer to a value on the heap</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">but in C# there is no control:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">int x1 = 3; // x1 is a value on the stack</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">int x2 = new int(); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">x2 = 3; // x2 is also a value on the stack!</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">2.5 Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">It isn&#8217;t, really. When an int is being used as an int, it is a value. However, when it is being used as an object, it is a reference to an integer value (on the managed heap). In other words, when you treat an int as an object, the runtime automatically converts the int value to an object reference. This process is called boxing. The conversion involves copying the int to the heap, and creating an object instance which refers to it. Unboxing is the reverse process &#8211; the object is converted back to a value.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">int x = 3; // new int value 3 on the stack</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">object objx = x; // new int on heap, set to value 3 &#8211; still have x=3 on stack</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">int y = (int)objx; // new value 3 on stack, still got x=3 on stack and objx=3 on heap</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">2.6 Are C# references the same as C++ references?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Not quite. The basic idea is the same, but one significant difference is that C# references can be null . So you cannot rely on a C# reference pointing to a valid object. In that respect a C# reference is more like a C++ pointer than a C++ reference. If you try to use a null reference, a NullReferenceException is thrown.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">For example, look at the following method:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">void displayStringLength( string s )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( &#8220;String is length {0}&#8221;, s.Length );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">} </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">The problem with this method is that it will throw a NullReferenceException if called like this:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">string s = null;</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">displayStringLength( s );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Of course for some situations you may deem a NullReferenceException to be a perfectly acceptable outcome, but in this case it might be better to re-write the method like this:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">void displayStringLength( string s )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">if( s == null )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( &#8220;String is null&#8221; );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">else</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( &#8220;String is length {0}&#8221;, s.Length );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">} </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">2.7 Can I use typedefs in C#?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">No, C# has no direct equivalent of the C++ typedef. C# does allow an alias to be specified via the using keyword:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">using IntList = System.Collections.Generic.List&lt;int&gt;;</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">but the alias only applies in the file in which it is declared. A workaround in some cases is to use inheritance:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">public class IntList : List&lt;int&gt; { }</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">The pros and cons of this approach are discussed here.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3. Classes and Structs</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3.1 Structs are largely redundant in C++. Why does C# have them?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">In C++, a struct and a class are pretty much the same thing. The only difference is the default visibility level (public for structs, private for classes). However, in C# structs and classes are very different. In C#, structs are value types (instances stored directly on the stack, or inline within heap-based objects), whereas classes are reference types (instances stored on the heap, accessed indirectly via a reference). Also structs cannot inherit from structs or classes, though they can implement interfaces. Structs cannot have destructors. A C# struct is much more like a C struct than a C++ struct.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3.2 Does C# support multiple inheritance (MI)?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">No, though it does support implementation of multiple interfaces on a single class or struct.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3.3 Is a C# interface the same as a C++ abstract class?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">No, not quite. An abstract class in C++ cannot be instantiated, but it can (and often does) contain implementation code and/or data members. A C# interface cannot contain any implementation code or data members &#8211; it is simply a group of method names &amp; signatures. A C# interface is more like a COM interface than a C++ abstract class.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3.4 Are C# constructors the same as C++ constructors?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Very similar, but there are some significant differences. First, C# supports constructor chaining. This means one constructor can call another:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">class Person</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">public Person( string name, int age ) { &#8230; }</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">public Person( string name ) : this( name, 0 ) {}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">public Person() : this( &#8220;&#8221;, 0 ) {}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Another difference is that virtual method calls within a constructor are routed to the most derived implementation &#8211; see Can I Call a virtual method from a constructor.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Error handling is also somewhat different. If an exception occurs during construction of a C# object, the destuctor (finalizer) will still be called. This is unlike C++ where the destructor is not called if construction is not completed. (Thanks to Jon Jagger for pointing this out.)</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Finally, C# has static constructors. The static constructor for a class runs before the first instance of the class is created.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Also note that (like C++) some C# developers prefer the factory method pattern over constructors. See Brad Wilson&#8217;s article.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3.5 Are C# destructors the same as C++ destructors?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">No. They look the same but they are very different. The C# destructor syntax (with the familiar ~ character) is just syntactic sugar for an override of the System.Object Finalize method. This Finalize method is called by the garbage collector when it determines that an object is no longer referenced, before it frees the memory associated with the object. So far this sounds like a C++ destructor. The difference is that the garbage collector makes no guarantees about when this procedure happens. Indeed, the algorithm employed by the CLR garbage collector means that it may be a long time after the application has finished with the object. This lack of certainty is often termed &#8216;non-deterministic finalization&#8217;, and it means that C# destructors are not suitable for releasing scarce resources such as database connections, file handles etc.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">To achieve deterministic destruction, a class must offer a method to be used for the purpose. The standard approach is for the class to implement the IDisposable interface. The user of the object must call the Dispose() method when it has finished with the object. C# offers the &#8216;using&#8217; construct to make this easier.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3.6 If C# destructors are so different to C++ destructors, why did MS use the same syntax?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Presumably they wanted C++ programmers to feel at home. I think they made a mistake.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3.7 Are all methods virtual in C#?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">No. Like C++, methods are non-virtual by default, but can be marked as virtual.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3.8 How do I declare a pure virtual function in C#?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Use the abstract modifier on the method. The class must also be marked as abstract (naturally). Note that abstract methods cannot have an implementation (unlike pure virtual C++ methods).</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3.9 Can I call a virtual method from a constructor/destructor?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Yes, but it&#8217;s generally not a good idea. The mechanics of object construction in .NET are quite different from C++, and this affects virtual method calls in constructors. </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">C++ constructs objects from base to derived, so when the base constructor is executing the object is effectively a base object, and virtual method calls are routed to the base class implementation. By contrast, in .NET the derived constructor is executed first, which means the object is always a derived object and virtual method calls are always routed to the derived implementation. (Note that the C# compiler inserts a call to the base class constructor at the start of the derived constructor, thus preserving standard OO semantics by creating the illusion that the base constructor is executed first.)</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">The same issue arises when calling virtual methods from C# destructors. A virtual method call in a base destructor will be routed to the derived implementation.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">3.10 Should I make my destructor virtual?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">A C# destructor is really just an override of the System.Object Finalize method, and so is virtual by definition.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">4. Exceptions</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">4.1 Can I use exceptions in C#?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Yes, in fact exceptions are the recommended error-handling mechanism in C# (and in .NET in general). Most of the .NET framework classes use exceptions to signal errors.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">4.2 What types of object can I throw as exceptions?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Only instances of the System.Exception classes, or classes derived from System.Exception. This is in sharp contrast with C++ where instances of almost any type can be thrown.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">4.3 Can I define my own exceptions?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Yes, just derive your exception class from System.Exception.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Note that if you want your exception to cross remoting boundaries you&#8217;ll need to do some extra work &#8211; see http://www.thinktecture.com/Resources/RemotingFAQ/CustomExceptions.html for details.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">4.4 Does the System.Exception class have any cool features?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Yes &#8211; the feature which stands out is the StackTrace property. This provides a call stack which records where the exception was thrown from. For example, the following code:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">using System;</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">class CApp </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">public static void Main() </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">try </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">f(); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">} </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">catch( Exception e ) </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( &#8220;System.Exception stack trace = \n{0}&#8221;, e.StackTrace ); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">} </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">static void f() </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">throw new Exception( &#8220;f went pear-shaped&#8221; ); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">} </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">produces this output:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">System.Exception stack trace = </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">at CApp.f() </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">at CApp.Main()</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Note, however, that this stack trace was produced from a debug build. A release build may optimise away some of the method calls which could mean that the call stack isn&#8217;t quite what you expect.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">4.5 When should I throw an exception?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">This is the subject of some debate, and is partly a matter of taste. However, it is accepted by many that exceptions should be thrown only when an &#8216;unexpected&#8217; error occurs. How do you decide if an error is expected or unexpected? This is a judgement call, but a straightforward example of an expected error is failing to read from a file because the seek pointer is at the end of the file, whereas an example of an unexpected error is failing to allocate memory from the heap.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">4.6 Does C# have a &#8216;throws&#8217; clause?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">No, unlike Java, C# does not require (or even allow) the developer to specify the exceptions that a method can throw.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">5. Run-time Type Information</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">5.1 How can I check the type of an object at runtime?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">You can use the is keyword. For example:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">using System; </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">class CApp</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">public static void Main()</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">string s = &#8220;fred&#8221;; </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">long i = 10; </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( &#8220;{0} is {1}an integer&#8221;, s, (IsInteger(s) ? &#8220;&#8221; : &#8220;not &#8220;) ); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( &#8220;{0} is {1}an integer&#8221;, i, (IsInteger(i) ? &#8220;&#8221; : &#8220;not &#8220;) ); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">static bool IsInteger( object obj )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">if( obj is int || obj is long )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">return true; </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">else </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">return false;</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">} </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">produces the output:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">fred is not an integer </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">10 is an integer</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">5.2 Can I get the name of a type at runtime?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Yes, use the GetType method of the object class (which all types inherit from). For example:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">using System; </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">class CTest</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">class CApp </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">public static void Main()</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">long i = 10; </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">CTest ctest = new CTest(); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">DisplayTypeInfo( ctest ); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">DisplayTypeInfo( i ); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">static void DisplayTypeInfo( object obj ) </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{ </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( &#8220;Type name = {0}, full type name = {1}&#8221;, obj.GetType(), obj.GetType().FullName ); </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">produces the following output:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Type name = CTest, full type name = CTest </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Type name = Int64, full type name = System.Int64</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">5.3 What is the difference between typeof and GetType()?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Apart from the obvious (i.e. typeof operates on a type whereas GetType operates on an object), the main thing to watch out for is that GetType returns the underlying type of the object, which may not be the same as the type of the reference to the object. For example:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">class Base { }</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">class Derived : Base { }</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">class Program</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">static void Main()</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">ShowType( new Derived() );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">static void ShowType( Base b )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine(typeof(Base));</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine(b.GetType());</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">gives the following output:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Base</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Derived</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">6. Miscellaneous</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">6.1 How do I do a case-insensitive string comparison?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Use the String.Compare function. Its third parameter is a boolean which specifies whether case should be ignored or not.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">&#8220;fred&#8221; == &#8220;Fred&#8221; // false</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">System.String.Compare( &#8220;fred&#8221;, &#8220;Fred&#8221;, true ) == 0 // true</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">For more control over the comparison, e.g. exotic features like width-sensitivity, consider using System.Globalization.CompareInfo.Compare(), e.g.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">CultureInfo.CurrentCulture.CompareInfo.Compare(</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">&#8220;fred&#8221;, &#8220;Fred&#8221;, </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">CompareOptions.IgnoreCase | </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">CompareOptions.IgnoreKanaType | </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">CompareOptions.IgnoreWidth</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">);</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">6.2 Does C# support a variable number of arguments?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Yes, using the params keyword. The arguments are specified as a list of arguments of a specific type, e.g. int. For ultimate flexibility, the type can be object. The standard example of a method which uses this approach is System.Console.WriteLine().</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">6.3 How can I process command-line arguments?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Like this:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">using System;</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">class CApp</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">public static void Main( string[] args )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( &#8220;You passed the following arguments:&#8221; );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">foreach( string arg in args )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( arg );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">6.4 Does C# do array bounds checking?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Yes. An IndexOutOfRange exception is used to signal an error.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">6.5 How can I make sure my C# classes will interoperate with other .NET languages?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Make sure your C# code conforms to the Common Language Subset (CLS). To help with this, add the [assembly:CLSCompliant(true)] global attribute to your C# source files. The compiler will emit an error if you use a C# feature which is not CLS-compliant.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">6.6 How do I use the &#8216;using&#8217; keyword with multiple objects?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">You can nest using statements, like this:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">using( obj1 )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">using( obj2 )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">&#8230; </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">However consider using this more aesthetically pleasing (but functionally identical) formatting:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">using( obj1 )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">using( obj2 )</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">{</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">&#8230;</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">}</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">6.7 What is the difference between == and object.Equals?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">For value types, == and Equals() usually compare two objects by value. For example:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">int x = 10;</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">int y = 10;</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( x == y );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( x.Equals(y) );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">will display:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">True</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">True</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">However things are more complex for reference types. Generally speaking, for reference types == is expected to perform an identity comparison, i.e. it will only return true if both references point to the same object. By contrast, Equals() is expected to perform a value comparison, i.e. it will return true if the references point to objects that are equivalent. For example:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">StringBuilder s1 = new StringBuilder(&#8220;fred&#8221;);</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">StringBuilder s2 = new StringBuilder(&#8220;fred&#8221;);</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( s1 == s2 );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Console.WriteLine( s1.Equals(s2) );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">will display:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">False</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">True</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">s1 and s2 are different objects (hence == returns false), but they are equivalent (hence Equals() returns true).</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Unfortunately there are exceptions to these rules. The implementation of Equals() in System.Object (the one you&#8217;ll inherit by default if you write a class) compares identity, i.e. it&#8217;s the same as operator==. So Equals() only tests for equivalence if the class author overrides the method (and implements it correctly). Another exception is the string class &#8211; its operator== compares value rather than identity.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Bottom line: If you want to perform an identity comparison use the ReferenceEquals() method. If you want to perform a value comparison, use Equals() but be aware that it will only work if the type has overridden the default implementation. Avoid operator== with reference types (except perhaps strings), as it&#8217;s simply too ambiguous.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">6.8 How do I enforce const correctness in C#?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">You can&#8217;t &#8211; at least not in the same way you do in C++. C# (actually, the CLI) has no real concept of const correctness, For example, there&#8217;s no way to specify that a method should not modify an argument passed in to it. And there&#8217;s no way to specify that a method does not modify the object on which it is acting. </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">To get a feel for the angst this causes among some C++ programmers, read the feedback on this post from Raymond Chen.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">There are of course ways of addressing this issue. For example, see Brad Abram&#8217;s post (and associated feedback) for some ideas on adding optional read-only behaviour to collection classes. </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">7. C# 2.0</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">7.1 What are the new features in C# 2.0?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Support for all of the new framework features such as generics, anonymous methods, partial classes, iterators and static classes. See the .NET FAQ for more on these features.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Delegate inference is a new feature of the C# compiler which makes delegate usage a little simpler. It allows you to write this:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Thread t = new Thread(ThreadFunc);</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">instead of this:</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Thread t = new Thread( new ThreadStart(ThreadFunc) );</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Another minor but welcome addition is the explicit global namespace, which fixes a hole in namespace usage in C# 1.x. You can prefix a type name with global:: to indicate that the type belongs to the global namespace, thus avoiding problems where the compiler infers the namespace and gets it wrong.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">Finally C# 2.0 includes some syntactic sugar for the new System.Nullable type. You can use T? as a synonym for System.Nullable&lt;T&gt;, where T is a value type. As suggested by the name, this allows values of the type to be &#8216;null&#8217;, or &#8216;undefined&#8217;. </span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">7.2 Are C# generics the same as C++ templates?</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="font-family:Verdana;color:black;">No, not really. There are some similarities, but there are also fundamental differences. See the .NET FAQ for more details.</span><span style="color:black;"></span></p>
<p class="MsoNormal"><span style="color:black;"> </span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekwin.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekwin.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekwin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekwin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekwin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekwin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekwin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekwin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekwin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekwin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekwin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekwin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekwin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekwin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekwin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekwin.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=3&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekwin.wordpress.com/2008/03/08/function-arguments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e079a4593ca3302d9debe92e3f1af016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekwin</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://vivekwin.wordpress.com/2008/03/08/hello-world/</link>
		<comments>http://vivekwin.wordpress.com/2008/03/08/hello-world/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 13:59:11 +0000</pubDate>
		<dc:creator>vivekwin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=1&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekwin.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekwin.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekwin.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekwin.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekwin.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekwin.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekwin.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekwin.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekwin.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekwin.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekwin.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekwin.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekwin.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekwin.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekwin.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekwin.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekwin.wordpress.com&amp;blog=3098196&amp;post=1&amp;subd=vivekwin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekwin.wordpress.com/2008/03/08/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e079a4593ca3302d9debe92e3f1af016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekwin</media:title>
		</media:content>
	</item>
	</channel>
</rss>
