<?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-6123761814409153571</id><updated>2012-01-23T09:28:00.501-08:00</updated><category term='Python'/><category term='Scipy'/><category term='Parse Tree'/><category term='MySQL'/><category term='Installing'/><category term='Install'/><category term='Numpy'/><category term='Web framework'/><category term='ajax'/><category term='Php'/><category term='Compiler Design'/><category term='django book'/><category term='Cakephp'/><category term='Snow Leopard'/><title type='text'>lets share the knowledge</title><subtitle type='html'>Lets share the technical information to widen our horizon</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-6471157132830948280</id><published>2010-08-10T22:22:00.000-07:00</published><updated>2010-08-10T22:31:52.066-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Installing'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Installing  MySQL-python in Snow Leopard</title><content type='html'>&lt;code&gt;&lt;div&gt;Here are the steps for installing MySQL-python in Snow leopard:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Untar downloaded Mysql-Python&lt;/code&gt;&lt;div&gt;&lt;code&gt;cd [Mysql-Python path]&lt;untarred&gt;&lt;br /&gt;export PATH=/usr/local/mysql:$PATH&lt;br /&gt;sudo ARCHFLAGS='-arch x86_64' python setup.py build&lt;br /&gt;sudo ARCHFLAGS='-arch x86_64' python setup.py install&lt;/untarred&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:monospace, serif;font-size:100%;"&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:monospace, serif;font-size:100%;"&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;FYI: I have tested the installation in Python2.6.5&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:monospace, serif;font-size:100%;"&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:monospace, serif;font-size:100%;"&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;Enjoy&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-6471157132830948280?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/6471157132830948280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=6471157132830948280' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/6471157132830948280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/6471157132830948280'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2010/08/installing-mysql-python-in-snow-leopard.html' title='Installing  MySQL-python in Snow Leopard'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-4871760340412642910</id><published>2010-08-03T00:10:00.000-07:00</published><updated>2010-08-03T04:13:51.323-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Snow Leopard'/><category scheme='http://www.blogger.com/atom/ns#' term='Install'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='Numpy'/><category scheme='http://www.blogger.com/atom/ns#' term='Scipy'/><title type='text'>Installing Scipy, Numpy  and Matplotlib in Snow Leopard</title><content type='html'>I had trouble installing Scipy in my Macbook(SnowLeopard). After googling, I endup into the site &lt;a href="http://bit.ly/baCJUY"&gt;http://bit.ly/baCJUY&lt;/a&gt; .It solved my problem. Here is how i did it in simple way.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Run the &lt;a href="http://www.python.org/ftp/python/2.6.4/python-2.6.4_macosx10.3.dmg" class="liexternal"&gt;Python 2.6.4 installer&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Run the &lt;a href="http://sourceforge.net/projects/numpy/files/NumPy/1.3.0/numpy-1.3.0-py2.6-macosx10.5.dmg/download" class="liexternal"&gt;NumPy 1.3.0 installer&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Run the &lt;a href="http://sourceforge.net/projects/scipy/files/scipy/0.7.1/scipy-0.7.1-py2.6-python.org.dmg/download" class="liexternal"&gt;SciPy 0.7.1 installer.&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Actual Source: &lt;a href="http://bit.ly/bGSgBa"&gt;http://bit.ly/bGSgBa&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To install Matplotlib  download matplotlib from &lt;a href="http://www.cgl.ucsf.edu/Outreach/pc204/matplotlib.html"&gt;here&lt;/a&gt;. Install the downloaded package and enjoy python scientific toolkits :) .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-4871760340412642910?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/4871760340412642910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=4871760340412642910' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/4871760340412642910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/4871760340412642910'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2010/08/installing-scipy-and-numpy-in-snow.html' title='Installing Scipy, Numpy  and Matplotlib in Snow Leopard'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-166353643825582107</id><published>2010-07-09T03:34:00.000-07:00</published><updated>2010-07-09T03:40:22.188-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Parse Tree'/><category scheme='http://www.blogger.com/atom/ns#' term='Compiler Design'/><title type='text'>Experssion, Term and Item</title><content type='html'>Every time i study about Parse tree  (Compiler deisgn/Theory of compuatation), I get confused what expression, term and item actually means. So i am blogging for my reference and hope it  will be useful to others too.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An expression is a sum (with + or -) of terms.&lt;/li&gt;&lt;li&gt;A term is a product (with * or /) of items. &lt;/li&gt;&lt;li&gt;An item is either a number, or a variable name, or an expression enclosed in parentheses.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-166353643825582107?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/166353643825582107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=166353643825582107' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/166353643825582107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/166353643825582107'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2010/07/experssion-term-and-item.html' title='Experssion, Term and Item'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-7201029142775218521</id><published>2008-12-31T22:59:00.000-08:00</published><updated>2008-12-31T23:16:47.681-08:00</updated><title type='text'>Generalized Producer-Consumer solution using Semaphore</title><content type='html'>&lt;div align="justify"&gt;The &lt;b&gt;producer-consumer&lt;/b&gt; problem is a classical example of a multi-process synchronization&lt;u&gt;&lt;a href="http://en.wikipedia.org/wiki/Synchronization_%28computer_science%29" title="Synchronization (computer science)"&gt;&lt;/a&gt;&lt;/u&gt; problem. It illustrates the need for synchronization in systems where many processes share a resource. The problem describes two processes, the producer and the consumer, who share a common, fixed-size buffer. The producer's job is to generate a piece of data, put it into the buffer and start again. At the same time the consumer is consuming the data (i.e. removing it from the buffer) one piece at a time. The problem is to make sure that the producer won't try to add data into the buffer if it's full and that the consumer won't try to remove data from an empty buffer.&lt;br /&gt;&lt;br /&gt;Here, the problem is generalized to have multiple producers and consumers. The solution to these type of problem must assure three constraints&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;ol&gt;&lt;li&gt;Mutual exclusion&lt;/li&gt;&lt;li&gt;Free from Deadlock &lt;/li&gt;&lt;li&gt;Free from Starvation&lt;/li&gt;&lt;/ol&gt;&lt;b&gt;Pseudo-code&lt;/b&gt; for the solution to multiple producer- consumer problem is given below.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;Semaphore &lt;span style="color: rgb(187, 96, 213);"&gt;fullBuffer &lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; 0; // Initially, no item in buffer&lt;br /&gt;Semaphore &lt;span style="color: rgb(187, 96, 213);"&gt;emptyBuffers &lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; numBuffers; // Initially, num empty buffer&lt;br /&gt;Semaphore &lt;span style="color: rgb(187, 96, 213);"&gt;mutex &lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; 1;      // No thread updating the buffer&lt;br /&gt;Producer(item) &lt;span style="color: rgb(102, 102, 102);"&gt;{&lt;/span&gt;&lt;br /&gt;  emptyBuffers.P(); // Wait &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;until &lt;/span&gt;space&lt;br /&gt;  mutex.P();        // Wait &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;until &lt;/span&gt;buffer free&lt;br /&gt;  Enqueue(item);&lt;br /&gt;  mutex.V();&lt;br /&gt;  fullBuffers.V();  // Tell consumers there is data in buffer&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;}&lt;/span&gt;&lt;br /&gt;Consumer() &lt;span style="color: rgb(102, 102, 102);"&gt;{&lt;/span&gt;&lt;br /&gt;  fullBuffers.P();&lt;br /&gt;  mutex.P();&lt;br /&gt;  item &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; Dequeue();&lt;br /&gt;  mutex.V();&lt;br /&gt;  emptyBuffers.V();&lt;br /&gt;  &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;return &lt;/span&gt;item;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div align="justify"&gt;The mutex lock is used to ensure that only one process will be accessing the buffer at a time,this protect the Queue data structure (a shared buffer) from being damaged. If the mutex lock is not used then the concurrent process can manipulate the head and tail pointer associated with the buffer in undesired way. The emptyBuffers and fullBuffer are the semaphore specifying the no of the empty buffers and fullbuffer available respectively.&lt;br /&gt;&lt;br /&gt;The code implementing the given pseudo-code is shown below:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; * main.c&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *  Created on: Dec 31, 2008&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *      Author: Suvash Sedhain&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *  Multiple producer and Multiple consumer solution using Semaphores&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *      Note: semaphore.P() is actually sem_wait() and semaphore.V() is sem_post()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *      as defined in semaphore.h&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *      Ref:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *      - Operating System Concepts : Abraham Silberschatz, Peter Baer Galvin, Greg Gagne&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *      - Operating Systems, William Stallings&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *      - Professor John D. Kubiatowicz lectures notes, University of California, Berkeley&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *        website: http://inst.eecs.berkeley.edu/~cs162&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;#&lt;/span&gt;include &lt;span style="color: rgb(102, 102, 102);"&gt;&lt;&lt;/span&gt;stdlib.h&lt;span style="color: rgb(102, 102, 102);"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;#&lt;/span&gt;include &lt;span style="color: rgb(102, 102, 102);"&gt;&lt;&lt;/span&gt;pthread.h&lt;span style="color: rgb(102, 102, 102);"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;#&lt;/span&gt;include &lt;span style="color: rgb(102, 102, 102);"&gt;&lt;&lt;/span&gt;semaphore.h&lt;span style="color: rgb(102, 102, 102);"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;#&lt;/span&gt;include &lt;span style="color: rgb(102, 102, 102);"&gt;&lt;&lt;/span&gt;unistd.h&lt;span style="color: rgb(102, 102, 102);"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;#&lt;/span&gt;include &lt;span style="color: rgb(102, 102, 102);"&gt;&lt;&lt;/span&gt;stdio.h&lt;span style="color: rgb(102, 102, 102);"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;#&lt;/span&gt;define &lt;span style="color: rgb(102, 102, 102);"&gt;BUFFER&lt;/span&gt;_SIZE &lt;span style="color: rgb(64, 160, 112);"&gt;5&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;const&lt;/span&gt; int &lt;span style="color: rgb(102, 102, 102);"&gt;MAX&lt;/span&gt;_PRODUCER &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;20&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;const&lt;/span&gt; int &lt;span style="color: rgb(102, 102, 102);"&gt;MAX&lt;/span&gt;_CONSUMER &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;20&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;// information to maintain the circular queue data structure&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;&lt;/span&gt;int head &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;int tail &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;//shared buffer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;&lt;/span&gt;int buffer&lt;span style="color: rgb(102, 102, 102);"&gt;[BUFFER&lt;/span&gt;_SIZE];&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;// mutex lock for buffer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;&lt;/span&gt;pthread_mutex_t mutex&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;  &lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;//semaphores for specifying the empty and full&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;&lt;/span&gt;sem_t emptyBuffers&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;sem_t fullBuffer&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;//initialze the locks&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;&lt;/span&gt;void initialize_locks()&lt;br /&gt;{&lt;br /&gt;    pthread_mutex_init(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;mutex&lt;span style="color: rgb(102, 102, 102);"&gt;,NULL&lt;/span&gt;);&lt;br /&gt;    sem_init(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;emptyBuffers&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(64, 160, 112);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(64, 160, 112);"&gt;5&lt;/span&gt;);&lt;br /&gt;    sem_init(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;fullBuffer&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(64, 160, 112);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(64, 160, 112);"&gt;0&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;// Produce random value to shared buffer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;&lt;/span&gt;void &lt;span style="color: rgb(102, 102, 102);"&gt;*&lt;/span&gt;producer(void &lt;span style="color: rgb(102, 102, 102);"&gt;*&lt;/span&gt;param)&lt;br /&gt;{&lt;br /&gt;  int item&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;  while&lt;/span&gt;(&lt;span style="color: rgb(64, 160, 112);"&gt;1&lt;/span&gt;)&lt;br /&gt;  {&lt;br /&gt;      item &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; rand();&lt;br /&gt;      sem_wait(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;emptyBuffers);&lt;br /&gt;      pthread_mutex_lock(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;mutex);&lt;br /&gt;      buffer&lt;span style="color: rgb(102, 102, 102);"&gt;[&lt;/span&gt;tail] &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; item &lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;      tail &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; (tail&lt;span style="color: rgb(102, 102, 102);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(64, 160, 112);"&gt;1&lt;/span&gt;) &lt;span style="color: rgb(102, 102, 102);"&gt;%&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102);"&gt;BUFFER&lt;/span&gt;_SIZE&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;      printf (&lt;span style="color: rgb(64, 112, 160);"&gt;"producer: inserted %d \n"&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt; item);&lt;br /&gt;      fflush (stdout);&lt;br /&gt;      pthread_mutex_unlock(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;mutex);&lt;br /&gt;      sem_post(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;fullBuffer);&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;  printf (&lt;span style="color: rgb(64, 112, 160);"&gt;"producer quiting\n"&lt;/span&gt;);  fflush (stdout);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;//consume values from the shared buffer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;&lt;/span&gt;void &lt;span style="color: rgb(102, 102, 102);"&gt;*&lt;/span&gt;consumer(void &lt;span style="color: rgb(102, 102, 102);"&gt;*&lt;/span&gt;param)&lt;br /&gt;{&lt;br /&gt;   int item&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;while&lt;/span&gt; (&lt;span style="color: rgb(64, 160, 112);"&gt;1&lt;/span&gt;)&lt;br /&gt;   {&lt;br /&gt;       sem_wait(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;fullBuffer);&lt;br /&gt;       pthread_mutex_lock(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;mutex);&lt;br /&gt;       item &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; buffer&lt;span style="color: rgb(102, 102, 102);"&gt;[&lt;/span&gt;head];&lt;br /&gt;       head &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; ( head &lt;span style="color: rgb(102, 102, 102);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;1&lt;/span&gt;) &lt;span style="color: rgb(102, 102, 102);"&gt;%&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102);"&gt;BUFFER&lt;/span&gt;_SIZE&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;       printf (&lt;span style="color: rgb(64, 112, 160);"&gt;"consumer: removed %d \n"&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt; item);&lt;br /&gt;       fflush (stdout);&lt;br /&gt;       pthread_mutex_unlock(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;mutex);&lt;br /&gt;       sem_post(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;emptyBuffers);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main( int argc&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt; char &lt;span style="color: rgb(102, 102, 102);"&gt;*&lt;/span&gt;argv&lt;span style="color: rgb(102, 102, 102);"&gt;[&lt;/span&gt;])&lt;br /&gt;{&lt;br /&gt;   int i&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt; sleep_time &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;100&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt; no_of_consumer_threads &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;10&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt; no_of_producer_threads &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;   pthread_t producer_id&lt;span style="color: rgb(102, 102, 102);"&gt;[MAX&lt;/span&gt;_PRODUCER]&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt; consumer_id&lt;span style="color: rgb(102, 102, 102);"&gt;[MAX&lt;/span&gt;_CONSUMER];&lt;br /&gt;   initialize_locks();&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;   // create producer threads&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;   for&lt;/span&gt;(i &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt; i &lt;span style="color: rgb(102, 102, 102);"&gt;&lt;&lt;/span&gt; no_of_producer_threads&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt; i&lt;span style="color: rgb(102, 102, 102);"&gt;++&lt;/span&gt;)&lt;br /&gt;   {&lt;br /&gt; &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;      if&lt;/span&gt; (pthread_create(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;producer_id&lt;span style="color: rgb(102, 102, 102);"&gt;[&lt;/span&gt;i]&lt;span style="color: rgb(102, 102, 102);"&gt;,NULL,&lt;/span&gt;producer&lt;span style="color: rgb(102, 102, 102);"&gt;,NULL&lt;/span&gt;) &lt;span style="color: rgb(102, 102, 102);"&gt;!=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;0&lt;/span&gt;)&lt;br /&gt;       {&lt;br /&gt;           fprintf (stderr&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt; &lt;span style="color: rgb(64, 112, 160);"&gt;"Unable to create producer thread\n"&lt;/span&gt;);&lt;br /&gt;  &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;         return&lt;/span&gt; &lt;span s=""&gt;-&lt;/span&gt;&lt;span style="color: rgb(64, 160, 112);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;   // create consumer threads&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;   for&lt;/span&gt;(i &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt; i &lt;span style="color: rgb(102, 102, 102);"&gt;&lt;&lt;/span&gt; no_of_consumer_threads&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt; i&lt;span style="color: rgb(102, 102, 102);"&gt;++&lt;/span&gt;)&lt;br /&gt;   {&lt;br /&gt; &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;      if&lt;/span&gt; (pthread_create(&lt;span style="color: rgb(102, 102, 102);"&gt;&amp;amp;&lt;/span&gt;consumer_id&lt;span style="color: rgb(102, 102, 102);"&gt;[&lt;/span&gt;i]&lt;span style="color: rgb(102, 102, 102);"&gt;,NULL,&lt;/span&gt;consumer&lt;span style="color: rgb(102, 102, 102);"&gt;,NULL&lt;/span&gt;) &lt;span style="color: rgb(102, 102, 102);"&gt;!=&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;0&lt;/span&gt;)&lt;br /&gt;       {&lt;br /&gt;           fprintf (stderr&lt;span style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt; &lt;span style="color: rgb(64, 112, 160);"&gt;"Unable to create consumer thread\n"&lt;/span&gt;);&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   sleep(sleep_time);&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;   return&lt;/span&gt; &lt;span style="color: rgb(64, 160, 112);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-7201029142775218521?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/7201029142775218521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=7201029142775218521' title='54 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/7201029142775218521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/7201029142775218521'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2008/12/producer-consumer-problem-is-classical.html' title='Generalized Producer-Consumer solution using Semaphore'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>54</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-1047936666872212258</id><published>2008-09-12T04:07:00.000-07:00</published><updated>2008-09-12T04:38:43.308-07:00</updated><title type='text'>Simple RSS feed reader in python</title><content type='html'>&lt;div&gt;&lt;/div&gt;Writing a simple RSS feed reader is pretty simple  in  python.Here i have presented a simple snippet that prints the "title" element of the RSS feed&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;&lt;br /&gt;# This program is free software; you can redistribute it and/or modify&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;# it under the terms of the GNU General Public License as published by&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;# the Free Software Foundation; version 2 of the License.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;# This program is distributed in the hope that it will be useful,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;# but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(96, 160, 176); font-style: italic;"&gt;# GNU General Public License for more details.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;from&lt;/span&gt; &lt;span style="color: rgb(14, 132, 181); font-weight: bold;"&gt;urllib2&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;import&lt;/span&gt; urlopen&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;from&lt;/span&gt; &lt;span style="color: rgb(14, 132, 181); font-weight: bold;"&gt;xml.sax&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;import&lt;/span&gt; make_parser, ContentHandler&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: rgb(14, 132, 181); font-weight: bold;"&gt;sys&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;__author__ &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 112, 160);"&gt;"Suvash Sedhain"&lt;/span&gt;&lt;br /&gt;__date__ &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(64, 112, 160);"&gt;"Fri Sep 12 16:46:44 NPT 2008"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(14, 132, 181); font-weight: bold;"&gt;RSSHandler&lt;/span&gt; (ContentHandler):&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;def&lt;/span&gt; &lt;span style="color: rgb(6, 40, 126);"&gt;__init__&lt;/span&gt;(&lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;):&lt;br /&gt;      ContentHandler&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;__init__(&lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;)&lt;br /&gt;      &lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;__inItem &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32);"&gt;False&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;__inTitle &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32);"&gt;False&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;def&lt;/span&gt; &lt;span style="color: rgb(6, 40, 126);"&gt;characters&lt;/span&gt;(&lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;,data):&lt;br /&gt;      &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;__inTitle:&lt;br /&gt;          sys&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;stdout&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;write(data)&lt;br /&gt;       &lt;br /&gt;  &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;def&lt;/span&gt; &lt;span style="color: rgb(6, 40, 126);"&gt;startElement&lt;/span&gt;(&lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;, tag, attrs):&lt;br /&gt;      &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;if&lt;/span&gt; tag &lt;span style="color: rgb(102, 102, 102);"&gt;==&lt;/span&gt; &lt;span style="color: rgb(64, 112, 160);"&gt;"item"&lt;/span&gt;:&lt;br /&gt;          &lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;__inItem &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32);"&gt;True&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;if&lt;/span&gt; tag &lt;span style="color: rgb(102, 102, 102);"&gt;==&lt;/span&gt; &lt;span style="color: rgb(64, 112, 160);"&gt;"title"&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;and&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;__inItem:&lt;br /&gt;          &lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;__inTitle &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32);"&gt;True&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;def&lt;/span&gt; &lt;span style="color: rgb(6, 40, 126);"&gt;endElement&lt;/span&gt;(&lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;, tag):&lt;br /&gt;      &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;if&lt;/span&gt; tag &lt;span style="color: rgb(102, 102, 102);"&gt;==&lt;/span&gt; &lt;span style="color: rgb(64, 112, 160);"&gt;"title"&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;and&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;__inTitle:&lt;br /&gt;          sys&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;stdout&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;write(&lt;span style="color: rgb(64, 112, 160);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(64, 112, 160); font-weight: bold;"&gt;\n&lt;/span&gt;&lt;span style="color: rgb(64, 112, 160);"&gt;"&lt;/span&gt;)&lt;br /&gt;          &lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;__inTitle &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32);"&gt;False&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;if&lt;/span&gt; tag &lt;span style="color: rgb(102, 102, 102);"&gt;==&lt;/span&gt; &lt;span style="color: rgb(64, 112, 160);"&gt;"item"&lt;/span&gt;:&lt;br /&gt;          &lt;span style="color: rgb(0, 112, 32);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;__inItem &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 112, 32);"&gt;False&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 112, 32); font-weight: bold;"&gt;def&lt;/span&gt; &lt;span style="color: rgb(6, 40, 126);"&gt;listFeedTitle&lt;/span&gt;(url):&lt;br /&gt;  infile &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; urlopen(url)&lt;br /&gt;  parser &lt;span style="color: rgb(102, 102, 102);"&gt;=&lt;/span&gt; make_parser()&lt;br /&gt;  parser&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;setContentHandler(RSSHandler())&lt;br /&gt;  parser&lt;span style="color: rgb(102, 102, 102);"&gt;.&lt;/span&gt;parse(infile)&lt;br /&gt;&lt;br /&gt;#extract all the python related links from dzone&lt;br /&gt;listFeedTitle(&lt;span style="color: rgb(64, 112, 160);"&gt;"http://www.dzone.com/links/feed/search/python/rss.xml"&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;Code Explanation:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The class &lt;span style="font-style: italic;"&gt;RSSHandler&lt;/span&gt; is derived from the class &lt;span style="font-style: italic;"&gt;ContentHandler&lt;/span&gt;, which is a interface that provides functionality of Parsing XML. we override methods &lt;span style="font-weight: bold;"&gt;characters&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;startElement&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;endElement&lt;/span&gt; to customize the parser as per our need.&lt;br /&gt;&lt;br /&gt;The method invocation can be summarized as:&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;"characters" method is called when stream of text is encountered&lt;/li&gt;&lt;/ul&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt; "startElement" method is called when any starting tag is encountered&lt;/li&gt;&lt;/ul&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt; "endElement" method is called when any ending tag is encountered&lt;/li&gt;&lt;/ul&gt;The function make_parser is a factory function that returns the generic XML parser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-1047936666872212258?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/1047936666872212258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=1047936666872212258' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/1047936666872212258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/1047936666872212258'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2008/09/simple-rss-feed-reader-in-python.html' title='Simple RSS feed reader in python'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-6046967334002657135</id><published>2008-05-25T09:53:00.002-07:00</published><updated>2008-06-24T03:20:31.821-07:00</updated><title type='text'>IMAGE VERIFICATION WITH PHP</title><content type='html'>&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-size:16;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;Image verification has become an integral part in any online registration process. It is important to know whether the other side that is filling the form is really a human or any robot or automatic scripts so, its time to look at how it really works.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-size:16;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;To achieve this with PHP, you need to have the GD library installed. The whole procedure is quite simple. You generate a random number and then stamp it over a picture and there you go, you have your own verification number on a nice picture.&lt;span style="font-size:0;"&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-size:16;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;The coding is also quite simple as the algorithm mentioned above. Enough of words and let’s take a look at the coding to make the things go clear.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:16;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:16;"&gt;//verification.php&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$alphanum = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;// generate the5 digit &lt;span style="font-size:0;"&gt;&lt;/span&gt;verification code&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$rand = substr(str_shuffle($alphanum), 0, 5);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;//create image from a given jpeg to write our code&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$image = imagecreatefromjpeg("background.jpg");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;//allocate the text color of the code&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$textColor = imagecolorallocate($image, 0, 0, 0); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;// write the code on the background image&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;imagestring ($image, 5, 5, 8, $rand, $textColor); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;// send the content type header so the image is //displayed properly&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;header(‘Content-type: image/jpeg’);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;// send the image to the browser&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;imagejpeg($image);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-right: -1.25in;"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-right: -1.25in;"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;// destroy the image to free up the memory&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;imagedestroy($image);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;?&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:16;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;Save the above code as verification.php and preview it in your browser and there you have it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:16;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="background: aqua none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:16;"&gt;How it works&lt;/span&gt;&lt;span style="font-size:16;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-size:16;"&gt;In the above program, we created a string of alphanumeric characters. Then the sting was shuffled using &lt;i&gt;str_shuffle(string)&lt;/i&gt; function. We then extracted the first five characters of the shuffled string using the &lt;i&gt;substr(string,starting_position,no_of_chars)&lt;/i&gt;. The extracted characters were then stored as our random code. We then created a image from the given image and wrote our code on the image using the &lt;i&gt;imagestring(image,font,x_pos,y_pos,string,string_color).&lt;/i&gt; (Refer the &lt;i&gt;imagettftext()&lt;/i&gt;&lt;span style="font-size:0;"&gt; &lt;/span&gt;function for better result).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-size:16;"&gt;And finally the image was fed to the browser using the &lt;i&gt;imagejpeg(image)&lt;/i&gt; function for jpeg image. For a complete reference on the functions used in above codes, you can log on to the official site of php,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-size:16;"&gt;&lt;a href="http://www.php.net/"&gt;http://www.php.net/&lt;/a&gt; and get your copy of php manual for free.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-size:16;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:16;"&gt;Now you have your verification code, but what about using it to verify the users. They say life is full of options and so does php offers a variety of options to pass a variable between the web pages. You can pass the random code generated to any other page either using sessions or cookies variables, using the form submission method or the rather insecure URL method. Let’s try it using session variables. For this you need to have some modifications on your verification.php file or whatever you named it. first of all initialize a session and then assign the random number to a session variable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;i&gt;&lt;span style="background: yellow none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;//mod_verification.php&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;Session_start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$alphanum = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;// generate the5 digit &lt;span style="font-size:0;"&gt;&lt;/span&gt;verification code&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$rand = substr(str_shuffle($alphanum), 0, 5);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;//assign session variable the verification code&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$_SESSION[‘variable’]=$rand;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;//create image from a given jpeg to write our code&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$image = imagecreatefromjpeg("background.jpg");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;//allocate the text color of the code&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$textColor = imagecolorallocate($image, 0, 0, 0); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;// write the code on the background image&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;imagestring ($image, 5, 5, 8, $rand, $textColor); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;// send the content type header so the image is //displayed properly&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;header(‘Content-type: image/jpeg’);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;//save the final image as image.jpg &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;imagejpeg($image,”image.jpg”);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;echo “&amp;lt;img src=\”image.jpg\”&gt;”;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;echo "Type the code you see in the image in the box below. (case sensitive)";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;?&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&amp;lt;form action=check.php method=post&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&amp;lt;input name=code type=text &gt; //place to type the code&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&amp;lt;input type=submit&gt; //submit button&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&amp;lt;/form&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;span style="font-size:0;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:16;"&gt;With that done, we must now create a new file and name it check.php and see if it works.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="background: yellow none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:14;"&gt;//check.php&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;Session_start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;//retrieve the posted variable via forn &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$typed=$_POST[‘code’];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;//retrieve the session variable &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;$var=$_SESSION[‘variable’];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;echo “The verification code was $var and you typed $typed”;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;if($var==$typed)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;echo “you are verified”;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;?&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:14;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:16;"&gt;There you are, with your own image verification tool. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-6046967334002657135?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/6046967334002657135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=6046967334002657135' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/6046967334002657135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/6046967334002657135'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2008/05/image-verification-with-php.html' title='IMAGE VERIFICATION WITH PHP'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-1510437033630332036</id><published>2007-11-07T08:37:00.000-08:00</published><updated>2007-11-07T10:23:00.252-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web framework'/><category scheme='http://www.blogger.com/atom/ns#' term='Cakephp'/><title type='text'>5 Reasons why beginner hates web-frame work?</title><content type='html'>&lt;p class="MsoNormal" style="text-align: justify;"&gt;Working on spring framework and Cake PHP framework make me realize why beginners hate web-framework. I had heard a lot of eulogy about spring so I was eager to use the spring framework. Initially, I found the framework enigmatic. Aspect Oriented programming, Dependency injection, Bean creation, Validation and Hibernate everything was completely new for me. At first, to create a simple “hello world” was also daunting task for me. Fortunately, my team leader was expert in all those things and he was so helpful. So, we keep on learning all those stuffs during the course of the project. Now, I am working with energetic programmers on CakePHP framework. As I am familiar with MVC, Cake PHP is yummy for me. Although my teammates were familiar with PHP but MVC was new for them. So, at the beginning they were arguing “Why we are using any framework?” And they were not convinced about the productivity of the framework too. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;As per my personal experience, following are the 5 reasons why beginner hates web-framework&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(51, 153, 102);font-size:14;" &gt;1) Comparing everything with hello world.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;I have found in many pages which compares languages by showing in how many line they can display “hello world” and something simple things like this. I have found the good impression of such pages on the beginner. So, when I say you need MODEL, VIEW and CONTROLLER to create a simple app to a beginner, they simply think that frame-work adds overhead because they have to create three pages to create a simple hello world.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="color: rgb(51, 153, 102);font-size:14;" &gt;2) &lt;b style=""&gt;Coding Convention &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;While working with the Cake PHP naming convention of the model view and controller have annoyed my team members and it reminds me the days when novice to the spring frame work.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: -0.25in; text-align: justify; text-indent: 0.25in;"&gt;&lt;span style="color: rgb(51, 153, 102);font-size:14;" &gt;3) &lt;b style=""&gt;Functionality provided by the framework&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;Beginners prefer to use their own code even though the framework provides it. Once,&lt;u&gt; &lt;/u&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;One of my teammates argued with me regarding the CakePHP validation. At first he used his own JavaScript based validation. But After working with numbers of pages he realized that it’s effective to use the CakePHP validation and was convinced to use that.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: -0.25in; text-align: justify; text-indent: 0.25in;"&gt;&lt;span style="color: rgb(51, 153, 102);font-size:14;" &gt;4) &lt;b style=""&gt;MVC is overhead for beginner&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;Actually MVC systematize the development process itself. Work of the programmer and designer can be easily separated. So, coding and designing can go hand on hand. Its difficult for the beginner to visualize the program flow with MVC. However, it is difficult&lt;u&gt; &lt;/u&gt;to convince the beginner about MVC pattern until and unless they get involved in any &lt;b style=""&gt;large &lt;/b&gt;projects.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: -0.25in; text-align: justify; text-indent: 0.25in;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(51, 153, 102);font-size:14;" &gt;5) Framework is difficult to understand.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 9pt; text-align: justify;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;For any one who is new to any framework, s/he has problem on even in simple things. Only difference is that for the people who have already worked in other frameworks can compare the features and quickly learn the things. But, for the novice it is too difficult to grasp a lot of new terminology at a time. So, all these terminology intimidate the novice.&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: -9pt; text-align: justify; text-indent: -9pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-1510437033630332036?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/1510437033630332036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=1510437033630332036' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/1510437033630332036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/1510437033630332036'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2007/11/5-reasons-why-beginner-hates-web-frame.html' title='5 Reasons why beginner hates web-frame work?'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-1825584149316839533</id><published>2007-10-07T22:16:00.000-07:00</published><updated>2007-10-07T22:21:17.406-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php'/><title type='text'>Object Oriented Programming with PHP</title><content type='html'>&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }  --&gt;  &lt;/style&gt;  &lt;p style="margin-bottom: 0in;"&gt;The term object-oriented involves thinking about processes as entities; in other words, the way we think about day-to-day objects. Object oriented programming is widespread today, and many universities teach object-oriented programming in beginning programming classes. Currently, Java and C++ are the most prevalent languages used for object-oriented programming&lt;span style="font-family:Cheltenham-Book,serif;"&gt;. &lt;/span&gt;Object-oriented&lt;span style="font-family:Cheltenham-Book,serif;"&gt; &lt;/span&gt;programming is not just a matter of using different syntax. It’s a different way of analyzing programming problems. In object-oriented programming, the elements of a program are &lt;i&gt;objects. &lt;/i&gt;The objects represent the elements of the problem your program is meant to solve. Object-oriented programming developed new concepts and new terminology to represent those concepts. &lt;/p&gt;&lt;p style="margin-bottom: 0in; line-height: 150%;" align="justify"&gt;                But what about OOP in web scripts like PHP? Web scripts typically execute quickly and then go away. So you may think do we really need OOP concept in the web scripting? PHP wasn’t developed as an object oriented language. PHP began life as a simple set of scripts. However, PHP couldn’t be left untouched by this growing global phenomenon of OOP and its numerous advantages forced it to be reckoned by the language. Over the course of its life, PHP has evolved, more and more object-oriented features. First, you could define classes, but there were no constructors. Then, constructors appeared, but there were no destructors. Slowly but surely, as more people began to push the limits of PHP's syntax additional features were added to satisfy the demand. Object oriented programming became possible with PHP 4. With the introduction of PHP 5, the PHP developers have really beefed up the object-oriented features of PHP, resulting in both more speed and added features. Much of this improvement is invisible — changes introduced with the Zend 2 engine that powers PHP 5, that make scripts using objects run much faster and more efficiently than they did in PHP 4. PHP typically has a less thoroughgoing implementation of OOP than languages like c++, java, etc. There are still some concepts missing as function overloading and multiple inheritances.  &lt;/p&gt; &lt;p style="margin-bottom: 0in; line-height: 150%;" align="justify"&gt;           OOP concept has really changed the way we used to program in PHP. Because of OOP, the code redundancy has been greatly reduced and using this technique we are able to make simple programs on the fly. This concept has helped to develop and maintain large scale projects easily. Features like inheritance, encapsulation and abstractions have helped speed up the development process of products using PHP. As of PHP5, it supports single inheritance, constructors and destructors, encapsulations, static functions, object interface, etc. So, OOP is certainly developing as an integral part of PHP programming.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-1825584149316839533?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/1825584149316839533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=1825584149316839533' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/1825584149316839533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/1825584149316839533'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2007/10/object-oriented-programming-with-php.html' title='Object Oriented Programming with PHP'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-2919545944504794636</id><published>2007-10-01T12:09:00.000-07:00</published><updated>2007-10-05T03:56:29.557-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django book'/><title type='text'>Pdf version of the Django book</title><content type='html'>&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style=";font-size:16;color:green;"  &gt;Pdf version of online Django book&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style=";font-size:16;color:green;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="color: rgb(20, 32, 31);font-size:16;" &gt;If you prefer the pdf format to html then download the pdf format of the django book here:&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;a style="font-family: times new roman;" href="http://bir2su.googlepages.com/djangobook.pdf"&gt; Djangobook&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;    &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style=";font-size:14;color:black;"  &gt;The book is actually compiled from the content available in the Djangobook.com&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style=";font-size:14;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style=";font-size:14;color:black;"  &gt;What is Django and why I love it?&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-size:14;color:black;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style=";font-size:14;color:black;"  &gt;&lt;span style=""&gt;          &lt;/span&gt;Django is the High level python Web framework for the rapid web development. Django is based on the MVC ie Model View Controller (actually the developer of the Django calls it MTV ie Model Template View). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;      &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style=";font-size:14;color:black;"  &gt;While Ruby on Rails(ROR) was&lt;span style=""&gt;  &lt;/span&gt;the subject of the discussion among the web developers, Django was developed to make the web development easy with the power of the python. The framework is highly inspired by the features of the Ruby on Rails, but it should be mentioned that it’s not the port of the ROR for python. Django has its own descent architecture and design. As per my experience Django is more Productive and scalable than the RoR. So its true for me too that &lt;b style=""&gt;&lt;u&gt;if ruby is on rails then the Python is on jet. &lt;/u&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt; &lt;/span&gt;An excellent comparison between the &lt;b style=""&gt;&lt;span style=""&gt; &lt;/span&gt;Django&lt;/b&gt; and&lt;b style=""&gt; Rails &lt;/b&gt;in terms of the performance is available at &lt;a href="http://wiki.rubyonrails.org/rails/pages/Framework+Performance"&gt;wiki.rubyonrails.org/rails/pages/Framework+Performance&lt;/a&gt;. &lt;/span&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style=";font-size:14;color:black;"  &gt;&lt;o:p&gt;&lt;span style="text-decoration: none;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;span style=";font-size:14;color:black;"  &gt;&lt;span style=""&gt;&lt;/span&gt;The best part of the Django is its well maintained site &lt;a href="http://www.djangoproject.com/"&gt;www.Djangoproject.com&lt;/a&gt;. This site provides lots of the information about the web development with Django.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style=";font-size:14;color:black;"  &gt;An up-to-date list of dozens of sites that use Django is located &lt;span style=""&gt; &lt;/span&gt;at &lt;/span&gt;&lt;a style="color: rgb(51, 102, 255);" href="http://code.djangoproject.com/wiki/DjangoPoweredSite"&gt;&lt;span style="color: rgb(172, 86, 3);font-size:14;" &gt;code.Djangoproject.com/wiki/DjangoPoweredSites.&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="color: rgb(172, 86, 3);font-size:14;" &gt;&lt;/span&gt;&lt;span style=";font-size:14;color:black;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;Visit the link below &lt;/span&gt;&lt;span style=";font-size:14;color:black;"  &gt;for the short but excellent introduction of the Django&lt;/span&gt;&lt;span style=";font-size:14;color:black;"  &gt; &lt;a href="http://www.ibm.com/developerworks/linux/library/l-django/?ca=dgr-btw01DjangoAndPython"&gt;http://www.ibm.com/developerworks/linux/library/l-Django/?ca=dgr-btw01DjangoAndPython&lt;/a&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style=";font-size:14;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style=";font-size:14;color:black;"  &gt;If you find this stuff useful then don’t forget to digg this post so that it is easily available for others too.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-2919545944504794636?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/2919545944504794636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=2919545944504794636' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/2919545944504794636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/2919545944504794636'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2007/10/pdf-version-of-django-book.html' title='Pdf version of the Django book'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-7798496297948687372</id><published>2007-09-28T10:34:00.001-07:00</published><updated>2007-10-01T12:15:59.288-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><title type='text'>Ajax :Defacto of web 2.0</title><content type='html'>&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;b&gt;&lt;span style=""&gt;AJAX&lt;/span&gt;&lt;/b&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;b&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;What is &lt;/span&gt;&lt;/b&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;b&gt;&lt;span style=""&gt;Ajax&lt;/span&gt;&lt;/b&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;b&gt;&lt;span style=""&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;If you are thinking about getting information about Ajax FC or the &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; city, then you've just hit the wrong page. We are here to talk about the term &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;AJAX&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; which stands for Asynchronous JavaScript &amp;amp; XML. The term &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; was coined in 2005 by James Garrett and is used to describe a combination of technologies of JavaScript, XML, CSS, XHTML and DOM and the all important XHR (XMLHTTPRequest) object. While the name &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;AJAX&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; has only recently been coined, the underlying technologies (JavaScript, XML,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;SOAP, and so on) have been maturing for years .XHR was created by Microsoft in IE5 in March of 1999, as an ActiveX Object and it only worked in IE.XHR was then adopted by Mozilla 1.0 and Safari 1.2.And a new generation of web application was born. Its core technique is centered on communication to the server without a page refresh .It is also&lt;o:p&gt;&lt;/o:p&gt; known as XMLHTTP technique.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; is all about improving the user experience. Since the beginning of the&lt;o:p&gt;&lt;/o:p&gt;n Web, and until recently, the users have nothing to do but fill some forms, click some links and then wait for reloading the whole page. It was not only becoming monotonous but tedious as well. This is what could be called the Web 1.0 model. Google Maps (http://maps.google.com) really ignited the &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; fire. Google, through the clever use of XHR callbacks provided the first in-page scrollable map. There was no waiting around for a bunch of ads to refresh. It really opened the new pattern of web UI which we prefer to call web 2.0.Real time Live searches, Web based chatting, Dragging and dropping ,instant feedback etc, have really established AJAX as a tool for making richer application. Google gmail, Google suggest, Google maps, Flickr etc. are the examples of &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; application that have sparked people's imagination.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;The four defining principles of Ajax&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(0, 51, 0);font-family:TimesNewRoman;font-size:14;"  &gt;1. &lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;i&gt;&lt;span style=""&gt;The browser hosts an application, not content&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Classically when a user logs into a site, a session is initialized and several serverside objects are created and pages are served to the browser. The home page is dished up to the browser, in a stream of HTML markup that mixes together standard boilerplate presentation and user-specific data. The browser acted as a dumb terminal and flushed whatever was sent to it. But &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; moves some application logic to the browser. When the user logs in. a more complex document is delivered to the browser, a large proportion of&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;which is JavaScript. This document will stay with the user throughout the session, although it will probably alter its appearance considerably while the user is interacting with it. It knows how to respond to user input and is able to decide whether to handle the user input itself or to pass a request on to the web server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(0, 51, 0);font-family:TimesNewRoman;font-size:14;"  &gt;2. &lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;i&gt;&lt;span style=""&gt;The server delivers data, not content&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;i&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;As we noted, the classic web app serves up the same mixture of boilerplate, content, and data at every step. An &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; based application can behave smartly by sending asynchronous requests to the server so that the server can only send back the relevant data while all other features of the page layout are there already.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(0, 51, 0);font-family:TimesNewRoman;font-size:14;"  &gt;3 .&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;i&gt;&lt;span style=""&gt;User interactions with the application can be fluid and continuous&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;i&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;In classic web applications, the only way to contact the server was either to click a hyperlink or to submit a form and wait for the server to respond. But &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; completely changes this style of communicating the server. With &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; technology, we can contact the server without interfering the user's flow. Interactions can be made with the server on the basis of mouse drag or movement or on every keystroke as on Google suggest.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(0, 51, 0);font-family:TimesNewRoman;font-size:14;"  &gt;4. &lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;i&gt;&lt;span style=""&gt;This is real coding and requires discipline&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;i&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;An &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; technology doesn't use JavaScript just to get fancy decorations or designs in the site. It really has to do some serious works. In &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;, the code that you deliver when users launch the application must run until they close it, without breaking.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);font-size:180%;" &gt;What can you do with &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);font-size:180%;" &gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=""&gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;The technology for &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; has been around since 1998, and a handful of applications (such as Microsoft’s Outlook Web Access) have already put it to use. But Ajax didn’t really catch on until early 2005, when a couple of high-profile Web applications (such as Google Suggest and Google Maps) put it to work, and Jesse James Garrett wrote his article coining the term Ajax and so putting everything under one roof. Google has been the pioneer in developing &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; applications and has done more than nyone to raise the profile of &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; applications. Some of the applications of &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;a. &lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;i&gt;&lt;span style=""&gt;Auto complete&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;This is the &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; feature that reacts to keystrokes and tries to make intelligent&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;guesses on what the user is going to type and then suggest it. For example&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;suggestions in gmail from the address book on typing email addresses.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;i&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;i&gt;&lt;span style=""&gt;b. Searching in real time with live searches&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;i&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;This feature gives result to your queries instantly as you enter them.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Googlesuggest is an example of this feature. You can view an example by logging onto &lt;/span&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:blue;"   &gt;http://www.google.com/webhp?complete=1&lt;/span&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;c. &lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;i&gt;&lt;span style=""&gt;Chatting&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;i&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; has enabled us to have a web based chat service. &lt;/span&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:blue;"   &gt;http://iloveim.com &lt;/span&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;is an example of a site based on this technology.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;d. &lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;i&gt;&lt;span style=""&gt;Dragging and dropping&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;As you might have seen in many e-commerce sites, you can drag and drop items to your cart which you prefer to buy. This has been made possible by &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;. &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; basically deals with the asynchronous handling of events. By using Ajax a rich application can be achieved without any additional plug-ins whatsoever to the browser as Ajax is supported by all major browsers IE, Firefox / Netscape / Mozilla with slight variations. So, &lt;/span&gt;&lt;st1:city&gt;&lt;st1:place&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt;Ajax&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=";font-family:TimesNewRoman;font-size:14;color:black;"   &gt; has been a major tool in making the web UI more attractive and user&lt;o:p&gt;&lt;/o:p&gt; friendly and is definitely here to stay.&lt;/span&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-size:16;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-7798496297948687372?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/7798496297948687372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=7798496297948687372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/7798496297948687372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/7798496297948687372'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2007/09/ajax-defacto-of-web-20.html' title='Ajax :Defacto of web 2.0'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-8740838149806888049</id><published>2007-09-27T10:56:00.000-07:00</published><updated>2008-11-27T05:04:39.589-08:00</updated><title type='text'>WEB CRAWLER: How It Works?</title><content type='html'>&lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify; text-indent: 0.75in;"&gt;&lt;span style="font-family:Arial;"&gt;In the internet there are hundreds of millions of pages providing the information on an amazing variety of topics. So, retrieving the useful information from the web is really a daunting task. &lt;span style=""&gt; &lt;/span&gt;How to obtain the required information from those millions of pages? Of course internet search engine site like google.com, yahoo.com, live.com etc are one and only option. These are special sites on the Web that are designed to help people find information stored on other sites. At the first glance it seems like a magic .These site understand what we intended to search. &lt;span style=""&gt; &lt;/span&gt;Really amazing, Search engine can be &lt;span style="color:black;"&gt;Crawler-Based Search Engines and Human-powered directories&lt;b&gt;. &lt;/b&gt;&lt;/span&gt;&lt;span style="color:black;"&gt;Crawler-based search engines create their listings automatically. It automatically tracks any changes on the web pages where as a human-powered directory depends on humans for its listings. So, in the rapidly growing web, &lt;span style=""&gt;Crawler-Based Search Engine is better.&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: -0.5in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: -0.25in; text-align: justify; text-indent: 0.5in;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;Crawler-based search engines have three major steps.&lt;/span&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color: rgb(153, 51, 102);font-family:Arial;" &gt;&lt;span style=""&gt;a)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b style=""&gt;&lt;span style="color: rgb(153, 51, 102);font-family:Arial;" &gt;Crawling&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color: rgb(153, 51, 102);font-family:Arial;" &gt;&lt;span style=""&gt;b)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b style=""&gt;&lt;span style="color: rgb(153, 51, 102);font-family:Arial;" &gt;Indexing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color: rgb(153, 51, 102);font-family:Arial;" &gt;&lt;span style=""&gt;c)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b style=""&gt;&lt;span style="color: rgb(153, 51, 102);font-family:Arial;" &gt;Searching&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: -0.25in; text-align: justify; text-indent: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(0, 102, 0);font-family:Arial;" &gt;Crawling:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;Web crawlers are programs that locate and gather information on the web. They recursively follow hyperlinks present in known document to find other document&lt;/span&gt;&lt;span style="font-family:Arial;"&gt;. The usual starting points are lists of heavily used &lt;span style="color:black;"&gt;&lt;a href="http://www.howstuffworks.com/web-server.htm"&gt;&lt;span style="text-decoration: none;color:black;" &gt;servers&lt;/span&gt;&lt;/a&gt;&lt;/span&gt; and very popular pages. In this way, the spider system quickly begins to travel, spreading out across the most widely used portions of the Web&lt;span style="color:black;"&gt;.&lt;span style=""&gt;  &lt;/span&gt;The spider visits to the site on a regular basis, such as every month or two, to look for changes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: -0.25in; text-align: justify; text-indent: 0.5in;"&gt;&lt;span style="color: rgb(0, 102, 0);font-family:Arial;font-size:12;"  &gt;&lt;span style=""&gt; &lt;/span&gt;Indexing&lt;/span&gt;&lt;span style="color: rgb(51, 153, 102);font-family:Arial;" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style="font-family:Arial;"&gt;An index helps to find the information as quickly as possible. &lt;span style="color:black;"&gt;The index is also known as catalog. If a web page changes, then index is updated with new information. Indexing basically consists of two steps:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;span style=""&gt;a)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;Parsing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;span style=""&gt;b)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;Hashing&lt;span style="color:black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;a. Parsing:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt; &lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;span style="font-family:Arial;"&gt;Parser extracts the link for further crawling. It also removes tag, JavaScript, comments etc. from the web pages and convert the html document to plain text. For the automated analysis of the text Regular expressions are extensively used. P&lt;/span&gt;&lt;span style="font-family:Arial;"&gt;arser which is designed to run on the entire Web must handle a huge array of possible errors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;b. Hashing&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt;After each document is parsed, it is encoded into a number. For &lt;span style="color:black;"&gt;&lt;a href="http://www.howstuffworks.com/encryption2.htm"&gt;&lt;span style="text-decoration: none;color:black;" &gt;hashing&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;, a formula known as hashing function is applied to attach a numerical value to a word. So, every word is converted into a wordID by using hash function. Inverted index is used to maintain the relationship between WordID and DocID which helps to quickly find the document containing the given word.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: -27pt; text-align: justify; text-indent: 0.75in;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(0, 102, 0);font-family:Arial;" &gt;Searching:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;span style=";font-family:Arial;color:black;"  &gt;All the documents matching the index are not equally relevant. Among the millions of documents only the most relevant documents have to be listed. &lt;/span&gt;&lt;span style="font-family:Arial;"&gt;In the simplest case, a search engine could just store the word and the URL where it was found. In reality, this would make for an engine of limited use, since there would be no way of telling whether the word was used in an important or a trivial way on the page, whether the word was used once or many times or whether the page contained links to other pages containing the word. So, to provide quality search results efficiently, searching process has to complete following steps&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;Parse the query.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;Convert words into wordIDs using hash function. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;Compute the rank of that document for the query. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;Sort the documents by rank.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;List only the top N numbers of documents.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;span style="font-family:Arial;"&gt;For those who are interested in the implementation of the web crawler, check out any of the open source crawler listed below:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;a href="file:///G:/backup%20from%20c/blog%20articles/crawler.archive.org/" title="Heritrix"&gt;Heritrix&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt; is the &lt;a href="http://en.wikipedia.org/wiki/Internet_Archive" title="Internet Archive"&gt;Internet Archive&lt;/a&gt;'s archival-quality crawler, designed for archiving periodic snapshots of a large portion of the Web (&lt;b style=""&gt;&lt;u&gt;written&lt;span style=""&gt;  &lt;/span&gt;in Java&lt;/u&gt;&lt;/b&gt;).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;a href="http://www.htdig.org/" title="http://www.htdig.org/"&gt;ht://Dig&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt; includes a Web crawler in its indexing engine.(Written in C)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;a href="http://larbin.sourceforge.net/index-eng.html" title="http://larbin.sourceforge.net/index-eng.html"&gt;Larbin&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt; &lt;span style=""&gt; &lt;/span&gt;a simple web Crawler(Written in c)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;a href="file:///G:/backup%20from%20c/blog%20articles/lucene.apache.org/nutch/" title="Nutch"&gt;Nutch&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt; is a scalable crawler written in Java and released under an &lt;a href="http://en.wikipedia.org/wiki/Apache_License" title="Apache License"&gt;Apache License&lt;/a&gt;. It can be used in conjunction with the &lt;a href="http://en.wikipedia.org/wiki/Lucene" title="Lucene"&gt;Lucene&lt;/a&gt; text indexing package.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;a href="http://www.cwr.cl/projects/WIRE/" title="http://www.cwr.cl/projects/WIRE/"&gt;WIRE - Web Information Retrieval Environment&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt; (Baeza-Yates and Castillo, 2002) is a web crawler written in C++ and released under the &lt;a href="http://en.wikipedia.org/wiki/GNU_General_Public_License" title="GNU General Public License"&gt;GPL&lt;/a&gt;, including several policies for scheduling the page downloads and a module for generating reports and statistics on the downloaded pages so it has been used for Web characterization.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;a href="http://sourceforge.net/projects/ruya/" title="http://sourceforge.net/projects/ruya/"&gt;Ruya&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt; Ruya is an Open Source, breadth-first, level-based web crawler written in python.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;a href="http://uicrawler.sourceforge.net/" title="http://uicrawler.sourceforge.net/"&gt;Universal Information Crawler&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt; Simple web crawler, written in Python.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;&lt;a href="http://www.dataparksearch.org/" title="DataparkSearch"&gt;DataparkSearch&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt; is a crawler and search engine released under the GNU General Public License.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt; text-align: justify;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-8740838149806888049?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/8740838149806888049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=8740838149806888049' title='40 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/8740838149806888049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/8740838149806888049'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2007/09/web-crawler-how-it-works.html' title='WEB CRAWLER: How It Works?'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>40</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6123761814409153571.post-3803363023552441071</id><published>2007-08-31T10:06:00.000-07:00</published><updated>2007-08-31T10:07:34.111-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Python Never bites</title><content type='html'>&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 16pt; color: green;"&gt;Python:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify; text-indent: 0.5in;"&gt;Python is a general purpose object-oriented, high-level interpreted language. Python was originally developed in the early '90s by Guido van Rossum. His original goal was to develop a language that stresses in readability, simplicity and elegance. Python runs on all major hardware platforms and operating systems, so it doesn't constrain your platform choices. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify; text-indent: 0.5in;"&gt;Python offers high productivity for all phases of the software life cycle: analysis, design, prototyping, coding, testing, debugging, tuning, documentation, deployment, and, of course, maintenance. Python is easy to learn, so it is quite suitable to anyone new to programming, yet at the same time it is powerful enough for the sophisticated expert. There are many sophisticated libraries available which make the programming in python even more equipped. The combination of simplicity, power and portability, along with its open-source nature, has made Python extremely popular.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 16pt; color: rgb(51, 153, 102);"&gt;Who uses python?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify; text-indent: 0.5in;"&gt;Python is used extensively for system administration tasks (it is, for example, a vital component of several Linux distributions).It is also used to teach programming to beginners. Here is list of some organization that uses python&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;Google has used it to implement many components of      its Web crawler and search engine. The most interesting thing is that even      the originator of Python, Guido van Rossum, is a Google employee. &lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;NASA uses Python for several of its software systems,      and has adopted it as the standard scripting language for its Integrated      Planning System.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=""&gt; &lt;/span&gt;Industrial      Light &amp; Magic, Creator of star wars, uses Python in its production of      special effects for large-budget feature films.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=""&gt; &lt;/span&gt;Yahoo! uses it      (among other things) to manage its discussion groups and Yahoo maps.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;Video sharing site Youtube uses it.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;Disney uses Python for its animation production      applications. It has developed a 3D engine “Panda3d” for the development      of interactive graphics. Panda3d is developed as the joint venture of      Disney and Carnegie Mellon university(CMU)&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;To learn more about the organization using python, visit the page &lt;a href="http://wiki.python.org/moin/OrganizationsUsingPython"&gt;http://wiki.python.org/moin/OrganizationsUsingPython&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 14pt; color: rgb(51, 153, 102);"&gt;Advantage of python &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 14pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;Python is open source software so, it has huge open      source community supporting it.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;Python is available on an incredibly wide range of      hardware and software platforms. This includes the usual suspects: Sun,      Intel, IBM, Microsoft Windows variants, Macintosh OS variants and all *nix      system.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;Python programs require less time to develop than      other high-level languages. Because of the elegance and simplicity of the      language, Python programs tend to be 3-5 times shorter than their      equivalent in Java, and 5-10 times shorter than C++ equivalents.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;Since the python code is highly readable, programs      are easier to maintain. So it reduces the maintenance cost which is      crucial in software development.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;Python has loosely typed language.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;It exploits the full power of object oriented      approach.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;Python programs can be extended using C, C++, or      Java. SWIG (Simple Wrapper and Interface Generator) helps to create the      wrapper for python.&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: justify;"&gt;The popular web development framework for python such      as Zope and Plone , Django, TurboGears make it popular for web development.&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 16pt; color: rgb(51, 153, 102);"&gt;What the python users say?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 14pt;"&gt;Google&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify; text-indent: 0.5in;"&gt;"Python has been an important part of Google since the beginning, and remains so as the system grows and evolves. Today dozens of Google engineers use Python, and we're looking for more people with skills in this language." said Peter Norvig, director of search quality at Google, Inc.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify; text-indent: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 14pt;"&gt;YouTube.com&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify; text-indent: 0.5in;"&gt;"Python is fast enough for our site and allows us to produce maintainable features in record times, with a minimum of developers," said Cuong Do, Software Architect, YouTube.com.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify; text-indent: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 14pt;"&gt;Industrial Light &amp; Magic&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify; text-indent: 0.5in;"&gt;"Python plays a key role in our production pipeline. Without it a project the size of Star Wars: Episode II would have been very difficult to pull off. From crowd rendering to batch processing to compositing, Python binds all things together," said Tommy Burnette, Senior Technical Director, Industrial Light &amp; Magic.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;"Python is everywhere at ILM. It's used to extend the capabilities of our applications, as well as providing the glue between them. Every CG image we create has involved Python somewhere in the process," said Philip Peterson, Principal Engineer, Research &amp; Development, Industrial Light &amp;amp; Magic.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Visit &lt;a href="http://www.python.org/about/quotes/"&gt;http://www.python.org/about/quotes/&lt;/a&gt; to read more quotes from others.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 14pt; color: rgb(51, 153, 102);"&gt;Is Python Suitable for me?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Well, it depends on what you are seeking for. If you are completely new in the field of programming then it’s easy to learn and has good learning curve. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;For the rapid development this is the best language. However, for the high end computational and simulation software which involves extremely complex &lt;span style=""&gt; &lt;/span&gt;graphics and mathematics, C and C++ may be the better choice. I think quotations from the web/software giants like Google, YouTube and Industrial Light &amp; Magic speak more than thousands of my words.So, you can use to python if you want pleasing coding experience. And its true that python never bites.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=""&gt; &lt;/span&gt;NOTE: If you are sure that it’s the programming language for you then get the recent copy of the python from &lt;a href="http://www.python.org/"&gt;www.python.org&lt;/a&gt; . &lt;u&gt;Eclipse IDE&lt;/u&gt; with Pydev plug-in will give great coding experience. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6123761814409153571-3803363023552441071?l=bir2su.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bir2su.blogspot.com/feeds/3803363023552441071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6123761814409153571&amp;postID=3803363023552441071' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/3803363023552441071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6123761814409153571/posts/default/3803363023552441071'/><link rel='alternate' type='text/html' href='http://bir2su.blogspot.com/2007/08/python-never-bites_4134.html' title='Python Never bites'/><author><name>zephyr</name><uri>http://www.blogger.com/profile/10845733901751466750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>
