<?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>Daily Gadgets, Computer, and Electronics News &#187; Programming</title>
	<atom:link href="http://www.funponsel.com/blog/tag/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.funponsel.com/blog</link>
	<description>Daily Gadgets, Computer, and Electronics News</description>
	<lastBuildDate>Sun, 22 Nov 2009 17:39:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hello World</title>
		<link>http://www.funponsel.com/blog/programming/hello-world-2.html</link>
		<comments>http://www.funponsel.com/blog/programming/hello-world-2.html#comments</comments>
		<pubDate>Sun, 28 Aug 2005 18:34:51 +0000</pubDate>
		<dc:creator>cosa</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[hello_world]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[programming_language]]></category>

		<guid isPermaLink="false">http://www.funponsel.com/blog/archives/2005/08/29/hello-world-2/</guid>
		<description><![CDATA[Hello World. One of the most popular sentence in the computer programming world. People who learn a new programming language usually write &#8220;Hello World&#8221; program first, which output a &#8220;Hello World&#8221; message on the screen. Wolfram RÃ¶sler, with help from many people around the world, managed to compile over 221 Hello World programs in many [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Hello World</strong>. One of the most popular sentence in the computer programming world. People who learn a new programming language usually write &#8220;Hello World&#8221; program first, which output a &#8220;Hello World&#8221; message on the screen. Wolfram RÃ¶sler, with help from many people around the world, managed to compile over 221 Hello World programs in many programming language, plus some human languages too. He started collecting the Hello World program on 03-Oct-1994, put on the Internet on 30-Dec-1999, and exceeded 200 entries on 14-Jul-2005. It is administered as a bunch of text files which are compiled into this single HTML file by a bash script executed under the Cygwin environment, run on Windows.</p>
<p><span id="more-485"></span>A sample of Hello World program using HTML language below:</p>
<p><code>&lt;HTML><br />
&lt;!-- Hello World in HTML --><br />
&lt;HEAD><br />
&lt;TITLE>Hello World!&lt;/TITLE><br />
&lt;/HEAD><br />
&lt;BODY><br />
Hello World!<br />
&lt;/BODY><br />
&lt;/HTML></code></p>
<p>Hey, even Wordpress automatically post Hello World entry upon its installation.</p>
<p><a href="http://www.funponsel.net/images//hello_world.jpg" title="Hello World on Wordpress"><img class="doBorder" src="http://www.funponsel.net/images//_hello_world.jpg" width="450" height="72" alt="Hello World on Wordpress"  /></a></p>
<p>[ Visit <a href="http://www.roesler-ac.de/wolfram/hello.htm">The Hello World Collection</a> ]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.funponsel.com/blog/programming/hello-world-2.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP v5.1.0 Beta 3</title>
		<link>http://www.funponsel.com/blog/news/php-v510-beta-3.html</link>
		<comments>http://www.funponsel.com/blog/news/php-v510-beta-3.html#comments</comments>
		<pubDate>Wed, 20 Jul 2005 19:35:18 +0000</pubDate>
		<dc:creator>cosa</dc:creator>
				<category><![CDATA[News Splash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.funponsel.com/blog/archives/2005/07/21/php-v510-beta-3/</guid>
		<description><![CDATA[New beta version for PHP v5.1 is released today.

Latest Changes:
- PDO (PHP Data Objects) &#8211; A new native database abstraction layer providing performance, ease-of-use, and flexibility
- Significantly improved language performance mainly due to the new Zend Engine II execution architecture
- The PCRE extension has been updated to PCRE 5.0
- Many more improvements including lots of [...]]]></description>
			<content:encoded><![CDATA[<p>New beta version for <a href="http://www.php.net">PHP</a> v5.1 is released today.</p>
<p><span id="more-266"></span><br />
<blockquote><strong>Latest Changes:</strong></p>
<p>- PDO (PHP Data Objects) &#8211; A new native database abstraction layer providing performance, ease-of-use, and flexibility<br />
- Significantly improved language performance mainly due to the new Zend Engine II execution architecture<br />
- The PCRE extension has been updated to PCRE 5.0<br />
- Many more improvements including lots of new functionality &#038; many bug fixes, especially in regards to SOAP, streams and SPL</p>
<p>Download : <a href="http://us2.php.net/distributions/php-5.1.0b3-Win32.zip">PHP v5.1.0 (Beta 3)</a></p>
<p><strong>Key improvements of PHP 5.1 include:</strong></p>
<p>- PDO (PHP Data Objects) &#8211; A new native database abstraction layer providing performance, ease-of-use, and flexibility.<br />
- Significantly improved language performance mainly due to the new Zend Engine II execution architecture.<br />
- The PCRE extension has been updated to PCRE 5.0.<br />
- Many more improvements including lots of new functionality &#038; many bug fixes, especially in regards to SOAP, streams and SPL.</p>
<p><em>Everyone is encouraged to start playing with this beta, although it is not yet recommended for mission-critical production use. </em></p></blockquote>
<p>[ <a href="http://www.go4i.net/article1160.html">Via Go4I.net</a> ] [ <a href="http://us2.php.net/distributions/php-5.1.0b3-Win32.zip">Direct Download</a> ]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.funponsel.com/blog/news/php-v510-beta-3.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax Mistakes</title>
		<link>http://www.funponsel.com/blog/news/ajax-mistakes.html</link>
		<comments>http://www.funponsel.com/blog/news/ajax-mistakes.html#comments</comments>
		<pubDate>Thu, 26 May 2005 02:06:42 +0000</pubDate>
		<dc:creator>cosa</dc:creator>
				<category><![CDATA[News Splash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ajax]]></category>

		<guid isPermaLink="false">http://www.funponsel.com/blog/archives/2005/05/26/ajax-mistakes/</guid>
		<description><![CDATA[From Alex Bosworth&#8217;s blog via digg:
Ajax is an awesome technology that is driving a new generation of web apps, from maps.google.com to colr.org to backpackit.com. But Ajax is also a dangerous technology for web developers, its power introduces a huge amount of UI problems as well as server side state problems and server load problems. [...]]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://sourcelabs.com/ajb/archives/2005/05/ajax_mistakes.html">Alex Bosworth&#8217;s blog</a> via <a href="http://digg.com/programming/Ajax_Mistakes">digg</a>:</p>
<blockquote><p><a href="http://en.wikipedia.org/wiki/AJAX">Ajax</a> is an awesome technology that is driving a new generation of web apps, from <a href="http://maps.google.com">maps.google.com</a> to <a href="http://www.colr.org">colr.org</a> to <a href="http://www.backpackit.com">backpackit.com</a>. But Ajax is also a dangerous technology for web developers, its power introduces a huge amount of UI problems as well as server side state problems and server load problems. </p></blockquote>
<p><span id="more-182"></span><br />
Will you continue using Ajax? If you ask me, <strong>*I will *</strong> Some of the points that Alex mention are probably correct, but some are not. For example:</p>
<blockquote><p>1. Not giving immediate visual cues for clicking widgets.</p></blockquote>
<p>and</p>
<blockquote><p>4. Blinking and changing parts of the page unexpectedly</p></blockquote>
<p>This can be easily done using CSS. Simply prepare a message box using DIV attribute and hide it (<code>display:none</code>). Whenever Ajax is in progress, make it visible (<code>display:block</code>). This way, visitor know if there&#8217;s a progress going on, not <em>unexpectedly</em> anymore. <a href="http://www.funponsel.com/blog/archives/category/programming/ajax/">My Ajax Tutorial</a> also cover this technique.</p>
<p>For me, Ajax is wonderful. It&#8217;s not 100% secure right now, but again, it&#8217;s a wonderful programming technique. I&#8217;ll stick and continue using Ajax for now <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
]]></content:encoded>
			<wfw:commentRss>http://www.funponsel.com/blog/news/ajax-mistakes.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dynamic Text Replacement</title>
		<link>http://www.funponsel.com/blog/web-and-graphic-design/dynamic-text-replacement.html</link>
		<comments>http://www.funponsel.com/blog/web-and-graphic-design/dynamic-text-replacement.html#comments</comments>
		<pubDate>Wed, 18 May 2005 00:13:56 +0000</pubDate>
		<dc:creator>cosa</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Web & Graphic Design]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.funponsel.com/blog/archives/2005/05/18/dynamic-text-replacement/</guid>
		<description><![CDATA[From digg.com:
Excellent article on how to use JavaScript and PHP, to generate images from text using any font you like. All without changing the structure of your HTML or CSS.
Read the article here.
]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://www.digg.com">digg.com</a>:</p>
<blockquote><p>Excellent article on how to use JavaScript and PHP, to generate images from text using any font you like. All without changing the structure of your HTML or CSS.</p></blockquote>
<p>Read the article <a href="http://www.alistapart.com/articles/dynatext/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.funponsel.com/blog/web-and-graphic-design/dynamic-text-replacement.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax Tutorial &#8211; Part II</title>
		<link>http://www.funponsel.com/blog/programming/ajax-tutorial-part-ii.html</link>
		<comments>http://www.funponsel.com/blog/programming/ajax-tutorial-part-ii.html#comments</comments>
		<pubDate>Fri, 13 May 2005 02:21:29 +0000</pubDate>
		<dc:creator>cosa</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.funponsel.com/blog/archives/2005/05/13/ajax-tutorial-part-ii/</guid>
		<description><![CDATA[This is it. The second part of my Ajax tutorial (original version, written in Indonesian language, is available here). This part mostly covered the scripting stuff. The original article was first published in eKelas @ May 5th, 2005.

The Easy Ajax Implementation
For our study case, we&#8217;re going to make a simple voting/rating booth application. We&#8217;re going [...]]]></description>
			<content:encoded><![CDATA[<div class="note">This is it. The second part of my Ajax tutorial (original version, written in Indonesian language, is available <a href="http://www.funponsel.com/blog/archives/2005/05/08/ajax-tutorial-part-i/">here</a>). This part mostly covered the scripting stuff. The original article was first published in <a href="http://ekelas.stikom.edu/forum">eKelas</a> @ May 5<sup>th</sup>, 2005.</div>
<p><span id="more-141"></span><br />
<strong>The Easy Ajax Implementation</strong></p>
<p>For our study case, we&#8217;re going to make a simple voting/rating booth application. We&#8217;re going to make 2 files, one for the front-end (<strong>vote.php</strong>, handle the user interface) and one for the back-end (<strong>sendVote.php</strong>, handle the data saving and retrieval). </p>
<p>First, here&#8217;s the code for <strong>vote.php</strong> (we&#8217;ll explain this later)</p>
<p>[php]< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" ><br />
<head></p>
<p>    <script language="javascript" type="text/javascript"> </p>
<p>        var url = "sendVote.php?id=";
        var delurl = "&#038;value=";</p>
<p>        function handleHttpResponse() {
            if (http.readyState == 4) {
                results = http.responseText.split(",");
                document.getElementById('voteResult').value = results[0];
            }
        }        </p>
<p>        function updateVote() { 
            var voteValue = document.getElementById("voteValue").value; 
            var voteId = document.getElementById("voteId").value;
            http.open("GET", url + voteId + delurl + voteValue, true); 
            http.onreadystatechange = handleHttpResponse; 
            http.send(null);
        }</p>
<p>        function getHTTPObject() { 
            var xmlhttp; /*@cc_on 
            @if (@_jscript_version >= 5) 
                try { 
                    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
                } 
                catch (e) { 
                    try { 
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
                    } 
                    catch (E) { 
                        xmlhttp = false; 
                    } 
                } 
            @else 
                xmlhttp = false; 
            @end @*/  
            if (!xmlhttp &#038;&#038; typeof XMLHttpRequest != 'undefined') { 
                try { 
                    xmlhttp = new XMLHttpRequest(); 
                } 
                catch (e) { 
                    xmlhttp = false; 
                } 
            } 
            return xmlhttp; 
        } </p>
<p>        var http = getHTTPObject();</p>
<p>    </script></p>
<p></head><br />
<body></p>
<form>
<input TYPE="hidden" NAME="voteId" ID="voteId" VALUE="1"/>
        Rating: </p>
<select NAME="voteValue" ID="voteValue">
            <option VALUE="1">1</option><br />
            <option VALUE="2">2</option><br />
            <option VALUE="3">3</option><br />
            <option VALUE="4">4</option><br />
            <option VALUE="5">5</option><br />
        </select>
<input TYPE="button" NAME="submit" ID="submit" VALUE="Vote" onclick="updateVote();" />
        <br />
        Input Rating:<br />
<input TYPE="text" NAME="voteResult" ID="voteResult" WIDTH="5" />
    </form>
<p></body><br />
</html>[/php]</p>
<p>And the second file, <strong>sendVote.php</strong></p>
<p>[php]< ?php<br />
    echo $_GET['value'];<br />
?>[/php]</p>
<p>Before we continue, let&#8217;s try it first by calling vote.php from your web browser. Notice that after you select the rating and hit Vote button, the rating you choose will be displayed on the texbox below.</p>
<p><ins datetime="2005-05-07T07:51:32-07:00">Live Demo:</ins> <a href="http://www.funponsel.com/dev/ajax_vote/vote.php" title="Live Demo">http://www.funponsel.com/dev/ajax_vote/vote.php</a></p>
<p>In this first sample, the process is really simple. We haven&#8217;t process the rating value yet (no database involved), instead, we just send it back as an output for the back-end process. When you hit the Vote button, the JavaScript function, <strong>updateVote()</strong> will be called. In this stage, voteId and voteValue (rating value) are taken from the form and sent to sendVote.php as a parameter through XMLHttpRequest object.</p>
<p>The purpose of <strong>handleHttpResponse()</strong> function is to handle any change on the request status. When the status equal to 4 (<code>readyState == 4</code>), then the request process is over. Or it means that the back-end process already return output. After that, return output is taken from <strong>ResponseText</strong> attribute and then displayed on the textbox.</p>
<p>As already mention, there is no interaction with the database yet. Hey, we haven&#8217;t even create the database <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) <strong>sendVote.php</strong> will simply take the parameter and return the value right away (<code>echo $_GET['value'];</code>.</p>
<div class="comment">What about <strong>getHTTPObject()</strong> function? Don&#8217;t bother with it <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The point is almost the same as what we&#8217;ve learned before on the first part, but with a little bit more <em>twist</em> <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) So let&#8217;s just focus on the XMLHttpRequest process <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  </div>
<blockquote><p>Notice that in this first example we only use XHTML, a simple DOM, and XMLHttpRequest. Just like what I already said before on the first part. No need to worry about learning Ajax on the hard way (with all the complexity of XMLDOM and CSS), as the easy way already exists <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p></blockquote>
<p>On the next page, we will modify our code above and start communication with the database.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.funponsel.com/blog/programming/ajax-tutorial-part-ii.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Ajax Tutorial &#8211; Part I</title>
		<link>http://www.funponsel.com/blog/programming/ajax-tutorial-part-i.html</link>
		<comments>http://www.funponsel.com/blog/programming/ajax-tutorial-part-i.html#comments</comments>
		<pubDate>Sat, 07 May 2005 19:53:51 +0000</pubDate>
		<dc:creator>cosa</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.funponsel.com/blog/archives/2005/05/08/ajax-tutorial-part-i/</guid>
		<description><![CDATA[This is the English translation for my Ajax tutorial. Original article, written in Indonesian language, can be found here.

Introduction
Ajax is the current rising star in the web development field. Several popular company already started using Ajax, including: Google (Gmail, GMaps, GSuggest, GGroups), Amazon (A9.com), Flickr, and Orkut.
Ajax is not a new technology. It&#8217;s a new [...]]]></description>
			<content:encoded><![CDATA[<div class="note">This is the English translation for my Ajax tutorial. Original article, written in Indonesian language, can be found <a href="http://www.funponsel.com/blog/archives/2005/05/05/tutorial-ajax/" title="Tutorial Ajax">here</a>.</div>
<p><span id="more-126"></span></p>
<h2>Introduction</h2>
<p>Ajax is the current rising star in the web development field. Several popular company already started using Ajax, including: Google (Gmail, GMaps, GSuggest, GGroups), Amazon (A9.com), Flickr, and Orkut.</p>
<p><em>Ajax is not a new technology</em>. It&#8217;s a new developing approach, based on the following existing technologies:</p>
<ul>
<li><strong>XHTML</strong> and <strong>CSS</strong> for standard presentation,</li>
<li><strong>DOM (Document Object Model)</strong> for dynamic and interactive presentation,</li>
<li><strong>XML</strong> and <strong>XSLT</strong> for data exchange and manipulation, and</li>
<li><strong>XMLHttpRequest</strong> for asynchronius data retrieval</li>
</ul>
<div class="notes">In the implementation, not all of them must be used at once. The minimal requirement are XHTML, DOM, and XMLHttpRequest. CSS is used to formating and styling the site presentation, while XML (and XSLT) is used to formatting the data being exchange.</div>
<p>The foundation of Ajax is XMLHttpRequest object. It was first implemented by Microsoft on Internet Explorer 5 as an ActiveX object. Later, Mozilla engineers developed a compatible native version for Mozilla 1.0 (and Netscape 7), followed by Apple on their Safari 1.2 browser. </p>
<div class="comment">I haven&#8217;t check it myself, but my friend said that Opera browser doesn&#8217;t support XMLHttpRequest yet. I&#8217;d be grateful if anyone can confirm this for me.</div>
<p>In short, the purpose of this XMLHttpRequest object is to handle data request asynchronously in the background for any web application who need to exchange and manipulate data on-the-fly without reloading the page. In traditional data processing, user submits the data through form, browser sends the data to the server, then server return the output through a new page, so browser need to load that new page in order to display the result to user.</p>
<div class="note">To see what Ajax looks like, just login to your <a href="http://www.google.com/gmail">GMail</a> account (if you don&#8217;t have one, get it free <a href="http://www.funponsel.com/blog/archives/2005/04/17/free-gmail-account">here</a> <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ), and check your inbox. You&#8217;ll see a &#8220;Loading&#8221; message on the top right of the screen. Then the message disappear, and a list of your inbox message is displayed. All of them happen without reloading the page. Compare the process with <a href="http://mail.yahoo.com/">Yahoo! Mail</a> or <a href="http://www.hotmail.com">HotMail</a>. <a href="http://www.google.com">Google</a>&#8217;s <a href="http://www.google.com/gmail">GMail</a> used Ajax, and that&#8217;s what you get with Ajax implementation. Cool, huh? <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</div>
<p>On the next page, we will discuss more about XMLHttpRequest object.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.funponsel.com/blog/programming/ajax-tutorial-part-i.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>15 Things You Can Do With RSS</title>
		<link>http://www.funponsel.com/blog/article/15-things-you-can-do-with-rss.html</link>
		<comments>http://www.funponsel.com/blog/article/15-things-you-can-do-with-rss.html#comments</comments>
		<pubDate>Fri, 06 May 2005 02:26:31 +0000</pubDate>
		<dc:creator>cosa</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[News Splash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.funponsel.com/blog/archives/2005/05/06/15-things-you-can-do-with-rss/</guid>
		<description><![CDATA[Tim Yang wrote a nice article titled 15 Things You Can Do With RSS. Go there and read it. It&#8217;s amazing to find out what RSS can do these days  )
]]></description>
			<content:encoded><![CDATA[<p><a href="http://timyang.com">Tim Yang</a> wrote a nice article titled <strong>15 Things You Can Do With RSS</strong>. Go <a href="http://timyang.com/comments.php?id=630_0_1_0_C">there</a> and read it. It&#8217;s amazing to find out what RSS can do these days <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
]]></content:encoded>
			<wfw:commentRss>http://www.funponsel.com/blog/article/15-things-you-can-do-with-rss.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial Ajax &#8211; Part II</title>
		<link>http://www.funponsel.com/blog/programming/tutorial-ajax-part-ii.html</link>
		<comments>http://www.funponsel.com/blog/programming/tutorial-ajax-part-ii.html#comments</comments>
		<pubDate>Thu, 05 May 2005 15:52:10 +0000</pubDate>
		<dc:creator>cosa</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.funponsel.com/blog/archives/2005/05/05/tutorial-ajax-part-ii/</guid>
		<description><![CDATA[Second and final part of my Ajax tutorial. This part mostly covered the scripting stuff. This article first published in eKelas @ May 5th, 2005. And yes, I&#8217;ll translate this into English asap  

Implementasi
Untuk percobaan, kita akan membuat sebuah aplikasi voting/rating booth sederhana. Secara umum, kita akan menyiapkan 2 buah file, yaitu sebuah file [...]]]></description>
			<content:encoded><![CDATA[<div class="note">Second and final part of my Ajax tutorial. This part mostly covered the scripting stuff. This article first published in <a href="http://ekelas.stikom.edu/forum">eKelas</a> @ May 5<sup>th</sup>, 2005. And yes, I&#8217;ll translate this into English asap <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </div>
<p><span id="more-118"></span><br />
<strong>Implementasi</strong></p>
<p>Untuk percobaan, kita akan membuat sebuah aplikasi voting/rating booth sederhana. Secara umum, kita akan menyiapkan 2 buah file, yaitu sebuah file HTML (atau PHP) untuk presentasi ke layar dan sebuah file script PHP untuk melakukan proses backend (retrieve &#038; save data).</p>
<p>File pertama, <strong>vote.htm</strong></p>
<p>[html]< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" ><br />
<head></p>
<p>    <script language="javascript" type="text/javascript"> </p>
<p>        var url = "sendVote.php?id=";
        var delurl = "&#038;value=";</p>
<p>        function handleHttpResponse() {
            if (http.readyState == 4) {
                results = http.responseText.split(",");
                document.getElementById('voteResult').value = results[0];
            }
        }        </p>
<p>        function updateVote() { 
            var voteValue = document.getElementById("voteValue").value; 
            var voteId = document.getElementById("voteId").value;
            http.open("GET", url + voteId + delurl + voteValue, true); 
            http.onreadystatechange = handleHttpResponse; 
            http.send(null);
        }</p>
<p>        function getHTTPObject() { 
            var xmlhttp; /*@cc_on 
            @if (@_jscript_version >= 5) 
                try { 
                    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
                } 
                catch (e) { 
                    try { 
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
                    } 
                    catch (E) { 
                        xmlhttp = false; 
                    } 
                } 
            @else 
                xmlhttp = false; 
            @end @*/  
            if (!xmlhttp &#038;&#038; typeof XMLHttpRequest != 'undefined') { 
                try { 
                    xmlhttp = new XMLHttpRequest(); 
                } 
                catch (e) { 
                    xmlhttp = false; 
                } 
            } 
            return xmlhttp; 
        } </p>
<p>        var http = getHTTPObject();</p>
<p>    </script></p>
<p></head><br />
<body></p>
<form>
<input TYPE="hidden" NAME="voteId" ID="voteId" VALUE="1"/>
        Nilai: </p>
<select NAME="voteValue" ID="voteValue">
            <option VALUE="1">1</option><br />
            <option VALUE="2">2</option><br />
            <option VALUE="3">3</option><br />
            <option VALUE="4">4</option><br />
            <option VALUE="5">5</option><br />
        </select>
<input TYPE="button" NAME="submit" ID="submit" VALUE="Vote" onclick="updateVote();" />
        <br />
        Nilai yang Anda masukkan:<br />
<input TYPE="text" NAME="voteResult" ID="voteResult" WIDTH="5" />
    </form>
<p></body><br />
</html>[/html]</p>
<p>File kedua, <strong>sendVote.php</strong></p>
<p>[php]< ?php</p>
<p>    echo $_GET['value'];</p>
<p>?>[/php]</p>
<p>Sebelum dibahas, coba jalankan dulu dng cara memanggil file vote.htm. Perhatkan, pada saat Anda memilih nilai rating dan menekan tombol Vote, beberapa saat kemudian nilai tersebut akan muncul pada textbox di bawahnya.</p>
<p><ins datetime="2005-05-07T07:51:32-07:00">Live Demo:</ins> <a href="http://www.funponsel.com/dev/ajax_vote/vote.php" title="Live Demo">http://www.funponsel.com/dev/ajax_vote/vote.php</a></p>
<p>Pada contoh pertama ini, proses berlangsung sangat sederhana. Pada saat tombol Vote ditekan, maka akan dilakukan pemanggilan function JS <strong>updateVote()</strong>. Dalam fungsi ini dilakukan pemanggilan thd file sendVote.php dng parameter id dan value yg diambil dari form. Proses pemanggilan dilakukan melalui obyek XMLHttpRequest.</p>
<p>Function <strong>handleHttpResponse</strong> bertujuan untuk menangani perubahan status request. Apabila status adalah 4, berarti proses telah selesai. Selanjutnya data akan diambil dari atribut ResponseText dan ditampilkan dlm textbox.</p>
<p>Script sendVote.php saat ini masih belum melakukan interaksi dng database. Prosesnya hanyalah menerima parameter value dan mengembalikannya sbg output. Itu sebabnya yg muncul pada textbox adalah nilai yg kita pilih.</p>
<div class="comment">Bagaimana dng function getHTTPObject()? Tidak perlu dipikir <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Intinya hampir sama dng fungsi yg ada pada bagian sebelumnya, hanya sedikit lebih detil (mbulet <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</div>
<blockquote><p>Perhatikan bahwa dlm contoh ini kita hanya menggunakan XHTML, DOM, dan XMLHttpRequest. Sesuai dng yg saya sebutkan sebelumnya <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  DOM yg digunakan pun sangat sederhana, sekedar method getElementById saja.</p></blockquote>
<p>Pada halaman selanjutnya, kita akan melakukan sedikit modifikasi untuk berkoneksi dng database.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.funponsel.com/blog/programming/tutorial-ajax-part-ii.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial Ajax</title>
		<link>http://www.funponsel.com/blog/programming/tutorial-ajax.html</link>
		<comments>http://www.funponsel.com/blog/programming/tutorial-ajax.html#comments</comments>
		<pubDate>Thu, 05 May 2005 15:41:47 +0000</pubDate>
		<dc:creator>cosa</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.funponsel.com/blog/archives/2005/05/05/tutorial-ajax/</guid>
		<description><![CDATA[I just wrote a tutorial for Ajax on eKelas and I post it here as a backup for my writing   Sorry, still in Indonesian language. I&#8217;ll try to translate it to English as soon as possible.

Pendahuluan
Ajax adalah sebuah development approach yg saat ini sedang naik daun. Beberapa perusahaan yg sudah menggunakan Ajax, al: [...]]]></description>
			<content:encoded><![CDATA[<div class="note">I just wrote a tutorial for Ajax on eKelas and I post it here as a backup for my writing <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Sorry, still in Indonesian language. I&#8217;ll try to translate it to English as soon as possible.</div>
<p><span id="more-117"></span><br />
<strong>Pendahuluan</strong></p>
<p>Ajax adalah sebuah development approach yg saat ini sedang naik daun. Beberapa perusahaan yg sudah menggunakan Ajax, al: Google (GMail, GMaps, GSuggest, GGroups), Amazon (A9), Flickr, dan Orkut.</p>
<p>Ajax bukan sebuah teknologi baru, melainkan sebuah tehnik pengembangan aplikasi web dengan menggabungkan dan memanfaatkan beberapa teknologi yg sudah ada, yaitu:<br />
- standard presentasi menggunakan XHTML dan CSS<br />
- tampilan dinamis dan interaktif dengan menggunakan DOM (Document Object Model)<br />
- pertukaran dan manipulasi data dengan menggunakan XML dan XSLT<br />
- pengambilan data asinkron dengan menggunakan XMLHttpRequest</p>
<blockquote><p>Pada prakteknya nanti, tidak semua teknologi di atas harus digunakan scr bersamaan. Yg wajib dipakai adalah XHTML, DOM, dan XMLHttpRequest. CSS adalah tambahan untuk lebih mempercantik tampilan dan interaksi dng user, sedangkan XML adalah untuk memformat data saja.</p></blockquote>
<p>Dasar dari Ajax sendiri adalah obyek ActiveX XMLHttpRequest yg diimplementasikan oleh Microsoft pada IE5. Mozilla sendiri kemudian menyusul pada Mozilla 1.0 (Netscape 7) dan selanjutnya Apple pada Safari 1.2. Secara singkat, tujuan dari obyek ini adalah menangani pembuatan aplikasi yg dapat melakukan proses2 pertukaran dan manipulasi data XML scr on-the-fly tanpa perlu adanya proses reload halaman. Proses2 manipulasi data tradisional yg ada selama ini menggunakan konsep form, dmn apabila form di-submit, data dikirimkan, dan user akan dibawa ke halaman baru untuk melihat hasilnya. Dng memanfaatkan Ajax, khususnya XMLHttpRequest ini, user tidak akan dibawa ke halaman baru krn hasil dari proses submit akan langsung muncul di halaman yg sama.</p>
<blockquote><p>Kalo bingung ngebayangin, coba login ke GMail (kalo belum punya GMail, klik link yg ada di signature-ku). Perhatikan baik2. Proses cek inbox, baca email, dsb, semuanya berlangsung tanpa ada proses loading halaman. Bahkan saat proses, akan muncul tulisan &#8220;Loading&#8221; di pojok kanan atas. Keren kan? Ya itulah salah satu contoh nyata pemanfaatan Ajax.</p></blockquote>
<p>Bagian berikut akan membahas mengenai obyek XMLHttpRequest dan method2nya.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.funponsel.com/blog/programming/tutorial-ajax.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tutorial Smarty &#8211; Bagian III</title>
		<link>http://www.funponsel.com/blog/programming/tutorial-smarty-bagian-iii.html</link>
		<comments>http://www.funponsel.com/blog/programming/tutorial-smarty-bagian-iii.html#comments</comments>
		<pubDate>Tue, 03 May 2005 17:47:26 +0000</pubDate>
		<dc:creator>cosa</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.funponsel.com/blog/archives/2005/05/04/tutorial-smarty-bagian-iii/</guid>
		<description><![CDATA[Bagian ketiga dari tutorial ini diambil dari posting gw di eKelas tanggal 23 April 2005.

Sekarang kita akan mencoba mendalami Smarty lebih jauh, yaitu dng membuat aplikasi guestbook   Konsepnya adalah sebuah guestbook sederhana dng pilihan tampilan 2 bahasa. Proyek yg dbuat ini akan terdiri dari 4 bagian, yaitu:
1. Main (guestbook.php) &#8211;> script utama, berisi [...]]]></description>
			<content:encoded><![CDATA[<div class="note">Bagian ketiga dari tutorial ini diambil dari posting gw di <a href="http://ekelas.stikom.edu/forum">eKelas</a> tanggal 23 April 2005.</div>
<p><span id="more-110"></span><br />
Sekarang kita akan mencoba mendalami Smarty lebih jauh, yaitu dng membuat aplikasi guestbook <img src='http://www.funponsel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Konsepnya adalah sebuah guestbook sederhana dng pilihan tampilan 2 bahasa. Proyek yg dbuat ini akan terdiri dari 4 bagian, yaitu:<br />
1. Main (guestbook.php) &#8211;> script utama, berisi parsing ke template dan proses2 database. Letakkan di direktori utama (mis: path-to-web-server\guestbook)<br />
2. Konfigurasi &#8211;> file konfigurasi. Letakkan di subdir configs (mis: path-to-web-server\guestbook\configs)<br />
2.a. Indonesia.conf &#8211;> berisi konfigurasi untuk mode bahasa Indonesia<br />
2.b. Inggris.conf &#8211;> berisi konfigurasi untuk mode bahasa Inggris<br />
3. Template (guestbook.tpl) &#8211;> file template, berisi template tampilan. Letakkan di subdir templates (mis: path-to-web-server\guestbook\templates)<br />
4. Style sheet (style.css) &#8211;> CSS file, untuk pendukung tampilan. Letakkan di direktori utama (mis: path-to-web-server\guestbook)</p>
<div class="note">Entah kenapa, Smarty memberikan pesan error saat menggunakan metode<br />
<style></style>
<p> untuk memasukkan kode CSS. Sedangkan pada penggunaan inline style (tag style) dan embedded style (link rel) tidak ada masalah.</p></div>
<p>Berikut source code-nya:<br />
1. <strong>guestbook.php</strong></p>
<p>[php]< ?php<br />
     require 'libs/Smarty.class.php';<br />
     $smarty = new Smarty;<br />
     $smarty->assign(&#8221;content&#8221;,&#8221;Smarty says, &#8220;Hello World&#8221;");<br />
     $smarty->display(&#8217;guestbook.tpl&#8217;);<br />
?>[/php]</p>
<p>2. a. <strong>Indonesia.conf</strong></p>
<p>[code]# Konfigurasi untuk bhs Indonesia<br />
pageTitle = "Demo Pembuatan Buku Tamu menggunakan Smarty"<br />
textTitle = "Buku Tamu dengan Smarty"<br />
textDesc = "Demo ini menunjukkan penggunaan pustaka Smarty. Dengan Smarty. kita dapat memisahkan bagian logika dengan bagian presentasi dari aplikasi kita. Selain itu kita juga dapat memisahkan konfigurasi dari aplikasi tersebut. Hasilnya adalah manajemen proyek yg lebih baik efektif dan efisien."<br />
formTextName = "Nama"<br />
formTextEmail = "Email"<br />
formTextComment = "Komentar"<br />
formTextSubmit = "Isi Buku Tamu"<br />
formTextDiv = ":"[/code]</p>
<p>2. b. <strong>Inggris.conf</strong></p>
<p>[code]# Konfigurasi untuk bhs Inggris<br />
pageTitle = "Guestbook Demo Using Smarty"<br />
textTitle = "Guestbook with Smarty"<br />
textDesc = "This demo shows how Smarty library works. With Smarty, you can easily split your application coding/logic, design/layout, and configuration, thus make project management much more easier."<br />
formTextName = "Name"<br />
formTextEmail = "Email"<br />
formTextComment = "Comment"<br />
formTextSubmit = "Submit"<br />
formTextDiv = ":"[/code]</p>
<p>3. <strong>guestbook.tpl</strong></p>
<p>[html]{config_load file=&#8221;inggris.conf&#8221;}<br />
<html><br />
<head></p>
<link REL="StyleSheet" HREF="style.css" TYPE="text/css">
</link></head><br />
<body></p>
<div id="main">
<div id="textTitle">{#textTitle#}</div>
<div id="textDesc">{#textDesc#}</div>
<div id="formPost">
<form method="post">
<div id="tableRow">
<div id="tableCol1">{#formTextName#}</div>
<div id="tableCol2">{#formTextDiv#}</div>
<div id="tableCol3">
<input type="text" id="nama" width="20"/></div>
<p>
            </div>
<div id="tableRow">
<div id="tableCol1">{#formTextEmail#}</div>
<div id="tableCol2">{#formTextDiv#}</div>
<div id="tableCol3">
<input type="text" id="email" width="20"/></div>
<p>
            </div>
<div id="tableRow">
<div id="tableCol1">{#formTextComment#}</div>
<div id="tableCol2">{#formTextDiv#}</div>
<div id="tableCol3"><textarea id="komentar" rows="5" cols="20"></textarea></div>
<p>
            </div>
<div style="float:right;padding-top:5px;padding-right:10px;">
<input style="background-color:#99CC33;"type="submit" id="submit" value="{#formTextSubmit#}"/></div>
</p></form>
</p></div>
<div id="content">{$content}</div>
</div>
<p></body><br />
</html>[/html]</p>
<p>4. <strong>style.css</strong></p>
<p>[css]body {<br />
    background-color: #f4f4f4;<br />
    color: #000;<br />
    margin: 0px;<br />
}</p>
<p>#main {<br />
    width:90%;<br />
    background-color:#ffffff;<br />
    float:left;<br />
    border-right:2px dashed #333333;<br />
    border-bottom:2px dashed #333333;<br />
    padding-bottom:40px;<br />
}</p>
<p>#main #textTitle {<br />
    text-align: center;<br />
    margin-top:10px;<br />
    margin-bottom:10px;<br />
    font-weight:bolder;<br />
    font-size:1.5em;<br />
}</p>
<p>#main #textDesc {<br />
    font-size:0.8em;<br />
    padding:5px;<br />
    margin-left:10%;<br />
    margin-right:10%;<br />
    margin-bottom:20px;<br />
    text-align:center;<br />
    border:2px solid #cccccc;<br />
    background-color:#e9e9e9;<br />
    -moz-border-radius:7px;<br />
}</p>
<p>#main #formPost {<br />
    float:left;<br />
    margin-left:5%;<br />
    margin-right:5%;<br />
    padding:10px;<br />
    border:1px solid #999999;<br />
    width:250px;<br />
    background-color:#f9f9f9;<br />
}</p>
<p>#main #formPost #tableRow {<br />
    border-bottom:1px solid #cccccc;<br />
    padding-bottom:5px;<br />
    margin-bottom:5px;<br />
}</p>
<p>#main #formPost #tableCol1 {<br />
    float:left;<br />
    margin-left:10px;<br />
    width:60px;<br />
}</p>
<p>#main #formPost #tableCol2 {<br />
    float:left;<br />
    margin-left:10px;<br />
    width:10px;<br />
    text-align:center;<br />
}</p>
<p>#main #formPost #tableCol3 {<br />
    float:left;<br />
    margin-left:10px;<br />
    width:80px;<br />
}</p>
<p>input,textarea {<br />
    background-color:#f3f3cc;<br />
    border:1px solid #333333;<br />
}</p>
<p>#main #content {<br />
    float: left;<br />
    font-size: 0.9em;<br />
}[/css]</p>
<p>Sekarang coba kita jalankan (<em>http://localhost/guestbook/guestbook.php</em>). Contoh hasilnya dapat dilihat di screenshot di bawah. Cobalah untuk mengganti &#8220;<em>inggris.conf</em>&#8221; dengan &#8220;<em>indonesia.conf</em>&#8221; pada baris pertama dari <em>index.tpl</em> dan lihat hasilnya. Secara otomatis buku tamu Anda akan berganti bahasa.</p>
<p><a href="http://www.funponsel.net/images//smarty_demo.jpg"><img src="http://www.funponsel.net/images//_smarty_demo.jpg" width="300" height="129" alt="Smart Demo Screenshot" title="Smart Demo Screenshot"  /></a></p>
<p>Pada bagian ini kita hanya akan membahas masalah penggunaan Smarty pada tampilan utama saja. Pada bagian selanjutnya, bagian terakhir, akan dibahas sisanya, yaitu ttg pemilihan bahasa (konfigurasi) yg digunakan, proses2 database, serta output dari database.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.funponsel.com/blog/programming/tutorial-smarty-bagian-iii.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
