<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-19196687</id><updated>2012-01-27T17:56:08.431-05:00</updated><category term='SCM'/><category term='Maynard'/><category term='JSP'/><category term='Java EE'/><category term='Certification'/><category term='Seam'/><category term='AJAX'/><category term='Displaytag'/><category term='Programming Practices'/><category term='BaseApp'/><category term='Memory Leak'/><category term='network management'/><category term='IDE'/><category term='BPEL'/><category term='Sun certifications'/><category term='USA'/><category term='Cable Broadband'/><category term='experiences'/><category term='PHP'/><category term='Webservices'/><category term='Code Coverage'/><category term='stallings'/><category term='DOCSIS'/><category term='Java SE'/><category term='book review'/><category term='unit testing'/><category term='DWR'/><category term='snmp'/><category term='boxing'/><category term='Design Patterns'/><category term='Kempo Karate'/><category term='Quartz'/><category term='vblog'/><title type='text'>FitProgrammer@Work</title><subtitle type='html'>A blog about my day 2 day learnings.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>90</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-19196687.post-8294984881202398972</id><published>2012-01-04T21:23:00.001-05:00</published><updated>2012-01-04T21:25:02.618-05:00</updated><title type='text'>foobar2000 - A pretty nice music player for windows</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;a href="http://www.foobar2000.org/"&gt;foobar2000&lt;/a&gt;: I discovered today foobar2000 and have used it for almost the whole day today and i must say that its very light and fast (you really can feel it is so). Highly recommended - go &lt;a href="http://www.foobar2000.org/"&gt;check it out&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.foobar2000.org/images/img/main.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="269" src="http://www.foobar2000.org/images/img/main.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;"&gt;'via Blog this'&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-8294984881202398972?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/8294984881202398972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=8294984881202398972&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8294984881202398972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8294984881202398972'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2012/01/foobar2000-pretty-nice-music-player-for.html' title='foobar2000 - A pretty nice music player for windows'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-2114011557969720515</id><published>2012-01-03T19:11:00.001-05:00</published><updated>2012-01-03T19:11:43.442-05:00</updated><title type='text'>Batch script to change Java Home between different JDKs</title><content type='html'>&lt;p&gt;I recently happened to be working on multiple releases with some of them requiring the code to be compiled with JDK 6 whereas the more recent releases requiring code to compile with JDK 7. So i wrote up the following batch script to make the job of switching between the 2 JDKs easier. Before i run my ant build script i run the below script to set to ‘7’ for JDK 7 or ‘6’ for JDK 6.&lt;/p&gt; &lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;@ECHO OFF&lt;/pre&gt;&lt;pre&gt;echo %1%&lt;/pre&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; &lt;span class="str"&gt;"%1"&lt;/span&gt;== &lt;span class="str"&gt;""&lt;/span&gt; ( &lt;/pre&gt;&lt;pre class="alt"&gt;    echo &lt;span class="str"&gt;"Syntax: javahome 7 or 6"&lt;/span&gt; &lt;/pre&gt;&lt;pre&gt;    Goto :&lt;span class="kwrd"&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;) &lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; &lt;span class="str"&gt;"%1"&lt;/span&gt; == &lt;span class="str"&gt;"7"&lt;/span&gt; (&lt;/pre&gt;&lt;pre class="alt"&gt;    echo &lt;span class="str"&gt;"Setting JDK 7"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;    &lt;/pre&gt;&lt;pre class="alt"&gt;    set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_01&lt;/pre&gt;&lt;pre&gt;    GOTO :printver&lt;/pre&gt;&lt;pre class="alt"&gt;) &lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; &lt;span class="str"&gt;"%1"&lt;/span&gt; == &lt;span class="str"&gt;"6"&lt;/span&gt; (&lt;/pre&gt;&lt;pre&gt;    echo &lt;span class="str"&gt;"Setting JDK 6"&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;    &lt;/pre&gt;&lt;pre&gt;    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_23&lt;/pre&gt;&lt;pre class="alt"&gt;    GOTO :printver&lt;/pre&gt;&lt;pre&gt;)&lt;/pre&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;:printver&lt;/pre&gt;&lt;pre class="alt"&gt;echo %JAVA_HOME%&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;set NEW_PATH=%PATH%&lt;/pre&gt;&lt;pre&gt;FOR /F &lt;span class="str"&gt;"delims=;"&lt;/span&gt; %%P IN (&lt;span class="str"&gt;"%PATH%"&lt;/span&gt;) DO (&lt;/pre&gt;&lt;pre class="alt"&gt;    @ECHO path = %%~P&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;)&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;set PATH=%JAVA_HOME%\bin;%NEW_PATH%&lt;/pre&gt;&lt;pre class="alt"&gt;echo %PATH%&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;java -version&lt;/pre&gt;&lt;pre&gt;:end&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-2114011557969720515?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/2114011557969720515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=2114011557969720515&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2114011557969720515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2114011557969720515'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2012/01/batch-script-to-change-java-home.html' title='Batch script to change Java Home between different JDKs'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-7192471625521489400</id><published>2011-12-25T00:57:00.000-05:00</published><updated>2011-12-25T00:57:51.346-05:00</updated><title type='text'>Some new movie reviews</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;My family has been away for last 2 weeks in which i had the free-time to catch up on some of the new movie releases. Here are the ones i watched this holiday season, in order:&lt;br /&gt;&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;Hugo (3D) -&lt;/b&gt;&amp;nbsp; &lt;span style="background-color: #e9e9e9; font-family: 'Droid Sans', helvetica, verdana, arial, sans-serif; font-size: 16px; line-height: 24px; text-align: -webkit-auto;"&gt;Throughout his extraordinary career, Academy Award-wining director Martin Scorsese has brought his unique vision and dazzling gifts to life in a series of unforgettable films. This holiday season the legendary storyteller invites you to join him on a thrilling journey to a magical world with his first-ever 3-D film, based on Brian Selznick's award-winning, imaginative New York Times best-seller, "The Invention of Hugo Cabret." Hugo is the astonishing adventure of a wily and resourceful boy whose quest to unlock a secret left to him by his father will transform Hugo and all those around him, and reveal a safe and loving place he can call home.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Sherlock Holmes 2 - A game of shadows -&lt;/b&gt;&amp;nbsp; &lt;span style="background-color: #e9e9e9; font-family: 'Droid Sans', helvetica, verdana, arial, sans-serif; font-size: 16px; line-height: 24px; text-align: -webkit-auto;"&gt;Sherlock Holmes (Robert Downey Jr.) has always been the smartest man in the room...until now. There is a new criminal mastermind at large-Professor Moriarty (Jared Harris)-and not only is he Holmes' intellectual equal, but his capacity for evil, coupled with a complete lack of conscience, may actually give him an advantage over the renowned detective. When the Crown Prince of Austria is found dead, the evidence, as construed by Inspector Lestrade (Eddie Marsan), points to suicide. But Sherlock Holmes deduces that the prince has been the victim of murder-a murder that is only one piece of a larger and much more portentous puzzle, designed by Professor Moriarty. The cunning Moriarty is always one step ahead of Holmes as he spins a web of death and destruction-all part of a greater plan that, if he succeeds, will change the course of history.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;The girl with the dragon tattoo -&amp;nbsp;&lt;/b&gt; &lt;span style="background-color: #e9e9e9; font-family: 'Droid Sans', helvetica, verdana, arial, sans-serif; font-size: 16px; line-height: 24px; text-align: -webkit-auto;"&gt;The Girl with the Dragon Tattoo is the first film in Columbia Pictures' three-picture adaptation of Stieg Larsson's literary blockbuster The Millennium Trilogy. Directed by David Fincher and starring Daniel Craig and Rooney Mara, the film is based on the first novel in the trilogy, which altogether have sold 50 million copies in 46 countries and become a worldwide phenomenon.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Adventures of Tintin -&lt;/b&gt;&amp;nbsp; &lt;span style="background-color: #e9e9e9; font-family: 'Droid Sans', helvetica, verdana, arial, sans-serif; font-size: 16px; line-height: 24px; text-align: -webkit-auto;"&gt;Paramount Pictures and Columbia Pictures Present a 3D Motion Capture Film The Adventures of Tintin directed by Steven Spielberg from a screenplay by Steven Moffat and Edgar Wright &amp;amp; Joe Cornish. Starring Jamie Bell as Tintin, the intrepid young reporter whose relentless pursuit of a good story thrusts him into a world of high adventure, and Daniel Craig as the nefarious Red Rackham.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Mission Impossible 4 - Ghost Protocol -&lt;/b&gt;&amp;nbsp; &lt;span style="background-color: #e9e9e9; font-family: 'Droid Sans', helvetica, verdana, arial, sans-serif; font-size: 16px; line-height: 24px; text-align: -webkit-auto;"&gt;This is not just another mission. The IMF is shut down when it's implicated in a global terrorist bombing plot. Ghost Protocol is initiated and Ethan Hunt and his rogue new team must go undercover to clear their organization's name. No help, no contact, off the grid. You have never seen a mission grittier and more intense than this.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div style="text-align: -webkit-auto;"&gt;&lt;span style="font-family: 'Droid Sans', helvetica, verdana, arial, sans-serif;"&gt;&lt;span style="line-height: 24px;"&gt;All were nice movies (or else i would not have gone to watch them :)) but i liked the "Adventures of Tintin" the most, followed by MI4 and Sherlock holmes, followed by Hugo and then Girl with the dragon tattoo. The problem with the GWTDT is it is not as well made as the sweedish version of the same movie (which i had watched before the english one).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-7192471625521489400?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/7192471625521489400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=7192471625521489400&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7192471625521489400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7192471625521489400'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/12/some-new-movie-reviews.html' title='Some new movie reviews'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-2316948576677223216</id><published>2011-12-19T12:55:00.001-05:00</published><updated>2011-12-19T12:55:34.376-05:00</updated><title type='text'>VMware vSphere Performance Manager APIs</title><content type='html'>&lt;p&gt;&lt;a href="http://www.doublecloud.org/wp-content/uploads/2010/03/vsphere_performance_counters.png"&gt;PerfCounterInfo&lt;/a&gt; &lt;p&gt;Figure 1 – PerfCounterInfo &lt;p&gt;&lt;a href="http://www.doublecloud.org/wp-content/uploads/2010/03/vsphere_performance_interval.png"&gt;PerfInterval&lt;/a&gt; &lt;p&gt;Figure 2 - PerfInterval &lt;h3&gt;Performance Provider&lt;/h3&gt; &lt;p&gt;1. A "performance provider" (&lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.PerformanceManager.ProviderSummary.html"&gt;PerfProviderSummary&lt;/a&gt;) is any managed object that generates utilization or other performance metrics. &lt;p&gt;2. Performance providers include &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.ManagedEntity.html"&gt;managed entities&lt;/a&gt;, such as &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.HostSystem.html"&gt;hosts&lt;/a&gt;, &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.VirtualMachine.html"&gt;virtual machines&lt;/a&gt;, &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.ComputeResource.html"&gt;compute resources&lt;/a&gt;, &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.ResourcePool.html"&gt;resource pools&lt;/a&gt;, &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.Datastore.html"&gt;datastores&lt;/a&gt;, and &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.Network.html"&gt;networks&lt;/a&gt;. Performance providers also include physical or virtual devices associated with these objects, such as virtual host-bus adapters and network-interface controllers (NICs) &lt;p&gt;3. Each performance provider—the instrumented device or entity—has its own set of &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.PerformanceManager.CounterInfo.html"&gt;counters&lt;/a&gt; that provides metadata about its available &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.PerformanceManager.EntityMetric.html"&gt;metrics&lt;/a&gt;. Each counter has a unique&lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.PerformanceManager.CounterInfo.html#key"&gt;key&lt;/a&gt;, referred to as the counterId. &lt;h3&gt;Performance Counter&lt;/h3&gt; &lt;p&gt;4. Counters are organized by &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.PerformanceManager.CounterInfo.html#groupInfo"&gt;groups&lt;/a&gt; of finite system resources, such as &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/memory_counters.html"&gt;memory&lt;/a&gt;, &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/cpu_counters.html"&gt;CPU&lt;/a&gt;, &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/disk_counters.html"&gt;disk&lt;/a&gt;, and so on. &lt;p&gt;5. PerfCounterInfo data object, shown in Figure 1, represents a performance counter. &lt;table border="1" cellspacing="0" cellpadding="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="197"&gt; &lt;p&gt;Name&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="152"&gt; &lt;p&gt;Type&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="241"&gt; &lt;p&gt;Description&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="197"&gt; &lt;p&gt;groupInfo&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="152"&gt; &lt;p&gt;ElementDescription&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="241"&gt; &lt;p&gt;The group of the performance counter with its label and summary details.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="197"&gt; &lt;p&gt;Key&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="152"&gt; &lt;p&gt;Int&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="241"&gt; &lt;p&gt;A system-generated number that uniquely identifies the counter in the context of the system. The performance counter ID.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="197"&gt; &lt;p&gt;Level&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="152"&gt; &lt;p&gt;int&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="241"&gt; &lt;p&gt;1..4, 1 is default. Higher the setting more data is collected by vCenter. See below for details. Note this is only applicable for vCenter and not ESX host.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="197"&gt; &lt;p&gt;nameInfo&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="152"&gt; &lt;p&gt;ElementDescription&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="241"&gt; &lt;p&gt;Counter name&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="197"&gt; &lt;p&gt;perDeviceLevel&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="152"&gt; &lt;p&gt;Int (since 4.1)&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="241"&gt; &lt;p&gt;&amp;gt;= level.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="197"&gt; &lt;p&gt;rollupType&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="152"&gt; &lt;p&gt;PerfSummaryType&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="241"&gt; &lt;p&gt;One of average, latest, max, min, none, summation&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="197"&gt; &lt;p&gt;statsType&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="152"&gt; &lt;p&gt;PerfStatsType&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="241"&gt; &lt;p&gt;One of absolute, delta or rate&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="197"&gt; &lt;p&gt;unitInfo&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="152"&gt; &lt;p&gt;ElementDescription&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="241"&gt; &lt;p&gt;Unit for values of performance counter.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;6. The performance counter can be represented by the following dotted string notation:  &lt;p&gt;&lt;b&gt;[group].[counter].[rollupType]&lt;/b&gt;&lt;b&gt;&lt;/b&gt; &lt;p&gt;Example, disk.usage.average &lt;p&gt;7. Here are a list of four &lt;b&gt;levels&lt;/b&gt; and what counters are included: &lt;p&gt;a. Level 1:&amp;nbsp; includes basic metrics: average usage for CPU, memory, disk, and network; system uptime, system heartbeat, and DRS metrics. It does not include statistics for any device. &lt;p&gt;b. Level 2: includes all counters with rollup types of average, summation, and latest for CPU, memory, disk, and network; system uptime, system Heartbeat, and DRS metrics. It does not include any statistics for device either. &lt;p&gt;c. Level 3: includes all metrics (including device metrics) for all counter groups except these with rollup types of maximum and minimum rollup types. &lt;p&gt;d. Level 4: includes all metrics supported by VirtualCenter, including maximum and minimum rollup types. &lt;h3&gt;Performance Metric&lt;/h3&gt; &lt;p&gt;8. The cpu.usage.average is a performance counter for average CPU utilization. When the counter is collected on CPU No. 1 of a host, a &lt;b&gt;performance metric&lt;/b&gt; is formed. The performance metric is represented by PerfMetricId data object which consists of two parts: &lt;p&gt;a. counterId: The integer that identifies the performance counter. &lt;p&gt;b. instanceId: The name of the instance such as “vmnic1” or “vmhba0:0:0”. &lt;h3&gt;Performance Interval&lt;/h3&gt; &lt;p&gt;9. The interval has to be longer than the sampling interval, which can be found as refreshRate in the PerfProviderSummary data object returned by queryPerfProviderSummary() method, normally 20 second. For VirtualCenter Server systems, instances of this data object are referred to as “historical intervals” because they control how data collected from the ESX systems will be aggregated and stored in the database. &lt;p&gt;10. vCenter default setting is level 1 and it retains sampled stats data as follows: &lt;p&gt;· 5-minute samples for the past day &lt;p&gt;· 30-minute samples for the past week &lt;p&gt;· 2-hour samples for the past month &lt;p&gt;· 1-day samples for the past year &lt;p&gt;11. PerfInterval is explained below: &lt;table border="1" cellspacing="0" cellpadding="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="199"&gt; &lt;p&gt;Name&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="90"&gt; &lt;p&gt;Type&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="301"&gt; &lt;p&gt;Description&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="199"&gt; &lt;p&gt;Enabled&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="90"&gt; &lt;p&gt;Boolean&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="301"&gt; &lt;p&gt;If disabled vCenter will not collect performance data for that interval or higher intervals. For example, disabling the "Past Month" interval disables both "Past Month" and "Past Year" intervals. The system will aggregate and retain performance data using the "Past Day" and "Past Week" intervals only.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="199"&gt; &lt;p&gt;Key&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="90"&gt; &lt;p&gt;Int&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="301"&gt; &lt;p&gt;Id for interval&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="199"&gt; &lt;p&gt;Length&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="90"&gt; &lt;p&gt;Int&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="301"&gt; &lt;p&gt;Seconds that the stats corresponding to this interval are kept on system&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="199"&gt; &lt;p&gt;Level&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="90"&gt; &lt;p&gt;Int&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="301"&gt; &lt;p&gt;1..4. higher the level more data is collected.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="199"&gt; &lt;p&gt;Name&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="90"&gt; &lt;p&gt;String&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="301"&gt; &lt;p&gt;Name of historical interval. Example, “Past Day”, “Past Week” etc.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="199"&gt; &lt;p&gt;samplingPeriod&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="90"&gt; &lt;p&gt;Int&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="301"&gt; &lt;p&gt;Number of seconds that data is sampled for this interval. The real-time samplingPeriod is 20 seconds.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;Default properties for the four built-in historical intervals include: &lt;table border="1" cellspacing="0" cellpadding="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;KEY&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;SAMPLINGPERIOD&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;LENGTH&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;NAME&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;LEVEL&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;ENABLED&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt; &lt;p&gt;1&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;300&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;86400&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;Past day&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;1&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;true&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt; &lt;p&gt;2&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;1800&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;604800&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;Past week&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;1&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;true&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt; &lt;p&gt;3&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;7200&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;2592000&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;Past month&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;1&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;true&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt; &lt;p&gt;4&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;66400&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;31536000&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;Past year&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;1&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;true&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;12. In general, you should avoid changing the intervals as much as possible except the levels. &lt;h3&gt;Real time vs historical performance statistics:&lt;/h3&gt; &lt;p&gt;a. Real time stats collected at 20 secs sampling interval and kept for a length of 1 hour. &lt;p&gt;b. These real time samples are then processed to generate historical performance stats. &lt;p&gt;c. ESX only maintains 5 mins interval historical stats for one day length. vCenter does more aggregation and maintains stats for longer durations. &lt;h3&gt;Important references:&lt;/h3&gt; &lt;p&gt;1. vSphere SDK 5.0 reference on Performance Manager - &lt;a href="http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.PerformanceManager.html"&gt;http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.PerformanceManager.html&lt;/a&gt; &lt;p&gt;2. A decent introduction to performance manager APIs: &lt;a href="http://www.doublecloud.org/2010/03/fundamentals-of-vsphere-performance-management/"&gt;http://www.doublecloud.org/2010/03/fundamentals-of-vsphere-performance-management/&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-2316948576677223216?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/2316948576677223216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=2316948576677223216&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2316948576677223216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2316948576677223216'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/12/vmware-vsphere-performance-manager-apis.html' title='VMware vSphere Performance Manager APIs'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-6318913602943394755</id><published>2011-09-23T20:15:00.000-04:00</published><updated>2011-09-23T20:15:07.017-04:00</updated><title type='text'>Installing VMware vCenter Server 4.1</title><content type='html'>&lt;a href="http://www.vmadmin.co.uk/vmware/36-virtualcenter/263-vcenterinstall41"&gt;Installing VMware vCenter Server 4.1&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;Very helpful instructions with screenshot to walk you through the entire vCenter server 4.1 installation with a SQL Server 2008 (not the express edition one).&lt;br /&gt;&lt;br /&gt;&lt;a style="font-size:13px" href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk"&gt;'via Blog this'&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-6318913602943394755?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/6318913602943394755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=6318913602943394755&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6318913602943394755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6318913602943394755'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/09/installing-vmware-vcenter-server-41.html' title='Installing VMware vCenter Server 4.1'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-233997345749947401</id><published>2011-06-29T13:30:00.001-04:00</published><updated>2011-06-29T13:30:43.489-04:00</updated><title type='text'>VMware vSphere 4 Networking Essentials</title><content type='html'>&lt;p&gt;1. &lt;b&gt;vSwitch similarities to a physical L2 switch&lt;/b&gt;: &lt;ul&gt; &lt;li&gt;A vSwitch functions at Layer 2, &lt;/li&gt; &lt;li&gt;maintains MAC address tables, &lt;/li&gt; &lt;li&gt;forwards frames to other switch ports based on MAC address, &lt;/li&gt; &lt;li&gt;supports VLAN configuration, &lt;/li&gt; &lt;li&gt;is capable of trunking using IEEE 802.1q VLAN tags, and&lt;/li&gt; &lt;li&gt;is capable of establishing port channels.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;2. vSwitches are configured with a specific number of ports: 8, 24, 56, 120, 248, 504, or 1016. VMKernel reserves 8 ports for its own use. &lt;p&gt;3. Changing the number of ports on a vSwitch requires a reboot of ESX/ESXi host. &lt;p&gt;&lt;b&gt;4. &lt;/b&gt;&lt;b&gt;vSwitch dissimilarities to physical L2 switch:&lt;/b&gt; &lt;ul&gt; &lt;li&gt;Does not support dynamic negotiation protocols for establishing 802.1q trunks or port channels like DTP (Dynamic Trunking Protocol) or PAgP (Port Aggregation Protocol).&lt;/li&gt; &lt;li&gt;A vSwitch cannot be connected to another vSwitch thereby eliminating a potential looping configuration. Because there is no possibility of looping, the vSwitches do not run Spanning Tree Protocol (STP).&lt;/li&gt; &lt;li&gt;A vSwitch authoritatively knows the MAC addresses of the virtual machines connected to that vSwitch so there is no need to learn MAC addresses from the network.&lt;/li&gt; &lt;li&gt;Traffic received by a vSwitch on one uplink is never forwarded out another uplink. So a vSwitch cannot be used as a transit path between 2 physical switches for example, because traffic on one uplink won’t be forwarded out another uplink.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;5. Following 3 types of ports and port groups can be configured on a vSwitch: &lt;ul&gt; &lt;li&gt;Service console port&lt;/li&gt; &lt;li&gt;VMKernel port&lt;/li&gt; &lt;li&gt;Virtual Machine port group&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;All of the above types can be represented by one table/type: &lt;p&gt;&lt;b&gt;std_vswitch_portgroup&lt;/b&gt; - model's VMKernel Ports, Service Console Ports and VM Port groups &lt;ul&gt; &lt;li&gt;· network_label&lt;/li&gt; &lt;li&gt;· vlan_id&lt;/li&gt; &lt;li&gt;· type - one of vmportgroup (0), vmkernel(1), serviceconsole(2)&lt;/li&gt; &lt;li&gt;· vmkernel_port_operations (bitmask - values) - only applicable for VMKernel ports&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;000 - Use this portgroup for iSCSI/NAS traffic &lt;p&gt;001 - Use this portgroup for VMotion &lt;p&gt;010 - Use this portgroup for fault tolerance logging &lt;p&gt;100 - Use this portgroup for management traffic - only applicable for ESXi &lt;p&gt;6. vSphere client combines the creation of vSwitch with creation of new ports or port groups. vSphere client does not ask about creating a new vSwitch, but rather what type of port or port group to create (connection types – Virtual Machine, VMKernel or Service Console are the options). &lt;p&gt;7. Unlike ports or port groups, uplinks are not necessarily required in order for a vSwitch to function. VMs connected to a vSwitch without any uplinks can communicate with each other but cannot communicate with VMs on other vSwitches or physical systems. Such a configuration is known as an “&lt;b&gt;Internal-only vSwitch&lt;/b&gt;”. Communication between VMs connected to an internal-only vSwitch takes place entirely in software and happens at whatever speed the VMKernel can perform the task. &lt;p&gt;8. VMs connected to an internal-only vSwitch are not VMotion capable. But if the VM is disconnected from the internal-only vSwitch, VMotion will succeed if &lt;i&gt;all other requirements&lt;/i&gt; have been met. &lt;p&gt;9. A vSwitch can also be bound to multiple physical NICs – this configuration is called &lt;b&gt;NIC team&lt;/b&gt;. This takes advantage of load distribution and redundancy. &lt;p&gt;10. vSwitch associated with a physical NIC provides VMs with the amount of bandwidth the physical NIC is configured to support. &lt;p&gt;11. A single physical NIC cannot be associated with multiple vSwitches.  &lt;p&gt;12. Max number of physical NICs on a ESX/ESXi host is 32 of which only 4 can be 10 Gbps adapters. &lt;p&gt;&lt;b&gt;13. &lt;/b&gt;&lt;b&gt;Service Console ports:&lt;/b&gt; &lt;ul&gt; &lt;li&gt;ESX supports up to 16 service console ports.&lt;/li&gt; &lt;li&gt;At least one service console port is required to exist on any one vSwitch on an ESX host.&lt;/li&gt; &lt;li&gt;We will discover but not perform any create/update/delete operations for this port type.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;14. &lt;/b&gt;&lt;b&gt;VMKernel ports:&lt;/b&gt; &lt;ul&gt; &lt;li&gt;Provide network access for the VMKernel’s TCP/IP stack (which is separate and independent from the Service Console TCP/IP stack).&lt;/li&gt; &lt;li&gt;VMKernel ports are used for &lt;i&gt;VMotion process&lt;/i&gt;, &lt;i&gt;iSCSI/NAS access&lt;/i&gt; and VMware FT.&lt;/li&gt; &lt;li&gt;With ESXi hosts, VMKernel ports are also used for management.&lt;/li&gt; &lt;li&gt;A VMKernel port comprises of 2 components:&lt;/li&gt; &lt;ul&gt; &lt;li&gt;A VMKernel port on a vSwitch&lt;/li&gt; &lt;li&gt;A VMKernel NIC – vmknic &lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;e. The vmknic is configured with the interface IP address in the process of creating the VMKernel connection type in vSphere client. The IP address should be a valid IP for the network to which the physical NIC is connected to. One can optionally provide the default gateway if VMKernel NIC is required to reach remote subnets. &lt;p&gt;&lt;b&gt;15. &lt;/b&gt;&lt;b&gt;VLAN &lt;/b&gt; &lt;ul&gt; &lt;li&gt;a. IEEE 802.1Q Tagging – marking traffic as belonging to a particular VLAN. VLAN tag (aka VLAN ID) is value between 1 and 4094 which unique identifies the VLAN across the network.&lt;/li&gt; &lt;li&gt;b. VLANs are handled by configuring different port groups within a vSwitch. A port group can be associated to only 1 VLAN at a time, but multiple port groups can be associated with a single VLAN.&lt;/li&gt; &lt;li&gt;&lt;a name="_Toc266965266"&gt;Figure &lt;/a&gt;16 - Configuring VLAN on Port groups of a vSwitch&lt;/li&gt; &lt;li&gt;c. To make VLANs work properly with a port group, the uplinks for the vSwitch must be connected to a physical switch port configured as a trunk port. A trunk port understands how to pass traffic from multiple VLANs simultaneously while also preserving the VLAN IDs on the traffic. So the physical switch passes the VLAN tags up to the ESX server, where the vSwitch tries to direct the traffic to a port group with that VLAN ID configured.&lt;/li&gt; &lt;li&gt;d. The default native VLAN is VLAN ID 1. This is untagged VLAN ID meaning the switch port will strip this native VLAN id from the traffic as they pass. If you want to pass traffic on VLAN 1 to ESX server, then you need to maintain the tagging in the traffic and so you need to configure another VLAN id as native default VLAN. So an untagged VLAN (default native VLAN) can also be any id between 1 and 4094.&lt;/li&gt; &lt;li&gt;e. A good convention to follow while naming port group or port network label is: &lt;b&gt;VLANXXX-Network Description&lt;/b&gt;. For example, VLAN11-IPStorage.&lt;/li&gt; &lt;li&gt;f. Although VLAN reduce the cost of constructing multiple logical subnets by separating the network segments logically but still all traffic runs on the same physical network underneath. For bandwidth-intensive network operations this disadvantage of shared physical network might outweigh the scalability and cost savings of a VLAN.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;16. &lt;/b&gt;&lt;b&gt;NIC Teaming&lt;/b&gt; &lt;ul&gt; &lt;li&gt;a. &lt;b&gt;Uplink&lt;/b&gt; is a physical adapter bound to the vSwitch and connected to physical switch.&lt;/li&gt; &lt;li&gt;b. NIC teaming involves connecting multiple adapters to single vSwitch. It provides redundancy and load balancing of network communications to Service Console, VMKernel and virtual machines.&lt;/li&gt; &lt;li&gt;&lt;a name="_Toc266965267"&gt;Figure &lt;/a&gt;17 - NIC Teaming&lt;/li&gt; &lt;li&gt;c. As seen in figure above, both of the vSwitches have 2 uplinks and each uplink connects to a different physical switch.&lt;/li&gt; &lt;li&gt;d. ESX/ESXi can have a max of 32 uplinks and these uplinks can be spread across multiple vSwitches or all tossed into a NIC team on one vSwitch.&lt;/li&gt; &lt;li&gt;e. Building a functional NIC team requires that all uplinks be connected to physical switches in the same broadcast domain. If VLANs are used then all the switches should be configured for VLAN trunking and the appropriate subset of VLANs must be allowed across the VLAN trunk.&lt;/li&gt; &lt;li&gt;f. The load balancing feature of NIC teaming does not function like the load balancing feature of advanced routing protocol and hence is not a product of identifying the amount of traffic transmitted through a network adapter and shifting traffic to equalize data flow through all available adapters. Rather the load balancing algorithm for NIC teams in a vSwitch is a balance of the number of connections – not amount of traffic. NIC teams on a vSwitch can be configured with one of following 3 policies:&lt;/li&gt; &lt;ul&gt; &lt;li&gt;i. &lt;b&gt;vSwitch port based load balancing&lt;/b&gt; (default)&lt;/li&gt; &lt;li&gt;This policy setting ensures that network adapter connected to a vSwitch port will consistently use the same physical network adapter. In the event one of the uplinks fails, the traffic from failed uplink will failover to another physical adapter.&lt;/li&gt; &lt;li&gt;This setting is best used when number of virtual network adapters is greater than number of physical network adapters. Link aggregation using 802.3ad teaming is not supported with this and MAC based load balancing policies.&lt;/li&gt; &lt;li&gt;&lt;b&gt;ii. &lt;/b&gt;&lt;b&gt;Source MAC based load balancing&lt;/b&gt;&lt;/li&gt; &lt;li&gt;It has same limitations as previous method – it’s also static mapping of vNIC MAC to a pNIC. Traffic originating from a vNIC will always go through the same physical NIC in this approach (Same as previous).&lt;/li&gt; &lt;li&gt;&lt;b&gt;iii. &lt;/b&gt;&lt;b&gt;IP hash based load balancing (out-IP policy)&lt;/b&gt;&lt;/li&gt; &lt;li&gt;It uses source and destination IP addresses to determine the physical network adapter for communication. This allows traffic originating from a single vNIC to go over multiple physical NICs when communicating with different destinations.&lt;/li&gt; &lt;li&gt;This policy setting requires all physical NICs be connected to same physical switch. Also the switch must be configured for link aggregation (which can increase the throughput by combining the bandwidth of multiple physical NICs for use by a single vNIC of a VM). ESX/ESXi supports standard 802.3ad teaming in static (manual) mode and does not support LACP or PAgP.&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;g. The load balancing feature on vSwitch applies only to the outbound traffic.&lt;/li&gt; &lt;li&gt;h. &lt;b&gt;Failover detection&lt;/b&gt; with NIC teaming can be configured to use either a link status method or a beacon probing method.&lt;/li&gt; &lt;ul&gt; &lt;li&gt;i. Link status method – failure of an uplink is determined by link status provided by physical network adapter. But this can only identify the link status of pNIC to edge switch and not the link status between the edge switch to an upstream switch.&lt;/li&gt; &lt;li&gt;ii. Beacon probing failover detection – included link status as well as &lt;b&gt;sends Ethernet broadcast frames across all physical network adapters in NIC team&lt;/b&gt; which help detect upstream network connection failures as well and will force failover when STP blocks ports, when ports are configured with wrong VLAN or when a switch to switch connection has failed. When a beacon is not returned on a pNIC the vswitch triggers failover.&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;i. Failback option controls how ESX will handle a failed network adapter when it recovers from failure. Default setting is yes which means the adapter will be returned to active duty immediately upon recovery and it will replace the standby adapter that may have taken its place during the failure. Setting it to No means the recovered adapter will remain inactive until another adapter fails. &lt;/li&gt; &lt;li&gt;j. One can even use the setting “Explicit failover order” in which case traffic will move to next available uplink in the list of active adapters. If no active adapters are available then traffic will move down the list to the standby adapters.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;17. &lt;/b&gt;&lt;b&gt;vNetwork Distributed Virtual Switches:&lt;/b&gt; &lt;ul&gt; &lt;li&gt;a. A dvSwitch spans multiple servers instead of each server having its own set of vSwitches.&lt;/li&gt; &lt;li&gt;b. First you create a dvSwitch and you add hosts to it during or after creation.&lt;/li&gt; &lt;li&gt;c. When an additional ESX host is added to a dvSwitch, all of the dvPortgroups will automatically be propagated to the new host with the correct configuration. This is the distributed nature of the dvSwitch – as configuration changes are made via the vSphere client a vSphere server pushes those changes out to all participating hosts in the dvSwitch.&lt;/li&gt; &lt;li&gt;d. A host cannot be removed from a dvSwitch if it still has VMs connected to a dvPortgroup on that dvSwitch.&lt;/li&gt; &lt;li&gt;e. Adding dvPortgroup:&lt;/li&gt; &lt;ul&gt; &lt;li&gt;i. Name of dvPortgroup – unique across member hosts of dvSwitch.&lt;/li&gt; &lt;li&gt;ii. Number of ports: 128 default, max configurable value is 8192.&lt;/li&gt; &lt;li&gt;iii. VLAN Type: &lt;/li&gt; &lt;ul&gt; &lt;li&gt;1. None – dvPortgroup will receive only untagged traffic&lt;/li&gt; &lt;li&gt;2. VLAN – dvPortgroup will receive tagged traffic and uplinks must connect to switch ports configured as VLAN trunks&lt;/li&gt; &lt;li&gt;3. VLAN Trunking – dvPortgroup will pass VLAN tags up to guest OS on any connected VMs&lt;/li&gt; &lt;li&gt;4. Private VLAN &lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;18. &lt;/b&gt;&lt;b&gt;FAQ: &lt;/b&gt; &lt;ul&gt; &lt;li&gt;a. Can we have vNIC created without portgroup association? NO - API requires you to specify an existing portgroup while creating vNIC.&lt;/li&gt; &lt;li&gt;b. You can assign any name to vswitch - for eg. 'ViMaster Switch'&lt;/li&gt; &lt;li&gt;c. Standard vSwitch Port group name is unique within a host&lt;/li&gt; &lt;li&gt;d. Hybrid deployments (vDS + vSS) is a supported deployment scenario. If vCenter fails then you won’t be able to manage your vDS so it is recommended that we use vSS for at least the VMKernel and Service Console connections. One can have the VM port groups on vDS though.&lt;/li&gt; &lt;li&gt;e. We can assign a virtual hard disk carved out of a VMFS datastore over an iSCSI LUN to a VM with no network card (vnics).&lt;/li&gt; &lt;li&gt;f. For software iSCSI initiator we can tell the vmknic interface being used by identifying which iscsi target is in the same subnet as the vmknic interface. &lt;/li&gt; &lt;li&gt;&lt;b&gt;g. &lt;/b&gt;For hardware iSCSI initiator no vmkernel port needs to be configured and it will show up as a normal FCHBA (Storage adapters) in vSphere client. The ip address will be configured on the HBA directly.&lt;b&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-233997345749947401?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/233997345749947401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=233997345749947401&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/233997345749947401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/233997345749947401'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/06/vmware-vsphere-4-networking-essentials.html' title='VMware vSphere 4 Networking Essentials'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-6889710092863454896</id><published>2011-06-14T03:00:00.002-04:00</published><updated>2011-06-14T03:05:32.783-04:00</updated><title type='text'>Book Review: The Kite Runner</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://upload.wikimedia.org/wikipedia/en/6/62/Kite_runner.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://upload.wikimedia.org/wikipedia/en/6/62/Kite_runner.jpg" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I listened to the audio book “The Kite Runner” read by the author Mr. &lt;a href="http://en.wikipedia.org/wiki/Khaled_Hosseini"&gt;Khaled Hosseini&lt;/a&gt;. This book has a very strong story line to keep the reader’s attention occupied. I liked the story and following are some thoughts on the book:&lt;br /&gt;1. Relation between Amir and Hassan – the loyalty and unconditional devotion which Hassan has for Amir speaks for the mindset that society can impose on an individual of lower rank that such an individual can never come out of. In spite of Amir’s cowardly manners Hassan never blames him and even accepts the false charges of being a thief just so that Amir is not caught red handed was quite touching.&lt;br /&gt;2. The way Hazara community was treated in Afghanistan or the Shudras were treated in India or the Jews were treated by Nazis is a fact that humanity should never forget just so that it never repeats those mistakes in the future. It is works like this book that remind us of our abhorrent mistakes of the past and reinforces into us the realization that we should never let this repeat itself. &lt;br /&gt;3. Reader gets a feel of the Afghan culture – what a pushtun clan can value, respect for elders in the society and the values like this that parents teach their children.&lt;br /&gt;4. How the Afghan people were scared of the Taliban and some mentions of the atrocities that Taliban militia men conducted on&amp;nbsp; people. &lt;br /&gt;5. Amir adopts Hassan’s son Sohrab and brings him to US and the problems that he faces with the consulate even though he was a US Citizen was also quite believable and something any foreign national living in US can relate to.&lt;br /&gt;Overall the story was well told – its not very big book and I could complete listening to it within 4 days. Now I will like to see the movie and will update this post with how I found that later.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-6889710092863454896?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/6889710092863454896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=6889710092863454896&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6889710092863454896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6889710092863454896'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/06/book-review-kite-runner.html' title='Book Review: The Kite Runner'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-2975670656122127354</id><published>2011-05-14T16:54:00.004-04:00</published><updated>2011-05-16T07:11:41.366-04:00</updated><title type='text'>Rushil learning swimming</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-31MDfFx3qoU/TckBMLY8_0I/AAAAAAAASs8/WSJYD_5Jo2s/s1600/IMG_1110.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="239" src="http://1.bp.blogspot.com/-31MDfFx3qoU/TckBMLY8_0I/AAAAAAAASs8/WSJYD_5Jo2s/s320/IMG_1110.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This is the picture of Rushil learning swimming at DACA Swim Center (www.daca.org). He is 3.5yrs old now. He is enjoying the experience of swimming this summer.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-2975670656122127354?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/2975670656122127354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=2975670656122127354&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2975670656122127354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2975670656122127354'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/05/rushil-learning-swimming.html' title='Rushil learning swimming'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-31MDfFx3qoU/TckBMLY8_0I/AAAAAAAASs8/WSJYD_5Jo2s/s72-c/IMG_1110.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-1238313968555651333</id><published>2011-03-08T05:36:00.003-05:00</published><updated>2011-03-08T05:39:02.476-05:00</updated><title type='text'>My .vimrc</title><content type='html'>One of my favorite .vimrc config file: &lt;a href="http://www.scribd.com/doc/50269230/vimrc"&gt;http://www.scribd.com/doc/50269230/vimrc&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-1238313968555651333?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/1238313968555651333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=1238313968555651333&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1238313968555651333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1238313968555651333'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/03/my-vimrc_08.html' title='My .vimrc'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-7947681901997334012</id><published>2011-02-25T05:26:00.002-05:00</published><updated>2011-02-25T13:53:44.058-05:00</updated><title type='text'>Book Review: The Fountainhead</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;img align="left" height="253" src="http://g-ecx.images-amazon.com/images/G/01/ciu/7a/82/3019b220dca05cf35a9b3010.L.jpg" style="display: inline; float: left;" width="149" /&gt;&lt;br /&gt;I recently completed the book &lt;a href="http://en.wikipedia.org/wiki/The_Fountainhead"&gt;The Fountainhead by Ayn Rand&lt;/a&gt;. Following is the review of the book:&lt;br /&gt;Fountainhead is the story of an architect, named Howard Roark, who is extremely passionate about the field of architecture but his ideas about it are not in tune with the times in which he lives in. In his time the teachers in his college to the professional architects practicing business were all of the view that the field of building design and architecture has already reached its pinnacle of evolution and needs no further change from what the masters of the past have already established as the best approach to building design possible – namely the gothic architecture. Howard Roark was a modernist and did not endorse to the idea of gothic architecture and wanted to do the building design in a more modern way in tune with the demands of the present times. As a result, he is faced with several challenges while practicing architecture his own way. He wont get any contracts, he does not work if people don’t accept his design exactly as he designed it without any change, and there were people who worked against him to ensure he succumbs to the pain they inflict on him. Ayn Rand has very elegantly tried to convey the message that in this world most of us are mere second-handers who adopt the genius of one man and keeping towing to that line without wanting or accepting any change. When there comes a man who tries to bring in something new something different than the norm then the whole world goes against such a man – since that man represents the one that most of us mere humans are not – such a man is more able than any of the average men around him and so the world does not want to let him be since that man makes others realize that they are inferior than him. Such average mere mortals have low self-respect, no integrity and they endorse but one thing – that good of the community is more important than the good of the individual. An individual may be sacrificed for the good of the community if need be. Such people cannot stand alone and require support of the other like minded men. They only know to feed on the genius of the first handers – men like Howard Roark. Ayn Rand goes on to expound on the virtues of being selfish – to love oneself is not sin – but a primary duty of an individual toward himself. She goes on to mention that where there is some sacrifice being done by someone there is someone getting what is being sacrificed. In the name of religion and politics, in the name of brotherhood we come across several such people who vehemently try to emphasize to others the virtues of being unselfish and to practice sacrifice/renunciation. &lt;br /&gt;Howard Roark says – I shall not live for any other man nor will I expect any man to live for me. &lt;br /&gt;The philosophy behind this story is gripping and forces one to think about whether one has integrity or are we going to end up as one of the mere second handers.   &lt;br /&gt;&lt;br /&gt;The important characters are:&lt;br /&gt;Howard Roark – the hero or the protagonist.&lt;br /&gt;Dominique Francone – the heroine who loves Roark&lt;br /&gt;Peter Keating – Roark’s college mate who starts with being a go-getter and then realizes that in his passion to succeed he has lost his integrity.&lt;br /&gt;Gayle Wynand – the industrialist who is the alter ego of Howard Roark &lt;br /&gt;Ellsworth Toohey – the villain – he feeds on the souls of the unsure the second hander population which needed some moral support from him and his guidance since they lacked their own decision their own integrity&lt;br /&gt;Henry Cameron – an architect who Roark works for in his first job&lt;br /&gt;Highly recommended. Even if one does not like the philosophy one should still read this book for the literary value it has – the prose of &lt;a href="http://nasonart.com/personal/lifelessons/fountainhead.html"&gt;Howard Roark’s statement in the court&lt;/a&gt;, Ellsworth Toohey’s lecture to Peter Keating and in general the dialogues exchanged between the characters are very well composed and a pleasure to read.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-7947681901997334012?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/7947681901997334012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=7947681901997334012&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7947681901997334012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7947681901997334012'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/02/book-review-fountainhead.html' title='Book Review: The Fountainhead'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-8690961786418438001</id><published>2011-02-09T05:07:00.001-05:00</published><updated>2011-02-09T05:07:19.189-05:00</updated><title type='text'>Book Review: The Read-Aloud Handbook</title><content type='html'>&lt;p&gt;&lt;img style="display: block; float: none; margin-left: auto; margin-right: auto" src="http://www.trelease-on-reading.com/default06-images/rah-cov06.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The read-aloud handbook by Jim Trelease is a treatise on the importance of reading aloud books to your children (by parents or by teachers in classroom). Mr Trelease brings forth several examples of how some parents were able to inculcate into their kids the habit of reading by beginning to read to them from early childhood. I will try to summarize my own experience of following this idea with my kid Rushil (who is 3.5yrs old).&lt;/p&gt;  &lt;p&gt;I don’t remember exactly when I started to read on a regular basis during bed time to Rushil but it was approximately around 1.5yrs of age and only recently around 2.5-3yr age Rushil has started to show very positive interest in the books and just wants me to continue to read to him one book after another. Nowadays I read to him for at least 30mins during bed time but that is the least and mostly I have to read 2 stories (either from one book or 2 books). We visit the library once a week on Saturday’s after him gym class and of late that has become a routine and Rushil has come to expect that on Saturday’s and going to library is a pleasure trip for him as he gets to pick books and also DVDs &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://lh4.ggpht.com/_qVBiMGte-S0/TVJnVh_nEnI/AAAAAAAARt0/nXWWSJ1jgMs/wlEmoticon-smile2.png?imgmax=800" /&gt; there. We bring usually 2-5 books at a time with some books containing multiple stories. Apart from bedtime stories I also try to read to him while he is eating but that’s not a routine. Until now I have only been reading to him picture books and have also tried some chapter picture books (especially the Usborne anthologies ones which are picture books divided into chapters with about 70 pages for each story). I am yet to try reading a chapter from a Novel (like &lt;a href="http://www.amazon.com/Charlottes-Web-B-White/dp/0064410935/ref=pd_ts_b_10?ie=UTF8&amp;amp;s=books"&gt;Charlotte’s Web&lt;/a&gt; by E. B. White). Once we also brought an audio book collection from library of Fairy tales and I was pleasantly surprised that Rushil was listening to the story of the Ugly Duckling quite intently. The audio books can be a good variety to play in the car at times. &lt;/p&gt;  &lt;p&gt;Now going back to the book, the read-aloud handbook, it contains a list of books to be read aloud organized by the type of books and the kid’s age range. We can also find good lists on Amazon web site on which books to read to children of certain age. The list comes in handy in deciding which books are good to be read-aloud to children. In the first part of the book the author gives instances of several people who have written to him or spoken to him retelling their own experiences of reading to their students or children and the changes they witnessed in the kids. Also he mentions of research works which corroborate the fact that reading aloud to children is the best thing parents can do for their children’s education – by helping them build a solid foundation and imagination and most importantly inculcating in their kids the value of reading as a pleasure giving activity so that children are encouraged to read more as they grow. The book also recommends that parent’s themselves should lead by example by becoming avid readers. Reading aloud should also be done even after children start reading on their own. The book mentions of using close caption feature of TV while letting kids watch TV so that they also get to see the text together with what they hear – as this also may help in familiarizing the child with the sound and the text of words which will help them eventually in learning to read those text. &lt;/p&gt;  &lt;p&gt;If you are a parent then it’s a good book to read to know about the values of reading aloud to your children.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-8690961786418438001?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/8690961786418438001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=8690961786418438001&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8690961786418438001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8690961786418438001'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/02/book-review-read-aloud-handbook.html' title='Book Review: The Read-Aloud Handbook'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_qVBiMGte-S0/TVJnVh_nEnI/AAAAAAAARt0/nXWWSJ1jgMs/s72-c/wlEmoticon-smile2.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-6316398078117503293</id><published>2011-02-05T12:04:00.010-05:00</published><updated>2011-02-06T12:44:53.337-05:00</updated><title type='text'>WattOS distro review</title><content type='html'>&lt;a href="http://www.planetwatt.com/"&gt;WattOS&lt;/a&gt; is a very fast Ubuntu based distro which i have started using now on my not-so-old laptop (Dell Vostro). I tried several re-mastered Ubuntu distros but somehow i was not getting the optimum performance out of my laptop. It was generally running slower than my work laptop which has windows XP and even though my Vostro has modest RAM and processor but even with Ubuntu (Gnome desktop one) i could see the processor being used upto 40% with just some apps in operation (an IDE, a terminal etc). Also the browsing speed was sub-par. With WattOS i see the performance on the same Vostro laptop very good. I hope this is going to remain stable. WattOS only supports 32 bit for now and even though my Vostro has Core 2 Duo (64 bit processor) i was ok with using a 32 bit distro too as even Ubuntu site mentions that 32 bit edition is more stable release. It uses LXDE/OpenBox desktop environment. WattOS uses the latest Ubuntu Linux as a basis using only the core  system and then slowly adding base modules to ensure a small memory  footprint, and speed.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I tried several distros before and even liked them but had it been a faster machine the distros like pinguy OS are very good and beautiful indeed but for my Vostro they were just too bulky. WattOS does not come with any games at all nor does it have several of the applications that come with the standard Ubuntu distribution but comes with bare minimal of the applications only - for office they have AbiWord, Leafpad for text editior, KeepassX for password management, fotoxx for photo management, Firefox as the default browser (which i replaced with Chromium), and then you have the Synaptic Package manager to add any other that you want. I will be using this system mostly for Java development and programming stuff and not for any document editing at all (as for those i have a windows 7 desktop) so i wont care too much about how complete a desktop it has and i will prefer if it does not have too many extra apps that i will not use like at all.  So i am happy with the speed and performance of the machine and feel like my old laptop is rejuvenated. I wish i had found such an OS as wattOS earlier without having to waste my time in trying out others. Now my CPU usage under similar load conditions as perviously described is around 3% and memory usage is 1% (i have 4GB RAM).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Introduction excerpted from the WattOS site:&lt;br /&gt;wattOS is a lightweight Linux operating system remastered from the core  Ubuntu Linux build. It is a free operating system that focuses on a  small footprint, low power, and a simple quick interface. Bring your old  computer back to life again with a fresh install of wattOS!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-6316398078117503293?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/6316398078117503293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=6316398078117503293&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6316398078117503293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6316398078117503293'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/02/wattos-distro.html' title='WattOS distro review'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-8570852668015207513</id><published>2011-01-31T03:47:00.001-05:00</published><updated>2011-01-31T03:47:04.932-05:00</updated><title type='text'>Book Review: Kidnapped (Graphic Novella)</title><content type='html'>&lt;p&gt;&lt;img style="display: block; float: none; margin-left: auto; margin-right: auto" src="http://ecx.images-amazon.com/images/I/517VWEB8F7L._SL500_AA300_.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I recently got hold of this book – &lt;a href="http://www.amazon.com/Kidnapped-Graphic-Novel-Full-Colour/dp/1902407385/ref=sr_1_1?ie=UTF8&amp;amp;qid=1296462651&amp;amp;sr=8-1"&gt;Kidnapped by R. L. Stevenson&lt;/a&gt;, from the local library and it proved to be an interesting read and the illustrations in the novel were very good too. Its an abridged edition of course but is able to hold the interest of the reader quite well indeed. Following is some summary of the book in my words – David Balfour goes seeking for his inheritance after his father’s demise – and meets his uncle Ebenezer Balfour who is the evil kind who will not want David to get his share of the estate and conspires to kill David but fails and eventually manages to sell David off for bondage labor to a captain of the Covenant ship. There David happens to meet a guy of Scottish decent who he befriends and who finally helps David to come back to England and get his property back from his uncle. The adventures of David and his friend while they escape from the Covenant till they reach England forms the major part of the story line. Overall a&amp;#160; nicely done novella – good for a quick read.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-8570852668015207513?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/8570852668015207513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=8570852668015207513&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8570852668015207513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8570852668015207513'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/01/book-review-kidnapped-graphic-novella.html' title='Book Review: Kidnapped (Graphic Novella)'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-8836825306440665824</id><published>2011-01-30T15:34:00.002-05:00</published><updated>2011-05-16T06:06:11.513-04:00</updated><title type='text'>Book Review: The Call of the Wild</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://ecx.images-amazon.com/images/I/515rshMa4YL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://ecx.images-amazon.com/images/I/515rshMa4YL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This is my first review of any book on my blog. I have recently started paying attention to my reading habit and have completed the first book – by author &lt;a href="http://en.wikipedia.org/wiki/Jack_London"&gt;Jack London&lt;/a&gt; – &lt;a href="http://en.wikipedia.org/wiki/Call_of_the_wild"&gt;The Call of the Wild&lt;/a&gt;. Though much has already been written about the book I will try to summarize it in my words below. This story has its appeal for me for the fact that I am presently staying in Santa Clara California where Buck used to live in Judge Miller’s house and I have also once visited Alaska where most of the story is based on.&lt;br /&gt;This is a classic American story about a dog (Buck) who is sold by Judge Miller’s (in who’s household Buck used to inhabit as a pet born of a Saint Bernard father and a Scotch Shepherd Mother) gardener, Manuel, to the wrong hands at the time when (strong sled) dogs were in great demand (due to &lt;a href="http://en.wikipedia.org/wiki/Klondike_Gold_Rush"&gt;Klondike Gold Rush&lt;/a&gt;). And so Buck was relocated from the Santa Clara valley California to the north land (Alaska). The story is about how Buck experiences and sustains through the drastic change in his life being brought about by being moved from a domesticated pet dog to a hard working sled dog in the extreme climate of the north land. Buck survives it all because of his physical strength, ability to adapt to the changing environment, and above all, not loosing his values and remaining true to his self. Buck was passed on from one master to the next but they all liked him except for the trio who were themselves bad masters and they end up loosing Buck to Thornton. Bucks affection for Thornton is very heart warming. Eventually Buck avenges for his master’s death and returns to answer the call of the wild – where he does not kill for pleasure but only for his need to survive.&lt;br /&gt;This is a children’s classic and is a quick read and a nicely told story. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-8836825306440665824?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/8836825306440665824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=8836825306440665824&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8836825306440665824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8836825306440665824'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2011/01/book-review-call-of-wild.html' title='Book Review: The Call of the Wild'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-21527962683756771</id><published>2010-11-27T09:55:00.002-05:00</published><updated>2011-01-03T04:36:37.359-05:00</updated><title type='text'>My new 2011 Honda Odyssey EX-L</title><content type='html'>&lt;p&gt;Its been quite some time that I have been keeping silent on this blog but today I just could not resist the need to announce it to the who-so-ever-is-interested (may be its just me – and yes I do like to read what I wrote in the past some times) that I bought my second car – which is not a car but a mini-van and the best in its category at the time of the purchase – the new 2011 Honda Odyssey. I went for the EX-L trim which comes with leather seats and many other luxuries which one does not often need but are nice to have. The color is Polished Metal (dark grey) and the interior leather color is beige (light greyish brown). I just drove it a little bit till now (from dealer’s showroom to home) but the feel of driving a brand new Odyssey is just as I read about it described on the several forums (which I visited while researching which of the Honda Odyssey, Toyota Sienna or Acura MDX should be my next car). They said it is a driver’s mini-van (meaning you will have perfect control on the vehicle while steering it – the steering control is almost perfect) and which makes even a big mini-van quite easy to maneuver. Also the 2011 is state-of-the-art with many of the tech features coming standard (like Bluetooth, Auxiliary Jack for MP3 players, USB port to charge iPODs etc). There are some unique convenience features like the cool box refrigerator, a trash holder in the 2nd row which are unique to the Odyssey 2011 (no other mini-van has it right now). &lt;/p&gt;  &lt;p&gt;&lt;img src="http://1.images.ebizautos.com/sites/stockchrome/colormatched_transparent/640/cc_2011hon010d_640/cc_2011hon010d_640_si.png" /&gt;&lt;/p&gt;  &lt;p&gt;After juggling between Sienna, Odyssey and MDX we decided to go for Odyssey because of its better ratings as the best mini-van and economical mileage, nice technical package that came standard (which definitely increase the ease of use of the vehicle), the 2011 is a design refresh year for Honda Odyssey so many improvements have been made over the previous model,&amp;#160; the cost was bearable (compared to MDX), even though it does not have a 4WD I decided to go for it because I already have the Honda Element which is a 4WD vehicle and in the bay area we don’t usually need the 4WD unless you are travelling to the Sierra’s (lake tahoe etc) where there is snow fall. We also considered the equally priced Honda Pilot EX-L but somehow after having one SUV (even though Element is a compact SUV) I did not want to own another similar (only little bigger) vehicle. Mini-vans are more roomy, more comfy and the 2011 model of Ody also looks and feels more like driving a car than a mini-van. &lt;/p&gt;  &lt;p&gt;I have a 3.5yr old kid and the purpose of this van was to mainly drop and pickup the kid from school. But we also wanted to buy something more comfortable, not very luxurious but at least one that makes those couple family vacations to LA and the like more pleasurable. I first wanted to buy an MDX but I realized that it was too much of a stretch to go for (in&amp;#160; terms of the cost of the car and its maintenance cost – only take premium gas and mileage is 16mpg, parts are expensive etc.). The other option was to get a used MDX but then I somehow prefer to own a less luxurious or less powerful *new* car than a fully loaded luxury car which is used one (I know this is not exactly being practical but Ody seemed to be a nice compromise and here’s why – I could get a fully loaded MDX Touring with RES/NAV used 2005 model with 50K+ miles on it comes for 24K approx. and if I spend 13k more I get a new Honda Odyssey 2011 which is not the fully loaded model but has all that I care for with just 2 miles on it &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://lh5.ggpht.com/_qVBiMGte-S0/TPEbzA9PmoI/AAAAAAAAQBA/rvfGbew-gt4/wlEmoticon-smile%5B2%5D.png?imgmax=800" /&gt;). I did not need the RES/NAV but what I cared for more was the leather seats, power doors, power tailgate, blue tooth hands free support. For RES and NAV I did not want to shell out another 3-4k more. I can always put a GPS in the car for much less price. Also the mini-van is in general more roomy and hence more comfortable on longer trips than any SUV. Also climbing in and out of the van for kids and older people is generally easier. &lt;/p&gt;  &lt;p&gt;Enough with the pros of Ody, now the cons are: it does not come with 4WD, parking is a hassle some times, does not look as cool as an SUV would. But for me the pros outweighed the cons. Between Sienna and Ody, the Ody looked much better than the 2011 Sienna (which to me looked more like an ambulance). Sienna has a 4WD option but the mileage was minus 3 mpg from the 2WD one. Also the reviews that 2011 Ody got were better than 2011 Sienna.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-21527962683756771?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/21527962683756771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=21527962683756771&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/21527962683756771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/21527962683756771'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2010/11/my-new-2011-honda-odyssey-ex-l.html' title='My new 2011 Honda Odyssey EX-L'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_qVBiMGte-S0/TPEbzA9PmoI/AAAAAAAAQBA/rvfGbew-gt4/s72-c/wlEmoticon-smile%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-1342015721925975823</id><published>2010-04-21T20:52:00.002-04:00</published><updated>2010-04-21T21:09:29.903-04:00</updated><title type='text'>Setting up NFS Server on Linux</title><content type='html'>Steps to setup the NFS server on RHEL 5 Linux:&lt;br /&gt;For details you can refer to &lt;a href="http://nfs.sourceforge.net/"&gt;http://nfs.sourceforge.net/&lt;/a&gt;. &lt;div&gt;1. Check if NFS is not already running by typing the command: rpcinfo -p&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;# rpcinfo -p&lt;/b&gt;&lt;/div&gt;&lt;div&gt;   program vers proto   port&lt;/div&gt;&lt;div&gt;    100000    2   tcp    111  portmapper&lt;/div&gt;&lt;div&gt;    100000    2   udp    111  portmapper&lt;/div&gt;&lt;div&gt;    100024    1   udp    895  status&lt;/div&gt;&lt;div&gt;    100024    1   tcp    898  status&lt;/div&gt;&lt;div&gt;    100011    1   udp    725  rquotad&lt;/div&gt;&lt;div&gt;    100011    2   udp    725  rquotad&lt;/div&gt;&lt;div&gt;    100011    1   tcp    728  rquotad&lt;/div&gt;&lt;div&gt;    100011    2   tcp    728  rquotad&lt;/div&gt;&lt;div&gt;    100003    2   udp   2049  nfs&lt;/div&gt;&lt;div&gt;    100003    3   udp   2049  nfs&lt;/div&gt;&lt;div&gt;    100003    4   udp   2049  nfs&lt;/div&gt;&lt;div&gt;    100021    1   udp  32774  nlockmgr&lt;/div&gt;&lt;div&gt;    100021    3   udp  32774  nlockmgr&lt;/div&gt;&lt;div&gt;    100021    4   udp  32774  nlockmgr&lt;/div&gt;&lt;div&gt;    100003    2   tcp   2049  nfs&lt;/div&gt;&lt;div&gt;    100003    3   tcp   2049  nfs&lt;/div&gt;&lt;div&gt;    100003    4   tcp   2049  nfs&lt;/div&gt;&lt;div&gt;    100021    1   tcp  54361  nlockmgr&lt;/div&gt;&lt;div&gt;    100021    3   tcp  54361  nlockmgr&lt;/div&gt;&lt;div&gt;    100021    4   tcp  54361  nlockmgr&lt;/div&gt;&lt;div&gt;    100005    1   udp    791  mountd&lt;/div&gt;&lt;div&gt;    100005    1   tcp    794  mountd&lt;/div&gt;&lt;div&gt;    100005    2   udp    791  mountd&lt;/div&gt;&lt;div&gt;    100005    2   tcp    794  mountd&lt;/div&gt;&lt;div&gt;    100005    3   udp    791  mountd&lt;/div&gt;&lt;div&gt;    100005    3   tcp    794  mountd&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;If the output looks something similar to above then NFS service is already running and you may need to just restart it in case you are modifying the /etc/exports file. If you don't see the nfs service being printed as output of command rpcinfo -p then follow the next steps.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Create a /etc/exports file (if not already present). For details and other examples refer to the &lt;a href="http://linux.die.net/man/5/exports"&gt;man exports&lt;/a&gt; documentation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Format for entries in this file is:&lt;/div&gt;&lt;div&gt;&lt;b&gt;/directory/to/share nfs_client_host(options)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Following entry is only good for testing purposes (as it is insecure).&lt;/div&gt;&lt;div&gt;&lt;b&gt;----- edit start -----&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;/vm_share *(rw,insecure)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;----- edit end ------&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. Now run the below command to export all the directories.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;$ /usr/sbin/&lt;/b&gt;&lt;a href="http://linux.die.net/man/8/exportfs"&gt;&lt;b&gt;exportfs &lt;/b&gt;&lt;/a&gt;&lt;b&gt;-a&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. Restart the nfsd from the /etc/init.d script file. This may vary across distributions of linux. In case of RHEL 5, this file happens to be /etc/init.d/nfs. Pass it the option to start or restart.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5. Again verify that rpcinfo -p now prints nfs service too (as shown above).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now you can use any NFS client to access the shared NFS directory /vm_share on the linux host.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-1342015721925975823?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/1342015721925975823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=1342015721925975823&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1342015721925975823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1342015721925975823'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2010/04/setting-up-nfs-server-on-linux.html' title='Setting up NFS Server on Linux'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-485680746113879006</id><published>2009-12-24T14:29:00.005-05:00</published><updated>2009-12-26T20:11:51.844-05:00</updated><title type='text'>Singleton Pattern with Lazy Initialization On Demand Holder</title><content type='html'>&lt;p&gt;This is one of the better ways to implementing a singleton class (class which lets user create one and only one instance).&lt;/p&gt;  &lt;p&gt;It uses Initialization on demand holder pattern.&lt;/p&gt;  &lt;br /&gt;  &lt;pre&gt;&lt;br /&gt;public class Singleton {&lt;br /&gt; private static class LazyHolder {&lt;br /&gt;  private static final Singleton instance = new Singleton();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public static Singleton getInstance() {&lt;br /&gt;  return LazyHolder.instance;&lt;br /&gt; }&lt;br /&gt;         &lt;br /&gt; private Singleton() {&lt;br /&gt;  //initialize singleton instance&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-485680746113879006?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/485680746113879006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=485680746113879006&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/485680746113879006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/485680746113879006'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/12/singleton-pattern-with-lazy.html' title='Singleton Pattern with Lazy Initialization On Demand Holder'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-8251241320212277468</id><published>2009-12-22T04:13:00.001-05:00</published><updated>2009-12-22T04:13:20.440-05:00</updated><title type='text'>Using Apache Thrift for RPC over TCP socket</title><content type='html'>&lt;p&gt;&lt;a href="http://wiki.apache.org/thrift/FrontPage"&gt;Apache thrift&lt;/a&gt; is a framework for cross language RPC service/client implementation. Thrift has a small IDL (interface definition language) and comes with an IDL compiler that generates code to be used to easily build RPC clients and servers that communicate seamlessly across programming languages. &lt;/p&gt;  &lt;p&gt;First you need to &lt;a href="http://incubator.apache.org/thrift/"&gt;download thrift&lt;/a&gt; and then install &lt;a href="http://www.cygwin.com/"&gt;Cygwin&lt;/a&gt; (i used 1.7 version of Cygwin).&lt;/p&gt;  &lt;p&gt;Since the thrift is distributed in source form so we first need to build the thrift.exe IDL compiler. Follow &lt;a href="http://wiki.apache.org/thrift/ThriftInstallationWin32"&gt;this document&lt;/a&gt; to generate the compiler exe on windows (mine is Windows 7 home premium x64).&lt;/p&gt;  &lt;p&gt;Following is an example usage. We intend to write a C# service and a Java client that implement the following interface (hello.thrift):&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; java hello&lt;br /&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; csharp hello&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;enum&lt;/span&gt; Operation {&lt;br /&gt;  ADD = 1,&lt;br /&gt;  SUBTRACT = 2,&lt;br /&gt;  MULTIPLY = 3,&lt;br /&gt;  DIVIDE = 4&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;struct&lt;/span&gt; Work {&lt;br /&gt;  1: i32 num1 = 0,&lt;br /&gt;  2: i32 num2,&lt;br /&gt;  3: Operation op,&lt;br /&gt;  4: &lt;span class="kwrd"&gt;string&lt;/span&gt; comment,&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;exception InvalidOperation {&lt;br /&gt;  1: i32 what,&lt;br /&gt;  2: &lt;span class="kwrd"&gt;string&lt;/span&gt; why&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;service HelloService {&lt;br /&gt;&lt;br /&gt;   &lt;span class="kwrd"&gt;void&lt;/span&gt; ping(),&lt;br /&gt;&lt;br /&gt;   i32 add(1:i32 num1, 2:i32 num2),&lt;br /&gt;&lt;br /&gt;   i32 calculate(1:i32 logid, 2:Work w) throws (1:InvalidOperation ouch),&lt;br /&gt;   &lt;br /&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; greeting(),&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Compile the above thrift file with the thrift compiler to generate both java and c# code.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;thrift.exe -r --gen java hello.thrift&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;thrift.exe –r –gen csharp hello.thrift&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Following is the service (Program.cs):&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Thrift;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Thrift.Transport;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Thrift.Protocol;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Thrift.Server;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; hello;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; thriftcsserv&lt;br /&gt;{&lt;br /&gt;    &lt;span class="kwrd"&gt;class&lt;/span&gt; Program&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;try&lt;/span&gt;&lt;br /&gt;            {&lt;br /&gt;                HelloServiceHandler handler = &lt;span class="kwrd"&gt;new&lt;/span&gt; HelloServiceHandler();&lt;br /&gt;                HelloService.Processor processor = &lt;span class="kwrd"&gt;new&lt;/span&gt; HelloService.Processor(handler);&lt;br /&gt;                TServerTransport transport = &lt;span class="kwrd"&gt;new&lt;/span&gt; TServerSocket(34568);&lt;br /&gt;                TServer server = &lt;span class="kwrd"&gt;new&lt;/span&gt; TSimpleServer(processor, transport);&lt;br /&gt;&lt;br /&gt;                &lt;span class="rem"&gt;// Use this for a multithreaded server&lt;/span&gt;&lt;br /&gt;                &lt;span class="rem"&gt;// server = new TThreadPoolServer(processor, serverTransport);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Starting the server...&amp;quot;&lt;/span&gt;);&lt;br /&gt;                server.Serve();&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception e)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine(e.Message);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; HelloServiceHandler : HelloService.Iface&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ping()&lt;br /&gt;            { }&lt;br /&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; add(&lt;span class="kwrd"&gt;int&lt;/span&gt; num1, &lt;span class="kwrd"&gt;int&lt;/span&gt; num2)&lt;br /&gt;            {&lt;br /&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; (num1 + num2);&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; calculate(&lt;span class="kwrd"&gt;int&lt;/span&gt; logid, Work w) &lt;br /&gt;            {&lt;br /&gt;                &lt;span class="kwrd"&gt;int&lt;/span&gt; val = 0;&lt;br /&gt;                &lt;span class="kwrd"&gt;switch&lt;/span&gt; (w.Op)&lt;br /&gt;                {&lt;br /&gt;                    &lt;span class="kwrd"&gt;case&lt;/span&gt; Operation.ADD:&lt;br /&gt;                        val = w.Num1 + w.Num2;&lt;br /&gt;                        &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;br /&gt;                    &lt;span class="kwrd"&gt;case&lt;/span&gt; Operation.SUBTRACT:&lt;br /&gt;                        val = w.Num1 - w.Num2;&lt;br /&gt;                        &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;br /&gt;                    &lt;span class="kwrd"&gt;case&lt;/span&gt; Operation.MULTIPLY:&lt;br /&gt;                        val = w.Num1 * w.Num2;&lt;br /&gt;                        &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;br /&gt;                    &lt;span class="kwrd"&gt;case&lt;/span&gt; Operation.DIVIDE:&lt;br /&gt;                        &lt;span class="kwrd"&gt;if&lt;/span&gt; (w.Num2 == 0)&lt;br /&gt;                        {&lt;br /&gt;                            InvalidOperation io = &lt;span class="kwrd"&gt;new&lt;/span&gt; InvalidOperation();&lt;br /&gt;                            io.What = (&lt;span class="kwrd"&gt;int&lt;/span&gt;)w.Op.GetTypeCode();&lt;br /&gt;                            io.Why = &lt;span class="str"&gt;&amp;quot;Cannot divide by 0&amp;quot;&lt;/span&gt;;&lt;br /&gt;                            &lt;span class="kwrd"&gt;throw&lt;/span&gt; io;&lt;br /&gt;                        }&lt;br /&gt;                        val = w.Num1 / w.Num2;&lt;br /&gt;                        &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;br /&gt;                    &lt;span class="kwrd"&gt;default&lt;/span&gt;:&lt;br /&gt;                        InvalidOperation io1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; InvalidOperation();&lt;br /&gt;                        io1.What = (&lt;span class="kwrd"&gt;int&lt;/span&gt;)w.Op.GetTypeCode();&lt;br /&gt;                        io1.Why = &lt;span class="str"&gt;&amp;quot;Unknown operation&amp;quot;&lt;/span&gt;;&lt;br /&gt;                        &lt;span class="kwrd"&gt;throw&lt;/span&gt; io1;&lt;br /&gt;                }&lt;br /&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; val;&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; greeting()&lt;br /&gt;            {&lt;br /&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;Hello world of RPC using thrift from c# service&amp;quot;&lt;/span&gt;;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And the HelloClient.java is below:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;package hello.client;&lt;br /&gt;&lt;br /&gt;import hello.HelloService;&lt;br /&gt;import hello.InvalidOperation;&lt;br /&gt;import hello.Operation;&lt;br /&gt;import hello.Work;&lt;br /&gt;&lt;br /&gt;import org.apache.thrift.TException;&lt;br /&gt;import org.apache.thrift.protocol.TBinaryProtocol;&lt;br /&gt;import org.apache.thrift.protocol.TProtocol;&lt;br /&gt;import org.apache.thrift.transport.TSocket;&lt;br /&gt;import org.apache.thrift.transport.TTransport;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; HelloClient {&lt;br /&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; main(String[] args) {&lt;br /&gt;    &lt;span class="kwrd"&gt;try&lt;/span&gt; {&lt;br /&gt;&lt;br /&gt;      TTransport transport = &lt;span class="kwrd"&gt;new&lt;/span&gt; TSocket(&lt;span class="str"&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;, 34568);&lt;br /&gt;      TProtocol protocol = &lt;span class="kwrd"&gt;new&lt;/span&gt; TBinaryProtocol(transport);&lt;br /&gt;      HelloService.Client client = &lt;span class="kwrd"&gt;new&lt;/span&gt; HelloService.Client(protocol);&lt;br /&gt;&lt;br /&gt;      transport.open();&lt;br /&gt;&lt;br /&gt;      client.ping();&lt;br /&gt;      System.&lt;span class="kwrd"&gt;out&lt;/span&gt;.println(&lt;span class="str"&gt;&amp;quot;ping()&amp;quot;&lt;/span&gt;);&lt;br /&gt;      &lt;br /&gt;      String str = client.greeting();&lt;br /&gt;      System.&lt;span class="kwrd"&gt;out&lt;/span&gt;.println(str);&lt;br /&gt;      &lt;br /&gt;      &lt;span class="kwrd"&gt;int&lt;/span&gt; sum = client.add(1, 1);&lt;br /&gt;      System.&lt;span class="kwrd"&gt;out&lt;/span&gt;.println(&lt;span class="str"&gt;&amp;quot;1+1=&amp;quot;&lt;/span&gt; + sum);&lt;br /&gt;&lt;br /&gt;      Work work = &lt;span class="kwrd"&gt;new&lt;/span&gt; Work();&lt;br /&gt;&lt;br /&gt;      work.op = Operation.DIVIDE;&lt;br /&gt;      work.num1 = 1;&lt;br /&gt;      work.num2 = 0;&lt;br /&gt;      &lt;span class="kwrd"&gt;try&lt;/span&gt; {&lt;br /&gt;        &lt;span class="kwrd"&gt;int&lt;/span&gt; quotient = client.calculate(1, work);&lt;br /&gt;        System.&lt;span class="kwrd"&gt;out&lt;/span&gt;.println(&lt;span class="str"&gt;&amp;quot;Whoa we can divide by 0&amp;quot;&lt;/span&gt;);&lt;br /&gt;      } &lt;span class="kwrd"&gt;catch&lt;/span&gt; (InvalidOperation io) {&lt;br /&gt;        System.&lt;span class="kwrd"&gt;out&lt;/span&gt;.println(&lt;span class="str"&gt;&amp;quot;Invalid operation: &amp;quot;&lt;/span&gt; + io.why);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      work.op = Operation.SUBTRACT;&lt;br /&gt;      work.num1 = 15;&lt;br /&gt;      work.num2 = 10;&lt;br /&gt;      &lt;span class="kwrd"&gt;try&lt;/span&gt; {&lt;br /&gt;        &lt;span class="kwrd"&gt;int&lt;/span&gt; diff = client.calculate(1, work);&lt;br /&gt;        System.&lt;span class="kwrd"&gt;out&lt;/span&gt;.println(&lt;span class="str"&gt;&amp;quot;15-10=&amp;quot;&lt;/span&gt; + diff);&lt;br /&gt;      } &lt;span class="kwrd"&gt;catch&lt;/span&gt; (InvalidOperation io) {&lt;br /&gt;        System.&lt;span class="kwrd"&gt;out&lt;/span&gt;.println(&lt;span class="str"&gt;&amp;quot;Invalid operation: &amp;quot;&lt;/span&gt; + io.why);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      transport.close();&lt;br /&gt;&lt;br /&gt;    } &lt;span class="kwrd"&gt;catch&lt;/span&gt; (TException x) {&lt;br /&gt;      x.printStackTrace();&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now run the service and then the client. The o/p is as follows:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;ping()&lt;br /&gt;    &lt;br /&gt;Hello world of RPC using thrift from c# service&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;1+1=2&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;Invalid operation: Cannot divide by 0&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;15-10=5&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Hope you find this useful. I did not find a direct C# service example but i could easily translate the Java server example to C#. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-8251241320212277468?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/8251241320212277468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=8251241320212277468&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8251241320212277468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8251241320212277468'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/12/using-apache-thrift-for-rpc-over-tcp.html' title='Using Apache Thrift for RPC over TCP socket'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-8689807533826691349</id><published>2009-12-10T13:45:00.007-05:00</published><updated>2009-12-11T05:07:10.529-05:00</updated><title type='text'>JSON-RPC between .NET service and Java client</title><content type='html'>Recently i experimented with &lt;a href="http://jayrock.berlios.de/"&gt;Jayrock .NET library for JSON-RPC&lt;/a&gt; and following its tutorial it was very simple to run a .NET JSON-RPC service on my Win7 Home Premium (IIS 7.5). From my earlier experience with JSON-RPC in Java, i wrote a Java client using &lt;a href="http://code.google.com/p/json-rpc-client/"&gt;json-rpc-client library&lt;/a&gt; and could get the RPC communication happening without any issue. &lt;br /&gt;&lt;br /&gt;The ease with which the code samples worked for the below helloworld-ish sample, motivated me to write about it. JSON-RPC is simpler to debug and implement than SOAP and can be secured by implementing it over https. Most of the time in systems integration all we need is getting the .NET software to communicate with the Java software and in such simpler scenarios where RPC mechanism which is firewall friendly like SOAP is needed then thats where JSON-RPC is a good option.&lt;br /&gt;&lt;br /&gt;helloworld.ashx - the JSONRPCHandler &lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Web;&lt;br /&gt;using Jayrock.Json;&lt;br /&gt;using Jayrock.JsonRpc;&lt;br /&gt;using Jayrock.JsonRpc.Web;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;namespace jayrockserv&lt;br /&gt;{&lt;br /&gt;    public class HelloWorld : JsonRpcHandler&lt;br /&gt;    {&lt;br /&gt;        [JsonRpcMethod("greetings")]&lt;br /&gt;        public string Greetings()&lt;br /&gt;        {&lt;br /&gt;            return "Welcome to Jayrock!";&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [JsonRpcMethod("add")]&lt;br /&gt;        public int sum(int a, int b)&lt;br /&gt;        {&lt;br /&gt;            return (a+b);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Java JSON-RPC client:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Main.java:&lt;br /&gt;&lt;br /&gt;import org.apache.commons.httpclient.HttpState;&lt;br /&gt;import org.apache.commons.logging.Log;&lt;br /&gt;import org.apache.commons.logging.LogFactory;&lt;br /&gt;import org.codebistro.jsonrpc.Client;&lt;br /&gt;import org.codebistro.jsonrpc.HTTPSession;&lt;br /&gt;import org.codebistro.jsonrpc.TransportRegistry;&lt;br /&gt;&lt;br /&gt;public class Main {&lt;br /&gt; private static final Log log = LogFactory.getLog(Main.class);&lt;br /&gt; private static final String rootURL= "http://localhost/jayrock/helloworld.ashx";&lt;br /&gt; /**&lt;br /&gt;  * @param args&lt;br /&gt;  */&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  // Register HTTP&lt;br /&gt;  HTTPSession.register(TransportRegistry.i());&lt;br /&gt;  HTTPSession httpSession= (HTTPSession)TransportRegistry.i().createSession(rootURL);&lt;br /&gt;  HttpState state= new HttpState();&lt;br /&gt;  httpSession.setState(state);&lt;br /&gt;  Client client= new Client(httpSession);&lt;br /&gt;  RpcIF rpc = client.openProxy(null, RpcIF.class);&lt;br /&gt;  String str = rpc.greetings();&lt;br /&gt;  log.debug("Output:" + str);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;RpcIF.java:&lt;br /&gt;public interface RpcIF {&lt;br /&gt; String greetings();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;O/P on client side:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;JSON RPC REQUEST ==&gt; {"id":1,"method":"greetings","params":[]}&lt;br /&gt;JSON RPC RESPONSE ==&gt; {"id":1,"result":"Welcome to Jayrock!"}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-8689807533826691349?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/8689807533826691349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=8689807533826691349&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8689807533826691349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8689807533826691349'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/12/lightweight-inter-operable-web-service.html' title='JSON-RPC between .NET service and Java client'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-2141514018732052170</id><published>2009-10-17T13:04:00.003-04:00</published><updated>2009-10-17T13:48:07.759-04:00</updated><title type='text'>No screens found error for X server in Ubuntu Jaunty</title><content type='html'>I recently encountered an error when all of a sudden after a reboot X server will not start up. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It stated the following:&lt;div&gt;&lt;span class="Apple-style-span"   style="  ;font-family:monospace;font-size:medium;"&gt;&lt;pre&gt;(EE) intel(0): No kernel modesetting driver detected. (EE) Screen(s) found, but none have a usable configuration.&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;My configuration at the time of this error was:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  ;font-family:monospace;font-size:medium;"&gt;&lt;pre&gt;9.04 x64, kernel 2.6.28-15-generic, with intel GM965 graphics running xserver-xorg-video-intel:  2:2.9.0~git20091007.03e8e64f-0ubuntu0tormod3~jaunty&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;First i selected recovery mode to boot into last good configuration.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I struggled with it for a while trying some of the suggestions i could find on google searches. In the process i tried upgrading to the linux kernel  2.6.30-020630 and tried enabling the KMS (&lt;a href="https://wiki.ubuntu.com/X/KernelModeSetting"&gt;Kernel Mode Setting&lt;/a&gt;) for Jaunty as described &lt;a href="https://wiki.ubuntu.com/X/KernelModeSetting"&gt;here&lt;/a&gt; and that fixed the issue. &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-2141514018732052170?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/2141514018732052170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=2141514018732052170&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2141514018732052170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2141514018732052170'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/10/no-screens-found-error-for-x-server-in.html' title='No screens found error for X server in Ubuntu Jaunty'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-5937399155910918813</id><published>2009-09-27T11:17:00.003-04:00</published><updated>2009-11-09T03:40:26.584-05:00</updated><title type='text'>Enabling RDP on Windows Vista Home Premium 64 Bit (SP2)</title><content type='html'>I found the hack mentioned in this blog &lt;a href="http://andrewblock.net/?p=411"&gt;http://andrewblock.net/?p=411&lt;/a&gt; work for me pretty well. Am able to RDP from Win XP Pro to my Vitsa Home Premium 64 Bit SP2 with no issue so far.&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Update: For enabling RDP on Windows 7 Home Premium, refer to &lt;a href="http://thegreenbutton.com/forums/p/79427/393664.aspx#393664"&gt;this forum post&lt;/a&gt;. It worked for me.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-5937399155910918813?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/5937399155910918813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=5937399155910918813&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/5937399155910918813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/5937399155910918813'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/09/enabling-rdp-on-windows-vista-home.html' title='Enabling RDP on Windows Vista Home Premium 64 Bit (SP2)'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-6313063765290182269</id><published>2009-08-05T15:08:00.000-04:00</published><updated>2009-08-05T15:09:04.899-04:00</updated><title type='text'>Some useful Eclipse shortcut keys</title><content type='html'>&lt;ul&gt;&lt;li&gt;Cnrtl + O - show all methods and properties of the current editor's class.&lt;/li&gt;&lt;li&gt;Cntl + Shift + O - fix import statements.&lt;/li&gt;&lt;li&gt;Cntl + Shift + F - format code.&lt;/li&gt;&lt;li&gt;Cntl + 1 - show quick fix recommendations.&lt;/li&gt;&lt;li&gt;Cntl + F6 - toggle between editors&lt;/li&gt;&lt;li&gt;Cntl + E - show all open editors&lt;/li&gt;&lt;li&gt;Alt + left/right arrow - move to last edit location&lt;/li&gt;&lt;li&gt;Cntl + M - toggle maximize and minimize current editor&lt;/li&gt;&lt;li&gt;Cntl + J - incremental search (searches as you type)&lt;/li&gt;&lt;li&gt;Cntl + Shift + J - incremental backwards search.&lt;/li&gt;&lt;li&gt;Cntl + K - find next&lt;/li&gt;&lt;li&gt;Cntl + Shift + K - find previous&lt;/li&gt;&lt;li&gt;Cntl + Shift + L - Shows currently defined shortcut keys (same as Help &gt; Key Assist).&lt;/li&gt;&lt;li&gt;Cntl + L - go to line.&lt;/li&gt;&lt;li&gt;Cntl + Shift + G - generate getters/setters.&lt;/li&gt;&lt;li&gt;Cntl + Alt + G - find text in workspace.&lt;/li&gt;&lt;/ul&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-6313063765290182269?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/6313063765290182269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=6313063765290182269&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6313063765290182269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6313063765290182269'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/08/some-useful-eclipse-shortcut-keys.html' title='Some useful Eclipse shortcut keys'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-6888210584829641595</id><published>2009-07-23T21:09:00.005-04:00</published><updated>2009-10-29T18:40:06.465-04:00</updated><title type='text'>Eclipse 3.5 Galileo and clearcase plug-in</title><content type='html'>I installed the Eclipse Galileo recently and found that the Rational Clearcase plugin by IBM does not work anymore in 3.5. Of course the latest plug-in explicitly mentions its just for Eclipse 3.4. But i tried anyways and it did not work. Fortunately, there is a clearcase plugin that works with Eclipse 3.5 at this point (&lt;a href="http://eclipse-ccase.sourceforge.net/documents/user_guide.pdf"&gt;http://eclipse-ccase.sourceforge.net/documents/user_guide.pdf&lt;/a&gt;). May be soon IBM clearcase plug-in will also be released that is compatible with Eclipse 3.5.&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Updated: &lt;a href="http://www-01.ibm.com/support/docview.wss?rs=984&amp;amp;uid=swg24024213"&gt;IBM Rational clearcase SCM Adapter version&lt;/a&gt; is available too now for Eclipse 3.5.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-6888210584829641595?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/6888210584829641595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=6888210584829641595&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6888210584829641595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6888210584829641595'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/07/eclipse-35-galileo-and-clearcase-plug.html' title='Eclipse 3.5 Galileo and clearcase plug-in'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-7439997543952106650</id><published>2009-04-24T19:06:00.002-04:00</published><updated>2009-04-24T19:54:42.707-04:00</updated><title type='text'>Upgrade to Ubuntu 9.04</title><content type='html'>I was pleasantly surprised to see the dist upgrade to Ubuntu 9.04 from the previous 8.10 installation going well. It did not work so well last time during upgrade from 8.04 to 8.10. It crashed the root file system for me then. But the lazy me, hoped that it will work this time and it did and upgrade went fine. Web is already &lt;a href="http://news.cnet.com/8301-1001_3-10226746-92.html"&gt;replete with praises for jaunty release&lt;/a&gt;.&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-7439997543952106650?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/7439997543952106650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=7439997543952106650&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7439997543952106650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7439997543952106650'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/04/upgrade-to-ubuntu-904.html' title='Upgrade to Ubuntu 9.04'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-4405162533574536004</id><published>2009-03-16T12:28:00.001-04:00</published><updated>2009-03-16T12:28:35.151-04:00</updated><title type='text'>Installing Subversion 1.5.3 on windows</title><content type='html'>&lt;p&gt;Steps are: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Download subversion installer from &lt;a href="http://subversion.tigris.org"&gt;http://subversion.tigris.org&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Install at location say C:\svn. &lt;/li&gt;    &lt;li&gt;At cmd prompt, create a repository: &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;svnadmin create &amp;quot;C:\svnrepo&amp;quot;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;Edit C:\svnrepo\conf\svnserve.conf and uncomment the following lines: &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;anon-access = read      &lt;br /&gt;auth-access = write       &lt;br /&gt;password-db = passwd&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;Edit C:\svnrepo\conf\passwd file:add users in the format username = password one per line and remove the default users. &lt;/li&gt;    &lt;li&gt;Set environment variable SVN_EDITOR to your favorite text editor (say Textpad.exe). &lt;/li&gt;    &lt;li&gt;Set Subversion as a service with the following command at cmd prompt:      &lt;ul&gt;       &lt;li&gt;&lt;font face="Courier New"&gt;sc create Subversion binpath= &amp;quot;c:\svn\bin\svnserve.exe --service --root c:\svnrepo --listen-port 9999&amp;quot; displayname= &amp;quot;Subversion Repo&amp;quot; depend= Tcpip start= auto&lt;/font&gt; &lt;/li&gt;        &lt;li&gt;Go to service control manager to start the Subversion service or type the following on :          &lt;pre&gt;net start “Subversion Repo”&lt;/pre&gt;&lt;br /&gt;      &lt;/li&gt;&lt;br /&gt;    &lt;/ul&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Import an existing project in subversion repo: &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;svn import C:\myproject svn://localhost:9999/myproject&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;After importing data, note that the original tree is &lt;em&gt;not&lt;/em&gt; under version control. To start working, you still need to &lt;b&gt;svn checkout&lt;/b&gt; a fresh working copy of the tree. &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;svn checkout svn://localhost:9999/myproject&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;Install 32 or 64 bit version of tortoise SVN from &lt;a title="http://tortoisesvn.net/" href="http://tortoisesvn.net/"&gt;http://tortoisesvn.net/&lt;/a&gt;. After installing you will need to reboot your system. Tortoise SVN is a windows shell extension which makes the use of SVN from windows explorer very easy and intuitive. &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;There's a standard convention in Subversion to &lt;a href="http://svnbook.red-bean.com/en/1.4/svn.reposadmin.planning.html"&gt;start with the &amp;quot;TTB folders&amp;quot; at the root of any project&lt;/a&gt;: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Because Subversion uses regular directory copies for branching and tagging (see &lt;a href="http://svnbook.red-bean.com/en/1.4/svn.branchmerge.html"&gt;Chapter 4, Branching and Merging&lt;/a&gt;), the Subversion community recommends that you choose a repository location for each project root -- the &amp;quot;top-most&amp;quot; directory which contains data related to that project -- and then create three subdirectories beneath that root: &lt;b&gt;trunk&lt;/b&gt;, meaning the directory under which the main project development occurs; &lt;b&gt;branches&lt;/b&gt;, which is a directory in which to create various named branches of the main development line; &lt;b&gt;tags&lt;/b&gt;, which is a collection of tree snapshots that are created, and perhaps destroyed, but never changed. &lt;/blockquote&gt;&lt;br /&gt;So make it a practice to add the trunk, tags and branches directories to your project and all your project files will go under trunk then.&lt;br /&gt;&lt;br /&gt;  &lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-4405162533574536004?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/4405162533574536004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=4405162533574536004&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/4405162533574536004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/4405162533574536004'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/03/installing-subversion-153-on-windows.html' title='Installing Subversion 1.5.3 on windows'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-532633680971957941</id><published>2009-02-16T21:55:00.007-05:00</published><updated>2009-02-16T22:21:27.999-05:00</updated><title type='text'>Introduction to Vim for Programmers</title><content type='html'>&lt;enter&gt;&lt;mark&gt;&lt;num&gt;&lt;args&gt;&lt;span style="font-weight: bold;"&gt;Vim editor:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It has 3 modes:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Ex&lt;/span&gt; mode &lt;----&gt; &lt;span style="font-weight: bold;"&gt;Command&lt;/span&gt; mode &lt;-----&gt; &lt;span style="font-weight: bold;"&gt;Insert&lt;/span&gt; mode.&lt;br /&gt;         &lt;enter&gt;&lt;br /&gt;You can never go from Insert to Ex mode directly or vice versa. You always&lt;br /&gt;first need to go to command mode. Enter command mode by typing Esc and enter Ex mode by typing :.&lt;br /&gt;&lt;br /&gt;For cursor movement:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;   k&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;h      l&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;   j&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;Cursor movement commands: {motion} commands:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;G&lt;/span&gt; - Last line in file&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;gg&lt;/span&gt; - First line in file&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;%&lt;/span&gt;  - Jump to matching brace (()}{[])&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;m{1etter}&lt;/span&gt; - example ma to mark a line. There can be at&lt;br /&gt;                                  max 26  marks in the file.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;`&lt;/span&gt;&lt;mark&gt;&lt;span style="font-weight: bold;"&gt;{mark}&lt;/span&gt; - example `a to jump to the named mark.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;``&lt;/span&gt; - Jump to the last line where you jumped or searched from.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;/expr&lt;/span&gt; - forward search where expr = is a regex.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;?expr&lt;/span&gt; - backward search.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;n&lt;/span&gt; - repeat last search in the same direction.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;N&lt;/span&gt; - repeat last search in the opposite direction.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;w&lt;/span&gt; - move cursor forward by one word.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;b&lt;/span&gt; - move cursor backward by one word.&lt;br /&gt;&lt;/mark&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;"&gt;Some more cursor movement commands:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;Cntl + F&lt;/span&gt; - move one screen forward.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Cntl + B&lt;/span&gt; - move one screen backward.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;f{char}&lt;/span&gt; - position cursor at the matching {char} to the right.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;t{char} &lt;/span&gt;- position cursor just before the matching {char} to the right.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;F{char}&lt;/span&gt; - position cursor at the matching {char} to the left.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;T{char}&lt;/span&gt; - position cursor just before the matching {char} to the left.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Basic insert commands:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;i &lt;/span&gt;- enter insert mode.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;a&lt;/span&gt; - enter insert mode after character under cursor.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;I &lt;/span&gt;- enter insert mode starting before first non blank character on the line.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;A&lt;/span&gt; - enter insert mode starting after last non blank character on the line.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;o&lt;/span&gt; - enter insert mode starting on a new line after current cursor line.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;O&lt;/span&gt; - enter insert mode starting on a new line before current cursor line.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Change commands:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;C &lt;/span&gt;- delete everything from cursor to end of line.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;c&lt;/span&gt;&lt;num&gt;&lt;span style="font-weight: bold;"&gt;{motion}&lt;/span&gt; - delete everything from cursor position as determined by the motion (one of the cursor movement commands).&lt;br /&gt;  Example: &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;c5{h}&lt;/span&gt; - deletes 5 chars to the left (as h is for&lt;br /&gt;  left movement).&lt;br /&gt;  &lt;span style="font-weight: bold;"&gt;c2w &lt;/span&gt;- deletes 2 words and puts in insert mode.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;S&lt;/span&gt; - Substitute/change current line entirely. Delete all text on current line and put in insert mode.&lt;/num&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Patterns for using change commands:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;2cw&lt;/span&gt; - change 2 words.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;cta&lt;/span&gt; - delete everything upto next occurrence of letter a.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5cta&lt;/span&gt; - delete everything upto 5th occurrence of letter a.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5S &lt;/span&gt;- delete current line and subsequent 4 lines.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Miscellaneous commands:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;u&lt;/span&gt; - undo&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Cntl + R&lt;/span&gt; - redo&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Cntl + N/Cntl + P&lt;/span&gt; - autocompletion with text that already exists in the in the document.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;. &lt;/span&gt;- repeat the last change.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;zt &lt;/span&gt;- redraw the screen placing current line to top of screen.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;zz &lt;/span&gt;- redraw the screen placing current line to the center of screen.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;zb&lt;/span&gt; - redraw the screen placing current line to the bottom of screen.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Delete, cut and paste commands:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;D&lt;/span&gt; - Delete from current cursor position to the end of line.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;d{motion}&lt;/span&gt; - delete from current curson position to the position determined by {motion} command. Example,&lt;br /&gt;  d5w - delete next 5 words.&lt;br /&gt;  dn - delete till next matching search pattern.&lt;br /&gt;  d`a - delete till marked line named a.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;y{motion} &lt;/span&gt;- yank or copy from current cursor position to the position&lt;br /&gt;  determined by {motion} command. Example,&lt;br /&gt;  &lt;span style="font-weight: bold;"&gt;y5w&lt;/span&gt; - copy next 5 words.&lt;br /&gt;  &lt;span style="font-weight: bold;"&gt;yG &lt;/span&gt;- copy till the end of file.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;p &lt;/span&gt;- put the character in registry/clipboard after current character under cursor.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;P&lt;/span&gt; - put the character in registry/clipboard before current character under cursor.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;dfa &lt;/span&gt;- delete until character first character a from current cursor position.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;dta&lt;/span&gt; - delete upto character first character a from current cursor position.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;yy4p &lt;/span&gt;- copy current line and paste it 4 times.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;dG&lt;/span&gt; - delete everything from current line till end of file.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;y50G&lt;/span&gt; - copy everything from current line till line 50.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;d5l&lt;/span&gt; - delete 5 characters to the right (l is for right motion).&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5dd&lt;/span&gt; - delete 5 lines including current one.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Ex mode:&lt;/span&gt;&lt;br /&gt;Ex mode commands are of the form:&lt;br /&gt;&lt;blockquote style="color: rgb(255, 0, 0);"&gt;:[firstline][,lastline]command&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;blockquote&gt;:25,30d - delete lines from 25 to 30.&lt;/blockquote&gt;Line numbers are optional.&lt;br /&gt;If no line number is specified, command applies to current line.&lt;br /&gt;If only one line number is specified, command applies to that line.&lt;br /&gt;To affect a range of lines, we need to specify both firstline and lastline.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Shortcuts for specifying line numbers in Ex mode:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;.&lt;/span&gt; - current line number. Example- :.,50d - delete from current to line 50.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;$&lt;/span&gt; - last line number in file.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;% &lt;/span&gt;- entire file - same as specifying 1,$.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;`a&lt;/span&gt; - line number of bookmarked line a.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;/expr/&lt;/span&gt; - next line that matches expr.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;?expr?&lt;/span&gt; - previous line that matches expr.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;\/ &lt;/span&gt;- next line that matches the most recent expr.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;\?&lt;/span&gt; - prev line that matches the most recent expr.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;\&amp;amp; &lt;/span&gt;- next line that matches the most recent substitution.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Examples:&lt;br /&gt;:/Begin/,/End/d - deletes lines from first line that has word Begin till&lt;br /&gt;last line which has word End.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;10,40w bkup.dat&lt;/span&gt; - saves the lines 10 to 40 in a file bkup.dat.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Essential Ex Commands:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;:w {filename}&lt;/span&gt; - save the current buffer to filename.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:q&lt;/span&gt; - quite the current buffer.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:x &lt;/span&gt;- same as :wq - quite and save unsaved data.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:e {filename}&lt;/span&gt; - open named file for editing in a new buffer.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:d &lt;/span&gt;- delete current line or range of lines&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:map {a} {b}&lt;/span&gt; - remap the keys used in command mode.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:set {arguments}&lt;/span&gt; - configure vim (mostly to be used in .vimrc)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:help&lt;/span&gt; - vim help.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Search and Replace:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;:s/search/replacement/flags&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;If search or replacement string contains / character then either we can&lt;br /&gt;escape it with a \ or use a different delimiter (like #) other than / for&lt;br /&gt;eg:&lt;br /&gt;&lt;blockquote style="color: rgb(255, 0, 0);"&gt;:s#/usr/share/file1#/usr/share/file2/#&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Usage examples:&lt;/span&gt;&lt;br /&gt;&lt;/enter&gt;&lt;/args&gt;&lt;/num&gt;&lt;/mark&gt;&lt;ol&gt;&lt;li&gt;&lt;enter&gt;&lt;mark&gt;&lt;num&gt;&lt;args&gt;first occurrence single line &lt;span style="color: rgb(255, 0, 0);"&gt;:s/bash/perl/&lt;/span&gt;&lt;/args&gt;&lt;/num&gt;&lt;/mark&gt;&lt;/enter&gt;&lt;/li&gt;&lt;li&gt;&lt;enter&gt;&lt;mark&gt;&lt;num&gt;&lt;args&gt;all occurrences single line &lt;span style="color: rgb(255, 0, 0);"&gt;:s/bash/perl/g&lt;/span&gt;&lt;/args&gt;&lt;/num&gt;&lt;/mark&gt;&lt;/enter&gt;&lt;/li&gt;&lt;li&gt;&lt;enter&gt;&lt;mark&gt;&lt;num&gt;&lt;args&gt;first occurrence between line range: &lt;span style="color: rgb(255, 0, 0);"&gt;:23,100s/bash/perl/&lt;/span&gt;&lt;/args&gt;&lt;/num&gt;&lt;/mark&gt;&lt;/enter&gt;&lt;/li&gt;&lt;li&gt;&lt;enter&gt;&lt;mark&gt;&lt;num&gt;&lt;args&gt;all occurrences between line range: &lt;span style="color: rgb(255, 0, 0);"&gt;:23,100s/bash/perl/g&lt;/span&gt;&lt;/args&gt;&lt;/num&gt;&lt;/mark&gt;&lt;/enter&gt;&lt;/li&gt;&lt;li&gt;&lt;enter&gt;&lt;mark&gt;&lt;num&gt;&lt;args&gt;first occurrence in whole text: &lt;span style="color: rgb(255, 0, 0);"&gt;:%s/bash/perl/&lt;/span&gt;&lt;/args&gt;&lt;/num&gt;&lt;/mark&gt;&lt;/enter&gt;&lt;/li&gt;&lt;li&gt;&lt;enter&gt;&lt;mark&gt;&lt;num&gt;&lt;args&gt;all occurrences whole text: &lt;span style="color: rgb(255, 0, 0);"&gt;:%s/bash/perl/g &lt;/span&gt;&lt;/args&gt;&lt;/num&gt;&lt;/mark&gt;&lt;/enter&gt;&lt;/li&gt;&lt;/ol&gt;&lt;enter&gt;&lt;mark&gt;&lt;num&gt;&lt;args&gt;&lt;span style="font-weight: bold;"&gt;Code browsing:&lt;/span&gt;&lt;br /&gt;Run ctags as follows in the source directory and it generates an index file&lt;br /&gt;called tags of source files in current directory and its subdirectories.&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-weight: bold;"&gt;ctags -R &lt;/blockquote&gt;&lt;br /&gt;Now in vim we can use each source file as a web page with each symbol&lt;br /&gt;(variable, function) having hyperlinks, such that, if you do a cntl + ] on&lt;br /&gt;the current symbol then it will take you to the definition of the symbol.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Following are commands for browsing code in vim:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Cntl + ] &lt;/span&gt; - jump to the tag under cursor (ie go to definition of function,&lt;br /&gt;      class, declaration of variable).&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Cntl + T &lt;/span&gt; - Return to current tag from most recent jump off point.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:pop&lt;/span&gt;      - Same as Cntl + T except that we can specify count to go back&lt;br /&gt;      multiple levels.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:tn &lt;/span&gt;      - Jump to next match (when tag produces more than one match in&lt;br /&gt;      case of C++ overloaded functions).&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:tp &lt;/span&gt;      - Jump to previous match (in case of multiple matches).&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:ts name&lt;/span&gt;  - Shows a list of matching tags you can select from.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:tags&lt;/span&gt;     - Show current tag stack with one line for each tag.&lt;br /&gt;&lt;br /&gt;Lastly, to build c/c++ code:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;:make {args} &lt;args&gt;&lt;/args&gt;&lt;/span&gt; - invokes the make program. We can change the make program in to say ant by using Ex mode (or in .vimrc) as&lt;br /&gt;        &lt;span style="color: rgb(255, 0, 0);"&gt; :set makeprg=ant&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One nice .vimrc can be found at:&lt;br /&gt;&lt;a href="http://research.iiit.ac.in/%7Emasatran/config/.vimrc"&gt;http://research.iiit.ac.in/~masatran/config/.vimrc&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Use &lt;blockquote&gt;wget &lt;a href="http://research.iiit.ac.in/%7Emasatran/config/.vimrc"&gt;http://research.iiit.ac.in/~masatran/config/.vimrc&lt;/a&gt;&lt;/blockquote&gt; to get it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/args&gt;&lt;/num&gt;&lt;/mark&gt;&lt;/enter&gt;&lt;/enter&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-532633680971957941?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/532633680971957941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=532633680971957941&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/532633680971957941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/532633680971957941'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/02/introduction-to-vim-for-programmers.html' title='Introduction to Vim for Programmers'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-6437944282009155619</id><published>2009-02-15T03:19:00.008-05:00</published><updated>2009-02-15T03:41:32.482-05:00</updated><title type='text'>A short introduction to GNU make</title><content type='html'>A make &lt;span style="font-weight: bold;"&gt;rule&lt;/span&gt; looks like the following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-weight: bold;"&gt;target: prerequisite&lt;br /&gt;    commands&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;.PHONY: all&lt;br /&gt;all: program1 program2&lt;br /&gt;program1: a.o b.o&lt;br /&gt;  gcc -o program1 a.o b.o&lt;br /&gt;program2: c.o d.o&lt;br /&gt;  gcc -o program2 c.o d.o&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This tells make not to search for a file named all and to assume that  this target&lt;br /&gt;is always obsolete.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Defining variables:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Variables in a make file are like &lt;property&gt; in an ant build script but they&lt;br /&gt;can only be set once unlike ant properties and dont change value.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;FLAGS = first&lt;br /&gt;all:&lt;br /&gt;  @echo FLAGS=$(FLAGS)&lt;br /&gt;&lt;br /&gt;FLAGS = second&lt;br /&gt;other:&lt;br /&gt;  @echo FLAGS=$(FLAGS)&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The FLAGS variable is assigned the last value which is set in the build file&lt;br /&gt;viz. second and so even if we run all target, the value echoed for FLAGS&lt;br /&gt;will be second.&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;* So, a variable should be set just once in the make file. *&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;VAR = value&lt;br /&gt;VAR := value&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The := form allows variables to reference themselves without recursion.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;VAR = value&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;# Wrong! Causes infinite recursion&lt;br /&gt;VAR = $(VAR) more&lt;br /&gt;&lt;br /&gt;# Okay, the := prevents recursion&lt;br /&gt;VAR := $(VAR) more&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;# A GNU extension that does the same thing&lt;br /&gt;VAR = value&lt;br /&gt;VAR += more&lt;br /&gt;&lt;br /&gt;make automatically removes leading and trailing white space from your&lt;br /&gt;variable values when you use the traditional syntax.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;TRAD=       Hello World&lt;br /&gt;all:&lt;br /&gt;  @echo "$(TRAD)" -- removes the spaces in the o/p&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;If we want to preserve the spaces:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;TRAD=$() Hello World $()&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;we can use the built-in empty variables $() to mark the beginning and end.&lt;br /&gt;&lt;br /&gt;GNU make comes with many &lt;span style="font-weight: bold;"&gt;implicit rules &lt;/span&gt;to do almost everything you need.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;.c.o:&lt;br /&gt;    $(COMPILE.c) $(OUTPUT_OPTION) $&lt;&lt;/blockquote&gt;&lt;br /&gt;where,&lt;br /&gt;COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c&lt;br /&gt;CC = gcc&lt;br /&gt;&lt;br /&gt;This says, “If you see a target with an .o extension, and there is no explicit&lt;br /&gt;rulefor it, look for a file with the same base and the .c extension. If you find&lt;br /&gt;it, run these commands.”&lt;br /&gt;&lt;br /&gt;We can checkout such implicit rules and built-in variables by:&lt;br /&gt;&lt;blockquote&gt;make -p&lt;/blockquote&gt;&lt;br /&gt;CFLAGS and others are not defined but make allows referencing not defined&lt;br /&gt;variables and will replace them with empty strings.&lt;br /&gt;&lt;br /&gt;We can set CFLAGS= -g to enable debugging.&lt;br /&gt;&lt;br /&gt;Common variables used in implicit rules:&lt;br /&gt;&lt;blockquote&gt;CC = gcc - C Compiler&lt;br /&gt;CXX = g++ - C++ compiler.&lt;br /&gt;CFLAGS = none - flags passed to C compiler.&lt;br /&gt;CXXFLAGS = none - flags passed to C++ compiler.&lt;br /&gt;CPPFLAGS = none - flags passed to C Pre Processor. Typical flags include -I, -D and -U.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Default &lt;span style="font-weight: bold;"&gt;suffix rules&lt;/span&gt; to create object code:&lt;br /&gt;&lt;blockquote&gt;.c  = $(CC) -c $(CPPFLAGS) $(CFLAGS)&lt;br /&gt;.cpp, .cc, .C = $(CXX) -c $(CPPFLAGS) $(CXXFLAGS)&lt;br /&gt;.s = $(AS) $(ASFLAGS) -- for assembley code.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Automatic Variables:&lt;/span&gt;&lt;br /&gt;Their values can change in the context they are used. Regular variables can&lt;br /&gt;also contain automatic variables.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;blockquote&gt;build_C_program=$(CC) -o $@ $^&lt;br /&gt;&lt;br /&gt;program1: mod1.o mod2.o&lt;br /&gt;  $(build_C_program)&lt;br /&gt;program2: mod3.o mod4.o&lt;br /&gt;  $(build_C_program)&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Note: implicit rule will be used to create the pre-requisites modx.o:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;.c.o:&lt;br /&gt;    $(COMPILE.c) $(OUTPUT_OPTION) $&lt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;then modx.o will be fed to the build_C_program to generate the programx&lt;br /&gt;executables.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Useful automatic variables in GNU make:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;ol&gt;&lt;li&gt;$@ = target filename&lt;/li&gt;&lt;li&gt;$^ = all pre-requisites with duplicate names removed.&lt;/li&gt;&lt;li&gt;$+ = all pre-requisites with duplicate names.&lt;/li&gt;&lt;li&gt;$&lt; = name of first pre-requisite in the rule.&lt;/li&gt;&lt;li&gt;$? = name of pre-requisite newer than target.&lt;/li&gt;&lt;li&gt;$* = base name of target file (without extension).&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Manipulating variables with functions:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;CSRCS=foo.c&lt;br /&gt;CXXSRCS=foo.cpp&lt;br /&gt;OBJS=$(CSRCS:.c=.o) $(CXXSRCS:.cpp=.o)&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;or use:&lt;br /&gt;&lt;blockquote&gt;OBJS:=$(addsuffix .o, $(basename $(SRCS)))&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;shell&lt;/span&gt; function:&lt;br /&gt;&lt;blockquote&gt;CURRENT_TIME=$(&lt;span style="color: rgb(255, 0, 0);"&gt;shell&lt;/span&gt; date +%T)&lt;br /&gt;something:&lt;br /&gt;  @echo started $(CURRENT_TIME)&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Other functions provided by GNU make are:&lt;br /&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;$(subst from, to, text)&lt;/li&gt;&lt;li&gt;$(patsubst from-pattern, to-pattern, filenames)&lt;/li&gt;&lt;li&gt;$(strip string) -- removes the whitespace chars.&lt;/li&gt;&lt;li&gt;$(findstring match, string)&lt;/li&gt;&lt;li&gt;$(filter patterns, filenames) -- returns files that match one or more space&lt;/li&gt;&lt;li&gt;separated patterns&lt;/li&gt;&lt;li&gt;$(sort text) - lexical order sort&lt;/li&gt;&lt;li&gt;$(word n, text) - nth word in text&lt;/li&gt;&lt;li&gt;$(error message) - fails the build after printing the message.&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;User can define custom functions which can be called as:&lt;br /&gt;&lt;blockquote&gt;myfunction = @echo $(1) $(2)&lt;br /&gt;all:&lt;br /&gt;  $(call myfunction,hello,world)&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conditionals:&lt;/span&gt;&lt;br /&gt;ifeq, ifneq&lt;br /&gt;ifdef, ifndef&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;ifeq ($(shell uname -o),GNU/Linux)&lt;br /&gt;  CPPFLAGS += -DLINUX&lt;br /&gt;endif&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note: &lt;/span&gt;The text that appears inside the conditional clause may be any valid make lines, but conditionals may not be used inside the command section of rules or inside variable/function definitions.&lt;br /&gt;&lt;br /&gt;To ensure that A_VITAL_VARIABLE is defined or else the build has to fail:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;ifndef (A_VITAL_VARIABLE)&lt;br /&gt;$(error A_VITAL_VARIABLE is not set)&lt;br /&gt;endif&lt;/blockquote&gt;Generally, projects will have a Makefile for each project source directory.&lt;br /&gt;&lt;br /&gt;A sample makefile:&lt;br /&gt;The below makefile resides in the bin/ directory and compiles C and C++ sources in src/ directory. The executables are created in bin/ directory.&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;pre&gt;.PHONY: all&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VPATH=../src&lt;br /&gt;CFLAGS += -Wall -Wformat-nonliteral -Wformat-y2k &lt;br /&gt;build_C_program=$(CC) $(CFLAGS) -Wstrict-prototypes -o test $^&lt;br /&gt;build_CXX_program=$(CXX) $(CXXFLAGS) -Weffc++ -o hello $^&lt;br /&gt;CSRCS=test.c&lt;br /&gt;CXXSRCS=hello.cpp&lt;br /&gt;COBJS=$(CSRCS: .c=.o)&lt;br /&gt;CPPOBJS=$(CXXSRCS: .cpp=.o)&lt;br /&gt;CURRENT_TIME=$(shell date +%T)  &lt;br /&gt;&lt;br /&gt;ifdef (debug)&lt;br /&gt;        CFLAGS += -g&lt;br /&gt;        CXXFLAGS += -g&lt;br /&gt;else&lt;br /&gt;        CFLAGS += -O2&lt;br /&gt;        CXXFLAGS += -O2&lt;br /&gt;endif&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;all: empty.so ccode cppcode &lt;br /&gt;        @echo started $(CURRENT_TIME);&lt;br /&gt;&lt;br /&gt;ccode: $(COBJS)&lt;br /&gt;        @echo Building C code; \&lt;br /&gt;        $(build_C_program)&lt;br /&gt;&lt;br /&gt;cppcode: $(CPPOBJS)&lt;br /&gt;        @echo Building CPP code;\&lt;br /&gt;        $(build_CXX_program)&lt;br /&gt;&lt;br /&gt;empty.so: empty.c&lt;br /&gt;        $(CC) -shared -fpic -o $@ $^&lt;br /&gt;&lt;br /&gt;run: all&lt;br /&gt;        LD_LIBRARY_PATH=../src ./test&lt;br /&gt;&lt;br /&gt;clean:&lt;br /&gt;        rm -f empty.so $(COBJS) $(CPPOBJS)&lt;br /&gt;&lt;br /&gt;cleanall: clean&lt;br /&gt;        rm -f $(basename $(COBJS) $(CPPOBJS))&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/property&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-6437944282009155619?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/6437944282009155619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=6437944282009155619&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6437944282009155619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6437944282009155619'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/02/short-introduction-to-gnu-make.html' title='A short introduction to GNU make'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-7546925489877260334</id><published>2009-02-13T14:30:00.001-05:00</published><updated>2009-02-13T14:30:43.645-05:00</updated><title type='text'>VNCServer Configuration</title><content type='html'>&lt;p&gt;In the &lt;strong&gt;~/.vnc/xstartup&lt;/strong&gt; we can configure vnc session to start in gnome or kde, as shown below:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="400"&gt;         &lt;p&gt;&lt;font face="Courier" size="1"&gt;#!/bin/sh &lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Courier" size="1"&gt;# Uncomment the following two lines for normal desktop:             &lt;br /&gt;# unset SESSION_MANAGER              &lt;br /&gt;# exec /etc/X11/xinit/xinitrc &lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Courier" size="1"&gt;[ -x /etc/vnc/xstartup ] &amp;amp;&amp;amp; exec /etc/vnc/xstartup             &lt;br /&gt;[ -r $HOME/.Xresources ] &amp;amp;&amp;amp; xrdb $HOME/.Xresources              &lt;br /&gt;xsetroot -solid grey              &lt;br /&gt;vncconfig -iconic &amp;amp;              &lt;br /&gt;xterm -geometry 80x24+10+10 -ls -title &amp;quot;$VNCDESKTOP Desktop&amp;quot; &amp;amp;              &lt;br /&gt;/usr/dt/bin/dtwm &amp;amp;              &lt;br /&gt;startkde &amp;amp;&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Courier" size="1"&gt;#gnome-session &amp;amp;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Then start vnc server as:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="400"&gt;&lt;font face="cour"&gt;$ vncserver&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This will tell you the hostname:sessionnum and set the password:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="400"&gt;$ vncpasswd&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Now you are all set to connect with your favorite vnc client (i use realvnc).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-7546925489877260334?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/7546925489877260334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=7546925489877260334&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7546925489877260334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7546925489877260334'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/02/vncserver-configuration.html' title='VNCServer Configuration'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-5959788344265411858</id><published>2009-02-09T04:27:00.004-05:00</published><updated>2009-02-28T00:17:07.778-05:00</updated><title type='text'>Port Forwarding : Accessing your home computer from work</title><content type='html'>In order to access the home ubuntu desktop from work, following is what i needed to do:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Installed open-ssh demon on ubuntu with: sudo apt-get install open-ssh&lt;/li&gt;&lt;li&gt;Tested that i could use a windows box on the home lan to access the sshd using putty.&lt;/li&gt;&lt;li&gt;Once sshd is setup, followed the instructions at &lt;a href="http://www.portforward.com/help/pfprogression.htm"&gt;http://www.portforward.com/help/pfprogression.htm&lt;/a&gt;, which is broadly the following:&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt; First we need to setup static/manual IP on the host computer to which we want to forward the port(s) to. Mine was setup to obtain IP address using DHCP so i first changed that to manual.&lt;/li&gt;&lt;li&gt;Then login to the router (mine is an Air-link AR670W) and enable Port Forwarding for the SSH application port 22 for both TCP/UDP protocols and provided the static IP of my ubuntu desktop. &lt;/li&gt;&lt;li&gt;Saved the configuration and router reboots after that. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;Then i noted down the ISP assigned public IP to my router's external interface and used that IP (external IP of my router) from a windows box to putty to. Since the SSH port 22 on router is configured to be forwarded to my ubuntu desktop, so i was allowed my way to the ubuntu desktop.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.portforward.com/routers.htm"&gt;http://www.portforward.com/routers.htm&lt;/a&gt; has a listing of several routers and the documentation on how to configure that router for port forwarding.&lt;/p&gt;&lt;p&gt;Also checkout how to setup a easy to remember domain name for your router so that you dont have to remember your router IP (&lt;a href="http://www.techthrob.com/tech/dyndns.php"&gt;http://www.techthrob.com/tech/dyndns.php&lt;/a&gt;). This way even if your router is assigned a new external IP by your ISP, the ddclient demon will automatically update the mapping of your domain id to the new IP. The dyndns.com site has a script generator which can generate the ddclient.conf file for you. Use the generator and it will work without fail. You can find it &lt;a href="https://www.dyndns.com/support/tools/clientconfig.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To configure ubuntu 8.10 for static IP, just use the System &gt; Preferences &gt; Network Configuration UI and select Manual for Method in IPv4 Settings tab and provide your static IP address (say 192.168.1.100), the netmask and the gateway (router ip - like 192.168.1.1). Also you may provide DNS servers (check your router's status page for knowing what DNS servers to use - it will automatically have got it from your ISP).&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-5959788344265411858?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/5959788344265411858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=5959788344265411858&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/5959788344265411858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/5959788344265411858'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2009/02/port-forwarding-accessing-your-home.html' title='Port Forwarding : Accessing your home computer from work'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-1512681747059973896</id><published>2008-11-26T14:18:00.001-05:00</published><updated>2008-11-26T15:02:31.654-05:00</updated><title type='text'>Extending Net-SNMP 5.4.2.1 Agent</title><content type='html'>&lt;p align="justify"&gt;This article describes how to extend &lt;a href="http://www.net-snmp.org/"&gt;Net-SNMP&lt;/a&gt; agent toolkit to instrument the &lt;a href="http://www.mibsearch.com/mibview/EtherLike-MIB"&gt;EtherLike-MIB&lt;/a&gt; (RFC 3635) with hardcoded defaults. This article will describe the setup on windows (I used XP SP3) and Linux (I used openSUSE 11.0) required to develop this agent.&lt;/p&gt;  &lt;p align="justify"&gt;The following instructions were carried out for net-snmp source version 5.4.2.1. This article assumes the following default paths:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;     &lt;div align="justify"&gt;Net-SNMP un-archived on windows in C:\net-snmp and ~/net-snmp on Linux. &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Net-SNMP installed in C:\usr on Windows and /usr/local on Linux. &lt;/div&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;h3 align="justify"&gt;1.1. Setup the development environment&lt;/h3&gt;  &lt;ol&gt;   &lt;li&gt;     &lt;div align="justify"&gt;Download and install MSVC++ Express 2005 from &lt;a href="http://www.microsoft.com/express/2005/download/default.aspx"&gt;http://www.microsoft.com/express/2005/download/default.aspx&lt;/a&gt;. There is some compilation issue of the net-snmp code with MSVC++ 2008 (Orcas) and i did not bother to fix it but used the 2005 instead. &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Download and setup platform sdk as described in &lt;a href="http://www.microsoft.com/express/2005/platformsdk/default.aspx"&gt;http://www.microsoft.com/express/2005/platformsdk/default.aspx&lt;/a&gt;. Be sure to setup the development environment using the PSDK as described in the link step-wise. &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Download net-snmp source from &lt;a href="http://www.net-snmp.org/download.html"&gt;http://www.net-snmp.org/download.html&lt;/a&gt;. The net-snmp version 5.4.2.1 can be downloaded from there. &lt;/div&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;h3 align="justify"&gt;1.2. Build and install net-snmp from source on windows&lt;/h3&gt;  &lt;ol&gt;   &lt;li&gt;     &lt;div align="justify"&gt;Un-archive the net-snmp source to say c:\net-snmp. &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Follow the &lt;a href="http://www.net-snmp.org/docs/README.win32.html"&gt;README.win32&lt;/a&gt; to build the net-snmp code (Read the section Microsoft Visual C++ - Workspace – Building).&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;ol&gt;       &lt;li&gt;         &lt;div align="justify"&gt;We need to first load the &lt;b&gt;winsdk.dsw&lt;/b&gt; in the MSVC++ 2005 express. Below is the screenshot of all projects that make up the win32sdk workspace in MSVC++. &lt;/div&gt;       &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_qVBiMGte-S0/SS2g3l-ZCzI/AAAAAAAAGCw/szq9tlYmw_w/s1600-h/clip_image002%5B3%5D.jpg"&gt;&lt;img title="clip_image002" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="clip_image002" src="http://lh6.ggpht.com/_qVBiMGte-S0/SS2g4chHZaI/AAAAAAAAGC0/SZnhgmy2uP4/clip_image002_thumb.jpg?imgmax=800" width="178" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Figure 1 - Projects in win32sdk.dsw&lt;/p&gt;  &lt;ol&gt;   &lt;ol&gt;     &lt;li&gt;       &lt;div align="justify"&gt;Modify the &lt;b&gt;win32\netsnmp\netsnmpconfig.h&lt;/b&gt; file to add: &lt;/div&gt;     &lt;/li&gt;   &lt;/ol&gt; &lt;/ol&gt;  &lt;div align="justify"&gt;   &lt;pre&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; #define HAVE_WIN32_PLATFORM_SDK 1&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;ol&gt;&lt;br /&gt;    &lt;li&gt;&lt;br /&gt;      &lt;div align="justify"&gt;Build in order, the following project for (Release | Debug) configuration. &lt;/div&gt;&lt;br /&gt;    &lt;/li&gt;&lt;br /&gt;  &lt;/ol&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;i. libagent&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;ii. libhelpers&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;iii. libnetsnmptrapd&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;iv. libsnmp&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;v. netsnmpmibsdk&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;ol&gt;&lt;br /&gt;    &lt;li&gt;&lt;br /&gt;      &lt;div align="justify"&gt;Go to Build &amp;gt; Batch Build… and select the (Debug | Release) configuration of all projects except for the ones you built in step c above. &lt;/div&gt;&lt;br /&gt;    &lt;/li&gt;&lt;br /&gt;  &lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;If everything is okay with setup, then build should go fine too. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Using cmd line on windows, go to c:\net-snmp and run the command: &lt;b&gt;win32\install_netsnmp.bat&lt;/b&gt; to install net-snmp you built above to location c:\usr. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Set the &lt;b&gt;c:\usr\bin&lt;/b&gt; to PATH environment variable for easy access to the command line snmp client and agent executables. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 align="justify"&gt;1.3. Build and install net-snmp from source on Linux&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Un-archive the net-snmp source to say ~/net-snmp. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Follow the &lt;a href="http://www.net-snmp.org/docs/INSTALL.html"&gt;INSTALL&lt;/a&gt; to build the net-snmp code. Run the following commands on shell prompt: &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;    &lt;ol&gt;&lt;br /&gt;      &lt;li&gt;&lt;br /&gt;        &lt;div align="justify"&gt;cd ~/net-snmp &lt;/div&gt;&lt;br /&gt;      &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;      &lt;li&gt;&lt;br /&gt;        &lt;div align="justify"&gt;./configure &lt;/div&gt;&lt;br /&gt;      &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;      &lt;li&gt;&lt;br /&gt;        &lt;div align="justify"&gt;make &lt;/div&gt;&lt;br /&gt;      &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;      &lt;li&gt;&lt;br /&gt;        &lt;div align="justify"&gt;make install (run as root) &lt;/div&gt;&lt;br /&gt;      &lt;/li&gt;&lt;br /&gt;    &lt;/ol&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;The make install step will install the net-snmp binaries by default in /usr/local path.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 align="justify"&gt;1.4. Configuring the snmpd agent (snmpd.conf)&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Configure snmp agent by running &lt;a href="http://www.net-snmp.org/docs/man/snmpconf.html"&gt;snmpconf&lt;/a&gt; command (see man page) or copy the C:/net-snmp/Example.conf and modify. &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;    &lt;ol&gt;&lt;br /&gt;      &lt;li&gt;&lt;br /&gt;        &lt;div align="justify"&gt;snmpconf –g basic_setup &lt;/div&gt;&lt;br /&gt;      &lt;/li&gt;&lt;br /&gt;    &lt;/ol&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;I used the following configuration. Copy-paste the text below into a file named snmpd.conf. The agent is configured for snmp v2c and with rwcommunity string of public. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;com2sec local     localhost       &lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;group MyRWGroup    v1         local&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;group MyRWGroup    v2c        local&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;group MyRWGroup    usm        local&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;view all    included  .1                               80&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;#                context sec.model sec.level match  read   write  notif&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;access MyROGroup &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;      any       noauth    exact  all    none   none&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;access MyRWGroup &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;      any       noauth    exact  all    all    none&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;syslocation Right here, right now.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;syscontact Me &amp;lt;me@somewhere.org&amp;gt;&lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Save the file in path : &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;    &lt;ol&gt;&lt;br /&gt;      &lt;li&gt;&lt;br /&gt;        &lt;div align="justify"&gt;C:\usr\etc\snmp\snmpd.conf (on Windows) &lt;/div&gt;&lt;br /&gt;      &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;      &lt;li&gt;&lt;br /&gt;        &lt;div align="justify"&gt;/etc/snmp/snmpd.conf (on Linux) &lt;/div&gt;&lt;br /&gt;      &lt;/li&gt;&lt;br /&gt;    &lt;/ol&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 align="justify"&gt;1.5. Load the MIB module and generate the C code&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;The EtherLike-MIB has 5 tables (columnar variables). &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;For mib2c code generation I used linux host. Run the following commands on shell prompt: &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;mkdir ethmib_src&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;cd ethmib_src &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;export MIBS=ALL &lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;EtherLike-MIB was part of the net-snmp distribution so all we need is to tell mib2c to use it by setting the environment variable MIBS.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;mib2c –c mib2c.create-dataset.conf dot3StatsTable &lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;This will generate dot3StatsTable.c and dot3StatsTable.h files.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;Similarly run the similar command for the other tables in the mib.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;mib2c –c mib2c.create-dataset.conf dot3PauseTable &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;mib2c –c mib2c.create-dataset.conf dot3HCStatsTable &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;mib2c –c mib2c.create-dataset.conf dot3CollTable &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;mib2c –c mib2c.create-dataset.conf dot3ControlTable &lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;Use the ethmib_src and use it for windows agent extension too. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 align="justify"&gt;1.6. Use the generated source files to instrument the mib on Windows&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;On Windows, the above generated source files can be copied to c:\net-snmp\agent\mibgroups. You may also create a folder names EtherLike-MIB and sub-folders for each table like dot3StatsTable etc, and keep the respective table *.c and *.h files in the folder with the table name. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Add the generated sources in the MSVC++ netsnmpmibssdk project as shown below: &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_qVBiMGte-S0/SS2g40JuJDI/AAAAAAAAGC4/I2AUZnCs-78/s1600-h/clip_image004%5B3%5D.jpg"&gt;&lt;img title="clip_image004" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="clip_image004" src="http://lh6.ggpht.com/_qVBiMGte-S0/SS2g7LfIB4I/AAAAAAAAGC8/GW5tUtNaky0/clip_image004_thumb.jpg?imgmax=800" width="164" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;Figure 2 - EtherLike-MIB files added to the netsnmpmibssdk project.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Add the dot3StatsTable.h and dot3StatsTable.c files to your &lt;b&gt;'netsnmpmibssdk'&lt;/b&gt; project in VC++. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Next edit the '&amp;lt;sourcedir&amp;gt;\win32\&lt;b&gt;mib_module_includes.h&lt;/b&gt;' file to add an include to your .h file. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;#include &lt;span style="color: #006080"&gt;&amp;quot;mibgroup/EtherLike-MIB/dot3StatsTable/dot3StatsTable.h&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;#include &lt;span style="color: #006080"&gt;&amp;quot;mibgroup/EtherLike-MIB/dot3HCStatsTable/dot3HCStatsTable.h&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;#include &lt;span style="color: #006080"&gt;&amp;quot;mibgroup/EtherLike-MIB/dot3CollTable/dot3CollTable.h&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;#include &lt;span style="color: #006080"&gt;&amp;quot;mibgroup/EtherLike-MIB/dot3ControlTable/dot3ControlTable.h&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;#include &lt;span style="color: #006080"&gt;&amp;quot;mibgroup/EtherLike-MIB/dot3PauseTable/dot3PauseTable.h&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 align="justify"&gt;&amp;#160;&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Next edit the '&amp;lt;sourcedir&amp;gt;\win32\&lt;b&gt;mib_module_inits.h'&lt;/b&gt; file to add code to call your initialize function.&lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (should_init(&lt;span style="color: #006080"&gt;&amp;quot;dot3StatsTable&amp;quot;&lt;/span&gt;)) init_dot3StatsTable();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (should_init(&lt;span style="color: #006080"&gt;&amp;quot;dot3HCStatsTable&amp;quot;&lt;/span&gt;)) init_dot3HCStatsTable();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (should_init(&lt;span style="color: #006080"&gt;&amp;quot;dot3CollTable&amp;quot;&lt;/span&gt;)) init_dot3CollTable();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (should_init(&lt;span style="color: #006080"&gt;&amp;quot;dot3ControlTable&amp;quot;&lt;/span&gt;)) init_dot3ControlTable();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (should_init(&lt;span style="color: #006080"&gt;&amp;quot;dot3PauseTable&amp;quot;&lt;/span&gt;)) init_dot3PauseTable();&lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 align="justify"&gt;&amp;#160;&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 align="justify"&gt;1.7. Instrument the EtherLike-MIB&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;This section only instruments the dot3StatsTable generated source to return some default data. Other table instrumentation can be done in the similar manner. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Edit the &lt;b&gt;dot3StatsTable.c&lt;/b&gt; file as shown below to return some hardcoded data. The changes to the generated code have been highlighted. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt; * Note: this file originally auto-generated by mib2c using&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt; *        : mib2c.create-dataset.conf 9375 2004-02-02 19:06:54Z rstory $&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt; */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;#include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;#include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;#include &amp;lt;net-snmp/agent/net-snmp-agent-includes.h&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;#include &lt;span style="color: #006080"&gt;&amp;quot;dot3StatsTable.h&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/** Initialize the dot3StatsTable table by defining its contents and how it's structured */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;initialize_table_dot3StatsTable(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;{&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; oid dot3StatsTable_oid[] = {1,3,6,1,2,1,10,7,2};&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    size_t dot3StatsTable_oid_len = OID_LENGTH(dot3StatsTable_oid);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    netsnmp_table_data_set *table_set;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;// variables declared – wrajnees&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    netsnmp_table_row *row;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; _max_cols = 21; &lt;span style="color: #008000"&gt;// there are 18 columns in this table.&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; column = 0;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; index = 1;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; val = 20;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; oid      objid_etherchipset[] = { 0 };     &lt;span style="color: #008000"&gt;/* ethernetChipset vendor oid */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;// end variables declared.&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;/* create the table structure itself */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    table_set = netsnmp_create_table_data_set(&lt;span style="color: #006080"&gt;&amp;quot;dot3StatsTable&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;/* comment this out or delete if you don't support creation of new rows */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    table_set-&amp;gt;allow_creation = 1;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;/***************************************************&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     * Adding indexes&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    DEBUGMSGTL((&lt;span style="color: #006080"&gt;&amp;quot;initialize_table_dot3StatsTable&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                &lt;span style="color: #006080"&gt;&amp;quot;adding indexes to table dot3StatsTable\n&amp;quot;&lt;/span&gt;));&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    netsnmp_table_set_add_indexes(table_set,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                           ASN_INTEGER,  &lt;span style="color: #008000"&gt;/* index: dot3StatsIndex */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                           0);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    DEBUGMSGTL((&lt;span style="color: #006080"&gt;&amp;quot;initialize_table_dot3StatsTable&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                &lt;span style="color: #006080"&gt;&amp;quot;adding column types to table dot3StatsTable\n&amp;quot;&lt;/span&gt;));         &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    netsnmp_table_set_multi_add_default_row(table_set,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            &lt;span style="color: #008000"&gt;/*COLUMN_DOT3STATSINDEX, ASN_INTEGER, 0,&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;                                            NULL, 0,*/&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSALIGNMENTERRORS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSFCSERRORS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSSINGLECOLLISIONFRAMES, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSSQETESTERRORS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSDEFERREDTRANSMISSIONS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSLATECOLLISIONS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSEXCESSIVECOLLISIONS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSCARRIERSENSEERRORS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSFRAMETOOLONGS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSETHERCHIPSET, ASN_OBJECT_ID, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSSYMBOLERRORS, ASN_COUNTER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSDUPLEXSTATUS, ASN_INTEGER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSRATECONTROLABILITY, ASN_INTEGER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                            COLUMN_DOT3STATSRATECONTROLSTATUS, ASN_INTEGER, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                            NULL, 0,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                              0);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;/* registering the table with the master agent */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;/* note: if you don't need a subhandler to deal with any aspects&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;       of the request, change dot3StatsTable_handler to &amp;quot;NULL&amp;quot; */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    netsnmp_register_table_data_set(netsnmp_create_handler_registration(&lt;span style="color: #006080"&gt;&amp;quot;dot3StatsTable&amp;quot;&lt;/span&gt;, NULL,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                                        dot3StatsTable_oid,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                                                        dot3StatsTable_oid_len,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                                                        HANDLER_CAN_RONLY),&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                            table_set, NULL);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;// Add code - wrajnees&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     * create the a row for the table, and add the data &lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    row = netsnmp_create_table_data_row();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     * set the index to the IETF WG name &amp;quot;snmpv3&amp;quot; &lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    netsnmp_table_row_add_index(row, ASN_INTEGER, (u_char*)&amp;amp;index, &lt;span style="color: #0000ff"&gt;sizeof&lt;/span&gt;(index));&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     * set the column 2 and above&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (column = 2; column &amp;lt;= _max_cols; column++) {&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;        &lt;span style="color: #008000"&gt;// Following columns are not valid.&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;switch&lt;/span&gt;(column) {&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; 12: &lt;span style="color: #008000"&gt;// INVALIDs&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; 14:&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; 15:&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; 17: &lt;span style="color: #008000"&gt;// OID&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                netsnmp_set_row_column(row, column, ASN_OBJECT_ID,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                               (u_char*)objid_etherchipset, 1*&lt;span style="color: #0000ff"&gt;sizeof&lt;/span&gt;(oid));&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; 19: &lt;span style="color: #008000"&gt;// INTEGER&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; 21:&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                netsnmp_set_row_column(row, column, ASN_INTEGER,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                               (u_char*)&amp;amp;val, &lt;span style="color: #0000ff"&gt;sizeof&lt;/span&gt;(val));    &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; 20: &lt;span style="color: #008000"&gt;// TRUTH_VALUE&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                netsnmp_set_row_column(row, column, ASN_INTEGER,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                               (u_char*)&amp;amp;val, &lt;span style="color: #0000ff"&gt;sizeof&lt;/span&gt;(val));    &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;default&lt;/span&gt;: &lt;span style="color: #008000"&gt;// COUNTER&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                netsnmp_set_row_column(row, column, ASN_COUNTER,&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                               (u_char*)&amp;amp;val, &lt;span style="color: #0000ff"&gt;sizeof&lt;/span&gt;(val));    &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;        }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     * add the row to the table &lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    netsnmp_table_dataset_add_row(table_set, row);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     * Finally, this actually allows the &amp;quot;add_row&amp;quot; token it the&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     * * snmpd.conf file to add rows to this table.&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     * * Example snmpd.conf line:&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     * *   add_row netSnmpIETFWGTable eos &amp;quot;Glenn Waters&amp;quot; &amp;quot;Dale Francisco&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;     */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    netsnmp_register_auto_data_table(table_set, NULL);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &lt;span style="color: #008000"&gt;// End add code - wrajnees&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/** Initializes the dot3StatsTable module */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;init_dot3StatsTable(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;{&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;  &lt;span style="color: #008000"&gt;/* here we initialize all the tables we're planning on supporting */&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    initialize_table_dot3StatsTable();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;}&lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Now rebuild the &lt;b&gt;netsnmpmibssdk&lt;/b&gt; project and then &lt;b&gt;snmpdsdk&lt;/b&gt; project, in order. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Run the following command to re-install the modified agent with the dot3StatsTable changes. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;cd c:\net-snmp &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;win32\install_netsnmp.bat &lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Start the new agent as follows: &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;cd c:\usr\bin &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;snmpd.exe –f –Lo –V &lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Open a MIB Browser to walk the dot3StatsTable instrumentation: &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_qVBiMGte-S0/SS2g7mNPWyI/AAAAAAAAGDA/6cuYvQpkBYQ/s1600-h/clip_image006%5B3%5D.jpg"&gt;&lt;img title="clip_image006" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="206" alt="clip_image006" src="http://lh5.ggpht.com/_qVBiMGte-S0/SS2g8M4XcpI/AAAAAAAAGDE/1S4QNwF-rMk/clip_image006_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 align="justify"&gt;1.8. Instrumentation on Linux&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Copy the generated source to the path ~/net-snmp/agent/mibgroups and run the following commands: &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;./configure –with-mib-modules=”dot3StatsTable dot3PauseTable dot3HCStatsTable dot3CollTable dot3ControlTable” &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;make &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;make install (run &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; root)&lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Start the snmpd as: &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;/usr/local/sbin/snmpd –f –Lo –V &lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Run a command line snmpwalk to test it. &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; max-height: 200px"&gt;&lt;br /&gt;    &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;$ snmpwalk -v 2c -mAll -c &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; localhost dot3StatsTable &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;EtherLike-MIB::dot3StatsAlignmentErrors.1 = Counter32: 20 &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;EtherLike-MIB::dot3StatsFCSErrors.1 = Counter32: 20 &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;EtherLike-MIB::dot3StatsSingleCollisionFrames.1 = Counter32: 20 &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;EtherLike-MIB::dot3StatsMultipleCollisionFrames.1 = Counter32: 20 &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;EtherLike-MIB::dot3StatsSQETestErrors.1 = Counter32: 20 &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;EtherLike-MIB::dot3StatsDeferredTransmissions.1 = Counter32: 20 &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;EtherLike-MIB::dot3StatsLateCollisions.1 = Counter32: 20 &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;EtherLike-MIB::dot3StatsExcessiveCollisions.1 = Counter32: 20 &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;EtherLike-MIB::dot3StatsInternalMacTransmitErrors.1 = Counter32: 20 &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;EtherLike-MIB::dot3StatsCarrierSenseErrors.1 = Counter32: 20&lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 align="justify"&gt;2. Co-existance with MS Windows SNMP Agent&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;We have 2 approaches to getting the net-snmp agent to co-exist with the Microsoft provided SNMP agent:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;As of Net-SNMP 5.4, the Net-SNMP agent is able to load the Windows SNMP service extension DLLs by using the Net-SNMP winExtDLL extension. In this scenario, MS SNMP agent is installed but disabled. This is required because winExtDLL extension and existing windows extensions use Windows SNMP API from snmpapi.dll. The limitations of this approach are: &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;ul&gt;&lt;br /&gt;    &lt;li&gt;&lt;br /&gt;      &lt;div align="justify"&gt;linkUp/Down generic traps are not received for some unknown reason.&lt;/div&gt;&lt;br /&gt;    &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;    &lt;li&gt;&lt;br /&gt;      &lt;div align="justify"&gt;sysUpTime.0 does not report the correct uptime for the agent. This is because the Windows extension checks for the uptime of the SNMP service, which is not running when Net-SNMP is running.&lt;/div&gt;&lt;br /&gt;    &lt;/li&gt;&lt;br /&gt;  &lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Alternatively, Net-SNMP agent can run as a proxy SNMP agent and will proxy for the MS SNMP agent (running at a non-default port) for those MIBs that MS SNMP agent instruments. For all other MIBs, Net-SNMP agent can service the SNMP requests. This approach does not suffer from the winExtDLL approach’s limitation, but then we need to run two snmp agents (net-snmp and MS snmp agents).&lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;This sums up in short, the development setup required to get started with extending the net-snmp agent.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-1512681747059973896?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/1512681747059973896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=1512681747059973896&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1512681747059973896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1512681747059973896'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2008/11/extending-net-snmp-5421-agent.html' title='Extending Net-SNMP 5.4.2.1 Agent'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_qVBiMGte-S0/SS2g4chHZaI/AAAAAAAAGC0/SZnhgmy2uP4/s72-c/clip_image002_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-7675799729663367753</id><published>2008-10-22T14:10:00.001-04:00</published><updated>2008-10-22T14:10:30.351-04:00</updated><title type='text'>SCDJWS 1.4 Study Guide | Pothi.com</title><content type='html'>&lt;a href="http://pothi.com/pothi/book/watsh-rajneesh-scdjws-14-study-guide"&gt;SCDJWS 1.4 Study Guide | Pothi.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Posted using &lt;a href="http://sharethis.com"&gt;ShareThis&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-7675799729663367753?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/7675799729663367753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=7675799729663367753&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7675799729663367753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7675799729663367753'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2008/10/scdjws-14-study-guide-pothicom.html' title='SCDJWS 1.4 Study Guide | Pothi.com'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-2026214190974086670</id><published>2008-08-17T14:15:00.005-04:00</published><updated>2008-08-18T00:01:49.491-04:00</updated><title type='text'>Vim quick reference</title><content type='html'>The following content is excerpted from &lt;a href="http://linuxconfig.org/Vim_Tutorial"&gt;http://linuxconfig.org/Vim_Tutorial&lt;/a&gt;. It covers most of the essentials that one needs while editing code. One thing which i know and use and is not covered is :e &amp;lt; filename &amp;gt; &lt;filename&gt; to open multiple files without exiting vim and then navigating among the open files using :b &lt;/filename&gt;&amp;lt; num &amp;gt; , where num is file buffer number for the open files&lt;filename&gt; &lt;num&gt;. Other than that, there were quite a few points in the tutorial that were really good and i did not use/know them before. Also see other good links to learn more on vi/vim at &lt;a href="http://delicious.com/rwatsh/vi"&gt;http://delicious.com/rwatsh/vi&lt;/a&gt;.&lt;br /&gt;&lt;h1&gt;&lt;span class="mw-headline"&gt;Vim Tutorial Summary&lt;/span&gt;&lt;/h1&gt; &lt;a name="VIM_novice_level_Summary_2"&gt;&lt;/a&gt;&lt;h2&gt; &lt;span class="mw-headline"&gt;VIM novice level Summary&lt;/span&gt;&lt;/h2&gt; &lt;table&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td style="border: 1px none ; width: 50%; font-size: 95%; color: rgb(0, 0, 0); vertical-align: text-top;"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Moving around with cursor:&lt;/b&gt;&lt;br /&gt;h key = LEFT,  l key = RIGHT, k key = UP,  j key = DOWN &lt;/li&gt;&lt;li&gt; &lt;b&gt;Exiting vim editor without saving:&lt;/b&gt;&lt;br /&gt;press ESC to get into command mode, enter :q! to exit. &lt;/li&gt;&lt;li&gt; &lt;b&gt;Deleting characters in vim command mode:&lt;/b&gt;&lt;br /&gt;delete with  x key &lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;td style="width: 50%; font-size: 95%; color: rgb(0, 0, 0);"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Inserting / appending text:&lt;/b&gt;&lt;br /&gt;Press i or a in command mode and type &lt;/li&gt;&lt;li&gt; &lt;b&gt;Saving changes and exit:&lt;/b&gt;&lt;br /&gt;in command mode :wq or SHIFT+zz  &lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;a name="VIM_Operators_and_Motions_summary_2"&gt;&lt;/a&gt;&lt;h2&gt; &lt;span class="mw-headline"&gt;VIM Operators and Motions summary&lt;/span&gt;&lt;/h2&gt; &lt;table&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td style="border: 1px none ; width: 50%; font-size: 95%; color: rgb(0, 0, 0); vertical-align: text-top;"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Deleting words:&lt;/b&gt;&lt;br /&gt;delete word with d operator and w or e motion  &lt;/li&gt;&lt;li&gt; &lt;b&gt;Deleting to the end of the line:&lt;/b&gt;&lt;br /&gt;delete to th end of the line with d operator and $ motion &lt;/li&gt;&lt;li&gt; &lt;b&gt;Using operators, motions and counts:&lt;/b&gt;&lt;br /&gt;beginning of th line 0, end of the line $, end of the 2nd word 2e beginning of the 4th word 4w  &lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;td style="width: 50%; font-size: 95%; color: rgb(0, 0, 0);"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Deleting multiple words:&lt;/b&gt;&lt;br /&gt;to delete 3 words you would use d3w  &lt;/li&gt;&lt;li&gt; &lt;b&gt;Deleting lines:&lt;/b&gt;&lt;br /&gt;to delete single line dd, delete n lines ndd &lt;/li&gt;&lt;li&gt; &lt;b&gt;Undo changes:&lt;/b&gt;&lt;br /&gt;undo changes with u  &lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;a name="VIM_apprentice_user_summary_2"&gt;&lt;/a&gt;&lt;h2&gt; &lt;span class="mw-headline"&gt;VIM apprentice user summary&lt;/span&gt;&lt;/h2&gt; &lt;table&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td style="border: 1px none ; width: 50%; font-size: 95%; color: rgb(0, 0, 0); vertical-align: text-top;"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Paste command:&lt;/b&gt;&lt;br /&gt;paste your cache memory with p command  &lt;/li&gt;&lt;li&gt; &lt;b&gt;Replace characters:&lt;/b&gt;&lt;br /&gt;rt replace current character with t &lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;td style="width: 50%; font-size: 95%; color: rgb(0, 0, 0);"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Change characters:&lt;/b&gt;&lt;br /&gt;ce to change single word, c$ to change to the end of the line  &lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;a name="VIM_experienced_user_summary_2"&gt;&lt;/a&gt;&lt;h2&gt; &lt;span class="mw-headline"&gt;VIM experienced user summary&lt;/span&gt;&lt;/h2&gt; &lt;table&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td style="border: 1px none ; width: 50%; font-size: 95%; color: rgb(0, 0, 0); vertical-align: text-top;"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Advanced Navigation:&lt;/b&gt;&lt;br /&gt;end of the file G, begging of the file gg or 1G, to get on line n use nG&lt;br /&gt;instruct vim display file information CTRL+g &lt;/li&gt;&lt;li&gt; &lt;b&gt;Search text with vim:&lt;/b&gt;&lt;br /&gt;search forward /, search backward ?, next search n , previous search N &lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;td style="width: 50%; font-size: 95%; color: rgb(0, 0, 0);"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Vim Substitution :&lt;/b&gt;&lt;br /&gt;first occurrence single line :s/bash/perl/&lt;br /&gt;all occurrences single line :s/bash/perl/g&lt;br /&gt;first occurrence between line range: :23,100s/bash/perl/&lt;br /&gt;all occurrences between line range: :23,100s/bash/perl/g&lt;br /&gt;first occurrence in whole text: :%s/bash/perl/&lt;br /&gt;all occurrences whole text: :%s/bash/perl/g &lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;a name="VIM_veteran_user_summary_2"&gt;&lt;/a&gt;&lt;h2&gt; &lt;span class="mw-headline"&gt;VIM veteran user summary&lt;/span&gt;&lt;/h2&gt; &lt;table&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td style="border: 1px none ; width: 50%; font-size: 95%; color: rgb(0, 0, 0); vertical-align: text-top;"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Execute external commands on shell from vim:&lt;/b&gt;&lt;br /&gt;:!ls will execute ls command on your shell  &lt;/li&gt;&lt;li&gt; &lt;b&gt;Writing to files advanced:&lt;/b&gt;:w saves current file without quit, :w bash.sh whites to file bash.sh &lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;td style="width: 50%; font-size: 95%; color: rgb(0, 0, 0);"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Highlight text ans save to different file:&lt;/b&gt;highlight text with v operator and save it with :w &lt;yourfile&gt;   &lt;/yourfile&gt;&lt;/li&gt;&lt;li&gt; &lt;b&gt;Retrieve text from different file:&lt;/b&gt;:r &lt;yourfile&gt; will retrieve content of &lt;yourfile&gt; file  &lt;/yourfile&gt;&lt;/yourfile&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;a name="VIM_expert_user_summary"&gt;&lt;/a&gt;&lt;h2&gt; &lt;span class="mw-headline"&gt;VIM expert user summary&lt;/span&gt;&lt;/h2&gt;   &lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border: 1px none ; width: 50%; font-size: 95%; color: rgb(0, 0, 0); vertical-align: text-top;"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Using o operator:&lt;/b&gt;&lt;br /&gt;:o insert line bellow you cursor, O inserts line above your cursor &lt;/li&gt;&lt;li&gt; &lt;b&gt;Copy and paste:&lt;/b&gt;&lt;br /&gt;yank line with y and paste it with p &lt;/li&gt;&lt;/ul&gt; &lt;/td&gt;&lt;td style="width: 50%; font-size: 95%; color: rgb(0, 0, 0);"&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Customize vim's environment:&lt;/b&gt;&lt;br /&gt;edit ~/.vimrc file to customize vim's environment  &lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/num&gt;&lt;/filename&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-2026214190974086670?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/2026214190974086670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=2026214190974086670&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2026214190974086670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2026214190974086670'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2008/08/vim-quick-reference.html' title='Vim quick reference'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-437207111113894828</id><published>2008-04-18T04:14:00.004-04:00</published><updated>2008-04-18T04:35:39.020-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java SE'/><category scheme='http://www.blogger.com/atom/ns#' term='Certification'/><title type='text'>Free Java Programmer's Test</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_qVBiMGte-S0/SAhch4uTXSI/AAAAAAAAD-Y/ybGMVdyOJC4/s1600-h/betterprogrammercert.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp0.blogger.com/_qVBiMGte-S0/SAhch4uTXSI/AAAAAAAAD-Y/ybGMVdyOJC4/s200/betterprogrammercert.png" alt="" id="BLOGGER_PHOTO_ID_5190500307776527650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I stumbled on the site &lt;a href="http://www.betterprogrammer.com/"&gt;http://www.betterprogrammer.com&lt;/a&gt; today and found that it offers an open book programming test meaning you can use all reference (like one can do at work) but complete 5 programming exercises pertaining to use of core Java language for writing algorithms. It requires lots of Java collections framework usage and writing some recursion algorithms, writing tree traversal code, calculating prime numbers and stuff like that. The time limit is not very strict and it even allows you to take a break and then continue with the test. In the end you are given a free certificate based on percentile (which it states will keep changing - read may improve - with time, as more people take this free test). The questions were good quality and if you have some free time and like to write code then its quite a good avenue to spend some time on.&lt;br /&gt;&lt;br /&gt;My certificate is here: &lt;a href="http://www.betterprogrammer.com/certificate/BP1Q9GB5"&gt;http://www.betterprogrammer.com/certificate/BP1Q9GB5&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;They claim to maintain this certificate for you in their database and that you can retake the tests to improve (not sure if the questions remain the same - if they dont change then thats a bummer) but anyway take it once and you will love it. If you have taken this test already then feel free to leave your comments on how you liked it or discuss the questions you liked/found interesting.&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-437207111113894828?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/437207111113894828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=437207111113894828&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/437207111113894828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/437207111113894828'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2008/04/free-java-programmers-test.html' title='Free Java Programmer&apos;s Test'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_qVBiMGte-S0/SAhch4uTXSI/AAAAAAAAD-Y/ybGMVdyOJC4/s72-c/betterprogrammercert.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-3237441966291905352</id><published>2008-03-19T02:31:00.002-04:00</published><updated>2008-03-19T02:41:52.024-04:00</updated><title type='text'>Windows Vista SP1 Released Today</title><content type='html'>Get it from &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=b0c7136d-5ebb-413b-89c9-cb3d06d12674&amp;amp;DisplayLang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=b0c7136d-5ebb-413b-89c9-cb3d06d12674&amp;amp;DisplayLang=en&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I had the RC1 installed and so when i tried installing the SP1 release then it gave me an error that SP1 is already installed.&lt;br /&gt;&lt;br /&gt;So, you must remove all previous version of SP1 before upgrading to the next.&lt;br /&gt;&lt;br /&gt;Control Panel &gt; Programs and Features &gt; Installed Updates (upper left corner&lt;br /&gt;under Tasks) &gt; Highlight "Service Pack KB936330" &gt; Uninstall&lt;br /&gt;&lt;br /&gt;It will take awhile, there will be 2-3 reboots.  Then you can install the&lt;br /&gt;new version.&lt;br /&gt;&lt;br /&gt;Follow the above steps and then go to the given link above (for MS download center for Vista SP1) and download and install the SP1 here. To know the features of SP1 please refer to &lt;a href="http://apcmag.com/6929/vista_sp1_in_depth"&gt;this article&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-3237441966291905352?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/3237441966291905352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=3237441966291905352&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/3237441966291905352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/3237441966291905352'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2008/03/windows-vista-sp1-released-today.html' title='Windows Vista SP1 Released Today'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-3507860913554947380</id><published>2008-03-18T07:32:00.003-04:00</published><updated>2008-03-18T07:47:17.816-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java SE'/><category scheme='http://www.blogger.com/atom/ns#' term='Memory Leak'/><category scheme='http://www.blogger.com/atom/ns#' term='Java EE'/><title type='text'>Using SAP Memory Analyzer for Java memory leak detection</title><content type='html'>&lt;p&gt;&lt;a href="http://img301.imageshack.us/img301/5139/mem1vj6.swf"&gt;&lt;br /&gt; [Click to watch video of using SAP Memory Analyzer]&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I recently had opportunity to use the &lt;a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/Java/Java+Memory+Analysis"&gt;SAP Memory Analyzer tool&lt;/a&gt; for analyzing an HPROF heap dump generated on OutOfMemory error in code. I found that its an excellent and user friendly tool for job of memory leak analysis with good documentation. Though i generally preferred to use JHAT for heap walking but i realized that this SAP tool is much more intuitive and memory leak detection in code was a breeze. The above video tutorial talks about using the version 1.1.1 (which happens to be the latest at this time). Highly recommended.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-3507860913554947380?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/3507860913554947380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=3507860913554947380&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/3507860913554947380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/3507860913554947380'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2008/03/using-sap-memory-analyzer-for-java.html' title='Using SAP Memory Analyzer for Java memory leak detection'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-4757945815324103646</id><published>2008-03-13T04:56:00.003-04:00</published><updated>2008-03-13T05:08:51.268-04:00</updated><title type='text'>Emma vs Cobertura</title><content type='html'>The 2 open source Java code coverage tools that are the best among the lot are cobertura and emma. Both have their own pros and cons. &lt;br /&gt;&lt;br /&gt;Cobertura - http://cobertura.sourceforge.net/ &lt;br /&gt;vs&lt;br /&gt;Emma - http://emma.sourceforge.net/&lt;br /&gt;&lt;br /&gt;Points borrowed from: http://raibledesigns.com/rd/entry/emma_vs_cobertura_for_code&lt;br /&gt;Video : http://video.google.com/videoplay?docid=820584080702226910&lt;br /&gt;&lt;br /&gt;Emma:&lt;br /&gt;1. Stats on both class and method coverage&lt;br /&gt;2. Partial/fractional line coverages is unique trait - shown in yellow when there are multiple conditions in a conditional block like if (x &amp;lt; 0 and x &amp;gt; 10) and say x &amp;gt; 10 never gets executed this is shown in yellow. This is important feature which lets us determine if the tests cover all conditions of such more than one conditions conditional blocks.&lt;br /&gt;3. Not being actively developed.&lt;br /&gt;4. Stricter code coverage.&lt;br /&gt;5. Integration with Eclipse available - http://www.eclemma.org/&lt;br /&gt;6. Better documentation than cobertura.&lt;br /&gt;7. Instrumentation process is faster than cobertura.&lt;br /&gt;8. Standalone library and does not have any external dependencies.&lt;br /&gt;9. Common public license 1.0 friendlier that GPL.&lt;br /&gt;&lt;br /&gt;Cobertura: (since 2002)&lt;br /&gt;1. GPL'd version of JCoverage (which is commercial). Project older than Emma.&lt;br /&gt;2. Prettier reports.&lt;br /&gt;3. Actively developed.&lt;br /&gt;4. Branch/block and line coverages only - no class or method level coverage.&lt;br /&gt;5. How many times a line has been executed - unique about cobertura.&lt;br /&gt;6. &amp;lt;cobertura-check&amp;gt; where one can specify percentage of coverage that's a MUST or else build fails.&lt;br /&gt;7. Data merge feature - good for QA labs... for merging coverage data to prepare historical trend graphs. Emma also supports it now but it seems its better with cobertura. Project long coverage collection possible.&lt;br /&gt;8. Depends on other third party libraries.&lt;br /&gt;&lt;br /&gt;Common factors in both of these code coverage tools:&lt;br /&gt;1. bytecode instrumentation.&lt;br /&gt;2. reports are filterable so you can tell what needs to be evaluated for code coverage.&lt;br /&gt;3. offline instrumentation (most recommended approach) - separate instrument/execute/report tasks – this is what we adopted. The other approach is on-the-fly instrumentation.&lt;br /&gt;4. ant integration.&lt;br /&gt;5. testng integration.&lt;br /&gt;&lt;br /&gt;The above information can be used in deciding about the right tool for your project. We went for Emma as it seemed to have good enough reports and was fast. I did not get a chance to experiment with Cobertura but will surely try it out soon.&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-4757945815324103646?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/4757945815324103646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=4757945815324103646&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/4757945815324103646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/4757945815324103646'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2008/03/emma-vs-cobertura.html' title='Emma vs Cobertura'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-8148472255642646925</id><published>2008-03-13T04:39:00.007-04:00</published><updated>2009-01-14T15:03:04.753-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Code Coverage'/><title type='text'>Using TestNG with Emma for automating test code coverage report generation</title><content type='html'>TestNG and Emma can be used together to automate the generation of code coverage report after every test run in the ANT builld script.&lt;br /&gt;Following ant build script snippet shows how both tools are used together for this important metrics collection.&lt;br /&gt;&lt;br /&gt;To run it:&lt;br /&gt;$ ant emma test&lt;br /&gt;&lt;br /&gt;This will generate the code coverage report for the TestNG tests in ./coverage directory (where, basedir = ".").&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- output directory used for EMMA coverage reports: --&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;property name="coverage.dir" value="${basedir}/coverage" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- directory that contains emma.jar and emma_ant.jar: --&amp;gt;&lt;br /&gt;&amp;lt;property name="emma.dir" value="${lib}/emma" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- path element used by EMMA taskdef below: --&amp;gt;&lt;br /&gt;&amp;lt;path id="emma.lib"&amp;gt;&lt;br /&gt; &amp;lt;pathelement location="${emma.dir}/emma.jar" /&amp;gt;&lt;br /&gt; &amp;lt;pathelement location="${emma.dir}/emma_ant.jar" /&amp;gt;&lt;br /&gt;&amp;lt;/path&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- this loads &amp;lt;emma&amp;gt; and &amp;lt;emmajava&amp;gt; custom tasks: --&amp;gt;&lt;br /&gt;&amp;lt;taskdef resource="emma_ant.properties" classpathref="emma.lib" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;property environment="env" /&amp;gt;&lt;br /&gt;&amp;lt;path id="classpath"&amp;gt;&lt;br /&gt; &amp;lt;fileset dir="${lib}"&amp;gt;&lt;br /&gt;  &amp;lt;include name="**/*.jar" /&amp;gt;&lt;br /&gt; &amp;lt;/fileset&amp;gt;&lt;br /&gt;&amp;lt;/path&amp;gt;&lt;br /&gt;&amp;lt;!-- 6. CODE COVERAGE initialization. --&amp;gt;&lt;br /&gt;&amp;lt;target name="emma" description="turns on EMMA's instrumentation/reporting"&amp;gt;&lt;br /&gt; &amp;lt;property name="emma.enabled" value="true" /&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;!-- this property, if overriden via -Demma.filter=&amp;lt;list of filter specs&amp;gt;&lt;br /&gt;         on ANT's command line, will set the coverage filter; by default,&lt;br /&gt;         all classes found in 'run.classpath' pathref will be instrumented:&lt;br /&gt;    --&amp;gt;&lt;br /&gt; &amp;lt;property name="emma.filter" value="" /&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- 7. TEST the application. --&amp;gt;&lt;br /&gt;&amp;lt;taskdef name="testng" classpathref="classpath" classname="org.testng.TestNGAntTask" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- EMMA ANT tasks are implemented as pseudo-nested tasks: &amp;lt;emma&amp;gt;&lt;br /&gt;       container task can contain an arbitrary sequence of &amp;lt;instr&amp;gt;,&lt;br /&gt;       &amp;lt;report&amp;gt;, and &amp;lt;merge&amp;gt;. Both the container tag and each of the nested&lt;br /&gt;       elements support an optional boolean 'enabled' attribute: setting it&lt;br /&gt;       to 'false' will no-op the element. This is convenient for&lt;br /&gt;       sandwhiching normal build tasks between EMMA tasks such that coverage&lt;br /&gt;       instrumentation and reporting could be enabled on demand. --&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;target name="test" description="execute testng tests" depends="dist"&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;emma enabled="${emma.enabled}" verbosity="verbose"&amp;gt;&lt;br /&gt;  &amp;lt;instr instrpath="${build}" mode="overwrite" metadatafile="${coverage.dir}/metadata.emma"&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;!-- note that coverage filters can be set through nested &amp;lt;filter&amp;gt;&lt;br /&gt;             elements as well: many of EMMA setting are 'mergeable' in the&lt;br /&gt;             sense that they can be specified multiple times and the result&lt;br /&gt;             is a union of all such values. Here we are not merging several&lt;br /&gt;             filters together but merely demonstrating that it is possible:&lt;br /&gt;        --&amp;gt;&lt;br /&gt;   &amp;lt;filter value="${emma.filter}" /&amp;gt;&lt;br /&gt;  &amp;lt;/instr&amp;gt;&lt;br /&gt; &amp;lt;/emma&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;javac srcdir="${test.src.dir}" destdir="${build}" classpathref="classpath" deprecation="${compile.deprecation}" /&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;testng classpathref="test.classpath" outputDir="${testng.report.dir}" sourcedir="${test.src.dir}" haltOnfailure="true"&amp;gt;&lt;br /&gt;  &amp;lt;xmlfileset dir="${test.src.dir}" includes="testng.xml" /&amp;gt;&lt;br /&gt;  &amp;lt;jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma" /&amp;gt;&lt;br /&gt;  &amp;lt;jvmarg value="-Demma.coverage.out.merge=false" /&amp;gt;&lt;br /&gt; &amp;lt;/testng&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;!-- if enabled, generate coverage report(s): --&amp;gt;&lt;br /&gt; &amp;lt;emma enabled="${emma.enabled}"&amp;gt;&lt;br /&gt;  &amp;lt;report sourcepath="${src}" sort="+block,+name,+method,+class" metrics="method:70,block:80,line:80,class:100"&amp;gt;&lt;br /&gt;   &amp;lt;!-- collect all EMMA data dumps (metadata and runtime)&lt;br /&gt;             [this can be done via nested &amp;lt;fileset&amp;gt; fileset elements&lt;br /&gt;             or &amp;lt;file&amp;gt; elements pointing to a single file]:&lt;br /&gt;        --&amp;gt;&lt;br /&gt;   &amp;lt;fileset dir="${coverage.dir}"&amp;gt;&lt;br /&gt;    &amp;lt;include name="*.emma" /&amp;gt;&lt;br /&gt;   &amp;lt;/fileset&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;!-- for every type of report desired, configure a nested&lt;br /&gt;             element; various report parameters&lt;br /&gt;             can be inherited from the parent &amp;lt;report&amp;gt;&lt;br /&gt;             and individually overridden for each report type:&lt;br /&gt;        --&amp;gt;&lt;br /&gt;   &amp;lt;txt outfile="${coverage.dir}/coverage.txt" depth="package" columns="class,method,block,line,name" /&amp;gt;&lt;br /&gt;   &amp;lt;xml outfile="${coverage.dir}/coverage.xml" depth="package" /&amp;gt;&lt;br /&gt;   &amp;lt;html outfile="${coverage.dir}/coverage.html" depth="method" columns="name,class,method,block,line" /&amp;gt;&lt;br /&gt;  &amp;lt;/report&amp;gt;&lt;br /&gt; &amp;lt;/emma&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-8148472255642646925?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/8148472255642646925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=8148472255642646925&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8148472255642646925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/8148472255642646925'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2008/03/using-testng-with-emma-for-automating.html' title='Using TestNG with Emma for automating test code coverage report generation'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-5450073617971886982</id><published>2008-01-09T17:48:00.000-05:00</published><updated>2008-01-09T18:00:51.448-05:00</updated><title type='text'>Experience using apache commons EqualsBuilder class</title><content type='html'>Following are my learnings on how to use the &lt;a href="http://commons.apache.org/lang/api/org/apache/commons/lang/builder/EqualsBuilder.html"&gt;EqualsBuilder&lt;/a&gt; class in apache commons lang library. &lt;br /&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tr&gt;&lt;td align="center"&gt;C:\Work\EqualsProto\src\equalsproto\Main.java&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="keyword-directive"&gt;package&lt;/span&gt; equalsproto;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;//~--- non-JDK imports --------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword-directive"&gt;import&lt;/span&gt; java.util.Arrays;&lt;br /&gt;&lt;span class="keyword-directive"&gt;import&lt;/span&gt; org.apache.commons.lang.builder.EqualsBuilder;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword-directive"&gt;class&lt;/span&gt; A&lt;br /&gt;{&lt;br /&gt;   &lt;span class="keyword-directive"&gt;private&lt;/span&gt; String s = &lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;Watsh&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;   &lt;span class="keyword-directive"&gt;private&lt;/span&gt; &lt;span class="keyword-directive"&gt;int&lt;/span&gt;    x = 10;&lt;br /&gt;   &lt;span class="keyword-directive"&gt;private&lt;/span&gt; &lt;span class="keyword-directive"&gt;float&lt;/span&gt;  y = 20.2f;&lt;br /&gt;&lt;br /&gt;   &lt;span class="comment"&gt;//~--- constructors --------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   A() {}&lt;br /&gt;   &lt;br /&gt;   A(&lt;span class="keyword-directive"&gt;int&lt;/span&gt; i, &lt;span class="keyword-directive"&gt;int&lt;/span&gt; i0, String string)&lt;br /&gt;   {&lt;br /&gt;      &lt;span class="keyword-directive"&gt;this&lt;/span&gt;.x = i;&lt;br /&gt;      &lt;span class="keyword-directive"&gt;this&lt;/span&gt;.y = i0;&lt;br /&gt;      &lt;span class="keyword-directive"&gt;this&lt;/span&gt;.s = string;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   &lt;span class="comment"&gt;//~--- methods -------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;Method&lt;/span&gt; &lt;span class="comment"&gt;description&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;    *&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;    *&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="ST0"&gt;@param&lt;/span&gt; &lt;span class="comment"&gt;obj&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    *&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="ST0"&gt;@return&lt;/span&gt;&lt;br /&gt;    &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;   @Override&lt;br /&gt;   &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;boolean&lt;/span&gt; equals(Object obj)&lt;br /&gt;   {&lt;br /&gt;      &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (obj &lt;span class="keyword-directive"&gt;instanceof&lt;/span&gt; A == &lt;span class="keyword-directive"&gt;false&lt;/span&gt;) {&lt;br /&gt;         &lt;span class="keyword-directive"&gt;return&lt;/span&gt; &lt;span class="keyword-directive"&gt;false&lt;/span&gt;;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (&lt;span class="keyword-directive"&gt;this&lt;/span&gt; == obj) {&lt;br /&gt;         &lt;span class="keyword-directive"&gt;return&lt;/span&gt; &lt;span class="keyword-directive"&gt;true&lt;/span&gt;;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      A rhs = (A) obj;&lt;br /&gt;&lt;br /&gt;      &lt;span class="comment"&gt;/**&lt;/span&gt; &lt;span class="comment"&gt;Note&lt;/span&gt;&lt;span class="comment"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;       * &lt;/span&gt;&lt;span class="comment"&gt;Do&lt;/span&gt; &lt;span class="comment"&gt;not&lt;/span&gt; &lt;span class="comment"&gt;use&lt;/span&gt; &lt;span class="comment"&gt;appendSuper&lt;/span&gt; &lt;span class="comment"&gt;when&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;span class="comment"&gt;super&lt;/span&gt; &lt;span class="comment"&gt;class&lt;/span&gt; &lt;span class="comment"&gt;is&lt;/span&gt; &lt;span class="comment"&gt;java&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;span class="comment"&gt;lang&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;span class="comment"&gt;Object&lt;/span&gt; &lt;span class="comment"&gt;as&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;       * &lt;/span&gt;&lt;span class="comment"&gt;default&lt;/span&gt; &lt;span class="comment"&gt;implementation&lt;/span&gt; &lt;span class="comment"&gt;of&lt;/span&gt; &lt;span class="comment"&gt;equals&lt;/span&gt; &lt;span class="comment"&gt;in&lt;/span&gt; &lt;span class="comment"&gt;Object&lt;/span&gt; &lt;span class="comment"&gt;class&lt;/span&gt; &lt;span class="comment"&gt;will&lt;/span&gt; &lt;span class="comment"&gt;return&lt;/span&gt; &lt;span class="comment"&gt;true&lt;/span&gt; &lt;span class="comment"&gt;only&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;       * &lt;/span&gt;&lt;span class="comment"&gt;when&lt;/span&gt; &lt;span class="comment"&gt;two&lt;/span&gt; &lt;span class="comment"&gt;references&lt;/span&gt; &lt;span class="comment"&gt;are&lt;/span&gt; &lt;span class="comment"&gt;pointing&lt;/span&gt; &lt;span class="comment"&gt;to&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;span class="comment"&gt;same&lt;/span&gt; &lt;span class="comment"&gt;object&lt;/span&gt; &lt;span class="comment"&gt;instance&lt;/span&gt; &lt;span class="comment"&gt;and&lt;/span&gt; &lt;span class="comment"&gt;hence&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;       * &lt;/span&gt;&lt;span class="comment"&gt;the&lt;/span&gt; &lt;span class="comment"&gt;effect&lt;/span&gt; &lt;span class="comment"&gt;is&lt;/span&gt; &lt;span class="comment"&gt;not&lt;/span&gt; &lt;span class="comment"&gt;desirable&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;br /&gt;       &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword-directive"&gt;return&lt;/span&gt; &lt;span class="keyword-directive"&gt;new&lt;/span&gt; EqualsBuilder().append(s, rhs.s).append(x,&lt;br /&gt;         rhs.x).append(y, rhs.y).isEquals();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword-directive"&gt;class&lt;/span&gt; B &lt;br /&gt;{&lt;br /&gt;   &lt;span class="keyword-directive"&gt;private&lt;/span&gt; String z = &lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;Rajneesh&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;   &lt;span class="keyword-directive"&gt;private&lt;/span&gt; A      a;&lt;br /&gt;   &lt;span class="keyword-directive"&gt;private&lt;/span&gt; A[]    array;&lt;br /&gt;&lt;br /&gt;   &lt;span class="comment"&gt;//~--- constructors --------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   B(String z, A a, A[] array)&lt;br /&gt;   {&lt;br /&gt;      &lt;span class="keyword-directive"&gt;this&lt;/span&gt;.z = z;&lt;br /&gt;      &lt;span class="keyword-directive"&gt;this&lt;/span&gt;.a = a;&lt;br /&gt;      &lt;span class="keyword-directive"&gt;this&lt;/span&gt;.array    = array;&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;    @Override&lt;br /&gt;   &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;Learning&lt;/span&gt;&lt;span class="comment"&gt;: &lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * 1&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt; &lt;span class="comment"&gt;appendSuper&lt;/span&gt;&lt;span class="comment"&gt;() &lt;/span&gt;&lt;span class="comment"&gt;should&lt;/span&gt; &lt;span class="comment"&gt;not&lt;/span&gt; &lt;span class="comment"&gt;be&lt;/span&gt; &lt;span class="comment"&gt;used&lt;/span&gt; &lt;span class="comment"&gt;as&lt;/span&gt; &lt;span class="comment"&gt;it&lt;/span&gt; &lt;span class="comment"&gt;then&lt;/span&gt; &lt;span class="comment"&gt;calls&lt;/span&gt; &lt;span class="comment"&gt;super&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;span class="comment"&gt;equals&lt;/span&gt;&lt;span class="comment"&gt;()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;for&lt;/span&gt; &lt;span class="comment"&gt;java&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;span class="comment"&gt;lang&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;span class="comment"&gt;Object&lt;/span&gt; &lt;span class="comment"&gt;class&lt;/span&gt; &lt;span class="comment"&gt;which&lt;/span&gt; &lt;span class="comment"&gt;will&lt;/span&gt; &lt;span class="comment"&gt;return&lt;/span&gt; &lt;span class="comment"&gt;true&lt;/span&gt; &lt;span class="comment"&gt;only&lt;/span&gt; &lt;span class="comment"&gt;when&lt;/span&gt; &lt;span class="comment"&gt;both&lt;/span&gt; &lt;span class="comment"&gt;lhs&lt;/span&gt; &lt;span class="comment"&gt;and&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;rhs&lt;/span&gt; &lt;span class="comment"&gt;references&lt;/span&gt; &lt;span class="comment"&gt;point&lt;/span&gt; &lt;span class="comment"&gt;to&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;span class="comment"&gt;same&lt;/span&gt; &lt;span class="comment"&gt;object&lt;/span&gt; &lt;span class="comment"&gt;instance&lt;/span&gt; &lt;span class="comment"&gt;and&lt;/span&gt; &lt;span class="comment"&gt;hence&lt;/span&gt; &lt;span class="comment"&gt;will&lt;/span&gt; &lt;span class="comment"&gt;return&lt;/span&gt; &lt;span class="comment"&gt;false&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;when&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt;&lt;span class="comment"&gt; 2 &lt;/span&gt;&lt;span class="comment"&gt;object&lt;/span&gt; &lt;span class="comment"&gt;instances&lt;/span&gt; &lt;span class="comment"&gt;are&lt;/span&gt; &lt;span class="comment"&gt;different&lt;/span&gt; &lt;span class="comment"&gt;but&lt;/span&gt; &lt;span class="comment"&gt;meaningfully&lt;/span&gt; &lt;span class="comment"&gt;equivalent&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * 2&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt; &lt;span class="comment"&gt;To&lt;/span&gt; &lt;span class="comment"&gt;compare&lt;/span&gt; &lt;span class="comment"&gt;arrays&lt;/span&gt;&lt;span class="comment"&gt;, &lt;/span&gt;&lt;span class="comment"&gt;you&lt;/span&gt; &lt;span class="comment"&gt;will&lt;/span&gt; &lt;span class="comment"&gt;either&lt;/span&gt; &lt;span class="comment"&gt;need&lt;/span&gt; &lt;span class="comment"&gt;to&lt;/span&gt; &lt;span class="comment"&gt;use&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;EqualsBuilder&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;span class="comment"&gt;reflectionEquals&lt;/span&gt;&lt;span class="comment"&gt;() &lt;/span&gt;&lt;span class="comment"&gt;approach&lt;/span&gt; &lt;span class="comment"&gt;or&lt;/span&gt; &lt;span class="comment"&gt;if&lt;/span&gt; &lt;span class="comment"&gt;you&lt;/span&gt; &lt;span class="comment"&gt;are&lt;/span&gt; &lt;span class="comment"&gt;using&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;EqualsBuilder&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;span class="comment"&gt;append&lt;/span&gt;&lt;span class="comment"&gt;() &lt;/span&gt;&lt;span class="comment"&gt;approach&lt;/span&gt; &lt;span class="comment"&gt;then&lt;/span&gt; &lt;span class="comment"&gt;append&lt;/span&gt;&lt;span class="comment"&gt;(&lt;/span&gt;&lt;span class="comment"&gt;array1&lt;/span&gt;&lt;span class="comment"&gt;, &lt;/span&gt;&lt;span class="comment"&gt;array2&lt;/span&gt;&lt;span class="comment"&gt;) &lt;/span&gt;&lt;span class="comment"&gt;calls&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;array1&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;span class="comment"&gt;equals&lt;/span&gt;&lt;span class="comment"&gt;(&lt;/span&gt;&lt;span class="comment"&gt;array2&lt;/span&gt;&lt;span class="comment"&gt;) &lt;/span&gt;&lt;span class="comment"&gt;which&lt;/span&gt; &lt;span class="comment"&gt;will&lt;/span&gt; &lt;span class="comment"&gt;only&lt;/span&gt; &lt;span class="comment"&gt;do&lt;/span&gt; &lt;span class="comment"&gt;a&lt;/span&gt; &lt;span class="comment"&gt;shallow&lt;/span&gt; &lt;span class="comment"&gt;comparison&lt;/span&gt; &lt;span class="comment"&gt;for&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * 2 &lt;/span&gt;&lt;span class="comment"&gt;arrays&lt;/span&gt; &lt;span class="comment"&gt;involved&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt; &lt;span class="comment"&gt;So&lt;/span&gt; &lt;span class="comment"&gt;in&lt;/span&gt; &lt;span class="comment"&gt;such&lt;/span&gt; &lt;span class="comment"&gt;a&lt;/span&gt; &lt;span class="comment"&gt;case&lt;/span&gt;&lt;span class="comment"&gt;, &lt;/span&gt;&lt;span class="comment"&gt;you&lt;/span&gt; &lt;span class="comment"&gt;must&lt;/span&gt; &lt;span class="comment"&gt;use&lt;/span&gt; &lt;span class="comment"&gt;Arrays&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;span class="comment"&gt;deepEquals&lt;/span&gt;&lt;span class="comment"&gt;() &lt;/span&gt;&lt;span class="comment"&gt;for&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;all&lt;/span&gt; &lt;span class="comment"&gt;array&lt;/span&gt; &lt;span class="comment"&gt;members&lt;/span&gt; &lt;span class="comment"&gt;of&lt;/span&gt; &lt;span class="comment"&gt;your&lt;/span&gt; &lt;span class="comment"&gt;class&lt;/span&gt; &lt;span class="comment"&gt;and&lt;/span&gt; &lt;span class="comment"&gt;once&lt;/span&gt; &lt;span class="comment"&gt;that&lt;/span&gt; &lt;span class="comment"&gt;equality&lt;/span&gt; &lt;span class="comment"&gt;is&lt;/span&gt; &lt;span class="comment"&gt;met&lt;/span&gt; &lt;span class="comment"&gt;you&lt;/span&gt; &lt;span class="comment"&gt;can&lt;/span&gt; &lt;span class="comment"&gt;use&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;EqualsBuilder&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;span class="comment"&gt;append&lt;/span&gt;&lt;span class="comment"&gt;() &lt;/span&gt;&lt;span class="comment"&gt;for&lt;/span&gt; &lt;span class="comment"&gt;rest&lt;/span&gt; &lt;span class="comment"&gt;of&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;span class="comment"&gt;non&lt;/span&gt;&lt;span class="comment"&gt;-&lt;/span&gt;&lt;span class="comment"&gt;array&lt;/span&gt; &lt;span class="comment"&gt;instances&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="comment"&gt;NOTE&lt;/span&gt;&lt;span class="comment"&gt;: &lt;/span&gt;&lt;span class="comment"&gt;I&lt;/span&gt; &lt;span class="comment"&gt;have&lt;/span&gt; &lt;span class="comment"&gt;not&lt;/span&gt; &lt;span class="comment"&gt;tested&lt;/span&gt; &lt;span class="comment"&gt;for&lt;/span&gt; &lt;span class="comment"&gt;how&lt;/span&gt; &lt;span class="comment"&gt;this&lt;/span&gt; &lt;span class="comment"&gt;approach&lt;/span&gt; &lt;span class="comment"&gt;works&lt;/span&gt; &lt;span class="comment"&gt;for&lt;/span&gt; &lt;span class="comment"&gt;Collection&lt;/span&gt; &lt;span class="comment"&gt;classes&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;   &lt;span class="comment"&gt;/*public boolean equals(Object obj)&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;      if (obj instanceof A == false) {&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;         return false;&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;      }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;      if (this == obj) {&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;         return true;&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;      }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;      B rhs = (B) obj;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;      return new EqualsBuilder().append(z, rhs.z).append(a,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;         rhs.a).append(array, rhs.array).isEquals();&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;   }*/&lt;/span&gt;&lt;br /&gt;   &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;boolean&lt;/span&gt; equals(Object obj) {&lt;br /&gt;        &lt;span class="keyword-directive"&gt;return&lt;/span&gt; EqualsBuilder.reflectionEquals(&lt;span class="keyword-directive"&gt;this&lt;/span&gt;, obj);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;/**&lt;/span&gt; &lt;span class="comment"&gt;Testing&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;span class="comment"&gt;use&lt;/span&gt; &lt;span class="comment"&gt;of&lt;/span&gt; &lt;span class="comment"&gt;EqualsBuilder&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="ST0"&gt;@author&lt;/span&gt; &lt;span class="comment"&gt;wrajnees&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;class&lt;/span&gt; Main&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;    * &lt;/span&gt;&lt;span class="ST0"&gt;@param&lt;/span&gt; &lt;span class="comment"&gt;args&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;span class="comment"&gt;command&lt;/span&gt; &lt;span class="comment"&gt;line&lt;/span&gt; &lt;span class="comment"&gt;arguments&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;   &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;static&lt;/span&gt; &lt;span class="keyword-directive"&gt;void&lt;/span&gt; main(String[] args)&lt;br /&gt;   {&lt;br /&gt;        A a1 = &lt;span class="keyword-directive"&gt;new&lt;/span&gt; A(2, 43, &lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;xxx&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;);&lt;br /&gt;        A a2 = &lt;span class="keyword-directive"&gt;new&lt;/span&gt; A(2, 43, &lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;xxx&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;);&lt;br /&gt;        &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (a1.equals(a2)) {&lt;br /&gt;            p(&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;a1 equals a2&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;);&lt;br /&gt;        } &lt;span class="keyword-directive"&gt;else&lt;/span&gt; {&lt;br /&gt;            p(&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;a1 not equals a2&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;);&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        A[] array1 = &lt;span class="keyword-directive"&gt;new&lt;/span&gt; A[2];&lt;br /&gt;        A[] array2 = &lt;span class="keyword-directive"&gt;new&lt;/span&gt; A[2];&lt;br /&gt;        &lt;br /&gt;        array1[0] = a1;&lt;br /&gt;        array1[1] = &lt;span class="keyword-directive"&gt;new&lt;/span&gt; A();&lt;br /&gt;        &lt;br /&gt;        array2[0] = a2;&lt;br /&gt;        array2[1] = &lt;span class="keyword-directive"&gt;new&lt;/span&gt; A();&lt;br /&gt;        &lt;br /&gt;        &lt;span class="comment"&gt;// comparing arrays&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (Arrays.deepEquals(array1, array2)) {&lt;br /&gt;        &lt;span class="comment"&gt;//if (array1.equals(a2)) { // -- does not work&lt;/span&gt;&lt;br /&gt;            p(&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;arrays are equal&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;);&lt;br /&gt;        } &lt;span class="keyword-directive"&gt;else&lt;/span&gt; {&lt;br /&gt;            p(&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;arrays arent equal&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;);&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;        &lt;span class="comment"&gt;// comparing more complex object with containment and array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        B b1 = &lt;span class="keyword-directive"&gt;new&lt;/span&gt; B(&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;Test&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;, a1, array1);&lt;br /&gt;        B b2 = &lt;span class="keyword-directive"&gt;new&lt;/span&gt; B(&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;Test&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;, a2, array2);&lt;br /&gt;        &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (b1.equals(b2)) {&lt;br /&gt;            p(&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;b1 equals b2&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;);&lt;br /&gt;        } &lt;span class="keyword-directive"&gt;else&lt;/span&gt; {&lt;br /&gt;            p(&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;&lt;span class="character"&gt;b1 not equals b2&lt;/span&gt;&lt;span class="character"&gt;&amp;quot;&lt;/span&gt;);&lt;br /&gt;        }        &lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   &lt;span class="keyword-directive"&gt;private&lt;/span&gt; &lt;span class="keyword-directive"&gt;static&lt;/span&gt; &lt;span class="keyword-directive"&gt;void&lt;/span&gt; p(String s) {&lt;br /&gt;       System.out.println(s);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-5450073617971886982?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/5450073617971886982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=5450073617971886982&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/5450073617971886982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/5450073617971886982'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2008/01/experience-using-apache-commons.html' title='Experience using apache commons EqualsBuilder class'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-48366381819963360</id><published>2008-01-08T01:23:00.001-05:00</published><updated>2008-01-08T03:06:59.148-05:00</updated><title type='text'>Detecting memory leaks in Java SE</title><content type='html'>Today i have learned about a nice approach to detecting memory leaks in the Java SE applications using the jmap and jhat (Java Heap Analysis Tool). The process to be followed is described below:&lt;br /&gt;&lt;br /&gt;1. Run your application.&lt;br /&gt;&lt;br /&gt;2. Run the command jps to know the process id of the J2SE application you ran.&lt;br /&gt;% jps&lt;br /&gt;1234 MyApp&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;3. Perform those actions in your application which you feel will cause the memory leak. You can observe the real time heap usage plot in jconsole. Launch jconsole and select your application in it to connect to.&lt;br /&gt;% jconsole&lt;br /&gt;&lt;br /&gt;4.Then run the command jmap to dump the heap.&lt;br /&gt;% &lt;a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jmap.html"&gt;jmap&lt;/a&gt; -dump:file=myapp.bin 1234&lt;br /&gt;&lt;br /&gt;This will produce a heap dump in myapp.bin file with the heap profile.&lt;br /&gt;&lt;br /&gt;4. Run the JHAT (Java Heap Analysis Tool) as follows:&lt;br /&gt;% &lt;a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html"&gt;jhat&lt;/a&gt;&lt;a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html"&gt; &lt;/a&gt;-J-mx512m heap.bin&lt;br /&gt;&lt;br /&gt;The above command starts a small Http server at port 7000 by default.&lt;br /&gt;&lt;br /&gt;5. Browse to http://localhost:7000 and you will have you the heap browser - a hyperlinked set of pages from where you can trace every object allocated and who all reference the object at the point at which the heap dump was created.&lt;br /&gt;&lt;br /&gt;6. The important pages to browse to are:&lt;br /&gt;http://localhost:7000/histo/ - to see the histogram of heap usage.&lt;br /&gt;http://localhost:7000/showInstanceCounts or http://localhost:7000/showInstanceCounts/includePlatform/ to see biggest types with most object allocations (ie instances).&lt;br /&gt;&lt;br /&gt;and some advanced features of using SQL to query values of instance members:&lt;br /&gt;http://localhost:7000/oql/&lt;br /&gt;&lt;br /&gt;7. So browse to http://localhost:7000/showInstanceCounts/. Investigate "Instances" and not "Classes". Use “Reference Chains from Rootset” (Exclude weak refs!!!) to see who’s holding the instance. This tip i found in one of the links below in the reference section and it really was what was required to find the memory leaking code.&lt;br /&gt;&lt;br /&gt;Some good references are:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.adtmag.com/java/articleold.aspx?id=165"&gt;Memory leaks in Java program&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mustangs.html"&gt;Using Mustang's jmap/jhat to profile Glassfish&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://blog.emptyway.com/2007/04/02/finding-memory-leaks-in-java-apps/"&gt;Finding Memory leaks in Java Program&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-48366381819963360?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/48366381819963360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=48366381819963360&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/48366381819963360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/48366381819963360'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2008/01/detecting-memory-leaks-in-java-se.html' title='Detecting memory leaks in Java SE'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-2528170176091793311</id><published>2007-12-03T13:44:00.000-05:00</published><updated>2007-12-03T13:46:36.381-05:00</updated><title type='text'>TestNG versus JUnit4</title><content type='html'>Comparing JUnit 4 and TestNG 5.7&lt;br /&gt;&lt;br /&gt;Excerpts from http://www.ibm.com/developerworks/java/library/j-cq08296/ by Andy Glover.&lt;br /&gt;&lt;br /&gt;JUnit is geared more towards unit testing - testing an object class in isolation.&lt;br /&gt;TestNG provides more features and flexibility to facilitate its use not only for unit but integration, regression, functional, acceptance testings etc.&lt;br /&gt;&lt;br /&gt;1. The setup method (annotated with @BeforeClass) needs to static and public with JUnit 4 but thats not required by TestNG. Thus TestNG is more flexible of the two.&lt;br /&gt;&lt;br /&gt;2. Dependency testing:&lt;br /&gt;Unlike JUnit, TestNG welcomes test dependencies through the dependsOnMethods attribute of the Test annotation. With this handy feature, you can easily specify dependent methods,  which will execute before a desired method. What's more, if the dependent method fails, then all subsequent tests will be skipped, not marked as failed.&lt;br /&gt;&lt;br /&gt;In JUnit 4, you can specify test orders using fixtures but if one test A fails then a test B that depends on test A will also be marked as failed.&lt;br /&gt;&lt;br /&gt;TestNG's trick of skipping, rather than failing, can really take the pressure off in large test suites. Rather than trying to figure out why 50 percent of the test suite failed, your team can concentrate on why 50 percent of it was skipped! Better yet, TestNG complements its dependency testing setup with a mechanism for rerunning only failed tests.&lt;br /&gt;&lt;br /&gt;3. Fail and rerun:&lt;br /&gt;The ability to rerun failed tests is especially handy in large test suites, and it's a feature you'll only find in TestNG. In JUnit 4, if your test suite consists of 1000 tests and 3 of them fail, you'll likely be forced to rerun the entire suite (with fixes). Needless to say, this sort of thing can take hours.&lt;br /&gt;&lt;br /&gt;Anytime there is a failure in TestNG, it creates an XML configuration file (testng-failed.xml) that delineates the failed tests. Running a TestNG runner with this file causes TestNG to only run the failed tests. So, in the previous example, you would only have to rerun the three failed tests and not the whole suite.&lt;br /&gt;&lt;br /&gt;This feature doesn't seem like such a big deal when you're running smaller test suites, but you quickly come to appreciate it as your test suites grow in size.&lt;br /&gt;&lt;br /&gt;4. Parametric testing:&lt;br /&gt;By placing parametric data in TestNG's XML configuration files, you can reuse a single test case with different data sets and even get different results. This technique is perfect for avoiding tests that only assert sunny-day scenarios or don't effectively verify bounds.&lt;br /&gt;&lt;br /&gt;JUnit testers often turn to a framework like FIT in this case because it lets you drive tests with tabular data. But TestNG provides a similar feature right out of the box.&lt;br /&gt;&lt;br /&gt;This feature not only facilitates reuse of the test case code but also allows non-programmers to specify test data (since test data is in xml file).&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class TestWebServer {&lt;br /&gt;  @Test(parameters = { "number-of-times" })&lt;br /&gt;  public void accessPage(int numberOfTimes) {&lt;br /&gt;    while (numberOfTimes-- &gt; 0) {&lt;br /&gt;     // access the web page&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. Advanced Parametric testing:&lt;br /&gt;While pulling data values into an XML file can be quite handy, tests occasionally require complex types, which can't be represented as a String or a primitive value. TestNG handles this scenario with its @DataProvider annotation, which facilitates the mapping of complex parameter types to a test method. &lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;//This method will provide data to any test method that declares that its Data Provider&lt;br /&gt;//is named "test1"&lt;br /&gt;@DataProvider(name = "test1")&lt;br /&gt;public Object[][] createData1() {&lt;br /&gt; return new Object[][] {&lt;br /&gt;   { "Cedric", new Integer(36) },&lt;br /&gt;   { "Anne", new Integer(37)}, &lt;br /&gt; };&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//This test method declares that its data should be supplied by the Data Provider&lt;br /&gt;//named "test1"&lt;br /&gt;@Test(dataProvider = "test1")&lt;br /&gt;public void verifyData1(String n1, Integer n2) {&lt;br /&gt; System.out.println(n1 + " " + n2);&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;6. Groups:&lt;br /&gt;&lt;br /&gt;You can define groups at the class level and then add groups at the method level. You can also specify groups and methods to be included and excluded.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;@Test(groups = { "checkin-test" })&lt;br /&gt;public class All {&lt;br /&gt;&lt;br /&gt;  @Test(groups = { "func-test" )&lt;br /&gt;  public void method1() { ... }&lt;br /&gt;&lt;br /&gt;  public void method2() { ... }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and then in testng.xml:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;test name="Simple example"&gt;&lt;br /&gt;  &amp;lt;groups&gt;&lt;br /&gt;    &amp;lt;run&gt;&lt;br /&gt;      &amp;lt;include name="checkin-test"/&gt;&lt;br /&gt;      &amp;lt;exclude name="broken"/&gt;&lt;br /&gt;    &amp;lt;/run&gt;&lt;br /&gt;  &amp;lt;/groups&gt;&lt;br /&gt; &lt;br /&gt;  &amp;lt;classes&gt;&lt;br /&gt;    &amp;lt;class name="example1.Test1"&gt;&lt;br /&gt;    &amp;lt;methods&gt;&lt;br /&gt;       &amp;lt;include name="testMethod" /&gt;&lt;br /&gt;    &amp;lt;/methods&gt;&lt;br /&gt;  &amp;lt;/classes&gt;&lt;br /&gt;&amp;lt;/test&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-2528170176091793311?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/2528170176091793311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=2528170176091793311&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2528170176091793311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2528170176091793311'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/12/testng-versus-junit4.html' title='TestNG versus JUnit4'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-4155401369754642673</id><published>2007-12-01T02:10:00.000-05:00</published><updated>2007-12-01T02:56:24.944-05:00</updated><title type='text'>TestNG - java testing framework</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: arial;"&gt;Recently i got introduced to TestNG (version 5.7) at work. I was familiar to JUnit from the past and i kind of knew about the existance of TestNG and that it had improvements over JUnit but i never thought that it will gain so much traction that i will be made to use it soon. Here are some of the features:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style="font-family: arial; text-align: justify;"&gt;&lt;li&gt;JDK 5 Annotations (JDK 1.4 is also supported with JavaDoc annotations).        &lt;/li&gt;&lt;li&gt;Flexible test configuration - using multiple testng XML configuration files one per test suite.        &lt;/li&gt;&lt;li&gt;Support for data-driven testing (with @DataProvider).&lt;/li&gt;&lt;li&gt;Support for parameters - you can pass parameters to test methods from the testng.xml file.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Allows distribution of tests on slave machines - support for parallel execution of tests and methods.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Powerful execution model (no more TestSuite) - test classes are annotated POJOs and don't have to extend any class or implement interface to have test methods.        &lt;/li&gt;&lt;li&gt;Supported by a variety of tools and plug-ins (Eclipse, IDEA, Ant, Maven,        etc...).        &lt;/li&gt;&lt;li&gt;Embeds BeanShell for further flexibility.        &lt;/li&gt;&lt;li&gt;Default JDK functions for runtime and logging (no dependencies).        &lt;/li&gt;&lt;li&gt;Dependent methods for application server testing. - one can specify the dependsOnMethods attribute to the @Test annotation to specify a list of methods that should execute before a certain test method executes. This is a powerful feature and is required for any kind of dependent testing. If a dependent method fails, then all subsequent tests will be &lt;i&gt;skipped&lt;/i&gt;, not marked as failed (unlike JUnit).&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;A good article stating improvements in TestNG over JUnit 4 is found at &lt;a href="http://www.ibm.com/developerworks/java/library/j-cq08296/"&gt;http://www.ibm.com/developerworks/java/library/j-cq08296/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I used TestNG today for the first time and found the framework very easy to use and within a day i had it integrated into our build system and made a presentation to the team about its usage in our project. In this post, i am detailing the steps i performed to start using TestNG:&lt;br /&gt;&lt;br /&gt;1. Wrote a class using just the 3 basic TestNG annotations to start with:&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;@BeforeClass&lt;/li&gt;&lt;li&gt;@Test (groups = {"xyz.groupname"}) - at class level which gets inherited by all public methods in the class.&lt;/li&gt;&lt;li&gt;@AfterClass&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;See &lt;a href="http://testng.org/doc/documentation-main.html#annotations"&gt;http://testng.org/doc/documentation-main.html#annotations&lt;/a&gt; for complete list of supported annotations.&lt;br /&gt;&lt;br /&gt;2. Wrote a master testng.xml which included all project suite-files and was referenced from the ant build script. Also wrote a testng-regression.xml which was imported in the master testng.xml. In the testng-regression.xml, defined the test runs in the suite. Each such testng-xxx.xml file is for xxx named test suite. Each suite can have one or more test runs. Each test runs identifies the class(es) or package(s) to lookup for annotated test methods. Each test run also identifies filter criteria based on groups to include and exclude in the test run. See &lt;a href="http://testng.org/doc/documentation-main.html#testng-xml"&gt;http://testng.org/doc/documentation-main.html#testng-xml&lt;/a&gt; for more on testng.xml.&lt;br /&gt;&lt;br /&gt;One powerful feature i found was the group names could be specified in dot separated (java package name like) notations and follow a hierarchy akin to the Log4j Logger naming hierarchy. So you can use wildcards in the testng.xml to not only include all classes of a group but also include classes from child groups. For example, i could just say xyz.* to include xyz.abc and xyz.def group classes.&lt;br /&gt;&lt;br /&gt;3. Lastly, used the ant build file to call the testng ant task and pass the testng.xml location to it so that testng can execute the tests we wanted. We can have multiple targets defined for different types of tests that we may want to automate. See &lt;a href="http://testng.org/doc/ant.html"&gt;http://testng.org/doc/ant.html &lt;/a&gt;for examples.&lt;br /&gt;&lt;br /&gt;In the latest releases of JUnit 4, it too uses JDK5 annotations and thus makes up for some of the shortcomings that led &lt;a href="http://www.beust.com/weblog/"&gt;Cedric Beust&lt;/a&gt; to develop TestNG framework.&lt;br /&gt;&lt;br /&gt;If you have not had a chance to explore TestNG so far, then i hope after reading this post you will have the good sense to do so now :).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-4155401369754642673?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/4155401369754642673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=4155401369754642673&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/4155401369754642673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/4155401369754642673'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/12/testng-java-testing-framework.html' title='TestNG - java testing framework'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-1919117297283976689</id><published>2007-11-10T04:06:00.000-05:00</published><updated>2007-11-10T04:10:46.609-05:00</updated><title type='text'>Case for Web services with JSON RPC</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;I have recently been working on developing &lt;a href="http://json-rpc.org/wiki/specification"&gt;JSON RPC&lt;/a&gt; based web services (over https) and using Java client. The server side JSONRPC services were developed using the &lt;a href="http://oss.metaparadigm.com/jsonrpc/"&gt;JSON-RPC-Java&lt;/a&gt; and later also using the &lt;a href="http://www.big-llc.com/Wiki.jsp?page=Products.JSONRPCLibrary"&gt;JSON-RPC C&lt;/a&gt; libraries.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The only client side JSON RPC stack in Java that is available at the time of this writing is &lt;a href="http://code.google.com/p/json-rpc-client/"&gt;http://code.google.com/p/json-rpc-client/&lt;/a&gt;. It supports JSON RPC over http (using apache commons httpclient library). It was easily extensible to support JSON RPC over https. In this post, i am going to put down my experiences of using JSON RPC.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;JSON is a fat-free XML. (Read more at http://json.org/xml.html). &lt;/li&gt;&lt;li&gt;JSON RPC is an alternative RPC mechanism over http (or https).&lt;/li&gt;&lt;li&gt;JSON RPC is simpler to learn and implement than SOAP. The stacks are much less lines of code compared to SOAP stacks.&lt;/li&gt;&lt;li&gt;JSON RPC is simple as it does not include an Interface Definition Language like WSDL for SOAP based web services. So there is no contract definition between client and server in a IDL rather contract is defined on paper and then implememted in respective languages of server-side and client-side.&lt;/li&gt;&lt;li&gt;JSON RPC spec is very loosly written and hence leaves alot of room for vendors to come up with their own solutions. Like metaparadig folks have their proprietary way of implementing class hinting (viz the way to identify the class type to the other end so that JSON message can be mapped to a class type and an instance of the class can be created with the passed in values in the JSON stream).&lt;/li&gt;&lt;li&gt;The interoperability between JSON RPC C/C++ service and Java client is limited in following aspects:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;No Java collections can be used. This is same for even SOAP web services. The root cause for this limitation is that the pre JDK 1.5 Java had no generics and hence all collection classes (like ArrayList) could have held more than one Object types so it was hard to tell the type of the element held in the collection. This is solved by proprietary class hinting ismplementations when both client and server are in Java but across languages this becomes an issue. So the solution is to use arrays instead.&lt;/li&gt;&lt;li&gt;Enum types are not supported by the metaparadigm JSON-RPC-Java stack at present as its a newer JDK 1.5 feature. So use int instead.&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Security: Though several approaches may be possible but the simplest solution is to implement JSON RPC over https with basic authentication for client. You may have a self-signed certificate for the web service to keep the deployments simple. But if you really want the most security possible then go for a trusted CA signed certificate for the web service but then you will require a certificate signing infrastructure in place to be able to create a certificate for each instance of web service installed. &lt;/li&gt;&lt;li&gt;JSON RPC spec does not have anything to say about intermediary message handlers but it is easy to think of creating JSON RPC intermediary nodes although the spec does not have provisions for extensible message control headers like SOAP spec has. So JSON RPC is pretty much limited to being used between two nodes (the client and the server) - the message source and the message destination or end point. Its not really meant for "document" style messaging for which SOAP is used in B2B applications.&lt;/li&gt;&lt;/ol&gt;So if you want to build a robust, fat-free (read faster) distributed RPC infrastructure then you can base it on JSON RPC.&lt;br /&gt;&lt;br /&gt;JSON RPC makes most sense in web applications where the client is in Javascript language as JSON maps directly to Javascript objects and hence you dont need to parse the message and extract the data, its done automatically. But other than AJAXing your web pages, you can also use it for straight forward RPC architectures where SOAP may be an overkill. You will have a working JSON RPC solution much sooner and it is of course much easier to comprehend and implement than SOAP. So when you are using SOAP web services with RPC style then think twice as you have an more able alternative approach in JSON RPC.&lt;br /&gt;&lt;br /&gt;Let me know your thoughts by leaving your comments.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-1919117297283976689?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/1919117297283976689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=1919117297283976689&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1919117297283976689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1919117297283976689'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/11/i-have-recently-been-working-on.html' title='Case for Web services with JSON RPC'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-1385964961546823307</id><published>2007-11-06T14:06:00.001-05:00</published><updated>2007-11-06T14:17:08.115-05:00</updated><title type='text'>Using Basic authentication and HTTPS (w/ self-signed certificates) in Java</title><content type='html'>1. Client Authentication is in practice only used for B2B type applications.&lt;br /&gt;2. In some cases we may even be okay with not authenticating the server on the client end during SSL handshake, for sake of: &lt;br /&gt; o simplicity (no certificate signing infrastructure is required) and &lt;br /&gt; o performance (we only use SSL for encryption and not for server authentication). &lt;br /&gt; &lt;br /&gt;This approach is of self-signed certificate which the server can sign for itself and client will by-pass server authentication.&lt;br /&gt;&lt;br /&gt;3. We first need to configure web server for SSL. Tomcat currently operates only on JKS, PKCS11 or PKCS12 format keystores.&lt;br /&gt;4. We can use the JDK keytool to generate self-signed certificate for the host running tomcat as shown below:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ keytool -genkey -alias tomcat -keyalg RSA -keystore example.keystore&lt;br /&gt;Enter keystore password:  secret&lt;br /&gt;Re-enter new password: secret&lt;br /&gt;What is your first and last name?&lt;br /&gt;  [Unknown]:  localhost&lt;br /&gt;What is the name of your organizational unit?&lt;br /&gt;  [Unknown]:  &lt;br /&gt;What is the name of your organization?&lt;br /&gt;  [Unknown]:  &amp;lt;My Company Name&gt;&lt;br /&gt;What is the name of your City or Locality?&lt;br /&gt;  [Unknown]:  &amp;lt;City&gt;&lt;br /&gt;What is the name of your State or Province?&lt;br /&gt;  [Unknown]:  &amp;lt;State&gt;&lt;br /&gt;What is the two-letter country code for this unit?&lt;br /&gt;  [Unknown]:  &amp;lt;Country Code&gt;&lt;br /&gt;Is CN=localhost, OU=Unkown, O=&amp;lt;My Company Name&gt;, L=&amp;lt;City&gt;, ST=&amp;lt;State&gt;, C=&amp;lt;Country&gt; correct?&lt;br /&gt;  [no]:  yes&lt;br /&gt;&lt;br /&gt;Enter key password for &lt;tomcat&gt;&lt;br /&gt;        (RETURN if same as keystore password):  &amp;lt;Enter&gt;&lt;br /&gt;        &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The example.keystore is then generated and is in JKS (Java Key Store) format.&lt;br /&gt;&lt;br /&gt;5. Copy it to the Tomcat root directory say C:\Program Files\Apache Software Foundation\Tomcat 6.0 path.&lt;br /&gt;&lt;br /&gt;6. The final step is to configure your secure socket in the $CATALINA_HOME/conf/server.xml file, where $CATALINA_HOME represents the directory into which you installed Tomcat 6. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;Connector protocol="org.apache.coyote.http11.Http11Protocol"&lt;br /&gt;               port="8443" minSpareThreads="5" maxSpareThreads="75"&lt;br /&gt;               enableLookups="true" disableUploadTimeout="true" &lt;br /&gt;               acceptCount="100"  maxThreads="200"&lt;br /&gt;               scheme="https" secure="true" SSLEnabled="true"&lt;br /&gt;               keystoreFile="./example.keystore" keystorePass="secret"&lt;br /&gt;           clientAuth="false" sslProtocol="TLS"/&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;NOTE: You can refer to the http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html for more configuration options.&lt;br /&gt;&lt;br /&gt;With the above settings you can verify that browsing to https://localhost:8443 returns the splash page of tomcat home. &lt;br /&gt;&lt;br /&gt;7. We will also make sure that tomcat has a role named "manager" and some user associated with the role. We can edit the tomcat_users.xml for that:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version='1.0' encoding='utf-8'?&gt;&lt;br /&gt;&amp;lt;tomcat-users&gt;&lt;br /&gt;  &amp;lt;role rolename="manager"/&gt;&lt;br /&gt;  &amp;lt;user username="admin" password="admin" roles="manager"/&gt;&lt;br /&gt;&amp;lt;/tomcat-users&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;8. Now, we can enforce that a certain URL pattern for our web application always requires https access. To do this, we need to edit the web.xml of the web application:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;security-constraint&gt;&lt;br /&gt; &amp;lt;display-name&gt;some name for service&amp;lt;/display-name&gt;&lt;br /&gt; &amp;lt;web-resource-collection&gt;&lt;br /&gt;     &amp;lt;web-resource-name&gt;My Service&amp;lt;/web-resource-name&gt;&lt;br /&gt;     &amp;lt;description/&gt;&lt;br /&gt;     &amp;lt;url-pattern&gt;/secure/XYZ/*&amp;lt;/url-pattern&gt;&lt;br /&gt;     &amp;lt;http-method&gt;GET&amp;lt;/http-method&gt;&lt;br /&gt;     &amp;lt;http-method&gt;POST&amp;lt;/http-method&gt;&lt;br /&gt;     &amp;lt;http-method&gt;HEAD&amp;lt;/http-method&gt;&lt;br /&gt;     &amp;lt;http-method&gt;PUT&amp;lt;/http-method&gt;&lt;br /&gt;     &amp;lt;http-method&gt;OPTIONS&amp;lt;/http-method&gt;&lt;br /&gt;     &amp;lt;http-method&gt;TRACE&amp;lt;/http-method&gt;&lt;br /&gt;     &amp;lt;http-method&gt;DELETE&amp;lt;/http-method&gt;&lt;br /&gt;&amp;lt;/web-resource-collection&gt;&lt;br /&gt;&amp;lt;auth-constraint&gt;&lt;br /&gt;     &amp;lt;role-name&gt;manager&amp;lt;/role-name&gt;&lt;br /&gt; &amp;lt;/auth-constraint&gt;&lt;br /&gt; &amp;lt;user-data-constraint&gt;&lt;br /&gt;     &amp;lt;description/&gt;&lt;br /&gt;     &amp;lt;transport-guarantee&gt;CONFIDENTIAL&amp;lt;/transport-guarantee&gt;&lt;br /&gt; &amp;lt;/user-data-constraint&gt;&lt;br /&gt;&amp;lt;/security-constraint&gt;&lt;br /&gt;&amp;lt;login-config&gt;&lt;br /&gt; &amp;lt;auth-method&gt;BASIC&amp;lt;/auth-method&gt;&lt;br /&gt; &amp;lt;realm-name&gt;MY_SECURE_REALM&amp;lt;/realm-name&gt;&lt;br /&gt;&amp;lt;/login-config&gt;&lt;br /&gt;&amp;lt;security-role&gt;&lt;br /&gt; &amp;lt;description&gt;manager api can use this role.&amp;lt;/description&gt;&lt;br /&gt; &amp;lt;role-name&gt;manager&amp;lt;/role-name&gt;&lt;br /&gt;&amp;lt;/security-role&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;With the above configuration, we have Basic authentication and HTTPS enabled for all resources accessed by the URL pattern /secure/XYZ/*.&lt;br /&gt;&lt;br /&gt;So even if you try to access the resource at /secure/XYZ/* using http then tomcat will redirect you to the page using https scheme and thus enforce secure use. Since we also use the Basic authentication so browser client will prompt you entering user credentials. &lt;br /&gt;&lt;br /&gt;9. If you are using API based http client access from say a J2SE client (using apache commons httpclient 3.x) then you will need to set the credentials for the realm MY_SECURE_REALM (which defines the Authentication Scope on the web server) in the Http header.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;HttpState state = new HttpState();&lt;br /&gt;state.setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, &lt;br /&gt;"MY_SECURE_REALM"), new UsernamePasswordCredentials(user, passwd));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Also you will need to use the org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory to be able to by-pass the agent authentication on client side. Apache commons httpclient comes with this contrib code which is included with the source distro but is not bundled in the jar file. So you will need to pull the source out from contrib/ssl path and use it in your project.&lt;br /&gt;&lt;br /&gt;Basically you will need to check if the uri in use has scheme type of https then associate the EasySSLProtocolSocketFactory as the protocol handler for the scheme.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if (uri.getScheme().equals("https")) {&lt;br /&gt; Protocol easyhttps = new Protocol(uri.getScheme(), new EasySSLProtocolSocketFactory(), uri.getPort());&lt;br /&gt;&lt;br /&gt; Protocol.registerProtocol("https", easyhttps);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The way it works is, EasySSLProtocolSocketFactory in turn uses the EasyX509TrustManager (again from contrib/ssl) to just do a agent certificate validity from and to time validation (so that the ceritificate is not expired and is not before the validity start date). As long as the certificate in use by the agent is valid the EasyX509TrustManager will be okay to bypass doing any authentication for the self-signed certificate for the agent.&lt;br /&gt;&lt;br /&gt;That completes the simple discourse on how to use Basic authentication with HTTPS (using self-signed certificate for the server end).&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-1385964961546823307?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/1385964961546823307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=1385964961546823307&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1385964961546823307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1385964961546823307'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/11/using-basic-authentication-and-https-w.html' title='Using Basic authentication and HTTPS (w/ self-signed certificates) in Java'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-7655264632033328479</id><published>2007-10-26T16:45:00.000-04:00</published><updated>2007-10-27T00:33:07.063-04:00</updated><title type='text'>Salient points about log4j</title><content type='html'>0. Log4j has three main components: loggers, appenders and layouts.&lt;br /&gt;&lt;br /&gt;1. Loggers are named entities which follow hierarchical naming.&lt;br /&gt;2. A logger is said to be an ancestor of another logger if its name followed by a dot is a prefix of the descendant logger name. A logger is said to be a parent of a child logger if there are no ancestors between itself and the descendant logger. For example, the logger named "com.foo" is a parent of the logger named "com.foo.Bar".&lt;br /&gt;3. The root logger resides at the top of the logger hierarchy. It is exceptional in two ways:&lt;br /&gt;&lt;br /&gt;  1. it always exists,&lt;br /&gt;  2. it cannot be retrieved by name.&lt;br /&gt;Invoking the class static Logger.getRootLogger method retrieves it.&lt;br /&gt;4. Loggers may be assigned levels. The set of possible levels, that is:&lt;br /&gt;&lt;br /&gt;TRACE,&lt;br /&gt;DEBUG,&lt;br /&gt;INFO,&lt;br /&gt;WARN,&lt;br /&gt;ERROR and&lt;br /&gt;FATAL&lt;br /&gt;&lt;br /&gt;are defined in the org.apache.log4j.Level class.&lt;br /&gt;&lt;br /&gt;5. The inherited level for a given logger C, is equal to the first non-null level in the logger hierarchy, starting at C and proceeding upwards in the hierarchy towards the root logger.&lt;br /&gt;&lt;br /&gt;6. Here are the basic Logger class methods:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package org.apache.log4j;&lt;br /&gt;&lt;br /&gt;public class Logger {&lt;br /&gt;&lt;br /&gt;   // Creation &amp;amp; retrieval methods:&lt;br /&gt;   public static Logger getRootLogger();&lt;br /&gt;   public static Logger getLogger(String name);&lt;br /&gt;&lt;br /&gt;   // printing methods:&lt;br /&gt;   public void trace(Object message);&lt;br /&gt;   public void debug(Object message);&lt;br /&gt;   public void info(Object message);&lt;br /&gt;   public void warn(Object message);&lt;br /&gt;   public void error(Object message);&lt;br /&gt;   public void fatal(Object message);&lt;br /&gt;&lt;br /&gt;   // generic printing method:&lt;br /&gt;   public void log(Level l, Object message);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;7. A logging request is said to be enabled if its level is higher than or equal to the level of its logger.&lt;br /&gt;&lt;br /&gt;A log request of level p in a logger with (either assigned or inherited, whichever is appropriate) level q, is enabled if  p &gt;= q.&lt;br /&gt;&lt;br /&gt;This rule is at the heart of log4j. It assumes that levels are ordered. For the standard levels, we have DEBUG &lt; INFO &lt; WARN &lt; ERROR &lt; FATAL.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   // get a logger instance named "com.foo"&lt;br /&gt;   Logger  logger = Logger.getLogger("com.foo");&lt;br /&gt;&lt;br /&gt;   // Now set its level. Normally you do not need to set the&lt;br /&gt;   // level of a logger programmatically. This is usually done&lt;br /&gt;   // in configuration files.&lt;br /&gt;   logger.setLevel(Level.INFO);&lt;br /&gt;&lt;br /&gt;   Logger barlogger = Logger.getLogger("com.foo.Bar");&lt;br /&gt;&lt;br /&gt;   // This request is enabled, because WARN &gt;= INFO.&lt;br /&gt;   logger.warn("Low fuel level.");&lt;br /&gt;&lt;br /&gt;   // This request is disabled, because DEBUG &lt; INFO.&lt;br /&gt;   logger.debug("Starting search for nearest gas station.");&lt;br /&gt;&lt;br /&gt;   // The logger instance barlogger, named "com.foo.Bar",&lt;br /&gt;   // will inherit its level from the logger named&lt;br /&gt;   // "com.foo" Thus, the following request is enabled&lt;br /&gt;   // because INFO &gt;= INFO.&lt;br /&gt;   barlogger.info("Located nearest gas station.");&lt;br /&gt;&lt;br /&gt;   // This request is disabled, because DEBUG &lt; INFO.&lt;br /&gt;   barlogger.debug("Exiting gas station search");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;8. In fundamental contradiction to biological parenthood, where parents always preceed their children, log4j loggers can be created and configured in any order. In particular, a "parent" logger will find and link to its descendants even if it is instantiated after them.&lt;br /&gt;&lt;br /&gt;9. Log4j makes it easy to name loggers by software component. This can be accomplished by statically instantiating a logger in each class, with the logger name equal to the fully qualified name of the class. This is a useful and straightforward method of defining loggers. As the log output bears the name of the generating logger, this naming strategy makes it easy to identify the origin of a log message. The developer is free to name the loggers as desired.Nevertheless, naming loggers after the class where they are located seems to be the best strategy known so far.&lt;br /&gt;&lt;br /&gt;10. Log4j allows logging requests to print to multiple destinations. In log4j speak, an output destination is called an appender.&lt;br /&gt;&lt;br /&gt;Currently, appenders exist for the console, files, GUI components, remote socket servers, JMS,  NT Event Loggers, and remote UNIX Syslog daemons. It is also possible to log asynchronously.&lt;br /&gt;&lt;br /&gt;11. More than one appender can be attached to a logger.&lt;br /&gt;&lt;br /&gt;The addAppender method adds an appender to a given logger.&lt;br /&gt;&lt;br /&gt;12. Each enabled logging request for a given logger will be forwarded to all the appenders in that logger as well as the appenders higher in the hierarchy.&lt;br /&gt;&lt;br /&gt;In other words, appenders are inherited additively from the logger hierarchy. For example, if a console appender is added to the root logger, then all enabled logging requests will at least print on the console. If in addition a file appender is added to a logger, say C, then enabled logging requests for C and C's children will print on a file and on the console.&lt;br /&gt;&lt;br /&gt;It is possible to override this default behavior so that appender accumulation is no longer additive by setting the additivity flag to false.&lt;br /&gt;&lt;br /&gt;13.The layout is responsible for formatting the logging request according to the user's wishes, whereas an appender takes care of sending the formatted output to its destination.&lt;br /&gt;&lt;br /&gt;The PatternLayout, part of the standard log4j distribution, lets the user specify the output format according to conversion patterns similar to the C language printf function.&lt;br /&gt;&lt;br /&gt;See the conversion characters to use in the link below:&lt;br /&gt;http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html&lt;br /&gt;&lt;br /&gt;For example, the PatternLayout with the conversion pattern "%r [%t] %-5p %c - %m%n" will output something akin to:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;176 [main] INFO  org.foo.Bar - Located nearest gas station.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The first field is the number of milliseconds elapsed since the start of the program.&lt;br /&gt;The second field is the thread making the log request.&lt;br /&gt;The third field is the level of the log statement.&lt;br /&gt;The fourth field is the name of the logger associated with the log request.&lt;br /&gt;The text after the '-' is the message of the statement.&lt;br /&gt;&lt;br /&gt;14. To use log4j by reading the configuration from a properties file:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import com.foo.Bar;&lt;br /&gt;&lt;br /&gt;import org.apache.log4j.Logger;&lt;br /&gt;import org.apache.log4j.PropertyConfigurator;&lt;br /&gt;&lt;br /&gt;public class MyApp {&lt;br /&gt;&lt;br /&gt;  static Logger logger = Logger.getLogger(MyApp.class.getName());&lt;br /&gt;&lt;br /&gt;  public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    // BasicConfigurator replaced with PropertyConfigurator.&lt;br /&gt;    PropertyConfigurator.configure(args[0]);&lt;br /&gt;&lt;br /&gt;    logger.info("Entering application.");&lt;br /&gt;    Bar bar = new Bar();&lt;br /&gt;    bar.doIt();&lt;br /&gt;    logger.info("Exiting application.");&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And a sample configuration file:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;log4j.rootLogger=DEBUG, A1&lt;br /&gt;log4j.appender.A1=org.apache.log4j.ConsoleAppender&lt;br /&gt;log4j.appender.A1.layout=org.apache.log4j.PatternLayout&lt;br /&gt;&lt;br /&gt;# Print the date in ISO 8601 format&lt;br /&gt;log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n&lt;br /&gt;&lt;br /&gt;# Print only messages of level WARN or above in the package com.foo.&lt;br /&gt;log4j.logger.com.foo=WARN&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Example output:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;2000-09-07 14:07:41,508 [main] INFO  MyApp - Entering application.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will only print warn, error or fatal but not info, debug or trace messages for all components inheriting from com.foo logger name hierarchy.&lt;br /&gt;&lt;br /&gt;Example using multiple appenders:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;log4j.rootLogger=debug, stdout, R&lt;br /&gt;&lt;br /&gt;log4j.appender.stdout=org.apache.log4j.ConsoleAppender&lt;br /&gt;log4j.appender.stdout.layout=org.apache.log4j.PatternLayout&lt;br /&gt;&lt;br /&gt;# Pattern to output the caller's file name and line number.&lt;br /&gt;log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n&lt;br /&gt;&lt;br /&gt;log4j.appender.R=org.apache.log4j.RollingFileAppender&lt;br /&gt;log4j.appender.R.File=example.log&lt;br /&gt;&lt;br /&gt;log4j.appender.R.MaxFileSize=100KB&lt;br /&gt;# Keep one backup file&lt;br /&gt;log4j.appender.R.MaxBackupIndex=1&lt;br /&gt;&lt;br /&gt;log4j.appender.R.layout=org.apache.log4j.PatternLayout&lt;br /&gt;log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Example output:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;INFO [main] (MyApp2.java:12) - Entering application.&lt;br /&gt;DEBUG [main] (Bar.java:8) - Doing it again!&lt;br /&gt;INFO [main] (MyApp2.java:15) - Exiting application.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;15. Under certain well-defined circumstances however, the static inializer of the Logger class will attempt to automatically configure log4j.&lt;br /&gt;&lt;br /&gt;The exact default initialization algorithm is defined as follows:&lt;br /&gt;&lt;br /&gt;  1. Setting the log4j.defaultInitOverride system property to any other value then "false" will cause log4j to skip the default initialization procedure (this procedure).&lt;br /&gt;  2. Set the resource string variable to the value of the log4j.configuration system property. The preferred way to specify the default initialization file is through the log4j.configuration system property. In case the system property log4j.configuration is not defined, then set the string variable resource to its default value "log4j.properties".&lt;br /&gt;  3. Attempt to convert the resource variable to a URL.&lt;br /&gt;  4. If the resource variable cannot be converted to a URL, for example due to a MalformedURLException, then search for the resource from the classpath by calling org.apache.log4j.helpers.Loader.getResource(resource, Logger.class) which returns a URL. Note that the string "log4j.properties" constitutes a malformed URL. See Loader.getResource(java.lang.String) for the list of searched locations.&lt;br /&gt;  5. If no URL could not be found, abort default initialization. Otherwise, configure log4j from the URL. The PropertyConfigurator will be used to parse the URL to configure log4j unless the URL ends with the ".xml" extension, in which case the DOMConfigurator will be used. You can optionaly specify a custom configurator. The value of the log4j.configuratorClass system property is taken as the fully qualified class name of your custom configurator. The custom configurator you specify must implement the Configurator interface.&lt;br /&gt; &lt;br /&gt;Under Tomcat 3.x and 4.x, you should place the log4j.properties under the WEB-INF/classes directory of your web-applications. Log4j will find the properties file and initialize itself. This is easy to do and it works.&lt;br /&gt;&lt;br /&gt;Generally one would want to have the flexibility to choose between different logging implementations. In that case, one can use apache commons logging which provides similar interface as Log4J's described above (only it calls it Logger as Log and uses a LogFactory.getLog() to get the named Log instance) but comes with adapters for several other logging implementations in Java (Avalon, JDK's Logging etc).&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-7655264632033328479?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/7655264632033328479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=7655264632033328479&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7655264632033328479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/7655264632033328479'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/10/salient-points-about-log4j.html' title='Salient points about log4j'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-2225278826575965922</id><published>2007-09-03T14:13:00.000-04:00</published><updated>2007-09-06T13:15:08.374-04:00</updated><title type='text'>EJB 3.0 with JBoss 4.2.1 GA and Netbeans IDE 5.5.1</title><content type='html'>I have started to read &lt;a href="http://www.amazon.com/Enterprise-JavaBeans-3-0-Bill-Burke/dp/059600978X/ref=pd_bbs_1/105-4755089-0258040?ie=UTF8&amp;s=books&amp;qid=1188845793&amp;sr=1-1"&gt;O'reilly's EJB 3.0 5th Edition&lt;/a&gt; by Bill Burke and Richard Monson-Haefel. The book covers &lt;a href="http://jcp.org/en/jsr/detail?id=220"&gt;EJB 3.0&lt;/a&gt; and &lt;a href="http://jcp.org/en/jsr/detail?id=220"&gt;Java Persistence 1.0&lt;/a&gt; in detail. It comes with a JBoss workbook for JBoss 4.0.3 release. I installed the current stable release JBoss 4.2.1 GA for my practice. Unlike the 4.0.x releases, the JBoss 4.2.x release has the EJB 3 enabled by default. I used &lt;a href="http://www.jboss.com/products/jbossnetbeans"&gt;Netbeans&lt;/a&gt; 5.5.1 IDE for development. It supports JBoss 4.x and even 5.x (which is still in beta). It readily recognized my JBoss 4.2.1 installation in the server manager. I created a project as Enterprise Application (with both web and ejb modules). The persistence configuration was simple and i used the default datasource HSQL DB 1.8. &lt;br /&gt;&lt;br /&gt;There were some gotchas before i could get chapter 4 "Developing your first bean" examples working:&lt;br /&gt;1. one has to change this "DefaultDS" to "java:/DefaultDS" in the META-INF/persistence.xml of your ejb module.&lt;br /&gt;2. also, in the client application, you will need to reference the "TravelAgentBean/remote" as "&amp;lt;Your EAR application name&amp;gt;/TravelAgentBean/remote". To be sure as to where in the jndi tree has your session bean got registered, you can browse to jmx-console (http://localhost:8080/jmx-console) and look for "service=JNDIView". Click on the link and in the following page, invoke the method list() to see the list of names in the JNDI tree. From there you can know for sure what name to use for lookup at client end for your session facade.&lt;br /&gt;3. lastly, i had mistakenly had my entity bean's id annotated as @GeneratedValue in which case when i used to call the setId() method in my session facade bean, then it used to throw an exception while persisting using EntityManager's persist() that the entity instance is detached one. So, i could either remove the annotation of generated value or don't set the id.&lt;br /&gt;4. at client end, there is no need for PortableRemoteObject.narrow() method anymore. You can simply use Java casting. &lt;br /&gt;&lt;br /&gt;For my simple example, i did not have to pass the JNDI bootstrap params as properties instance to InitialContext() constructor.&lt;br /&gt;&lt;br /&gt;Eclipse 3.3 (Europa) has a very nice OR mapping tool called &lt;a href="http://www.eclipse.org/webtools/dali/main.php"&gt;Dali&lt;/a&gt;, but i am yet to figure out how to make it work for me (basically if i don't have the corresponding table already created in the DB, then Eclipse is unable to map the Entity type's members to columns in the database table and so far i dont know how to turn that error off. With Netbeans i did not get that issue and when i first ran my application the table was automatically created by hibernate as i declared it to do so by setting hibernate property hibernate.hbm2ddl.auto with value "update"). Europa release supports JBoss 4.2.x release. Red Hat is also developing a &lt;a href="http://www.redhat.com/developers/rhds/index.html"&gt;comprehensive IDE&lt;/a&gt; solution for JBoss in partnership with &lt;a href="http://www.exadel.com/web/portal/products/ExadelStudioPro"&gt;Exadel &lt;/a&gt;to facilitate easier Rich web application development.&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-2225278826575965922?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/2225278826575965922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=2225278826575965922&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2225278826575965922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2225278826575965922'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/09/ejb-30-with-jboss-421-ga-and-netbeans.html' title='EJB 3.0 with JBoss 4.2.1 GA and Netbeans IDE 5.5.1'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-4650380656382067603</id><published>2007-08-17T21:10:00.000-04:00</published><updated>2007-08-17T21:13:20.798-04:00</updated><title type='text'>My SCDJWS Study Notes using Scribd</title><content type='html'>&lt;object height="500" width="450"&gt;&lt;param name="allowScriptAccess" value="SameDomain"&gt;&lt;param name="movie" value="http://static.scribd.com/FlashPaperS3.swf?guid=4c46k41945c3o&amp;document_id=247878"&gt;&lt;embed src="http://static.scribd.com/FlashPaperS3.swf?guid=4c46k41945c3o&amp;amp;document_id=247878" type="application/x-shockwave-flash" height="900" width="800"&gt;&lt;/embed&gt; &lt;/object&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-4650380656382067603?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/4650380656382067603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=4650380656382067603&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/4650380656382067603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/4650380656382067603'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/08/my-scdjws-study-notes-using-scribd.html' title='My SCDJWS Study Notes using Scribd'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-6416046208585675000</id><published>2007-07-25T23:05:00.001-04:00</published><updated>2007-07-25T23:45:54.043-04:00</updated><title type='text'>My new Honda Element 2007</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_qVBiMGte-S0/RqgY4ctDj2I/AAAAAAAABQc/npAyFh8TkfM/s1600-h/DSC00611.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_qVBiMGte-S0/RqgY4ctDj2I/AAAAAAAABQc/npAyFh8TkfM/s200/DSC00611.JPG" alt="" id="BLOGGER_PHOTO_ID_5091346736799256418" border="0" /&gt;&lt;/a&gt;I recently bought a &lt;a href="http://automobiles.honda.com/element/"&gt;Honda Element&lt;/a&gt; 2007 compact SUV and after having driven it today for a week, i feel a very satisfied owner of my first 4 wheeler vehicle ever. This model of SUV is unique with capacity to seat only 4 passengers and the doors are wide-opening clamshell type with no pillar between the front and back seats (but one has to first open the front doors to be able to open the back doors). Other auto makers also have SUVs of similar kind like Toyota’s &lt;a href="http://en.wikipedia.org/wiki/FJ_Cruiser"&gt;FJ Cruiser&lt;/a&gt; and Nissan’s &lt;a href="http://en.wikipedia.org/wiki/Nissan_Xterra"&gt;Xterra&lt;/a&gt;. The mileage is 21mpg in city and 26mpg on highway (which is decent compared to other compact SUV’s). The engine is 166 hp and its a 4 wheel drive vehicle. It comes fully loaded with power window, mirror, steering and doors. There is a AM/FM/CD player and a skylight glass top. The thing which i loved about my new Element is its very spacious (alot of leg room and room for cargo). With wide opening doors, loading cargo is easy (as there is no pillar between seats). The rear seats can be folded to the sides too thus making extra space for cargo. Also the look is off beat and trendy (in my opinion). &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-6416046208585675000?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/6416046208585675000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=6416046208585675000&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6416046208585675000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/6416046208585675000'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/07/my-new-honda-element-2007.html' title='My new Honda Element 2007'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_qVBiMGte-S0/RqgY4ctDj2I/AAAAAAAABQc/npAyFh8TkfM/s72-c/DSC00611.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-1668222759219708606</id><published>2007-06-17T20:38:00.000-04:00</published><updated>2007-07-01T11:45:01.670-04:00</updated><title type='text'>Charting the web with Cewolf/JFreeChart - Producing Time Series plots</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://cewolf.sourceforge.net/new/img/examplexy.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px;" src="http://cewolf.sourceforge.net/new/img/examplexy.png" alt="" border="0" /&gt;&lt;/a&gt;I recently had an opportunity to use the &lt;a href="http://cewolf.sourceforge.net/new/index.html"&gt;Cewolf&lt;/a&gt; 1.0 at work for some Time Series plots (a variant of the XY Chart, shown in the figure above,  where the X-axis is for time values). This blog is about Cewolf and how to create time series plots with it.&lt;br /&gt;&lt;br /&gt;Cewolf is a JSP tag library which uses &lt;a href="http://www.jfree.org/jfreechart/"&gt;JFreeChart &lt;/a&gt;for rendering the charts. It comes with a controller servlet which is used for interpreting the parameters passed through the JSP tag and accordingly generating the chart image in-memory (no files created on the file system of the server) and embeds the image as &lt;img&gt; tag in the HTML output to the client response stream.&lt;br /&gt;&lt;br /&gt;IMO, Cewolf/JFreeChart is the best free charting package for a web application required to draw charts and being developed in Java EE. It supports several different types of charts and one of them was the Time Series plots. Here is some code which can produce a simple time series plot (using cewolf).&lt;br /&gt;&lt;br /&gt;1. To install Cewolf you just need to copy the jars from its lib/  path (which includes the JFreeChart jar too) to WEB-INF/lib of your web application.&lt;br /&gt;&lt;br /&gt;2. We need to write a data producer which gets the data set (in {time, value} pairs for the time series plot).  A typical time series data producer is given below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;//~--- non-JDK imports --------------------------------------------------------&lt;br /&gt;&lt;br /&gt;import de.laures.cewolf.DatasetProduceException;&lt;br /&gt;import de.laures.cewolf.DatasetProducer;&lt;br /&gt;&lt;br /&gt;import org.jfree.data.time.Minute;&lt;br /&gt;import org.jfree.data.time.TimeSeries;&lt;br /&gt;import org.jfree.data.time.TimeSeriesCollection;&lt;br /&gt;&lt;br /&gt;//~--- JDK imports ------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;import java.io.Serializable;&lt;br /&gt;&lt;br /&gt;import java.util.Date;&lt;br /&gt;import java.util.Map;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * A sample data producer for the time series plot.&lt;br /&gt;*/&lt;br /&gt;public class MyDataProducer implements DatasetProducer, Serializable&lt;br /&gt;{&lt;br /&gt;    public MyDataProducer()&lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public Object produceDataset(Map map) throws DatasetProduceException&lt;br /&gt;    {&lt;br /&gt;        /*&lt;br /&gt;         *   To this time series collection we can add more than one time series&lt;br /&gt;         *   where each time series will be represented by its own line on a&lt;br /&gt;         *   plot.&lt;br /&gt;         */&lt;br /&gt;        TimeSeriesCollection ts = new TimeSeriesCollection();&lt;br /&gt;&lt;br /&gt;        try {&lt;br /&gt;            String[] allSeries = { "series1", "series2" };&lt;br /&gt;&lt;br /&gt;            // Loop through all series and add the data to series and series to&lt;br /&gt;            // timeseries collection (ts).&lt;br /&gt;            for (int i = 0; i &lt; allSeries.length; i++) {&lt;br /&gt;&lt;br /&gt;                // Get data for series from some kind of datasource&lt;br /&gt;                MyDataSet[] myDataSet = GetDataForSeries(allSeries[i]);&lt;br /&gt;                TimeSeries  mySeries  = new TimeSeries("My Data Series " + i, Minute.class);&lt;br /&gt;&lt;br /&gt;                // Add data to series&lt;br /&gt;                for (MyDataSet data : myDataSet) {&lt;br /&gt;                    mySeries.add(new Minute(new Date(data.getTimestamp().getTime())), data.getYValue());&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                // Add the series to the collection&lt;br /&gt;                ts.addSeries(mySeries);&lt;br /&gt;            }&lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;&lt;br /&gt;            throw new DatasetProduceException();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return ts;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public boolean hasExpired(Map map, Date date)&lt;br /&gt;    {&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public String getProducerId()&lt;br /&gt;    {&lt;br /&gt;        return "My Data Producer";&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private MyDataSet[] GetDataForSeries(String string)&lt;br /&gt;    {&lt;br /&gt;        // Get data from DB or some data source&lt;br /&gt;        // return an array of time/value pairs (for instance, as an array&lt;br /&gt;        // of MyDataSet instances.       &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;MyDataSet class is:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.sql.Timestamp;&lt;br /&gt;&lt;br /&gt;/** A sample time/value pair data. An array/list of this type will constitute&lt;br /&gt; * the data set for the plot.&lt;br /&gt;*/&lt;br /&gt;public class MyDataSet&lt;br /&gt;{&lt;br /&gt;    private Timestamp timestamp; // You can use other date/time types in Java SE here.&lt;br /&gt;    private double    yValue;&lt;br /&gt;&lt;br /&gt;    public MyDataSet()&lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public Timestamp getTimestamp() {&lt;br /&gt;        return timestamp;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void setTimestamp(Timestamp timestamp) {&lt;br /&gt;        this.timestamp = timestamp;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public double getYValue() {&lt;br /&gt;        return yValue;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void setYValue(double yValue) {&lt;br /&gt;        this.yValue = yValue;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In the JSP page you include the chart now:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;jsp:usebean id="myPlotData" class="com.mycompany.MyDataProducer"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;cewolf:chart&lt;br /&gt;    id="MyChart"&lt;br /&gt;    type="timeseries"&lt;br /&gt;    title="My Plot Title"&lt;br /&gt;    xaxislabel="Time"&lt;br /&gt;    yaxislabel="My Data Value"&gt;&lt;br /&gt;    &amp;lt;cewolf:data&amp;gt;&lt;br /&gt;    &amp;lt;cewolf:producer id="myPlotData" usecache="false"&amp;gt;&lt;br /&gt;    &amp;lt;/cewolf:data&amp;gt;&lt;br /&gt;&amp;lt;/cewolf:chart&amp;gt;&lt;br /&gt;&amp;lt;cewolf:img chartid="MyChart" renderer="/cewolf" width="1000" height="400"&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Lastly, one needs to configure the CewolfServlet in the web.xml:&lt;br /&gt;&lt;pre&gt;&amp;lt;servlet&amp;gt;&lt;br /&gt;   &amp;lt;servlet-name&amp;gt;CewolfServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;   &amp;lt;servlet-class&amp;gt;de.laures.cewolf.CewolfRenderer&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;&amp;lt;/servlet&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;   &amp;lt;servlet-name&amp;gt;CewolfServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt; &amp;lt;url-pattern&amp;gt;/cewolf/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;&amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The generated charts on tomcat does require one to increase the JVM heap size to at least 256MB from the default 64MB.&lt;br /&gt;&lt;br /&gt;The pros of using Cewolf/JFreeChart in a Java EE web application:&lt;br /&gt;1. Compared to the other &lt;a href="http://www.jfree.org/jfreechart/faq.html#FAQ13"&gt;open source packages&lt;/a&gt;, JFreeChart happens to be the best in terms of the look and feel of the plots and the ease of use of the API.&lt;br /&gt;2. Cewolf contributes to the glory by making the JFreeChart available as JSP tag library. And as far as i know, there isn't any other better option for plotting in the open source Java world.&lt;br /&gt;&lt;br /&gt;The duo of Cewolf/JFreeChart are lacking in a few important features:&lt;br /&gt;1. AJAX support for real-time plots. So if we want the server to be able to asynchronously (or by the virtue of some background polling from client) refresh the chart in (near) real-time then its not something supported today in Cewolf/JFreeChart. If this feature is required then JViews Charts or Chart Director are the two commercial offerings that i know of that can do AJAX based live charts.&lt;br /&gt;2. Zoom and Pan interactions are not easily supported by the API.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-1668222759219708606?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/1668222759219708606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=1668222759219708606&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1668222759219708606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1668222759219708606'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/06/charting-web-with-cewolfjfreechart.html' title='Charting the web with Cewolf/JFreeChart - Producing Time Series plots'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-2343911438796549933</id><published>2007-06-10T01:55:00.001-04:00</published><updated>2007-06-17T19:39:56.885-04:00</updated><title type='text'>Working with JMaki</title><content type='html'>&lt;div style="text-align: justify;"&gt;I recently had an opportunity to use some of the &lt;a href="https://ajax.dev.java.net/"&gt;JMaki UI components&lt;/a&gt; and it took me some googling to figure out how to pass data dynamically (which is what most of the time you will want and unfortunately all examples use some static data in the JSON format) to the UI components. JMaki's integration with Netbeans makes it really simple to have those nice Web UI components working for you in a jiffy (like grid, tree, menu, captcha, autocomplete etc). Though i am a big fan of DWR (having used the reverse ajax in DWR 2.0 for an event browser application to show events in real-time) for Ajax support in my work, i did like the Ajax-enabled UI Components that come with JMaki. Another nice thing about JMaki is, it provides a common data model for multiple implementations of a certain UI component. For example, you have a Yahoo UI Tree and a dojo toolkit tree component. Since JMaki provides the abstraction by keeping the data models same for both these tree components, so we have the option to switch between these implementations with almost no change to code.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Now going back to the point (the reason i am writing this post after all) ... the JMaki components accept data dynamically in JSON format and though one can create the JSON format string to pass as value attributes to the widgets, it becomes cumbersome for widgets like trees or grid to escape the quotes and construct the strings. To make our lives easy in constructing the JSON formatted dynamic data, JMaki comes bundled with org.json.* classes (JSONObject, JSONArray etc) using which one can create the data to pass in an elegant and maintainable way. You will need to convert the JSONObject or JSONArray types to their Object literal form using the following code which Greg Murray (JMaki project manager) released in reply to one post on JMaki users forum:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Converts a JSON Object to an Object Literal&lt;br /&gt;     *&lt;br /&gt;     *&lt;br /&gt;     * @param jo&lt;br /&gt;     * @param buff&lt;br /&gt;     *&lt;br /&gt;     * @return&lt;br /&gt;     *&lt;br /&gt;     * @throws JSONException&lt;br /&gt;     */&lt;br /&gt;    public static String jsonToObjectLiteral(JSONObject jo, StringBuffer buff)&lt;br /&gt;            throws JSONException&lt;br /&gt;    {&lt;br /&gt;        if (buff == null) {&lt;br /&gt;            buff = new StringBuffer("{");&lt;br /&gt;        } else {&lt;br /&gt;            buff.append("{");&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        JSONArray names = jo.names();&lt;br /&gt;&lt;br /&gt;        for (int l = 0; (names != null) &amp;&amp; (l &lt; names.length()); l++) {&lt;br /&gt;            String key   = names.getString(l);&lt;br /&gt;            String value = null;&lt;br /&gt;&lt;br /&gt;            if (jo.optJSONObject(key) != null) {&lt;br /&gt;                value = key + ":";&lt;br /&gt;                buff.append(value);&lt;br /&gt;                jsonToObjectLiteral(jo.optJSONObject(key), buff);&lt;br /&gt;            } else if (jo.optJSONArray(key) != null) {&lt;br /&gt;                value = key + ":";&lt;br /&gt;                buff.append(value);&lt;br /&gt;                jsonArrayToString(jo.optJSONArray(key), buff);&lt;br /&gt;            } else if (jo.optLong(key, -1) != -1) {&lt;br /&gt;                value = key + ":" + jo.get(key) + "";&lt;br /&gt;                buff.append(value);&lt;br /&gt;            } else if (jo.optDouble(key, -1) != -1) {&lt;br /&gt;                value = key + ":" + jo.get(key) + "";&lt;br /&gt;                buff.append(value);&lt;br /&gt;            } else if (jo.opt(key) != null) {&lt;br /&gt;                Object obj = jo.opt(key);&lt;br /&gt;&lt;br /&gt;                if (obj instanceof Boolean) {&lt;br /&gt;                    value = key + ":" + jo.getBoolean(key) + "";&lt;br /&gt;                } else {&lt;br /&gt;                    value = key + ":" + "'" + jo.get(key) + "'";&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                buff.append(value);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            if (l &lt; names.length() - 1) {&lt;br /&gt;                buff.append(",");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        buff.append("}");&lt;br /&gt;&lt;br /&gt;        return buff.toString();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Converts a json array to string.&lt;br /&gt;     *&lt;br /&gt;     *&lt;br /&gt;     * @param ja&lt;br /&gt;     * @param buff&lt;br /&gt;     *&lt;br /&gt;     * @return&lt;br /&gt;     *&lt;br /&gt;     * @throws JSONException&lt;br /&gt;     */&lt;br /&gt;    public static String jsonArrayToString(JSONArray ja, StringBuffer buff)&lt;br /&gt;            throws JSONException&lt;br /&gt;    {&lt;br /&gt;        if (buff == null) {&lt;br /&gt;            buff = new StringBuffer("[");&lt;br /&gt;        } else {&lt;br /&gt;            buff.append("[");&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        for (int key = 0; (ja != null) &amp;&amp; (key &lt; ja.length()); key++) {&lt;br /&gt;            String value = null;&lt;br /&gt;&lt;br /&gt;            if (ja.optJSONObject(key) != null) {&lt;br /&gt;                jsonToObjectLiteral(ja.optJSONObject(key), buff);&lt;br /&gt;            } else if (ja.optJSONArray(key) != null) {&lt;br /&gt;                jsonArrayToString(ja.optJSONArray(key), buff);&lt;br /&gt;            } else if (ja.optLong(key, -1) != -1) {&lt;br /&gt;                value = ja.get(key) + "";&lt;br /&gt;                buff.append(value);&lt;br /&gt;            } else if (ja.optDouble(key, -1) != -1) {&lt;br /&gt;                value = ja.get(key) + "";&lt;br /&gt;                buff.append(value);&lt;br /&gt;            } else if (ja.optBoolean(key)) {&lt;br /&gt;                value = ja.getBoolean(key) + "";&lt;br /&gt;                buff.append(value);&lt;br /&gt;            } else if (ja.opt(key) != null) {&lt;br /&gt;                Object obj = ja.opt(key);&lt;br /&gt;&lt;br /&gt;                if (obj instanceof Boolean) {&lt;br /&gt;                    value = ja.getBoolean(key) + "";&lt;br /&gt;                } else {&lt;br /&gt;                    value = "'" + ja.get(key) + "'";&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                buff.append(value);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            if (key &lt; ja.length() - 1) {&lt;br /&gt;                buff.append(",");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        buff.append("]");&lt;br /&gt;&lt;br /&gt;        return buff.toString();&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So, after you have your dynamic data put in JSONObject or JSONArray, you can invoke the corresponding conversion method stated above to get the String form of your JSON data ready to be passed to the component.&lt;br /&gt;&lt;br /&gt;For instance, in your tree builder code, you will need to do the following (the example is from this post where the solution was posted by Greg Murray):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public static JSONObject buildTreeData(AuthorizedTeams ateams)&lt;br /&gt;throws JSONException {&lt;br /&gt;&lt;br /&gt; JSONObject retValue = new JSONObject();&lt;br /&gt; JSONObject root = new JSONObject();&lt;br /&gt; root.put ("title", "Organizations");&lt;br /&gt; root.put ("expanded", true);&lt;br /&gt; JSONArray data = new JSONArray();&lt;br /&gt;&lt;br /&gt; Team[] teams = ateams.getTeams();&lt;br /&gt;&lt;br /&gt; for (int i=0; i&amp;lt;teams.length; i++) {&lt;br /&gt;   JSONObject teamObj = new JSONObject();&lt;br /&gt;   teamObj.put("title", teams[i].getTeamName());&lt;br /&gt;   teamObj.put("expanded", true);&lt;br /&gt;&lt;br /&gt;   JSONArray children = new JSONArray();&lt;br /&gt;&lt;br /&gt;   User[] teamUsers = teams[i].getMembers();&lt;br /&gt;   for (int j=0; j&amp;lt;teamUsers.length; j++) {&lt;br /&gt;     JSONObject childObj = new JSONObject();&lt;br /&gt;     childObj.put("title",teamUsers [j].getUserName());&lt;br /&gt;     children.put(childObj);&lt;br /&gt;   }&lt;br /&gt;   teamObj.put("children", children);&lt;br /&gt;   data.put(teamObj);&lt;br /&gt; }&lt;br /&gt; root.put ("children", data);&lt;br /&gt; retValue.put ("root", root);&lt;br /&gt;&lt;br /&gt; return &lt;span style="font-weight: bold;"&gt;jsonToObjectLiteral(retValue, new StringBuffer());&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Here is the JSP snippet:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt; &amp;lt;jsp:useBean id="teams"&lt;br /&gt;   class="com.myapp.assignment.AuthorizedTeams"&lt;br /&gt;   scope="request"/&gt;&lt;br /&gt; &amp;lt;a:widget name="dojo.tree" value="${teams.teamsData}"&gt;&lt;br /&gt;&lt;/a:ajax&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-2343911438796549933?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/2343911438796549933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=2343911438796549933&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2343911438796549933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/2343911438796549933'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/06/working-with-jmaki.html' title='Working with JMaki'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-1383639940695050289</id><published>2007-05-08T10:41:00.001-04:00</published><updated>2007-05-08T10:48:59.383-04:00</updated><title type='text'>JavaServer Faces Part 1 - Introduction</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;This is first in the series of blogs on JSF. &lt;p&gt;JSF = JavaServer Faces. &lt;p&gt;It’s a web framework. The 3 independent elements that make up a usable JSF component in a page are: &lt;ol&gt; &lt;li&gt;&lt;b&gt;UIComponent&lt;/b&gt; class – defines behavior of component. Eg. UISelectOne  &lt;li&gt;&lt;b&gt;Renderer&lt;/b&gt; class – provides specific renderings of component. For eg, a UISelectOne can be rendered in HTML as either a group of radio buttons or a select menu.  &lt;li&gt;A &lt;b&gt;JSP tag&lt;/b&gt; – which associates a Renderer with a UIComponent and makes them usable in JSP as a single tag, eg &amp;lt;h:selectOneMenu&amp;gt; &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;JSF UI components are bound to server-side Java beans (which are registered as Managed Beans in &lt;b&gt;faces-config.xml&lt;/b&gt;). In the JSP pages, the UI components are bound to Managed Beans using the JSF Expression Language (which in JSF 1.2 is same as JSTL 2.1’s EL and is now called Unified EL). Once bound, updating bean properties or invoking bean methods from a web interface is handled automatically by JSF request processing lifecycle. This ability to automatically synchronize server-side Java Bean properties to a hierarchical set of components that are based on UI presented to the client user is a major advantage of JSF over other web frameworks like Struts. &lt;p&gt;&lt;b&gt;JSF Request Processing Lifecycle&lt;/b&gt; &lt;ol&gt; &lt;li&gt;When a JSP page with JSF components is requested first time, then JSF runtime creates an in-memory components tree on server side.  &lt;li&gt;In between requests, when nothing is happening in application, the component tree is cached on server.  &lt;li&gt;Upon a subsequent request, the component tree is reconstituted, and if form input values are sent in request, they are processed and validations are executed.  &lt;li&gt;Upon successful validation, server-side managed bean properties are updated.  &lt;li&gt;Once all event processing and updates are over, the response is sent to client. &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;b&gt;To enable JSF support in a Java EE web application&lt;/b&gt;, following needs to be done: &lt;ol&gt; &lt;li&gt;An entry for &lt;b&gt;Faces Servlet&lt;/b&gt; in web.xml and mapping of this servlet to *.faces or /faces/* etc. (A request that uses the appropriate faces URL pattern can be considered a faces request and when received by faces controller, it processes the request by preparing an object known as the &lt;b&gt;JSF context&lt;/b&gt;, which contains all accessible application data and routes the client to appropriate view page based on the navigation rules as defined in the faces-config.xml.)  &lt;li&gt;A JSF configuration file – &lt;b&gt;faces-config.xml&lt;/b&gt; in WEB-INF/ path.  &lt;li&gt;Following jar files in WEB-INF/lib path:  &lt;ol&gt; &lt;li&gt;JSF jars – jsf-api.jar and jsf-impl.jar  &lt;li&gt;Apache commons jars – commons-beanutils.jar, commons-collection.jar, commons-digester.jar, and commons-logging.jar.  &lt;li&gt;JSTL jars – standard.jar and jstl.jar&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;b&gt;For a JSP page to be JSF enabled, &lt;/b&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;we need to include at least the following taglibs from Sun’s JSF RI (you may also use Apache MyFaces implementation of JSF spec): &lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt; &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt; &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;%@taglib uri=”http:&lt;span style="color: #008000"&gt;//java.sun.com/jsf/core” prefix=”f”%&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &amp;lt;%@taglib uri=”http:&lt;span style="color: #008000"&gt;//java.sun.com/jsf/html” prefix=”h”%&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;In the JSP page body, we must add &amp;lt;f:view&amp;gt; tag which becomes the base UI component of component tree in memory on server side when the page is requested for viewing. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;If page processes form input, then we can add &amp;lt;h:form&amp;gt; tag.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Example code: &lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;inputname.jsp&lt;/strong&gt; – shows a form to user to enter name&lt;br /&gt;&lt;p&gt;If outcome is “greeting” then show &lt;strong&gt;greeting.jsp&lt;/strong&gt; to user&lt;br /&gt;&lt;p&gt;The input name between the two pages is stored in memory in &lt;strong&gt;PersonBean&lt;/strong&gt;’s personName field. The personName is registered as managed bean and JSF’s EL is used in the JSP pages to access the PersonBean’s personName field values.&lt;/p&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; inputname.jsp:&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &amp;lt;%@ taglib uri=&lt;span style="color: #006080"&gt;"http://java.sun.com/jsf/html"&lt;/span&gt; prefix=&lt;span style="color: #006080"&gt;"h"&lt;/span&gt; %&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &amp;lt;%@ taglib uri=&lt;span style="color: #006080"&gt;"http://java.sun.com/jsf/core"&lt;/span&gt; prefix=&lt;span style="color: #006080"&gt;"f"&lt;/span&gt; %&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &amp;lt;f:loadBundle basename=&lt;span style="color: #006080"&gt;"jsfks.bundle.messages"&lt;/span&gt; var=&lt;span style="color: #006080"&gt;"msg"&lt;/span&gt;/&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &amp;lt;html&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;  &amp;lt;head&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;   &amp;lt;title&amp;gt;enter your name page&amp;lt;/title&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;  &amp;lt;/head&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;  &amp;lt;body&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;    &amp;lt;f:view&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;      &amp;lt;h1&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;       &amp;lt;h:outputText &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;=&lt;span style="color: #006080"&gt;"#{msg.inputname_header}"&lt;/span&gt;/&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;      &amp;lt;/h1&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;      &amp;lt;h:form id=&lt;span style="color: #006080"&gt;"helloForm"&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;       &amp;lt;h:outputText &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;=&lt;span style="color: #006080"&gt;"#{msg.prompt}"&lt;/span&gt;/&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;       &amp;lt;h:inputText &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;=&lt;span style="color: #006080"&gt;"#{personBean.personName}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;       &amp;lt;h:commandButton action=&lt;span style="color: #006080"&gt;"greeting"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;=&lt;span style="color: #006080"&gt;"#{msg.button_text}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;      &amp;lt;/h:form&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;    &amp;lt;/f:view&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;  &amp;lt;/body&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt; &amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Where, message bundle is defined in a &lt;b&gt;message.properties&lt;/b&gt; file (which needs to be put in WEB-INF/classes path in your web applications WAR) as,&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; inputname_header=JSF KickStart&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; prompt=Tell us your name:&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; greeting_text=Welcome to JSF&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; button_text=Say Hello&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; sign=!&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;We bind a PersonBean to the inputText filed in helloForm. To do so we also need to register the PersonBean as managed bean in &lt;b&gt;faces-config.xml&lt;/b&gt;. We also need to define the navigation rule from :&lt;/p&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;?xml version=&lt;span style="color: #006080"&gt;"1.0"&lt;/span&gt;?&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &amp;lt;!DOCTYPE faces-config PUBLIC&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;   &lt;span style="color: #006080"&gt;"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;   &lt;span style="color: #006080"&gt;"http://java.sun.com/dtd/web-facesconfig_1_1.dtd"&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &amp;lt;faces-config&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;   &amp;lt;navigation-rule&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;    &amp;lt;from-view-id&amp;gt;/pages/inputname.jsp&amp;lt;/from-view-id&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     &amp;lt;navigation-&lt;span style="color: #0000ff"&gt;case&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;      &amp;lt;from-outcome&amp;gt;greeting&amp;lt;/from-outcome&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;      &amp;lt;to-view-id&amp;gt;/pages/greeting.jsp&amp;lt;/to-view-id&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;    &amp;lt;/navigation-&lt;span style="color: #0000ff"&gt;case&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;   &amp;lt;/navigation-rule&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;   &amp;lt;managed-bean&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;     &amp;lt;managed-bean-name&amp;gt;personBean&amp;lt;/managed-bean-name&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;     &amp;lt;managed-bean-&lt;span style="color: #0000ff"&gt;class&lt;/span&gt;&amp;gt;jsfks.PersonBean&amp;lt;/managed-bean-&lt;span style="color: #0000ff"&gt;class&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;     &amp;lt;managed-bean-scope&amp;gt;request&amp;lt;/managed-bean-scope&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;   &amp;lt;/managed-bean&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt; &amp;lt;/faces-config&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;And here’s what the &lt;b&gt;greeting.jsp&lt;/b&gt; is:&lt;/p&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;%@ taglib uri=&lt;span style="color: #006080"&gt;"http://java.sun.com/jsf/html"&lt;/span&gt; prefix=&lt;span style="color: #006080"&gt;"h"&lt;/span&gt; %&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &amp;lt;%@ taglib uri=&lt;span style="color: #006080"&gt;"http://java.sun.com/jsf/core"&lt;/span&gt; prefix=&lt;span style="color: #006080"&gt;"f"&lt;/span&gt; %&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &amp;lt;f:loadBundle basename=&lt;span style="color: #006080"&gt;"jsfks.bundle.messages"&lt;/span&gt; var=&lt;span style="color: #006080"&gt;"msg"&lt;/span&gt;/&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &amp;lt;html&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;   &amp;lt;head&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;    &amp;lt;title&amp;gt;greeting page&amp;lt;/title&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;   &amp;lt;/head&amp;gt;    &lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;   &amp;lt;body&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;      &amp;lt;f:view&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;          &amp;lt;h3&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;       &amp;lt;h:outputText &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;=&lt;span style="color: #006080"&gt;"#{msg.greeting_text}"&lt;/span&gt; /&amp;gt;,&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;       &amp;lt;h:outputText &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;=&lt;span style="color: #006080"&gt;"#{personBean.personName}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;          &amp;lt;h:outputText &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;=&lt;span style="color: #006080"&gt;"#{msg.sign}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;         &amp;lt;/h3&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;      &amp;lt;/f:view&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;  &amp;lt;/body&amp;gt;    &lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt; &amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And the managed bean &lt;b&gt;PersonBean.java&lt;/b&gt;:&lt;/p&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; package jsfks;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; PersonBean {&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;    String personName;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     &lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;    &lt;span style="color: #008000"&gt;/**&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt; &lt;span style="color: #008000"&gt;   * @return Person Name&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; &lt;span style="color: #008000"&gt;   */&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; String getPersonName() {&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; personName;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;    }&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;    &lt;span style="color: #008000"&gt;/**&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt; &lt;span style="color: #008000"&gt;   * @param Person Name&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt; &lt;span style="color: #008000"&gt;   */&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; setPersonName(String name) {&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;       personName = name;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;    }&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This completes the short introduction to JSF 1.1.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;(C) 2008 Watsh Rajneesh. All Rights Reserved.&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19196687-1383639940695050289?l=rwatsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rwatsh.blogspot.com/feeds/1383639940695050289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19196687&amp;postID=1383639940695050289&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1383639940695050289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19196687/posts/default/1383639940695050289'/><link rel='alternate' type='text/html' href='http://rwatsh.blogspot.com/2007/05/javaserver-faces-part-1-introduction.html' title='JavaServer Faces Part 1 - Introduction'/><author><name>Watsh Rajneesh</name><uri>http://www.blogger.com/profile/06716243760036932975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2831/2343/1600/JetDirect_Team_Pics.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19196687.post-3975593327091036584</id><published>2007-04-15T23:22:00.000-04:00</published><updated>2007-04-21T09:58:48.888-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cable Broadband'/><category scheme='http://www.blogger.com/atom/ns#' term='DOCSIS'/><title type='text'>Understanding Cable Broadband Technology</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_qVBiMGte-S0/RiLyhLX1cEI/AAAAAAAAARw/Ln3mZbX2GFc/s1600-h/image007.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp1.blogger.com/_qVBiMGte-S0/RiLyhLX1cEI/AAAAAAAAARw/Ln3mZbX2GFc/s200/image007.jpg" alt="" id="BLOGGER_PHOTO_ID_5053868383665483842" border="0" /&gt;&lt;/a&gt;Below is an introduction to the terms, concepts and summary of the features of  DOCSIS standard versions which i have compiled from several sources in an effort  to learn about the cable broadband technology.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style="text-align: justify;"&gt;&lt;strong&gt;Cable Modem:&lt;/strong&gt; is a device that is designed to bridge  customer's home computing network to an external network, usually the Internet.  This is accomplished by using the preexisting coaxial cable network, originally  designed for the cable TV infrastructure, known as &lt;em&gt;Community Antenna  Television&lt;/em&gt; (&lt;strong&gt;CATV&lt;/strong&gt;).&lt;/p&gt;&lt;div&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;&lt;strong&gt;Coaxial Cable (RG-6 type):&lt;/strong&gt; Many video channels, each carried  at a specific frequency, are superimposed by the cable provider onto a single  carrier medium - a standard coaxial cable. This process modulates each channel  so that it is exactly &lt;strong&gt;6 MHz&lt;/strong&gt; (8MHz in Europe) away from the  previous channel, and the frequency range available for a CATV provider to use  typically runs from 42 to 850 MHz. When a user is watching a channel, the TV is  tuned to the frequency that represents the channel and so displays only the part  of the cable signal that corresponds to that channel. The legacy CATV  infrastructure was designed as a one-way communication network. &lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;&lt;strong&gt;ADSL:&lt;/strong&gt; As demand for faster home internet service increased,  cable companies began using their existing coax cable networks to offer digital  internet connectivity. At the same time, telcos (phone companies) started using  their existing copper two-wire phone lines to offer a similar service known as  &lt;strong&gt;ADSL&lt;/strong&gt; (&lt;em&gt;Asynchronous Digital Subscriber Line), &lt;/em&gt;where the  downstream connection is faster than the upstream connection. Unlike dialup, DSL  uses a sophisticated frequency-modulation method to transmit data through copper  line wires without disrupting the regular phone service over the line.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Quick comparison between Cable modem and ADSL broadband  technologies:&lt;/strong&gt;&lt;/p&gt; &lt;table class="MsoTableProfessional" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td style="border: 1pt solid black; padding: 0in 5.4pt; background: black none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size:10;"&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;Cable  Modem&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-color: black black black rgb(235, 233, 237); border-top: 1pt solid black; border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; background: black none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size:10;"&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;ADSL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td style="border-color: rgb(235, 233, 237) black black; border-left: 1pt solid black; border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt; &lt;/p&gt;&lt;br /&gt;&lt;/td&gt; &lt;td style="border-color: rgb(235, 233, 237) black black rgb(235, 233, 237); border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;span style="font-size:10;"&gt;DSL is decent for browsing web, sending emails, sending  and receiving pictures and downloading music but it usually lacks bandwidth for  anything having to do with video. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td style="border-color: rgb(235, 233, 237) black black; border-left: 1pt solid black; border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;span style="font-size:10;"&gt;Almost insensitive to distance between CMTS and CM as  fiber optic cables can support digital data transmission over longer  distances.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-color: rgb(235, 233, 237) black black rgb(235, 233, 237); border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;span style="font-size:10;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;DSL is distance sensitive: the  signal decreases with increasing distance between the modem and the network  service provider, which results in a loss of data throughput. As a result, DSL  modem may achieve only a fraction of the advertised data speeds.  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td style="border-color: rgb(235, 233, 237) black black; border-left: 1pt solid black; border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;span style="font-size:10;"&gt;Cable service operates on a coax cable which has a  higher informational density and is physically thicker than phone wire. This  provides a cleaner signal and allows you to modulate more data at higher  frequencies with fewer errors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-color: rgb(235, 233, 237) black black rgb(235, 233, 237); border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;span style="font-size:10;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td style="border-color: rgb(235, 233, 237) black black; border-left: 1pt solid black; border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;span style="font-size:10;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Coax cable is a shared medium,  meaning every house in the area around a local hub of coax (known as &lt;i style=""&gt;drop&lt;/i&gt;) is physically connected to the  same coax cable.&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-color: rgb(235, 233, 237) black black rgb(235, 233, 237); border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;span style="font-size:10;"&gt;A DSL home line is a dedicated connection that connects  the home user directly with the service provider (the phone  company).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td style="border-color: rgb(235, 233, 237) black black; border-left: 1pt solid black; border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;span style="font-size:10;"&gt;Cable modems can upload faster than DSL modems can (max  download speed being 38 Mbps and max upload speed being 30 Mbps) but the  upstream bandwidth is usually limited by the ISP to a much slower  rate.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-color: rgb(235, 233, 237) black black rgb(235, 233, 237); border-right: 1pt solid black; border-bottom: 1pt solid black; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"&gt;&lt;span style="font-size:10;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;In short, i think the one can decide which of the two technologies to choose  based on which one works out cheaper and/or reliable in their area as both these  technologies are capable and can coexist as means to achieve broadband internet  connection for home users. I used to use ADSL from airtel in India (Bangalore)  and am using Cable modem from comcast in USA (Maynard, MA) and have noticed no  significant difference in the service quality during video chats on internet  (viz a scenario where high usage of upstream and downstream is made).&lt;/p&gt; &lt;p&gt;&lt;strong&gt;A Cable network:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;A cable coax network is a &lt;strong&gt;bus topology&lt;/strong&gt; - ie all service  nodes (cable modems) are connected to a common medium, the coax bus. Each modem  connected to a bus shares this line with every other modem when sending and  receiving data. But generally cable modem networks use a technology called &lt;a href="http://en.wikipedia.org/wiki/Hybrid_fibre-coaxial"&gt;hybrid fiber coax&lt;/a&gt;  (&lt;strong&gt;HFC&lt;/strong&gt;), which incorporates both optical fiber along with coaxial  cable to create a broadband network.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_qVBiMGte-S0/RiLzSbX1cFI/AAAAAAAAAR4/wO0d4qcTlak/s1600-h/hfc.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp2.blogger.com/_qVBiMGte-S0/RiLzSbX1cFI/AAAAAAAAAR4/wO0d4qcTlak/s200/hfc.bmp" alt="" id="BLOGGER_PHOTO_ID_5053869229774041170" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_qVBiMGte-S0/RiLzSrX1cGI/AAAAAAAAASA/B7EqL8l2Xu4/s1600-h/image001.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp3.blogger.com/_qVBiMGte-S0/RiLzSrX1cGI/AAAAAAAAASA/B7EqL8l2Xu4/s200/image001.bmp" alt="" id="BLOGGER_PHOTO_ID_5053869234069008482" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_qVBiMGte-S0/RiLzS7X1cII/AAAAAAAAASQ/IaD2eJeoqpk/s1600-h/image004.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp0.blogger.com/_qVBiMGte-S0/RiLzS7X1cII/AAAAAAAAASQ/IaD2eJeoqpk/s200/image004.jpg" alt="" id="BLOGGER_PHOTO_ID_5053869238363975810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_qVBiMGte-S0/RiLzSrX1cHI/AAAAAAAAASI/fvV7THH8ekM/s1600-h/image006.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp3.blogger.com/_qVBiMGte-S0/RiLzSrX1cHI/AAAAAAAAASI/fvV7THH8ekM/s200/image006.jpg" alt="" id="BLOGGER_PHOTO_ID_5053869234069008498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="text-align: justify;"&gt;A fiber optic node has a broadband optical transmitter and receiver capable  of converting the downstream optically modulated signal coming from the headend  to an electrical signal going to the homes as well as el
