<?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>trk's weblog</title>
	<atom:link href="http://www.trk7.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trk7.com/blog</link>
	<description>My virtual home.</description>
	<lastBuildDate>Mon, 09 Aug 2010 04:47:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>GNU sed, replace search string with contents of a file</title>
		<link>http://www.trk7.com/blog/quickfixes/gnu-sed-replace-search-string-with-contents-of-a-file/</link>
		<comments>http://www.trk7.com/blog/quickfixes/gnu-sed-replace-search-string-with-contents-of-a-file/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 04:45:48 +0000</pubDate>
		<dc:creator>trkesavan</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[quickfixes]]></category>

		<guid isPermaLink="false">http://www.trk7.com/blog/?p=143</guid>
		<description><![CDATA[Say, I want to replace the text &#8220;replace me&#8221; in all the .txt files in the current directory with the contents of modified.js file &#160; find . -name &#34;*.txt&#34; -print0 &#124; xargs -0 sed -i -e &#8216;s/replace me/cat modified.js/e&#8217; &#160; Notice the &#8216;/e&#8217; at the end and that seems to do the trick.]]></description>
			<content:encoded><![CDATA[<p>Say, I want to replace the text &#8220;replace me&#8221; in all the .txt files in the current directory with the contents of modified.js file</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">find</span> . -name <span class="st0">&quot;*.txt&quot;</span> -print0 | <span class="kw2">xargs</span> <span class="nu0">-0</span> <span class="kw2">sed</span> -i -e <span class="st0">&#8216;s/replace me/cat modified.js/e&#8217;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>Notice the &#8216;/e&#8217; at the end and that seems to do the trick.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trk7.com/blog/quickfixes/gnu-sed-replace-search-string-with-contents-of-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery empty(),remove() and Thickbox</title>
		<link>http://www.trk7.com/blog/quickfixes/jquery-emptyremove-and-thickbox/</link>
		<comments>http://www.trk7.com/blog/quickfixes/jquery-emptyremove-and-thickbox/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 10:09:29 +0000</pubDate>
		<dc:creator>trkesavan</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[quickfixes]]></category>

		<guid isPermaLink="false">http://www.trk7.com/blog/?p=127</guid>
		<description><![CDATA[I am a great fan of thickbox and I have used it for a long time. Recently I came across a situation where trying to close a modal that had a table with around 7000 rows (each 8 columns) crashed the tab in Chrome and took a very long time in Firefox. I went through <a href='http://www.trk7.com/blog/quickfixes/jquery-emptyremove-and-thickbox/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I am a great fan of thickbox and I have used it for a long time. Recently I came across a situation where trying to close a modal that had a table with around 7000 rows (each 8 columns) crashed the tab in Chrome and took a very long time in Firefox.</p>
<p>I went through the thickbox forum and discovered that other people have had similar issues and they were related to the tb_remove() function. I did my own profiling and came to the same conclusion.Of particular interest was this statement:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">$<span class="br0">&#40;</span><span class="st0">&quot;#TB_window&quot;</span><span class="br0">&#41;</span>.<span class="me1">fadeOut</span><span class="br0">&#40;</span><span class="st0">&quot;fast&quot;</span>,<span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#123;</span>$<span class="br0">&#40;</span><span class="st0">&#8216;#TB_window,#TB_overlay,#TB_HideSelect&#8217;</span><span class="br0">&#41;</span>.</div>
</li>
<li class="li1">
<div class="de1"><span class="me1">trigger</span><span class="br0">&#40;</span><span class="st0">&quot;unload&quot;</span><span class="br0">&#41;</span>.<span class="me1">unbind</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">remove</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<span class="br0">&#125;</span><span class="br0">&#41;</span>; </div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>I looked at the documentation and then read through the comments where someone mentioned that remove() can be quite expensive due to stuff that it does and he suggested to use empty() before remove(). Voila, it worked! So for anyone else facing the same issue with thickbox, change the statement above to:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">$<span class="br0">&#40;</span><span class="st0">&quot;#TB_window&quot;</span><span class="br0">&#41;</span>.<span class="me1">fadeOut</span><span class="br0">&#40;</span><span class="st0">&quot;fast&quot;</span>,<span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#123;</span>$<span class="br0">&#40;</span><span class="st0">&#8216;#TB_window,#TB_overlay,#TB_HideSelect&#8217;</span><span class="br0">&#41;</span>.</div>
</li>
<li class="li1">
<div class="de1"><span class="me1">trigger</span><span class="br0">&#40;</span><span class="st0">&quot;unload&quot;</span><span class="br0">&#41;</span>.<span class="me1">unbind</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">empty</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">remove</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>and see if that works for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trk7.com/blog/quickfixes/jquery-emptyremove-and-thickbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix find, xargs and basename.</title>
		<link>http://www.trk7.com/blog/linux/unix-find-xargs-and-basename/</link>
		<comments>http://www.trk7.com/blog/linux/unix-find-xargs-and-basename/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 03:35:40 +0000</pubDate>
		<dc:creator>trkesavan</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.trk7.com/blog/?p=125</guid>
		<description><![CDATA[Xargs is great. If you want to know why use xargs over exec, have a read of this: xargs versus exec. But, there is one problem. If the command that you are trying to execute on the results from find cannot take more than one file as param (basename for e.g, can take only one <a href='http://www.trk7.com/blog/linux/unix-find-xargs-and-basename/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Xargs is great. If you want to know why use xargs over exec, have a read of this: <a href="http://www.sunmanagers.org/pipermail/summaries/2005-March/006255.html">xargs versus exec</a>.</p>
<p>But, there is one problem. If the command that you are trying to execute on the results from find cannot take more than one file as param  (basename for e.g, can take only one file), then use the -n 1 param with xargs (to process one file at a time) . In that case, xargs is probably going to be as quick as using exec.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">find</span> . -name <span class="st0">&quot;*.rar&quot;</span> | <span class="kw2">xargs</span> -n <span class="nu0">1</span> unrar e</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">find</span> . -name <span class="st0">&quot;*.rar&quot;</span> | <span class="kw2">xargs</span> -n <span class="nu0">1</span> <span class="kw2">basename</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>And this will get the basename without using the basename function (I go it from <a href="http://superuser.com/questions/52861/find-exec-vs-xargs-aka-whyadoes-find-xargs-basename-break">this</a> page). </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">find</span> . -name <span class="st0">&quot;*.rar&quot;</span> -<span class="kw3">printf</span> <span class="st0">&quot;%f<span class="es0">\n</span>&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.trk7.com/blog/linux/unix-find-xargs-and-basename/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Munin: Could not open required defaults file: /root/.my.cnf</title>
		<link>http://www.trk7.com/blog/programming/mysql/munin-could-not-open-required-defaults-file-root-my-cnf/</link>
		<comments>http://www.trk7.com/blog/programming/mysql/munin-could-not-open-required-defaults-file-root-my-cnf/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 01:08:56 +0000</pubDate>
		<dc:creator>trkesavan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[munin]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[quickfixes]]></category>

		<guid isPermaLink="false">http://www.trk7.com/blog/?p=119</guid>
		<description><![CDATA[For some reason I kept getting this error (even when the file was readable by all) in one of the munin (mysql slave) plugins that I had written. So this was the solution that worked for me; under the [mysql*] section in /etc/munin/plugin-conf.d/munin-node I added this: env.mysqlopts -u{user} -p{password} and in my plugin I did <a href='http://www.trk7.com/blog/programming/mysql/munin-could-not-open-required-defaults-file-root-my-cnf/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>For some reason I kept getting this error (even when the file was readable by all) in one of the munin (mysql slave) plugins that I had written.</p>
<p>So this was the solution that worked for me;</p>
<pre>
under the [mysql*] section in /etc/munin/plugin-conf.d/munin-node
I added this: env.mysqlopts -u{user} -p{password}
</pre>
<p>and in my plugin</p>
<p>I did something like this:</p>
<pre>
mysql ${mysqlopts} -e'show slave status \G'
</pre>
<p>and that seemed to have picked up the user and password from env.mysqlopts and the plugin started working (ofcourse after I restarted munin).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trk7.com/blog/programming/mysql/munin-could-not-open-required-defaults-file-root-my-cnf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing: &#8220;unknown terminal type&#8221; in shell</title>
		<link>http://www.trk7.com/blog/linux/fixing-unknown-terminal-type-in-shell/</link>
		<comments>http://www.trk7.com/blog/linux/fixing-unknown-terminal-type-in-shell/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 00:33:18 +0000</pubDate>
		<dc:creator>trkesavan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[quickfixes]]></category>

		<guid isPermaLink="false">http://www.trk7.com/blog/?p=117</guid>
		<description><![CDATA[Assuming you are using bash Add the following to ~/.bash_profile &#160; TERM=vt100 export TERM &#160; and then from shell &#160; source ~/.bash_profile &#160; Note: &#8216;vt100&#8242; could be replaced with something similar in /usr/share/terminfo/]]></description>
			<content:encoded><![CDATA[<p>Assuming you are using bash<br />
Add the following to ~/.bash_profile</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="re2">TERM=</span>vt100</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">export</span> TERM</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>and then from shell</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">source</span> ~/.bash_profile</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>Note: &#8216;vt100&#8242; could be replaced with something similar in /usr/share/terminfo/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trk7.com/blog/linux/fixing-unknown-terminal-type-in-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL KEY, PRIMARY KEY and NOT NULL.</title>
		<link>http://www.trk7.com/blog/programming/mysql/mysql-key-primary-key-and-not-null/</link>
		<comments>http://www.trk7.com/blog/programming/mysql/mysql-key-primary-key-and-not-null/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 10:22:39 +0000</pubDate>
		<dc:creator>trkesavan</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.trk7.com/blog/?p=113</guid>
		<description><![CDATA[Have a look at this sql statement: &#160; mysql&#62; CREATE TABLE `t1` &#40;`id` INT NULL AUTO_INCREMENT, KEY&#40;`id`&#41;&#41;; Query OK, 0 rows affected &#40;0.92 sec&#41; &#160; mysql&#62; SHOW CREATE TABLE `t1`; +&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+ &#124; Table &#124; CREATE TABLE &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <a href='http://www.trk7.com/blog/programming/mysql/mysql-key-primary-key-and-not-null/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Have a look at this sql statement:</p>
<div style="word-wrap:break-word;">
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">mysql&gt; <span class="kw1">CREATE TABLE</span> `t1` <span class="br0">&#40;</span>`id` <span class="kw2">INT</span> <span class="kw3">NULL</span> <span class="kw3">AUTO_INCREMENT</span>, KEY<span class="br0">&#40;</span>`id`<span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">Query OK, <span class="nu0">0</span> rows affected <span class="br0">&#40;</span><span class="nu0">0.92</span> sec<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">mysql&gt; <span class="kw1">SHOW</span> <span class="kw1">CREATE TABLE</span> `t1`;</div>
</li>
<li class="li1">
<div class="de1">+<span class="co1">&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+</span></div>
</li>
<li class="li1">
<div class="de1">| Table | <span class="kw1">CREATE TABLE</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
</li>
<li class="li1">
<div class="de1">+<span class="co1">&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+</span></div>
</li>
<li class="li1">
<div class="de1">| t1 &nbsp; &nbsp;| <span class="kw1">CREATE TABLE</span> `t1` <span class="br0">&#40;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; `id` <span class="kw2">INT</span><span class="br0">&#40;</span><span class="nu0">11</span><span class="br0">&#41;</span> <span class="kw3">NOT NULL</span> <span class="kw3">AUTO_INCREMENT</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;KEY <span class="br0">&#40;</span>`id`<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#41;</span> ENGINE=MyISAM <span class="kw3">DEFAULT</span> <span class="kw3">CHARSET</span>=latin1 |</div>
</li>
<li class="li1">
<div class="de1">+<span class="co1">&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+</span></div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">1</span> row <span class="kw5">IN</span> <span class="kw1">SET</span> <span class="br0">&#40;</span><span class="nu0">0.08</span> sec<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
</ol>
</div>
</div>
<p>See, how MySQL implicitly converts the NULLable column `id` to NOT NULLable because the column `id` was also a key?</p>
<p>Also have a look at the following statements:</p>
<div style="word-wrap:break-word;">
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">mysql&gt; <span class="kw1">CREATE TABLE</span> `t2` <span class="br0">&#40;</span>`id` <span class="kw2">INT</span> <span class="kw3">NULL</span> <span class="kw3">AUTO_INCREMENT</span> KEY<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">Query OK, <span class="nu0">0</span> rows affected <span class="br0">&#40;</span><span class="nu0">0.11</span> sec<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">mysql&gt; <span class="kw1">SHOW</span> <span class="kw1">CREATE TABLE</span> `t2`;</div>
</li>
<li class="li1">
<div class="de1">+<span class="co1">&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+</span></div>
</li>
<li class="li1">
<div class="de1">| Table | <span class="kw1">CREATE TABLE</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
</li>
<li class="li1">
<div class="de1">+<span class="co1">&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+</span></div>
</li>
<li class="li1">
<div class="de1">| t2 &nbsp; &nbsp;| <span class="kw1">CREATE TABLE</span> `t2` <span class="br0">&#40;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; `id` <span class="kw2">INT</span><span class="br0">&#40;</span><span class="nu0">11</span><span class="br0">&#41;</span> <span class="kw3">NOT NULL</span> <span class="kw3">AUTO_INCREMENT</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">PRIMARY KEY</span> <span class="br0">&#40;</span>`id`<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#41;</span> ENGINE=MyISAM <span class="kw3">DEFAULT</span> <span class="kw3">CHARSET</span>=latin1 |</div>
</li>
<li class="li1">
<div class="de1">+<span class="co1">&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+</span></div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">1</span> row <span class="kw5">IN</span> <span class="kw1">SET</span> <span class="br0">&#40;</span><span class="nu0">0.00</span> sec<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
</ol>
</div>
</div>
<p>Having KEY in the column specification makes that column a PRIMARY KEY! </p>
<p>I am going to go through these pages:<br />
<a href="http://dev.mysql.com/doc/refman/5.0/en/silent-column-changes.html">http://dev.mysql.com/doc/refman/5.0/en/silent-column-changes.html</a><br />
<a href="http://dev.mysql.com/doc/refman/5.0/en/create-table.html">http://dev.mysql.com/doc/refman/5.0/en/create-table.html<br />
</a><br />
and try to understand why the context really matters while specifying the key.  and also the reasoning behind implicitly changing stuff instead of throwing an error.ATM, it just doesn&#8217;t make any sense!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trk7.com/blog/programming/mysql/mysql-key-primary-key-and-not-null/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Q&amp;A Site covering Religion and Philosophy</title>
		<link>http://www.trk7.com/blog/my_sites/qa-site-covering-religion-and-philosophy/</link>
		<comments>http://www.trk7.com/blog/my_sites/qa-site-covering-religion-and-philosophy/#comments</comments>
		<pubDate>Sun, 23 May 2010 01:31:12 +0000</pubDate>
		<dc:creator>trkesavan</dc:creator>
				<category><![CDATA[my_sites]]></category>
		<category><![CDATA[philosophy]]></category>
		<category><![CDATA[religion]]></category>

		<guid isPermaLink="false">http://www.trk7.com/blog/?p=97</guid>
		<description><![CDATA[I have now been hosting a Q&#038;A site covering 2 of my favorite topics: Religion and Philosophy. Link: bayankaram.com. The name &#8220;bayankaram&#8221; refers to the legendary Sri Prativadi Bhayankaram Annan Swami who composed Suprabhatham.]]></description>
			<content:encoded><![CDATA[<p>I have now been hosting a Q&#038;A site covering 2 of my favorite topics: Religion and Philosophy. Link: <a href="http://www.bayankaram.com">bayankaram.com</a>.</p>
<p>The name &#8220;bayankaram&#8221; refers to the legendary Sri Prativadi Bhayankaram Annan Swami who composed <a href="http://en.wikipedia.org/wiki/Suprabhatam">Suprabhatham</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trk7.com/blog/my_sites/qa-site-covering-religion-and-philosophy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.375 seconds -->
