<?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:blogger='http://schemas.google.com/blogger/2008' 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-2918514529204426688</id><updated>2024-09-10T17:03:33.017-07:00</updated><category term="Google Map API"/><category term="JEE 5.0"/><category term="Rails"/><category term=".Net"/><category term="C#"/><category term="Hibernate"/><category term="ActiveRecords"/><category term="Ajax"/><category term="Database Programming"/><category term="Declarative Security"/><category term="EJB 3.0"/><category term="GDI+"/><category term="Image Manipulation"/><category term="Introduction"/><category term="JSF"/><category term="JSP"/><category term="JSP Implicit Objects"/><category term="JavaScript"/><category term="OleDB"/><category term="Realms"/><category term="jQuery"/><category term="managed beans"/><category term="tutorial"/><category term="web 2.0"/><category term="web-development"/><title type='text'>My Thoughts and Rants on the current web technologies</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-7587523154210114464</id><published>2010-10-01T21:57:00.001-07:00</published><updated>2010-10-01T22:01:27.620-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="web 2.0"/><category scheme="http://www.blogger.com/atom/ns#" term="web-development"/><title type='text'>Introducing jQuery</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-IN&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val=&quot;Cambria Math&quot;&gt;    &lt;m:brkbin val=&quot;before&quot;&gt;    &lt;m:brkbinsub val=&quot;&amp;#45;-&quot;&gt;    &lt;m:smallfrac val=&quot;off&quot;&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val=&quot;0&quot;&gt;    &lt;m:rmargin val=&quot;0&quot;&gt;    &lt;m:defjc val=&quot;centerGroup&quot;&gt;    &lt;m:wrapindent val=&quot;1440&quot;&gt;    &lt;m:intlim val=&quot;subSup&quot;&gt;    &lt;m:narylim val=&quot;undOvr&quot;&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; defunhidewhenused=&quot;true&quot; defsemihidden=&quot;true&quot; defqformat=&quot;false&quot; defpriority=&quot;99&quot; latentstylecount=&quot;267&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;0&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Normal&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;heading 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 7&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 8&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 9&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 7&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 8&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 9&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;35&quot; qformat=&quot;true&quot; name=&quot;caption&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;10&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Title&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;1&quot; name=&quot;Default Paragraph Font&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;0&quot; name=&quot;Body Text&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;11&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Subtitle&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;22&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Strong&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;20&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Emphasis&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;59&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Table Grid&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Placeholder Text&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;1&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;No Spacing&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Revision&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;34&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;List Paragraph&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;29&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Quote&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;30&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Intense Quote&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;19&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Subtle Emphasis&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;21&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Intense Emphasis&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;31&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Subtle Reference&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;32&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Intense Reference&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;33&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Book Title&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;37&quot; name=&quot;Bibliography&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; qformat=&quot;true&quot; name=&quot;TOC Heading&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Table Normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;; 	mso-bidi-font-family:&quot;Times New Roman&quot;;} &lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:shapedefaults ext=&quot;edit&quot; spidmax=&quot;1026&quot;&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:shapelayout ext=&quot;edit&quot;&gt;   &lt;o:idmap ext=&quot;edit&quot; data=&quot;1&quot;&gt;  &lt;/o:shapelayout&gt;&lt;/xml&gt;&lt;![endif]--&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;It is JavaScript that brings a HTML page to &#39;life&#39;. Whether it is client-side validation, animating the page elements or calling the server in the background to get updated page, one can use JavaScript to achieve all this and much more. However, using JavaScript in its &#39;raw&#39; state compels the developer to write multiple lines to implement each of the afore-mentioned functionality and for each application. The pit-fall in such an approach is that each application will have its own pattern and trying to reuse JavaScript code developed for one application, will ultimately result in re-factoring most of the code so that it meets the requirements of both the applications. This is where JavaScript libraries come into picture. These libraries encapsulate the ordinary yet oft used functionalities (e.g. validation, selection of elements etc.) and provide simplified API to access these functionalities. Among the JavaScript libraries, one of the most used is jQuery. In this discussion, the focus will be on the basics of jQuery. The first section will be about the whys and wherefores of the jQuery. The second section will provide details about using various functionalities of jQuery. That’s the agenda for this discussion.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 12pt; line-height: 115%;&quot; lang=&quot;EN-US&quot;&gt;jQuery – the Whys and Wherefores&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;To understand how jQuery can ease web client (JavaScript based) development, one has to understand two aspects of jQuery. They are:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;1. Functionalities&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;2. Modules&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Understanding the functionalities/services provided by jQuery will tell you what jQuery provides and understanding the modules that constitute jQuery will tell you how to access the services provided by jQuery. Here are the details.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;1. Functionalities&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The functionalities provided by jQuery can be classified into following&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;a. Selection&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;b. Attributes handling&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;c. Element manipulation&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;d. Ajax&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;e. Callbacks&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;f. Event Handling&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Among the above listed functionalities, selection, element manipulation and event handling makes common tasks very easily implementable or trivial.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;a. Selection&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Using this functionality one can select one or multiple HTML elements. The raw JavaScript equivalent of the selection functionality is&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;document.getElementByID(‘&lt;element&gt;’) or&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;document.getElementByTagName(‘&lt;tag&gt;’)&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;b. Attributes handling&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;One of most required task in JavaScript is to change the value of an attribute of a tag. The conventional way is to use getElementByID to get the element and then use index to get to the required attribute. jQuery eases it by using selection and attributes handling functionality in conjunction. &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;c. Element handling&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;There are scenarios where the values of tags need to be modified. One of such scenarios is rewriting text of a &lt;p&gt; tag based on selection from combo box. That is where element handling functionality of jQuery comes handy. Using the element handling or DOM scripting, as it is popularly known, one can not only access a tag but also perform manipulation such as appending child tags to multiple occurrences of a specific tag without using for loop.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;d. Ajax&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ajax is of the concept and implementation that brought the usefulness of JavaScript to the fore. However, it also brought the complexities and the boilerplate code required for using Ajax to its full potential. The Ajax related functionalities of jQuery encapsulates away the boilerplate code and lets one concentrate on the result of the Ajax call. The main point to keep in mind is that encapsulation of the setup code does not mean that one cannot access the Ajax related events. jQuery takes care of that too and one can register to the Ajax events and handle them.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;e. Callbacks&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;There are many scenarios in web development, where you want to initiate another task on the basis of completion of one task. An example of such a scenario involves animation. If you want to execute a task after completion of an animation, you will need callback function. The core of jQuery is implemented in such a way that most of the API supports callbacks.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;f. Event handling&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;One of the main aspects of JavaScript and its relationship with HTML is the events triggered by the form elements can be handled using JavaScript. However, when multiple elements and multiple events come into picture, the code complexity becomes very hard to handle. The core of jQuery is geared towards handling the events in such a way that complexity can be maintained at manageable levels.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Now that we have discussed the main functionalities of jQuery, let us move onto the main modules of jQuery and how the functionalities map onto the functionalities. &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;2. Modules&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The modules contain APIs that have one-to-one mapping with the functionalities (most of the time). The main modules of jQuery are&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;a. Selectors&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;b. Attributes/CSS&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;c. Manipulation&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;d. Ajax&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;e. Callback&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;f. Event Handling&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The names are indicators as to which functionalities they map to. Here are the details&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;a. Selectors&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;As the name indicates, selectors provide the functionality to select elements.&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;As mentioned earlier, selectors are denoted by dollar ($) sign. Some of the commonly used selectors are&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;all selector – selects all the elements&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;:first and :last selectors – select the first and last occurrence of a recurring element/tag.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;:eq (index) – selects the element with the index having the &lt;span style=&quot;&quot;&gt; &lt;/span&gt;value passed as argument.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;#id – selects the element whose id is passed. &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Following statements show how selectors are commonly used&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot;&gt;$(&quot;p&quot;) &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;&quot;&gt;The above statement selects all &lt;p&gt; elements.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot;&gt;$(&quot;p.start&quot;)&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;&quot;&gt; &lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;&quot;&gt;It selects all &lt;p&gt; elements with class whose name is “start”.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot;&gt;$(&quot;p#demo&quot;)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;&quot;&gt;It selects the first &lt;p&gt; element with &quot;demo&quot; as id. &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;b. Attributes/CSS:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The attribute handling functionality can be found in the API of this module. It also provides manipulation of CSS classes attached to the elements or attributes. Some of the most commonly used API is&lt;/span&gt;&lt;/p&gt;  &lt;h4 style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol; font-weight: normal; font-style: normal;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal; font-style: normal;&quot; lang=&quot;EN-US&quot;&gt;.attr( attributeName ) – gets the value of an attribute for the first element having the attribute with name equal to the passed attribute name &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;.addClass (classname) – sets the CSS class of a particular element.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;.val() - gets the current value of the first element in the set of matched elements. It is primarily used to get the values from form elements.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;.css(name, value)&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;- sets the style property that matches the name of the style passed to the value passed for style&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 18pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Following is an example of css() API&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 18pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$(&quot;p&quot;).css(&quot;background-color&quot;,&quot;yellow&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 18pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;It will set the style of all the &lt;p&gt; elements. In this case the style is background color. Its value is set to yellow.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 18pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;c. Manipulation&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The API related to DOM scripting can be found in this module. In other words, the API in this module is used to manipulate DOM in one way or other. One point to keep in mind is that many of the API in this module overlaps with API in Attributes/CSS module. Some of the most commonly used API is:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;.after(content) – adds the specified content after each of the elements from a set of matched elements.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;clone() – duplicates the elements in a set o matched elements.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;replaceWith(newContent) – replaces each element from a set of matched elements with the specified content.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The term “set of matched elements” means that these APIs need to be used along with selectors. A selector may return more than one element. Hence, the returned values are collectively termed as set. For example, the following statement appends “This is appended” to all the &lt;p&gt; elements&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$(&quot;p&quot;).append(&quot;This is appended &quot;);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;And the following replaced all the values between &lt;p&gt; and &lt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;d. Ajax&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The Ajax related functionality can be found in this module. Following are the most commonly used APIs&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;get() – retrieve data from the server specified by the URL, with the data passed.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 36pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Post() – same as get but uses POST HTTP method to retrieve the data.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;For example, the following statements depict the use of get() API&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$.get(&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&quot;http://mysite.org/test.php&quot;,&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;function(data) { alert(data); },&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In the above example, get takes two parameters – URL of the remote site and the callback that performs some operation on the data passed into the callback by get API. Here the URL is “http://mysite.org/test.php” and the operation performed is alerting the user.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;e. Callbacks&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;One of the aspects of jQuery that is heavily used is callbacks. A callback is a function that is registered with another method and gets called when a specific condition, such as response from the server is fulfilled. Following statements display callback in its simplest form&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$(&quot;p#test&quot;).hide(1000,function(){&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;alert(&quot;The paragraph is now hidden&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;});&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt; &lt;br /&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The hide() API takes two arguments, speed with which the element has to be hidden and the method that needs to be called when the task of hiding is done. In the above example, when the &lt;p&gt; element with id as test is hidden an alert is displayed. In this case callback function is directly defined within hide(). &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;f. Event handling&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;As stated before, event handling is part of the core functionalities of jQuery. However, to use it, one point needs to be understood. It is the place (within the HTML document) where event and its handler will be attached. The answer to this question is the correct place is the section which gets called before body section is called and it is the head section. &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;To attach a handler with an event, the statements need to be place within the ready() function of document DOM element. For example, following statements attach the click event of button to its handler&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$(document).ready(function(){&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;&quot;&gt;                              &lt;/span&gt;$(&quot;button#test&quot;).click(function(){&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 70.9pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;$(&quot;p&quot;).hide();&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;&quot;&gt;                              &lt;/span&gt;});&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;});&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The click event button with id ‘test’ is attached to the handler using callback functionality which in turn is defined inside the callback for ready(). One point to keep in mind is that any kind event handling code must be defined inside ready() and read() itself must be a part of the head section (&lt;head&gt;&lt;/head&gt;).&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This completes the bird’s eye view of the APIs of jQuery. Next section will deal with the steps in using jQuery and some its APIs. It will also cover how to use some of the APIs discussed in this section.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Developing with jQuery – Step-by-Step:&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The steps to use jQuery&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;include downloading and installing (in some cases), referencing the jQuery library and calling the API. Following are the details&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;1. Downloading and installing jQuery&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This step is not mandatory. The reason for this step being optional is that there are alternative ways to reference jQuery library which will be discussed as a part of next step. To download jQuery, one has to download it from the following URL&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;http://docs.jquery.com/Downloading_jQuery#Current_Release&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Unzip it to the local folder from where it will be referenced. That completes the step for downloading and installing. &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;2. Referencing the Library&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;There are two ways to reference jQuery. They are&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;a. Local reference&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;c. Remote reference&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Both use src attribute of &lt;script&gt; tag to refer to the files of jQuery. However, where the files reside is the main difference between the two ways. Here are the details&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;a. Local reference&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;When the library (JS files of jQuery) resides within the application directory structure, then the files are locally referenced. Following statement references files stored in the scripts folder of the application&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;../script/jquery-1.4.2.js&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/script&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;b. Remote reference&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;When the library is hosted on another site ( e.g. code.google.com) and the URL is used to access the functionalities of the library, it is known as remote referencing. The steps to remotely refer jQuery hosted at code.google.com are as follows&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;i. Refer to the jQuery hosted on code.google.com using the src attribute of the &lt;script&gt; tag. The following&lt;br /&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;statement does the same&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;b style=&quot;&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;&quot;&gt;               &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;&lt;/script&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The main point to remember is that the URL for the jQuery library may change based on the version of jQuery.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;ii. Call the initialization function i.e. ready() after the referencing statement. The following example shows both the steps together&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;&quot;&gt;               &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;&lt;/script&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;$(document).ready(function() {&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;// provide the initialization such as event handling here&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;});&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/script&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;3. Calling the API&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;To call the API, one can use one of the following ways&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;a. Fully qualified name&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;When calling the API with fully qualified name, the statement starts with jQuery. The following statement calls the selector using fully qualified name&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;jQuery(‘:first’)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;b. Using Dollar sign &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The dollar sign ($) can be used to call the APIs, instead of using ‘jQuery’. The following statement uses dollar sign to call the selector instead of jQuery&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$(‘:first’)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;4. Putting it all Together:&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Let’s put all the steps together. &lt;span style=&quot;&quot;&gt; &lt;/span&gt;The following example will implement&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;a simple time server. There are two files –one that sits at the server and the one executed at the client. They are&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;1. SimpleTimeServer.php – it will reside at the server and respond with the current server time.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;2. Client.html – it will send request to the server for current server&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;time via Ajax and display the response it&lt;br /&gt;&lt;span style=&quot;&quot;&gt;                            &lt;/span&gt;receives.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;First is the SimpleTimeServer.php.&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;It will have the following code&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;?php&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$time_now=mktime(date(&#39;h&#39;)+5,date(&#39;i&#39;)+30,date(&#39;s&#39;));&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$time_now_str = date(&#39;l M dS, Y, h:i:s A&#39;,$time_now)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;print $time_now_str;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;?&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;It uses the mktime function to get the current date time and the date function to convert it to human readable string. &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Next is Client.html. Following is the code &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;en&quot; lang=&quot;en&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;head&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;title&gt;Current Date and Time&lt;/title&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.2.6.js&quot;&gt;&lt;/script&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;       &lt;/span&gt;&lt;script type=&quot;text/javascript&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 35.45pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;function&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;getTime()&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 35.45pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;{&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 70.9pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$.ajax({&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 106.35pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;url : &quot;SimpleTimeServer.php&quot;,&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 106.35pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;success : function (data) {&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 141.8pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$(&quot;#contentArea&quot;).html(data);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 141.8pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 70.9pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;});&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 35.45pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;setTimeout(&quot;getTime()&quot;, 1000);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 35.45pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;&lt;/script&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;&lt;/head&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;&lt;body onload=&quot;getTime();&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;       &lt;/span&gt;&lt;table width=&quot;100%&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;&quot;&gt;          &lt;/span&gt;&lt;tr&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;margin-left: 35.45pt; text-align: justify; text-indent: 35.45pt;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;td&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;width=&quot;100%&quot; align=&quot;center&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;&quot;&gt;                    &lt;/span&gt;&lt;div id=&quot;contentArea&quot; style=&quot;color:blue;font:bold 14px arial;padding-top:140px;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;&quot;&gt;                       &lt;/span&gt;&lt;/div&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;&quot;&gt;                          &lt;/span&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;/td&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;/tr&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;/table&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;/body&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;&lt;/html&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The core of the client is the getTime function. It make call to the server using the get API and displays the received value using the manipulator html(). Then the function uses setTimeOut() to call itself at specified interval. The getTime() is called when the body section loads, thus once the body is loaded the time is displayed at a specific interval.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;That completes the example. What I discussed here is just the tip of the ice-berg. In the next article, the selectors will be covered in details. Till then…&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoBodyText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/7587523154210114464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/7587523154210114464' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/7587523154210114464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/7587523154210114464'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2010/10/introducing-jquery.html' title='Introducing jQuery'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-1868543904545931943</id><published>2010-01-23T23:15:00.000-08:00</published><updated>2010-01-23T23:17:25.120-08:00</updated><title type='text'>Moving on...</title><content type='html'>I have moved on to wordpress. Please update your bookmarks&lt;br /&gt;&lt;br /&gt;http://aprajshekhar.wordpress.com</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/1868543904545931943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/1868543904545931943' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/1868543904545931943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/1868543904545931943'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2010/01/moving-on.html' title='Moving on...'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-5619862019597766941</id><published>2008-08-20T08:08:00.000-07:00</published><updated>2008-08-20T08:18:48.164-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Database Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="OleDB"/><title type='text'>Database Programming in C# with MySQL : Using OleDB</title><content type='html'>&lt;style type=&quot;text/css&quot;&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }  --&gt;  &lt;/style&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;Persisting the data processed by an application has become the norm of the day. The storage can be either file-system using normal files or databases. The functionalities provided by database packages make them more attractive proposition. With the advent of Open Source database products such as MySQL, use of database for data persistence more or less ubiquitous. Hence, no language or platform can ignore providing libraries to access databases especially MySQL and .Net, as a platform and C#, as a language, are no exceptions. There are three main Data Providers, as the database access APIs are known as in .Net, which are SQL Data Provider, OleDB Data Provider and ODBC Data Provider. Of these I would be focusing on OleDB Data Provider and on using it to work with MySQL database. First section would provide insight into the various APIs that forms the OleDB. Second section would detail the steps required to access MySQL using OleDB. In the last section, I would develop a real-world application that implements the theory provided in first two sections. That’s the outline for this discussion.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;OleDB – What is it:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;OleDB is one of the three Data Providers supported by .Net. It is part of System.Data namespace specifically all the classes of OleDB come under System.Data.OleDb namespace. OleDB had been around before .Net come picture. What OleDB provider does is that it provides mechanism to access OleDB data source (Databases that could be connected through OleDB) in managed space of .Net. in essence, OleDB Data Provider sits between .Net based application and OleDB. The main classes that form OleDB Data Provider are:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;1. OleDbConnection&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;2. OleDbCommand&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;3. OleDbDataAdapter&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;4. OleDbDataReader&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;Most of the classes are arranged in a hierarchical manner, that is, one provides the instance of the other. For example, OleDbCommand provides instance of OleDbDataReader.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1. OleDbConnection:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;It represents a connection with a data source such as a database server. Each connection represented by OleDbConnection’s instance is unique. When an instance of OleDbConnection is created all its attributes are given or set to their default values. If the underlying OleDB provider doesn’t support certain properties or methods the corresponding properties and methods of OleDbConnection would be disabled. To create an instance of OleDbConnection, its constructor has to be called with connection string. Connection string specifies the parameters needed to connect with the data source. Following statement shows such an example:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;OleDbConnection conn = new OleDbConnection(            &quot;Provider=MySqlProv;&quot; + &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;            &lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;&quot;Data Source=localhost;&quot; + &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;            &lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;&quot;User id=UserName;&quot; + &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;            &lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;&quot;Password=Secret;&quot;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;);&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;    &lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;The above example provides a connection to MySQL server at local machine.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;2. OleDbCommand:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.16in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;OleDbCommand represents a command to be executed against a data source connected through OleDbConnection instance. In the context of databases the command can be an SQL statement or a Stored Procedure. To get an instance of OleDbCommand, its constructor has to be called with instance of OleDbConnection class and the string containing the SQL query to be executed. For example, the following statement creates an instance of OleDbCommand named command:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.16in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;string queryString = &quot;SELECT OrderID, CustomerID FROM Orders&quot;;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.16in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;OleDbCommand command = new OleDbCommand(queryString, conn);&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;3. OleDbDataAdapter:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.16in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;It represents a set of commands and a connection that is used to fill a DataSet. In other words it is a bridge between DataSet and the data source to retrieve and update the data. The constructor of the OleDbDataAdapter needs to be called with SQL &lt;b&gt;select&lt;/b&gt; statement and OleDbConnection instance. To cite an example following creates an instance of OleDbDataAdapter named adapter&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.16in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;OleDbDataAdapter adapter = new OleDbDataAdapter(queryString, conn);&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;4. OleDbDataReader:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;It provides a mechanism to read forward only stream of records and columns from the data source. To obtain an instance of OleDbDataReader, executeReader() method of OleDbCommand has to be called. Following statement does the same:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;OleDbDataReader reader = command.ExecuteReader();&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;One point to keep in mind while using OleDbDataReader is that while it is being used, the corresponding connection would be kept busy, as it uses a stream to communicate with data source. &lt;/span&gt;&lt;/span&gt; &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;So now as the main classes have been discussed, next step is in understanding how MySQL and OleDB Data Provider link with each other. What OleDB Data Provider does exactly is that it calls the underlying OleDB Provider. So it is the OleDB provider that communicates with the data source. For each database system, the OleDB Provider has to be provided by vendor of the database. In this case the vendor is MySQL. Hence unless MySQL provides the OleDB provider, OleDB Data Provider wont be able to communicate with database server. The Provider supplied by MySQL has to be registered with .Net so that OleDB Data Provider can call the Provider. The other term for the OleDB Provider is Database Driver. In case of MySQL it is also known as MySQL connector. Next I will be discussing the steps to access MySQL.  &lt;/span&gt;&lt;/span&gt; &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;Accessing MySQL – Step by Step:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;As the Data Provider in discussion is OleDB, the steps to access MySQL doesn’t change from accessing any other databases. The point of difference comes in connection string. Lets look at the steps:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1. Creating the Connection object&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;2. Instantiating the Command object&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;3. Obtaining the DataReader object&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;4. Retrieving the records&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;The connection string comes into picture at first step. And it is the connection string that decides which underlying Driver has to be called.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1. Creating the Connection object:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;Creating a connection object really means obtaining an instance of OleDbConnection class. The constructor takes connection string as parameter. Connection string is composed of the following:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;a. Provider – it specifies the vendor of the driver. In case of MySQL, the value &lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;                   &lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;would be &lt;b&gt;MySqlProv.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;b. Data Source   - the name of the machine where the server is residing. &lt;/span&gt;&lt;/span&gt; &lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;c. User Id – the user name with which to connect to the database&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;d. Password – the password with which to connect with database&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;The connection string is a collection of name value pairs separated by semicolon. For example, to connect with a database at localhost with user name as root and no password, the connection string would be:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;b&gt;string strConnect&lt;/b&gt; = &lt;b&gt;&quot;Provider=MySqlProv;&quot; + &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;            &lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;&quot;Data Source=localhost;&quot; + &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;            &lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&quot;User id=root;&quot; + &lt;/span&gt;&lt;/span&gt;&lt;/b&gt; &lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;            &lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;&quot;Password=;&quot;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;And OleDbConnection instance that can be obtained by using the connection string would be thus:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;OleDbConnection conn = new OleDbConnection(  strConnect);&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;2. Instantiating Command Object:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;The next step in accessing MySQL is creating an instance of OleDbCommand class so that an SQL statement to be executed at database. To obtain an instance of OleDbConnection, its constructor needs, the SQL statement to be executed and the connection through which the database can be connected. For example, the following statements create an instance of OleDbCommand named command:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;string strSQL= “Select * from user_master”;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;OleDbCommand command = new OleDbCommand(strSQL, conn);&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;3. Obtaining Data Reader Object:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;Next step is to retrieve the result. But for that a stream is required that fetches data from the database. This requirement can be met by obtaining an object of OleDbDataReader. As discussed in first section, it is a forward only stream using which the rows and columns returned by the executed command can be read. To get an instance of OleDbDataReader, ExecuteReader() method of OleDbCommand instance. So accordingly to get an instance named reader, the statement would be:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.21in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;OleDbDataReader reader = command.ExecuteReader();&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;  &lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;4. Retrieving the records:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.25in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt; &lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;The records can be retrieved using the &lt;b&gt;Read() &lt;/b&gt;method of OleDbDataReder. It returns true if more records are available else returns false. To access the specific column &lt;b&gt;GetString() &lt;/b&gt;method of OleDbDataReder. It takes column no. as the argument. For example, following code block reads the value of second column of each row (columns are zero indexed):&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.25in; text-indent: 0.25in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt; &lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;while( reader.Read())&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 1in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;Console.WriteLine(reader.GetString(1));&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style=&quot;margin-left: 0.25in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;For extracting data from columns having type different from varchar, OleDb Data Provider gives different .Net types mapped to SQL types. &lt;/span&gt;&lt;/span&gt; &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;That brings us to the end of second section. In the next section, I would be developing a small application that would use MySQL OleDB Data Provider to access MySQL database server.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;MySQL Access – In Real World:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;The example I will be developing would primarily focus on a class that returns OleDbConnection, OleDbCommand and OleDbDataReader instances. It contains two classes:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Data – It creates and returns instances of OleDbConnection, OleDbCommand and &lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;          &lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;OleDbDataReader.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;DataTest – It tests the functionalities provided by Data class.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;Lets start with Data class. Its parameterized constructor creates the connection string from the parameters passed and instantiates OleDbConnection connection class using the string. The getDataReader method returns a OleDbDataReader instance based on the OleDbCommand instance passed. Here is the class:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;using System;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;using System.Data;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;using System.Data.OleDb;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;namespace MySQLApp&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt; /// &lt;summary&gt;&lt;/summary&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;/// Creates and returns OleDbConnection, OleDbCommand and ///OleDbDataReader&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt; /// &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt; public class Data&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt; {&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  private OleDbConnection connection=null;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  private OleDbCommand command=null;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  string connectionString=null;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  public Data()&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  {&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   connectionString=&quot;&quot;;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  }&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  public Data(string host, string userId, string password)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  {&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 1.5in; margin-bottom: 0in;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;connectionString=&quot; Provider=MySqlProv; Data Source=&quot;+host+&quot;; User id=&quot;+userId+&quot;; Password=&quot;+password+&quot;;&quot;;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   connection=new OleDbConnection(connectionString);&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   command=new OleDbCommand();&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  }&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  public OleDbCommand getCommand(string sqlString)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  {&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   command.Connection=connection;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   command.CommandText=sqlString;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   return command;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  }&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  public OleDbDataReader getReader(OleDbCommand command)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  {&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   return command.ExecuteReader();&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  }&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt; }&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;The next class is the DataTest. It creates an instance of the Data class and executes an SQL statement using it. Here is the code:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;using System;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;namespace MySQLApp&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt; /// &lt;summary&gt;&lt;/summary&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt; ///Creates an instance of Data class to execute a simple SQL ///statement.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt; /// &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt; class DataTest&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt; {&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  /// &lt;summary&gt;&lt;/summary&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  /// The main entry point for the application.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  /// &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  [STAThread]&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  static void Main(string[] args)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  {&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   Data data=new Data(&quot;localhost&quot;,&quot;root&quot;,&quot;root123&quot;);&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   data.getReader(data.getCommand(&quot;select * from &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style=&quot;margin-left: 4in; margin-bottom: 0in;&quot;&gt;        &lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;user&quot;));&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 0.25in; text-indent: 0.25in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt; &lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;   while( reader.Read())&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 1.5in; text-indent: 0.5in; margin-bottom: 0in;&quot; align=&quot;justify&quot;&gt; &lt;b&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;Console.WriteLine(reader.GetString(1));&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;   &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;  }&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt; }&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana,sans-serif;&quot;&gt;That brings us to the end of this discussion. The application developed here would form the basis of the advanced operations using DataAdapter in the next part of this discussion. Till then…&lt;br /&gt;&lt;br /&gt;This article can be found at:&lt;br /&gt;http://www.aspfree.com/c/a/Database/&lt;br /&gt;Database-Programming-in-C-Sharp-with-MySQL-Using-OleDB/&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/5619862019597766941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/5619862019597766941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/5619862019597766941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/5619862019597766941'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2008/08/database-programming-in-c-with-mysql.html' title='Database Programming in C# with MySQL : Using OleDB'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-171814917483803947</id><published>2008-08-16T06:55:00.000-07:00</published><updated>2008-08-16T07:09:08.529-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="GDI+"/><category scheme="http://www.blogger.com/atom/ns#" term="Image Manipulation"/><title type='text'>Image Manipulation using GDI+ - the C# way : Basics</title><content type='html'>&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;&lt;style type=&quot;text/css&quot;&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   H5 { margin-top: 0.19in; margin-bottom: 0.19in; page-break-after: auto }   H5.western { font-family: &quot;Thorndale AMT&quot;, serif }   H5.cjk { font-family: &quot;Albany AMT&quot; }   H5.ctl { font-family: &quot;Albany AMT&quot; }   P { margin-bottom: 0.08in }  --&gt;&lt;/style&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Image manipulation is considered one of the difficult tasks in Graphics Programming. This is more so if the Operating System under consideration is Windows. The reason is that to achieve efficiency nothing can find a better option than Windows API. The APIs provided by Windows comes under the GDI roof. GDI is short for Graphics Device Interface. However, GDI works at low level graphics. So to use it good understanding of how Windows work is required. Even with MFC, GDI is a bit complicated. But with evolution of GDI+ the scenario is changing. The major change between GDI and GDI+ is that GDI exposes only APIs for unmanaged code whereas GDI+ provides for both managed as well as unmanaged code. Hence GDI+ is oriented towards .Net based languages. And in the world of .Net, one of the best options is C#. So in this discussion, I would be focusing on how to use the basic image manipulations using GDI+ library in C#. The first section would focus on the terminology used by GDI+ and image manipulation in general. In the second section I would detail the steps involved in image manipulation using GDI+. The last section would be about using the basic image manipulation within a real world application. That’s the outline for this discussion.&lt;/span&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Image Manipulation using GDI+ - the Terminology:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Before understanding how to use GDI+ APIs for image manipulation, it is better to understand what GDI+ really is and what constitutes its vocabulary. If we consider basic image manipulation, there four points that need to be understood which are:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;1. GDI+&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;2. Vector Graphics&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;3. Raster Graphics&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;4. Imaging&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;The second, third and fourth are integral part of image manipulation vocabulary. The fourth term in itself consists of many terms, some which would be discussed in this section.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;1. GDI+:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;By definition “GDI+ is a library that provides an interface that allows programmers to write Windows and Web graphics applications that interact with graphical devices such as printers, monitors, or files”. In essence, it provides a layer of abstraction over varied devices with which GUI needs to work. This abstraction works by converting the data into device compatible form. The device then turns the data into human readable form. The implementation of GDI+ is in the form of C++ classes that can be used from .Net environment. In .Net library, GDI+ classes are exposed through the System.Drawing and its namespaces.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;2. Vector Graphics:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;By definition “Graphics in which an image is stored as a series of numbers defining size, position, and shape”. In other words, in Vector graphics the image contains position vectors describing the image, where a vector represents both quantity and direction. For example, instead of containing a bit in a file for say a line being drawn, a vector graphics file describes a series of points to be connected. Also since the file contains vector commands, the size of the file becomes small.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;3. Raster Graphics:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Raster is grid of x- and y- co-ordinates on a display space which, in this case is the display device. A Raster Graphics file contains information identifying which of these coordinates to illuminate using monochrome (black and white) or spectro-chrome (color) values. Raster images are also known as Bit-mapped images or Bitmaps because it contains information directly mapped to the display device’s grid. Due to this they have larger size than that of Vector Graphic files.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;4. Imaging:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.16in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Imaging is the process of viewing and manipulating the images. In managed GDI+, imaging has two facets – Basic and Advanced. The processes in Basic covers loading and saving, zooming, scaling etc. whereas that in Advanced covers color palette, metafiles and tagged images. The basic functionalities are encapsulated in &lt;i&gt;Image&lt;/i&gt; class. It provides methods to load, save and create images. The subclasses of &lt;i&gt;Image &lt;/i&gt;class i.e. &lt;i&gt;Bitmap and Metafile&lt;/i&gt; provides the functionality for displaying and manipulating the images.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;That was a bird’s eye view of the recurring terms in the world of GDI+ and image manipulation. In the next section I will discuss about steps in loading and manipulating it using flipping as well as rotating the image.     &lt;/span&gt; &lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Image Manipulation Using GDI+ - Step By Step:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Now lets have a look at steps at using the GDI+ for image manipulation. There are four main steps:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;1. Overriding the Paint event of Form&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;2. Obtaining the Graphics object&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;3. Obtaining the Image object&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;4. Apply manipulation methods&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;First two steps is required whenever one has to work with GDI+. However, the last two comes into picture only when image manipulation has to be done. So here are the details:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;1. Overriding the Paint event of form:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;In .Net applications, drawing is done on a Form’s surface. This is same for both web applications as well as desktop application. The function where the actual drawing code can be hooked into is the Paint method. So, first step is to override this method to get foothold into the draw process within the application. This can be achieved either by supplying Paint handler to the Form’s paint method or by overriding OnPaint method. Though its better to provide Paint handler.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;2. Obtaining the Graphics object:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;The next step is to obtain the object of Graphics class. Because only through the Graphics object that the drawing methods can be called. To show an image it has to be drawn on to the Form. That can only be done using the &lt;i&gt;DrawImage&lt;/i&gt; method of an object of Graphic class. An object of Graphics object is associated with a form. So it can be obtained by-&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;a. Using PaintEventArgs argument passed into the Paint handler&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;b. Using PaintArgs argument passed into the OnPaint method&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;c. Using CreateGraphics method of a Form.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;The example of the first method would be thus:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;private void form1_Paint(object sender, PaintEventArgs e)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Graphics g = e.Graphics;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;where &lt;b&gt;form1_Paint &lt;/b&gt;is the handler for Paint event of Form &lt;b&gt;form1. &lt;/b&gt;The Graphics property of the PaintEventArgs returns a Graphics object associated with the Form object.  The second way can be exemplified as :&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt;  &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;protected override void OnPaint(PaintEventArgs e)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;  &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Graphics g = e.Graphics;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;The main difference between first and second is that in the second way, the OnPaint method is overridden. The example for the third way would be :&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Graphics g = this.CreateGraphics();&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Where &lt;i&gt;this&lt;/i&gt; refers to the Form in which this statement has been embedded. The CreateGraphics() method returns a method object of the Form. The only drawback of this approach is that the Graphics object would have to be disposed manually using dispose method of the Graphics object. I prefer the first method. Hence I would be using it henceforth.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;3. Obtaining the Image object:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.21in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Image object can be obtained in three different ways using the static methods provided by Image class:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;     &lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;   &lt;span style=&quot;font-size:100%;&quot;&gt;a. FromFile method returns an Image from the file specified as argument.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;   &lt;span style=&quot;font-size:100%;&quot;&gt;b. FromHbitmap creates and returns an Image object from a window handle to a &lt;/span&gt; &lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;       &lt;span style=&quot;font-size:100%;&quot;&gt;bitmap.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;   &lt;span style=&quot;font-size:100%;&quot;&gt;c. FromStream creates an Image object from a stream of bytes (in a file or a &lt;/span&gt; &lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;      &lt;span style=&quot;font-size:100%;&quot;&gt;database).&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.1in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Among these, the first method is most commonly used if the image is available as a file, whereas the third method comes handy in web applications where the images would be stored as a column value of a table. The following statements creates an object of Image class using the first method:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.1in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;text-indent: 0.1in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt; &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Image curImage = Image.FromFile(“flower.bmp”);&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;4. Apply manipulation methods:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.2in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;For the sole purpose of imaging, the Image class provides many methods. The most common in imaging are Flip and Rotate. The Image class provides for these by the following method – &lt;b&gt;RotateFlip. &lt;/b&gt;The parameter to this method defines whether the flip as well as rotation both has to be done or only one of flip and rotation has to be applied. It also defines through what degrees flip or rotate has to be done. The following table provides most common arguments to the RotateFlip method as well as their description. The argument being passed are the members of &lt;b&gt;RotateFlipType.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.2in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-left: 0.2in; margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.1in; margin-bottom: 0in; text-align: justify; font-family: verdana;&quot;&gt;    &lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;table  style=&quot;text-align: left; margin-left: 0px; margin-right: 0px; color: rgb(255, 255, 0);font-family:verdana;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;4&quot; frame=&quot;below&quot; width=&quot;692&quot;&gt;  &lt;col width=&quot;183&quot;&gt;  &lt;col width=&quot;477&quot;&gt;  &lt;thead&gt;   &lt;tr&gt;    &lt;td colspan=&quot;2&quot; width=&quot;674&quot;&gt;         &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Member&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;  &lt;/thead&gt;  &lt;tbody&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate180FlipNone&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;180-degree     rotation without flipping&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate180FlipX&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;180-degree     rotation with a horizontal flip&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate180FlipXY&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;180-degree     rotation with horizontal and vertical flips&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate180FlipY&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;180-degree     rotation with a vertical flip&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate270FlipNone&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;270-degree     rotation without flipping&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate270FlipX&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;270-degree     rotation with a horizontal flip&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate270FlipXY&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;270-degree     rotation with horizontal and vertical flips&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate270FlipY&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;270-degree     rotation with a vertical flip&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate90FlipNone&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;90-degree     rotation without flipping&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate90FlipX&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;90-degree     rotation with a horizontal flip&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate90FlipXY&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;90-degree     rotation with horizontal and vertical flips&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Rotate90FlipY&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;90-degree     rotation with a vertical flip&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;RotateNoneFlipNone&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;No rotation and     no flipping&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;RotateNoneFlipX&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;No rotation,     with a horizontal flip&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;RotateNoneFlipXY&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;No rotation,     with horizontal and vertical flips&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr valign=&quot;top&quot;&gt;    &lt;td width=&quot;183&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;RotateNoneFlipY&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;    &lt;td width=&quot;477&quot;&gt;     &lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;No rotation,     with a vertical flip&lt;/span&gt;&lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;  &lt;/tbody&gt; &lt;/table&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;For example to flip and rotate an image through 90 degrees on both X- and Y- axes the statement would be:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;curImage.RotateFlip(RotateFlipType.Rotate90FlipXY);&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;where curImage is an object of the type Image and the argument tells the RotateFlip method that the image has to be rotated through 90 degrees and need to be flipped both vertically and horizontally.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;That brings us to the end of this section. In the next section I would develop an application that would load, flip and rotate the loaded image.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Image Manipulation – In the Real World:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Starting from this part onwards, I would be developing an image manipulation application using C# and GDI+. The basic version that would be developed now would provide the following features:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;1. Load an image file&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;2. Rotate the loaded image 90 degrees&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;3. Flip the image along X- axis&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;First the menus have to be setup as shown in the figure below.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Fig1 –  GDI_1.jpg&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Fig2 - GDI_1_RotateFlip.jpg &lt;/span&gt; &lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;The names of the menus are:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;mnuLoad – the submenu that would show the Open dialog box and loads the file&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;mnu90rotate – rotates the image by 90 degrees.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;mnuXfilp- flips the image along X-axis.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Here is the handler for loading the image:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;private void mnuLoad_Click(object sender,&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;System.EventArgs e)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// Create OpenFileDialog&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;OpenFileDialog opnDlg = new OpenFileDialog();&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// Set a filter for images&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;opnDlg.Filter =&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;&quot;All Image files|*.bmp;*.gif;*.jpg;*.ico;&quot;+&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;&quot;*.emf;,*.wmf|Bitmap Files(*.bmp;*.gif;*.jpg;&quot;+&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;&quot;*.ico)|*.bmp;*.gif;*.jpg;*.ico|&quot;+&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;&quot;Meta Files(*.emf;*.wmf;*.png)|*.emf;*.wmf;*.png&quot;;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;opnDlg.Title = &quot;ImageViewer: Open Image File&quot;;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;opnDlg.ShowHelp = true;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// If OK, selected&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;if(opnDlg.ShowDialog() == DialogResult.OK)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// Read current selected file name&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;curFileName = opnDlg.FileName;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// Create the Image object using&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// Image.FromFile&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;try&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;            &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;curImage = Image.FromFile(curFileName);&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;catch(Exception exp)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;            &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;MessageBox.Show(exp.Message);&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// Repaint the form, which forces the paint&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// event handler&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Invalidate();&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt; &lt;span style=&quot;font-size:100%;&quot;&gt;The name of the file returned by the open file dialog is set as the current file name. then it is used to load the file using the FromFile function of the Image class. The returned image is assigned to the curImage variable which is of type Image and its scope is of class level. Next Inavlidate() method is called so that paint event is fired. Following the code, embedded in the Form’s Paint method handler, that actually draws the image:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;private void Form1_Paint(object sender,&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;System.Windows.Forms.PaintEventArgs e)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;          &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Graphics g = e.Graphics;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;          &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;if(curImage != null)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;          &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;               &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// Draw image using the DrawImage method&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;               &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;g.DrawImage(curImage,&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;                    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;AutoScrollPosition.X,&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;                    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;AutoScrollPosition.Y,&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;                    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;curImage.Width,&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;                    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;curImage.Height );&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;          &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;The logic checks whether the current image is null or not. If not null, the DrawImage method of Graphic class is given the curImage as the Image to be loaded. The Graphic object is obtained from the Graphics property of PaintEventArgs object. Next the handler for rotating the image – it is embedded in the handler for the mnu90rotate menu item. Here is the code:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// Rotate 90 degrees&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;private void mnu90rotate_Click(object sender,&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;System.EventArgs e)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;if(curImage != null)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;curImage.RotateFlip(&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;            &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;RotateFlipType.Rotate90FlipNone);&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Invalidate();&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;The image is rotated using the RotateFlip method of Image class. Since curImage is of Image class type, hence the method can be directly called on the Image object. Next it calls the Inavlidate() method to redraw the image.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Last comes the flip logic. It is embedded in the handler for the mnuXflip menu item.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;// Flip X&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;private void mnuXflip_Click(object sender,&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;System.EventArgs e)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;if(curImage != null)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;curImage.RotateFlip(&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;            &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;RotateFlipType.RotateNoneFlipX);&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;        &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Invalidate();&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;    &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p  style=&quot;margin-bottom: 0in; text-align: justify;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify; font-family: verdana;&quot;&gt; &lt;/div&gt;&lt;p face=&quot;verdana&quot; style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;That’s all for the example. This sets up the stage for image manipulation using GDI+ in C#. However certain aspects of the problem of image manipulation have been left out including saving the image and how GDI+ works. These will be the topics that will be tackled in the next part of this series. Till then…&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify; font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Note: You can find the article on: http://www.aspfree.com/c/a/C-Sharp/Basic-Image-Manipulation-using-GDI-and-C/&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/171814917483803947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/171814917483803947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/171814917483803947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/171814917483803947'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2008/08/image-manipulation-using-gdi-c-way.html' title='Image Manipulation using GDI+ - the C# way : Basics'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-6847503163830020236</id><published>2008-08-16T06:29:00.000-07:00</published><updated>2008-08-16T06:47:38.188-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Declarative Security"/><category scheme="http://www.blogger.com/atom/ns#" term="JEE 5.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Realms"/><title type='text'>Realms- Securing the J2EE Applications using Container Services</title><content type='html'>&lt;div&gt;              &lt;style type=&quot;text/css&quot;&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }  --&gt;  &lt;/style&gt;  &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;b&gt;Realms- Securing the J2EE Applications using Container Services&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;In the world of web applications, security is paramount, more so when the platform is J2EE. A J2EE application consists of different components such as Web Component, Business Logic components and so on. Each of these components execute in their own containers. So, in essence, each component can be provided security by the container in two ways:&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;Declarative Security&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;Declarative security is based on Realms, Roles, Users and Groups (more on that later).&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot; start=&quot;2&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;Programmatic  Security&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;In Programmatic security, the security is provided through the code embedded in the application itself.  Java Authentication and Authorization Services or JAAS belongs to this category.  &lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;Securing a web application (for that matter any application) has always two broad phases- Authentication and Authorization. In authentication one validates the credentials of the user. Login procedure is a part of authentication. The next step is setting up and controlling the access rights of the successfully authenticated user. This complete phase comes under Authorization. In authorization a user’s right to access the resources provided by the application is controlled.  &lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;In a J2EE application, both of these are managed using Declarative Security. The security service uses the verified credentials supplied at the authentication to control the access to the resources within the application. Hence when authorization comes into picture authentication must also be addressed. Hence here both the phases and the role of Realms in these phases will be discussed here.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;b&gt;Realms, Roles and  Users:&lt;/b&gt;&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;Realms, roles and users- these words crop up every time security is discussed in the context of J2EE security. So what are these? Let’s have a detailed view of the trinity of security.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;ol&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;Realms:&lt;/p&gt;  &lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;A realm defines the boundary of an application. Whatever comes within this boundary is secure. Technically, a realm is a policy that defines how a user is authenticated in a secured domain. This policy contains the list of users and the mechanism to authenticate them. This is similar to Access Control List and authentication mechanism deployed by Windows NT based systems and/or UNIX based systems.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;ol start=&quot;2&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;User/Principal:&lt;/p&gt;  &lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;A Principal is user within the security policy domain. The principal is also known as user within the realm. The username of the user that he/she uses to login and that user’s principal name need not be similar. That’s what the J2EE specification tells but almost all the J2EE implementations utilize the username itself as the principal name.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;ol start=&quot;3&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;Roles:&lt;/p&gt;  &lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;Roles are the references to the actual roles described within the application. The developer uses this reference to map the user to a role. Each user has a role reference mapped into his/her principal name. The reference in turn is mapped onto the actual role within the application.  Common role references are Administrator, role1 etc.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot; start=&quot;2&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;b&gt;Common  Implementations of Realms:&lt;/b&gt;&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;As mentioned J2EE application starts using the container’s security services from the time of user’s authentication. Hence the chief implementations of realms also are based on how or where the principals and the related realms are stored. Whenever the container needs to lookup the names and the roles, it uses these ‘storages’.  The users and their roles can be stored in three major ways which are xml files, relational databases and directory of LDAP based directory server. So the implementations are:&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;ol&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;Memory Realm&lt;/p&gt;   &lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;JDBC Realm&lt;/p&gt;   &lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;JNDI Realm&lt;/p&gt;  &lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;Memory  Realm:&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.81in; margin-bottom: 0in; text-align: justify;&quot;&gt;Memory realm is based on xml files. All the user names, passwords and their respective roles are stored in a xml file. Whenever the container starts up, it parses this xml file and loads the information into the memory. So until the server is stopped, the complete information is stored within the memory space of the container. Whenever authentication and successive authorization has to be done the supplied credentials (from here I will be using the term credentials for the information supplied by the user) are checked against the in-memory information. The upside of this implementation is that it is easier to setup and use. The downside is that newer information added to the xml file won’t be reflected till the container is restarted.  So it is not a good choice for production purposes.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;               &lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot; start=&quot;2&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;JDBC Realm:&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.81in; margin-bottom: 0in; text-align: justify;&quot;&gt;In JDBC realm, the credentials of a user are stored in a relational database table. The container uses JDBC driver to access the information. The major difference between memory realm and JDBC realm is the way in which the credentials are stored. The JDBC realm, as already said, uses tables. The default (also the commonly used) names of these tables are Users and Roles. Whenever a new user is registered, the application or the web administrator has to enter the credentials into the Users table and the corresponding role has to be entered into the Roles table. The container, whenever required uses the information available in the tables to authenticate as well authorize a particular user. The advantage of this implementation is that new information can be entered and used without restarting the server. Also data becomes more secure as the data is not stored in plain text files. Hence for most of the production purposes it is recommended as well as used.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.56in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot; start=&quot;3&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;JNDI Realms:&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.81in; margin-bottom: 0in; text-align: justify;&quot;&gt;JNDI Realm uses LDAP services provided by a JNDI provider. This is the most complex and the most extensive container based security implementation that any vendor provides. An LDAP directory server contains credentials of the user.  The credentials are kept as directory entries in the server. These entries are accessed via the JNDI services within the container.  By default, the authentication is done by Bind mode. In this mode, the realm binds the user to the DN entry of the LDAP server using the username and password provided by the user. A user is said to be authenticated if this simple bind succeeds. The passwords of the registered users are not saved in plain text. Instead digest of these passwords are store. Digesting is a form of encryption. So security fears can be dispelled. Again, as in the case of JDBC realms, the entry of registered users is left to the application or web administrator. Though JDBC and JNDI are almost similar, yet the extensive choices provided by the JNDI realm gives it an upper hand.  &lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot; start=&quot;3&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;b&gt;Implementation of  Realm -An example:&lt;/b&gt;&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;So much for the theory, lets see a real world example. As I have already mentioned, in the Declarative security, the constraints are declared in the deployment descriptor i.e. web.xml. So the only part one has to deal with as a web developer is deployment descriptor.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;The example that I am citing here deals with a java based Content Management System (CMS). The CMS (lets call it JCMS) has certain resources such as video files, documents etc that can be accessed only by authorized users only. To be more precise we have secure the folders containing the resources.  Let’s see how to do it.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;Once all the mappings concerning the web application are done, the security declarations and mappings come into picture. The mapping for securing the application resources comes between the following:&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;web-app&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;security-constraint&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;:&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;:&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;:&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;/security-constraint&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&lt;b&gt;:&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&lt;b&gt;:&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;/&lt;/b&gt;&lt;i&gt;web-app&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;In other words to the security mapping &lt;b&gt;&amp;lt;security-constraint&amp;gt; &lt;/b&gt;acts as parent node. Then the resources that have to be secured must be declared.  Like servlet mappings it can be done for each resource separately or all the resources can be brought under the same declaration.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;&lt;/b&gt;&lt;i&gt;web-app&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&lt;b&gt;:&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;security-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&lt;b&gt;&amp;lt;web-resource-collection&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&lt;b&gt;:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&lt;b&gt;:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&lt;b&gt;&amp;lt;/web-resource-collection&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;/security-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;/&lt;/b&gt;&lt;i&gt;web-app&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;The  &amp;lt;web-resource-collection&amp;gt; encapsulates the various resources that has to be secured. The next step is to give the name to the resource realm and then provide the url that would be used to access the resources.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;&lt;/b&gt;&lt;i&gt;web-app&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;:&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;security-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; text-indent: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt; &lt;i&gt;&amp;lt;web-resource-collection&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;        &lt;i&gt;  &lt;/i&gt;&lt;b&gt; &amp;lt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;web-resource-name&amp;gt;Protected Area&amp;lt;/web-resource-name&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 2.08in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&lt;b&gt;&amp;lt;!-- Define the context-relative URL(s) to be protected --&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;    &amp;lt;url-pattern&amp;gt;/secured/resources/*&amp;lt;/url-pattern&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;                                  &lt;b&gt;:&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;    :&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt; &amp;lt;/web-resource-collection&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;/security-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;/&lt;/b&gt;&lt;i&gt;web-app&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;Then, tell the container, what are the HTTP methods, that would be used to access the resources. If the methods are listed, then only those methods would be protected.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;&lt;/b&gt;&lt;i&gt;web-app&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;:&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;security-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; text-indent: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt; &lt;i&gt;&amp;lt;web-resource-collection&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;        &lt;i&gt;  &lt;/i&gt;&lt;b&gt; &lt;/b&gt;&lt;i&gt;&amp;lt;web-resource-name&amp;gt;Protected Area&amp;lt;/web-resource-name&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;    &amp;lt;!-- Define the context-relative URL(s) to be protected --&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;        &lt;i&gt;     &amp;lt;url-pattern&amp;gt;/secured/resources/*&amp;lt;/url-pattern&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;    &lt;/i&gt;&lt;b&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&amp;lt;http-method&amp;gt;DELETE&amp;lt;/http-method&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;        &lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&lt;b&gt;     &amp;lt;http-method&amp;gt;GET&amp;lt;/http-method&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;         &lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&lt;b&gt;    &amp;lt;http-method&amp;gt;POST&amp;lt;/http-method&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; text-indent: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;  &lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&lt;b&gt;   &amp;lt;http-method&amp;gt;PUT&amp;lt;/http-method&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;                &lt;i&gt;&amp;lt;/web-resource-collection&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;  &lt;b&gt;    :&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;    :&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;/security-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;/&lt;/b&gt;&lt;i&gt;web-app&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;Here we are telling the container that we want to authenticate all DELETE, GET,POST,PUT methods. So whenever any one of these methods are used in request, then container fires up the authentication process. But there are five types of authentication ( Form based and Basic are two of the most commonly used. How to tell the container which one to use? But before that the container needs to be told the authentic users for this resource. This is done a follows:&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&amp;lt;&lt;i&gt;web-app&lt;/i&gt;&amp;gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;:&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;:&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;security-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; text-indent: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt; &lt;i&gt;&amp;lt;web-resource-collection&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;        &lt;i&gt;  &lt;/i&gt;&lt;b&gt; &lt;/b&gt;&lt;i&gt;&amp;lt;web-resource-name&amp;gt;Protected Area&amp;lt;/web-resource-name&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;    &amp;lt;!-- Define the context-relative URL(s) to be protected --&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;        &lt;i&gt;     &amp;lt;url-pattern&amp;gt;/secured/resources/*&amp;lt;/url-pattern&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;    &amp;lt;http-method&amp;gt;DELETE&amp;lt;/http-method&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;        &lt;i&gt;     &amp;lt;http-method&amp;gt;GET&amp;lt;/http-method&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;         &lt;i&gt;    &amp;lt;http-method&amp;gt;POST&amp;lt;/http-method&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; text-indent: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;  &lt;i&gt;   &amp;lt;http-method&amp;gt;PUT&amp;lt;/http-method&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;                &lt;i&gt;&amp;lt;/web-resource-collection&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;  &lt;b&gt;  &lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&amp;lt;auth-constraint&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&lt;b&gt;&amp;lt;!-- Anyone with one of the listed roles may access this area --&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;         &lt;b&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;  &amp;lt;role-name&amp;gt;raj&amp;lt;/role-name&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;    &amp;lt;role-name&amp;gt;admin&amp;lt;/role-name&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;      &lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&lt;b&gt; &amp;lt;/auth-constraint&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;/security-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;:&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;   :&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;/&lt;/b&gt;&lt;i&gt;web-app&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;            Once the user list is given, then the part comes where the type of authentication has to be provided.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&amp;lt;&lt;i&gt;web-app&lt;/i&gt;&amp;gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;security-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; text-indent: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt; &lt;i&gt;&amp;lt;web-resource-collection&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;        &lt;i&gt;  &lt;/i&gt;&lt;b&gt; &lt;/b&gt;&lt;i&gt;&amp;lt;web-resource-name&amp;gt;Protected Area&amp;lt;/web-resource-name&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;    &amp;lt;!-- Define the context-relative URL(s) to be protected --&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;        &lt;i&gt;     &amp;lt;url-pattern&amp;gt;/secured/resources/*&amp;lt;/url-pattern&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;    &amp;lt;http-method&amp;gt;DELETE&amp;lt;/http-method&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;        &lt;i&gt;     &amp;lt;http-method&amp;gt;GET&amp;lt;/http-method&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;         &lt;i&gt;    &amp;lt;http-method&amp;gt;POST&amp;lt;/http-method&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; text-indent: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;  &lt;i&gt;   &amp;lt;http-method&amp;gt;PUT&amp;lt;/http-method&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;                &lt;i&gt;&amp;lt;/web-resource-collection&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;  &lt;b&gt;  &lt;/b&gt;&lt;i&gt;&amp;lt;auth-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;!-- Anyone with one of the listed roles may access this area --&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;         &lt;i&gt;  &amp;lt;role-name&amp;gt;raj&amp;lt;/role-name&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;    &amp;lt;role-name&amp;gt;admin&amp;lt;/role-name&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;      &lt;i&gt; &amp;lt;/auth-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;i&gt;&amp;lt;/security-constraint&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt; &amp;lt;login-config&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;      &lt;b&gt; &amp;lt;auth-method&amp;gt;BASIC&amp;lt;/auth-method&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;      &lt;b&gt; &amp;lt;realm-name&amp;gt;Example Basic Authentication Area&amp;lt;/realm-name&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;text-indent: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family:Courier New, monospace;&quot;&gt;&amp;lt;/login-config&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 1.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;:&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;   :&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;b&gt;&amp;lt;/&lt;/b&gt;&lt;i&gt;web-app&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;The &amp;lt;login-config&amp;gt; is the place where the type of authentication and the realm to be authenticated. Here we are using BASIC authentication that means whenever anyone tries to access the secured resources the container pops up the standard window dialog demanding the user name and password.  &lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;So we have secured our application without even writing a line of java code. Easy… isn’t it?&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;Where should one go from here? The next logical step is making the application more secure by using JAAS. How to do it … it’s for another time.&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-left: 0.5in; margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;          &lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;  &lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/6847503163830020236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/6847503163830020236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/6847503163830020236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/6847503163830020236'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2008/08/realms-securing-j2ee-applications-using.html' title='Realms- Securing the J2EE Applications using Container Services'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-116742419157581881</id><published>2008-05-10T08:02:00.000-07:00</published><updated>2008-05-10T08:32:55.703-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Rails"/><title type='text'>Rails 2.0: Why change the scaffolding</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Rails 2.0.3 is now in market. There are many changes such as multi-views, using Model objects as resource handlers etc. However, the main change is how the scaffolding is done. Gone are the days of issuing Scaffold command and the table to be scaffolded. For example, if the name of table to be scaffold is Emp having Id and name . In the pre 2.0 era I would have given the following command&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;ruby script/generate scaffold Emp empAdmin&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;That would have generated the model named Emp with controller having the name empAdminController and the related views. Now how things have changed in 2.0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;ruby script/generate scaffold Emp name:string&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Yes, I had to pass the non id attributes to the scaffold command. Now if it is a trivial table with 3 or 4 columns then well and good. However, a table in real world will have atleast 15 columns then its just too much. I know scaffold is not seen as a good parctice in 2.0. However, &lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;scaffold &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;was the reason I admired Rails. Now it seems like Rails is also making development a bit complex. Apart from that Rails 2.0 is really great.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/116742419157581881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/116742419157581881' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/116742419157581881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/116742419157581881'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2008/05/rails-20-why-change-scaffolding.html' title='Rails 2.0: Why change the scaffolding'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-8930731409049828441</id><published>2008-05-03T00:25:00.000-07:00</published><updated>2008-05-03T01:30:28.700-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="JEE 5.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Rails"/><title type='text'>Active Records v/s Hibernate - Round II</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Welcome to the round two of Active Record v/s Rails. This round is based upon implementation of ORM classes. Lets start with Hibernate. The steps to implement ORM class in Hibernate are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Name the class (preferable) according to the table. For example, if table is named Employee, then the class is also named Employee. This is preferable but optional.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Next declare the instance variable corresponding to the attributes of the table with which class is to be mapped. For example, if the Employee table has an attribute named Name, then the class will have an instance variable named Name. Its data-type will be the Java equivalent of SQL type. If Name attribute is varchar, the name instance variable will be String.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Last step is to implement getters and setters for the instance variables.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Next let us see how to do this with Active Record&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Name the class  according to the table. For example, if table is named Employee, then the class is also named Employee. This is mandatory if you do not want to override the defaults.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Derive the class from Base class of ActiveRecord package. For example, the Employee class needs to be derived from Base::ActiveRecord.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Thats it just two steps. No need to declare any instance variable or any getter/setter. So how does Rails gives you the data? It does it as follows:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;When the ORM object is created Rails reads the schema of the table and through meta-programming, creates corresponding instance variables in the ORM object.&lt;/li&gt;&lt;li&gt;Next, Rails populates the object with the data from the table.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Using meta-programming and reflection Rails dynamically does everything. In the next post the third round will start on the basis of Query Language supported by both.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/8930731409049828441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/8930731409049828441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/8930731409049828441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/8930731409049828441'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2008/05/active-records-vs-hibernate-round-ii.html' title='Active Records v/s Hibernate - Round II'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-5604761780988854459</id><published>2007-10-06T09:08:00.000-07:00</published><updated>2008-04-28T20:43:46.135-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActiveRecords"/><category scheme="http://www.blogger.com/atom/ns#" term="Hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="JEE 5.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Rails"/><title type='text'>Active Record v/s Hibernate - Round I</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;You will have heard of shiny new web application framework called Ruby-on-Rails also known as RoR or simply Rails. It provides complete stack from ORM framework to Web Service. From this post onwards for next couple of posts I will compare and contrast between different components of JEE and Rails. I will begin with Hibernate from JEE and Active Record from Rails. The Round I of the Active Record v/s Hibernate will be on the basis of &lt;span style=&quot;font-weight: bold;&quot;&gt;Mapping&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;The very first aspect is mapping. Hibernate requires the POJO (Java objects that represents the tables) be mapped with the tables using XML. That means if there is even a slight change in the Database schema such as the length of a particular field is changed, then you will have to make changes not only to the corresponding POJO but also to the mapping file. If you fail to do so, then run-time exception is the most common and the least problem that you will face.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;Now lets look at Active Record. The driving principle of Rails is &quot;Convention-over-Configuration&quot; (but version 2.0 is deviating from it, more on that later). So , to map a class to a database table you just have to follow conventions. The conventions are&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol style=&quot;text-align: justify; font-family: georgia;&quot;&gt;&lt;li&gt;The class derives from ActiveRecord::Base i.e. Base class of ActiveRecord module&lt;/li&gt;&lt;li&gt;The name of the class must be same as that of the table&lt;/li&gt;&lt;li&gt;The name of the class should start with a capital letter (though this applies to all Ruby classes)&lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;Thats it. No XML, no configuration. Even if there is a change in the table, the corresponding class will adapt to it automatically at runtime through reflection and meta-programming. So that is the difference between Active Records and Hibernate on the basis of Mapping. In the next post I will continue comparing the two on how ORM classes are defined.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;color: rgb(51, 204, 0);&quot;&gt;Authors Note: I am really sorry for the gap between the posts. It wont happen again (this time for sure). For now on you can expect atleast one post in a week.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/5604761780988854459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/5604761780988854459' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/5604761780988854459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/5604761780988854459'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/10/active-record-vs-hibernate-round-i.html' title='Active Record v/s Hibernate - Round I'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-6288424951762331667</id><published>2007-10-04T07:17:00.000-07:00</published><updated>2008-12-13T00:25:25.646-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JEE 5.0"/><category scheme="http://www.blogger.com/atom/ns#" term="JSF"/><category scheme="http://www.blogger.com/atom/ns#" term="managed beans"/><title type='text'>Accessing Managed Beans from backing bean</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiULczF5BB52J817-GUEJqEssTNSpcoYjlemo22RavA_JqI-zcKBG3qoiLjKmoy8wa-AzGUxIY8qrASilwcQQCgvBt9K-bTf8iwUzMjQusyBYE9jHmgLI5Rk75KOHSnbksJ2rCRojz-V-_5/s1600-h/art_j.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiULczF5BB52J817-GUEJqEssTNSpcoYjlemo22RavA_JqI-zcKBG3qoiLjKmoy8wa-AzGUxIY8qrASilwcQQCgvBt9K-bTf8iwUzMjQusyBYE9jHmgLI5Rk75KOHSnbksJ2rCRojz-V-_5/s320/art_j.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5117492110554595810&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9FH2z_yHSh7O1WiWgeTCqu-jYR8hJB1nqxCVJwYoMBDMG0cypqtpuWNEc2YHKPZLWMYP4Vd4boGGi8Awrlo5dK8pqP-B1WXXB3UOm1-W8ie03BdO9iCYTJnMsId_gBfbyikKgEHy5R6cP/s1600-h/art_s.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9FH2z_yHSh7O1WiWgeTCqu-jYR8hJB1nqxCVJwYoMBDMG0cypqtpuWNEc2YHKPZLWMYP4Vd4boGGi8Awrlo5dK8pqP-B1WXXB3UOm1-W8ie03BdO9iCYTJnMsId_gBfbyikKgEHy5R6cP/s320/art_s.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5117492209338843634&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUeBcKQ38w6E8vtOK7wymCF1f5ug5xQkKSZWMUZg9VSKfWqnUSjTOxOLxuNhRRCG8j1OWZc-3dF5qIKGofcK6kqWNzNNmGCMfifoNfpvAIjUgu9b0OnlZwFJljObmKBvDKjQm4dJ24K7Zf/s1600-h/art_f.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUeBcKQ38w6E8vtOK7wymCF1f5ug5xQkKSZWMUZg9VSKfWqnUSjTOxOLxuNhRRCG8j1OWZc-3dF5qIKGofcK6kqWNzNNmGCMfifoNfpvAIjUgu9b0OnlZwFJljObmKBvDKjQm4dJ24K7Zf/s320/art_f.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5117492338187862530&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;Sun created JSF as a competition for ASP.net. Though the idea is good, yet, the Sun stuck with the aspect of configuration. So if I need the framework to manage any of my beans automatically, then I need to specify it in faces-config.xml. Lets say my bean is named ResultBean, then I will have to put it as follows&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;b  style=&quot;font-family:verdana;&quot;&gt;&lt;managed-bean&gt; &lt;/managed-bean&gt;&lt;/b&gt;&lt;b  style=&quot;font-family:verdana;&quot;&gt;&lt;span dir=&quot;rtl&quot; lang=&quot;AR-SA&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;  &lt;p class=&quot;MsoNormal&quot; dir=&quot;ltr&quot;  style=&quot;text-align: left; direction: ltr; unicode-bidi: embed;font-family:verdana;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;AR-SA&quot;&gt;&lt;span style=&quot;&quot;&gt; &amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&lt;managed-bean-name&gt;&lt;/managed-bean-name&gt;&lt;/b&gt;&lt;b style=&quot;font-family: verdana;&quot;&gt;managed-bean&amp;gt; &lt;/b&gt;&lt;b style=&quot;font-family: verdana;&quot;&gt;&lt;span dir=&quot;rtl&quot; lang=&quot;AR-SA&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;text-align: left; direction: ltr; unicode-bidi: embed; font-family: verdana;&quot;&gt;&lt;span dir=&quot;ltr&quot;&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;AR-SA&quot;&gt;&lt;span dir=&quot;ltr&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;&quot;&gt;          &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;b face=&quot;verdana&quot;&gt;&lt;managed-bean&gt; &lt;/managed-bean&gt;&lt;/b&gt;&lt;b face=&quot;verdana&quot;&gt;&lt;span dir=&quot;rtl&quot; lang=&quot;AR-SA&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;text-align: left; direction: ltr; unicode-bidi: embed; font-family: verdana;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;AR-SA&quot;&gt;&lt;span style=&quot;&quot;&gt; &amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;managed-bean-name&gt;Result&lt;/b&gt;&lt;b face=&quot;verdana&quot;&gt;&lt;managed-bean&gt;&lt;/managed-bean&gt;&lt;/b&gt;&lt;b&gt;&lt;span lang=&quot;AR-SA&quot;&gt;&lt;span style=&quot;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;/managed-bean-name&amp;gt; &lt;/b&gt;&lt;b&gt;&lt;span dir=&quot;rtl&quot; lang=&quot;AR-SA&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;text-align: left; direction: ltr; unicode-bidi: embed; font-family: verdana;&quot;&gt;&lt;b&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&amp;lt;managed-bean-class&amp;gt;org.me.ResultBean&amp;lt;/managed-bean-class&amp;lt; &lt;/b&gt;&lt;b&gt;&lt;span dir=&quot;rtl&quot; lang=&quot;AR-SA&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;text-align: left; direction: ltr; unicode-bidi: embed; font-family: verdana;&quot;&gt;&lt;span dir=&quot;ltr&quot;&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;AR-SA&quot;&gt;&lt;span dir=&quot;ltr&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;&quot;&gt;           &lt;/span&gt;&amp;lt;managed-bean-scope&amp;gt;session&amp;lt;/managed-bean-scope&amp;gt; &lt;/b&gt;&lt;b&gt;&lt;span dir=&quot;rtl&quot; lang=&quot;AR-SA&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;text-align: left; direction: ltr; unicode-bidi: embed; font-family: verdana;&quot;&gt;&lt;span dir=&quot;ltr&quot;&gt;&lt;/span&gt;&lt;b&gt;&lt;span dir=&quot;ltr&quot;&gt;&lt;/span&gt;&amp;lt;managed-bean&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; dir=&quot;ltr&quot;  style=&quot;text-align: left; direction: ltr; unicode-bidi: embed;font-family:verdana;&quot;&gt;&lt;b&gt;&lt;span dir=&quot;rtl&quot; lang=&quot;AR-SA&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; dir=&quot;ltr&quot;  style=&quot;text-align: left; direction: ltr; unicode-bidi: embed;font-family:verdana;&quot;&gt;&lt;span dir=&quot;ltr&quot;&gt;&lt;/span&gt;&lt;b&gt;&lt;span dir=&quot;ltr&quot;&gt;&lt;/span&gt;&lt;managed-bean&gt;&lt;/managed-bean&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;Now let us say there is another bean named ValueSetter, which is also a managed bean, wants to access the ResultBean, then the technique is classic Java technique. It goes something like as under&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Get a reference to FacesContext which essentially is ServletContex when compared to Servlet&lt;/li&gt;&lt;li&gt;From FacesContext reference get current Application object&lt;/li&gt;&lt;li&gt;From Application object get a reference to VariableResolver object&lt;/li&gt;&lt;li&gt;Call resolveVariable method on it passing reference of the FacesContext and the name of the bean as string (not the class name)&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;In code it will be as follows&lt;br /&gt;&lt;/span&gt;&lt;p class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; face=&quot;verdana&quot; style=&quot;text-align: left; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;FacesContext context = FacesContext.getCurrentInstance();&lt;/span&gt; &lt;/b&gt;&lt;b&gt;&lt;span dir=&quot;rtl&quot; lang=&quot;AR-SA&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;text-align: left; direction: ltr; unicode-bidi: embed; font-family: verdana;&quot;&gt;&lt;b&gt;ResultBean bean = (ResultBean) context.getApplication().getVariableResolver().resolveVariable(context, &quot;Result&quot;);&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span dir=&quot;rtl&quot; lang=&quot;AR-SA&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;b style=&quot;font-family: verdana;&quot;&gt;&lt;span dir=&quot;rtl&quot; lang=&quot;AR-SA&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;As you have seen how many objects need to be used. Cant it be made simpler?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/6288424951762331667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/6288424951762331667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/6288424951762331667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/6288424951762331667'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/10/accessing-managed-beans-from-backing.html' title='Accessing Managed Beans from backing bean'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiULczF5BB52J817-GUEJqEssTNSpcoYjlemo22RavA_JqI-zcKBG3qoiLjKmoy8wa-AzGUxIY8qrASilwcQQCgvBt9K-bTf8iwUzMjQusyBYE9jHmgLI5Rk75KOHSnbksJ2rCRojz-V-_5/s72-c/art_j.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-7353983721031751090</id><published>2007-10-02T05:47:00.000-07:00</published><updated>2008-12-13T00:25:26.220-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JEE 5.0"/><category scheme="http://www.blogger.com/atom/ns#" term="JSP"/><category scheme="http://www.blogger.com/atom/ns#" term="JSP Implicit Objects"/><title type='text'>JSP and Servlet - Implicit objects</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgRiMVQhXmTpqu3_gAZ83VPvncyMzlJkBKmkEg8a33TVGdB5qegqn-pDKxvXKdOYK6hlkjxv0MpydXDyBzfvvPu3mTfTxuSxaCnN5tazIbIBqE_E68kRHpDVqYWfm94vSPpg3f5T-oVa6z/s1600-h/art_j.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgRiMVQhXmTpqu3_gAZ83VPvncyMzlJkBKmkEg8a33TVGdB5qegqn-pDKxvXKdOYK6hlkjxv0MpydXDyBzfvvPu3mTfTxuSxaCnN5tazIbIBqE_E68kRHpDVqYWfm94vSPpg3f5T-oVa6z/s320/art_j.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5116728027282702770&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUNNBax-LlPahv6-BjNz9Mkn9h0iZm_oOHvHmpOPcBvL0tpz4E1h3MUrbyrGNskdHMvUJbyjgLhKt5fEQLqBuT6jSM1eIm6AXglS1j2p1rzbWV6xCjuBBx3TAhauzIivcgwXnrud81Ypm_/s1600-h/art_s.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUNNBax-LlPahv6-BjNz9Mkn9h0iZm_oOHvHmpOPcBvL0tpz4E1h3MUrbyrGNskdHMvUJbyjgLhKt5fEQLqBuT6jSM1eIm6AXglS1j2p1rzbWV6xCjuBBx3TAhauzIivcgwXnrud81Ypm_/s320/art_s.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5116728160426688962&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq76MKvl0c_y3TLSoES8hl5_21PEpV23xwc8FR53fkq8PxbEkjeYKWHdPZ9KwGwldiJuuZ8tZ6EEEjeJo79Jfq9OEMeBLzGWOuo-pu1MtF2jm99CX-jyFf_gGh-2YMC9FT9NphkiWCbtZK/s1600-h/art_p.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq76MKvl0c_y3TLSoES8hl5_21PEpV23xwc8FR53fkq8PxbEkjeYKWHdPZ9KwGwldiJuuZ8tZ6EEEjeJo79Jfq9OEMeBLzGWOuo-pu1MtF2jm99CX-jyFf_gGh-2YMC9FT9NphkiWCbtZK/s320/art_p.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5116728323635446226&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;JSP provides following implicit objects&lt;br /&gt;&lt;/span&gt;&lt;ol style=&quot;font-family: verdana;&quot;&gt;&lt;li&gt;request&lt;/li&gt;&lt;li&gt;response&lt;/li&gt;&lt;li&gt;session&lt;/li&gt;&lt;li&gt;page&lt;/li&gt;&lt;li&gt;application&lt;/li&gt;&lt;li&gt;exception&lt;/li&gt;&lt;li&gt;pageContext&lt;/li&gt;&lt;li&gt;out&lt;/li&gt;&lt;/ol&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;The first question any interviewer or external asks is to name all the implicit object. The next question is which Servlet object corresponds to which JSP implicit object. So from this post onwards I will discuss this aspect. This post looks at request object.&lt;br /&gt;&lt;br /&gt;You will be knowing that when JSP is compiled, it becomes a Servlet. HttpServletRequest is one of the two objects passes as arguments to the service method of the Servlet class. In case of compiled JSP, the name of the service method is &lt;span style=&quot;font-weight: bold;&quot;&gt;_jspService, &lt;/span&gt;the only method that a developer cannot override. When the compilation takes place the &lt;span style=&quot;font-weight: bold;&quot;&gt;request&lt;/span&gt; object is accessed as an object of HttpServletRequest. To cut a long story short &lt;span style=&quot;font-weight: bold;&quot;&gt;request&lt;/span&gt; object corresponds to &lt;span style=&quot;font-weight: bold;&quot;&gt;HttpServletRequest. &lt;/span&gt;In the next post I will discuss about response and out objects. Till then keep visiting...&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/7353983721031751090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/7353983721031751090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/7353983721031751090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/7353983721031751090'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/10/jsp-and-servlet-implicit-objects.html' title='JSP and Servlet - Implicit objects'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgRiMVQhXmTpqu3_gAZ83VPvncyMzlJkBKmkEg8a33TVGdB5qegqn-pDKxvXKdOYK6hlkjxv0MpydXDyBzfvvPu3mTfTxuSxaCnN5tazIbIBqE_E68kRHpDVqYWfm94vSPpg3f5T-oVa6z/s72-c/art_j.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-8976465994031185145</id><published>2007-09-30T07:12:00.000-07:00</published><updated>2008-12-13T00:25:26.835-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JEE 5.0"/><title type='text'>Why Annotations cant be used always?</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrB-3CDC7nIYfSCrHHwHvrY7LykvQe4waEo44ywnLBZNv-hZyPoRRo4codgQfmZUwe_e-X2RUvjoLD5JSEuLu4e1J3QTCzCgMowHGasa8H4jgV_fUBx8For4B5hhIoJXLL59R75qhLT5We/s1600-h/art_j.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrB-3CDC7nIYfSCrHHwHvrY7LykvQe4waEo44ywnLBZNv-hZyPoRRo4codgQfmZUwe_e-X2RUvjoLD5JSEuLu4e1J3QTCzCgMowHGasa8H4jgV_fUBx8For4B5hhIoJXLL59R75qhLT5We/s320/art_j.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5116006043280245106&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUsi5AR5lSQpdyW-NuaDNkwX8exucBWUTDzTr8PccG0B9WDuVfe2Hu8SttxWMpyqw7wJBBz-xTFMPuarE4WLxfLsxn1k3EWNb8byBPB6YHoQNzNRchWWJWQTrHioBTv9rhaYVQky_1yt2Q/s1600-h/art_e.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUsi5AR5lSQpdyW-NuaDNkwX8exucBWUTDzTr8PccG0B9WDuVfe2Hu8SttxWMpyqw7wJBBz-xTFMPuarE4WLxfLsxn1k3EWNb8byBPB6YHoQNzNRchWWJWQTrHioBTv9rhaYVQky_1yt2Q/s320/art_e.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5116006129179591042&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQoFSWMKxF7mrSXYniZ7nngXvSwDbqjGmVmVWIR1ppD77g4O_Q3qPteVJRTduIiukz21E_3q00ZgjIv-nuiOergSQ9ZLfnYntK3tZP9Fy5GfUIDtKFK2n8q3Q8rU45oPzfdkaX4j-xRSpE/s1600-h/art_e.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQoFSWMKxF7mrSXYniZ7nngXvSwDbqjGmVmVWIR1ppD77g4O_Q3qPteVJRTduIiukz21E_3q00ZgjIv-nuiOergSQ9ZLfnYntK3tZP9Fy5GfUIDtKFK2n8q3Q8rU45oPzfdkaX4j-xRSpE/s320/art_e.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5116006232258806162&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;That exactly what my question is. JEE 5 gives you a choice to use &lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;annotations instead of configuration files almost everywhere - even in Servlets. However, why such a facility be extended to frameworks such as JSF where I still have to use configuration files.&lt;br /&gt;&lt;br /&gt;Frameworks including JSF needs to be compilation stage as well as configuration stage to deploy them successfully. If servlets can be deployed without configuration file(web.xml), then why such a facility is not being extended to JSF? I am leaving out Struts because its outside Sun&#39;s control. And get me wrong, I am not against configuration. My only question is when an alternative is available and such an alternative can ease development, then why is not being implemented? With that I stopping my rant.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/8976465994031185145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/8976465994031185145' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/8976465994031185145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/8976465994031185145'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/09/why-annotations-cant-be-used-always.html' title='Why Annotations cant be used always?'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrB-3CDC7nIYfSCrHHwHvrY7LykvQe4waEo44ywnLBZNv-hZyPoRRo4codgQfmZUwe_e-X2RUvjoLD5JSEuLu4e1J3QTCzCgMowHGasa8H4jgV_fUBx8For4B5hhIoJXLL59R75qhLT5We/s72-c/art_j.gif" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-8763280472832249392</id><published>2007-09-29T08:18:00.000-07:00</published><updated>2008-12-13T00:25:27.366-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EJB 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="JEE 5.0"/><title type='text'>EJB 3.0: A Step in the Right Direction</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYSyU5_92XZgoyoAJZ26DvBpsJKj-X8OMyh8OirnBYuQAI5auBpJBls7wbDw0_f8kSjMxwOXEghVpP_TPeOUFHmTjYLaQ2FrguwPGeVUfhyphenhyphens6sOmBTSXxv0PMtSGRLx9Cq2DX1wJkCnr5b/s1600-h/art_e.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYSyU5_92XZgoyoAJZ26DvBpsJKj-X8OMyh8OirnBYuQAI5auBpJBls7wbDw0_f8kSjMxwOXEghVpP_TPeOUFHmTjYLaQ2FrguwPGeVUfhyphenhyphens6sOmBTSXxv0PMtSGRLx9Cq2DX1wJkCnr5b/s320/art_e.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5115654457257394482&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguPx3V9Qtd-dq-xkynUdiBlHOS3aKdgBVupLDhuqt3tAKt666Fitkh3N8VFrk4zQN3I1j7Wt-rgDkWDbVO3Nv2xqi9Qw7FmQEJ5LCMQSDfDhOTUKgqFxe5ZhgsS7r95r07_nDx5n_o6hks/s1600-h/art_j.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguPx3V9Qtd-dq-xkynUdiBlHOS3aKdgBVupLDhuqt3tAKt666Fitkh3N8VFrk4zQN3I1j7Wt-rgDkWDbVO3Nv2xqi9Qw7FmQEJ5LCMQSDfDhOTUKgqFxe5ZhgsS7r95r07_nDx5n_o6hks/s320/art_j.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5115654577516478786&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPaLQhuMGIrlUxOngrKEwnVkiQUGm4P2EDWvchXQZybsOzmjYBfPTp26n4Qx6OyM2tNe_thWOHP7rB9Plc5wM7yNAr9xqaTMsiu_jinPVia2O1_NgWfHuQmruabUcgPy0C4NJNSmwFNtg7/s1600-h/art_b.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPaLQhuMGIrlUxOngrKEwnVkiQUGm4P2EDWvchXQZybsOzmjYBfPTp26n4Qx6OyM2tNe_thWOHP7rB9Plc5wM7yNAr9xqaTMsiu_jinPVia2O1_NgWfHuQmruabUcgPy0C4NJNSmwFNtg7/s320/art_b.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5115654753610137938&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;In the last post I ranted about problems with GMap. However, this time its not a rant. Thats right EJB 3.0 is a step in the right direction. The reason are as follows&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;1. No more configuration files. Annotations takes care of all the configuration. For example to tell container that a class Test is a Session bean, you will annotate it as follows&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;@Stateless&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;public class Test{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;//rest of the class&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;2. No more home or remote interfaces. Just a simple Java class with annotations. Simple Java classes are known as Plain Old Java Objects or POJO. All the types of Beans in EJB 3.0 are based on POJO. So you dont need to extend or implement any interface. Take a look at the above example. It is a Stateless Session Bean, yet, does not extends or implements any Remote,  Home  or  Bean  interface.&lt;br /&gt;&lt;br /&gt;3. Clients dont need to depend on JNDI. Instead &lt;span style=&quot;font-weight: bold;&quot;&gt;dependency injection&lt;/span&gt; is used. More about dependency injection in next post.&lt;br /&gt;&lt;br /&gt;4. Entity Beans now have full support for CRUD operations. CRUD is short for Create, Retrieve, Update and Delete. Prior to version 3.0, Entity Beans supported only limited Retrieve operation (also known as Select operation) that did not include full joins.&lt;br /&gt;&lt;br /&gt;Thats all about new features of EJB 3.0. In the future posts, I will discuss about development using EJB 3.0. Visit again...&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/8763280472832249392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/8763280472832249392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/8763280472832249392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/8763280472832249392'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/09/ejb-30-step-in-right-direction.html' title='EJB 3.0: A Step in the Right Direction'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYSyU5_92XZgoyoAJZ26DvBpsJKj-X8OMyh8OirnBYuQAI5auBpJBls7wbDw0_f8kSjMxwOXEghVpP_TPeOUFHmTjYLaQ2FrguwPGeVUfhyphenhyphens6sOmBTSXxv0PMtSGRLx9Cq2DX1wJkCnr5b/s72-c/art_e.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-1378745997622389078</id><published>2007-09-28T05:28:00.000-07:00</published><updated>2007-09-28T05:41:38.163-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Map API"/><title type='text'>Back again</title><content type='html'>&lt;span style=&quot;font-family:verdana;&quot;&gt;It has been a long time since the last post. However, from now on I will be posting on a regular basis. There is a chance of changing the name of the blog as well. But thats for the future. Now its time for ranting. Yes rant. Its about GMap API.&lt;br /&gt;&lt;br /&gt;The simple app I had created works well from my home where there is no router or proxy per se. But, when I tried it from my friend&#39;s home pc which is behind a proxy, it started to show Paulo Alto even when I gave coordinates of India. Whats the problem here? Any idea anybody?&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/1378745997622389078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/1378745997622389078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/1378745997622389078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/1378745997622389078'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/09/back-again.html' title='Back again'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-2110870300369612898</id><published>2007-05-11T06:47:00.000-07:00</published><updated>2007-05-11T06:49:35.980-07:00</updated><title type='text'>Sorry For No Post</title><content type='html'>I am extremely sorry as my schedule is not allowing to make any new posts. Once I am through the schedule I will start again.</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/2110870300369612898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/2110870300369612898' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/2110870300369612898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/2110870300369612898'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/05/sorry-for-no-post.html' title='Sorry For No Post'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-3212872720213724765</id><published>2007-04-10T07:36:00.000-07:00</published><updated>2007-09-29T09:03:44.512-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Map API"/><title type='text'>GMap Animation and Events -II: Events</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;A quick look at events supported by GMap. GMap supports event handling through the Event listener pattern. The class that provides support for event handling is GEvent class. The &lt;b style=&quot;&quot;&gt;addEventListener() &lt;/b&gt;method of GEvent class. It takes three parameters:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;1. Object of GMap:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;The map on which event has to be applied.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;2. The event to be Handled:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 12pt 0in 0.0001pt 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;It is a string. The string contains event names. There are two commonly used &lt;span style=&quot;&quot;&gt; &lt;/span&gt;events:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 12pt 0in 0.0001pt 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;i. click:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 12pt 0in 0.0001pt 22.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;It is the most common of all the events. It is generated (or happens) when one presses and releases the left mouse button on the map.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;ii. moveend:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 12pt 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;It is generated when the user stops navigating or panning the map. It essentially means end of moving a map.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;Following code shows how to use both types of events:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;The code is a slight modification of the initial code to display map.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;function load() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;if (GBrowserIsCompatible()) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;var map = new GMap2(document.getElementById(&quot;map&quot;)); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                   &lt;/span&gt;//map.setMapType(GMapType.G_HYBRID_MAP);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                   &lt;/span&gt;map.addControl(new GSmallMapControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                   &lt;/span&gt;map.addControl(new GMapTypeControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                   &lt;/span&gt;map.addControl(new GScaleControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                   &lt;/span&gt;map.setCenter(new GLatLng(31.122027, 77.111664), 13);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                   &lt;/span&gt;&lt;b style=&quot;&quot;&gt;GEvent.addListener(map,&quot;click&quot;, function(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                    &lt;/span&gt;alert(map.getCenter())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                    &lt;/span&gt;)&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;//for the event moveend&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                          &lt;/span&gt;GEvent.addListener(map,&quot;moveend&quot;, function(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                    &lt;/span&gt;alert(map.getCenter())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                    &lt;/span&gt;)&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;The getCenter() method of the GMap2 returns the current focus latitude and longitude of the map. That’s all for this quickie.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/3212872720213724765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/3212872720213724765' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/3212872720213724765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/3212872720213724765'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/04/gmap-animation-and-events-ii-events.html' title='GMap Animation and Events -II: Events'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-5513377395668351866</id><published>2007-03-23T08:39:00.000-07:00</published><updated>2007-03-23T08:42:51.760-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Map API"/><title type='text'>Animations and Events in GMap - I : Basic Animation</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;The Hello World experiment has impressed upon me the ease of setting up Google Maps for a website. However, it had only limited functionality. Also I wanted to check how it works with ‘conventional’ JavaScript APIs. The best way is to cook-up some animation (eventhough it may not mean much). So when I saw a function to change the focus of the area displayed, I thought let me create an animation with it. In JavaScript, there are two kinds of timers available – &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;1. One that executes a given function exactly once after a specified amount of delay &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;2. Another that executes the function repeatedly after a specified interval.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;The corresponding functions are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;1. setTimeout and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;2. setInterval&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;respectively. Both are the methods of &lt;b style=&quot;&quot;&gt;window &lt;/b&gt;object. So now how to use it to animate google map. For that the API I am going to use is:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;panTo:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;This is a method of GMap2. What it does is it changes the center of the map to the given point represented by latitude and longitude. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;So how to use this to achieve animation? The methods are as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;1. By using setTimout with panTo:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;Adding the setTimeout just after setting the focus point of map, would create a one shot animation. That means it would be panned only once. The code would look like :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;function load() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;if (GBrowserIsCompatible()) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;var map = new GMap2(document.getElementById(&quot;map&quot;)); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;//map.setMapType(GMapType.G_HYBRID_MAP);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;map.addControl(new GSmallMapControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;map.addControl(new GMapTypeControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;map.addControl(new GScaleControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;map.setCenter(new GLatLng(31.122027, 77.111664), 13);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;&lt;b style=&quot;&quot;&gt;window.setTimeout(function() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                &lt;/span&gt;map.panTo(new GLatLng(31.152027, 77.111664));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                &lt;/span&gt;},18000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                &lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 11.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;the setTimeout is given an anonymous function as the function to be called and nearly 15 sec as the time to wait before function is executed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;2. By using SetInterval with panTo:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;This comes handy when u want to the focus return to a particular point&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;again and again after a specified time interval. The syntax is similar to that of setTimeout. The only difference is in the way both functions. Following is the same code implemented with setInterval:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;function load() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;if (GBrowserIsCompatible()) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;var map = new GMap2(document.getElementById(&quot;map&quot;)); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;//map.setMapType(GMapType.G_HYBRID_MAP);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;map.addControl(new GSmallMapControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;map.addControl(new GMapTypeControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;map.addControl(new GScaleControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;map.setCenter(new GLatLng(31.122027, 77.111664), 13);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;&lt;b style=&quot;&quot;&gt;window.setInterval(function() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                 &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                 &lt;/span&gt;map.panTo(new GLatLng(31.152027, 77.111664));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                 &lt;/span&gt;},18000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                 &lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 10.5pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;That’s it for this post. By the next post I would have experimented the event handling provided by GMap API.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in; text-align: justify;&quot;&gt;.&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/5513377395668351866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/5513377395668351866' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/5513377395668351866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/5513377395668351866'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/03/animations-and-events-in-gmap-i-basic.html' title='Animations and Events in GMap - I : Basic Animation'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-3103216874087243692</id><published>2007-03-15T07:13:00.000-07:00</published><updated>2007-03-15T07:15:50.220-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Map API"/><title type='text'>Getting Latitude and Longitude for GMap API- The easy way</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;A quick update. One of the most important and the thing of frustration for anyone starting with GMap API is getting hold of desired latitude and longitude. There are many ways. I am listing here one of the easiest ways to get the latitude and&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;longitude of desired location. Here are the steps:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol style=&quot;margin-top: 0in;&quot; start=&quot;1&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;Go      to the following site : &lt;a href=&quot;http://www.infosports.com/m/map.htm&quot;&gt;http://www.infosports.com/m/map.htm&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;Navigate      the map till you get the desired location. For example, I required the lat      and long. of Shimla. So I navigated (panned and zoomed) till I got to      Shimla.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;Then      click on the spot. In my case its Shimla. A marker would be generated at      that point. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;click      on the marker to get the latitude and the longitude. Mine is &lt;/span&gt;77.16496467590332,      31.102995000257405&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;That’s it. If there are easier ways do share.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in; text-align: justify;&quot;&gt;.&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/3103216874087243692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/3103216874087243692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/3103216874087243692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/3103216874087243692'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/03/getting-latitude-and-longitude-for-gmap.html' title='Getting Latitude and Longitude for GMap API- The easy way'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-2664945036928240140</id><published>2007-03-13T06:46:00.000-07:00</published><updated>2007-03-13T07:05:55.238-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Map API"/><title type='text'>Hello World the Google Map API Way: Adding Controls</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;In the last post I had said I wanted to add something extra to the Hello world of GMap. The extras are controls. So the second part is:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;2. Adding Controls to the map:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 14.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;The map looks plain without the controls for scaling and mapping. So I decided to jazz it up with the following controls:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 14.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 50.25pt; text-align: justify; text-indent: -0.5in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;i.&lt;span style=&quot;;font-family:&amp;quot;;font-size:7;&quot;  &gt;                    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;GSmallMapControl:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 50.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;It shows a control with four buttons to pan(move the map) in four directions alongwith buttons to zoom in and out. The constructor is GSmallMapControl().&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 50.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 50.25pt; text-align: justify; text-indent: -0.5in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;ii.&lt;span style=&quot;;font-family:&amp;quot;;font-size:7;&quot;  &gt;                   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;GMapTypeControl:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 50.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;It provides the control to change the type of map. The types are map, satellite image and hybrid which shows map superimposed on satellite image. GMapTypeControl() is the constructor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 50.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 50.25pt; text-align: justify; text-indent: -0.5in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;iii.&lt;span style=&quot;;font-family:&amp;quot;;font-size:7;&quot;  &gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;GScaleControl:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 50.25pt; text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;As the name suggests, it shows a scale within the map. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;So how to add them to the map? The way is pretty simple- use the addControl() method of GMap2 instance. Here is the way in code:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;function load() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;if (GBrowserIsCompatible()) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;var map = new GMap2(document.getElementById(&quot;map&quot;)); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;                   &lt;/span&gt;//add the controls to the map&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;                   &lt;/span&gt;&lt;b style=&quot;&quot;&gt;map.addControl(new GSmallMapControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;                        &lt;/span&gt;map.addControl(new GMapTypeControl());&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;                   &lt;/span&gt;map.setCenter(new GLatLng(31.122027, 77.111664), 13);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;                        &lt;/span&gt;map.addControl(new GScaleControl());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;If you have observed, there is a difference in adding GScaleControl when compared to others. The first two controls (for that most of the controls that I have tested) are added before setting the center of the map where as the GScaleControl() is set after the center of the map has been set. What would have happened if I had called it before setting the center? The result would have been a blank page with a JavaScript error. That’s what happened with me. If you get any&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;different result please share.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:10;&quot;  &gt;That’s it for this post. Next I would be looking at event handling in Google Map.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/2664945036928240140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/2664945036928240140' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/2664945036928240140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/2664945036928240140'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/03/hello-world-google-map-api-way-adding.html' title='Hello World the Google Map API Way: Adding Controls'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-1423862332359412009</id><published>2007-03-04T09:36:00.000-08:00</published><updated>2007-03-04T09:38:31.311-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Map API"/><title type='text'>Hello World - The Google Maps Way</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 12pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;Last week I had said that I would be cooking up a &quot;Hello World&quot; kind of app. I did it. There were two parts:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;Display default location provided by GMap API:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;In nutshell, just make the sample app provided by Google while registration, work on my local system. It also clarified one of my doubts - where is the API library of GMap located? &#39;Coz it was not provided when I registered. For some, it may be a silly question. Ok. So the answer is in the following line:&lt;br /&gt;&lt;br /&gt;&amp;lt;script src=&lt;a href=&quot;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=&quot;&gt;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=&lt;/a&gt;[yourkey]&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;The src attribute is pointing to the place where APIs are available. The place is maps.google.com – the site of Google maps. Along with the URL key received while registering with Google maps. Next comes the implementation of custom logic. It starts with the function &lt;b style=&quot;&quot;&gt;load():&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;//&amp;lt;![CDATA[&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;function load() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;//]]&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;The next step is to ensure browser compatibility with client browser. This is done using GBrowserIsCompatible().&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;//&amp;lt;![CDATA[&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;function load() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;          &lt;/span&gt;&lt;b style=&quot;&quot;&gt;if (GBrowserIsCompatible()) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;}&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;//]]&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;Once compatible browser is found, then an instance of GMap2 class is created. The parameter passed id the div object in which the map has to be shown:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;//&amp;lt;![CDATA[&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;function load() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;          &lt;/span&gt;if (GBrowserIsCompatible()) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;       &lt;/span&gt;var map = new GMap2(document.getElementById(&quot;map&quot;));&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;}&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;//]]&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;The last step is to display the map using setCenter() method of GMap2. the method takes latitude , longitude and zoom factor as parameters. Of these zoom is optional. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;//&amp;lt;![CDATA[&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;function load() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;          &lt;/span&gt;if (GBrowserIsCompatible()) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;&quot;&gt;       &lt;/span&gt;var map = new GMap2(document.getElementById(&quot;map&quot;));&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;              &lt;/span&gt;&lt;b style=&quot;&quot;&gt;map.setCenter(new GLatLng(31.122027, 77.111664), 13);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;}&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;//]]&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;The last but not least is the HTML especially the div part:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&amp;lt;body onload=&quot;load()&quot; onunload=&quot;GUnload()&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&amp;lt;div id=&quot;map&quot; style=&quot;width: 500px; height: 500px&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&amp;lt;/body&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana;&quot;&gt;The load() has to be called in body’s onLoad is obvious. Calling GUnload() is a good practice to avoid memory leaks. That’s for the first part.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/1423862332359412009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/1423862332359412009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/1423862332359412009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/1423862332359412009'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/03/hello-world-google-maps-way.html' title='Hello World - The Google Maps Way'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-3633089765253846838</id><published>2007-02-23T07:07:00.000-08:00</published><updated>2007-03-04T08:57:49.555-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Map API"/><title type='text'>Google Maps : Getting the Key</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;I started my exploration of Google Map API. For those who came late, Google Map API provide way to harness the power of Google Maps for your site. The API itself is JavaScript based. So if you have intermediate knowledge of JavaScript, then you are ready to work with GMap API.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;The first step is to get a &lt;span style=&quot;font-weight: bold;&quot;&gt;registration key&lt;/span&gt;. The key is a string which GMap server uses to &#39;recognize&#39; and authenticate you. To get the key the registration page asks for your web-site address. If you already have a website, then everything is well and dandy. However what if you are like me (I still dont have a page of my own)?  My first thought was to grab  a  free  web  host  such  as  geo-cities.  But  then  decided  to  check  the  tried  and  tested  &#39;localhost&#39;.  I  was  not  sure  about  Google  accepting  it. I was in for a surprise. It accepted the URL http://localhost readily and provided me the key. And thus I was well and ready to do my exploration and experimentation with GMap API.&lt;br /&gt;&lt;br /&gt;Next step is to test the API with GMap&#39;s version of Hello World. That I will be doing tonite. More about it tomorrow.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/3633089765253846838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/3633089765253846838' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/3633089765253846838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/3633089765253846838'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/02/google-maps-getting-key.html' title='Google Maps : Getting the Key'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2918514529204426688.post-1306445007314811626</id><published>2007-02-22T08:08:00.000-08:00</published><updated>2007-03-04T08:59:02.205-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Introduction"/><title type='text'>Testing 123</title><content type='html'>&lt;span style=&quot;font-family:verdana;&quot;&gt;I will be using this blog to give u a look into my experimentations with different web development APIs. You can also term it my ramblings if you wish. I am starting with Google Map API. Check out my blog again to know my first impressions about it.&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://apmuses.blogspot.com/feeds/1306445007314811626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2918514529204426688/1306445007314811626' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/1306445007314811626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2918514529204426688/posts/default/1306445007314811626'/><link rel='alternate' type='text/html' href='http://apmuses.blogspot.com/2007/02/testing-123.html' title='Testing 123'/><author><name>Rajshekhar AP</name><uri>http://www.blogger.com/profile/09897568592456975826</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>