<?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>blog.KapilSakhare.in</title>
	<atom:link href="http://blog.kapilsakhare.in/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.kapilsakhare.in</link>
	<description>World of Open Source!!!..... a lot more...</description>
	<lastBuildDate>Fri, 18 May 2012 14:05:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>IPL player arrested for misbehaving with American woman</title>
		<link>http://blog.kapilsakhare.in/video/ipl-player-arrested-for-misbehaving-with-american-woman</link>
		<comments>http://blog.kapilsakhare.in/video/ipl-player-arrested-for-misbehaving-with-american-woman#comments</comments>
		<pubDate>Fri, 18 May 2012 14:05:20 +0000</pubDate>
		<dc:creator>Kapil</dc:creator>
				<category><![CDATA[Video]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.kapilsakhare.in/?p=279</guid>
		<description><![CDATA[<div id="fb-root"></div>IPL player arrested for misbehaving with American woman: &#160; &#160; //Tweet //]]></description>
			<content:encoded><![CDATA[<p>IPL player arrested for misbehaving with American woman:</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/ua5nfF1t5Hw?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>&nbsp;</p>
<p>&nbsp;
<div class="ptl_div"><script>
					//<![CDATA[
					document.write('<g:plusone size="standard" annotation="none" href="http://blog.kapilsakhare.in/video/ipl-player-arrested-for-misbehaving-with-american-woman"></g:plusone>');
				        //]]&gt;
					</script><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.kapilsakhare.in/video/ipl-player-arrested-for-misbehaving-with-american-woman" data-text="IPL player arrested for misbehaving with American woman" data-count="horizontal">Tweet</a>
<div class="ptl_fb"><script>
							//<![CDATA[
							document.write('<fb:like href="http://blog.kapilsakhare.in/video/ipl-player-arrested-for-misbehaving-with-american-woman" send="true" layout="button_count" width="90"  action="like" font="" colorscheme="light"></fb:like>');
							//]]&gt;
							</script></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kapilsakhare.in/video/ipl-player-arrested-for-misbehaving-with-american-woman/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spot fixing in IPL</title>
		<link>http://blog.kapilsakhare.in/sport/spot-fixing-in-ipl-2</link>
		<comments>http://blog.kapilsakhare.in/sport/spot-fixing-in-ipl-2#comments</comments>
		<pubDate>Thu, 17 May 2012 20:39:22 +0000</pubDate>
		<dc:creator>Kapil</dc:creator>
				<category><![CDATA[Sport]]></category>

		<guid isPermaLink="false">http://blog.kapilsakhare.in/?p=267</guid>
		<description><![CDATA[&#160; //Tweet //]]></description>
			<content:encoded><![CDATA[<p><iframe width="500" height="375" src="http://www.youtube.com/embed/E2StZvUy000?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>&nbsp;
<div class="ptl_div"><script>
					//<![CDATA[
					document.write('<g:plusone size="standard" annotation="none" href="http://blog.kapilsakhare.in/sport/spot-fixing-in-ipl-2"></g:plusone>');
				        //]]&gt;
					</script><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.kapilsakhare.in/sport/spot-fixing-in-ipl-2" data-text="Spot fixing in IPL" data-count="horizontal">Tweet</a>
<div class="ptl_fb"><script>
							//<![CDATA[
							document.write('<fb:like href="http://blog.kapilsakhare.in/sport/spot-fixing-in-ipl-2" send="true" layout="button_count" width="90"  action="like" font="" colorscheme="light"></fb:like>');
							//]]&gt;
							</script></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kapilsakhare.in/sport/spot-fixing-in-ipl-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript to check when the browser window is close</title>
		<link>http://blog.kapilsakhare.in/javascript/javascript-to-check-when-the-browser-window-is-close</link>
		<comments>http://blog.kapilsakhare.in/javascript/javascript-to-check-when-the-browser-window-is-close#comments</comments>
		<pubDate>Thu, 17 May 2012 16:56:38 +0000</pubDate>
		<dc:creator>Kapil</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.kapilsakhare.in/?p=257</guid>
		<description><![CDATA[Does anyone know any way that I can use javascript to check when the browser window is close and pop-up a confirmation dailog to ask whether the user is confirm to exit the browser or change his mind to stay? Here is the answer to above questions. &#60;script language="javascript"&#62; window.onbeforeunload = function () { var [...]]]></description>
			<content:encoded><![CDATA[<p>Does anyone know any way that I can use javascript to check when the browser window is close and pop-up a confirmation dailog to ask whether the user is confirm to exit the browser or change his mind to stay?<br />
Here is the answer to above questions.</p>
<pre>&lt;script language="javascript"&gt;
window.onbeforeunload = function ()
{
	var disp_txt = "";

	disp_txt+= "WAIT! READ THIS MESSAGE.\n\n";
	disp_txt+= "Yepie, you got the answer here.\n\n";

	location.assign("http://blog.kapilsakhare.in");
	return disp_txt;
}
&lt;/script&gt;</pre>
<div class="ptl_div"><script>
					//<![CDATA[
					document.write('<g:plusone size="standard" annotation="none" href="http://blog.kapilsakhare.in/javascript/javascript-to-check-when-the-browser-window-is-close"></g:plusone>');
				        //]]&gt;
					</script><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.kapilsakhare.in/javascript/javascript-to-check-when-the-browser-window-is-close" data-text="JavaScript to check when the browser window is close" data-count="horizontal">Tweet</a>
<div class="ptl_fb"><script>
							//<![CDATA[
							document.write('<fb:like href="http://blog.kapilsakhare.in/javascript/javascript-to-check-when-the-browser-window-is-close" send="true" layout="button_count" width="90"  action="like" font="" colorscheme="light"></fb:like>');
							//]]&gt;
							</script></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kapilsakhare.in/javascript/javascript-to-check-when-the-browser-window-is-close/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 ways to generate random password from command line</title>
		<link>http://blog.kapilsakhare.in/linux/10-ways-to-generate-random-password-from-command-line</link>
		<comments>http://blog.kapilsakhare.in/linux/10-ways-to-generate-random-password-from-command-line#comments</comments>
		<pubDate>Tue, 15 May 2012 09:16:45 +0000</pubDate>
		<dc:creator>Kapil</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kapilsakhare.in/?p=252</guid>
		<description><![CDATA[Here&#8217;s 10 ways to generate random password: For any of these random password commands, you can either modify them to output a different password length, or you can just use the first n characters of the generated password if you don&#8217;t want such a long password. This method uses SHA to hash the date, runs [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s 10 ways to generate random password:</p>
<p>For any of these random password commands, you can either modify them to output a different password length, or you can just use the first n characters of the generated password if you don&#8217;t want such a long password.</p>
<p>This method uses SHA to hash the date, runs through base64, and then outputs the top 32 characters.</p>
<pre>date +%s | sha256sum | base64 | head -c 32 ; echo</pre>
<p>This method used built-in /dev/urandom feature, and filter out only characters that you would normally use in a password. Then it outputs the top 32 characters.</p>
<pre>&lt; /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;</pre>
<p>This uses openssl&#8217;s rand function, which may not be installed on your system.<br />
For example:</p>
<pre>openssl rand -base64 32</pre>
<p>This works a lot like the other urandom function, but just does the work in reverse. Bash is very powerful!</p>
<pre>tr -cd '[:alnum:]' &lt; /dev/urandom | fold -w30 | head -n1</pre>
<p>Here&#8217;s another example that filters using the strings command, which outputs printable strings from a file. In this case is the urandom feature.</p>
<pre>strings /dev/urandom | grep -o ':alnum:' | head -n 30 | tr -d '\n'; echo</pre>
<p>Here&#8217;s an even simpler version of the urandom one.</p>
<pre>&lt; /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6</pre>
<p>This manages to use the very useful dd command.</p>
<pre>dd if=/dev/urandom bs=1 count=32 2&gt;/dev/null | base64 -w 0 | rev | cut -b 2- | rev</pre>
<p>You can even create a random left-hand password, which would let you type your password with one hand.</p>
<pre>&lt;/dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c8; echo ""</pre>
<p>If you&#8217;re going to be using this all the time, it&#8217;s probably a better idea to put it into a function. In this case, once you run the command once, you&#8217;ll be able to use randpw anytime you want to generate a random password. You&#8217;d probably want to put this into your ~/.bashrc file.</p>
<pre>randpw(){ &lt; /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo;}</pre>
<p>You can use this same syntax to make any of these into a function—just replace everything inside the { }</p>
<p>And here&#8217;s the easiest way to make a password from the command line, which works in Linux, Windows with Cygwin, and probably Mac OS X. I&#8217;m sure that some people will complain that it&#8217;s not as random as some of the other options, but honestly, it&#8217;s random enough if you&#8217;re going to be using the whole thing.</p>
<pre>date | md5sum</pre>
<div class="ptl_div"><script>
					//<![CDATA[
					document.write('<g:plusone size="standard" annotation="none" href="http://blog.kapilsakhare.in/linux/10-ways-to-generate-random-password-from-command-line"></g:plusone>');
				        //]]&gt;
					</script><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.kapilsakhare.in/linux/10-ways-to-generate-random-password-from-command-line" data-text="10 ways to generate random password from command line" data-count="horizontal">Tweet</a>
<div class="ptl_fb"><script>
							//<![CDATA[
							document.write('<fb:like href="http://blog.kapilsakhare.in/linux/10-ways-to-generate-random-password-from-command-line" send="true" layout="button_count" width="90"  action="like" font="" colorscheme="light"></fb:like>');
							//]]&gt;
							</script></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kapilsakhare.in/linux/10-ways-to-generate-random-password-from-command-line/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto Optimize Your MySQL Tables Script</title>
		<link>http://blog.kapilsakhare.in/php/auto-optimize-your-mysql-tables-script</link>
		<comments>http://blog.kapilsakhare.in/php/auto-optimize-your-mysql-tables-script#comments</comments>
		<pubDate>Thu, 10 May 2012 19:46:20 +0000</pubDate>
		<dc:creator>Kapil</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.kapilsakhare.in/?p=246</guid>
		<description><![CDATA[To make MySQL driven websites running fast, I&#8217;ve pieced together a script and cron job that will save you some support calls. Step 1: Create a PHP script: &#60;?php // Change vars as needed here $server = "localhost"; $user = "mysql_user"; $pwd = "mysql_password"; $dbName = "mysql_dbName"; $link = mysql_connect($server, $user, $pwd); if (!$link) { [...]]]></description>
			<content:encoded><![CDATA[<p>To make MySQL driven websites running fast, I&#8217;ve pieced together a script and cron job that will save you some support calls.</p>
<p>Step 1: Create a PHP script:</p>
<pre>&lt;?php
// Change vars as needed here
$server = "localhost";
$user = "mysql_user";
$pwd = "mysql_password";
$dbName = "mysql_dbName";

$link = mysql_connect($server, $user, $pwd);

if (!$link) {
     die('Could not connect: ' . mysql_error());
}

$db_selected = mysql_select_db($dbName, $link);

if (!$db_selected) {
    die ('Can\'t use $dbName : ' . mysql_error());
}

// Find all tables in the selected DB
$alltables = mysql_query("SHOW TABLES");

// Process all tables.
while ($table = mysql_fetch_assoc($alltables))
{
   foreach ($table as $db =&gt; $tablename)
   {
         // Optimize them!
         mysql_query("OPTIMIZE TABLE '".$tablename."'") or die(mysql_error());
   } // end foreach
} // end while

mysql_close($link);
?&gt;</pre>
<p>Step 2: Add this script into your daily cron jobs<br />
Login as root and follow these steps to add your new website optimization script to your daily cron directory, thus never having to worry about manually optimizating again!</p>
<pre>cd /etc/cron.daily</pre>
<pre>echo '#!/bin/sh' &gt; mysql_optimize; echo '/path/to/your/script.php' &gt;&gt; mysql_optimize; chmod 755 mysql_optimize;</pre>
<p>Now your all set! A quick and easy way to keep your high volume MySQL driven websites optimized!<br />
It is most effective on tables that get updated a lot (with deletions and inserts).
<div class="ptl_div"><script>
					//<![CDATA[
					document.write('<g:plusone size="standard" annotation="none" href="http://blog.kapilsakhare.in/php/auto-optimize-your-mysql-tables-script"></g:plusone>');
				        //]]&gt;
					</script><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.kapilsakhare.in/php/auto-optimize-your-mysql-tables-script" data-text="Auto Optimize Your MySQL Tables Script" data-count="horizontal">Tweet</a>
<div class="ptl_fb"><script>
							//<![CDATA[
							document.write('<fb:like href="http://blog.kapilsakhare.in/php/auto-optimize-your-mysql-tables-script" send="true" layout="button_count" width="90"  action="like" font="" colorscheme="light"></fb:like>');
							//]]&gt;
							</script></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kapilsakhare.in/php/auto-optimize-your-mysql-tables-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Few Tips for Optimizing PHP code</title>
		<link>http://blog.kapilsakhare.in/php/few-tips-for-optimizing-php-code</link>
		<comments>http://blog.kapilsakhare.in/php/few-tips-for-optimizing-php-code#comments</comments>
		<pubDate>Mon, 07 May 2012 07:04:01 +0000</pubDate>
		<dc:creator>Kapil</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.kapilsakhare.in/?p=244</guid>
		<description><![CDATA[1. If a method can be static, declare it static. Speed improvement is by a factor of 4. 2. echo is faster than print. 3. Use echo&#8217;s multiple parameters instead of string concatenation. 4. Set the maxvalue for your for-loops before and not in the loop. 5. Unset your variables to free memory, especially large [...]]]></description>
			<content:encoded><![CDATA[<p>1. If a method can be static, declare it static. Speed improvement is by a factor of 4.</p>
<p>2. echo is faster than print.</p>
<p>3. Use echo&#8217;s multiple parameters instead of string concatenation.</p>
<p>4. Set the maxvalue for your for-loops before and not in the loop.</p>
<p>5. Unset your variables to free memory, especially large arrays.</p>
<p>6. Avoid magic like __get, __set, __autoload</p>
<p>7. require_once() is expensive</p>
<p>8. Use full paths in includes and requires, less time spent on resolving the OS paths.</p>
<p>9. If you need to find out the time when the script started executing, INSERT:CONTENT:END SERVER['REQUEST_TIME'] is preferred to time()</p>
<p>10. See if you can use strncasecmp, strpbrk and stripos instead of regex</p>
<p>11. str_replace is faster than preg_replace, but strtr is faster than str_replace by a factor of 4</p>
<p>12. If the function, such as string replacement function, accepts both arrays and single characters as arguments, and if your argument list is not too long, consider writing a few redundant replacement statements, passing one character at a time, instead of one line of code that accepts arrays as search and replace arguments.</p>
<p>13. It&#8217;s better to use select statements than multi if, else if, statements.</p>
<p>14. Error suppression with @ is very slow.</p>
<p>15. Turn on apache&#8217;s mod_deflate</p>
<p>16. Close your database connections when you&#8217;re done with them</p>
<p>17. $row['id'] is 7 times faster than $row[id]</p>
<p>18. Error messages are expensive</p>
<p>19. Do not use functions inside of for loop, such as for ($x=0; $x &lt; count($array); $x) The count() function gets called each time.</p>
<p>20. Incrementing a local variable in a method is the fastest. Nearly the same as calling a local variable in a function.</p>
<p>21. Incrementing a global variable is 2 times slow than a local var.</p>
<p>22. Incrementing an object property (eg. $this-&gt;objprop++) is 3 times slower than a local variable.</p>
<p>23. Incrementing an undefined local variable is 9-10 times slower than a pre-initialized one.</p>
<p>24. Just declaring a global variable without using it in a function also slows things down (by about the same amount as incrementing a local var). PHP probably does a check to see if the global exists.</p>
<p>25. Method invocation appears to be independent of the number of methods defined in the class because I added 10 more methods to the test class (before and after the test method) with no change in performance.</p>
<p>26. Methods in derived classes run faster than ones defined in the base class.</p>
<p>27. A function call with one parameter and an empty function body takes about the same time as doing 7-8 $localvar++ operations. A similar method call is of course about 15 $localvar++ operations.</p>
<p>28. Surrounding your string by &#8216; instead of &#8221; will make things interpret a little faster since php looks for variables inside &#8220;&#8230;&#8221; but not inside &#8216;&#8230;&#8217;. Of course you can only do this when you don&#8217;t need to have variables in the string.</p>
<p>29. When echoing strings it&#8217;s faster to separate them by comma instead of dot. Note: This only works with echo, which is a function that can take several strings as arguments.</p>
<p>30. A PHP script will be served at least 2-10 times slower than a static HTML page by Apache. Try to use more static HTML pages and fewer scripts.</p>
<p>31. Your PHP scripts are recompiled every time unless the scripts are cached. Install a PHP caching product to typically increase performance by 25-100% by removing compile times.</p>
<p>32. Cache as much as possible. Use memcached &#8211; memcached is a high-performance memory object caching system intended to speed up dynamic web applications by alleviating database load. OP code caches are useful so that your script does not have to be compiled on every request</p>
<p>33. When working with strings and you need to check that the string is either of a certain length you&#8217;d understandably would want to use the strlen() function. This function is pretty quick since it&#8217;s operation does not perform any calculation but merely return the already known length of a string available in the zval structure (internal C struct used to store variables in PHP). However because strlen() is a function it is still somewhat slow because the function call requires several operations such as lowercase &amp; hashtable lookup followed by the execution of said function. In some instance you can improve the speed of your code by using an isset() trick.<br />
Example:</p>
<pre>if (strlen($foo) &lt; 5) { echo 'Foo is too short'; }
vs.</pre>
<pre>if (!isset($foo{5})) { echo 'Foo is too short'; }</pre>
<p>Calling isset() happens to be faster then strlen() because unlike strlen(), isset() is a language construct and not a function meaning that it&#8217;s execution does not require function lookups and lowercase. This means you have virtually no overhead on top of the actual code that determines the string&#8217;s length.</p>
<p>34. When incrementing or decrementing the value of the variable $i++ happens to be a tad slower then ++$i. ++$i happens to be faster in PHP because instead of 4 opcodes used for $i++ you only need 3. Post incrementation actually causes in the creation of a temporary var that is then incremented. While pre-incrementation increases the original value directly. This is one of the optimization that opcode optimized like Zend&#8217;s PHP optimizer. It is a still a good idea to keep in mind since not all opcode optimizers perform this optimization and there are plenty of ISPs and servers running without an opcode optimizer.</p>
<p>35. Not everything has to be OOP, often it is too much overhead, each method and object call consumes a lot of memory.</p>
<p>36. Do not implement every data structure as a class, arrays are useful, too</p>
<p>37. Don&#8217;t split methods too much, think, which code you will really re-use.</p>
<p>38. You can always split the code of a method later, when needed</p>
<p>39. Make use of the countless predefined functions.</p>
<p>40. If you have very time consuming functions in your code, consider writing them as C extensions</p>
<p>41. Profile your code. A profiler shows you, which parts of your code consumes how many time. The Xdebug debugger already contains a profiler. Profiling shows you the bottlenecks in overview.
<div class="ptl_div"><script>
					//<![CDATA[
					document.write('<g:plusone size="standard" annotation="none" href="http://blog.kapilsakhare.in/php/few-tips-for-optimizing-php-code"></g:plusone>');
				        //]]&gt;
					</script><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.kapilsakhare.in/php/few-tips-for-optimizing-php-code" data-text="Few Tips for Optimizing PHP code" data-count="horizontal">Tweet</a>
<div class="ptl_fb"><script>
							//<![CDATA[
							document.write('<fb:like href="http://blog.kapilsakhare.in/php/few-tips-for-optimizing-php-code" send="true" layout="button_count" width="90"  action="like" font="" colorscheme="light"></fb:like>');
							//]]&gt;
							</script></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kapilsakhare.in/php/few-tips-for-optimizing-php-code/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s the Maximum Length For MySQL TEXT Field Types</title>
		<link>http://blog.kapilsakhare.in/mysql/whats-the-maximum-length-for-mysql-text-field-types</link>
		<comments>http://blog.kapilsakhare.in/mysql/whats-the-maximum-length-for-mysql-text-field-types#comments</comments>
		<pubDate>Wed, 02 May 2012 07:00:24 +0000</pubDate>
		<dc:creator>Kapil</dc:creator>
				<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://blog.kapilsakhare.in/?p=240</guid>
		<description><![CDATA[MySQL engine supports 4 TEXT field types TINYTEXT TEXT MEDIUMTEXT LONGTEXT MyISAM tables in MySQL have a maximum size of a row of 65,535 bytes, so all the data in a row must fit within this limit. However, the TEXT types are stored outside the table itself and only contribute 1 to 4 bytes towards [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL engine supports 4 TEXT field types</p>
<ul>
<li>TINYTEXT</li>
<li>TEXT</li>
<li>MEDIUMTEXT</li>
<li>LONGTEXT</li>
</ul>
<p>MyISAM tables in MySQL have a maximum size of a row of 65,535 bytes, so all the data in a row must fit within this limit.<br />
However, the TEXT types are stored outside the table itself and only contribute 1 to 4 bytes towards this limit.</p>
<p>TEXT data types are also able to store much more data than VARCHAR and CHAR text types so TEXT types are what you need to use when storing web page or similar content in a database.</p>
<p>The maximum amount of data that can be stored in each data type is as follows:</p>
<pre>TINYTEXT     256 bytes
TEXT         65,535 bytes        ~64kb
MEDIUMTEXT   16,777,215 bytes    ~16MB
LONGTEXT     4,294,967,295 bytes ~4GB</pre>
<p>In most circumstances the TEXT type is probably sufficient, but if you are coding a content management system it&#8217;s probably best to use the MEDIUMTEXT type for longer pages to ensure there are no issues with data size limits.
<div class="ptl_div"><script>
					//<![CDATA[
					document.write('<g:plusone size="standard" annotation="none" href="http://blog.kapilsakhare.in/mysql/whats-the-maximum-length-for-mysql-text-field-types"></g:plusone>');
				        //]]&gt;
					</script><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.kapilsakhare.in/mysql/whats-the-maximum-length-for-mysql-text-field-types" data-text="What&#8217;s the Maximum Length For MySQL TEXT Field Types" data-count="horizontal">Tweet</a>
<div class="ptl_fb"><script>
							//<![CDATA[
							document.write('<fb:like href="http://blog.kapilsakhare.in/mysql/whats-the-maximum-length-for-mysql-text-field-types" send="true" layout="button_count" width="90"  action="like" font="" colorscheme="light"></fb:like>');
							//]]&gt;
							</script></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kapilsakhare.in/mysql/whats-the-maximum-length-for-mysql-text-field-types/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop Cron Job From Emailing</title>
		<link>http://blog.kapilsakhare.in/linux/stop-cron-job-from-emailing</link>
		<comments>http://blog.kapilsakhare.in/linux/stop-cron-job-from-emailing#comments</comments>
		<pubDate>Wed, 25 Apr 2012 17:56:16 +0000</pubDate>
		<dc:creator>Kapil</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kapilsakhare.in/?p=238</guid>
		<description><![CDATA[At the end of the cmd of the cronjob you can add: &#62;/dev/null 2&#62;&#38;1 a line would look like this: etc/web/htdocs/cron.php &#62;/dev/null 2&#62;&#38;1 //Tweet //]]></description>
			<content:encoded><![CDATA[<p>At the end of the cmd of the cronjob you can add: &gt;/dev/null 2&gt;&amp;1<br />
a line would look like this: etc/web/htdocs/cron.php &gt;/dev/null 2&gt;&amp;1
<div class="ptl_div"><script>
					//<![CDATA[
					document.write('<g:plusone size="standard" annotation="none" href="http://blog.kapilsakhare.in/linux/stop-cron-job-from-emailing"></g:plusone>');
				        //]]&gt;
					</script><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.kapilsakhare.in/linux/stop-cron-job-from-emailing" data-text="Stop Cron Job From Emailing" data-count="horizontal">Tweet</a>
<div class="ptl_fb"><script>
							//<![CDATA[
							document.write('<fb:like href="http://blog.kapilsakhare.in/linux/stop-cron-job-from-emailing" send="true" layout="button_count" width="90"  action="like" font="" colorscheme="light"></fb:like>');
							//]]&gt;
							</script></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kapilsakhare.in/linux/stop-cron-job-from-emailing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>15 Famous Sayings by Chanakya</title>
		<link>http://blog.kapilsakhare.in/general/15-famous-sayings-by-chanakya</link>
		<comments>http://blog.kapilsakhare.in/general/15-famous-sayings-by-chanakya#comments</comments>
		<pubDate>Thu, 05 Apr 2012 09:50:53 +0000</pubDate>
		<dc:creator>Kapil</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.kapilsakhare.in/?p=234</guid>
		<description><![CDATA[1) &#8220;Learn from the mistakes of others&#8230; you can&#8217;t live long enough to make them all yourselves!!&#8221; - Chanakya 2)&#8221;A person should not be too honest. Straight trees are cut first and Honest people are screwed first.&#8221; - Chanakya 3)&#8221;Even if a snake is not poisonous, it should pretend to be venomous.&#8221; Chanakya 4)&#8221;There is [...]]]></description>
			<content:encoded><![CDATA[<p>1) &#8220;Learn from the mistakes of others&#8230; you can&#8217;t live long enough to make them all yourselves!!&#8221;<br />
- Chanakya</p>
<p>2)&#8221;A person should not be too honest. Straight trees are cut first and Honest people are screwed first.&#8221;<br />
- Chanakya</p>
<p>3)&#8221;Even if a snake is not poisonous, it should pretend to be venomous.&#8221;<br />
Chanakya</p>
<p>4)&#8221;There is some self-interest behind every friendship. There is no friendship without self-interests. This is a bitter truth.&#8221;<br />
- Chanakya</p>
<p>5)&#8221; Before you start some work, always ask yourself three questions &#8211; Why am I doing it, What the results might be and Will I be successful. Only when you think deeply and find satisfactory answers to these questions, go ahead.&#8221;<br />
- Chanakya</p>
<p>6)&#8221;As soon as the fear approaches near, attack and destroy it.&#8221;<br />
- Chanakya</p>
<p>7)&#8221;The world&#8217;s biggest power is the youth and beauty of a woman.&#8221;<br />
- Chanakya</p>
<p>8)&#8221;Once you start a working on something, don&#8217;t be afraid of failure and don&#8217;t abandon it. People who work sincerely are the happiest.&#8221;<br />
- Chanakya</p>
<p>9)&#8221;The fragrance of flowers spreads only in the direction of the wind. But the goodness of a person spreads in all direction.&#8221;<br />
- Chanakya</p>
<p>10)&#8221;God is not present in idols. Your feelings are your god. The soul is your temple.&#8221;<br />
- Chanakya</p>
<p>11) &#8220;A man is great by deeds, not by birth.&#8221;<br />
- Chanakya</p>
<p>12) &#8220;Never make friends with people who are above or below you in status. Such friendships will never give you any happiness.&#8221;<br />
- Chanakya</p>
<p>13) &#8220;Treat your kid like a darling for the first five years. For the next five years, scold them. By the time they turn sixteen, treat them like a friend. Your grown up children are your best friends.&#8221;<br />
- Chanakya</p>
<p>14) &#8220;Books are as useful to a stupid person as a mirror is useful to a blind person.&#8221;<br />
- Chanakya</p>
<p>15) &#8220;Education is the best friend. An educated person is respected everywhere. Education beats the beauty and the youth.&#8221;<br />
-Chanakya
<div class="ptl_div"><script>
					//<![CDATA[
					document.write('<g:plusone size="standard" annotation="none" href="http://blog.kapilsakhare.in/general/15-famous-sayings-by-chanakya"></g:plusone>');
				        //]]&gt;
					</script><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.kapilsakhare.in/general/15-famous-sayings-by-chanakya" data-text="15 Famous Sayings by Chanakya" data-count="horizontal">Tweet</a>
<div class="ptl_fb"><script>
							//<![CDATA[
							document.write('<fb:like href="http://blog.kapilsakhare.in/general/15-famous-sayings-by-chanakya" send="true" layout="button_count" width="90"  action="like" font="" colorscheme="light"></fb:like>');
							//]]&gt;
							</script></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kapilsakhare.in/general/15-famous-sayings-by-chanakya/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Funny Company Names</title>
		<link>http://blog.kapilsakhare.in/general/funny-company-names</link>
		<comments>http://blog.kapilsakhare.in/general/funny-company-names#comments</comments>
		<pubDate>Fri, 30 Mar 2012 13:23:25 +0000</pubDate>
		<dc:creator>Kapil</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.kapilsakhare.in/?p=231</guid>
		<description><![CDATA[1. NIIT : Not Interested in IT 2. WIPRO : Weak Input, Poor &#38; Rubbish Output 3. HCL : Hidden Costs &#38; Losses 4. TCS : Totally Confusing Solutions 5. INFOSYS : Inferior Offline Systems 6. HUGHES : Highly Useless Graduates Hired for Eating and Sleeping 7. BAAN : Beggars Association and Nerds 8. IBM [...]]]></description>
			<content:encoded><![CDATA[<p>1. NIIT : Not Interested in IT</p>
<p>2. WIPRO : Weak Input, Poor &amp; Rubbish Output</p>
<p>3. HCL : Hidden Costs &amp; Losses</p>
<p>4. TCS : Totally Confusing Solutions</p>
<p>5. INFOSYS : Inferior Offline Systems</p>
<p>6. HUGHES : Highly Useless Graduates Hired for Eating and Sleeping</p>
<p>7. BAAN : Beggars Association and Nerds</p>
<p>8. IBM : Implicitly Boring Machines</p>
<p>9. SATYAM : Sad And Tired Yelling Away Madly</p>
<p>10. C-DOT : Coffee During Office Timings</p>
<p>11. AT&amp;T : All Troubles &amp; Terrible</p>
<p>12. CMC : Coffee, Meals and Comfort</p>
<p>13. DEC : Drifting &amp; Exhausted Computers</p>
<p>14. ORACLE : Online Romance And Chatting with Lady Employees</p>
<p>15. PATNI: Pathetic Appraisal Techniques, No Increments
<div class="ptl_div"><script>
					//<![CDATA[
					document.write('<g:plusone size="standard" annotation="none" href="http://blog.kapilsakhare.in/general/funny-company-names"></g:plusone>');
				        //]]&gt;
					</script><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.kapilsakhare.in/general/funny-company-names" data-text="Funny Company Names" data-count="horizontal">Tweet</a>
<div class="ptl_fb"><script>
							//<![CDATA[
							document.write('<fb:like href="http://blog.kapilsakhare.in/general/funny-company-names" send="true" layout="button_count" width="90"  action="like" font="" colorscheme="light"></fb:like>');
							//]]&gt;
							</script></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kapilsakhare.in/general/funny-company-names/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

