<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en-US">
  <title>Coderkitty - Home</title>
  <id>tag:coderkitty.sweetperceptions.com,2009:mephisto/</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  
  <link href="http://coderkitty.sweetperceptions.com/" rel="alternate" type="text/html" />
  <updated>2009-08-14T13:10:46Z</updated>
  <link rel="self" href="http://feeds.feedburner.com/Coderkitty-Home" type="application/atom+xml" /><feedburner:emailServiceId>Coderkitty-Home</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/Coderkitty-Home" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.yourminis.com/subscribe.aspx?u=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.yourminis.com/images/addtoyourminisbadge.gif">Subscribe with Yourminis.com</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://hub.netomat.net/account/account.autoSubscribe.jspa?urls=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.netomat.net/blogger/images/icon_netomat_feedbutton.gif">Subscribe with netomat Hub</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FCoderkitty-Home" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-08-14:1002</id>
    <published>2009-08-14T13:09:00Z</published>
    <updated>2009-08-14T13:10:46Z</updated>
    <category term="Coding" />
    <category term="Tech Juices" />
    <category term="download" />
    <category term="git" />
    <category term="php" />
    <category term="release" />
    <category term="security" />
    <category term="update" />
    <category term="wordpress" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/cXJQDrxnH-o/wordpress-2-8-4-release-a-joke" rel="alternate" type="text/html" />
    <title>Wordpress 2.8.4 release, a joke?</title>
<content type="html">
            &lt;p&gt;I have been maintaining several &lt;a href="http://wordpress.org"&gt;Wordpress&lt;/a&gt; blogs (all currently running 2.8.3 as of the time of writing).  I logged in earlier today, and found that there was a new release.  Of course, I wanted to have them all updated at the soonest possible time.  &lt;/p&gt;

&lt;p&gt;By practice, I download the zipped file to apply them manually onto our &lt;a href="http://www.git-scm.org"&gt;source code repositories&lt;/a&gt; for update.  Usually, I find this useful because I get to see what the changes really were for the new release.  I was surprised to see that the new version I downloaded was a complete joke.  &lt;/p&gt;

&lt;p&gt;I got Wordpress 2.8.4 &lt;a href="http://wordpress.org/wordpress-2.8.4.zip"&gt;here&lt;/a&gt;.  I downloaded the file also inside the server, for a quick copy of the latest version, in case it will be needed.  Applying it to local copy of the repository, I found some big joke.  Amusing, but also confusing.&lt;/p&gt;
&lt;p&gt;I have been maintaining several &lt;a href="http://wordpress.org"&gt;Wordpress&lt;/a&gt; blogs (all currently running 2.8.3 as of the time of writing).  I logged in earlier today, and found that there was a new release.  Of course, I wanted to have them all updated at the soonest possible time.  &lt;/p&gt;

&lt;p&gt;By practice, I download the zipped file to apply them manually onto our &lt;a href="http://www.git-scm.org"&gt;source code repositories&lt;/a&gt; for update.  Usually, I find this useful because I get to see what the changes really were for the new release.  I was surprised to see that the new version I downloaded was a complete joke.  &lt;/p&gt;

&lt;p&gt;I got Wordpress 2.8.4 &lt;a href="http://wordpress.org/wordpress-2.8.4.zip"&gt;here&lt;/a&gt;.  I downloaded the file also inside the server, for a quick copy of the latest version, in case it will be needed.  Applying it to local copy of the repository, I found some big joke.  Amusing, but also confusing.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now tell me.. Is this real?  Could I be wrong? Could this be a mistake perhaps?  &lt;a href="http://wordpress.org/development/2009/08/2-8-4-security-release/"&gt;Where is the security release?&lt;/a&gt;  I'm not moving a muscle.&lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zLAoumCWCLYg87eZi335siRGEp4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zLAoumCWCLYg87eZi335siRGEp4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zLAoumCWCLYg87eZi335siRGEp4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zLAoumCWCLYg87eZi335siRGEp4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=cXJQDrxnH-o:yewlmoyiC9k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=cXJQDrxnH-o:yewlmoyiC9k:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=cXJQDrxnH-o:yewlmoyiC9k:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=cXJQDrxnH-o:yewlmoyiC9k:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=cXJQDrxnH-o:yewlmoyiC9k:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=cXJQDrxnH-o:yewlmoyiC9k:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/cXJQDrxnH-o" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/8/14/wordpress-2-8-4-release-a-joke</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-08-02:969</id>
    <published>2009-08-02T11:39:00Z</published>
    <updated>2009-08-03T06:17:47Z</updated>
    <category term="Coding" />
    <category term="Database" />
    <category term="adodb" />
    <category term="ajax" />
    <category term="cms" />
    <category term="freebie" />
    <category term="html" />
    <category term="mini store" />
    <category term="php" />
    <category term="rails" />
    <category term="ruby" />
    <category term="search" />
    <category term="stores" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/SBBo4NUWIp4/free-mini-store-search-app-in-php-and-ajax-for-dummies" rel="alternate" type="text/html" />
    <title>Free mini store search app in PHP and AJAX - for dummies</title>
<content type="html">
            &lt;p&gt;This is a very crude and very simple application which was for a demo purpose as requested by the client.  I haven't been using PHP and (moreso) AJAX in over a year and a half already.  This task was really more of a fun challenge that I cannot resist.  I just wanted to see how long I can work on this and deliver what the client's requests were.  Funny that this simple task was quoted to take 14 days of dev work, while it took me less than 5hours (since I was able to work on a CMS from scratch along with this all in 5hours of work time).&lt;/p&gt;

&lt;p&gt;If you find yourself in need of a jumpstart, consider this the best freebie for you.  Enjoy, and next time, give the client the correct estimates.  It might save you both from hating each other and ruining possible future projects. ;)&lt;/p&gt;
&lt;p&gt;My &lt;a href="http://sweetperceptions.com/projects/4"&gt;last PHP project&lt;/a&gt; was almost a year and a half ago.  I started working in &lt;a href="http://php.net"&gt;PHP&lt;/a&gt; eversince college.  Moved on to &lt;a href="http://java.com"&gt;Java&lt;/a&gt;, &lt;a href="http://python.org"&gt;Python&lt;/a&gt; and now, &lt;a href="http://www.ruby-lang.org"&gt;Ruby&lt;/a&gt;.  I must say, &lt;a href="http://php.net"&gt;PHP&lt;/a&gt; was the longest scripting language I used in my entire professional programming career.  Maybe because it was the easiest language to learn (and abuse).  &lt;/p&gt;

&lt;p&gt;So many resources on the Web have fluttered around for so long, even after frameworks were born.  There came &lt;a href="http://cakephp.org"&gt;CakePHP&lt;/a&gt;, &lt;a href="http://zend.com"&gt;Zend&lt;/a&gt;, &lt;a href="http://xisc.com"&gt;Prado&lt;/a&gt;, &lt;a href="http://symfony-project.org"&gt;Symfony&lt;/a&gt;, etc.  There were other tools too to help in making PHP a truly object orientd scripting language.  Some of my few favorites were: &lt;a href="http://www.smarty.net/"&gt;Smarty&lt;/a&gt; and &lt;a href="http://adodb.sourceforge.net/"&gt;AdoDB&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I've quit on &lt;a href="http://php.net"&gt;PHP&lt;/a&gt;, but I do not abhor it.  I still understand the old businesses still running their cash-cow apps in &lt;a href="http://php.net"&gt;PHP&lt;/a&gt; and is not yet looking forward to trusting Ruby on Rails or even other alternatives.  The business is always driven by finances and resources.  Sometimes, the best technological decisions elude the managers' table during meetings.. hence, the prevalence of a lot of legacy &lt;a href="http://php.net"&gt;PHP&lt;/a&gt; applications.  With this understanding, I still believe that these businesses would very much benefit upgrading their systems and even the skill sets of their own developers.  Even if they wanted to remain with &lt;a href="http://php.net"&gt;PHP&lt;/a&gt;, there are a lot of options out there that do not involve complete development of applications from the ground up.  Some would even prefer built systems that allow plugins for upgrade--like &lt;a href="http://drupal.org"&gt;Drupal&lt;/a&gt;, &lt;a href="http://joomla.org"&gt;Joomla&lt;/a&gt;, and even &lt;a href="http://wordpress.org"&gt;Wordpress&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There are cons of using such built systems (dependency on plugin upgrades, general hacking, and a becoming a prey to overly customizing them), and so, I myself would &lt;strong&gt;&lt;em&gt;not&lt;/strong&gt;&lt;/em&gt; recommend using them if you won't be able to protect your site from these downside.&lt;/p&gt;

&lt;p&gt;Though its been quite a while since I last worked on &lt;a href="http://php.net"&gt;PHP&lt;/a&gt;, it became a challenge for me to just do this mini store application just for fun of measuring how long I could work on such a request given that I have been out of touch from the &lt;a href="http://php.net"&gt;PHP&lt;/a&gt; world, and that the requirement could also involve &lt;a href="http://en.wikipedia.org/.../Ajax_" title="programming"&gt;AJAX&lt;/a&gt;.. and it would be from the ground up!&lt;/p&gt;

&lt;p&gt;This would be a very simple application though needing a database and javascript support for &lt;a href="http://en.wikipedia.org/.../Ajax_" title="programming"&gt;AJAX&lt;/a&gt;.  Let me now guide you to how it was done.&lt;/p&gt;

&lt;p&gt;First, create the database with the following schema:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class="r"&gt;CREATE&lt;/span&gt; &lt;span class="r"&gt;TABLE&lt;/span&gt; &lt;span class=""&gt;areas&lt;/span&gt; (&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=""&gt;id&lt;/span&gt; &lt;span class="pt"&gt;int&lt;/span&gt;(&lt;span class="i"&gt;11&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt; &lt;span class="di"&gt;auto_increment&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=""&gt;country_id&lt;/span&gt; &lt;span class="pt"&gt;int&lt;/span&gt;(&lt;span class="i"&gt;11&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;PRIMARY&lt;/span&gt; &lt;span class="r"&gt;KEY&lt;/span&gt;  (&lt;span class=""&gt;id&lt;/span&gt;),&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;KEY&lt;/span&gt; &lt;span class=""&gt;country_id_index&lt;/span&gt; (&lt;span class=""&gt;country_id&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;) &lt;span class="r"&gt;ENGINE&lt;/span&gt;=&lt;span class=""&gt;MyISAM&lt;/span&gt;  &lt;span class="di"&gt;DEFAULT&lt;/span&gt; &lt;span class="di"&gt;CHARSET&lt;/span&gt;=&lt;span class=""&gt;latin1&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="r"&gt;CREATE&lt;/span&gt; &lt;span class="r"&gt;TABLE&lt;/span&gt; &lt;span class=""&gt;countries&lt;/span&gt; (&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=""&gt;id&lt;/span&gt; &lt;span class="pt"&gt;int&lt;/span&gt;(&lt;span class="i"&gt;11&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt; &lt;span class="di"&gt;auto_increment&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;PRIMARY&lt;/span&gt; &lt;span class="r"&gt;KEY&lt;/span&gt;  (&lt;span class=""&gt;id&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;) &lt;span class="r"&gt;ENGINE&lt;/span&gt;=&lt;span class=""&gt;MyISAM&lt;/span&gt;  &lt;span class="di"&gt;DEFAULT&lt;/span&gt; &lt;span class="di"&gt;CHARSET&lt;/span&gt;=&lt;span class=""&gt;latin1&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="r"&gt;CREATE&lt;/span&gt; &lt;span class="r"&gt;TABLE&lt;/span&gt; &lt;span class=""&gt;stores&lt;/span&gt; (&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=""&gt;id&lt;/span&gt; &lt;span class="pt"&gt;int&lt;/span&gt;(&lt;span class="i"&gt;11&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt; &lt;span class="di"&gt;auto_increment&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=""&gt;contact_person&lt;/span&gt; &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=""&gt;contact_info&lt;/span&gt; &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=""&gt;address&lt;/span&gt; &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=""&gt;email&lt;/span&gt; &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;40&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=""&gt;website&lt;/span&gt; &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=""&gt;area_id&lt;/span&gt; &lt;span class="pt"&gt;int&lt;/span&gt;(&lt;span class="i"&gt;11&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;PRIMARY&lt;/span&gt; &lt;span class="r"&gt;KEY&lt;/span&gt;  (&lt;span class=""&gt;id&lt;/span&gt;),&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;KEY&lt;/span&gt; &lt;span class=""&gt;name_index&lt;/span&gt; (&lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt;),&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;KEY&lt;/span&gt; &lt;span class=""&gt;area_id_index&lt;/span&gt; (&lt;span class=""&gt;area_id&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;) &lt;span class="r"&gt;ENGINE&lt;/span&gt;=&lt;span class=""&gt;MyISAM&lt;/span&gt;  &lt;span class="di"&gt;DEFAULT&lt;/span&gt; &lt;span class="di"&gt;CHARSET&lt;/span&gt;=&lt;span class=""&gt;latin1&lt;/span&gt;;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;Next, let's prepare the main file.  We are going to need a stores.php, getareas.php, getstores.php, search.php, ajax.js and include files for connecting to the database and query functions.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stores.php&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most important parts of this file are the section handlers.  We'll need handles for: (1) search results, (2) areas list, (3) stores list.  These should have distinct ids that you'll have to note.&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;31&lt;tt&gt;
&lt;/tt&gt;32&lt;tt&gt;
&lt;/tt&gt;33&lt;tt&gt;
&lt;/tt&gt;34&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;35&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;36&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class="ta"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="an"&gt;xmlns&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;http://www.w3.org/1999/xhtml&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;xml:lang&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;lang&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="ta"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Mini store app&lt;span class="ta"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;script&lt;/span&gt; &lt;span class="an"&gt;type&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;text/javascript&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;src&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;js/ajax.js&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;script&lt;/span&gt; &lt;span class="an"&gt;src&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;js/prototype.js&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;type&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;text/javascript&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;script&lt;/span&gt; &lt;span class="an"&gt;src&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;js/scriptaculous.js&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;type&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;text/javascript&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;    &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="ta"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="ta"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="an"&gt;id&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;searchForm&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="ta"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="an"&gt;type&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;name&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;search&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="ta"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="an"&gt;type&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;submit&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;onclick&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;showSearchResults(Form.findFirstElement(document.forms[0]).value);$('searchBox').setStyle('display: block');new Effect.SlideDown($('searchBox'));return false;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;value&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Search for stores&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="an"&gt;id&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;searchBox&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;style&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;display: none;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="an"&gt;style&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;float: left;clear: both;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="c"&gt;&amp;lt;?php&lt;tt&gt;
&lt;/tt&gt;        $results = Site::getCountries();&lt;tt&gt;
&lt;/tt&gt;      &lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;ul class='item' style='overflow:auto;height: 500px;'&amp;gt;&amp;quot;;  &lt;tt&gt;
&lt;/tt&gt;        foreach($results as $country){&lt;tt&gt;
&lt;/tt&gt;            echo &amp;quot;&amp;lt;li&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;            echo &amp;quot;&amp;lt;a href='' onclick=\&amp;quot;javascript:showAreas('&amp;quot; . $country['id'] . &amp;quot;');$('areaHint').setStyle('display: none;');$('areaHint').undoPositioned();new Effect.Move($('areaHint'), { x: 0, y: 0, mode: 'absolute' });$('areaHint').setStyle('display: block;');new Effect.Move($('areaHint'), { x: 60, y: 0 });return false;\&amp;quot;&amp;gt;&amp;quot; . $country['name'] . &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;            echo &amp;quot;&amp;lt;/li&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;        }&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      ?&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="an"&gt;id&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;storeHint&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;style&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;border: 0px solid blue; margin-top: 15px; overflow: auto; float: right; width: 300px; height: 500px; display: block;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="an"&gt;id&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;areaHint&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;style&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;border: 0px solid red; margin-top: 30px; overflow: auto; width: 300px; height: 500px; display: block;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="ta"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ta"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getareas.php&lt;/strong&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&amp;lt;?php&lt;tt&gt;
&lt;/tt&gt;  $results = Site::getAreasOfCountry($_GET[&amp;quot;q&amp;quot;]);&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  if($results){&lt;tt&gt;
&lt;/tt&gt;    echo &amp;quot;&amp;lt;ul class='item'&amp;gt;&amp;quot;;  &lt;tt&gt;
&lt;/tt&gt;    foreach($results as $area){&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;li&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;a href='' onclick=\&amp;quot;javascript:showStores('&amp;quot; . $area['id'] . &amp;quot;');$('storeHint').setStyle('display: none;');$('storeHint').setStyle('display: block;');$('storeHint').undoPositioned();new Effect.Move($('storeHint'), { x: 0, y: 0, mode: 'absolute' });$('storeHint').setStyle('display: block;');new Effect.Move($('storeHint'), { x: -60, y: 0 });return false;\&amp;quot;&amp;gt;&amp;quot; . $area['name'] . &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;/li&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;    echo &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;;   &lt;tt&gt;
&lt;/tt&gt;  }else{&lt;tt&gt;
&lt;/tt&gt;    echo &amp;quot;&amp;lt;p style='text-align: center;'&amp;gt;Whoops, no areas found.&amp;lt;/p&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;?&amp;gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getstores.php&lt;/strong&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&amp;lt;?php&lt;tt&gt;
&lt;/tt&gt;  $results = Site::getStoresOfArea($_GET[&amp;quot;q&amp;quot;]);&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  if($results){&lt;tt&gt;
&lt;/tt&gt;    echo &amp;quot;&amp;lt;ul class='item'&amp;gt;&amp;quot;;  &lt;tt&gt;
&lt;/tt&gt;    foreach($results as $row){&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;li&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;a href='' onclick=\&amp;quot;javascript:showStoreDetails('&amp;quot; . $row['id'] . &amp;quot;');return false;\&amp;quot;&amp;gt;&amp;quot; . $row['name'] . &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;div id='storeDetail&amp;quot; . $row['id'] . &amp;quot;' style='display: none;'&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;table&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Contact Person&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; . $row['contact_person'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Contact Info&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; . $row['contact_info'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Address&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; . $row['address'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Email&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; . $row['email'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Website&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; . $row['website'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;        echo &amp;quot;&amp;lt;/table&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;/div&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;/li&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;    echo &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;;   &lt;tt&gt;
&lt;/tt&gt;  }else{&lt;tt&gt;
&lt;/tt&gt;    echo &amp;quot;&amp;lt;p style='text-align: center;'&amp;gt;Whoops, no stores found.&amp;lt;/p&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;?&amp;gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Search.php&lt;/strong&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&amp;lt;?php&lt;tt&gt;
&lt;/tt&gt;  $results = Site::getSearch($_GET[&amp;quot;search&amp;quot;]);&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  if($results){&lt;tt&gt;
&lt;/tt&gt;?&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &amp;lt;a href=&amp;quot;#&amp;quot; style=&amp;quot;float: right;padding-right: 15px;&amp;quot; onclick=&amp;quot;$('searchBox').setStyle('display: none;');&amp;quot;&amp;gt;CLOSE&amp;lt;/a&amp;gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;&amp;lt;?php    &lt;tt&gt;
&lt;/tt&gt;    echo &amp;quot;&amp;lt;table border='1' style='margin: 10px; background-color: rgb(83, 131, 219); width: 90%;'&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;    echo &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Contact Person&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Contact Info&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Address&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Email&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Website&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Country&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Area&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    foreach($results as $row){&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;tr&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;td&amp;gt;&amp;quot; . $row['name'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; . $row['contact_person'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; . $row['contact_info'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; . $row['address'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; . $row['email'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; . $row['website'] . &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;a href='' onclick=\&amp;quot;javascript:showAreas('&amp;quot; . $row['country_id'] . &amp;quot;');$('searchBox').setStyle('display: none;');$('areaHint').setStyle('display: none;');$('areaHint').undoPositioned();new Effect.Move($('areaHint'), { x: 0, y: 0, mode: 'absolute' });$('areaHint').setStyle('display: block;');new Effect.Move($('areaHint'), { x: 60, y: 0 }); return false;\&amp;quot;&amp;gt;&amp;quot; . $row['country_name'] . &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;a href='' onclick=\&amp;quot;javascript:showStores('&amp;quot; . $row['area_id'] . &amp;quot;');$('searchBox').setStyle('display: none;');$('storeHint').setStyle('display: none;');$('storeHint').undoPositioned();$('storeHint').setStyle('display: block;');new Effect.BlindDown('storeHint'); return false;\&amp;quot;&amp;gt;&amp;quot; . $row['area_name'] . &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;/td&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;      echo &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;    echo &amp;quot;&amp;lt;/table&amp;gt;&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;  }else{&lt;tt&gt;
&lt;/tt&gt;    echo &amp;quot;Whooops! No store matched your search criteria.&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;?&amp;gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ajax.js&lt;/strong&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;31&lt;tt&gt;
&lt;/tt&gt;32&lt;tt&gt;
&lt;/tt&gt;33&lt;tt&gt;
&lt;/tt&gt;34&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;35&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;36&lt;tt&gt;
&lt;/tt&gt;37&lt;tt&gt;
&lt;/tt&gt;38&lt;tt&gt;
&lt;/tt&gt;39&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;40&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;41&lt;tt&gt;
&lt;/tt&gt;42&lt;tt&gt;
&lt;/tt&gt;43&lt;tt&gt;
&lt;/tt&gt;44&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;45&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;46&lt;tt&gt;
&lt;/tt&gt;47&lt;tt&gt;
&lt;/tt&gt;48&lt;tt&gt;
&lt;/tt&gt;49&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;50&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;51&lt;tt&gt;
&lt;/tt&gt;52&lt;tt&gt;
&lt;/tt&gt;53&lt;tt&gt;
&lt;/tt&gt;54&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;55&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;56&lt;tt&gt;
&lt;/tt&gt;57&lt;tt&gt;
&lt;/tt&gt;58&lt;tt&gt;
&lt;/tt&gt;59&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;60&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;61&lt;tt&gt;
&lt;/tt&gt;62&lt;tt&gt;
&lt;/tt&gt;63&lt;tt&gt;
&lt;/tt&gt;64&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;65&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;66&lt;tt&gt;
&lt;/tt&gt;67&lt;tt&gt;
&lt;/tt&gt;68&lt;tt&gt;
&lt;/tt&gt;69&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;70&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;71&lt;tt&gt;
&lt;/tt&gt;72&lt;tt&gt;
&lt;/tt&gt;73&lt;tt&gt;
&lt;/tt&gt;74&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;75&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;76&lt;tt&gt;
&lt;/tt&gt;77&lt;tt&gt;
&lt;/tt&gt;78&lt;tt&gt;
&lt;/tt&gt;79&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;80&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;81&lt;tt&gt;
&lt;/tt&gt;82&lt;tt&gt;
&lt;/tt&gt;83&lt;tt&gt;
&lt;/tt&gt;84&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;85&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;86&lt;tt&gt;
&lt;/tt&gt;87&lt;tt&gt;
&lt;/tt&gt;88&lt;tt&gt;
&lt;/tt&gt;89&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;90&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;91&lt;tt&gt;
&lt;/tt&gt;92&lt;tt&gt;
&lt;/tt&gt;93&lt;tt&gt;
&lt;/tt&gt;94&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;95&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;96&lt;tt&gt;
&lt;/tt&gt;97&lt;tt&gt;
&lt;/tt&gt;98&lt;tt&gt;
&lt;/tt&gt;99&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;100&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;101&lt;tt&gt;
&lt;/tt&gt;102&lt;tt&gt;
&lt;/tt&gt;103&lt;tt&gt;
&lt;/tt&gt;104&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;105&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;106&lt;tt&gt;
&lt;/tt&gt;107&lt;tt&gt;
&lt;/tt&gt;108&lt;tt&gt;
&lt;/tt&gt;109&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;110&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;111&lt;tt&gt;
&lt;/tt&gt;112&lt;tt&gt;
&lt;/tt&gt;113&lt;tt&gt;
&lt;/tt&gt;114&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;115&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;116&lt;tt&gt;
&lt;/tt&gt;117&lt;tt&gt;
&lt;/tt&gt;118&lt;tt&gt;
&lt;/tt&gt;119&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class="kw"&gt;var&lt;/span&gt; xmlhttp;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;var&lt;/span&gt; areaHandle;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;var&lt;/span&gt; storeHandle;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;function&lt;/span&gt; showSearchResults(str)&lt;tt&gt;
&lt;/tt&gt;{&lt;tt&gt;
&lt;/tt&gt;xmlhttp=GetXmlHttpObject();&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;if&lt;/span&gt; (xmlhttp==&lt;span class="kw"&gt;null&lt;/span&gt;){  &lt;tt&gt;
&lt;/tt&gt;  alert (&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Browser does not support HTTP Request&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="kw"&gt;return&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;var&lt;/span&gt; url=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;search.php&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;url=url+&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;?search=&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;+str;&lt;tt&gt;
&lt;/tt&gt;url=url+&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;&amp;amp;sid=&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;+Math.random();&lt;tt&gt;
&lt;/tt&gt;xmlhttp.onreadystatechange=stateChangedSearch;&lt;tt&gt;
&lt;/tt&gt;xmlhttp.open(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,url,&lt;span class="kw"&gt;true&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;xmlhttp.send(&lt;span class="kw"&gt;null&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;function&lt;/span&gt; showAreas(str)&lt;tt&gt;
&lt;/tt&gt;{&lt;tt&gt;
&lt;/tt&gt;xmlhttp=GetXmlHttpObject();&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;if&lt;/span&gt; (xmlhttp==&lt;span class="kw"&gt;null&lt;/span&gt;){  &lt;tt&gt;
&lt;/tt&gt;  alert (&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Browser does not support HTTP Request&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="kw"&gt;return&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;areaHandle = str;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;var&lt;/span&gt; url=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;getareas.php&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;url=url+&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;?q=&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;+str;&lt;tt&gt;
&lt;/tt&gt;url=url+&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;&amp;amp;sid=&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;+Math.random();&lt;tt&gt;
&lt;/tt&gt;xmlhttp.onreadystatechange=stateChangedAreas;&lt;tt&gt;
&lt;/tt&gt;xmlhttp.open(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,url,&lt;span class="kw"&gt;true&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;xmlhttp.send(&lt;span class="kw"&gt;null&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;function&lt;/span&gt; showStores(str)&lt;tt&gt;
&lt;/tt&gt;{&lt;tt&gt;
&lt;/tt&gt;xmlhttp=GetXmlHttpObject();&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;if&lt;/span&gt; (xmlhttp==&lt;span class="kw"&gt;null&lt;/span&gt;){  &lt;tt&gt;
&lt;/tt&gt;  alert (&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Browser does not support HTTP Request&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="kw"&gt;return&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;storeHandle = str;  &lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;var&lt;/span&gt; url=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;getstores.php&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;url=url+&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;?q=&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;+str;&lt;tt&gt;
&lt;/tt&gt;url=url+&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;&amp;amp;sid=&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;+Math.random();&lt;tt&gt;
&lt;/tt&gt;xmlhttp.onreadystatechange=stateChangedStores;&lt;tt&gt;
&lt;/tt&gt;xmlhttp.open(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,url,&lt;span class="kw"&gt;true&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;xmlhttp.send(&lt;span class="kw"&gt;null&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;function&lt;/span&gt; stateChangedSearch()&lt;tt&gt;
&lt;/tt&gt;{&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="kw"&gt;switch&lt;/span&gt;(xmlhttp.readyState){&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="kw"&gt;case&lt;/span&gt; &lt;span class="i"&gt;4&lt;/span&gt;:&lt;tt&gt;
&lt;/tt&gt;      document.getElementById(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;searchBox&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;).innerHTML=xmlhttp.responseText;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="kw"&gt;break&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;      &lt;tt&gt;
&lt;/tt&gt;    &lt;span class="kw"&gt;case&lt;/span&gt; &lt;span class="i"&gt;1&lt;/span&gt;:&lt;tt&gt;
&lt;/tt&gt;      document.getElementById(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;searchBox&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).innerHTML=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Loading...&amp;amp;nbsp;&amp;lt;img src='ajax-loader.gif' alt='loading...' /&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="kw"&gt;break&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;  }  &lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;function&lt;/span&gt; stateChangedAreas()&lt;tt&gt;
&lt;/tt&gt;{&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="kw"&gt;switch&lt;/span&gt;(xmlhttp.readyState){&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="kw"&gt;case&lt;/span&gt; &lt;span class="i"&gt;4&lt;/span&gt;:&lt;tt&gt;
&lt;/tt&gt;      handleId = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;areaHint&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;      document.getElementById(handleId).innerHTML=xmlhttp.responseText;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="kw"&gt;break&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;      &lt;tt&gt;
&lt;/tt&gt;    &lt;span class="kw"&gt;case&lt;/span&gt; &lt;span class="i"&gt;1&lt;/span&gt;:&lt;tt&gt;
&lt;/tt&gt;      document.getElementById(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;areaHint&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).innerHTML=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Loading...&amp;amp;nbsp;&amp;lt;img src='ajax-loader.gif' alt='loading...' /&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="kw"&gt;break&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;  }  &lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;function&lt;/span&gt; stateChangedStores()&lt;tt&gt;
&lt;/tt&gt;{&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="kw"&gt;switch&lt;/span&gt;(xmlhttp.readyState){&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="kw"&gt;case&lt;/span&gt; &lt;span class="i"&gt;4&lt;/span&gt;:&lt;tt&gt;
&lt;/tt&gt;      handleId = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;storeHint&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;      document.getElementById(handleId).innerHTML=xmlhttp.responseText;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="kw"&gt;break&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;      &lt;tt&gt;
&lt;/tt&gt;    &lt;span class="kw"&gt;case&lt;/span&gt; &lt;span class="i"&gt;1&lt;/span&gt;:&lt;tt&gt;
&lt;/tt&gt;      document.getElementById(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;storeHint&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).innerHTML=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Loading...&amp;amp;nbsp;&amp;lt;img src='ajax-loader.gif' alt='loading...' /&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="kw"&gt;break&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;  } &lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;function&lt;/span&gt; showStoreDetails(storeId){&lt;tt&gt;
&lt;/tt&gt;  storeHandle = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;storeDetail&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + storeId;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="kw"&gt;if&lt;/span&gt;(document.getElementById(storeHandle).style.display==&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;block&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;){&lt;tt&gt;
&lt;/tt&gt;    document.getElementById(storeHandle).style.display = &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;  }&lt;span class="kw"&gt;else&lt;/span&gt;{&lt;tt&gt;
&lt;/tt&gt;    document.getElementById(storeHandle).style.display = &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;block&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;function&lt;/span&gt; GetXmlHttpObject()&lt;tt&gt;
&lt;/tt&gt;{&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;if&lt;/span&gt; (window.XMLHttpRequest)&lt;tt&gt;
&lt;/tt&gt;  {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="c"&gt;// code for IE7+, Firefox, Chrome, Opera, Safari&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="kw"&gt;return&lt;/span&gt; &lt;span class="kw"&gt;new&lt;/span&gt; XMLHttpRequest();&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;if&lt;/span&gt; (window.ActiveXObject)&lt;tt&gt;
&lt;/tt&gt;  {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="c"&gt;// code for IE6, IE5&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="kw"&gt;return&lt;/span&gt; &lt;span class="kw"&gt;new&lt;/span&gt; ActiveXObject(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Microsoft.XMLHTTP&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;&lt;span class="kw"&gt;return&lt;/span&gt; &lt;span class="kw"&gt;null&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Of course, it will be totally up to you how you will implement your query functions and other includes for this, but here is what I have:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;includes/site.inc.php&lt;/strong&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  function getCountries(){&lt;tt&gt;
&lt;/tt&gt;    $db = $GLOBALS['db'];&lt;tt&gt;
&lt;/tt&gt;    $sql = &amp;quot;select * from countries order by name asc&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;    $a = $db-&amp;gt;CacheGetAll(3600,$sql);&lt;tt&gt;
&lt;/tt&gt;    return $a;&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  function getSearch($key){&lt;tt&gt;
&lt;/tt&gt;    $db = $GLOBALS['db'];&lt;tt&gt;
&lt;/tt&gt;    $sql = &amp;quot;select stores.name, stores.contact_person, stores.contact_info, stores.address, countries.name as country_name, countries.id as country_id, areas.name as area_name, areas.id as area_id from stores, countries, areas where (stores.name like '%{$key}%' or stores.address like '%{$key}%' or stores.contact_person like '%{$key}%' or stores.contact_info like '%{$key}%' or stores.email like '%{$key}%' or stores.website like '%{$key}%') and stores.area_id = areas.id and areas.country_id = countries.id order by stores.name, stores.address asc&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;    $a = $db-&amp;gt;GetAll($sql);&lt;tt&gt;
&lt;/tt&gt;    return $a;&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  function getAreasOfCountry($countryId){&lt;tt&gt;
&lt;/tt&gt;    $db = $GLOBALS['db'];&lt;tt&gt;
&lt;/tt&gt;    $sql = &amp;quot;select areas.*, countries.name as country_name from areas, countries where areas.country_id = countries.id and areas.country_id = $countryId order by areas.name asc&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;    $a = $db-&amp;gt;CacheGetAll(3600,$sql);&lt;tt&gt;
&lt;/tt&gt;    return $a;&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  function getStoresOfArea($areaId){&lt;tt&gt;
&lt;/tt&gt;    $db = $GLOBALS['db'];&lt;tt&gt;
&lt;/tt&gt;    $sql = &amp;quot;select * from stores where area_id=$areaId order by name asc&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;    $a = $db-&amp;gt;CacheGetAll(3600,$sql);&lt;tt&gt;
&lt;/tt&gt;    return $a;&lt;tt&gt;
&lt;/tt&gt;  }  &lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;To briefly explain, the stores.php page displays a search form at the top and lists all available countries at the left side.  For better display, the list of countries, areas and stores are clipped and set overflow to automatic only.  Each country is displayed a link which then triggers and ajax call to get the areas for this specific country.  This link points to a javascript method that invokes AJAX and returns the results of the invoked file to the handle specified in our stores.php page.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The list of areas are displayed in the next pane.  The AJAX method displays a loading message while waiting for the results.  Added effects were used from the use of &lt;a href="http://prototypejs.org"&gt;prototype&lt;/a&gt; and &lt;a href="http://script.aculo.us"&gt;scriptaculous&lt;/a&gt; for eye candy only.  If you don't want to implement prototype/scriptaculous, you can remove the following files from being loaded in the head section of your stores.php:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;    &lt;span class="ta"&gt;&amp;lt;script&lt;/span&gt; &lt;span class="an"&gt;src&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;js/prototype.js&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;type&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;text/javascript&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;script&lt;/span&gt; &lt;span class="an"&gt;src&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;js/scriptaculous.js&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;type&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;text/javascript&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;    &lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;and, use these lines to display the names of the country/area:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;in stores.php:&lt;/strong&gt;  &lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;echo &amp;quot;&lt;span class="ta"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="an"&gt;href&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;onclick&lt;/span&gt;=&lt;span class="er"&gt;\&lt;/span&gt;&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;javascript:showAreas('&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;.&lt;/span&gt; &lt;span class="er"&gt;$&lt;/span&gt;&lt;span class="an"&gt;country&lt;/span&gt;&lt;span class="er"&gt;[&lt;/span&gt;&lt;span class="er"&gt;'&lt;/span&gt;&lt;span class="an"&gt;id&lt;/span&gt;&lt;span class="er"&gt;'&lt;/span&gt;&lt;span class="er"&gt;]&lt;/span&gt; &lt;span class="an"&gt;.&lt;/span&gt; &lt;span class="er"&gt;&amp;quot;&lt;/span&gt;&lt;span class="er"&gt;'&lt;/span&gt;&lt;span class="er"&gt;)&lt;/span&gt;&lt;span class="er"&gt;;&lt;/span&gt;&lt;span class="an"&gt;return&lt;/span&gt; &lt;span class="an"&gt;false&lt;/span&gt;&lt;span class="er"&gt;;&lt;/span&gt;&lt;span class="er"&gt;\&lt;/span&gt;&lt;span class="er"&gt;&amp;quot;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&amp;quot; . $country['name'] . &amp;quot;&lt;span class="ta"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&amp;quot;;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;in getareas.php:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;echo &amp;quot;&lt;span class="ta"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="an"&gt;href&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;onclick&lt;/span&gt;=&lt;span class="er"&gt;\&lt;/span&gt;&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;javascript:showStores('&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="an"&gt;.&lt;/span&gt; &lt;span class="er"&gt;$&lt;/span&gt;&lt;span class="an"&gt;area&lt;/span&gt;&lt;span class="er"&gt;[&lt;/span&gt;&lt;span class="er"&gt;'&lt;/span&gt;&lt;span class="an"&gt;id&lt;/span&gt;&lt;span class="er"&gt;'&lt;/span&gt;&lt;span class="er"&gt;]&lt;/span&gt; &lt;span class="an"&gt;.&lt;/span&gt; &lt;span class="er"&gt;&amp;quot;&lt;/span&gt;&lt;span class="er"&gt;'&lt;/span&gt;&lt;span class="er"&gt;)&lt;/span&gt;&lt;span class="er"&gt;;&lt;/span&gt;&lt;span class="an"&gt;return&lt;/span&gt; &lt;span class="an"&gt;false&lt;/span&gt;&lt;span class="er"&gt;;&lt;/span&gt;&lt;span class="er"&gt;\&lt;/span&gt;&lt;span class="er"&gt;&amp;quot;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&amp;quot; . $area['name'] . &amp;quot;&lt;span class="ta"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&amp;quot;;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;You're officially good to go.  There are other tips you can use too.  If you're interested with personalizing your ajax-loader.gif, you can &lt;a href="http://www.ajaxload.info/"&gt;visit this site&lt;/a&gt; and create your own.  And if however, you have a huge amount of information to be stored, make sure you have the correct indices for your database.&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class=""&gt;ALTER&lt;/span&gt; &lt;span class="r"&gt;TABLE&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;areas&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=""&gt;ADD&lt;/span&gt; &lt;span class="r"&gt;INDEX&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;country_id_index&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; ( &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;country_id&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; );&lt;tt&gt;
&lt;/tt&gt;&lt;span class=""&gt;ALTER&lt;/span&gt; &lt;span class="r"&gt;TABLE&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;stores&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=""&gt;ADD&lt;/span&gt; &lt;span class="r"&gt;INDEX&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;store_name_index&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; ( &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; );&lt;tt&gt;
&lt;/tt&gt;&lt;span class=""&gt;ALTER&lt;/span&gt; &lt;span class="r"&gt;TABLE&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;stores&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=""&gt;ADD&lt;/span&gt; &lt;span class="r"&gt;INDEX&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;store_area_id_index&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; ( &lt;span class="s"&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;span class="k"&gt;area_id&lt;/span&gt;&lt;span class="dl"&gt;`&lt;/span&gt;&lt;/span&gt; );&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;This mini store app plus a CMS to maintain it (both from scratch) took me a whole deal of 5hours' work.  I must admit, it was a bit hard for me to go back to working in &lt;a href="http://php.net"&gt;PHP&lt;/a&gt; when I was so overjoyed with &lt;a href="http://ruby-lang.org"&gt;Ruby&lt;/a&gt;.  I knew I could have done this all in &lt;a href="http://rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt; in a little less than 5hours' work and with much lesser code.  I still think that for an application to be neat, less cluttered and specifically working in &lt;a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself"&gt;DRY&lt;/a&gt;, it would take so much effort not like in &lt;a href="http://rubyonrails.org"&gt;Rails&lt;/a&gt;.  And that's the reason why I don't want to go back to &lt;a href="http://php.net"&gt;PHP&lt;/a&gt; again.&lt;/p&gt;

&lt;p&gt;But do help yourself, I saved an archive of this code for your consumption.  Download &lt;a href="http://sweetperceptions.com/downloads/ministore-freebie.zip"&gt;here&lt;/a&gt; or &lt;a href="http://www.4shared.com/file/122365495/8e8f3221/ministore-freebie.html"&gt;here&lt;/a&gt;.  I'm pretty sure you'll put better evolution to this short but sweet app.  Its very crude, and most styles where just hard coded for the benefit of fulfilling a demo for the &lt;a href="http://dakilangbum.com"&gt;client&lt;/a&gt;'s request.  You may want to visit the store playground &lt;a href="http://playground.dakilangbum.com/stores/stores.php"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks and Enjoy!&lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/41DLIH3E6wggnhbw3OWlqHwYu9Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/41DLIH3E6wggnhbw3OWlqHwYu9Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/41DLIH3E6wggnhbw3OWlqHwYu9Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/41DLIH3E6wggnhbw3OWlqHwYu9Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=SBBo4NUWIp4:kzbPZp7M6mY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=SBBo4NUWIp4:kzbPZp7M6mY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=SBBo4NUWIp4:kzbPZp7M6mY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=SBBo4NUWIp4:kzbPZp7M6mY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=SBBo4NUWIp4:kzbPZp7M6mY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=SBBo4NUWIp4:kzbPZp7M6mY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/SBBo4NUWIp4" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/8/2/free-mini-store-search-app-in-php-and-ajax-for-dummies</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-07-05:961</id>
    <published>2009-07-05T06:38:00Z</published>
    <updated>2009-07-05T06:50:17Z</updated>
    <category term="Coding" />
    <category term="Design and CSS" />
    <category term="css" />
    <category term="dakilangbum" />
    <category term="indomagz2" />
    <category term="php" />
    <category term="premium" />
    <category term="python" />
    <category term="rails" />
    <category term="ruby" />
    <category term="theme" />
    <category term="ugaling pinoy" />
    <category term="validation" />
    <category term="wordpress" />
    <category term="xhtml" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/fZAf2nulbfg/premium-should-be-quality" rel="alternate" type="text/html" />
    <title>Premium should be quality</title>
<content type="html">
            &lt;p&gt;Aside from daily tinkering of &lt;a href="http://rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt; application, both for &lt;a href="http://devex.com/maricris"&gt;work&lt;/a&gt; and &lt;a href="http://sweetperceptions.com"&gt;play&lt;/a&gt;, I have to serve requests that involve other scripting languages such as &lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt; and &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt;.  &lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt; is the least of my favorites, but since its still the most widely used scripting language, &lt;em&gt;in which more and more non CS grads have been so boastful of knowing&lt;/em&gt;, then I still go ways to cater to such applications.  Love of &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt; is another thing.  Its as beautiful as Ruby is for me, and as strict as how I tend to live my life. &lt;/p&gt;

&lt;p&gt;As of the moment, I have a project running in &lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt; which was built using &lt;a href="http://www.smarty.net/"&gt;Smarty&lt;/a&gt;, though is &lt;a href="http://upnec.sweetperceptions.com"&gt;not yet deployed&lt;/a&gt; on client's public server.  Aside from this, I am also happily supporting &lt;a href="http://dakilangbum.com"&gt;several Wordpress powered blogs&lt;/a&gt;.  I don't choose the themes, but I do have an input on whether its a good choice or not.  We have completed customization of &lt;a href="http://dakilangbum.com"&gt;two&lt;/a&gt; of &lt;a href="http://rebyu.dakilangbum.com"&gt;these&lt;/a&gt; blogs and was working on the last one yesterday.  The chosen theme was &lt;a href="http://www.magznetwork.com/wordpress-themes/indomagz-free-premium-wordpress-theme.html"&gt;IndoMagz2&lt;/a&gt;.  Of course, I immediately uploaded the theme for use.  After that was the anticipation of other stuff to be removed or added.  &lt;/p&gt;

&lt;p&gt;I couldn't have reacted negatively if I didn't have to go through the codes themselves to make some tweeks.  At first glance, it looked just like any other &lt;a href="http://www.themespreview.com/category/magazine-style/"&gt;magazine type wordpress theme&lt;/a&gt;.  Blocks of elements are organized in the left and right columns of the layout.  Although, I quite believe that three columned layouts are far better in information exposure, I don't have anything against using two columned layouts.  I even thought that the layout was neat looking and the default banner would have really suited the new blog we were fixing.  It was called "&lt;a href="http://ugalingpinoy.dakilangbum.com"&gt;Ugaling Pinoy&lt;/a&gt;" which translates to "Filipino Attitudes" or even "Filipino Characteristics".&lt;/p&gt;
&lt;p&gt;Aside from daily tinkering of &lt;a href="http://rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt; application, both for &lt;a href="http://devex.com/maricris"&gt;work&lt;/a&gt; and &lt;a href="http://sweetperceptions.com"&gt;play&lt;/a&gt;, I have to serve requests that involve other scripting languages such as &lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt; and &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt;.  &lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt; is the least of my favorites, but since its still the most widely used scripting language, &lt;em&gt;in which more and more non CS grads have been so boastful of knowing&lt;/em&gt;, then I still go ways to cater to such applications.  Love of &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt; is another thing.  Its as beautiful as Ruby is for me, and as strict as how I tend to live my life. ;)&lt;/p&gt;

&lt;p&gt;As of the moment, I have a project running in &lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt; which was built using &lt;a href="http://www.smarty.net/"&gt;Smarty&lt;/a&gt;, though is &lt;a href="http://upnec.sweetperceptions.com"&gt;not yet deployed&lt;/a&gt; on client's public server.  Aside from this, I am also happily supporting &lt;a href="http://dakilangbum.com"&gt;several Wordpress powered blogs&lt;/a&gt;.  I don't choose the themes, but I do have an input on whether its a good choice or not.  We have completed customization of &lt;a href="http://dakilangbum.com"&gt;two&lt;/a&gt; of &lt;a href="http://rebyu.dakilangbum.com"&gt;these&lt;/a&gt; blogs and was working on the last one yesterday.  The chosen theme was &lt;a href="http://www.magznetwork.com/wordpress-themes/indomagz-free-premium-wordpress-theme.html"&gt;IndoMagz2&lt;/a&gt;.  Of course, I immediately uploaded the theme for use.  After that was the anticipation of other stuff to be removed or added.  &lt;/p&gt;

&lt;p&gt;I couldn't have reacted negatively if I didn't have to go through the codes themselves to make some tweeks.  At first glance, it looked just like any other &lt;a href="http://www.themespreview.com/category/magazine-style/"&gt;magazine type wordpress theme&lt;/a&gt;.  Blocks of elements are organized in the left and right columns of the layout.  Although, I quite believe that three columned layouts are far better in information exposure, I don't have anything against using two columned layouts.  I even thought that the layout was neat looking and the default banner would have really suited the new blog we were fixing.  It was called "&lt;a href="http://ugalingpinoy.dakilangbum.com"&gt;Ugaling Pinoy&lt;/a&gt;" which translates to "Filipino Attitudes" or even "Filipino Characteristics".&lt;/p&gt;

&lt;p&gt;After a series of tickets have been filed to me for resolution, I needed to open up the codes of the theme and make the actual tweaking.  I started out with the homepage.  Several requests were to totally remove the functionality that the theme offered.  Well, of course, nothing is impossible.  Only time is the variable for every request.  The quality and standard must always be fixed.  This is where the real misery started.  &lt;/p&gt;

&lt;p&gt;I suddenly felt like I wouldn't really be tweaking the theme, but throwing it away altogether!  But this was not the request!  I only have to change some parts to get it going the way it was supposed to.. but this was not my case.  I was dismayed to see its code was nowhere close to premium value!&lt;/p&gt;

&lt;p&gt;I took the liberty of defining &lt;a href="http://www.google.com.ph/search?q=define%3A+premium&amp;amp;ie=utf-8&amp;amp;oe=utf-8&amp;amp;aq=t&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a"&gt;"premium" via Google search&lt;/a&gt;.  Among the varied definitions of premium were:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;ul&gt;
    &lt;li&gt;the amount that something in scarce supply is valued above its
    nominal value; "they paid a premium
    for access to water"&lt;/li&gt;
    &lt;li&gt;having or reflecting superior quality or value; "premium gasoline at
    a premium price" -
    wordnet.princeton.edu/perl/webwn&lt;/li&gt;
    &lt;li&gt;The amount by which a bond or stick sells above its par value. -
    www.deltaindex.com/learningcentre/JargonBuster&lt;/li&gt;
    &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Oh, and the quality was nowhere close to what I have expected!  And here, I have to make my own test to prove to myself that I have not misjudged the quality of this product.  Wordpress has already formed a group effort of identifying which themes deserve the limelight.  Not only to put a few above the rest, but to create models for a good quality theme.  At &lt;a href="http://www.themespreview.com/"&gt;Themes Preview&lt;/a&gt;, they quantify the good qualities of each theme into three groups: gold, silver and bronze with a &lt;a href="http://www.themespreview.com/theme-info/"&gt;distinct list of criteria&lt;/a&gt; used for judging.  Let's try to do the same for this case.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div&gt;

&lt;/div&gt;

&lt;p&gt;&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I run the validator and I get errors &lt;/p&gt;&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I run the validator and css passed &lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;guess, what? no support. &lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;IE6?  Good thing, yes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;Firefox compatible?  Good thing, yes.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Gravatar supported &lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto adjustment within the sidebar is also a failure &lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I adjusted the default post image to something larger than the post area and it passes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Floating content within post area is okay, but the style is not good.   Photo is not padded. &lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Proper image alignment doesn't work.  I tried to force alignment values to no avail.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;Proper sidebar heirarchy fail 
&lt;blockquote&gt;
    &lt;p&gt;&lt;/li&gt;
    &lt;/ul&gt;
    There are others more that exemplify that this premium is nothing better than any other free.  Despite the &lt;a href="http://www.magznetwork.com/download/3/"&gt;guide that was downloadable from the site&lt;/a&gt;, there were items that drew more negative comments.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;The theme was not tested on the latest version.  It only supported up to 2.6.x.&lt;/li&gt;
  &lt;li&gt;The only way to make changes to this theme was to directly edit the code.  Which was kind of hard for the normal, average blogger.&lt;/li&gt;
  &lt;li&gt;The code for the home.php alone was about ~185 lines.  This is quite huge considering that Wordpress and PHP is already modular.&lt;/li&gt;
  &lt;li&gt;Though the styles passed the validation, it wasn't semantic enough.  The naming of the styles were not intuitive enough nor is it reusable anywhere outside the name context.&lt;/li&gt;
  &lt;li&gt;Not all posts may have a photo.  The theme doesn't support this complexity.  Instead, it forces you to put a photo there unless you'd rather see the default "missing photo thumbnail".&lt;/li&gt;
  &lt;li&gt;The code was not properly indented.  Not readable. &lt;/li&gt;
  &lt;li&gt;The link for support on the themes management page did not go to the correct page.  Instead, they have a forum for the support where as of the moment had only three (3) posts.  I wonder how else I can get support for this?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I really can't say its simple.  Nor can I say its clean (for it should be clean inside and out).  Its customizeable alright, but only if you can survive reading the jungle-like code.  I definitely wouldn't recommend using this. &lt;/p&gt;

&lt;p&gt;Watch out for what becomes of &lt;a href="http://ugalingpinoy.dakilangbum.com"&gt;Ugaling Pinoy&lt;/a&gt; soon.  We won't be using Indomagz2 theme anymore, rest assured.&lt;/p&gt;

&lt;div&gt;&lt;/div&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eZG-OA0tMfr9pBbAtfWl1dtrlwM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eZG-OA0tMfr9pBbAtfWl1dtrlwM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eZG-OA0tMfr9pBbAtfWl1dtrlwM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eZG-OA0tMfr9pBbAtfWl1dtrlwM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=fZAf2nulbfg:UhBN0nUaHhs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=fZAf2nulbfg:UhBN0nUaHhs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=fZAf2nulbfg:UhBN0nUaHhs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=fZAf2nulbfg:UhBN0nUaHhs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=fZAf2nulbfg:UhBN0nUaHhs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=fZAf2nulbfg:UhBN0nUaHhs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/fZAf2nulbfg" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/7/5/premium-should-be-quality</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-07-01:956</id>
    <published>2009-07-01T13:52:00Z</published>
    <updated>2009-07-02T13:55:57Z</updated>
    <category term="Life can't wait!" />
    <category term="Wordless Wednesday" />
    <category term="codinghorror" />
    <category term="habits" />
    <category term="programming" />
    <category term="twitter" />
    <category term="wordless wednesday" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/P8dTdTPLm3c/be-wrong-to-be-correct" rel="alternate" type="text/html" />
    <title>Be wrong to be correct</title>
<content type="html">
            &lt;p&gt;&lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vLgB0PdPe5x3G6cH5AwiyUuv5Wo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vLgB0PdPe5x3G6cH5AwiyUuv5Wo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vLgB0PdPe5x3G6cH5AwiyUuv5Wo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vLgB0PdPe5x3G6cH5AwiyUuv5Wo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=P8dTdTPLm3c:SD-As11dWX4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=P8dTdTPLm3c:SD-As11dWX4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=P8dTdTPLm3c:SD-As11dWX4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=P8dTdTPLm3c:SD-As11dWX4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=P8dTdTPLm3c:SD-As11dWX4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=P8dTdTPLm3c:SD-As11dWX4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/P8dTdTPLm3c" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/7/1/be-wrong-to-be-correct</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-06-20:949</id>
    <published>2009-06-20T18:02:00Z</published>
    <updated>2009-06-27T18:13:18Z</updated>
    <category term="Life can't wait!" />
    <category term="Tech Juices" />
    <category term="aim" />
    <category term="calendar" />
    <category term="email" />
    <category term="geektool" />
    <category term="google calendar" />
    <category term="gtd" />
    <category term="hiveminder" />
    <category term="ical" />
    <category term="im" />
    <category term="isync" />
    <category term="jabber" />
    <category term="lifehacker" />
    <category term="mac" />
    <category term="mobile" />
    <category term="msn" />
    <category term="tastyplanner" />
    <category term="twitter" />
    <category term="yahoo" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/ZjT6IlSemIM/making-gtd-work-for-you-using-hiveminder-google-calendar-ical-isync-and-your-mobile" rel="alternate" type="text/html" />
    <title>Making GTD work for you using Hiveminder, Google Calendar, iCal, iSync and your mobile</title>
<content type="html">
            &lt;p&gt;&lt;/p&gt;

&lt;p&gt;I'm a fairly new member of &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt;.  I remember, I saw it first from a &lt;a href="http://lifehacker.com/software/to-do-managers/track-and-share-your-to-dos-with-hiveminder-193401.php"&gt;Lifehacker article&lt;/a&gt; discussing about the best &lt;a href="http://en.wikipedia.org/wiki/Getting_Things_Done"&gt;GTD&lt;/a&gt; tool.  I wanted something unobstrusive and could be used in a variety of ways.&lt;/p&gt;

&lt;p&gt;I found &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt; and I gave it a spin.  I immediately liked its simple layout which is quite refreshing and neat.  I don't have to think much about how to use it.  I immediately began using the "braindump" for all the tasks I had to work on.  Though I'm a fan of handy notebooks, I would very much love to have technology remind me of things I need to work on too.  Sometimes, I get too lazy to read my notebook or scribble down my thoughts for most of the time, I think faster than I could write!&lt;/p&gt;
&lt;p&gt;I'm a fairly new member of &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt;.  I remember, I saw it first from a &lt;a href="http://lifehacker.com/software/to-do-managers/track-and-share-your-to-dos-with-hiveminder-193401.php"&gt;Lifehacker article&lt;/a&gt; discussing about the best &lt;a href="http://en.wikipedia.org/wiki/Getting_Things_Done"&gt;GTD&lt;/a&gt; tool.  I wanted something unobstrusive and could be used in a variety of ways.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I found &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt; and I gave it a spin.  I immediately liked its simple layout which is quite refreshing and neat.  I don't have to think much about how to use it.  I immediately began using the "braindump" for all the tasks I had to work on.  Though I'm a fan of handy notebooks, I would very much love to have technology remind me of things I need to work on too.  Sometimes, I get too lazy to read my notebook or scribble down my thoughts for most of the time, I think faster than I could write!&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;At first, I just put everything in the braindump.  Later on, I got to study the integration of the tools available to &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt;.  Its really wonderful that several services could be made available through the use of already institutionalized basic services such as IMs and Emails.  Right now, &lt;a href="http://twitter.com"&gt;Twitter&lt;/a&gt; is becoming another one of those basic services, along with &lt;a href="http://facebook.com/sweetperceptions"&gt;Facebook&lt;/a&gt;, of course.&lt;/p&gt;

&lt;p&gt;Although they haven't integrated their IM service to &lt;a href="http://yahoo.com"&gt;Yahoo&lt;/a&gt; yet, its already available to those using AIM and &lt;a href="http://gmail.com"&gt;Gmail&lt;/a&gt;/jabber IM accounts.  They have a very &lt;a href="http://hiveminder.com/help/reference/IM"&gt;comprehensive list of commands available for IM use&lt;/a&gt; and a short but sweet &lt;a href="http://hiveminder.com/help/how-to/tasks-by-IM.html"&gt;guide to using the IM service&lt;/a&gt;.  The email tool seems very helpful too!  I figured if you can't do IM in your office but would really love to be able to collate your tasks in &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt;, you're gonna love this.  Well, whilst the other may be using their IMs or Emails for this, &lt;a href="http://twitter.com"&gt;Twitter&lt;/a&gt; buffs won't be ostracized too!  They have an account at Twitter which they hooked up for us when if we want to jot down tasks via &lt;a href="http://twitter.com"&gt;Twitter&lt;/a&gt;.  Its a direct message, so nobody will see it at all.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Over the couple of months that I've been using &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt;, what I find lacking in it is a good security setup (though they reserve it for their Pro users--I'm only using the basic free one).  And another, would be a good roundtrip syncing of items with their available tools.&lt;/p&gt;

&lt;p&gt;Apart from jotting down your tasks, of course you'd want to be reminded of them.  I use &lt;a href="http://projects.tynsoe.org/en/geektool/"&gt;GeekTool&lt;/a&gt; to display my &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt; items on my desktop via an export of my tasks in text format.  Another more useful tool for me is the export to &lt;a href="http://en.wikipedia.org/wiki/ICal"&gt;iCal&lt;/a&gt;.  And this marks where I make a more holistic approach to my &lt;a href="http://en.wikipedia.org/wiki/Getting_Things_Done"&gt;GTD&lt;/a&gt; life.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Google Calendar, the center of the agenda&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I don't know how it is that others get to do their &lt;a href="http://en.wikipedia.org/wiki/Getting_Things_Done"&gt;GTD&lt;/a&gt;s via a sole tool or process alone, but I do use several tools at different times.  I'm a sort of a Google buff/Google whore (or whatever you might want to call a person who spends most of their time within Google services).  I use mostly Google powered tools to power my lifestyle.  I email, I read, I surf, I check my sites, etc. using Google related services.  Its not surprising, I'd find &lt;a href="http://www.google.com/calendar/render"&gt;Google calendar&lt;/a&gt; better than any other online calendars out there.&lt;/p&gt;

&lt;p&gt;Our office shares calendars via &lt;a href="http://www.google.com/calendar/render"&gt;Google calendar&lt;/a&gt; and also in Apptix (which I hate by the way).  I like the fact that I could subscribe/unsubscribe from several calendars using only one account.  With this, I keep the personal events from the public events in separate entities, while I'm able to access/view them using only one account.  Routinely, I would backup my calendar via an export to &lt;a href="http://en.wikipedia.org/wiki/ICal"&gt;iCal&lt;/a&gt; format.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Exporting to &lt;a href="http://en.wikipedia.org/wiki/ICal"&gt;iCal&lt;/a&gt; format seems to work best for me whenever I'm offline (which I so often hate to be).  I can quickly breeze through my appointments and reminders via &lt;a href="http://en.wikipedia.org/wiki/ICal"&gt;iCal&lt;/a&gt;.  Note that, even if Google Calendar has an option for sync already, I haven't been able to get it to sync with my &lt;a href="http://www.sonyericsson.com/cws/products/mobilephones/overview/w960i"&gt;W960&lt;/a&gt;, that's why I'm opting to do it this way.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;iCal, one step closer to me offline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/ICal"&gt;iCal&lt;/a&gt; is very flexible tool that I have not yet maximized.  You can jot notes on your events, create alarms, sync with other calendars, etc.  Although I have not yet used it to its full potential, I'm already happy with making use of it with what I have and for my needs.  It makes my life easier when I'm in offline mode.&lt;/p&gt;

&lt;p&gt;Right now, I have my &lt;a href="http://www.google.com/calendar/render"&gt;Google calendar&lt;/a&gt; imported into &lt;a href="http://en.wikipedia.org/wiki/ICal"&gt;iCal&lt;/a&gt; (which I manually do from time to time).  As part of the whole integration, I also export my &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt; tasks to &lt;a href="http://en.wikipedia.org/wiki/ICal"&gt;iCal&lt;/a&gt;.  I also have another calendar for TastyPlanner which I have included in my &lt;a href="http://en.wikipedia.org/wiki/ICal"&gt;iCal&lt;/a&gt; setup.  &lt;/p&gt;

&lt;p&gt;I just set my &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt; and &lt;a href="http://tastyplanner.com/"&gt;TastyPlanner&lt;/a&gt; subscription to auto refresh every now and then to receive updates.  I do the manual import of my &lt;a href="http://www.google.com/calendar/render"&gt;Google Calendar&lt;/a&gt; since I want the items there to be grouped into one subscription.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;iSync, the bridge to mobility&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finally, there's the missing link.  None of these tools could have been any more useful than they are alone without syncing them all to my mobile.  Of course, when internet and laptop are both missing, I still have to survive.  Good thing &lt;a href="http://www.apple.com/support/isync/"&gt;iSync&lt;/a&gt; is there to give my life a fuller shape.&lt;/p&gt;

&lt;p&gt;For a long while back, I wasn't able to find a plugin that could help me link &lt;a href="http://www.apple.com/support/isync/"&gt;iSync&lt;/a&gt; with my &lt;a href="http://www.sonyericsson.com/cws/products/mobilephones/overview/w960i"&gt;W960i&lt;/a&gt; phone.  I have searched long and hard to find it since it wasn't automatically detected by &lt;a href="http://www.apple.com/support/isync/"&gt;iSync&lt;/a&gt;'s native setup alone.&lt;/p&gt;

&lt;p&gt;I have found &lt;a href="http://www.esato.com/archive/t.php/t-162631,1.html"&gt;this&lt;/a&gt; and gave it a try.  It worked for me!  Now, my calendars and todos can be synced to my mobile and I don't have to miss anything!&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maximizing this setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, there are tricky items in this setup.  &lt;a href="http://hiveminder.com"&gt;Hiveminder&lt;/a&gt; doesn't really show up in your &lt;a href="http://en.wikipedia.org/wiki/ICal"&gt;iCal&lt;/a&gt; after the export/import has been put in place.  The key factor is to always put due dates in your tasks if you want them to be visible in your synced calendar.  &lt;/p&gt;

&lt;p&gt;Another thing would be if you keep on missing your appointments/reminders just because you failed to look at your calendar.  But this can be fixed!  What I do for this, is to setup Google to send me SMS reminders from &lt;a href="http://www.google.com/calendar/render"&gt;Google Calendar&lt;/a&gt;.  You can do this too by going to your Google Calendar &gt;&gt; Settings &gt;&gt; Mobile Setup.&lt;/p&gt;

&lt;p&gt;So there, if this doesn't work for you, you can still explore other ways of making your life's tasks easier and faster to accomplish.  Maybe sometime soon, I can come up with something better for me too.  Who knows? :)&lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IVpHHReYe9WiJUu8Tqx6xD9UrR0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IVpHHReYe9WiJUu8Tqx6xD9UrR0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IVpHHReYe9WiJUu8Tqx6xD9UrR0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IVpHHReYe9WiJUu8Tqx6xD9UrR0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=ZjT6IlSemIM:JcfiS2k63xg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=ZjT6IlSemIM:JcfiS2k63xg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=ZjT6IlSemIM:JcfiS2k63xg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=ZjT6IlSemIM:JcfiS2k63xg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=ZjT6IlSemIM:JcfiS2k63xg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=ZjT6IlSemIM:JcfiS2k63xg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/ZjT6IlSemIM" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/6/20/making-gtd-work-for-you-using-hiveminder-google-calendar-ical-isync-and-your-mobile</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-06-04:933</id>
    <published>2009-06-04T04:57:00Z</published>
    <updated>2009-06-27T18:14:12Z</updated>
    <category term="dupliate title" />
    <category term="duplicate meta" />
    <category term="duplicate tags" />
    <category term="google" />
    <category term="google webmaster" />
    <category term="mephisto" />
    <category term="monitor" />
    <category term="themes" />
    <category term="tools" />
    <category term="webmaster" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/wtnZoh8O8-s/playing-it-safe-with-google-s-web-tools" rel="alternate" type="text/html" />
    <title>Playing it safe with Google's web tools</title>
<content type="html">
            &lt;p&gt;Just for the sake of 'doing-it-right', I enrolled all my sites into &lt;a href="http://www.google.com/analytics/"&gt;Google's Analytics&lt;/a&gt; and subjected them to &lt;a href="http://www.google.com/webmasters"&gt;Google Webmaster's tools&lt;/a&gt;.  I'd check them from time to time to set some updates and fix reported errors.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.google.com/webmasters"&gt;Google Webmaster's tools&lt;/a&gt; is quite a handy measure for beginners who don't know where to start with their site monitoring or how to improve their pages the way Google sees it.  You can optimize your page titles, see how to do it..&lt;/p&gt;
&lt;p&gt;Just for the heck of 'doing-it-right', I enrolled all my sites into &lt;a href="http://www.google.com/analytics/"&gt;Google's Analytics&lt;/a&gt; and subjected them to &lt;a href="http://www.google.com/webmasters"&gt;Google Webmaster's tools&lt;/a&gt;.  I'd check them from time to time to set some updates and fix reported errors.&lt;/p&gt;

&lt;p&gt;Google Webmaster's tools is quite a handy measure for beginners who don't know where to start with their site monitoring or how to improve their pages the way Google sees it.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;What has been confusing was that, Google reports multiple instances of the same title tag for some of my pages.  This doesn't happen with &lt;a href="http://livinglife.sweetperceptions.com"&gt;Wordpress&lt;/a&gt; though.  Since I just ported a &lt;a href="http://www.templatelite.com/"&gt;Wordpress theme&lt;/a&gt; look to mephisto, I wondered if it was just my fault and if ever, how could I fix it.  I looked into the default mephisto theme, and found this in the layout:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&amp;lt;title&amp;gt;{{ site.title }} {&lt;span class="s"&gt;&lt;span class="dl"&gt;% &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="dl"&gt; &lt;/span&gt;&lt;/span&gt;article &lt;span class="s"&gt;&lt;span class="dl"&gt;%}&lt;/span&gt;&lt;span class="k"&gt; {{ article.title &lt;/span&gt;&lt;span class="dl"&gt;}&lt;/span&gt;&lt;/span&gt;} {&lt;span class="s"&gt;&lt;span class="dl"&gt;% &lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="dl"&gt; &lt;/span&gt;&lt;/span&gt;%} {{ site.subtitle }} {&lt;span class="s"&gt;&lt;span class="dl"&gt;% &lt;/span&gt;&lt;span class="k"&gt;endif&lt;/span&gt;&lt;span class="dl"&gt; &lt;/span&gt;&lt;/span&gt;%}&amp;lt;&lt;span class="rx"&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;span class="k"&gt;title&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;This sets the title to the title of the article when an article is present, but to the site subtitle for pages such as article archive, tag archive, page or even section archive.  Some &lt;a href="http://themes.benlog.org/"&gt;mephisto themes&lt;/a&gt; (like &lt;a href="http://evil.che.lu/projects/skittlish"&gt;skittlish&lt;/a&gt;) support the change in the page title (for its archives, dunno for the tag archives).  I haven't tried skittlish myself, but here's my take on how you can make your mephisto pages have unique titles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In your themes directory (or whichever path you have your theme in), create a new file called &lt;em&gt;title&lt;/em&gt;header.liquid (or whatever you'd have it called) inside the templates directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Put the following code in it:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;{&lt;span class="s"&gt;&lt;span class="dl"&gt;% &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="dl"&gt; &lt;/span&gt;&lt;/span&gt;article &lt;span class="s"&gt;&lt;span class="dl"&gt;%}&lt;/span&gt;&lt;span class="k"&gt;&lt;tt&gt;
&lt;/tt&gt;  &amp;lt;meta name=&amp;quot;description&amp;quot; content=&amp;quot;Put your site description here.  Put an intro to article here '{{ article.title &lt;/span&gt;&lt;span class="dl"&gt;}&lt;/span&gt;&lt;/span&gt;}&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;.&amp;quot;/&amp;gt;  &lt;tt&gt;
&lt;/tt&gt;  &amp;lt;meta name=&amp;quot;keywords&amp;quot; content=&amp;quot;put, your, default, keywords, here, separated, by, commas, {{ article.title }}&amp;quot;/&amp;gt;&lt;tt&gt;
&lt;/tt&gt;{% endif %}&lt;tt&gt;
&lt;/tt&gt;{% if section %} &lt;tt&gt;
&lt;/tt&gt;  {% if section.name == &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;span class="co"&gt;Home&lt;/span&gt;&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt; and archive_date %}&lt;tt&gt;
&lt;/tt&gt;    &amp;lt;meta name=&amp;quot;description&amp;quot; content=&amp;quot;Put your site description here.  Put an intro to the archive date {{ archive_date | format_date: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;my&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;}} articles.&amp;quot;/&amp;gt;    &lt;tt&gt;
&lt;/tt&gt;    &amp;lt;meta name=&amp;quot;keywords&amp;quot; content=&amp;quot;put, your default, keywords, here, separated, by, commas, {{ archive_date | format_date: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;my&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;}}&amp;quot;/&amp;gt;&lt;tt&gt;
&lt;/tt&gt;  {% else %}&lt;tt&gt;
&lt;/tt&gt;    &amp;lt;meta name=&amp;quot;description&amp;quot; content=&amp;quot;Put your site description here.  Put an intro to the section archive {{ section.name }} articles.&amp;quot;/&amp;gt;&lt;tt&gt;
&lt;/tt&gt;    &amp;lt;meta name=&amp;quot;keywords&amp;quot; content=&amp;quot;put, your default, keywords, here, separated, by, commas, {{ section.name }}&amp;quot;/&amp;gt;&lt;tt&gt;
&lt;/tt&gt;  {% endif %}&lt;tt&gt;
&lt;/tt&gt;{% endif %}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;In your layout.liquid, find the meta tag with the content-type and put the following code:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  &amp;lt;meta content=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;application/xhtml+xml; charset=utf-8&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; http-equiv=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;content-type&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;/&amp;gt;&lt;tt&gt;
&lt;/tt&gt;  {&lt;span class="s"&gt;&lt;span class="dl"&gt;% &lt;/span&gt;&lt;span class="k"&gt;include&lt;/span&gt;&lt;span class="dl"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;title_header&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; %}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;And, that's it!  Save your templates, and give it a restart.  You should be able to get rid of the Google webmaster errors in its diagnostics section.  If you're interested to find out more about the archiving, you can start &lt;a href="http://groups.google.com/group/MephistoBlog/browse_thread/thread/fde557ffc03bace2"&gt;here&lt;/a&gt; or explore the codes of &lt;a href="http://evil.che.lu/projects/skittlish"&gt;skittlish theme&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Feel free to leave me a message if you enjoyed this post.  ;) &lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SmPEA9mMS-ArsoLYJDsr3o8rO1U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SmPEA9mMS-ArsoLYJDsr3o8rO1U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SmPEA9mMS-ArsoLYJDsr3o8rO1U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SmPEA9mMS-ArsoLYJDsr3o8rO1U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=wtnZoh8O8-s:m_IqHscPPOk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=wtnZoh8O8-s:m_IqHscPPOk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=wtnZoh8O8-s:m_IqHscPPOk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=wtnZoh8O8-s:m_IqHscPPOk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=wtnZoh8O8-s:m_IqHscPPOk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=wtnZoh8O8-s:m_IqHscPPOk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/wtnZoh8O8-s" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/6/4/playing-it-safe-with-google-s-web-tools</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-05-31:929</id>
    <published>2009-05-31T11:36:00Z</published>
    <updated>2009-06-27T18:14:47Z</updated>
    <category term="Coding" />
    <category term="Ruby and/or Rails" />
    <category term="atom" />
    <category term="blog" />
    <category term="i.ph" />
    <category term="publishing" />
    <category term="ruby" />
    <category term="scraping" />
    <category term="wordpress" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/v3ds7oZ92O4/migrate-your-wordpress-blog-using-ruby-and-atom" rel="alternate" type="text/html" />
    <title>Migrate to your Wordpress blog using Ruby and Atom</title>
<content type="html">
            &lt;p&gt;Recently, I have encountered a dilemma regarding my personal blog.  I have it hosted by a &lt;a href="http://i.ph"&gt;local blog host provider&lt;/a&gt;.  It was great staying there and blogging there when there was still this very tight-knit community of bloggers.  From time to time, we'd all meet up and just express our thoughts in person.  The providers were really great with hearing out their users' thoughts, wishes including rants and raves.  They were really good with what they were doing (up to some point in time).&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Now, being the Ruby lover that I am, I decided to write a Ruby script that would scrape my content and push it onto my &lt;a href="http://livinglife.sweetperceptions.com"&gt;new Wordpress blog&lt;/a&gt;.  There are a couple of assumptions/caveats for this script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can scrape off content from only &lt;strong&gt;YOUR OWN BLOG&lt;/strong&gt;.  Please don't use this to steal other people's content.  &lt;strong&gt;&lt;em&gt;I am not liable for any online content theft from the use of this script.&lt;/strong&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;You must be able to understand the structure of the blog you are scraping.  You should know where the "excerpt", "main body", "post date", "post author", etc. info are located from the markup/source of the blog you are scraping.&lt;/li&gt;
&lt;li&gt;You must have the credentials of the blog where you want to push the scraped content.&lt;/li&gt;
&lt;li&gt;If in case you need something else, or some more tweaking to this script, you must know Ruby, or maybe you can &lt;a href="mailto:coderkitty @ sweetperceptions.com"&gt;drop me a line&lt;/a&gt; and I'll see how I can help you.&lt;/li&gt;
&lt;li&gt;This script uses Atom tools, although there are other gems available, this is what I chose to use.&lt;/li&gt;
&lt;li&gt;Turn on Atom publishing in your Wordpress blog.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;Recently, I have encountered a dilemma regarding my personal blog.  I have it hosted by a &lt;a href="http://sweetperceptions.i.ph"&gt;local blog host provider&lt;/a&gt;.  It was great staying there and blogging there when there was still this very tight-knit community of bloggers.  From time to time, we'd all meet up and just express our thoughts in person.  The providers were really great with hearing out their users' thoughts, wishes including rants and raves.  They were really good with what they were doing (up to some point in time).&lt;/p&gt;

&lt;p&gt;Here are a couple of my raves about their service and the community:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Most of the members were real people.  Not just an avenue for spammers and anonymous bloggers&lt;/li&gt;
&lt;li&gt;People of that community were intelligent people.  Its nice to have some good conversations with them.&lt;/li&gt;
&lt;li&gt;There's always a superhero in the forum who always tries to help (though he's not connected with the providers themselves)&lt;/li&gt;
&lt;li&gt;Even their higher management mingle with the people of their community&lt;/li&gt;
&lt;li&gt;Customer support is quick to reply&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And some of my rants too:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sometimes, they forget about threads/issues &lt;/li&gt;
&lt;li&gt;Their customer support is very poor in their knowledge of how the system works&lt;/li&gt;
&lt;li&gt;Their customer support cannot provide tech support&lt;/li&gt;
&lt;li&gt;No integration to offline blogging software (though &lt;a href="http://wordpress.org"&gt;Wordpress&lt;/a&gt; supports this)&lt;/li&gt;
&lt;li&gt;I found out, (while writing this script), that they had a lot of substandard tweaks (especially in the markup)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And yes, it might be too obvious for some, I have experienced all of my rants in the past few weeks that have passed.  I was under the intent of making an offline backup of my blog (hosted with them).  And with this, I got in touch with their customer support.  I have been courteous enough, patient and understanding that my request might come in weird, or exceptional to that case.  The &lt;a href="http://i.ph"&gt;I.ph&lt;/a&gt; platform is really made of &lt;a href="http://wordpress.org"&gt;Wordpress engine&lt;/a&gt;, and that they tweaked this engine to conform to some of their requirements in providing their own bloghost.  I knew for a fact that a backup could easily have been given only to special requests like mine.   But this was not my case.&lt;/p&gt;

&lt;p&gt;It seemed to me that they were reluctant, if not totally disagreeing with the fact that they'd release a backup of my blog.. for what reason, I don't know why.  Maybe because their tweaks have made &lt;a href="http://wordpress.org"&gt;Wordpress engine&lt;/a&gt;'s support for one click backup unusable??  I tried to reason out by giving them clarification of what I needed from them, but they made me wait in vain.  Alas, my patience broke out when I received an email from their customer support saying..&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Of course I know my own &lt;a href="http://feeds.feedburner.com/Coderkitty-Home"&gt;RSS feed&lt;/a&gt;, don't I?  But that was not what was asked for!  At rage, I decided to take matters into my own fiery hands.  I couldn't say well enough that that email only made me furious.. well, it also made me excited and happy!  Happy that I could once again write my own code to reach my own goal!  Since I was bent on getting my own backup in an easy way, I looked up some reference online on whether somebody else could have done or wrote something similar to what I had in mind.  I found &lt;a href="http://www.technetra.com/2009/02/24/migrating-your-blogs-content-to-wordpress/"&gt;this&lt;/a&gt;, but it seems to be dead as of the time of writing.&lt;/p&gt;

&lt;p&gt;Now, being the Ruby lover that I am, I decided to write a Ruby script that would scrape my content and push it onto my &lt;a href="http://livinglife.sweetperceptions.com"&gt;new Wordpress blog&lt;/a&gt;.  There are a couple of assumptions/caveats for this script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can scrape off content from only &lt;strong&gt;YOUR OWN BLOG&lt;/strong&gt;.  Please don't use this to steal other people's content.  &lt;strong&gt;&lt;em&gt;I am not liable for any online content theft from the use of this script.&lt;/strong&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;You must be able to understand the structure of the blog you are scraping.  You should know where the "excerpt", "main body", "post date", "post author", etc. info are located from the markup/source of the blog you are scraping.&lt;/li&gt;
&lt;li&gt;You must have the credentials of the blog where you want to push the scraped content.&lt;/li&gt;
&lt;li&gt;If in case you need something else, or some more tweaking to this script, you must know Ruby, or maybe you can &lt;a href="mailto:coderkitty@sweetperceptions.com"&gt;drop me a line&lt;/a&gt; and I'll see how I can help you.&lt;/li&gt;
&lt;li&gt;This script uses Atom tools, although there are other gems available, this is what I chose to use.&lt;/li&gt;
&lt;li&gt;Turn on Atom publishing in your Wordpress blog.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Ready?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First, of course, have a working Ruby setup.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next, make sure you have the following gems: (1) &lt;a href="http://wiki.github.com/why/hpricot"&gt;Hpricot&lt;/a&gt; and (2) &lt;a href="http://raa.ruby-lang.org/project/atom-tools/"&gt;Atom&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;sudo gem install hpricot&lt;tt&gt;
&lt;/tt&gt;sudo gem install atom-tools&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Test the following requires in your irb.  If it doesn't raise an error, then you're good to go. :)&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;require &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;rubygems&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;require &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;open-uri&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;require &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;net/http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;require &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;hpricot&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;require &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;atom/entry&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;require &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;atom/collection&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Secure all the variables you'll need:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;wp_blog_host = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;livinglife.sweetperceptions.com&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class="c"&gt;#the wordpress blog you want to post to&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;wp_blog_uri = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;http://&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;wp_blog_host&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class="c"&gt;#making it browseable&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;wp_base = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;http://&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;wp_blog_host&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt;/wp-app.php&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class="c"&gt;#appending the base for publishing posts&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;wp_blog_username = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;myusername&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class="c"&gt;#username to the wordpress blog you want to post to&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;wp_blog_password = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;mypassword&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class="c"&gt;#password to the wordpress blog you want to post to&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;your_blog_source = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;http://sweetperceptions.i.ph&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class="c"&gt;#the page you want to scrape content from&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;which_pages = &lt;span class="i"&gt;1&lt;/span&gt;..&lt;span class="i"&gt;19&lt;/span&gt;  &lt;span class="c"&gt;#put the pages here, if the content source will need this, see how I used it &lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;You must have registered categories on your recipient wordpress blog to be able to automatically categorize your posts.  If your blog source already have categories, then you can use these exact names for the migration.  If you only have tags, I can still help you out (as this was my trouble too).  You'll need to declare your registered categories as such (these are my own categories):&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;registered_categories = [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;About me&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Artistry&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Cool Finds&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Dreams&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Events&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Health and Beauty&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Horoscope&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Living Life&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Meme&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Movies&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Music&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Notes&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Pet Love&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Quotes&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Random thoughts&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Stories to share&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Techie&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Travel&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;] &lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;If these new registered categories do not match those that you currently have in your blog source, then explicitly setting "synonym categories" would help.  For those who did not categorize their posts, and solely rely on their tags, this could be your best avenue for categorizing your posts automatically.  Try to categorize which tags (and old categories) would fall into your new categories.  &lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;synonym_categories = {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;About me&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;me&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;], &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Artistry&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;poem&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Cool Finds&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;cool&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Dreams&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;dream&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;dreams&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Events&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;event&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;bday&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;birthday&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Christmas&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;New year&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;new-year&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;celebration&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Health and Beauty&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;health&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;sickness&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;headache&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;fever&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;cancer&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Horoscope&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;cookie&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;fortune&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;horoscope&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;astrology&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;psych&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Living Life&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;life&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;kalokohan&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Meme&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;meme&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Movies&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;hollywood&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;movie&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;movies&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;movie-lines&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;happy-feet&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Music&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;song&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;songs&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;singer&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;music&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;ost&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Notes&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;notes&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Pet Love&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;pet&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;cat&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;dog&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;animal&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;animals&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;pets&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Quotes&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;quote&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;quotes&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Random thoughts&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;thought&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;thoughts&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;think&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;logic&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Stories to share&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;story&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;stories&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;adventure&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Techie&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;tech&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;techie&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;work&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;web2.0&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;development&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;software&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;online&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;skype&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;pc&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Travel&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;philippines&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;travel&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;province&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;When everything here is set, you'll need to understand that if you don't have your own sitemap of posts' links, you'll need to extract them manually by visiting all pages of your blog_source to get their urls.  This might take some time.  Its better if you have a list of your own posts' urls via a sitemap.  If not, then you'll have to set your blog source pages like this (mine had the format http://sweetperceptions.i.ph/page/N):&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;which_pages.each &lt;span class="r"&gt;do&lt;/span&gt; |page|&lt;tt&gt;
&lt;/tt&gt;  from = Hpricot(open(your_blog_source + &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;/page/&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;page.to_s&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;))&lt;tt&gt;
&lt;/tt&gt;  urls &amp;lt;&amp;lt; (from/&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;h3[@class='entrytitle']/a&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).collect{|x| x[&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;href&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;]}&lt;tt&gt;
&lt;/tt&gt;&lt;span class="r"&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Or, use your links from a sitemap.  I only used text format for my own use.  To do this,&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;urls = &lt;span class="co"&gt;File&lt;/span&gt;.readlines(urls_to_import).map { |line| line.chomp }&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;Now, let's take a deep breath.  The next steps would be more about &lt;a href="http://wiki.github.com/why/hpricot"&gt;Hpricot&lt;/a&gt;, and parsing your own document to extract the necessary information.  I'll walk you through how I got mine, but then you'll have to construct your own for each section necessary.  ;)  I'll show you the snippet of the section involved, followed by the &lt;a href="http://wiki.github.com/why/hpricot"&gt;Hpricot&lt;/a&gt; code to get it.  I used &lt;a href="https://addons.mozilla.org/firefox/addon/1843"&gt;Firebug&lt;/a&gt; to help me with this, by the way. &lt;/p&gt;

&lt;p&gt;This is an example of one post in my blog source:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get the title of your post.  Each blog entry in my blog source is enclosed in a div which contains an h3 tag with class 'entrytitle'.  The actual title is enclosed in a link.  You always call the inner_html of the element node you're looking at to get the text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  title = (&lt;span class="co"&gt;CGI&lt;/span&gt;::unescapeHTML((doc/&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;div/h3[@class='entrytitle']/a&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).inner_html.strip)).gsub(&lt;span class="rx"&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;span class="ch"&gt;\r&lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;I explicitly set the author to my name.  Next, we get the time stamp.  Some would have the timestamp displayed, while the others won't.  If you want to capture the exact timestamp of the post, better to have this in the script.  Mine was displayed at the bottom of the blog entry inside a div with class 'meta-post'.  Since this entire thing contains other information too, I used regular expression to match the format of my timestamp.  &lt;em&gt;NOTE:  Others would have a different timestamp format.  Please adjust as necessary.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  timestr = (doc/&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;div[@class='meta-post']&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).inner_html[&lt;span class="rx"&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;span class="ch"&gt;\d&lt;/span&gt;&lt;span class="k"&gt;+:&lt;/span&gt;&lt;span class="ch"&gt;\d&lt;/span&gt;&lt;span class="ch"&gt;\d&lt;/span&gt;&lt;span class="k"&gt;:&lt;/span&gt;&lt;span class="ch"&gt;\d&lt;/span&gt;&lt;span class="ch"&gt;\d&lt;/span&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;/span&gt;]&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;The date is still out there.  The date stamp of my post is found inside a div with a span whose class is called 'date'.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  datestr = ((doc/&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;div/span[@class='date']&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).inner_html.strip).gsub(&lt;span class="rx"&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;span class="ch"&gt;\r&lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;After we have the time and the date stamp, we concatenate them to form a string that would be accepted as a valid date via Atom publishing.  &lt;em&gt;NOTE: You may need to adjust your timezone calculations for this.  Mine resolves to be -0500.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  datestr = datestr + &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt; &lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + timestr&lt;tt&gt;
&lt;/tt&gt;  datestr = &lt;span class="co"&gt;DateTime&lt;/span&gt;.parse(datestr).strftime(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;%a, %-d %b %Y %T -0500&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Next comes the tricky part: Categorizing your post!  If you were able to correctly assemble your registered categories and synonym categories, this would be a breeze.  Well, at any rate, you can keep on emptying your blog for the posts and redoing them again as frequent as you have/want to.  Find where your tags are enclosed.  Mine is found inside a div with class 'tag-list'.  If your tags match the exact name of a category, then its automatically added to your filtered tags.  Next, your synonym categories would be parsed to see if your tags can be used to classify to your new registered category.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  filtered_tags = []&lt;tt&gt;
&lt;/tt&gt;  tags = (doc/&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;div[@class='tag-list']/a&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).collect{|x| x.inner_html}&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="c"&gt;#rule 1 -&amp;gt; exact match&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  filtered_tags &amp;lt;&amp;lt; tags.collect{|x| x &lt;span class="r"&gt;if&lt;/span&gt; registered_categories.include?(x)}.compact&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="c"&gt;#rule 2 -&amp;gt; synonyms&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  synonym_categories.keys.each &lt;span class="r"&gt;do&lt;/span&gt; |syn|&lt;tt&gt;
&lt;/tt&gt;    filtered_tags &amp;lt;&amp;lt; tags.collect{|x| syn &lt;span class="r"&gt;if&lt;/span&gt; (synonym_categories[syn]).include?(x)}.compact&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  tags = filtered_tags.flatten.compact.uniq.join(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Now to get your entire post.  Yipee!  You need to find a distinguishable id attached to every post.  There really should be one unique id for each post.  They usually look like 'post-id' or any flavors of that.  Mine was enclosed in a div with id called 'postentry-{id}'.  You'll need to get the this id!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  &lt;span class="c"&gt;# Get your contents by finding all paras in the entry post&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  entry_id = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;postentry-&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;doc.at(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;div[@class='blog']&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)[&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;].split(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;-&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;).last&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="c"&gt;# Get the main body content&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  contents = (doc/&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;#&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;entry_id&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;We are almost done.  With this, there could be some parts of the body that you'd want to remove.  You can do this by getting to the element via Hpricot and remove each of them.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  &lt;span class="c"&gt;# Remove unneeded elements  &lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  (doc/&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;#&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;entry_id&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt;/h3&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).remove  &lt;tt&gt;
&lt;/tt&gt;  (doc/&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;#&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;entry_id&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt;/span[@class='date']&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).remove  &lt;tt&gt;
&lt;/tt&gt;  (doc/&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;#&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;entry_id&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt;/div[@class='tag-list']&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).remove&lt;tt&gt;
&lt;/tt&gt;  (doc/&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;#&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;entry_id&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt;/div[@class='meta-post']&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).remove&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Lastly, assemble your element and post away!&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  &lt;span class="c"&gt;# Atom Author element&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  author = &lt;span class="co"&gt;Atom&lt;/span&gt;::&lt;span class="co"&gt;Author&lt;/span&gt;.new&lt;tt&gt;
&lt;/tt&gt;  author.name = author&lt;tt&gt;
&lt;/tt&gt;  author.uri = wp_blog_uri&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="c"&gt;# Atom Entry element  &lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  entry = &lt;span class="co"&gt;Atom&lt;/span&gt;::&lt;span class="co"&gt;Entry&lt;/span&gt;.new&lt;tt&gt;
&lt;/tt&gt;  entry.title = title&lt;tt&gt;
&lt;/tt&gt;  entry.summary = hExcerpt&lt;tt&gt;
&lt;/tt&gt;  entry.content = content&lt;tt&gt;
&lt;/tt&gt;  entry.content.type = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;html&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  entry.published = datestr&lt;tt&gt;
&lt;/tt&gt;  entry.updated = datestr&lt;tt&gt;
&lt;/tt&gt;  entry.tag_with(tags, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  entry.authors &amp;lt;&amp;lt; author&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  req = &lt;span class="co"&gt;Atom&lt;/span&gt;::&lt;span class="co"&gt;HTTP&lt;/span&gt;.new&lt;tt&gt;
&lt;/tt&gt;  req.user = wp_blog_username&lt;tt&gt;
&lt;/tt&gt;  req.pass = wp_blog_password&lt;tt&gt;
&lt;/tt&gt;  req.always_auth = &lt;span class="sy"&gt;:basic&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt; &lt;tt&gt;
&lt;/tt&gt;  &lt;span class="c"&gt;# Atom Collection&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  c = &lt;span class="co"&gt;Atom&lt;/span&gt;::&lt;span class="co"&gt;Collection&lt;/span&gt;.new(wp_base + &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;/posts&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, req)&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  res = c.post! entry&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;Did you enjoy this?  I knew I did the first time!  It feels great not having to manually copy and paste my content from the old blog source to the new one.  Best of it all, I was able to keep my categories.  I'm still looking at how to transfer all of my tags into the new one along with the comments, but I'm not yet successful with doing it as of the moment.  If you'd like a full copy of this script, you can find it &lt;a href="http://pastie.org/495598"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Goodluck to your migration!  I hope this helped.&lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Rhj3bdfAAnS0tZrXuJz7s0JnYf4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Rhj3bdfAAnS0tZrXuJz7s0JnYf4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Rhj3bdfAAnS0tZrXuJz7s0JnYf4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Rhj3bdfAAnS0tZrXuJz7s0JnYf4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=v3ds7oZ92O4:IrpG9v6d61A:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=v3ds7oZ92O4:IrpG9v6d61A:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=v3ds7oZ92O4:IrpG9v6d61A:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=v3ds7oZ92O4:IrpG9v6d61A:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=v3ds7oZ92O4:IrpG9v6d61A:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=v3ds7oZ92O4:IrpG9v6d61A:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/v3ds7oZ92O4" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/5/31/migrate-your-wordpress-blog-using-ruby-and-atom</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-04-11:921</id>
    <published>2009-04-11T07:27:00Z</published>
    <updated>2009-06-27T18:15:28Z</updated>
    <category term="Coding" />
    <category term="Life can't wait!" />
    <category term="cleanup" />
    <category term="coding" />
    <category term="housekeeping" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/v3K9k-lAjrk/code-revisiting-and-housekeeping" rel="alternate" type="text/html" />
    <title>Code revisiting and housekeeping</title>
<content type="html">
            &lt;p&gt;Its a great success for every programmer once a project or an assignment has been completed.  But give it a day, a week or even a month and the good old code in place is now stale.&lt;/p&gt;

&lt;p&gt;Its every programmer's duty to revisit their codes once in awhile and reassess if the old codes are still pretty much the best codes to be inplace or if there's something new that could do something better, faster and easier with much less effort than before.  &lt;/p&gt;
&lt;p&gt;Its a great success for every programmer once a project or an assignment has been completed.  But give it a day, a week or even a month and the good old code in place is now stale.&lt;/p&gt;

&lt;p&gt;Its every programmer's duty to revisit their codes once in awhile and reassess if the old codes are still pretty much the best codes to be inplace or if there's something new that could do something better, faster and easier with much less effort than before.  Guess that's part of of every code/project's &lt;a href="http://www.codinghorror.com/blog/archives/001230.html"&gt;technical debt&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This &lt;strong&gt;&lt;em&gt;old&lt;/strong&gt;&lt;/em&gt; code could really say a lot:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  &lt;span class="r"&gt;def&lt;/span&gt; &lt;span class="fu"&gt;languages_s&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    tmp_array = &lt;span class="pc"&gt;self&lt;/span&gt;.languages&lt;tt&gt;
&lt;/tt&gt;    txt_array = &lt;span class="co"&gt;Array&lt;/span&gt;.new&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="r"&gt;for&lt;/span&gt; tmp &lt;span class="r"&gt;in&lt;/span&gt; tmp_array&lt;tt&gt;
&lt;/tt&gt;      txt_array &amp;lt;&amp;lt; tmp.name.delete(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt; &lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="r"&gt;if&lt;/span&gt; txt_array&lt;tt&gt;
&lt;/tt&gt;      tmp_arr = txt_array.sort&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="r"&gt;if&lt;/span&gt; tmp_arr&lt;tt&gt;
&lt;/tt&gt;        &lt;span class="r"&gt;return&lt;/span&gt; tmp_arr.join(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt; &lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="r"&gt;else&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;span class="r"&gt;return&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="r"&gt;else&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="r"&gt;return&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;Could really be waiting to become something like this: (if only programmers weren't as lazy as they are)&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  &lt;span class="r"&gt;def&lt;/span&gt; &lt;span class="fu"&gt;languages&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    (&lt;span class="pc"&gt;self&lt;/span&gt;.languages.blank?) ? &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; : &lt;span class="pc"&gt;self&lt;/span&gt;.languages.collect{|x| x.name}.sort.join(&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt; &lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;Personally, everytime I have a free time to spare, I take a breeze through old codes, and try to keep them in tougher shape.  I do believe your code says a lot about yourself.  So everytime you improve your skills, go improve on all possible evidence too! :)&lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IE_cfs_hhnn-tAZ-FThI8MVBTh4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IE_cfs_hhnn-tAZ-FThI8MVBTh4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IE_cfs_hhnn-tAZ-FThI8MVBTh4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IE_cfs_hhnn-tAZ-FThI8MVBTh4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=v3K9k-lAjrk:xitHJhHUucY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=v3K9k-lAjrk:xitHJhHUucY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=v3K9k-lAjrk:xitHJhHUucY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=v3K9k-lAjrk:xitHJhHUucY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=v3K9k-lAjrk:xitHJhHUucY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=v3K9k-lAjrk:xitHJhHUucY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/v3K9k-lAjrk" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/4/11/code-revisiting-and-housekeeping</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-04-05:210</id>
    <published>2009-04-05T11:53:00Z</published>
    <updated>2009-06-27T18:15:45Z</updated>
    <category term="Design and CSS" />
    <category term="css" />
    <category term="design" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/PoxHV3QsqxA/easy-css-rounded-corners" rel="alternate" type="text/html" />
    <title>Easy CSS rounded corners</title>
<content type="html">
            Rounded corners are easily achievable.  Either via CSS or Javascript.  See this sample using CSS, or the resource in Javascript.
&lt;p&gt;I tried working on different approaches for rounded corners using CSS.  I really didn't want to resort to using the old fashioned tabled layout.  &lt;/p&gt;

&lt;p&gt;What I wanted was really simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It should be cross browser compatible&lt;/li&gt;
&lt;li&gt;it should look undistorted&lt;/li&gt;
&lt;li&gt;it should be easily configured&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I got all that I wanted &lt;a href="http://www.svay.com/coins_arrondis/rounded_corners.html"&gt;here&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add the following CSS code to your stylesheet:


&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class="cl"&gt;.upperleft&lt;/span&gt;{&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;width&lt;/span&gt; : &lt;span class="fl"&gt;100%&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;margin-left&lt;/span&gt; : &lt;span class="vl"&gt;auto&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;margin-right&lt;/span&gt; : &lt;span class="vl"&gt;auto&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-color&lt;/span&gt; : &lt;span class="cr"&gt;#fff&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-image&lt;/span&gt; : &lt;span class="s"&gt;&lt;span class="dl"&gt;url(&lt;/span&gt;&lt;span class="k"&gt;'/images/upperleft.gif'&lt;/span&gt;&lt;span class="dl"&gt;)&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-repeat&lt;/span&gt; : &lt;span class="vl"&gt;no-repeat&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-position&lt;/span&gt; : &lt;span class="vl"&gt;top&lt;/span&gt; &lt;span class="vl"&gt;left&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="cl"&gt;.upperright&lt;/span&gt;{&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-image&lt;/span&gt; : &lt;span class="s"&gt;&lt;span class="dl"&gt;url(&lt;/span&gt;&lt;span class="k"&gt;'/images/upperright.gif'&lt;/span&gt;&lt;span class="dl"&gt;)&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-repeat&lt;/span&gt; : &lt;span class="vl"&gt;no-repeat&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-position&lt;/span&gt; : &lt;span class="vl"&gt;top&lt;/span&gt; &lt;span class="vl"&gt;right&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="cl"&gt;.lowerleft&lt;/span&gt;{&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-image&lt;/span&gt; : &lt;span class="s"&gt;&lt;span class="dl"&gt;url(&lt;/span&gt;&lt;span class="k"&gt;'/images/lowerleft.gif'&lt;/span&gt;&lt;span class="dl"&gt;)&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-repeat&lt;/span&gt; : &lt;span class="vl"&gt;no-repeat&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-position&lt;/span&gt; : &lt;span class="vl"&gt;bottom&lt;/span&gt; &lt;span class="vl"&gt;left&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="cl"&gt;.lowerright&lt;/span&gt;{&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-image&lt;/span&gt; : &lt;span class="s"&gt;&lt;span class="dl"&gt;url(&lt;/span&gt;&lt;span class="k"&gt;'/images/lowerright.gif'&lt;/span&gt;&lt;span class="dl"&gt;)&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-repeat&lt;/span&gt; : &lt;span class="vl"&gt;no-repeat&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;background-position&lt;/span&gt; : &lt;span class="vl"&gt;bottom&lt;/span&gt; &lt;span class="vl"&gt;right&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="ke"&gt;padding&lt;/span&gt; : &lt;span class="fl"&gt;3%&lt;/span&gt; &lt;span class="fl"&gt;3%&lt;/span&gt; &lt;span class="fl"&gt;3%&lt;/span&gt; &lt;span class="fl"&gt;3%&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Enclose your desired content like this:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="an"&gt;class&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;upperleft&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;span class="ta"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="an"&gt;class&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;upperright&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;            &lt;span class="ta"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="an"&gt;class&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;lowerleft&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;                 &lt;span class="ta"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="an"&gt;class&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;lowerright&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;                            YOUR DESIRED CONTENT HERE&lt;tt&gt;
&lt;/tt&gt;                &lt;span class="ta"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;            &lt;span class="ta"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;span class="ta"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="ta"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div&gt;
&lt;div class="upperleft"&gt;
    &lt;div class="upperright"&gt;
        &lt;div class="lowerleft"&gt;
            &lt;div class="lowerright"&gt;
SAMPLE HERE
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/div&gt;&lt;/p&gt;

This solution is only good if you want to have it done via CSS.  Using Javascript is another thing, but here's a very good resource to get you going in that direction: [http://www.html.it/articoli/niftycube/index.html][1]


  [1]: http://www.html.it/articoli/niftycube/index.html
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ez6PTkQtHU6LbBto-4_YbVkHRVw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ez6PTkQtHU6LbBto-4_YbVkHRVw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ez6PTkQtHU6LbBto-4_YbVkHRVw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ez6PTkQtHU6LbBto-4_YbVkHRVw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=PoxHV3QsqxA:s7uId70U4FI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=PoxHV3QsqxA:s7uId70U4FI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=PoxHV3QsqxA:s7uId70U4FI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=PoxHV3QsqxA:s7uId70U4FI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=PoxHV3QsqxA:s7uId70U4FI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=PoxHV3QsqxA:s7uId70U4FI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/PoxHV3QsqxA" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/4/5/easy-css-rounded-corners</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-03-27:911</id>
    <published>2009-03-27T13:48:00Z</published>
    <updated>2009-06-27T18:16:07Z</updated>
    <category term="Coding" />
    <category term="Ruby and/or Rails" />
    <category term="acts_as_solr" />
    <category term="index" />
    <category term="rails" />
    <category term="ruby" />
    <category term="search" />
    <category term="solr" />
    <category term="sync" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/HiZ_I3VueAk/removing-out-of-sync-error-in-acts_as_solr" rel="alternate" type="text/html" />
    <title>Removing "out of sync" error in acts_as_solr</title>
<content type="html">
            It could've been pretty straightforward removing this concerned item from the solr index and then everything would be well.. but its a lot harder than that if you're looking at over a thousand indexed elements vs their 'existing' counterparts in the database!  Finding the exact data to remove was really the hardest part!  I never knew this until I took the liberty of helping out our kind Infra Team to resolve the problem.   I decided to tweak the solr parser method returning the "out of  sync" error.  I thought that it would actually be brilliant to just display the concerned element's id so that they could delete it from the index itself.  And so, I had something like this: (in acts_as_solr/lib/parser_methods.rb)
&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://lucene.apache.org/solr/"&gt;Solr&lt;/a&gt; is an open source enterprise
  search server based on the Lucene Java
  search library, with XML/HTTP and JSON
  APIs, hit highlighting, faceted
  search, caching, replication, a web
  administration interface and many more
  features. It runs in a Java servlet
  container such as Tomcat.&amp;nbsp;&amp;nbsp;-&lt;a href="http://lucene.apache.org/solr/"&gt;Apache Solr&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Solr can be used in &lt;a href="http://wiki.apache.org/solr/#head-f5e0c63a9a48037a2200cf9ceabda53898142d80"&gt;different containers&lt;/a&gt; and &lt;a href="http://wiki.apache.org/solr/#head-ab1768efa59b26cbd30f1acd03b633f1d110ed47"&gt;different wrappers&lt;/a&gt;.  Our application runs on Ruby on Rails, and we used &lt;a href="http://github.com/railsfreaks/acts_as_solr/tree/master"&gt;acts_as_solr&lt;/a&gt;.  Though solr is a powerful, already stable and yet flexible third party solution that we could rely on, we were still not able to maximize its full capacity.  We used the bare minimum features of solr for our search modules. &lt;/p&gt;

&lt;p&gt;As of now, we've used a couple of acts_as_solr enhancments and add ons, some of which we learned from different online resources.  We were able to use &lt;a href="http://www.elctech.com/projects/advanced-db_free_solr"&gt;db_free_solr&lt;/a&gt; and explored on the &lt;a href="http://www.quarkruby.com/2007/9/14/advanced-acts_as_solr"&gt;highlighting and faceting capabilities of solr&lt;/a&gt;.  Its been pretty helpful, but of course nothing is almost always seamless.  We encounter few problems with syncing records from the database and onto solr.  For sure, you've come across this trouble before, if you've been using solr:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Out of sync! Found N items
  in index, but only n were
  found in database!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It sure was putting down every page wherein there was this glitch in the count of the records retrieved.  It therefore gave the negative impression that our site was frequently unstable.  Removing a certain indexed element from the solr index is easy as:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class="co"&gt;ActsAsSolr&lt;/span&gt;:: &lt;span class="co"&gt;Post&lt;/span&gt;.execute(&lt;span class="co"&gt;Solr&lt;/span&gt;::&lt;span class="co"&gt;Request&lt;/span&gt;:: &lt;span class="co"&gt;Delete&lt;/span&gt;.new(&lt;span class="sy"&gt;:query&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;%{&lt;/span&gt;&lt;span class="k"&gt;type_s:Model AND id:&amp;quot;Model:110809&amp;quot;&lt;/span&gt;&lt;span class="dl"&gt;}&lt;/span&gt;&lt;/span&gt;))&lt;tt&gt;
&lt;/tt&gt;&lt;span class="co"&gt;ActsAsSolr&lt;/span&gt;:: &lt;span class="co"&gt;Post&lt;/span&gt;.execute(&lt;span class="co"&gt;Solr&lt;/span&gt;::&lt;span class="co"&gt;Request&lt;/span&gt;::&lt;span class="co"&gt;Commit&lt;/span&gt;.new)&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;It could've been pretty straightforward removing this concerned item from the solr index and then everything would be well.. but its a lot harder than that if you're looking at over a thousand indexed elements vs their 'existing' counterparts in the database!  Finding the exact data to remove was really the hardest part!  I never knew this until I took the liberty of helping out our kind Infra Team to resolve the problem.   I decided to tweak the solr parser method returning the "out of  sync" error.  I thought that it would actually be brilliant to just display the concerned element's id so that they could delete it from the index itself.  And so, I had something like this: (in acts_solr/lib/parser_methods.rb)&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;raise &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Out of sync! Found &lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;ids.size&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt; items in index, but only &lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;things.size&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt; were found in database! Remove &lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;(ids - (things.collect{|x| x.id})).to_sentence&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt;.&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;unless&lt;/span&gt; things.size == ids.size&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;And yes, viola!  I can now see the faulty ids that were causing the "out of sync" problem.  I presented this not-so-brilliant solution to our Infra Team, and they came up with a better idea.  My colleague thought that it would be nicer if I could just do away with the "out of sync" error altogether. Since I can already pinpoint the cause of the trouble, then why not remove it for good?  I came up with half the solution.  It was the quicker one to implement and didn't require much from their end either.  &lt;/p&gt;

&lt;p&gt;Distinguishing the faulty id from the list of objects from solr vs those that were from the db, it paved the way for me to simply remove these ids from the checking.  It was half the solution because (hint, hint.. I may be doing this next time when I have time) I could actually delete the certain indexed element from solr instead of simply removing it from solr's items on hand.  This "full" solution could actually bring forth other complications since you'd have to deal with what models were concerned and what fields will solr need to look at, etc.  &lt;/p&gt;

&lt;p&gt;And so.. the half solution that I did was to clean up the elements on hand for solr.  This &lt;a href="http://pastie.org/pastes/426482"&gt;snippet&lt;/a&gt; is found in acts_as_solr/lib/parser_methods.rb.&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  &lt;span class="r"&gt;def&lt;/span&gt; &lt;span class="fu"&gt;reorder&lt;/span&gt;(things, ids)&lt;tt&gt;
&lt;/tt&gt;    ordered_things = &lt;span class="co"&gt;Array&lt;/span&gt;.new(things.size)&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="r"&gt;unless&lt;/span&gt; things.size == ids.size&lt;tt&gt;
&lt;/tt&gt;      (ids - (things.collect{|x| x.id})).collect{|missing| ids[ids.index(missing)] = &lt;span class="pc"&gt;nil&lt;/span&gt;}&lt;tt&gt;
&lt;/tt&gt;      ids = ids.compact&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    raise &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;Out of sync! Found &lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;ids.size&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt; items in index, but only &lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;things.size&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt; were found in database! Remove &lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;(ids - (things.collect{|x| x.id})).to_sentence&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt;.&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;unless&lt;/span&gt; things.size == ids.size&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    things.each &lt;span class="r"&gt;do&lt;/span&gt; |thing|&lt;tt&gt;
&lt;/tt&gt;      position = ids.index(thing.id)&lt;tt&gt;
&lt;/tt&gt;      ordered_things[position] = thing&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    ordered_things&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;The first four lines above the "out of sync" message is what is critical.  It will attempt to remove the missing object from the items that solr will return.  If all else fails, then it will be displaying the "out of sync" error, but would still be displaying the ids that were causing the problem. &lt;/p&gt;

&lt;p&gt;Its quick, but not dirty.  It works, but will not really guarantee that your problem will go away permanently.  I suggest you do a complete reindex of your whole data.  Or better yet, whatever was causing it, just make sure that there are no direct database deletion of any data so that solr will always remain in sync with your database.&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iL9_PAD3scb0UAGfV-ohhgcYtik/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iL9_PAD3scb0UAGfV-ohhgcYtik/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iL9_PAD3scb0UAGfV-ohhgcYtik/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iL9_PAD3scb0UAGfV-ohhgcYtik/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=HiZ_I3VueAk:9YbNDNV8TKE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=HiZ_I3VueAk:9YbNDNV8TKE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=HiZ_I3VueAk:9YbNDNV8TKE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=HiZ_I3VueAk:9YbNDNV8TKE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=HiZ_I3VueAk:9YbNDNV8TKE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=HiZ_I3VueAk:9YbNDNV8TKE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/HiZ_I3VueAk" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/3/27/removing-out-of-sync-error-in-acts_as_solr</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-03-09:909</id>
    <published>2009-03-09T02:26:00Z</published>
    <updated>2009-06-27T18:16:19Z</updated>
    <category term="Coding" />
    <category term="Ruby and/or Rails" />
    <category term="application" />
    <category term="cms" />
    <category term="database_form" />
    <category term="extensions" />
    <category term="mailer" />
    <category term="new" />
    <category term="radiant" />
    <category term="rails" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/0YJKnRfn3to/extending-database_form-to-send-emails-via-mailer-extension" rel="alternate" type="text/html" />
    <title>Extending Database_form to send Emails via Mailer extension</title>
<content type="html">
            &lt;p&gt;Radiant is just a gem.  Its installation is very easy, and super fast.  I really didn't have much trouble.  But the thing is, I wanted to have more control over the code itself, since I will be tweaking the Radiant app into something that fits their needs, and my deliverables too.  And so, if you end up with this decision, just unpack your radiant gem.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gem unpack radiant
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once you have the tree generated, you'll see that its a normal Rails application hiding in the gem.  Now you can inspect the code, and have it tweaked according to your will.  I made changes in some of the templates, stylesheets, etc, and added some extensions.  One of the uses of the site would be to serve as a mail form where users can contact them via a feedback section.  I checked out their [Third Party extensions][8] which was quite extensive enough.  I found a couple of them that I really needed:&lt;/p&gt;
&lt;p&gt;I recently used &lt;a href="http://radiantcms.org"&gt;Radiant&lt;/a&gt; to complete a project that was to build a site that was sitting on top of a Ruby on Rails application.  The easiest way for them to be able to manage it without my supervision was to have it built on top of a CMS.  Of course, the future plan is always to sell something online or maybe build a community for their site, but right now, a static corporate website was well enough. &lt;/p&gt;

&lt;p&gt;Having a static site built in Rails has its pros and cons.  IMHO, as a static site, you've got the super easy, straightforward utilization of caching.  So its going to be superfast!  The templates can easily be updated, as well as the graphics.  No fancy hardcoding necessary.  But still, though its fairly easy for good RoR developers such as myself, its a lot harder for the common programmer who lives and thrives in easy markups. &lt;/p&gt;

&lt;p&gt;On the onset of an exciting idea of building a new Rails powered application, the following options automatically crossed my mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use a social networking template application such as &lt;a href="http://lovdbyless.com"&gt;LovdbyLess&lt;/a&gt; or &lt;a href="http://www.communityengine.org"&gt;Community Engine&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Use a blogging engine such as &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt; or &lt;a href="http://mephistoblog.com"&gt;Mephisto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Use a CMS such as &lt;a href="http://radiantcms.org"&gt;Radiant&lt;/a&gt;, and something else (see, I'm a bit biased here.. I don't remember any other CMS as good as Radiant).&lt;/li&gt;
&lt;li&gt;Use a blank Rails application template that has a lot of plugins built in already, like &lt;a href="http://jimneath.org/bort/"&gt;Bort&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Alright, be a hero and start everything from scratch (maybe you have 3months dev time, full time? err)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A few more inputs from them and I understand that they only needed a static site wherein they can change the contents at any given time, and maybe sell some stuffs online soon.  And, now the new baby is born out of Radiant!&lt;/p&gt;

&lt;p&gt;Radiant is just a gem.  Its installation is very easy, and super fast.  I really didn't have much trouble.  But the thing is, I wanted to have more control over the code itself, since I will be tweaking the Radiant app into something that fits their needs, and my deliverables too.  And so, if you end up with this decision, just unpack your radiant gem.&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;gem unpack radiant&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;Once you have the tree generated, you'll see that its a normal Rails application hiding in the gem.  Now you can inspect the code, and have it tweaked according to your will.  I made changes in some of the templates, stylesheets, etc, and added some extensions.  One of the uses of the site would be to serve as a mail form where users can contact them via a feedback section.  I checked out their &lt;a href="http://wiki.radiantcms.org/Thirdparty_Extensions"&gt;Third Party extensions&lt;/a&gt; which was quite extensive enough.  I found a couple of them that I really needed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://github.com/zapnap/database_form/tree/master"&gt;Database_form&lt;/a&gt; by zapnap&lt;/li&gt;
&lt;li&gt;&lt;a href="http://github.com/ntalbott/radiant-mailer-extension/tree/master"&gt;Radiant Mailer Extension&lt;/a&gt; by ntalbott, learn how to set it up &lt;a href="http://wiki.radiantcms.org/How_To_Use_The_Mailer_Extension"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://github.com/kbingman/paperclipped/tree/master"&gt;Paperclipped&lt;/a&gt; by kbingman&lt;/li&gt;
&lt;li&gt;&lt;a href="http://github.com/saturnflyer/radiant-help-extension/"&gt;Help&lt;/a&gt; by saturnflyer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It was pretty sweet and less complicated.  The only caveat I had to take note was that, you can't do the usual:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;rake radiant&lt;span class="sy"&gt;:extensions&lt;/span&gt;&lt;span class="sy"&gt;:&amp;lt;&lt;/span&gt;extension&amp;gt;&lt;span class="sy"&gt;:migrate&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;if you don't make sure that in your &lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;vendor/extensions&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;you have the extension name separated by underscores not by dashes.  I had to google this up just to know what went wrong after pulling a copy of the extension repository into my vendor/extensions folder.&lt;/p&gt;

&lt;p&gt;The next problem was really tricky.  After learning about extensions, I kept looking for ways to be able to use the mailer on my database_form page.  I found the clue &lt;a href="http://www.nabble.com/--about-using-database_form-on-every-page-td19558722.html"&gt;here&lt;/a&gt;.  Though it wasn't really what I needed.  So, after randomly looking for an available solution, I quit and started to work on my own workaround.  &lt;em&gt;If I'm reinventing the wheel or if someone knows any other resource, please be sure to post it here.&lt;/em&gt; ;)&lt;/p&gt;

&lt;p&gt;If you want to try this out, do this at your own risk.  It works for me, that's all I can say.. and whoops, no test for this one. :)  First, make sure that you have your mailer extension set up already and working.  Next, get database_form and have it set up too and already working.  Once you have these two, then let's move forward.&lt;/p&gt;

&lt;p&gt;Your database_form page should have a &lt;em&gt;mailer&lt;/em&gt; section.  Your mailer section should at least have the following example information:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  subject: Confirmation notification for &amp;lt;your site name&amp;gt;&lt;tt&gt;
&lt;/tt&gt;  from: noreply@sweetperceptions.com&lt;tt&gt;
&lt;/tt&gt;  redirect&amp;amp;#95;to: /contact-us/thank-you&lt;tt&gt;
&lt;/tt&gt;  recipients:&lt;tt&gt;
&lt;/tt&gt;    - email@email.com&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;In your &lt;a href="http://pastie.org/411364"&gt;vendor/extensions/database_form/app/models/database_form_page.rb&lt;/a&gt;, add this line to the method &lt;em&gt;save_form&lt;/em&gt; in its else clause just before &lt;em&gt;true&lt;/em&gt;:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;send_static_email(form_data) &lt;span class="r"&gt;unless&lt;/span&gt; &lt;span class="pc"&gt;self&lt;/span&gt;.parts.find_by_name(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;mailer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;).blank?&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;Then add the send_static_email method contents as such:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;  &lt;span class="r"&gt;def&lt;/span&gt; &lt;span class="fu"&gt;send_static_email&lt;/span&gt;(form_data)&lt;tt&gt;
&lt;/tt&gt;    mailer_config = &lt;span class="co"&gt;YAML&lt;/span&gt;::load(&lt;span class="pc"&gt;self&lt;/span&gt;.parts.find_by_name(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;mailer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;).content).symbolize_keys&lt;tt&gt;
&lt;/tt&gt;    mail = &lt;span class="co"&gt;Mail&lt;/span&gt;.new(&lt;span class="pc"&gt;self&lt;/span&gt;, mailer_config, form_data)&lt;tt&gt;
&lt;/tt&gt;    mail.send&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;After that, every entry to the database form will send the notification to your desired recipients.  Hope this works for you guys wanting to have that feature set for Radiant. &lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/t4-gusoGbuGYuTkUWKtCpB4K-Rw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/t4-gusoGbuGYuTkUWKtCpB4K-Rw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/t4-gusoGbuGYuTkUWKtCpB4K-Rw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/t4-gusoGbuGYuTkUWKtCpB4K-Rw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=0YJKnRfn3to:moGHU9cEu4E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=0YJKnRfn3to:moGHU9cEu4E:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=0YJKnRfn3to:moGHU9cEu4E:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=0YJKnRfn3to:moGHU9cEu4E:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=0YJKnRfn3to:moGHU9cEu4E:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=0YJKnRfn3to:moGHU9cEu4E:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/0YJKnRfn3to" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/3/9/extending-database_form-to-send-emails-via-mailer-extension</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-02-07:490</id>
    <published>2009-02-07T05:10:00Z</published>
    <updated>2009-06-27T18:16:39Z</updated>
    <category term="Design and CSS" />
    <category term="Life can't wait!" />
    <category term="search" />
    <category term="sort" />
    <category term="usability" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/pdlCXGqIwcI/sorting-is-a-part-of-searching" rel="alternate" type="text/html" />
    <title>Sorting is a part of Searching</title>
<content type="html">
            Anybody who has used the net for research or part of everyday work knows how to search.  Searching is one of the key aspects of using the internet.  With so many information out there, you might never find what it is exactly you're looking for if you don't know how to search.

..Not all sites that offer searching offers sorting.  Isn't a wonder?..
&lt;p&gt;Anybody who has used the net for research or part of everyday work knows how to search.  Searching is one of the key aspects of using the internet.  With so many information out there, you might never find what it is exactly you're looking for if you don't know how to search.&lt;/p&gt;

&lt;p&gt;With that, I feel that it is essential for any application to be offering a search function.  Forums have searches.  Social networking sites have searches.  Even Google started out as just a web search engine before it became a portal.  If you offer any sort of reference site with information, searching should be a part of it.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;A Web search engine is a tool designed to search for information on the World Wide Web. Information may consist of web pages, images, information and other types of files. Some search engines also mine data available in newsbooks, databases, or open directories. Unlike Web directories, which are maintained by human editors, search engines operate algorithmically or are a mixture of algorithmic and human input.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;-- &lt;a href="http://en.wikipedia.org/wiki/Web_search_engine"&gt;http://en.wikipedia.org/wiki/Web_search_engine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But when you already do know how to search, and you got your results already, what do you do with it? You found substantial information, but not yet the one that you needed.  You must filter it out.  Other computation must be done to be able to extract the right information.  You need to apply filters, navigate through the results (while keeping intact your initial results) and even sorting your results according to your preferred filter.  And viola!  Not all sites that offer searching offers sorting.  Isn't a wonder?&lt;/p&gt;

&lt;p&gt;I believe that sorting is a must for all sites that return search results.  Take for a couple of example the following sites:&lt;/p&gt;

&lt;p&gt;I've found a couple of examples ranging from bad, to semi failure to good ones.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The site was good, and search was quite robust.  But the main pitfall was the design.  I was quite overwhelmed with the buttons and tabs and other form elements that I can click.  I was struck by awe and confusion.  I immediately left the site.  They had good sorting too, but quite bad in usability.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Google News was good, for they offered sorting for the results.  For me, the problem is that I was presented with an "automagically" preset sorting preference.  What if I'd want to sort the results by title?  Hmmm..&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;LinkedIn relied on the concept of an "addressbook" and default its sorting to alphabetically sorting their surnames.  Its quite good, honestly and the usability is good too.  Its just a shame that I can't sort by company name and/or title/position.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I stumbled upon this site called sortby.org and found that their very simple search was quite effective.  Although their preset sorting was quite limited as it is, it was all fitting for the nature of their results.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The searching and sorting found in Devex's site is quite good but bad in usability.  The sort bar appears off from the whole display of the search results.&lt;/p&gt;

&lt;p&gt;There are a lot of other sites that implement sorting but the usability is quite bad or just not optimized.  Youtube's sort is a good starting point.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Youtube's good sort plus good usability looks okay.  It presents a very intuitive use of its good search and sorting of results.  For now, I'll use Youtube's style as my reference for sorting.  I haven't found any good ones out there.  I'll be delighted if anyone could point me to one good resource though.&lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/udzLrw2i_X2b76L45OUz0gVk8os/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/udzLrw2i_X2b76L45OUz0gVk8os/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/udzLrw2i_X2b76L45OUz0gVk8os/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/udzLrw2i_X2b76L45OUz0gVk8os/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=pdlCXGqIwcI:pVjrs5HxlEY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=pdlCXGqIwcI:pVjrs5HxlEY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=pdlCXGqIwcI:pVjrs5HxlEY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=pdlCXGqIwcI:pVjrs5HxlEY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=pdlCXGqIwcI:pVjrs5HxlEY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=pdlCXGqIwcI:pVjrs5HxlEY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/pdlCXGqIwcI" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/2/7/sorting-is-a-part-of-searching</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2009-01-30:434</id>
    <published>2009-01-30T13:35:00Z</published>
    <updated>2009-06-27T18:16:50Z</updated>
    <category term="Life can't wait!" />
    <category term="addiction" />
    <category term="break" />
    <category term="carpal tunnel syndrome" />
    <category term="coding" />
    <category term="computers" />
    <category term="cts" />
    <category term="occupational hazard" />
    <category term="pain" />
    <category term="programmers" />
    <category term="programming" />
    <category term="rsi" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/zzABjlbNEkI/caution-programming-is-addictive" rel="alternate" type="text/html" />
    <title>Caution: Programming is addictive</title>
<content type="html">
            &lt;p&gt;True that its symptoms of pain gradually increases over time.  I'm a touch typist and I usually feel the pain when typing things for long straight hours without a break. (just like when I blog or when I program).  The pain now lasts longer and disappears only for a short while.  It has gotten into my attention lately, and so I tried to work on a short term remedy.  I bought myself a wrist brace.  Although &lt;a href="http://en.wikipedia.org/wiki/Occupational_Safety_and_Health_Administration"&gt;Occupational Safety and Health Administration (OSHA)&lt;/a&gt; states that CTS is not directly proven to be caused by repetitive activities as compared to structural and biological risk factors, I still cannot take away the fact that the pain emanates during contact with the computer.  *Below are photos of my wrist brace*.&lt;/p&gt;
&lt;p&gt;I don't think headhunters should ever include in their job descriptions the requirement for the 'computer literacy' requirement.  Nowadays, most of our day to day tasks can be accomplished via the computer and over the internet.  Purchases, demos, computing, alerts, maps, and even office documents can be processed and accomplished thru the web.  Though there are some who are still used to the traditional way of business processing like the messengers, offline marketing agents, etc., their numbers are gradually being squashed to a negligible percentage of the computing world.  I really would be dumbfounded and shocked if I'd hear somebody say that a keyboard and/or a mouse is an unknown gadget to them!  Unless you live in a very rural area without phone lines and/or electricity, it seems the awareness of such gadgets is a required fact.&lt;/p&gt;

&lt;p&gt;You'll step inside an office and find a matrix of people quietly working and typing away into their glowing lcd screens.  Headsets affixed to their heads either for music or for work.  Who are they?  Would you think they are call center agents?  Researchers perhaps?  how about programmers?  Nope.  I guess you wouldn't know at first glance unless you're a programmer yourself.&lt;/p&gt;

&lt;p&gt;A programmer is technically still another computer operator.  We operate and work on computers.  We just work and use them differently.  We all have different uses for the computer.  Over the years, we've developed habits and practices on working with computers.  Some, we customize, some we don't.  Some accessorize, some don't.  Bottom line is.. we all work with computers in our own way and style.&lt;/p&gt;

&lt;p&gt;The computer is my best friend.  Its an understatement and an exaggeration at the same time.  Of course it's my best resource for things that I want to accomplish professionally, and its the best tool for aiding my goals and needs.  Its my best friend when I blog.  Its actually more than what is a best friend, but not really a best friend to its fullest.  It can't talk back when I need it to, nor give me consolation when I most need it.  But its still there, regardless of how much I can get from it, or how much it can provide for me with my needs.  Everyone should concede to the fact that the computer is our slave, yet it enslaves us in return.  &lt;/p&gt;

&lt;p&gt;Gahh.. I don't really care.  To some extent, I control what I want from it and how long I want it.  Programmers are really scientists.  We create.  We invent.  We design.  We are artists, and yes we are addicts.  The computer is really very lovable and alluring.  Sometimes, I find myself working straight for &lt;a href="http://twitter.com/sweetperception/status/1160253742"&gt;hours and hours&lt;/a&gt; without taking breaks.  One thing just leads to another.  With so many tools and procrastination sources (&lt;a href="http://lifehacker.com"&gt;timesink sites&lt;/a&gt;), its really very hard to exercise discipline all the time.  GTD is good, as I do it all the time (not exactly as Allen describes it though), but I still find myself unstoppable during coding.  Its just so addictive! :D&lt;/p&gt;

&lt;p&gt;I don't remember how young I was when I started falling in love with the science of computing.  I got into college and fell head over heels with computers, and programming most especially.  I've heard about other people jumping into programming for money's sake, and others dropping out of the roll for time's sake.  I believe that once a programmer, you'll always be a programmer.  I believe there are tons of reasons debated over and over again about women and programming and even time versus productivity of programmers.&lt;/p&gt;

&lt;p&gt;Being the programming addict that I am, of course I can't deny the fact that it has improved my personality and outlook in life over the years.  The unending cycle of learning and unlearning things has made some dull aspects of my life shine brighter; while some shiny aspects were worn out and made dull.  Reality check must be put in place.  But how?&lt;/p&gt;

&lt;p&gt;The benefits of loving your career as a programmer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You never work.  You only do your hobby.&lt;/li&gt;
&lt;li&gt;You are never pressed to do anything you don't like (unless you have an abusive superior, of course)&lt;/li&gt;
&lt;li&gt;You'd love to improve your work because you want to take pride in your hard and diligent labor&lt;/li&gt;
&lt;li&gt;You want to make a difference and move the people in your community&lt;/li&gt;
&lt;li&gt;You get to invent and reinvent&lt;/li&gt;
&lt;li&gt;You get to satisfy your curiosity (most of the time.. :P)&lt;/li&gt;
&lt;li&gt;You are not &lt;em&gt;technically&lt;/em&gt; tied to an 8hr job&lt;/li&gt;
&lt;li&gt;You care not &lt;em&gt;technically&lt;/em&gt; tied to a specific workplace setup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cons of loving your career (too much) as a programmer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You forget what day and time it is (trust me, I'm not alone on this one)&lt;/li&gt;
&lt;li&gt;You forget how to define weekends and breaks&lt;/li&gt;
&lt;li&gt;You use the words "output", "result", "compile", "restart", "build", "migrate", "deploy" more frequently in your daily life&lt;/li&gt;
&lt;li&gt;You notice that you are skin tone is growing paler (due to lack of sun exposure--you sleep in the morning)&lt;/li&gt;
&lt;li&gt;You miss out blockbuster movies, tv shows, sitcoms, etc.&lt;/li&gt;
&lt;li&gt;For me: combing my hair seems less and less important. Haha&lt;/li&gt;
&lt;li&gt;WORST: you develop RSI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hate dealing with the cons.  Sometimes it catches up on me (on us).  Although at the end of the day, its the RSI that makes me do some reality check, its still worth the reassessment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="http://en.wikipedia.org/wiki/Repetitive_strain_injury"&gt;RSI as defined by Wikipedia:&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Repetitive strain injury (RSI), also known as Cumulative Trauma Disorder (CTD), occupational overuse syndrome, non-specific arm pain or work related upper limb disorder (WRULD), is the most recent manifestation of illness concepts that link use of the arm to injury or disease. Prior to typewriters or computers there was the concept of "writer's cramp".&lt;/p&gt;

  &lt;p&gt;The basis for this illness concept is the idea that one can overuse a tool, such as a computer keyboard or musical instrument in a way that causes tissue damage leading to pain. Conditions such as RSI tend to be associated with both physical and psychosocial stressors.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Although the term "RSI" is very much a general term for pain that is not directly related to medical pathophysiological causes, its meaning has been resounding to all computer users.  The most common pain related to RSI is the &lt;a href="http://en.wikipedia.org/wiki/Carpal_tunnel_syndrome"&gt;Carpal Tunnel Syndrome&lt;/a&gt;.  This specific trauma arises from the damage of the median nerves that go through the carpal tunnel that is found between three bones.  Over repetitive and frequent use, the tissues wear out and cause pain.  Google CTS and find information that says the possible cure/treatment for CTS is through undergoing surgery to repair and inject steriods into the tissues only to cut down the pain but not to totally cure it.  Immediate ways to combat it is to wear wrist braces and do more &lt;a href="http://sweetperceptions.i.ph/blogs/sweetperceptions/2008/12/01/moving-my-thoughts-to-yoga/"&gt;yoga exercises&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;True that its symptoms of pain gradually increases over time.  I'm a touch typist and I usually feel the pain when typing things for long straight hours without a break. (just like when I blog or when I program).  The pain now lasts longer and disappears only for a short while.  It has gotten into my attention lately, and so I tried to work on a short term remedy.  I bought myself a wrist brace.  Although &lt;a href="http://en.wikipedia.org/wiki/Occupational_Safety_and_Health_Administration"&gt;Occupational Safety and Health Administration (OSHA)&lt;/a&gt; states that CTS is not directly proven to be caused by repetitive activities as compared to structural and biological risk factors, I still cannot take away the fact that the pain emanates during contact with the computer.  *Below are photos of my wrist brace*.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;I have been thinking about short term needs and long term needs for addressing the problem.  So far, I'm too scared of the long term things, so I came up with this list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Use anti rsi applications&lt;/em&gt;&lt;/strong&gt;.  So far, I've used &lt;a href="http://workrave.org"&gt;Workrave&lt;/a&gt; back when I was in &lt;a href="http://sweetperceptions.i.ph/blogs/sweetperceptions/2007/05/13/ubuntu-days-are-here/"&gt;Ubuntu&lt;/a&gt; and it works for me.  In Mac, you can try &lt;a href="http://www.apple.com/downloads/macosx/productivity_tools/macbreakz.html"&gt;MacBreakz&lt;/a&gt;, &lt;a href="http://www.dejal.com/free/"&gt;TimeOut&lt;/a&gt; and &lt;a href="http://tech.inhelsinki.nl/antirsi/"&gt;AntiRSI&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;do your GTD well&lt;/em&gt;&lt;/strong&gt;.  Consult your best book or tool on this.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;monitor your health&lt;/em&gt;&lt;/strong&gt;. Remind yourself for more water breaks, toilet breaks, and even meal breaks. ;)  You can use &lt;a href="http://rememberthemilk.com"&gt;RememberTheMilk&lt;/a&gt;, your Outlook, mobile phone, iCal and even &lt;a href="http://www.google.com/calendar"&gt;Google calendar&lt;/a&gt; to remind you.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;schedule more life outside work&lt;/em&gt;&lt;/strong&gt;.  Leave work at the right time and enjoy for about 2-3 hours before going home for rest&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;do your homework on &lt;a href="http://en.wikipedia.org/wiki/Ergonomics"&gt;ergonomics&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;.  Choose the right gadgets to help you work seamlessly in your workplace and for your work practices.  Pick the right keyboard and mouse combination.  The &lt;a href="http://www.codinghorror.com/blog/archives/001146.html"&gt;right chair&lt;/a&gt; height, fit and make could also help a lot.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;find your sweet spot!&lt;/em&gt;&lt;/strong&gt;  Sometimes, all it takes is finding the perfect pose, the perfect spot for working well.  If you find this, do take note of it.  It might help reduce the total number of hours working infront of the pc and more time outside of work.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm no guru, and believe me I had to discipline myself to avoid using the computer at times when I don't have to.  Its really addictive and productive at the same time.  I hope to be able to practice more of these to avoid further damage while I enjoy my life long hobby.   &lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nAIMLoWa1AEcik52AXZXEXJndCI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nAIMLoWa1AEcik52AXZXEXJndCI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nAIMLoWa1AEcik52AXZXEXJndCI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nAIMLoWa1AEcik52AXZXEXJndCI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=zzABjlbNEkI:hECoz0x6nKE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=zzABjlbNEkI:hECoz0x6nKE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=zzABjlbNEkI:hECoz0x6nKE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=zzABjlbNEkI:hECoz0x6nKE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=zzABjlbNEkI:hECoz0x6nKE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=zzABjlbNEkI:hECoz0x6nKE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/zzABjlbNEkI" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2009/1/30/caution-programming-is-addictive</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2008-12-09:145</id>
    <published>2008-12-09T15:45:00Z</published>
    <updated>2009-06-27T18:17:02Z</updated>
    <category term="Coding" />
    <category term="Ruby and/or Rails" />
    <category term="Testing" />
    <category term="cucumber" />
    <category term="rails" />
    <category term="remarkable" />
    <category term="rspec" />
    <category term="shoulda" />
    <category term="tdd" />
    <category term="testing" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/zHEQr4v6IDg/testing-is-a-remarkable-thing" rel="alternate" type="text/html" />
    <title>Testing is a Remarkable thing!</title>
<content type="html">
            &lt;p&gt;I never knew testing could really change the way I code.  I know I’m a good programmer because I love implementing standards and doing the “right things” the “first time”.. and yet testing has made me realize something..&lt;/p&gt;
&lt;p&gt;I never knew testing could really change the way I code.  I know I’m a good programmer because I love implementing standards and doing the “right things” the “first time”.. and yet testing has made me realize something..&lt;/p&gt;

&lt;p&gt;I never got to know how to properly test my own code.  I’ve only used a lot of &lt;a href="http://seleniumhq.org/"&gt;selenium&lt;/a&gt;, trying to dig into making it work for simple end user testing and usability of the application, but framework testing that involves the unit tests, integration tests and even performance tests are now putting themselves in the limelight for my programming career.&lt;/p&gt;

&lt;p&gt;Looking at a huge challenge of writing tests for an old yet immature application (that I know of), I felt that this would be a very beautiful yet painstaking challenge. It can help me grow as a programmer and still save the project and the sanity of my colleagues.  I have closely inspected the use of certain frameworks.&lt;/p&gt;

&lt;p&gt;The following have been my choices:  &lt;a href="http://rspec.info" title="RSpec"&gt;RSpec&lt;/a&gt;, &lt;a href="http://www.thoughtbot.com/projects/shoulda/" title="Shoulda by Thoughtbot"&gt;Shoulda&lt;/a&gt;, Cucumber, &lt;a href="http://glu.ttono.us/articles/2005/10/30/why-and-how-ruby-and-rails-unit-testing" title="The built-in Rails testing framework"&gt;Rails Unit Test&lt;/a&gt;.  &lt;a href="http://twitter.com/sweetperception/statuses/1039712990" title="Twitter trail"&gt;I have asked around and most of my network responded with their love of RSpec&lt;/a&gt;.  I know that &lt;a href="http://rspec.info" title="RSpec"&gt;RSpec&lt;/a&gt; is already gained widespread use and popularity amongst Rails developers, but as I was also looking into using &lt;a href="http://www.thoughtbot.com/projects/shoulda/" title="Shoulda by Thoughtbot"&gt;Shoulda&lt;/a&gt;, I found that there truly were things that I did not like from &lt;a href="http://rspec.info" title="RSpec"&gt;RSpec&lt;/a&gt; that I very much found in &lt;a href="http://www.thoughtbot.com/projects/shoulda/" title="Shoulda by Thoughtbot"&gt;Shoulda&lt;/a&gt;.  Some of these are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I am having difficulty of testing nested resources in &lt;a href="http://rspec.info" title="RSpec"&gt;RSpec&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://rspec.info" title="RSpec"&gt;RSpec&lt;/a&gt;’s it-something-blank syntax doesn’t really amuse me (on a personal note, thought it fascinated me way back at the time I discovered it).&lt;/li&gt;
&lt;li&gt;I don’t like the way messages are displayed by &lt;a href="http://rspec.info" title="RSpec"&gt;RSpec&lt;/a&gt; when a test case fails.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="http://www.thoughtbot.com/projects/shoulda/" title="Shoulda by Thoughtbot"&gt;Shoulda&lt;/a&gt; on the other hand looked cleaner for me.  I also like the straightforwardness of the &lt;a href="http://github.com/carlosbrando/remarkable/wikis/activerecord-shoulda-macros"&gt;should-have-this methods&lt;/a&gt; for testing (especially in ActiveRecords).  &lt;/p&gt;

&lt;p&gt;Now, what I was missing in between was using the strength of &lt;a href="http://rspec.info" title="RSpec"&gt;RSpec&lt;/a&gt; in all other areas, and the readability and macros of Shoulda.  Here is when I stumbled across &lt;a href="http://www.nomedojogo.com/2008/11/18/shoulda-for-rspec-is-remarkable/" title="Shoulda for Rspec is Remarkabke"&gt;Remarkable&lt;/a&gt;; and truly I must agree it is remarkable!&lt;/p&gt;

&lt;p&gt;I have immediately jumped into writing a simple test for &lt;a href="http://pastie.org/334908" title="Checkout below's code in pastie"&gt;one of my models&lt;/a&gt; as follows:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class="r"&gt;class&lt;/span&gt; &lt;span class="cl"&gt;Feedback&lt;/span&gt; &amp;gt; &lt;span class="co"&gt;ActiveRecord&lt;/span&gt;::&lt;span class="co"&gt;Base&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  acts_as_audited&lt;tt&gt;
&lt;/tt&gt;  validates_presence_of &lt;span class="sy"&gt;:name&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..hey you can't be anonymous!&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:on&lt;/span&gt; =&amp;gt; &lt;span class="sy"&gt;:create&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  validates_presence_of &lt;span class="sy"&gt;:email&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..I need your contact details.&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:on&lt;/span&gt; =&amp;gt; &lt;span class="sy"&gt;:create&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  validates_presence_of &lt;span class="sy"&gt;:topic&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..what are you writing to me about?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:on&lt;/span&gt; =&amp;gt; &lt;span class="sy"&gt;:create&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  validates_presence_of &lt;span class="sy"&gt;:message&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..so you were saying?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:on&lt;/span&gt; =&amp;gt; &lt;span class="sy"&gt;:create&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  validates_format_of &lt;span class="sy"&gt;:email&lt;/span&gt;, &lt;span class="sy"&gt;:with&lt;/span&gt; =&amp;gt; &lt;span class="rx"&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;span class="k"&gt;^([^@&lt;/span&gt;&lt;span class="ch"&gt;\s&lt;/span&gt;&lt;span class="k"&gt;]{1}+)@((?:[-a-z0-9]+&lt;/span&gt;&lt;span class="ch"&gt;\.&lt;/span&gt;&lt;span class="k"&gt;)+[a-z]{2,})$&lt;/span&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;span class="mod"&gt;i&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..it should look something like yourname@something.com&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:on&lt;/span&gt; =&amp;gt; &lt;span class="sy"&gt;:create&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  validates_length_of &lt;span class="sy"&gt;:message&lt;/span&gt;, &lt;span class="sy"&gt;:minimum&lt;/span&gt; =&amp;gt; &lt;span class="i"&gt;5&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..uhm, can you be more specific?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  validates_length_of &lt;span class="sy"&gt;:name&lt;/span&gt;, &lt;span class="sy"&gt;:minimum&lt;/span&gt; =&amp;gt; &lt;span class="i"&gt;3&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..uhm, can you be more specific?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  validates_length_of &lt;span class="sy"&gt;:topic&lt;/span&gt;, &lt;span class="sy"&gt;:minimum&lt;/span&gt; =&amp;gt; &lt;span class="i"&gt;5&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..uhm, can you be more specific?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="r"&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;I know there are only few resources in the net that show you the exact counterpart of code being tested and test codes, but here’s mine.  &lt;a href="http://pastie.org/334910" title="Checkout below's code in pastie"&gt;Maybe this can help&lt;/a&gt;.&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;31&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;require &lt;span class="co"&gt;File&lt;/span&gt;.expand_path(&lt;span class="co"&gt;File&lt;/span&gt;.dirname(&lt;span class="pc"&gt;__FILE__&lt;/span&gt;) + &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;/../spec_helper&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;describe &lt;span class="co"&gt;Feedback&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;A Feedback instance&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class="co"&gt;VALID&lt;/span&gt; = {&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="sy"&gt;:name&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;firstname lastname&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="sy"&gt;:email&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;email.email@email.com&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="sy"&gt;:topic&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;some topic&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;      &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;some message&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  it &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;should accept VALID attributes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    assert f = &lt;span class="co"&gt;Feedback&lt;/span&gt;.new(&lt;span class="co"&gt;VALID&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;    assert f.valid?&lt;tt&gt;
&lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  should_require_attributes(&lt;span class="sy"&gt;:name&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..hey you can't be anonymous!&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  should_require_attributes(&lt;span class="sy"&gt;:email&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..I need your contact details.&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  should_require_attributes(&lt;span class="sy"&gt;:topic&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..what are you writing to me about?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  should_require_attributes(&lt;span class="sy"&gt;:message&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..so you were saying?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  should_ensure_length_at_least(&lt;span class="sy"&gt;:name&lt;/span&gt;, &lt;span class="i"&gt;3&lt;/span&gt;, &lt;span class="sy"&gt;:short_message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..uhm, can you be more specific?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  should_ensure_length_at_least(&lt;span class="sy"&gt;:message&lt;/span&gt;, &lt;span class="i"&gt;5&lt;/span&gt;, &lt;span class="sy"&gt;:short_message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..uhm, can you be more specific?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  should_ensure_length_at_least(&lt;span class="sy"&gt;:topic&lt;/span&gt;, &lt;span class="i"&gt;5&lt;/span&gt;, &lt;span class="sy"&gt;:short_message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..uhm, can you be more specific?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  should_allow_values_for(&lt;span class="sy"&gt;:name&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;maricris&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;ace&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;greg&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;john paul&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;mary jesus joseph&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  should_not_allow_values_for(&lt;span class="sy"&gt;:name&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;aa&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;at&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;jp&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;1&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;s&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..uhm, can you be more specific?&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  should_allow_values_for(&lt;span class="sy"&gt;:email&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;email.email@email.com&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;email_email@yahoo.com&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;123@yahoo.com&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  should_not_allow_values_for(&lt;span class="sy"&gt;:email&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;123@.com&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;testing!@!yahoocom&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;3@11234.#8com&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;..it should look something like yourname@something.com&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;span class="r"&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;There.  I know its not the best and the prettiest, but its a work in progress.  Writing these wee lines of code to test a small, almost bare model was truly a worthwhile experience.  What I really liked about doing this was the fact that at some point, while I was working backward (not the usual &lt;a href="http://en.wikipedia.org/wiki/Test-driven_development"&gt;TDD&lt;/a&gt;), when I arbitrarily took that my model was initially written meekly but completely, I was wrong.&lt;/p&gt;

&lt;p&gt;In the process of enumerating the cases where the validation should fail, I really had to go back to my model and change something.  Writing tests can make you more precise, and even make you feel that you can bring out your code to production and feel confident.&lt;/p&gt;

&lt;p&gt;I can now see why &lt;a href="http://www.railsenvy.com/2007/10/4/how-i-learned-to-love-testing-presentation"&gt;Gregg&lt;/a&gt; said he learned to love testing too.  Its not like I am forcing you to, but you should have a taste of this cake and be your own judge.  Will you like it or not? ..its totally up to you.  This will bring me not just sanity, but also confidence and a lot more freedom to rewrite and refactor in the future.   Just great! :) &lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gADN7vT8jtWQbSslx99wTiELsBE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gADN7vT8jtWQbSslx99wTiELsBE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gADN7vT8jtWQbSslx99wTiELsBE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gADN7vT8jtWQbSslx99wTiELsBE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=zHEQr4v6IDg:GbYlnIjkjJs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=zHEQr4v6IDg:GbYlnIjkjJs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=zHEQr4v6IDg:GbYlnIjkjJs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=zHEQr4v6IDg:GbYlnIjkjJs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=zHEQr4v6IDg:GbYlnIjkjJs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=zHEQr4v6IDg:GbYlnIjkjJs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/zHEQr4v6IDg" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2008/12/9/testing-is-a-remarkable-thing</feedburner:origLink></entry>
  <entry xml:base="http://coderkitty.sweetperceptions.com/">
    <author>
      <name>chris</name>
    </author>
    <id>tag:coderkitty.sweetperceptions.com,2008-12-04:142</id>
    <published>2008-12-04T14:09:00Z</published>
    <updated>2009-06-27T18:17:12Z</updated>
    <category term="Database" />
    <category term="database" />
    <category term="mysql" />
    <category term="postgresql" />
    <category term="tips" />
    <category term="tutorials" />
    <link href="http://feedproxy.google.com/~r/Coderkitty-Home/~3/VdI051em25g/migrating-from-mysql-to-postgresql" rel="alternate" type="text/html" />
    <title>Migrating from MySQL to PostgreSQL</title>
<content type="html">
            &lt;p&gt;Along with the migration that I have done from &lt;a href="http://subversion.tigris.org" title="Subversion Main Site"&gt;SVN&lt;/a&gt; to &lt;a href="http://git.org.cz" title="Git Main Site"&gt;Git&lt;/a&gt; and deploying my projects using &lt;a href="http://capify.org" title="Capistrano Main Site"&gt;Capistrano recipes&lt;/a&gt;, I was also faced with one task that was not very easy.  I had to move my &lt;a href="http://mysql.com" title="MySQL Main Site"&gt;MySQL&lt;/a&gt; databases to &lt;a href="http://postgresql.org" title="PostgreSQL Main Site"&gt;PostgreSQL&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why move?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well, I gave it a thought, and I feel that I am now more comfortable with using Rails with &lt;a href="http://postgresql.org" title="PostgreSQL Main Site"&gt;PostgreSQL&lt;/a&gt;.  Another factor is that I've already used MySQL in my early programming days and seemed fit for small scale projects.  Since I have been dealing more and more with bigger databases, I'm getting the hang of using &lt;a href="http://postgresql.org" title="PostgreSQL Main Site"&gt;PostgreSQL&lt;/a&gt; over &lt;a href="http://postgresql.org" title="MySQL Main Site"&gt;MySQL&lt;/a&gt;.  It didn't really have to be very technical, but the simple preference mattered much.&lt;/p&gt;
&lt;p&gt;Along with the migration that I have done from &lt;a href="http://subversion.tigris.org" title="Subversion Main Site"&gt;SVN&lt;/a&gt; to &lt;a href="http://git.org.cz" title="Git Main Site"&gt;Git&lt;/a&gt; and deploying my projects using &lt;a href="http://capify.org" title="Capistrano Main Site"&gt;Capistrano recipes&lt;/a&gt;, I was also faced with one task that was not very easy.  I had to move my &lt;a href="http://mysql.com" title="MySQL Main Site"&gt;MySQL&lt;/a&gt; databases to &lt;a href="http://postgresql.org" title="PostgreSQL Main Site"&gt;PostgreSQL&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why move?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well, I gave it a thought, and I feel that I am now more comfortable with using Rails with &lt;a href="http://postgresql.org" title="PostgreSQL Main Site"&gt;PostgreSQL&lt;/a&gt;.  Another factor is that I've already used MySQL in my early programming days and seemed fit for small scale projects.  Since I have been dealing more and more with bigger databases, I'm getting the hang of using &lt;a href="http://postgresql.org" title="PostgreSQL Main Site"&gt;PostgreSQL&lt;/a&gt; over &lt;a href="http://postgresql.org" title="MySQL Main Site"&gt;MySQL&lt;/a&gt;.  It didn't really have to be very technical, but the simple preference mattered much.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What to do?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;For the impatient:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Export your current database using &lt;a href="http://www.phpmyadmin.net/"&gt;PhpMyAdmin&lt;/a&gt;.  Select the database you want to export and click on the export tab.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Export using SQL format and configure your options as seen below:&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;ul&gt;&lt;li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download the mysql to pgsql script &lt;a href="http://gborg.postgresql.org/project/mysql2psql/"&gt;here&lt;/a&gt;.  Its not much, but it will at least do for you some stuffs that are needed and leave out only some more small stuffs to watch out for.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once you have the script, make it executable by doing this:&lt;/p&gt;&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class=""&gt;chmod&lt;/span&gt; &lt;span class="i"&gt;777&lt;/span&gt; &lt;span class=""&gt;mysql2pgsql&lt;/span&gt;.&lt;span class=""&gt;perl&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;ol&gt;&lt;li&gt;Now, convert your exported &lt;i&gt;mysql.sql&lt;/i&gt; file to &lt;i&gt;pgsql.sql&lt;/i&gt; by using the converter, like this:&lt;/li&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;./&lt;span class=""&gt;mysql2pgsql&lt;/span&gt;.&lt;span class=""&gt;perl&lt;/span&gt; &lt;span class=""&gt;yourinputfile&lt;/span&gt;.&lt;span class=""&gt;sql&lt;/span&gt; &lt;span class=""&gt;youroutputfile&lt;/span&gt;.&lt;span class=""&gt;sql&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;li&gt;&lt;p&gt;Your new &lt;i&gt;youroutputfile.sql&lt;/i&gt; is not supposedly a postgres format.  But wait!  There's more!  Your outputfile.sql is not yet totally ready.  The magic is over, its time to make some moves for yourself.  Don't be lazy!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Given the code: &lt;a href="http://pastie.org/330839"&gt;http://pastie.org/330839&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class="r"&gt;DROP&lt;/span&gt; &lt;span class="r"&gt;TABLE&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;audits&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=""&gt;CASCADE&lt;/span&gt;&lt;span class="er"&gt;\&lt;/span&gt;&lt;span class=""&gt;g&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="r"&gt;DROP&lt;/span&gt; &lt;span class=""&gt;SEQUENCE&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;audits_id_seq&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=""&gt;CASCADE&lt;/span&gt; ;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="r"&gt;CREATE&lt;/span&gt; &lt;span class=""&gt;SEQUENCE&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;audits_id_seq&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class=""&gt;START&lt;/span&gt; &lt;span class=""&gt;WITH&lt;/span&gt; &lt;span class="i"&gt;63&lt;/span&gt; ;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="r"&gt;CREATE&lt;/span&gt; &lt;span class="r"&gt;TABLE&lt;/span&gt;  &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;audits&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; (&lt;tt&gt;
&lt;/tt&gt;   &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="pt"&gt;integer&lt;/span&gt; &lt;span class="di"&gt;DEFAULT&lt;/span&gt; &lt;span class=""&gt;nextval&lt;/span&gt;(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;&amp;quot;audits_id_seq&amp;quot;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;) &lt;span class="r"&gt;NOT&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;   &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;auditable_id&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class="pt"&gt;int&lt;/span&gt; &lt;span class="di"&gt;default&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;   &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;auditable_type&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="di"&gt;default&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;   &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;user_id&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class="pt"&gt;int&lt;/span&gt; &lt;span class="di"&gt;default&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;   &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;user_type&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="di"&gt;default&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;   &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="di"&gt;default&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;   &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;action&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class="pt"&gt;varchar&lt;/span&gt;(&lt;span class="i"&gt;255&lt;/span&gt;) &lt;span class="di"&gt;default&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;   &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;changes&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class="pt"&gt;text&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;   &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;version&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class="pt"&gt;int&lt;/span&gt; &lt;span class="di"&gt;default&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;   &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;created_at&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class="pt"&gt;timestamp&lt;/span&gt; &lt;span class=""&gt;without&lt;/span&gt; &lt;span class="pt"&gt;time&lt;/span&gt; &lt;span class=""&gt;zone&lt;/span&gt; &lt;span class="di"&gt;default&lt;/span&gt; &lt;span class="pc"&gt;NULL&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;   &lt;span class="r"&gt;primary&lt;/span&gt; &lt;span class="r"&gt;key&lt;/span&gt; (&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;)     ;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="c"&gt;--&lt;tt&gt;
&lt;/tt&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="c"&gt;-- Dumping data for table 'audits'&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="r"&gt;INSERT&lt;/span&gt; &lt;span class="r"&gt;INTO&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;audits (id&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;auditable_id&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;auditable_type&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;user_id&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;user_type&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;action&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;changes&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;version&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;created_at)&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;VALUES&lt;/span&gt; &lt;tt&gt;
&lt;/tt&gt;(&lt;span class="i"&gt;1&lt;/span&gt;, &lt;span class="i"&gt;2&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;Feedback&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="pc"&gt;NULL&lt;/span&gt;, &lt;span class="pc"&gt;NULL&lt;/span&gt;, &lt;span class="pc"&gt;NULL&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;create&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;--- &lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;name: &lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;- chris&lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;message: &lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;- testing lang po&lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;topic: &lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;- some topic&lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;email: &lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="k"&gt;- coderkitty@sweetperceptions.com&lt;/span&gt;&lt;span class="ch"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="i"&gt;1&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;2008-01-27 11:34:10&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;remove all lines that look like these:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class="r"&gt;DROP&lt;/span&gt; &lt;span class="r"&gt;TABLE&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;audits&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=""&gt;CASCADE&lt;/span&gt;&lt;span class="er"&gt;\&lt;/span&gt;&lt;span class=""&gt;g&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class="r"&gt;DROP&lt;/span&gt; &lt;span class=""&gt;SEQUENCE&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;audits_id_seq&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=""&gt;CASCADE&lt;/span&gt; ;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;and then make sure that your INSERTs don't have the double quotes, so that they'll look like this:&lt;/p&gt;

&lt;div class="coderay-macro"&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  &lt;td title="click to toggle" class="line_numbers"&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class="code"&gt;&lt;pre&gt;&lt;span class="r"&gt;INSERT&lt;/span&gt; &lt;span class="r"&gt;INTO&lt;/span&gt; &lt;span class=""&gt;audits&lt;/span&gt; (&lt;span class=""&gt;id&lt;/span&gt;, &lt;span class=""&gt;auditable_id&lt;/span&gt;, &lt;span class=""&gt;auditable_type&lt;/span&gt;, &lt;span class=""&gt;user_id&lt;/span&gt;, &lt;span class=""&gt;user_type&lt;/span&gt;, &lt;span class=""&gt;username&lt;/span&gt;, &lt;span class=""&gt;action&lt;/span&gt;, &lt;span class=""&gt;changes&lt;/span&gt;, &lt;span class=""&gt;version&lt;/span&gt;, &lt;span class=""&gt;created_at&lt;/span&gt;) &lt;span class="r"&gt;VALUES&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/ol&gt;

&lt;p&gt;That's it for the quick and short version.  The long version though would have to be reading more of the documentations of each databases.  You'd have to watch out several items like:&lt;/p&gt;

&lt;p&gt;&lt;ul&gt;
&lt;li&gt;ENGINE=MyISAM&lt;/li&gt;
&lt;li&gt;IF NOT EXISTS&lt;/li&gt;
&lt;li&gt;mediumint to int&lt;/li&gt;
&lt;li&gt;tinyint to smallint&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;

&lt;p&gt;If your database is already huge, consider doing it manually.  You may miss some data if you don't go through the nitty gritty details of it.  But for small databases like the ones I have, this solution is pretty neat.&lt;/p&gt;

&lt;p&gt;You can get some more info here:
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/17717/migrating-from-mysql-to-postgresql"&gt;StackOverflow's thread on migrating from mysql to postgresql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://codespatter.com/2008/07/02/tips-for-mysql-to-postgresql-switch/"&gt;CodeSpatter converts from mysql to postgresql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.postgresql.org/docs/"&gt;PostgreSQL Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;
          
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cuZPsOTrAMitT33Ri05IQiGZ5Ig/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cuZPsOTrAMitT33Ri05IQiGZ5Ig/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cuZPsOTrAMitT33Ri05IQiGZ5Ig/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cuZPsOTrAMitT33Ri05IQiGZ5Ig/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=VdI051em25g:t9Fn5w_ovFE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=VdI051em25g:t9Fn5w_ovFE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=VdI051em25g:t9Fn5w_ovFE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=VdI051em25g:t9Fn5w_ovFE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Coderkitty-Home?a=VdI051em25g:t9Fn5w_ovFE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Coderkitty-Home?i=VdI051em25g:t9Fn5w_ovFE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Coderkitty-Home/~4/VdI051em25g" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://coderkitty.sweetperceptions.com/2008/12/4/migrating-from-mysql-to-postgresql</feedburner:origLink></entry>
</feed>
