<?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>P for Positive &#187; Programming</title>
	<atom:link href="http://www.pforpositive.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pforpositive.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 15 Jun 2010 03:53:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Trim Last Character(s) from a String in Javascript</title>
		<link>http://www.pforpositive.com/2008/04/trim-last-characters-from-a-string-in-javascript/</link>
		<comments>http://www.pforpositive.com/2008/04/trim-last-characters-from-a-string-in-javascript/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 03:47:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.pforpositive.com/?p=76</guid>
		<description><![CDATA[Today, I had a need to join comma separated strings in Javascript which turned out to be very easy. I wrote something similar to this
for(var i=0; i &#60; length; i++){
string=string+labels[i]+&#8221;,&#8221;
}
where string was defined as a var and labels as array.
The difficult part was to remove the last comma. After googling for fifteen minuted, I decided [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I had a need to join comma separated strings in Javascript which turned out to be very easy. I wrote something similar to this</p>
<p>for(var i=0; i &lt; length; i++){<br />
string=string+labels[i]+&#8221;,&#8221;<br />
}</p>
<p>where string was defined as a var and labels as array.</p>
<p>The difficult part was to remove the last comma. After googling for fifteen minuted, I decided to read the documentation on Strings and found the substring function which turned out to be perfect solution.</p>
<p>string = string.substring(0, string.length-1)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pforpositive.com/2008/04/trim-last-characters-from-a-string-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create .htaccess file in Vista</title>
		<link>http://www.pforpositive.com/2008/04/create-htaccess-file-in-vista/</link>
		<comments>http://www.pforpositive.com/2008/04/create-htaccess-file-in-vista/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 03:31:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.pforpositive.com/?p=75</guid>
		<description><![CDATA[I enjoy using command line, especially for things that I cannot do using GUI. Today, I spent good 15 minutes trying to create .htaccess file in c:\xampp\htdocs directory on my Vista machine. I guess Vista expects a file name before the period and therefore kept saying &#8216;You must type a file name&#8217;. This DOS command [...]]]></description>
			<content:encoded><![CDATA[<p>I enjoy using command line, especially for things that I cannot do using GUI. Today, I spent good 15 minutes trying to create .htaccess file in c:\xampp\htdocs directory on my Vista machine. I guess Vista expects a file name before the period and therefore kept saying &#8216;You must type a file name&#8217;. This DOS command did the trick:</p>
<p>C:\xampp\htdocs&gt; type nul &gt; .htaccess</p>
<p>Once the file was created, I was able to edit it in notepad <img src='http://www.pforpositive.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pforpositive.com/2008/04/create-htaccess-file-in-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check if Password is Alphanumeric &#8211; PHP</title>
		<link>http://www.pforpositive.com/2008/04/check-if-password-is-alphanumeric-php/</link>
		<comments>http://www.pforpositive.com/2008/04/check-if-password-is-alphanumeric-php/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 02:39:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.pforpositive.com/?p=74</guid>
		<description><![CDATA[A couple of weeks ago, I spent several hours trying to figure out how to check if a password is alphanumeric or not. Following is a function that worked along with explanation.
1 function checkPasswordIsAlphaNumeric($password1){
2 $pattern1 = &#8220;/[a-zA-Z]+/&#8221;;
3 $pattern2 = &#8220;/[0-9]+/&#8221;;
4 return ((preg_match($pattern1, $password1)) &#38;&#38; (preg_match($pattern2, $password1)));
5 }
Line 1 is simple. We declare a function &#8216;checkPasswordIsAlphaNumeric&#8217; [...]]]></description>
			<content:encoded><![CDATA[<div>A couple of weeks ago, I spent several hours trying to figure out how to check if a password is alphanumeric or not. Following is a function that worked along with explanation.</div>
<p>1 function checkPasswordIsAlphaNumeric($password1){<br />
2 $pattern1 = &#8220;/[a-zA-Z]+/&#8221;;<br />
3 $pattern2 = &#8220;/[0-9]+/&#8221;;<br />
4 return ((preg_match($pattern1, $password1)) &amp;&amp; (preg_match($pattern2, $password1)));<br />
5 }</p>
<p>Line 1 is simple. We declare a function &#8216;checkPasswordIsAlphaNumeric&#8217; which takes one argument, password1.</p>
<p>Let&#8217;s tease apart the pattern defined in line 2:</p>
<p>- the expression should be enclosed in the delimiters. A common delimiter is forward slash.</p>
<p>- square brackets are used to match a set of characters, also called character class. Any one of the characters inside the square brackets is matched.</p>
<p>- a-zA-Z matches a through z (lower case) or A through Z (upper case)</p>
<p>- + matches one or more of the preceeding pattern</p>
<p>Putting it all together, /[a-zA-Z]+/ matches one or more characters from a through z OR A through Z.</p>
<p>Line 3 is similar to line 2. It matches one or more characters in the range 0 to 9.</p>
<div>Line 4 checks for the presence of an alphabet in the &#8216;$password1&#8242; string AND also checks for the presence of a digit in &#8216;$password1&#8242; string. If it finds at least one alphabet and at least one digit, it returns true. Otherwise, it returns false.</div>
<p>Following are some references that helped me decode regular expressions:</p>
<p><a href="http://java.sun.com/docs/books/tutorial/essential/regex/char_classes.html">http://java.sun.com/docs/books/tutorial/essential/regex/char_classes.html</a><br />
<a href="http://www.webcheatsheet.com/php/regular_expressions.php">http://www.webcheatsheet.com/php/regular_expressions.php</a><br />
<a href="http://www.phphacks.com/content/view/31/33/">http://www.phphacks.com/content/view/31/33/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pforpositive.com/2008/04/check-if-password-is-alphanumeric-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
