<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8654375134827389820</atom:id><lastBuildDate>Mon, 30 Jan 2012 20:59:53 +0000</lastBuildDate><title>Rails Builder</title><description>A web blog for all Ruby on rails developers</description><link>http://railsbuilder.blogspot.com/</link><managingEditor>noreply@blogger.com (Rails builder)</managingEditor><generator>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogspot/ZKbN" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="blogspot/zkbn" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8654375134827389820.post-5134752787782530736</guid><pubDate>Fri, 18 Jun 2010 08:27:00 +0000</pubDate><atom:updated>2010-06-18T01:41:33.087-07:00</atom:updated><title>Installing Hive on linux</title><description>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CAdmin%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Courier; 	panose-1:2 7 4 9 2 2 5 2 4 4; 	mso-font-charset:0; 	mso-generic-font-family:modern; 	mso-font-format:other; 	mso-font-pitch:fixed; 	mso-font-signature:3 0 0 0 1 0;} @font-face 	{font-family:Wingdings; 	panose-1:5 0 0 0 0 0 0 0 0 0; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 268435456 0 0 -2147483648 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} h3 	{mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	mso-outline-level:3; 	font-size:13.5pt; 	font-family:"Times New Roman";} a:link, span.MsoHyperlink 	{color:blue; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{color:purple; 	text-decoration:underline; 	text-underline:single;} pre 	{margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Courier New"; 	mso-fareast-font-family:"Times New Roman";} p.line862, li.line862, div.line862 	{mso-style-name:line862; 	mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} p.line874, li.line874, div.line874 	{mso-style-name:line874; 	mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:138688227; 	mso-list-type:hybrid; 	mso-list-template-ids:-1542040082 -1426314766 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l0:level1 	{mso-level-number-format:roman-lower; 	mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.5in;} @list l1 	{mso-list-id:1601448026; 	mso-list-type:hybrid; 	mso-list-template-ids:-2084906244 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l1:level1 	{mso-level-start-at:3; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l2 	{mso-list-id:1738741957; 	mso-list-template-ids:-649962268;} @list l2:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	font-family:Symbol;} @list l3 	{mso-list-id:1898710504; 	mso-list-type:hybrid; 	mso-list-template-ids:54981000 1920081654 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l3:level1 	{mso-level-tab-stop:39.0pt; 	mso-level-number-position:left; 	margin-left:39.0pt; 	text-indent:-.25in;} @list l4 	{mso-list-id:1992099289; 	mso-list-type:hybrid; 	mso-list-template-ids:254722860 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l4:level1 	{mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l5 	{mso-list-id:2036618772; 	mso-list-template-ids:83892540;} @list l5:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	font-family:Symbol;} @list l5:level2 	{mso-level-number-format:bullet; 	mso-level-text:o; 	mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	font-family:"Courier New"; 	mso-bidi-font-family:"Times New Roman";} @list l5:level3 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:1.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	font-family:Wingdings;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:16pt;"&gt;Overview:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Hive is a query based, data warehouse infrastructure built on top of Hadoop that provides tools to enable easy data summarization, querying and analysis of large datasets data stored in Hadoop files. It provides a mechanism to put structure on this data and it also provides a simple query language called Hive QL which is based on SQL and which enables users familiar with SQL to query this data. At the same time, this language also allows traditional map/reduce programmers to be able to plug in their custom mappers and reducers to do more sophisticated analysis which may not be supported by the built-in capabilities of the language.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:16pt;"&gt;Pre-requisites:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin-left: 0.75in; text-indent: -0.5in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-weight: normal;font-size:12pt;" &gt;&lt;span style=""&gt;1.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-weight: normal;font-size:12pt;" &gt;  Java 1.6 &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin-left: 0.75in; text-indent: -0.5in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-weight: normal;font-size:12pt;" &gt;&lt;span style=""&gt;2. &lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;                  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-weight: normal;font-size:12pt;" &gt;Hadoop 0.17.x to 0.20.x.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin-left: 0.75in; text-indent: -0.5in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-weight: normal;font-size:12pt;" &gt;&lt;span style=""&gt;3.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-weight: normal;font-size:12pt;" &gt;  Ant 1.8.1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin-left: 0.75in; text-indent: -0.5in;"&gt;&lt;!--[if !supportLists]--&gt;4.  &lt;span style="font-weight: normal;font-size:12pt;" &gt;Subversion (SVN)&lt;/span&gt;&lt;span style="font-size:12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;b style=""&gt;Note:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt; &lt;/span&gt;For me, I need to configure and install Hadoop 0.20.0 version.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:16pt;"&gt;Installation:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:16pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Download&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-right: -9pt;"&gt;&lt;span style="font-size:12pt;"&gt;svn co http://svn.apache.org/repos/asf/hadoop/hive/trunk hive&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Using svn you can download the hive frame work from trunk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ol style="margin-top: 0in;" start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Navigate      to the folder in the command shell by following command&lt;/li&gt;&lt;/ol&gt;  &lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style="font-size:12pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;cd hive&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;2. &lt;span style=""&gt; &lt;/span&gt;Build the hive package using ant (Make sure you have installed ant&lt;/span&gt;)&lt;/pre&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;span style=""&gt;      &lt;/span&gt;ant package&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;span style=""&gt;3.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;Once if you build the jar files using ant you will find new folder structure in hive folder, navigate to below folder structure&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;span style=""&gt;      &lt;/span&gt;cd build/dist&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;span style=""&gt;4.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;Make sure everything&lt;span style=""&gt;  &lt;/span&gt;build by ant is correctly by list the folder&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt; ls&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt;Output will be list like this &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt; README.txt&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt; bin/ (all the shell scripts)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt; lib/ (required jar files)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt; conf/ (configuration files)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt; examples/ (sample input and query files)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;  &lt;p class="MsoNormal" style="margin-left: -9pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size:16pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;Execution:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:16pt;"&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:16pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/span&gt;Note: &lt;/b&gt;Before running hive make sure you have configured and installed Hadoop 0.20.0 or any other version as per requirement&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Hive use Hadoop so you need to specify the Hadoop path to hive, Hadoop folder path (which you have&lt;span style=""&gt;   &lt;/span&gt;to download and configure ) need to make visible. You can do it by two ways &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 39pt; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;You can export the path for single session by following bash command&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 21pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 21pt;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;   &lt;/span&gt;export HADOOP_HOME=hadoop-install-dir&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 21pt;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 21pt;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;   &lt;/span&gt;For me it is&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 21pt;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 39pt;"&gt;&lt;b style=""&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Courier;"&gt;export HADOOP_HOME&lt;/span&gt;=/home/hadoop/arun/hadoop-0.20.0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;      &lt;/span&gt;Note:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;       &lt;/span&gt;Make sure HADOOP_HOME variable assigned properly is&lt;span style=""&gt;  &lt;/span&gt;by this command&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;     &lt;/span&gt;echo $HADOOP_HOME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 39pt; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;You can&lt;span style="font-family:Courier;"&gt; &lt;/span&gt;export the path as permanent by adding it in to .bash_profile file which is shell script automatically checked first when any script executes &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 39pt;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;vi /logged_in_user_name/.bash_profile&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 39pt;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 39pt;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-family:Courier;"&gt;For me it is (I logged as root)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Courier;"&gt;vi /root/.bash_profile&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt; &lt;/span&gt;Open the file with &lt;b style=""&gt;vi&lt;/b&gt; editor and add the following lines&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Courier;"&gt;Assigning the variable&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Courier;"&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;HADOOP_HOME=/home/hadoop/arun/hadoop-0.20.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Courier;"&gt;Make visible to all process&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Courier;"&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;export HADOOP_HOME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 39pt;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:14pt;"&gt;Note :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;In addition, you must create /tmp and /user/hive/warehouse (aka hive.metastore.warehouse.dir) and set them chmod g+w in HDFS before a table can be created in Hive.&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 75pt;"&gt;&lt;b style=""&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;Following commands will do above creation, navigate to the Hadoop folder path (home folder ) for me it is &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 75pt;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;       "&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Courier;"&gt;/home/hadoop/arun/hadoop-0.20.0&lt;b style=""&gt; "&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;And type the following commands; it will create the folder structure&lt;b style=""&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 39pt;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;[root@master hadoop-0.20.2]# /bin/hadoop dfs -mkdir /tmp&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;[root@master hadoop-0.20.2]# /bin/hadoop dfs -mkdir/user/hive/warehouse&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;[root@master hadoop-0.20.2]# /bin/hadoop dfs -mkdir /tmp&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;[root@master hadoop-0.20.2]# /bin/hadoop dfs -mkdir /tmp&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt;Basic Execution:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;span style=""&gt;  &lt;/span&gt;Now navigate back to the hive folder downloaded and installed folder move to&lt;span style=""&gt;   &lt;/span&gt;Ant build &lt;span style=""&gt; &lt;/span&gt;package “build/dist”, And type bin/hive the shell will open query shell in the same shell&lt;/span&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;cd /hive_home_folder/&lt;span style=""&gt;   &lt;/span&gt;for me : cd /downloads/hive/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;cd build/dist&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;bin/hive&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;For me it is &lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;[root@master dist]# bin/hive&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;Hive history file=/tmp/root/hive_job_log_root_201006181053_1733690517.txt&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;hive&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt; Testing/Checking:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;span style=""&gt;      &lt;/span&gt;Creating Hive table&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style="font-size:12pt;"&gt;hive&gt; CREATE TABLE jak (id INT, friends STRING); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;/span&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;Output: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;span style=""&gt;         &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;hive&gt; CREATE TABLE jak (id INT, friends STRING);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=""&gt;          &lt;/span&gt;OK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=""&gt;          &lt;/span&gt;Time taken: 0.476 seconds&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;hive&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;It will show the created Hive&lt;span style=""&gt;  &lt;/span&gt;table &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;hive&gt; SHOW TABLES;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;Output: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;hive&gt;SHOW TABLES;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 1in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;OK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 1in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;jak&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 1in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;lists&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 1in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;Time taken: 0.215 seconds&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;hive&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:14pt;"  &gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h3&gt;&lt;span style="font-size:16pt;"&gt;Configuration:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p class="line862" style="margin-left: 0.25in;"&gt;- hive default configuration is stored in &lt;install-dir&gt;/conf/hive-default.xml &lt;/install-dir&gt;&lt;/p&gt;  &lt;p class="line862" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Symbol;font-size:10pt;"  &gt;&lt;span style=""&gt;·&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Configuration variables can be changed by (re-)defining them in &lt;install-dir&gt;/conf/hive-site.xml &lt;/install-dir&gt;&lt;/p&gt;  &lt;p class="line862" style="margin-left: 0.25in;"&gt;- log4j configuration is stored in &lt;install-dir&gt;/conf/hive-log4j.properties &lt;/install-dir&gt;&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.25in;"&gt;- hive configuration is an overlay on top of hadoop - meaning the hadoop configuration variables are inherited by default. &lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.25in;"&gt;- hive configuration can be manipulated by: &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Symbol;font-size:10pt;"  &gt;&lt;span style=""&gt;·&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;editing hive-site.xml and defining any desired variables (including hadoop variables) in it &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Symbol;font-size:10pt;"  &gt;&lt;span style=""&gt;·&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;from the cli using the set command (see below) &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Symbol;font-size:10pt;"  &gt;&lt;span style=""&gt;·&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;by invoking hive using the syntax: &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;"  &gt;&lt;span style=""&gt;o&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;$ bin/hive -hiveconf x1=y1 -hiveconf x2=y2 &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 2in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Wingdings;font-size:10pt;"  &gt;&lt;span style=""&gt;§&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;this sets the variables x1 and x2 to y1 and y2 respectively&lt;/p&gt;  &lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;  &lt;h3&gt;Error logs:&lt;/h3&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;Hive uses log4j for logging. By default logs are not emitted to the console by the cli. They are stored in the file: - /tmp/{user.name}/hive.log &lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;If the user wishes - the logs can be emitted to the console by adding the arguments shown below: - bin/hive -hiveconf hive.root.logger=INFO,console &lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;Note that setting hive.root.logger via the 'set' command does not change logging properties since they are determined at initialization time. &lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;Error logs are very useful to debug problems. Please send them with any bugs (of which there are many!) to &lt;a href="mailto:hive-dev@hadoop.apache.org"&gt;hive-dev@hadoop.apache.org&lt;/a&gt;. &lt;/p&gt;  &lt;p class="line874"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="line874"&gt;&lt;b style=""&gt;&lt;span style="font-size:16pt;"&gt;Installation errors and solutions:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="line874"&gt;&lt;b style=""&gt;&lt;span style="font-size:14pt;"&gt;Note:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="line874" style="text-indent: 0.5in;"&gt;In installation/setup of hive you will mostly face issue on the downloading the required software to build the jar file using ant.&lt;/p&gt;  &lt;p class="line874"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="line874"&gt;Error 1:&lt;/p&gt;  &lt;p class="line874"&gt;If try to build the package using ant like below&lt;/p&gt;  &lt;p class="line874"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;    &lt;/span&gt;[root@master hive]# ant package&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="line874"&gt;&lt;span style=""&gt;   &lt;/span&gt;It will produce error like below&lt;/p&gt;  &lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt;ivy-retrieve-hadoop-source:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt;[ivy:retrieve] :: Ivy 2.0.0-rc2 - 20081028224207 :: http://ant.apache.org/ivy/ ::&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;&lt;span style="font-size:12pt;"&gt;:: loading settings :: file = /master/hadoop/hive/ivy/ivysettings.xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p class="line874"&gt;&lt;span style=""&gt;             &lt;/span&gt;&lt;span style="font-family:Courier;"&gt;BUILD FAILED&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;&lt;span style="font-family:Courier;"&gt;/test/hive/build.xml:160: The following error occurred while executing this line:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;&lt;span style="font-family:Courier;"&gt;/test/hive/build.xml:103: The following error occurred while executing this line:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;&lt;span style="font-family:Courier;"&gt;/test/hive/shims/build.xml:56: The following error occurred while executing this line:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;&lt;span style="font-family:Courier;"&gt;/test/hive/build-common.xml:177: impossible to resolve dependencies:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;  &lt;/span&gt;resolve failed - see output for details&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="line874"&gt;&lt;span style=""&gt; &lt;/span&gt;Solution:&lt;/p&gt;  &lt;p class="line874"&gt;&lt;span style=""&gt;         &lt;/span&gt;It is all about downloading file error the path is not correct so I downloaded Hadoop-0.20.0 core file and placed it ant building path as below &lt;/p&gt;  &lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;cd ~/.ant/cache/hadoop/core/sources&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;wget &lt;a href="http://archive.apache.org/dist/hadoop/core/hadoop-0.20.0/hadoop-0.20.0.tar.gz"&gt;http://archive.apache.org/dist/hadoop/core/hadoop-0.20.0/hadoop-0.20.0.tar.gz&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;svn update&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;After did this you need to change the a variable true to false in /hive/ivy/ivysettings.xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;For me hive home path is&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;cd /hive/ivy&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=""&gt;   &lt;/span&gt;vi ivysettings.xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;I changed the following variable to true to false (basically we tell to ant not to download file use existing file for further process)as follows&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;Checkmodified=”true” to checkmodified=”false”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;From:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;ibiblio name="apache-snapshot" root="${snapshot.apache.org}" m2compatible="true"&gt;&lt;/ibiblio&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;checkmodified="true" changingPattern=".*SNAPSHOT"/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;TO:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;ibiblio name="apache-snapshot" root="${snapshot.apache.org}" m2compatible="true"&gt;&lt;/ibiblio&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;checkmodified="false" changingPattern=".*SNAPSHOT"/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:12pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;Now clean the ant package and build hive package for specified version of &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;Hadoop for me it is 0.20.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=""&gt;      &lt;/span&gt;ant -Dhadoop.version=0.x.x clean package&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12pt;"  &gt;For me&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p class="line874" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;  &lt;/span&gt;ant -Dhadoop.version=0.20.0 clean package&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="line874"&gt;It will work fine…&lt;/p&gt;  &lt;p class="line874"&gt;Error 2:&lt;/p&gt;  &lt;p class="line874"&gt;&lt;span style=""&gt;        &lt;/span&gt;After installing the HIVE, when we query means it will show error like&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;“Execution Jar:&lt;span style=""&gt;  &lt;/span&gt;hive/lib/hive-exec-*.jar. “&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt; &lt;/span&gt;Missing Hive Execution Jar&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Solution:&lt;/p&gt;  &lt;p class="line874"&gt;&lt;span style=""&gt;  &lt;/span&gt;If we do the installation (manually download and saving file in ant path) in above method some times the created of jar file&lt;span style=""&gt;  &lt;/span&gt;(by ant) will be saved in a different location&lt;/p&gt;  &lt;p class="line874"&gt;We need to find that file and need to paste in correct path &lt;/p&gt;  &lt;p class="line874"&gt;Original/correct path is hive home folder/build/dist&lt;/p&gt;  &lt;p class="line874"&gt;For me it is&lt;span style=""&gt;    &lt;/span&gt;cd&lt;span style=""&gt;  &lt;/span&gt;/hive/ build/dist&lt;/p&gt;  &lt;p class="line874"&gt;Note:&lt;/p&gt;  &lt;p class="line874" style="text-indent: 0.5in;"&gt;If you want acces globally u need to set HIVE_HOME path refer above path setting process.&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="line874"&gt;It will work fine…&lt;/p&gt;  &lt;p class="line874"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="line874"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="line874"&gt;Error 3:&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="line874" style="text-indent: 0.5in;"&gt;After installing the HIVE, when we query means it will show error like “it can’t able to create JVM because of Memory HEAPSIZE is very high”&lt;/p&gt;  &lt;p class="line874"&gt;&lt;span style=""&gt;    &lt;/span&gt;Solution:&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;For that we need to change the heap size in the following file&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in; text-indent: 0.5in;"&gt;\hive\build\dist\bin\ext\util\execHiveCmd.sh&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;as 64 or as per your requirement&lt;/p&gt;  &lt;p class="line874"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;# increase the threshold for large queries&lt;/p&gt;  &lt;p class="line874" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;  &lt;/span&gt;HADOOP_HEAPSIZE=64&lt;/p&gt;  &lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;  &lt;p class="line874"&gt;It will work fine…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8654375134827389820-5134752787782530736?l=railsbuilder.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://railsbuilder.blogspot.com/2010/06/installing-hive-on-linux.html</link><author>noreply@blogger.com (Rails builder)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8654375134827389820.post-8234720629171798242</guid><pubDate>Fri, 13 Nov 2009 05:12:00 +0000</pubDate><atom:updated>2009-11-12T21:19:42.829-08:00</atom:updated><title>instance_eval and class_eval in ruby</title><description>&lt;p&gt;In an attempt to better understand instance_eval and class_eval, I just read &lt;a href="http://www.khelll.com/blog/ruby/ruby-reflection/"&gt;Khaled’s post on Ruby reflection&lt;/a&gt;. It helped, and I came up with a memory crutch I can use to remember when to use each of them:&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;Use ClassName.&lt;strong&gt;instance_eval&lt;/strong&gt; to define &lt;strong&gt;class &lt;/strong&gt;methods.&lt;/p&gt; &lt;p&gt;Use ClassName.&lt;strong&gt;class_eval&lt;/strong&gt; to define &lt;strong&gt;instance &lt;/strong&gt;methods.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;That’s right. Not a typo. Here are some examples, shamelessly stolen from his post:&lt;/p&gt; &lt;div class="syntaxhighlighter " id="highlighter_283491"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="comments"&gt;  # Defining a class method with instance_eval&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="color1"&gt;    Fixnum&lt;/code&gt;&lt;code class="plain"&gt;.instance_eval { &lt;/code&gt;&lt;code class="keyword"&gt;def&lt;/code&gt; &lt;code class="plain"&gt;ten; &lt;/code&gt;&lt;code class="constants"&gt;10&lt;/code&gt;&lt;code class="plain"&gt;; &lt;/code&gt;&lt;code class="keyword"&gt;end&lt;/code&gt; &lt;code class="plain"&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="color1"&gt;    Fixnum&lt;/code&gt;&lt;code class="plain"&gt;.ten &lt;/code&gt;&lt;code class="comments"&gt;#=&gt; 10&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="comments"&gt;  # Defining an instance method with class_eval&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="color1"&gt;    Fixnum&lt;/code&gt;&lt;code class="plain"&gt;.class_eval { &lt;/code&gt;&lt;code class="keyword"&gt;def&lt;/code&gt; &lt;code class="plain"&gt;number; &lt;/code&gt;&lt;code class="keyword"&gt;self&lt;/code&gt;&lt;code class="plain"&gt;; &lt;/code&gt;&lt;code class="keyword"&gt;end&lt;/code&gt; &lt;code class="plain"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="constants"&gt;  7&lt;/code&gt;&lt;code class="plain"&gt;.number &lt;/code&gt;&lt;code class="comments"&gt;#=&gt; 7&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;h4&gt;I Like Stuff that’s Backwards&lt;/h4&gt; &lt;p&gt;Why is it the reverse of what you might expect? Because Fixnum.instance_eval treats Fixnum as an instance (an instance of the Class class), thus any new functions you define can be called on that instance. So it’s equivalent to this:&lt;/p&gt; &lt;div class="syntaxhighlighter " id="highlighter_364187"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="keyword"&gt;  class&lt;/code&gt; &lt;code class="color1"&gt;Fixnum&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;  &lt;/code&gt;&lt;span class="block" style="margin-left: 14px ! important;"&gt;&lt;code class="keyword"&gt;def&lt;/code&gt; &lt;code class="keyword"&gt;self&lt;/code&gt;&lt;code class="plain"&gt;.ten&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;  &lt;/code&gt;&lt;span class="block" style="margin-left: 28px ! important;"&gt;&lt;code class="constants"&gt;10&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;  &lt;/code&gt;&lt;span class="block" style="margin-left: 14px ! important;"&gt;&lt;code class="keyword"&gt;end&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="keyword"&gt;  end&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="color1"&gt;  Fixnum&lt;/code&gt;&lt;code class="plain"&gt;.ten &lt;/code&gt;&lt;code class="comments"&gt;#=&gt; 10&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;Fixnum.class_eval treats Fixnum as a class and executes the code in the context of that class, thus any “def” statements are treated exactly as if they were in normal code without any reflection. It’s equivalent to this:&lt;/p&gt; &lt;div class="syntaxhighlighter " id="highlighter_865986"&gt;&lt;div class="bar              "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="keyword"&gt;   class&lt;/code&gt; &lt;code class="color1"&gt;Fixnum&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;   &lt;/code&gt;&lt;span class="block" style="margin-left: 14px ! important;"&gt;&lt;code class="keyword"&gt;def&lt;/code&gt; &lt;code class="plain"&gt;number&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;  &lt;/code&gt;&lt;span class="block" style="margin-left: 28px ! important;"&gt;&lt;code class="keyword"&gt;self&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;   &lt;/code&gt;&lt;span class="block" style="margin-left: 14px ! important;"&gt;&lt;code class="keyword"&gt;end&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="keyword"&gt;    end&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="constants"&gt;  7&lt;/code&gt;&lt;code class="plain"&gt;.number &lt;/code&gt;&lt;code class="comments"&gt;#=&gt; 7&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;There are still some things about Ruby reflection that mystify me but at least I think I’ve got this one nailed.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8654375134827389820-8234720629171798242?l=railsbuilder.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://railsbuilder.blogspot.com/2009/11/instanceeval-and-classeval-in-ruby.html</link><author>noreply@blogger.com (Rails builder)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8654375134827389820.post-6933738921430315424</guid><pubDate>Wed, 29 Apr 2009 11:55:00 +0000</pubDate><atom:updated>2009-04-29T05:09:13.498-07:00</atom:updated><title>Bang Methods In Ruby &amp; Ruby Classes</title><description>&lt;div class="post-body entry-content"&gt; In Ruby, you can write methods whose names end in ! (exclamation point or “bang”). There’s a lot of confusion surrounding the matter of when, and why, you would want to do so.&lt;br /&gt;&lt;br /&gt;What ! does (and does not) mean&lt;br /&gt;&lt;br /&gt;The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name.&lt;br /&gt;&lt;br /&gt;So, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.&lt;br /&gt;&lt;br /&gt;The ! does not mean “This method changes its receiver.” A lot of “dangerous” methods do change their receivers. But some don’t. I repeat: ! does not mean that the method changes its receiver.&lt;br /&gt;&lt;br /&gt;Don’t overuse the !&lt;br /&gt;Not every !-method changes its receiver, and not every receiver-changing method ends with !. There’s Array#pop/push/shift/unshift/concat/clear, and lots of others.&lt;br /&gt;&lt;br /&gt;Don’t add ! to your destructive (receiver-changing) methods’ names, unless you consider the changing to be “dangerous” and you have a “non-dangerous” equivalent method without the !. If some arbitrary subset of destructive methods end with !, then the whole point of ! gets distorted and diluted, and ! ceases to convey any information whatsoever.&lt;br /&gt;&lt;br /&gt;If you want to write a destructive method and you don’t think the name conveys destruction, you might be tempted to add a ! to make it clear. That’s not a good idea. If the name of a destructive method, without a !, does not connote destruction, then the name is wrong and cannot be repaired by slapping a ! on it.&lt;br /&gt;&lt;br /&gt;In such a case, you should create the traditional pair of methods: a non-bang method and a bang method. It’s conventional to define the non-bang method in terms of the bang one. Here’s an example involving a simplistic version of an Array#flatten_once method (it doesn’t handle nested objects other than arrays very well, but it makes the bang-point):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Array&lt;br /&gt;def flatten_once!&lt;br /&gt;res = [] each do |e|&lt;br /&gt;  [*e].each {|f| res &lt;&lt;&gt;&lt;br /&gt;The non-bang method is defined in terms of the bang method. You wouldn’t want to write an isolated method called flatten_once! without the matching non-bang version, since there’s no way to measure the “danger” except in relation to the non-dangerous method.&lt;br /&gt;&lt;br /&gt;Danger takes many forms&lt;br /&gt;Sometimes you get more than one kind of “danger” even within one bang method. Take String#gsub!. This method changes its receiver:&lt;br /&gt;str = "David" str.gsub!(/$/, " Black") str # David Black It also differs from gsub (non-bang) in that if the string does not change, gsub returns a copy of the unchanged string but gsub! returns nil:&lt;br /&gt;str.gsub(/xyz/, "blah") # David Black str.gsub!(/xyz/, "blah") # nil str # David Black The ! in gsub! gives you a heads-up: it warns you of danger, and that means that before you use the method, you should find out exactly how it behaves. (A simple “ri String#gsub!” should do it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-family:georgia;"&gt;Ruby classes&lt;/span&gt; &lt;/span&gt;&lt;a style="font-weight: bold;" name="6865277012107506731"&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;&lt;strong&gt;1.  Classes are themselves represented as objects.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;The first thing you’ll notice when you begin to learn ruby, is that all things are objects. Ruby is a dynamic 100% object oriented language (&lt;em&gt;along with lots of others, as I seemed to have forgoten&lt;/em&gt;). This really opens the doors to a new type of programming, called meta-programming. Meta-programming allows you to open up classes and objects as the application is running and modify them in any way needed. Even classes are objects, and thus have their own set of methods available to them. Each time you create a class you’re actually creating an object of class Class. In the code below you’ll notice that Dog has lots of methods, but it doesn’t have a method named class. Dog can call the method “class” because it is an object of type class. This gives it access to all of ruby’s class object methods. A list of available methods for class Object can be found at &lt;a href="http://www.rubycentral.com/ref/ref_c_object.html"&gt;Ruby Central.&lt;/a&gt;  A more updated list can be found in the &lt;a href="http://www.amazon.com/exec/obidos/redirect?link_code=ur2&amp;amp;tag=recentrambles-20&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;path=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2F0974514055%2Fsr%3D8-1%2Fqid%3D1149118020%2Fref%3Dpd_bbs_1%3F%255Fencoding%3DUTF8"&gt;Programming Ruby 2nd Edition&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=recentrambles-20&amp;amp;l=ur2&amp;amp;o=1" alt="" style="border: medium none  ! important; margin: 0px ! important;" width="1" border="0" height="1" /&gt; book.  If you plan doing anything beyond a recipe, or depot app, you’ll need this book!&lt;br /&gt;&lt;pre&gt;class Dog&lt;br /&gt;## lots of Dog methods that aren't def class&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;p Dog.class # =&gt; Class&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;2.  Methods can be defined on a per-object basis&lt;/strong&gt;&lt;br /&gt;Methods can also be created for a specific instance of an object. These methods are only available to the the object named in the method call.&lt;br /&gt;&lt;pre&gt;  dog = Object.new&lt;br /&gt;&lt;br /&gt;def dog.bark&lt;br /&gt;puts "ruff ruff"&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;dog.bark # =&gt; ruff ruff&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;3.  You can also define per-object methods using class &lt;&lt; &lt;/strong&gt;&lt;br /&gt;You can also create objects by using the Object.new method. This now makes dog a certified object, and thus you are free to add methods to this object.&lt;br /&gt;&lt;pre&gt;  dog = Object.new&lt;br /&gt;&lt;br /&gt;class &lt;&lt;&gt; ruff ruff&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;4.  outside of methods, within a class … end block, self refers to the class&lt;/strong&gt;&lt;br /&gt;Self always references the current object. Inside of any class, self will be treated just the same as Dog (if you’re in class Dog).&lt;br /&gt;&lt;pre&gt;  class Dog&lt;br /&gt;p self # =&gt; Dog&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;5.  “class methods” are simply per-object methods defined on classes&lt;/strong&gt;&lt;br /&gt;In ruby, you are able to tie a class to a particular object. Remember from tip 4 that you can replace self with Dog, and nothing about the code would change. This use of self defines a class that is based around the object self. Here, self is the class object Dog. This now allows you to add methods to class Dog. These new methods are class methods, and will be available to Dog. This means that you don’t have to create an instance of this object to call this method.&lt;br /&gt;&lt;pre&gt;  class Dog&lt;br /&gt;class &lt;&lt;&gt; ruff ruff&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8654375134827389820-6933738921430315424?l=railsbuilder.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://railsbuilder.blogspot.com/2009/04/bang-methods-in-ruby-ruby-classes.html</link><author>noreply@blogger.com (Rails builder)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8654375134827389820.post-8065552954347066200</guid><pubDate>Mon, 20 Apr 2009 06:11:00 +0000</pubDate><atom:updated>2011-03-24T22:00:08.070-07:00</atom:updated><title>Ruby on Rails Interview Questions</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_44rn_CkFp1w/SewXvqup-kI/AAAAAAAAATY/_ItmGa0A7Rg/s1600-h/interview-reduced.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 159px; height: 200px;" src="http://2.bp.blogspot.com/_44rn_CkFp1w/SewXvqup-kI/AAAAAAAAATY/_ItmGa0A7Rg/s200/interview-reduced.jpg" alt="" id="BLOGGER_PHOTO_ID_5326658566963722818" border="0" /&gt;&lt;/a&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CAdmin%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C02%5Cclip_filelist.xml"&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id="ieooui"&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Courier; 	panose-1:2 7 4 9 2 2 5 2 4 4; 	mso-font-charset:0; 	mso-generic-font-family:modern; 	mso-font-format:other; 	mso-font-pitch:fixed; 	mso-font-signature:3 0 0 0 1 0;} @font-face 	{font-family:Wingdings; 	panose-1:5 0 0 0 0 0 0 0 0 0; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 268435456 0 0 -2147483648 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} h2 	{mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	mso-outline-level:2; 	font-size:18.0pt; 	font-family:"Times New Roman"; 	font-weight:bold;} a:link, span.MsoHyperlink 	{color:blue; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{color:purple; 	text-decoration:underline; 	text-underline:single;} p 	{mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} code 	{font-family:"Courier New"; 	mso-ascii-font-family:"Courier New"; 	mso-fareast-font-family:"Times New Roman"; 	mso-hansi-font-family:"Courier New"; 	mso-bidi-font-family:"Courier New";} pre 	{margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; 	font-size:10.0pt; 	font-family:"Courier New"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:270019245; 	mso-list-template-ids:-1109491736;} @list l0:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:39.0pt; 	mso-level-number-position:left; 	margin-left:39.0pt; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:Wingdings;} @list l1 	{mso-list-id:990715496; 	mso-list-template-ids:-1887691254;} @list l1:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:39.0pt; 	mso-level-number-position:left; 	margin-left:39.0pt; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:Wingdings;} @list l2 	{mso-list-id:1467817402; 	mso-list-template-ids:-434499822;} @list l2:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:39.0pt; 	mso-level-number-position:left; 	margin-left:39.0pt; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:Wingdings;} @list l3 	{mso-list-id:1642736671; 	mso-list-template-ids:1986043616;} @list l3:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:39.0pt; 	mso-level-number-position:left; 	margin-left:39.0pt; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:Wingdings;} @list l4 	{mso-list-id:1653824064; 	mso-list-template-ids:465721542;} @list l4:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	font-family:Symbol;} @list l5 	{mso-list-id:2063673336; 	mso-list-type:hybrid; 	mso-list-template-ids:555521578 1389152372 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l5:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:39.0pt; 	mso-level-number-position:left; 	margin-left:39.0pt; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:Wingdings;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;1. Why Ruby on Rails?
&lt;br /&gt;Ans:&lt;span style=""&gt;  &lt;/span&gt;There are lot of advantages of using ruby on rails
&lt;br /&gt;1. DRY Principal
&lt;br /&gt;2. Convention over Configuration
&lt;br /&gt;3. Gems and Plugins
&lt;br /&gt;4. Scaffolding
&lt;br /&gt;5. Pure OOP Concept&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;6. Rest Support &lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;7. Rack support&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;8. Action Mailer&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;9. Rpc support&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;10. Rexml Support&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;11. etc..&lt;/p&gt;&lt;p style="margin: 0in 0in 0.0001pt;"&gt;
&lt;br /&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;2. Explain about the programming language ruby?&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ruby is the brain child of a Japanese programmer Matz. He created Ruby. It is a cross platform object oriented language. It helps you in knowing what your code does in your application. With legacy code it gives you the power of administration and organization tasks. Being open source, it did go into great lengths of development.&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;3. Explain about ruby names?
&lt;br /&gt;Classes, variables, methods, constants and modules can be referred by ruby names. When you want to distinguish between various names you can specify that by the first character of the name. Some of the names are used as reserve words which should not be used for any other purpose. A name can be lowercase letter, upper case letter, number, or an underscore, make sure that you follow the name by name characters.&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;4. What is the Difference between Symbol and String?&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: Symbol are same like string but both behaviors is different based on object_id, memory and process time (cpu time) Strings are mutable , Symbols are immutable.&lt;/p&gt;  &lt;p&gt;Mutable objects can be changed after assignment while immutable objects can only be overwritten. For example&lt;/p&gt;  &lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p "string object jak".object_id #=&gt; 22956070&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p "string object jak".object_id #=&gt; 22956030&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p "string object jak".object_id #=&gt; 22956090&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt; &lt;/code&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p :symbol_object_jak.object_id #=&gt; 247378&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p :symbol_object_jak.object_id #=&gt; 247378&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p :symbol_object_jak.object_id #=&gt; 247378&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt; &lt;/code&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p " string object jak ".to_sym.object_id #=&gt; 247518&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p " string object jak ".to_sym.object_id #=&gt; 247518&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p " string object jak ".to_sym.object_id #=&gt; 247518&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p :symbol_object_jak.to_s.object_id #=&gt; 22704460&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;p :symbol_object_jak.to_s.object_id #=&gt; 22687010&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;&lt;span style=""&gt;p :symbol_object_jak.to_s.object_id #=&gt; 21141310&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style=""&gt; &lt;/span&gt;And also it will differ by process time &lt;/p&gt;  &lt;p&gt;For example:&lt;/p&gt;  &lt;p&gt;Testing two symbol values for equality (or non-equality) is faster than testing two string values for equality,&lt;/p&gt;  &lt;p&gt;Note : Each unique string value has an associated symbol&lt;/p&gt;  &lt;p&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0.0001pt;"&gt;5. What is Session and Cookies?
&lt;br /&gt;Ans: &lt;span style=""&gt; &lt;/span&gt;Session: are used to store user information on the server side.
&lt;br /&gt;cookies: are used to store information on the browser side or we can say client side
&lt;br /&gt;Session : say session[:user] = “arunkumar” it remains when the browser is not closed&lt;/p&gt;  &lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;6. &lt;span style=""&gt; &lt;/span&gt;What is request.xhr?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Ans:&lt;span style=""&gt;  &lt;/span&gt;A request.xhr tells the controller that the new &lt;st1:city st="on"&gt;&lt;st1:place st="on"&gt;Ajax&lt;/st1:place&gt;&lt;/st1:city&gt; request has come, It always return Boolean values (TRUE or FALSE)&lt;/p&gt;  &lt;p&gt;7. What is MVC? and how it Works?
&lt;br /&gt;Ans: &lt;span style=""&gt; &lt;/span&gt;MVC tends for Model-View-Controller, used by many languages like PHP, Perl, Python etc. The flow goes like this: Request first comes to the controller, controller finds and appropriate view and interacts with model, model interacts with your database and send the response to controller then controller based on the response give the output parameter to view, for Example your url is something like this:
&lt;br /&gt;http://localhost:3000/users/new
&lt;br /&gt;here users is your controller and new is your method, there must be a file in your views/users folder named new.html.erb, so once the submit button is pressed, User model or whatever defined in the rhtml form_for syntax, will be called and values will be stored into the database.&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;8. What things we can define in the model?
&lt;br /&gt;Ans: &lt;span style=""&gt; &lt;/span&gt;There are lot of things you can define in models few are:
&lt;br /&gt;1. Validations (like validates_presence_of, numeracility_of, format_of etc.)
&lt;br /&gt;2. Relationships(like has_one, has_many, HABTM etc.)
&lt;br /&gt;3. Callbacks(like before_save, after_save, before_create etc.)
&lt;br /&gt;4. Suppose you installed a plugin say validation_group, So you can also define validation_group settings in your model
&lt;br /&gt;5. ROR Queries in Sql&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;6. Active record Associations&lt;span style=""&gt;  &lt;/span&gt;Relationship&lt;/p&gt;  &lt;p&gt;9. What is ORM in Rails?
&lt;br /&gt;Ans: &lt;span style=""&gt; &lt;/span&gt;ORM tends for Object-Relationship-Model, it means that your Classes are mapped to table in the database, and Objects are directly mapped to the rows in the table.&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;10. &lt;span style="font-family:times new roman;"&gt;How many Types of Associations&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;  &lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;Relationships does a Model has?&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt; font-family: times new roman;"&gt;Ans: When you have more than one model in your rails application, you would need to create connection between those models. You can do this via associations. Active Record supports three types of associations:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:10pt;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style="font-family: times new roman;"&gt;one-to-one : &lt;/b&gt;&lt;span style="font-family:times new roman;"&gt;A one-to-one relationship exists when one item has exactly one of another item. For example, a person has exactly one birthday or a dog has exactly one owner.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:arial;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:10pt;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style="font-family: times new roman;"&gt;one-to-many :&lt;/b&gt;&lt;span style="font-family:times new roman;"&gt; A one-to-many relationship exists when a single object can be a member of many other objects. For instance, one subject can have many books.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:arial;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:10pt;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style="font-family: times new roman;"&gt;many-to-many :&lt;/b&gt;&lt;span style="font-family:times new roman;"&gt; A many-to-many relationship exists when the first object is related to one or more of a second object, and the second object is related to one or many of the first object.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;      &lt;p&gt;You indicate these associations by adding declarations to your models: has_one, has_many, belongs_to, and has_and_belongs_to_many.&lt;/p&gt;  &lt;p&gt;11. Difference between render and redirect?
&lt;br /&gt;Ans: &lt;span style=";font-family:courier new;font-size:85%;"  &gt; &lt;/span&gt;&lt;/p&gt;  &lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b style=""&gt;render example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt; render :partial &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt; &lt;/span&gt;render :new&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;  &lt;/span&gt;It will render the template new.rhtml without&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt; &lt;span style=""&gt; &lt;/span&gt;calling or redirecting to the new action.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;
&lt;br /&gt;&lt;b style=""&gt;redirect example: &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt; &lt;/span&gt;redirect_to :controller =&gt; ‘users’, :action =&gt; ‘new’&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt; &lt;span style=""&gt; &lt;/span&gt;It forces the clients browser to request the&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;  &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;new action.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;12. What is the Difference between Static and Dynamic Scaffolding?
&lt;br /&gt;Ans:&lt;span style=""&gt;  &lt;/span&gt;The Syntax of Static Scaffold is like this:
&lt;br /&gt;ruby script/generate scaffold User Comment
&lt;br /&gt;Where Comment is the model and User is your controller, So all n all static scaffold takes 2 parameter i.e your controller name and model name, whereas in dynamic scaffolding you have to define controller and model one by one.&lt;/p&gt;  &lt;p&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;13. How you run your Rails Application&lt;span style=""&gt;  &lt;/span&gt;without creating database ?
&lt;br /&gt;Ans: You can run application by uncomment the line in environment.rb&lt;/p&gt;  &lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;Path =&gt; rootpath conf/ environment.rb&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;# Skip frameworks you're not going to use (only works if using vendor/rails)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;   &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt; &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;config.frameworks -= [ :action_web_service, :action_mailer,:active_record ]&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;14. How to use sql db or mysql db. without defining it in the database.yml
&lt;br /&gt;Ans: You can use &lt;span style="font-size:100%;"&gt;&lt;code&gt;ActiveRecord&lt;/code&gt;&lt;/span&gt; anywhere!&lt;/p&gt;  &lt;pre&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;code&gt;require 'rubygems'&lt;/code&gt;&lt;/span&gt;&lt;span style=";font-family:Courier;font-size:12pt;"  &gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;
&lt;br /&gt;&lt;code&gt;require 'active_record'&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;ActiveRecord::Base.establish_connection({&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;:adapter =&gt; 'postgresql',&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;:user =&gt; 'foo',&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;:password =&gt; 'bar',&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;:database =&gt; 'whatever'&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;})&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;class Task &lt;&gt;&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;set_table_tame "a_legacy_thingie"&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;def utility_methods&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;update_attribute(:title, "yep")&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;end&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;end&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;Task.find(:first)&lt;/code&gt;
&lt;br /&gt;Etcetera. It’s &lt;code&gt;ActiveRecord&lt;/code&gt;, you know what to do. Going wild:
&lt;br /&gt;&lt;code&gt;ActiveRecord::Base.establish_connection(:adapter =&gt; "sqlite3",
&lt;br /&gt;:dbfile =&gt; ":memory:")&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;ActiveRecord::Schema.define(:version =&gt; 1) do&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;create_table :posts do |t|&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;t.string :title&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;t.text :excerpt, :body&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;end&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;end&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;class Post &lt;&gt;&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;validates_presence_of :title&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;end&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;Post.create(:title =&gt; "A new post!")&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;Post.create(:title =&gt; "Another post",
&lt;br /&gt;:excerpt =&gt; "The excerpt is an excerpt.")&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;puts Post.count&lt;/code&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;a href="http://stuff.lilleaas.net/active_record_anywhere"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;15. What are helpers and how to use helpers in ROR?
&lt;br /&gt;Ans: &lt;span style=""&gt; &lt;/span&gt;Helpers (“view helpers”) are modules that provide methods which are automatically usable in your view. They provide shortcuts to commonly used display code and a way for you to keep the programming out of your views. The purpose of a helper is to simplify the view. It’s best if the view file (RHTML/RXML) is short and sweet, so you can see the structure of the output.&lt;/p&gt;  &lt;p&gt;16. What is Active Record?
&lt;br /&gt;Ans: &lt;span style=""&gt; &lt;/span&gt;Active Record are like Object Relational Mapping(ORM), where classes are mapped to table , objects are mapped to columns &lt;span style=""&gt; &lt;/span&gt;and object attributes are mapped to data in the table&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;17. Ruby Support Single Inheritance/Multiple Inheritance or Both?
&lt;br /&gt;Ans: &lt;span style=""&gt; &lt;/span&gt;Ruby Supports only Single Inheritance.&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;You can achieve Multiple Inheritance through MIXIN concept means you achieve using module by including it with classes. &lt;/p&gt;  &lt;p&gt;18. How many types of callbacks available in ROR?
&lt;br /&gt;Ans: &lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;ul  style="font-family:courier new;"&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:10pt;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;(-) save&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;(-) valid&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;  &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(1) before_validation&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;(2) before_validation_on_create&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(-) validate&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(-) validate_on_create&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(3) after_validation&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(4) after_validation_on_create&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(5) before_save&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(6) before_create&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(-) create&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(7) after_create&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(8) after_save&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;                   &lt;h2 style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-weight: normal;font-size:100%;" &gt;19. &lt;span style=""&gt; &lt;/span&gt;What can Rails Migration do?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-weight: normal;font-size:12pt;" &gt;&lt;span style="font-size:100%;"&gt;Ans:&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;ul&gt;&lt;li  style="font-family:verdana;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:10pt;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;create_table(name, options)&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:courier new;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;drop_table(name)&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:courier new;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;rename_table(old_name, new_name)&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:courier new;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;add_column(table_name, column_name, type, options)&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:courier new;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;rename_column(table_name, column_name, new_column_name)&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:courier new;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;change_column(table_name, column_name, type, options)&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:courier new;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;remove_column(table_name, column_name)&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:courier new;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;add_index(table_name, column_name, index_type)&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:courier new;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;remove_index(table_name, column_name)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;                  &lt;p&gt;&lt;b&gt;Migrations support all the basic data types:&lt;/b&gt; string, text, integer, float, datetime, timestamp, time, date, binary and boolean:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Wingdings;font-size:10pt;"  &gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;b&gt;string -&lt;/b&gt; is for small data types such as a title.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:georgia;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;b style="font-family: courier new;"&gt;text -&lt;/b&gt;&lt;span style="font-family:courier new;"&gt; is for longer pieces of textual data, such as the description&lt;/span&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:georgia;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;b&gt;integer -&lt;/b&gt; is for whole numbers.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:georgia;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;b&gt;float -&lt;/b&gt; is for decimals.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:georgia;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;b&gt;datetime and timestamp -&lt;/b&gt; store the date and time into a column.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:georgia;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;b style="font-family: courier new;"&gt;date and time -&lt;/b&gt;&lt;span style="font-family:courier new;"&gt; store either the date only or time only&lt;/span&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:georgia;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;b style="font-family: courier new;"&gt;binary -&lt;/b&gt;&lt;span style="font-family:courier new;"&gt; is for storing data such as images, audio, or movie&lt;/span&gt;s.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:georgia;"&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;&lt;b style="font-family: courier new;"&gt;boolean -&lt;/b&gt;&lt;span style="font-family:courier new;"&gt; is for storing true or false values&lt;/span&gt;.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;                &lt;p&gt;Valid column options are:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Wingdings;font-size:10pt;"  &gt;&lt;span style=""&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:85%;"&gt;&lt;strong style="font-family: courier new;"&gt;limit&lt;/strong&gt;&lt;span style="font-family:courier new;"&gt; ( :limit =&gt; “50” )&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;strong style="font-family: courier new;"&gt;default&lt;/strong&gt;&lt;span style="font-family:courier new;"&gt; (:default =&gt; “blah” &lt;/span&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:85%;"&gt;&lt;strong style="font-family: courier new;"&gt;null&lt;/strong&gt;&lt;span style="font-family:courier new;"&gt; (:null =&gt; false implies NOT NULL&lt;/span&gt;)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt; &lt;p style="margin: 0in 0in 0.0001pt;"&gt;20. What is the naming conventions for methods that return a boolean result?&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: Methods that return a boolean result are typically named with a ending question mark. For example: def active? return true #just always returning true end&lt;/p&gt;&lt;p style="margin: 0in 0in 0.0001pt;"&gt;
&lt;br /&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;21. How do the following methods differ: @my_string.strip and @my_string.strip! ?&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: The strip! method modifies the variable directly. Calling strip (without the !) returns a copy of the variable with the modifications, the original variable is not altered.&lt;/p&gt;  &lt;p&gt;22. What's the difference in scope for these two variables: @name and @@name?&lt;/p&gt;&lt;p&gt; Ans: @name is an instance variable and @@name is a class variable&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;23. What is the log that has to seen to check for an error in ruby rails? &lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: Rails will report errors from Apache in log/apache.log and errors from the Ruby code in log/development.log. If you're having a problem, do have a look at what these logs are saying. On Unix and Mac OS X you may run tail -f log/development.log in a separate terminal to monitor your application's execution.&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;24. What is the use of global variable $ in Ruby?&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: A class variable starts with an @@ sign which is immediately followed by upper or lower case letter. You can also put some name characters after the letters which stand to be a pure optional. A class variable can be shared among all the objects of a class. A single copy of a class variable exists for each and every given class.
&lt;br /&gt;To write a global variable you start the variable with a $ sign which should be followed by a name character. Ruby defines a number of global variables which also include other punctuation characters such as $_ and $-k.&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;For example:&lt;span style=""&gt;  &lt;/span&gt;If you declare one variable as global we can access any where, where as class variable visibility only in the classÂ Example
&lt;br /&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style="font-family:courier new;"&gt;class Test&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;def h&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Â $a = 5&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Â @b = 4&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Â&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;while $a &gt; 0&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;puts $a&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$a= $a - 1&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;test = Test.new&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;test.h&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;puts $aÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â # 5&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;puts @bÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â #nil&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0in 0in 0.0001pt;"&gt;
&lt;br /&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;25. Where does the start_tabnav gets informations for tabs rendering in ruby rail?&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: The main Symbol let the start_tabnav method know to look for a special MainTabnav class where all the magic happens&lt;/p&gt;&lt;p style="margin: 0in 0in 0.0001pt;"&gt;
&lt;br /&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;26. What is the Install rail package? &lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: There are several packages that you can download and install. The prebuilt Rails installer called Install rail which currently is only for Windows&lt;/p&gt;  &lt;p style="margin-bottom: 0.0001pt;"&gt;27. What is the log that has to seen to check for an error in ruby rails? &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Ans: Rails will report errors from Apache in log/apache.log and errors from the Ruby code in log/development.log. If you're having a problem, do have a look at what these logs are saying. On Unix and Mac OS X you may run tail -f log/development.log in a separate terminal to monitor your application's execution.
&lt;br /&gt;
&lt;br /&gt;28. What is the use of super in ruby rails?
&lt;br /&gt;Ans: Ruby uses the super keyword to call the superclass (Parent class) implementation of the current method&lt;/p&gt;  &lt;p class="MsoNormal"&gt;
&lt;br /&gt;29. What is the difference between nil and false in ruby?
&lt;br /&gt;Ans: False is a boolean datatype, Nil is not a data type it have object_id 4
&lt;br /&gt;
&lt;br /&gt;30. How is class methods defined in Ruby?
&lt;br /&gt;Ans: &lt;span style="font-family:courier new;"&gt;A:def self.methodname&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;--------&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;--------&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;or&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;def classname.methodname&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;--------&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;--------&lt;/span&gt;
&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;31. How is object methods defined in Ruby?
&lt;br /&gt;Ans:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;class jak&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;def method1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style=""&gt;   &lt;/span&gt;--------
&lt;br /&gt;&lt;span style=""&gt;   &lt;/span&gt;--------
&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;end&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;end
&lt;br /&gt;&lt;!--[if !supportLineBreakNewLine]--&gt;
&lt;br /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;obj=jak.new&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Courier;"&gt;It is single object
&lt;br /&gt;def obj.object_method_one
&lt;br /&gt;--------
&lt;br /&gt;--------
&lt;br /&gt;end&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-family: courier new;" class="MsoNormal"&gt;obj.Send(object_method_every)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;It will be created every for every object creation
&lt;br /&gt;
&lt;br /&gt;32. What are the priority of operators available in Ruby ?
&lt;br /&gt;Ans: &lt;span style=""&gt; &lt;/span&gt;Something that used in an expression to manipulate objects such as + (plus), - (minus), * (multiply), and / (divide). You can also use operators to do comparisons,such as with &lt;, &gt;, and &amp;amp;&amp;amp;. The priority is based on "BODMAS"
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;33. What are the looping structures available in Ruby?&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: &lt;span style=""&gt; &lt;/span&gt;&lt;span style="font-family:Courier;"&gt;for..in
&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;untill..end
&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;while..end
&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;do..end&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Note: You can also use each&lt;span style=""&gt;  &lt;/span&gt;to iterate a array as loop not exactly like loop&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;34. What are the object-oriented programming features supported by Ruby and how multiple inheritance supported in ?&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: Classes,Objects,Inheritance,Singleton methods,polymorphism(accomplished by over riding and overloading) are some oo concepts supported by ruby. Multiple inheritance supported using Mixin concept.
&lt;br /&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;35. What is the scope of a local variable in Ruby and define it scope ?&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: A new scope for a local variable is introduced in the toplevel, a class (module) definition, a method defintion. In a procedure block a new scope is introduced but you can access to a local variable outside the block.
&lt;br /&gt;The scope in a block is special because a local variable should be localized in Thread and Proc objects.&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;36. How is an enumerator iterator handled in Ruby?&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: Iterator is handled using keyword 'each' in ruby.
&lt;br /&gt;For example
&lt;br /&gt;&lt;span style="font-family:Courier;"&gt;number=[1,2,3]
&lt;br /&gt;then we can use iterator as
&lt;br /&gt;number.each do |i|
&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;puts i
&lt;br /&gt;&lt;/span&gt;end
&lt;br /&gt;Above prints the values of an array $no which is accomplished using iterator.&lt;/p&gt;  &lt;p style="margin-bottom: 0.0001pt;"&gt;37. How is visibility of methods changed in Ruby (Encapsulation)? &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Ans: By applying the access modifier : Public , Private and Protected access Modifier&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;38. What is the use of load,require, auto_load,require_relative in Ruby? &lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Ans: A method that loads and processes the Ruby code from a separate file, including whatever classes, modules, methods, and constants are in that file into the current scope. load is similar, but rather than performing the inclusion operation once, it reprocesses the code every time load is called.&lt;/p&gt;&lt;p style="margin: 0in 0in 0.0001pt;"&gt;auto_load - Whenever the interpreter call the method that time only it will initiate the method in hat file.&lt;/p&gt;&lt;p style="margin: 0in 0in 0.0001pt;"&gt;require_relative - It it to load local folder files.
&lt;br /&gt;&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;/p&gt;
&lt;br /&gt;&lt;p class="MsoNormal"&gt;More Questions:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;1. Explain choose_weighted method with example &lt;/p&gt;  &lt;p class="MsoNormal"&gt;2. What is GIL in ruby ?
&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;3. Is variable is a object ?&lt;/p&gt;&lt;p class="MsoNormal"&gt;    Ans : Variable is not an object
&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;4. List of protocols supported by ruby ?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;5. Explain Virtual attribute ?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;6. How to validate and modify attribute value ?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;7. How to serialize data with YAML ?&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;More Questions and Answers of this will be published very soon , So stay in touch.. I will keep you updating.....&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8654375134827389820-8065552954347066200?l=railsbuilder.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://railsbuilder.blogspot.com/2009/04/ruby-on-rails-interview-questions.html</link><author>noreply@blogger.com (Rails builder)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_44rn_CkFp1w/SewXvqup-kI/AAAAAAAAATY/_ItmGa0A7Rg/s72-c/interview-reduced.jpg" height="72" width="72" /><thr:total>17</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8654375134827389820.post-8118486653555615879</guid><pubDate>Tue, 20 Jan 2009 12:37:00 +0000</pubDate><atom:updated>2009-01-29T01:44:43.092-08:00</atom:updated><title>A to Z DOS Command-Line Tricks for XP</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_44rn_CkFp1w/SXXGtE20j1I/AAAAAAAAAJc/HgbMtVtMdT4/s1600-h/DOS+Command+Window.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 233px; height: 155px;" src="http://4.bp.blogspot.com/_44rn_CkFp1w/SXXGtE20j1I/AAAAAAAAAJc/HgbMtVtMdT4/s320/DOS+Command+Window.jpg" alt="" id="BLOGGER_PHOTO_ID_5293355414743977810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Typing DOS commands on the Windows Command Line prompt is a most efficient and faster way of doing things in Windows XP. Here's a run-down of the most useful DOS commands available in Windows XP. Some of these DOS commands even do not have an visual alternative.&lt;br /&gt;&lt;br /&gt;DOS Command-line tools must be run at the prompt of the Cmd.exe command interpreter. To open Command Prompt, click Start, click Run, type cmd, and then click OK.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;ipconfig&lt;/span&gt; - Windows IP configuration&lt;/b&gt;&lt;br /&gt;Useful for troubleshooting your internet connection. Displays the current IP address of your computer and the DNS server address. If you call your ISP for reporting a bad internet connection, he will probably ask you to run ipconfig.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;fc&lt;/span&gt; - Free BeyondCompare in XP&lt;/b&gt;&lt;br /&gt;FC is an advanced DOS Command that compares two files and displays the differences between them. Though the file comparison results are not as interactive as BeyondCompare or Altova DiffDog, fc is still very useful. You can even set fc to resynchronize the files after finding a mismatch.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;type&lt;/span&gt; - open text files sans Notepad&lt;/b&gt;&lt;br /&gt;Similar to Unix cat command, Type is my favorite DOS command for displaying the contents of a text files without modifying them. When used in combination with more switch, type splits the contents of lengthy text files into multiple pages. Avoid using the type command with binary files or you'll hear alien PC beeps and see some greek characters on your PC.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;ping&lt;/span&gt; - Say hello to another computer&lt;/b&gt;&lt;br /&gt;Ping network command followed by the web-address or IP address tells you about the health of the connection and whether the other party is responding to your handshake request. Ping tool can also be used to convert the web address to a physical IP address.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;tree&lt;/span&gt; - visual directory structure&lt;/b&gt;&lt;br /&gt;You often need to take prints of your physical directory structure but XP has no simple "visual" commands for printing directory contents. Here, try the Tree DOS command and redirect the output to a text file.&lt;br /&gt;&lt;br /&gt;tree &gt; mydirectory.txt&lt;br /&gt;print mydirectory.txt&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;attrib&lt;/span&gt; - make hidden files visible&lt;/b&gt;&lt;br /&gt;Attrib lets you change attributes of System files and even hidden files. This is great for troubleshooting Windows XP. Say your XP doesn't boot ever since you edited that startup boot.ini file (Hidden), use attrib to remove the Hidden attibute and edit the file using EDIT dos command.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;assoc&lt;/span&gt; - which program will open that .xyz file&lt;/b&gt;&lt;br /&gt;The assoc DOS command can be used to either isplay or even modify the file name extension associations. The command &lt;b&gt;assoc .htm&lt;/b&gt; will quickly tell you the name of your default web browser (see picture)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;move&lt;/span&gt; - more flexible than copy-paste&lt;/b&gt;&lt;br /&gt;Say you got a lot of XLS and DOC files in you MyDocuments folder and want to move only those XLS files that have their name ending with 2006. In XP Explorer, you have to manually select each file and then cut-paste to another folder. However, the DOS move command make things much simpler. Just type the following at the command prompt:&lt;br /&gt;&lt;b&gt;move *2006.xls c:\2006Reports\&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;find&lt;/span&gt; - advanced file search with filter&lt;/b&gt;&lt;br /&gt;Find is the most powerful DOS command and even more useful than the Windows Desktop Search tool or the Windows Find Wizard. The find command searches for a specific string of text in a file or files. After searching the specified file or files, find displays any lines of text that contain the specified string.&lt;br /&gt;&lt;br /&gt;To search your hard disk to find and display the file names on drive C: that contain the string "Google" use the pipe (|) to direct the results of a dir command to find as follows:&lt;br /&gt;dir c:\ /s /b | find "Google"&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;Quick tip&lt;/span&gt; - Drag to avoid typing&lt;/b&gt;: When your command acts on a file or folder, you must type the path to that folder after the command. You can save typing time by dragging the file or folder from Windows Explorer into the command window.&lt;br /&gt;&lt;br /&gt;To view help at the command-line, at the command prompt, type the following:&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;CommandName /?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Run Commands&lt;br /&gt;&lt;br /&gt;  start&gt; run and enter the following commands:&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;appwiz.cpl&lt;/span&gt; -- Used to run Add/Remove wizard&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Calc&lt;/span&gt; --Calculator&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Cfgwiz32&lt;/span&gt; --ISDN Configuration Wizard&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Charmap&lt;/span&gt; --Character Map&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Chkdisk&lt;/span&gt; --Repair damaged files&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Cleanmgr &lt;/span&gt;--Cleans up hard drives&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Clipbrd&lt;/span&gt; --Windows Clipboard viewer&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Control &lt;/span&gt;--Displays Control Panel&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Cmd&lt;/span&gt; --Opens a new Command Window&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Control mouse&lt;/span&gt; --Used to control mouse properties&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Dcomcnfg&lt;/span&gt; --DCOM user security&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Debug&lt;/span&gt; --Assembly language programming tool&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Defrag&lt;/span&gt; --Defragmentation tool&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Drwatson&lt;/span&gt; --Records programs crash &amp;amp; snapshots&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Dxdiag &lt;/span&gt;--DirectX Diagnostic Utility&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Explorer&lt;/span&gt; --Windows Explorer&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Fontview&lt;/span&gt; --Graphical font viewer&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Fsmgmt.msc&lt;/span&gt; -- Used to open shared folders&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Firewall.cpl&lt;/span&gt;  -- Used to configure windows firewall&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Ftp&lt;/span&gt; -ftp.exe program&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Hostname&lt;/span&gt; --Returns Computer's name&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Hdwwiz.cpl&lt;/span&gt; -- Used to run Add Hardware wizard&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Ipconfig&lt;/span&gt; --Displays IP configuration for all network adapters&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Logoff &lt;/span&gt;-- Used to logoff the computer&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;MMC&lt;/span&gt; --Microsoft Management Console&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Msconfig&lt;/span&gt; --Configuration to edit startup files&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Mstsc&lt;/span&gt; -- Used to access remote desktop&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Mrc&lt;/span&gt; -- Malicious Software Removal Tool&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Msinfo32&lt;/span&gt; --Microsoft System Information Utility&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Nbtstat&lt;/span&gt; --Displays stats and current connections using NetBIOS over TCP/IP&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Netstat&lt;/span&gt; --Displays all active network connections&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Nslookup&lt;/span&gt;--Returns your local DNS server&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Osk&lt;/span&gt; ---Used to access on screen keyboard&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Perfmon.msc&lt;/span&gt; -- Used to configure the performance of Monitor.&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Ping&lt;/span&gt; --Sends data to a specified host/IP&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Powercfg.cpl&lt;/span&gt; -- Used to configure power option&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Regedit&lt;/span&gt; --Registry Editor&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Regwiz&lt;/span&gt; -- Registration wizard&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Sfc /scannow&lt;/span&gt; -- System File Checker&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Sndrec32 &lt;/span&gt;--Sound Recorder&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Shutdown&lt;/span&gt; -- Used to shutdown the windows&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Spider&lt;/span&gt; -- Used to open spider solitaire card game&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Sfc / scannow&lt;/span&gt; -- Used to run system file checker utility.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Sndvol32&lt;/span&gt; --Volume control for soundcard&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Sysedit&lt;/span&gt; -- Edit system startup files&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Taskmgr&lt;/span&gt; --Task manager&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Telephon.cpl&lt;/span&gt; -- Used to configure modem options.&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Telnet&lt;/span&gt; --Telnet program&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Tracert&lt;/span&gt; --Traces and displays all paths required to reach an internet host&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Winchat&lt;/span&gt; -- Used to chat with Microsoft&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Wmplayer&lt;/span&gt; -- Used to run Windows Media player&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Wab&lt;/span&gt; -- Used to open Windows address Book.&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;WinWord&lt;/span&gt; -- Used to open Microsoft word&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Winipcfg &lt;/span&gt;--Displays IP configuration&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Winver&lt;/span&gt; -- Used to check Windows Version&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;    Wupdmgr&lt;/span&gt; --Takes you to Microsoft Windows Update&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 255, 51);"&gt;Write&lt;/span&gt; -- Used to open WordPad&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;h1 style="color: rgb(51, 255, 51);"&gt;An A-Z Index of the &lt;span class="blu"&gt;Windows XP&lt;/span&gt; command line&lt;/h1&gt; &lt;pre&gt;   &lt;a href="http://www.ss64.com/nt/addusers.html"&gt;ADDUSERS&lt;/a&gt; Add or list users to/from a CSV file&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/arp.html"&gt;ARP&lt;/a&gt;      Address Resolution Protocol&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/assoc.html"&gt;ASSOC&lt;/a&gt;    Change file extension associations&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/associate.html"&gt;ASSOCIAT&lt;/a&gt; One step file association&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/at.html"&gt;AT&lt;/a&gt;       Schedule a command to run at a later time&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/attrib.html"&gt;ATTRIB&lt;/a&gt;   Change file attributes&lt;br /&gt;b&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/bootcfg.html"&gt;BOOTCFG&lt;/a&gt;  Edit Windows boot settings&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/browstat.html"&gt;BROWSTAT&lt;/a&gt; Get domain, browser and PDC info&lt;br /&gt;c&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/cacls.html"&gt;CACLS&lt;/a&gt;    Change file permissions&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/call.html"&gt;CALL&lt;/a&gt;     Call one batch program from another&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/cd.html"&gt;CD&lt;/a&gt;       Change Directory - move to a specific Folder&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/change.html"&gt;CHANGE&lt;/a&gt;   Change Terminal Server Session properties&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/chkdsk.html"&gt;CHKDSK&lt;/a&gt;   Check Disk - check and repair disk problems&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/chkntfs.html"&gt;CHKNTFS&lt;/a&gt;  Check the NTFS file system&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/choice.html"&gt;CHOICE&lt;/a&gt;   Accept keyboard input to a batch file&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/cipher.html"&gt;CIPHER&lt;/a&gt;   Encrypt or Decrypt files/folders&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/cleanmgr.html"&gt;CleanMgr&lt;/a&gt; Automated cleanup of Temp files, recycle bin&lt;br /&gt;  CLEARMEM Clear memory leaks&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/clip.html"&gt;CLIP&lt;/a&gt;     Copy STDIN to the Windows clipboard.&lt;br /&gt;~ CLS      Clear the screen&lt;br /&gt;  CLUSTER  Windows Clustering&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/cmd.html"&gt;CMD&lt;/a&gt;      Start a new CMD shell&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/color.html"&gt;COLOR&lt;/a&gt;    Change colors of the CMD window&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/comp.html"&gt;COMP&lt;/a&gt;     Compare the contents of two files or sets of files&lt;br /&gt;  COMPACT  Compress files or folders on an NTFS partition&lt;br /&gt;  COMPRESS Compress individual files on an NTFS partition&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/con2prt.html"&gt;CON2PRT&lt;/a&gt;  Connect or disconnect a Printer&lt;br /&gt;  CONVERT  Convert a FAT drive to NTFS.&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/copy.html"&gt;COPY&lt;/a&gt;     Copy one or more files to another location&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/csccmd.html"&gt;CSCcmd&lt;/a&gt;   Client-side caching (Offline Files)&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/csvde.html"&gt;CSVDE&lt;/a&gt;    Import or Export Active Directory data&lt;br /&gt;d&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/date.html"&gt;DATE&lt;/a&gt;     Display or set the date&lt;br /&gt;  Dcomcnfg DCOM Configuration Utility&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/defrag.html"&gt;DEFRAG&lt;/a&gt;   Defragment hard drive&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/del.html"&gt;DEL&lt;/a&gt;      Delete one or more files&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/delprof.html"&gt;DELPROF&lt;/a&gt;  Delete NT user profiles&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/del.html"&gt;DELTREE&lt;/a&gt;  Delete a folder and all subfolders&lt;br /&gt;  &lt;a href="http://support.microsoft.com/?kbid=311272"&gt;DevCon&lt;/a&gt;   Device Manager Command Line Utility&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/dir.html"&gt;DIR&lt;/a&gt;      Display a list of files and folders&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/diruse.html"&gt;DIRUSE&lt;/a&gt;   Display disk usage&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/diskcomp.html"&gt;DISKCOMP&lt;/a&gt; Compare the contents of two floppy disks&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/diskcopy.html"&gt;DISKCOPY&lt;/a&gt; Copy the contents of one floppy disk to another&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/diskpart.html"&gt;DISKPART&lt;/a&gt; Disk Administration&lt;br /&gt;  DNSSTAT  DNS Statistics&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/doskey.html"&gt;DOSKEY&lt;/a&gt;   Edit command line, recall commands, and create macros&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/dsadd.html"&gt;DSADD&lt;/a&gt;    Add user (computer, group..) to active directory&lt;br /&gt;  DSQUERY  List items in active directory&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/dsmod.html"&gt;DSMOD&lt;/a&gt;    Modify user (computer, group..) in active directory&lt;br /&gt;e&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/echo.html"&gt;ECHO&lt;/a&gt;     Display message on screen&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/endlocal.html"&gt;ENDLOCAL&lt;/a&gt; End localisation of environment changes in a batch file&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/del.html"&gt;ERASE&lt;/a&gt;    Delete one or more files&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/exit.html"&gt;EXIT&lt;/a&gt;     Quit the current script/routine and set an errorlevel.&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/expand.html"&gt;EXPAND&lt;/a&gt;   Uncompress files&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/extract.html"&gt;EXTRACT&lt;/a&gt;  Uncompress CAB files&lt;br /&gt;f&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/fc.html"&gt;FC&lt;/a&gt;       Compare two files&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/find.html"&gt;FIND&lt;/a&gt;     Search for a text string in a file&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/findstr.html"&gt;FINDSTR&lt;/a&gt;  Search for strings in files&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/for_f.html"&gt;FOR /F&lt;/a&gt;   Loop command: against a set of files&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/for_cmd.html"&gt;FOR /F&lt;/a&gt;   Loop command: against the results of another command&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/for.html"&gt;FOR&lt;/a&gt;      Loop command: all options Files, Directory, List&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/forfiles.html"&gt;FORFILES&lt;/a&gt; Batch process multiple files&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/format.html"&gt;FORMAT&lt;/a&gt;   Format a disk&lt;br /&gt;  FREEDISK Check free disk space (in bytes)&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/fsutil.html"&gt;FSUTIL&lt;/a&gt;   File and Volume utilities&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/ftp.html"&gt;FTP&lt;/a&gt;      File Transfer Protocol&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/ftype.html"&gt;FTYPE&lt;/a&gt;    Display or modify file types used in file extension associations&lt;br /&gt;g&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/global.html"&gt;GLOBAL&lt;/a&gt;   Display membership of global groups&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/goto.html"&gt;GOTO&lt;/a&gt;     Direct a batch program to jump to a labelled line&lt;br /&gt;h&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/help.html"&gt;HELP&lt;/a&gt;     Online Help&lt;br /&gt;i&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/if.html"&gt;IF&lt;/a&gt;       Conditionally perform a command&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/ifmember.html"&gt;IFMEMBER&lt;/a&gt; Is the current user in an NT Workgroup&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/ipconfig.html"&gt;IPCONFIG&lt;/a&gt; Configure IP&lt;br /&gt;k&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/kill.html"&gt;KILL&lt;/a&gt;     Remove a program from memory&lt;br /&gt;l&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/label.html"&gt;LABEL&lt;/a&gt;    Edit a disk label&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/local.html"&gt;LOCAL&lt;/a&gt;    Display membership of local groups&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/logevent.html"&gt;LOGEVENT&lt;/a&gt; Write text to the NT event viewer.&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/logoff.html"&gt;LOGOFF&lt;/a&gt;   Log a user off&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/logtime.html"&gt;LOGTIME&lt;/a&gt;  Log the date and time in a file&lt;br /&gt;m&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/mapisend.html"&gt;MAPISEND&lt;/a&gt; Send email from the command line&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/mbsacli.html"&gt;MBSAcli&lt;/a&gt;  Baseline Security Analyzer.&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/mem.html"&gt;MEM&lt;/a&gt;      Display memory usage&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/md.html"&gt;MD&lt;/a&gt;       Create new folders&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/mklink.html"&gt;MKLINK&lt;/a&gt;   Create a symbolic link (linkd)&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/mode.html"&gt;MODE&lt;/a&gt;     Configure a system device&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/more.html"&gt;MORE&lt;/a&gt;     Display output, one screen at a time&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/mountvol.html"&gt;MOUNTVOL&lt;/a&gt; Manage a volume mount point&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/move.html"&gt;MOVE&lt;/a&gt;     Move files from one folder to another&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/moveuser.html"&gt;MOVEUSER&lt;/a&gt; Move a user from one domain to another&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/msg.html"&gt;MSG&lt;/a&gt;      Send a message&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/msiexec.html"&gt;MSIEXEC&lt;/a&gt;  Microsoft Windows Installer&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/msinfo.html"&gt;MSINFO&lt;/a&gt;   Windows NT diagnostics&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/mstsc.html"&gt;MSTSC&lt;/a&gt;    Terminal Server Connection (Remote Desktop Protocol)&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/munge.html"&gt;MUNGE&lt;/a&gt;    Find and Replace text within file(s)&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/mv.html"&gt;MV&lt;/a&gt;       Copy in-use files&lt;br /&gt;n&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/net.html"&gt;NET&lt;/a&gt;      Manage network resources&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/netdom.html"&gt;NETDOM&lt;/a&gt;   Domain Manager&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/netsh.html"&gt;NETSH&lt;/a&gt;    Configure network protocols&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/netsvc.html"&gt;NETSVC&lt;/a&gt;   Command-line Service Controller&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/nbtstat.html"&gt;NBTSTAT&lt;/a&gt;  Display networking statistics (NetBIOS over TCP/IP)&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/netstat.html"&gt;NETSTAT&lt;/a&gt;  Display networking statistics (TCP/IP)&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/now.html"&gt;NOW&lt;/a&gt;      Display the current Date and Time&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/nslookup.html"&gt;NSLOOKUP&lt;/a&gt; Name server lookup&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/ntbackup.html"&gt;NTBACKUP&lt;/a&gt; Backup folders to tape&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/ntrights.html"&gt;NTRIGHTS&lt;/a&gt; Edit user account rights&lt;br /&gt;p&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/path.html"&gt;PATH&lt;/a&gt;     Display or set a search path for executable files&lt;br /&gt; &lt;a href="http://www.ss64.com/nt/pathping.html"&gt; PATHPING&lt;/a&gt; Trace route plus network latency and packet loss&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/pause.html"&gt;PAUSE&lt;/a&gt;    Suspend processing of a batch file and display a message&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/perms.html"&gt;PERMS&lt;/a&gt;    Show permissions for a user&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/monitor.html"&gt;PERFMON&lt;/a&gt;  Performance Monitor&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/ping.html"&gt;PING&lt;/a&gt;     Test a network connection&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/popd.html"&gt;POPD&lt;/a&gt;     Restore the previous value of the current directory saved by PUSHD&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/portqry.html"&gt;PORTQRY&lt;/a&gt;  Display the status of ports and services&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/print.html"&gt;PRINT&lt;/a&gt;    Print a text file&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/prncnfg.html"&gt;PRNCNFG&lt;/a&gt;  Display, configure or rename a printer&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/prnmngr.html"&gt;PRNMNGR&lt;/a&gt;  Add, delete, list printers set the default printer&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/prompt.html"&gt;PROMPT&lt;/a&gt;   Change the command prompt&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/psexec.html"&gt;PsExec&lt;/a&gt;     Execute process remotely&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/psfile.html"&gt;PsFile&lt;/a&gt;     Show files opened remotely&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/psgetsid.html"&gt;PsGetSid&lt;/a&gt;   Display the SID of a computer or a user&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/psinfo.html"&gt;PsInfo&lt;/a&gt;     List information about a system&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/pskill.html"&gt;PsKill&lt;/a&gt;     Kill processes by name or process ID&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/pslist.html"&gt;PsList&lt;/a&gt;     List detailed information about processes&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/psloggedon.html"&gt;PsLoggedOn&lt;/a&gt; Who's logged on (locally or via resource sharing)&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/psloglist.html"&gt;PsLogList&lt;/a&gt;  Event log records&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/pspasswd.html"&gt;PsPasswd&lt;/a&gt;   Change account password&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/psservice.html"&gt;PsService&lt;/a&gt;  View and control services&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/psshutdown.html"&gt;PsShutdown&lt;/a&gt; Shutdown or reboot a computer&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/pssuspend.html"&gt;PsSuspend&lt;/a&gt;  Suspend processes&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/pushd.html"&gt;PUSHD&lt;/a&gt;    Save and then change the current directory&lt;br /&gt;q&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/qgrep.html"&gt;QGREP&lt;/a&gt;    Search file(s) for lines that match a given pattern.&lt;br /&gt;r&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/rasdial.html"&gt;RASDIAL&lt;/a&gt;  Manage RAS connections&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/rasphone.html"&gt;RASPHONE&lt;/a&gt; Manage RAS connections&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/recover.html"&gt;RECOVER&lt;/a&gt;  Recover a damaged file from a defective disk.&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/reg.html"&gt;REG&lt;/a&gt;      Registry: Read, Set, Export, Delete keys and values&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/regedit.html"&gt;REGEDIT&lt;/a&gt;  Import or export registry settings&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/regsvr32.html"&gt;REGSVR32&lt;/a&gt; Register or unregister a DLL&lt;br /&gt;  &lt;a href="http://support.microsoft.com/?kbid=245031"&gt;REGINI&lt;/a&gt;   Change Registry Permissions&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/rem.html"&gt;REM&lt;/a&gt;      Record comments (remarks) in a batch file&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/ren.html"&gt;REN&lt;/a&gt;      Rename a file or files.&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/replace.html"&gt;REPLACE&lt;/a&gt;  Replace or update one file with another&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/rd.html"&gt;RD&lt;/a&gt;       Delete folder(s)&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/rmtshare.html"&gt;RMTSHARE&lt;/a&gt; Share a folder or a printer&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/robocopy.html"&gt;ROBOCOPY&lt;/a&gt; Robust File and Folder Copy&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/route.html"&gt;ROUTE&lt;/a&gt;    Manipulate network routing tables&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/runas.html"&gt;RUNAS&lt;/a&gt;    Execute a program under a different user account&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/rundll32.html"&gt;RUNDLL32&lt;/a&gt; Run a DLL command (add/remove print connections)&lt;br /&gt;s&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/sc.html"&gt;SC&lt;/a&gt;       Service Control&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/schtasks.html"&gt;SCHTASKS&lt;/a&gt; Create or Edit Scheduled Tasks&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/sclist.html"&gt;SCLIST&lt;/a&gt;   Display NT Services&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/set.html"&gt;SET&lt;/a&gt;      Display, set, or remove environment variables&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/setlocal.html"&gt;SETLOCAL&lt;/a&gt; Control the visibility of environment variables&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/setx.html"&gt;SETX&lt;/a&gt;     Set environment variables permanently&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/share.html"&gt;SHARE&lt;/a&gt;    List or edit a file share or print share&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/shift.html"&gt;SHIFT&lt;/a&gt;    Shift the position of replaceable parameters in a batch file&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/shortcut.html"&gt;SHORTCUT&lt;/a&gt; Create a windows shortcut (.LNK file)&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/showgrps.html"&gt;SHOWGRPS&lt;/a&gt; List the NT Workgroups a user has joined&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/showmbrs.html"&gt;SHOWMBRS&lt;/a&gt; List the Users who are members of a Workgroup&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/shutdown.html"&gt;SHUTDOWN&lt;/a&gt; Shutdown the computer&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/sleep.html"&gt;SLEEP&lt;/a&gt;    Wait for x seconds&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/soon.html"&gt;SOON&lt;/a&gt;     Schedule a command to run in the near future&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/sort.html"&gt;SORT&lt;/a&gt;     Sort input&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/start.html"&gt;START&lt;/a&gt;    Start a program or command in a separate window.&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/su.html"&gt;SU&lt;/a&gt;       Switch User&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/subinacl.html"&gt;SUBINACL&lt;/a&gt; Edit file and folder Permissions, Ownership and Domain&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/subst.html"&gt;SUBST&lt;/a&gt;    Associate a path with a drive letter&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/systeminfo.html"&gt;SYSTEMINFO&lt;/a&gt; List system configuration&lt;br /&gt;t&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/tasklist.html"&gt;TASKLIST&lt;/a&gt; List running applications and services&lt;br /&gt;  TASKKILL Remove a running process from memory&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/time.html"&gt;TIME&lt;/a&gt;     Display or set the system time&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/timeout.html"&gt;TIMEOUT&lt;/a&gt;  Delay processing of a batch file&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/title.html"&gt;TITLE&lt;/a&gt;    Set the window title for a CMD.EXE session&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/tlist.html"&gt;TLIST&lt;/a&gt;    Task list with full path&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/touch.html"&gt;TOUCH&lt;/a&gt;    Change file timestamps   &lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/tracert.html"&gt;TRACERT&lt;/a&gt;  Trace route to a remote host&lt;br /&gt;  TREE     Graphical display of folder structure&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/type.html"&gt;TYPE&lt;/a&gt;     Display the contents of a text file&lt;br /&gt;u&lt;br /&gt;  USRSTAT  List domain usernames and last login&lt;br /&gt;v&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/ver.html"&gt;VER&lt;/a&gt;      Display version information&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/verify.html"&gt;VERIFY&lt;/a&gt;   Verify that files have been saved&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/vol.html"&gt;VOL&lt;/a&gt;      Display a disk label&lt;br /&gt;w&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/where.html"&gt;WHERE&lt;/a&gt;    Locate and display files in a directory tree&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/whoami.html"&gt;WHOAMI&lt;/a&gt;   Output the current UserName and domain&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/windiff.html"&gt;WINDIFF&lt;/a&gt;  Compare the contents of two files or sets of files&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/winmsd.html"&gt;WINMSD&lt;/a&gt;   Windows system diagnostics&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/winmsdp.html"&gt;WINMSDP&lt;/a&gt;  Windows system diagnostics II&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/wmic.html"&gt;WMIC&lt;/a&gt;     WMI Commands&lt;br /&gt;x&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/xcacls.html"&gt;XCACLS&lt;/a&gt;   Change file permissions&lt;br /&gt;  &lt;a href="http://www.ss64.com/nt/xcopy.html"&gt;XCOPY&lt;/a&gt;    Copy files and folders&lt;br /&gt;~ &lt;a href="http://www.ss64.com/nt/rem.html"&gt;::&lt;/a&gt;       Comment / Remark&lt;br /&gt;&lt;/pre&gt; Commands marked &lt;span class="telety"&gt;~&lt;/span&gt; are &lt;i&gt;Internal&lt;/i&gt; commands only available within the CMD shell.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8654375134827389820-8118486653555615879?l=railsbuilder.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://railsbuilder.blogspot.com/2009/01/dos-command-line-tricks-for-xp.html</link><author>noreply@blogger.com (Rails builder)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_44rn_CkFp1w/SXXGtE20j1I/AAAAAAAAAJc/HgbMtVtMdT4/s72-c/DOS+Command+Window.jpg" height="72" width="72" /><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8654375134827389820.post-2789276526274995468</guid><pubDate>Thu, 01 Jan 2009 12:21:00 +0000</pubDate><atom:updated>2009-01-01T04:38:59.466-08:00</atom:updated><title>20 Things you didn't know about Windows XP -Jak</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_44rn_CkFp1w/SVy4vXPQZzI/AAAAAAAAADs/tnrcKRqwM-Y/s1600-h/Microsoft_Windows_XP_Gold.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 150px;" src="http://4.bp.blogspot.com/_44rn_CkFp1w/SVy4vXPQZzI/AAAAAAAAADs/tnrcKRqwM-Y/s200/Microsoft_Windows_XP_Gold.jpg" alt="" id="BLOGGER_PHOTO_ID_5286303186457487154" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;You've read the reviews and digested the key feature enhancements and operational changes. Now it's time to delve a bit deeper and uncover some of &lt;span style="font-style: italic;"&gt;&lt;a href="http://www.microsoft.com/windows/windows-xp/"&gt;Windows XP's&lt;/a&gt; &lt;/span&gt;secrets.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. It boasts how long it can stay up. Whereas previous versions of Windows were coy about how long they went between boots, XP is positively proud of its stamina. Go to the Command Prompt in the Accessories menu from the All Programs start button option, and then type 'systeminfo'. The computer will produce a lot of useful info, including the uptime. If you want to keep these, type 'systeminfo &gt; info.txt'. This creates a file called info.txt you can look at later with Notepad. (Professional Edition only).&lt;br /&gt;&lt;br /&gt;2. You can delete files immediately, without having them move to the Recycle Bin first. Go to the Start menu, select Run... and type 'gpedit.msc'; then select User Configuration, Administrative Templates, Windows Components, Windows Explorer and find the Do not move deleted files to the Recycle Bin setting. Set it. Poking around in gpedit will reveal a great many interface and system options, but take care -- some may stop your computer behaving as you wish. (Professional Edition only).&lt;br /&gt;&lt;br /&gt;3. You can lock your XP workstation with two clicks of the mouse. Create a new shortcut on your desktop using a right mouse click, and enter 'rundll32.exe user32.dll,LockWorkStation' in the location field. Give the shortcut a name you like. That's it -- just double click on it and your computer will be locked. And if that's not easy enough, Windows key + L will do the same.&lt;br /&gt;&lt;br /&gt;4. XP hides some system software you might want to remove, such as Windows Messenger, but you can tickle it and make it disgorge everything. Using Notepad or Edit, edit the text file /windows/inf/sysoc.inf, search for the word 'hide' and remove it. You can then go to the Add or Remove Programs in the Control Panel, select Add/Remove Windows Components and there will be your prey, exposed and vulnerable.&lt;br /&gt;&lt;br /&gt;5. For those skilled in the art of DOS batch files, XP has a number of interesting new commands. These include 'eventcreate' and 'eventtriggers' for creating and watching system events, 'typeperf' for monitoring performance of various subsystems, and 'schtasks' for handling scheduled tasks. As usual, typing the command name followed by /? will give a list of options -- they're all far too baroque to go into here.&lt;br /&gt;&lt;br /&gt;6. XP has IP version 6 support -- the next generation of IP. Unfortunately this is more than your ISP has, so you can only experiment with this on your LAN. Type 'ipv6 install' into Run... (it's OK, it won't ruin your existing network setup) and then 'ipv6 /?' at the command line to find out more. If you don't know what IPv6 is, don't worry and don't bother.&lt;br /&gt;&lt;br /&gt;7. You can at last get rid of tasks on the computer from the command line by using 'taskkill /pid' and the task number, or just 'tskill' and the process number. Find that out by typing 'tasklist', which will also tell you a lot about what's going on in your system.&lt;br /&gt;&lt;br /&gt;8. XP will treat Zip files like folders, which is nice if you've got a fast machine. On slower machines, you can make XP leave zip files well alone by typing 'regsvr32 /u zipfldr.dll' at the command line. If you change your mind later, you can put things back as they were by typing 'regsvr32 zipfldr.dll'.&lt;br /&gt;&lt;br /&gt;9. XP has ClearType -- Microsoft's anti-aliasing font display technology -- but doesn't have it enabled by default. It's well worth trying, especially if you were there for DOS and all those years of staring at a screen have given you the eyes of an astigmatic bat. To enable ClearType, right click on the desktop, select Properties, Appearance, Effects, select ClearType from the second drop-down menu and enable the selection. Expect best results on laptop displays. If you want to use ClearType on the Welcome login screen as well, set the registry entry HKEY_USERS/.DEFAULT/Control Panel/Desktop/FontSmoothingType to 2.&lt;br /&gt;&lt;br /&gt;10. You can use Remote Assistance to help a friend who's using network address translation (NAT) on a home network, but not automatically. Get your pal to email you a Remote Assistance invitation and edit the file. Under the RCTICKET attribute will be a NAT IP address, like 192.168.1.10. Replace this with your chum's real IP address -- they can find this out by going to www.whatismyip.com -- and get them to make sure that they've got port 3389 open on their firewall and forwarded to the errant computer.&lt;br /&gt;&lt;br /&gt;11. You can run a program as a different user without logging out and back in again. Right click the icon, select Run As... and enter the user name and password you want to use. This only applies for that run. The trick is particularly useful if you need to have administrative permissions to install a program, which many require. Note that you can have some fun by running programs multiple times on the same system as different users, but this can have unforeseen effects.&lt;br /&gt;&lt;br /&gt;12. Windows XP can be very insistent about you checking for auto updates, registering a Passport, using Windows Messenger and so on. After a while, the nagging goes away, but if you feel you might slip the bonds of sanity before that point, run Regedit, go to HKEY_CURRENT_USER/Software/Microsoft/Windows/Current Version/Explorer/Advanced and create a DWORD value called EnableBalloonTips with a value of 0.&lt;br /&gt;&lt;br /&gt;13. You can start up without needing to enter a user name or password. Select Run... from the start menu and type 'control userpasswords2', which will open the user accounts application. On the Users tab, clear the box for Users Must Enter A User Name And Password To Use This Computer, and click on OK. An Automatically Log On dialog box will appear; enter the user name and password for the account you want to use.&lt;br /&gt;&lt;br /&gt;14. Internet Explorer 6 will automatically delete temporary files, but only if you tell it to. Start the browser, select Tools / Internet Options... and Advanced, go down to the Security area and check the box to Empty Temporary Internet Files folder when browser is closed.&lt;br /&gt;&lt;br /&gt;15. XP comes with a free Network Activity Light, just in case you can't see the LEDs twinkle on your network card. Right click on My Network Places on the desktop, then select Properties. Right click on the description for your LAN or dial-up connection, select Properties, then check the Show icon in notification area when connected box. You'll now see a tiny network icon on the right of your task bar that glimmers nicely during network traffic.&lt;br /&gt;&lt;br /&gt;16. The Start Menu can be leisurely when it decides to appear, but you can speed things along by changing the registry entry HKEY_CURRENT_USER/Control Panel/Desktop/MenuShowDelay from the default 400 to something a little snappier. Like 0.&lt;br /&gt;&lt;br /&gt;17. You can rename loads of files at once in Windows Explorer. Highlight a set of files in a window, then right click on one and rename it. All the other files will be renamed to that name, with individual numbers in brackets to distinguish them. Also, in a folder you can arrange icons in alphabetised groups by View, Arrange Icon By... Show In Groups.&lt;br /&gt;&lt;br /&gt;18. Windows Media Player will display the cover art for albums as it plays the tracks -- if it found the picture on the Internet when you copied the tracks from the CD. If it didn't, or if you have lots of pre-WMP music files, you can put your own copy of the cover art in the same directory as the tracks. Just call it folder.jpg and Windows Media Player will pick it up and display it.&lt;br /&gt;&lt;br /&gt;19. Windows key + Break brings up the System Properties dialogue box; Windows key + D brings up the desktop; Windows key + Tab moves through the taskbar buttons.&lt;br /&gt;&lt;br /&gt;20. The next release of Windows XP, codenamed Longhorn, is due out late next year or early 2003 and won't be much to write home about. The next big release is codenamed Blackcomb and will be out in 2003/2004.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8654375134827389820-2789276526274995468?l=railsbuilder.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://railsbuilder.blogspot.com/2009/01/20-things-you-didnt-know-about-windows.html</link><author>noreply@blogger.com (Rails builder)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_44rn_CkFp1w/SVy4vXPQZzI/AAAAAAAAADs/tnrcKRqwM-Y/s72-c/Microsoft_Windows_XP_Gold.jpg" height="72" width="72" /><thr:total>0</thr:total></item></channel></rss>

