<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>Munim .NET //everything starts simple</title><generator>Tumblr (3.0; @munim)</generator><link>http://munim.tumblr.com/</link><item><title>Rounding decimal value to 0.0 or 0.5</title><description>&lt;!-- blockquote {  font-family: Consolas, Lucida Console, Courier New; } --&gt;
&lt;p&gt;Today morning I was need to convert values ranging 0.0 to 1.0 where rounding will be necessary 0.0 or 0.5. For instance, if your original value 7.3 it should be floored to 7.0 and on the other hand if your value is 7.8 it should be floored to 7.5.&lt;/p&gt;
&lt;p&gt;The original code was written by Indian developers where they thousands if-else conditions like&lt;/p&gt;
&lt;blockquote&gt;if (value &amp;gt;= 0.0 &amp;amp;&amp;amp; value &amp;lt; 0.5)&lt;br/&gt;      return 0.0;&lt;br/&gt; else if (value &amp;gt;= 0.5 &amp;amp;&amp;amp; value &amp;lt; 1.0)&lt;br/&gt;      return 0.5;&lt;br/&gt; else if (value &amp;gt;= 1.0 &amp;amp;&amp;amp; value &amp;lt; 1.5)&lt;br/&gt;      return 1.0;&lt;br/&gt; -&lt;br/&gt; -&lt;br/&gt; -&lt;br/&gt; else if (value &amp;gt;= 99.5 &amp;amp;&amp;amp; value &amp;lt; 100.0)&lt;br/&gt;      return 100;&lt;/blockquote&gt;
&lt;p&gt;This is one of the worst code ever written but many people do. I have written a function with some mathematical derivatives to solve the problem in 2 lines of code.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;        public static decimal RoundToPointFive(decimal value)&lt;br/&gt;        {&lt;br/&gt;            var intValue = ((int) value);&lt;br/&gt;            return intValue + (Math.Round(value%intValue)*(decimal) 0.5);&lt;br/&gt;        }&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://munim.tumblr.com/post/11606165594</link><guid>http://munim.tumblr.com/post/11606165594</guid><pubDate>Tue, 18 Oct 2011 13:17:00 +0600</pubDate><category>c math</category></item><item><title>HOW TO: Setup XDebug on XAMPP and Eclipse</title><description>&lt;p&gt;Before proceeding with the setup, it&amp;#8217;s recommended to note down few things which may save couple of hours.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Your PHP version [Write a PHP file with &amp;lt;?php phpinfo();&amp;#160;?&amp;gt; to get the version]&lt;/li&gt;
&lt;li&gt;Your Windows version (32-bit or 64-bit) [See System Properties]&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Now go to &lt;a target="_blank" href="http://xdebug.org/download.php"&gt;XDebug Download&lt;/a&gt; page and you will see Windows binaries with having some version information. Download the XDebug DLL and put it on your {xampp-folder}\php\ext folder and rename the file to php_xdebug.dll. [NOTE: {xampp-folder} is just an alias. Consider it as where you installed XAMPP. Something like C:\XAMPP]&lt;/p&gt;
&lt;p&gt;Now you have to open php.ini located in your {xampp-folder}\php folder. Now search for &amp;#8220;[XDebug]&amp;#8221; section, if you find anything then just put the lines, otherwise write [XDebug] at the end of the file and write the lines below:&lt;/p&gt;
&lt;p&gt;xdebug.remote_enable=1&lt;br/&gt;xdebug.remote_host=&amp;#8221;localhost&amp;#8221;&lt;br/&gt;xdebug.remote_port=9000&lt;br/&gt;xdebug.remote_handler=&amp;#8221;dbgp&amp;#8221;&lt;/p&gt;
&lt;p&gt;Hold on, you are not done yet. One more line to make PHP know XDebug DLL.&lt;/p&gt;
&lt;p&gt;If you are using less than PHP v5.3 then add&lt;br/&gt;&lt;span class="serif"&gt;zend_extension_ts&lt;/span&gt;={xampp-folder}\php\ext\php_xdebug.dll&lt;/p&gt;
&lt;p&gt;If you are using PHP v5.3 and above then add&lt;br/&gt;&lt;span class="serif"&gt;zend_extension&lt;/span&gt;={xampp-folder}\php\ext\php_xdebug.dll&lt;br/&gt;&lt;br/&gt;If you are using any custom build of PHP with &lt;span class="serif"&gt; &amp;#8212;enable-debug then add&lt;br/&gt;&lt;/span&gt;&lt;span class="serif"&gt;zend_extension&lt;/span&gt;_debug={xampp-folder}\php\ext\php_xdebug.dll&lt;br/&gt;&lt;br/&gt;OK! You are almost done. Search for &amp;#8220;[Zend]&amp;#8221; section now in PHP.ini, if you find &lt;span class="serif"&gt;zend_extension_ts, then comment the line using &amp;#8220;;&amp;#8221;. And that&amp;#8217;s it!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="serif"&gt;Refresh you phpinfo page and search for &amp;#8220;XDebug&amp;#8221; and you will see setting of XDebug and you have successfully configured XDebug with PHP.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="serif"&gt;Considering you are using Eclipse v3.3 or above, which has built-in XDebug support. All you have to do is, go to &amp;#8220;Debug Configuration&amp;#8221; as set start URL, click &amp;#8220;Apply&amp;#8221; and close the window. Now click &amp;#8220;Debug&amp;#8221; button from toolbar to start debugging.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="serif"&gt;PS: There&amp;#8217;s a XDebug bug which makes Apache server to crash while debugging with Eclipse. The crash occurs when invalid expressions (watch items) are there. Delete all expression items when terminating or launching your debug session.&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="serif"&gt;HAPPY LIFE :)&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;</description><link>http://munim.tumblr.com/post/917355998</link><guid>http://munim.tumblr.com/post/917355998</guid><pubDate>Sat, 07 Aug 2010 18:44:00 +0600</pubDate><category>xdebug</category><category>php</category><category>howto</category></item><item><title>GMail adds rich text signatures</title><description>&lt;p&gt;You can now use rich text as well as images in your &lt;a target="_blank" href="http://www.gmail.com"&gt;GMail&lt;/a&gt; signatures.&lt;/p&gt;
&lt;p&gt;Currently GMail supports hotlinks to images for using images in your signatures. You can use &lt;a target="_blank" href="http://www.photobucket.com"&gt;Photobucket&lt;/a&gt; or &lt;a target="_blank" href="http://www.imageshack.us"&gt;Imageshack&lt;/a&gt; to use inline images in your GMail signatures.&lt;/p&gt;
&lt;p&gt;Goto &lt;strong&gt;Settings&lt;/strong&gt;, scroll down on the &lt;strong&gt;General&lt;/strong&gt; tab for &lt;strong&gt;Signature section&lt;/strong&gt; to modify your signature. Also use &lt;strong&gt;Insert Image &lt;/strong&gt;on the Signature textbox toolbar to link images. Make sure you upload your images to above mentioned sites or any image hosting provider that supports &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Inline_linking%20"&gt;hotlinking&lt;/a&gt;&lt;/p&gt;</description><link>http://munim.tumblr.com/post/789016914</link><guid>http://munim.tumblr.com/post/789016914</guid><pubDate>Fri, 09 Jul 2010 16:22:00 +0600</pubDate><category>gmail signature rich</category></item><item><title>Javascript: Difference between "return false" and "e.preventDefault()"</title><description>&lt;p&gt;Most of the times we just write&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;return false;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;or we write&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;e.preventDefault()&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;to stop from executing &lt;a target="_blank" href="http://www.w3schools.com/HTML/html_links.asp"&gt;href&lt;/a&gt; element in an anchor tag.&lt;/p&gt;
&lt;p&gt;return false; just stops the propagation and e.preventDefault() makes the default behavior execution of a tag.&lt;/p&gt;
&lt;p&gt;In simple words:&lt;/p&gt;
&lt;p&gt;equivalent to &lt;strong&gt;return false; &lt;/strong&gt;is&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;e.preventDefault();&lt;/p&gt;
&lt;p&gt;e.stopPropagation();&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://munim.tumblr.com/post/788870462</link><guid>http://munim.tumblr.com/post/788870462</guid><pubDate>Fri, 09 Jul 2010 15:15:26 +0600</pubDate><category>javascript</category></item><item><title>I am loving this song. This song is called Chobbi and currently...</title><description>&lt;iframe class="tumblr_audio_player tumblr_audio_player_452568802" src="http://munim.tumblr.com/post/452568802/audio_player_iframe/munim/tumblr_kzdyno7AMc1qa5mlg?audio_file=http%3A%2F%2Fwww.tumblr.com%2Faudio_file%2Fmunim%2F452568802%2Ftumblr_kzdyno7AMc1qa5mlg" frameborder="0" allowtransparency="true" scrolling="no" width="500" height="85"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;I am loving this song. This song is called Chobbi and currently unreleased by Stentorian.&lt;/p&gt;</description><link>http://munim.tumblr.com/post/452568802</link><guid>http://munim.tumblr.com/post/452568802</guid><pubDate>Tue, 16 Mar 2010 23:45:00 +0600</pubDate><category>bangla</category><category>music</category><category>stentorian</category></item><item><title>Thinking ASP.NET in MVC</title><description>&lt;p&gt;My web hosting doesn&amp;#8217;t support ASAPI_Rewrite and thus cannot use ASP.NET MVC, and I am in love with MVC and of course ASP.NET.&lt;/p&gt;
&lt;p&gt;I am currently working on mobile site for my local users and trying to implement MVC architecture.&lt;/p&gt;</description><link>http://munim.tumblr.com/post/452560784</link><guid>http://munim.tumblr.com/post/452560784</guid><pubDate>Tue, 16 Mar 2010 23:39:00 +0600</pubDate><category>mvc</category><category>asp.net</category><category>self-thought</category></item><item><title>My visit to Malaysia. Petronas Twin Towers, Kuala Lumpur.</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_kqs1g75LXB1qa5mlgo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;My visit to Malaysia. Petronas Twin Towers, Kuala Lumpur.&lt;/p&gt;</description><link>http://munim.tumblr.com/post/200806384</link><guid>http://munim.tumblr.com/post/200806384</guid><pubDate>Wed, 30 Sep 2009 16:09:43 +0700</pubDate></item></channel></rss>
