<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Thinker's PostsThinker's Posts</title>
	
	<link>http://arfeen.net</link>
	<description>It's About Everything...!!</description>
	<lastBuildDate>Fri, 01 Mar 2013 05:31:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/thinkersposts" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="thinkersposts" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>MySQL: Use of GROUP after ORDER BY</title>
		<link>http://arfeen.net/2012/10/mysql-use-of-group-after-order-by/</link>
		<comments>http://arfeen.net/2012/10/mysql-use-of-group-after-order-by/#comments</comments>
		<pubDate>Tue, 02 Oct 2012 06:00:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[before]]></category>
		<category><![CDATA[group by]]></category>
		<category><![CDATA[grouping]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[order by]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[select]]></category>

		<guid isPermaLink="false">http://arfeen.net/?p=393</guid>
		<description><![CDATA[Just came across a MySQL query simple problem and I was thinking it would be too simple for me to solve. But it wasn&#8217;t like that. The query made me realize, I&#8217;m still missing some basic rules of query even after years on working on MySQL. It was about the use of GROUP BY and [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>Just came across a MySQL query simple problem and I was thinking it would be too simple for me to solve.</p>
<p>But it wasn&#8217;t like that. The query made me realize, I&#8217;m still missing some basic rules of query even after years on working on MySQL. It was about the use of GROUP BY and ORDER BY in the query.</p>
<p>To make this understand, here is a sample table.</p>
<table border="1">
<tbody>
<tr>
<td bgcolor="silver">id</td>
<td bgcolor="silver">product_code</td>
<td bgcolor="silver">sale</td>
<td bgcolor="silver">tax</td>
</tr>
<tr>
<td valign="top">1</td>
<td valign="top">A-001</td>
<td valign="top">200</td>
<td valign="top">1.5</td>
</tr>
<tr>
<td valign="top">2</td>
<td valign="top">A-002</td>
<td valign="top">340</td>
<td valign="top">2.34</td>
</tr>
<tr>
<td valign="top">3</td>
<td valign="top">A-003</td>
<td valign="top">120</td>
<td valign="top">0.75</td>
</tr>
<tr>
<td valign="top">4</td>
<td valign="top">A-003</td>
<td valign="top">340</td>
<td valign="top">3.33</td>
</tr>
<tr>
<td valign="top">5</td>
<td valign="top">A-003</td>
<td valign="top">150</td>
<td valign="top">0.8</td>
</tr>
<tr>
<td valign="top">6</td>
<td valign="top">A-002</td>
<td valign="top">500</td>
<td valign="top">4.55</td>
</tr>
<tr>
<td valign="top">7</td>
<td valign="top">A-001</td>
<td valign="top">340</td>
<td valign="top">3.44</td>
</tr>
<tr>
<td valign="top">8</td>
<td valign="top">A-001</td>
<td valign="top">250</td>
<td valign="top">1.33</td>
</tr>
<tr>
<td valign="top">9</td>
<td valign="top">A-002</td>
<td valign="top">120</td>
<td valign="top">1.77</td>
</tr>
<tr>
<td valign="top">10</td>
<td valign="top">A-002</td>
<td valign="top">340</td>
<td valign="top">1.88</td>
</tr>
</tbody>
</table>
<p>Problem:</p>
<p>As you can see there are duplicate records for product code with sale and tax record in different amount. All I want is to fetch the records where it should be grouped together on the basis of &#8220;product_code&#8221; field but it should fetch the maximum sale record too. So I expected this result:</p>
<p>&nbsp;</p>
<table border="1">
<tbody>
<tr>
<td class="medium" bgcolor="silver">id</td>
<td class="medium" bgcolor="silver">product_code</td>
<td class="medium" bgcolor="silver">sale</td>
<td class="medium" bgcolor="silver">tax</td>
</tr>
<tr>
<td class="normal" valign="top">1</td>
<td class="normal" valign="top">A-002</td>
<td class="normal" valign="top">500</td>
<td class="normal" valign="top">4.55</td>
</tr>
<tr>
<td class="normal" valign="top">2</td>
<td class="normal" valign="top">A-001</td>
<td class="normal" valign="top">340</td>
<td class="normal" valign="top">3.44</td>
</tr>
<tr>
<td class="normal" valign="top">3</td>
<td class="normal" valign="top">A-003</td>
<td class="normal" valign="top">340</td>
<td class="normal" valign="top">3.33</td>
</tr>
</tbody>
</table>
<p>And here is the query I applied:<br />
<pre class="brush: sql">SELECT * FROM sales GROUP BY product_code ORDER BY sale DESC</pre></p>
<p>But guess what ? It brought me this result:</p>
<p>&nbsp;</p>
<table border="1">
<tbody>
<tr>
<td class="medium" bgcolor="silver">id</td>
<td class="medium" bgcolor="silver">product_code</td>
<td class="medium" bgcolor="silver">sale</td>
<td class="medium" bgcolor="silver">tax</td>
</tr>
<tr>
<td class="normal" valign="top">1</td>
<td class="normal" valign="top">A-002</td>
<td class="normal" valign="top">340</td>
<td class="normal" valign="top">2.34</td>
</tr>
<tr>
<td class="normal" valign="top">2</td>
<td class="normal" valign="top">A-001</td>
<td class="normal" valign="top">200</td>
<td class="normal" valign="top">1.5</td>
</tr>
<tr>
<td class="normal" valign="top">3</td>
<td class="normal" valign="top">A-003</td>
<td class="normal" valign="top">120</td>
<td class="normal" valign="top">0.75</td>
</tr>
</tbody>
</table>
<p>This is wrong right ? the maximum sale recorded for A-002 was 500 not 340, and for A-001 was 340 not 200 and for A-003 was also 340 but not 120. Why ? because it grouped the rows first and then applied the sorting with order by. And definitely this is not what we wanted.</p>
<p>So, I came up with a simple work around with query:<br />
<pre class="brush: sql">SELECT * FROM sales salestable WHERE sale = (SELECT MAX(sale) FROM sales WHERE product_code = salestable.product_code) GROUP BY product_code ORDER BY sale DESC;</pre></p>
<p>See what it says, its selecting rows from the &#8220;sales&#8221; table with an alias &#8220;salestable&#8221;. It asked the db to fetch the records but only for the product id whose record is having the maximum sale and then group it and sort it.</p>
<p>So did we get what we expected ?</p>
<p>What about the performance ? I haven&#8217;t analyzed it yet. Let me know if you have some points.</p>
<p>Hope it may help some of you guys.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Update:</p>
<p>As in the Moyes Ansari commented, we can also come up with this solution, which will give the same data and probably better in the performance:</p>
<p><pre class="brush: php">SELECT * FROM (SELECT * FROM sales  ORDER BY sale DESC) AS salestable GROUP BY salestable.product_code ORDER BY sale DESC</pre></p>
<p>Thanks Moyed</p>
]]></content:encoded>
			<wfw:commentRss>http://arfeen.net/2012/10/mysql-use-of-group-after-order-by/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Tomb of Quide-e-Azam Muhammad Ali Jinnah, Founder of Pakistan</title>
		<link>http://arfeen.net/2012/09/the-tomb-of-quide-e-azam-muhammad-ali-jinnah-founder-of-pakistan/</link>
		<comments>http://arfeen.net/2012/09/the-tomb-of-quide-e-azam-muhammad-ali-jinnah-founder-of-pakistan/#comments</comments>
		<pubDate>Tue, 18 Sep 2012 12:48:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://arfeen.net/?p=383</guid>
		<description><![CDATA[&#160; Quid-e-Azam Muhammad Ali Jinnah, the founder of Pakistan (25 Dec, 1976 – 11 Sep, 1948), when died, buried with honored in Karachi. Their grave area later converted into a big tomb that later became the landmark for Pakistan especially Karachi. The tomb was built quite big in size that it can easily be seen [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p><a href="http://arfeen.net/wp-content/uploads/2012/09/2012-09-16-18.56.58.jpg"><img src="http://arfeen.net/wp-content/uploads/2012/09/2012-09-16-18.56.58-300x225.jpg" alt="" title="2012-09-16 18.56.58" width="300" height="225" class="alignnone size-medium wp-image-436" /></a>&nbsp;</p>
<p><a title="Quid-e-Azam Muhammad Ali Jinnah (Wiki)" href="http://en.wikipedia.org/wiki/Muhammad_Ali_Jinnah" target="_blank">Quid-e-Azam Muhammad Ali Jinnah</a>, the founder of <a title="Pakistan (Wiki)" href="http://en.wikipedia.org/wiki/Pakistan" target="_blank">Pakistan</a> (25 Dec, 1976 – 11 Sep, 1948), when died, buried with honored in Karachi. Their grave area later converted into a big tomb that later became the landmark for Pakistan especially Karachi. The tomb was built quite big in size that it can easily be seen from all the corners of the city.<br />
The tomb is surrounded by a big beautiful garden. The tomb is quite on the height that you can see the entire city from the tomb floor. Inside the tomb, a chandelier was installed which was gifted from the govt. of China.<br />
Few days before I had a chance to visit the tomb again after years since my childhood. I took my daughter there to show her as an assignment from her class teacher. It was a good task for the kids, as definitely it’s a good way to introduce them to the father of the nation Muhammad Ali Jinnah.<br />
I went there and took some pictures and sharing them here.</p>
<p>&nbsp;</p>

		<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="http://arfeen.net/wp-content/plugins/wp-vertical-gallery/js/AC_RunActiveContent.js" language="javascript"></script>

		<script language="javascript"> 
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '700',
			'height', '570',
			'src', 'http://arfeen.net/wp-content/plugins/wp-vertical-gallery/js/wp_vertical',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'xmlswf_vmvrt',
			'bgcolor', '#ffffff',
			'name', 'xmlswf_vmvrt',
			'menu', 'true',
			'allowFullScreen', 'true',
			'allowScriptAccess','sameDomain',
			'movie', 'http://arfeen.net/wp-content/plugins/wp-vertical-gallery/js/wp_vertical',
			'salign', '',
			'flashVars','loadFile=http://arfeen.net/wp-content/plugins/wp-vertical-gallery/xml/vrt_all.xml'
			); //end AC code
	}
</script>

]]></content:encoded>
			<wfw:commentRss>http://arfeen.net/2012/09/the-tomb-of-quide-e-azam-muhammad-ali-jinnah-founder-of-pakistan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Raining … In Karachi</title>
		<link>http://arfeen.net/2012/09/raining-in-karachi/</link>
		<comments>http://arfeen.net/2012/09/raining-in-karachi/#comments</comments>
		<pubDate>Sat, 08 Sep 2012 11:08:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[climate]]></category>
		<category><![CDATA[food]]></category>
		<category><![CDATA[karachi]]></category>
		<category><![CDATA[momsoon]]></category>
		<category><![CDATA[pakistan]]></category>
		<category><![CDATA[rain]]></category>
		<category><![CDATA[sports]]></category>
		<category><![CDATA[tradition]]></category>
		<category><![CDATA[traffic]]></category>
		<category><![CDATA[weather]]></category>

		<guid isPermaLink="false">http://arfeen.net/?p=364</guid>
		<description><![CDATA[Karachi, the largest city of Pakistan, is a bit less fortunate when it comes to monsoon raining. Raining always fascinate Karachites because here the total season last for less than even a month. Though they enjoy cloudy weather in whole August after the &#8220;hell hot&#8221; summer of June-July but still everyone talks about if it [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>Karachi, the largest city of Pakistan, is a bit less fortunate when it comes to monsoon raining.</p>
<p>Raining always fascinate Karachites because here the total season last for less than even a month. Though they enjoy cloudy weather in whole  August after the &#8220;hell hot&#8221; summer of June-July but still everyone talks about if it will be raining today.</p>
<p>Raining, in Karachi, is mostly enjoyed by walking, driving and playing favorite sports. Not only this but cooking traditional nation&#8217;s favorite snack like &#8220;Pakoray&#8221; and &#8220;Poori Halwa and Kachori&#8221; is like a must do task.</p>
<p>Even after these enjoyments, people have nightmares also which are actully the &#8220;after effects&#8221; of raining. Because of bit inefficient sanitory system, the water on the roads causes traffic jam which last for hours and it is a normal thing here. People prefer to go back to home early before it starts raining because they don&#8217;t want to get stuck in the traffic. </p>
<p>Even after these things raining is always enjoyed and considered a blessing here.</p>
<p>Like othet people I also take photos from my mobile when it rains. Enjoy some of my photos I took in recent monsoon season.<br />
<img title="IMG_20120907_091821.jpg" class="alignnone" alt="image" src="http://arfeen.net/wp-content/uploads/2012/09/wpid-IMG_20120907_091821.jpg" /> </p>
<p><img title="IMG_20120907_085318.jpg" class="alignnone" alt="image" src="http://arfeen.net/wp-content/uploads/2012/09/wpid-IMG_20120907_085318.jpg" /> </p>
<p><img title="2012-09-05 14.18.51.jpg" class="alignnone" alt="image" src="http://arfeen.net/wp-content/uploads/2012/09/wpid-2012-09-05-14.18.51.jpg" /> </p>
<p><img title="2012-09-05 14.18.54.jpg" class="alignnone" alt="image" src="http://arfeen.net/wp-content/uploads/2012/09/wpid-2012-09-05-14.18.54.jpg" /> </p>
<p><img title="IMG_20120906_193008.jpg" class="alignnone" alt="image" src="http://arfeen.net/wp-content/uploads/2012/09/wpid-IMG_20120906_193008.jpg" /> </p>
<p><img title="2012-09-07 09.41.24.jpg" class="alignnone" alt="image" src="http://arfeen.net/wp-content/uploads/2012/09/wpid-2012-09-07-09.41.24.jpg" /> </p>
<p><img title="2012-08-25 15.04.35.jpg" class="alignnone" alt="image" src="http://arfeen.net/wp-content/uploads/2012/09/wpid-2012-08-25-15.04.35.jpg" /> </p>
<p><img title="2012-08-20 08.58.36.jpg" class="alignnone" alt="image" src="http://arfeen.net/wp-content/uploads/2012/09/wpid-2012-08-20-08.58.36.jpg" /></p>
<p> Posted from WordPress for Android</span></p>
]]></content:encoded>
			<wfw:commentRss>http://arfeen.net/2012/09/raining-in-karachi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Yii :: Sharing Cache keys between console and web app</title>
		<link>http://arfeen.net/2012/07/yii-sharing-cache-keys-between-console-and-web-app/</link>
		<comments>http://arfeen.net/2012/07/yii-sharing-cache-keys-between-console-and-web-app/#comments</comments>
		<pubDate>Mon, 09 Jul 2012 07:10:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Yii php framework cache console web app application software web sqlite memcache apc]]></category>

		<guid isPermaLink="false">http://arfeen.net/?p=357</guid>
		<description><![CDATA[Cache is important for any web or console app to save time in fetching data from the databases. Yii offers a built in cache mechanism with a variety of choosing different cache engines, e.g. Sqlite, Memcache, API etc. Sometimes, you also require a console application to integrate the data with the web app. This may [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>Cache is important for any web or console app to save time in fetching data from the databases.</p>
<p><a href="http://www.yiiframework.com/" title="Yii Framework" target="_blank">Yii</a> offers a built in cache mechanism with a variety of choosing different cache engines, e.g. Sqlite, Memcache, API etc.</p>
<p>Sometimes, you also require a console application to integrate the data with the web app. This may be required when you want some cron jobs for report generations or some other continuous services that do not require direct user interaction. To do this, you also want your console and web app to share the common cache key/values. Whatever the cache engine you are using, you need to mention in config file of console and web app, to use common key/values.</p>
<p>You can do this by editing your config files for console and web app.</p>
<p>In, the example here, I&#8217;m using SQLite cache:</p>
<p><pre class="brush: php">'cachedb'=&gt;array(
	    'class' =&gt; 'system.db.CDbConnection',
            'connectionString' =&gt; 'sqlite:/wamp/www/myproject/protected/data/cache_data.db',
            'schemaCachingDuration' =&gt; 3600,
		),			

'cache'=&gt;array(
           'class' =&gt; 'system.caching.CDbCache',           
           'connectionID' =&gt; 'cachedb',
           'keyPrefix' =&gt; 'cache-assets'
  ),
  </pre></p>
<p>  As you can see I&#8217;m using 2 components for cache, cachedb is actually being used for sqlite. </p>
<p>  &#8216;keyPrefix&#8217; is actually forcing the cache to use some particular prefix for the cache keys.</p>
<p>  This config should be common between your console and web app config, and by doing this both apps will share the common cache values.</p>
<p>  More on Yii cahce, check the <a href="http://www.yiiframework.com/doc/guide/1.1/en/caching.overview" title="Yii Cache">official documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://arfeen.net/2012/07/yii-sharing-cache-keys-between-console-and-web-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My another PHP class nominated at PHPClasses.org</title>
		<link>http://arfeen.net/2012/06/my-another-php-class-nominated-at-phpclasses-org/</link>
		<comments>http://arfeen.net/2012/06/my-another-php-class-nominated-at-phpclasses-org/#comments</comments>
		<pubDate>Fri, 01 Jun 2012 07:16:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[awards]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[contribution]]></category>
		<category><![CDATA[nominations]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://arfeen.net/?p=349</guid>
		<description><![CDATA[Few days before I wrote about the class , I recently submitted to PHPClasses.org. The class was successfully approved on the PHPClasses and it has been nominated for the &#8220;Innovation Award&#8221;, a regular monthly competition arranged by PHPClasses. So If you are registered at PHPClasses.org, you can vote to the nominations here. Happy Voting :)]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>Few days before I wrote about the <a href="http://arfeen.net/2012/05/basic-language-parser-my-new-php-class-published-in-phpclasses-org/">class </a>, I recently submitted to <a href="http://phpclasses.org" title="PHPClasses.org">PHPClasses.org</a>. </p>
<p>The class was successfully approved on the <a href="http://phpclasses.org">PHPClasses </a>and it has been nominated for the &#8220;Innovation Award&#8221;, a regular monthly competition arranged by <a href="http://phpclasses.org">PHPClasses</a>.</p>
<p>So If you are registered at <a href="http://phpclasses.org">PHPClasses.org</a>, you can vote to the nominations <a href="http://www.phpclasses.org/vote.html" title="Vote here">here</a>.</p>
<p><script src="http://www.phpclasses.org/browse/package/7499/format/badge.js">
</script></p>
<p>Happy Voting :) </p>
]]></content:encoded>
			<wfw:commentRss>http://arfeen.net/2012/06/my-another-php-class-nominated-at-phpclasses-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Take a look at “WordPress” for Android</title>
		<link>http://arfeen.net/2012/05/take-a-look-at-wordpress-for-android/</link>
		<comments>http://arfeen.net/2012/05/take-a-look-at-wordpress-for-android/#comments</comments>
		<pubDate>Thu, 24 May 2012 20:08:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://arfeen.net/?p=345</guid>
		<description><![CDATA[https://play.google.com/store/apps/details?id=org.wordpress.android I have just started using this WordPress Android app. Like the web interface, the app&#8217;s interface is so neat and usable that one would only want to create post from mobile device only. The menu is clearly defined and all main options can be seen at first look. Two options also given to create [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p><a href="https://play.google.com/store/apps/details?id=org.wordpress.android ">https://play.google.com/store/apps/details?id=org.wordpress.android </a></p>
<p>I have just started using this <strong>WordPress Android app</strong>. Like the web interface, the app&#8217;s interface is so neat and usable that one would only want to create post from mobile device only. The menu is clearly defined and all main options can be seen at first look. Two options also given to create a quick blog with a picture or video. The editor is quite cool and its quite comfortable. The best option is the sharing option which is added in core Android system. You can share any link you want in your blog post. This is really a cool app. Here how it looks like : </p>
<p><img title="SC20120525-005720.png" class="alignnone" alt="image" src="http://arfeen.net/wp-content/uploads/2012/05/wpid-SC20120525-005720.png" /></p>
<p><span class="post_sig">Posted from WordPress for Android</span></p>
]]></content:encoded>
			<wfw:commentRss>http://arfeen.net/2012/05/take-a-look-at-wordpress-for-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TV remote control inventor Eugene Polly dies</title>
		<link>http://arfeen.net/2012/05/tv-remote-control-inventor-eugene-polly-dies/</link>
		<comments>http://arfeen.net/2012/05/tv-remote-control-inventor-eugene-polly-dies/#comments</comments>
		<pubDate>Wed, 23 May 2012 04:20:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[eugene polly]]></category>
		<category><![CDATA[invention]]></category>
		<category><![CDATA[remote control]]></category>
		<category><![CDATA[rip]]></category>
		<category><![CDATA[tv]]></category>

		<guid isPermaLink="false">http://arfeen.net/?p=340</guid>
		<description><![CDATA[http://www.bbc.co.uk/news/world-us-canada-18164200 The inventor of TV Remote Control &#8220;Eugene Polley&#8221; of &#8220;Zenith&#8221; died at the age of 97. Definitely Eugene&#8217;s invention made him one of the greatest inventor on 20th century. Today wheb we get beneited of hundreds of channels would never be fun without remote control. As it was said it was considered a luxury [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>http://www.bbc.co.uk/news/world-us-canada-18164200 The inventor of TV Remote Control &#8220;Eugene Polley&#8221; of &#8220;Zenith&#8221; died at the age of 97. Definitely Eugene&#8217;s invention made him one of the greatest inventor on 20th century. Today wheb we get beneited of hundreds of channels would never be fun without remote control. As it was said it was considered a luxury at that time but I thibk it still is. Thank you Eugene, for such a great invention. R.I.P. May God bless your soul</p>
]]></content:encoded>
			<wfw:commentRss>http://arfeen.net/2012/05/tv-remote-control-inventor-eugene-polly-dies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BASIC Language Parser – My new PHP class published in PHPClasses.org</title>
		<link>http://arfeen.net/2012/05/basic-language-parser-my-new-php-class-published-in-phpclasses-org/</link>
		<comments>http://arfeen.net/2012/05/basic-language-parser-my-new-php-class-published-in-phpclasses-org/#comments</comments>
		<pubDate>Thu, 17 May 2012 05:38:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[basic language parser]]></category>
		<category><![CDATA[human]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[language to machine]]></category>
		<category><![CDATA[natual language]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP language]]></category>

		<guid isPermaLink="false">http://arfeen.net/?p=333</guid>
		<description><![CDATA[Update: This class won a 3rd rank overall for the month May 2012 at PHPClasses.org. Recently, I was stuck in a situation where I wanted to have my own small conditional language and its parser. I only wanted to execute the conditions using &#8220;IF THEN ELSE&#8221;. I came up with this idea and it worked. [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p><script src="http://www.phpclasses.org/browse/package/7499/format/badge.js">
</script></p>
<p><strong>Update: This class won a 3rd rank overall for the month May 2012 at PHPClasses.org.<br />
</strong><br />
Recently, I was stuck in a situation where I wanted to have my own small conditional language and its parser.</p>
<p>I only wanted to execute the conditions using &#8220;IF THEN ELSE&#8221;. I came up with this idea and it worked. Although it could be bit memory costly so it may takes time for bigger conditions. It is ideal in the situations where performance is not the issue and you only need to get the jobs done.</p>
<p>So I wrote this class &#8220;BASIC Language Parser&#8221; and it has been published in <a href="http://phpclasses.org" title="PHPClasses.org" target="_blank"></a> (and yes this class been marked as &#8220;Noted&#8221; :) . Here is the <a href="http://www.phpclasses.org/package/7499-PHP-Parse-BASIC-language-statements.html" target="_blank">direct link</a> for the class.</p>
<p>Update (Nominated by PHPClasses.org):</p>
<p><script src="http://www.phpclasses.org/browse/package/7499/format/badge.js">
</script></p>
<p>How to use it:<br />
<code><br />
Syntax:</p>
<p>		IF <( ANY CONDITION YOU WANT )> THEN<br />
			DO <ANY STRING WHICH YOU CAN PARSE><br />
		ELSE<br />
			{ DO <ANY STRING WHICH YOU CAN PARSE> | IF <( ANY CONDITION YOU WANT )> }<br />
		END</code></p>
<p>This is how the language will look like. It is up to you how you will write the conditions inside, you can do anything on your choice, you just need to tell parse weather the condition is &#8220;true&#8221; or &#8220;false&#8221; so that it may proceed for the &#8220;THEN&#8221; or &#8220;ELSE&#8221; what is appropriate.</p>
<p>Here is an example:<br />
<code><br />
	IF (MY_AGE > 13)<br />
					THEN<br />
						DO AGECHECK<br />
					ELSE<br />
						IF (MY_AGE > 20)<br />
							DO ANOTHERROUTINES<br />
						END<br />
				END</code></p>
<p>Then look at this function:</p>
<p><code>public function checkCondition($condition){</p>
<p>         /* Do your actual conditions cheking here, i.e., using the things inside paranthesis */</p>
<p>         preg_match_all("/(.*)/",$condition,$mathes);<br />
         //print_r($mathes);</p>
<p>         return false;<br />
    }  </code>      </p>
<p>This is the place where you actually parse your condition. You could use DB to execute your condition or you could probably use &#8220;eval&#8221; to make it exactly what PHP is. Totally depends on your choice.</p>
<p>If you have any suggestion, feel free to comment. Or you might probably want to make it better.</p>
<p>Here is the <a href="http://www.phpclasses.org/browse/author/459335.html" target="_blank">link</a> to the page for my already published classes at PHPClasses.org</p>
]]></content:encoded>
			<wfw:commentRss>http://arfeen.net/2012/05/basic-language-parser-my-new-php-class-published-in-phpclasses-org/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Yii Framework : How to change the DB connection in Yii models at run time</title>
		<link>http://arfeen.net/2012/04/yii-framework-how-to-change-the-db-connection-in-yii-models-at-run-time/</link>
		<comments>http://arfeen.net/2012/04/yii-framework-how-to-change-the-db-connection-in-yii-models-at-run-time/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 20:09:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Yii]]></category>
		<category><![CDATA[yii framework]]></category>

		<guid isPermaLink="false">http://arfeen.net/?p=326</guid>
		<description><![CDATA[How to change the DB connection in Yii models at runtime. After you have generated the Yii model, you need to add a parent method from CActiveRecord &#8220;getDbConnection()&#8221;. This method is actually resposible to return the database connection. In this method, you need to create a DB connection. If you use return $connection-&#62;db; This will [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>How to change the DB connection in Yii models at runtime.</p>
<p>After you have generated the Yii model, you need to add a parent method from CActiveRecord &#8220;getDbConnection()&#8221;.</p>
<p>This method is actually resposible to return the database connection. In this method, you need to create a DB connection. If you use</p>
<p>	<pre class="brush: php">return $connection-&gt;db;</pre></p>
<p>This will actually the default DB connection mentioned in your config file (most probably main.php). </p>
<p>To use a different DB connection, you need to add this method:</p>
<p>	<pre class="brush: php">Yii::createComponent( $array );</pre></p>
<p>This method takes an array as argument. The structure of the array would be the same your default DB connection in your main conffig file, except you need to add one more key for db class &#8220;CDbConnection&#8221;.</p>
<p>So that&#8217;s how you will use it:</p>
<p>	<pre class="brush: php">$dbconnection = Yii::createComponent(
			array('connectionString' =&gt; 'mysql:host=localhost;dbname=mydb',
			'emulatePrepare' =&gt; true,
			'username' =&gt; 'mydbuser',
			'password' =&gt; 'dbpass',
			'charset' =&gt; 'utf8',
			'class' =&gt; 'CDbConnection'
			)
		
		);
</pre></p>
<p>So now the method in your model would be:</p>
<p>	<pre class="brush: php">public function getDbConnection(){
	
	$dbconnection = Yii::createComponent(
			array('connectionString' =&gt; 'mysql:host=localhost;dbname=mydb',
			'emulatePrepare' =&gt; true,
			'username' =&gt; 'mydbuser',
			'password' =&gt; 'dbpass',
			'charset' =&gt; 'utf8',
			'class' =&gt; 'CDbConnection'
			)
		
		);

	}</pre></p>
<p>And the rest of the method would be as is.</p>
<p>So in any case where you are changing the databases at run time this code might help you.</p>
]]></content:encoded>
			<wfw:commentRss>http://arfeen.net/2012/04/yii-framework-how-to-change-the-db-connection-in-yii-models-at-run-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Story of Lycos Customer Support</title>
		<link>http://arfeen.net/2012/01/a-story-of-lycos-customer-support/</link>
		<comments>http://arfeen.net/2012/01/a-story-of-lycos-customer-support/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 07:43:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[csr]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[lycos]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://arfeen.net/?p=321</guid>
		<description><![CDATA[Recently my 14 years old &#8220;hotmail&#8221; account was blocked as someone managed to access it to send lots of spam email. MSN blocked my account and asked me to send a code that has been sent to my email account which was at lycos mail. I was surprised to see that my lycos email was [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="http://arfeen.net/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>Recently my 14 years old &#8220;<a href="http://www.hotmail.com" title="MSN Hotmail">hotmail</a>&#8221; account was blocked as someone managed to access it to send lots of spam email. <a href="http://msn.com" title="MSN">MSN </a>blocked my account and asked me to send a code that has been sent to my email account which was at <a href="http://mail.lycos.com" title="Lycos Mail">lycos mail</a>. I was surprised to see that my <a href="http://mail.lycos.com" title="Lycos Mail">lycos email</a> was no more and I had to re signup. Luckily I got the same account with the same username.</p>
<p>When I signed up on <a href="http://lycos.com" title="Lycos">Lycos</a>, I got a blank email with no activation link. There was no way to activate and login to my account. Every I was logging it was asking me to signup again. I sent an email to the  <a href="http://lycos.com" title="Lycos">Lycos</a>customer support and I was so surprised to see that I got reply within 10 minutes from the support, telling me that the account has been activated by support agent. And yes it was true, my account was activated and I was able to send and receive emails. Thanks to  <a href="http://lycos.com" title="Lycos">Lycos</a>, I got my &#8220;<a href="http://www.hotmail.com" title="MSN Hotmail">hotmail</a>account back.</p>
<p>Although there are some problems in <a href="http://lycos.com" title="Lycos">Lycos</a>, but I was so shocked to see the response time of Lycos customer service. I have been using <a href="http://lycos.com" title="Lycos">Lycos</a>since 1998 (when I started to browse the Internet). I still remember those early days of Internet, when having an email account was a big thing. I was also the user of <a href="http://www.tripod.lycos.com/" title="Lycos Tripod">Tripod </a>which use to offer free hosting.</p>
<p>So that was a short story about <a href="http://lycos.com" title="Lycos">Lycos</a>&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://arfeen.net/2012/01/a-story-of-lycos-customer-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
