<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Knowledge is Power</title>
	<atom:link href="http://learntechskill.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://learntechskill.wordpress.com</link>
	<description>Be a student forever...and learn many things</description>
	<lastBuildDate>Thu, 19 May 2011 11:45:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='learntechskill.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Knowledge is Power</title>
		<link>http://learntechskill.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://learntechskill.wordpress.com/osd.xml" title="Knowledge is Power" />
	<atom:link rel='hub' href='http://learntechskill.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to validate json object in php</title>
		<link>http://learntechskill.wordpress.com/2011/05/19/how-to-validate-json-object-in-php/</link>
		<comments>http://learntechskill.wordpress.com/2011/05/19/how-to-validate-json-object-in-php/#comments</comments>
		<pubDate>Thu, 19 May 2011 11:07:00 +0000</pubDate>
		<dc:creator>krishnabhaya</dc:creator>
				<category><![CDATA[JS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Js]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://learntechskill.wordpress.com/?p=63</guid>
		<description><![CDATA[Here is the example code for json object validation in php It can be used in other languages to just the concern is language should support regular expression and json encode/decode functions. if(preg_match('/^\{.*\}$/',$message)){ $objs = json_decode( stripslashes($message)); if($objs){ foreach ($objs as $ob) { if($ob) { $is_json = true; break; } } } //json but empty [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=63&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is the example code for json object validation in php<br />
It can be used in other languages to just the concern is language should support regular expression<br />
and json encode/decode functions.</p>
<pre>
if(preg_match('/^\{.*\}$/',$message)){
        $objs = json_decode( stripslashes($message));
        if($objs){
            foreach ($objs as $ob)
            {
                if($ob)	{
                    $is_json = true;
                    break;
                }
            }
        }
        //json but empty values or null values so treat them as normal text
        //$is_json = false;
    }</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learntechskill.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learntechskill.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learntechskill.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learntechskill.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learntechskill.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learntechskill.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learntechskill.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learntechskill.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learntechskill.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learntechskill.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learntechskill.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learntechskill.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learntechskill.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learntechskill.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=63&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learntechskill.wordpress.com/2011/05/19/how-to-validate-json-object-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4fdfab5321a16d09375c9d2d713de7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krishnabhaya</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Regular expressions in MySQL</title>
		<link>http://learntechskill.wordpress.com/2010/11/08/using-regular-expressions-in-mysql/</link>
		<comments>http://learntechskill.wordpress.com/2010/11/08/using-regular-expressions-in-mysql/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 05:10:06 +0000</pubDate>
		<dc:creator>krishnabhaya</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://learntechskill.wordpress.com/?p=55</guid>
		<description><![CDATA[We ( developers ) are so used to work with Regular expression that we want it to use everywhere. It&#8217;s a great feature rather should say technique and specially very powerful. It&#8217;s supported by all languages and used wordwide. I was not aware of MySQL support for regular expression using REGEXP operator. This post is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=55&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We ( developers ) are so used to work with Regular expression that we want it to use everywhere.<br />
It&#8217;s a great feature rather should say technique and specially very powerful. It&#8217;s supported by all languages and used wordwide.</p>
<p>I was not aware of MySQL support for regular expression using REGEXP operator. This post is to all people who might not aware of usage of regular expressions in MySQL.</p>
<p>MySQL has quite different syntax to handle it in sql query.It&#8217;s like this</p>
<blockquote><p>SELECT * FROM <em>tbl_name</em> WHERE <em>field_name</em> REGEXP &#8216;[[:digit:]]{3}$&#8217;;</p></blockquote>
<p><strong>Explaination:</strong> It would select records where field value has mininum 3 digits( 0-9 ) and REGEXP is the reserved word.</p>
<p>similar query with some special character as regular expression pattern</p>
<blockquote><p>SELECT * FROM <em>tbl_name</em> WHERE <em>field_name</em> REGEXP &#8216;[[.vertical-line.]][[.vertical-line.]][[:digit:]]{3}&#8217; ;</p></blockquote>
<p><strong>Explaination:</strong> It would select records where field value has mininum 3 digits( 0-9 ), prefixed with &#8216;||&#8217; .<br />
exmple value :  &#8216;||100&#8242;</p>
<p>You can find more details for the same under <a href="http://dev.mysql.com/doc/refman/5.0/en/regexp.html">MySQL documentation : Regular Expressions section </a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learntechskill.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learntechskill.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learntechskill.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learntechskill.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learntechskill.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learntechskill.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learntechskill.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learntechskill.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learntechskill.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learntechskill.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learntechskill.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learntechskill.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learntechskill.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learntechskill.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=55&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learntechskill.wordpress.com/2010/11/08/using-regular-expressions-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4fdfab5321a16d09375c9d2d713de7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krishnabhaya</media:title>
		</media:content>
	</item>
		<item>
		<title>Mysql LOCATE and SUBSTRING</title>
		<link>http://learntechskill.wordpress.com/2009/06/08/mysql-locate-and-substring/</link>
		<comments>http://learntechskill.wordpress.com/2009/06/08/mysql-locate-and-substring/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 11:09:34 +0000</pubDate>
		<dc:creator>krishnabhaya</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[mysql string functions]]></category>

		<guid isPermaLink="false">http://learntechskill.wordpress.com/?p=48</guid>
		<description><![CDATA[hello friends, mysql provides us many inbuilt functions to get accurate result according to our requirement. Migrating old data with new fields and structure is quite cumbersome and time consuming. Sometimes, we need to update data to adjust it with our new requirement, in that case mysql functions helps a lot. We can do specific [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=48&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>hello friends, mysql provides us many inbuilt functions to get accurate result according to our requirement. Migrating old data with new fields and structure is quite cumbersome and time consuming. Sometimes, we need to update data to adjust it with our new requirement, in that case mysql functions helps a lot. We can do specific operation on lots of existing records by a single query.</p>
<p>As per requirement, I need to add a new field for my table with username initials. In this case, we have already 500 users, and their transaction records.  I want to update records for existing user records. I got solution using mysql inbuilt function. Solution is like this</p>
<p>Table name: Users<br />
Fields: userid, username, user_initial (newly added field)</p>
<p>username includes &#8220;firstname lastname&#8221; combination<br />
i.e. &#8220;xyz pqr&#8221;, it should update record with initials &#8220;xp&#8221;</p>
<p><strong>Query:</strong><br />
UPDATE Users set user_initial= concat( substring(username,1,1), substring(username, locate(&#8216; &#8216;,username)+1, 1) )</p>
<p>here, it wil take first letter of string and concate it with second initial, where   for finding second initial it will first locate position of space in string and then get first letter of it using substring.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learntechskill.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learntechskill.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learntechskill.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learntechskill.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learntechskill.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learntechskill.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learntechskill.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learntechskill.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learntechskill.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learntechskill.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learntechskill.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learntechskill.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learntechskill.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learntechskill.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=48&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learntechskill.wordpress.com/2009/06/08/mysql-locate-and-substring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4fdfab5321a16d09375c9d2d713de7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krishnabhaya</media:title>
		</media:content>
	</item>
		<item>
		<title>Using  input_in_place_editor_tag of symfony</title>
		<link>http://learntechskill.wordpress.com/2009/06/08/using-input_in_place_editor_tag-of-symfony/</link>
		<comments>http://learntechskill.wordpress.com/2009/06/08/using-input_in_place_editor_tag-of-symfony/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 10:52:14 +0000</pubDate>
		<dc:creator>krishnabhaya</dc:creator>
				<category><![CDATA[symfony]]></category>
		<category><![CDATA[input_in_place_editor_tag]]></category>

		<guid isPermaLink="false">http://learntechskill.wordpress.com/?p=46</guid>
		<description><![CDATA[input_in_place_editor_tag of symfony is one of the nice feature of ajax. But we have to take care to pass parameters, set values to use it. It contains following parameters: name of element URI of an action that is called when update done cols and rows to show editable area (textarea) loadTextURL: The URI of an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=46&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>input_in_place_editor_tag of symfony is one of the nice feature of ajax. But we have to take care to pass parameters, set values to use it. It contains following parameters:</p>
<ol>
<li>name of element</li>
<li>URI of an action that is called when update done</li>
<li>cols and rows to show editable area (textarea)</li>
<li>loadTextURL: The URI of an action that is called to display the text to edit.</li>
</ol>
<p>example:</p>
<p>echo input_in_place_editor_tag(&#8216;price&#8217;, &#8216;item/updateOrder?id=&#8217;.$id.&#8217;, array(&#8216;size=&gt;&#8217;5&#8242;, &#8216;maxlength&#8217;=&gt;&#8217;10&#8242;, &#8216;highlightcolor&#8217;=&gt;&#8217;#B0E0E6&#8242;,<br />
&#8216;loadTextURL&#8217;=&gt;url_for(&#8216;item/getURLValue?id=&#8217;.$id.&#8217;&amp;type=price&#8217;)<br />
));</p>
<p>Please note here, i have used &#8216;url_for&#8217; here for loadTextURL because, i have faced problem of getting value, in case of your application is full ajax application, and it may contain different URL in address bar of browser. If your browser has some other url with sub modules and action, and that time specifying simple module/action will not work as it will search for that module/action according to url in browser (module in other module). To solve this problem, you have to make it independent of browser url and that can be done using &#8216;url_for&#8217;.  We will get full URL using it so there is no chance of confusion with browser url during ajax call.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learntechskill.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learntechskill.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learntechskill.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learntechskill.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learntechskill.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learntechskill.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learntechskill.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learntechskill.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learntechskill.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learntechskill.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learntechskill.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learntechskill.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learntechskill.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learntechskill.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=46&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learntechskill.wordpress.com/2009/06/08/using-input_in_place_editor_tag-of-symfony/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4fdfab5321a16d09375c9d2d713de7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krishnabhaya</media:title>
		</media:content>
	</item>
		<item>
		<title>Get list of libraries installed in Perl</title>
		<link>http://learntechskill.wordpress.com/2009/05/22/get-list-of-libraries-installed-in-perl/</link>
		<comments>http://learntechskill.wordpress.com/2009/05/22/get-list-of-libraries-installed-in-perl/#comments</comments>
		<pubDate>Fri, 22 May 2009 10:16:30 +0000</pubDate>
		<dc:creator>krishnabhaya</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[command]]></category>

		<guid isPermaLink="false">http://learntechskill.wordpress.com/?p=43</guid>
		<description><![CDATA[CPAN provides very nice facility for installing libraries from terminal only. It shows library is up to date, if we try to re-install the same library. Though we sometimes require to get list of libraries installed on server as list, as checking each library individually is cubersome. I came to know about two command provided [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=43&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>CPAN provides very nice facility for installing libraries from terminal only. It shows  library is up to date, if we try to re-install the same library. Though we sometimes require to get list of libraries installed on server as list, as checking each library individually is cubersome. I came to know about two command provided by perl, which shows list of libraries.</p>
<p><strong>1.perldoc perlmodlib</strong></p>
<p>It will show list of libraries which are part of perl installation and default installed.</p>
<p><strong>2.perldoc perllocal</strong></p>
<p>It will show list of libraries installed and which are not part of default libraries included at time of perl installation.<strong><br />
</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learntechskill.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learntechskill.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learntechskill.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learntechskill.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learntechskill.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learntechskill.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learntechskill.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learntechskill.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learntechskill.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learntechskill.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learntechskill.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learntechskill.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learntechskill.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learntechskill.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=43&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learntechskill.wordpress.com/2009/05/22/get-list-of-libraries-installed-in-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4fdfab5321a16d09375c9d2d713de7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krishnabhaya</media:title>
		</media:content>
	</item>
		<item>
		<title>Can&#8217;t locate installed library in Perl</title>
		<link>http://learntechskill.wordpress.com/2009/05/22/cant-locate-installed-library-in-perl/</link>
		<comments>http://learntechskill.wordpress.com/2009/05/22/cant-locate-installed-library-in-perl/#comments</comments>
		<pubDate>Fri, 22 May 2009 10:03:51 +0000</pubDate>
		<dc:creator>krishnabhaya</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://learntechskill.wordpress.com/?p=41</guid>
		<description><![CDATA[Sometimes it happens that we installed any library/module (in case of mod_perl) successfully, but then also, internal server error comes (500) and shows, that server can&#8217;t locate that library. At that time first check the server log, for missing library name and also check location it is searching the library. Normally, server searchs in @INC, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=41&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes it happens that we installed any library/module (in case of mod_perl) successfully, but then also, internal server error comes (500) and  shows, that server can&#8217;t locate that library. At that time first check the server log, for missing library name and also check location it is searching the library. Normally, server searchs in  @INC, default location where all libraries stored. But some libraries, due to some version problem or any reason not located on same location at time of installation.  To use the same library in our script file, we have to explicitly tell server to check other locations also for locating libraries. That can be done like as follows:</p>
<p><code>* assuming you are having root access on server. so can run commands on terminal.<br />
</code><br />
You will get library name and path from error log (in case of internal server error)</p>
<p><strong>Example:</strong><br />
I want to use XML::Writer library.<br />
It&#8217;s located in /usr/local/lib/perl5/site_perl/5.8.9/XML/Writer.pm</p>
<p><strong>Server Error like :</strong></p>
<p>Can&#8217;t locate XML/Writer.pm in @INC (@INC contains: /usr/local/apache/perl</p>
<p>1. Get exact location of library.<br />
<strong>command :</strong><br />
locate XML/Writer.pm</p>
<p><strong>result : </strong><br />
/root/.cpan/build/XML-Writer-0.606-85Lgu7/Writer.pm<br />
/root/.cpan/build/XML-Writer-0.606-85Lgu7/blib/lib/XML/Writer.pm<br />
/usr/lib/perl5/vendor_perl/5.8.8/XML/Handler/CanonXMLWriter.pm<br />
/usr/lib/perl5/vendor_perl/5.8.8/XML/Handler/XMLWriter.pm<br />
/usr/local/lib/perl5/site_perl/5.8.9/XML/Writer.pm</p>
<p>2. Check the result of command select the path exactly matching with your library. Then include it&#8217;s parent directory to your file, so server will search for library in that directory also.</p>
<p>example: .pm ,.pl file</p>
<p><strong>start.pm</strong><br />
use lib qw(/usr/local/lib/perl5/site_perl/5.8.9)<br />
use XML::Writer;</p>
<p>3. Now, server will search &#8220;/usr/local/lib/perl5/site_perl/5.8.9&#8243; directory also (including default @INC) to locate libraries, so it can find and locate particular library.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learntechskill.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learntechskill.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learntechskill.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learntechskill.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learntechskill.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learntechskill.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learntechskill.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learntechskill.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learntechskill.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learntechskill.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learntechskill.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learntechskill.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learntechskill.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learntechskill.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=41&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learntechskill.wordpress.com/2009/05/22/cant-locate-installed-library-in-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4fdfab5321a16d09375c9d2d713de7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krishnabhaya</media:title>
		</media:content>
	</item>
		<item>
		<title>Redirect from HTTPS to HTTP</title>
		<link>http://learntechskill.wordpress.com/2009/05/11/redirect-from-https-to-http/</link>
		<comments>http://learntechskill.wordpress.com/2009/05/11/redirect-from-https-to-http/#comments</comments>
		<pubDate>Mon, 11 May 2009 06:28:32 +0000</pubDate>
		<dc:creator>krishnabhaya</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[HTTP]]></category>

		<guid isPermaLink="false">http://learntechskill.wordpress.com/?p=36</guid>
		<description><![CDATA[This post is related to my old post. We do not require &#8220;https&#8221; for all pages. So there is a stage where we need to redirect page from secure to unsecure page. Here is a PHP code to get request detail and redirect it to http request. $encport =&#8217;443&#8242;; if($_SERVER['SERVER_PORT'] !== $encport &#124;&#124; $_SERVER['HTTPS'] !== [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=36&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post is related to my old post. We do not require &#8220;https&#8221; for all pages. So there is a stage where we need to redirect page from secure to unsecure page. Here is a PHP code to get request detail and redirect it to http request.</p>
<p>$encport =&#8217;443&#8242;;</p>
<p>if($_SERVER['SERVER_PORT'] !== $encport || $_SERVER['HTTPS'] !== &#8220;on&#8221;)<br />
{<br />
header(&#8220;Location: https://&#8221;.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);exit;<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learntechskill.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learntechskill.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learntechskill.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learntechskill.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learntechskill.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learntechskill.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learntechskill.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learntechskill.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learntechskill.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learntechskill.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learntechskill.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learntechskill.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learntechskill.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learntechskill.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=36&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learntechskill.wordpress.com/2009/05/11/redirect-from-https-to-http/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4fdfab5321a16d09375c9d2d713de7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krishnabhaya</media:title>
		</media:content>
	</item>
		<item>
		<title>Implementing SSL with Symfony</title>
		<link>http://learntechskill.wordpress.com/2009/04/15/implementing-ssl-with-symfony/</link>
		<comments>http://learntechskill.wordpress.com/2009/04/15/implementing-ssl-with-symfony/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 10:45:37 +0000</pubDate>
		<dc:creator>krishnabhaya</dc:creator>
				<category><![CDATA[symfony]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://learntechskill.wordpress.com/?p=19</guid>
		<description><![CDATA[Hi, all. Symfony provides easy way to implement SSL for selected pages/requests/action of application. For this we have to do changes in following files apps\frontend\config\app.yml &#8211; define the modules and action files that are to be put to secure site app.yml all: ssl: insecure_host: one.mydomain.com secure_host: secure.mydomain.com #it can be same as insecure host secure_actions: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=19&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi, all.<br />
Symfony provides easy way to implement SSL for selected pages/requests/action of application.</p>
<p>For this we have to do changes in following files</p>
<p>apps\frontend\config\app.yml &#8211;  define the<br />
modules and action files that are to be put to secure site</p>
<p><strong>app.yml</strong><br />
all:<br />
ssl:<br />
insecure_host:    one.mydomain.com<br />
secure_host:      secure.mydomain.com<br />
#it can be same as insecure host</p>
<p>secure_actions:<br />
- { module: register, action: add }<br />
- { module: auth, action: login }<br />
- { module: user, action: changepassword }</p>
<p>apps\frontend\config\filters.yml &#8211; add sslfilter</p>
<p><strong>filters.yml</strong><br />
sslFilter:<br />
class:  sslFilter</p>
<p>apps\frontend\lib\sslFilter.class.php &#8211; library file for ssl</p>
<p><strong>sslFilter.class.php</strong></p>
<div style="overflow:scroll;width:650px;">
<pre class="php php" style="font-family:monospace;"><span style="color:rgb(0,0,255);font-style:italic;">/**
 * Filter for redirecting to SSL for the pages that need it
 *
 * @author James McGlinn &lt;james@mcglinn.org&gt;
 * @version 2
 */</span>
<span style="color:rgb(0,0,0);font-weight:bold;">class</span> sslFilter <span style="color:rgb(0,0,0);font-weight:bold;">extends</span> sfFilter
<span style="color:rgb(0,153,0);">{</span>
  <span style="color:rgb(0,0,255);font-style:italic;">/**
   * Execute filter
   *
   * @param FilterChain $filterChain The symfony filter chain
   */</span>

  <span style="color:rgb(0,0,0);font-weight:bold;">public</span> <span style="color:rgb(0,0,0);font-weight:bold;">function</span> execute <span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$filterChain</span><span style="color:rgb(0,153,0);">)</span>
  <span style="color:rgb(0,153,0);">{</span>
    <span style="color:rgb(102,102,102);font-style:italic;">// Only execute this filter once</span>
    <span style="color:rgb(177,177,0);">if</span> <span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$this</span><span style="color:rgb(51,153,51);">-&gt;</span><span style="color:rgb(0,64,0);">isFirstCall</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(51,153,51);">&amp;&amp;</span> SF_ENVIRONMENT <span style="color:rgb(51,153,51);">!=</span> <span>'dev'</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(0,153,0);">{</span>

      <span style="color:rgb(102,102,102);font-style:italic;">// Array of modules/actions that require move to SSL</span>
      <span style="color:rgb(0,0,136);">$ssl_actions</span> <span style="color:rgb(51,153,51);">=</span> sfConfig<span style="color:rgb(51,153,51);">::</span><span style="color:rgb(0,64,0);">get</span><span style="color:rgb(0,153,0);">(</span><span>'app_ssl_secure_actions'</span><span style="color:rgb(0,153,0);">)</span>;
&nbsp;
      <span style="color:rgb(177,177,0);">if</span> <span style="color:rgb(0,153,0);">(</span><span style="color:rgb(153,0,0);">empty</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$_SERVER</span><span style="color:rgb(0,153,0);">[</span><span>'HTTPS'</span><span style="color:rgb(0,153,0);">]</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(51,153,51);">&amp;&amp;</span> <span style="color:rgb(153,0,0);">count</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$_POST</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(51,153,51);">&lt;</span> <span style="color:rgb(204,102,204);">1</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(0,153,0);">{</span>

&nbsp;
        <span style="color:rgb(102,102,102);font-style:italic;">// We're not using SSL and not POSTing data - check if we should be using SSL</span>
        <span style="color:rgb(177,177,0);">foreach</span> <span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$ssl_actions</span> <span style="color:rgb(177,177,0);">as</span> <span style="color:rgb(0,0,136);">$action</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(0,153,0);">{</span>

          <span style="color:rgb(177,177,0);">if</span> <span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$this</span><span style="color:rgb(51,153,51);">-&gt;</span><span style="color:rgb(0,64,0);">getContext</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,153,0);">)</span><span style="color:rgb(51,153,51);">-&gt;</span><span style="color:rgb(0,64,0);">getModuleName</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(51,153,51);">==</span> <span style="color:rgb(0,0,136);">$action</span><span style="color:rgb(0,153,0);">[</span><span>'module'</span><span style="color:rgb(0,153,0);">]</span> <span style="color:rgb(51,153,51);">&amp;&amp;</span> <span style="color:rgb(0,0,136);">$this</span><span style="color:rgb(51,153,51);">-&gt;</span><span style="color:rgb(0,64,0);">getContext</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,153,0);">)</span><span style="color:rgb(51,153,51);">-&gt;</span><span style="color:rgb(0,64,0);">getActionName</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(51,153,51);">==</span> <span style="color:rgb(0,0,136);">$action</span><span style="color:rgb(0,153,0);">[</span><span>'action'</span><span style="color:rgb(0,153,0);">]</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(0,153,0);">{</span>

            <span style="color:rgb(0,0,136);">$new_url</span> <span style="color:rgb(51,153,51);">=</span> <span style="color:rgb(153,0,0);">sprintf</span><span style="color:rgb(0,153,0);">(</span><span>'https://%s%s'</span><span style="color:rgb(51,153,51);">,</span> sfConfig<span style="color:rgb(51,153,51);">::</span><span style="color:rgb(0,64,0);">get</span><span style="color:rgb(0,153,0);">(</span><span>'app_ssl_secure_host'</span><span style="color:rgb(0,153,0);">)</span><span style="color:rgb(51,153,51);">,</span> <span style="color:rgb(0,0,136);">$_SERVER</span><span style="color:rgb(0,153,0);">[</span><span>'REQUEST_URI'</span><span style="color:rgb(0,153,0);">]</span><span style="color:rgb(0,153,0);">)</span>;
            <span style="color:rgb(153,0,0);">header</span><span style="color:rgb(0,153,0);">(</span><span>'Location: '</span> <span style="color:rgb(51,153,51);">.</span> <span style="color:rgb(0,0,136);">$new_url</span><span style="color:rgb(0,153,0);">)</span>;
            <span style="color:rgb(153,0,0);">exit</span>;
          <span style="color:rgb(0,153,0);">}</span>

        <span style="color:rgb(0,153,0);">}</span>
&nbsp;
        <span style="color:rgb(102,102,102);font-style:italic;">// Using secure host when not required - not good</span>
        <span style="color:rgb(177,177,0);">if</span> <span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$_SERVER</span><span style="color:rgb(0,153,0);">[</span><span>'HTTP_HOST'</span><span style="color:rgb(0,153,0);">]</span> <span style="color:rgb(51,153,51);">==</span> sfConfig<span style="color:rgb(51,153,51);">::</span><span style="color:rgb(0,64,0);">get</span><span style="color:rgb(0,153,0);">(</span><span>'app_ssl_secure_host'</span><span style="color:rgb(0,153,0);">)</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(0,153,0);">{</span>

          <span style="color:rgb(0,0,136);">$new_url</span> <span style="color:rgb(51,153,51);">=</span> <span style="color:rgb(153,0,0);">sprintf</span><span style="color:rgb(0,153,0);">(</span><span>'http://%s%s'</span><span style="color:rgb(51,153,51);">,</span> sfConfig<span style="color:rgb(51,153,51);">::</span><span style="color:rgb(0,64,0);">get</span><span style="color:rgb(0,153,0);">(</span><span>'app_ssl_insecure_host'</span><span style="color:rgb(0,153,0);">)</span><span style="color:rgb(51,153,51);">,</span> <span style="color:rgb(0,0,136);">$_SERVER</span><span style="color:rgb(0,153,0);">[</span><span>'REQUEST_URI'</span><span style="color:rgb(0,153,0);">]</span><span style="color:rgb(0,153,0);">)</span>;
          <span style="color:rgb(153,0,0);">header</span><span style="color:rgb(0,153,0);">(</span><span>'Location: '</span> <span style="color:rgb(51,153,51);">.</span> <span style="color:rgb(0,0,136);">$new_url</span><span style="color:rgb(0,153,0);">)</span>;
          <span style="color:rgb(153,0,0);">exit</span>;
        <span style="color:rgb(0,153,0);">}</span>

      <span style="color:rgb(0,153,0);">}</span> <span style="color:rgb(177,177,0);">elseif</span> <span style="color:rgb(0,153,0);">(</span><span style="color:rgb(51,153,51);">!</span><span style="color:rgb(153,0,0);">empty</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$_SERVER</span><span style="color:rgb(0,153,0);">[</span><span>'HTTPS'</span><span style="color:rgb(0,153,0);">]</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(51,153,51);">&amp;&amp;</span> <span style="color:rgb(153,0,0);">count</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$_POST</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(51,153,51);">&lt;</span> <span style="color:rgb(204,102,204);">1</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(0,153,0);">{</span>

&nbsp;
        <span style="color:rgb(102,102,102);font-style:italic;">// We're using SSL and not posting data</span>
        <span style="color:rgb(0,0,136);">$dont_redirect</span> <span style="color:rgb(51,153,51);">=</span> <span style="color:rgb(0,0,0);font-weight:bold;">false</span>;
        <span style="color:rgb(177,177,0);">foreach</span> <span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$ssl_actions</span> <span style="color:rgb(177,177,0);">as</span> <span style="color:rgb(0,0,136);">$action</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(0,153,0);">{</span>

          <span style="color:rgb(177,177,0);">if</span> <span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$this</span><span style="color:rgb(51,153,51);">-&gt;</span><span style="color:rgb(0,64,0);">getContext</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,153,0);">)</span><span style="color:rgb(51,153,51);">-&gt;</span><span style="color:rgb(0,64,0);">getModuleName</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(51,153,51);">==</span> <span style="color:rgb(0,0,136);">$action</span><span style="color:rgb(0,153,0);">[</span><span>'module'</span><span style="color:rgb(0,153,0);">]</span> <span style="color:rgb(51,153,51);">&amp;&amp;</span> <span style="color:rgb(0,0,136);">$this</span><span style="color:rgb(51,153,51);">-&gt;</span><span style="color:rgb(0,64,0);">getContext</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,153,0);">)</span><span style="color:rgb(51,153,51);">-&gt;</span><span style="color:rgb(0,64,0);">getActionName</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(51,153,51);">==</span> <span style="color:rgb(0,0,136);">$action</span><span style="color:rgb(0,153,0);">[</span><span>'action'</span><span style="color:rgb(0,153,0);">]</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(0,153,0);">{</span>

            <span style="color:rgb(0,0,136);">$dont_redirect</span> <span style="color:rgb(51,153,51);">=</span> <span style="color:rgb(0,0,0);font-weight:bold;">true</span>;
          <span style="color:rgb(0,153,0);">}</span>
        <span style="color:rgb(0,153,0);">}</span>
        <span style="color:rgb(177,177,0);">if</span> <span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,0,136);">$dont_redirect</span> <span style="color:rgb(51,153,51);">==</span> <span style="color:rgb(0,0,0);font-weight:bold;">false</span><span style="color:rgb(0,153,0);">)</span> <span style="color:rgb(0,153,0);">{</span>

          <span style="color:rgb(102,102,102);font-style:italic;">// Redirect</span>
          <span style="color:rgb(0,0,136);">$new_url</span> <span style="color:rgb(51,153,51);">=</span> <span style="color:rgb(153,0,0);">sprintf</span><span style="color:rgb(0,153,0);">(</span><span>'http://%s%s'</span><span style="color:rgb(51,153,51);">,</span> sfConfig<span style="color:rgb(51,153,51);">::</span><span style="color:rgb(0,64,0);">get</span><span style="color:rgb(0,153,0);">(</span><span>'app_ssl_insecure_host'</span><span style="color:rgb(0,153,0);">)</span><span style="color:rgb(51,153,51);">,</span> <span style="color:rgb(0,0,136);">$_SERVER</span><span style="color:rgb(0,153,0);">[</span><span>'REQUEST_URI'</span><span style="color:rgb(0,153,0);">]</span><span style="color:rgb(0,153,0);">)</span>;
          <span style="color:rgb(153,0,0);">header</span><span style="color:rgb(0,153,0);">(</span><span>'Location: '</span> <span style="color:rgb(51,153,51);">.</span> <span style="color:rgb(0,0,136);">$new_url</span><span style="color:rgb(0,153,0);">)</span>;
          <span style="color:rgb(153,0,0);">exit</span>;
        <span style="color:rgb(0,153,0);">}</span>

      <span style="color:rgb(0,153,0);">}</span>
    <span style="color:rgb(0,153,0);">}</span>
    <span style="color:rgb(102,102,102);font-style:italic;">// Next filter</span>
    <span style="color:rgb(0,0,136);">$filterChain</span><span style="color:rgb(51,153,51);">-&gt;</span><span style="color:rgb(0,64,0);">execute</span><span style="color:rgb(0,153,0);">(</span><span style="color:rgb(0,153,0);">)</span>;
  <span style="color:rgb(0,153,0);">}</span>

<span style="color:rgb(0,153,0);">}</span></pre>
</div>
<p><strong>Reference url:</strong><br />
<a href="http://james.mcglinn.org/2006/10/ssl-redirect-filter-for-symfony/">http://james.mcglinn.org/2006/10/ssl-redirect-filter-for-symfony/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learntechskill.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learntechskill.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learntechskill.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learntechskill.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learntechskill.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learntechskill.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learntechskill.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learntechskill.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learntechskill.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learntechskill.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learntechskill.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learntechskill.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learntechskill.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learntechskill.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=19&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learntechskill.wordpress.com/2009/04/15/implementing-ssl-with-symfony/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4fdfab5321a16d09375c9d2d713de7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krishnabhaya</media:title>
		</media:content>
	</item>
		<item>
		<title>Add multiple criteria with &#8216;AND&#8217; and &#8216;OR&#8217;</title>
		<link>http://learntechskill.wordpress.com/2009/03/23/add-multiple-criteria-with-and-and-or/</link>
		<comments>http://learntechskill.wordpress.com/2009/03/23/add-multiple-criteria-with-and-and-or/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 08:34:04 +0000</pubDate>
		<dc:creator>krishnabhaya</dc:creator>
				<category><![CDATA[symfony]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://learntechskill.wordpress.com/?p=12</guid>
		<description><![CDATA[Hi, all, symfony framework covers most of the things of normal sql does. though programmers face difficulty using queries in certain situation as we are used to write conventional sql queries. Here is one of the example for adding criteria with both &#8216;AND&#8217; and &#8216;OR&#8217; criteria. I want to search on two different field of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=12&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi, all, symfony framework covers most of the things of normal sql does. though  programmers face difficulty using queries in certain situation as we are used to write conventional sql queries. Here is one of the example for adding criteria with both &#8216;AND&#8217; and &#8216;OR&#8217; criteria.</p>
<p>I want to search on two different field of a table with multiple terms as a search string.</p>
<p>$c = new Criteria();<br />
$c-&gt;addSelectColumn(MyTablePeer::MY_ID);</p>
<p>//get search term array<br />
$txtSearchArr = split(&#8216; &#8216;,trim($txtSearch)); //whatever seperator </p>
<p>for($i=0;$i&lt;count($txtSearchArr);$i++)<br />
{</p>
<p>$criterion-&gt;getNewCriterion(MyTableTypesPeer::TYP_NAME, &#8220;%&#8221;.$txtSearchF.&#8221;%&#8221;,Criteria::LIKE));<br />
			   		$criterion-&gt;addOr($c-&gt;getNewCriterion(MyTableCategoryPeer::CAT_NO, &#8220;%&#8221;.$txtSearchF.&#8221;%&#8221;,Criteria::LIKE));</p>
<p>$c-&gt;addAnd($criterion);<br />
}</p>
<p>The above will search in typename and categoryno for each terms and combination of each term in each field.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learntechskill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learntechskill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learntechskill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learntechskill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learntechskill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learntechskill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learntechskill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learntechskill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learntechskill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learntechskill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learntechskill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learntechskill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learntechskill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learntechskill.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=12&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learntechskill.wordpress.com/2009/03/23/add-multiple-criteria-with-and-and-or/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4fdfab5321a16d09375c9d2d713de7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krishnabhaya</media:title>
		</media:content>
	</item>
		<item>
		<title>Sort on comma seperated field</title>
		<link>http://learntechskill.wordpress.com/2009/03/08/sort-on-comma-seperated-field/</link>
		<comments>http://learntechskill.wordpress.com/2009/03/08/sort-on-comma-seperated-field/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 10:36:04 +0000</pubDate>
		<dc:creator>krishnabhaya</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://learntechskill.wordpress.com/?p=3</guid>
		<description><![CDATA[If you want to sort on one of the comma separated field of table in mysql, here is a solution. I required to sort comma separated field, default sorting of mysql considers whole field value, including comma, count of words and do sort on these. I want to sort on just first word of comma [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=3&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to sort on one of the comma separated field of table in mysql, here is a solution.  I required to sort comma separated field, default sorting of mysql considers whole field value, including comma, count of words and do sort on these. I want to sort on just first word of comma separated field. And I got solution of that using SUBSTRING_INDEX function of mysql. Many of us are not aware of power of such functions in mysql and not using those in our sql queries.</p>
<p>Example:</p>
<p>Table : TBL_EXM</p>
<p>Field_Id<br />
Field_Tags( a comma separated field)</p>
<p>Query:<br />
SELECT * FROM `TBL_EXM` ORDER BY (SUBSTRING_INDEX(`Field_Tags`, &#8216;,&#8217; , 1))</p>
<p>It is having more combination and options. You can check in detail from <a href="http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_substring-index">here</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learntechskill.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learntechskill.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learntechskill.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learntechskill.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learntechskill.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learntechskill.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learntechskill.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learntechskill.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learntechskill.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learntechskill.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learntechskill.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learntechskill.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learntechskill.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learntechskill.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learntechskill.wordpress.com&amp;blog=6872697&amp;post=3&amp;subd=learntechskill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learntechskill.wordpress.com/2009/03/08/sort-on-comma-seperated-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4fdfab5321a16d09375c9d2d713de7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krishnabhaya</media:title>
		</media:content>
	</item>
	</channel>
</rss>
