<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Gaurish Sharma Live</title>
	<atom:link href="http://www.gaurishsharma.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gaurishsharma.com</link>
	<description>Gaurish Sharma&#039;s blog foccused on Technology,Broadband,Latest Offers. He seldomly writes about his life experiances</description>
	<lastBuildDate>Fri, 03 Feb 2012 12:04:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How-To Fully Disable Caching in Drupal 7</title>
		<link>http://www.gaurishsharma.com/2012/02/how-to-fully-disable-caching-in-drupal-7.html</link>
		<comments>http://www.gaurishsharma.com/2012/02/how-to-fully-disable-caching-in-drupal-7.html#comments</comments>
		<pubDate>Fri, 03 Feb 2012 12:04:33 +0000</pubDate>
		<dc:creator>gaurish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gaurishsharma.com/?p=667</guid>
		<description><![CDATA[Caching helps to cut the load on server &#38; increase server speed. Hence, Drupal comes with caching build-in at various levels. there will be situations where,  you may want to disable *ALL* caching like I was doing some module development and without clearing out the caches the changes were not visible. So, I had to disable <a href='http://www.gaurishsharma.com/2012/02/how-to-fully-disable-caching-in-drupal-7.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Caching helps to cut the load on server &amp; increase server speed. Hence, Drupal comes with caching build-in at various levels. there will be situations where,  you may want to disable *ALL* caching like I was doing some module development and without clearing out the caches the changes were not visible. So, I had to disable caches.  Incase, you too want to disable Caching for say for development &#8211; here below</p>
<ol>
<li>Go to <em>Site Configuration</em> -&gt; <em>Performance</em>:
<ul>
<li>Set the following options, and click <em>Save configuration</em>:
<ul>
<li><strong>Caching mode:</strong> Disabled</li>
<li><strong>Minimum cache lifetime:</strong> none</li>
<li><strong>Page compression:</strong> Disabled</li>
<li><strong>Block cache:</strong> Disabled</li>
<li><strong>Optimize CSS files:</strong> Disabled</li>
<li><strong>Optimize JavaScript files:</strong> Disabled</li>
</ul>
</li>
<li>Click <em>Clear cached data</em>.</li>
</ul>
</li>
<li>Go to <em>Site building</em> -&gt; <em>Views</em> -&gt; <em>Tools</em>:
<ul>
<li>Check <em>Disable views data caching</em> and click <em>Save configuration</em>.</li>
<li>Click <em>Clear Views&#8217; cache</em>.</li>
</ul>
</li>
<li>Install the <a href="http://drupal.org/project/devel" rel="nofollow">Devel module</a>, and go to <em>Site Configuration</em> -&gt; <em>Devel settings</em>:
<ul>
<li>Check <em>Rebuild the theme registry on every page load</em> and click <em>Save configuration</em>.</li>
</ul>
</li>
<li>Add the following to your .module file to disable menu caching</li>
</ol>
<pre class="brush: php; title: ; notranslate">

function hook_init(){
   //FIXME: remove before going into production
   menu_rebuild();
}</pre>
<p>With this, now ALL caching in drupal will disabled. Enjoy quicker development &amp; don&#8217;t forget to undo these changes once your site goes into production!</p>
<img src="http://www.gaurishsharma.com/?ak_action=api_record_view&id=667&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.gaurishsharma.com/2012/01/getting-started-with-drupal-module-development.html' rel='bookmark' title='Getting Started with Drupal Module Development'>Getting Started with Drupal Module Development</a></li>
<li><a href='http://www.gaurishsharma.com/2011/12/enable-right-click-on-pages-where-its-been-disabled.html' rel='bookmark' title='Enable right-click on pages where its been disabled'>Enable right-click on pages where its been disabled</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gaurishsharma.com/2012/02/how-to-fully-disable-caching-in-drupal-7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started with Drupal Module Development</title>
		<link>http://www.gaurishsharma.com/2012/01/getting-started-with-drupal-module-development.html</link>
		<comments>http://www.gaurishsharma.com/2012/01/getting-started-with-drupal-module-development.html#comments</comments>
		<pubDate>Mon, 30 Jan 2012 17:36:45 +0000</pubDate>
		<dc:creator>gaurish</dc:creator>
				<category><![CDATA[Web - Drupal]]></category>

		<guid isPermaLink="false">http://www.gaurishsharma.com/?p=658</guid>
		<description><![CDATA[I am building a new site &#38; I have chosen to create that with Drupal. as you may know, Drupal is a popular open-source, free to use Content Management System but you may not know that Drupal also has a powerful framework which can be used to be built just about anything. This is done by <a href='http://www.gaurishsharma.com/2012/01/getting-started-with-drupal-module-development.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I am building a new site &amp; I have chosen to create that with <a href="http://drupal.org/">Drupal</a>. as you may know, Drupal is a popular open-source, free to use Content Management System but you may not know that Drupal also has a powerful framework which can be used to be built just about anything. This is done by creating custom modules. Now, as with other things the hardest part is to get started. so this post will deal on how to get started with Drupal development</p>
<h3>Learning Drupal Module Development</h3>
<p>In Drupal, Whatever you want to do. There is a modules for that! If not, then you have to write a custom module that accomplishes that.</p>
<p><strong>Introduction</strong></p>
<p>A Drupal module mainly consists of bunch of loosely coupled functions  written in procedural style(you can use some OO features though). some might ask why it&#8217;s not object-oriented, that because Drupal was written in the time when PHP didn&#8217;t support OOP &amp; lacked namespaces. Sadly, that hasn&#8217;t changed even when even now PHP does support full OOP including namespaces(PHP 5.3+).<br />
However, it is commendable on Drupal&#8217;s part that it managed to work around PHP&#8217;s limitations by adopting design such architecture.</p>
<p><strong>Hook System</strong></p>
<p>Hook System is nothing but a glorified naming convention adopted universally by Drupal Community. Infact, entire architecture of Drupal is build around this naming convention. According to this naming convention, the module name you choose must be unique, and should be all lowercase, containing only letters &amp; numbers, always starting with a letter. Within the module itself, all functions must then be prefixed with the module filename, followed by an underscore, and then action(called hook in drupal land) in following way</p>
<p>function ModuleName_action()</p>
<p>here,<br />
ModuleName = name of your module<br />
action = pre-defined hook</p>
<p>These hooks are pre-defined and are called automatically by Drupal when specific event occurs, so you just have to define an appropriate hook/action &amp; Drupal will take care of the rest. for example, your module was called &#8220;mymodule&#8221; &amp; want to add some help text. so, in custom module, you will add function named &#8220;<em>mymodule_help</em>&#8220;.</p>
<pre class="brush: php; title: ; notranslate">
/**
* This Implements hook_help()
*/
function mymodule_help($path, $arg){
    if($path=='admin/structure'){
        return t('This is the sample help text');
    }
}</pre>
<p>This function gets called automatically by Drupal when a page is displayed, then we check if <em>$path</em> is<em> admin/structure,</em> if yes. then the help text is displayed. Simple!</p>
<p>So, this was a 20,000 feet view to Drupal Modules. I hope now you have at least basic idea about Drupal&#8217;s hook system, how it works,why its build that way &amp; how go about writing custom modules. To end, I am leaving you with some resources that would guide you further on this journey of writing Drupal modules.</p>
<ul>
<li><a href="http://api.drupal.org/api/drupal">Drupal API reference site</a></li>
<li><strong>Books</strong>: I am reading &#8220;<a href="http://www.amazon.com/Definitive-Guide-Drupal-Apress/dp/1430231351">The Definitive Guide to Drupal 7</a>&#8220;, however there are <a href="http://drupal.org/books">lot of other options to chose from</a>.</li>
<li><a href="http://drupal.org/developing/modules">Building Drupal Module &#8211; Drupal.org Docs</a></li>
<li><a href="http://drupal.org/project/examples">Examples Project</a> &#8211; Standard repository of sample modules that can be used to learn module development,</li>
</ul>
<p>Good Luck &amp; have fun Drupalizing the web!</p>
<img src="http://www.gaurishsharma.com/?ak_action=api_record_view&id=658&type=feed" alt="" /><p>&nbsp</p>]]></content:encoded>
			<wfw:commentRss>http://www.gaurishsharma.com/2012/01/getting-started-with-drupal-module-development.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[JavaScript] Difference between eval() vs new Function()</title>
		<link>http://www.gaurishsharma.com/2012/01/javascript-difference-between-eval-vs-new-function.html</link>
		<comments>http://www.gaurishsharma.com/2012/01/javascript-difference-between-eval-vs-new-function.html#comments</comments>
		<pubDate>Sat, 28 Jan 2012 07:04:20 +0000</pubDate>
		<dc:creator>gaurish</dc:creator>
				<category><![CDATA[Web - JavaScript]]></category>

		<guid isPermaLink="false">http://www.gaurishsharma.com/?p=654</guid>
		<description><![CDATA[Many JavaScript programmers treat eval &#38; new Function construct as the same. But new Function &#38; eval are NOT the same. the important difference is:- eval() works within the current execution scope and can affect local variables. new Function() cannot affect local variables because the code runs in a separate scope So both are evil <a href='http://www.gaurishsharma.com/2012/01/javascript-difference-between-eval-vs-new-function.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Many JavaScript programmers treat eval &amp; new Function construct as the same. But new Function &amp; eval are NOT the same. the important difference is:-</p>
<ul>
<li><strong>eval()</strong> works within the current execution scope and can affect local variables.</li>
<li><strong>new Function() </strong>cannot affect local variables because the code runs in a separate scope</li>
</ul>
<p>So both are evil &amp; should only be used when there is no other way but as you may notice new Function is slightly less evil</p>
<img src="http://www.gaurishsharma.com/?ak_action=api_record_view&id=654&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.gaurishsharma.com/2010/12/javascript-5-things-love-hate.html' rel='bookmark' title='JavaScript: I hate you but I Love you, too'>JavaScript: I hate you but I Love you, too</a></li>
<li><a href='http://www.gaurishsharma.com/2011/04/javascript-bookmarklet-convert-all-text-on-page-into-lower-case.html' rel='bookmark' title='[JavaScript Bookmarklet] Convert All text on page into Lower Case'>[JavaScript Bookmarklet] Convert All text on page into Lower Case</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gaurishsharma.com/2012/01/javascript-difference-between-eval-vs-new-function.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Last day of 2011, I met  Dr A P J Abdul Kalam</title>
		<link>http://www.gaurishsharma.com/2011/12/on-last-day-of-2011-i-met-dr-a-p-j-abdul-kalam.html</link>
		<comments>http://www.gaurishsharma.com/2011/12/on-last-day-of-2011-i-met-dr-a-p-j-abdul-kalam.html#comments</comments>
		<pubDate>Sat, 31 Dec 2011 11:25:56 +0000</pubDate>
		<dc:creator>gaurish</dc:creator>
				<category><![CDATA[Editorial]]></category>
		<category><![CDATA[Me Myself and My Life]]></category>

		<guid isPermaLink="false">http://www.gaurishsharma.com/?p=641</guid>
		<description><![CDATA[2011 is coming to an end and 2012 is about to start. Like all new years I was thinking what special thing can I do &#8211;&#160;usually&#160;it means going to &#8220;cool&#8221; parties &#38; hanging out with my friends. But this year, I didn&#8217;t have anything planned as I didn&#8217;t want to do anything. &#160;As nothing ever <a href='http://www.gaurishsharma.com/2011/12/on-last-day-of-2011-i-met-dr-a-p-j-abdul-kalam.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>2011 is coming to an end and 2012 is about to start. Like all new years I was thinking what special thing can I do &#8211;&nbsp;usually&nbsp;it means going to &#8220;cool&#8221; parties &amp; hanging out with my friends. But this year, I didn&#8217;t have anything planned as I didn&#8217;t want to do anything. &nbsp;As nothing ever goes according to plans; so my &#8220;plan&#8221; of &#8220;no plan&#8221; flopped. Instead, on last day 2011 &#8211; 31 December, I met &nbsp;<a href="http://en.wikipedia.org/wiki/A._P._J._Abdul_Kalam">A. P. J. Abdul Kalam</a> who was 11th&nbsp;president&nbsp;of india.</p>
<p>Long story short, he came to our college and addressed us, so I saw &amp; hear him speak right in front of me. first thing I noticed he just another human being like us who gets annoyed when his hair get&nbsp;messed &amp; starts combing them right on stage in front of everyone! <img src='http://www.gaurishsharma.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>But there is few things I noticed though&nbsp;observing his actions,body language &amp; works, I want to share</p>
<ul>
<li><strong>Dreamer:</strong>&nbsp; He likes to dream BIG &amp; says &#8220;<em>Dream BIG, Aim High.&nbsp;Aiming small is a crime</em>.&#8221;.His final dream is to&nbsp;see India as a <em>Developed Nation</em>. Hence the reason that even after writing multiple books about India&#8217;s development, he still is coming out with a new Book &#8212; <a href="http://www.flipkart.com/books/0143417304?affid=INGAURISH">&nbsp;Target 3 Billion</a>. I don&#8217;t know if India will become a&nbsp;developed country but I suspect Kalam will&nbsp;&nbsp;keep coming out with more such books. I guess he enjoys writing</li>
<li><strong>On a Mission: </strong>While addressing the crowd, he told that last week he was in a village near&nbsp;Cochin, Kerala. before that he was in Delhi &amp; looking at this last year&#8217;s&nbsp;schedule. It seems he travels a lot. &nbsp;keep in mind that these are voluntary as his current job is of a professor/dean. the question is &#8212; a) Does he travel this much because he likes to meet people? or b) He is on a self initiated mission &amp; that mission requires him to travel so much &amp; meet all kinds of people? Don&#8217;t know what case it is but seems there is a bigger motive.</li>
<li><strong>Frank:</strong>&nbsp;He was the&nbsp;president of our country, one might expect him to be bit reserved &amp; not speak freely but he is frank &amp; to the point. Kalam says whatever he has in mind. for example, when a question when stretched&nbsp;too long &#8212; he simply said &#8220;woman, you are giving a lecture!&#8221; which shows that he is frank even with people that he hasn&#8217;t met before; <em>seedhi baat no bakwas</em>!</li>
<li><strong>Less&nbsp;Religion&nbsp;&amp; More Spirituality: </strong>During the interaction session, a question was asked related to <a href="http://en.wikipedia.org/wiki/Shi'a%E2%80%93Sunni_relations">shia vs sunni</a>&nbsp; sects(not sure exactly what it was, as the ascent of the girl asking the difficult to gasp). Anyways, the muslim girl belonging to the some gulf country who asked the question did mention in her question that&nbsp;kalam is a muslin.&nbsp;&nbsp;Unlike other questions where he took keen interest &amp; in this case his facial expression were that of a &nbsp;&#8221;disinterested&#8221; person &amp; stated that his name is arabic. And while he always interested in talking about spirituality in his books, talk etc. It seems that he is not interested in the whole Caste System or&nbsp;religion&nbsp;thing which is a good thing if you ask me! btw, do remember I said he looked&nbsp;disinterested. But any of his actions it didn&#8217;t seem that he hated any religion or loved another. I got an impression that he was more interested in other&nbsp;topics.</li>
<li><strong>More abstractions, less&nbsp;practicability: </strong>Dr&nbsp;Kalam talks meta &#8211; instead of giving straightforward answers, he likes to go deep. For example, when a boy asks him a simple questions &#8212; How to be confident? instead of providing him a straight answer, he recites him some&nbsp;poem. &nbsp;And during our interaction, he talked so deep that many of my friends were bored to death which is something he should consider improving on. However, I being a deep thinker myself like going deep &#8211; so I enjoyed his talk &amp; was able to understand gist of what he said.</li>
<li><strong>Likes Poetry:</strong>&nbsp; Kalam likes&nbsp;Poetry&nbsp;so much that he even made us recite few lines along with him. It was bit silly but was fun <img src='http://www.gaurishsharma.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </li>
<li><strong>Political system is broken: </strong>Like everyone, he too knows that indian politicians are all corrupt, care about their personnel wealth than nations progress. Basically,the whole system is broken. That&#8217;s why he even encouraged all the students to join politics. But Mr Kalam, Thanks but no thanks <img src='http://www.gaurishsharma.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>Further, I will share &nbsp;4 thing&nbsp;that he said are needed&nbsp;if someone wants to achieve success:</p>
<ol>
<li>Aim High</li>
<li>Do Hard work</li>
<li>Continuously&nbsp;gaining&nbsp;knowledge&nbsp;throughout your life by books or teachers.</li>
<li>Perseverance: Steady&nbsp;persistence&nbsp;in&nbsp;a&nbsp;course&nbsp;of&nbsp;action,&nbsp;apurpose,&nbsp;a&nbsp;state</li>
</ol>
<p>lastly, I am not too sure about accuracy &amp; there may be errors in my observations, mostly because I little distracted &amp; did lot of bird-watching&#8230;lol!&nbsp;But In all seriousness, I do&nbsp;appreciate&nbsp;the work kalam has done &amp; is still doing for the country. He seemed quite&nbsp;patriotic. It was a nice&nbsp;experience&nbsp;to the 11th&nbsp;president&nbsp;of&nbsp;India on last day of 2011!</p>
<p>Hopefully, people will draw&nbsp;inspiration&nbsp;from him/his work &amp; embark on struggle to make&nbsp;India&nbsp;a developed country!</p>
<h3 style="text-align: center;">Wish you Happy New Year 2012!</h3>
<p><em>[Update]<br />
Corrected 4 mantras for success, Thanks <strong>Preeti</strong></em></p>
<img src="http://www.gaurishsharma.com/?ak_action=api_record_view&id=641&type=feed" alt="" /><p>&nbsp</p>]]></content:encoded>
			<wfw:commentRss>http://www.gaurishsharma.com/2011/12/on-last-day-of-2011-i-met-dr-a-p-j-abdul-kalam.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Enable right-click on pages where its been disabled</title>
		<link>http://www.gaurishsharma.com/2011/12/enable-right-click-on-pages-where-its-been-disabled.html</link>
		<comments>http://www.gaurishsharma.com/2011/12/enable-right-click-on-pages-where-its-been-disabled.html#comments</comments>
		<pubDate>Thu, 29 Dec 2011 10:46:03 +0000</pubDate>
		<dc:creator>gaurish</dc:creator>
				<category><![CDATA[Web - JavaScript]]></category>

		<guid isPermaLink="false">http://www.gaurishsharma.com/?p=637</guid>
		<description><![CDATA[My bank has a stupidly disabled right-click on its website which I don&#8217;t like. So I created clever JavaScript bookmarket to disable this restriction Remove disable right-click restriction Drag the above link to bookmarks bar &#38; click on this when you want to enable right-click on pages where its been disabled! here is the code: <a href='http://www.gaurishsharma.com/2011/12/enable-right-click-on-pages-where-its-been-disabled.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>My bank has a stupidly disabled right-click on its website which I don&#8217;t like.</p>
<div id="attachment_638" class="wp-caption aligncenter" style="width: 160px"><a href="http://www.gaurishsharma.com/wp-content/uploads/2011/12/Capture.png"><img class="size-thumbnail wp-image-638" title="No Right-Click Allowed" src="http://www.gaurishsharma.com/wp-content/uploads/2011/12/Capture-150x150.png" alt="No Right-Click Allowed" width="150" height="150" /></a><p class="wp-caption-text">No Right-Click Allowed</p></div>
<p>So I created clever JavaScript bookmarket to disable this restriction</p>
<h2><a href="javascript:void(document.oncontextmenu=null)">Remove disable right-click restriction</a></h2>
<p>Drag the above link to bookmarks bar &amp; click on this when you want to enable right-click on pages where its been disabled!</p>
<p>here is the code:</p>
<pre class="brush: jscript; title: ; notranslate">
javascript:void(document.oncontextmenu=null)
</pre>
<img src="http://www.gaurishsharma.com/?ak_action=api_record_view&id=637&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.gaurishsharma.com/2011/04/javascript-bookmarklet-convert-all-text-on-page-into-lower-case.html' rel='bookmark' title='[JavaScript Bookmarklet] Convert All text on page into Lower Case'>[JavaScript Bookmarklet] Convert All text on page into Lower Case</a></li>
<li><a href='http://www.gaurishsharma.com/2011/03/workaround-for-youtube-flash-bug-video-displayed-in-weird-colors.html' rel='bookmark' title='Workaround for Youtube Flash Bug | Video displayed in weird colors'>Workaround for Youtube Flash Bug | Video displayed in weird colors</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gaurishsharma.com/2011/12/enable-right-click-on-pages-where-its-been-disabled.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Truth behind Petrol price in India</title>
		<link>http://www.gaurishsharma.com/2011/11/truth-behind-petrol-price-in-india.html</link>
		<comments>http://www.gaurishsharma.com/2011/11/truth-behind-petrol-price-in-india.html#comments</comments>
		<pubDate>Thu, 03 Nov 2011 18:04:31 +0000</pubDate>
		<dc:creator>gaurish</dc:creator>
				<category><![CDATA[Editorial]]></category>

		<guid isPermaLink="false">http://www.gaurishsharma.com/?p=620</guid>
		<description><![CDATA[Media has been constantly talking about rising crude oil prices and how the Govt is facing losses. Take a look this simple maths to check if they are right or wrong: 1) Currently, International crude oil prices are around US$ 109 per barrel or Rs.5,360/- INR. $1 = Rs49.17 current exchange rate 2) Each barrel <a href='http://www.gaurishsharma.com/2011/11/truth-behind-petrol-price-in-india.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Media has been constantly talking about rising crude oil prices and how the Govt is facing losses.</p>
<p>Take a look this simple maths to check if they are right or wrong:</p>
<p>1) Currently, International crude oil prices are around US$ <em>109</em> per barrel or Rs.5,360/- INR. $1 = Rs49.17 current exchange rate<br />
2) Each barrel contains about <em>158.76 litres</em> of oil.<br />
3) crude oil costs R<em>s33.76</em> per lite(<em>5360/158.76</em>) + add the cost of refining it to petrol which is <em>6.52 paise per litre</em> + cost of transportation (Rs 6) + petrol pump&#8217;s commission (Rs 1.05) = <strong>47.33(Total cost)</strong></p>
<p>so, <strong>price should Rs47.33/L</strong> but Govt charged price is Rs73/L&#8230;how? well, rest all are Taxes imposed by our own Govt!!</p>
<p>Bhai, It seems you have fallen victim of this media created propaganda! Govt is NOT losing money, instead the earn thousands of crores in taxes on petrol!!!</p>
<p>Wake UP India, Don&#8217;t get confused!</p>
<img src="http://www.gaurishsharma.com/?ak_action=api_record_view&id=620&type=feed" alt="" /><p>&nbsp</p>]]></content:encoded>
			<wfw:commentRss>http://www.gaurishsharma.com/2011/11/truth-behind-petrol-price-in-india.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[php] Calculate Age in Days</title>
		<link>http://www.gaurishsharma.com/2011/10/php-calculate-age-in-days.html</link>
		<comments>http://www.gaurishsharma.com/2011/10/php-calculate-age-in-days.html#comments</comments>
		<pubDate>Sat, 01 Oct 2011 16:48:36 +0000</pubDate>
		<dc:creator>gaurish</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.gaurishsharma.com/?p=622</guid>
		<description><![CDATA[Just today while driving back home, a random question came across my mind, What is my age in number days? Now, I am not good at maths to figure it out manually but since I am decent php programmer, I wrote this small code snippet which helps calculate my age counting in terms days. And its just <a href='http://www.gaurishsharma.com/2011/10/php-calculate-age-in-days.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Just today while driving back home, a random question came across my mind,</p>
<h2>What is my age in number days?</h2>
<p>Now, I am not good at maths to figure it out manually but since I am decent php programmer, I wrote this small code snippet which helps calculate my age counting in terms days. And its just one line!</p>
<pre class="brush: php; title: ; notranslate">
$birthday = '1989-03-06';
$now = date(&quot;Y-m-d&quot;);
echo 'You are '. date_diff(date_create($birthday), date_create($now))-&gt;format('%a days old');
</pre>
<p>So according to this,<br />
<strong>Today is the 8,244th day of my life</strong>. Cheers! <img src='http://www.gaurishsharma.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<img src="http://www.gaurishsharma.com/?ak_action=api_record_view&id=622&type=feed" alt="" /><p>&nbsp</p>]]></content:encoded>
			<wfw:commentRss>http://www.gaurishsharma.com/2011/10/php-calculate-age-in-days.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[How To] Track Tweets &amp; Likes through Google Analytics</title>
		<link>http://www.gaurishsharma.com/2011/08/measuring-tweets-likes-google-analytics.html</link>
		<comments>http://www.gaurishsharma.com/2011/08/measuring-tweets-likes-google-analytics.html#comments</comments>
		<pubDate>Thu, 18 Aug 2011 10:47:10 +0000</pubDate>
		<dc:creator>gaurish</dc:creator>
				<category><![CDATA[Web - JavaScript]]></category>

		<guid isPermaLink="false">http://www.gaurishsharma.com/?p=610</guid>
		<description><![CDATA[Google Analytics (GA)&#160;is a free service offered by&#160;Google&#160;that generates detailed&#160;statistics&#160;about the visitors to a&#160;website. Its hugely popular tool which is used&#160;&#160;57% of the 10,000 most popular websites on the currently, the list includes Twitter,myspace etc. GA tracks visitors &#38; provides you useful information such as Traffic source: If it was direct traffic, Purchased traffic via <a href='http://www.gaurishsharma.com/2011/08/measuring-tweets-likes-google-analytics.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><strong>Google Analytics (GA)</strong>&nbsp;is a free service offered by&nbsp;<a title="Google" href="http://en.wikipedia.org/wiki/Google">Google</a>&nbsp;that generates detailed&nbsp;<a title="Statistics" href="http://en.wikipedia.org/wiki/Statistics">statistics</a>&nbsp;about the visitors to a&nbsp;<a title="Website" href="http://en.wikipedia.org/wiki/Website">website</a>. Its hugely popular tool which is used&nbsp;&nbsp;57% of the 10,000 most popular websites on the currently, the list includes Twitter,myspace etc. GA tracks visitors &amp; provides you useful information such as</p>
<ul>
<li><strong>Traffic source</strong>: If it was direct traffic, Purchased traffic via Ads or some other source</li>
<li><strong>Information about Visitor</strong>: Their IP Address, country,&nbsp;Browser,time spend on site &amp; lots of other information that could help you understand your visitors</li>
<li>And lots of other such useful bits of information.</li>
</ul>
<div>What GA could not track until recently was social&nbsp;engagement, if someone click Like button,tweets or shared your site on social network. How do you track it? by default that social media traffic would be shown as DIRECT traffic which is not what you want. &nbsp;But good news is Google&nbsp;analytics now support this and they are calling this <em>_trackSocial</em> method</div>
<div>
<p>the syntax is as follows:<span id="more-610"></span></p>
<ul>
<ul>_trackSocial(network, socialAction, opt_target, opt_pagePath)</ul>
</ul>
<p>Where:</p>
<ul>
<ul>
<ol>
<li><strong>Network</strong>: Name of the social network ( facebook, twitter, etc)</li>
<li><strong>SocialAction</strong>: Type of action (like, tweet, send,)</li>
<li><strong>opt_target</strong>: Subject of the action being taken. Optional, defaults to the URL being shared (document.location.href). Can be manually set to anything: a different URL (if they’re sharing content that “points” to another URL), an entity (e.g, product name, article name), or content ID</li>
<li><strong>opt_pagePath</strong>: The page on which the action occurred. Optional, defaults to the URI where the sharing took place (document.location.pathname). Can be manually set (like a virtual pagename).</li>
</ol>
</ul>
</ul>
</div>
<div>I was tasked to implement this feature on a client website, so they can see&nbsp;social interactions in Google Analytics. here is how I did it:</div>
<h2>Basics</h2>
<p>Facebook &amp; twitter does not want to share their data with Google but it seems google has figured out a way. &nbsp;basically, &nbsp;<em>_trackSocial</em> i sJavaScript based integration &amp; Its not that complex. what we gotta do is to bind callback functions to javascript events. these events could facebook&nbsp;like/unlike, facebook send &amp; twitter tweet. These callback function would be then invoked whenever user generated an social media related event. using this function callback GA script knows that action of tweeting,liking has taken place &amp; GA sent sents the tracking beacon.</p>
<h2>What you need</h2>
<ul>
<li>Google Chrome&nbsp;Browser</li>
<li>&nbsp;<a title="Google Analytics Debugger (by Google)" href="https://chrome.google.com/webstore/detail/jnkmfdileelhofjcijamephohjechhna">Google&nbsp;Analytics&nbsp;Debug Extension</a></li>
<li>Basic JavaScript knowledge</li>
</ul>
<h3>The Process:</h3>
<p>Read the <a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingSocial.html">Google supplied guide</a> which describes how to use Google Analytics to get interaction metrics on non-Google networks such as Facebook and Twitter &amp; now there the script which you have to embed on the page you need to track social integration</p>
<p><script src="https://gist.github.com/1153813.js?file=gistfile1.js"></script> </p>
<img src="http://www.gaurishsharma.com/?ak_action=api_record_view&id=610&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.gaurishsharma.com/2009/02/secure-your-google-account.html' rel='bookmark' title='Secure Your Google Account'>Secure Your Google Account</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gaurishsharma.com/2011/08/measuring-tweets-likes-google-analytics.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3 Tips for writing good Code</title>
		<link>http://www.gaurishsharma.com/2011/07/3-tips-for-writing-good-code.html</link>
		<comments>http://www.gaurishsharma.com/2011/07/3-tips-for-writing-good-code.html#comments</comments>
		<pubDate>Thu, 28 Jul 2011 13:20:59 +0000</pubDate>
		<dc:creator>gaurish</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.gaurishsharma.com/?p=600</guid>
		<description><![CDATA[Often when I look other people&#8217;s code, I feel like vomiting. Why? Because most of the time the code is badly written, has bugs &#38; is hard to read. so what is it that makes up &#8220;good code&#8221;. some might say: good code = easier to read + lot of comments. Sure, readability is important but its last <a href='http://www.gaurishsharma.com/2011/07/3-tips-for-writing-good-code.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Often when I look other people&#8217;s code, I feel like vomiting. Why? Because most of the time the code is badly written, has bugs &amp; is hard to read. so what is it that makes up &#8220;good code&#8221;. some might say:</p>
<blockquote><p>good code = easier to read + lot of comments.</p></blockquote>
<p>Sure, readability is important but its last thing on my list.</p>
<p>what are the 3 most important things for writing &#8220;good code&#8221;?</p>
<ol>
<li><strong>Expect the unexpected</strong>: Sounds oxymoron? But that&#8217;s what you got to do: Expect all cases. Practically what this means is you have to do error handling &amp; validation at every step of program. Example, Don&#8217;t just assume connection to database works now, so it will work forever. if you are passing a type array to a class method, don&#8217;t assume in that method will receive that argument of array type,. things can go wrong anytime. Always be prepared to <em>Expect Everything! Check Everything</em></li>
<li><strong>Exploit your own code</strong>: As programmers our mind always focuses on how to make things work which is fine but this leads so to locked mindset; trained to think in just one way. This is specially bad from security standpoint. An Excellent example is bug in opensource <a href="http://www.schneier.com/blowfish-bug.txt">blowfish C Libary</a>. This bug existed from 1998, nearly 13years in which hundreds of highly talented developers must have looked at the code &amp; yet not noticed the bug. Wonder Why? Because when reading the code, we are reading the programmers indent instead of actually seeing what the code is doing. What we should be doing is trying to break our own code: think of all possible way you can bypass &amp; do something dangerous. essentially think like a cracker/hacker. If you can&#8217;t develop that mindset &#8212; make sure atleast one person from your team can</li>
<li><strong>Never Trust the Client: </strong><em>never ever trust the client!</em> By client I mean web browser etc. This means any data retuned from functions you have written in javascript have to  validated again server side. Don&#8217;t trust any data that is sent by client &amp; always sanitize your inputs. Because people can modify headers, edit form values, change javascript logic completely. so its very important that you always double-check everything on server &amp; make sure its what you expect.developers should treat web browsers as hostile environment over which they have partial non-exclusive control.</li>
</ol>
<div>So these were my 3 tips for writing <em>good code</em>. The others can be Better Docs,making code readable, performance but the Above 3 according to me are most important.  What you think? Let your thought in comments below</div>
<img src="http://www.gaurishsharma.com/?ak_action=api_record_view&id=600&type=feed" alt="" /><p>&nbsp</p>]]></content:encoded>
			<wfw:commentRss>http://www.gaurishsharma.com/2011/07/3-tips-for-writing-good-code.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MumBai Terror Attacks &amp; why I love technology!</title>
		<link>http://www.gaurishsharma.com/2011/07/mumbai-blast-why-i-love-technology.html</link>
		<comments>http://www.gaurishsharma.com/2011/07/mumbai-blast-why-i-love-technology.html#comments</comments>
		<pubDate>Wed, 13 Jul 2011 21:22:01 +0000</pubDate>
		<dc:creator>gaurish</dc:creator>
				<category><![CDATA[Myself and My Life]]></category>

		<guid isPermaLink="false">http://www.gaurishsharma.com/?p=592</guid>
		<description><![CDATA[In between chaos created by bomb blasts in Mumbai &#38; news channels constantly flashing horrific images in name of &#8220;live reporting&#8221;, there is some other related news which caught my eye. Delhi resident Nitin Sagar created a public spreadsheet on Google Docs(Now taken offline) where anyone willing to help Mumbai blast victims can give their <a href='http://www.gaurishsharma.com/2011/07/mumbai-blast-why-i-love-technology.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>In between chaos created by <a href="http://www.bbc.co.uk/news/world-south-asia-14141454">bomb blasts in Mumbai</a> &amp; news channels constantly flashing <a href="http://ibnlive.in.com/photogallery/4398-7.html">horrific images</a> in name of &#8220;live reporting&#8221;, there is some other<a href="http://technolog.msnbc.msn.com/_news/2011/07/13/7075543-google-docs-connect-mumbai-after-blasts"> related news which caught my eye</a>.</p>
<p>Delhi resident Nitin Sagar created a <a href="https://spreadsheets.google.com/spreadsheet/lv?hl=en_US&amp;key=tE-okpwwYgQavia5opgZSEA&amp;hl=en_US&amp;f=true&amp;gid=9">public spreadsheet</a> on Google Docs(<em>Now taken offline</em>) where anyone willing to help Mumbai blast victims can give their contact details &amp; list things they are willing to do for helping. Shortly after that, it got <a href="https://twitter.com/#!/nitinsgr/status/91154218458689536">retweeted like crazy</a> &amp; gone <a href="http://www.ndtv.com/article/india/online-mumbai-offers-rides-shelter-to-strangers-119121">viral</a></p>
<p><a href="http://www.gaurishsharma.com/wp-content/uploads/2011/07/capture.jpg"><img class="aligncenter size-medium wp-image-593" title="capture" src="http://www.gaurishsharma.com/wp-content/uploads/2011/07/capture-300x219.jpg" alt="" width="300" height="219" /></a></p>
<p>Several users have offered overnight house stays, the use of their car, and listed their blood types under the #here2help tab. The spreadsheet also has #needhelp, Blood group, Missing, and Injured tabs which residents are still filling out. serendipity of finding that there are hundreds of people more than willing to offer you place to stay, donate blood,free rides, give money is amazing. It Certainly reinforces that humanity is not dead.</p>
<p>This is where technology can play its part to connect people &#8212; instantly &amp; spontaneously. Like in this case,  tools like Twitter,Google Docs have organize an ongoing rescue effort where people are helping each other without help from Govt which you can see by this <a href="http://maps.google.com/maps/ms?msa=0&amp;msid=211457129268955422608.0004a7f5c67df8e1275c1&amp;ie=UTF8&amp;ll=19.07315,72.863388&amp;spn=0.227132,0.315857&amp;z=11&amp;source=embed">map of tweet users in mumbai</a>. This allowed every person with internet connection to add their tiny bit.</p>
<p>This exactly why I love technology! Technology enables normal people to do great things.</p>
<h3 style="text-align: center;"><strong>We are for Peace, ALWAYS!</strong></h3>
<img src="http://www.gaurishsharma.com/?ak_action=api_record_view&id=592&type=feed" alt="" /><p>&nbsp</p>]]></content:encoded>
			<wfw:commentRss>http://www.gaurishsharma.com/2011/07/mumbai-blast-why-i-love-technology.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

