<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Henry&#039;s Web Notes</title>
	<atom:link href="http://devel.lubong.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://devel.lubong.com</link>
	<description>My dev notes about the web</description>
	<lastBuildDate>Sun, 12 Feb 2012 21:57:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JavaScript: Avoiding Implied Globals In Your Functions</title>
		<link>http://devel.lubong.com/2012/02/12/javascript-avoiding-implied-globals-in-your-functions/</link>
		<comments>http://devel.lubong.com/2012/02/12/javascript-avoiding-implied-globals-in-your-functions/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 21:57:04 +0000</pubDate>
		<dc:creator>Henry Lubong</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://devel.lubong.com/?p=26</guid>
		<description><![CDATA[You were told that any variables inside a function are supposed to be available only to that function and not accessible outside. So you are doing something like this: function add(x, y) { sum = x + y; return sum; } So you called the function add with some arguments and got a the correct [...]]]></description>
			<content:encoded><![CDATA[<p>You were told that any variables inside a function are supposed to be available only to that function and not accessible outside. So you are doing something like this:</p>
<pre><code>
function add(x, y) {
    sum = x + y;
    return sum;
}
</code></pre>
<p>So you called the function <code>add</code> with some arguments and got a the correct return value. Great, it works, your function is working but there&#8217;s one problem though. After calling the function, you had implicitly added one more variable <code>sum</code> to the global namespace. You can try the code above for yourself. After you call <code>add</code>, you can print out <code>this.sum</code> or <code>window.sum</code> and you&#8217;ll see that it has the same value as the variable inside the function. </p>
<p>How did that happen? In JavaScript, any variable that you don&#8217;t declare automatically becomes a property of the global object just like the variable above. Unless that was your intention, it is always a good habit to declare a local variable with <code>var</code>.</p>
<p>Here is the correct way to do it:</p>
<pre><code>
function add(x, y) {
    var sum = x + y;
    return sum;
}
</code></pre>
<p>Now, when you call the function and tried to print <code>window.sum</code>, you will get <code>undefined</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://devel.lubong.com/2012/02/12/javascript-avoiding-implied-globals-in-your-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache: Serving Your Website Without &#8220;www&#8221;</title>
		<link>http://devel.lubong.com/2009/08/11/apache-serving-your-website-without-www/</link>
		<comments>http://devel.lubong.com/2009/08/11/apache-serving-your-website-without-www/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 06:18:22 +0000</pubDate>
		<dc:creator>Henry Lubong</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[virtualhost]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://devel.lubong.com/?p=21</guid>
		<description><![CDATA[In the early days of the web, people used to always type www in front of a domain name. I believe this became a convention to distinguish the web server from other services like the mail server. In reality, there&#8217;s no need for distinction because a typical web server responds to port 80 and the [...]]]></description>
			<content:encoded><![CDATA[<p>In the early days of the web, people used to always type <code>www</code> in front of a domain name. I believe this became a convention to distinguish the web server from other services like the mail server. In reality, there&#8217;s no need for distinction because a typical web server responds to port 80 and the mail server responds to port 25, 110, etc. There was never a rule that requires a website to start with a <code>www</code> or any other prefixes. So typing just your domainname.com should be a valid website address.</p>
<p>These days, it is now a common practice to serve a website either with or without the <code>www</code> prefix. In fact, most companies prefer it without the <code>www</code> because it&#8217;s easier to type and remember. Not to mention, the letter &#8220;w&#8221; has the longest syllable in the alphabet. Try to say that three times before the domain name. And don&#8217;t give me that &#8220;dubdubdub&#8221; stuff <img src='http://devel.lubong.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, if you&#8217;re hosting your own server and/or have access to the Apache configuration file (it&#8217;s usually httpd.conf or apache2.conf) and running multiple sites, you can copy the following lines in your conf file (replace example.com with your domain name):</p>
<pre>&lt;VirtualHost *&gt;
    DocumentRoot /var/www/web
    ServerName www.example.com
    <strong>ServerAlias example.com</strong>
&lt;/VirtualHost&gt;</pre>
<p>In addition, make sure that the <code>A Record</code> in your DNS setting had the <code>example.com</code> and <code>www.example.com</code> pointing to the same IP address.</p>
]]></content:encoded>
			<wfw:commentRss>http://devel.lubong.com/2009/08/11/apache-serving-your-website-without-www/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Twitter Tools</title>
		<link>http://devel.lubong.com/2009/08/08/testing-twitter-tools/</link>
		<comments>http://devel.lubong.com/2009/08/08/testing-twitter-tools/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 02:20:58 +0000</pubDate>
		<dc:creator>Henry Lubong</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://devel.lubong.com/?p=16</guid>
		<description><![CDATA[Just testing twitter tools without the bit.ly plugin&#8230; Update: You don&#8217;t need to install/activate the bit.ly plugin that came with Twitter Tools since Twitter is already using bit.ly for shortening URL.]]></description>
			<content:encoded><![CDATA[<p>Just testing twitter tools without the bit.ly plugin&#8230;</p>
<p>Update:<br />
You don&#8217;t need to install/activate the bit.ly plugin that came with Twitter Tools since Twitter is already using bit.ly for shortening URL.</p>
]]></content:encoded>
			<wfw:commentRss>http://devel.lubong.com/2009/08/08/testing-twitter-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux: How To Install Apache And PHP5 In Ubuntu</title>
		<link>http://devel.lubong.com/2009/08/08/linux-how-to-install-apache-and-php5-in-ubuntu/</link>
		<comments>http://devel.lubong.com/2009/08/08/linux-how-to-install-apache-and-php5-in-ubuntu/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 21:16:42 +0000</pubDate>
		<dc:creator>Henry Lubong</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://devel.lubong.com/?p=10</guid>
		<description><![CDATA[From the command line, run the following commands: sudo apt-get install apache2 sudo apt-get install php5 sudo apt-get install libapache2-mod-php5 sudo /etc/init.d/apache2 restart And that&#8217;s it. Your web server with PHP is ready to go. The default location of the Doument Root can be found in /var/www If you need a CLI (command-line-interface) for PHP [...]]]></description>
			<content:encoded><![CDATA[<p>From the command line, run the following commands:</p>
<p><code>sudo apt-get install apache2<br />
sudo apt-get install php5<br />
sudo apt-get install libapache2-mod-php5<br />
sudo /etc/init.d/apache2 restart</code></p>
<p>And that&#8217;s it. Your web server with PHP is ready to go. The default location of the Doument Root can be found in /var/www</p>
<p>If you need a CLI (command-line-interface) for PHP you can run the following command:</p>
<p><code>sudo apt-get install php5-cli</code></p>
]]></content:encoded>
			<wfw:commentRss>http://devel.lubong.com/2009/08/08/linux-how-to-install-apache-and-php5-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Session Save Path Error</title>
		<link>http://devel.lubong.com/2008/04/30/php-session-save-path-error/</link>
		<comments>http://devel.lubong.com/2008/04/30/php-session-save-path-error/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 16:26:28 +0000</pubDate>
		<dc:creator>Henry Lubong</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[savepath]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[temp]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://devel.lubong.com/?p=7</guid>
		<description><![CDATA[Error: Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. This error has something to do with the directory where your PHP sessions are saved. Check the value of session.savepath in your php.ini and make sure that the directory has a write [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Error: Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.</strong></p>
<p>This error has something to do with the directory where your PHP sessions are saved. Check the value of <code>session.savepath</code> in your <code>php.ini</code> and make sure that the directory has a write permission or if it exists. If you are running PHP on Windows, typically on install time, the default setting for this is under <code>C:\Documents and Settings\[user]\Local Settings\Temp\php\Session</code>. In some weird cases, Windows deletes this directory. So if you get the error message above, make sure that this directory still exist. If not, you can simply create the directory or better yet, change your session.savepath setting  to a directory out of temp.</p>
]]></content:encoded>
			<wfw:commentRss>http://devel.lubong.com/2008/04/30/php-session-save-path-error/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JavaScript: How To Force Page To Reload</title>
		<link>http://devel.lubong.com/2007/06/24/javascript-how-to-force-page-to-reload/</link>
		<comments>http://devel.lubong.com/2007/06/24/javascript-how-to-force-page-to-reload/#comments</comments>
		<pubDate>Sun, 24 Jun 2007 18:02:22 +0000</pubDate>
		<dc:creator>Henry Lubong</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[refresh]]></category>
		<category><![CDATA[reload]]></category>

		<guid isPermaLink="false">http://devel.lubong.com/2007/06/24/javascript-how-to-force-page-to-reload/</guid>
		<description><![CDATA[When you want to load a page on a browser, you would normally click the Refresh / Reload button or press F5 or CTRL-R on your keyboard. If you set your browser to cache previously viewed pages, doing a normal page reload will cause the browser to fetch the requested page from cache unless otherwise [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to load a page on a browser, you would normally click the Refresh / Reload button or press F5 or CTRL-R on your keyboard. If you set your browser to cache previously viewed pages, doing a normal page reload will cause the browser to fetch the requested page from cache unless otherwise instructed by a script or meta tag in the page. When this happens, images and css will be read from cache and form fields will also retain their values (this included text, textarea, radio button and checkbox). </p>
<p>In order to completely force a page to reload, which means, instructing the browser to skip the cached data and re-fetch everything from the server, you need to press CTRL-F5 on IE and Firefox or Command-R on Mac-Safari.</p>
<p>In JavaScript, there are also different ways to reload a page. Here are the methods for a normal page reload:</p>
<p><code>window.location.assign(url);</code><br />
Loads the page at the the provided URL.</p>
<p><code>window.location.replace(url);</code><br />
Same as <code>assign()</code> method except that when <code>replace()</code> is used, the current page will not be saved in the session history as it was replaced by the provided URL.</p>
<p><code>document.location = url;</code><br />
Technically, location is a read-only property of the document. But some browsers allow you to assign a URL to it, which causes the page to reload. The reason for this is because whenever the location property is modified, a page will reload with the new assigned URL. I recommend using <code>window.location</code> for browser compatibility.</p>
<p><code>window.location.href = url;</code><br />
Same as <code>document.location</code></p>
<p>The other properties of location that when modified will reload the page are <code>hash, host, hostname, pathname, port, protocol and search</code>.</p>
<p><strong>What if you want to completely force a page to reload?</strong> Say, you want to clear all entered values in a form or maybe you have modified your CSS and you want to make sure that the page will pickup the new changes. In order to do so, you can do the following:</p>
<p><code>window.location.reload(true);</code></p>
<p>The <code>reload</code> method accepts a boolean value, which, when it is <code>true</code>, causes the page to always fetch document from the server. When none is specified, it defaults to <code>false</code>, which may reload the page from its cache.</p>
<p>As you can see, the methods for forcing a page to reload has their own purposes. If you simply want to reload the  page and do not care about displaying fresh data, you should not always force it to reload from the server to avoid making http requests, which is an expensive call and a waste of bandwidth. You are not only calling the page itself but you maybe reloading an external CSS page too.</p>
]]></content:encoded>
			<wfw:commentRss>http://devel.lubong.com/2007/06/24/javascript-how-to-force-page-to-reload/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Web Acronyms</title>
		<link>http://devel.lubong.com/2007/03/13/web-acronyms/</link>
		<comments>http://devel.lubong.com/2007/03/13/web-acronyms/#comments</comments>
		<pubDate>Wed, 14 Mar 2007 04:22:25 +0000</pubDate>
		<dc:creator>Henry Lubong</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://devel.lubong.com/2007/03/13/web-acronyms/</guid>
		<description><![CDATA[I want to blog some basic stuff for at least a month. How about I start with listing some of the acronyms commonly use on the web. You probably already heard all of them, but do you know what they stand for? Here they are: ASCII &#8211; American Standard Code for Information Interchange AJAX &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>I want to blog some basic stuff for at least a month. How about I start with listing some of the acronyms commonly use on the web. You probably already heard all of them, but do you know what they stand for? Here they are:</p>
<p>ASCII &#8211; American Standard Code for Information Interchange<br />
AJAX &#8211; Asynchronous Javascript<br />
ASP &#8211; Active Server Pages<br />
CGI &#8211; Common Gateway Interface<br />
CF &#8211; Cold Fusion<br />
CFM &#8211; Cold Fusion<br />
CFML &#8211; Cold Fusion<br />
CSS &#8211; Cascading Style Sheet<br />
DB &#8211; Database<br />
DHTML &#8211; Dynamic Hypertext Markup Language<br />
DMX &#8211; Dreamweaver MX<br />
DOM &#8211; Document Object Model<br />
DTD &#8211; Document Type Definition<br />
DW &#8211; Dreamweaver<br />
FF &#8211; Firefox<br />
FE &#8211; Front-end<br />
FEE &#8211; Front-end Engineer<br />
FH &#8211; Freehand<br />
FL &#8211; Flash<br />
FP &#8211; Fireworks<br />
FTP &#8211; File Transfer Protocol<br />
FW &#8211; Fireworks<br />
GIF &#8211; Graphic interchange Format<br />
GUI &#8211; Graphical User Interface<br />
HDML &#8211; Handheld Device Markup Language<br />
HTML &#8211; Hypertext Markup Language<br />
HTTP &#8211; Hypertext Transfer Protocol<br />
HTTPS &#8211; Secure Hypertext Transfer Protocol<br />
IDE &#8211; Integrated Development/Design Environment<br />
IE &#8211; Internet Explorer<br />
IP &#8211; Internet Protocol<br />
IRI &#8211; Internationalized Resource Identifier<br />
JPG/JPEG &#8211; Joint Photographic Experts Group<br />
JS &#8211; Javascript<br />
JSP &#8211; JavaServer Pages<br />
LAMP &#8211; Linux, Apache, MySQL, PHP/Perl/Python<br />
MIME &#8211; Multipurpose Internet Mail Extensions<br />
MM &#8211; Macromedia<br />
MOZ &#8211; Mozilla<br />
MSIE &#8211; Microsoft Internet Explorer<br />
NN &#8211; Netscape Navigator<br />
PERL &#8211; Practical Extraction/Expansion and Report Language<br />
PHP &#8211; Hypertext Preprocessor<br />
PNG &#8211; Portable Network Graphics<br />
POP &#8211; Post Office Protocol<br />
PS &#8211; Photoshop<br />
RDF &#8211; Resource Description Framework<br />
REST &#8211; Representational State Transfer<br />
RPC &#8211; Remote Procedure Call<br />
RS &#8211; Recordset<br />
RTSP &#8211; Realtime Streaming Protocol<br />
SB &#8211; Server Behavior<br />
SGML &#8211; Standard Generalized Markup Language<br />
SMIL &#8211; Synchronized Multimedia Integration Language<br />
SMTP &#8211; Simple Mail Transfer Protocol<br />
SOAP &#8211; Simple Object Access Protocol<br />
SQL &#8211; Structured Query Language<br />
SRGS &#8211; Speech Recognition Grammar Specification<br />
SSI &#8211; Server Side Includes<br />
SSML &#8211; Speech Synthesis Markup Language<br />
SSL &#8211; Secure Sockets Layer<br />
SVG &#8211; Scalable Vector Graphics<br />
TCP/IP &#8211; Transmission Control Protocol over Internet Protocol<br />
TLS &#8211; Transport Layer Security<br />
UCS &#8211; Universal Character Set<br />
UI &#8211; User Interface<br />
URI &#8211; Uniform Resource Identifier<br />
URL &#8211; Uniform Resource Locator<br />
UTF &#8211; Unicode Transformation Format<br />
W3C &#8211; World Wide Web Consortium<br />
WAI &#8211; Web Accessibility Initiative<br />
WASP &#8211; Windows, Apache, SQL, PHP<br />
WML &#8211; Wireless Markup Language<br />
WSDL &#8211; Web Services Description Language<br />
WWW &#8211; World Wide Web<br />
WYSIWYG &#8211; What You See Is What You Get<br />
XHTML &#8211; Extensible HyperText Markup Language<br />
XML &#8211; Extensible Markup Language<br />
XPATH &#8211; XML Path Language<br />
XRI &#8211; Extensible Resource Identifier<br />
XSL &#8211; Extensible Stylesheet Language<br />
XSLT &#8211; Extensible Stylesheet Language Transformations</p>
]]></content:encoded>
			<wfw:commentRss>http://devel.lubong.com/2007/03/13/web-acronyms/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

