<?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>ByteChemist &#187; Web Development</title>
	<atom:link href="http://www.bytechemist.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bytechemist.com</link>
	<description></description>
	<lastBuildDate>Sun, 18 Oct 2009 22:50:38 +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>Using SVN copy to branch or tag within a repository</title>
		<link>http://www.bytechemist.com/2009/03/22/using-svn-copy-to-branch-or-tag-within-a-repository/</link>
		<comments>http://www.bytechemist.com/2009/03/22/using-svn-copy-to-branch-or-tag-within-a-repository/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 19:45:44 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/?p=23</guid>
		<description><![CDATA[To &#8220;branch&#8221; or &#8220;tag&#8221; within a repository, use svn copy. The syntax is simple. svn copy &#123;SRC&#125; &#123;DST&#125; The source and destination can be either a working copy path or full URL in any combination. So to tag a revision from trunk the following command could be used. svn copy --username myusername --password mypassword http://domain.com/svn/trunk [...]]]></description>
			<content:encoded><![CDATA[<p>To &#8220;branch&#8221; or &#8220;tag&#8221; within a repository, use svn copy.  The syntax is simple.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> copy <span style="color: #7a0874; font-weight: bold;">&#123;</span>SRC<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>DST<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>The source and destination can be either a working copy path or full URL in any combination.  So to tag a revision from trunk the following command could be used.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> copy <span style="color: #660033;">--username</span> myusername <span style="color: #660033;">--password</span> mypassword http:<span style="color: #000000; font-weight: bold;">//</span>domain.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>trunk http:<span style="color: #000000; font-weight: bold;">//</span>domain.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>tag<span style="color: #000000; font-weight: bold;">/</span>0.1.1332 <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;commit message&quot;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2009/03/22/using-svn-copy-to-branch-or-tag-within-a-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recover the MySQL Root Password in Linux</title>
		<link>http://www.bytechemist.com/2008/06/30/recover-the-mysql-root-password-in-linux/</link>
		<comments>http://www.bytechemist.com/2008/06/30/recover-the-mysql-root-password-in-linux/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 23:06:05 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/06/30/recover-the-mysql-root-password-in-linux/</guid>
		<description><![CDATA[Step 1 &#8211; At the linux shell, stop the current mysqld process, start the mysqld_safe process with &#8211;skip-grant-tables switch and login as root (no password). /etc/init.d/mysql stop mysqld_safe --skip-grant-tables &#38; mysql -u root Step 2 &#8211; At the mysql shell set the root password and flush privileges. USE mysql; UPDATE user SET password=PASSWORD&#40;&#34;new-password-here&#34;&#41; WHERE User='root'; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Step 1</strong> &#8211; At the linux shell, stop the current mysqld process, start the mysqld_safe process with &#8211;skip-grant-tables switch and login as root (no password).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mysql stop
mysqld_safe <span style="color: #660033;">--skip-grant-tables</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
mysql <span style="color: #660033;">-u</span> root</pre></div></div>

<p><strong>Step 2</strong> &#8211; At the mysql shell set the root password and flush privileges.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">USE</span> mysql<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">UPDATE</span> <span style="color: #000099;">user</span> <span style="color: #990099; font-weight: bold;">SET</span> <span style="color: #000099;">password</span><span style="color: #CC0099;">=</span><span style="color: #000099;">PASSWORD</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">&quot;new-password-here&quot;</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">WHERE</span> <span style="color: #000099;">User</span><span style="color: #CC0099;">=</span><span style="color: #008000;">'root'</span><span style="color: #000033;">;</span>
FLUSH <span style="color: #990099; font-weight: bold;">PRIVILEGES</span><span style="color: #000033;">;</span>
QUIT<span style="color: #000033;">;</span></pre></div></div>

<p><strong>Step 3</strong> &#8211; Back at the linux shell stop the mysqld_safe process and start the normal mysqld process.  At this point you should be able to successfully login as root using the password from Step 2.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mysql stop
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mysql start
mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/06/30/recover-the-mysql-root-password-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set MySQL Root Password</title>
		<link>http://www.bytechemist.com/2008/06/30/set-mysql-root-password/</link>
		<comments>http://www.bytechemist.com/2008/06/30/set-mysql-root-password/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 22:45:11 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/06/30/set-mysql-root-password/</guid>
		<description><![CDATA[To reset the MySQL root password, login to the mysql shell and run the following commands. SET PASSWORD FOR root@localhost=PASSWORD&#40;'RootPasswordHere'&#41;; FLUSH PRIVILEGES;]]></description>
			<content:encoded><![CDATA[<p>To reset the MySQL root password, login to the mysql shell and run the following commands.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">SET</span> <span style="color: #000099;">PASSWORD</span> FOR root@localhost<span style="color: #CC0099;">=</span><span style="color: #000099;">PASSWORD</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'RootPasswordHere'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
FLUSH <span style="color: #990099; font-weight: bold;">PRIVILEGES</span><span style="color: #000033;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/06/30/set-mysql-root-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grant MySQL Privileges</title>
		<link>http://www.bytechemist.com/2008/06/30/grant-mysql-privileges/</link>
		<comments>http://www.bytechemist.com/2008/06/30/grant-mysql-privileges/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 22:41:32 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/06/30/grant-mysql-privileges/</guid>
		<description><![CDATA[To grant all privileges to a user from any location login to the mysql shell and run the following queries. GRANT ALL PRIVILEGES ON *.* TO username@localhost IDENTIFIED BY 'PasswordHere' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO username@&#34;%&#34; IDENTIFIED BY 'PasswordHere' WITH GRANT OPTION; FLUSH PRIVILEGES;]]></description>
			<content:encoded><![CDATA[<p>To grant all privileges to a user from any location login to the mysql shell and run the following queries.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">ALL</span> <span style="color: #990099; font-weight: bold;">PRIVILEGES</span> <span style="color: #990099; font-weight: bold;">ON</span> <span style="color: #CC0099;">*</span>.<span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">TO</span> username@localhost IDENTIFIED BY <span style="color: #008000;">'PasswordHere'</span> <span style="color: #990099; font-weight: bold;">WITH</span> <span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">OPTION</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">ALL</span> <span style="color: #990099; font-weight: bold;">PRIVILEGES</span> <span style="color: #990099; font-weight: bold;">ON</span> <span style="color: #CC0099;">*</span>.<span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">TO</span> username@<span style="color: #008000;">&quot;<span style="color: #008080; font-weight: bold;">%</span>&quot;</span> IDENTIFIED BY <span style="color: #008000;">'PasswordHere'</span> <span style="color: #990099; font-weight: bold;">WITH</span> <span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">OPTION</span><span style="color: #000033;">;</span>
FLUSH <span style="color: #990099; font-weight: bold;">PRIVILEGES</span><span style="color: #000033;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/06/30/grant-mysql-privileges/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Cache Control using mod_expires with Expires By Type</title>
		<link>http://www.bytechemist.com/2008/06/27/apache-cache-control-using-mod_expires-with-expires-by-type/</link>
		<comments>http://www.bytechemist.com/2008/06/27/apache-cache-control-using-mod_expires-with-expires-by-type/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 17:14:54 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/06/27/apache-cache-control-using-mod_expires-with-expires-by-type/</guid>
		<description><![CDATA[Use Apache&#8217;s mod_expires to explicitly set the expiration of a file by it&#8217;s type. This will enable to browser to cache these static assets and greatly increase performance. &#60;IfModule mod_expires.c&#62; ExpiresActive on ExpiresDefault &#34;now&#34; ExpiresByType text/html &#34;now&#34; ExpiresByType text/xml &#34;now&#34; ExpiresByType text/css &#34;access plus 8 hours&#34; ExpiresByType text/plain &#34;access plus 8 hours&#34; ExpiresByType application/x-javascript &#34;access [...]]]></description>
			<content:encoded><![CDATA[<p>Use Apache&#8217;s mod_expires to explicitly set the expiration of a file by it&#8217;s type.  This will enable to browser to cache these static assets and greatly increase performance.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_expires.c<span style="color: #000000; font-weight: bold;">&gt;</span>
    ExpiresActive on
    ExpiresDefault <span style="color: #ff0000;">&quot;now&quot;</span>
    ExpiresByType text<span style="color: #000000; font-weight: bold;">/</span>html <span style="color: #ff0000;">&quot;now&quot;</span>
    ExpiresByType text<span style="color: #000000; font-weight: bold;">/</span>xml <span style="color: #ff0000;">&quot;now&quot;</span>
    ExpiresByType text<span style="color: #000000; font-weight: bold;">/</span>css <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType text<span style="color: #000000; font-weight: bold;">/</span>plain <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType application<span style="color: #000000; font-weight: bold;">/</span>x-javascript <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType application<span style="color: #000000; font-weight: bold;">/</span>x-shockwave-flash <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType application<span style="color: #000000; font-weight: bold;">/</span>pdf <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType image<span style="color: #000000; font-weight: bold;">/</span>gif <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType image<span style="color: #000000; font-weight: bold;">/</span>png <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType image<span style="color: #000000; font-weight: bold;">/</span>jpeg <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType image<span style="color: #000000; font-weight: bold;">/</span>x-icon <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType video<span style="color: #000000; font-weight: bold;">/</span>x-flv <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType video<span style="color: #000000; font-weight: bold;">/</span>quicktime <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/06/27/apache-cache-control-using-mod_expires-with-expires-by-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the ternary operator in PHP</title>
		<link>http://www.bytechemist.com/2008/01/11/using-the-ternary-operator-in-php/</link>
		<comments>http://www.bytechemist.com/2008/01/11/using-the-ternary-operator-in-php/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 02:43:15 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/01/11/using-the-ternary-operator-in-php/</guid>
		<description><![CDATA[The ternary operator is an excellent and often underutilized way to quickly evaluate a variable in place of an if/else statement. The syntax is clean and can greatly simplify code. &#40; expr1 &#41; ? &#40; expr2 &#41; : &#40; expr3 &#41; Take the following code for example where we determine how to greet a user. [...]]]></description>
			<content:encoded><![CDATA[<p>The ternary operator is an excellent and often underutilized way to quickly evaluate a variable in place of an if/else statement.  The syntax is clean and can greatly simplify code.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#40;</span> expr1 <span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span> expr2 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span> expr3 <span style="color: #009900;">&#41;</span></pre></div></div>

<p>Take the following code for example where we determine how to greet a user.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Guest&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The code above is simple enough but let&#8217;s see how we can improve it by refactoring using a ternary operator.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;Guest&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Update 1:</strong> There is a <a href="http://php.dzone.com/news/php-shorthand-if-else-examples">great collection</a> of examples over at dzone.</p>
<p><strong>Update 2:</strong> Found another nice <a href="http://php.dzone.com/news/tips-tricks-learning-ternary-o">tips and tricks</a> post over at dzone.</p>
<p><strong>Update 3:</strong> One more to <a href="http://mikebernat.com/blog/The_Ternary_Operator">check out</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/01/11/using-the-ternary-operator-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
