<?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>maSnun&#039;s logs &#187; humour</title>
	<atom:link href="http://masnun.com/blog/tag/humour/feed/" rel="self" type="application/rss+xml" />
	<link>http://masnun.com/blog</link>
	<description>Personal Blog of maSnun</description>
	<lastBuildDate>Sat, 24 Jul 2010 04:33:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Decoding Google&#039;s Tweet With PHP</title>
		<link>http://masnun.com/blog/2009/09/05/decoding-googles-tweet-with-php/</link>
		<comments>http://masnun.com/blog/2009/09/05/decoding-googles-tweet-with-php/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 06:30:57 +0000</pubDate>
		<dc:creator>masnun</dc:creator>
				<category><![CDATA[Blog Post]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[humour]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://masnun.com/?p=549</guid>
		<description><![CDATA[This is something for fun &#8212; nothing serious. It just happened that Google just sent a mysterious Tweet around 2 hours ago from now with an image with of the Google home page featuring an UFO. The UFO was seen &#8230; <a href="http://masnun.com/blog/2009/09/05/decoding-googles-tweet-with-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is something for fun &#8212; nothing serious. It just happened that Google just sent a <a href="http://twitter.com/google/status/3772868874">mysterious Tweet </a> around 2 hours ago from now with an image with of the Google home page featuring an UFO. The UFO was seen pulling an O out of the google logo. But what the heck does that tweet mean ?</p>
<p><strong>1.12.12 25.15.21.18 15 1.18.5 2.5.12.15.14.7 20.15 21.19 </strong> was the tweet.</p>
<p>Well, it&#8217;s nothing tough. Every number separated by a dot or space corresponds to the alphabet. So, I wrote a PHP script to decode this mysterious tweet and finally found the meaning:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
masnun<span style="color: #000000; font-weight: bold;">@</span>ubuntu:~<span style="color: #000000; font-weight: bold;">/</span>Desktop$ php decode-google-tweet
all your o are belong to us
masnun<span style="color: #000000; font-weight: bold;">@</span>ubuntu:~<span style="color: #000000; font-weight: bold;">/</span>Desktop$</pre></div></div>

<p>So, it meant <b>&#8221; all your o are belong to us &#8221; </b> <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
Sounds a bit odd ? Or wrong in grammar ? yeah, still, that&#8217;s the message. It is confirmed on the twitpic image.</p>
<p>And here&#8217;s the source code &#8211;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$num</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// placeholder for 1 to 26</span>
<span style="color: #000088;">$alpha</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// placeholder for a to z</span>
&nbsp;
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">27</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$num</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// dynamically store 1 to 26 in the array</span>
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'a'</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #0000ff;">'z'</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$alpha</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// dynamically store a to y in the array</span>
<span style="color: #000088;">$alpha</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'z'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// manually add z to the array</span>
<span style="color: #000088;">$dict</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_combine</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$num</span><span style="color: #339933;">,</span><span style="color: #000088;">$alpha</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// combine them to form a dictionary</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// print_r($dict);</span>
&nbsp;
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;1.12.12 25.15.21.18 15 1.18.5 2.5.12.15.14.7 20.15 21.19&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// the code to decode</span>
<span style="color: #000088;">$arr</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// differentiate the parts</span>
&nbsp;
<span style="color: #000088;">$meaning</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// placeholder for the ultimate meaning</span>
&nbsp;
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span>count<span style="color: #009900;">&#40;</span><span style="color: #000088;">$arr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$s</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$arr</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// dot seperated portions</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$s</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// seperate the numbers</span>
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$j</span><span style="color: #339933;">&lt;</span>count<span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$j</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// get individual numbers</span>
<span style="color: #000088;">$meaning</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$dict</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// look up in the dictionary for the corresponding char</span>
 <span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$meaning</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// restore the spaces</span>
&nbsp;
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$meaning</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// echo the meaning</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>It was quite a bit of fun decoding the message with PHP. Well, I do agree that there was no need to use PHP here. But why do the hard work from memory when you have automation tools at your hand <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ?</p>
]]></content:encoded>
			<wfw:commentRss>http://masnun.com/blog/2009/09/05/decoding-googles-tweet-with-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Twitter OAuth Fun :D</title>
		<link>http://masnun.com/blog/2009/08/29/twitter-oauth-fun-d/</link>
		<comments>http://masnun.com/blog/2009/08/29/twitter-oauth-fun-d/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 00:33:12 +0000</pubDate>
		<dc:creator>masnun</dc:creator>
				<category><![CDATA[Blog Post]]></category>
		<category><![CDATA[humour]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://masnun.com/?p=467</guid>
		<description><![CDATA[My University is off for about a month and I am thinking of passing this huge time in some sort of productive work. I love coding and experimenting. Twitter and PHP being my favourites, I decided to check out the &#8230; <a href="http://masnun.com/blog/2009/08/29/twitter-oauth-fun-d/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My University is off for about a month and I am thinking of passing this huge time in some sort of productive work. I love coding and experimenting. Twitter and PHP being my favourites, I decided to check out the Twitter API and cook something up with PHP. I have already used the Basic Authentication API calls in the past (to develop the twitter mobile publisher at <a href="http://masnun.com/twitter/">http://masnun.com/twitter/</a> which is my major tool to tweet while I am on the go). This time I decided to try the OAuth API mainly for two reasons &#8212; 1) I need to explore the OAuth system and 2) I have a project coming on based on the twitter OAuth API.</p>
<p>So, I started studying the Twitter OAuth API and learnt it pretty well. Then I thought what kind of application I could build with this very newly gathered knowledge ? Why not make some fun ? Yeah, I just can&#8217;t help making fun every now and then.</p>
<p>Finally, here it is &#8212; <a href="http://masnun.com/twitter-app/">http://masnun.com/twitter-app/</a> <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It&#8217;s a little devil app that automatically takes you to the authorization URL and asks for OAuth based authentication. If you allow it, it will automatically make a tweet using your account. The tweet will be nothing bad though, just a link back to the app <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>To develop this app, I have used the official Twitter OAuth library for PHP written by Abraham. <strong>Download it: </strong>  <a href="http://github.com/abraham/twitteroauth">http://github.com/abraham/twitteroauth</a> .</p>
<p><strong>Points to Ponder:</strong></p>
<ul>
<li>An application can do almost anything to your twitter account once you approve it.</li>
<li>Twitter says, the access token they provide doesn&#8217;t expire. That means once you approve an application, it can use your account forever if they are clever enough to store your access token details.</li>
<li>While approving an application, you never know what kind of permission the application has &#8212; read only or read-write both. I think this option should be left upon the users. The users should be able to choose whether he wants to provide write access or not.</li>
</ul>
<p>I have seen some web sites exploit Twitter accounts. TweeterFollow is a decent example of such nasty practices. Once you provide your credentials, they&#8217;ll regularly tweet their links from your account. So think twice before you approve an application though OAuth is safer than providing password since you can choose to withdraw your permission to an application.</p>
<p>I will write detailed about OAuth and provide the source code in another post. Just now, I am feeling extremely sleepy. Woke up to have my Sehri and didn&#8217;t return to bed. It&#8217;s time I had a nap&#8230; <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://masnun.com/blog/2009/08/29/twitter-oauth-fun-d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Secrets of Women&#039;s Language</title>
		<link>http://masnun.com/blog/2009/08/01/the-secrets-of-womens-language/</link>
		<comments>http://masnun.com/blog/2009/08/01/the-secrets-of-womens-language/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 09:45:42 +0000</pubDate>
		<dc:creator>masnun</dc:creator>
				<category><![CDATA[Blog Post]]></category>
		<category><![CDATA[humour]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://masnun.com/?p=391</guid>
		<description><![CDATA[The Secrets of Women&#8217;s Language &#8230; a must-read for any man. Keywords and their meanings: &#8220;Fine&#8221;: This is the word ladies use at the end of any argument that they feel they are right about but need to shut you &#8230; <a href="http://masnun.com/blog/2009/08/01/the-secrets-of-womens-language/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1><strong>The Secrets of Women&#8217;s Language</strong></h1>
<h2>&#8230;  a must-read for any man. </h2>
<p>Keywords and their meanings:</p>
<p><strong> &#8220;Fine&#8221;:</strong> This is the word ladies use at the end of any argument that they feel they are right about but need to shut you up. NEVER use &#8220;Fine&#8221; to describe<br />
how a woman looks. This will cause you to have one of those arguments.</p>
<p><strong> &#8220;Five minutes&#8221;: </strong>This is half an hour. It is equivalent to the five<br />
minutes that your football game is going to last before you take out the<br />
trash, so it&#8217;s an even trade.</p>
<p><strong> &#8220;Nothing&#8221;: </strong>This means something, and you should be on your toes.<br />
&#8220;Nothing&#8221; is usually used to describe the feeling a woman has of wanting<br />
to turn you inside out, upside down, and backwards.<br />
&#8220;Nothing&#8221; usually signifies an argument that will last &#8220;Five Minutes&#8221;<br />
and end with the word &#8220;Fine.&#8221;<br />
<strong><br />
&#8220;Go Ahead&#8221; (with raised eyebrows): </strong>This is a dare. One that will result<br />
in a woman getting upset over &#8220;Nothing&#8221; and will end with the word<br />
&#8220;Fine.&#8221;<br />
<strong><br />
&#8220;Go Ahead&#8221; (normal eyebrows):</strong> This means &#8220;I give up&#8221; or &#8220;Do what you<br />
want, because I don&#8217;t care.&#8221;  You will get a raised eyebrow &#8220;Go ahead&#8221;<br />
in just a few minutes, followed by &#8220;Nothing&#8221; and &#8220;Fine&#8221; and she will<br />
talk to you in about &#8220;Five Minutes&#8221; when she cools off.</p>
<p><strong> &lt;Loud Sigh&gt;:</strong> This is not actually a word, but is still often a verbal<br />
statement very misunderstood by men. A &#8220;Loud Sigh&#8221; means she thinks you<br />
are an idiot at that moment and wonders why she is wasting her time<br />
standing here and arguing with you over &#8220;Nothing.&#8221;<br />
<strong><br />
&lt;Soft Sigh&gt;: </strong>Again, not a word, but a verbal statement. &#8220;Soft Sighs&#8221;<br />
are one of the few things that some men actually understand. She is<br />
content. Your best bet is to not move or breathe, and she will stay<br />
content.</p>
<p><strong> &#8220;Oh&#8221;: </strong>This word followed by any statement is trouble. Example: &#8220;Oh, let<br />
me get that.&#8221; Or, &#8220;Oh, I talked to him about what you were doing last<br />
night.&#8221; If she says &#8220;Oh&#8221; before a statement, RUN, do not walk, to the<br />
nearest exit. She will tell you that she is &#8220;Fine&#8221; when she is done<br />
tossing your clothes out the window, but do not expect her to talk to<br />
you for at least 2 days. &#8220;Oh,&#8221; as the lead to a sentence, usually<br />
signifies that you are caught in a lie. Do not try to lie more to get<br />
out of it, or you will get raised eyebrows &#8220;Go ahead&#8221; followed by acts<br />
so unspeakable that we can&#8217;t bring ourselves to write about them.</p>
<p><strong> &#8220;That&#8217;s Okay&#8221;: </strong>This is one of the most dangerous statements that a<br />
woman can say to a man. &#8220;That&#8217;s Okay&#8221; means that she wants to think long<br />
and hard before paying you retributions for whatever it is that you have<br />
done. &#8220;That&#8217;s Okay&#8221; is often used with the word &#8220;Fine&#8221; and used in<br />
conjunction with a raised eyebrow &#8220;Go ahead.&#8221; At some point in the near<br />
future when she has plotted and planned, you are going to be in some<br />
mighty big trouble.<br />
<strong><br />
&#8220;Please Do&#8221;: </strong>This is not a statement; it is an offer. A woman is giving<br />
you the chance to come up with whatever excuse or reason you have for<br />
doing whatever it is that you have done. You have a fair chance to tell<br />
the truth, so be careful, and you shouldn&#8217;t get a &#8220;That&#8217;s Okay&#8221;.</p>
<p><strong> &#8220;Thanks&#8221;:</strong> A woman is thanking you. Do not faint; just say you&#8217;re<br />
welcome.</p>
<p><strong> &#8220;Thanks a lot&#8221;: </strong>This is much different from &#8220;Thanks&#8221;. A woman will say,<br />
&#8220;Thanks a lot&#8221; when she is really ticked off at you. It signifies that<br />
you have hurt her in some callous way, and will be followed by the &#8220;Loud<br />
Sigh.&#8221; Be careful not to ask what is wrong after the &#8220;Loud Sigh&#8221;, as she<br />
will only tell you &#8220;Nothing.&#8221;<br />
 <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://masnun.com/blog/2009/08/01/the-secrets-of-womens-language/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
