<?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>Evangozali&#039;s Weblog</title>
	<atom:link href="http://evangozali.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://evangozali.wordpress.com</link>
	<description>A frog, yearning to get out of shell</description>
	<lastBuildDate>Tue, 29 Nov 2011 10:38:45 +0000</lastBuildDate>
	<language>id</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='evangozali.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Evangozali&#039;s Weblog</title>
		<link>http://evangozali.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://evangozali.wordpress.com/osd.xml" title="Evangozali&#039;s Weblog" />
	<atom:link rel='hub' href='http://evangozali.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Easy comment-uncomment with 1 character</title>
		<link>http://evangozali.wordpress.com/2011/11/29/easy-comment-uncomment-with-1-character/</link>
		<comments>http://evangozali.wordpress.com/2011/11/29/easy-comment-uncomment-with-1-character/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 10:30:12 +0000</pubDate>
		<dc:creator>evangozali</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[commenting]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://evangozali.wordpress.com/?p=224</guid>
		<description><![CDATA[This is commented. /* do_something(); //*/ This is not. //* do_something(); //*/ Got this from a friend who got this from a friend who got this from a friend who&#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=224&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is commented.</p>
<pre>/*
do_something();
//*/</pre>
<p>This is not.</p>
<pre>//*
do_something();
//*/
</pre>
<p>Got this from a friend who got this from a friend who got this from a friend who&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evangozali.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evangozali.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evangozali.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evangozali.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evangozali.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evangozali.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evangozali.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evangozali.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evangozali.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evangozali.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evangozali.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evangozali.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evangozali.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evangozali.wordpress.com/224/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=224&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evangozali.wordpress.com/2011/11/29/easy-comment-uncomment-with-1-character/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65a39a6123e3956f493978c1ee913c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evangozali</media:title>
		</media:content>
	</item>
		<item>
		<title>[iOS] Pointer to Block Pointer</title>
		<link>http://evangozali.wordpress.com/2011/11/24/ios-pointer-to-block-pointer/</link>
		<comments>http://evangozali.wordpress.com/2011/11/24/ios-pointer-to-block-pointer/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 15:34:28 +0000</pubDate>
		<dc:creator>evangozali</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[pointer]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://evangozali.wordpress.com/?p=212</guid>
		<description><![CDATA[iOS block programming feature is pretty cool, it makes asynchronous programming easier. This time I want to talk about block pointer. A block pointer is a type of variable that we can use to refer to a block, for example void (^blockPointer)(void) = void ^(void) { NSLog(@"inside a block"); }; We can then execute the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=212&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>iOS <a href="http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Blocks/Articles/00_Introduction.html">block programming</a> feature is pretty cool, it makes asynchronous programming easier. This time I want to talk about <em>block pointer</em>. A block pointer is a type of variable that we can use to refer to a block, for example</p>
<pre>void (^blockPointer)(void) = void ^(void) { NSLog(@"inside a block"); };</pre>
<p>We can then execute the block like normal function call.</p>
<pre>blockPointer();</pre>
<p>What&#8217;s interesting is that a block pointer is actually an Objective-C object. We can do <em>copy</em>, <em>retain</em>, <em>release</em>, <em>autorelease</em> (more on this can be read <a href="http://ptgmedia.pearsoncmg.com/images/9780321711380/samplepages/0321711386.pdf">here</a>) on it, and also assign a pointer to it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>I&#8217;ll show you a sample use case where I want to make a pointer to a block pointer. Suppose I have a function that does something asynchronously and executes a block at the end of it.</p>
<pre>- (void) asyncFunction:(void (^)(void)) block {
  // do something asynchronously, then execute the block at the end
  block();
}</pre>
<p>Then I have another function, a nasty one with many nested <em>if</em>s, that passes a block to asyncFunction depending on the conditions. When it doesn&#8217;t call asyncFunction, the block still has to be executed. So the block must be called exactly once, no matter which conditional route it takes.</p>
<p><strong>Solution A</strong>: do some brute force with myriads of <em>if-else</em></p>
<pre>- (void)nastyFunction:(void (^)(void)) block {
  if (...) {
    if (...) {
      [self asyncFunction:block];
    } else {
      /* myriads of other if-else */
    }
  } else (...) {
    block();
  }
}</pre>
<p><strong>Solution B</strong>: Because a block pointer is an Objective-C object, we can assign <em>nil</em> to it. So after calling asyncFunction, we assign the block to <em>nil</em>. At the end of nastyFunction we execute the block only if it&#8217;s not <em>nil</em>.</p>
<pre>- (void)nastyFunction:(void (^)(void)) block {
  if (...) {
    if (...) {
      [self asyncFunction:block];
      block = nil;
    }
    /* myriads of other ifs */
  }
  if (block != nil){
    block();
  }
}</pre>
<p>The number of <em>else</em> decreases, the number of &#8216;<em>block = nil</em>&#8216; increases.</p>
<p><strong>Solution C</strong>: this is where pointer to block pointer becomes useful. Instead of writing &#8216;<em>block=nil</em>&#8216; numerous times, we write it only once inside asyncFunction. But to change the value of <em>block</em> inside nastyFunction, we have to pass it to asyncFunction using a pointer. We declare a pointer to block pointer using this statement.</p>
<pre>void (^pointerToBlockPointer *)(void)</pre>
<p>So asyncFunction becomes</p>
<pre>- (void) asyncFunction:(void (^*)(void)) block {
  // do something asynchronously, then execute the block at the end and assign it to nil
  *block();
  *block = nil;
}</pre>
<p>And we pass the block from nastyFunction using its address.</p>
<pre>- (void)nastyFunction:(void (^)(void)) block {
  if (...) {
    if (...) {
      [self asyncFunction:&amp;block];  
    }
    /* myriads of other ifs */
  }
  if (block != nil){
    block();
  }
}</pre>
<p>The declaration for pointer to block pointer is pretty funny, I got it from XCode compilation error message <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>Another useful tips: if you want to simplify the declaration, you can typedef the block pointer.</p>
<pre>typedef (void)(^BlockPointerType)(void);</pre>
<p>So the pointer to it can be written as</p>
<pre>BlockPointerType * pointerToBlockPointer;</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evangozali.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evangozali.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evangozali.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evangozali.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evangozali.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evangozali.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evangozali.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evangozali.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evangozali.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evangozali.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evangozali.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evangozali.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evangozali.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evangozali.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=212&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evangozali.wordpress.com/2011/11/24/ios-pointer-to-block-pointer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65a39a6123e3956f493978c1ee913c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evangozali</media:title>
		</media:content>
	</item>
		<item>
		<title>[AS3] Nested function and asynchronous model</title>
		<link>http://evangozali.wordpress.com/2011/03/04/as3-nested-function-and-asynchronous-model/</link>
		<comments>http://evangozali.wordpress.com/2011/03/04/as3-nested-function-and-asynchronous-model/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 03:15:07 +0000</pubDate>
		<dc:creator>evangozali</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[adobe air]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[nested function]]></category>

		<guid isPermaLink="false">http://evangozali.wordpress.com/?p=191</guid>
		<description><![CDATA[In early days I&#8217;m used to synchronous programming model, everything can be called sequentially so I don&#8217;t have to deal with callback, I can write the code very neatly. When I meet AS3, I learn much about asynchronous functions, callbacks and event handlers.  AS3 uses asynchronous model so extensively, almost everything that needs &#8220;loading time&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=191&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">In early days I&#8217;m used to synchronous programming model, everything can be called sequentially so I don&#8217;t have to deal with callback, I can write the code very neatly. When I meet AS3, I learn much about asynchronous functions, callbacks and event handlers.  AS3 uses asynchronous model so extensively, almost everything that needs &#8220;loading time&#8221; is asynchronous, like URLLoader, Loader, SQLStatement, and more. On one side it makes my job easier because I don&#8217;t need to create a background process (as in Java / C#) to do the loading in background and prevent the application from hanging. On the other side it makes the code I write pretty messy.</p>
<p style="text-align:justify;">Imagine a case where I need to do multiple INSERT statement to an SQLite database and do something when all insertions finish. I can either 1) do all insertions sequentially and handle all success callbacks. Then when the number of callbacks equals the number of insertions, I continue. Or 2) do first insertion, wait callback, insert the next, wait callback, and so on until the last callback. In either case, I need to add a new object variable to count the number of callbacks. That makes the code more unclean because the variable should only be used temporarily.</p>
<p style="text-align:justify;">This is where I find nested function to be really useful. I have known that AS3 has nested function since way back then, but I prefer not to use it in my code for the sake of clean and more readable code. However in this case of multiple asynchronous functions, I find no better way to do it than nested function. This is due to one magical property of nested function: it preserves the local variable of its parent function, even across asynchronous calls.</p>
<p style="text-align:justify;">So for example, if I want to do multiple insert to SQLite using method 2) above, the code will look something like this.</p>
<pre>function insertAll(){
  var i:int = 0, max:int = 10;
  var statement:SQLStatement = new SQLStatement();
  statement.sqlConnection = this.connection;
  function insert(){
    if (i &lt; max){
      statement.text = "INSERT INTO table VALUES ("+i+")";
      statement.execute(-1, new Responder(insert));
      i++;
    } else {
      //do something after
    }
  }
  insert();
}</pre>
<p style="text-align:justify;">In function insertAll(), the value of local variable &#8220;i&#8221; will be preserved across calls to nested function insert(). So I don&#8217;t need to add any new object variable. In this case I find asynchronous model and nested function are meant to be used together, maybe that&#8217;s actually the idea behind them anyway.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evangozali.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evangozali.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evangozali.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evangozali.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evangozali.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evangozali.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evangozali.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evangozali.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evangozali.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evangozali.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evangozali.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evangozali.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evangozali.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evangozali.wordpress.com/191/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=191&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evangozali.wordpress.com/2011/03/04/as3-nested-function-and-asynchronous-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65a39a6123e3956f493978c1ee913c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evangozali</media:title>
		</media:content>
	</item>
		<item>
		<title>Cara Sederhana Membedakan Script PHP untuk Development/Deployment</title>
		<link>http://evangozali.wordpress.com/2010/12/17/cara-sederhana-membedakan-script-php-untuk-developmentdeployment/</link>
		<comments>http://evangozali.wordpress.com/2010/12/17/cara-sederhana-membedakan-script-php-untuk-developmentdeployment/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 10:48:15 +0000</pubDate>
		<dc:creator>evangozali</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[trik]]></category>

		<guid isPermaLink="false">http://evangozali.wordpress.com/?p=186</guid>
		<description><![CDATA[Saat sedang kodang-koding di kantor, tiba-tiba saya menemukan penggunaan require_once pada php yang agak menarik. Seperti yang kita tahu, require_once memasukkan sebuah script hanya pertama kali dipanggil. Jika script yang sama dimasukkan 2 kali, pemasukan kedua tidak dilakukan. Masalah yang sedang saya kerjakan seperti ini: saya membuat script php yang menerima input parameter dan melakukan [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=186&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Saat sedang kodang-koding di kantor, tiba-tiba saya menemukan penggunaan require_once pada php yang agak menarik. Seperti yang kita tahu, require_once memasukkan sebuah script hanya pertama kali dipanggil. Jika script yang sama dimasukkan 2 kali, pemasukan kedua tidak dilakukan.</p>
<p style="text-align:justify;">Masalah yang sedang saya kerjakan seperti ini: saya membuat script php yang menerima input parameter dan melakukan validasi sederhana dengan hashing parameter. Yang merepotkan, untuk melakukan testing pada script tersebut saya harus menghitung hash dari parameter yang saya input -___-, padahal saya ingin melakukan testing cepat dengan memasukkan parameter lewat browser. Salah satu solusinya, saya dapat menonaktifkan dahulu fitur hashing untuk melakukan pengujian lewat browser, tapi untuk menguji aplikasi sebenarnya saya harus mengaktifkan hashing lagi, jadinya bolak-balik deh.</p>
<p style="text-align:justify;">Ada cara lain yang ternyata lebih mudah, yaitu membuat script terpisah untuk testing pada browser dan meng-require_once script asli. Pada script asli saya menambahkan konfigurasi aktif/tidaknya hashing dengan variable $use_hash. Variable $use_hash ini saya definisikan pada script terpisah &#8220;config.php&#8221; yang di-require_once oleh script asli. Untuk lebih gampangnya, isi script kurang lebih sebagai berikut.</p>
<p style="text-align:justify;"><code><br />
//script config.php<br />
$use_hash = true;<br />
</code></p>
<p style="text-align:justify;"><code>//script asli.php<br />
require_once("config.php");<br />
if ($use_hash) {<br />
//hitung hash<br />
} else {</code></p>
<p style="text-align:justify;">}</p>
<p style="text-align:justify;"><code>//script testing.php<br />
require_once("config.php");<br />
$use_hash = false;<br />
require_once("asli.php");<br />
</code></p>
<p style="text-align:justify;">Mekanisme pada script testing.php: karena require_once hanya meng-include sekali, script config.php hanya dibaca pertama kali. require_once(&#8220;config.php&#8221;) yang terdapat di script asli.php tidak akan terpanggil, sehingga nilai akhir variable $use_hash adalah false. Dengan cara ini saya dapat melakukan testing pada browser cukup dengan membuka testing.php (muhaha). Mungkin trik ini juga bisa dipakai untuk keperluan lain, seperti membedakan script yang akan digunakan untuk tahapan development/deployment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evangozali.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evangozali.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evangozali.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evangozali.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evangozali.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evangozali.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evangozali.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evangozali.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evangozali.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evangozali.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evangozali.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evangozali.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evangozali.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evangozali.wordpress.com/186/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=186&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evangozali.wordpress.com/2010/12/17/cara-sederhana-membedakan-script-php-untuk-developmentdeployment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65a39a6123e3956f493978c1ee913c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evangozali</media:title>
		</media:content>
	</item>
		<item>
		<title>Review Game: Ever17 &#8211; The Out of Infinity</title>
		<link>http://evangozali.wordpress.com/2010/09/28/review-game-ever17-the-out-of-infinity/</link>
		<comments>http://evangozali.wordpress.com/2010/09/28/review-game-ever17-the-out-of-infinity/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 16:28:50 +0000</pubDate>
		<dc:creator>evangozali</dc:creator>
				<category><![CDATA[Review]]></category>
		<category><![CDATA[ever17]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[KID]]></category>
		<category><![CDATA[misteri]]></category>
		<category><![CDATA[novel]]></category>
		<category><![CDATA[sci-fi]]></category>
		<category><![CDATA[Visual Novel]]></category>

		<guid isPermaLink="false">http://evangozali.wordpress.com/?p=165</guid>
		<description><![CDATA[Setelah berbulan-bulan ga nulis blog, akhirnya gatel juga pengen nulis review game Ever17. Ever17 &#8211; The Out of Infinity adalah visual novel non-eroge keluaran 2002 yang diproduksi Kindle Imagine Develop (KID) &#8211; perusahaan game Jepang yang sayangnya udah bangkrut -_-&#8221;. Ever17 mengambil latar belakang di sebuah tempat wisata laut bernama LeMu. LeMu merupakan sebuah pulau [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=165&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Setelah berbulan-bulan ga nulis blog, akhirnya gatel juga pengen nulis review game Ever17. Ever17 &#8211; The Out of Infinity adalah visual novel non-eroge keluaran 2002 yang diproduksi <a href="http://en.wikipedia.org/wiki/KID">Kindle Imagine Develop</a> (KID) &#8211; perusahaan game Jepang yang sayangnya udah bangkrut -_-&#8221;.</p>
<p>Ever17 mengambil latar belakang di sebuah tempat wisata laut bernama LeMu. LeMu merupakan sebuah pulau buatan manusia yang terapung di tengah lautan, terdiri dari lantai utama yang tersusun dari tanah seperti layaknya pulau alami dan 3 tingkat lantai bawah yang tenggelam di bawah permukaan laut. LeMu dibuat sedemikian rupa sehingga strukturnya tidak akan rusak oleh tekanan air laut yang semakin ke dalam semakin tinggi.</p>
<p>Suatu hari terjadi bencana di LeMu yang mengakibatkan kebocoran air laut dan menenggelamkan setengah bagian dari LeMu. Enam orang tertinggal saat evakuasi dilakukan dan terjebak di lantai bawah karena jalan menuju lantai utama sudah tenggelam. Kamu pun akan melanjutkan cerita dengan sudut pandang salah satu dari dua tokoh utama: Takeshi Kuranari, mahasiswa 20 tahun yang selalu tampak santai; atau Kid, seorang anak lelaki yang kehilangan ingatan sesaat sebelum kecelakaan terjadi.</p>
<p>Ever17 bisa dibilang bergenre misteri-fiksi ilmiah. Berbagai misteri disajikan kepada pembaca, seperti sensor pendeteksi manusia yang menunjukkan angka 7, ingatan Kid yang hilang, pintu yang tidak bisa dibuka, dan hubungan masa lalu dari semua orang yang terjebak. Semua misteri baru akan terjawab tuntas waktu kita menamatkan True Ending, yang membuat saya terkagum-kagum pada si penulis skenario. Penyampaian cerita membuat kita terus berpikir dan bertanya-tanya: apa arti di balik semua keanehan yang terjadi?</p>
<p>Sebagai tambahan, Ever17 menempati posisi pertama di <a href="http://vndb.org">VNDB </a>saat tulisan ini dibuat dengan rating 9.07/10. Rating usia pembaca 13+.<br />
<a href="http://evangozali.files.wordpress.com/2010/09/post01_1.jpg"><img class="alignleft size-medium wp-image-169" title="ever17_1" src="http://evangozali.files.wordpress.com/2010/09/post01_1.jpg?w=213&#038;h=300" alt="" width="213" height="300" /></a><br />
<a href="http://evangozali.files.wordpress.com/2010/09/kid_takeshi.jpg"><img class="alignleft size-medium wp-image-170" title="kid_takeshi" src="http://evangozali.files.wordpress.com/2010/09/kid_takeshi.jpg?w=300&#038;h=167" alt="" width="300" height="167" /></a><br />
<a href="http://evangozali.files.wordpress.com/2010/09/ev_tu01a_1.jpg"><img class="alignleft size-medium wp-image-171" title="tsugumi" src="http://evangozali.files.wordpress.com/2010/09/ev_tu01a_1.jpg?w=300&#038;h=225" alt="" width="300" height="225" /></a><br />
<a href="http://evangozali.files.wordpress.com/2010/09/ev_so05b_1.jpg"><img class="alignleft size-medium wp-image-172" title="sora" src="http://evangozali.files.wordpress.com/2010/09/ev_so05b_1.jpg?w=300&#038;h=225" alt="" width="300" height="225" /></a><br />
<a href="http://evangozali.files.wordpress.com/2010/09/ev_yu01a_1.jpg"><img class="alignleft size-medium wp-image-173" title="you" src="http://evangozali.files.wordpress.com/2010/09/ev_yu01a_1.jpg?w=300&#038;h=225" alt="" width="300" height="225" /></a><br />
<a href="http://evangozali.files.wordpress.com/2010/09/ev_sa01a_1.jpg"><img class="alignleft size-medium wp-image-174" title="sara" src="http://evangozali.files.wordpress.com/2010/09/ev_sa01a_1.jpg?w=300&#038;h=225" alt="" width="300" height="225" /></a><br />
<a href="http://evangozali.files.wordpress.com/2010/09/ev_co03a_1.jpg"><img class="alignleft size-medium wp-image-175" title="coco" src="http://evangozali.files.wordpress.com/2010/09/ev_co03a_1.jpg?w=300&#038;h=225" alt="" width="300" height="225" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evangozali.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evangozali.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evangozali.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evangozali.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evangozali.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evangozali.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evangozali.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evangozali.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evangozali.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evangozali.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evangozali.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evangozali.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evangozali.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evangozali.wordpress.com/165/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=165&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evangozali.wordpress.com/2010/09/28/review-game-ever17-the-out-of-infinity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65a39a6123e3956f493978c1ee913c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evangozali</media:title>
		</media:content>

		<media:content url="http://evangozali.files.wordpress.com/2010/09/post01_1.jpg?w=213" medium="image">
			<media:title type="html">ever17_1</media:title>
		</media:content>

		<media:content url="http://evangozali.files.wordpress.com/2010/09/kid_takeshi.jpg?w=300" medium="image">
			<media:title type="html">kid_takeshi</media:title>
		</media:content>

		<media:content url="http://evangozali.files.wordpress.com/2010/09/ev_tu01a_1.jpg?w=300" medium="image">
			<media:title type="html">tsugumi</media:title>
		</media:content>

		<media:content url="http://evangozali.files.wordpress.com/2010/09/ev_so05b_1.jpg?w=300" medium="image">
			<media:title type="html">sora</media:title>
		</media:content>

		<media:content url="http://evangozali.files.wordpress.com/2010/09/ev_yu01a_1.jpg?w=300" medium="image">
			<media:title type="html">you</media:title>
		</media:content>

		<media:content url="http://evangozali.files.wordpress.com/2010/09/ev_sa01a_1.jpg?w=300" medium="image">
			<media:title type="html">sara</media:title>
		</media:content>

		<media:content url="http://evangozali.files.wordpress.com/2010/09/ev_co03a_1.jpg?w=300" medium="image">
			<media:title type="html">coco</media:title>
		</media:content>
	</item>
		<item>
		<title>Material is not everything</title>
		<link>http://evangozali.wordpress.com/2010/03/30/material-is-not-everything/</link>
		<comments>http://evangozali.wordpress.com/2010/03/30/material-is-not-everything/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 03:53:21 +0000</pubDate>
		<dc:creator>evangozali</dc:creator>
				<category><![CDATA[Wacana]]></category>
		<category><![CDATA[gayus]]></category>
		<category><![CDATA[musik]]></category>
		<category><![CDATA[renungan]]></category>

		<guid isPermaLink="false">http://evangozali.wordpress.com/?p=153</guid>
		<description><![CDATA[Kenapa ya banyak orang pengen punya duit segudang kayak Gayus? Jadi inget lirik lagu Black Eyed Pea feat Jack Johnson &#8211; Gone Going. Johnny wanna be a big star Get on stage and play the guitar Make a little money, buy a fancy car Big old house and an alligator Just to match with them [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=153&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Kenapa ya banyak orang pengen punya duit segudang kayak Gayus? Jadi inget lirik lagu Black Eyed Pea feat Jack Johnson &#8211; Gone Going.</p>
<p>Johnny wanna be a big star<br />
Get on stage and play the guitar<br />
Make a little money, buy a fancy car<br />
Big old house and an alligator<br />
Just to match with them alligator shoes<br />
He&#8217;s a rich man so he&#8217;s no longer singing the blues<br />
He&#8217;s singing songs about material things<br />
And platinum rings and watches that go bling<br />
But, diamonds don&#8217;t bling in the dark<br />
He a star now, but he ain&#8217;t singing from the heart<br />
Sooner or later he&#8217;s just gonna fall apart<br />
Coz his fans can&#8217;t relate to his new found art<br />
He ain&#8217;t doing what he did from the start<br />
And that&#8217;s putting in some feeling and thought<br />
He decided to live his life shallow<br />
Passion is love for material</p>
<p>[Chorus]<br />
And its gone&#8230; gone&#8230; going&#8230;<br />
Gone&#8230; everything gone&#8230; give a damn&#8230;<br />
Gone be the birds when they don&#8217;t want to sing&#8230;<br />
Gone people&#8230; up awkward with their things&#8230; gone.</p>
<p>You see yourself in the mirror<br />
And you feel safe coz it looks familiar<br />
But you afraid to open up your soul<br />
Coz you don&#8217;t really know, don&#8217;t really know<br />
Who is, the person that&#8217;s deep within<br />
Coz you are content with just being the na¯ve brown man<br />
And you fail to see that its trivial<br />
Insignificant, you addicted to material<br />
I&#8217;ve seen your kind before<br />
Your the type that thinks souls is sold in a store<br />
Packaged up with inscent sticks<br />
With them vegetarian meals<br />
To you that&#8217;s righteous<br />
You&#8217;re fiction like books<br />
You need to go out to life and look<br />
Coz&#8230; what happens when they take your material<br />
You already sold your soul and its&#8230;</p>
<p>[Chorus]</p>
<p>You say that time is money and money is time<br />
So you got mind in your money and your money on your mind<br />
But what about&#8230; that crime that you did to get paid<br />
And what about&#8230; that bid, you can&#8217;t take it to your brain<br />
Why you on about those shoes you&#8217;ll wear today<br />
They&#8217;ll do no good on the bridges you&#8217;ve walked along the way</p>
<p>All that money that you got gonna be gone<br />
That gear that you rock gonna be gone<br />
The house up on the hill gonna be gone<br />
The gold &#8212; on your grill gonna be gone<br />
The ice on your wrist gonna be gone<br />
That nice little Miss gonna be gone<br />
That whip that you roll gonna be gone<br />
And what&#8217;s worst is your soul&#8217;s already gone</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evangozali.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evangozali.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evangozali.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evangozali.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evangozali.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evangozali.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evangozali.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evangozali.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evangozali.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evangozali.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evangozali.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evangozali.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evangozali.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evangozali.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=153&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evangozali.wordpress.com/2010/03/30/material-is-not-everything/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65a39a6123e3956f493978c1ee913c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evangozali</media:title>
		</media:content>
	</item>
		<item>
		<title>C++ vector iterator: a foolish amateur mistake by me</title>
		<link>http://evangozali.wordpress.com/2010/02/25/c-vector-iterator-a-foolish-amateur-mistake-by-me/</link>
		<comments>http://evangozali.wordpress.com/2010/02/25/c-vector-iterator-a-foolish-amateur-mistake-by-me/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 16:00:58 +0000</pubDate>
		<dc:creator>evangozali</dc:creator>
				<category><![CDATA[Curahan Hati]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[iterator]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://evangozali.wordpress.com/?p=150</guid>
		<description><![CDATA[I write this so other people won&#8217;t make the same mistake like me.. well no, just to babble about my bad day. I wrote a code and tried to debug hours without result, my program keeps crashing. I thought my algorithm was wrong somewhere, division by zero have been handled and all. And it turns [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=150&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I write this so other people won&#8217;t make the same mistake like me.. well no, just to babble about my bad day.</p>
<p>I wrote a code and tried to debug hours without result, my program keeps crashing. I thought my algorithm was wrong somewhere, division by zero have been handled and all. And it turns out the problem was because I foolishly push_back a vector while iterating it using iterator.</p>
<p><pre class="brush: plain;">
std::vector&lt;SomeClass&gt;::iterator i;
for (i=v.begin(); i&lt;v.end(); i++){
  .....
  //in some cases, I have to do this
  v.push_back(SomeClass());
}
</pre></p>
<p>After reading <a href="http://www.cplusplus.com/reference/stl/vector/push_back/">c++ reference about push_back</a> I just realized that &#8220;Reallocations invalidate all previously obtained iterators, references and pointers.&#8221; Well&#8230; really a stupid mistake. I called push_back several times, the vector size changed, reallocation occurs, and segmentation fault is my friend&#8230;</p>
<p>From this day onward, I&#8217;ll make a note to use [] whenever I need to change the size of a vector.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evangozali.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evangozali.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evangozali.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evangozali.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evangozali.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evangozali.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evangozali.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evangozali.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evangozali.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evangozali.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evangozali.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evangozali.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evangozali.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evangozali.wordpress.com/150/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=150&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evangozali.wordpress.com/2010/02/25/c-vector-iterator-a-foolish-amateur-mistake-by-me/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65a39a6123e3956f493978c1ee913c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evangozali</media:title>
		</media:content>
	</item>
		<item>
		<title>Class Profiler sederhana pada c++</title>
		<link>http://evangozali.wordpress.com/2010/02/24/class-profiler-sederhana-pada-c/</link>
		<comments>http://evangozali.wordpress.com/2010/02/24/class-profiler-sederhana-pada-c/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 09:36:58 +0000</pubDate>
		<dc:creator>evangozali</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[algoritma]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[optimisasi]]></category>
		<category><![CDATA[profiler]]></category>

		<guid isPermaLink="false">http://evangozali.wordpress.com/?p=141</guid>
		<description><![CDATA[Optimisasi adalah hal yang mungkin jarang kita perhatikan saat sedang membuat aplikasi, terutama aplikasi-aplikasi yang ringan. Dengan kemampuan CPU yang semakin tinggi, kita dapat membuat aplikasi dengan fitur yang banyak namun tetap dapat berjalan dengan cepat. Namun ada kalanya kita dihadapkan pada aplikasi yang membutuhkan komputasi kompleks yang mengakibatkan kinerja buruk (baca: ngelag) kalau kita [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=141&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Optimisasi adalah hal yang mungkin jarang kita perhatikan saat sedang membuat aplikasi, terutama aplikasi-aplikasi yang ringan. Dengan kemampuan CPU yang semakin tinggi, kita dapat membuat aplikasi dengan fitur yang banyak namun tetap dapat berjalan dengan cepat. Namun ada kalanya kita dihadapkan pada aplikasi yang membutuhkan komputasi kompleks yang mengakibatkan kinerja buruk (baca: ngelag) kalau kita tidak melakukan optimisasi. Contohnya pada semester ini saya mengambil kuliah Grafika 3D yang membutuhkan perhitungan kompleks sehingga mau tak mau optimisasi algoritma harus dilakukan.</p>
<p style="text-align:justify;">Untuk membantu tahap optimisasi tersebut saya membuat sebuah class Profiler sederhana yang dapat menghitung rentang waktu yang dipakai komputer untuk menjalankan tahapan-tahapan proses. Setelah melihat tahapan mana yang membutuhkan waktu paling lama, baru saya mencoba melakukan optimisasi pada bagian tersebut. Source codenya dapat diunduh di <a href="http://sites.google.com/site/evangozali/files/profiler_1.0.zip" target="_blank">sini</a>. Contoh cara pemakaiannya adalah sebagai berikut:</p>
<p><pre class="brush: plain;">
Profiler::enabled = true;
Profiler::reportDelay = 30;
while (loop){
  Profiler * profiler = Profiler::start(&quot;mainloop&quot;);
  //lakukan perhitungan berat di sini
  //
  Profiler::stop(profiler);
  Profiler::reportAll();
}
</pre></p>
<p style="text-align:justify;">Untuk saat ini Profiler yang saya buat baru bisa mengenerate report sekali saja. reportDelay menunjukkan berapa kali reportAll() harus dipanggil sampai report yang sebenarnya ditulis. Pada setiap pemanggilan reportAll, Profiler akan mencatat waktu, lalu reportDelay akan dikurangi 1. Saat reportDelay mencapai 0, laporan ditulis ke stdout, setelah itu profiler berhenti berfungsi. Waktu yang ditampilkan merupakan rata-rata dari waktu yang dicatat pada setiap pemanggilan reportAll().</p>
<p style="text-align:justify;">Laporan yang dicatat memiliki label nama yang dipassing pada fungsi start(), seperti label &#8220;mainloop&#8221; pada contoh di atas. Dengan cara ini kita bisa membagi-bagi program menjadi beberapa bagian dan menjalankan Profiler dengan label yang berbeda-beda. Di bawah ini contoh screenshot laporan Profiler dari tugas saya:</p>
<p><a href="http://evangozali.files.wordpress.com/2010/02/hasilprofiler.jpg"><img class="size-thumbnail wp-image-142 alignnone" title="hasilprofiler" src="http://evangozali.files.wordpress.com/2010/02/hasilprofiler.jpg?w=649&#038;h=444" alt="" width="649" height="444" /></a></p>
<p style="text-align:justify;">Hanya saja karena class Profiler ini sendiri belum dioptimisasi, penggunaan Profiler terlalu banyak malah akan menurunkan kinerja program. Dan karena perhitungannya dalam millidetik, presisinya kurang tinggi, tapi cukup untuk mengukur kinerja program yang berat.</p>
<p style="text-align:justify;">Profiler ini saya buat untuk compiler gcc dan baru dites di Windows saja.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evangozali.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evangozali.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evangozali.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evangozali.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evangozali.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evangozali.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evangozali.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evangozali.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evangozali.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evangozali.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evangozali.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evangozali.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evangozali.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evangozali.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=141&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evangozali.wordpress.com/2010/02/24/class-profiler-sederhana-pada-c/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65a39a6123e3956f493978c1ee913c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evangozali</media:title>
		</media:content>

		<media:content url="http://evangozali.files.wordpress.com/2010/02/hasilprofiler.jpg?w=150" medium="image">
			<media:title type="html">hasilprofiler</media:title>
		</media:content>
	</item>
		<item>
		<title>C++: Mengatasi Circular Reference</title>
		<link>http://evangozali.wordpress.com/2010/02/05/c-mengatasi-circular-reference/</link>
		<comments>http://evangozali.wordpress.com/2010/02/05/c-mengatasi-circular-reference/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 08:49:06 +0000</pubDate>
		<dc:creator>evangozali</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[include]]></category>

		<guid isPermaLink="false">http://evangozali.wordpress.com/?p=132</guid>
		<description><![CDATA[Sekarang saya sedang mengeksplor kembali c++, ternyata ada masalah-masalah baru yang belum pernah saya ketahui sebelumnya. Maklum, sebelum ini cuma sempat mempelajari c++ di kuliah OOP dan saat Kerja Praktik. Masalah yang saya bahas kali ini adalah circular reference. Misalkan ada satu file header a.h menginclude b.h, dan b.h menginclude a.h, maka terjadilah circular reference. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=132&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sekarang saya sedang mengeksplor kembali c++, ternyata ada masalah-masalah baru yang belum pernah saya ketahui sebelumnya. Maklum, sebelum ini cuma sempat mempelajari c++ di kuliah OOP dan saat Kerja Praktik.</p>
<p>Masalah yang saya bahas kali ini adalah circular reference. Misalkan ada satu file header a.h menginclude b.h, dan b.h menginclude a.h, maka terjadilah circular reference. Cara mengatasinya ada 2 tahap: memakai include guard dan forward declaration.</p>
<p>Include guard merupakan trik untuk mencegah sebuah file terinclude 2 kali, umumnya selalu dipakai pada semua file header (dan sejak kuliah Struktur data sudah diwajibkan untuk dipakai). Include guard dapat dituliskan seperti ini</p>
<pre>#ifndef __HEADER_A_H
#define __HEADER_A_H

#include "b.h"
class A {
  void do(B b);
}

#endif</pre>
<p>Di mana __HEADER_A_H merupakan sebuah label untuk file header tersebut, yang harus unik untuk setiap file header. Dengan include guard ini, kita dapat menghindari error kompilasi karena compiler melakukan looping untuk menginclude file a.h dan b.h tanpa henti.</p>
<p>Namun cara ini belum cukup untuk mengatasi masalah circular reference. Misalkan kita coba mengkompilasi dua buah file sbb:</p>
<pre>//----- a.h ------//

#ifndef __HEADER_A_H
#define __HEADER_A_H

#include "b.h"
class A {
  void do(B b);
}

#endif
</pre>
<pre>//----- b.h ------//

#ifndef __HEADER_B_H
#define __HEADER_B_H

#include "a.h"
class B {
  void do(A a);
}

#endif
</pre>
<p>Akan terjadi error kompilasi karena salah satu class tidak akan terdefinisi pada class satunya (karena file yang diinclude tidak akan diinclude lagi). Untuk mengatasinya kita memakai teknik forward declaration untuk menggantikan perintah include.</p>
<pre>//----- a.h ------//

#ifndef __HEADER_A_H
#define __HEADER_A_H

class B; //forward declaration class B
class A {
  void do(B b);
}

#endif</pre>
<pre>//----- b.h ------//

#ifndef __HEADER_B_H
#define __HEADER_B_H

class A; //forward declaration class A
class B {
  void do(A a);
}

#endif
</pre>
<p>Dengan forward declaration, kita cukup memberitahu bahwa kita memakai sebuah class tanpa perlu menginclude file yang berisi deklarasi class tersebut. Nantinya pada file implementasi (.cpp) kita baru menginclude file class yang bersangkutan. Namun perlu diingat, karena compiler tidak mengetahui isi dari class tersebut, kita tidak dapat langsung mengakses member class dari file header, jadi akses member harus dilakukan di file .cpp.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evangozali.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evangozali.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evangozali.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evangozali.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evangozali.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evangozali.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evangozali.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evangozali.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evangozali.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evangozali.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evangozali.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evangozali.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evangozali.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evangozali.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=132&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evangozali.wordpress.com/2010/02/05/c-mengatasi-circular-reference/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65a39a6123e3956f493978c1ee913c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evangozali</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP: Interscript Communication via File</title>
		<link>http://evangozali.wordpress.com/2010/02/02/php-interscript-communicatio/</link>
		<comments>http://evangozali.wordpress.com/2010/02/02/php-interscript-communicatio/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 08:38:07 +0000</pubDate>
		<dc:creator>evangozali</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://evangozali.wordpress.com/?p=124</guid>
		<description><![CDATA[Sometimes we want a php script to communicate with another script. For what purpose? Suppose you have a script that runs a long process and you want to update the status of that script every second (consider a progress bar, for example). The simplest solution is to let the main script echo the status every [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=124&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Sometimes we want a php script to communicate with another script. For what purpose? Suppose you have a script that runs a long process and you want to update the status of that script every second (consider a progress bar, for example). The simplest solution is to let the main script echo the status every second, but then the whole screen will be covered by status update, and that&#8217;s not what we want. The idea then is to have another script &#8220;ask&#8221; the status of the main script and echo it. By putting some javascript to refresh that other page every second, we can get a neat update.</p>
<p style="text-align:justify;">The question is how does the other script &#8220;ask&#8221; the status of the main script? The simplest solution would be using file as a pipe between the two scripts. Let the main script keep writing status to the file and let the other script read the file, parse it, and display the status. Consider this simple piece of code:</p>
<p>main.php</p>
<pre>for ($i=0; $i&lt;50; $i++){
  file_put_contents("pipe", $i);
  sleep(1);
}</pre>
<p>other.php</p>
<pre>echo file_get_contents("pipe");
//put javascript to refresh
echo "&lt;script&gt;
function refresh(){ window.location.reload(); }
setTimeout( 'refresh()', 1000 );
&lt;/script&gt;";</pre>
<p style="text-align:justify;">Browse main.php and let that page open or the script will eventually die, then browse other.php to see the updated status. With this simple idea, you can make a progress bar using some javascript to draw the bar. You can even make the progress bar in main.php if you put AJAX in main.php calling other.php.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evangozali.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evangozali.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evangozali.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evangozali.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evangozali.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evangozali.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evangozali.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evangozali.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evangozali.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evangozali.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evangozali.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evangozali.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evangozali.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evangozali.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evangozali.wordpress.com&amp;blog=3065998&amp;post=124&amp;subd=evangozali&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evangozali.wordpress.com/2010/02/02/php-interscript-communicatio/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65a39a6123e3956f493978c1ee913c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evangozali</media:title>
		</media:content>
	</item>
	</channel>
</rss>
