<?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>PHP, MySQL, Javascript, AJAX, HTML and CSS</title>
	<atom:link href="http://web4us.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://web4us.wordpress.com</link>
	<description>Nothing is far away</description>
	<lastBuildDate>Mon, 30 Jan 2012 09:13:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='web4us.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>PHP, MySQL, Javascript, AJAX, HTML and CSS</title>
		<link>http://web4us.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://web4us.wordpress.com/osd.xml" title="PHP, MySQL, Javascript, AJAX, HTML and CSS" />
	<atom:link rel='hub' href='http://web4us.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Distance calculator based on geo cords</title>
		<link>http://web4us.wordpress.com/2010/07/23/distance-calculator-based-on-geo-cords/</link>
		<comments>http://web4us.wordpress.com/2010/07/23/distance-calculator-based-on-geo-cords/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 09:12:08 +0000</pubDate>
		<dc:creator>webforus</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[distance calculator]]></category>
		<category><![CDATA[geo cords]]></category>

		<guid isPermaLink="false">http://web4us.wordpress.com/?p=618</guid>
		<description><![CDATA[Here is the function to calculate distance between two points based on geo cords( latitude and longitude) &#60;?php function distance($lat1, $lon1, $lat2, $lon2, $unit) { $theta = $lon1 - $lon2; $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +  cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); $miles = $dist * 60 * 1.1515; $unit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=618&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is the function to calculate distance between two points based on geo cords( latitude and longitude)</p>
<pre>&lt;?php
function distance($lat1, $lon1, $lat2, $lon2, $unit) {
 $theta = $lon1 - $lon2;
 $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +  cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));
 $dist = acos($dist);
 $dist = rad2deg($dist);
 $miles = $dist * 60 * 1.1515;
 $unit = strtoupper($unit);
 if ($unit == "K") {//Kilometers
 return round(($miles * 1.609344),2);
 }elseif ($unit == "N") {//Nautical mile
 return round(($miles * 0.8684),2);
 }else{ //Miles
 return  round($miles,2);
 }
}
echo distance(16.264602, 79.991455, 17.34784201769758, 78.50830078125, "");
?&gt;
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/web4us.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/web4us.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/web4us.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/web4us.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/web4us.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/web4us.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/web4us.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/web4us.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/web4us.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/web4us.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/web4us.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/web4us.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/web4us.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/web4us.wordpress.com/618/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=618&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://web4us.wordpress.com/2010/07/23/distance-calculator-based-on-geo-cords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bcfaf4f9ed831f35225940327e00cec0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">webforus</media:title>
		</media:content>
	</item>
		<item>
		<title>Include html files inside another html file</title>
		<link>http://web4us.wordpress.com/2010/07/23/include-html-files-inside-another-html-file/</link>
		<comments>http://web4us.wordpress.com/2010/07/23/include-html-files-inside-another-html-file/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 07:02:38 +0000</pubDate>
		<dc:creator>webforus</dc:creator>
				<category><![CDATA[HTML / CSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[include html]]></category>

		<guid isPermaLink="false">http://web4us.wordpress.com/?p=581</guid>
		<description><![CDATA[Following is the way of including the html files inside some other html files.This will not work if you put it inside any server side executing files(eg., *.php,*.jsp, etc.,) &#60;!&#8211;#include virtual=&#8221;header.html&#8221;&#8211;&#62;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=581&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Following is the way of including the html files inside some other html files.This will not work if you put it inside any server side executing files(eg., *.php,*.jsp, etc.,)</p>
<p>&lt;!&#8211;#include virtual=&#8221;header.html&#8221;&#8211;&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/web4us.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/web4us.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/web4us.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/web4us.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/web4us.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/web4us.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/web4us.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/web4us.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/web4us.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/web4us.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/web4us.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/web4us.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/web4us.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/web4us.wordpress.com/581/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=581&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://web4us.wordpress.com/2010/07/23/include-html-files-inside-another-html-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bcfaf4f9ed831f35225940327e00cec0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">webforus</media:title>
		</media:content>
	</item>
		<item>
		<title>ZoomIn and ZoomOut of text on webpage</title>
		<link>http://web4us.wordpress.com/2010/07/23/zoomin-and-zoomout-of-text-on-webpage/</link>
		<comments>http://web4us.wordpress.com/2010/07/23/zoomin-and-zoomout-of-text-on-webpage/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 06:58:24 +0000</pubDate>
		<dc:creator>webforus</dc:creator>
				<category><![CDATA[HTML / CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[increase and decrease font]]></category>
		<category><![CDATA[zoom font]]></category>

		<guid isPermaLink="false">http://web4us.wordpress.com/?p=611</guid>
		<description><![CDATA[Zoom in/out options would be required in any informative website. Page would contains either article or news or any other text. Here is the simple way to implement the same. In this example i restricted minimum font size to 10 and max to 20. You can change as per your requirement. &#60;HTML&#62; &#60;HEAD&#62; &#60;TITLE&#62; Zoom [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=611&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Zoom in/out options would be required in any informative website. Page would contains either article or news or any other text.<br />
Here is the simple way to implement the same.<br />
In this example i restricted minimum font size to 10 and max to 20. You can change as per your requirement.<br />
<span id="more-611"></span></p>
<pre>&lt;HTML&gt;
 &lt;HEAD&gt;
 &lt;TITLE&gt; Zoom In / Zoom Out of an article &lt;/TITLE&gt;
 &lt;script type="text/javascript"&gt;
 function changeFontSize(type){
     var size = document.getElementById('content').style.fontSize;
     size = parseInt(size);
     tar_size = size;
     if(type == 'big'){
         if(size &lt; 20)
           tar_size = size + 3;
     }else{
         if(size &gt; 10)
           tar_size = size - 3;
     }
     document.getElementById('content').style.fontSize = tar_size + 'px';
  }
 &lt;/script&gt;
 &lt;/HEAD&gt;

 &lt;BODY&gt;
 &lt;a href="javascript:void(0)" onclick="changeFontSize('big');"&gt;Zoom In&lt;/a&gt; |
 &lt;a href="javascript:void(0)" onclick="changeFontSize('small');"&gt;Zoom Out&lt;/a&gt;
 &lt;div style="font-size:10px;" id="content"&gt;  

 Some text goes here...

 &lt;/div&gt;
 &lt;/BODY&gt;
&lt;/HTML&gt;
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/web4us.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/web4us.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/web4us.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/web4us.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/web4us.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/web4us.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/web4us.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/web4us.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/web4us.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/web4us.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/web4us.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/web4us.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/web4us.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/web4us.wordpress.com/611/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=611&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://web4us.wordpress.com/2010/07/23/zoomin-and-zoomout-of-text-on-webpage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bcfaf4f9ed831f35225940327e00cec0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">webforus</media:title>
		</media:content>
	</item>
		<item>
		<title>Focusing to any HTML element</title>
		<link>http://web4us.wordpress.com/2010/05/19/focusing-to-any-html-element/</link>
		<comments>http://web4us.wordpress.com/2010/05/19/focusing-to-any-html-element/#comments</comments>
		<pubDate>Wed, 19 May 2010 12:28:34 +0000</pubDate>
		<dc:creator>webforus</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[focus div]]></category>
		<category><![CDATA[focus div in javascript]]></category>
		<category><![CDATA[html div focus]]></category>

		<guid isPermaLink="false">http://web4us.wordpress.com/?p=602</guid>
		<description><![CDATA[If you want to focus to any form element you can achieve it by document.getElementById('form_ele_id').focus(); (or) document.form_name.form_ele_name.focus(); But in case of non form elements like div,span, etc.. You can not get it by using focus() method. You can achieve with the following statement.. document.getElementById('html_ele_id').scrollIntoView(); (or) document.location.url += "#html_ele_id";<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=602&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to focus to any form element you can achieve it by</p>
<pre>
document.getElementById('form_ele_id').focus();
(or)
document.form_name.form_ele_name.focus();
</pre>
<p>But in case of non form elements like div,span, etc.. You can not get it by using focus() method. You can achieve with the following statement..</p>
<pre>
document.getElementById('html_ele_id').scrollIntoView();
(or)
document.location.url += "#html_ele_id";
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/web4us.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/web4us.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/web4us.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/web4us.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/web4us.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/web4us.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/web4us.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/web4us.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/web4us.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/web4us.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/web4us.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/web4us.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/web4us.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/web4us.wordpress.com/602/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=602&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://web4us.wordpress.com/2010/05/19/focusing-to-any-html-element/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bcfaf4f9ed831f35225940327e00cec0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">webforus</media:title>
		</media:content>
	</item>
		<item>
		<title>Sort two dimensional array with the key</title>
		<link>http://web4us.wordpress.com/2010/04/27/sort-two-dimensional-array-with-the-key/</link>
		<comments>http://web4us.wordpress.com/2010/04/27/sort-two-dimensional-array-with-the-key/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 09:27:10 +0000</pubDate>
		<dc:creator>webforus</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[sort multi dimensional array]]></category>
		<category><![CDATA[sort two dimensional array]]></category>

		<guid isPermaLink="false">http://web4us.wordpress.com/?p=599</guid>
		<description><![CDATA[Here is the code for sorting two dimensional array with the specific key. &#60;?php $arr = Array( Array( 'id' =&#62; 1, 'Name' =&#62; 'Venu', 'Salary' =&#62; 1000 ), Array( 'id' =&#62; 2, 'Name' =&#62; 'Raj', 'Salary' =&#62; 500 ), Array( 'id' =&#62; 3, 'Name' =&#62; 'Ramesh', 'Salary' =&#62; 1500 ), Array ( 'id' =&#62; 4, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=599&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is the code for sorting two dimensional array with the specific key.</p>
<p><span id="more-599"></span></p>
<pre>&lt;?php
 $arr = Array(
 Array(
 'id' =&gt; 1,
 'Name' =&gt; 'Venu',
 'Salary' =&gt; 1000
 ),
 Array(
 'id' =&gt; 2,
 'Name' =&gt; 'Raj',
 'Salary' =&gt; 500
 ),
 Array(
 'id' =&gt; 3,
 'Name' =&gt; 'Ramesh',
 'Salary' =&gt; 1500
 ),
 Array
 (
 'id' =&gt; 4,
 'Name' =&gt; 'Siri',
 'Salary' =&gt; 1100
 ),
 Array(
 'id' =&gt; 4,
 'Name' =&gt; 'Jaya',
 'Salary' =&gt; 900
 )
 );
 $result = sortMultiArrayByKey($arr,'Salary');
 echo "&lt;pre&gt;";
 print_r($result);
 echo "&lt;/pre&gt;";

 function sortMultiArrayByKey($argArray, $argKey, $argOrder=SORT_ASC){
    foreach ($argArray as $key =&gt; $row){
       $key_arr[$key] = $row[$argKey];
    }
    array_multisort($key_arr, $argOrder, $argArray);
    return $argArray;
 }

?&gt;</pre>
<p>Output</p>
<pre>
<pre>Array
(
    [0] =&gt; Array
        (
            [id] =&gt; 2
            [Name] =&gt; Raj
            [Salary] =&gt; 500
        )

    [1] =&gt; Array
        (
            [id] =&gt; 4
            [Name] =&gt; Jaya
            [Salary] =&gt; 900
        )

    [2] =&gt; Array
        (
            [id] =&gt; 1
            [Name] =&gt; Venu
            [Salary] =&gt; 1000
        )

    [3] =&gt; Array
        (
            [id] =&gt; 4
            [Name] =&gt; Siri
            [Salary] =&gt; 1100
        )

    [4] =&gt; Array
        (
            [id] =&gt; 3
            [Name] =&gt; Ramesh
            [Salary] =&gt; 1500
        )

)</pre>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/web4us.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/web4us.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/web4us.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/web4us.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/web4us.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/web4us.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/web4us.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/web4us.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/web4us.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/web4us.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/web4us.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/web4us.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/web4us.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/web4us.wordpress.com/599/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=599&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://web4us.wordpress.com/2010/04/27/sort-two-dimensional-array-with-the-key/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bcfaf4f9ed831f35225940327e00cec0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">webforus</media:title>
		</media:content>
	</item>
		<item>
		<title>Indian currency format</title>
		<link>http://web4us.wordpress.com/2010/04/27/indian-currency-format/</link>
		<comments>http://web4us.wordpress.com/2010/04/27/indian-currency-format/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 08:43:51 +0000</pubDate>
		<dc:creator>webforus</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[number in indian currency format]]></category>
		<category><![CDATA[search engine optimization]]></category>

		<guid isPermaLink="false">http://web4us.wordpress.com/?p=595</guid>
		<description><![CDATA[This code will helps you to get the given number in Indian currency format. We can use number_format only for US currency. Below function may serves your purpose. &#60;?php echo formatInIndianStyle(256987425.44); function formatInIndianStyle($num){ $pos = strpos((string)$num, "."); if ($pos === false) { $decimalpart="00"; } if (!($pos === false)) { $decimalpart= substr($num, $pos+1, 2); $num = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=595&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This code will helps you to get the given number in Indian currency format. We can use number_format only for US currency.</p>
<p>Below function may serves your purpose.</p>
<p><span id="more-595"></span></p>
<pre>&lt;?php
 echo formatInIndianStyle(256987425.44);

 function formatInIndianStyle($num){
 $pos = strpos((string)$num, ".");
 if ($pos === false) {
 $decimalpart="00";
 }
 if (!($pos === false)) {
 $decimalpart= substr($num, $pos+1, 2); $num = substr($num,0,$pos);
 }

 if(strlen($num)&gt;3 &amp; strlen($num) &lt;= 12){
 $last3digits = substr($num, -3 );
 $numexceptlastdigits = substr($num, 0, -3 );
 $formatted = makeComma($numexceptlastdigits);
 $stringtoreturn = $formatted.",".$last3digits.".".$decimalpart ;
 }elseif(strlen($num)&lt;=3){
 $stringtoreturn = $num.".".$decimalpart ;
 }elseif(strlen($num)&gt;12){
 $stringtoreturn = number_format($num, 2);
 }

 if(substr($stringtoreturn,0,2)=="-,"){
 $stringtoreturn = "-".substr($stringtoreturn,2 );
 }

 return $stringtoreturn;
 }

 function makeComma($input){
 // This function is written by some anonymous person - I got it from Google
 if(strlen($input)&lt;=2)
 { return $input; }
 $length=substr($input,0,strlen($input)-2);
 $formatted_input = makeComma($length).",".substr($input,-2);
 return $formatted_input;
 }
?&gt;
</pre>
<p>Output</p>
<pre>25,69,87,425.44
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/web4us.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/web4us.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/web4us.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/web4us.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/web4us.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/web4us.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/web4us.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/web4us.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/web4us.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/web4us.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/web4us.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/web4us.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/web4us.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/web4us.wordpress.com/595/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=595&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://web4us.wordpress.com/2010/04/27/indian-currency-format/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bcfaf4f9ed831f35225940327e00cec0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">webforus</media:title>
		</media:content>
	</item>
		<item>
		<title>Fetching nearest string matches</title>
		<link>http://web4us.wordpress.com/2010/04/22/fetching-nearest-string-matches/</link>
		<comments>http://web4us.wordpress.com/2010/04/22/fetching-nearest-string-matches/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 10:33:54 +0000</pubDate>
		<dc:creator>webforus</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[did you mean]]></category>
		<category><![CDATA[nearest matches]]></category>
		<category><![CDATA[nearest string]]></category>

		<guid isPermaLink="false">http://web4us.wordpress.com/?p=591</guid>
		<description><![CDATA[If you enter any wrong spelling while Goggling,  &#8220;Did you mean:&#8221; stuff will be displayed with some nearest matches according to the given entry. This post will help you to implement same kind of stuff in your applications. Here is an example &#60;?php $search = "bangaluru"; $cities = array('delhi','hyderabad','bangalore','bandipur','waynad','coorg'); for($i=0; $i&#60;count($cities);$i++) { $match_val = levenshtein($search,$cities[$i]); [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=591&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you enter any wrong spelling while Goggling,  &#8220;Did you mean:&#8221; stuff will be displayed with some nearest matches according to the given entry.</p>
<p>This post will help you to implement same kind of stuff in your applications.</p>
<p>Here is an example<br />
<span id="more-591"></span></p>
<pre>&lt;?php
	$search = "bangaluru";
	$cities = array('delhi','hyderabad','bangalore','bandipur','waynad','coorg');
	for($i=0; $i&lt;count($cities);$i++)
	{
	   $match_val = levenshtein($search,$cities[$i]);
	   $match_array[$i] = $match_val;
	}
	asort($match_array);
	foreach ($match_array as $key=&gt;$val)
	{
	   $result[$key] = $cities[$key];
	}
	print_r($result);
?&gt;
</pre>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:19px;width:1px;height:1px;">&lt;?php<br />
$search = &#8220;bangaluru&#8221;;<br />
$str_array = array(&#8216;delhi&#8217;,'hyderabad&#8217;,'bangalore&#8217;,'bandipur&#8217;,'waynad&#8217;,'coorg&#8217;);<br />
for($i=0; $i&lt;count($str_array);$i++)<br />
{<br />
$match_val = levenshtein($search,$str_array[$i]);<br />
$match_array[$i] = $match_val;<br />
}<br />
asort($match_array);<br />
foreach ($match_array as $key=&gt;$val)<br />
{<br />
$result_array[$key] = $str_array[$key];<br />
}<br />
print_r($result_array);<br />
?&gt;</div>
<p>There is an array named &#8220;cities&#8221;. I am trying to search city &#8220;bangaluru&#8221; which is not mentioned in $cities array. Here i have used an array. This could be database fetching in your application.</p>
<p>The output will be shown like below:</p>
<pre>
Array
(
    [2] =&gt; bangalore
    [3] =&gt; bandipur
    [4] =&gt; waynad
    [0] =&gt; delhi
    [5] =&gt; coorg
    [1] =&gt; hyderabad
)
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/web4us.wordpress.com/591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/web4us.wordpress.com/591/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/web4us.wordpress.com/591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/web4us.wordpress.com/591/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/web4us.wordpress.com/591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/web4us.wordpress.com/591/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/web4us.wordpress.com/591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/web4us.wordpress.com/591/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/web4us.wordpress.com/591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/web4us.wordpress.com/591/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/web4us.wordpress.com/591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/web4us.wordpress.com/591/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/web4us.wordpress.com/591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/web4us.wordpress.com/591/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=591&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://web4us.wordpress.com/2010/04/22/fetching-nearest-string-matches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bcfaf4f9ed831f35225940327e00cec0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">webforus</media:title>
		</media:content>
	</item>
		<item>
		<title>Desktop applications with PHP</title>
		<link>http://web4us.wordpress.com/2010/01/22/desktop-applications-with-php/</link>
		<comments>http://web4us.wordpress.com/2010/01/22/desktop-applications-with-php/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 12:19:05 +0000</pubDate>
		<dc:creator>webforus</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[desktop applications]]></category>
		<category><![CDATA[desktop applications in php]]></category>

		<guid isPermaLink="false">http://web4us.wordpress.com/?p=587</guid>
		<description><![CDATA[Yes. It is possible with PHP. We can develop desktop applications with PHP. Here we can do most of the things which are possible in web. Here is the useful link to know more about this. http://gtk.php.net/ Here you can download the sample project. http://gtk.php.net/download.php<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=587&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yes. It is possible with PHP. We can develop desktop applications with PHP.<br />
Here we can do most of the things which are possible in web. </p>
<p>Here is the useful link to know more about this.</p>
<p>http://gtk.php.net/</p>
<p>Here you can download the sample project.</p>
<p>http://gtk.php.net/download.php</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/web4us.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/web4us.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/web4us.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/web4us.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/web4us.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/web4us.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/web4us.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/web4us.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/web4us.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/web4us.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/web4us.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/web4us.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/web4us.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/web4us.wordpress.com/587/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=587&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://web4us.wordpress.com/2010/01/22/desktop-applications-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bcfaf4f9ed831f35225940327e00cec0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">webforus</media:title>
		</media:content>
	</item>
		<item>
		<title>write your own firefox extension</title>
		<link>http://web4us.wordpress.com/2010/01/02/write-your-own-firefox-extension/</link>
		<comments>http://web4us.wordpress.com/2010/01/02/write-your-own-firefox-extension/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 09:39:14 +0000</pubDate>
		<dc:creator>webforus</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[firefox extension]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://web4us.wordpress.com/?p=573</guid>
		<description><![CDATA[Learn XUL- XML Userinterface Language for building a graphical user interface with XML tags. Firefox extensions are using the XUL program to display the elements in statusbar,toolbar, etc..XUL (XML User Interface Language) is Mozilla&#8217;s XML-based language that lets you build feature-rich cross platform applications that can run connected or disconnected from the Internet. These applications [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=573&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Learn XUL- XML Userinterface Language for building a graphical user interface with XML tags. Firefox extensions are using the XUL program to display the elements in statusbar,toolbar, etc..<strong>XUL</strong> (XML User Interface Language) is Mozilla&#8217;s XML-based language that lets you build feature-rich cross platform applications that can run connected or disconnected from the Internet. These applications are easily customized with alternative text, graphics and layout so they can be readily branded or localized for various markets. Web developers already familiar with Dynamic HTML (DHTML) will learn XUL quickly and can start building applications right away.</p>
<p><span id="more-573"></span>This Following example extension will show the <strong>Weather report in your Firefox statusbar</strong>:</p>
<p><span class="mcon"> The weather data (temperature; date/time and weather condition is shown as tool-tip) is fetched via AJAX from wunderground.com from the RSS feed for Rome/Italy (change the RSS Url for your own city). The RSS XML data is parsed and written to the statusbar field with javascript every 15 minutes.</span></p>
<p><strong>The creation of such a toolbar is pretty straightforward:</strong></p>
<p>First we need to create the directory-structure:</p>
<pre>[project-directory]
[project-directory]/chrome
[project-directory]/chrome/content
[project-directory]/chrome/skin
</pre>
<p>(the directory skin is not really used here &#8211; i.e. stylesheets (CSS) and graphics/icons would be stored in this directory)</p>
<p>If you have created this directory-structure, copy the following files in their given locations:</p>
<p><strong>[project-directory]/install.rdf</strong></p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#"&gt;
	&lt;Description about="urn:mozilla:install-manifest"&gt;
		&lt;em:id&gt;{aa84ce40-4253-11da-8cd6-0800200c9a66}&lt;/em:id&gt;
		&lt;em:name&gt;CaptainStatusBar&lt;/em:name&gt;
		&lt;em:version&gt;0.1&lt;/em:version&gt;
		&lt;em:description&gt;Statusbar-Addon to display various stuff&lt;/em:description&gt;
		&lt;em:file&gt;
			&lt;Description about="urn:mozilla:extension:file:statusbar.jar"&gt;
			&lt;em:package&gt;content/&lt;/em:package&gt;
			&lt;em:skin&gt;skin/&lt;/em:skin&gt;
			&lt;/Description&gt;
		&lt;/em:file&gt;
		&lt;em:targetApplication&gt;
			&lt;Description&gt;
			&lt;em:id&gt;{ec8030f7-c20a-464f-9b0e-13a3a9e97384}&lt;/em:id&gt;
			&lt;em:minVersion&gt;1.0&lt;/em:minVersion&gt;
			&lt;em:maxVersion&gt;1.5&lt;/em:maxVersion&gt;
			&lt;/Description&gt;
		&lt;/em:targetApplication&gt;
	&lt;/Description&gt;
&lt;/RDF&gt;
</pre>
<p>Notes: minVersion and maxVersion is the version information. It tells the browser, which versions of the browser this extension supports. The ID (starting with aa84ce40&#8230;) is a unique ID &#8211; use an online UUID generator (google for it) to get an own ID for your own projects).</p>
<p><strong>[project-directory]/chrome/content/contents.rdf</strong></p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
              xmlns:chrome="http://www.mozilla.org/rdf/chrome#"&gt;
	&lt;RDF:Description about="urn:mozilla:package:statusbar"
       chrome:extension="true" chrome:name="statusbar"/&gt;
	&lt;RDF:Seq RDF:about="urn:mozilla:package:root"&gt;
		&lt;RDF:li RDF:resource="urn:mozilla:package:statusbar"/&gt;
	&lt;/RDF:Seq&gt;
	&lt;RDF:Seq RDF:about="urn:mozilla:overlays"&gt;
		&lt;RDF:li RDF:resource="chrome://browser/content/browser.xul"/&gt;
		&lt;RDF:li RDF:resource="chrome://navigator/content/navigator.xul"/&gt;
	&lt;/RDF:Seq&gt;
	&lt;RDF:Seq RDF:about="chrome://browser/content/browser.xul"&gt;
		&lt;RDF:li&gt;chrome://statusbar/content/statusbar.xul&lt;/RDF:li&gt;
	&lt;/RDF:Seq&gt;
	&lt;RDF:Seq about="chrome://navigator/content/navigator.xul"&gt;
		&lt;RDF:li&gt;chrome://statusbar/content/statusbar.xul&lt;/RDF:li&gt;
	&lt;/RDF:Seq&gt;
&lt;/RDF:RDF&gt;
</pre>
<p><strong>[project-directory]/chrome/content/statusbar.xul</strong></p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;overlay id="sample"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
   &lt;statusbar id="status-bar"&gt;
      &lt;statusbarpanel id="mypanel" label="Loading..."/&gt;
   &lt;/statusbar&gt;
 	&lt;script src="captain.js"/&gt;
&lt;/overlay&gt;
</pre>
<p>Notes: This is pretty straightforward XUL code. See xulplanet.com and google for more details.</p>
<p><span class="mcon"><strong>[project-directory]/chrome/content/captain.js</strong></span></p>
<pre>function makeRequest(url, parameters) {
   http_request = false;
   http_request = new XMLHttpRequest();
   if (http_request.overrideMimeType) {
      http_request.overrideMimeType('text/xml');
   }
   if (!http_request) {
      alert('Cannot create XMLHTTP instance');
      return false;
   }
   http_request.onreadystatechange = alertContents;
   http_request.open('GET', url + parameters, true);
   http_request.send(null);
}

function alertContents() {
   if (http_request.readyState == 4) {
      if (http_request.status == 200) {

         var xmlobject = http_request.responseXML;
         var root = xmlobject.getElementsByTagName('rss')[0];
         var channels = root.getElementsByTagName("channel");
         var items = channels[0].getElementsByTagName("item");
         var descriptions = items[0].getElementsByTagName("description");
         var date = items[0].getElementsByTagName("pubDate");

         var desc = descriptions[0].firstChild.nodeValue;
         var descarray = desc.split("|");
         var temp = descarray[0];
         var temparray = temp.split(":");
         var temperature = temparray[1];
         var update = date[0].firstChild.nodeValue;
         var tooltipstring = update + ": " + descarray[3];

         document.getElementById('mypanel').label = "Roma: " + temperature;
         document.getElementById('mypanel').tooltipText = tooltipstring;

      } else {
         alert('There was a problem with the request.');
      }
   }
}
function updateweather() {
   makeRequest('http://www.wunderground.com/auto/rss_full/global/stations/16239.xml', '');
	self.setTimeout('updateweather()', 900000);
}
window.addEventListener("load", updateweather, false);
</pre>
<p>Notes: This is the Javascript file for fetching the XML RSS data and writing it to the statusbar element.</p>
<p>This example uses a RSS feed from wunderground.com, it&#8217;s use is for educational purposes only.</p>
<p><strong>[project-directory]/chrome/skin/contents.rdf</strong></p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:chrome="http://www.mozilla.org/rdf/chrome#"&gt;
	&lt;RDF:Seq about="urn:mozilla:skin:root"&gt;
		&lt;RDF:li resource="urn:mozilla:skin:classic/1.0" /&gt;
	&lt;/RDF:Seq&gt;
	&lt;RDF:Description about="urn:mozilla:skin:classic/1.0"&gt;
		&lt;chrome:packages&gt;
			&lt;RDF:Seq about="urn:mozilla:skin:classic/1.0:packages"&gt;
				&lt;RDF:li resource="urn:mozilla:skin:classic/1.0:statusbar" /&gt;
			&lt;/RDF:Seq&gt;
		&lt;/chrome:packages&gt;
	&lt;/RDF:Description&gt;
&lt;/RDF:RDF&gt;
</pre>
<p>And last but not least, we need to do some zipping:</p>
<p><strong>[project-directory]/make.sh</strong></p>
<pre>#!/bin/sh
cd chrome
zip -r statusbar.jar content/ skin/
cd ..
zip statusbar.xpi install.rdf chrome/statusbar.jar
</pre>
<p>As you see, the jar file and the xpi file are just regular zip files. If you are on Windows, you need to figure out yourself how to zip the structure via WinZIP or some command line zip tool.</p>
<p>Now we have the ready-to-install XPI file.<strong> Open the Firefox browser, and simply load the XPI file (Menu: File -&gt; Open File).</strong> The browser will tell you that the XPI is not signed, but that doesn&#8217;t matter in our case (signing the XPI will be part of a future tutorial). Restart Firefox and the toolbar should appear.</p>
<p><span class="mcon"><strong>TROUBLESHOOTING</strong><br />
<strong>HELP: FIREFOX DOESN&#8217;T LOAD (Segfaults):</strong><br />
Start Firefox in save-mode:</span></p>
<pre># firefox -safe-mode
</pre>
<p>In this mode no extension is loaded and the faulty extension can be removed with:<br />
Menu: Tools -&gt; Extensions</p>
<p><strong>There is some window at startup saying the extension can&#8217;t be installed:</strong><br />
Click on &#8220;details&#8221; and you should see something like this:<br />
<em>Chrome Registration failed for Extension &#8216;{a1577a80-3943-4362-a66d-858f01e2196c}&#8217; when calling  nsIXULChromeRegistry::installSkin with this chrome path:  jar:file:///[some-path]/extensions/%7Ba1577a80-3943-4362-a66d-858f01e2196c%7D/chrome/captain.jar!/skin/ (profile extension = true). Perhaps this path does not exist within the chrome JAR file, or the  contents.rdf file at that location is malformed?</em><br />
Check if all files are in the right location and if all files are actually present.</p>
<p><strong>Source: http://www.captain.at/howto-firefox-statusbar-tutorial.php</strong></p>
<p><strong>Related sites : http://www.xul.fr/tutorial/</strong></p>
<p><strong>https://developer.mozilla.org/En/XUL</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/web4us.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/web4us.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/web4us.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/web4us.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/web4us.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/web4us.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/web4us.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/web4us.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/web4us.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/web4us.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/web4us.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/web4us.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/web4us.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/web4us.wordpress.com/573/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=573&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://web4us.wordpress.com/2010/01/02/write-your-own-firefox-extension/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bcfaf4f9ed831f35225940327e00cec0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">webforus</media:title>
		</media:content>
	</item>
		<item>
		<title>print_r in error log file</title>
		<link>http://web4us.wordpress.com/2010/01/02/print_r-in-error-log-file/</link>
		<comments>http://web4us.wordpress.com/2010/01/02/print_r-in-error-log-file/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 09:30:50 +0000</pubDate>
		<dc:creator>webforus</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://web4us.wordpress.com/?p=567</guid>
		<description><![CDATA[Sometimes in live site developer suppose required to print the variable values or array values but can&#8217;t since it is in live server , so the option is we can print the values in error log file to check the values. Here is an example to print the values in error log file &#60;?php ini_set('log_errors', [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=567&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes in live site developer suppose required to print the variable values or array values but can&#8217;t since it is in live server , so the option is we can print the values in error log file to check the values. Here is an example to print the values in error log file<br />
<span id="more-567"></span></p>
<pre>&lt;?php
ini_set('log_errors', 1);
ini_set('error_log', 'error.log');//if not set, default error log file will be taken
error_log(
   strtr(
      print_r(Array(1, 2, 3), 1),
      array(
         "\r\n" =PHP_EOL,
         "\r" =PHP_EOL,
         "\n" =PHP_EOL,
      )
   )
);
?&gt;</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/web4us.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/web4us.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/web4us.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/web4us.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/web4us.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/web4us.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/web4us.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/web4us.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/web4us.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/web4us.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/web4us.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/web4us.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/web4us.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/web4us.wordpress.com/567/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=web4us.wordpress.com&amp;blog=8824564&amp;post=567&amp;subd=web4us&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://web4us.wordpress.com/2010/01/02/print_r-in-error-log-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bcfaf4f9ed831f35225940327e00cec0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">webforus</media:title>
		</media:content>
	</item>
	</channel>
</rss>
