<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1720439187228738899</id><updated>2012-02-16T06:14:00.486-08:00</updated><category term='Art of computer programming'/><category term='C Teasers'/><category term='Firefox'/><category term='Datastructure puzzles'/><category term='SEO'/><category term='General programming'/><category term='Google Go'/><category term='Linux/Unix'/><category term='perl'/><category term='Image Processing'/><category term='Project Ideas'/><category term='Java'/><category term='C/CPP'/><title type='text'>Laymans Views</title><subtitle type='html'>With this blog I intend to give you my perspective about various technology related stuff. I've remained a layman for a long time, so I hereby give you a very simple view of how things look to me and how to implement new ideas in a simple manner</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-6302695956041876493</id><published>2010-04-21T23:41:00.001-07:00</published><updated>2010-04-21T23:41:27.621-07:00</updated><title type='text'>Flickr</title><content type='html'>This is a test post from &lt;a href="http://www.flickr.com/r/testpost"&gt;&lt;img alt="flickr" src="http://www.flickr.com/images/flickr_logo_blog.gif" width="41" height="18" border="0" align="absmiddle" /&gt;&lt;/a&gt;, a fancy photo sharing thing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-6302695956041876493?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/6302695956041876493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2010/04/flickr.html#comment-form' title='32 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/6302695956041876493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/6302695956041876493'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2010/04/flickr.html' title='Flickr'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>32</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-7440108406917186996</id><published>2010-03-01T03:51:00.000-08:00</published><updated>2010-03-01T04:05:52.020-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Art of computer programming'/><title type='text'>Art of computer programming -Sorting #5</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Improvements that can be made on bubble sort&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are basically 2 improvements that you can make on bubble sort.&lt;br /&gt;&lt;br /&gt;One, you can eliminate certain comparisons. For example if 2 elements i and j in an array don't change their respective positions in 2 simultaneous passes during a bubble sort. Then it means that the values are in their final positions. Such elements can be left alone when comparing. &lt;br /&gt;&lt;br /&gt;Another distant possibility is that we can shift the base of the array left or right when we want to shift a position to left or right. This will help us in doing lesser number of comparisons. But whatever we do, it does not make the bubble sort any better than a selection sort or an insertion sort. &lt;br /&gt;&lt;br /&gt;So layman tells you to quit using the bubble sort for practical purposes.&lt;br /&gt;&lt;br /&gt;Thanking you,&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-7440108406917186996?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/7440108406917186996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2010/03/art-of-computer-programming-sorting-5.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/7440108406917186996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/7440108406917186996'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2010/03/art-of-computer-programming-sorting-5.html' title='Art of computer programming -Sorting #5'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-2649321093059133514</id><published>2009-12-14T07:19:00.001-08:00</published><updated>2009-12-14T07:30:58.837-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Read firefox bookmarks using Java</title><content type='html'>I've often seen people asking in various forums "how do we read firefox bookmarks from Java/C# ? ". It seemed like an interesting question and I ended up solving the question in around 2 hrs. A little bit of reading about the firefox database will be necessary. You can get that &lt;a href="http://kb.mozillazine.org/Places.sqlite"&gt;here&lt;/a&gt;. Now for the implementation you will need to add the jar file. You can get it &lt;a href="http://files.zentus.com/sqlitejdbc/sqlitejdbc-v056.jar"&gt;here&lt;/a&gt;. You can add the external jar to your project and then compile the following code. The implementation only reads and lists out some fields in places.sqlite. You can modify the query and do various other things.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;import java.sql.*;&lt;br /&gt;&lt;br /&gt;public class firefoxBookmarksReader {&lt;br /&gt;  public static void main(String[] args) throws Exception {&lt;br /&gt;      Class.forName("org.sqlite.JDBC");&lt;br /&gt;      Connection conn = DriverManager.getConnection("jdbc:sqlite:/home/deepak/.mozilla/firefox/yvf7p20d.default/places.sqlite//"); // replace the path appropriately depending on the location of places.sqlite&lt;br /&gt;  if(conn==null)&lt;br /&gt;  {&lt;br /&gt;   System.out.println("ERROR");&lt;br /&gt;  }&lt;br /&gt;  System.out.println(conn.toString());&lt;br /&gt;&lt;br /&gt;  Statement stat = conn.createStatement();&lt;br /&gt;&lt;br /&gt;  ResultSet rs = stat.executeQuery("select * from moz_bookmarks;");&lt;br /&gt;  while (rs.next()) {&lt;br /&gt;      System.out.println("id = " + rs.getString("id"));&lt;br /&gt;      System.out.println("keyword = " + rs.getString("keyword_id"));&lt;br /&gt;      System.out.println("title = " + rs.getString("title"));&lt;br /&gt;  }&lt;br /&gt;  rs.close();&lt;br /&gt;  conn.close();&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-2649321093059133514?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/2649321093059133514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/12/read-firefox-bookmarks-using-java.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/2649321093059133514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/2649321093059133514'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/12/read-firefox-bookmarks-using-java.html' title='Read firefox bookmarks using Java'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-8799421034913663011</id><published>2009-12-08T23:00:00.000-08:00</published><updated>2009-12-08T23:11:45.943-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google Go'/><title type='text'>Go on cygwin</title><content type='html'>I have a crap windows machine at my workplace and I wanted to do some work on Go during my free time. I had cygwin running and I could successfully install Google go on cygwin. So I thought I'll put this as a post.&lt;br /&gt;&lt;br /&gt;You have to get the repository. But you wont have hg command installed(in most cases)&lt;br /&gt;If you have already installed hg command for cygwin skip to step 2&lt;br /&gt;&lt;br /&gt;1. Do the folowing commands &lt;br /&gt;   $ wget http://peak.telecommunity.com/dist/ez_setup.py&lt;br /&gt;   $ python ez_setup.py&lt;br /&gt;   $ easy_install -U mercurial&lt;br /&gt;   $ chmod +x /usr/lib/python2.5/site-packages/mercurial-1.0-py2.5-cygwin-1.5.25-i686.egg/mercurial/*.dll&lt;br /&gt;&lt;br /&gt;2. Now that you have hg command on your machine. Do the following command.&lt;br /&gt;  $ hg clone https://golang-on-cygwin.googlecode.com/hg/ golang-on-cygwin &lt;br /&gt;&lt;br /&gt;3. Now you have to setup certain environment variables.&lt;br /&gt;  export GOROOT=/path/to/golang-on-cygwin&lt;br /&gt;  export GOARCH=386&lt;br /&gt;  export GOOS=linux&lt;br /&gt;  export GOBIN=/path/to/your/local/bin&lt;br /&gt;  export PATH=$PATH:$GOBIN&lt;br /&gt;&lt;br /&gt;4. Change to the source directory and run the all.bash script&lt;br /&gt;  cd $GOROOT/src&lt;br /&gt;  ./all.bash&lt;br /&gt;&lt;br /&gt;Installation will succeed and you can start with Google go&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Thanks,&lt;br /&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-8799421034913663011?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/8799421034913663011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/12/go-on-cygwin.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/8799421034913663011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/8799421034913663011'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/12/go-on-cygwin.html' title='Go on cygwin'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-5575389056476256651</id><published>2009-12-03T20:29:00.000-08:00</published><updated>2009-12-08T04:21:37.734-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C/CPP'/><category scheme='http://www.blogger.com/atom/ns#' term='C Teasers'/><title type='text'>Thread, semaphore, signals example in C</title><content type='html'>I got this question by chance. It was about creating 2 threads that would run in such a way that if one thread prints a value i, the next thread should print a value i+1.&lt;br /&gt;&lt;br /&gt;The pthread_create() function is used to create a new thread, with attributes specified by attr, within a process. If attr is NULL, the default attributes are used. If the attributes specified by attr are modified later, the thread's attributes are not affected. Upon successful completion, pthread_create() stores the ID of the created thread in the location referenced by thread. &lt;br /&gt;&lt;br /&gt;The pthread_join() function suspends the execution of the calling thread until the thread identified by the thread identifier terminates, either by calling pthread_exit() or by being canceled. &lt;br /&gt;&lt;br /&gt;For our given problem we need the increment and print action for each thread to be done as atomic actions. No context switch should happen these operations. If that happens we may not get the desired result. In case a context switch happens after a read in thread one, then thread 2 might print the incremented value and thread 1 will print the old value, and there are other possibilities as well.Hence the use of semaphore cannot be avoided.&lt;br /&gt;&lt;br /&gt;Use of SIGINT (Cntr+C) is used to quit the program.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#include &amp;lt; stdio.h &amp;gt;&lt;br /&gt;#include &amp;lt; pthread.h &amp;gt;&lt;br /&gt;#include &amp;lt; semaphore.h &amp;gt;&lt;br /&gt;#include &amp;lt; signal.h &amp;gt;&lt;br /&gt;&lt;br /&gt;sem_t semname;&lt;br /&gt;int qval=1;&lt;br /&gt;&lt;br /&gt;void *func1(void *arg) {&lt;br /&gt;  while(qval) {&lt;br /&gt;    sem_wait(&amp;semname);&lt;br /&gt;    printf("Thread one prints #  %d\n",(*(int *)(arg))++);&lt;br /&gt;    sem_post(&amp;semname);&lt;br /&gt;    sleep(1);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;void *func2(void *arg) {&lt;br /&gt;  while(qval) {&lt;br /&gt;    sem_wait(&amp;semname);&lt;br /&gt;    printf("Thread two prints # %d\n",(*(int *)(arg))++);&lt;br /&gt;    sem_post(&amp;semname);&lt;br /&gt;    sleep(1);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;void quit() {&lt;br /&gt;  qval=0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;main() {&lt;br /&gt;  signal(SIGINT,quit); &lt;br /&gt;  sem_init(&amp;semname,0,1);&lt;br /&gt;  int i=0;&lt;br /&gt;  pthread_t thread1,thread2;&lt;br /&gt;  pthread_create(&amp;thread1,NULL,func1,&amp;i);&lt;br /&gt;  pthread_create(&amp;thread2,NULL,func2,&amp;i);&lt;br /&gt;  pthread_join(thread1,&amp;i);&lt;br /&gt;  pthread_join(thread2,&amp;i);&lt;br /&gt;  printf("\nQuiting...\n");&lt;br /&gt;  return 0;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Thanks &lt;br /&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-5575389056476256651?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/5575389056476256651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/12/thread-semaphore-siignals-example-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/5575389056476256651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/5575389056476256651'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/12/thread-semaphore-siignals-example-in-c.html' title='Thread, semaphore, signals example in C'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-1017769667463068774</id><published>2009-12-02T04:24:00.000-08:00</published><updated>2009-12-02T08:41:03.639-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C/CPP'/><category scheme='http://www.blogger.com/atom/ns#' term='Datastructure puzzles'/><title type='text'>Trie datastructure C example</title><content type='html'>This post is about the trie datastructure. Here we are trying to do a lexicographic trie. It can store all the words of a dictionary in an efficient manner. In the lexicographic trie datastructure each node has 26 pointers. Each pointers represent a letter. So to store "lay" , the system will first create a path from pointer for letter l to a new node(call it ptr). Then it makes a new node and makes the ptr's pointer for letter a point to this new node and so on. The advantage is that many words start with the same substring (eg new and neo). So here the common part "n" &amp; "e" is stored only once. Hence lesser storage space and efficiency. In terms of computational speed searching is much faster as each time we can eliminate 25 links and hence it must be log n to the base 26. This is used commonly to implement dictionaries etc.&lt;br /&gt;See the code now.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;CODE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;#include &amp;lt; stdio.h &amp;gt;&lt;br /&gt;#include &amp;lt; stdlib.h &amp;gt;&lt;br /&gt;#include &amp;lt; string.h &amp;gt;&lt;br /&gt;&lt;br /&gt;struct diction&lt;br /&gt;   {&lt;br /&gt;   struct diction *alpha[26];&lt;br /&gt;   int flag;&lt;br /&gt;   };&lt;br /&gt;typedef struct diction dic;&lt;br /&gt;&lt;br /&gt;dic *root;&lt;br /&gt;int maptoptr(char a)&lt;br /&gt;   {&lt;br /&gt;   char j='a';&lt;br /&gt;   int i;&lt;br /&gt;   for(i=0; i&lt;26 a="'a';" root="(dic" i="0;i&lt;26;i++,a++)" t="maptoptr(a);"&gt;alpha[t]=NULL;&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void insert(char ip[])&lt;br /&gt;   {&lt;br /&gt;   dic *ptr=root;&lt;br /&gt;   int t;&lt;br /&gt;   int f=0;//false&lt;br /&gt;   int i=0;&lt;br /&gt;&lt;br /&gt;   t=maptoptr(ip[i]);&lt;br /&gt;   while(ptr-&gt;alpha[t]!=NULL &amp;amp;&amp;amp; f==0) //not finished searchin and if there is a path with current letter&lt;br /&gt;       {&lt;br /&gt;       if(ip[i]=='\0' &amp;amp;&amp;amp; ptr-&gt;flag==1)&lt;br /&gt;           {&lt;br /&gt;           f=1;//true&lt;br /&gt;           }&lt;br /&gt;       else&lt;br /&gt;           {&lt;br /&gt;           ptr=ptr-&gt;alpha[t];&lt;br /&gt;           i++;&lt;br /&gt;           }&lt;br /&gt;       t=maptoptr(ip[i]);&lt;br /&gt;       }&lt;br /&gt;   if(f==1)&lt;br /&gt;       {&lt;br /&gt;       printf("Already exists\n");&lt;br /&gt;       }&lt;br /&gt;   else&lt;br /&gt;       {&lt;br /&gt;       dic *ptr1=NULL;&lt;br /&gt;       char temp='a';&lt;br /&gt;       int j;&lt;br /&gt;       while(ip[i]!='\0')&lt;br /&gt;           {&lt;br /&gt;           temp='a';&lt;br /&gt;           ptr1=(dic *)malloc(sizeof(dic));&lt;br /&gt;           for(j=0;j&lt;26;j++,temp++) t="maptoptr(temp);"&gt;alpha[t]=NULL;&lt;br /&gt;               }&lt;br /&gt;           ptr1-&gt;flag=0;&lt;br /&gt;           t=maptoptr(ip[i]);&lt;br /&gt;           ptr-&gt;alpha[t]=ptr1;&lt;br /&gt;           ptr=ptr1;&lt;br /&gt;           i++;&lt;br /&gt;           }&lt;br /&gt;       ptr-&gt;flag=1;&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;void search(char ip[])&lt;br /&gt;   {&lt;br /&gt;   int i=0,f=1;&lt;br /&gt;   int t;&lt;br /&gt;   dic *ptr=root;&lt;br /&gt;   while(ip[i]!='\0'&amp;amp;&amp;amp; f==1)&lt;br /&gt;       {&lt;br /&gt;       t=maptoptr(ip[i]);&lt;br /&gt;       if(ptr-&gt;alpha[t]==NULL)&lt;br /&gt;           {&lt;br /&gt;           f=0;&lt;br /&gt;           i++;&lt;br /&gt;           break;&lt;br /&gt;           }&lt;br /&gt;       ptr=ptr-&gt;alpha[t];&lt;br /&gt;       i++;&lt;br /&gt;       }&lt;br /&gt;   if(f==1 &amp;amp;&amp;amp; ip[i]=='\0' &amp;amp;&amp;amp; ptr-&gt;flag==1)&lt;br /&gt;       printf("\nFound\n");&lt;br /&gt;   else&lt;br /&gt;       printf("\nNot found\n");&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;void bt_free(dic *ptr)&lt;br /&gt;   {&lt;br /&gt;   int i=0,t;&lt;br /&gt;   char a='a';&lt;br /&gt;   if(ptr==NULL)&lt;br /&gt;       return;&lt;br /&gt;   for(i=0;i&lt;26;i++,a++) t="maptoptr(a);"&gt;alpha[t]!=NULL)&lt;br /&gt;           {&lt;br /&gt;           bt_free((ptr-&gt;alpha[t]));&lt;br /&gt;           }  &lt;br /&gt;       }&lt;br /&gt;   free(ptr);   &lt;br /&gt;   }&lt;br /&gt;main()&lt;br /&gt;   {&lt;br /&gt;   char a[25];&lt;br /&gt;   printf("Enter the word to insert : ");&lt;br /&gt;   gets(a);&lt;br /&gt;   createroot();&lt;br /&gt;   insert(a);&lt;br /&gt;   printf("Enter another word to insert : ");&lt;br /&gt;   gets(a);&lt;br /&gt;   insert(a);&lt;br /&gt;   printf("Enter the word to be searched : ");&lt;br /&gt;   gets(a);&lt;br /&gt;   search(a);&lt;br /&gt;   bt_free(root);&lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;OUTPUT&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$ ./a.exe&lt;br /&gt;Enter the word to insert : layman&lt;br /&gt;Enter another word to insert : laymansviews&lt;br /&gt;Enter the word to be searched : layman&lt;br /&gt;&lt;br /&gt;Found&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-1017769667463068774?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/1017769667463068774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/12/trie-datastructure-c-example.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/1017769667463068774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/1017769667463068774'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/12/trie-datastructure-c-example.html' title='Trie datastructure C example'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-1022922796527144165</id><published>2009-11-25T21:48:00.001-08:00</published><updated>2009-11-26T00:24:34.603-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Art of computer programming'/><title type='text'>Art of computer programming -Sorting #4</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Bubble sort&lt;/span&gt;&lt;br /&gt;Bubble sort is the most well known sort. The idea of bubble sort is very straight forward. We compare adjacent elements and rearrange them. So element 1 and element 2 are compared and if element 1 is &gt; element 2 then they are swapped, next element 2 and element 3 are compared and so on. In the first pass the largest element will be swapped to position n-1. In the second pass second largest element will reach n-2 etc. So in the nth pass ith largest element will reach n-i. There are a total of n passes. Now there are very little interesting things about this sort.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;Point to note&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The algorithm is inefficient for small and large lists. For small lists insertion sort maybe used and O(n^2) sorting is not recommended for large lists.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Knuth says that "the bubble sort seems to have nothing to recommend it, except a catchy name and the fact that it leads to some interesting theoretical problems"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Bubble sort is 40% slower than selection sort and 5 times slower than insertion sort.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Algorithm&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;b&gt;procedure&lt;/b&gt; bubbleSort( A &lt;b&gt;:&lt;/b&gt; list of sortable items ) &lt;b&gt;defined as:&lt;/b&gt;&lt;br /&gt; &lt;b&gt;do&lt;/b&gt;&lt;br /&gt;   swapped := false&lt;br /&gt;   &lt;b&gt;for each&lt;/b&gt; i &lt;b&gt;in&lt;/b&gt; 0 &lt;b&gt;to&lt;/b&gt; length(A) - 2 &lt;b&gt;inclusive do:&lt;/b&gt;&lt;br /&gt;     &lt;b&gt;if&lt;/b&gt; A[i] &gt; A[i+1] &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;       swap( A[i], A[i+1] )&lt;br /&gt;       swapped := true&lt;br /&gt;     &lt;b&gt;end if&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;end for&lt;/b&gt;&lt;br /&gt; &lt;b&gt;while&lt;/b&gt; swapped&lt;br /&gt;&lt;b&gt;end procedure&lt;/b&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Worst case performance : O(n^2)&lt;br /&gt;Best case performance  : O(n)&lt;br /&gt;Average case performance : O(n^2)&lt;br /&gt;Worst case space complexity:  O(1)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;Thanking you,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-1022922796527144165?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/1022922796527144165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/11/art-of-computer-programming-sorting-4.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/1022922796527144165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/1022922796527144165'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/11/art-of-computer-programming-sorting-4.html' title='Art of computer programming -Sorting #4'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-6541687639820132278</id><published>2009-11-19T18:20:00.000-08:00</published><updated>2009-11-19T19:20:58.251-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C/CPP'/><category scheme='http://www.blogger.com/atom/ns#' term='C Teasers'/><title type='text'>C/C++ teaser</title><content type='html'>This is not very difficult. But just have a look.&lt;br /&gt;&lt;br /&gt;1. Predict the outcome&lt;br /&gt;#include &amp;lt; stdio.h &amp;gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a=0;&lt;br /&gt;printf("%s",a);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;2. Predict the outcome&lt;br /&gt;#include &amp;lt; stdio.h &amp;gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int arr[]={2,3,4,5,6};&lt;br /&gt;int *iptr=arr;&lt;br /&gt;iptr++;&lt;br /&gt;printf("%d",*(iptr+i));&lt;br /&gt;arr++;&lt;br /&gt;printf("%d",*(arr+i));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Predict the outcome&lt;br /&gt;#include &amp;lt; stdio.h &amp;gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int arr[]={2,3,4,5,6};&lt;br /&gt;int *iptr=arr;&lt;br /&gt;int i=0;&lt;br /&gt;printf("%d,%d%d,%d",*(iptr+i),i[arr],arr[i],*(arr+i));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please answer the questions as comments. The answers will be posted soon.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Thanks &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-6541687639820132278?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/6541687639820132278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/11/cc-teaser.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/6541687639820132278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/6541687639820132278'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/11/cc-teaser.html' title='C/C++ teaser'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-3098718657799137452</id><published>2009-11-18T21:28:00.000-08:00</published><updated>2009-11-18T22:58:55.330-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Art of computer programming'/><title type='text'>Art of computer programming -Sorting #3</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Shell sort&lt;/span&gt;&lt;br /&gt;For any sorting algorithm that moves only one position at a time , then the running time will always be proportional to n^2. Hence the idea was struck to make larger leaps rather than small ones. The small leaps is one of the prime reasons for insertion sort's low efficiency. And Donald Shell proposed shell sort.&lt;br /&gt;Now you will be wondering how to choose he leap/step size. In shell sort we can start with an arbitrary step size in the first pass, after every pass the step size decreases. Hence shell sort is also known as decreasing increment sort. We'll take an example. In the first pass, let the step size be 8.&lt;br /&gt;So during first pass element 0 is compared with element 8, element 16 , element 24.....element n.....element( n+8) etc.  During second pass the increment is reduced to 4, so element 0 is compared with element 4, element 8........element n, element(n+4) etc. In the third pass increment size be 2, comparison will be between element 0, element 2, element 4....element n,element( n+2) etc. And finally increment becomes 1 in the last pass. In the last pass element 0, element 1, element 2 ....element n, element (n+1) etc is compared.&lt;br /&gt;&lt;br /&gt;This is how the shell sort operates. During each pass the elements being compared are re-arranged in sorted order,ie, if element i and j are compared the position of i and j are rearranged so that the series i,j is in sorted order.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; font-style: italic;font-family:trebuchet ms;" &gt;Points of interest&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Like the insertion sort it has best case of O(n) hence its suitable to check whether an array is sorted or not.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Choosing the increment sequence is a tricky question. If you are concerned about the efficiency I have few recommendations for you:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The Sedgewick increment sequence..&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  &lt;/span&gt;&lt;img style="font-weight: bold;" class="tex" alt="9\times4^i - 9\times2^i + 1" src="http://upload.wikimedia.org/math/6/c/0/6c0509c282305744e4ea19341d7e1eae.png" /&gt;&lt;span style="font-weight: bold;"&gt;, or &lt;/span&gt;&lt;img style="font-weight: bold;" class="tex" alt="4^{i} - 3\times2^i + 1" src="http://upload.wikimedia.org/math/6/9/b/69b8a39c3174d1210562471b335ea6c0.png" /&gt;&lt;span style="font-weight: bold;"&gt; ......&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The best known sequence according to research by Marcin Ciura is 1, 4, 10, 23, 57, 132, 301, 701, 1750&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Algorithm:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;input: an array &lt;i&gt;a&lt;/i&gt; of length &lt;i&gt;n&lt;/i&gt; with array elements numbered 0 to &lt;i&gt;n&lt;/i&gt; − 1&lt;br /&gt;&lt;br /&gt;&lt;i&gt;inc&lt;/i&gt; ← round(&lt;i&gt;n&lt;/i&gt;/2)&lt;br /&gt;while &lt;i&gt;inc&lt;/i&gt; &gt; 0 do:&lt;br /&gt;  for &lt;i&gt;i&lt;/i&gt; = &lt;i&gt;inc&lt;/i&gt; .. &lt;i&gt;n&lt;/i&gt; − 1 do:&lt;br /&gt;      &lt;i&gt;temp&lt;/i&gt; ← &lt;i&gt;a&lt;/i&gt;[&lt;i&gt;i&lt;/i&gt;]&lt;br /&gt;      &lt;i&gt;j&lt;/i&gt; ← &lt;i&gt;i&lt;/i&gt;&lt;br /&gt;      while &lt;i&gt;j&lt;/i&gt; ≥ &lt;i&gt;inc&lt;/i&gt; and &lt;i&gt;a&lt;/i&gt;[&lt;i&gt;j&lt;/i&gt; − &lt;i&gt;inc&lt;/i&gt;] &gt; &lt;i&gt;temp&lt;/i&gt; do:&lt;br /&gt;          &lt;i&gt;a&lt;/i&gt;[&lt;i&gt;j&lt;/i&gt;] ← &lt;i&gt;a&lt;/i&gt;[&lt;i&gt;j&lt;/i&gt; − &lt;i&gt;inc&lt;/i&gt;]&lt;br /&gt;          &lt;i&gt;j&lt;/i&gt; ← &lt;i&gt;j&lt;/i&gt; − &lt;i&gt;inc&lt;/i&gt;&lt;br /&gt;      &lt;i&gt;a&lt;/i&gt;[&lt;i&gt;j&lt;/i&gt;] ← &lt;i&gt;temp&lt;/i&gt;&lt;br /&gt;  &lt;i&gt;inc&lt;/i&gt; ← round(&lt;i&gt;inc&lt;/i&gt; / 2.2)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Worst case performance :  Depends on the leap/step size sequence&lt;br /&gt;Best case performance  : O(n)&lt;br /&gt;Average case performance : Depends on the leap/step size sequence&lt;br /&gt;Worst case space complexity:  O(n) &lt;table class="infobox" style="width: 22em; text-align: left; font-size: 88%; line-height: 1.5em;" cellspacing="5"&gt;&lt;tbody&gt;&lt;tr class=""&gt;&lt;th style="text-align: left;"&gt;Thanking you,&lt;br /&gt;Layman&lt;br /&gt;&lt;/th&gt;&lt;td class="" style=""&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=""&gt;&lt;th style="text-align: left;"&gt;&lt;br /&gt;&lt;/th&gt;&lt;td class="" style=""&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=""&gt;&lt;th style="text-align: left;"&gt;&lt;br /&gt;&lt;/th&gt;&lt;td class="" style=""&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=""&gt;&lt;th style="text-align: left;"&gt;&lt;br /&gt;&lt;/th&gt;&lt;td class="" style=""&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-3098718657799137452?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/3098718657799137452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/11/art-of-computer-programming-sorting-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/3098718657799137452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/3098718657799137452'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/11/art-of-computer-programming-sorting-3.html' title='Art of computer programming -Sorting #3'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-5022340622529842364</id><published>2009-11-17T23:08:00.000-08:00</published><updated>2009-11-17T23:26:41.994-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Art of computer programming'/><title type='text'>Art of computer programming -Sorting #2</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Insertion sort&lt;/span&gt;&lt;br /&gt;Insertion sort is one of those very traditional sorting methods. In this method, we scan through the list element by element and we assume that all elements preceding the present element is sorted. We start with the assumption that first element is sorted and we need to place the 2nd element to the left or the right of the first element based on whether its greater than or less than the 1st element. So we can generalize that for the i'th element we assume that the list from 0...i-1 is sorted and we can insert the ith element at the the correct position in this sorted sublist. So the problem reduces to inserting an element in a sorted list. But its not as simple as it sounds. Inserting in a sorted list may need shifting the elements of the sublist. Its a reasonably expensive operation. Hence using arrays will be quite expensive for insertion sort. Whereas if you are using linked lists, then shifting operations become much more easier(as it involves only 2-3 pointer operations).&lt;br /&gt;On an average we will need a total of 0.5(1+2+...+n) shiftings ~ 0.25n^2&lt;br /&gt;&lt;br /&gt;A method to improve this will be to use binary search to find the position of the element in the sorted list. This will reduce the position search time to log n. Hence the algorithm improves.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; font-style: italic; font-family: trebuchet ms;"&gt;Points of interest&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;To check whether a list is already sorted insertion sort is highly recommended.&lt;br /&gt;It can receive data as it is working. This is particularly useful when you have only an incomplete piece of data.&lt;br /&gt;While insertion sort typically makes fewer comparisons than selection sort, it requires more writes because the inner loop can require shifting large sections of the sorted portion of the array.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Algorithm&lt;br /&gt;&lt;pre class="de1"&gt;insertionSort&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="kw4"&gt;array&lt;/span&gt; A&lt;span class="br0"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt;   &lt;span class="kw1"&gt;for&lt;/span&gt; i &lt;span class="sy0"&gt;:=&lt;/span&gt; 1 &lt;span class="kw1"&gt;to&lt;/span&gt; length&lt;span class="br0"&gt;[&lt;/span&gt;A&lt;span class="br0"&gt;]&lt;/span&gt;&lt;span class="sy0"&gt;-&lt;/span&gt;1 &lt;span class="kw1"&gt;do&lt;/span&gt;&lt;br /&gt;   &lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt;       value &lt;span class="sy0"&gt;:=&lt;/span&gt; A&lt;span class="br0"&gt;[&lt;/span&gt;i&lt;span class="br0"&gt;]&lt;/span&gt;;&lt;br /&gt;       j &lt;span class="sy0"&gt;:=&lt;/span&gt; i &lt;span class="sy0"&gt;-&lt;/span&gt; &lt;span class="nu0"&gt;1&lt;/span&gt;;&lt;br /&gt;       &lt;span class="kw1"&gt;while&lt;/span&gt; j &gt;&lt;span class="sy0"&gt;=&lt;/span&gt; 0 &lt;span class="kw3"&gt;and&lt;/span&gt; A&lt;span class="br0"&gt;[&lt;/span&gt;j&lt;span class="br0"&gt;]&lt;/span&gt; &gt; value &lt;span class="kw1"&gt;do&lt;/span&gt;&lt;br /&gt;       &lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt;           A&lt;span class="br0"&gt;[&lt;/span&gt;j &lt;span class="sy0"&gt;+&lt;/span&gt; 1&lt;span class="br0"&gt;]&lt;/span&gt; &lt;span class="sy0"&gt;:=&lt;/span&gt; A&lt;span class="br0"&gt;[&lt;/span&gt;j&lt;span class="br0"&gt;]&lt;/span&gt;;&lt;br /&gt;           j &lt;span class="sy0"&gt;:=&lt;/span&gt; j &lt;span class="sy0"&gt;-&lt;/span&gt; &lt;span class="nu0"&gt;1&lt;/span&gt;;&lt;br /&gt;       &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;       A&lt;span class="br0"&gt;[&lt;/span&gt;j &lt;span class="sy0"&gt;+&lt;/span&gt; 1&lt;span class="br0"&gt;]&lt;/span&gt; &lt;span class="sy0"&gt;:=&lt;/span&gt; value;&lt;br /&gt;   &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;&lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Worst case performance  О(n^2)&lt;br /&gt;Best case performance  O(n)&lt;br /&gt;Average case performance  О(n^2)&lt;br /&gt;Worst case space complexity O(1)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-5022340622529842364?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/5022340622529842364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/11/art-of-computer-programming-sorting-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/5022340622529842364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/5022340622529842364'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/11/art-of-computer-programming-sorting-2.html' title='Art of computer programming -Sorting #2'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-7643920648274437281</id><published>2009-11-13T01:36:00.000-08:00</published><updated>2009-11-16T23:24:14.091-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C/CPP'/><category scheme='http://www.blogger.com/atom/ns#' term='Datastructure puzzles'/><title type='text'>Rectangle intersection problem with tree datastructure</title><content type='html'>The problem here is to write a program that will find all the rectangles that intersects with a given rectangle once the left bottom and top right of the rectangles are given.&lt;br /&gt;&lt;br /&gt;#include &amp;lt; stdio.h&amp;gt&lt;br /&gt;#include &amp;lt; stdlib.h&amp;gt&lt;br /&gt;#include &amp;lt; sys/stat.h&amp;gt&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;struct rect {&lt;br /&gt;  int x,y;&lt;br /&gt;  struct rect *left,*right,*rtpoint;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int xmin,ymin,xmax,ymax;&lt;br /&gt;&lt;br /&gt;typedef struct rect rec;&lt;br /&gt;rec *root=NULL,*newptr=NULL;&lt;br /&gt;&lt;br /&gt;void find(int x1,int cnd) {&lt;br /&gt;  rec *parent=NULL,*tptr=NULL;&lt;br /&gt;  rec *ptr=root;&lt;br /&gt;  while(ptr!=NULL) {&lt;br /&gt;    parent=ptr;&lt;br /&gt;    if(cnd==0) {&lt;br /&gt;      //if( ((ptr-&gt;x &gt; x1) &amp;&amp; (ptr-&gt;rtpoint)-&gt;x &lt; x1) || ((ptr-&gt;x &lt; x1) &amp;&amp; ((ptr-&gt;rtpoint)-&gt;x&gt;x1) ) )&lt;br /&gt;   if(ptr-&gt;rtpoint!=NULL) {&lt;br /&gt;        if(check(ptr)) {&lt;br /&gt;       printf("\nIntersects (%d,%d) - (%d, %d)\n",ptr-&gt;x,ptr-&gt;y,(ptr-&gt;rtpoint)-&gt;x,(ptr-&gt;rtpoint)-&gt;y);&lt;br /&gt;       (ptr-&gt;rtpoint)-&gt;rtpoint=NULL;&lt;br /&gt;    ptr-&gt;rtpoint=NULL;  &lt;br /&gt;     }&lt;br /&gt;   } &lt;br /&gt;    } &lt;br /&gt;    if(ptr-&gt;x &gt; x1)&lt;br /&gt;      ptr=ptr-&gt;left;&lt;br /&gt;    else &lt;br /&gt;      ptr=ptr-&gt;right;&lt;br /&gt;  }&lt;br /&gt;  if(cnd==1) {&lt;br /&gt;    if(parent-&gt;x &gt; x1 )&lt;br /&gt;      parent-&gt;left=newptr;&lt;br /&gt;    else&lt;br /&gt;      parent-&gt;right=newptr;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int check(rec *temp) {&lt;br /&gt;  rec *temp2=temp-&gt;rtpoint;&lt;br /&gt;  int ys=temp-&gt;y,xs=temp-&gt;x;&lt;br /&gt;  int yr=temp2-&gt;y,xr=temp2-&gt;x,t;&lt;br /&gt;  if(ys&gt;yr) {&lt;br /&gt;    t=ys;&lt;br /&gt;    ys=yr;&lt;br /&gt;    yr=t;&lt;br /&gt;  }&lt;br /&gt;  if(xs&gt;xr) {&lt;br /&gt;    t=xs;&lt;br /&gt;    xs=xr;&lt;br /&gt;    xr=t;&lt;br /&gt;  } &lt;br /&gt;  return !( (yr &lt;= ymin)  || (ys &gt;= ymax) || (xr &lt;= xmin)  || (xs &gt;= xmax) ); &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void preorder(rec *ptr) {&lt;br /&gt;  if(ptr!=NULL) {&lt;br /&gt;    preorder(ptr-&gt;left);&lt;br /&gt;    printf("x=%d y=%d\n",ptr-&gt;x,ptr-&gt;y);&lt;br /&gt;    preorder(ptr-&gt;right);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;void bt_free() {&lt;br /&gt;  if(root==NULL)&lt;br /&gt;    return;&lt;br /&gt;  bt_free(root-&gt;left);&lt;br /&gt;  bt_free(root-&gt;right);&lt;br /&gt;  free(root);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&lt;br /&gt;  FILE * fp;&lt;br /&gt;  int temp;&lt;br /&gt;  rec *temp_ptr=NULL;&lt;br /&gt;  struct stat stFileInfo;&lt;br /&gt;  char filename[50];&lt;br /&gt;  do {&lt;br /&gt;    printf ("Enter the filename to get data : "); &lt;br /&gt;    gets(filename);&lt;br /&gt; temp=stat(filename,&amp;stFileInfo);&lt;br /&gt;    if(temp!=0) {&lt;br /&gt;   printf("File doesnt exist!!! \n");  &lt;br /&gt; }&lt;br /&gt;  }while(temp != 0); &lt;br /&gt;  fp = fopen(filename,"r");&lt;br /&gt;  while(fscanf(fp,"%d %d %d %d",&amp;xmin,&amp;ymin,&amp;xmax,&amp;ymax) &gt; 0) {&lt;br /&gt;    if(root==NULL) {&lt;br /&gt;      root=(rec *)malloc(sizeof(rec));&lt;br /&gt;      root-&gt;x=xmin;&lt;br /&gt;      root-&gt;y=ymin;&lt;br /&gt;      root-&gt;left=NULL;&lt;br /&gt;      root-&gt;right=NULL;&lt;br /&gt;      temp_ptr=root;   &lt;br /&gt;      newptr=(rec *)malloc(sizeof(rec));&lt;br /&gt;      newptr-&gt;left=NULL;&lt;br /&gt;      newptr-&gt;right=NULL;&lt;br /&gt;      newptr-&gt;rtpoint=temp_ptr;   &lt;br /&gt;      newptr-&gt;x=xmax;&lt;br /&gt;      newptr-&gt;y=ymax;&lt;br /&gt;      find(xmax,1);&lt;br /&gt;      temp_ptr-&gt;rtpoint=newptr;&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;      newptr=(rec *)malloc(sizeof(rec));&lt;br /&gt;      newptr-&gt;left=NULL;&lt;br /&gt;      newptr-&gt;right=NULL;   &lt;br /&gt;      newptr-&gt;x=xmin;&lt;br /&gt;      newptr-&gt;y=ymin;&lt;br /&gt;      temp_ptr=newptr;&lt;br /&gt;      find(xmin,1);&lt;br /&gt;      newptr=(rec *)malloc(sizeof(rec));&lt;br /&gt;      newptr-&gt;left=NULL;&lt;br /&gt;      newptr-&gt;right=NULL;&lt;br /&gt;      newptr-&gt;rtpoint=temp_ptr;   &lt;br /&gt;      newptr-&gt;x=xmax;&lt;br /&gt;      newptr-&gt;y=ymax;&lt;br /&gt;      find(xmax,1);&lt;br /&gt;      temp_ptr-&gt;rtpoint=newptr;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  fclose(fp);&lt;br /&gt;  printf("Tree created successfully\nPreorder traversal follows\n");&lt;br /&gt;  preorder(root);&lt;br /&gt;  printf("\nEnter the test rectangle co-ordinates seperated by comas\n"); &lt;br /&gt;  scanf("%d,%d,%d,%d",&amp;xmin,&amp;ymin,&amp;xmax,&amp;ymax);&lt;br /&gt;  if(xmin&gt;xmax) {&lt;br /&gt;    temp=xmin;&lt;br /&gt;    xmin=xmax;&lt;br /&gt;    xmax=temp;&lt;br /&gt;    temp=ymin;&lt;br /&gt;    ymin=ymax;&lt;br /&gt;    ymax=temp; &lt;br /&gt;  }&lt;br /&gt;  find(xmin,0);&lt;br /&gt;  find(xmax,0);&lt;br /&gt;  bt_free();&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sample input file&lt;br /&gt;6 6 11 11&lt;br /&gt;0 0 2 2&lt;br /&gt;9 9 12 12&lt;br /&gt;60 0 70 100&lt;br /&gt;7 2 8 12&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-7643920648274437281?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/7643920648274437281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/11/rectangle-intersection-with-tree.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/7643920648274437281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/7643920648274437281'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/11/rectangle-intersection-with-tree.html' title='Rectangle intersection problem with tree datastructure'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-5516848476965238774</id><published>2009-11-13T00:33:00.001-08:00</published><updated>2009-11-16T22:29:35.074-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C/CPP'/><title type='text'>COM/Serial communication in C</title><content type='html'>This program will help you to understand how to do serial communication in C.&lt;br /&gt;The C program will illustrate the basics of serial communication.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/////////////////////////////////////////////////&lt;br /&gt;// Serial port interface program               //&lt;br /&gt;/////////////////////////////////////////////////&lt;br /&gt;&lt;br /&gt;#include &amp;lt; stdio.h &amp;gt; // standard input / output functions&lt;br /&gt;#include &amp;lt; string.h &amp;gt; // string function definitions&lt;br /&gt;#include &amp;lt unistd.h &amp;gt; // UNIX standard function definitions&lt;br /&gt;#include &amp;lt; fcntl.h &amp;gt; // File control definitions&lt;br /&gt;#include &amp;lt; errno.h &amp;gt; // Error number definitions&lt;br /&gt;#include &amp;lt termios.h &amp;gt; // POSIX terminal control definitionss&lt;br /&gt;#include &amp;lt; time.h &amp;gt;   // time calls&lt;br /&gt;#include &amp;lt; stdlib.h &amp;gt;&lt;br /&gt;#include &amp;lt; sys/types.h &amp;gt;&lt;br /&gt;#include  &amp;lt; netinet/in.h &amp;gt;&lt;br /&gt;int fd;&lt;br /&gt;int open_port(void)&lt;br /&gt;{&lt;br /&gt;int fd; // file description for the serial port&lt;br /&gt;&lt;br /&gt;fd = open("COM2", O_RDWR);&lt;br /&gt;&lt;br /&gt;if(fd == -1) // if open is unsucessful&lt;br /&gt;{&lt;br /&gt; perror("open_port: Unable to open /dev/ttyS0 - ");&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;printf("Opened %d\n",fd);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;return(fd);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int configure_port(int fd)      // configure the port&lt;br /&gt;{&lt;br /&gt;struct termios oldtio,port_settings;      // structure to store the port settings in&lt;br /&gt;tcgetattr(fd,&amp;oldtio); &lt;br /&gt;//cfsetispeed(&amp;port_settings, B115200);    // set baud rates&lt;br /&gt;//cfsetospeed(&amp;port_settings, B115200);&lt;br /&gt;&lt;br /&gt;bzero (&amp;port_settings, sizeof (port_settings));&lt;br /&gt;port_settings.c_cflag = B115200 | CLOCAL | CREAD;&lt;br /&gt;port_settings.c_cflag &amp;= ~PARENB;    // set no parity, stop bits, data bits 8N1&lt;br /&gt;port_settings.c_cflag &amp;= ~CSTOPB;&lt;br /&gt;port_settings.c_cflag &amp;= ~CSIZE;&lt;br /&gt;port_settings.c_cflag |= CS8;&lt;br /&gt;port_settings.c_iflag = IGNPAR | ICRNL;&lt;br /&gt;port_settings.c_oflag = 0;&lt;br /&gt;port_settings.c_lflag &amp;= ~ICANON;&lt;br /&gt;tcflush(fd, TCIFLUSH);&lt;br /&gt;tcsetattr(fd,TCSANOW,&amp;port_settings);&lt;br /&gt;return(fd);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int query_modem(int fd)   // query modem with an AT command&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;int k=0;&lt;br /&gt;char str[5];&lt;br /&gt;str[0]=2;&lt;br /&gt;str[1]=str[2]='f';&lt;br /&gt;str[3]=str[4]=3;&lt;br /&gt;k=write(fd,str,strlen(str));  // send an AT command followed by a CR&lt;br /&gt;printf("command %d\n",k);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;int dsadas()&lt;br /&gt;{&lt;br /&gt;printf("In fm");&lt;br /&gt;int bytesRead;&lt;br /&gt;char *str;&lt;br /&gt;char *buff;&lt;br /&gt;//str=(char *)malloc(100*sizeof(char));&lt;br /&gt;//buff=(char *)malloc(1024*sizeof(char));&lt;br /&gt;while(1)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//printf("In while");&lt;br /&gt;if(read(fd,str,10)&gt;0)&lt;br /&gt;{&lt;br /&gt;printf("in if");&lt;br /&gt;buff="";&lt;br /&gt;printf("yesyeysyes %s\n",str);&lt;br /&gt;//strcpy(buff,str);&lt;br /&gt;do&lt;br /&gt;{&lt;br /&gt;//sleep(100);&lt;br /&gt;//append&lt;br /&gt;printf("Buffer = %s",buff);&lt;br /&gt;strcat(buff,str);&lt;br /&gt;bytesRead=read(fd,str,10);&lt;br /&gt;}while(bytesRead&gt;0);&lt;br /&gt;//send bytes to ip&lt;br /&gt;printf("Buffer = %s",buff);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;pthread_t thread1,thread2;&lt;br /&gt;fd = open_port();&lt;br /&gt;configure_port(fd);&lt;br /&gt;query_modem(fd);&lt;br /&gt;int  iret1, iret2;&lt;br /&gt;//iret1 = pthread_create( &amp;thread1, NULL, dsadas);&lt;br /&gt;//pthread_join(thread1, NULL); &lt;br /&gt;return(0);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-5516848476965238774?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/5516848476965238774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/11/comserial-communication-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/5516848476965238774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/5516848476965238774'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/11/comserial-communication-in-c.html' title='COM/Serial communication in C'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-8426438522406757132</id><published>2009-11-13T00:20:00.000-08:00</published><updated>2009-11-16T22:33:32.570-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C/CPP'/><category scheme='http://www.blogger.com/atom/ns#' term='Datastructure puzzles'/><title type='text'>Create tree from preorder traversal</title><content type='html'>#include &amp;lt; stdio.h &amp;gt;&lt;br /&gt;#include &amp;lt; stdlib.h &amp;gt;&lt;br /&gt;&lt;br /&gt;int current=0;&lt;br /&gt;&lt;br /&gt;struct bstree {&lt;br /&gt;  int val;&lt;br /&gt;  struct bstree *left,*right;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;typedef struct bstree node;&lt;br /&gt;&lt;br /&gt;node* tree_build(int* inarr,int* prearr,int left,int right);&lt;br /&gt;void sort(int inarray[], int begin, int end);&lt;br /&gt;void swap(int *a,int *b);&lt;br /&gt;void inorder_traverse(node *ptr);&lt;br /&gt;void bt_free(node *ptr);&lt;br /&gt;&lt;br /&gt;main() {&lt;br /&gt;  int i;&lt;br /&gt;  int prearr[]={10,4,3,2,5,6,11,13,12};&lt;br /&gt;  int inarr[10];&lt;br /&gt;  for(i=0;i&lt;9;i++)&lt;br /&gt;      inarr[i]=prearr[i];&lt;br /&gt;  sort(inarr,0,9);&lt;br /&gt;  node* root = tree_build(inarr,prearr,0,9);&lt;br /&gt;  printf("\n\nTREE CREATED. NOW DOING AN INORDER TRAVERSAL ON THE TREE...\n\n");&lt;br /&gt;  inorder_traverse(root);&lt;br /&gt;  printf("\n\n");&lt;br /&gt;  bt_free(root);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void bt_free(node *ptr) {&lt;br /&gt;  if(ptr==NULL)&lt;br /&gt;    return;&lt;br /&gt;  bt_free(ptr-&gt;left);&lt;br /&gt;  bt_free(ptr-&gt;right);&lt;br /&gt;  free(ptr);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void swap(int *a,int *b) {&lt;br /&gt;  int temp=*a;&lt;br /&gt;  *a=*b;&lt;br /&gt;  *b=temp;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void sort(int inarray[],int begin,int end) {&lt;br /&gt;  if (end &gt; begin + 1) {&lt;br /&gt;    int pivot=inarray[begin],l=begin+1,r=end;&lt;br /&gt;    while(l&lt;r) {&lt;br /&gt;      if (inarray[l] &lt;= pivot)&lt;br /&gt;        l++;&lt;br /&gt;      else&lt;br /&gt;        swap(&amp;amp;inarray[l],&amp;amp;inarray[--r]);&lt;br /&gt;    }&lt;br /&gt;    swap(&amp;amp;inarray[--l],&amp;amp;inarray[begin]);&lt;br /&gt;    sort(inarray,begin,l);&lt;br /&gt;    sort(inarray,r,end);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;node* tree_build(int inarr[],int prearr[],int left,int right) {&lt;br /&gt;  int i,position;&lt;br /&gt;  if(left==right)&lt;br /&gt;    return NULL;&lt;br /&gt;  node *temp=(node *)malloc(sizeof(node));   &lt;br /&gt;  temp-&gt;val=prearr[current];&lt;br /&gt;  if(left+1==right)&lt;br /&gt;    return temp;&lt;br /&gt;  i=left;&lt;br /&gt;  while(i&lt;right) {&lt;br /&gt;    if(inarr[i]==prearr[current])&lt;br /&gt;      break;&lt;br /&gt;    i++;&lt;br /&gt;  }&lt;br /&gt;  for(position=0;inarr[position]!=inarr[i];position++);&lt;br /&gt;  if(position&gt;left) {&lt;br /&gt;    current++;&lt;br /&gt;    temp-&gt;left=tree_build(inarr,prearr,left,position);&lt;br /&gt;  }&lt;br /&gt;  if(position+1&lt;right) {&lt;br /&gt;    current++;&lt;br /&gt;    temp-&gt;right=tree_build(inarr,prearr,position+1,right);&lt;br /&gt;  }&lt;br /&gt;  return temp;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void inorder_traverse(node *ptr) {&lt;br /&gt;  if(ptr==NULL)&lt;br /&gt;    return;&lt;br /&gt;  inorder_traverse(ptr-&gt;left);&lt;br /&gt;  printf(" %d - ",ptr-&gt;val);&lt;br /&gt;  inorder_traverse(ptr-&gt;right);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-8426438522406757132?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/8426438522406757132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/11/create-tree-from-preorder-traversal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/8426438522406757132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/8426438522406757132'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/11/create-tree-from-preorder-traversal.html' title='Create tree from preorder traversal'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-5053272508764128381</id><published>2009-10-23T01:14:00.000-07:00</published><updated>2009-11-16T22:33:46.327-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C/CPP'/><title type='text'>TCPIP communication in C</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Server.c&lt;/span&gt;&lt;br /&gt;/* A simple server in the internet domain using TCP&lt;br /&gt;   The port number is passed as an argument */&lt;br /&gt;#include &amp;lt; stdio.h &amp;gt;&lt;br /&gt;#include  &amp;lt; sys/types.h &amp;gt;&lt;br /&gt;#include  &amp;lt; sys/socket.h &amp;gt;&lt;br /&gt;#include  &amp;lt; netinet/in.h &amp;gt;&lt;br /&gt;&lt;br /&gt;void error(char *msg)&lt;br /&gt;{&lt;br /&gt;    perror(msg);&lt;br /&gt;    exit(1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main(int argc, char *argv[])&lt;br /&gt;{&lt;br /&gt;     int sockfd, newsockfd, portno, clilen;&lt;br /&gt;     char buffer[256];&lt;br /&gt;     struct sockaddr_in serv_addr, cli_addr;&lt;br /&gt;     int n;&lt;br /&gt;     if (argc &lt; 2) {&lt;br /&gt;         fprintf(stderr,"ERROR, no port provided\n");&lt;br /&gt;         exit(1);&lt;br /&gt;     }&lt;br /&gt;     sockfd = socket(AF_INET, SOCK_STREAM, 0);&lt;br /&gt;     if (sockfd &lt; 0)&lt;br /&gt;        error("ERROR opening socket");&lt;br /&gt;     bzero((char *) &amp;amp;serv_addr, sizeof(serv_addr));&lt;br /&gt;     portno = atoi(argv[1]);&lt;br /&gt;     serv_addr.sin_family = AF_INET;&lt;br /&gt;     serv_addr.sin_addr.s_addr = INADDR_ANY;&lt;br /&gt;     serv_addr.sin_port = htons(portno);&lt;br /&gt;     if (bind(sockfd, (struct sockaddr *) &amp;amp;serv_addr,&lt;br /&gt;              sizeof(serv_addr)) &lt; 0)&lt;br /&gt;              error("ERROR on binding");&lt;br /&gt;     listen(sockfd,5);&lt;br /&gt;     clilen = sizeof(cli_addr);&lt;br /&gt;     newsockfd = accept(sockfd,&lt;br /&gt;                 (struct sockaddr *) &amp;amp;cli_addr,&lt;br /&gt;                 &amp;amp;clilen);&lt;br /&gt;     if (newsockfd &lt; 0)&lt;br /&gt;          error("ERROR on accept");&lt;br /&gt;     bzero(buffer,256);&lt;br /&gt;     n = read(newsockfd,buffer,255);&lt;br /&gt;     if (n &lt; 0) error("ERROR reading from socket");&lt;br /&gt;     printf("Here is the message: %s\n",buffer);&lt;br /&gt;     n = write(newsockfd,"I got your message",18);&lt;br /&gt;     if (n &lt; 0) error("ERROR writing to socket");&lt;br /&gt;     return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Client.c&lt;/span&gt;&lt;br /&gt;#include &lt;stdio.h&gt;      /* for printf() and fprintf() */&lt;br /&gt;#include &lt;sys/socket.h&gt; /* for socket(), connect(), send(), and recv() */&lt;br /&gt;#include &lt;arpa/inet.h&gt;  /* for sockaddr_in and inet_addr() */&lt;br /&gt;#include &lt;stdlib.h&gt;     /* for atoi() and exit() */&lt;br /&gt;#include &lt;string.h&gt;     /* for memset() */&lt;br /&gt;#include &lt;unistd.h&gt;     /* for close() */&lt;br /&gt;#include &lt;netdb.h&gt;&lt;br /&gt;#define RCVBUFSIZE 200024   /* Size of receive buffer */&lt;br /&gt;&lt;br /&gt;void DieWithError(char *errorMessage);  /* Error handling function */&lt;br /&gt;&lt;br /&gt;int main(int argc, char *argv[])&lt;br /&gt;{&lt;br /&gt;    int sock;                        /* Socket descriptor */&lt;br /&gt;    struct sockaddr_in echoServAddr; /* Echo server address */&lt;br /&gt;    unsigned short echoServPort;     /* Echo server port */&lt;br /&gt;    char *servIP;                    /* Server IP address (dotted quad) */&lt;br /&gt;    char *echoString;                /* String to send to echo server */&lt;br /&gt;    char echoBuffer[RCVBUFSIZE];     /* Buffer for echo string */&lt;br /&gt;    unsigned int echoStringLen;      /* Length of string to echo */&lt;br /&gt;    int bytesRcvd, totalBytesRcvd;   /* Bytes read in single recv() &lt;br /&gt;                                        and total bytes read */&lt;br /&gt;   &lt;br /&gt;    servIP = "10.64.122.26";             /* First arg: server IP address (dotted quad) */&lt;br /&gt;    echoServPort = atoi("9000"); /* Use given port, if any */&lt;br /&gt;   &lt;br /&gt;    /* Create a reliable, stream socket using TCP */&lt;br /&gt;    if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) &lt; 0)&lt;br /&gt;        DieWithError("socket() failed");&lt;br /&gt;&lt;br /&gt;    /* Construct the server address structure */&lt;br /&gt;    memset(&amp;amp;echoServAddr, 0, sizeof(echoServAddr));     /* Zero out structure */&lt;br /&gt;    echoServAddr.sin_family      = AF_INET;             /* Internet address family */&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      echoServAddr.sin_addr.s_addr = inet_addr(servIP);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;    echoServAddr.sin_addr.s_addr = inet_addr(servIP);   /* Server IP address */&lt;br /&gt;    echoServAddr.sin_port = htons(echoServPort); /* Server port */&lt;br /&gt;&lt;br /&gt;    /* Establish the connection to the echo server */&lt;br /&gt;    if (connect(sock, (struct sockaddr *) &amp;amp;echoServAddr, sizeof(echoServAddr)) &lt; 0)&lt;br /&gt;        DieWithError("connect() failed");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /* Receive the same string back from the server */&lt;br /&gt;    totalBytesRcvd = 0;&lt;br /&gt;    printf("Received: ");                /* Setup to print the echoed string */&lt;br /&gt;    while (1)&lt;br /&gt;    {&lt;br /&gt;        /* Receive up to the buffer size (minus 1 to leave space for&lt;br /&gt;           a null terminator) bytes from the sender */&lt;br /&gt;        if ((bytesRcvd = recv(sock, echoBuffer, RCVBUFSIZE - 1, 0)) &gt; 0)&lt;br /&gt;            {&lt;br /&gt;            echoBuffer[bytesRcvd] = '\0';  /* Terminate the string! */&lt;br /&gt;            printf("%s\n", echoBuffer);      /* Print the echo buffer */&lt;br /&gt;            }&lt;br /&gt;           &lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;    printf("\n");    /* Print a final linefeed */&lt;br /&gt;&lt;br /&gt;    close(sock);&lt;br /&gt;       &lt;br /&gt;    exit(0);&lt;br /&gt;}//-- end main --//&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void DieWithError(char *errorMessage)&lt;br /&gt;{&lt;br /&gt;    perror(errorMessage);&lt;br /&gt;    exit(1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Thanking you&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-5053272508764128381?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/5053272508764128381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/10/tcpip-communication-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/5053272508764128381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/5053272508764128381'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/10/tcpip-communication-in-c.html' title='TCPIP communication in C'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-1247281721049677229</id><published>2009-10-13T19:14:00.001-07:00</published><updated>2009-11-16T22:34:01.599-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C/CPP'/><title type='text'>C code to check for the existance of a file</title><content type='html'>Recently I came across this question to check if a file exists in a given directory. The question looks pretty simple, but most of those guys just out of college will have trouble doing this, its for them that I write this down. Actually, you are supposed to know all this. But nothing happens as expected during college. So lets look at it at least now. There are many ways to do the same.&lt;br /&gt;You can do a fopen and if it fails then you can probably assume that the file doesn't exist. The standard practice in the software industry is to use a stat() function.&lt;br /&gt;&lt;br /&gt;Includes:&lt;br /&gt;#include &lt;sys h=""&gt;&lt;sys h=""&gt;&lt;br /&gt;Code:&lt;br /&gt;int intStat;&lt;br /&gt;struct stat stFileInfo;&lt;br /&gt;intStat = stat(filename,&amp;amp;stFileInfo);&lt;br /&gt;if(intStat==0)&lt;br /&gt; printf("File already exists!!!\n ");   &lt;br /&gt;else&lt;br /&gt;&lt;/sys&gt; printf("File doesnt exist\n ");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So,this is how you will check whether a file exists or not with the stat function. From now on use this method rather than checking whether fopen fails&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Thanking you,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;br /&gt;&lt;/sys&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-1247281721049677229?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/1247281721049677229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/10/c-code-to-check-for-existance-of-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/1247281721049677229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/1247281721049677229'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/10/c-code-to-check-for-existance-of-file.html' title='C code to check for the existance of a file'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-7617874163196869763</id><published>2009-09-05T21:30:00.001-07:00</published><updated>2009-11-17T23:08:26.072-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Art of computer programming'/><title type='text'>Art of computer programming -Sorting #1</title><content type='html'>Long since Ive posted something. This time we will learn sorting. Sorting is familiar to you and to me for many years. But there are aspects of it which I haven't heard about ever since I first knew it. Those will be the points of discussion here.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sorting by counting :&lt;/span&gt;&lt;br /&gt;I cant say this is the best method. But every method has its advantages and disadvantages when used appropriately.&lt;br /&gt;&lt;br /&gt;set count[i]=0 for all i from 0 to n-1&lt;br /&gt;for(i=n;i&gt;1;i++) {&lt;br /&gt;for(j=i-1;j&gt;=1;j++) {&lt;br /&gt;if element[i]&gt;element[j] count[i]++;&lt;br /&gt;else count[j]++;&lt;br /&gt;&lt;br /&gt;Now we have an auxiliary table within which we have the position of the elements in the sorted list.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Distribution counting sort:&lt;/span&gt;&lt;br /&gt;This technique is applicable when we have to sort the numbers which belongs to a small range.&lt;br /&gt;That is all the values to sort should be less than v(upper limit) and greater than u(lower limit) and v-u is small(&lt;10 i="0;i&lt;n;i++)" print="" each="" element="" this="" is="" very="" but="" will="" never="" realize="" the="" importance="" these="" small="" gains="" unless="" you="" try="" it="" out="" on="" a="" large="" set="" of=""&gt;&lt;span style="font-weight: bold;"&gt;). &lt;/span&gt;&lt;span&gt;In such cases we can use the sorting by counting method to its full use and it'll give much better efficiency than any other method.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Thanks&lt;br /&gt;Layman&lt;/span&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-7617874163196869763?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/7617874163196869763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/09/art-of-computer-programming-sorting-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/7617874163196869763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/7617874163196869763'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/09/art-of-computer-programming-sorting-1.html' title='Art of computer programming -Sorting #1'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-6846756027112394386</id><published>2009-07-05T09:52:00.000-07:00</published><updated>2009-11-17T04:14:32.042-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Project Ideas'/><title type='text'>Mini/Main CS Project ideas</title><content type='html'>&lt;div&gt;Its been sometime since I wanted to post some project ideas. &lt;/div&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Develop a debugger for C/CPP : gdb is a well known debugger in linux. On similar lines you can write a debugger for C/CPP. A debugger should contain functionalities to setup break points , view variable status etc. You can use Eclipse and see how ideally a debugger should work. I recommend you to do a mini-version of gdb. You will have many references since many debuggers including gdb are open-source.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Virtual private server :  VPS will provide multiple virtual hosting environments on the same physical server. This will eliminate the need for separate physical servers for hosting different websites. It will also provide clients with an economical solution for hosting their website and allow web hosting providers (WHPs) to use their resources efficiently. Each VPS acts as a dedicated server with full root access. The benefits from such products are efficient use of existing resources by sharing them between various customers, provides more security than other sharing hosting techniques, provides root access inside each VPS though with limited capabilities, faster context switching, and minimum modifications to kernel. &lt;/li&gt;&lt;li&gt;Octave Gtk : Octave-Gtk aims to bring a full-featured toolkit like GTK to GNU Octave, to make scientific computing tools with a GUI front-end scripted from Octave itself. This directly translates to end users as a new and powerful paradigm for constructing GUIs with minimal knowledge of the constructs and easy interface for scientific programs in a really short time. Octave-Gtk is an Octave Gtk binding, which helps you access the GTK C API from the GNU Octave, an interpreted language. This cross language interoperability is achieved by Octave-Gtk binding code, which enables type safe, idempotent access of functions and objects from the either domains of Octave and C in a clean, and transparent manner, hiding the details to the end user.&lt;/li&gt;&lt;li&gt;CrossTalk : CrossTalk is a VoIP client for Windows and Linux. It allows users to talk in real time (like telephone calls) and explores the exciting world of Internet Telephony. CrossTalk will implement a simple user interface allowing users to easily make calls anywhere. It will support the encryption of the data stream, low latnecy, use of minimum bandwidth and maybe multiple conferencing as well. I intend to develop CrossTalk clients for both Linux and Windows. All of the above 'abstracts' are what I intend to do, whether I can do it, or, maybe even better it is to be seen.&lt;/li&gt;&lt;li&gt;A Highly secure steganographic file system :                &lt;span style="font-size:85%;"&gt; Magikfs is a highly secure steganographic file system with the plausible deniability feature being implemented on the Linux platform particularly over an ext2/ext3 partition without structural modifications. The data which is already present in the file system is not harmed at all. Magikfs will be user friendly,easy to install and easy to give your files the highest kind of security ever offered by file systems that exists today. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Secure PC to PC communication : &lt;/span&gt;               &lt;span style="font-size:85%;"&gt; PC to PC communication is essential to share the information. The SENDTO command is used to directly send the message over the network. So, it is not possible to send the secured information. The sent message is not secured and can be mis utilized or eavesdropped. RSA is a public key algorithm. Public key cryptography uses 2 keys a "public key" and "private key" to implement an encryption algorithm that does not require two parties to first exchange a secret key in order to conduct secure communication. Two types of primitive are specified in this document, organized in pairs: encryption and decryption. An encryption primitive produces a cipher text representative from a message representative under the control of a public key, and a decryption primitive recovers the message representative from the cipher text representative under the control of the corresponding private key. Its security is based on difficulty of factorizing large integers. &lt;/span&gt;             &lt;/li&gt;&lt;li&gt; Mobile based collaboration : Mobiles are increasingly becoming high-end not only in terms of hardware but also in operating system cum software support. Hence, there is much demand of feature packed applications which are as good or even better than their PC based counterparts. Our application, a mobile based collaboration tool, beautifully packs features from different popular domains (like google calendar, maps, drawing tools, text chat etc.) into an application which allows collaboration with other users. Online document creation made popular by Google Docs has paved the way for creation of similar utilities to make a users experience wholesome. The very idea of an amateur internet user being able to share and communicate with his/her friends, relatives and business associates over the internet through simplistic yet powerful tools is very encouraging. Realizing this fact, we have developed an application that can collaboratively share information and data among a group of trusted users. Our main utility is a drawing tool for Android (Open Source Mobile SDK) which is based on the principle that inherent capability of human beings to express and understand is much better in terms of colorful figures than through plain text. In addition to this, we have incorporated several other features in our application, Google calendar, maps, advanced drawing features, text chat etc., that allow users to use the shared information enhancing the overall experience.&lt;/li&gt;&lt;/ul&gt;                                                                                                    Courtesy: Red hat scolarships&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Thanking you,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-6846756027112394386?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/6846756027112394386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/07/project-ideas.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/6846756027112394386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/6846756027112394386'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/07/project-ideas.html' title='Mini/Main CS Project ideas'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-8265047705098692470</id><published>2009-06-30T22:50:00.000-07:00</published><updated>2009-11-16T22:34:46.951-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General programming'/><title type='text'>Regular expressions quick list</title><content type='html'>One of the most essential things you need to know as a software engineer or as a software engineering student is regular expressions. This post will brief you about the basics of regular expressions, again remember this is just a layman's view and not a geeks perspective, so read this and move on.....&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Metacharacters            -------------------------Matches&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;.                        -------------------------------Anything except newline character&lt;/li&gt;&lt;li&gt;\n                      -----------------------------Newline&lt;/li&gt;&lt;li&gt;*                       ------------------------------Zero or more copies of preceding expression&lt;/li&gt;&lt;li&gt;+                      -----------------------------One or more occurrence of preceding expression&lt;/li&gt;&lt;li&gt;?                       ------------------------------Zero or one copies of  preceding expression&lt;/li&gt;&lt;li&gt;^                      -----------------------------Beginning of a line&lt;/li&gt;&lt;li&gt;$                       ------------------------------End of line&lt;/li&gt;&lt;li&gt;a|b                    ---------------------------a or b&lt;/li&gt;&lt;li&gt;(ab)+                -----------------------One or more copies of ab (grouping)&lt;/li&gt;&lt;li&gt;"a+b"                -----------------------Literal "a+b"&lt;/li&gt;&lt;li&gt;[]                       ------------------------------Character class&lt;/li&gt;&lt;/ol&gt; Examples :-&lt;br /&gt;&lt;ol&gt;&lt;li&gt;abc-------------------------------------                   abc&lt;/li&gt;&lt;li&gt;abc*                 -----------------------------------ab abc abcc abcc abccc ......&lt;/li&gt;&lt;li&gt;abc+                ----------------------------------abc abcc abccc.....&lt;/li&gt;&lt;li&gt;a(bc)+              -------------------------------abc  abcbc abcbcbc....&lt;/li&gt;&lt;li&gt;a(bc)?               --------------------------------a abc&lt;/li&gt;&lt;li&gt;[abc]                 ----------------------------------one of:a,b,c&lt;/li&gt;&lt;li&gt;[a-z]                  -----------------------------------any letter, a-z&lt;br /&gt;&lt;/li&gt;&lt;li&gt;[a\-z]                 ----------------------------------one of : a,-,z&lt;/li&gt;&lt;li&gt;[-az]                  ---------------------------------- one of : - , a, z&lt;/li&gt;&lt;li&gt;[a-zA-Z0-9]+     ----------------------one or more alphanumeric characters&lt;/li&gt;&lt;li&gt;[ \t\n]+              -------------------------------whitespace&lt;/li&gt;&lt;li&gt;[^ab]                ---------------------------------anything except : a,b&lt;/li&gt;&lt;li&gt;[a^b]                ---------------------------------one of : a, ^, b&lt;/li&gt;&lt;li&gt;[a|b]                  ----------------------------------one of : a, | , b&lt;/li&gt;&lt;li&gt;a|b                    ------------------------------------one of : a, b&lt;/li&gt;&lt;li&gt;^[a-z]                --------------------------------line starting with a character from a-z&lt;br /&gt;&lt;/li&gt;&lt;li&gt;[a-z]$                 --------------------------------line ending with a character from a-z&lt;br /&gt;&lt;/li&gt;&lt;li&gt;^[a-z]$              -----------------------------line containing only a character from a-z&lt;/li&gt;&lt;/ol&gt;Thanking you,&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-8265047705098692470?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/8265047705098692470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/06/regular-expressions-quick-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/8265047705098692470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/8265047705098692470'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/06/regular-expressions-quick-list.html' title='Regular expressions quick list'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-8763645759043729580</id><published>2009-06-29T20:25:00.000-07:00</published><updated>2009-11-16T22:35:15.176-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux/Unix'/><title type='text'>Linux Commands: Quicklist</title><content type='html'>&lt;div style="margin: 1ex;"&gt;&lt;div&gt; &lt;ul&gt;&lt;ol type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Who…….whoami&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;date&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;use of  ;  to    separate commands&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;man &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;ls……….      –F folder /…………. –l line by line&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;cat  &lt;list&gt;    Types contents onto screen    …… -n option for line    no           -b for    line no excluding blank lines&lt;/list&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;wc       &lt;filename&gt;     word count         -l for line count       -w for word count           -c for character count&lt;/filename&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; cp  &lt;source&gt;  &lt;destination&gt; copy source file to destination      -i ask before overwrite&lt;/destination&gt;&lt;/source&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(141, 179, 226);font-family:Calibri;font-size:100%;"  &gt;-&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;r option for copying directories  ……multiple directories may also be specified&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;More than one sources can be  specified. Last one will be taken as destination&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="9" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;mv      &lt;source&gt; &lt;destination&gt;  …….  –i option is    available for preventing the overwrite.&lt;/destination&gt;&lt;/source&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;mv can also be used along with  directories(moving)&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="10" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;rm &lt;list&gt;     removes the files&lt;/list&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;rmdir &lt;/span&gt;&lt;dir&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;     removes a directory&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;ls –l &lt;filename&gt;gives    the permissions …………..&lt;/filename&gt;&lt;/span&gt;&lt;/li&gt;&lt;/span&gt;&lt;/dir&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;   &lt;span style=";font-family:Calibri;font-size:100%;"  &gt;1&lt;sup&gt;st&lt;/sup&gt;  3 charas give owner permissions&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;      &lt;span style=";font-family:Calibri;font-size:100%;"  &gt;2&lt;sup&gt;nd&lt;/sup&gt;  3 gives group permissions&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;      &lt;span style=";font-family:Calibri;font-size:100%;"  &gt;3&lt;sup&gt;rd&lt;/sup&gt;  3 gives other privileges&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="13" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; chmod &lt;expression&gt;    &lt;files&gt;&lt;/files&gt;&lt;/expression&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;expression is either symbolic  or octal. In symbolic letters are used. In octal nos from 0-7 are used  to set the permissions.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;In symbolic form the syntax  is (who) (action) (permission)&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;&lt;b&gt;Letter Represents&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;u   Owner&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;g   Group&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;o   Other&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;a   All&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;&lt;b&gt;Symbol Represents&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;+  Adding permissions  to the file&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;-  Removing permission  from the file&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;=  Explicitly set the  file permissions&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;&lt;b&gt;Letter Represents&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;r    Read&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;w  Write&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;x   Execute&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;eg.  &lt;/span&gt;&lt;span style=";font-family:CourierNew;font-size:100%;"  &gt;$  chmod guo+rx *&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:CourierNew;font-size:100%;"  &gt;        gives read and execute permissions to group, owner and others(all).More  than one set of permissions can be set by separating by commas.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Octal methods&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Read permission value = 4; Write permission  value=2; Execute permission value=1;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Adding the value of the required permission  will give us a value b/w 0-7. We can use this no to specify the permission  for the owner, group, and others in the respective order.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;$ chmod 0777 *&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Will mean to add rwx permissions to  all&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;$chmod 0770 *&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;will add rwx permissions to owner and  group members whereas others will be prevented from reading , writing  or executing the file.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt;Here  * specifies that the  change of permission is applicable for all the files in the pwd (present  working directory)  &lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ol start="14" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;chown  option     user : group files&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;chown is used to change the ownership  of a file or group of files.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Option is basically all crap. Don’t  worry over that.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;User will be a an existing user  . This will specify the new owner of the file(s)&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Group files will be a path. It  can be  a single file or maybe a directory path.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;In recent systems chgrp is a new  command available.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;For portability sake we better  skip this option and stick on to chown.  &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="15" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;ps&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;This command lists all the presently  running processes.  Each process has a unique id called process  id or PID. It will be unique during a runtime. Its usually a 5 digit  number. Max value of PID is 32767.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Each process will have a PID and  a Parent PID attached to it. Each process will have a parent process.  We will note that most processes have the PPID as the PID of shell. &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt;With all commands we may  run them in foreground or background. If we run smthing on foreground  we cannot do any other process until it completes. So to save time we  can simply put them on to the background. To run a command as a background  process just add a ‘&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt;&amp;amp;’&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt; sign at the end of the command. Eg.    $ps &amp;amp;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(0, 112, 192);font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt;TIP : stty   –a  command will give you the list of all key combinations for  various functions. &lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="16" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; bg  %job number &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;To move a foreground process to  background we can use the ^Z key combination so that the process is  suspended and then using the bg command.  By default if no job  number is specified bg command resumes the most recently suspended process  to background.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="17" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;fg  %job number&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;To move a suspended process or  maybe a background process to foreground we can use this command. Job  number maybe specified. In case it’s not supplied, the shell takes  it as the last job suspended.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="18" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;nohup  &lt;command&gt;&lt;/command&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;This command can be prefixed with  any other command. It suppresses the action of the hang up signal and  thus causes a command to run even after the user logs out.  This  command is usually used to run commands in background. The results if  not redirected will go to a file called nohup.out . Otherwise it can  be suitably redirected&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Eg.    $nohup ls  &amp;amp;   will redirect the op to nohup.out &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="19" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;wait  &lt;optional&gt;&lt;/optional&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;wait can be used to put the shell  to wait state until background process(es) proceed to completion. The  optional parameter maybe a process id , a process number prefixed by  % sign , it maybe blank. In case the parameter is blank(absent) the  shell waits until all background processes attain completion.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="20" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;jobs&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;This command shows the list of  all processes that the user has suspended and also the ones running  in the background. In the op we can see – and + signs appear. The  job holding + sign will be the most recent one.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="21" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;kill &lt;parameter&gt;&lt;/parameter&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;The word says it all. It can kill  a process. The parameter maybe a PID or it may be the process no prefixed  by the %sign. Actually the kill command sends a TERM signal to the process.  The process may ignore this signal or otherwise it can perform an orderly  shutdown. In case it ignores we can go for the &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;kill  -9&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; (or &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;kill  –KILL&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;) command followed by the  parameter so that it will be forcibly killed.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ol start="22" type="1"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;exec  &lt;process&gt;&lt;/process&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;This command replaces the current  process with a new process specified in the command. The real mechanism  is overlaying the new process on the older running one.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;Variables  &lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Scalar variables are available  in unix. The variable assignment is fairly simple.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;Variable name=value&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;The lexical rules for variable  names are same as that of C. In case we need to get the value of a variable  we need to prefix the variable name by a &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;$ &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;sign. When the variable name prefixed by the  $ sign is parsed, the idea is to &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;textually  substitute for the $variable by its value .&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;  Use $ along with the variable name only when the value is needed and  not anywhere else. When assigning a string better use quotes. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;So far we have seen how to use  scalar variables. Now we shall move on to the more organized arrays.  The concept of arrays is same as in C. Array initialization is fairly  simple.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;Array name[index]=value&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;Or&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;Array name =(element1  element2 element3 …….elementn)&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;Or&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;Array name=([index1]=element1  [index5]=element5…….)&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Accessing an array element is a  different matter. The syntax will be…&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;{Arrayname[index]} &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Unlike C ,here the shell doesn’t  keep track of all the positions in an array. Rather it keeps track of  those elements that are assigned values. To access all elements in an  array 2 options are available.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;{arrayname[*]}&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;Or&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;{arrayname[@]}&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;If we assign a value to the arrayname,  its equivalent of assigning to the 0&lt;sup&gt;th&lt;/sup&gt; element in the array.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;We may set a variable as read-only  by the following command&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;readonly variablename&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Once a variable has been set as  readonly, then we can’t overwrite it. &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Just like we declared variables  we can unset or rather remove them from the computer’s memory. The  command format is shown below. This is same for both arrays as well  as scalar variables. But we cannot use this command format to remove  variables that have been set readonly. &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;unset variablename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;So far we have discussed about  variables. Now we shall see the different types of variables.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ul type="disc"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Local variable : Those variables    which we had used until now. These are user modifiable and can be set    by the user. These are the variables that are currently available within    the shell and are not available to other processes of the shell.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Environment variable : These    are variables that are accessible to every child process of the shell.    These are also user-modifiable. Only those environment variables that    are required for the proper functioning of the child program is usually    reserved.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Shell variable : These are    special types of variables that are set by the shell (and none else)    for the proper functioning of itself. They maybe of either local or    environment type.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Now we will see  how to export a variable to the environment. &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;export  varname=value varname1=value1……….varnamen=&lt;wbr&gt;valuen&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;Substitutions&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;There are basically  4 types of substitutions &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ul type="disc"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Filename substitution or    globbing&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Value based variable substitution&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Command substitution&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Arithmetic substitution&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;In globbing we  basically use three wildcards to match filenames. They are &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;*&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;(which  matches any no of any characters),&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;?&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; (which matches any 1 character), &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[character list]&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; (which matches any 1 character from the character  list). Rules that are to be used in the character list are same as those  that we have learnt in Perl (minor differences yet exist .for eg negation  is specified by ! and not by ^).&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;In value based  substitutions, a value is substituted or replaced for a parameter according  to certain conditions. There are basically 4 forms shown below.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;${parameter:-word}&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;     Will mean to substitute  the word for the parameter in case the parameter is either unset or  is null. &lt;i&gt;Here its blind substitution of the word instead of the parameter  as in case of a macro and it’s the word that matters, not its value. &lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;${parameter:=value}&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;………………………………….&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Command substitution  is yet another form. Its fairly simple. The basic idea is that the command  itself gets replaced by the output of a command. The usual context of  implementation is in the case of assigning an output to a variable.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;Variable=’command’&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Arithmetic substitution  basically deals with an expression as shown below. Here all the basic  operations like +,-,*,/ exists. Also its possible to change the precedence  by using braces. Arithmetic is integer arithmetic. Hence floating point  values maybe truncated.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;$((expression))&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;Flow control&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;If statement:&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;If  list1&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;then&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;            &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;list2&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;elif  list3&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;then&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;            &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;list4&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;else&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;list5&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;fi&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;if statement finds  application in error handling. List1 can be any operation, it maybe  a encode operation or maybe a file creation operation. In any case if  the operation fails(ie it returns nonzero) list2 is not executed.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;There is yet another  representation.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;if  list1 ; then list2; elif list3 ;then list4; else list5; fi &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;test is a command  used in association with if statement. It returns 0 or 1 based on the  expression it receives as argument. Syntax is shown below.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;test  expression&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;or&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[  expression ]&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Now we shall see  the various kind of tests.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ul type="disc"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;File tests&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;String comparisons&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Numerical comparisons&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;File tests are  used for testing files. The syntax is shown below.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[  option filename ]&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Some of the options  are:&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-b  if file exists and if it’s a block special file&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-c  if the file exists and if it’s a character special file&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-d  if the file exists and id it’s a directory&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-e  if file exists&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-f  if file exists and if it’s a regular file&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-r  if file exists and it is readable&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-w  if file exists and it is writable&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-x  if file exists and its executable&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Now we shall take  a look at test operations on strings. There are basically 2 things we  would like to find out.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;ul type="disc"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Check whether a string is    empty&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Check whether 2 strings    are equal&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[  -z string ]  checks whether a string is of zero length&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[  -n string ] checks whether a string is of nonzero length&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[  string1=string2 ] if the strings are equal returns 0&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[  string1 != string2 ] if the strings are unequal returns 0 &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Test can be done  on integers by the following format.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[  int1 operator int2 ]&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Operator can be:&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-eq   equal to&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-le    less than or equal to&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-lt     less than&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-gt    greater than&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-ge    greater than or equal to&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt;Here I would like to mention  a very important point.&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt;When we try a command in the  prompt we get the status of the command immediately. Errors will be  immediately reported. Whereas in a shell script this won’t happen.  So we must have some provision to check whether the last command was  successful. &lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt;The exit status of the last command  will be stored in a special variable &lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;$?&lt;/b&gt;&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt;. We can simply check this variable for  the value 0 to make sure the last command was successful.&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Continuing with our  discussion, now we will see compound expressions. These include combining  simple test expressions into a compound expression. The general form  is shown below.&lt;/span&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[ expression1  ] operator  [ expression2 ]&lt;/span&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;Operator  maybe&lt;/span&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-a     and&lt;/span&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-o   or&lt;/span&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Its also possible to  negate the outcome of an expression by using the following format&lt;/span&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[ !  expression ]&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;Some important points  need special mention. The spaces in the formats can’t be ignored.  Also all these test expressions are used in association with if expression.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;  Case statement:&lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Switch case statements serve the same  purpose as in C.  The syntax is shown below.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;case word in&lt;/span&gt;&lt;/p&gt; &lt;p&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;pattern1)&lt;/span&gt;&lt;/p&gt; &lt;p&gt;            &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;list1&lt;/span&gt;&lt;/p&gt; &lt;p&gt;            &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;;;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;pattern2)&lt;/span&gt;&lt;/p&gt; &lt;p&gt;            &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;list2&lt;/span&gt;&lt;/p&gt; &lt;p&gt;            &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;;;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;esac&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;or&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;case word in&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;pattern1) list1 ;;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;pattern2) list2 ;;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;esac&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here the word is matched with each  pattern provided. If it matches the corresponding list is executed.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Each pattern may include the wildcards.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;Loops&lt;br /&gt;&lt;/b&gt;&lt;i&gt;while loop:&lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;All of us know how a while loop works.  The syntax is shown below.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;while command&lt;/span&gt;&lt;/p&gt; &lt;p&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;do&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;p&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;list&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt; &lt;p&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;done&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;or&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;while command ; do  list ; done&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Command is usually a test expression  that we have already dealt with.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;List is any set of commands.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;It’s possible to nest loops as in  any other language.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;There exists yet another loop. The  until loop runs the list as long as the command(test expression) is  false. Syntax is shown below.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;until command&lt;/span&gt;&lt;/p&gt; &lt;p&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;do&lt;/span&gt;&lt;/p&gt; &lt;p&gt;            &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;list&lt;/span&gt;&lt;/p&gt; &lt;p&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;done&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;for loop:&lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;The for loop is a slightly different  concept from the for loop we know. It repeats a set of commands for  each item in a list after assigning the item in the list to a variable.  This is not the exact functioning of the loop. But for simplicity’s  sake we shall look at it that way. Whatever be the loop deals with repeating  a set of statements for each value in a list specified. Syntax is shown  below.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;for name in word1 word2  word3……….wordn&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;do&lt;/span&gt;&lt;/p&gt; &lt;p&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;list&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;done&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;or&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;for name in word1 word2  word3……wordn ; do list ; done&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here the loop assigns each word to  the name and then performs the list for each word.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;Select loop:&lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;This loop finds application in menu  driven programs. The syntax is shown below.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;select name in word1  word2 word3……….wordn&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;do&lt;/span&gt;&lt;/p&gt; &lt;p&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;list&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;done&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here the bash prints a numbered list  in the order word1…….wordn. Then it waits for the user to input.  The input from the user is expected to be a number preceding any item  that was displayed. If it is then the corresponding word is stored into  the name.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;Loop control&lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;There are basically 2 loop control  instructions.&lt;/span&gt;&lt;/p&gt; &lt;ul type="disc"&gt;&lt;li&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;break &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;     This command will    break the control out of the loop.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;continue&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;  This command will move the control out    of the loop for the current iteration.    &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;Input and output&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Output to the terminal can be done  2 ways.&lt;/span&gt;&lt;/p&gt; &lt;ul type="disc"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;echo&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;printf &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;The usage of printf is the same as  that in C.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Output of a command or a list of commands  can be redirected to a file using the redirection operator.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Syntax is shown below.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;{  command1; command2;…..commandn;  } &gt; filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;If no such file exists a new file is  created. If it exists the file content is overwritten.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Appending to a file needs another redirection  operator. Syntax is shown below.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;{ command1; command2;  command3; …………commandn; } &gt;&gt; filename&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Sometimes it is necessary to write  the result of commands onto the screen as well as a file. In that case  we can use the following format.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;command |tee filename&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;In input redirection, a text file can  be redirected as an input to a command. The syntax is shown below.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;command &lt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;There is yet another possibility.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;command &lt;&lt;&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;input1&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;input2&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;Inputn&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;delimiter&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here the redirection operator reads  the input from the user until the specified delimiter is met with again.  It then feeds the output to the command as input.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Now we will learn how to read an input  from the user. The syntax is very simple.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;read variable&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Pipelining is yet another concept available.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;command1 | command2……………&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here the output of command1 is fed  to the input of command2 and so on.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;File handles&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;We can associate a number with each  filehandle and then use it to do operations on files.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;3 file descriptors are always open  along with each and every command.&lt;/span&gt;&lt;/p&gt; &lt;ul type="disc"&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;STDIN value 0&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;STDOUT value 1&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;STDERR value 2&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;We can associate a filehandle with  a file using the following command.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;'exec n&gt; filename'&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;or&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;'exec n&gt;&gt;filename'&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here n is any integer. If n is 1 then  STDOUT is explicitly redirected to the specified file. In the second  form the file is open in append mode.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Now to redirect the output of a command  to a file we can use the following format.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;'command n&gt; filename'    (Append mode is also available)&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Also to read the contents from a file  to the standard input of a command the following syntax can be used.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;command n&lt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here n is the filehandle.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;We may redirect STDIN, STDOUT and STDERR  to any of the file by simply choosing 0,1,2 as the values for n. &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; &lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;It’s possible to redirect the input  of STDIN/STDOUT and STDERR to different files.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;'command 1&gt;file1  2&gt;file2'&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;The &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;/dev/null&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; file requires special mention. Anything redirected  to this file will be discarded.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Sometimes we may want to send both  STDOUT and STDERR to the same file. In that case the syntax is shown  below.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;'command &gt;   filename 2&gt;&amp;amp;1'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt;Reading input from a file&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Now we shall see how to read input  from a file line by line and then use it for text filtering.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;while read variablename&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;do&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;…………..&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;…………..&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;…………&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;'done &lt;&gt;'&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt; &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; &lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Now let’s move on to the most important  section as far as Y! is concerned. Most questions are asked from the  text filtering section.&lt;/span&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;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;u&gt;Text Filtering&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;Head and tail commands&lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;We can extract the first/last n lines  of a file by using head and tail commands respectively&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;head [ -n ] filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;tail [ -n ] filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;n is any integer. Head will return  the first n lines and tail returns the last n lines. In case no integer  is specified a default of 10 lines will be returned.  &lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;Grep command&lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;This is yet another powerful text filtering  command. Syntax is shown below.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;grep option word filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Option maybe&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-i for case independent  match&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-v for unmatched set  to be returned.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-n for line no’s  to be attached&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;-l for the list of  files including the word.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;transliterate(tr) command :&lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;This is yet another powerful text filtering  command. The function performed by tr is to transliterate one set into  another. The syntax is shown below.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;tr 'set1' 'set2' &lt;filename&gt;&lt;/filename&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here the characters included in set1  in the file are searched and replaced by the ones in set2. In case the  filename is not specified the shell waits for the input from the keyboard.  We must be careful while using characters like [ &amp;amp; ]. These have  a special meaning when used along with tr. Thus we must quote them (using  backslash) suitably. To capitalize or to do vice versa we can use set1  as &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;'A-Z' &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;and set2 as &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;'a-z'  .&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Sometimes you might feel that all characters  of set1 are being mapped to a single character of set2. In fact some  versions of tr behaves differently. So to be on the safer side its always  better to use the same number of characters in set1 and set2 (just in  case tr behaves differently).&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;There is yet another option available  for transliterate. This is the SQUEEZE option. The syntax is shown below.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;tr -s 'set1'&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here if the shell finds multiple consecutive  occurrences of any character in set1 then it gets replaced by a single  occurrence. &lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;Sort and uniq commands :&lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Sort command as we know sorts each  line of input. We can use the tr command to transliterate the each word  in the text input to a new line. Then we can sort the lines.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Syntax is shown below.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sort filename &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;for ascending order sort&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sort -r filename &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;can be used for reversing the result.&lt;/span&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;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;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;Text filtering&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;b&gt;&lt;i&gt;Sed&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Its the short for stream editor ,all  the input we feed into it goes through it and finally reaches the STDOUT.  It doesn't change the input file.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;With each line of the input file specified  it makes a copy of the line and then pattern matches the line with the  pattern specified. If a match is found then the corresponding action  is performed. Then it proceeds to the next pattern and repeats the same  procedure. Since the matching is done on the copy of the line and not  the real line the changes that are done on the line doesn't affect the  real line.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Syntax is shown below.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed [option] '/pattern1/'  action1&lt;/span&gt;&lt;/p&gt; &lt;p&gt;      &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;          '/pattern2/' action2 &lt;/span&gt;&lt;/p&gt; &lt;p&gt;                  &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;.......&lt;/span&gt;&lt;/p&gt; &lt;p&gt;            &lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;..................&lt;wbr&gt;....         filenames&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;patterns are usually regular expressions.  We are already familiar with regular expressions. The only major difference  is that there is no + meta character here. Although we are already familiar  with regular expressions I would like to add a few important points  here.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[^chars]   &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; matches character set not specified by chars.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;^[chars]    &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;matches character set that starts with any  one specified in chars &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;[chars]$     &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;matches character set that ends with a character  specified in chars.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/p' file  &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;prints the lines that can be matched by pattern&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/d' file     &lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; prints the lines after deleting those lines  that matches pattern&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/s/pattern1/pattern2/&lt;wbr&gt;'  file &lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;First a list of all the lines that  match pattern are created then in these lines those characters that  match pattern1 are replaced by pattern2. Then the entire lines are printed&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed 's/pattern1/pattern2/'  file &lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;here all those characters that match  pattern1 in a line are substituted by pattern2.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;But there is a problem with the last  2 cases. Only the first character set in a line that matches the pattern1  is substituted. All other patterns in the same line are not substituted.  In case we need to replace all the character sets that match pattern1  then the following syntax is to be used.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed 's/pattern1/pattern2/g'  file&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;The following syntax replaces the 4&lt;sup&gt;th&lt;/sup&gt;  pattern match in a line by the substitute provided.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed 's/pattern1/pattern2/4'  file&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Sometimes we may need to replace the  a pattern by another only if it doesn't contain a particular pattern.  In that case we can use the following syntax.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern1/!s/pattern2/&lt;wbr&gt;pattern3/g'&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here sed replaces all pattern2 by pattern3  for all the lines that doesn't match pattern1.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Deleting leading white spaces&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed 's/^[ \t]*//g'&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Deleting trailing white spaces&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed 's/[ \t]*$//g'&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; &lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Sometimes it becomes necessary to reuse  a value in an expression. Suppose that we need to append a $ sign in  front of all the numbers(floating) that is in a textfile. Then we can  use the following syntax.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed 's/[0-9][0-9]*\.[0-9][0-9]*/\$&lt;wbr&gt;&amp;amp;/'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Its also possible to redirect the output  of the sed command to a file by the following pattern.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/' action   filename &gt;destination filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Sometimes there occur situations in  which there is a need to do more than one substitutions. In that case  we can use the following syntax to perform the substitution.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed 's/pattern1/pattern2/g'  -e 's/pattern3/pattern4/g' ......................&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Here the shell searches for pattern1  and substitutes all occurrences of pattern1 by pattern2 also it does  the same thing with pattern3 and  4.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;So far we have dealt with the easy  ones that sed can give you. Now we will consider pattern space as a  buffer. Just imagine that there are 2 buffers pattern buffer that holds  the pattern to be printed and hold buffer that holds the current line.  With this idea in mind read along.  &lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;= To print the current line number&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed = filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;x To exchange contents of pattern and  hold &lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/x' filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;Initially hold has null and pattern  has 1&lt;/i&gt;&lt;sup&gt;&lt;i&gt;st&lt;/i&gt;&lt;/sup&gt;&lt;i&gt; line(that matches the pattern) then  it exchanges their content and then prints the content of pattern. Next  pattern gets next pattern matched. Hold has 1&lt;/i&gt;&lt;sup&gt;&lt;i&gt;st&lt;/i&gt;&lt;/sup&gt;&lt;i&gt;  pattern matched. They exchange the content and then prints content of  pattern. &lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;n or N  To read the next line in to the  pattern space&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/n' filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;Here whenever a pattern is matched  the next line is read into the pattern buffer.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;g or G  Copy/append hold buffer to pattern  buffer.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/g' filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;h or H  Copy/append to pattern buffer  to hold buffer.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/h' filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;w filename Write the current pattern  buffer to file&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/w filename'  filename1 &lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;r filename Append text read from file&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/r filename'   filename1&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Double spacing a line that matches  pattern&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/G' filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Double space a file that has already  blank lines in it.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/^$/d;G' filename&lt;/span&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;    here the blanklines are  first removed and then doublespaced&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Delete double spacing&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed 'n;d' filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Insert a blank line above every line  that matches a pattern&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/{x;p;x}'  filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Insert a  blank line below every  line that matches a pattern.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/G' filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Insert a blankline above and below  a pattern.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/pattern/{x;p;x;G}'&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Inserting the  line number at  the beginning of the every line&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed = filename | sed  'N;s/\n/\t/'&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;&lt;i&gt;The first part of the command will  give us the line nos attached to the lines but the line nos and lines  are on separate lines. Hence we append every line (along with \n to  the pattern buffer which initially contains the line number. Then we  substitute tab for newline. &lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Inserting  line number along with  lines but print the linenos only if line is not blank]&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed '/./=' filename  | sed 'N;s/\n/\t/'&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Calibri;font-size:100%;"  &gt;Count the number of lines in a file&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-family:Calibri;font-size:100%;"  &gt;sed -n '$='  filename&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Thanking you,&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&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/1720439187228738899-8763645759043729580?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/8763645759043729580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/06/commands-quicklist-who.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/8763645759043729580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/8763645759043729580'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/06/commands-quicklist-who.html' title='Linux Commands: Quicklist'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-44948267144877474</id><published>2009-06-29T11:44:00.000-07:00</published><updated>2009-11-16T22:35:34.600-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>SEO 3</title><content type='html'>I haven't yet seen any response for my previous posts. But I'm a self driven person and will keep on writing. So I'd like to give you my third and probably the final post on SEO. In my last post I talked to you about a brute force approach. Here I shall talk to you about a new approach , which is almost the opposite of what you have.&lt;br /&gt;&lt;br /&gt;If you have a site on which you have some contents and you want to extract the useful data from the site (typically names of people, technology names ....etc). We shall call them entities. You need to put in some data and you need to get an array of words in the list which has some semantic importance. Have you guys come across any such system ?? . My boss was the first one to recommend me such a system. It is called CALAIS.&lt;br /&gt;&lt;br /&gt;&lt;cite&gt;www.&lt;b&gt;opencalais&lt;/b&gt;.com&lt;/cite&gt;&lt;br /&gt;&lt;br /&gt;You can go in there and find out its functionality.&lt;br /&gt;&lt;br /&gt;So my recommendation,&lt;br /&gt;Whenever a new post is made , get all the terms returned by calais and then do a google sktool search for the keywords related to each term.&lt;br /&gt;Get the list returned by Google sktool and then add these terms to the link farm mentioned in the post SEO2&lt;br /&gt;This will help you to build a linkfarm withou much burden on the server.&lt;br /&gt;Thanking you&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-44948267144877474?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/44948267144877474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/06/seo-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/44948267144877474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/44948267144877474'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/06/seo-3.html' title='SEO 3'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-3006227068748375310</id><published>2009-06-26T06:01:00.000-07:00</published><updated>2009-11-16T22:35:50.225-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>SEO 2</title><content type='html'>The last post was for babies. I call those things for babies because they are things which any person who has heard of SEO will know. So this is what would actually help you. In this post I shall explain to you about how to bring about a revolutionary change with your site traffic. I will give you one way by which you can bring in a large traffic.&lt;br /&gt;This is about keywords. Iam sure you would have heard about keywords. It was a practice that revolutionized the search engine market before years. Here people can add keywords to the html field and then search engines are more likely to show your page when someone searches for your page.&lt;br /&gt;&lt;br /&gt;Im sure you are now feeling that I'm gonna retell you the story about keywords, which you would have heard for many years. NO. I have an idea here. And Iam going to present it before you. No matter what you people say, this is going to help you later.&lt;br /&gt;&lt;br /&gt;PICK UP THE TOP 100000 keywords search queries in G, Y! or the newcomer B.&lt;br /&gt;Search for relevant content in your site for these keywords.&lt;br /&gt;If your site has relevant content then add your keyword to a link farm( basically a page full of links, filled with keywords here).&lt;br /&gt;Each keyword in the linkfarm points to a page which shows the search results for the keyword within your site.&lt;br /&gt;So basically the user isn't pissed off and you have a whole page of keywords.&lt;br /&gt;I would recommend you to use only 100 links/page.&lt;br /&gt;And the last step. Get the linkfarm indexed by the G or Y! or B.&lt;br /&gt;&lt;br /&gt;Note: To get the linkfarm indexed you can submit it to google via a 'Add a result link' at the bottom of a page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-3006227068748375310?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/3006227068748375310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/06/seo-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/3006227068748375310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/3006227068748375310'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/06/seo-2.html' title='SEO 2'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-6064586941575216707</id><published>2009-06-23T23:42:00.000-07:00</published><updated>2009-11-17T00:44:19.285-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>SEO 1</title><content type='html'>&lt;span style="font-weight: bold;font-size:100%;" &gt;You might have read a 1000 tips about bringing more traffic to your site. And yet you might feel that those tips arent really helping you. Well I would say ideally, if your site contains relevant content traffic should follow. When you don't have content and yet you want traffic, I cant call you anything short of being self-centered. And this article is not for those self-centered people.&lt;br /&gt;This article has been a long time coming, and this is aimed at people who have relevant content on their site and yet cant get enough traffic because of 'n' number of reasons. I understand how bad it feels when you've done all the work and finally you cant make it because of one big 'G' or another shaky 'Y' and rarely cos of the just begun 'B'.&lt;br /&gt;&lt;br /&gt;Basically recommending something for a site in general is something I really don't believe in . But there are general practices to be followed , and these may not help you with an outburst of traffic (or more pages indexed). But they are the basics and without them you cant get any outbursts. SO READ THE FOLLOWING EXTRACT...&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;  	&lt;meta equiv="CONTENT-TYPE" content="text/html; charset=utf-8"&gt;&lt;title&gt;Search engine optimization (SEO) is the process of improving th&lt;/title&gt;&lt;meta name="GENERATOR" content="OpenOffice.org 2.2  (Linux)"&gt;&lt;meta name="AUTHOR" content="god"&gt;&lt;meta name="CREATED" content="20090518;11460000"&gt;&lt;meta name="CHANGEDBY" content="zamzar.com"&gt;&lt;meta name="CHANGED" content="20090518;11460000"&gt; 	 	 	 	 	 	 	&lt;style type="text/css"&gt; 	&lt;!-- 		@page { size: 21cm 29.7cm; margin: 2cm } 		P { margin-bottom: 0.21cm } 		A:link { color: #0000ff } 		A.ctl:link { font-family: "Times New Roman", serif } 	--&gt; 	&lt;/style&gt;  &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Search engine optimization&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt; (SEO) is the process of improving the volume or quality of traffic to a web site from search engines via "natural" ("organic" or "algorithmic") search results.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;As an Internet marketing strategy, SEO considers how search engines work and what people search for. Optimizing a website primarily involves editing its content and HTML coding to both increase its relevance to specific keywords and to remove barriers to the indexing activities of search engines.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt;&lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;Search engine optimizers may offer SEO as a stand-alone service or as a part of a broader marketing campaign. Because effective SEO may require changes to the &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/HTML"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;HTML&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; source code of a site, SEO tactics may be incorporated into web site development and &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Web_site_design"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;design&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt;&lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;Initially, all a &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Webmaster"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;webmaster&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; needed to do was submit a page, or &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;URL&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;, to the various engines which would send a &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Web_crawler"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;spider&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; to "crawl" that page, extract links to other pages from it, and return information found on the page to be &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Index_%28search_engine%29"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;indexed&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Search_engine_optimization#cite_note-0"&gt;&lt;sup&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;[1]&lt;/span&gt;&lt;/span&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; The process involves a search engine spider downloading a page and storing it on the search engine's own server, where a second program, known as an &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Search_engine_indexing"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;indexer&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;, extracts various information about the page, such as the words it contains and where these are located, as well as any weight for specific words, as well as any and all links the page contains, which are then placed into a scheduler for crawling at a later date.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt;&lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;Early versions of search &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Algorithm"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;algorithms&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; relied on webmaster-provided information such as the keyword &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Meta_tag"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;meta tag&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;, or index files in engines like &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Aliweb"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;ALIWEB&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;. Meta tags provide a guide to each page's content. But using meta data to index pages was found to be less than reliable because the webmaster's choice of keywords in the meta tag could potentially be an inaccurate representation of the site's actual content.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt;&lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;While graduate students at &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Stanford_University"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;Stanford University&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Larry_Page"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;Larry Page&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; and &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Sergey_Brin"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;Sergey Brin&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; developed "backrub," a search engine that relied on a mathematical algorithm to rate the prominence of web pages. The number calculated by the algorithm, &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/PageRank"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;PageRank&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;, is a function of the quantity and strength of &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://en.wikipedia.org/wiki/Inbound_link"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;inbound links&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;. PageRank estimates the likelihood that a given page will be reached by a web user who randomly surfs the web, and follows links from one page to another. In effect, this means that some links are stronger than others, as a higher PageRank page is more likely to be reached by the random surfer.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Any content that is hidden using CSS or other forms of subterfuge, regardless of intent, may be regarded&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;as an invisible factor and devalued. At worst, if employed excessively, the page or site may be penalized as&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;a whole.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Page Title&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;The page title is a string of text, defined by contents of the &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;title&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;element in the &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;head&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;section&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;of the HTML document. The title is visible both in the title bar of a browser window, as well as the&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;headline of a search engine result. It is arguably one of the most important factors in search engine&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;optimization because it is both an important factor in search engine rankings, as well as a critical call&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;to action that can enhance the click-through rate (CTR). Vanessa Fox of Google states, “Make sure each&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;page has a descriptive &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;title&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;tag and headings. The title of a page isn’t all that useful if every page&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;has the same one.”&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;One of the biggest mistakes web developers make is to set the title for all pages on a web site to the same&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;generic text. Frequently, this text is the company name and/or a slogan. In this case, at best your pages&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;will be indexed poorly. At worst, the site could receive a penalty if the search engines see the pages as&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;duplicate content. Be sure all pages on a dynamic site have unique and relevant titles.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;When writing titles, it is also wise to insert some targeted keywords. You should not lose sight, however,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;that a title is also a call to action. Even if a title successfully influences a search engine to rank a page&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;highly, that ranking effectiveness is then multiplied by your CTR. Keyword stuffed titles are not always&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;effective for CTR, though they may rank well. As a reminder, these keywords should also appear in the&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;document’s copy.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;People will also frequently use a page title for the anchor text of an inbound link. Anchor text is an&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;important off-page factor, and its beneficial effect is discussed later in this chapter.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="font-size:85%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;title&gt;BrandAdda: Community for Companies &amp;amp; Consumers around Brands &amp;amp; Products&lt;/title&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt;    &lt;span style="font-family:Courier New, monospace;font-size:100%;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;title&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;Mentos, Community, News, Review, Ideate, Rate, Discuss, Polls, Blog, Ads, Promotions, Photos, Videos&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;title&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Page Headings&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Page headings are sections of text set off from web page copy to indicate overall context and meaning.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;They are usually larger in size than the other copy within the document. They are typically created using&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;hx&gt; &lt;/hx&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;tags in HTML, where x is a number between 1 and 6. They have been abused in the past to manipulate&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;search rankings, but they are still an important on-page factor, and they also serve to help the user&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;navigate a page.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt;&lt;span style="font-family:Courier New, monospace;font-size:100%;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;h1&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;Mentos&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;h1&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;a&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt;              &lt;span style="font-family:Courier New, monospace;font-size:100%;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;div&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt;      &lt;span style="font-family:Courier New, monospace;font-size:100%;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;h3&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;Description: &lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;h3&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt;&lt;span style="font-family:Courier New, monospace;font-size:100%;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;h2&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; class&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;"drupal-tabs-title"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;Last Week&lt;!--&lt;/span--&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;h2&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Page Copy&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;It is intuitively clear that a page that contains the keywords that a user is looking for should be relevant&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;to his or her search query. Search engine algorithms take this into account as well. Keyword insertion,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;however, should not be done in the excess. Mentioning the keywords in various inflections (plural, singular, past, present, and so on) is likely beneficial, as well as varying word order (“chocolate&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;chip cookies” versus “cookies with chocolate chips”). Excessive and contrived keyword repetition—&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;“&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;keyword stuffing” — however, could actually be perceived as spam.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Because the search engine algorithms are unknown, “excessive” is an unfortunately vague qualifier.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;This is one of the times we will reference something requisitely in an imprecise manner.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;SEO copywriting aims to produce content on a web site in such a way that it reads well for the surfer,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;but also targets specific search terms in search engines. It is a process that legitimately, without the use&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;of spamming techniques, seeks to achieve high rankings in the search engines. SEO copywriting is an&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;art, and it takes time to master. There is no magic solution that will make it easy to create copy that is&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;persuasive, contains relevant keywords a few times, and sounds like it is not contrived specifically to&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;do so. There are a few tricks, and a few useful hints, however.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;One of our favorite tricks is to use the end and beginning of a sentence to repeat a keyword subtly.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;i&gt;Example: “Miami Hotels: You may want to try one our fine hotels in &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;i&gt;Miami. Hotel &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;i&gt;accommodations at&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;the Makebelieve Hotel will exceed your wildest expectations.”&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;The copy should also contain words that are related, but not necessarily inflections of your targeted key&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;phrase. For example, a search engine algorithm would likely see a page on cookies that also contains the&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;words “chocolate chip” or “cakes” as relevant. This tends to happen naturally with well-written prose,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;but it is worth mentioning.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;color:#000000;"  &gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Mentos is a brand of mints, of the "scotch mint" type, sold in many markets across the world by the Perfetti Van Melle corporation. Mentos was first produced in the Netherlands during the 1950s. The slogan of Mentos is "The FreshMaker."&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;  &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;To&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;color:#000000;"  &gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Mentos is a brand of mints, of the "scotch mint" type, sold in many markets across the world by the Perfetti Van Melle corporation. Mentos was first produced in the Netherlands during the 1950s. Mentos slogan is "The FreshMaker."&lt;/span&gt;&lt;/span&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Outbound Links&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Search engines will evaluate the links that a document contains. A related link on a web page is valuable&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;content in and of itself, and is treated as such by search engines. However, links to totally irrelevant or&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;spam content can potentially hurt the rankings of a page. Linking to a “bad neighborhood” of spam sites&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;or even lots of irrelevant sites can hurt a site’s rankings.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt;&lt;span style="font-family:Courier New, monospace;font-size:100%;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;a&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; href&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;="&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="view-source:http://www.mentos.com/"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;http://www.mentos.com/&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;" &lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Keywords in Page URL and Domain Name&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;It is likely that keywords contained by a URL, both in the domain name or in the file name, do have a&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;minor but apparently positive effect on ranking. It also likely has an effect on CTR because keywords in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;the URL may make a user more likely to click a link due to an increase in perceived relevance. The URL,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;like the page title, is also often selected as the anchor text for a link. This may have the same previously&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;mentioned beneficial effect.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt;&lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://brandadda.com/bh/mentos"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;http://brandadda.com/bh/mentos&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Internal Link Structure and Anchors&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Search engines may make the assumption that pages not linked to, or buried within a web site’s internal&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;link structure, are less important, just as they assume that pages that are not linked well from external&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;sources are less important than those that are. Linking from the home page to content that you would&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;like to rank can improve that page’s rankings, as well as linking to it from a sitemap and from various&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;related content within the site. This models real-world human behavior as well. Popular products are&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;often prominently featured in the front of a store.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;One horrible way to push pages down the link hierarchy is to implement pagination using “&lt;&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;“&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;next &gt;” links, without linking directly to the individual pages. Consider the example of the fourth page&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;of an article that is split into four parts. It is reached like this:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Home Page &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;➪&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Article Part 1 &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;➪&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Article Part 2 &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;➪&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Article Part 3 &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;➪&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Article Part 4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;This fourth page is harder to reach not only by humans (who need to click at least four times), but also&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;by search engines, which would probably consider the content in that page as less important. We call the&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;effect of this link structure “death by pagination,” and we suggest two possible approaches for mitigating&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;the problem:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;1. &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Don’t use simple pagination. Page with “&lt;&gt;” links, but also add links to the&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;individual pages, that is, “&lt;&gt;.” This creates a better navigation scheme to all&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;pages.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;2. &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Add a sitemap with links to all the pages.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Invisible factors&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;  &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Meta Description&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;For the most part, the importance of a meta description lies in the fact that search engines may choose to&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;use it in the SERPs, instead of displaying relevant bits from the page (this is not guaranteed, however).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Speaking from a marketing point of view, this may improve CTR. A meta description may also have a&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;minor effect on search engine rankings, but it is definitely not a critical factor in that regard. Here is an&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;example:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;meta name="”description”" value="”The" secrets="" to="" baking="" chewy="" chocolate="" chip=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;cookies that make you wish thousands of calories were actually good for you!” /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt;&lt;span style="font-family:Courier New, monospace;font-size:100%;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;meta&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; name&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;"description" &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;content&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;"Consumer self-expression through ideas, reviews, comments, photos, videos. Companies interact with Consumers via comments, blogs, ads, polls, promotions."&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Meta Keywords&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;This criterion is widely regarded as totally unimportant because it is completely invisible and subject&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;to manipulation. It is wise to place a few major keywords as well as their misspellings in the meta keywords&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;tag, but the effectiveness of targeting misspellings this way has been disputed:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;meta name="”keywords”" value="”chocolate" baking="" chocolate="" chip=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;cookies, choclate, cokies” /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt;&lt;span style="font-family:Courier New, monospace;font-size:100%;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;meta&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt; name&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;"keyword" &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;content&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;"Consumers, Companies, Brands, Products, Services, self-expression, collaboration, community, ideas, reviews, forums, discussions, photos, videos, company blogs, polls, ads, promotions."&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Alt and Title Attributes&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Because these tags are mostly invisible, they are likely not an important ranking factor. Many assert&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;that their value is higher on hyperlinked images. They are important, however, for screen readers and&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;text-based browsers — that is, for accessibility and usability in general, so they should not be ignored&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;for that reason alone. Neither of these attributes will make or break you, but blind visitors using screen&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;readers will thank you in any case. This is a case where accessibility, usability, and search engine optimization&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;coincide. The descriptions should be short. Keyword stuffing in an &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;alt &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;tag will irk blind&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;users using screen readers, and possibly “irk” the search engines as well. Alt tags can only be used in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;image tags, whereas title attributes can be used in most tags. Here is an example of the &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;alt &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;attribute&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;in an image:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;img src="http://www.blogger.com/%E2%80%9D/images/chocolate_chip_cookie.jpg%E2%80%9D" alt="”a" picture="" of="" a="" really="" big="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt; &lt;span style="font-size:100%;color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;chocolate chip cookie”&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt; &lt;span style="font-family:Times NewROman, serif;font-size:100%;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;And the &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;title &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;attribute on a link:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2; font-weight: bold;" lang="en-US"&gt; &lt;/p&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;a href="http://www.blogger.com/%E2%80%9D/chocolate_chip_cookie.html%E2%80%9D" title="”a" really="" big="" chocolate="" chip=""&gt;&lt;br /&gt; &lt;/a&gt;&lt;/span&gt;&lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;" lang="en-US"&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://www.blogger.com/%E2%80%9D/chocolate_chip_cookie.html%E2%80%9D" title="”a" really="" big="" chocolate="" chip=""&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Page Structure Considerations&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;a href="http://www.blogger.com/%E2%80%9D/chocolate_chip_cookie.html%E2%80%9D" title="”a" really="" big="" chocolate="" chip=""&gt; &lt;/a&gt;&lt;/span&gt;&lt;p style="margin-bottom: 0cm; line-height: 100%; font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://www.blogger.com/%E2%80%9D/chocolate_chip_cookie.html%E2%80%9D" title="”a" really="" big="" chocolate="" chip=""&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Search engines use block-level elements, for example &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://www.blogger.com/%E2%80%9D/chocolate_chip_cookie.html%E2%80%9D" title="”a" really="" big="" chocolate="" chip=""&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;, or &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;table&gt; &lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;elements to group related&lt;/span&gt;&lt;/span&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;text. Using block-level elements indiscriminately for layout, as illustrated in the following example, may&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;be harmful:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;div&gt;Dog&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;div&gt;food&lt;/div&gt; is likely to be less relevant than:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;div&gt;dog food&lt;/div&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Time-Based Factors&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Try as you might, but the only criterion that cannot be manipulated in any way is time. Old men and&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;women are often sought for their knowledge and experience. And the price of wine is directly proportional&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;to its age for a reason.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;This is a useful analogy. Because time cannot be cheated, an old site that slowly accumulates links over&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;time and regularly adds new knowledge is what we term “fine wine.” Search engines tend to agree, and&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;give the deserved credit to such fine wines.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Many users previously purchased expired domain names that used to house an older popular web site&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;in the interest of tricking search engines into thinking a site is not new. Search engines are now aware&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;of this practice and reset the “aging-value” of any site that is housed by an expired domain name,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;as well as devalue its preexisting links. In fact, there may also be a penalty applied to such expired&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;domain names, as discussed later in this chapter in the section “The Expired Domain Penalty.” There&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;are still opportunities, however, in buying domains directly from users with old existing web sites.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;The time-based factors that are used as ranking factors are the site and page age, and the age of the links&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;referring to it. The registration length of a domain name may also influence rankings.me may also influence rankings.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;External links&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Quantity of Inbound Links&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;A site with many inbound links is likely to be relevant because many people voted for it by placing the&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;link on their sites. There are some caveats here with regard to whether the links are detected to be part of&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;an artificial link scheme, and quality is also a concern as explained in the next section. However, more is&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;generally better.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Quality of Inbound Links&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;A popular web site that links to you prominently that itself has many inbound links and a good reputation&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;is likely to mean more than a link from a random page from an unimportant web site with few&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;links. There is no absolute definition that describes “quality.” Search engines themselves struggle with&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;this definition and use very complicated algorithms that implement an approximation of the human&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;definition. Use your judgment and intuition.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Relevance of Inbound Links&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;A search engine is likely to view a link from a semantically related web page or site as more valuable than&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;a link from a random unrelated one. Usually, a series of links with very similar anchor text from unrelated&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;sources is an indicator of an artificial link scheme, and they may be devalued. Too many links from irrelevant&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;sources may result in a penalty. This has led to speculation that competitors can hurt your web site&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;by pointing many such links to your web site. Google states in its Webmaster Help Center, however, that&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;there is “almost nothing a competitor can do to harm your ranking or have your site removed from our&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;index” (&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;http://www.google.com/support/webmasters/bin/answer.py?answer=34449&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;). The&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;verdict is out on MSN Live Search, as documented at &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;http://www.seroundtable.com/archives/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;006666.html.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Link Churn&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Links that appear and disappear on pages are likely to be part of a linking scheme. The rate at which&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;these links appear and disappear is termed “link churn.” If this happens frequently, it may be regarded&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;as spam. Those links will either be devalued, or at worst your web site will be regarded as spam and&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;penalized. Unless you are participating in such a scheme, this should probably not be a concern.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Link Acquisition Rate&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;An algorithm may view the acquisition of many thousands of links by a new site as suspicious, if not&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;also accompanied by relevant highly ranked authority sites. Usually this is an indicator of a linking&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;scheme. This consideration was affirmed by Google engineer Matt Cutts in one of his videos at &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;http://&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;u&gt;&lt;a class="western" href="http://www.mattcutts.com/blog/more-seo-answers-on-video/"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;www.mattcutts.com/blog/more-seo-answers-on-video/&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style=""&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Link Anchor Text and Surrounding Copy&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Inbound links that contain semantically related anchor text to the content they point to have a positive&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;effect on rankings. The copy surrounding the link, if present, may also do the same. Some even posit&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;that this copy is as important as the link anchor text itself. Links with such surrounding copy are widely&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;believed to be valued more by search engines, because links without copy surrounding it are frequently&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;purchased and/or less indicative of a vote.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Manipulating link anchor text and the surrounding copy, if done en masse, can be used to manipulate&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;i&gt;search results by creating a phenomenon called “Google bombing” (&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;http://en.wikipedia.org/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;wiki/Google_bomb)&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;i&gt;. One popular example of this is illustrated, at the time of writing, with a&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;query to Yahoo!, Google, or MSN, with the keyword “miserable failure.” The top result is the White&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;House’s official biographical page for President George W. Bush, which doesn’t contain either of the&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;words “miserable” or “failure” in the copy, but is linked from many sites that contain the words&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="color:#000000;"&gt;“&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;i&gt;miserable failure.” This particular Google bomb, and a few related ones, are described at &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;http://&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;en.wikipedia.org/wiki/Miserable_failure&lt;i&gt;.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Reciprocal Links&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;A long time ago, webmasters used to trade links strategically to achieve radical improvements in rankings.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;This created an artificial number of self-serving votes. Over time, search engines became wiser and they&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;devalued such reciprocal links. In response, search engine marketers created link-exchanging schemes with&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;multiple parties to avoid detection. Modern search engines can detect such simple subterfuge as well. That&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;is not to say that reciprocal linking is bad, but it should be balanced by several one-way links as well. The&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;combination of the two models something more natural-looking and will result in higher ranking.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Number of Links on a Page&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;A link on a page with few outbound links is generally worth more than a link on a page with many outbound&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;links. This concept is also implied by the formula for Google’s PageRank.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Semantic Relationship among Links on a Page&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;A search engine may assume that a page with many links to pages that are not semantically related is a&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;links page, or some sort of page designed to manipulate rankings or trade links. It is also believed that&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;even naming a page with the word “links” in it, such as &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;links.php&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;, may actually devalue links contained&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;within that particular page.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; widows: 2; orphans: 2;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;IP Addresses of Cross-Linked Sites&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;It is sometimes useful to think of an IP address as you do a phone number. For this example’s sake, format&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;a hypothetical phone number, (123) 555-1212, differently—as if it were an IP:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;123.555.1212&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;The first number, 123, is the area code, the second, 555, is the exchange, and the third, 1212, is the number&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;within that exchange. The numbers go from most significant to least significant. 123 probably indicates&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="color:#000000;"&gt;“&lt;/span&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;somewhere in this or that state.” 555 means “some county in the state,” and so on. So we can assert that&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;the person answering the phone at 123.555.1212 is in the same neighborhood as 123.555.1213.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Likewise, IP addresses located in the same C class — that is, addresses that match for the first three&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;octets (&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;xxx.xxx.xxx.*&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;) — are very likely to be nearby, perhaps even on the same server.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;When sites are interlinked with many links that come from such similar IP addresses, they will be regarded&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;suspiciously, and those links may be devalued. For example, a link from &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;domainA &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;on &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;100.100.1.1 &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;to&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;domainB &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;on &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;100.100.1.2 &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;is a link between two such sites. Done excessively, this can be an indicator&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;for artificial link schemes meant to manipulate the rankings of those web sites. Matt Cutts affirms that&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Google scrutinizes this sort of interlinking in his video at &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;http://www.mattcutts.com/blog/seoanswers-&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;on-google-video/&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Perhaps you host quite a few sites with similar themed content for whatever reason, and do not wish&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;to worry about this. There are a few vendors that offer hosting in multiple C classes. We don’t have&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;experience working with any of these providers, and do not make any recommendations. This is just&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;a list of hosting services that we’ve found that&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;TLD of Domain Name for a Link&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;It is widely believed that &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;.edu &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;and &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;.gov &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;domain names are less susceptible to manipulation and therefore&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;weighed more heavily. This is disputed by some search engine marketers as the actual factor, and&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;they assert that the same effect may be as a result of the age (most schools and governmental agencies&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;have had sites for a while), and amount of links that they’ve acquired over time. Matt Cutts coincides&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;with this view (&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;http://www.mattcutts.com/blog/another-two-videos/&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;). It is mostly irrelevant,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;however, what the underlying reason is. Getting a link from a site that fits this sort of profile is very&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;desirable — and most &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;.edu &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;and &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;.gov &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;domains do.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Link Location&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Links prominently presented in content near the center of the page may be regarded by the search&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;engines as more important. Links embedded in content presented near the bottom of a page are usually&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;less important; and external links at the bottom of a page to semantically unrelated sites may, at worst,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;be a criterion for spam-detection. Presentation location is different than &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;&lt;i&gt;physical &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;location. The physical&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;location within the document was historically important, but is less of a factor more recently. Ideally, the&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;primary content of a page should be early in the HTML source of a web page, as well as prominently&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;displayed in the center region of a web page. More on this topic is discussed in Chapter 6, “SE-Friendly&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;HTML and JavaScript.”&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Web Standards Compliance&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Standards compliance and cleanliness of code is historically unimportant, but the recent accessibility&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;work may eventually make it become a small ranking factor. That said, Matt Cutts downplays it because&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;40% of the web doesn’t validate (&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;http://www.mattcutts.com/blog/more-seo-answers-on-video/&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Content on &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;google.com &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;itself does not validate, at the moment of writing this text. You can use the W3C&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;"&gt; &lt;span style="font-family:Times NewROman, serif;"&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;Markup Validation Service at &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;http://validator.w3.org/ &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span lang="en-US"&gt;to test your web pages for compliance.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;&lt;i&gt;Detrimental “Red-Flag” Factors&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;Obviously writing spammy content, launching thousands of spammy doorway pages simultaneously, or&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;soliciting spammy links that actually get detected as such are detrimental in nature, but we will not continue&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt; &lt;span style="color:#000000;"&gt;&lt;span style="font-family:Times NewROman, serif;"&gt;in that vein. Some of these factors are discussed in more detail in Chapter 8, “Black Hat SEO.”&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm; line-height: 100%;" lang="en-US"&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/table&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style="font-weight: bold;"&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-6064586941575216707?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/6064586941575216707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/06/search-engine-optimization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/6064586941575216707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/6064586941575216707'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/06/search-engine-optimization.html' title='SEO 1'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-3733211448609437176</id><published>2009-06-22T02:38:00.000-07:00</published><updated>2009-11-16T22:36:04.889-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux/Unix'/><title type='text'>UNIX script Q</title><content type='html'>Long time since any posts...so here is one for all of you who would love to do some unix questions...&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I have a file pattern.txt and another file lines.txt. I want the list of all lines in lines.txt that match any pattern in pattern.txt&lt;/li&gt;&lt;/ul&gt;          The command maybe simple to all of you&lt;br /&gt;            &lt;span style="font-weight: bold;"&gt;grep -f pattern.txt lines.txt&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Here I want the list of all lines in fileA but not in fileB           &lt;/li&gt;&lt;/ul&gt;             &lt;span style="font-weight: bold;"&gt;sort fileA fileB| uniq -u&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Kill all processes by a user&lt;/li&gt;&lt;/ul&gt;            &lt;span style="font-weight: bold;"&gt; kill -9 `ps -u &lt;username&gt; -o "pid="`&lt;br /&gt;&lt;/username&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt; List all files modified last week&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;          f&lt;/span&gt;&lt;span style="font-weight: bold;" class="kw2"&gt;ind&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="font-weight: bold;" class="sy0"&gt;/&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="font-weight: bold;" class="re5"&gt;-mtime&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="font-weight: bold;" class="re5"&gt;-7&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="font-weight: bold;" class="re5"&gt;-print&lt;br /&gt;       +7 will give you more than a week ago&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="re5"&gt;Thanking you&lt;/span&gt;&lt;span style="font-weight: bold;" class="re5"&gt;&lt;span style="font-weight: bold;"&gt;,&lt;br /&gt;Layman&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-3733211448609437176?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/3733211448609437176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/06/unix-script-q.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/3733211448609437176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/3733211448609437176'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/06/unix-script-q.html' title='UNIX script Q'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-3981772922849739139</id><published>2009-05-21T02:37:00.000-07:00</published><updated>2009-11-16T22:36:17.219-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux/Unix'/><title type='text'>Simulate SCP using SSH</title><content type='html'>An interesting question&lt;br /&gt;How to simulate scp using ssh ...&lt;br /&gt;Using the same way you sud be able to run a script in your machine on the remote machine.&lt;br /&gt;&lt;br /&gt;I assume that the reader is aware of what SCP and SSH is.&lt;br /&gt;&lt;br /&gt;Lets try this...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;deepak@deepak-laptop:~$ cat abcd.txt | ssh deepak@jeeves ' cat &gt; abcd.txt;chmod 0777 abcd.txt;./abcd.txt;'&lt;/span&gt;&lt;div style="font-weight: bold;" class="im"&gt;&lt;br /&gt;deepak@jeeves's password:&lt;br /&gt;abcd.txt&lt;br /&gt;Desktop&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;Thu May 21 14:40:58 IST 2009&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;/home/deepak&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; jeeves&lt;/span&gt;&lt;div style="font-weight: bold;" class="im"&gt;&lt;br /&gt;deepak@deepak-laptop:~$ cat abcd.txt&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;ls&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;date&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;pwd&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;hostname&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;deepak@deepak-laptop:~$&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;So how does this work...&lt;br /&gt;The cat wud obviously get the contents of the file and pipe it to the STDIN of the remote system.&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;At the remote system the cat would redirect the contents of STDIN into the file (thereby creating the file) and then changing its permissions and then executing it.&lt;br /&gt;Simple enough but not easy to find at once.&lt;br /&gt;&lt;br /&gt;Other recommended scripts would be&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;cat abcd.txt | ssh deepak@jeeves ' cat -|bash'  # remote exec of command&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;cat abcd.txt | ssh deepak@jeeves ' cat  &gt; filename' #  scp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Thanking you&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-3981772922849739139?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/3981772922849739139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/05/simulate-scp-using-ssh.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/3981772922849739139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/3981772922849739139'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/05/simulate-scp-using-ssh.html' title='Simulate SCP using SSH'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-4392408189763271671</id><published>2009-05-20T03:37:00.000-07:00</published><updated>2009-11-16T22:36:41.208-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Image Processing'/><title type='text'>Learn to morph</title><content type='html'>People look at morphing as a satanic act. To me , I feel there is nothing like that. I've loved morphing ever since I learned to do it. I have done many morphs which finally had some quality in it. I've loved outputs...results have always been my passion. So I guess thats one of the many reasons why I learned it. Later I gave up the act for a loved one. So here Iam to teach you how to morph...&lt;br /&gt;&lt;br /&gt;You would either be on windows or linux . On windows I'm guess you would be using photoshop, and for all those linux users I would recommend using GIMP. I'm using GIMP to demonstrate this to you.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Get the 2 pics and open them in gimp&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShQMS4soVcI/AAAAAAAAADM/sF-x2f3LqLA/s1600-h/Screenshot.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShQMS4soVcI/AAAAAAAAADM/sF-x2f3LqLA/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5337904976937637314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Use the scissor tool to cut out the face of the person&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQMnSS_NxI/AAAAAAAAADU/Nk652iqU31w/s1600-h/Screenshot-1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQMnSS_NxI/AAAAAAAAADU/Nk652iqU31w/s400/Screenshot-1.png" alt="" id="BLOGGER_PHOTO_ID_5337905327406790418" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Select the face&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQM5qZ-fPI/AAAAAAAAADk/bB1XCBkney4/s1600-h/Screenshot-2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQM5qZ-fPI/AAAAAAAAADk/bB1XCBkney4/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5337905643116199154" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQM-OiwcPI/AAAAAAAAADs/OQMkXE0ap_4/s1600-h/Screenshot-3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQM-OiwcPI/AAAAAAAAADs/OQMkXE0ap_4/s400/Screenshot-3.png" alt="" id="BLOGGER_PHOTO_ID_5337905721536180466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Cut the face and paste it on a new transparent background page&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_7hm9npg_Mzo/ShQNEfdRWpI/AAAAAAAAAD0/B7qUrGdf1KA/s1600-h/Screenshot-4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_7hm9npg_Mzo/ShQNEfdRWpI/AAAAAAAAAD0/B7qUrGdf1KA/s400/Screenshot-4.png" alt="" id="BLOGGER_PHOTO_ID_5337905829155789458" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Remove the unwanted areas of the image&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7hm9npg_Mzo/ShQNIXykKqI/AAAAAAAAAD8/7DXt0SAzx_s/s1600-h/Screenshot-5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_7hm9npg_Mzo/ShQNIXykKqI/AAAAAAAAAD8/7DXt0SAzx_s/s400/Screenshot-5.png" alt="" id="BLOGGER_PHOTO_ID_5337905895817095842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Cut a small portion from the image (of arnie)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQNOQG3z4I/AAAAAAAAAEE/DrmMmnTuDMY/s1600-h/Screenshot-6.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQNOQG3z4I/AAAAAAAAAEE/DrmMmnTuDMY/s400/Screenshot-6.png" alt="" id="BLOGGER_PHOTO_ID_5337905996834000770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Paste it over the face of the image&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQNSZsD3tI/AAAAAAAAAEM/6fX81HmnCwo/s1600-h/Screenshot-7.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQNSZsD3tI/AAAAAAAAAEM/6fX81HmnCwo/s400/Screenshot-7.png" alt="" id="BLOGGER_PHOTO_ID_5337906068125376210" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShQNW5qMwwI/AAAAAAAAAEU/PySeR5iT2Fc/s1600-h/Screenshot-8.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShQNW5qMwwI/AAAAAAAAAEU/PySeR5iT2Fc/s400/Screenshot-8.png" alt="" id="BLOGGER_PHOTO_ID_5337906145426981634" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Go to the layers window and select overlay. This will help you to match the color of the 2 images&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQNfnJOzVI/AAAAAAAAAEk/b_xJlfUGhAI/s1600-h/Screenshot-10.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShQNfnJOzVI/AAAAAAAAAEk/b_xJlfUGhAI/s400/Screenshot-10.png" alt="" id="BLOGGER_PHOTO_ID_5337906295075687762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Copy and paste the new image onto arnie&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_7hm9npg_Mzo/ShQNprzcxbI/AAAAAAAAAE0/qt3DQsVQEDg/s1600-h/Screenshot-12.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_7hm9npg_Mzo/ShQNprzcxbI/AAAAAAAAAE0/qt3DQsVQEDg/s400/Screenshot-12.png" alt="" id="BLOGGER_PHOTO_ID_5337906468125197746" border="0" /&gt;&lt;/a&gt;Scale the image suitably to match the head size of arnie&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShQNkQN6uqI/AAAAAAAAAEs/r4DCgFX46wc/s1600-h/Screenshot-11.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShQNkQN6uqI/AAAAAAAAAEs/r4DCgFX46wc/s400/Screenshot-11.png" alt="" id="BLOGGER_PHOTO_ID_5337906374820674210" border="0" /&gt;&lt;/a&gt;Use the smudge, blur and sharpen tools suitably to give the image a good look&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShQNuAi3ycI/AAAAAAAAAE8/E7zeAsxm8-0/s1600-h/Screenshot-13.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShQNuAi3ycI/AAAAAAAAAE8/E7zeAsxm8-0/s400/Screenshot-13.png" alt="" id="BLOGGER_PHOTO_ID_5337906542412286402" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The final image is ready&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShTqnqORzmI/AAAAAAAAAFM/gLA-sIvd3JQ/s1600-h/Arnold-Schwarzenegger.jpg"&gt;&lt;img style="cursor: pointer; width: 326px; height: 400px;" src="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShTqnqORzmI/AAAAAAAAAFM/gLA-sIvd3JQ/s400/Arnold-Schwarzenegger.jpg" alt="" id="BLOGGER_PHOTO_ID_5338149425410854498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This doesnt look really good , I know, but I couldn't spend more time on this. If you would like to know more about morphing pls comment with your gtalk usernames.&lt;br /&gt;&lt;br /&gt;I would have loved to show you how good I'm at this but I'm sorry blogger doesn't allow explicit images :p  ;) . So please bear with me.&lt;br /&gt;&lt;br /&gt;Thanking you&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-4392408189763271671?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/4392408189763271671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/05/learn-to-morph.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/4392408189763271671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/4392408189763271671'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/05/learn-to-morph.html' title='Learn to morph'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_7hm9npg_Mzo/ShQMS4soVcI/AAAAAAAAADM/sF-x2f3LqLA/s72-c/Screenshot.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-1307695703272553602</id><published>2009-05-19T03:32:00.000-07:00</published><updated>2009-11-16T22:36:56.363-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General programming'/><title type='text'>Enhanced public key cryptography</title><content type='html'>&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;I'm sure all of us would have heard about public key cryptography. Here I would like to propose a new idea which I suppose would enhance public key cryptography. This paper is no mumbo-jumbo. Its  very simple and surprising. Please have a look and let me know...&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;AI'm sure all of us would have heard about public key cryptography. Here I would like to propose a new idea which I suppose would enhance public key cryptography. This paper is no mumbo-jumbo. Its very simple and surprising. Please have a look and let me know...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Definitions&lt;/span&gt;&lt;br /&gt;Cipher - a cryptographic algorithm used to encrypt and decrypt files&lt;br /&gt;and messages.&lt;br /&gt;Ciphertext - the disguised (or encrypted) file or message.&lt;br /&gt;Code - the usage of characters or words to represent words,&lt;br /&gt;sentences, or ideas. Morse code is a common example, where&lt;br /&gt;combinations of dots and dashes represent letters and numbers.&lt;br /&gt;Cryptanalysis - the art of breaking cryptosystems. The process of&lt;br /&gt;looking for errors or weaknesses in the implementation of an&lt;br /&gt;algorithm or of the algorithm itself.&lt;br /&gt;Cryptography - the art of creating and using cryptosystems.&lt;br /&gt;Cryptology - the study of both cryptography and cryptanalysis.&lt;br /&gt;Cryptosystem - the entire process of using cryptography. This&lt;br /&gt;includes the actions of encrypting and decrypting a file or message, or&lt;br /&gt;authenticating the sender of an e-mail message.&lt;br /&gt;Key - a collection of bits,usually stored in a file, which is used to encrypt or decrypt a message.&lt;br /&gt;Plaintext - the original message or file. After a file or message has been encrypted and then decrypted you should end up with the original file or message.Private Key - the secret key of a public-private key cryptography system. This key is used to "sign" outgoing messages, and is used to decrypt incoming messages.&lt;br /&gt;Public Key - the public key of a public-private key cryptography system. This key is used to confirm "signatures" on incoming messages or to encrypt a file or message so that only the holder of the private key can decrypt the file or message.&lt;br /&gt;Public-private Key Cryptography System - a cryptography system that uses two different keys to lock and unlock (encrypt and decrypt) messages and files. The two keys are mathematically linked together. An individual's public key is distributed to other users and is used to encrypt messages to the individual. The individual keeps the private key secret and uses it to decrypt messages sent with the public key.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Enhanced public key cryptography : A proposition&lt;/span&gt;&lt;br /&gt;We have seen that even a public key system with n users would need 2*n number of keys to be stored. It may not seem very large for small systems. But as the value of n increases the size of the database also grows. This in fact slows down the system. Efficiency of the system decreases. As we have already discussed our concern is to   further reduce the size of the data base. The basic idea is that we don't need to store the private key into the database. We would rather express the private key as a function of the public key. Private key = f (Public key) The first time a user registers to the system , the user is asked to enter his desired user name. Once he enters a user name (that doesn't exist already) , the system supplies him with a password. This password cannot be changed by the user in future. The password or rather the private key is calculate as a function of the public key. The function maybe to&lt;br /&gt;simply add the ASCII values of characters used in the public key and then give the result of computation as the private key or password. So each time a user wants to login,he is required to enter his user name and password. The system calculates the original password for the user name as f(user name). Then the system checks whether f(user name),and the entered password matches. If they match the user can connect to the system. Otherwise he is not allowed to connect. So the basic idea is to calculate the real password from the user name applying the function and then match it with the password entered by the user. The advantage here is that for n users we need to store only n entries of use names. No password is stored.&lt;br /&gt;However there is one serious disadvantage for this system. If a cryptanalyst gets a number of combinations of the user names and passwords he may succeed in finding the transformation performed by the function 'f(user name)'. If that happens he will be able to get the passwords for each and every user. Then the system fails completely. To avoid such a failure what we do is that we use a number of&lt;br /&gt;functions rather than a single function. So the cryptanalyst can't find any similarity in the way the passwords are generated . The function used to calculate the password for a user depends on the position of the user name in the database. We shall consider an example. Suppose there are n users already registered in the database and there are m distinct functions available in the system to calculate the&lt;br /&gt;value of the password from the user name. A new user wants to register to the system. The desired user name is 'abcn1'. Then the system writes his user name at the end of the database. So position of the new user will be n+1. We then calculate the (n+1)th number in the Fibonacci series. Say the number is p. We perform p%m ( where m is the number of functions the system uses to calculate the passwords&lt;br /&gt;from the user name). We know that 0 &lt;= p%m &lt;&gt; &lt;m returns="" between="" 0="" use="" index="" equal="" calculate="" since="" insertions="" are="" always="" occurring="" at="" end="" computed="" p="" remains="" constant="" each="" compute="" password="" doesn="" function="" calculating="" different="" users="" differ="" according="" no="" cryptanalyst="" find="" out="" thus="" has="" reduced="" stored="" it="" guarantees="" security="" method="" store="" functions="" be="" used="" and="" names="" n="" as="" value="" m="" increases="" more="" random="" passwords="" trade="" there="" one="" important="" need="" for="" name="" shouldn="" what="" happens="" user="" deletes="" his="" account="" an="" database="" will="" remaining="" solution="" to="" can="" simply="" invalidate="" rather="" than="" deleting="" from="" but="" then="" if="" goes="" on="" large="" number="" entries="" might="" occur="" in="" this="" is="" modify="" insertion="" procedure="" next="" time="" a="" new="" entry="" overwrites="" position="" of="" other="" records="" don="" t="" also="" managed="" invalid="" space="" so="" all="" the="" issues="" we="" dealt="" with="" have="" been="" successfully=""&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;EPKC vs PCK&lt;/span&gt;&lt;br /&gt;PCK uses the inefficient linear search for retrieving the username and password(ie the public and private keys of a user). Linear search efficieny is O(n). So this is considered inefficient. Sometimes its possible to use binary search to improve the search times. But then, sorting must be done during insertion. This is a tedious process. This will lead to greater insertion times. Thus still inefficient.&lt;br /&gt;Now lets see about the proposed EPCK. Here search (or rather calculation )is done via a hashing. Once the key pairs are entered by the user to login, the system can use a hashing process to retrieve the function to calculate the private key. Then this function can map the public key to the private key in a unique way. It's well known that hashing process has a search time of O(1). There are some additional processes done before and after hashing. Considering all these processes we can sum up that EPCK search times is by all means comparable to PCK. In terms of space efficiency PCK is far behind EPCK. PCK is 50%(nearly) more space efficient. This is because in EPCK we don't store the private key of the users. And in terms of security domain. In PCK we would need to secure the database using strong firewalls. This means additional cost. Still it's not possible to be sure of 100% security. In the age of systems like the bruteforce we cant rely on any security providers. EPCK since they&lt;br /&gt;don't need to store any private key don't need any protection to the database. Maybe a small amount of write protection can be done. Thus EPCK is more space efficient than PCK. Also its less expensive than PCK.&lt;br /&gt;&lt;br /&gt;&lt;/m&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShKTQ8y2-SI/AAAAAAAAADE/gQ3N-jRCLgo/s1600-h/Untitled.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://2.bp.blogspot.com/_7hm9npg_Mzo/ShKTQ8y2-SI/AAAAAAAAADE/gQ3N-jRCLgo/s400/Untitled.png" alt="" id="BLOGGER_PHOTO_ID_5337490427794094370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;                                    This is a picture of an EPCK database.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The proposed system requires lesser memory space(half the memory space) compared to public key systems without compromising the security of the system. Thus the efficiency of the communication system will improve tremendously,without sacrificing the security of the system.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanking you&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-1307695703272553602?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/1307695703272553602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/05/enhanced-public-key-cryptography.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/1307695703272553602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/1307695703272553602'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/05/enhanced-public-key-cryptography.html' title='Enhanced public key cryptography'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_7hm9npg_Mzo/ShKTQ8y2-SI/AAAAAAAAADE/gQ3N-jRCLgo/s72-c/Untitled.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1720439187228738899.post-2279645428256404840</id><published>2009-05-19T02:35:00.000-07:00</published><updated>2009-11-16T22:37:09.567-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Language interpreter</title><content type='html'>Its been some time since I was struck with this idea of an mini-language interpreter.&lt;br /&gt;I started imagining it in the lines of an interpreter that could possibly understand scripts similar to the those written it the traditional bash shell scripts.&lt;br /&gt;The work took some time. I choose perl to build the interpreter. The reason is obvious . The first reason was that I'd learned perl , and I wanted to use it somewhere. Second reason was that it was easier to do pattern matching in perl. So I started with what I call now the "Language Interpreter developed in perl". I'd initially scanned the web for  tutorials that could help me on the project. I couldn't find any. I failed to find any documents on the web in a similar line. So after doing a fair amount of work and obtaining reasonable amount of results I thought I should post this on the web. So here it is...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;#!/usr/bin/perl -w&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;while(&lt;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    chomp($_);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    if($_)    {match1($_);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;}    &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;sub match1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    $_=$_[0];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;     if(/^while\(([^\)]*)\){(.*)}$/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    {    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        #print "\nstat1 :",$1," ",$2,"\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        $_=$1; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $statements=$2;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if(/^([a-zA-Z][a-zA-Z0-9]*)([&lt;&gt;=!]*)([a-zA-Z0-9]+)$/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $lhs=symtabretrieve($1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $op=match($2);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $rhs=match($3);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $idl=$1;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $idr=$3;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($rhs==8)    {$rhs=symtabretrieve($3);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($rhs==1) {$rhs=$3;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($op==2) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;         {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        while($lhs&lt;$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($op==3)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        while($lhs&gt;$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($op==4)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        while($lhs&gt;=$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($op==5)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        while($lhs&lt;=$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($op==6)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        while($lhs==$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($op==7)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        while($lhs!=$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        return;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;                        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^if\(([^\)]*)\){(.*)}$/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        #print "\nstat2 :",$1," ",$2,"\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        $_=$1;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $statements=$2;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if(/^([a-zA-Z][a-zA-Z0-9]*)([&lt;&gt;=!]*)([a-zA-Z0-9]+)$/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $lhs=symtabretrieve($1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $op=match($2);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $rhs=match($3);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $idl=$1;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $idr=$3;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($rhs==8)    {$rhs=symtabretrieve($3);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($rhs==1)    {$rhs=$3;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($op==2)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($lhs&lt;$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;             if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1) {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($op==3)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($lhs&gt;$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($op==4)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($lhs&gt;=$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($op==5)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($lhs&lt;=$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($op==6)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($lhs==$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        elsif($op==7)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($lhs!=$rhs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($statements) {match1($statements);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $lhs=symtabretrieve($idl);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $rhs=match($idr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($rhs==8)    {$rhs=symtabretrieve($idr);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            elsif($rhs==1)    {$rhs=$idr;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }    &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        return;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;     elsif(/^([a-zA-Z][a-zA-Z0-9]*)=([a-zA-Z0-9]+)$/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        #print "\nstat3 :",$1," ",$2,"\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        syminsert($1,$2);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        return;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^([a-zA-Z][a-zA-Z0-9]*\[[0-9][0-9]*\])=([a-zA-Z0-9]+)$/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        #print "\nstat4 :",$1," ",$2,"\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;         syminsert($1,$2);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;         return;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^([a-zA-Z][a-zA-Z0-9]*)=([a-zA-Z0-9]+)([p\+\-\*\/\%])([a-zA-Z0-9]+)$/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;         #print "\nstat5 :",$1," ",$2,"\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;         if(match($2)==1)        {$frstopd=$2;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;         else                 {$frstopd=symtabretrieve($2);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;         if(match($4)==1)        {$scndop=$4;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;         else                {$scndop=symtabretrieve($4);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;         $op=match($3);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;         if($op==9)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        $val=$frstopd+$scndop;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        syminsert($1,$val);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($op==10)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        $val=$frstopd-$scndop;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        syminsert($1,$val);    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($op==11)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        $val=$frstopd*$scndop;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        syminsert($1,$val);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($op==12)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        $val=$frstopd/$scndop;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        syminsert($1,$val);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($op==13)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        $val=$frstopd+$scndop;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        syminsert($1,$val);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        return;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^echo \$([a-zA-Z0-9]+)\[\$?([a-zA-Z0-9][a-zA-Z0-9]*)\]$/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        #print "\nstat6 :",$1," ",$2,"\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        $index=symtabretrieve($2);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($index==undef)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        $index=$1."[".$2."]";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        print symtabretrieve($index);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        $pr=$1."[".$index."]";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        print symtabretrieve($pr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        print "\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        return;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^echo \$([a-zA-Z0-9]+)$/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        #print "\nstat7 :",$1,"\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        print symtabretrieve($1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        print "\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        return;        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^echo ([^;]*)$/)    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        #print "\nstat8 :",$1,"\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        print $1;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        print "\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        return;            &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^if/ || /^while/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    {    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if(/^(.*});(.*)/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        {    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            my @temp=split(//,$1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            my $c=$2;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            my $a="";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            my $b="";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            my $char='';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            my $count=1;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            while(@temp)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $char=shift(@temp);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            $a.=$char;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($char eq '{')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;                while($count)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;                {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;                $char=shift(@temp);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;                $a.=$char;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;                if($char eq '{')    {$count++;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;                elsif($char eq '}')    {$count--;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if(!$count)    {$b=join('',@temp); @temp=();}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            #print "\nstat9 :A:",$a," B:",$b," C:",$c,"\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($a) {match1($a);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($b) {match1($b);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;            if($c) {match1($c);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        return;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^(.*?);(.*)$/)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        #print "\nstat10 :A",$1," B:",$2,"\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        my $a=$1; my $b=$2;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($a) {match1($a);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        if($b) {match1($b);}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;        return;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;}    &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;sub match&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    $_=$_[0];    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    if(/^[0-9]+$/)            {return 1;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^&lt;$/)            {return 2;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^&gt;$/)            {return 3;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^&gt;=$/)            {return 4;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^&lt;=$/)            {return 5;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^==$/)            {return 6;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^!=$/)            {return 7;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^[a-zA-Z0-9]+/)        {return 8;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^\+/)            {return 9;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^\-/)            {return 10;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^\*/)            {return 11;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^\//)            {return 12;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    elsif(/^\%/)            {return 13;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    else                {return 0;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;sub syminsert&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    $symtab{$_[0]}=$_[1];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;sub symtabretrieve&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;    return $symtab{$_[0]};&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="font-family:times new roman;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShKCwrqkQRI/AAAAAAAAACY/wyXxRqJMqbs/s1600-h/Screenshot.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShKCwrqkQRI/AAAAAAAAACY/wyXxRqJMqbs/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5337472281254052114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShKDpgRo9BI/AAAAAAAAACo/XBDNbjjUDOw/s1600-h/Screenshot-1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_7hm9npg_Mzo/ShKDpgRo9BI/AAAAAAAAACo/XBDNbjjUDOw/s400/Screenshot-1.png" alt="" id="BLOGGER_PHOTO_ID_5337473257449255954" border="0" /&gt;&lt;/a&gt;The results I should say is only a miniature version of the project. And the code isn't fully shown. Your comments would be greatly appreciated.&lt;br /&gt;&lt;br /&gt;Thanking you,&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Layman&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1720439187228738899-2279645428256404840?l=myexps.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myexps.blogspot.com/feeds/2279645428256404840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myexps.blogspot.com/2009/05/language-interpreter.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/2279645428256404840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1720439187228738899/posts/default/2279645428256404840'/><link rel='alternate' type='text/html' href='http://myexps.blogspot.com/2009/05/language-interpreter.html' title='Language interpreter'/><author><name>Deepak</name><uri>http://www.blogger.com/profile/15932953408993276139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_7hm9npg_Mzo/SyIB6BlWmoI/AAAAAAAAAFY/qmLCWg7xt64/S220/Image097.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_7hm9npg_Mzo/ShKCwrqkQRI/AAAAAAAAACY/wyXxRqJMqbs/s72-c/Screenshot.png' height='72' width='72'/><thr:total>1</thr:total></entry></feed>
