<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"><id>http://binnyva.blogspot.com/feeds/posts/full</id><updated>2006-10-04T17:42:28.929+05:30</updated><title type="text">Bin-Blog</title><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/index.html"/><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full"/><link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full?max-results=25"/><link rel="next" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full?start-index=26&amp;max-results=25"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author><generator version="7.00" uri="http://beta.blogger.com">Blogger</generator><openSearch:totalResults>138</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>http://binnyva.blogspot.com/feeds/posts/full/7645192374158086658</id><published>2006-10-04T16:46:00.000+05:30</published><updated>2006-10-04T16:50:10.159+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type="text">PostgreSQL</title><content type="html">&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger2/6782/1621/400/postgresql.png" border="0" alt="" /&gt;
&lt;p class="intro"&gt;&lt;a href="http://www.postgresql.org/" class="external" title="Offical site of PostgreSQL"&gt;PostgreSQL&lt;/a&gt; is a RDBMS that &lt;a href="http://www.mibrahim.net/blog/2006/07/21/why-i-will-switch-my-website-to-postgresql/" class="external" title="Why I will switch my website to PostgreSQL"&gt;many&lt;/a&gt; claim is &lt;a href="http://www.postgresql.org/about/quotesarchive" class="external" title="Some testimonals from PostgreSQL site"&gt;better&lt;/a&gt; than MySQL. This is basically the only Open Source competion MySQL has. There are other Open RDBMS but they are not in the league of MySQL and PostgreSQL.&lt;/p&gt;

&lt;p&gt;PostgreSQL is a open source object-relational database server(database management system). It supports many advanced features that are not in MySQL.&lt;/p&gt;

&lt;h2&gt;Features of PostgreSQL&lt;/h2&gt;

&lt;dl&gt;
&lt;dt&gt;Functions&lt;/dt&gt;
&lt;dd&gt;This feature allow blocks of code to be executed by the server. Functions in PostgreSQL can be written many languages like PL/pgSQL, PL/Perl, plPHP, PL/Python, PL/Ruby, PL/Tcl and more.&lt;/dd&gt;

&lt;dd&gt;Indexes&lt;/dd&gt;
&lt;dd&gt;An index is storing some columns of a table separately to allows quick access to the table. This makes the index smaller than the original table (due to having fewer columns), and it is optimized for quick searching. Most RDBMS supports this.&lt;/dd&gt;

&lt;dt&gt;Triggers&lt;/dt&gt;
&lt;dd&gt;A database trigger is procedural code that is automatically executed in response to certain events on a particular table in a database. Triggers can restrict access to specific data, perform logging, or audit access to data. In addition to calling functions written in the native PL/PgSQL, triggers can also invoke functions written in other languages like PL/Perl.&lt;/dd&gt;

&lt;dt&gt;MVCC&lt;/dt&gt;
&lt;dd&gt;PostgreSQL uses Multi-Version Concurrency Control (MVCC), which gives an user a copy of the database, allowing changes to be made by one user without being visible to the other users until the change is committed. This also lets you 'roll back' to an older version of the database if necessary. This is similar to the Version control systems like CVS or Subversion.&lt;/dd&gt;

&lt;dt&gt;Inheritance&lt;/dt&gt;
&lt;dd&gt;This feature lets tables inherit the properties of a parent table. Data is shared between parent and child tables. For example, adding a column in the parent will cause that column to appear in the child table also.&lt;/dd&gt;

&lt;dt&gt;Referential Integrity&lt;/dt&gt;
&lt;dd&gt;PostgreSQL allows column constraints, foreign key constraints, and row checks.&lt;/dd&gt;

&lt;dt&gt;Other features&lt;/dt&gt;
&lt;dd&gt;And many more features like...

&lt;ul&gt;
&lt;li&gt;Views&lt;/li&gt;
&lt;li&gt;Full, inner, left and right joins&lt;/li&gt;
&lt;li&gt;Sub-selects&lt;/li&gt;
&lt;li&gt;Encrypted connections via SSL&lt;/li&gt;
&lt;li&gt;Point-in-time recovery&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;Another open source RDBMS is SQLite. This provides no serious competion for MySQL or PostgreSQL as it tends to a different need. It is a a small C library that implements a self-contained, embeddable, zero-configuration, single file SQL database engine. More about SQLite in the next post.&lt;/p&gt;


&lt;h3&gt;References&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/List_of_relational_database_management_systems#Free_or_open_source_software" class="external"&gt;All Free RDBMS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.postgresql.org/" class="external" title="Offical site of PostgreSQL"&gt;PostgreSQL Official Site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.postgresql.org/docs/8.1/interactive/index.html" class="external"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.postgresql.org/download/" class="external"&gt;Download PostgreSQL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Comparisons&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.databasejournal.com/features/mysql/article.php/3288951" class="external"&gt;PostgreSQL vs MySQL: Which is better?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://monstera.man.poznan.pl/wiki/index.php/Mysql_vs_postgres" class="external"&gt;MySQL vs. PostgreSQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://builder.com.com/5100-6388-1050671.html" class="external"&gt;MySQL vs. PostgreSQL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/database" rel="tag"&gt;database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/postgresql" rel="tag"&gt;postgresql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/rdbms" rel="tag"&gt;rdbms&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/mysql" rel="tag"&gt;mysql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/10/postgresql.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/7645192374158086658"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/7645192374158086658"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/135491088241297649</id><published>2006-09-28T17:40:00.000+05:30</published><updated>2006-09-28T17:43:09.359+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="blogging"/><title type="text">Blogger Changed the Feed URL for Blogger Beta Site...</title><content type="html">&lt;p class="intro"&gt;Blogger have changed the URL of the feeds of all the blogs that have upgraded to Blogger beta. In the previous version of blogger, the feeds were located in the location...&lt;/p&gt;

&lt;p&gt;http://&amp;lt;blogger_id&amp;gt;.blogspot.com/atom.xml &lt;br /&gt;
(Eg. http://binnyva.blogspot.com/atom.xml )&lt;/p&gt;

&lt;p&gt;Now it is in...&lt;/p&gt;

&lt;p&gt;http://&amp;lt;blogger_id&amp;gt;.blogspot.com/feeds/posts/full&lt;br /&gt;
(Eg. &lt;a href="http://binnyva.blogspot.com/feeds/posts/full"&gt;http://binnyva.blogspot.com/feeds/posts/full&lt;/a&gt; )&lt;/p&gt;

&lt;p&gt;This is a bad move by blogger. I just can't understand why they did it. They least they could do is redirect all traffic to the old location(http://binnyva.blogspot.com/atom.xml) to the new location(http://binnyva.blogspot.com/feeds/posts/full). By best bet is that they want to use &lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" class="external"&gt;REST&lt;/a&gt; architecture.&lt;/p&gt;

&lt;p&gt;Another thing I don't understand is the result that is returned by the server when the feed URL is accessed. It returns the status 400 - Bad Request. Not 404(Page not found) but 400. I wish they would change this to 301(Moved Permanently) and redirect the user to the new feed location.&lt;/p&gt;

&lt;p&gt;UPDATE : This problem is fixed now! Thanks Guys.&lt;/p&gt;

&lt;h2&gt;Syndication Errors&lt;/h2&gt;

&lt;p&gt;So why is this a bad thing? Why am I complaining when a page is moved. The answer is simple : Syndication. Many people who have subscribed to my feed using the old URL will not be able to access the feed. Many indexers like Technorati, Syndic8 etc. will not be able to access and index my blog. All because the URL for feed is changed.&lt;/p&gt;

&lt;p&gt;Fortunately for me, I am using the &lt;a href="http://www.feedburner.com/"&gt;Feedburner service&lt;/a&gt;. So I don't have a problem if the feed is moved. I just change the 'Original Feed' location in my feedburner account, and the the visitors will get the new data - without even noticing the change. If you are worried that Blogger will change the feed again, go register for this service(its free).&lt;/p&gt;

&lt;p&gt;But I used the URL 'http://binnyva.blogspot.com/atom.xml' whenever I submitted my blog to an automatic indexer(Technorati,IceRocket,etc.). Now I will have to go around and update all those sites.&lt;/p&gt;

&lt;p&gt;Bad move blogger. Hope you fix this issue soon.&lt;/p&gt;

&lt;h2&gt;New Features&lt;/h2&gt;

&lt;p&gt;That said, I have to admit the new feed system is cool. You can specify some quires and you will get a feed based on those quires.&lt;/p&gt;

&lt;p&gt;For example, you can use the URL http://binnyva.blogspot.com/feeds/posts/full?max-results=5 and get the latest 5 posts instead of the default 25 new posts. Also there is a provision to get the feed for the comments of each post.(Eg. &lt;a href="http://binnyva.blogspot.com/feeds/2591766938765279155/comments/full"&gt;http://binnyva.blogspot.com/feeds/2591766938765279155/comments/full&lt;/a&gt; is the comments for the recent &lt;a href="http://binnyva.blogspot.com/2006/09/fedora-core-5-64bit-vs-32bit.html"&gt;Fedora Core 5 - 64bit&lt;/a&gt; Vs 32bit post)&lt;/p&gt;

&lt;p&gt;Some quires that work with the XML feed. There might be more, but these are the only ones I know. If you know any that are not included here, let me know and I will include them.&lt;/p&gt;

&lt;p&gt;URL : &lt;a href="http://binnyva.blogspot.com/feeds/posts/full"&gt;http://binnyva.blogspot.com/feeds/posts/full&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Parameters&lt;/h3&gt;
&lt;dl&gt;
&lt;dt&gt;max-results&lt;/dt&gt;
&lt;dd&gt;The number of posts that should appear in the XML(Default : 25). Example :  &lt;a href="example http://binnyva.blogspot.com/feeds/posts/full?max-results=5"&gt;http://binnyva.blogspot.com/feeds/posts/full?max-results=5&lt;/a&gt;&lt;/dd&gt;

&lt;dt&gt;start-index&lt;/dt&gt;
&lt;dd&gt;The post from which the listing should be taken. 1 means latest, 2 means second latest and so on(Default : 1).&lt;/dd&gt;

&lt;/dl&gt;

&lt;p&gt;I think they are using an updated feed creator - the version given in the &lt;code&gt;generator&lt;/code&gt; tag have changed. The new XML feed has Generator 'Blogger 7.00' while the older one has 'Blogger 6.72' as the generator.&lt;/p&gt;

&lt;h2&gt;RSS/Atom&lt;/h2&gt;

&lt;p&gt;Another thing I noticed was that the feed is available only in the atom format. In the previous version, they had both the Atom Format and the RSS format. Atom was available at http://binnyva.blogspot.com/atom.xml while RSS could be accessed at http://binnyva.blogspot.com/rss.xml . I can't find any way to get the RSS format in the new release(Blogger 7.0). Do any of you know where I can access the RSS format of the feed?&lt;/p&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/blogging" rel="tag"&gt;blogging&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/blogger" rel="tag"&gt;blogger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/atom" rel="tag"&gt;atom&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/rss" rel="tag"&gt;rss&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/feed" rel="tag"&gt;feed&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/09/blogger-changed-feed-url-for-blogger.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/135491088241297649"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/135491088241297649"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/2747725898907528766</id><published>2006-09-26T00:19:00.000+05:30</published><updated>2006-09-26T00:24:25.039+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="sites"/><title type="text">Top 5 Features Missing from Digg</title><content type="html">&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger2/6782/1621/400/32x32-digg-guy.png" border="0" alt="Digg Guy" /&gt;

&lt;p class="intro"&gt;&lt;a href="http://www.digg.com/" class="external"&gt;Digg&lt;/a&gt; is a great site - &lt;a href="http://binnyva.blogspot.com/2005/11/digg-news-filtering-service.html" class="internal" title="Digg - A News Filtering Service"&gt;I use it&lt;/a&gt; daily to get myself up to date. Digg is one of the best news filtering service out there. A small definition of digg(for those who were living under a rock)...&lt;/p&gt;

&lt;blockquote cite="http://en.wikipedia.org/wiki/Digg"&gt;Digg is a news website with an emphasis on technology and science articles. &lt;strong class="highlight"&gt;It combines social bookmarking, blogging, and syndication with a form of non-hierarchical, democratic editorial control&lt;/strong&gt;. News stories and websites are submitted by users, and then promoted to the front page through a user-based ranking system.(From &lt;a href="http://en.wikipedia.org/wiki/Digg" class="external"&gt;Wikipedia&lt;/a&gt;)&lt;/blockquote&gt;

&lt;p&gt;Like many other users of Digg, I too have a list of features I would like to see in Digg. These are the top 5(+1) features that are missing from digg.&lt;/p&gt;

&lt;h3&gt;Tagging&lt;/h3&gt;

&lt;p&gt;I just don't understand why this feature is not present in Digg. Digg is a poster boy for Web 2.0 and tagging is one of the core features of Web 2.0. Even &lt;a href="http://www.slashdot.com/" class="external"&gt;Slashdot&lt;/a&gt; brought in tagging.&lt;/p&gt;

&lt;h3&gt;Bookmarking option - without digging&lt;/h3&gt;

&lt;p&gt;Many people digg an article because they want to mark it for reading latter - not because they read the article and liked it.  I have done this many times. But if there is &lt;strong class="highlight"&gt;an option to 'bookmark' an article without digging it&lt;/strong&gt;, the users will use that feature - giving more each digg more weight.&lt;/p&gt;

&lt;h3&gt;Link to original story in the feed&lt;/h3&gt;

&lt;p&gt;The &lt;strong class="highlight"&gt;Digg RSS feed&lt;/strong&gt; is next to useless as it &lt;strong class="highlight"&gt;don't contain the link to the original story&lt;/strong&gt;. The links is for the comment page for that story in Digg. I understand that diggs will lose some traffic if there is no need for the user to visit the front page, but is this a good long term strategy? Guys, you are a Web 2.0 site - you really have to provide a good feed. You if want, you can include the link to the comment page in the 'description' section, but please, include the link to the original articles.&lt;/p&gt;

&lt;h3&gt;New Stories&lt;/h3&gt;

&lt;p&gt;Despite what my friends think, I don't check Digg once every 10 seconds. The actual time is more like once every 10 hours or so. The problem is a lot of feeds get promoted to the frontpage in that time. So there is a good chance that I will miss out some of the digged articles. I would like a page that would &lt;strong class="highlight"&gt;show all the stories that have been promoted since the last time I visited&lt;/strong&gt; that page.&lt;/p&gt; 

&lt;p&gt;For example, say I visited this &lt;em&gt;non-existent&lt;/em&gt; page
http://www.digg.com/new/ at 2006-09-23 10:00:00. The interface will be similar to that of the frontpage. I browse through the list of stories, merrily digging away. After my 'digging run' is over(say at 2006-09-23 10:30:00), I visit some other site, do some coding etc. till I feel the craving to check Digg again. So I visit the 'New' page again. Now only the diggs that has been promoted &lt;strong class="highlight"&gt;after&lt;/strong&gt; 2006-09-23 10:30:00(time of the end of the last digg run) will be shown.&lt;/p&gt;

&lt;p&gt;You would have to be logged in for this feature to work, which would be a good thing for Digg. If you don't want to log in, this can also be implemented using a cookie.&lt;/p&gt;

&lt;p&gt;This feature is for the frontpage diggs - but can also be implemented for the 'Upcoming' Diggs too.&lt;/p&gt;

&lt;h3&gt;Link to external services&lt;/h3&gt;

&lt;p&gt;A link to external services like del.icio.us would be nice. Digg have provided a 'Blog This' options(which I have never yet used). But a much more helpful feature is a small &lt;strong class="highlight"&gt;link next to every post - "Bookmark this link in Del.icio.us"&lt;/strong&gt;. Or 'Seed this story in Newsvine'. Or whatever.&lt;/p&gt;

&lt;h3&gt;Bonus Feature : Pictures&lt;/h3&gt;

&lt;p&gt;Even though this feature is not essential, I thought it would be great if &lt;strong class="highlight"&gt;each story has an images associated with it to the right&lt;/strong&gt; - like in &lt;a href="http://del.icio.us/" class="external"&gt;del.icio.us&lt;/a&gt; or &lt;a href="http://tech.memeorandum.com/" class="external"&gt;tech.memeorandum&lt;/a&gt;. Right now, images are only available for video links.&lt;/p&gt;

&lt;p&gt;Your 'most wanted' feature for digg not here? If you have any feature that you would like to see in Digg, leave a comment.&lt;/p&gt;

&lt;p&gt;Happy Digging.&lt;/p&gt;

&lt;iframe width="100" height="110" frameborder="0" src="http://bin-co.com/sites/tools/show_digg.php?url=http://digg.com/tech_news/Top_5_Features_Missing_from_Digg" &gt;&lt;/iframe&gt;
&lt;!--
&lt;a href="http://www.digg.com/tech_news/Top_5_Features_Missing_from_Digg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger2/6782/1621/400/180x35-digg-button.png" border="0" alt="" /&gt;&lt;/a&gt;
--&gt;

&lt;h3&gt;Related Links&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://labnol.blogspot.com/2006/06/diggcom-for-power-users-10-interesting.html" class="external"&gt;Digg.com for Power Users: 10 Interesting Digg Features&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://computer.howstuffworks.com/digg.htm" class="external"&gt;How Digg Works&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/digg" rel="tag"&gt;digg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/news" rel="tag"&gt;news&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/sites" rel="tag"&gt;sites&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/09/top-5-features-missing-from-digg.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/2747725898907528766"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/2747725898907528766"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/9131539293164022215</id><published>2006-09-22T23:37:00.000+05:30</published><updated>2006-09-22T23:38:54.244+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="css"/><title type="text">Sementic Pullquotes</title><content type="html">&lt;blockquote class="pullquote"&gt;&lt;p&gt;"Pullquotes are basically some important text in the content that is repeated on a side with emphasis"&lt;/p&gt;&lt;/blockquote&gt;

&lt;p class="intro"&gt;Roger Johansson of the &lt;a href="http://www.456bereastreet.com/" class="external"&gt;456 Berea st.&lt;/a&gt; recently wrote an article on how to &lt;a href="http://www.456bereastreet.com/archive/200609/automatic_pullquotes_with_javascript_and_css/" class="external" title="Automatic pullquotes with JavaScript and CSS"&gt;make pullquotes using javascript&lt;/a&gt;. Pullquotes are basically some important text in the content that is repeated on a side with emphasis so that people will notice it sooner. This is often seen in magazines. Example to the right...&lt;/p&gt;

&lt;p&gt;The method he used is to give the needed text a class, pull out the text using javascript and show it in the side. See original article for more details and code.&lt;/p&gt;

&lt;h2&gt;Advantages of this method&lt;/h2&gt;

&lt;h3&gt;Avoids redundancy&lt;/h3&gt;

&lt;p&gt;This approach avoids having to enter the same content twice in the page. If you are using a pullquote, you will already have that text somewhere in the page.&lt;/p&gt;


&lt;h2&gt;A few problems with this approach&lt;/h2&gt;

&lt;h3&gt;JavaScript is used for structure&lt;/h3&gt;

&lt;p&gt;JavaScript is used to create the pullquote - basically doing the job that rightfully belongs to (X)HTML. However, this don't really bother me - I am not that much of a purist. This feature also avoids redundancy of the text - which brings me to my next point.&lt;/p&gt;

&lt;h3&gt;Misses out on &lt;abbr title="Search Engine Optimization"&gt;SEO&lt;/abbr&gt; advantage&lt;/h3&gt;

&lt;p&gt;The redundancy in the quote, propably containing some of our target keywords, is a good thing from an SEO point of view. Using this method will eliminate that advantage.&lt;/p&gt;

&lt;h3&gt;Not sementic&lt;/h3&gt;

&lt;p&gt;The 'span' tag is free of any sementic meaning - and frowned on in many purist circles. But, as I said earlier, it don't bother me much(I use spans liberally). But in this case, there is an opportunity do this right - using sementic markup is very easy...&lt;/p&gt;

&lt;pre&gt;&lt;code class="html"&gt;&amp;lt;blockquote class="pullquote"&amp;gt;&amp;lt;p&amp;gt; ... pullquote ... &amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;...if you don't have issues about quoting yourself.&lt;/p&gt;

&lt;h3&gt;Text can't be changed&lt;/h3&gt;

&lt;p&gt;You will have to use the text exactly as it appears in the body - you will not be able to make any changes to it. Often you want to make cosmetic changes to the text before you make it a pullquote.&lt;/p&gt;

&lt;h3&gt;Don't need javascript&lt;/h3&gt;

&lt;p&gt;If someone who has &lt;a href="http://www.openjs.com/articles/javascript_detection_using_css.php" class="mypages"&gt;a good browser(supports CSS) is surfing with Javascript turned off&lt;/a&gt;, he will not be able to see the effect.&lt;/p&gt;

&lt;h2&gt;Purely Sementic Method&lt;/h2&gt;

&lt;p&gt;A much simpler method of doing this is to just the proper markup to insert the quote and using CSS to position the text whereever you want. You don't really need JavaScript for doing this.&lt;/p&gt;

&lt;h3&gt;(X)HTML&lt;/h3&gt;

&lt;pre&gt;&lt;code class="html"&gt;&amp;lt;blockquote class="pullquote"&amp;gt;&amp;lt;p&amp;gt; ... pull quote ... &amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;CSS&lt;/h3&gt;

&lt;p&gt;This code is taken from the original article. Change it to fit your design.&lt;/p&gt;

&lt;pre&gt;&lt;code class="javascript"&gt;
.pullquote {
 float:right;
 width:10em;
 display:block;
 margin:0.25em 0.75em 0.25em 1em;
 padding:0.5em;
 border:3px double #ccc;
 border-width:3px 0;
 color:#333;
 background-color:#f0f0f0;
 font:italic 1.3em/1.3 Georgia;
}
.pullquote p {
 margin:0;
 text-align:center;
}&lt;/code&gt;&lt;/pre&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/css" rel="tag"&gt;css&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/pullquote" rel="tag"&gt;pullquote&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/sementic" rel="tag"&gt;sementic&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/09/sementic-pullquotes.html"/><link rel="related" href="http://www.456bereastreet.com/archive/200609/automatic_pullquotes_with_javascript_and_css/"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/9131539293164022215"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/9131539293164022215"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/573054769720836214</id><published>2006-09-19T23:50:00.000+05:30</published><updated>2006-09-19T23:52:04.258+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type="text">32bit Linux installed(Fedora Core 5)</title><content type="html">&lt;p class="intro"&gt;As said in the &lt;A href="http://binnyva.blogspot.com/2006/09/fedora-core-5-64bit-vs-32bit.html" class="internal" title="Fedora Core 5 - 64bit Vs 32bit"&gt;previous post&lt;/A&gt;, I have installed Fedora Core 5(32 bit) version on my system. A pity, I was starting to like the 64 bit version. The speed became bearable after you get used to it. Anyway I have just installed the 32 bit version - I have to configure it now. I will let you know what I think of the OS once the whole thing is set up.&lt;/p&gt;

&lt;p&gt;I have stumbled upon a practical way to partition the &lt;abbr title="Hard Disk"&gt;HDD&lt;/abbr&gt; if you want to reinstall the OS every 6 months(the release cycle of many Linux Distros like Fedora Core and Ubuntu is 6 months). Of course, I will reinstalling you system every 6 months, but it is an option.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows Partitions(if any)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/boot&lt;/code&gt; - 200 MB for me&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/&lt;/code&gt; - The root partition&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/home&lt;/code&gt; - Where all the user's information is kept&lt;/li&gt;
&lt;li&gt;swap - The size of this drive must be twice RAM's size. If you have 1 GB RAM, you must have 2 GB Swap.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Make sure you have a separate &lt;code&gt;/home&lt;/code&gt; partition - that way you can reinstall the OS without losing(or having to move) any of the files you are working on. Just make sure you choose 'Custom Partitioning' when installing the OS. Then format all the partition EXCEPT the &lt;code&gt;/home&lt;/code&gt; partition.&lt;/p&gt;

&lt;p&gt;Of course, if you choose to put your site in /var/www/htdocs(or some folder outside your home) you will have to backup those folders. Some folders that I have to backup outside home are...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/var/www/&lt;/code&gt; - All my web development folder - htdocs, cgi-bin etc.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/var/lib/mysql/&lt;/code&gt; - Database is stored here.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/&lt;/code&gt; - Configurations.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/var/cvs/&lt;/code&gt; - CVS repository is in this folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also if you are the root user, your files will be kept in &lt;code&gt;/root&lt;/code&gt; - not in &lt;code&gt;/home&lt;/code&gt;. So back those up too.&lt;/p&gt;

&lt;p&gt;The rest of the files are in my home folder(&lt;code&gt;/home/binnyva&lt;/code&gt;) - these files will stay intact as I did not format the &lt;code&gt;/home&lt;/code&gt; partition.&lt;/p&gt;

&lt;p&gt;A problem with this method is that creating the same user is a problem. For example, if I create a new user with the same username(binnyva), the new users files will overwrite the existing files. Also &lt;abbr title="K Desktop Environment"&gt;KDE&lt;/abbr&gt; does not play nice when I tried to use the old configurations - I can login - but KDE will not start up. I had to login as root and delete the '.kde' directory from my folder before I got it to work again. This is a huge problem - I spend days trying to configure the OS to my liking - now I have to do it again. I would appreciate it if there was some system to copy the system configuration when upgrading the system. This is especially improtant in the case of 6 month release cycles I spoke about earlier.&lt;/p&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/linux" rel="tag"&gt;linux&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/fedora" rel="tag"&gt;fedora&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/core" rel="tag"&gt;core&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/09/32bit-linux-installedfedora-core-5.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/573054769720836214"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/573054769720836214"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/2591766938765279155</id><published>2006-09-15T00:01:00.000+05:30</published><updated>2006-09-15T00:02:13.991+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type="text">Fedora Core 5 - 64bit Vs 32bit</title><content type="html">&lt;p class="intro"&gt;I have just &lt;a href="http://binnyva.blogspot.com/2006/09/fedora-core-5.html" class="internal" title="Fedora Core 5"&gt;installed Fedora Core 5&lt;/a&gt; 64bit linux in my system. I like it, but there is some problems associated with its being 64 bit.&lt;/p&gt;
&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger2/6782/1621/400/fc5.png" border="0" alt="" /&gt;

&lt;h2&gt;No Flash&lt;/h2&gt;

&lt;p&gt;Macromedia(now Adobe) have not released a Flash plugin for 64 bit Firefox. This is in most cases a good thing - as I won't have to watch annoying flash ads. But it is a problem when I am trying to view videos in YouTube or Google Video. Also, Google Analytics is impossible to use without Flash. There are some solutions like &lt;a href="http://www.ilfilosofo.com/blog/2006/03/21/flash-for-64-bit-fedora-core-4/" class="external"&gt;using a 32 bit firefox on a 64 bit linux&lt;/a&gt; - but I like it better if there is native support. For automated installation see &lt;a href="http://www.ubuntuforums.org/showthread.php?p=1174435" class="external"&gt;Howto Install 32 bit Firefox with Flash w/sound and Java for AMD64&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Not much of an performance boost in Desktop systems&lt;/h2&gt;

&lt;blockquote cite="http://enterprise.linux.com/article.pl?sid=06/09/07/1632253"&gt;64-bit binaries are not twice as fast, either. You are unlikely to notice any discernible speed difference, particularly with desktop apps.&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="http://enterprise.linux.com/article.pl?sid=06/09/07/1632253" class="external"&gt;What you should (and shouldn't) expect from 64-bit Linux&lt;/a&gt; - A must read if you are torn between choosing a 64bit and 32bit OS for your system.&lt;/p&gt;

&lt;h2&gt;Can't get IE to work&lt;/h2&gt;

&lt;p&gt;As I have promised in the '&lt;a href="http://binnyva.blogspot.com/2006/06/installing-internet-explorer-in-linux.html" class="external"&gt;Installing Internet Explorer in Linux&lt;/a&gt;' post, I have installed IE using Wine in the system. I did this in a &lt;abbr title="Fedora Core 3"&gt;FC3&lt;/abbr&gt; system(at work) and a &lt;abbr title="Fedora Core 5"&gt;FC5&lt;/abbr&gt; system(at Home). IE works perfectly(or close enough) on the FC3 system - but fails miserably on the FC5 system. I think this is an issue with Wine. I had to &lt;a href="http://wiki.winehq.org/WineOn64bit" class="external" title="How to build 32-bit Wine on a 64-bit (x86-64) system"&gt;hack it a bit to work with my 64 bit system&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Speed&lt;/h2&gt;

&lt;p&gt;Another problem I have noticed is that the system, on the whole, seems a bit slower than FC3. I have seen &lt;a href="http://forums.fedoraforum.org/showthread.php?p=605983#post605983" class="external"&gt;other complaints like this&lt;/a&gt; on the net - but very few valid solutions.&lt;/p&gt;
 
&lt;p&gt;I am trying to speed thing up a bit by &lt;a href="http://www.mjmwired.net/resources/mjm-services-fc5.html" class="external"&gt;disabling unwanted services&lt;/a&gt;. But still I think that the FC3 was faster. I am going to upgrade my RAM to 1GB from the current 512 MB - maybe that will solve the problem.&lt;/p&gt;

&lt;p&gt;If nothing works, I will install a 32 bit version of FC5. I will have to re-configure everything - but &lt;strong&gt;I need speed.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/linux" rel="tag"&gt;linux&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/fedora" rel="tag"&gt;fedora&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/core" rel="tag"&gt;core&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/64bit" rel="tag"&gt;64bit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/32bit" rel="tag"&gt;32bit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/wine" rel="tag"&gt;wine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/09/fedora-core-5-64bit-vs-32bit.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/2591766938765279155"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/2591766938765279155"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/8761503415736750631</id><published>2006-09-12T18:37:00.000+05:30</published><updated>2006-09-12T18:38:59.192+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type="text">Object Oriented Programing(OOP) in JavaScript</title><content type="html">&lt;p class="intro"&gt;A quick link dump on JavaScript inheritance and other &lt;abbr title="Object Oriented Programing"&gt;OOP&lt;/abbr&gt; techniques that are almost never used when coding in JavaScript.&lt;/p&gt;

&lt;dl&gt;
&lt;dt&gt;&lt;a class="external" href=""&gt;Classical Inheritance in JavaScript&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;JavaScript is a class-free, object-oriented language, and as such, it uses prototypal inheritance instead of classical inheritance. This can be puzzling to programmers trained in conventional object-oriented languages like C++ and Java. JavaScript's prototypal inheritance has more expressive power than classical inheritance. By Douglas Crockford&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://www.crockford.com/javascript/private.html"&gt;Private Members in JavaScript&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;Some believe that javascript lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can have private members. Here's how. Again, by Douglas Crockford&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://www.dustindiaz.com/javascript-private-public-privileged/"&gt;How to achieve private, public, and privileged members in JavaScript&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;One core thing about JavaScript that tends to confuse people is how to get private, public, and privileged members. First off one might even question the fact of whether or not they’re useful or needed - and to one degree, they’re not. But like any OOP language that allows for declaration of private and public members, there’s not even a need for them there as well. By Dustin Diaz&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://www.dustindiaz.com/namespace-your-javascript/"&gt;Namespacing your JavaScript&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;Perhaps a very uncommon approach to developing web applications that require JavaScript (but should be more common) is namespacing your scripts. This can be done very simple-like in a manner that is painless and nice-looking. By Dustin Diaz&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://www.litotes.demon.co.uk/js_info/private_static.html"&gt;Private Static Members in Javascript&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;It was a widely held belief that javascript objects could not have private instance members, that all javascript object properties where public and could be accessed and changed with external code.&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://phrogz.net/JS/Classes/OOPinJS.html"&gt;OOP in JS, Part 1 - Public/Private Variables and Methods&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;This page shows how to create private variables and methods in classes in Javascript through the rather simple example of a person.&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://phrogz.net/JS/Classes/OOPinJS2.html"&gt;OOP in JS, Part 2 : Inheritance&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;This section discusses inheritance in Javascript.&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://www.cs.rit.edu/~atk/JavaScript/manuals/jsobj/"&gt;Object Hierarchy and Inheritance in JavaScript&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;JavaScript is an object-oriented language based on prototypes, rather than, as is common, being class-based. Because of this different basis, it can be less apparent how JavaScript allows you to create hierarchies of objects and to have inheritance of properties and their values. This paper attempts to clarify the situation.&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://www.xml.com/pub/a/2006/06/07/object-oriented-javascript.html"&gt;Object-oriented JavaScript&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;JavaScript is not generally considered a robust programming language, especially when compared to languages such as Java or C#: it is interpreted, rather than compiled; it is dynamically, rather than statically, typed; and it is commonly considered a procedural, rather than an object-oriented, language.&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://www.sitepoint.com/article/oriented-programming-1"&gt;JavaScript Object-Oriented Programming&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;It may be shocking news, but JavaScript is a very powerful object-based (or prototype-based, whatever you wish to call it) language. Yes, JavaScript is a powerful language, not just something that's handy for image rollovers and other corny, flashy effects. However, very few people who have used JavaScript realize its capabilities. If you're one of these people, this tutorial is aimed at you.&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://www.javascriptkit.com/javatutors/oopjs.shtml"&gt;JavaScript and Object Oriented Programming (OOP)&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;JavaScript is an excellent language to write object oriented web applications. It can support OOP because it supports inheritance through prototyping as well as properties and methods. Many developers cast off JS as a suitable OOP language because they are so used to the class style of C# and Java. Many people don't realize that JavaScript supports inheritance.&lt;/dd&gt;
&lt;dt&gt;&lt;a class="external" href="http://www.ajaxpath.com/javascript-inheritance"&gt;Introducing the best Javascript Inheritance Technique&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;Every programmer who's tried to apply classical Object Oriented techniques when developing with JavaScript, has at one time or another asked themselves the question: How do you call or invoke a super class method?&lt;/dd&gt;
&lt;/dl&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/javascript" rel="tag"&gt;javascript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/object" rel="tag"&gt;object&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/inheritance" rel="tag"&gt;inheritance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/oops" rel="tag"&gt;oops&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/09/object-oriented-programingoop-in.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/8761503415736750631"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/8761503415736750631"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/2649519409220433565</id><published>2006-09-06T10:04:00.000+05:30</published><updated>2006-09-06T10:05:39.814+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogger"/><title type="text">Blogger Beta</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/6782/1621/1600/blogger_wysiwyg_templating.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger2/6782/1621/200/blogger_wysiwyg_templating.png" border="0" alt="" /&gt;&lt;/a&gt;
&lt;p class="intro"&gt;I have &lt;strong&gt;upgraded to Blogger Beta&lt;/strong&gt; - now I can access many more features - like &lt;a href="http://help.blogger.com/bin/answer.py?answer=44498" class="external"&gt;labels&lt;/a&gt;, &lt;a href="http://help.blogger.com/bin/answer.py?answer=43708" class="external"&gt;WYSIWYG template modification&lt;/a&gt; etc. Since I use a customized blog design, it has not been easy. In fact, it was quite hard. But was it worth it? I don't know yet.&lt;/p&gt;

&lt;h2&gt;New templating Language&lt;/h2&gt;

&lt;p&gt;The templating language has been changed entirely. Many new features have been added - and the complexity have gone up greatly. I understood the language - but I don't think anyone without a programming background would spend enough time to study it.&lt;/p&gt;

&lt;h3&gt;Loops&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;&amp;lt;b:loop ... &amp;gt;&lt;/code&gt; tag lets you repeat a section of content multiple times with little or no changes. Example...&lt;/p&gt;

&lt;pre&gt;&lt;code class="xml"&gt;&amp;lt;b:loop var='post' values='data:posts'&amp;gt;
   &amp;lt;h2&amp;gt;&amp;lt;data:post.title/&amp;gt;&amp;lt;/h2&amp;gt;
&amp;lt;/b:loop&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Conditional Statement - If/Else&lt;/h3&gt;

&lt;p&gt;Shows the content only if the given statement is true(or false). Example...&lt;/p&gt;

&lt;pre&gt;&lt;code class="xml"&gt;&amp;lt;b:if cond='data:blog.url == data:blog.homepageUrl'&amp;gt;
 &amp;lt;data:title/&amp;gt;
&amp;lt;b:else/&amp;gt;
 &amp;lt;a expr:href='data:blog.homepageUrl'&amp;gt;&amp;lt;data:title/&amp;gt;&amp;lt;/a&amp;gt;
&amp;lt;/b:if&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Section - Widget - Include&lt;/h3&gt;

&lt;p&gt;The Section/Widget/Include system make the Drag and Drop template editing system possible. The section is a top level container which can contain multiple widgets. A widget can have many 'includable's. The includable with the id 'main' will be shown by default. You can display the other includable using the code '&amp;lt;b:include name='ID_OF_INCLUDABLE'/&amp;gt; Some sample code - this code shows the header of this blog...&lt;/p&gt;

&lt;pre&gt;&lt;code class="xml"&gt;&amp;lt;b:section class='header' id='header' maxwidgets='1' showaddelement='no'&amp;gt;
&amp;lt;b:widget id='Header1' locked='true' title='Bin-Blog (Header)' type='Header'&amp;gt;
&amp;lt;b:includable id='main'&amp;gt;
&amp;lt;h1 id="blog-title"&amp;gt;
&amp;lt;b:if cond='data:blog.url == data:blog.homepageUrl'&amp;gt;
&amp;lt;data:title/&amp;gt;
&amp;lt;b:else/&amp;gt;
&amp;lt;a expr:href='data:blog.homepageUrl'&amp;gt;&amp;lt;data:title/&amp;gt;&amp;lt;/a&amp;gt;
&amp;lt;/b:if&amp;gt;
&amp;lt;/h1&amp;gt;
&amp;lt;p id="description"&amp;gt;&amp;lt;data:description/&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/b:includable&amp;gt;
&amp;lt;/b:widget&amp;gt;
&amp;lt;/b:section&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Very powerful - but complicated.&lt;/p&gt;

&lt;h2&gt;In Conclusion&lt;/h2&gt;

&lt;p&gt;I like the new templating system - it is complicated, but very powerful. If you are willing to spend the time to study it, you can make magic. Kudos to the Blogger team for bringing it out.&lt;/p&gt;

&lt;p&gt;If you notice any problem this blog, let me know. I not have tested this in IE yet - &lt;a href="http://binnyva.blogspot.com/2006/09/fedora-core-5.html" class="internal" title="Fedora Core 5"&gt;I have linux&lt;/a&gt; remember?&lt;/p&gt;

&lt;p&gt;Did you move your blog to blogger beta? Why not? If you did, how did it go? Leave some comments.&lt;/p&gt;

&lt;h2&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.wilkinsons.com/Bananna/2006/08/deconstructing-blogger-beta-html.html" class="external"&gt;Deconstructing Blogger Beta&lt;/a&gt; - A comprehensive explanation of the blogger beta templating system.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://help.blogger.com/bin/topic.py?topic=9084" class="external"&gt;New Features&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://help.blogger.com/bin/answer.py?answer=46870" class="external"&gt;Can I edit the HTML of my blog's layout?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://help.blogger.com/bin/answer.py?answer=46888" class="external"&gt;Page Elements Tags for Layouts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://help.blogger.com/bin/answer.py?answer=46871" class="external"&gt;Fonts and Colors Tags for Layouts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://help.blogger.com/bin/answer.py?answer=46995" class="external"&gt;Widget Tags for Layouts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://help.blogger.com/bin/answer.py?answer=47270" class="external"&gt;Layouts Data Tags&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/blogger" rel="tag"&gt;blogger&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/09/blogger-beta.html"/><link rel="related" href="http://beta.blogger.com/"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/2649519409220433565"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/2649519409220433565"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/5560242117555328291</id><published>2006-09-03T22:52:00.000+05:30</published><updated>2006-09-03T22:54:10.655+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="personal"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type="text">Fedora Core 5</title><content type="html">&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger2/6782/1621/400/fedora.png" border="0" alt="Fedora Core 5" /&gt;
&lt;p class="intro"&gt;I have upgraded from &lt;A href="http://binnyva.blogspot.com/2006/02/kde-gnome-and-nautilus.html" class="internal"&gt;Linux Fedora Core 3&lt;/A&gt; to Fedora Core 5. I still have to not configured it fully, so a complete review will have to wait.&lt;/p&gt;

&lt;p&gt;I had a few troubles getting Firefox to work as I need it - and I have great difficulty in believing that they did not include XMMS in the distro. Other than that, I am mostly satisfied with the OS.&lt;/p&gt;

&lt;p&gt;More details and a decent review will be posted when I have finished configuring the system.&lt;/p&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/linux" rel="tag"&gt;linux&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/fedora" rel="tag"&gt;fedora&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/09/fedora-core-5.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/5560242117555328291"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/5560242117555328291"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/1596893728550450278</id><published>2006-08-28T23:23:00.000+05:30</published><updated>2006-08-28T23:31:09.374+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type="text">MySQL Storage Engines - MyISAM, InnoDB and others</title><content type="html">&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger2/6782/1621/400/mysql_logo.gif" border="0" alt="" /&gt;
&lt;p class="intro"&gt;&lt;a href="http://www.mysql.com/" class="external"&gt;MySQL&lt;/a&gt; has a feature called Storage Engines - it supports multiple independent storage engines that can be used as handlers for different table types. Each table can be stored in a way that is most optimized for that particular table.&lt;/p&gt;

&lt;p&gt;With this system, the &lt;strong class="highlight"&gt;developer can choose how a table must be stored&lt;/strong&gt; - he can chose which storage engine is best for that particular situation. For example in a content management system, the table containing the contents will be read more often - so we will chose a storage engine better optimized for reading data(eg. MyISAM). But in the case of the table storing the logs, it must be written more often - so we chose a storage engine that is better at writing for that table. Having multiple storage engine makes sure that you can get the best optimization for any given situation.&lt;/p&gt;


&lt;p&gt;There are &lt;a href="http://blog.develix.com/frog/user/cliff/article/2006-06-04/9" class="external"&gt;many who believe this is a Bad Thing&lt;/a&gt;. In most other &lt;abbr title="DataBase Management System"&gt;DBMS&lt;/abbr&gt;, the Administrator don't have to worry about such details - the DBMS will take care of this. I don't want to take sides in this debate - as for many people, this has become a religious issue. Anyway, as I am writing a &lt;a href="http://binnyva.blogspot.com/2006/08/mysql-database-management-system.htmlMySQL - Database Management System" class="internal" title="MySQL - Database Management System"&gt;series on MySQL&lt;/a&gt;, I cannot ignore this very important feature of MySQL.&lt;/p&gt;

&lt;p&gt;I have only used two of MySQL many Storage Engines - MyISAM and InnoDB. The rest, I have not uses yet. Someday.&lt;/p&gt;

&lt;h2&gt;MyISAM&lt;/h2&gt;

&lt;p&gt;MyISAM is the default storage engine for MySQL. If you create a table in MySQL, without paying any attention to select a specific engine, then that table will be created in MyISAM(by default). This storage engine is the best for &lt;strong class="highlight"&gt;high-speed storage and retrieval&lt;/strong&gt;. It also supports &lt;strong class="highlight"&gt;fulltext searching capabilities&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;MyISAM is supported in all MySQL configurations. This engine is used for Data warehousing, read-only archives optimized for bulk operations, etc. as it is the best solution when you want flexible index formats, big scans and has a small disk footprint for data and index. This is not suitable for a typical &lt;a href="http://en.wikipedia.org/wiki/OLTP" class="external"&gt;OLTP&lt;/a&gt; application because of table-level locking, bad crash durability and lack of &lt;a href="http://en.wikipedia.org/wiki/ACID" class="external"&gt;ACID&lt;/a&gt; compliance.&lt;/p&gt;

&lt;h2&gt;InnoDB&lt;/h2&gt;

&lt;p&gt;The &lt;a href="http://en.wikipedia.org/wiki/InnoDB" class="external"&gt;InnoDB storage engine&lt;/a&gt; provide transaction-safe tables(BDB also does this). InnoDB is also included by default in all MySQL 5.0 binary distributions. This engine supports...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Row level locking&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Mvcc" class="external" title="Multiversion Concurrency Control"&gt;MVCC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Savepoints within transactions&lt;/li&gt;
&lt;li&gt;More features for typical OLTP applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the main advantage of this engine is that you can rollback to a previous version of the database using its &lt;strong class="highlight"&gt;COMMIT/ROLLBACK support&lt;/strong&gt;. InnoDB engine is more reliable than MyISAM.&lt;/p&gt;

&lt;h2&gt;Memory&lt;/h2&gt;

&lt;p&gt;The MEMORY storage engine provides &lt;strong class="highlight"&gt;in-memory tables&lt;/strong&gt;. The MERGE storage engine will let you handle many identical MyISAM tables as a single table. Like MyISAM, the MEMORY and MERGE storage engines handle non-transactional tables, and both are also included in MySQL by default.&lt;/p&gt;

&lt;p&gt;The main advantages of the MEMORY Storage engine are...&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No disk footprint&lt;/li&gt;
&lt;li&gt;Extremely fast&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is most useful for...&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Summary tables&lt;/li&gt;
&lt;li&gt;Simulations&lt;/li&gt;
&lt;li&gt;Temporary operations(sessions etc)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;CSV&lt;/h2&gt;

&lt;p&gt;The &lt;abbr title="Comma Seperated Values"&gt;CSV&lt;/abbr&gt; storage engine &lt;strong class="highlight"&gt;stores data in text files using comma-separated values format&lt;/strong&gt;. The main advantages of this approach are...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Very simple - data stored in plain text files&lt;/li&gt;
&lt;li&gt;The database can be modified without the server&lt;/li&gt;
&lt;li&gt;Export/Import couldn't be easier.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Other Storage Engines&lt;/h2&gt;

&lt;p&gt;There are many other storage engines supported by MySQL. Some of them are...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NDB Cluster&lt;/li&gt;
&lt;li&gt;ARCHIVE&lt;/li&gt;
&lt;li&gt;BLACKHOLE&lt;/li&gt;
&lt;li&gt;FEDERATED&lt;/li&gt;
&lt;li&gt;Falcon&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are not satisfied with any of these engines, you can write your own engine.&lt;/p&gt;


&lt;h2&gt;Reference&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.linuxplanet.com/linuxplanet/tutorials/6034/2/" class="external"&gt;MySQL Storage Engines&lt;/a&gt; - 8 part series on MySQL Storage Engines&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.devshed.com/c/a/MySQL/Storage-Engine-Table-Types/" class="external"&gt;Storage Engine (Table Types)&lt;/a&gt; - 15 part series&lt;/li&gt;
&lt;li&gt;&lt;a href="http://dev.mysql.com/tech-resources/articles/storage-engine/part_1.html" class="external"&gt;MySQL AB :: MySQL Storage Engine Architecture, Part 1: An Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://mysql.com/doc/refman/5.0/en/storage-engines.html" class="external"&gt;Storage Engines and Table Types&lt;/a&gt; - MySQL Reference Manual&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/mysql" rel="tag"&gt;mysql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/database" rel="tag"&gt;database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/dbms" rel="tag"&gt;dbms&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/storage" rel="tag"&gt;storage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/engines" rel="tag"&gt;engines&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/08/mysql-storage-engines-myisam-innodb-and.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/1596893728550450278"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/1596893728550450278"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/5359271652368128370</id><published>2006-08-24T23:17:00.000+05:30</published><updated>2006-08-25T00:24:13.069+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="scripts"/><title type="text">Live Validator - JavaScript Field Validation Scrip...</title><content type="html">&lt;p class="intro"&gt;Live Validator is a JavaScript program that will validate any form field as the user types the data using the regular expressions that you have specified.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.openjs.com/scripts/forms/live_validation/" class="mypages"&gt;Live Validator 1.00.A Beta&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.openjs.com/scripts/forms/live_validation/documentation.php" class="mypages"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.openjs.com/scripts/forms/live_validation/live_validation.js" class="mypages download"&gt;Live Validator Code (4.2 KB)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Features&lt;/h2&gt;

&lt;dl&gt;
&lt;dt&gt;Key Validation&lt;/dt&gt;
&lt;dd&gt;Valides the key as you type it. For example, if you just want numbers in a field, the user will not be allowed to enter alphabets.&lt;/dd&gt;
&lt;dt&gt;Live Validation feedback&lt;/dt&gt;
&lt;dd&gt;If the field validates, the color of the element will change&lt;/dd&gt;
&lt;dt&gt;Attach a form to the validation.&lt;/dt&gt;
&lt;dd&gt;This will show error when the form is submitted&lt;/dd&gt;
&lt;dt&gt;Reasonable size&lt;/dt&gt;
&lt;dd&gt;4.2 KB uncompressed&lt;/dd&gt;
&lt;dt&gt;Works in most major browsers.&lt;/dt&gt;
&lt;dd&gt;At least the ones I tested in - Firefox 1.5/Linux, Firefox 1.5/Windows, IE 6, Opera 9/Linux, Opera/Windows&lt;/dd&gt;
&lt;dt&gt;And more...&lt;/dt&gt;
&lt;dd&gt;Many more features...&lt;/dd&gt;
&lt;/dl&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/6782/1621/1600/validation.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger2/6782/1621/320/validation.png" border="0" alt="" /&gt;&lt;/a&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/javascript" rel="tag"&gt;javascript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/form" rel="tag"&gt;form&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/validation" rel="tag"&gt;validation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/library" rel="tag"&gt;library&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/08/live-validator-javascript-field.html"/><link rel="related" href="http://www.openjs.com/scripts/forms/live_validation/"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/5359271652368128370"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/5359271652368128370"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115609734487874959</id><published>2006-08-20T23:25:00.000+05:30</published><updated>2006-08-20T23:45:30.100+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type="text">phpMyAdmin Tips and Tricks - Database Backup and R...</title><content type="html">&lt;p class="intro"&gt;&lt;a href="http://www.phpmyadmin.net/" class="external"&gt;phpMyAdmin&lt;/a&gt; is a big software - there are features that I have not used yet. But there are some features that are not very obvious - but could save you a lot of time.&lt;/p&gt;

&lt;h2&gt;Quick Table Browse&lt;/h2&gt;

&lt;p&gt;The normal way to seeing the contents of a table is to click on the table name in the left pane and then click on the 'Browse' tab in the top. But there is a one click way to do this - &lt;strong class="highlight"&gt;click on the small icon next to the table name in the left pane&lt;/strong&gt;.&lt;/p&gt;

&lt;img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/674/1162/400/quick_browse.png" border="0" alt="Click icon to browse table" /&gt;

&lt;h2&gt;Default Table Selection&lt;/h2&gt;

&lt;p&gt;When you access phpMyAdmin, you get the main page - after that you have to chose from the drop down which database should be used. Wouldn't it be useful if the database you use most would be automatically selected on loading? You can do this by accessing phpMyAdmin using the following URL.&lt;/p&gt;

&lt;pre&gt;http://localhost/phpMyAdmin/?db=my_fav_db&lt;/pre&gt;

&lt;p&gt;You will have to change the database name and the location to the one in your system - but you got the idea right?&lt;/p&gt;

&lt;h2&gt;Database Backup&lt;/h2&gt;

There are many ways to take a database backup using phpMyAdmin - but my favorite way is to take an &lt;abbr title="Structured Query Language"&gt;SQL&lt;/abbr&gt; Dump. 

&lt;p&gt;Select the database you want to backup and &lt;strong class="highlight"&gt;click 'Export' tab&lt;/strong&gt; in the main frame. Now &lt;strong class="highlight"&gt;select all the tables&lt;/strong&gt; in the select box. You can select the format of the backup - like SQL, CSV, XML etc. We will select the SQL option. It is recommended that you &lt;strong class="highlight"&gt;check the 'Add DROP TABLE' and 'Add IF NOT EXISTS' checkboxs&lt;/strong&gt;. This will make sure that the existing tables will be removed when restoring the backup. Now check the 'Save as file' checkbox. Then click the 'Go' button. Now you should see a download option for the database backup. You can save this file to you harddisk and run it later if you want to restore the backup. If you did not check the 'Save as file' option, the SQL dump will be shown in a textarea.&lt;/p&gt;

&lt;p&gt;This can also be done using the 'mysqldump' command in linux using the following command.&lt;/p&gt;

&lt;pre&gt;mysqldump --add-drop-table --user=root DATABASE&gt; backup_file.sql&lt;/pre&gt;

&lt;h2&gt;Table Backup&lt;/h2&gt;

&lt;p&gt;If you just need the backup of a single table, select that table from the table list in the left pane and click the 'Export' tab. Now do the steps described in the database backup section. Here only the selected table will be backuped.&lt;/p&gt;

&lt;p&gt;This can be done using the following command.&lt;/p&gt;

&lt;pre&gt;mysqldump --add-drop-table --user=root DATABASE TABLE&gt; backup_file.sql&lt;/pre&gt;

&lt;h2&gt;Restoring a backup&lt;/h2&gt;

&lt;p&gt;Click the 'SQL' icon(&lt;img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/674/1162/400/sql_icon.png" border="0" alt="SQL Icon" /&gt;) in the left pane - this will open a popup. Paste the SQL code you when you backuped the database in the textarea in this popup. Alternatively, you can chose the 'Import Files' tab in this popup and chose the location of the file you saved when backing up the data.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;not a recommended method to restore large backup&lt;/strong&gt; - if the backup file is more than 1 MB, don't try this. A better method is to upload the backup file to you host and restore the backup using the shell.&lt;/p&gt;

&lt;!--&lt;p&gt;Use this command to import the table from a file&lt;/p&gt;

&lt;pre&gt;mysqlimport --user=root DATABASE backup_file.sql&lt;/pre&gt;--&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/database" rel="tag"&gt;database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/mysql" rel="tag"&gt;mysql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/phpmyadmin" rel="tag"&gt;phpmyadmin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/08/phpmyadmin-tips-and-tricks-database.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115609734487874959"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115609734487874959"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115531653488849489</id><published>2006-08-11T22:42:00.000+05:30</published><updated>2006-08-15T23:31:29.853+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type="text">Installing and Configuring phpMyAdmin</title><content type="html">&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/674/1162/400/phpmyadmin.png" border="0" alt="phpMyAdmin Logo" /&gt;

&lt;p class="intro"&gt;In the last post, I &lt;a href="http://binnyva.blogspot.com/2006/08/managing-databases-with-mysql-clients.html" title="Managing Databases with MySQL Clients - phpMyAdmin" class="internal"&gt;introduced phpMyAdmin&lt;/a&gt;. In this, we will deal with installation and configuration of &lt;a href="http://www.phpmyadmin.net/" class="external"&gt;phpMyAdmin&lt;/a&gt;.&lt;/p&gt;

&lt;p class="update"&gt;UPDATE: This installation manual is for the older versions on phpMyAdmin. To see how to install the latest version, see the post &lt;a href="http://binnyva.blogspot.com/2006/08/installing-phpmyadmin-28.html" class="internal" title="Installing phpMyAdmin 2.8"&gt;Installing phpMyAdmin 2.8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My aim is to &lt;strong&gt;create a tool that could be used to administer your database in a development server&lt;/strong&gt;. These directions are &lt;strong&gt;NOT for a production server&lt;/strong&gt;. You will need much more security when installing phpMyAdmin on a production server. A good source for information on how to install phpMyAdmin securely is the series '&lt;a href="http://www.devshed.com/c/a/PHP/Doing-More-With-phpMyAdmin-Part-1/" class="external"&gt;Doing more with phpMyAdmin&lt;/a&gt;'.&lt;/p&gt;

&lt;h2&gt;Installation phpMyAdmin&lt;/h2&gt;

&lt;p&gt;Get the latest version of phpMyAdmin from &lt;a href="http://www.phpmyadmin.net/" class="external"&gt;phpMyAdmin.net&lt;/a&gt;. The files will compressed - so you will have to extract it.&lt;/p&gt;

&lt;p&gt;Create a &lt;strong&gt;folder called 'phpMyAdmin'&lt;/strong&gt; in the &lt;strong&gt;document root&lt;/strong&gt; of your server and &lt;strong&gt;extract&lt;/strong&gt; the PHP scripts into it. That's it - the installing part is over.&lt;/p&gt;

&lt;h3&gt;Configuring phpMyAdmin&lt;/h3&gt;
&lt;h4&gt;Necessary Information&lt;/h4&gt;
&lt;p&gt;Now we have to configure it - before starting this, make sure you have the following details...&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Database Server address&lt;/li&gt;
&lt;li&gt;Database Username&lt;/li&gt;
&lt;li&gt;Database Password&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the sake of example I am going to assume that the following values...&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Server : 'localhost'&lt;/li&gt;
&lt;li&gt;Username : 'root'&lt;/li&gt;
&lt;li&gt;Password : ''&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using the 'root' user with an empty password is one of the worst security blunders you can make - but what the hell, we are on a development server, right?&lt;/p&gt;

&lt;h4&gt;Editing 'config.inc.php'&lt;/h4&gt;

&lt;p&gt;Open up the file 'config.inc.php' in your &lt;a href="http://binnyva.blogspot.com/2006/05/web-development-in-linux.html" class="internal" title="Web Development in Linux"&gt;favorite editor&lt;/a&gt; and edit the following values...&lt;/p&gt;

&lt;pre&gt;&lt;code class="javascript"&gt;$cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin/';&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is the &lt;strong&gt;absolute path for your phpMyAdmin directory&lt;/strong&gt;. If you enter this location into a browser, phpMyAdmin should show up. I will not recommend that you use 'localhost' as the domain if you are on a network and expect others to connect to this phpMyAdmin setup. You should use 'http://&amp;lt;YOUR IP&amp;lt;/phpMyAdmin/' in such a case. However if you are using phpMyAdmin for just your system, localhost will do fine.&lt;/p&gt;

&lt;pre&gt;&lt;code class="javascript"&gt;$cfg['Servers'][$i]['host'] = 'localhost';&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is the &lt;strong&gt;database server address&lt;/strong&gt;. If you look at the following lines in the file, you will notice that there is more than one instance of this line. This is for managing more that one database server using just one phpMyAdmin. Make sure that all the other hosts are set to empty - phpMyAdmin will ignore it if it is empty.&lt;/p&gt;

&lt;pre&gt;&lt;code class="javascript"&gt;$cfg['Servers'][$i]['user'] = 'root';&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;strong&gt;database user&lt;/strong&gt; - in our case 'root'. Only the first instance of the line should be set - the other will be ignored if the 'host' option is not set.&lt;/p&gt;

&lt;pre&gt;&lt;code class="javascript"&gt;$cfg['Servers'][$i]['password'] = '';&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;strong&gt;password for the above given user&lt;/strong&gt; - in this example we are using an empty password.&lt;/p&gt;

&lt;p&gt;There are many other options - but you will not have to worry about them - they will do fine with their default values. However, if you are adventurous, feel free to experiment with the configuration options. The file well commented in detail - so you will have no trouble finding your way around - if you know a bit of &lt;abbr title="PHP : Hypertext Preprocessor"&gt;PHP&lt;/abbr&gt;.&lt;/p&gt;

&lt;p&gt;After all this is done, open up a &lt;a href="http://binnyva.blogspot.com/2006/05/browsers-for-web-development-in-linux.html" class="internal" title="Browsers for Web Development in Linux"&gt;browser&lt;/a&gt; and point it to &lt;a href="http://localhost/phpMyAdmin/" class="local" title="Link may fail"&gt;http://localhost/phpMyAdmin/&lt;/a&gt;. If all went well, you will get the front page of phpMyAdmin.&lt;/p&gt;

&lt;h3&gt;References&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.phpmyadmin.net/" class="external"&gt;phpMyAdmin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.phpmyadmin.net/home_page/docs.php#quick_install" class="external"&gt;Installing phpMyAdmin - Official Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.devshed.com/c/a/PHP/Doing-More-With-phpMyAdmin-Part-1/" class="external"&gt;Doing More With phpMyAdmin&lt;/a&gt; - A 7 part tutorial for configuring and using phpMyAdmin&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/mysql" rel="tag"&gt;mysql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/phpmyadmin" rel="tag"&gt;phpmyadmin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/database" rel="tag"&gt;database&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/08/installing-and-configuring-phpmyadmin.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115531653488849489"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115531653488849489"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115566416883777145</id><published>2006-08-15T23:11:00.000+05:30</published><updated>2006-08-15T23:19:29.136+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type="text">Installing phpMyAdmin 2.8</title><content type="html">&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/674/1162/400/phpmyadmin.png" border="0" alt="phpMyAdmin Logo" /&gt;
&lt;p class="intro"&gt;The &lt;a href="http://binnyva.blogspot.com/2006/08/installing-and-configuring-phpmyadmin.html" class="internal" title="Installing and Configuring phpMyAdmin"&gt;install instructions I provided earlier&lt;/a&gt; will only work in the earlier versions of &lt;a href="http://binnyva.blogspot.com/2006/08/managing-databases-with-mysql-clients.html" class="internal" title="Managing Databases with MySQL Clients - phpMyAdmin"&gt;phpMyAdmin&lt;/a&gt;. The latest version(2.8.2.1 - as of Aug 15, 2006) has a much easier way of doing this.&lt;/p&gt;

&lt;p&gt;Get the latest version of phpMyAdmin from &lt;a href="http://www.phpmyadmin.net/" class="external"&gt;phpMyAdmin.net&lt;/a&gt;. The files will compressed - so you will have to extract it. Create a &lt;strong&gt;folder called 'phpMyAdmin'&lt;/strong&gt; in the &lt;strong&gt;document root&lt;/strong&gt; of your server and &lt;strong&gt;extract&lt;/strong&gt; the PHP scripts into it. That's it - the installing part is over. The latest version will automatically configure itself to run with these settings...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database Host : localhost&lt;/li&gt;
&lt;li&gt;Username : root&lt;/li&gt;
&lt;li&gt;Password : (Empty)&lt;/li&gt;
&lt;/ul&gt;

For the example we provided the last time, this is all that is needed. But if you wish to configure your phpMyAdmin using more advanced options, &lt;strong&gt;open the folder you installed phpMyAdmin&lt;/strong&gt; to(&amp;lt;Document Root/phpMyAdmin/&amp;gt;) and &lt;strong&gt;create a folder called 'config'&lt;/strong&gt;. Make sure it has write permission. You can &lt;strong&gt;give it write permission&lt;/strong&gt; with the following command(assuming that your are on a linux system)...

&lt;pre&gt;chmod 666 config&lt;/pre&gt;

&lt;p&gt;Now &lt;strong&gt;open the URL &lt;a href="http://localhost/phpMyAdmin/scripts/setup.php" class="local" title="Link may not work"&gt;http://localhost/phpMyAdmin/scripts/setup.php&lt;/a&gt;.&lt;/strong&gt; This will help you configure your phpMyAdmin.&lt;/p&gt;

&lt;p&gt;The configuration is very straight forward - so I am not providing much details about it. If you have any doubt, reffer the &lt;a href="http://localhost/phpMyAdmin/Documentation.html" class="local" title="Links to your machine"&gt;documentation&lt;/a&gt; that comes with the installation.&lt;/p&gt;

&lt;p&gt;After you have finished configuration, &lt;strong&gt;click on the 'Save' Button&lt;/strong&gt; in the 'Configuration' section. This will create a 'config.inc.php' file inside the 'config' folder that we created earlier. You will have to manually copy this config file to you phpMyAdmin folder. After this is done, delete the config folder. You can do this with the command...&lt;/p&gt;

&lt;pre&gt;mv config/config.inc.php .
rmdir config&lt;/pre&gt;

&lt;p&gt;On a personal note, I still prefer the 2.6 Version of phpMyAdmin. Some pages in the latest version have a tendency to create horizontal scroll bars even on 1024x768 resolution.&lt;/p&gt;


&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/mysql" rel="tag"&gt;mysql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/phpmyadmin" rel="tag"&gt;phpmyadmin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/database" rel="tag"&gt;database&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/08/installing-phpmyadmin-28.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115566416883777145"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115566416883777145"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115497229306917281</id><published>2006-08-07T23:01:00.000+05:30</published><updated>2006-08-07T23:08:13.086+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type="text">Managing Databases with MySQL Clients - phpMyAdmin...</title><content type="html">&lt;p class="intro"&gt;There are many MySQL Clients(or database administration tools) out there - &lt;a href="http://www.mysqlfront.de/" class="external"&gt;MySQL Front End&lt;/a&gt;, &lt;a href="http://tora.sourceforge.net/" class="external"&gt;Tora&lt;/a&gt;, mysql etc. But in the web environment, one client rules - &lt;a href="http://www.phpmyadmin.net/" class="external"&gt;phpMyAdmin&lt;/a&gt;. phpMyAdmin is a &lt;strong&gt;&lt;abbr title="PHP: Hypertext Preprocessor"&gt;PHP&lt;/abbr&gt; based(obviously) &lt;abbr title="Graphical User Interface"&gt;GUI&lt;/abbr&gt; administration tool for MySQL.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I began programming in Linux, I could not use the DB Administration tool my co-workers were using. They were using MySQL Front End - and only the windows version was available for it. Since no one in my office used Linux, none knew another &lt;abbr title="DataBase Administration"&gt;DBA&lt;/abbr&gt; for Linux. One suggested Tora, but I could not get it to run - some dependencies were missing. Anyway, I was forced to use &lt;code&gt;mysql&lt;/code&gt; - yes, the command line client that came with MySQL Server. You can start it by bringing up a terminal and entering 'mysql' into it. Then you type every &lt;abbr title="Stuctured Query Language"&gt;SQL&lt;/abbr&gt; command you want to execute into it. Trust me, it was not fun. The biggest problems was that I want to copy something and press 'Ctrl+C' - in the terminal 'Ctrl+C' is not Copy - its Close. So the client goes down. It was very irritating. Anyway I found phpMyAdmin before long and have been using it ever since(even after I got Tora running).&lt;/p&gt;

&lt;p&gt;The biggest advantages of phpMyAdmin is that it is &lt;strong&gt;web based&lt;/strong&gt; - it runs on any server capable of handling PHP. Because of this all the online Database Administration is done using phpMyAdmin. If you have a site of your own, and you have the control panel access to it, you will know what I mean. They database management part will be handled by phpMyAdmin. The phpMyAdmin site cites the following as the &lt;strong&gt;&lt;a href="http://www.phpmyadmin.net/home_page/docs.php#intro" class="external" title="The phpMyAdmin Project Documentation"&gt;features of phpMyAdmin&lt;/a&gt;&lt;/strong&gt;...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Browse, view and drop databases, tables, views, fields and indexes.&lt;/li&gt;
&lt;li&gt;Create, copy, drop, rename and alter databases, tables, fields and indexes.&lt;/li&gt;
&lt;li&gt;Maintenance server, databases and tables, with proposals on server configuration.&lt;/li&gt;
&lt;li&gt;Execute, edit and bookmark any SQL-statement, even batch-queries.&lt;/li&gt;
&lt;li&gt;Create and read dumps of tables - in various formats like CSV, SQL, etc.&lt;/li&gt;
&lt;li&gt;Export data to various formats: CSV, SQL, XML, Excel and more.&lt;/li&gt;
&lt;li&gt;Administer multiple servers.&lt;/li&gt;
&lt;li&gt;Manage MySQL users and privileges.&lt;/li&gt;
&lt;li&gt;Check referential integrity in MyISAM tables.&lt;/li&gt;
&lt;li&gt;Using Query-by-example (QBE), create complex queries automatically connecting required tables.&lt;/li&gt;
&lt;li&gt;Search globally in a database or a subset of it.&lt;/li&gt;
&lt;li&gt;Support InnoDB tables and &lt;a href="http://www.phpmyadmin.net/home_page/docs.php#faq1_17"&gt;foreign keys&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.phpmyadmin.net/home_page/docs.php#faq1_17"&gt;Support mysqli&lt;/a&gt;, the improved MySQL extension.&lt;/li&gt;
&lt;li&gt;And more...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;phpMyAdmin is so commonly used that there is a book - &lt;a href="http://www.packtpub.com/view_book/isbn/1904811035"&gt;Mastering phpMyAdmin for effective MySQL Management&lt;/a&gt; - that aims to teach it.&lt;/p&gt;

&lt;h3&gt;Reference&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.phpmyadmin.net/home_page/docs.php"&gt;phpMyAdmin Project Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.php-editors.com/articles/sql_phpmyadmin.php"&gt;Learning SQL Using phpMyAdmin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.devshed.com/c/a/PHP/Doing-More-With-phpMyAdmin-Part-1/"&gt;Doing More With phpMyAdmin&lt;/a&gt; - A 7 part tutorial for configuring and using phpMyAdmin.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/mysql" rel="tag"&gt;mysql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/phpmyadmin" rel="tag"&gt;phpmyadmin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/database" rel="tag"&gt;database&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/08/managing-databases-with-mysql-clients.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115497229306917281"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115497229306917281"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115464561996443237</id><published>2006-08-03T04:19:00.000+05:30</published><updated>2006-08-04T04:23:39.990+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type="text">MySQL - Database Management System</title><content type="html">&lt;p class="intro"&gt;In this &lt;abbr title="Linux Apache MySQL PHP/Perl/Python/Ruby"&gt;LAMP&lt;/abbr&gt; series, we have looked at &lt;a href="http://binnyva.blogspot.com/2006/05/web-development-in-linux.html" class="internal" title="Web Development in Linux"&gt;Linux&lt;/a&gt; and &lt;a href="http://binnyva.blogspot.com/2006/06/apache.html" class="internal" title="Apache"&gt;Apache&lt;/a&gt; - now we are going to have a look at MySQL.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.mysql.com/" class="external"&gt;MySQL&lt;/a&gt; is a &lt;strong class="strong"&gt;multithreaded, multi-user, &lt;abbr title="Stuctured Query Language"&gt;SQL&lt;/abbr&gt; based Database Management System(DBMS)&lt;/strong&gt; under &lt;abbr title="GNU General Public License"&gt;GPL&lt;/abbr&gt; license. It have become the &lt;strong class="strong"&gt;most popular open source database&lt;/strong&gt; because of its performance, reliability and ease of use. It is &lt;a href="http://www.mysql.com/why-mysql/" class="external"&gt;said&lt;/a&gt; to have more than 10 million installations.&lt;/p&gt;

&lt;p&gt;The popularity of MySQL as a web application platform is closely tied to the popularity of &lt;abbr title="PHP : Hypertext Preprocessor"&gt;PHP&lt;/abbr&gt;, which is often used with MySQL and nicknamed the &lt;em&gt;Dynamic Duo&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;MySQL have long been my favorite &lt;abbr title="Database Management System"&gt;DBMS&lt;/abbr&gt; because its ease of use and great support in PHP. I have used MySQL in almost all the Web applications I have created over the years. This includes PHP as well as Perl apps. Ruby on Rails, the hottest framework right now, uses MySQL.&lt;/p&gt;

&lt;h2&gt;Features&lt;/h2&gt;

&lt;p&gt;Please note that some of the following features are only present MySQL 5.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cross-platform support&lt;/li&gt;
&lt;li&gt;Stored procedures&lt;/li&gt;
&lt;li&gt;Triggers&lt;/li&gt;
&lt;li&gt;Cursors&lt;/li&gt;
&lt;li&gt;True VARCHAR support&lt;/li&gt;
&lt;li&gt;INFORMATION_SCHEMA&lt;/li&gt;
&lt;li&gt;Multiple independent storage engines(more about this later)&lt;/li&gt;
&lt;li&gt;Transactions with the InnoDB, BDB and Cluster storage engines; savepoints with InnoDB&lt;/li&gt;
&lt;li&gt;SSL support&lt;/li&gt;
&lt;li&gt;Query caching&lt;/li&gt;
&lt;li&gt;Sub-SELECTs (or nested SELECTs)&lt;/li&gt;
&lt;li&gt;Full-text indexing and searching using MyISAM engine&lt;/li&gt;
&lt;li&gt;Embedded database library&lt;/li&gt;
&lt;li&gt;Full Unicode support&lt;/li&gt;
&lt;li&gt;ACID compliance using the InnoDB, BDB and Cluster engines&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Used In&lt;/h2&gt;
&lt;p&gt;Some of the most popular sites using MySQL are given below...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.google.com/" title="Google"&gt;Google&lt;/a&gt; - for Google AdWords&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.yahoo.com/" title="Yahoo!"&gt;Yahoo!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.slashdot.org/" title="Slashdot"&gt;Slashdot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.digg.com/" title="Digg"&gt;Digg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/" title="Wikipedia"&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.craigslist.com" title="Craigslist"&gt;Craigslist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.nasa.gov/" title="NASA"&gt;NASA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.flickr.com/" title="Flickr"&gt;flickr&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.livejournal.com/" title="LiveJournal"&gt;LiveJournal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.friendster.com/" title="Friendster"&gt;Friendster&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/mysql" rel="tag"&gt;mysql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/dbms" rel="tag"&gt;dbms&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/database" rel="tag"&gt;database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/lamp" rel="tag"&gt;lamp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/08/mysql-database-management-system.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115464561996443237"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115464561996443237"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115426143346559990</id><published>2006-07-30T17:33:00.000+05:30</published><updated>2006-07-30T17:54:18.730+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type="text">Multiple Versions of Apache on a Single System</title><content type="html">&lt;p class="intro"&gt;Some times it is necessary to have &lt;strong&gt;multiple versions on Apache&lt;/strong&gt; in your system. The system I am currently working on has two versions of Apache - the first is Apache 1.3 with PHP 4 and MySQL 3. The second apache is Apache 2.0 with PHP 5 and MySQL 5. It is very easy to install multiple versions of Apache in your system - the only limitation is that you can't have all the versions run at once - &lt;strong&gt;only one instance of apache must be running&lt;/strong&gt; at any one point.&lt;/p&gt;

&lt;p&gt;I installed multiple versions of apache by using the '&lt;code&gt;prefix&lt;/code&gt;' keyword while compiling the software. To do this, you must have the source tarball of the apache program. Install it using the commands...&lt;/p&gt;

&lt;pre&gt;./configure --prefix=/usr/local/apache2
make &amp;amp;&amp;amp; make install&lt;/pre&gt;

&lt;p&gt;The &lt;strong&gt;&lt;code&gt;prefix&lt;/code&gt; keyword is the location where apache will be installed&lt;/strong&gt; to. When create multiple installation of apache, keep changing this location - so that the previous installation will not be overwritten. You can start apache using the command...&lt;/p&gt;

&lt;pre&gt;/usr/local/apache2/bin/apachectl start&lt;/pre&gt;

&lt;p&gt;This command will start the apache server at &lt;code&gt;/usr/local/apache2/&lt;/code&gt; folder. The configuration files for this installation will be at &lt;code&gt;/usr/local/apache2/conf/&lt;/code&gt;. Open the folder '/usr/local/apache2/' and you will see the other folders in this directory - like document root, logs etc. You can change the default locations of these folders using the &lt;code&gt;httpd.conf&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Apache can be stopped using any one of the following commands...&lt;/p&gt;

&lt;pre&gt;service httpd stop&lt;/pre&gt;

&lt;p&gt;OR&lt;/p&gt;

&lt;pre&gt;/usr/local/apache2/bin/apachectl stop&lt;/pre&gt;

&lt;p&gt;Make sure that the running instance of Apache is stopped before starting a new instance - else a failure message will be shown. You can do this by using the command line...&lt;/p&gt;

&lt;pre&gt;$ service httpd stop
Stopping httpd:                        [  OK  ]
$ /usr/local/apache2/bin/apachectl start&lt;/pre&gt;

&lt;p&gt;Or you can use a neat script I created in &lt;a href="http://www.bin-co.com/tcl/tutorial/" class="mypages" title="Tcl/Tk Tutorial"&gt;Tcl/Tk&lt;/a&gt;. Save the following code into a file, say, 'ApacheRemote.tcl' and execute it using the command '&lt;code&gt;wish ApacheRemote.tcl&lt;/code&gt;'. NOTE: You must have Tcl/Tk on your system for this to work.&lt;/p&gt;

&lt;pre&gt;&lt;code class="tcl"&gt;
#!/usr/bin/wish
# ApacheRemote V 2.00.A
# http://www.bin-co.com/tcl/

proc showMsg { result } {
 .txt insert end "$result\n"
}

############################### GUI Code ####################################
label .lab_top -text "Apache Remote"
pack .lab_top

frame .frm_common
button .frm_common.but_stop -text "Stop Apache" -command {
 catch { exec "service" "httpd" "stop" } result
 showMsg $result
}
button .frm_common.but_status -text "Status" -command {
 catch { exec "service" "httpd" "status" } result
 showMsg $result
}
pack .frm_common.but_stop .frm_common.but_status -side left
pack .frm_common

frame .frm
button .frm.but_start -text "Start /usr/local" -command {
 catch { exec "/usr/local/apache/bin/apachectl" "start" } result
 showMsg $result
 #exit
}
button .frm.but_start_default -text "Start Default" -command {
 catch { exec "service" "httpd" "start" } result
 showMsg $result
 #exit
}

pack .frm.but_start .frm.but_start_default -side left
pack .frm

#Result Display Area
text .txt 
pack .txt -fill both -expand 1 -side top

bind . &amp;lt;Key-Escape&amp;gt; { exit }
&lt;/code&gt;&lt;/pre&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/apache" rel="tag"&gt;apache&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/lamp" rel="tag"&gt;lamp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/linux" rel="tag"&gt;linux&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/07/multiple-versions-of-apache-on-single.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115426143346559990"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115426143346559990"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115393460638252860</id><published>2006-07-26T22:47:00.000+05:30</published><updated>2006-07-26T22:53:26.400+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><title type="text">Practical Uses for mod_rewrite</title><content type="html">&lt;p class="intro"&gt;I have explained how to &lt;a href="http://binnyva.blogspot.com/2006/07/modrewrite-module-for-apache.html" class="internal" title="mod_rewrite module for Apache"&gt;use mod_rewrite to create structured &lt;abbr title="Universal Resource Locator"&gt;URL&lt;/abbr&gt;s&lt;/a&gt; and about the &lt;a href="http://binnyva.blogspot.com/2006/07/modrewrite-directives-rewritecond-and.html" class="internal" title="mod_rewrite Directives - RewriteCond and RewriteRule"&gt;most used mod_rewrite directives&lt;/a&gt;. Now to see some practical use of mod_rewrite in various situations.&lt;/p&gt;

&lt;h2&gt;URL Change&lt;/h2&gt;

&lt;p&gt;Good URLs don't change - but sometimes you have to do it. Move one file from its previous location to a new one. Even I have done it - I moved my site from &lt;a href="http://www.geocities.com/binnyva/" class="mypages"&gt;http://www.geocities.com/binnyva/&lt;/a&gt; to &lt;a href="http://www.bin-co.com/" class="mypages"&gt;Bin-Co&lt;/a&gt;, &lt;a href="http://www.openjs.com/" class="mypages" title="JavaScript - Opened"&gt;OpenJS&lt;/a&gt; and &lt;a href="http://www.binnyva.com/" class="mypages"&gt;BinnyVA&lt;/a&gt;. When you make such a move, you want to make sure that your visitors move with you. This can be done using mod_rewrite.&lt;/p&gt;

&lt;p&gt;Lets say you are moving the a page from &lt;code&gt;http://www.domain.com/oldfile.html&lt;/code&gt; to &lt;code&gt;http://www.domain.com/stuff/newfile.html&lt;/code&gt;. Now when ever someone visits the oldfile.html file, they get a 404 error. You can use the following script to make sure that &lt;strong class="highlight"&gt;all visitors to the old page is redirected to the new one&lt;/strong&gt;...&lt;/p&gt;

&lt;pre&gt;&lt;code class="mod_rewrite"&gt;
RewriteRule ^oldfile\.html$ http://www.domain.com/stuff/newfile.html [R]

&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Escape the Slashdot Effect&lt;/h2&gt;

&lt;p&gt;Slashdot Effect is a situation when a link to a smaller site appear in a heavy traffic site like &lt;a href="http://www.slashdot.org/" class="external" title="Stuff that matters"&gt;Slashdot&lt;/a&gt; or &lt;a href="http://www.digg.com/" class="external"&gt;Digg&lt;/a&gt;. Due to the huge traffic this brings, many site with low bandwidth will crumble. One method to prevent this is to &lt;strong class="highlight"&gt;deny access to all visitors who have come from the high traffic site&lt;/strong&gt;(let us assume it is slashdot.org). There are other methods also(eg. mirroring). So you have two requirements...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deny access to all from slashdot.org&lt;/li&gt;
&lt;li&gt;Allow access to all others.&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code class="mod_rewrite"&gt;
RewriteCond %{HTTP_REFERER} ^http://slashdot\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://www\.slashdot\.org [NC]
RewriteRule ^.*$ /denied.html [F]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The logic behind the above code goes somewhat like this...&lt;/p&gt;

&lt;p&gt;&lt;code&gt;RewriteCond %{HTTP_REFERER} ^http://slashdot\.org [NC,OR]&lt;/code&gt; - If the visitor have come from http://slashdot.org OR,&lt;br /&gt;
&lt;code&gt;RewriteCond %{HTTP_REFERER} ^http://www\.slashdot\.org [NC]&lt;/code&gt; - if he have come from http://www.slashdot.org&lt;br /&gt;
&lt;code&gt;RewriteRule ^.*$ /denied.html [F]&lt;/code&gt; - Show a 'Forbidden' message.&lt;/p&gt;

&lt;h2&gt;Prevent Image Hot Linking&lt;/h2&gt;

&lt;p&gt;Hot Linking is when someone links to a file from our server directly in a way that our bandwidth will be used when anyone visits the other person's site. For example, let say we have a cool picture called, say, 'cool_picture.jpg'. We have kept it in 'http://www.our-domain.com/pictures/cool_picture.jpg'. Now some guy from another site, likes this picture and decided to show the image in his site - so he uses the HTML code...&lt;/p&gt;

&lt;pre&gt;&lt;code class="html"&gt;&amp;lt;img src="http://www.our-domain.com/pictures/cool_picture.jpg" /&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So whenever someone visits this guys site, the image is fetched from our server - thus increasing our bandwidth costs. For this reason, this method is also known as bandwidth theft.&lt;/p&gt;

&lt;p&gt;So how do we prevent it? The same method used in the last situations - &lt;strong class="highlight"&gt;look at the referrer, and if it is not ours, show a forbidden message.&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class="mod_rewrite"&gt;
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www\.our-domaincom/\.org [NC]
RewriteCond %{HTTP_REFERER} !^http://our-domain\.com/\.org [NC]
RewriteRule ^.*$ /denied.html [F]
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Using Different Files for Different Browsers&lt;/h2&gt;

&lt;p&gt;As all good web designers know, different browsers have different ways of parsing the same &lt;abbr title="Cascadding Style Sheets"&gt;CSS&lt;/abbr&gt; file. So your masterpiece in IE will look like something the cat brought in Firefox. One simple way of solving this problem is to use mod_rewrite and provide a different css file based on the visitor's browsers. Lets say we have a CSS file called 'style.css'. But for IE, we have created a special CSS file called 'style_ie.css'. For firefox, we have yet another CSS file called 'style_ff.css'. Our pages uses the HTML code...&lt;/p&gt;

&lt;pre&gt;&lt;code class="html"&gt;&amp;lt;link href="style.css" type="text/css" rel="stylesheet" /&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now to &lt;strong class="highlight"&gt;provide different files based on the user agent of the visitor&lt;/strong&gt;...&lt;/p&gt;

&lt;pre&gt;&lt;code class="mod_rewrite"&gt;
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/(.*)MSIE
RewriteRule (.*)style.css$ $1style_ie.css [L]

RewriteCond %{HTTP_USER_AGENT} ^Mozilla/(.*)Firefox
RewriteRule (.*)style.css$ $1style_ff.css [L]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For more solutions to situations like this, see the &lt;a href="http://httpd.apache.org/docs/2.0/misc/rewriteguide.html" class="external"&gt;URL Rewriting Guide&lt;/a&gt; from Apache Docs.&lt;/p&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/mod_rewrite" rel="tag"&gt;mod_rewrite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/apache" rel="tag"&gt;apache&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/url" rel="tag"&gt;url&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/07/practical-uses-for-modrewrite.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115393460638252860"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115393460638252860"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115315734445499540</id><published>2006-07-17T22:54:00.000+05:30</published><updated>2006-07-23T00:15:19.586+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><title type="text">mod_rewrite module for Apache</title><content type="html">&lt;p class="intro"&gt;Along with the ability to password protect folders on the web server, another major use of the .htaccess file is the ability to 'rewrite' the &lt;abbr title="Uniform Resource Locator"&gt;URL&lt;/abbr&gt;. This will let you &lt;strong class="highlight"&gt;create more structured and easy to remember URLs&lt;/strong&gt;. This module will &lt;strong class="highlight"&gt;redirect the user to one page while showing another URL&lt;/strong&gt; in the address bar.&lt;/p&gt;

&lt;h2&gt;Application of &lt;code&gt;mod_rewrite&lt;/code&gt;&lt;/h2&gt;

&lt;h3&gt;Used in del.icio.us&lt;/h3&gt;

&lt;p&gt;This method is used to great effect in sites like &lt;a href="http://en.wikipedia.com/" class="external"&gt;Wikipedia&lt;/a&gt; and &lt;a href="http://del.icio.us/" class="external"&gt;Del.icio.us&lt;/a&gt;. For example let us take a del.icio.us URL...&lt;/p&gt;

&lt;pre&gt;http://del.icio.us/binblog/javascript+ajax&lt;/pre&gt;

&lt;p&gt;This does not mean that there is a folder called &lt;code&gt;binblog&lt;/code&gt; in the root of del.icio.us site. Nor does this mean that there is a file with the name '&lt;code&gt;javascript+ajax&lt;/code&gt;'. This trick is done using &lt;strong class="highlight"&gt;URL manipulation&lt;/strong&gt;. In this example, the URL can be split into three parts....&lt;/p&gt;

&lt;pre&gt;
http://del.icio.us/binblog/javascript+ajax
         ^^^         ^^^          ^^^           
      Site URL     User ID        Tags
    &lt;em&gt;del.icio.us&lt;/em&gt;    &lt;em&gt;binblog&lt;/em&gt;    &lt;em&gt;javascript&lt;/em&gt; and &lt;em&gt;ajax&lt;/em&gt;
&lt;/pre&gt;

&lt;p&gt;The actual URL being called &lt;em&gt;may&lt;/em&gt; be something like...&lt;/p&gt;

&lt;pre&gt;http://del.icio.us/show_bookmarks.php?format=html&amp;amp;user=binblog&amp;amp;tags=javascript+ajax&lt;/pre&gt;

&lt;p&gt;So how do the user see one URL and the server use another? That is the subtle art of URL manipulation. Before we see the details of this method, a small warning. You may not be able to get the concept at the first glance - it may be sometime before you understand mod_rewrite completely. So - don't give up, grasshopper. As one person puts it...&lt;/p&gt;

&lt;blockquote cite="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html"&gt;Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo.&lt;br /&gt;
&lt;cite&gt;Brian Moore&lt;/cite&gt;&lt;/blockquote&gt;

&lt;p&gt;Before going any further, let me also warn you that &lt;strong class="highlight"&gt;you must know regular expression&lt;/strong&gt; to understand how this works. OK, now we can go further.&lt;/p&gt;


&lt;h2&gt;Using mod_rewrite&lt;/h2&gt;

&lt;p&gt;First we need a regular expression to &lt;strong class="highlight"&gt;extract the necessary elements from the URL&lt;/strong&gt;. We will ignore the site URL(http://del.icio.us/) part. The URL is &lt;/p&gt;

&lt;pre&gt;http://del.icio.us/binblog/javascript+ajax&lt;/pre&gt;

&lt;p&gt;The Regualar Expression is...&lt;/p&gt;

&lt;pre&gt;^([^\/]+)\/([^\/]+)$&lt;/pre&gt;

&lt;p&gt;The extracted strings will be...&lt;/p&gt;

&lt;p&gt;$1 = binblog (First Match)&lt;br /&gt;
$2 = javascript+ajax (Second Match)&lt;/p&gt;

&lt;p&gt;To make this effect using the &lt;code&gt;mod_rewrite&lt;/code&gt; module, open the &lt;strong class="highlight"&gt;.htaccess file&lt;/strong&gt; your &lt;a href="http://binnyva.blogspot.com/2006/05/web-development-in-linux.html" class="internal" title="Web Development in Linux"&gt;favorite editor&lt;/a&gt; and type in the following lines...&lt;/p&gt;

&lt;pre&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;
RewriteEngine On
RewriteRule ^([^\/]+)\/([^\/]*)$ show_bookmarks.php?format=html&amp;amp;user=$1&amp;amp;tags=$2
&amp;lt;/IfModule&amp;gt;&lt;/pre&gt;

&lt;p&gt;Now to test this, &lt;strong class="highlight"&gt;create a file called 'show_bookmarks.php' in the document root&lt;/strong&gt; of your web server. I hope that I don't have to tell you that you need a &lt;a href="http://binnyva.blogspot.com/2006/05/web-development-in-linux.html" class="internal" title="Web Development in Linux"&gt;LAMP&lt;/a&gt; setup to do this. You will &lt;strong&gt;need atleast Apache and PHP&lt;/strong&gt; to do this.&lt;/p&gt;

&lt;p&gt;After creating the 'show_bookmarks.php' file, enter the following code into it...&lt;/p&gt;

&lt;pre&gt;&amp;lt;pre&amp;gt;&amp;lt;?php print_r($_GET); ?&amp;gt;&amp;lt;/pre&amp;gt;&lt;/pre&gt;

&lt;p&gt;Since this is just a test, I did not bother with all the HTML tags like &amp;lt;html&amp;gt;,&amp;lt;body&amp;gt; etc. But if you are a sticker for the rules, go ahead and make the full document.&lt;/p&gt;

&lt;p&gt;Next, open this URL in the browser...&lt;/p&gt;

&lt;pre&gt;http://localhost/show_bookmarks.php?format=html&amp;amp;user=binblog&amp;amp;tags=javascript+ajax&lt;/pre&gt;

&lt;p&gt;You should get this result - the contests of the GET request...&lt;/p&gt;

&lt;pre&gt;Array
(
    [format] =&gt; html
    [user] =&gt; binblog
    [tags] =&gt; javascript ajax
)&lt;/pre&gt;

&lt;p&gt;Now try it with the URL...&lt;/p&gt;

&lt;pre&gt;http://localhost/binblog/javascript+ajax&lt;/pre&gt;

&lt;p&gt;If everything went well, this also should have the same output - that is...&lt;/p&gt;

&lt;pre&gt;Array
(
    [format] =&gt; html
    [user] =&gt; binblog
    [tags] =&gt; javascript ajax
)&lt;/pre&gt;

&lt;h2&gt;Explanation&lt;/h2&gt;

&lt;h3&gt;IfModule&lt;/h3&gt;

&lt;pre&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;&lt;/pre&gt;

&lt;p&gt;This is an &lt;code&gt;if&lt;/code&gt; condition - the code inside these tags will only be executed if the &lt;code&gt;mod_rewrite&lt;/code&gt; module is loaded with apache.&lt;/p&gt;

&lt;h3&gt;RewriteEngine&lt;/h3&gt;

&lt;pre&gt;RewriteEngine On&lt;/pre&gt;

&lt;p&gt;The 'RewriteEngine' directive enables or disables runtime rewriting engine. Here we are &lt;strong class="highlight"&gt;turning on the re-write Engine&lt;/strong&gt;. Use the value 'off' if you want to turn of all rewriting. &lt;/p&gt;

&lt;h3&gt;RewriteRule&lt;/h3&gt;
&lt;pre&gt;RewriteRule ^([^\/]+)\/([^\/]*)$ show_bookmarks.php?format=html&amp;amp;user=$1&amp;amp;tags=$2&lt;/pre&gt;

&lt;p&gt;This is the important statement. The proper syntax for RewriteRule directive is given below...&lt;/p&gt;

&lt;pre&gt;RewriteRule &lt;em&gt;Pattern&lt;/em&gt; &lt;em&gt;Substitution&lt;/em&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;strong class="highlight"&gt;&lt;em&gt;Pattern&lt;/em&gt; is a &lt;a href="http://www.perldoc.com/perl5.6.1/pod/perlre.html" class="external"&gt;perl compactable regular expression&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Substitution&lt;/em&gt; part of the rewriting rule is the string which &lt;strong class="highlight"&gt;replaces the original URL&lt;/strong&gt; for which &lt;em&gt;Pattern&lt;/em&gt; has matched. You can use &lt;code&gt;$n&lt;/code&gt; to insert regular expression captured strings - $1 is the first capture, $2 will be the second and so on.&lt;/p&gt;

&lt;p&gt;One than one line of &lt;code&gt;RewriteRule&lt;/code&gt; can be used. The &lt;strong class="highlight"&gt;order of useage is important&lt;/strong&gt; as the second line will use the result of the first substitution as its input&lt;/p&gt;

&lt;pre&gt;&amp;lt;/IfModule&amp;gt;&lt;/pre&gt;

&lt;p&gt;End of the &lt;code&gt;if&lt;/code&gt; condition we started earlier.&lt;/p&gt;

&lt;h2&gt;Conditions&lt;/h2&gt;

&lt;p&gt;Some of you must have already seen a big problem in this approach. To see this problem, create a folder called, say, 'data' in your document root. Now create a file called 'something.txt' in this folder. Then try to access this folder from a browser using the URL.&lt;/p&gt;

&lt;pre&gt;http://localhost/data/&lt;/pre&gt;

&lt;p&gt;Now you see the problem, don't you? The above URL will result in the output...&lt;/p&gt;

&lt;pre&gt;Array
(
    [format] =&gt; html
    [user] =&gt; data
    [tags] =&gt; 
)
&lt;/pre&gt;

&lt;p&gt;Our &lt;code&gt;mod_rewrite&lt;/code&gt; rules have &lt;strong class="highlight"&gt;captured the URL of a valid file&lt;/strong&gt; along with the other URLs. To solve this problem, we will use a &lt;strong class="highlight"&gt;feature of mod_rewrite called Conditions&lt;/strong&gt;. Insert these lines in the &lt;code&gt;.htaccess&lt;/code&gt; file.&lt;/p&gt;

&lt;pre&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;
RewriteEngine On
&lt;span class="special"&gt;RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f&lt;/span&gt;
RewriteRule ^([^\/]+)\/([^\/]*)$ show_bookmarks.php?format=html&amp;amp;user=$1&amp;amp;tags=$2
&amp;lt;/IfModule&amp;gt;&lt;/pre&gt;

&lt;p&gt;See the line &lt;code&gt;RewriteCond %{REQUEST_FILENAME} !-d&lt;/code&gt;? This will make sure that the &lt;strong class="highlight"&gt;requested file is not a directory&lt;/strong&gt;. The line &lt;code&gt;RewriteCond %{REQUEST_FILENAME} !-f&lt;/code&gt; will &lt;strong class="highlight"&gt;prevent files from being caught&lt;/strong&gt; by the rewrite rule. The algorithm of these statements will look something like this...&lt;/p&gt;

&lt;pre&gt;if( 'Requested Filename' IS NOT Directory ) {
 if( 'Requested Filename' IS NOT File ) {
  Rewrite the URL.
 }
}&lt;/pre&gt;

&lt;p&gt;I hope you got the logic behind this - it took me a while to understand. Anyway, as I said earlier, don't be dissappointed if you don't get it at the first try - there is a lot of black magic involved.&lt;/p&gt;

&lt;p&gt;Now try to access the file we created a little while back...&lt;/p&gt;

&lt;pre&gt;http://localhost/data/something.txt&lt;/pre&gt;

&lt;p&gt;You will see that it works perfectly(hopefully). Now try...&lt;/p&gt;

&lt;pre&gt;http://localhost/data/&lt;/pre&gt;

&lt;p&gt;Again the folder is being accessed. Now try a URL that must be re-written...&lt;/p&gt;

&lt;pre&gt;http://localhost/binblog/javascript+ajax&lt;/pre&gt;

&lt;p&gt;If all goes well, this URL will be caught by our system and will be redirected to the &lt;code&gt;show_bookmarks.php&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;More about &lt;code&gt;mod_rewrite&lt;/code&gt; in the &lt;a href="http://binnyva.blogspot.com/2006/07/modrewrite-directives-rewritecond-and.html" class="internal" title="mod_rewrite Directives - RewriteCond and RewriteRule"&gt;next post(mod_rewrite Directives - RewriteCond and RewriteRule).&lt;/a&gt;&lt;/p&gt;


&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/apache" rel="tag"&gt;apache&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/mod_rewrite" rel="tag"&gt;mod_rewrite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/url" rel="tag"&gt;url&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/07/modrewrite-module-for-apache.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115315734445499540"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115315734445499540"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115359356038251548</id><published>2006-07-22T23:01:00.000+05:30</published><updated>2006-07-23T00:09:20.406+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><title type="text">mod_rewrite Directives - RewriteCond and RewriteRu...</title><content type="html">&lt;p class="intro"&gt;In the last post on &lt;a href="http://binnyva.blogspot.com/2006/07/modrewrite-module-for-apache.html" title="mod_rewrite module for Apache" class="internal"&gt;mod_rewrite&lt;/a&gt;, I used a basic example from &lt;a href="http://del.icio.us/" class="external"&gt;http://del.icio.us&lt;/a&gt; to explain the working of the mod_rewrite module. Now I will try to explain the various options available in mod_rewrite.&lt;/p&gt;

&lt;h2&gt;RewriteEngine&lt;/h2&gt;

&lt;p&gt;This directive turns the rewrite engine on or off.&lt;br /&gt;
&lt;em&gt;Syntax : &lt;/em&gt; RewriteEngine (on|off)&lt;br /&gt;
&lt;em&gt;Example: &lt;/em&gt; &lt;code&gt;RewriteEngine on&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you wish to &lt;strong class="highlight"&gt;disable rewriting, use RewriteEngine off instead of commenting out all the other lines.&lt;/strong&gt; Since the rewrite engine is off by default, you have to turn it on every time you wish to use the mod_rewrite module. So the first line will be always...&lt;/p&gt;

&lt;pre&gt;RewriteEngine on&lt;/pre&gt;

&lt;h2&gt;RewriteCond&lt;/h2&gt;

&lt;p&gt;The &lt;strong class="highlight"&gt;'if' statement of mod_rewrite&lt;/strong&gt;. The commands given below a RewriteCond line will be evaluated only if this returns a true value.&lt;br /&gt;
&lt;em&gt;Syntax : &lt;/em&gt;RewriteCond &lt;em&gt;TestString&lt;/em&gt; &lt;em&gt;ConditionPattern&lt;/em&gt; [&lt;em&gt;Flags&lt;/em&gt;]&lt;br /&gt;
&lt;em&gt;Example: &lt;/em&gt; &lt;code&gt;RewriteCond %{HTTP_REFERER} ^http://www.google.com&lt;/code&gt; [NC]&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;RewriteCond&lt;/code&gt; has &lt;strong class="highlight"&gt;two arguments plus an optional third&lt;/strong&gt; one.&lt;/p&gt;

&lt;h3 id="test_string"&gt;TestString&lt;/h3&gt;

&lt;p&gt;There are three main types of strings that can be used in TestString part of the directive.&lt;/p&gt;

&lt;h4&gt;RewriteRule Regular Expression Captures - $N&lt;/h4&gt;

&lt;p&gt;Here N is a number between 0 and 9. If you use the string $1 in the TestString part of the &lt;code&gt;RewriteCond&lt;/code&gt; directive, it will be replaced by the first capture from the regular expression for the corresponding &lt;code&gt;RewriteRule&lt;/code&gt; - ie. the RewriteRule that will follow this condition.&lt;/p&gt;

&lt;h4&gt;RewriteCond Regular Expression Captures - %N&lt;/h4&gt;

&lt;p&gt;For this string, N is a number between 1 and 9. If you use the $1 in the TestString part of the &lt;code&gt;RewriteCond&lt;/code&gt; directive, it will be replaced by the first capture from the regular expression for the corresponding &lt;code&gt;RewriteCond&lt;/code&gt; - ie. the RewriteCond above this condition.&lt;/p&gt;

&lt;h4&gt;Server Variables&lt;/h4&gt;

&lt;p&gt;This are given in the format...&lt;/p&gt;

&lt;pre&gt;%{VARIABLE_NAME}&lt;/pre&gt;

&lt;p&gt;The most commonly used Server variables are given below. To see the full list of available server variables, see the &lt;a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" class="external"&gt;apache manual page on &lt;code&gt;mod_rewrite&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;dl&gt;
&lt;dt&gt;HTTP_USER_AGENT&lt;/dt&gt;&lt;dd&gt;A string containing the name of the browser the visitor is using. Eg 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051111 Firefox/1.5'&lt;/dd&gt;
&lt;dt&gt;HTTP_REFERER&lt;/dt&gt;&lt;dd&gt;The URL of the page from where the current visitor came form.&lt;/dd&gt;
&lt;dt&gt;REMOTE_ADDR&lt;/dt&gt;&lt;dd&gt;The IP of the visitor.&lt;/dd&gt;
&lt;dt&gt;REMOTE_HOST&lt;/dt&gt;&lt;dd&gt;The visitor's host name.&lt;/dd&gt;
&lt;dt&gt;SCRIPT_FILENAME&lt;/dt&gt;&lt;dd&gt;The filename of the page that was requested.&lt;/dd&gt;
&lt;dt&gt;QUERY_STRING&lt;/dt&gt;&lt;dd&gt;The queries that was passed to the page.&lt;/dd&gt;
&lt;dt&gt;REQUEST_URI&lt;/dt&gt;&lt;dd&gt;The called URI&lt;/dd&gt;
&lt;dt&gt;REQUEST_FILENAME&lt;/dt&gt;&lt;dd&gt;The path of the file - ie. the URL of the page without the domain.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h3 id="condpattern"&gt;CondPattern&lt;/h3&gt;

&lt;p&gt;CondPattern is a regular expression - with some extra features...&lt;/p&gt;

&lt;dl&gt;
&lt;dt&gt;!&lt;/dt&gt;&lt;dd&gt;You can prefix the '!' operator to any condition pattern to make RewriteCond &lt;strong class="highlight"&gt;return true if the pattern does NOT match.&lt;/strong&gt;&lt;/dd&gt;
&lt;dt&gt;&amp;lt;CondPattern&lt;/dt&gt;&lt;dd&gt;Compares the two string and &lt;strong class="highlight"&gt;return true if the TestString is lexically lower&lt;/strong&gt; than the given pattern&lt;/dd&gt;
&lt;dt&gt;&amp;gt;CondPattern&lt;/dt&gt;&lt;dd&gt;&lt;strong class="highlight"&gt;Return true if the TestString is lexically greater&lt;/strong&gt; than the given pattern.&lt;/dd&gt;
&lt;dt&gt;=CondPattern&lt;/dt&gt;&lt;dd&gt;&lt;strong class="highlight"&gt;Return true if the TestString and pattern are equal&lt;/strong&gt;.&lt;/dd&gt;
&lt;dt&gt;-d&lt;/dt&gt;&lt;dd&gt;Return true if TestString is a directory(folder)&lt;/dd&gt;
&lt;dt&gt;-f&lt;/dt&gt;&lt;dd&gt;Return true if TestString is a file&lt;/dd&gt;
&lt;/dl&gt;

&lt;h3&gt;Flags&lt;/h3&gt;

Flags are given inside squire brackets([FLAGS]). Two flags are available for RewriteCond...

&lt;dl&gt;
&lt;dt&gt;NC&lt;/dt&gt;&lt;dd&gt;&lt;strong class="highlight"&gt;No Case&lt;/strong&gt; - the case is ignored in matching.&lt;/dd&gt;
&lt;dt&gt;OR&lt;/dt&gt;&lt;dd&gt;Use this to combine two consecutive RewriteCond with a logical OR - if this is not given, an AND condition is implied&lt;/dd&gt;
&lt;/dl&gt;

&lt;h2&gt;RewriteRule&lt;/h2&gt;

&lt;p&gt;Provides the rules for rewriting URLs.&lt;br /&gt;
&lt;em&gt;Syntax : &lt;/em&gt;RewriteRule &lt;em&gt;Pattern&lt;/em&gt; &lt;em&gt;Substitution&lt;/em&gt; [&lt;em&gt;Flags&lt;/em&gt;]&lt;br /&gt;
&lt;em&gt;Example: &lt;/em&gt; &lt;code&gt;RewriteRule ^/user/(.*) get_data.php?user=$1&lt;/code&gt; [NC]&lt;/p&gt;

&lt;p&gt;This is were the URL rewriting actually happens. This directive has &lt;strong class="highlight"&gt;two arguments plus an optional third&lt;/strong&gt; one.&lt;/p&gt;

&lt;h3&gt;Pattern&lt;/h3&gt;

&lt;p&gt;The &lt;strong class="highlight"&gt;pattern is a perl compactable regular expression used to match the current URL&lt;/strong&gt;. You can capture this by using the parenthesis ie. '(' and ')'. All text between these will be captured and could be used in the Substitution part of RewriteRule.&lt;/p&gt;

&lt;h3&gt;Substitution&lt;/h3&gt;

&lt;p&gt;The actual URL that is to be called is given here. This involves the &lt;strong class="highlight"&gt;path of the script and the parameters&lt;/strong&gt; that should be given to it. This supports all the special features of &lt;a href="#test_string"&gt;TestString&lt;/a&gt;(like $N, %N and Server variables) besides plain text. It also supports the '!','&amp;lt;','&amp;gt;' and '=' prefix operators as we saw in the &lt;a href="#condpattern"&gt;CondPattern&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Flags&lt;/h3&gt;

&lt;p&gt;Flats are the third argument to the RewriteRule directive. This should be given inside square brackets([FLAGS]). Flags is a &lt;strong class="highlight"&gt;comma-separated list&lt;/strong&gt; of these flags...&lt;/p&gt;

&lt;dl&gt;
&lt;dt&gt;R - Redirect&lt;/dt&gt;
&lt;dd&gt;The URL in the address bar will change if this flag is used - as the server will use the HTTP response of 302 (MOVED TEMPORARILY) when redirecting the page.&lt;/dd&gt;
&lt;dt&gt;F - Forbidden&lt;/dt&gt;
&lt;dd&gt;Using this flag immediately sends a HTTP response of 403 (FORBIDDEN). Use this flag with appropriate RewriteConds to conditionally block some URLs - for example &lt;a href="http://httpd.apache.org/docs/2.0/misc/rewriteguide.html#access"&gt;image hot linking from external sites&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;G - Gone&lt;/dt&gt;
&lt;dd&gt;Sends a HTTP response header of 410 (GONE). This flag is used to mark pages which no longer exist as gone.&lt;/dd&gt;
&lt;dt&gt;L - Last&lt;/dt&gt;
&lt;dd&gt;Stop the rewriting process in this rule and don't apply any more rules. Think Perl's &lt;code&gt;last&lt;/code&gt; command or the &lt;code&gt;break&lt;/code&gt; command of C.&lt;/dd&gt; 
&lt;dt&gt;NC - No Case&lt;/dt&gt;
&lt;dd&gt;Makes the Pattern case-insensitive.&lt;/dd&gt;
&lt;dt&gt;QSA - Query String Append&lt;/dt&gt;
&lt;dd&gt;This flag will append the query string from the current URL to the substitution string.&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;Eg. &lt;/p&gt;

&lt;pre&gt;
RewriteRule ^/user/(.*?)/ get_data.php?user=$1 [NC,QSA]
&lt;/pre&gt;

&lt;p&gt;Please keep in mind that this is just the most commonly used Flags - for the full list, go to the &lt;a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" class="external"&gt;apache manual page on &lt;code&gt;mod_rewrite&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy rewriting...&lt;/p&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/web" rel="tag"&gt;web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/development" rel="tag"&gt;development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/mod_rewrite" rel="tag"&gt;mod_rewrite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/apache" rel="tag"&gt;apache&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/07/modrewrite-directives-rewritecond-and.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115359356038251548"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115359356038251548"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115272831224366466</id><published>2006-07-13T23:44:00.000+05:30</published><updated>2006-07-12T23:48:32.256+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="personal"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type="text">New Blog - BinnyVA</title><content type="html">&lt;p class="intro"&gt;After &lt;a title="Moving the Blog from Blogspot" href="http://binnyva.blogspot.com/2006/03/moving-blog-from-blogspot.html" class="internal"&gt;much waiting&lt;/a&gt; I finally have a blog in &lt;a title="WordPress - PHP Blogging tool." href="http://wordpress.org/" class="external"&gt;WordPress&lt;/a&gt;. So currently I have two blogs - &lt;a title="Bin-Blog" href="http://binnyva.blogspot.com/" class="internal"&gt;Bin-Blog&lt;/a&gt; and &lt;a href="http://blog.binnyva.com/" class="mypages"&gt;BinnyVA&lt;/a&gt;. I plan to use this blog(Blogger) as a professional blog and the other one(WordPress) as a more personal one. That blog will have a lower post frequency - around one per week. So from now on, all post that would have been tagged with 'Personal' will be kept in the opther blog - this blog will be used exclusively for professional content.&lt;/p&gt;

&lt;p&gt;Another plus side of using that blog is that I can get an opertunity to sudy Wordpress - one of the most succesful PHP project of these times. Knowing what makes it tick will do me much good - I will be able to port my many programs as WordPress plugins. I actually plan to do this with Online Sudoku.&lt;/p&gt;

&lt;p&gt;So this post will be the last post in this blog to be &lt;a href="http://del.icio.us/binblog/personal/"&gt;tagged with 'personal'&lt;/a&gt;. If you want more posts of that genre, go over to my &lt;a href="http://blog.binnyva.com/" class="mypages blog"&gt;new blog&lt;/a&gt;.&lt;/p&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/blog" rel="tag"&gt;blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/personal" rel="tag"&gt;personal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/wordpress" rel="tag"&gt;wordpress&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/07/new-blog-binnyva.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115272831224366466"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115272831224366466"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/115246400874165519</id><published>2006-07-09T22:01:00.000+05:30</published><updated>2006-07-09T22:23:28.756+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type="text">Football Vs JavaScript</title><content type="html">&lt;h2&gt;The Stars&lt;/h2&gt;

&lt;h3&gt;Football&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Zinedine Zidane&lt;/li&gt;
&lt;li&gt;Ronaldo&lt;/li&gt;
&lt;li&gt;Wayne Rooney&lt;/li&gt;
&lt;li&gt;Christano Ronaldo&lt;/li&gt;
&lt;li&gt;Thierry Henry&lt;/li&gt;
&lt;li&gt;And more...&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;JavaScript&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.quirksmode.org/" class="external"&gt;Peter Paul Kosh(PPK)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://simon.incutio.com/" class="external"&gt;Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.domscripting.com/" class="external"&gt;Jeremy Keith&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.crockford.com/" class="external"&gt;Douglas Crockford&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.dustindiaz.com/" class="external"&gt;Dustin Diaz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;And more...&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;The Teams&lt;/h2&gt;

&lt;h3&gt;Football&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Real Madrid&lt;/li&gt;
&lt;li&gt;Manchester United&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;JavaScript&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Yahoo&lt;/li&gt;
&lt;li&gt;Google&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Why Football is better than JavaScript&lt;/h2&gt;

&lt;p&gt;Football has a &lt;strong&gt;fixed number&lt;/strong&gt; of Referees and Lines men.&lt;br /&gt;
In JavaScript, we get a new referee every time a new browser is made and a new lines man every time a new version is released.&lt;/p&gt;

&lt;p&gt;In football, if the referee calls a goal, it is a goal and if he calls it a foul it is a foul.&lt;br /&gt;
In JavaScript, one referee will call an event a goal while another will call the &lt;strong&gt;same event&lt;/strong&gt; a foul.&lt;/p&gt;

&lt;p&gt;In football, if you made a foul, the referee will send you out.&lt;br /&gt;
In JavaScript, if that was the case, &lt;code&gt;document.write&lt;/code&gt; and &lt;code&gt;eval&lt;/code&gt; would be a thing of the past.&lt;/p&gt;

&lt;p&gt;In football, if some players are playing a standard game, no referee will go around trying to make their lives a living hell.&lt;br /&gt;
In JavaScript, IE.&lt;/p&gt;

&lt;p&gt;Ronaldo makes more money and more fans than &lt;a href="http://www.quirksmode.org/" class="external"&gt;PPK&lt;/a&gt; can ever hope for.&lt;/p&gt;


&lt;h2&gt;Why JavaScript is better than Football&lt;/h2&gt;

&lt;p&gt;Anyone who knows JavaScript can compete in the World Wide Web cup.&lt;br /&gt;
Anyone who knows Football can dream of compeating in the World cup.&lt;/p&gt;

&lt;p&gt;In football, the referees will only check how you play - they don't help you.&lt;br /&gt;
In JavaScript, Firefox with &lt;a href="http://chrispederick.com/work/webdeveloper/" class="external" title="Web Developer Extension for Firefox"&gt;some&lt;/a&gt; &lt;a href="http://www.joehewitt.com/software/firebug/" class="external" title="Firebug - JavaScript Debugging"&gt;extensions&lt;/a&gt; to help you to 'play' better.&lt;/p&gt;

&lt;p&gt;Using libraries in JavaScript is like having Robotic legs in football. Using these you can run faster, shoot straighter and more accurately than you could hope for using your natural limbs. And most of the referee will stay happy as long as you use these robotic legs.&lt;/p&gt;

&lt;div class="tag-list"&gt;
&lt;h3&gt;Filed Under...&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/javascript" rel="tag"&gt;javascript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/football" rel="tag"&gt;football&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://del.icio.us/binblog/humor" rel="tag"&gt;humor&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2006/07/football-vs-javascript.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115246400874165519"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/115246400874165519"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/111791995776504252</id><published>2005-04-09T02:48:00.000+05:30</published><updated>2006-07-07T00:40:24.760+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="personal"/><title type="text">Salary</title><content type="html">&lt;p&gt;I got my first pay-check. Well, not actually a check but a huge bundle of cash. Not much - but it will do. What I really like about my job is that I can study new things there - so far I learned PHP and advanced CSS design.&lt;/p&gt;

&lt;p&gt;Anyway, now I am a paid employee. I am one more step closer to my dream of making money by the millions - like my father. My father never made money by the millions - but he dreamt of it.&lt;/p&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2005/04/salary.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/111791995776504252"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/111791995776504252"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/111792033343563413</id><published>2005-02-21T03:53:00.000+05:30</published><updated>2006-07-07T00:24:57.333+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="personal"/><title type="text">Got Job</title><content type="html">&lt;p&gt;I got my first offical Job - as a perl programmer at Reubro International.
This may well be the busiest times of my life. Upto now, life was a easy affair. But now I have to juggle multiple things while trying to stay sane.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Job - programmer&lt;/li&gt;
&lt;li&gt;MCP course at IndiaOptions.com&lt;/li&gt;
&lt;li&gt;CCNA course at IndiaOptions.com&lt;/li&gt;
&lt;li&gt;BCA course at IGNOU(Indira Ghandhi National Open University)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just to complicate things a litte more, I have some optional/semi-optional stuff I have to do. These include...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintain my websites&lt;/li&gt;
&lt;li&gt;Study other languages like Python, Ruby etc.&lt;/li&gt;
&lt;li&gt;Finish the Perl/Tk tutorial "&lt;a href="http://www.geocities.com/binnyva/code/perl/perl_tk_tutorial/"&gt;Create GUI using Perl/TK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Read more books - currently reading

&lt;ul&gt;
&lt;li&gt;My Experiments with Truth by M K Ghandhi&lt;/li&gt;
&lt;li&gt;Concise guide to Today's Religions by Josh MacDowell&lt;/li&gt;
&lt;li&gt;Joshua and the Flow of Bibilical History by Francis Schaffer&lt;/li&gt;
&lt;li&gt;And more.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ahh! So this is how life is on the fast line tastes like.&lt;/p&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2005/02/got-job.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/111792033343563413"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/111792033343563413"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry><entry><id>http://binnyva.blogspot.com/feeds/posts/full/111792008162402307</id><published>2005-04-14T02:50:00.000+05:30</published><updated>2006-07-07T00:18:23.420+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type="text">Amazon Associate</title><content type="html">&lt;p&gt;Today I signed up as an Amazon Associate - now my website has ads from Google, Amazon and Geocities. Practically filled with ads, don't you think? Must remove some ads - so I want to sign up for my own webspace. It costs money - but you gotta spend money to make money as they say. So the second I get my first google paycheck, I am going to sign up for a new account with some web hosting service. Problem is that I need a Credit Card for that - and as of today, I don't have one. Getting one will not be much trouble - but it will lighten my pocket 400 Rs per year - that's about $10.&lt;/p&gt;

&lt;p&gt;Have to decide on a web host now - know anything good?&lt;/p&gt;

&lt;p&gt;Update : Decided on &lt;a href="http://www.dreamhost.com/r.cgi?179344" class="external" title="Dreamhost - Web Hosting Provider"&gt;Dreamhost&lt;/a&gt; - &lt;a class="internal" href="http://binnyva.blogspot.com/2006/04/my-new-site-openjscom.html"&gt;My New Site - OpenJS.com&lt;/a&gt;.&lt;/p&gt;</content><link rel="alternate" type="text/html" href="http://binnyva.blogspot.com/2005/04/amazon-associate.html"/><link rel="self" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/111792008162402307"/><link rel="edit" type="application/atom+xml" href="http://binnyva.blogspot.com/feeds/posts/full/111792008162402307"/><author><name>Binny V A</name><uri>http://www.bin-co.com/</uri></author></entry></feed>
