<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CE4BSHg-cSp7ImA9WhRaF04.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691</id><updated>2012-02-20T02:15:59.659-08:00</updated><category term="Portability" /><category term="Technical" /><category term="c/c++" /><category term="SEO" /><category term="Technology" /><category term="Google MAP APIs" /><category term="sizeof" /><category term="Misc" /><category term="Hashing" /><category term="Creative Thinking" /><category term="Algorithms" /><category term="Blogger Blogging Blog" /><category term="Widgets" /><category term="Optimization" /><category term="Query/Suggestion" /><title>IDITAROD</title><subtitle type="html">-Adventerous journey of being tough, sharing my experiments with technology and blogging. Discuss, share and learn.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://tajendrasengar.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>43</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/twVUS" /><feedburner:info uri="blogspot/twvus" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;A0AHQHc4cCp7ImA9WhRQGUk.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-5089246873496084826</id><published>2011-12-13T03:55:00.001-08:00</published><updated>2011-12-15T03:48:51.938-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-15T03:48:51.938-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Technical" /><category scheme="http://www.blogger.com/atom/ns#" term="c/c++" /><category scheme="http://www.blogger.com/atom/ns#" term="Misc" /><title>How to increase service start/stop timeout ?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EMF_F8bxK2KFVxNZb4lxy6WQbS8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EMF_F8bxK2KFVxNZb4lxy6WQbS8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EMF_F8bxK2KFVxNZb4lxy6WQbS8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EMF_F8bxK2KFVxNZb4lxy6WQbS8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
&lt;div class="MsoNormal" style="margin-bottom: 7.5pt;"&gt;
&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Windows provide &lt;b&gt;SetServiceStatus&lt;/b&gt; function by which one can manage service time out
period. It’s a very straight forward API here are its details:-&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt; word-break: break-all;"&gt;
&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOOL WINAPI
SetServiceStatus(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt; word-break: break-all;"&gt;
&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; __in&amp;nbsp;&amp;nbsp;SERVICE_STATUS_HANDLE
hServiceStatus,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt; word-break: break-all;"&gt;
&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; __in&amp;nbsp;&amp;nbsp;LPSERVICE_STATUS
lpServiceStatus&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt; word-break: break-all;"&gt;
&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 7.5pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 7.5pt;"&gt;
&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;To manage timeout one need to inform SCM
periodically about the current status of service. So if one have pending
operations same information can be conveyed with this interface to SCM.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="apple-style-span"&gt;&lt;i&gt;A
common bug is for the service to have the main thread perform the
initialization while a separate thread continues to call&lt;/i&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;strong&gt;&lt;i&gt;SetServiceStatus&lt;/i&gt;&lt;/strong&gt;&lt;span class="apple-converted-space"&gt;&lt;i&gt;&lt;span style="float: none;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;i&gt;to
prevent the service control manager from marking it as hung. However, if the
main thread hangs, then the service start ends up in an infinite loop because
the worker thread continues to report that the main thread is making progress.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;
&lt;b&gt;&lt;span style="font-family: 'Segoe UI', sans-serif;"&gt;Here are the details of structure&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;typedef struct _SERVICE_STATUS {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;&amp;nbsp; DWORD dwServiceType;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;&amp;nbsp; DWORD dwCurrentState;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;&amp;nbsp; DWORD dwControlsAccepted;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;&amp;nbsp; DWORD dwWin32ExitCode;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;&amp;nbsp; DWORD dwServiceSpecificExitCode;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;&amp;nbsp; DWORD dwCheckPoint;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;&amp;nbsp; DWORD dwWaitHint;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;} SERVICE_STAT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;
&lt;b&gt;&lt;span style="font-family: 'Segoe UI', sans-serif;"&gt;And following are the main parameters to be used
while managing service time out duration in the structure&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;
&lt;b&gt;&lt;span style="font-family: 'Segoe UI', sans-serif;"&gt;dwCheckPoint&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: 'Segoe UI', sans-serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;"&gt;
&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;The check-point value the service increments periodically to
report its progress during a lengthy start, stop, pause, or continue operation.
For example, the service should increment this value as it completes each step
of its initialization when it is starting up. The user interface program that
invoked the operation on the service uses this value to track the progress of
the service during a lengthy operation. This value is not valid and should be
zero when the service does not have a start, stop, pause, or continue operation
pending.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;
&lt;b&gt;&lt;span style="font-family: 'Segoe UI', sans-serif;"&gt;dwWaitHint&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: 'Segoe UI', sans-serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;"&gt;
&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;The estimated time required for a pending start, stop, pause, or
continue operation, in milliseconds. Before the specified amount of time has
elapsed, the service should make its next call to the&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style="color: red; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;SetServiceStatus&lt;/span&gt;&lt;/b&gt;&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;function&lt;span style="color: #2a2a2a;"&gt; with either an incremented&amp;nbsp;&lt;b&gt;dwCheckPoint&lt;/b&gt;&amp;nbsp;value
or a change in&amp;nbsp;&lt;b&gt;dwCurrentState&lt;/b&gt;. If the amount of time specified by&amp;nbsp;&lt;b&gt;dwWaitHint&lt;/b&gt;&amp;nbsp;passes,
and&amp;nbsp;&lt;b&gt;dwCheckPoint&lt;/b&gt;&amp;nbsp;has not been incremented or&lt;b&gt;dwCurrentState&lt;/b&gt;&amp;nbsp;has
not changed, the service control manager or service control program can assume
that an error has occurred and the service should be stopped. However, if the
service shares a process with other services, the service control manager
cannot terminate the service application because it would have to terminate the
other services sharing the process as well.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;A sample code showing the use of above
discussed variable :-&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;//&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;// Purpose: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;//&amp;nbsp;&amp;nbsp; It will set the current service status and reports it to the SCM.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;//&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;// Parameters:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;//&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: red; font-family: Consolas;"&gt;dwCurrentState&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt; - The current state (see SERVICE_STATUS)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;//&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: red; font-family: Consolas;"&gt;dwWin32ExitCode&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt; - The system error code&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;//&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: red; font-family: Consolas;"&gt;dwWaitHint&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt; - Estimated time for pending operation, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in milliseconds&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;// &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span class="Apple-style-span" style="font-family: Consolas;"&gt;VOID ReportServiceStatus( DWORD dwCurrentState,&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DWORD dwWin32ExitCode,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DWORD dwWaitHint)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static DWORD dwCheckPoint = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Fill in the SERVICE_STATUS structure.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gSvcStatus.dwCurrentState = dwCurrentState;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gSvcStatus.dwWin32ExitCode = dwWin32ExitCode;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gSvcStatus.dwWaitHint = dwWaitHint;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (dwCurrentState == SERVICE_START_PENDING)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gSvcStatus.dwControlsAccepted = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else gSvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( (dwCurrentState == SERVICE_RUNNING) ||&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (dwCurrentState == SERVICE_STOPPED) )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gSvcStatus.dwCheckPoint = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else gSvcStatus.dwCheckPoint = &lt;/span&gt;&lt;span style="color: red; font-family: Consolas;"&gt;dwCheckPoint&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;++;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Report the status of the service to the SCM.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetServiceStatus( gSvcStatusHandle, &amp;amp;gSvcStatus );&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;One more important thing to remember :&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in; word-break: break-all;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color: #2a2a2a; font-family: Wingdings; font-size: 11.0pt; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"&gt;Ø&lt;span style="font: 7.0pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt;"&gt;&amp;nbsp;Do not wait longer than the wait hint. A good interval is one-tenth of the wait hint but not less than 1 second&amp;nbsp; and not more than 10 seconds. &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 12px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp; Example:- &lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="background-color: white; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dwWaitTime = ssStatus.dwWaitHint / 10;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="background-color: white; font-family: Consolas;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="background-color: white; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( dwWaitTime &amp;lt; 1000 )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="background-color: white; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dwWaitTime = 1000;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="background-color: white; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if ( dwWaitTime &amp;gt; 10000 )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="background-color: white; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dwWaitTime = 10000;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="word-break: break-all;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #2a2a2a; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;The following are some
of the best practices when calling SetServiceStatus&amp;nbsp;function:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type="disc"&gt;
&lt;li class="MsoNormal" style="color: #2a2a2a;"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Initialize
     all fields in the&amp;nbsp;&lt;b&gt;&lt;span style="color: #2a2a2a; text-decoration: none; text-underline: none;"&gt;SERVICE_STATUS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;structure,
     ensuring that there are valid check-point and wait hint values for pending
     states. Use reasonable wait hints.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="color: #2a2a2a;"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Do
     not register to accept controls while the status is &lt;b&gt;SERVICE_START_PENDING&lt;/b&gt; or the service can crash. After
     initialization is completed, accept the &lt;b&gt;SERVICE_CONTROL_STOP&lt;/b&gt; code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="color: #2a2a2a;"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Call
     this function with checkpoint and wait-hint values only if the service is
     making progress on the tasks related to the pending start, stop, pause, or
     continue operation. Otherwise, SCM cannot detect if your service is hung.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="color: #2a2a2a;"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Enter
     the stopped state with an appropriate exit code if&amp;nbsp;&lt;b&gt;&lt;span style="color: #2a2a2a; text-decoration: none; text-underline: none;"&gt;ServiceMain&lt;/span&gt;&lt;/b&gt;&amp;nbsp;fails.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="color: #2a2a2a;"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;If
     the status is &lt;b&gt;SERVICE&lt;/b&gt;_&lt;b&gt;STOPPED&lt;/b&gt;, perform all necessary
     cleanup and call&amp;nbsp;&lt;b&gt;SetServiceStatus&lt;/b&gt;&amp;nbsp;one
     time only. This function makes an LRPC call to the SCM. The first call to
     the function in the &lt;b&gt;SERVICE_STOPPED&lt;/b&gt;
     state closes the RPC context handle and any subsequent calls can cause the
     process to crash.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="color: #2a2a2a;"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Do
     not attempt to perform any additional work after calling&amp;nbsp;&lt;b&gt;SetServiceStatus&lt;/b&gt;&amp;nbsp;with &lt;b&gt;SERVICE_STOPPED&lt;/b&gt;, because the
     service process can be terminated at any time.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-5089246873496084826?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/U2DnsXAYaVY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/5089246873496084826/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/12/how-to-increase-service-startstop.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/5089246873496084826?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/5089246873496084826?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/U2DnsXAYaVY/how-to-increase-service-startstop.html" title="How to increase service start/stop timeout ?" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/12/how-to-increase-service-startstop.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4BSHg8fip7ImA9WhRaF04.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-126841887991870536</id><published>2011-12-03T10:07:00.001-08:00</published><updated>2012-02-20T02:15:59.676-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-20T02:15:59.676-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c/c++" /><title>Inline function example, a sample program c++</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6NphitDJ5wMoyiIcp7TkiNPJDD8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6NphitDJ5wMoyiIcp7TkiNPJDD8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6NphitDJ5wMoyiIcp7TkiNPJDD8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6NphitDJ5wMoyiIcp7TkiNPJDD8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;Inline function &lt;/span&gt;examples :-&lt;br /&gt;
recommended article :- &lt;a href="http://tajendrasengar.blogspot.com/2010/03/what-is-inline-function-in-cc.html" target="_blank"&gt;Inline Function&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Lets look out one of the simple example :-&lt;br /&gt;
&lt;pre style="font-family: Consolas, Courier, monospace; font-size: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;-------------------------------------------------------------------&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="font-size: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;// inline_functions_inline.cpp
#include &lt;stdio.h&gt;
#include &lt;conio.h&gt;

&lt;/conio.h&gt;&lt;/stdio.h&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #9fc5e8;"&gt;inline &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;char toupper( char a ) {
   return ((a &amp;gt;= 'a' &amp;amp;&amp;amp; a &amp;lt;= 'z') ? a-('a'-'A') : a );
}

int main() {
   printf_s("Enter a character: ");
   char ch = toupper( getc(stdin) );
   printf_s( "%c", ch );
}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="font-size: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;--&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas, Courier, monospace;"&gt;-----------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre style="font-family: Consolas, Courier, monospace; font-size: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: small; white-space: normal;"&gt;Now&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: small; white-space: normal;"&gt;&amp;nbsp;moving to example of using inline function inside a class :-&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="font-family: Consolas, Courier, monospace; font-size: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;pre style="font-family: Consolas, Courier, monospace; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;-------------------------------------------------------------------&lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="background-color: #9fc5e8; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;// Inline_Member Function example&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;class CBankAccount
{
public:
    CBankAccount(double initial_balance) { balance = initial_balance; }
    double GetBalance();
    double Deposit( double Amount );
    double Withdraw( double Amount );
private:
    double balance;
};

&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #9fc5e8;"&gt;inline &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;double CBankAccount::GetBalance()
{
    return balance;
}

&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #9fc5e8;"&gt;inline &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;double CBankAccount::Deposit( double Amount )
{
    return ( balance += Amount );
}

&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #9fc5e8;"&gt;inline &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;double CBankAccount::Withdraw( double Amount )
{
    return ( balance -= Amount );
}

int main()
{
 CBankAccount objAccount;
 objAccount.Deposit(1000);
}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="font-family: Consolas, Courier, monospace; font-size: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;-------------------------------------------------------------------&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: small; white-space: normal;"&gt;Just as you can ask the compiler to make a regular function inline, you can make class methods inline. The keyword&amp;nbsp;&lt;/span&gt;&lt;tt style="font-family: Consolas, Courier, monospace; font-size: 13px; white-space: normal;"&gt;inline&lt;/tt&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: small; white-space: normal;"&gt;&amp;nbsp;appears before the return value. In the class declaration, the functions were declared without the inline keyword. The inline keyword can be specified in the class declaration; the result is the same.&lt;/span&gt;&lt;/pre&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: small; white-space: normal;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px; white-space: normal;"&gt;Inline functions are best used for small functions such as accessing private data members. The main purpose of these one- or two-line "accessor" functions is to return state information about objects; short functions are sensitive to the overhead of function calls. Longer functions spend proportionately less time in the calling/returning sequence and benefit less from inlining.&lt;/span&gt;&lt;/blockquote&gt;
&amp;nbsp;Read More :- &lt;a href="http://tajendrasengar.blogspot.com/2010/03/what-is-inline-function-in-cc.html" target="_blank"&gt;Guidelines for using Inline function&lt;/a&gt;. &lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;
&lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;Check this out&lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;----------------------------------------------------&lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;a href="http://www.ticketamerica.com/harvard_crimson_tickets.html"&gt;harvard crimson tickets&lt;/a&gt;&lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;a href="http://www.ticketamerica.com/hofstra_pride_tickets.html"&gt;hofstra pride tickets&lt;/a&gt;&lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;a href="http://www.ticketamerica.com/houston_baptist_huskies_tickets.html"&gt;houston baptist huskies tickets&lt;/a&gt;&lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;----------------------------------------------------&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre style="overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; word-break: break-all; word-wrap: break-word;"&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-126841887991870536?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/SCwc48KNbJE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/126841887991870536/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/12/inline-function-example-sample-program.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/126841887991870536?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/126841887991870536?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/SCwc48KNbJE/inline-function-example-sample-program.html" title="Inline function example, a sample program c++" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/12/inline-function-example-sample-program.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUDRnk8eSp7ImA9WhRREE4.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-5166408568877616510</id><published>2011-11-22T23:21:00.001-08:00</published><updated>2011-11-22T23:27:57.771-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-22T23:27:57.771-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Technical" /><category scheme="http://www.blogger.com/atom/ns#" term="Misc" /><category scheme="http://www.blogger.com/atom/ns#" term="Optimization" /><title>How to start , stop perfmon from the command line in Windows ?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lSmOQCilSFurdjoHOgfGwBchKYk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lSmOQCilSFurdjoHOgfGwBchKYk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lSmOQCilSFurdjoHOgfGwBchKYk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lSmOQCilSFurdjoHOgfGwBchKYk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif; font-size: large;"&gt;Logman &lt;/span&gt;command is the solution for it.&lt;br /&gt;
let's have a look at the command&amp;nbsp;syntax&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
Syntax Verbs&lt;br /&gt;&lt;b&gt;Logman&lt;/b&gt;&amp;nbsp;[&lt;b&gt;create&lt;/b&gt;&amp;nbsp;{&lt;i&gt;counter&lt;/i&gt;&amp;nbsp;|&amp;nbsp;&lt;i&gt;trace&lt;/i&gt;}&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;&amp;nbsp;] [&lt;b&gt;start&lt;/b&gt;&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;] [&lt;b&gt;stop&lt;/b&gt;&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;] [&lt;b&gt;delete&lt;/b&gt;&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;] [&lt;b&gt;query&lt;/b&gt;&amp;nbsp;{&lt;i&gt;collection_name&lt;/i&gt;|&lt;b&gt;providers&lt;/b&gt;}] [&lt;b&gt;update&lt;/b&gt;&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;]&lt;/blockquote&gt;
&lt;br /&gt;
&lt;h2 style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 0px; padding-right: 0px; padding-top: 8px; text-align: -webkit-auto;"&gt;
Parameter details:-&lt;/h2&gt;
&lt;div style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 15px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto;"&gt;
&lt;b&gt;create&lt;/b&gt;&lt;b&gt;&amp;nbsp;{&lt;/b&gt;&lt;b&gt;&lt;i&gt;counter&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&amp;nbsp;|&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;i&gt;trace&lt;/i&gt;&lt;/b&gt;&lt;b&gt;}&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;i&gt;collection_name&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;:&amp;nbsp;&lt;/b&gt;Creates collection queries for either counter or trace collections. You can use command line options to specify settings.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 15px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto;"&gt;
&lt;b&gt;start&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;i&gt;collection_name&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;:&amp;nbsp;&lt;/b&gt;Starts the data collection query&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;. Use this option to change from scheduled collections to manual ones. Use the&amp;nbsp;&lt;b&gt;update&lt;/b&gt;&amp;nbsp;parameter in the command line with begin-time (-b), end-time (-e), or repeat-time (-rt) to reschedule collections.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 15px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto;"&gt;
&lt;b&gt;stop&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;i&gt;collection_name&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;:&amp;nbsp;&lt;/b&gt;Stops the data collection query&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;. Use this option to change from scheduled collections to manual ones. Use the&amp;nbsp;&lt;b&gt;update&lt;/b&gt;&amp;nbsp;parameter in the command line with begin-time (-b), end-time (-e), or repeat-time (-rt) to reschedule collections.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 15px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto;"&gt;
&lt;b&gt;delete&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;i&gt;collection_name&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;:&amp;nbsp;&lt;/b&gt;Deletes the data collection query&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;. If the&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;&amp;nbsp;does not exist, you will receive an error.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 15px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto;"&gt;
&lt;b&gt;query&lt;/b&gt;&lt;b&gt;&amp;nbsp;{&lt;/b&gt;&lt;b&gt;&lt;i&gt;collection_name&lt;/i&gt;&lt;/b&gt;&lt;b&gt;|&lt;/b&gt;&lt;b&gt;providers&lt;/b&gt;&lt;b&gt;}&amp;nbsp;&lt;/b&gt;&lt;b&gt;:&amp;nbsp;&lt;/b&gt;If no&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;&amp;nbsp;or&amp;nbsp;&lt;b&gt;providers&lt;/b&gt;&amp;nbsp;are given, the status of all existing collection queries are displayed. Use&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;&amp;nbsp;to display the properties of a specific collection. To display the properties on remote computers, use the&amp;nbsp;&lt;b&gt;-s&lt;/b&gt;&amp;nbsp;&lt;i&gt;remote computer&lt;/i&gt;&amp;nbsp;option in the command line. Use&amp;nbsp;&lt;b&gt;providers&lt;/b&gt;&amp;nbsp;as your keyword in place of&amp;nbsp;&lt;i&gt;collection_name&lt;/i&gt;&amp;nbsp;to display the registered providers installed on your local system. To list registered providers installed on the remote system, use the&amp;nbsp;&lt;b&gt;-s&lt;/b&gt;option in the command line.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 15px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto;"&gt;
&lt;b&gt;update&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;i&gt;collection_name&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;:&amp;nbsp;&lt;/b&gt;Updates collection queries for counter and trace collections. For counter collections, modifications to the query will stop, and then restart the collections. For trace collections, use the following parameters in the command line to query without stopping the collection:&amp;nbsp;&lt;b&gt;-p&lt;/b&gt;&amp;nbsp;&lt;i&gt;provider&lt;/i&gt;&amp;nbsp;[&lt;b&gt;(&lt;/b&gt;&lt;i&gt;flags&lt;/i&gt;[&lt;b&gt;,&lt;/b&gt;&lt;i&gt;flags ...&lt;/i&gt;]&lt;b&gt;)&lt;/b&gt;]&amp;nbsp;&lt;i&gt;Level&lt;/i&gt;,&amp;nbsp;&lt;b&gt;- max&lt;/b&gt;&amp;nbsp;&lt;i&gt;n&lt;/i&gt;,&amp;nbsp;&lt;b&gt;- o&lt;/b&gt;&amp;nbsp;&lt;i&gt;PathName&lt;/i&gt;,&amp;nbsp;&lt;b&gt;-ft&lt;/b&gt;&amp;nbsp;&lt;i&gt;mm:ss&lt;/i&gt;, or&amp;nbsp;&lt;b&gt;-fd&lt;/b&gt;.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This command is very helpful in performance automation&amp;nbsp;scenario.&lt;br /&gt;
If performance monitoring counter name is test_perf_log&lt;br /&gt;
then start command will go as :-&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: black;"&gt;&lt;span class="Apple-style-span" style="color: white;"&gt;&amp;nbsp; &amp;nbsp; logman start test_perf_log&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
on similar line stop command will go as:-&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: black; color: white;"&gt;&amp;nbsp; &amp;nbsp; logman stop test_perf_log&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: black; color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;For more detail jump to page :-&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nt_command_typeperf.mspx?mfr=true"&gt;http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nt_command_typeperf.mspx?mfr=true&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-5166408568877616510?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/Jq0WrY-KGT8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/5166408568877616510/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/11/how-to-start-stop-perfmon-from-command.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/5166408568877616510?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/5166408568877616510?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/Jq0WrY-KGT8/how-to-start-stop-perfmon-from-command.html" title="How to start , stop perfmon from the command line in Windows ?" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/11/how-to-start-stop-perfmon-from-command.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEDRHYzfyp7ImA9WhRRFUg.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-3299756194958040839</id><published>2011-11-01T22:57:00.000-07:00</published><updated>2011-11-29T00:01:15.887-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-29T00:01:15.887-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Technology" /><category scheme="http://www.blogger.com/atom/ns#" term="Google MAP APIs" /><title>Google MAP APIs to charge for usage, heavy traffic cost more</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PZjsEKncG4P7Uk7-hT-fVyybTuM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PZjsEKncG4P7Uk7-hT-fVyybTuM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PZjsEKncG4P7Uk7-hT-fVyybTuM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PZjsEKncG4P7Uk7-hT-fVyybTuM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Google MAP&lt;/span&gt;&lt;/b&gt; server with&amp;nbsp;their&amp;nbsp;increased traffic has given a new dimension of earning to Google.&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;With its success now Google is planning to charge for its usage.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Now one has to pay according to&amp;nbsp;their&amp;nbsp;usage.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Following is the cost estimation as per BBC&lt;br /&gt;
&lt;i style="background-color: white; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 3px; color: #363636; display: block; font-family: Arial, sans-serif; font-size: 13px; font-style: normal; line-height: 19px; margin-bottom: 0.5em; margin-left: 0.5em; margin-right: 0.5em; margin-top: 0.5em; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 1em; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; vertical-align: baseline;"&gt;"The BBC is reporting that from 1 January 2012, Google&amp;nbsp;&lt;span class="Apple-style-span" style="color: #006666; font-family: inherit;"&gt;&lt;span class="Apple-style-span" style="cursor: pointer; font-style: inherit; outline-color: initial; outline-width: initial;"&gt;will charge for the Google Maps API service&lt;/span&gt;&lt;/span&gt;&amp;nbsp;when more than the limit of 25,000 map "hits" are made in a day. Google is rumoured to be charging $4 per 1,000 views in excess of the limit. Google maintains the high limit of 25,000 free hits before charging 'will only affect 0.35% of users.'"&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://upload.wikimedia.org/wikipedia/en/thumb/3/30/Google_Maps_directions.png/250px-Google_Maps_directions.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="172" src="http://upload.wikimedia.org/wikipedia/en/thumb/3/30/Google_Maps_directions.png/250px-Google_Maps_directions.png" width="320" /&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #494949; font-family: Verdana, sans-serif; font-size: 12px; line-height: 20px;"&gt;&lt;b&gt;In the Google announcement:&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;em style="background-color: white; color: #494949; line-height: 20px; text-align: -webkit-auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;"&lt;/span&gt;We understand that the introduction of these limits may be concerning. However with the continued growth in adoption of the Maps API we need to secure its long term future by ensuring that even when used by the highest volume for-profit sites, the service remains viable. By introducing these limits we are ensuring that Google can continue to offer the Maps API for free to the vast majority of developers for many years to come."&lt;/span&gt;&lt;/em&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;h2 style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-top: 1em; text-align: -webkit-auto;"&gt;




About Google Maps API&lt;/h2&gt;
&lt;div style="background-color: white; font-family: Helvetica, Arial, sans-serif; line-height: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 1em; text-align: -webkit-auto;"&gt;
The Maps API is a free service, available for any web site that is free to consumers. Please see the&amp;nbsp;&lt;a href="http://code.google.com/apis/maps/terms.html" style="color: #0000cc;"&gt;terms of service&lt;/a&gt;&amp;nbsp;for more information.&lt;/div&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: Helvetica, Arial, sans-serif; line-height: 16px;"&gt;Businesses that charge fees for access, track assets or build internal applications must use&amp;nbsp;&lt;/span&gt;&lt;a href="http://code.google.com/apis/maps/documentation/premier/" style="background-color: white; color: #0000cc; font-family: Helvetica, Arial, sans-serif; line-height: 16px; text-align: -webkit-auto;"&gt;Google Maps API Premier&lt;/a&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: Helvetica, Arial, sans-serif; line-height: 16px; text-align: -webkit-auto;"&gt;, which provides enhanced features, technical support and a service-level agreement.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: Helvetica, Arial, sans-serif; line-height: 16px; text-align: -webkit-auto;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: Helvetica, Arial, sans-serif; line-height: 16px; text-align: -webkit-auto;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: large; line-height: 16px; text-align: -webkit-auto;"&gt;&lt;b&gt;&lt;a href="http://www.ticketamerica.com/indiana_pacers_tickets.html" target="_blank"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;indiana pacers tickets&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f1f1f1; color: #797979; font-family: Arial, sans-serif; font-size: 13px;"&gt;Ticketamerica.com has all of you're basketball NBA ticketing needs for teams like the indiana pacers and the milwaukee bucks as well as the atlanta hawks games, maps and seating charts.&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #797979; font-family: Arial, sans-serif; font-size: x-small;"&gt;Links to follow :-&amp;nbsp;&lt;/span&gt;&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;a href="http://www.ticketamerica.com/atlanta_hawks_tickets.html" style="font-family: Arial, sans-serif; font-size: small;" target="_blank"&gt;atlanta hawks tickets&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;a href="http://www.ticketamerica.com/milwaukee_bucks_tickets.html" style="font-family: Arial, sans-serif; font-size: small;" target="_blank"&gt;milwaukee bucks tickets&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;b style="background-color: #f1f1f1; color: #999999; font-family: Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"&gt;Disclosure :&lt;/b&gt;&lt;span class="Apple-style-span" style="background-color: #f1f1f1; color: #797979; font-family: Arial, sans-serif; font-size: 13px;"&gt;Pay Per Post Ad&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span class="Apple-style-span" style="color: #797979; font-family: Arial, sans-serif; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-3299756194958040839?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/IHFJijvrUwE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/3299756194958040839/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/11/google-map-apis-to-charge-for-usage.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/3299756194958040839?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/3299756194958040839?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/IHFJijvrUwE/google-map-apis-to-charge-for-usage.html" title="Google MAP APIs to charge for usage, heavy traffic cost more" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/11/google-map-apis-to-charge-for-usage.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8AQn05fSp7ImA9WhRRGU4.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-4973518879761503880</id><published>2011-10-20T03:02:00.001-07:00</published><updated>2011-12-03T10:44:03.325-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-03T10:44:03.325-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c/c++" /><title>How to stop function inlining ?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/J4TxQvY4tlDNPUoYM3a3XvlzkdE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J4TxQvY4tlDNPUoYM3a3XvlzkdE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/J4TxQvY4tlDNPUoYM3a3XvlzkdE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J4TxQvY4tlDNPUoYM3a3XvlzkdE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span class="Apple-style-span" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;b&gt;__declspec(noinline)&lt;/b&gt;&amp;nbsp;tells the compiler to never inline a particular member function (function in a class).&lt;/div&gt;
&lt;div style="margin-top: -6px;" xmlns="http://www.w3.org/1999/xhtml"&gt;
It may be worthwhile to not inline a function if it is small and not critical to the performance of your code.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;That is, if the function is small and not likely to be called often, such as a function that handles an error condition.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="margin-top: -6px;" xmlns="http://www.w3.org/1999/xhtml"&gt;
Keep in mind that if a function is marked&amp;nbsp;&lt;b&gt;noinline&lt;/b&gt;, the calling function will be smaller and thus, itself a candidate for compiler inlining.&lt;br /&gt;
&lt;br /&gt;
More about inlining :-&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;a href="http://tajendrasengar.blogspot.com/2010/03/what-is-inline-function-in-cc.html" target="_blank"&gt;Inline Function Advantage , Disadvantage , Performance Impact&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://tajendrasengar.blogspot.com/2011/12/inline-function-example-sample-program.html" target="_blank"&gt;Inline Function examples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-4973518879761503880?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/HFIEqmRmXIc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/4973518879761503880/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/10/how-to-stop-function-inlining.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/4973518879761503880?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/4973518879761503880?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/HFIEqmRmXIc/how-to-stop-function-inlining.html" title="How to stop function inlining ?" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/10/how-to-stop-function-inlining.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYFQHY8fyp7ImA9WhdbGEk.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-2616529907200121868</id><published>2011-10-16T06:58:00.000-07:00</published><updated>2011-10-17T02:18:31.877-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-17T02:18:31.877-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Google MAP APIs" /><category scheme="http://www.blogger.com/atom/ns#" term="Widgets" /><title>Distance Calculation from Latitude/Longitude using Google MAP APIs between two locations</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1THujXYyDgAzSK8b03jBgkbud7U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1THujXYyDgAzSK8b03jBgkbud7U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1THujXYyDgAzSK8b03jBgkbud7U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1THujXYyDgAzSK8b03jBgkbud7U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Here is a sample application which i have developed to get the direction, distance and duration between two location/places using &lt;span class="Apple-style-span" style="color: #b45f06; font-size: large;"&gt;Latitude/Longitude&lt;/span&gt; with the help of &lt;b&gt;Google MAP APIs.&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
This application will also reveals that how can we retrieve place/city name from the Latitude/Longitude.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Let's look at the input of application :-&lt;/div&gt;

&lt;img style="border:2px solid black" src="http://2.bp.blogspot.com/-JT5C2169jVQ/TprfCGcRIXI/AAAAAAAAAeg/H4GD-KlLc5c/s640/Distance+calculator+Latitude-Longitude.jpg" /&gt;
&lt;div&gt;
Just input Lat/Lng and press "get Directions with Distance/Duration!" and get the updated direction MAP with Distance and Duration.&lt;br /&gt;
Place A and Place B will displays the Lat/Lng resolved location.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Check out its demo :-&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
--&gt;

 
    &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"/&gt;
    &lt;title&gt;Google Maps API Sample, Distance from Latitude and Longitude between two locations&lt;/title&gt;
     &lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;sensor=false&amp;amp;
key=ABQIAAAAeUlgz5ZezwUbH47hW-nEohQCA9e3Snamcn8o65dAybaGLWFLfRR88VjEEw1CS7bsSs9P0Srig2eL-g" type="text/javascript"&gt;&lt;/script&gt;
    &lt;style type="text/css"&gt;
    body {
      font-family: Verdana, Arial, sans serif;
      font-size: 11px;
      margin: 2px;
    }
    table.directions th {
      background-color:#EEEEEE;
    }

    img {
      color: #000000;
    }
      
    &lt;/style&gt;
    &lt;script type="text/javascript"&gt;

    var map;
    var gdir;
    var geocoder = null;
    var addressMarker;
    var fromAddress ;
    var toAddress;
    var strAddress1 = null;
    var strAddress2 = null;
    var count = 0;
    var oGLatLngTo;
    var glocale;
    
    function initialize() {
      if (GBrowserIsCompatible()) {      
        map = new GMap2(document.getElementById("map_canvas"));
        gdir = new GDirections(map, document.getElementById("directions"));
        geocoder = new GClientGeocoder();
        
        GEvent.addListener(gdir, "load", onGDirectionsLoad);
        GEvent.addListener(gdir, "error", handleErrors);
    
        //setDirections("40.7384918","-74.0022663", "41.707521", "-74.0022663", "en_US");
        setDirections("40.7384918","-74.0022663", "41.707521", "-74.0022663", "en_US");
        
        /*setDirections( document.getElementById("fromC1").value,
                         document.getElementById("fromC2").value, 
                         document.getElementById("toC1").value,
                         document.getElementById("toC2").value,
                        document.getElementById("locale").value);*/
      }
    }
    
    function GetStringAddress1(response) {
      map.clearOverlays();
      if (!response || response.Status.code != 200) {
        alert("Status Code: " + response.Status.code + " , Check Lat and Lng");
      } else {
        var place = response.Placemark[0];
        var point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
        var marker = new GMarker(point);
        //map.addOverlay(marker);
        strAddress1 = place.address;
        fromAddress  = strAddress1;
        //alert("fromAddress  :" + fromAddress  );
         var gc2 = new GClientGeocoder();
         gc2.getLocations(oGLatLngTo   , GetStringAddress2);     
       }
    }
       function GetStringAddress2(response) {
      map.clearOverlays();
      if (!response || response.Status.code != 200) {
        alert("Status Code: " + response.Status.code + " , Check Lat and Lng");
      } else {
        var place = response.Placemark[0];
        var point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
        var marker = new GMarker(point);
        strAddress2 = place.address;
        
         toAddress = strAddress2;
         //alert("toAddress:" + toAddress );
     
         document.getElementById("fromAddressP1").value = fromAddress ;
         document.getElementById("toAddressP2").value = toAddress;
      
         gdir.load("from: " + fromAddress + " to: " + toAddress,
                { "locale": glocale });
                
      
       
      }
    }
      
   function setDirections(gLatLngFromC1, gLatLngFromC2, gLatLngToC1, gLatLngToC2, locale) {
      
      var oGLatLngFrom =  new GLatLng(gLatLngFromC1,gLatLngFromC2);
      oGLatLngTo   =  new GLatLng(gLatLngToC1, gLatLngToC2);
      count = 0;
  
      glocale = locale;
      var gc1 = new GClientGeocoder();
      gc1.getLocations(oGLatLngFrom , GetStringAddress1);
        
      
    }
    
    function handleErrors(){
     if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
       alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
     else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
       alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
     
     else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
       alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);
    
    //   else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS)  &lt;--- Doc bug... this is either not defined, or Doc is wrong
    //     alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);
       
     else if (gdir.getStatus().code == G_GEO_BAD_KEY)
       alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);
    
     else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
       alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
      
     else alert("An unknown error occurred.");
    }
    
    function onGDirectionsLoad(){ 
        // Use this function to access information about the latest load()
        // results.
          var distance = gdir.getDistance().meters;
      
      //alert("Distance is : " + gdir.getDistance().meters + "  and Duration Is: " + gdir.getDuration().seconds/60);
      
        document.getElementById("DistanceKM").value = gdir.getDistance().meters/1000;
            
        document.getElementById("DurationMin").value   = gdir.getDuration().seconds/60;

    }

    &lt;/script&gt;
  
  &lt;body onload="initialize()" onunload="GUnload()" style="font-family: Arial;border:1px solid black;"&gt;
    &lt;h2&gt;Maps API Directions Illustrated with Latitude and Longitude&lt;/h2&gt;
    &lt;form action="#" onsubmit="setDirections(this.fromC1.value, this.fromC2.value, this.toC1.value, this.toC2.value,  this.locale.value); return false"&gt;
      &lt;table&gt;
        &lt;tr&gt;
          &lt;th align="right"&gt;From:&amp;nbsp;&lt;/th&gt;
          &lt;td&gt;
            &lt;input type="text" size="15" id="fromAddressC1" name="fromC1" value="40.7384918"/&gt;
            &lt;input type="text" size="15" id="fromAddressC2" name="fromC2" value="-74.0022663"/&gt;
          &lt;td&gt;
            &lt;th align="right"&gt;&amp;nbsp;&amp;nbsp;To:&amp;nbsp;&lt;/th&gt;
            &lt;td&gt;
              &lt;input type="text" size="15" id="toAddressC1" name="toC1" value="41.707521" /&gt;
              &lt;input type="text" size="15" id="toAddressC2" name="toC2" value="-74.0022663" /&gt;
            &lt;td&gt;
        &lt;/tr&gt;
         &lt;tr&gt;
          &lt;th align="right"&gt;Place A:&amp;nbsp;&lt;/th&gt;
          &lt;td &gt;
            &lt;input type="text" size="40" id="fromAddressP1" name="fromP1" value="NA" 
                  "/&gt;
          &lt;td&gt;
            &lt;th align="right"&gt;&amp;nbsp;Place B:&amp;nbsp;&lt;/th&gt;
            &lt;td align="right"&gt;
              &lt;input type="text" size="40" id="toAddressP2" name="toP2" value="NA" 
                   " /&gt;
          &lt;td&gt;
        &lt;/tr&gt;
         &lt;tr&gt;
          &lt;th align="right"&gt;&lt;span lang="en-us"&gt;Distance &lt;/span&gt;&lt;/th&gt;
          &lt;td&gt;
              &lt;input id="DistanceKM"  type="text" 
                   /&gt;&lt;span lang="en-us"&gt; KM&lt;/span&gt;&lt;td&gt;
                      &amp;nbsp;&lt;th align="right"&gt;&lt;span lang="en-us"&gt;Duration&lt;/span&gt;&lt;/th&gt;
            &lt;td align="left"&gt;
                &lt;input id="DurationMin" align="left"  type="text" /&gt;&lt;span lang="en-us"&gt; Minutes&lt;/span&gt;&lt;td&gt;
                      &amp;nbsp;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;Language:&amp;nbsp;&lt;/th&gt;
          &lt;td colspan="3"&gt;
            &lt;select id="locale" name="locale"&gt;
              &lt;option value="en" selected&gt;English&lt;/option&gt;
              &lt;option value="fr"&gt;French&lt;/option&gt;
              &lt;option value="de"&gt;German&lt;/option&gt;
              &lt;option value="ja"&gt;Japanese&lt;/option&gt;
              &lt;option value="es"&gt;Spanish&lt;/option&gt;
            &lt;/select&gt;
            &lt;input name="submit" type="submit" value="Get Directions with Distance/Duration!" 
                  style="border: thick ridge #FFFFFF" /&gt;
          &lt;td&gt;
        &lt;/tr&gt;
     &lt;/table&gt;
    &lt;/form&gt;
    &lt;br/&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;div style="float: left; padding-right: 5px;"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "E8E7D0";
google_color_bg = "FFFFFF";
google_color_link = "B96F17";
google_color_url = "B96F17";
google_color_text = "000000";
//--&gt;
&lt;/script&gt;
&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/div&gt;
    &lt;table class="directions"&gt;
      &lt;tr&gt;
        &lt;th&gt;Formatted Directions&lt;/th&gt;&lt;th&gt;Map&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td valign="top"&gt;
          &lt;div id="directions" style="width: 275px"&gt;&lt;/div&gt;
        &lt;td&gt;
        &lt;td valign="top""&gt;
          &lt;div id="map_canvas"  style="height: 600px; width: 400px;"&gt;&lt;/div&gt;
        &lt;td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/body&gt;
&lt;/div&gt;
​&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-2616529907200121868?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/0fbeRXf9L2o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/2616529907200121868/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/10/distance-calculation-from.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/2616529907200121868?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/2616529907200121868?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/0fbeRXf9L2o/distance-calculation-from.html" title="Distance Calculation from Latitude/Longitude using Google MAP APIs between two locations" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-JT5C2169jVQ/TprfCGcRIXI/AAAAAAAAAeg/H4GD-KlLc5c/s72-c/Distance+calculator+Latitude-Longitude.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/10/distance-calculation-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEMQnY9fCp7ImA9WhdbFkw.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-8007171634744728186</id><published>2011-10-14T11:22:00.000-07:00</published><updated>2011-10-14T11:24:43.864-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-14T11:24:43.864-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Technology" /><category scheme="http://www.blogger.com/atom/ns#" term="Misc" /><category scheme="http://www.blogger.com/atom/ns#" term="Creative Thinking" /><title>Google's new web programming language, Dart</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WRCC_SW-2of9Ieb8eFiUmLT0iKg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WRCC_SW-2of9Ieb8eFiUmLT0iKg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WRCC_SW-2of9Ieb8eFiUmLT0iKg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WRCC_SW-2of9Ieb8eFiUmLT0iKg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Google recently came up with new programming language for web application named as &lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Dart&lt;/span&gt;&lt;/b&gt;.&lt;br /&gt;
Let's look at its technical specification :-&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #444444; font-family: 'Open Sans', sans-serif; font-size: 15px; line-height: 18px;"&gt;Dart is a new class-based programming language for creating structured web applications. Developed with the goals of simplicity, efficiency, and scalability, the Dart language combines powerful new language features with familiar language constructs into a clear, readable syntax.&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
In 2009, Google launched Go, a language designed for writing server software and handling other chores often handled today by C or C++. Dart, though, is "a new programming language for structured Web programming," according to the schedule for the Goto conference where Googlers plan to describe it next month.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img border="0" src="http://www.dartlang.org/imgs/dart-logo.png" /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="float: left; padding-right: 5px;"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_text = "000000";
google_color_link = "B96F17"; 
google_color_url = "B96F17"; 
//--&gt;
&lt;/script&gt;
&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some Key feature mentioned by google about &lt;b&gt;Dart&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Key features of the Dart language include:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #990000;"&gt;&lt;b&gt;Classes&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Classes and interfaces provide a well understood mechanism for efficiently defining APIs. These constructs enable encapsulation and reuse of methods and data.&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #990000;"&gt;&lt;b&gt;Optional types&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Dart programmers can optionally add static types to their code. Depending on programmer preference and stage of application development, the code can migrate from a simple, untyped experimental prototype to a complex, modular application with typing. Because types state programmer intent, less documentation is required to explain what is happening in the code, and type-checking tools can be used for debugging.&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #990000;"&gt;&lt;b&gt;Libraries&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Developers can create and use libraries that are guaranteed not to change during runtime. Independently developed pieces of code can therefore rely on shared libraries.&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #990000;"&gt;&lt;b&gt;Tooling&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Dart will include a rich set of execution environments, libraries, and development tools built to support the language. These tools will enable productive and dynamic development, including edit-and-continue debugging and beyond—up to a style where you program an application outline, run it, and fill in the blanks as you run.&lt;br /&gt;
&lt;br /&gt;
More information about Dart can be found at :-&amp;nbsp;&lt;a href="http://www.dartlang.org/"&gt;http://www.dartlang.org/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Sample "Hello World"&amp;nbsp;program&amp;nbsp;:-&lt;br /&gt;
&lt;blockquote&gt;
&amp;nbsp;&amp;nbsp;main() {&lt;br /&gt;
&amp;nbsp; var name = 'World';&lt;br /&gt;
&amp;nbsp; print('Hello, ${name}!');&lt;br /&gt;
}&lt;/blockquote&gt;
Tutorial for Dart language :-&amp;nbsp;&lt;a href="http://www.dartlang.org/docs/getting-started/"&gt;http://www.dartlang.org/docs/getting-started/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How to use Dart with HTML ?&lt;/b&gt;&lt;br /&gt;
Like JavaScript, Dart programs can be directly embedded on HTML pages served to the browser.&lt;br /&gt;
Here is the example for it :-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
simple Hello World in HTML using Dart. The main() method is the entry point.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;body&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script type='&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;application/dart&lt;/span&gt;'&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; void &lt;span class="Apple-style-span" style="color: #38761d;"&gt;main&lt;/span&gt;() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HTMLElement element = document.getElementById('&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;message&lt;/span&gt;');&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; element.innerHTML = 'Hello from Dart';&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;div id='message'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/blockquote&gt;
&lt;br /&gt;
The div element above is guaranteed to exist by the time the Dart code starts running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let's see now whether in future DART will hit its target or not.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-8007171634744728186?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/mUk4ipyC8lo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/8007171634744728186/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/10/googles-new-web-programming-language.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/8007171634744728186?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/8007171634744728186?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/mUk4ipyC8lo/googles-new-web-programming-language.html" title="Google's new web programming language, Dart" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/10/googles-new-web-programming-language.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMEQH4yfip7ImA9WhdbFEU.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-8376312772313324034</id><published>2011-10-12T23:13:00.000-07:00</published><updated>2011-10-12T23:13:21.096-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-12T23:13:21.096-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SEO" /><category scheme="http://www.blogger.com/atom/ns#" term="Blogger Blogging Blog" /><title>How to write HTML code inside blogger blog post ?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JyuMfKC-a8lBBIAmEz7WXK6XTFw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JyuMfKC-a8lBBIAmEz7WXK6XTFw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JyuMfKC-a8lBBIAmEz7WXK6XTFw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JyuMfKC-a8lBBIAmEz7WXK6XTFw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Most of the time it become very messy when we try to write HTML code inside blog post.&lt;br /&gt;
It does not appear in the same way as we want when we publish it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Following are some tricks which one can follow to simplify this process :-&lt;/b&gt;
&lt;br /&gt;
&lt;br/&gt;
&lt;div style="float: left; padding-right: 5px;"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_text = "000000";
google_color_link = "B96F17"; 
google_color_url = "B96F17"; 
//--&gt;
&lt;/script&gt;
&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Using existing HTML editor for writing complete content, and then copy paste entire content in post HTML mode.&lt;br /&gt;
2) Encode specific code with HTML encoder :-&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;shared one link here for you :&amp;nbsp;&lt;a href="http://centricle.com/tools/html-entities/"&gt;http://centricle.com/tools/html-entities/&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; a) Write your html code or any other code in the above site&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; b) Press encode button. This will change all html tags with relevant encoded symbols ( e.g. &amp;lt; with &amp;lt; )&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; c) Copy and paste encoded content into your compose post window.&lt;br /&gt;
here is the demo of&amp;nbsp;embedded&amp;nbsp;code:-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
void CLogicalTimeMarker::RegisteringFlag(int nModuleID, char* pszName)&lt;br /&gt;{&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;if(NULL != pszName &amp;amp;&amp;amp; nModuleID &amp;lt;= g_nMaxModuleSupported)&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;{&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;m_stArrTimeAccounterStats[nModuleID].strName = &amp;nbsp;pszName;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;br /&gt;}&lt;/blockquote&gt;
Here is one more site doing same html code encode:-&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href="http://www.eblogtemplates.com/blogger-ad-code-converter/"&gt;http://www.eblogtemplates.com/blogger-ad-code-converter/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="float: left; padding-right: 5px;"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_text = "000000";
google_color_link = "B96F17"; 
google_color_url = "B96F17"; 
//--&gt;
&lt;/script&gt;
&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Though one can embed any type of code like c/c++ , javascript , html with discussed approach.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-8376312772313324034?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/aOPmCg9ihWY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/8376312772313324034/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/10/how-to-write-html-code-inside-blogger.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/8376312772313324034?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/8376312772313324034?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/aOPmCg9ihWY/how-to-write-html-code-inside-blogger.html" title="How to write HTML code inside blogger blog post ?" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/10/how-to-write-html-code-inside-blogger.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMNQno5cCp7ImA9WhdbFEk.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-3111714481137201927</id><published>2011-10-12T10:45:00.000-07:00</published><updated>2011-10-12T11:34:53.428-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-12T11:34:53.428-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Google MAP APIs" /><category scheme="http://www.blogger.com/atom/ns#" term="Widgets" /><title>Distance between two locations with the help of Latitude and Longitude</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AjZQ2w1UGZA1JHpmeZT_cnHJGwg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AjZQ2w1UGZA1JHpmeZT_cnHJGwg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AjZQ2w1UGZA1JHpmeZT_cnHJGwg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AjZQ2w1UGZA1JHpmeZT_cnHJGwg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

   
&lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;sensor=false&amp;amp;
key=ABQIAAAAeUlgz5ZezwUbH47hW-nEohQCA9e3Snamcn8o65dAybaGLWFLfRR88VjEEw1CS7bsSs9P0Srig2eL-g" type="text/javascript"&gt;
&lt;/script&gt;   
   
       &lt;script type="text/javascript"&gt;

    var map;
    var gdir;
      //var geocoder = null;
    var addressMarker;
    var fromAddress ;
    var toAddress;
    var strAddress1 = null;
    var strAddress2 = null;
      var count = 0;
    
    function initialize() {
      if (GBrowserIsCompatible()) {      
        map = new GMap2(document.getElementById("map_canvas"));
        gdir = new GDirections(map, document.getElementById("directions"));
        //geocoder = new GClientGeocoder();
        
        GEvent.addListener(gdir, "load", onGDirectionsLoad);
        GEvent.addListener(gdir, "error", handleErrors);
    
    
        //setDirections("40.7384918","-74.0022663", "41.707521", "-74.0022663", "en_US");
        //setDirections("40.7384918","-74.0022663", "41.707521", "-74.0022663", "en_US");
        
        /*setDirections( document.getElementById("fromC1").value,
                         document.getElementById("fromC2").value, 
                         document.getElementById("toC1").value,
                         document.getElementById("toC2").value,
                        document.getElementById("locale").value);*/
      }
    }
    
    function GetStringAddress1(response) {
      map.clearOverlays();
      if (!response || response.Status.code != 200) {
        alert("Status Code: " + response.Status.code + " , Check Lat and Lng");
      } else {
        var place = response.Placemark[0];
        var point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
        var marker = new GMarker(point);
        //map.addOverlay(marker);
        strAddress1 = place.address;
       }
    }
       function GetStringAddress2(response1) {
      map.clearOverlays();
      if (!response1 || response1.Status.code != 200) {
        alert("Status Code: " + response1.Status.code + " , Check Lat and Lng");
      } else {
        var place = response1.Placemark[0];
        var point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
        var marker = new GMarker(point);
        strAddress2 = place.address;
       
      }
    }
      
      function pausecomp(millis) 
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); } 
while(curDate-date &lt; millis);
} 
      
       function setDirectionsA(AgLatLngFromC1, AgLatLngFromC2, AgLatLngToC1, AgLatLngToC2, Alocale) {
         //for(count = 0; count &lt; 2; count++)
         {
           setDirections(AgLatLngFromC1, AgLatLngFromC2, AgLatLngToC1, AgLatLngToC2, Alocale);
           //pausecomp(1000);
           // setDirections(AgLatLngFromC1, AgLatLngFromC2, AgLatLngToC1, AgLatLngToC2, Alocale);
         }
       }
    
    function setDirections(gLatLngFromC1, gLatLngFromC2, gLatLngToC1, gLatLngToC2, locale) {
      
      //GUnload();
      
      //initialize();
      
      var oGLatLngFrom =  new GLatLng(gLatLngFromC1,gLatLngFromC2);
      var oGLatLngTo   =  new GLatLng(gLatLngToC1, gLatLngToC2);
      count = 0;
      // for(count = 0; count &lt; 3; count++ )
      {
      // alert("gLatLngFrom:" + gLatLngFrom);
         
      
      var gc1 = new GClientGeocoder();
        gc1.reset();
      gc1.getLocations(oGLatLngFrom , GetStringAddress1);
      fromAddress  = strAddress1;
        //alert("fromAddress  :" + fromAddress  );
    }
      count = 0;
      //for(count = 0; count &lt; 3; count++ )
      {
      var gc2 = new GClientGeocoder();
         gc2.reset();
      gc2.getLocations(oGLatLngTo   , GetStringAddress2);
      toAddress = strAddress2;
        //alert("toAddress:" + toAddress );
    }
      //alert("toAddress:" + gLatLngToC1);
      
      document.getElementById("fromAddressP1").value = fromAddress ;
      document.getElementById("toAddressP2").value = toAddress;
      
      gdir.load("from: " + fromAddress + " to: " + toAddress,
                { "locale": locale });
      
      
    }
      
       function setDirectionsC(gLatLngFromC1, gLatLngFromC2, gLatLngToC1, gLatLngToC2, locale) {
      
      var oGLatLngFrom =  new GLatLng(gLatLngFromC1,gLatLngFromC2);
      var oGLatLngTo   =  new GLatLng(gLatLngToC1, gLatLngToC2);
      count = 0;
      // for(count = 0; count &lt; 3; count++ )
      {
      // alert("gLatLngFrom:" + gLatLngFrom);
      var gc1 = new GClientGeocoder();
      gc1.getLocations(oGLatLngFrom , GetStringAddress1);
      fromAddress  = strAddress1;
      alert("fromAddress  :" + fromAddress  );
    }
      count = 0;
      //for(count = 0; count &lt; 3; count++ )
      {
      var gc2 = new GClientGeocoder();
      gc2.getLocations(oGLatLngTo   , GetStringAddress2);
      toAddress = strAddress2;
      alert("toAddress:" + toAddress );
    }
      //alert("toAddress:" + gLatLngToC1);
      
      document.getElementById("fromAddressP1").value = fromAddress ;
      document.getElementById("toAddressP2").value = toAddress;
      
      gdir.load("from: " + fromAddress + " to: " + toAddress,
                { "locale": locale });
      
      
    }
    
    function handleErrors(){
     if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
       alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
     else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
       alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
     
     else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
       alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);
    
    //   else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS)  &lt;--- Doc bug... this is either not defined, or Doc is wrong
    //     alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);
       
     else if (gdir.getStatus().code == G_GEO_BAD_KEY)
       alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);
    
     else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
       alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
      
     else alert("An unknown error occurred.");
    }
    
    function onGDirectionsLoad(){ 
        // Use this function to access information about the latest load()
        // results.
    
        // e.g.
        // document.getElementById("getStatus").innerHTML = gdir.getStatus().code;
      // and yada yada yada...
      // setDirections("40.7384918","-74.0022663", "41.707521", "-74.0022663", "en_US");
      //alert("gdir.getStatus().code"+gdir.getStatus().code);
     
    }

    &lt;/script&gt;
&lt;body onload="initialize()" onunload="GUnload()"&gt;

    &lt;span class="style26" lang="en-us"&gt;&lt;span class="style29"&gt;&lt;span class="style6"&gt;
    Finding &lt;/span&gt;&lt;span class="style24"&gt;Distance&lt;/span&gt;&lt;span class="style6"&gt; 
    between two locations with Latitude and Longitude&lt;/span&gt;&lt;/span&gt;&lt;span 
        class="style25"&gt;.&lt;br class="style16" /&gt;
    &lt;br class="style16" /&gt;
    &lt;span class="style16"&gt;Lets see how can we find out the distance and duration 
    between two diffrent locations,
    &lt;br /&gt;
    if you have the latitude and longitude of two places.&lt;/span&gt;&lt;br 
        class="style16" /&gt;
    &lt;br class="style16" /&gt;
    &lt;span class="style16"&gt;Here is the pic of the application :-&lt;/span&gt;&lt;br 
        class="style16" /&gt;
&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="https://picasaweb.google.com/lh/photo/gGeyrGe7qHNTYfi-SPp-ENVZw4JXrCaleKH1Tie_fMY?feat=embedwebsite"&gt;&lt;img src="https://lh3.googleusercontent.com/-Nl4zw3vgMDc/TpXWdnn_gpI/AAAAAAAAAeY/1jcnVCkQGpk/s800/Google%252520Map%252520Lat%252520Lng.jpg" height="621" width="678" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div style="float: left; padding-right: 5px;"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_text = "000000";
//--&gt;
&lt;/script&gt;
&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
    &lt;br class="style6" /&gt;
    &lt;span class="style24"&gt;Steps for finding distance with latitude/longitude&lt;/span&gt;&lt;span 
        class="style16"&gt;.&lt;b&gt;&lt;br /&gt;
    &lt;/b&gt;1) Lets say we have latitude and longitude set P1 and P2.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Google MAP comes up with the class
    &lt;a href="http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GLatLng"&gt;
    GLatLng&lt;/a&gt;. This class helps to encapsulate Latitude&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; and Longitude.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class="style26"&gt;GLatLng is a point in 
    geographical coordinates longitude and latitude. Notice that although usual map 
    projections associate longitude with the x-coordinate of the map, and latitude 
    with the y-coordinate, the latitude cooridnate is always written first, followed 
    by the longitude, as it is custom in cartography. &lt;/span&gt;&lt;span class="style25"&gt;
    &lt;span class="style6"&gt;&lt;span class="style16" 
        style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"&gt;
    &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" 
        style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"&gt;&lt;span 
        class="style16"&gt;&lt;br /&gt;
    &lt;br /&gt;
    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="style6"&gt;&lt;span class="style26"&gt;2) From this 
    GLatLng points we need to get place name first.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class="style26"&gt;class &lt;b&gt;GClientGeocoder&lt;/b&gt; 
    will help us to get the place name from LatLng.&lt;/span&gt;&lt;span class="style16"&gt;&lt;br 
        class="style25" /&gt;
    &lt;span class="style25"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class="style26"&gt;This 
    class is used to communicate directly with Google servers to obtain geocodes for 
    user specified addresses. In addition, a geocoder maintains its own cache of 
    addresses, which allows repeated queries to be answered without a round trip to 
    the server. As a general best practice, it is not recommended to use 
    GClientGeocoder functions in a loop. Developers that have multiple addresses to 
    geocode should probably use our HTTP Geocoder instead.&lt;br /&gt;
    &lt;br /&gt;
    &lt;span class="style9"&gt;Method&lt;/span&gt; :- &lt;/span&gt;&lt;span class="style8"&gt;
    &lt;span class="style26" 
        style="color: rgb(0, 112, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"&gt;
    getLocations(latlng:&lt;a 
        href="http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GLatLng" 
        style="color: rgb(0, 0, 204); " title="GLatLng"&gt;GLatLng&lt;/a&gt;, 
    callback:function)&lt;br /&gt;
    &lt;br /&gt;
    &lt;/span&gt;&lt;/span&gt;&lt;span class="style16"&gt;&lt;span class="style26" 
        style="border-style: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(240, 240, 240);"&gt;
    This method performs reverse-geocoding, the conversion of a latitude/longitude 
    pair into human-readable addresses. getLocations() sends a request to the Google 
    geocoding service, asking it to return the address for the given latlng and pass 
    the response in the given callback. As this method requires a call to a Google 
    server, you must also pass a callback method to handle the response. This 
    response will contain a Status code, and if successful, one or more Placemark 
    objects. Note that this method may instead pass an addressable String, as 
    indicated above; in that case, the service will do a standard geocode. If 
    however, the first argument contains a GLatLng, the service will do a 
    reverse-geocode.&lt;/span&gt;&lt;/span&gt;&lt;span class="style8"&gt;&lt;span class="style26" 
        style="color: rgb(0, 112, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"&gt;&lt;br /&gt;
    &lt;br /&gt;
    &lt;/span&gt;&lt;span class="style28" 
        style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"&gt;
    Here is the example of function :-&lt;br /&gt;
    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" 
        style="color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); font-size: small; "&gt;
    &lt;pre class="prettyprint" 
        style="font-family: monospace; color: rgb(0, 112, 0); font-size: 9pt; background-color: rgb(250, 250, 250); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); line-height: 15px; margin-top: 1em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.99em; padding-right: 0.99em; padding-bottom: 0.99em; padding-left: 0.99em; overflow-x: auto; overflow-y: auto; word-wrap: break-word; "&gt;&lt;span 
        class="kwd" style="color: rgb(0, 0, 136); "&gt;function&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; showAddress&lt;/span&gt;&lt;span 
        class="pun" style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;response&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;)&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;{&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
  map&lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt;clearOverlays&lt;/span&gt;&lt;span 
        class="pun" style="color: rgb(102, 102, 0); "&gt;();&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
  &lt;/span&gt;&lt;span class="kwd" style="color: rgb(0, 0, 136); "&gt;if&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;(!&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;response &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;||&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; response&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Status&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;code &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;!=&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="lit" 
        style="color: rgb(0, 102, 102); "&gt;200&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;)&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;{&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
    alert&lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span 
        class="str" style="color: rgb(0, 136, 0); "&gt;&amp;quot;Status Code:&amp;quot;&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; response&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Status&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;code&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;);&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
  &lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;}&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="kwd" 
        style="color: rgb(0, 0, 136); "&gt;else&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;{&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
    place &lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;=&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; response&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Placemark&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;[&lt;/span&gt;&lt;span class="lit" 
        style="color: rgb(0, 102, 102); "&gt;0&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;];&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
    point &lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;=&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="kwd" 
        style="color: rgb(0, 0, 136); "&gt;new&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;GLatLng&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;place&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Point&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;coordinates&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;[&lt;/span&gt;&lt;span class="lit" 
        style="color: rgb(0, 102, 102); "&gt;1&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;],&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;place&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Point&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;coordinates&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;[&lt;/span&gt;&lt;span class="lit" 
        style="color: rgb(0, 102, 102); "&gt;0&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;]);&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
    marker &lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;=&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="kwd" 
        style="color: rgb(0, 0, 136); "&gt;new&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;GMarker&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;point&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;);&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
    map&lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt;addOverlay&lt;/span&gt;&lt;span 
        class="pun" style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;marker&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;);&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
    marker&lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt;openInfoWindowHtml&lt;/span&gt;&lt;span 
        class="pun" style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
        &lt;/span&gt;&lt;span class="str" style="color: rgb(0, 136, 0); "&gt;&amp;#39;orig latlng:&amp;#39;&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; response&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;name &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="str" 
        style="color: rgb(0, 136, 0); "&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; 
        &lt;/span&gt;&lt;span class="str" style="color: rgb(0, 136, 0); "&gt;&amp;#39;latlng:&amp;#39;&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; place&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Point&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;coordinates&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;[&lt;/span&gt;&lt;span class="lit" 
        style="color: rgb(0, 102, 102); "&gt;1&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;]&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="str" 
        style="color: rgb(0, 136, 0); "&gt;&amp;quot;,&amp;quot;&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; place&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Point&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;coordinates&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;[&lt;/span&gt;&lt;span class="lit" 
        style="color: rgb(0, 102, 102); "&gt;0&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;]&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="str" 
        style="color: rgb(0, 136, 0); "&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
        &lt;/span&gt;&lt;span class="str" style="color: rgb(0, 136, 0); "&gt;&amp;#39;Status Code:&amp;#39;&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; response&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Status&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;code &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="str" 
        style="color: rgb(0, 136, 0); "&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
        &lt;/span&gt;&lt;span class="str" style="color: rgb(0, 136, 0); "&gt;&amp;#39;Status Request:&amp;#39;&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; response&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Status&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;request &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="str" 
        style="color: rgb(0, 136, 0); "&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
        &lt;/span&gt;&lt;span class="str" style="color: rgb(0, 136, 0); "&gt;&amp;#39;Address:&amp;#39;&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; place&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;address &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="str" 
        style="color: rgb(0, 136, 0); "&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
        &lt;/span&gt;&lt;span class="str" style="color: rgb(0, 136, 0); "&gt;&amp;#39;Accuracy:&amp;#39;&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; place&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;AddressDetails&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Accuracy&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="str" 
        style="color: rgb(0, 136, 0); "&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
        &lt;/span&gt;&lt;span class="str" style="color: rgb(0, 136, 0); "&gt;&amp;#39;Country code: &amp;#39;&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;+&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; place&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;AddressDetails&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;Country&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;CountryNameCode&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;);&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
  &lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;}&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt;
&lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;}&lt;/span&gt;&lt;/pre&gt;
    &lt;/span&gt;&lt;span class="style6"&gt;&lt;span class="style18"&gt;
    &lt;br /&gt;
    &lt;/span&gt;&lt;/span&gt;&lt;span class="style16"&gt;
    &lt;br class="style25" /&gt;
    &lt;span class="style18"&gt;&lt;span class="style25"&gt;3) With the help of place name, we 
    will query map for getting the distance and duration.&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="style26"&gt;A sample code snippet for 
    displaying location with map :-&lt;/span&gt;&lt;span class="style16"&gt;&lt;span 
        class="style4"&gt;&lt;span class="style25"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;
    &lt;/span&gt;&lt;span class="style10"&gt;&lt;span class="Apple-style-span" 
        style="color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); font-size: small; "&gt;
    &lt;pre class="prettyprint" 
        style="font-family: monospace; color: rgb(0, 112, 0); font-size: 9pt; background-color: rgb(250, 250, 250); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); line-height: 15px; margin-top: 1em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.99em; padding-right: 0.99em; padding-bottom: 0.99em; padding-left: 0.99em; overflow-x: auto; overflow-y: auto; word-wrap: break-word; "&gt;&lt;span 
        class="com" style="color: rgb(136, 0, 0); "&gt;// Create a directions object and register a map and DIV to hold the &lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt;
&lt;/span&gt;&lt;span class="com" style="color: rgb(136, 0, 0); "&gt;// resulting computed directions&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt;

&lt;/span&gt;&lt;span class="kwd" style="color: rgb(0, 0, 136); "&gt;var&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; map&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;;&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
&lt;/span&gt;&lt;span class="kwd" style="color: rgb(0, 0, 136); "&gt;var&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; directionsPanel&lt;/span&gt;&lt;span 
        class="pun" style="color: rgb(102, 102, 0); "&gt;;&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
&lt;/span&gt;&lt;span class="kwd" style="color: rgb(0, 0, 136); "&gt;var&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; directions&lt;/span&gt;&lt;span 
        class="pun" style="color: rgb(102, 102, 0); "&gt;;&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;

&lt;/span&gt;&lt;span class="kwd" style="color: rgb(0, 0, 136); "&gt;function&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; initialize&lt;/span&gt;&lt;span 
        class="pun" style="color: rgb(102, 102, 0); "&gt;()&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;{&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
  map &lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;=&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="kwd" 
        style="color: rgb(0, 0, 136); "&gt;new&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;GMap2&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;document&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;getElementById&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span class="str" 
        style="color: rgb(0, 136, 0); "&gt;&amp;quot;map_canvas&amp;quot;&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;));&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
  directionsPanel &lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;=&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; document&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;getElementById&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span class="str" 
        style="color: rgb(0, 136, 0); "&gt;&amp;quot;my_textual_div&amp;quot;&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;);&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
  directions &lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;=&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="kwd" 
        style="color: rgb(0, 0, 136); "&gt;new&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;span class="typ" 
        style="color: rgb(102, 0, 102); "&gt;GDirections&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;map&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;,&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt; directionsPanel&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;);&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
  directions&lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;.&lt;/span&gt;&lt;span 
        class="pln" style="color: rgb(0, 0, 0); "&gt;load&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;(&lt;/span&gt;&lt;span class="str" 
        style="color: rgb(0, 136, 0); "&gt;&amp;quot;from:&amp;quot;+ &lt;/span&gt;&lt;span class="style11"&gt;fromAddress&lt;/span&gt;&lt;span 
        class="str" style="color: rgb(0, 136, 0); "&gt; + &amp;quot;to: &amp;quot; + &lt;/span&gt;&lt;span 
        class="style11"&gt;toAddress&lt;/span&gt;&lt;span class="pun" 
        style="color: rgb(102, 102, 0); "&gt;);&lt;/span&gt;&lt;span class="pln" 
        style="color: rgb(0, 0, 0); "&gt;
&lt;/span&gt;&lt;span class="pun" style="color: rgb(102, 102, 0); "&gt;}&lt;/span&gt;&lt;/pre&gt;
    &lt;/span&gt;&lt;/span&gt;&lt;span class="style6"&gt;&lt;span class="style16" 
        style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"&gt;
    &lt;br class="style25" /&gt;
    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="style20"&gt;&amp;nbsp; fromAddress&lt;/span&gt;&lt;span 
        class="style26"&gt; and &lt;b&gt;toAddress&lt;/b&gt; is the same which we can retrieve 
    easily with as we have discussed in step 2.&lt;/span&gt;&lt;p class="style20"&gt;
        Let&amp;#39;s see the demo in a sample application&lt;/p&gt;
    &lt;p&gt;
        &amp;nbsp;&lt;/p&gt;

&lt;br /&gt;
&lt;div style="float: left; padding-right: 5px;"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_text = "000000";
//--&gt;
&lt;/script&gt;
&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
        
       &lt;form action="#" onsubmit="setDirectionsA(this.fromC1.value, this.fromC2.value, this.toC1.value, this.toC2.value,  this.locale.value); return false"&gt;
      &lt;table&gt;
        &lt;tr&gt;
          &lt;th align="right"&gt;From:&amp;nbsp;&lt;/th&gt;
          &lt;td&gt;
            &lt;input type="text" size="15" id="fromAddressC1" name="fromC1" value="40.7384918"/&gt;
            &lt;input type="text" size="15" id="fromAddressC2" name="fromC2" value="-74.0022663"/&gt;
          &lt;td&gt;
            &lt;th align="right"&gt;&amp;nbsp;&amp;nbsp;To:&amp;nbsp;&lt;/th&gt;
            &lt;td&gt;
              &lt;input type="text" size="15" id="toAddressC1" name="toC1" value="41.707521" /&gt;
              &lt;input type="text" size="15" id="toAddressC2" name="toC2" value="-74.0022663" /&gt;
            &lt;td&gt;
        &lt;/tr&gt;
         &lt;tr&gt;
          &lt;th align="right"&gt;Place A:&amp;nbsp;&lt;/th&gt;
          &lt;td&gt;
            &lt;input type="text" size="50" id="fromAddressP1" name="fromP1" value="NA"/&gt;
          &lt;td&gt;
            &lt;th align="right"&gt;&amp;nbsp;Place B:&amp;nbsp;&lt;/th&gt;
            &lt;td align="right"&gt;
              &lt;input type="text" size="50" id="toAddressP2" name="toP2" value="NA" /&gt;
          &lt;td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;Language:&amp;nbsp;&lt;/th&gt;
          &lt;td colspan="3"&gt;
            &lt;select id="locale" name="locale"&gt;
              &lt;option value="en" selected&gt;English&lt;/option&gt;
              &lt;option value="fr"&gt;French&lt;/option&gt;
              &lt;option value="de"&gt;German&lt;/option&gt;
              &lt;option value="ja"&gt;Japanese&lt;/option&gt;
              &lt;option value="es"&gt;Spanish&lt;/option&gt;
            &lt;/select&gt;
            &lt;input name="submit" type="submit" value="Save Updated Values!" /&gt;
            &lt;input name="submit" type="submit" value="Show In Map!" /&gt;
          &lt;td&gt;
        &lt;/tr&gt;
     &lt;/table&gt;
    &lt;/form&gt;
    &lt;br/&gt;
    &lt;table class="directions"&gt;
      &lt;tr&gt;
        &lt;th&gt;Formatted Directions&lt;/th&gt;&lt;th&gt;Map&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td valign="top"&gt;
          &lt;div id="directions" style="width: 275px"&gt;&lt;/div&gt;
        &lt;td&gt;
        &lt;td valign="top"&gt;
          &lt;div id="map_canvas" style="width: 350px; height: 450px"&gt;&lt;/div&gt;
        &lt;td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;

&lt;/body&gt;


&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-3111714481137201927?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/jYKS3TG_0Ek" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/3111714481137201927/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/10/distance-between-two-locations-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/3111714481137201927?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/3111714481137201927?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/jYKS3TG_0Ek/distance-between-two-locations-with.html" title="Distance between two locations with the help of Latitude and Longitude" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh3.googleusercontent.com/-Nl4zw3vgMDc/TpXWdnn_gpI/AAAAAAAAAeY/1jcnVCkQGpk/s72-c/Google%252520Map%252520Lat%252520Lng.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/10/distance-between-two-locations-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkAHRXg9eip7ImA9WhdUFEs.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-8332403351645488407</id><published>2011-10-01T03:18:00.000-07:00</published><updated>2011-10-01T03:25:34.662-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-01T03:25:34.662-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Widgets" /><category scheme="http://www.blogger.com/atom/ns#" term="Blogger Blogging Blog" /><title>How to add gadget to blogger header ?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eOPGL0WTfw0LNcpGL3DM6N1RKjc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eOPGL0WTfw0LNcpGL3DM6N1RKjc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eOPGL0WTfw0LNcpGL3DM6N1RKjc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eOPGL0WTfw0LNcpGL3DM6N1RKjc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Recently experimenting with blogger template came across need of &lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;adding gadget to blogger header.&lt;/b&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Its very simple , just follow the steps below :-&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;1) Go to the edit section of blogger template.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Template-&amp;gt;Edit HTML&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;2) Search for following code which is about header.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="color: #660000;"&gt;&amp;lt;b:section class='header' id='header' maxwidgets='1' showaddelement='no'&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee; color: #335577; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee; color: #335577; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;3) Just change the &lt;i&gt;showaddelement &lt;/i&gt;to yes.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;4) Now move back to template layout view and now one can gadget to the header.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-pdWu4tG1BY4/TobncOMcS7I/AAAAAAAAAd8/NuQlYjp8l5I/s1600/Blog+Header.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="155" src="http://2.bp.blogspot.com/-pdWu4tG1BY4/TobncOMcS7I/AAAAAAAAAd8/NuQlYjp8l5I/s640/Blog+Header.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In addition to it one can also change &lt;i&gt;maxwidgets &lt;/i&gt;count from 1 to desired number to increase widget counts.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Extending the same concept of &lt;i&gt;showaddelement &lt;/i&gt;and &lt;i&gt;maxwidgets,&lt;/i&gt; one can also add and increase the gadget count to any other part of your blog. For example to body, footer or side&amp;nbsp;column.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Try this out to customize.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-8332403351645488407?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/-JGRSzXULIY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/8332403351645488407/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/10/how-to-add-gadget-to-blogger-header.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/8332403351645488407?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/8332403351645488407?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/-JGRSzXULIY/how-to-add-gadget-to-blogger-header.html" title="How to add gadget to blogger header ?" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-pdWu4tG1BY4/TobncOMcS7I/AAAAAAAAAd8/NuQlYjp8l5I/s72-c/Blog+Header.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/10/how-to-add-gadget-to-blogger-header.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAGSXc_eyp7ImA9WhdVGEk.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-2500532453229748213</id><published>2011-09-23T22:50:00.000-07:00</published><updated>2011-09-23T22:55:28.943-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-23T22:55:28.943-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SEO" /><category scheme="http://www.blogger.com/atom/ns#" term="Creative Thinking" /><title>Google In Page Analytics</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/o_71_UipZS_wCbvm8HkyGBkwbFY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/o_71_UipZS_wCbvm8HkyGBkwbFY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/o_71_UipZS_wCbvm8HkyGBkwbFY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/o_71_UipZS_wCbvm8HkyGBkwbFY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;Yet another awesome innovation from Google.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;A very&lt;b&gt;&lt;span class="Apple-style-span" style="color: #660000;"&gt; &lt;span class="Apple-style-span" style="font-size: large;"&gt;important SEO tool&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;, it actually helps one to visualize click views performed on a web page. Google recently launched In Page&amp;nbsp;Analytic&amp;nbsp; for this which can be found under Content section of&amp;nbsp;Google&amp;nbsp;analytic.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #222222; line-height: 19px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&amp;nbsp;It enables you to visually analyze your website pages in order to assess how users interact with those pages, and helps you understand the answers to questions as per Google Analytics such as:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="float: left; padding-right: 5px;"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "E8E7D0";
google_color_bg = "dcdcdc";
google_color_link = "B96F17";
google_color_url = "B96F17";
google_color_text = "000000";
//--&gt;
&lt;/script&gt;
&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;Is my page layout optimal for what I want users to accomplish on the page?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;Are my users seeing the content I want them to see?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;Are my users finding what they're looking for on the page?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;Are my calls to action motivating or visible enough?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;Which links are users clicking?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;Here is the image for my web page:-&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;a href="http://1.bp.blogspot.com/-kjZtmWiKvgI/Tn1nU75ZdNI/AAAAAAAAAdk/3uUMkwpX0es/s1600/In+Page+Analytics.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="246" src="http://1.bp.blogspot.com/-kjZtmWiKvgI/Tn1nU75ZdNI/AAAAAAAAAdk/3uUMkwpX0es/s640/In+Page+Analytics.gif" width="640" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;It's really great to see In-Page-Analytic report.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;For more details one can refer :-&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;a href="http://www.google.com/support/analytics/bin/answer.py?answer=178902"&gt;http://www.google.com/support/analytics/bin/answer.py?answer=178902&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
For SEO purpose this analysis report is very helpful, Try it out.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-2500532453229748213?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/rOSEMGU4uro" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/2500532453229748213/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/google-in-page-analytics.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/2500532453229748213?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/2500532453229748213?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/rOSEMGU4uro/google-in-page-analytics.html" title="Google In Page Analytics" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-kjZtmWiKvgI/Tn1nU75ZdNI/AAAAAAAAAdk/3uUMkwpX0es/s72-c/In+Page+Analytics.gif" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/google-in-page-analytics.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQER3s5eip7ImA9WhdVFUw.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-759231909138318942</id><published>2011-09-20T01:59:00.000-07:00</published><updated>2011-09-20T04:15:06.522-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-20T04:15:06.522-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SEO" /><category scheme="http://www.blogger.com/atom/ns#" term="Blogger Blogging Blog" /><title>How to add adsense to blog using javascript</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/X_sh17FTzZGRethfzhPGxOcYqlM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/X_sh17FTzZGRethfzhPGxOcYqlM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/X_sh17FTzZGRethfzhPGxOcYqlM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/X_sh17FTzZGRethfzhPGxOcYqlM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;title&gt;Untitled Page&lt;/title&gt;
    &lt;style type="text/css"&gt;
 p.MsoNormal
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:10.0pt;
	margin-left:0cm;
	line-height:115%;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	}
    
&lt;/style&gt;
&lt;script language="javascript" type="text/javascript"&gt;
// &lt;!CDATA[

function IMG1_onclick() {

}

// ]]&gt;
&lt;/script&gt;



&lt;br /&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Google Adsense &lt;/span&gt;&lt;/b&gt;can be easily added with the help of &lt;b&gt;javascript &lt;/b&gt;in any poart of post.&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&amp;nbsp;Lets look at the simple steps for doing it :-&amp;nbsp;
        &lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none;"&gt;
1) Go to the edit post of your blog.
    &lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none;"&gt;
2) Select HTML edit mode.
    &lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none;"&gt;
3) Insert following javascript to your HTML.&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none;"&gt;
&lt;strong&gt;&lt;em&gt;
            Below is the example of leader board Adsense :- &lt;/em&gt;&lt;/strong&gt;
    &lt;/div&gt;
&lt;div id=""javascript"&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
-------------------------------------------------------------------------------------------------------------------------&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
                &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span class="Apple-style-span" style="color: blue; font-family: 'Courier New'; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;script&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="text/javascript"&amp;gt;&amp;lt;&lt;/span&gt;!--&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_ad_client = &lt;span style="color: maroon;"&gt;"ca-pub-9274462217825187"&lt;/span&gt;;&lt;o:p&gt; 
        //change your pusblisher id&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_ad_width = 728;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_ad_height = 90;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_ad_format = &lt;span style="color: maroon;"&gt;"728x90_as"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_ad_type = &lt;span style="color: maroon;"&gt;"text"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_ad_channel =&lt;span style="color: maroon;"&gt;""&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_color_border = &lt;span style="color: maroon;"&gt;"E8E7D0"&lt;/span&gt;;&lt;o:p&gt; //change 
        background color from here&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_color_bg = &lt;span style="color: maroon;"&gt;"dcdcdc"&lt;/span&gt;;&lt;o:p&gt; //change back 
        ground coloe from here&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/o:p&gt;
            &amp;nbsp;&amp;nbsp;
            &amp;nbsp;&amp;nbsp;
            &amp;nbsp;&amp;nbsp;
            &amp;nbsp;&amp;nbsp;
            &amp;nbsp;&amp;nbsp; &lt;/span&gt;
    &lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_color_link = &lt;span style="color: maroon;"&gt;"B96F17"&lt;/span&gt;;&lt;o:p&gt; //change 
        link color from here&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_color_url = &lt;span style="color: maroon;"&gt;"B96F17"&lt;/span&gt;;&lt;o:p&gt; //change url 
        color from here&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
        google_color_text = &lt;span style="color: maroon;"&gt;"000000"&lt;/span&gt;;&lt;o:p&gt; //change 
        text color from here&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;//--&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;/&lt;/span&gt;&lt;span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;script&lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;script&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="text/javascript"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="color: red; font-family: 'Courier New'; font-size: 10pt;"&gt;src&lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;="http://pagead2.googlesyndication.com/pagead/show_ads.js"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;!--&lt;/font--&gt;&lt;span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;script&lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;

&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;"&gt;
-------------------------------------------------------------------------------------------------------------------------&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;div class="MsoNormal"&gt;
4) Save your post and you done with Adsense emebed into your post.
    &lt;/div&gt;
&lt;div class="MsoNormal"&gt;
Above adsense javascript code will return some thing like below in your blog post
        :-&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-mkJ-mki-8bo/TnhUR9SQqeI/AAAAAAAAAdM/K5REV_KGMR4/s1600/Blog_Adsense_JavaScript_LeaderBoard.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="http://2.bp.blogspot.com/-mkJ-mki-8bo/TnhUR9SQqeI/AAAAAAAAAdM/K5REV_KGMR4/s640/Blog_Adsense_JavaScript_LeaderBoard.JPG" width="640" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="float: left; padding-right: 5px;"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "E8E7D0";
google_color_bg = "dcdcdc";
google_color_link = "B96F17";
google_color_url = "B96F17";
google_color_text = "000000";
//--&gt;
&lt;/script&gt;
&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;span &gt;
        How to change the Adsense Unit Size ?&lt;/span&gt;&lt;/h1&gt;
&lt;div class="MsoNormal"&gt;
&lt;span&gt;Next important point is to change the adsense layout using javascript.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span &gt;Follow below step to change the :-
    &lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span&gt;1) Go to the adsense javascript.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span &gt;2) Change the hieght and width field , get the value of hieght and width from the
        image shown below:-&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span &gt;&lt;img height="640" id="IMG1" onclick="return IMG1_onclick()" src="http://4.bp.blogspot.com/-sT1JfIzKFwk/TnhDnmDz6_I/AAAAAAAAAdE/QNsvBslBkbQ/s640/AdUnit_Size_type.JPG" width="512" /&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span &gt;3) After changing the hieght and width, change the "&lt;span class="MsoNormal"&gt;&lt;span style="color: #cc3300;"&gt;google_ad_format&lt;/span&gt;" value in "width_height_as" format,
            example :-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span &gt;&lt;span class="MsoNormal"&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;
            &amp;nbsp; &amp;nbsp;&amp;nbsp; google_ad_width = 336; &lt;/span&gt;&lt;span class="MsoNormal"&gt;&lt;/span&gt;
    &lt;/span&gt;&lt;br /&gt;
&lt;span &gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;google_ad_height = 280;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span &gt;&lt;span style="font-family: 'Courier New';"&gt;
            &lt;span style="font-size: 10pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;
                google_ad_format = &lt;span style="color: maroon;"&gt;"336x280_as"&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span &gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;span &gt;&lt;span class="MsoNormal"&gt;4) &amp;nbsp;Just save it after changing the value, and you are
            ready with new Adsense unit size. Choose unit size according to your website/blog.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;&lt;span class="MsoNormal"&gt;
        &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;span class="MsoNormal"&gt;
        &lt;br /&gt;

    &lt;/span&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-759231909138318942?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/IvkJNL9BxEw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/759231909138318942/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/how-to-add-adsense-to-blog-using.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/759231909138318942?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/759231909138318942?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/IvkJNL9BxEw/how-to-add-adsense-to-blog-using.html" title="How to add adsense to blog using javascript" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-mkJ-mki-8bo/TnhUR9SQqeI/AAAAAAAAAdM/K5REV_KGMR4/s72-c/Blog_Adsense_JavaScript_LeaderBoard.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/how-to-add-adsense-to-blog-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MNRnkyfSp7ImA9WhdVFU0.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-2441660671088331034</id><published>2011-09-18T10:37:00.000-07:00</published><updated>2011-09-19T23:51:37.795-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-19T23:51:37.795-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Blogger Blogging Blog" /><title>List of Blog Post Gadget for blogger using javascript</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gSwtbEzv4Oy4zobDeQGOtDFYjZM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gSwtbEzv4Oy4zobDeQGOtDFYjZM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gSwtbEzv4Oy4zobDeQGOtDFYjZM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gSwtbEzv4Oy4zobDeQGOtDFYjZM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;title&gt;Blogger Data API Sample&lt;/title&gt;

&lt;style type="text/css"&gt;
        .style1
        {
            font-family: Arial, Helvetica, sans-serif;
        }
        .style2
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: small;
        }
        .style3
        {
            font-size: small;
        }
        .style4
        {
            font-family: Modern;
            background-color: #FFFFFF;
        }
    &lt;/style&gt;

  
    

    &lt;p class="style2"&gt;
        Following post will help in retrieving the information related to &lt;b&gt;list of 
        post from&lt;/b&gt; a blog. One can use this to display the list of blogs by following 
        easy step mentioned below&lt;/p&gt;
    &lt;p class="style2"&gt;
&amp;nbsp;1) Add one html/javascript gadget to your blog.
    &lt;/p&gt;
    &lt;p class="style2"&gt;
        2) Copy paste below code to your gadget.
    &lt;/p&gt;
    &lt;p class="style2"&gt;
        3) Replace feeduri with your blog feed uri.
    &lt;/p&gt;
    &lt;p class="style1"&gt;
        &lt;span class="style3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
        var feedUri = &amp;#39;&lt;/span&gt;&lt;a 
            href="http://www.blogger.com/feeds/10861780/posts/default"&gt;&lt;span 
            class="style3"&gt;http://www.blogger.com/feeds/10861780/posts/default&lt;/span&gt;&lt;/a&gt;&lt;span 
            class="style3"&gt;&amp;#39;;&lt;/span&gt;&lt;/p&gt;
    &lt;p class="style2"&gt;
&amp;nbsp;4) just save the gadget and its ready to use. Here goes the code for list of post 
        for a blog :-
    &lt;/p&gt;
&lt;br /&gt;
&lt;div style="float:left; padding-right:5px;"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "E8E7D0";
google_color_bg = "dcdcdc";
google_color_link = "B96F17";
google_color_url = "B96F17";
google_color_text = "000000";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
    &lt;p&gt;
        -------------------------------------------------------------------------------------------&lt;/p&gt;
    &lt;p class="style4"&gt;
        &lt;span class="Apple-style-span" 
            style="color: rgb(102, 102, 102); font-family: monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: nowrap; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); "&gt;
        &lt;span class="js-comment" style="color: rgb(136, 0, 0); "&gt;/*&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-comment" style="color: rgb(136, 0, 0); "&gt;* Retrieve a list of 
        blog posts&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-comment" style="color: rgb(136, 0, 0); "&gt;*/&lt;/span&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;span class="js-comment" style="color: rgb(136, 0, 0); "&gt;// Obtain a reference 
        to the &amp;#39;content&amp;#39; div&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-keyword" style="color: rgb(0, 0, 136); "&gt;var&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-variable" 
            style="color: black; "&gt;content&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-variable" 
            style="color: black; "&gt;document&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span class="js-property" 
            style="color: black; "&gt;getElementById&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;(&lt;/span&gt;&lt;span class="js-string" 
            style="color: rgb(0, 136, 0); "&gt;&amp;#39;content&amp;#39;&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;);&lt;/span&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;span class="js-comment" style="color: rgb(136, 0, 0); "&gt;// Create the blogger 
        service object&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-keyword" style="color: rgb(0, 0, 136); "&gt;var&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-variable" 
            style="color: black; "&gt;bloggerService&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;=&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" 
            style="color: rgb(0, 0, 136); "&gt;new&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-variable" style="color: black; "&gt;google&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;gdata&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;blogger&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;BloggerService&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;(&lt;/span&gt;&lt;span 
            class="js-string" style="color: rgb(0, 136, 0); "&gt;&amp;#39;com.appspot.interactivesampler&amp;#39;&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;);&lt;/span&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;span class="js-comment" style="color: rgb(136, 0, 0); "&gt;// The feed for a 
        single blog. (In this case, the Official Google Blog.)&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-comment" style="color: rgb(136, 0, 0); "&gt;//&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-comment" style="color: rgb(136, 0, 0); "&gt;// The ID included in 
        this URI can be retrieved from the&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-comment" style="color: rgb(136, 0, 0); "&gt;// &amp;lt;link 
        rel=&amp;quot;service.post&amp;quot;&amp;gt; element in the Blog&amp;#39;s HTML source&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-keyword" style="color: rgb(0, 0, 136); "&gt;var&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-variable" 
            style="color: black; "&gt;feedUri&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-string" 
            style="color: rgb(0, 136, 0); "&gt;&amp;#39;http://www.blogger.com/feeds/10861780/posts/default&amp;#39;&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;;&lt;/span&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;span class="js-comment" style="color: rgb(136, 0, 0); "&gt;// A callback method 
        invoked getBlogPostFeed() returns data&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-keyword" style="color: rgb(0, 0, 136); "&gt;var&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-variable" 
            style="color: black; "&gt;handleBlogPostFeed&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;=&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-keyword" style="color: rgb(0, 0, 136); "&gt;function&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;(&lt;/span&gt;&lt;span 
            class="js-variabledef" style="color: black; "&gt;postsFeedRoot&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;)&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" 
            style="color: rgb(0, 0, 136); "&gt;var&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-variabledef" style="color: black; "&gt;posts&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;=&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-localvariable" style="color: black; "&gt;postsFeedRoot&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;feed&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;getEntries&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;();&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" 
            style="color: rgb(136, 0, 0); "&gt;// This variable will buffer HTML output 
        until function completes&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" 
            style="color: rgb(0, 0, 136); "&gt;var&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-variabledef" style="color: black; "&gt;html&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;=&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-string" style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" 
            style="color: rgb(136, 0, 0); "&gt;// Display blog&amp;#39;s title&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" 
            style="color: black; "&gt;html&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;+=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-string" 
            style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;lt;dl&amp;gt;&amp;#39;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-string" style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;lt;dt&amp;gt;&amp;lt;strong&amp;gt;Blog:&amp;lt;/strong&amp;gt; 
        &amp;#39;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-string" style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;lt;a href=&amp;quot;&amp;#39;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-localvariable" style="color: black; "&gt;postsFeedRoot&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;feed&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;getLink&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;(&lt;/span&gt;&lt;span 
            class="js-string" style="color: rgb(0, 136, 0); "&gt;&amp;#39;alternate&amp;#39;&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;).&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;getHref&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;()&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-string" style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;quot;&amp;gt;&amp;#39;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-localvariable" style="color: black; "&gt;postsFeedRoot&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;feed&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;getTitle&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;().&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;getText&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;()&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-string" style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;lt;/a&amp;gt;&amp;lt;/dt&amp;gt;&amp;#39;&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" 
            style="color: rgb(136, 0, 0); "&gt;// Display blog posts&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" 
            style="color: black; "&gt;html&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;+=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-string" 
            style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;lt;dd&amp;gt;&amp;lt;ul&amp;gt;&amp;#39;&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" 
            style="color: rgb(0, 0, 136); "&gt;for&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;(&lt;/span&gt;&lt;span 
            class="js-keyword" style="color: rgb(0, 0, 136); "&gt;var&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-variabledef" 
            style="color: black; "&gt;i&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-atom" 
            style="color: rgb(34, 136, 17); "&gt;0&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-variabledef" style="color: black; "&gt;post&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;;&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-localvariable" 
            style="color: black; "&gt;post&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-localvariable" 
            style="color: black; "&gt;posts&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;[&lt;/span&gt;&lt;span class="js-localvariable" 
            style="color: black; "&gt;i&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;];&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-localvariable" style="color: black; "&gt;i&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;++&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;)&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" 
            style="color: rgb(0, 0, 136); "&gt;var&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-variabledef" style="color: black; "&gt;postTitle&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;=&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-localvariable" style="color: black; "&gt;post&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;getTitle&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;().&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;getText&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;();&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" 
            style="color: rgb(0, 0, 136); "&gt;var&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-variabledef" style="color: black; "&gt;postURL&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;=&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-localvariable" style="color: black; "&gt;post&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;getHtmlLink&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;().&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;getHref&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;();&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" 
            style="color: black; "&gt;html&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;+=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-string" 
            style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;#39;&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-localvariable" style="color: black; "&gt;postURL&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-string" style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&amp;#39;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-localvariable" style="color: black; "&gt;postTitle&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" 
            style="color: rgb(102, 102, 102); "&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-string" style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&amp;#39;&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;}&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" 
            style="color: black; "&gt;html&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;+=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-string" 
            style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;lt;/ul&amp;gt;&amp;lt;/dd&amp;gt;&amp;#39;&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" 
            style="color: rgb(136, 0, 0); "&gt;// Write out buffered HTML, and clear the 
        &amp;quot;Loading...&amp;quot; message&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" 
            style="color: black; "&gt;content&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span class="js-property" 
            style="color: black; "&gt;innerHTML&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-localvariable" 
            style="color: black; "&gt;html&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;};&lt;/span&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;span class="js-keyword" style="color: rgb(0, 0, 136); "&gt;var&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-variable" 
            style="color: black; "&gt;handleError&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-keyword" 
            style="color: rgb(0, 0, 136); "&gt;function&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;(&lt;/span&gt;&lt;span class="js-variabledef" 
            style="color: black; "&gt;error&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;)&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
        &lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" 
            style="color: black; "&gt;content&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span class="js-property" 
            style="color: black; "&gt;innerHTML&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;=&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-string" 
            style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;lt;pre&amp;gt;&amp;#39;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;+&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-localvariable" 
            style="color: black; "&gt;error&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span 
            class="js-operator" style="color: rgb(102, 102, 102); "&gt;+&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-string" 
            style="color: rgb(0, 136, 0); "&gt;&amp;#39;&amp;lt;/pre&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;;&lt;/span&gt;&lt;br /&gt;
        &lt;span class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;};&lt;/span&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;span class="js-variable" style="color: black; "&gt;bloggerService&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;.&lt;/span&gt;&lt;span 
            class="js-property" style="color: black; "&gt;getBlogPostFeed&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;(&lt;/span&gt;&lt;span 
            class="js-variable" style="color: black; "&gt;feedUri&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;,&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-variable" 
            style="color: black; "&gt;handleBlogPostFeed&lt;/span&gt;&lt;span 
            class="js-punctuation" style="color: rgb(102, 102, 102); "&gt;,&lt;span 
            class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="js-variable" 
            style="color: black; "&gt;handleError&lt;/span&gt;&lt;span class="js-punctuation" 
            style="color: rgb(102, 102, 102); "&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
    &lt;p&gt;
        ------------------------------------------------------------------------------------------------------&lt;/p&gt;
    &lt;p&gt;
        &amp;nbsp;&lt;/p&gt;
  &lt;p class="style2"&gt;
      &lt;b&gt; Below is the demo of above code for my blog :- &lt;/b&gt;&lt;/p&gt;
  &lt;p&gt;
        &amp;nbsp;&lt;/p&gt;
    &lt;script src="http://www.google.com/jsapi" type="text/javascript"&gt;
&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
      google.load("gdata", "1.x", { packages : ["blogger"] });
    
&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
      function _run() {
        /* 
        * Retrieve a list of blog posts
        */
        
        // Obtain a reference to the 'content' div
        var content = document.getElementById('content');
        
        // Create the blogger service object
        var bloggerService =
            new google.gdata.blogger.BloggerService('com.appspot.interactivesampler');
        
        // The feed for a single blog. (In this case, the Official Google Blog.)
        //
        // The ID included in this URI can be retrieved from the
        // &lt;link rel="service.post"&gt; element in the Blog's HTML source
        var feedUri = 'http://tajendrasengar.blogspot.com/feeds/posts/default';
        
        // A callback method invoked getBlogPostFeed() returns data
        var handleBlogPostFeed = function(postsFeedRoot) {
          var posts = postsFeedRoot.feed.getEntries();
          
          // This variable will buffer HTML output until function completes
          var html = '';
          
          // Display blog's title
          html += '&lt;dl&gt;'
               + '&lt;dt&gt;&lt;strong&gt;Blog:&lt;/strong&gt; '
               + '&lt;a href="'
               + postsFeedRoot.feed.getLink('alternate').getHref()
               + '"&gt;'
               + postsFeedRoot.feed.getTitle().getText()
               + '&lt;/a&gt;&lt;/dt&gt;';
          
          // Display blog posts
          html += '&lt;dd&gt;&lt;ul&gt;';
          for (var i = 0, post; post = posts[i]; i++) {
            var postTitle = post.getTitle().getText();
            var postURL = post.getHtmlLink().getHref();
            html += '&lt;li&gt;&lt;a href="' + postURL + '" target="_blank"&gt;'
                      + postTitle
                      + '&lt;/a&gt;&lt;/li&gt;';
          }
          html += '&lt;/ul&gt;&lt;/dd&gt;';
          
          // Write out buffered HTML, and clear the "Loading..." message
          content.innerHTML = html;
        };
        
        var handleError = function(error) {
          content.innerHTML = '&lt;pre&gt;' + error + '&lt;/pre&gt;';
        };
        
        bloggerService.getBlogPostFeed(feedUri, handleBlogPostFeed, handleError);
        
      }
      google.setOnLoadCallback(_run);
    
&lt;/script&gt;
    &lt;br /&gt;
&lt;div id="content" style="width: 100%;"&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Loading...&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-2441660671088331034?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/u0ymQQXvL-Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/2441660671088331034/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/list-of-post-gadget-for-blogger-using.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/2441660671088331034?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/2441660671088331034?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/u0ymQQXvL-Y/list-of-post-gadget-for-blogger-using.html" title="List of Blog Post Gadget for blogger using javascript" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/list-of-post-gadget-for-blogger-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQARXg6cSp7ImA9WhdbFEQ.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-6170269671610852305</id><published>2011-09-15T10:50:00.000-07:00</published><updated>2011-10-13T00:52:24.619-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-13T00:52:24.619-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><title>Postfix to Infix Algorithm</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZxZhBQ7MVemaPg4aKTe2TLVOVEQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZxZhBQ7MVemaPg4aKTe2TLVOVEQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZxZhBQ7MVemaPg4aKTe2TLVOVEQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZxZhBQ7MVemaPg4aKTe2TLVOVEQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
&lt;div style="margin-bottom: .0001pt; margin: 0cm;"&gt;
&lt;span style="color: black; font-family: Arial, sans-serif;"&gt;I have come across one
very&amp;nbsp;interesting&amp;nbsp;query about&lt;span class="apple-converted-space"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;Postfix
to Infix&lt;span class="apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;conversion.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: .0001pt; margin: 0cm;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="margin-bottom: .0001pt; margin: 0cm;"&gt;
&lt;span style="color: black; font-family: Arial, sans-serif;"&gt;Let’s understand first the importance
of having Postfix notation:-&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="float: left; padding-right: 5px;"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "E8E7D0";
google_color_bg = "dcdcdc";
google_color_link = "B96F17";
google_color_url = "B96F17";
google_color_text = "000000";
//--&gt;
&lt;/script&gt;
&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style="margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; text-indent: -18.0pt;"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Arial, sans-serif;"&gt;To
reduce computer memory access.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;The automatic stack permits the automatic storage of intermediate results for use later: this key&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; feature is what permits RPN calculators to easily evaluate expressions of arbitrary complexity: they&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;do not have limits on the complexity of expression they can evaluate.

&lt;br /&gt;
&lt;div style="margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; text-indent: -18.0pt;"&gt;
&lt;span style="color: black; font-family: Symbol;"&gt;·&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Arial, sans-serif;"&gt;To
utilize the&amp;nbsp;stack to evaluate expressions.&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; text-indent: -18.0pt;"&gt;
&lt;span style="color: black; font-family: Symbol;"&gt;·&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Arial, sans-serif;"&gt;To reduce the complexity of expression while evaluation.&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; text-indent: -18.0pt;"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Arial, sans-serif;"&gt;Postfix notation is often used in&amp;nbsp;&lt;span style="text-decoration: none;"&gt;stack-based&lt;/span&gt;&amp;nbsp;and&amp;nbsp;concatenative programming&amp;nbsp;languages.&lt;span class="Apple-style-span" style="font-size: 9pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: white; border-collapse: collapse; border: none; margin-left: 36.0pt; mso-background-themecolor: background1; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;"&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 462.1pt;" valign="top" width="616"&gt;&lt;div style="border-bottom: solid #AAAAAA 1.0pt; border: none; mso-border-bottom-alt: solid #AAAAAA .75pt; mso-element: para-border-div; padding: 0cm 0cm 2.0pt 0cm;"&gt;
&lt;div class="MsoNormal" style="border: none; margin-bottom: 7.2pt; mso-border-bottom-alt: solid #AAAAAA .75pt; mso-line-height-alt: 12.9pt; mso-outline-level: 2; mso-padding-alt: 0cm 0cm 2.0pt 0cm; padding: 0cm;"&gt;
&lt;span style="color: black; font-family: Arial, sans-serif; font-size: 13pt;"&gt;Postfix to Infix Algorithm&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 13pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: 18.0pt; margin-bottom: 6.0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 4.8pt;"&gt;
&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;Let’s look out for
  the algorithm for converting postfix to infix expression:-&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 19.2pt; mso-list: l1 level1 lfo2; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;While
  there are input symbol left&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 38.4pt; mso-list: l1 level2 lfo2; mso-margin-top-alt: auto; tab-stops: list 72.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;Read
  the next symbol from input.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 38.4pt; mso-list: l1 level2 lfo2; mso-margin-top-alt: auto; tab-stops: list 72.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;If
  the symbol is an operand (i.e. value)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 57.6pt; mso-list: l1 level3 lfo2; mso-margin-top-alt: auto; tab-stops: list 108.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;Push
  it onto the stack.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 38.4pt; mso-list: l1 level2 lfo2; mso-margin-top-alt: auto; tab-stops: list 72.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;Otherwise,
  the symbol is an operator.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 57.6pt; mso-list: l1 level3 lfo2; mso-margin-top-alt: auto; tab-stops: list 108.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;If
  there are fewer than&lt;/span&gt;&lt;span style="color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;&amp;nbsp;&lt;b&gt;2&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;values on the stack&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 76.8pt; mso-list: l1 level4 lfo2; mso-margin-top-alt: auto; tab-stops: list 144.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #c00000; font-family: Arial, sans-serif; font-size: 9pt;"&gt;Error&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;)&lt;/span&gt;&lt;/b&gt;&lt;span style="color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;The user has not input sufficient values in the
  expression.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 57.6pt; mso-list: l1 level3 lfo2; mso-margin-top-alt: auto; tab-stops: list 108.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;Else,
  Pop the top&lt;/span&gt;&lt;span style="color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;&amp;nbsp;&lt;b&gt;2&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;values from the stack (operand1 &amp;amp; operand 2).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 57.6pt; mso-list: l1 level3 lfo2; mso-margin-top-alt: auto; tab-stops: list 108.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;Put
  the operator, with the values as arguments and form a string (like : operand1
  operator operand2).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 57.6pt; mso-list: l1 level3 lfo2; mso-margin-top-alt: auto; tab-stops: list 108.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;Encapsulate
  the resulted string with parenthesis. (like: (a+b)&amp;nbsp; if operand1 =’a’, operand2 =’b’, operator =
  ‘+’ )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 57.6pt; mso-list: l1 level3 lfo2; mso-margin-top-alt: auto; tab-stops: list 108.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;Push
  the resulted string back to stack.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 19.2pt; mso-list: l1 level1 lfo2; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;If
  there is only one value in the stack&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 38.4pt; mso-list: l1 level2 lfo2; mso-margin-top-alt: auto; tab-stops: list 72.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: #365f91; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #365f91; font-family: Arial, sans-serif; font-size: 9pt;"&gt;That value in the stack is the desired
  infix string.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 19.2pt; mso-list: l1 level1 lfo2; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;If
  there are more values in the stack&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 38.4pt; mso-list: l1 level2 lfo2; mso-margin-top-alt: auto; tab-stops: list 72.0pt; text-indent: -17.85pt;"&gt;
&lt;span style="color: black; font-family: Wingdings; font-size: 10pt;"&gt;§&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #c00000; font-family: Arial, sans-serif; font-size: 9pt;"&gt;Error&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;)&lt;/span&gt;&lt;/b&gt;&lt;span style="color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: Arial, sans-serif; font-size: 9pt;"&gt;The user input has too many values.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: .0001pt; margin: 0cm;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style="margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Postfix to infix will not give you exact expression in terms of parenthesis, though it will give you same result on evaluation.&lt;br /&gt;
&lt;br /&gt;
e.g. (a+b+c)*2&lt;br /&gt;
Postfix will be :- ab+c+2*&lt;br /&gt;
And postfix to infix will give :- (((a+b)+c)*2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-6170269671610852305?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/OTGyYNf4uhY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/6170269671610852305/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/postfix-to-infix-algorithm.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/6170269671610852305?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/6170269671610852305?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/OTGyYNf4uhY/postfix-to-infix-algorithm.html" title="Postfix to Infix Algorithm" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/postfix-to-infix-algorithm.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4FRX47fip7ImA9WhdVFU0.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-655647046592279928</id><published>2011-09-15T00:19:00.000-07:00</published><updated>2011-09-19T23:41:54.006-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-19T23:41:54.006-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Google MAP APIs" /><category scheme="http://www.blogger.com/atom/ns#" term="Widgets" /><title>Distance Google MAP API demo</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NPRSbxdihTwgrXyxQ_7Lyimy1gI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NPRSbxdihTwgrXyxQ_7Lyimy1gI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NPRSbxdihTwgrXyxQ_7Lyimy1gI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NPRSbxdihTwgrXyxQ_7Lyimy1gI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;title&gt;Google Maps API Sample&lt;/title&gt; &lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;sensor=false&amp;amp;
key=ABQIAAAAeUlgz5ZezwUbH47hW-nEohQCA9e3Snamcn8o65dAybaGLWFLfRR88VjEEw1CS7bsSs9P0Srig2eL-g" type="text/javascript"&gt;
&lt;/script&gt;      &lt;br /&gt;
&lt;style type="text/css"&gt;
    body {
      font-family: Verdana, Arial, sans serif;
      font-size: 11px;
      margin: 2px;
    }
    table.directions th {
      background-color:#EEEEEE;
    }

    img {
      color: #000000;
    }
    
&lt;/style&gt;   &lt;br /&gt;
&lt;script type="text/javascript"&gt;
    var map;
    var gdir;
    var geocoder = null;
    var addressMarker;
    var distance;
    
    function initialize() {
      if (GBrowserIsCompatible()) {      
        map = new GMap2(document.getElementById("map_canvas"));
        gdir = new GDirections(map, document.getElementById("directions"));
    
        GEvent.addListener(gdir, "load", onGDirectionsLoad);
        GEvent.addListener(gdir, "error", handleErrors);
    
        setDirections("San Francisco", "Mountain View", "en_US");
      }
    }
    
    function setDirections(fromAddress, toAddress, locale) {
      gdir.load("from: " + fromAddress + " to: " + toAddress,
                { "locale": locale });
    }
    
    function handleErrors(){
     if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
       alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
     else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
       alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
     
     else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
       alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);
    
    //   else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS)  &lt;--- Doc bug... this is either not defined, or Doc is wrong
    //     alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);
       
     else if (gdir.getStatus().code == G_GEO_BAD_KEY)
       alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);
    
     else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
       alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
      
     else alert("An unknown error occurred.");
    }
    
    function onGDirectionsLoad(){ 
        // Use this function to access information about the latest load()
        // results.
   
        // e.g.
      distance = gdir.getDistance().meters;
      
      //alert("Distance is : " + gdir.getDistance().meters + "  and Duration Is: " + gdir.getDuration().seconds/60);
      
      document.getElementById("DistanceMeter").value = gdir.getDistance().meters/1000;
            
      document.getElementById("DurationMin").value   = gdir.getDuration().seconds/60;
      
 }

    
&lt;/script&gt;
  
  
   
    &lt;br /&gt;
&lt;h1&gt;

&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;Google&lt;/span&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Maps &lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small; font-weight: normal;"&gt;API Directions Illustrated&lt;/span&gt;&lt;/h1&gt;
&lt;h1&gt;
&lt;span class="Apple-style-span" style="font-size: small; font-weight: normal;"&gt;Enter Location in format #place,#city &lt;/span&gt;&lt;/h1&gt;
&lt;h1&gt;

&lt;span class="Apple-style-span" style="font-size: small; font-weight: normal;"&gt;Experimenting with google maps api, i have developed this quick utility to show the  distance and duration between locations. TRY IT OUT&lt;/span&gt;&lt;/h1&gt;
&lt;form action="#" onsubmit="setDirections(this.from.value, this.to.value, this.locale.value); return false"&gt;
&lt;body onload="initialize()" onunload="GUnload()" style="font-family: Arial;border: 0 none;"&gt;
 
&lt;table&gt;
        &lt;tbody&gt;
&lt;tr&gt;
          &lt;th align="right"&gt;From:&amp;nbsp;&lt;/th&gt;
          &lt;td&gt;&lt;input id="fromAddress" name="from" size="25" type="text" value="San Francisco" /&gt;
          &lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;th align="right"&gt;&amp;nbsp;&amp;nbsp;To:&amp;nbsp;&lt;/th&gt;
            &lt;td align="right"&gt;&lt;input id="toAddress" name="to" size="25" type="text" value="Mountain View" /&gt;
          &lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
          &lt;th&gt;Language:&amp;nbsp;&lt;/th&gt;
          &lt;td colspan="3"&gt;&lt;select id="locale" name="locale"&gt;
              &lt;option selected="" value="en"&gt;English&lt;/option&gt;
              &lt;option value="fr"&gt;French&lt;/option&gt;
              &lt;option value="de"&gt;German&lt;/option&gt;
              &lt;option value="ja"&gt;Japanese&lt;/option&gt;
              &lt;option value="es"&gt;Spanish&lt;/option&gt;
            &lt;/select&gt;
            &lt;input name="submit" type="submit" value="Get Directions!" /&gt;
          &lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
                &lt;th align="right"&gt;Distance:&amp;nbsp;
                &lt;/th&gt;
                &lt;td align="right"&gt;&lt;input id="DistanceMeter" name="distMeter" size="22" type="text" value="0" /&gt;KMs
                &lt;/td&gt;
                &lt;td&gt;&lt;/td&gt;
            &lt;/tr&gt;
&lt;tr&gt;
                &lt;th align="right"&gt;Duration:&amp;nbsp;
                &lt;/th&gt;
                &lt;td align="right"&gt;&lt;input id="DurationMin" name="durationMin" size="20" type="text" value="0" /&gt;Minutes
                &lt;/td&gt;
                &lt;td&gt;&lt;/td&gt;
            &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/form&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="float:left; padding-right:5px;"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "E8E7D0";
google_color_bg = "FFFFFF";
google_color_link = "B96F17";
google_color_url = "B96F17";
google_color_text = "000000";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;table class="directions"&gt;
      &lt;tbody&gt;
&lt;tr&gt;
        &lt;th&gt;Formatted Directions&lt;/th&gt;&lt;th&gt;Map&lt;/th&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;td valign="top"&gt;&lt;div id="directions" style="width: 275px;"&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;div id="map_canvas" style="height: 600px; width: 510px;"&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/body&gt;
 
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-655647046592279928?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/zWzk0c2zJ_E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/655647046592279928/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/distance-google-map-api-demo.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/655647046592279928?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/655647046592279928?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/zWzk0c2zJ_E/distance-google-map-api-demo.html" title="Distance Google MAP API demo" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/distance-google-map-api-demo.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQDQnY_cSp7ImA9WhdVFEQ.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-2656696664788562691</id><published>2011-09-14T06:52:00.000-07:00</published><updated>2011-09-19T22:42:53.849-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-19T22:42:53.849-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Google MAP APIs" /><category scheme="http://www.blogger.com/atom/ns#" term="Widgets" /><title>Distance between two locations with Google Map API</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hyY_LSRFecLrIlw9r7js8UQ6DVY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hyY_LSRFecLrIlw9r7js8UQ6DVY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hyY_LSRFecLrIlw9r7js8UQ6DVY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hyY_LSRFecLrIlw9r7js8UQ6DVY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;One can easily calculate distance between two location with the help of Google Map APIs. Google Map APIs comes with a set of classes which helps in doing such tasks.&lt;br /&gt;class &lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;GDirection&lt;/span&gt;&lt;/b&gt;, helps in getting the travel distance between&amp;nbsp;the two different location.&lt;br /&gt;So example shown below targets following features :-&lt;/span&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;Getting distance between two location.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;Getting duration between two location.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="background-color: white; border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #880000;"&gt;Here goes the complete java script code for it&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-style: none; border-top-width: 0px; font-family: monospace; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: nowrap;"&gt;
&lt;span class="Apple-style-span" style="color: #880000;"&gt;-------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-style: none; border-top-width: 0px; font-family: monospace; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: nowrap;"&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="xml-punctuation" style="color: #666600;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="xml-tagname" style="color: #000088;"&gt;script&amp;nbsp;&lt;/span&gt;&lt;span class="xml-attname" style="color: #660066;"&gt;type&lt;/span&gt;&lt;span class="xml-punctuation" style="color: #666600;"&gt;=&lt;/span&gt;&lt;span class="xml-attribute" style="color: #008800;"&gt;"text/javascript"&lt;/span&gt;&lt;span class="xml-punctuation" style="color: #666600;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;map&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;geocoder&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;null&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;addressMarker&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;distance&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;initialize&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;if&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;GBrowserIsCompatible&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;map&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;GMap2&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;document&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getElementById&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"map_canvas"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-style: none; border-top-width: 0px; font-family: monospace; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: nowrap;"&gt;
&lt;span class="js-punctuation" style="color: #666666;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-style: none; border-top-width: 0px; font-family: monospace; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: nowrap;"&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;GDirections&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;map&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;document&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getElementById&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"directions"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;GEvent&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;addListener&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"load"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;onGDirectionsLoad&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;GEvent&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;addListener&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"error"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;handleErrors&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;setDirections&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"San Francisco"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"Mountain View"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"en_US"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;setDirections&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variabledef" style="color: black;"&gt;fromAddress&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: black;"&gt;toAddress&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: black;"&gt;locale&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;load&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"from: "&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: black;"&gt;fromAddress&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;" to: "&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: black;"&gt;toAddress&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"locale"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: black;"&gt;locale&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666;"&gt;&lt;/span&gt;&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;onGDirectionsLoad&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #880000;"&gt;// Use this function to access information about the latest load()&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #880000;"&gt;// results.&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #880000;"&gt;// e.g.&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;distance&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getDistance&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;meters&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;alert&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"Distance is : "&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getDistance&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;meters&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"and Duration Is: "&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-style: none; border-top-width: 0px; font-family: monospace; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: nowrap;"&gt;
&lt;span class="js-operator" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getDuration&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;seconds&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;/&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;60&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;document&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getElementById&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"fdistance"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;innerHTML&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getDistance&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;meters&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;document&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getElementById&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"fduration"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;innerHTML&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getDuration&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;seconds&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;/&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;60&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666;"&gt;&lt;/span&gt;&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="xml-punctuation" style="color: #666600;"&gt;&lt;span class="xml-tagname" style="color: #000088;"&gt;script&lt;/span&gt;&lt;span class="xml-punctuation" style="color: #666600;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp;-------------------------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="float:left; padding-right:5px;"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "E8E7D0";
google_color_bg = "dcdcdc";
google_color_link = "B96F17";
google_color_url = "B96F17";
google_color_text = "000000";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;b&gt;Can we call GDirection without creating GMap ?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; So the answer is yes, one can create GDirection without pasing GMap also.&lt;br /&gt;So the output will only contain text format.&lt;br /&gt;&lt;i&gt;sample code &lt;/i&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="background-color: white; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="whitespace" style="color: #666666;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;gdir&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #000088;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;GDirections&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;null&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;document&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getElementById&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #008800;"&gt;"directions"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;so instead of map object &lt;b&gt;&lt;i&gt;null &lt;/i&gt;&lt;/b&gt;is passed in above code line, it will &lt;br /&gt;display direction information in only text format.&lt;br /&gt;One can also use above logic to design their own Google Gadgets too.&lt;/span&gt;&lt;/div&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-2656696664788562691?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/4qgDAapdErY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/2656696664788562691/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/distance-between-two-locations-with.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/2656696664788562691?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/2656696664788562691?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/4qgDAapdErY/distance-between-two-locations-with.html" title="Distance between two locations with Google Map API" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/distance-between-two-locations-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIGQ3k6fCp7ImA9WhRQEk4.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-1638745980542603255</id><published>2011-09-11T23:33:00.000-07:00</published><updated>2011-12-06T21:42:02.714-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-06T21:42:02.714-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c/c++" /><title>new vs malloc ?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/K7ViYoUS0lG8ocl0uF82_Gh-Moc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K7ViYoUS0lG8ocl0uF82_Gh-Moc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/K7ViYoUS0lG8ocl0uF82_Gh-Moc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K7ViYoUS0lG8ocl0uF82_Gh-Moc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;C++ &lt;/b&gt;&lt;/span&gt;often confuses&amp;nbsp;beginners&amp;nbsp;with its multiple way to allocate and free memory. Most of them understand them that free must be used with malloc and delete with new. But still they are not clear with the&amp;nbsp;differences. This article will help in&amp;nbsp;understanding&amp;nbsp;the concept behind new and malloc.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Lets see the broader level&amp;nbsp;differences&amp;nbsp;first :-&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&amp;nbsp;'new' helps in constructing an object (calls constructor), malloc does not. One of the most important differences between them.&lt;/li&gt;
&lt;/ul&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.g. Consider a&lt;br /&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Class A {&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public : A() { cout &amp;lt;&amp;lt;"In constructor"; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A* pobjA = &amp;nbsp;new A(); //it will call constructor and displays "In constructor"&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A* pa &amp;nbsp; &amp;nbsp; &amp;nbsp; = (A*) malloc(sizeof(A)); &amp;nbsp;//it will &lt;b&gt;not &lt;/b&gt;call constructor&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;new requires type of object to be allocated, malloc requires you to specify the total number of bytes to allocate.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;operator new is an operator, malloc is a function.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;operator new throws an exception if there is not enough memory, malloc returns a NULL. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;As both function help allocating memory dynamically, there are chances for&amp;nbsp;run-time&amp;nbsp;failure due to non availability of memory. For such cases both shows&amp;nbsp;different&amp;nbsp;behavior and hence need to be handled accordingly.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="text-align: left;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; very important pint to be noticed over here is&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;blockquote class=""&gt;
When new is used to allocate memory for a C++ class object, the object's constructor is called after the memory is allocated.&lt;/blockquote&gt;
&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;operator new can be overloaded, malloc cannot be overloaded.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;operator new/new[] must be matched with operator delete/delete[] to deallocate memory, malloc() must be matched with free() to deallocate memory.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Another big question is&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;How to choose between malloc and new ?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
While &lt;b&gt;working with C++, its always recommended to use "new"&lt;/b&gt;, because it has additive advantage over malloc which are:-&lt;/div&gt;
&lt;div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Its type safe.&lt;/li&gt;
&lt;li&gt;It calls constructor and helps in&amp;nbsp;implementing very important Object Oriented feature Inheritence (constructor chaining).&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
One can though use malloc while working with buffer (non class and struct base) , which they want to resize with time with the help of realloc. But still it can be achieved with the combination new/delete too.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;How much one can allocate ?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
One more query one can have now is, "How much one can allocate"? The largest possible memory block malloc can allocate depends on the host system, particularly the size of physical memory and the operating system implementation. Theoretically, the largest number should be the maximum value that can be held in a size_t type, which is an implementation-dependent unsigned integer representing the size of an area of memory. The maximum value is 2power(CHAR_BIT*sizeof(size_t) − 1), or the constant SIZE_MAX in the C99 standard.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
More relevant article:-&lt;/div&gt;
&lt;div&gt;
Read more &lt;a href="http://tajendrasengar.blogspot.com/2010/02/how-to-allocate-memory-dynamically-on.html"&gt;about dynamically allocating memory on stack here&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-1638745980542603255?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/jbg_K1Nsb3M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/1638745980542603255/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/new-vs-malloc.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/1638745980542603255?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/1638745980542603255?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/jbg_K1Nsb3M/new-vs-malloc.html" title="new vs malloc ?" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/new-vs-malloc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMGQ3o_eCp7ImA9WhdVFEQ.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-669241431889476756</id><published>2011-09-10T21:43:00.000-07:00</published><updated>2011-09-19T22:43:42.440-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-19T22:43:42.440-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Query/Suggestion" /><title>Post a Suggestion/Query</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6V_t9uCo-dAtslLuvFLcZrZIBKg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6V_t9uCo-dAtslLuvFLcZrZIBKg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6V_t9uCo-dAtslLuvFLcZrZIBKg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6V_t9uCo-dAtslLuvFLcZrZIBKg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;Open post&lt;/b&gt; for adding suggestions/queries to be considered for next posting.&lt;br /&gt;
&lt;br /&gt;
&lt;table&gt;
        &lt;tbody&gt;
&lt;tr&gt;
            &lt;td style="height: 402px; width: 3810px;"&gt;&lt;a href="http://2.bp.blogspot.com/-1oz1a0FASrk/TeZi_tBo3uI/AAAAAAAAA7Q/VPuWStRw25s/s1600/question-mark.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-1oz1a0FASrk/TeZi_tBo3uI/AAAAAAAAA7Q/VPuWStRw25s/s320/question-mark.jpg" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;
            &lt;td style="height: 402px; width: 444px;"&gt;&lt;div id="test_canvas" style="height: 450px; width: 850px;"&gt;
&lt;br /&gt;
&lt;marquee direction="down" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 400; left: 318; position: absolute; top: 8; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="2" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 258; left: 71; position: absolute; top: 6; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="3" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 254; left: 48; position: absolute; top: 89; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="2" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 76; left: 279; position: absolute; top: 81; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="2" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 135; left: 65; position: absolute; top: 30; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="1" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 196; left: 173; position: absolute; top: 98; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="7" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 28; left: 112; position: absolute; top: 24; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="4" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 152; left: 232; position: absolute; top: 46; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="4" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 114; left: 196; position: absolute; top: 99; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="5" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 19; left: 66; position: absolute; top: 35; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="5" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 409; left: 307; position: absolute; top: 18; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="3" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 76; left: 172; position: absolute; top: 107; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 430; left: 10; position: absolute; top: 119; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="1" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 48; left: 309; position: absolute; top: 68; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="6" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 470; left: 175; position: absolute; top: 105; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="3" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 87; left: 122; position: absolute; top: 4; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="5" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 40; left: 182; position: absolute; top: 74; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="3" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 27; left: 226; position: absolute; top: 32; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="2" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 21; left: 289; position: absolute; top: 12; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="5" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 494; left: 145; position: absolute; top: 96; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;marquee direction="down" scrollamount="2" style="color: #ffcc00; font-family: Cursive; font-size: 14pt; height: 440; left: 0px; position: absolute; top: 0px; z-index: 2;"&gt;Queries and Suggestions&lt;/marquee&gt;&lt;span style="position: absolute; top: 400px;"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div style="float:left; padding-right:5px;"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "E8E7D0";
google_color_bg = "dcdcdc";
google_color_link = "B96F17";
google_color_url = "B96F17";
google_color_text = "000000";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-669241431889476756?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/Yny3rHSsjfw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/669241431889476756/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/post-suggestionquery.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/669241431889476756?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/669241431889476756?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/Yny3rHSsjfw/post-suggestionquery.html" title="Post a Suggestion/Query" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-1oz1a0FASrk/TeZi_tBo3uI/AAAAAAAAA7Q/VPuWStRw25s/s72-c/question-mark.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/post-suggestionquery.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIGQHYzfCp7ImA9WhdVEUw.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-2892816138683643626</id><published>2011-09-10T11:21:00.000-07:00</published><updated>2011-09-15T11:48:41.884-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-15T11:48:41.884-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><category scheme="http://www.blogger.com/atom/ns#" term="Hashing" /><title>What is Hashing , HashTable, Hash Function and its collision resolution strategies</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4lt7-aIYj7uLUIBAHVouqIhQjnU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4lt7-aIYj7uLUIBAHVouqIhQjnU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4lt7-aIYj7uLUIBAHVouqIhQjnU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4lt7-aIYj7uLUIBAHVouqIhQjnU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Hashing &lt;/span&gt;&lt;/b&gt;is the technique used for performing almost constant time search in case of insertion, deletion and find operation. Taking a very simple example of it, an array with its index as key is the example of hash table.&lt;br /&gt;
So each index (key) can be used for accessing the value in a constant search time. This mapping key must be simple to compute and must helping in&amp;nbsp;identifying&amp;nbsp;the associated value. Function which helps us in generating such kind of key-value mapping is known as &lt;b&gt;Hash Function.&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Hash Table a.k.a Hash Map &lt;/b&gt;is a data structure which uses hash function to generate key corresponding to the associated value.&lt;br /&gt;
&lt;br /&gt;
lets look at some sample hash function for strings&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Folding Method:-&lt;/b&gt;&lt;br /&gt;
int h(String x, int D)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;int i, sum;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;for (sum=0, i=0; i&amp;lt;x.length(); i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sum+= (int)x.charAt(i);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;return (sum%D);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Cyclic Shift :-&lt;/b&gt;&lt;br /&gt;
static long hashCode(String key, int D)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; int h=0;&lt;br /&gt;
&amp;nbsp; for (int i=0, i&amp;lt;key.length(); i++)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; h = (h &amp;lt;&amp;lt; 4) | ( h &amp;gt;&amp;gt; 27);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; h += (int) key.charAt(i);&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; return h%D;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
good link for hash function on string : &lt;a href="http://research.cs.vt.edu/AVresearch/hashing/strings.php"&gt;click here&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Coming to very important part of hashing , which is &lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;collision resolution&lt;/span&gt;&lt;/b&gt;. Since its always not possible to design perfect hash function with minimal overhead which would generate unique key. To address this problem following are the two main collision resolving techniques :-&lt;/div&gt;
&lt;div&gt;
1) Open Hashing also known as separate chaining&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
2) Closed Hashing also known as open addressing&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Lets understand the&amp;nbsp;difference between them&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;1) Open Hashing&lt;/b&gt; :- In this strategy collision is resolved by keeping the conflicting element in a list. That is to keep all element in a list which generate same hash.&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-tuiWS8ztcWw/TmufNxuQT4I/AAAAAAAAAdA/QRixOa4ALnU/s1600/Open+Hashing+.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="171" src="http://1.bp.blogspot.com/-tuiWS8ztcWw/TmufNxuQT4I/AAAAAAAAAdA/QRixOa4ALnU/s320/Open+Hashing+.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Open Hashing&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
From above figure its clear that how collision get resolved by keeping a linked list.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;2) Closed Hashing&lt;/b&gt; :- In this strategy collision is resolved by placing the conflicting element near to the slot generated by the hash function.&amp;nbsp;Associated with closed hashing is a rehash strategy:&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;“If we try to place x in bucket h(x) and find it occupied, find alternative location h1(x), h2(x), etc. Try each in order, if none empty table is full,”&lt;/div&gt;
&lt;div&gt;
Lets take an example to understand it&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
HASH_TABLE_SIZE = 8&lt;/div&gt;
&lt;div&gt;
Input data :- a,b,c,d &amp;nbsp; Hash for them H(a) = 0, H(b) = 3, H(c) = 7 and &amp;nbsp;H(d) = 3&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now as 'c' and 'd' has same hash, where to insert 'd' then ?&lt;/div&gt;
&lt;div&gt;
Finding position using linear hashing :&lt;/div&gt;
&lt;div&gt;
h1(d) = (h(d)+1)%8 = 4%8 = 4&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Adding 1 to hash function of h(d) we get new position 4, and slot 4 is currently non occupied. So entering d at position 4. In this way Closed hashing works.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Disadvantage &lt;/i&gt;of closed hashing is that it consumes more space as&amp;nbsp;compared&amp;nbsp;to open hashing&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
also it has less flexibility in&amp;nbsp;accommodating for duplicate hash element.&lt;/div&gt;
&lt;div&gt;
Major &lt;i&gt;advantage &lt;/i&gt;of closed hashing is that it reduces the overhead of introducing new data structure and reduces cost of new memory allocation per new element insertion.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-2892816138683643626?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/kwWn4XTnU64" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/2892816138683643626/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/understanding-hashing-and-brief.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/2892816138683643626?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/2892816138683643626?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/kwWn4XTnU64/understanding-hashing-and-brief.html" title="What is Hashing , HashTable, Hash Function and its collision resolution strategies" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-tuiWS8ztcWw/TmufNxuQT4I/AAAAAAAAAdA/QRixOa4ALnU/s72-c/Open+Hashing+.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/understanding-hashing-and-brief.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQMRX0-fip7ImA9WhdWFUg.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-3503961666652958399</id><published>2011-09-09T00:04:00.000-07:00</published><updated>2011-09-09T00:13:04.356-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-09T00:13:04.356-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c/c++" /><title>Iterator in C++</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XBB_B_cQc85GWkqJn_aPFQPa2s8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XBB_B_cQc85GWkqJn_aPFQPa2s8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XBB_B_cQc85GWkqJn_aPFQPa2s8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XBB_B_cQc85GWkqJn_aPFQPa2s8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Iterator &lt;/span&gt;&lt;/b&gt;an object which help in traversing a container. Its like a navigator.&lt;br /&gt;
For&amp;nbsp;beginners&amp;nbsp;its very difficult to digest/learn Iterator after Array. Since access to array is very easy just pass an index and get the value.&lt;br /&gt;
So this post will help beginners to build understanding about Iterator.&lt;br /&gt;
&lt;br /&gt;
To start with lets look out for simple array traversal.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt; const int nLength = 10;&lt;br /&gt;
int account[nLength] = {0};&lt;br /&gt;
//to traverse the array one can simply provide for loop upto length and access it by index&lt;br /&gt;
for(int i = 0;  i&amp;lt;  nLength; i++)&lt;br /&gt;
{&lt;br /&gt;
cout&amp;lt;&amp;lt;account[i];&lt;br /&gt;
}&lt;/span&gt;&lt;div&gt;&lt;br /&gt;
Now lets solve the above problem if its a list container.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;   std::list lstAccount; //list container for account&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;    stAccount.push_back(1);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;    lstAccount.push_back(2);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;    lstAccount.push_back(3);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;    lstAccount.push_back(4);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;  std::list::iterator lstAccountIterator;//iterator for traversing list&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;   for(lstAccountIterator = lstAccount.begin(); //initialize iterator with begining&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;  lstAccountIterator != lstAccount.end(); // traverse until iterator rach end&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;  lstAccountIterator++) //move itertor to next element.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt;     {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #eeeeee;"&gt; cout&amp;lt;&amp;lt;*lstAccountIterator; //print value at itertor&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
So above code will help in traversing a list container.&lt;br /&gt;
Some good article on Iterator can be found at following links&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href="http://www.cplusplus.com/reference/std/iterator/"&gt;http://www.cplusplus.com/reference/std/iterator/&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href="http://www.cprogramming.com/tutorial/stl/iterators.html"&gt;http://www.cprogramming.com/tutorial/stl/iterators.html&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Iterator"&gt;http://en.wikipedia.org/wiki/Iterator&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now moving to next level, lets understand the &lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;iterator design pattern&lt;/span&gt;&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Purpose:&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;To provide a way for accessing and traversing the collection of elements, without actually exposing the internal structure/representation of the collection organisation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Benefits:&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;An abstraction which helps in simplifying the traversal mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Design Layout:&lt;/b&gt;&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-sa7NalKaLS0/Tmm4rHPi8nI/AAAAAAAAAc8/BmEz5o02tyo/s1600/iterator_Pattern.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="196" src="http://3.bp.blogspot.com/-sa7NalKaLS0/Tmm4rHPi8nI/AAAAAAAAAc8/BmEz5o02tyo/s400/iterator_Pattern.gif" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Fig. Iterator Design Pattern&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-3503961666652958399?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/qbzQYO5CLfU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/3503961666652958399/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/iterator-in-c.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/3503961666652958399?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/3503961666652958399?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/qbzQYO5CLfU/iterator-in-c.html" title="Iterator in C++" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-sa7NalKaLS0/Tmm4rHPi8nI/AAAAAAAAAc8/BmEz5o02tyo/s72-c/iterator_Pattern.gif" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/iterator-in-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cERnY6cCp7ImA9WhdWE0w.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-5300412242511323201</id><published>2011-09-06T06:06:00.000-07:00</published><updated>2011-09-06T06:16:47.818-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-06T06:16:47.818-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SEO" /><category scheme="http://www.blogger.com/atom/ns#" term="Blogger Blogging Blog" /><title>Some good SEO resources , links</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/kokOwOzni14E11FAPVJNLe9IRME/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kokOwOzni14E11FAPVJNLe9IRME/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/kokOwOzni14E11FAPVJNLe9IRME/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kokOwOzni14E11FAPVJNLe9IRME/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Here are list of some good &lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;SEO &lt;/span&gt;&lt;/b&gt;resources :-&lt;br /&gt;
&lt;br /&gt;
One of the best &amp;nbsp;description&amp;nbsp;about SEO :-&lt;br /&gt;
&lt;a href="http://searchengineland.com/guide/what-is-seo"&gt;http://searchengineland.com/guide/what-is-seo&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This page contain many relevant pointers -&lt;br /&gt;
&lt;a href="http://www.pronetadvertising.com/articles/top-50-seo-resources.html"&gt;http://www.pronetadvertising.com/articles/top-50-seo-resources.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Good resource :-&lt;br /&gt;
&lt;a href="http://www.seoconsultants.com/seo-resources/"&gt;http://www.seoconsultants.com/seo-resources/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It takes time to be consumed by crawlers, if we talk about google search engine. And it depends on many factors but&amp;nbsp;focusing&amp;nbsp;on the below key points are good enough for a new blogger.&lt;br /&gt;
Some key facts about SEO:-&lt;br /&gt;
1) Choose keywords (label) very effectively.&lt;br /&gt;
2) Do not create complex titles.&lt;br /&gt;
3) Leave&amp;nbsp;back-links&amp;nbsp;with relevant context.&lt;br /&gt;
4) Be consistent with post, it will help in keeping readers&amp;nbsp;interested&amp;nbsp;in the blog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Keep Blogging&lt;br /&gt;
-Tajendra&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-5300412242511323201?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/URqoQGqTbEs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/5300412242511323201/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/some-good-seo-resource.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/5300412242511323201?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/5300412242511323201?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/URqoQGqTbEs/some-good-seo-resource.html" title="Some good SEO resources , links" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/some-good-seo-resource.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cFQ345fCp7ImA9WhdWE0w.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-5454584902641801928</id><published>2011-09-06T04:35:00.000-07:00</published><updated>2011-09-06T05:10:12.024-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-06T05:10:12.024-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sizeof" /><title>sizeof operator , learning with experiments</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/u52ZYUaC3jVV_jnCpHHWqyV3LVs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/u52ZYUaC3jVV_jnCpHHWqyV3LVs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/u52ZYUaC3jVV_jnCpHHWqyV3LVs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/u52ZYUaC3jVV_jnCpHHWqyV3LVs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #351c75; font-size: large;"&gt;sizeof&lt;/span&gt; &lt;/b&gt;a very interesting operator, lets do some experiments with it to gain more understanding about it.&lt;br /&gt;
&lt;br /&gt;
Lets look at the msdn definition of it first  :-&lt;br /&gt;
&lt;blockquote&gt;Yields the size of its operand with respect to the size of type char [definition from msdn].&lt;/blockquote&gt;&lt;br /&gt;
&lt;u&gt;&lt;i&gt;Now lets start experimenting with it :-&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
what will following statement yields &lt;br /&gt;
&lt;br /&gt;
a) sizeof function ?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sizeof(&amp;amp;main);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sizeof(&amp;amp;printf);&lt;br /&gt;
&lt;br /&gt;
b) sizeof an empty class ? &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; class A {};&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sizeof(A)&lt;br /&gt;
&lt;br /&gt;
c) Can sizeof return 0 ?&lt;br /&gt;
&lt;br /&gt;
d) What will be the output of following program ?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int i  = 1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sizeof(i++);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cout&amp;lt;&amp;lt;"i="&amp;lt;&amp;lt;i;&lt;br /&gt;
&lt;br /&gt;
e) sizeof following  class ? &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;class A { char c; int i; };&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sizeof(A)&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;i&gt;Now lets look at them one by one &lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
a) sizeof function ?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sizeof(&amp;amp;main);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sizeof(&amp;amp;printf);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Answer &lt;/b&gt;: sizeof(&amp;amp;main) will return 4 on 32 bit OS.&lt;br /&gt;
same hold true for sizeof(&amp;amp;printf). And the reason is very straight forward. As its returning size of function pointer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
b) sizeof an empty class ? &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; class A {};&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sizeof(A);&lt;br /&gt;
&lt;b&gt;Answer &lt;/b&gt;: Its a very interesting question which have very straight forward answer. It directly depends on sizeof operator implementation, if one looks at msdn documentation it says sizeof operator never returns zero. Considering this fact it returns 1. &lt;br /&gt;
For more details one can go through link (stroustrup's FAQs):-&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href="http://www2.research.att.com/~bs/bs_faq2.html#sizeof-empty"&gt;http://www2.research.att.com/~bs/bs_faq2.html#sizeof-empty&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
c) Can sizeof return 0 ?&lt;br /&gt;
&lt;b&gt;Answer &lt;/b&gt;: NO, sizeof operator never returns 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
d) What will be the output of following program ?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int i  = 1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sizeof(i++);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cout&amp;lt;&amp;lt;"i="&amp;lt;&amp;lt;i;&lt;br /&gt;
&lt;b&gt;Answer &lt;/b&gt;: output would be 1, sizeof operator gets resolved at compile time only, no run-time execution will be entertained for sizeof operator. So the output would be 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
e) sizeof following  class ? &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; class A { char c; int i; };&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sizeof(A);&lt;br /&gt;
&lt;b&gt;Answer &lt;/b&gt;: Don't hurry up to reply with 5 byte, because it depends on the byte alignment of class.&lt;br /&gt;
If it is 1 byte aligned, output would be 5;&lt;br /&gt;
And for 4 byte aligned, output would be 8;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-5454584902641801928?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/T_S6Jucrs8A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/5454584902641801928/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/sizeof-operator-learning-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/5454584902641801928?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/5454584902641801928?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/T_S6Jucrs8A/sizeof-operator-learning-with.html" title="sizeof operator , learning with experiments" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/sizeof-operator-learning-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MDQH89fCp7ImA9WhdbFUw.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-8942060247375501915</id><published>2011-09-01T07:14:00.000-07:00</published><updated>2011-10-13T07:17:51.164-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-13T07:17:51.164-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Technical" /><category scheme="http://www.blogger.com/atom/ns#" term="Misc" /><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><title>Online Regular Expression / Regex Tools and Editor</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CfOxFiNLzBX3QnuXnsXwhH0oYEs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CfOxFiNLzBX3QnuXnsXwhH0oYEs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CfOxFiNLzBX3QnuXnsXwhH0oYEs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CfOxFiNLzBX3QnuXnsXwhH0oYEs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Some useful compiled link about online regex tester :-&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Regex tester from Regular Expression Info.com&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href="http://www.regular-expressions.info/javascriptexample.html"&gt;http://www.regular-expressions.info/javascriptexample.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table class="topad" style="background-color: #fff4e8; border-bottom-color: rgb(128, 51, 0); border-bottom-style: solid; border-bottom-width: 2px; border-left-color: rgb(128, 51, 0); border-left-style: solid; border-left-width: 2px; border-right-color: rgb(128, 51, 0); border-right-style: solid; border-right-width: 2px; border-top-color: rgb(128, 51, 0); border-top-style: solid; border-top-width: 2px; margin-bottom: 20px; margin-left: 10px; margin-right: 10px; margin-top: 20px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="font-family: Arial, helvetica, sans-serif; font-size: 14px; line-height: 20px;" valign="top"&gt;&lt;a href="http://www.regexbuddy.com/test.html" style="background-color: white; text-decoration: underline;" target="_top"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;img alt="RegexBuddy" border="0" height="145" src="http://www.regular-expressions.info/img/regexbuddyad.png" width="203" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;td class="topad" style="font-family: Arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; padding-left: 10px; padding-right: 10px; text-align: justify;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;b&gt;&lt;a href="http://www.regexbuddy.com/test.html" style="text-decoration: underline;" target="_top"&gt;Interactively create and test regular expressions with RegexBuddy&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Create&lt;/b&gt;&amp;nbsp;and analyze regex patterns with RegexBuddy's intuitive regex building blocks. Quickly&amp;nbsp;&lt;b&gt;test&lt;/b&gt;&amp;nbsp;regular expressions on sample data and files in a safe sandbox.&amp;nbsp;&lt;b&gt;Debug&lt;/b&gt;&amp;nbsp;regexes easily with real-time highlighting and informative regex match details.&amp;nbsp;&lt;a href="http://www.regexbuddy.com/" style="text-decoration: underline;"&gt;Get your own copy of RegexBuddy now&lt;/a&gt;.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="float: left; padding-right: 5px;"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_text = "000000";
google_color_link = "B96F17"; 
google_color_url = "B96F17"; 
//--&gt;
&lt;/script&gt;
&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Online regular Expression tester from PageColumn.&lt;/li&gt;
&lt;/ul&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href="http://www.pagecolumn.com/tool/regtest.htm"&gt;http://www.pagecolumn.com/tool/regtest.htm&lt;/a&gt;&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A very fast and effective regex tester.&lt;br /&gt;&lt;ul style="text-align: left;"&gt;
&lt;li&gt;FileFormat.Info&lt;/li&gt;
&lt;/ul&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href="http://www.fileformat.info/tool/regex.htm"&gt;http://www.fileformat.info/tool/regex.htm&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href="http://www.fileformat.info/tool/regex.htm"&gt;&lt;br /&gt;&lt;/a&gt;&lt;b&gt;Table For regular expression syntax:-&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #3f529c; font-family: 'Segoe UI', Verdana, Arial; font-weight: bold;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Regular Expression Syntax :-&amp;nbsp;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/1400241x(v=vs.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/1400241x(v=vs.85).aspx&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-8942060247375501915?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/Puod-tQaNKY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/8942060247375501915/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/09/online-regular-expression-regex-tools.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/8942060247375501915?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/8942060247375501915?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/Puod-tQaNKY/online-regular-expression-regex-tools.html" title="Online Regular Expression / Regex Tools and Editor" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/09/online-regular-expression-regex-tools.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYDSX05cSp7ImA9WhdSGU8.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-3465835949706281429</id><published>2011-07-29T00:56:00.000-07:00</published><updated>2011-07-29T00:56:18.329-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-29T00:56:18.329-07:00</app:edited><title>CPU spike problem, here is the library</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MfJ3UyU9zxruo5QdPWWrCg3j9vs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MfJ3UyU9zxruo5QdPWWrCg3j9vs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MfJ3UyU9zxruo5QdPWWrCg3j9vs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MfJ3UyU9zxruo5QdPWWrCg3j9vs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;If facing problem of improper CPU&amp;nbsp;utilization&amp;nbsp;while working with multiple core, then here is one good reference:-&lt;br /&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/gg675934.aspx"&gt;http://msdn.microsoft.com/en-us/library/gg675934.aspx&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-3465835949706281429?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/ktqj7ubgVN8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/3465835949706281429/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2011/07/cpu-spike-problem-here-is-library.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/3465835949706281429?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/3465835949706281429?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/ktqj7ubgVN8/cpu-spike-problem-here-is-library.html" title="CPU spike problem, here is the library" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2011/07/cpu-spike-problem-here-is-library.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQHRXcyeSp7ImA9WhdVFkQ.&quot;"><id>tag:blogger.com,1999:blog-6005247006949384691.post-7943408717017973895</id><published>2010-03-18T11:20:00.000-07:00</published><updated>2011-09-22T04:52:14.991-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-22T04:52:14.991-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Creative Thinking" /><title>Perception a boon or a killer ?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RAYthRasG0YGE4Nsm6gF15fZpJw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RAYthRasG0YGE4Nsm6gF15fZpJw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RAYthRasG0YGE4Nsm6gF15fZpJw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RAYthRasG0YGE4Nsm6gF15fZpJw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Perception is considered to be starting point of thinking. In most of the cases perception starts with our experiences we have from life. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;If we look thinking steps it would be:-&lt;/b&gt;&lt;br /&gt;
a) We see, observe or feel.&lt;br /&gt;
b) We percepts i.e. start thinking and analyzing.&lt;br /&gt;
c) We conclude and take actions.&lt;br /&gt;
&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=i0438-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B002WIDRM6&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&amp;amp;lt;p&amp;amp;gt;&amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;amp;gt; &amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;gt;&amp;amp;lt;/p&amp;amp;gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
Most of us just ignore the step (b), which i want to highlight with examples and will see some steps to improve this.&lt;br /&gt;
&lt;br /&gt;
Lets take an example of one short story showing perception role in real life:-&lt;br /&gt;
In Australia, the one dollar coin is much bigger than two dollar coin. One day, one big guy and his friend offered five-year old Johnny a choice between two coins: a one dollar coin and the small two dollar coin. He could take and keep whichever one he wanted.He picked the bigger, one dollar coin.His friends laughed and giggled.Whenever they wanted to tease Johnny they offered him again this choice of coins.He always took the bigger one.He never seemed to learn.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; One day an adult saw this and called Johnny over.He told Johnny that although the smaller coin was smaller it was actually worth more."I know that", said Johnny. The adult man just got stunned from his answer. Johnny added "If i had taken smaller one first time, then how often they will offer me again".&lt;br /&gt;
&lt;br /&gt;
With the above example it's very clear that perception made by big guys for that small kid was absolutely wrong. And utilizing same perception kid actually got the benefit.This example reveals us that don't precept that you are the most intelligent and the &lt;b&gt;"only one"&lt;/b&gt;.Always keep in mind that &lt;b&gt;you cant fool people all the time&lt;/b&gt;. So be very cautious in case you start perceiving things.&lt;br /&gt;
&lt;br /&gt;
Lets take one more practical example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="float:left; padding-right:5px;"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "ca-pub-9274462217825187";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "E8E7D0";
google_color_bg = "dcdcdc";
google_color_link = "B96F17";
google_color_url = "B96F17";
google_color_text = "000000";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
This is a small story indicating how perception can change with time and circumstances.&lt;br /&gt;
&lt;br /&gt;
Rishita joined college after stepping out of school world. She made few friends and Pinky was one of them. They soon became good friends and shared a small world together of friendship and trust with lots of fun and enjoyment. One day Rishita was not feeling well so she asked Pinky to submit her assignment on her behalf, as the assignment marks were to be added to final score.&lt;br /&gt;
&lt;br /&gt;
She was relieved that her assignment will be submitted on time. But next day she came to know that her assignment was not submitted and even Pinky was absent.&lt;br /&gt;
Rishita felt cheated and was very annoyed over Pinky. More important was that Pinky didn't even contact her once. One week passed by and Pinky joined back but Rishita decided not to talk to her. She created a perception for her and acted accordingly. Pinky tried to contact her many times but all in vein.&lt;br /&gt;
&lt;br /&gt;
Few months passed by. Rishita was talking to one of her classmate and when Pinky was mentioned, she suddenly came up with an abrupt remark on Pinky's credibility. Then her classmate asked the reason for such comment and Rishita told her everything. Then her classmate broke her perception by telling truth about Pinky's unavailability.The second side of story gave Rishita shock of her life.&lt;br /&gt;
&lt;br /&gt;
The day Pinky was going to submit Rishika's submission, her younger brother had a bad road accident and she was occupied for nearly 2 weeks with her brother's recovery. This was the reason she couldn't even inform Rishita. when she joined back she tried to contact Rishita, but Rishita's perception deprived her of the best friend she had.&lt;br /&gt;
&lt;br /&gt;
At this time she realized that her wrong perception due to a single incident and incomplete information cost her best friend she had.&lt;br /&gt;
&lt;br /&gt;
This example reveals that perception if made wrong can be a killer.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=i0438-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B0000U1OCI&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&amp;nbsp;A perception taken at a time plays very important role in real life situation.&lt;br /&gt;
As we saw perception taken by big guys was totally different from kids perception.&lt;br /&gt;
To kid perception made by big guys was a boon to him. We also seen &lt;br /&gt;
perception can make or break friendship.&lt;br /&gt;
&lt;br /&gt;
Lets take one more example to understand that perception is a boon or a killer?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An old man of ninety goes down to Hell. As he wonders around he sees a friend of his, about the same age, with the most beautiful young woman on his knee.&lt;br /&gt;
He ask, "Is this hell? You seem to be having a good time."&lt;br /&gt;
The friend replies, "it is indeed hell, i am the punishment for the young lady."&lt;br /&gt;
&lt;br /&gt;
This humorous example shows that perception can vary from people to people and its very difficult to get the right one. If you apply logic then also its difficult to create right perception. Perception as we seen can be a boon or it can be killer at times. &lt;i&gt;So, just be careful whenever you precept things, try to add more and more dimensions to your thinking process before taking an action.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Hope you enjoyed reading the post.&lt;br /&gt;
&lt;br /&gt;
Keep Rocking,&lt;br /&gt;
-Tajendra&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6005247006949384691-7943408717017973895?l=tajendrasengar.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/twVUS/~4/9tHl_YVc8gQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://tajendrasengar.blogspot.com/feeds/7943408717017973895/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://tajendrasengar.blogspot.com/2010/03/perception-boon-or-killer.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/7943408717017973895?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6005247006949384691/posts/default/7943408717017973895?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/twVUS/~3/9tHl_YVc8gQ/perception-boon-or-killer.html" title="Perception a boon or a killer ?" /><author><name>TS</name><uri>http://www.blogger.com/profile/02381204600694943595</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://tajendrasengar.blogspot.com/2010/03/perception-boon-or-killer.html</feedburner:origLink></entry></feed>

