<?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>Norse Technologies Knowledge Base&#187; code</title>
	<atom:link href="http://kb.norsetech.net/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://kb.norsetech.net</link>
	<description>Free Knowledge Articles</description>
	<lastBuildDate>Wed, 11 Jan 2012 00:53:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Delete Records in PHP using MySQL</title>
		<link>http://kb.norsetech.net/how-to-delete-records-in-php-using-mysql/</link>
		<comments>http://kb.norsetech.net/how-to-delete-records-in-php-using-mysql/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 23:56:53 +0000</pubDate>
		<dc:creator>kb-admin</dc:creator>
				<category><![CDATA[Freeware]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[com]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[html php]]></category>
		<category><![CDATA[lt]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[mysql query]]></category>
		<category><![CDATA[php mysql]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[unique names]]></category>
		<category><![CDATA[WHERE]]></category>
		<category><![CDATA[yourfield]]></category>
		<category><![CDATA[yourvalue]]></category>

		<guid isPermaLink="false">http://kb.norsetech.net/?p=100</guid>
		<description><![CDATA[The code in the HTML/PHP markup would look something like: &#60;?php mysql_query("DELETE FROM yourtable WHERE yourfield='yourvalue' ") or die(mysql_error()); ?&#62; This code deletes any record from the table named &#8220;yourtable&#8221; when that record&#8217;s field named &#8220;yourfield&#8221; is identically equal to &#8220;yourvalue&#8221;. The names of these objects will, of course, be replaced by the unique names [...]]]></description>
			<content:encoded><![CDATA[<p>The code in the HTML/PHP markup would look something like:</p>
<p><code>&lt;?php mysql_query("DELETE FROM <em>yourtable </em>WHERE <em>yourfield</em>='<em>yourvalue</em>' ")<br />
or die(mysql_error()); ?&gt;</code></p>
<p>This code deletes any record from the table named &#8220;yourtable&#8221; when that record&#8217;s field named &#8220;yourfield&#8221; is identically equal to &#8220;yourvalue&#8221;. The names of these objects will, of course, be replaced by the unique names that your set up uses.</p>
<p>Source: <a href="http://www.tizag.com/mysqlTutorial/mysqldelete.php" target="_blank">tizag.com &#8211; excellent tutorials on all kinds of coding, programming, and other technical stuff.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kb.norsetech.net/how-to-delete-records-in-php-using-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to CHMOD on files but not directories (inodes)</title>
		<link>http://kb.norsetech.net/how-to-chmod-on-files-but-not-directories-inodes/</link>
		<comments>http://kb.norsetech.net/how-to-chmod-on-files-but-not-directories-inodes/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 09:32:32 +0000</pubDate>
		<dc:creator>kb-admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[backslash]]></category>
		<category><![CDATA[chmod 755]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[directory tree]]></category>
		<category><![CDATA[directory type]]></category>
		<category><![CDATA[exec]]></category>
		<category><![CDATA[filelist]]></category>
		<category><![CDATA[ing]]></category>
		<category><![CDATA[Linuxquestions]]></category>
		<category><![CDATA[org]]></category>
		<category><![CDATA[pipe]]></category>
		<category><![CDATA[put]]></category>
		<category><![CDATA[semicolon]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Tool]]></category>
		<category><![CDATA[type]]></category>
		<category><![CDATA[way]]></category>

		<guid isPermaLink="false">http://kb.norsetech.net/?p=62</guid>
		<description><![CDATA[From Linuxquestions.org: &#8220;There are probably several methods, but one is to use find to produce a list of all files (not directories) and then execute chmod on each of them. For example Code: find /my/directory -type f -exec chmod 644 '{}' + Change the red parts to fit your needs. If you wonder what that [...]]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://www.linuxquestions.org/questions/linux-enterprise-47/chmod-on-files-only-583543/?s=8b99c02b20d5170e270d1f15c19f3f3e" target="_blank">Linuxquestions.org</a>:</p>
<p>&#8220;There are probably several methods, but one is to use find to produce a list of all files (not directories) and then execute chmod on each of them. For example</p>
<div style="margin: 5px 20px 20px;">
<div style="margin-bottom: 2px;">Code:</div>
<pre style="border: 1px inset; margin: 0px -99999px 0px 0px; padding: 3px; overflow: auto; width: 98%; height: 34px; text-align: left;" dir="ltr">find <span style="color: red;">/my/directory</span> -type f -exec <span style="color: red;">chmod 644</span> '{}' +</pre>
</div>
<p>Change the red parts to fit your needs. If you wonder what that &#8216;{}&#8217; is..well, you may have guessed that it&#8217;s where the filelist is being put when exec&#8217;ing the given command on each file.</p>
<p>You can also first try the command without chmod&#8217;ing to see that it affects the right files:</p>
<div style="margin: 5px 20px 20px;">
<div style="margin-bottom: 2px;">Code:</div>
<pre style="border: 1px inset; margin: 0px -99999px 0px 0px; padding: 3px; overflow: auto; width: 98%; height: 34px; text-align: left;" dir="ltr">find /my/directory -type f</pre>
</div>
<p>The above would find all regular files (not directories, for example) from within /my/directory.</p>
<p>If the command happens to throw you an error about the exec part, chances are it&#8217;s because of the plus sign (+) that ends the exec part. In this case try replacing the plus (+) with an escaped semicolon (\;) so it becomes</p>
<div style="margin: 5px 20px 20px;">
<div style="margin-bottom: 2px;">Code:</div>
<pre style="border: 1px inset; margin: 0px -99999px 0px 0px; padding: 3px; overflow: auto; width: 98%; height: 34px; text-align: left;" dir="ltr">find /my/directory -type f -exec chmod 644 '{}' \;</pre>
</div>
<p>On some machines I remember that it worked with semicolon (which needs a backslash in front of it, to protect it from being interpreted by your shell), but on my current installation it&#8217;s the plus sign (without a backslash).</p>
<p>Another way would probably be to list all regular files on the directory (using either find or any tool that can just list all files without directories) and then pipe the output to xargs with which the chmod was run.&#8221;</p>
<p>and from http://movabletripe.com/archive/recursively-chmod-directories-only/</p>
<p>&#8221;</p>
<p><small>June 19th, 2006 <!-- by Adam --></small></p>
<p><code>find . -type d -exec chmod 755 {} \;</code></p>
<p>This will recursively search your directory tree (starting at dir ‘dot’) and chmod 755 all directories only.</p>
<p>Similarly, the following will chmod all files only (and ignore the directories):</p>
<p><code>find . -type f -exec chmod 644 {} \;</code></p>
<p>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.norsetech.net/how-to-chmod-on-files-but-not-directories-inodes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to automatically reload a page when it is finished reloading, using javascript</title>
		<link>http://kb.norsetech.net/how-to-automatically-reload-a-page-when-it-is-finished-reloading-using-javascript/</link>
		<comments>http://kb.norsetech.net/how-to-automatically-reload-a-page-when-it-is-finished-reloading-using-javascript/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 20:02:38 +0000</pubDate>
		<dc:creator>kb-admin</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Enjoy]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[language javascript]]></category>
		<category><![CDATA[location]]></category>
		<category><![CDATA[lt]]></category>
		<category><![CDATA[page loads]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[script language]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[way]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web page html]]></category>
		<category><![CDATA[yout]]></category>

		<guid isPermaLink="false">http://norsetech.net/kb/?p=42</guid>
		<description><![CDATA[So, you have a web page (HTML, PHP, etc.) that you want to reload over and over. And at the same time, you want to be sure that the entire page loads before it starts the loop over again. Here is a javascript way to do just that. Simply include this script in yout HTML [...]]]></description>
			<content:encoded><![CDATA[<p>So, you have a web page (HTML, PHP, etc.) that you want to reload over and over. And at the same time, you want to be sure that the entire page loads before it starts the loop over again. Here is a javascript way to do just that.  Simply include this script in yout HTML code, and watch the magic:</p>
<pre>&lt;<span class="start-tag">script</span><span class="attribute-name"> language</span>=<span class="attribute-value">"javascript"</span>&gt;
window.onload=new Function("window.location.reload();");
&lt;/<span class="end-tag">script</span>&gt;</pre>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.norsetech.net/how-to-automatically-reload-a-page-when-it-is-finished-reloading-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

