<?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"
	>

<channel>
	<title>Free Android CakePHP GMaps Articles</title>
	<atom:link href="http://www.balistupa.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.balistupa.com/blog</link>
	<description>Bali Stupa Blog</description>
	<pubDate>Tue, 03 Aug 2010 01:21:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>How to redirect /app/webroot/blog/ into /blog/ Wordpress Cakephp</title>
		<link>http://www.balistupa.com/blog/2010/08/how-to-redirect-appwebrootblog-into-blog-wordpress-cakephp/</link>
		<comments>http://www.balistupa.com/blog/2010/08/how-to-redirect-appwebrootblog-into-blog-wordpress-cakephp/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 01:16:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[cakephp]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=100</guid>
		<description><![CDATA[At this time, a company website normally should have blog to post some business activity or related activity with website themes. Wordpress is the best blog framework (CMS) that i ever used. When i was build web application under my own php framework, i wasn&#8217;t worried about integrating wordpress into my website. It would has [...]]]></description>
			<content:encoded><![CDATA[<p>At this time, a company website normally should have blog to post some business activity or related activity with website themes. Wordpress is the best blog framework (CMS) that i ever used. When i was build web application under my own php framework, i wasn&#8217;t worried about integrating wordpress into my website. It would has separated setting with main application.</p>
<p>However, now i am using cakephp framework. And if we need to put file or folder, it need to be put inside app/webroot folder. So if i need to install wordpress blog in http://www.balistupa.com/blog, i need to put the blog folder inside /app/webroot/.</p>
<p>The problem is about the url, with standard setting the blog would be redirected to http://www.balistupa.com/app/webroot/blog/ not to http://www.balistupa.com/blog/. This is not look good for visitor and also for seo. Because the folder structure is to deep.</p>
<p><span id="more-100"></span>After researching, i play with .htaccess setting to redirect <strong>/app/webroot/blog/</strong> into <strong>/blog/</strong> url. And the solution is very simple. So this is the step how i install wordpress blog inside cakephp framework.</p>
<ol>
<li>upload wordpress files into /app/webroot/blog/ folder on server</li>
<li>setting /app/webroot/blog/wp-config.php with appropriate setting for database</li>
<li>and then install wordpress. On this step you will get directed to http://www.yourdomain.com/app/webroot/blog/install.php. Dont worried about the path, we can fix it easily</li>
<li>After installation finished, go to wordpress admin area at http://www.yourdomain.com/app/webroot/blog/wp-admin and then log in</li>
<li>Go to Settings &gt; General. Change <strong>WordPress address (URL)</strong> and <strong>Site address (URL)</strong> into http://www.yourdomain.com/blog/ and then Save.</li>
<li>If using mod_rewrite for wordpress, Open /app/webroot/blog/.htaccess. Change into<br />
<code>&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /app/webroot/blog/<br />
RewriteRule ^index\.php$ - [L]<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /app/webroot/blog/index.php [L]<br />
&lt;/IfModule&gt;</code></li>
<li>Open /.htaccess, Change its setting into<br />
<code>RedirectMatch temp ^/blog/wp-admin$ http://www.yourdomain.com/blog/wp-admin/<br />
RewriteRule blog$ /blog/ [L]<br />
RewriteRule blog/wp-admin$ /blog/wp-admin/ [L]<br />
RewriteRule ^$ app/webroot/ [L]<br />
RewriteRule (.*) app/webroot/$1 [L]</code></li>
<li>Finished. Now you will have wordpress blog url at http://www.yourdomain.com/blog/</li>
</ol>
<p>I notice that this setting also fix the problem user access http://www.yourdomain.com/blog without end /, and redirected into http://www.yourdomain.com/blog/.</p>
<p>So that is how we can redirecting http://www.yourdomain.com/app/webroot/blog/ into http://www.yourdomain.com/blog/ for installing Wordpress blog inside Cakephp Framework</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.balistupa.com%2Fblog%2F2010%2F08%2Fhow-to-redirect-appwebrootblog-into-blog-wordpress-cakephp%2F';
  addthis_title  = 'How+to+redirect+%2Fapp%2Fwebroot%2Fblog%2F+into+%2Fblog%2F+Wordpress+Cakephp';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.balistupa.com/blog/2010/08/how-to-redirect-appwebrootblog-into-blog-wordpress-cakephp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sleep or wait process on javascript thread</title>
		<link>http://www.balistupa.com/blog/2010/07/sleep-or-wait-process-on-javascript-thread/</link>
		<comments>http://www.balistupa.com/blog/2010/07/sleep-or-wait-process-on-javascript-thread/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 03:10:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[html]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=96</guid>
		<description><![CDATA[Actually there is no Thread.sleep method on javascript that work on Threading. Moreover there is no true threading in javascript. So everybody that want to deal with threading need to emulate it. In this article i would like to show you some method that emulate sleep method for waiting on a process. Each of this [...]]]></description>
			<content:encoded><![CDATA[<p>Actually there is no Thread.sleep method on javascript that work on Threading. Moreover there is no true threading in javascript. So everybody that want to deal with threading need to emulate it. In this article i would like to show you some method that emulate sleep method for waiting on a process. Each of this method has each own disadvantage, so you need to choose which is suitable for your case.</p>
<p>First method is sleep using javascript loop. This is first method that come to my mind when emulate sleep method on javascript. We wait for the process by checking the time in the loop.</p>
<pre class="code">function wait(millisecond) {
var date = new Date();
var current_date = null;

do { current_date = new Date(); }
while(current_date-date &lt; millisecond)
}

// do something
wait(1000); // wait 1000 millisecond
// do something</pre>
<p><span id="more-96"></span>The disadvantage is this method blocking the whole browser process. So you need to think if you want to wait process for long time.</p>
<p>Second method is only valid on Firefox windows. I got this function on <a href="http://www.daniweb.com/forums/thread47199.html">this thread</a>. This is work as a threading process. So it does not block your whole browser process.</p>
<pre class="code">/**
* Netscape compatible WaitForDelay function.
* You can use it as an alternative to Thread.Sleep() in any major programming language
* that support it while JavaScript it self doesn't have any built-in function to do such a thing.
* parameters:
*  (Number) delay in millisecond
*/
function nsWaitForDelay(delay) {
/**
* Just uncomment this code if you're building an extention for Firefox.
* Since FF3, we'll have to ask for user permission to execute XPCOM objects.
*/
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

// Get the current thread.
var thread = Components.classes["@mozilla.org/thread-manager;1"].getService(Components.interfaces.nsIThreadManager).currentThread;

// Create an inner property to be used later as a notifier.
this.delayed = true;

/* Call JavaScript setTimeout function
* to execute this.delayed = false
* after it finish.
*/
setTimeout("this.delayed = false;", delay);

/**
* Keep looping until this.delayed = false
*/
while (this.delayed) {
/**
* This code will not freeze your browser as it's documented in here:
* https://developer.mozilla.org/en/Code_snippets/Threads#Waiting_for_a_background_task_to_complete
*/
thread.processNextEvent(true);
}
}</pre>
<p>Third method is asynchronous method, so it will not blocking the whole browser process.</p>
<pre class="code">function my_method() {
}
setTimeout("my_method()",1000);</pre>
<p>you may also need to explore about setInterval and clearTimeout method for better use</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.balistupa.com%2Fblog%2F2010%2F07%2Fsleep-or-wait-process-on-javascript-thread%2F';
  addthis_title  = 'Sleep+or+wait+process+on+javascript+thread';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.balistupa.com/blog/2010/07/sleep-or-wait-process-on-javascript-thread/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to handle user closing browser windows or page using javascript</title>
		<link>http://www.balistupa.com/blog/2010/07/how-to-handle-user-closing-browser-windows-or-page-using-javascript/</link>
		<comments>http://www.balistupa.com/blog/2010/07/how-to-handle-user-closing-browser-windows-or-page-using-javascript/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 05:40:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[html]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=90</guid>
		<description><![CDATA[Sometime we need to handle or do something when user closing a browser windows or page. Maybe we want to ask user if they really want to close the page or it was a mistake click. This procedure all can be done using javascript.
There are two condition or event that you can intercept before it [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime we need to handle or do something when user closing a browser windows or page. Maybe we want to ask user if they really want to close the page or it was a mistake click. This procedure all can be done using javascript.</p>
<p>There are two condition or event that you can intercept before it really happen, first when user close the browser windows and second is when browser windows will be closed without any way to abort it.</p>
<p>For first condition we can handle it using <em>window.onbeforeunload</em> event.</p>
<blockquote><p><span id="intelliTxt"> function closeHandler() {<br />
return &#8220;Are you sure you want to close this page?&#8221;;<br />
}</span></p>
<p>window.onbeforeunload = closeHandler;</p></blockquote>
<p><span id="more-90"></span>And second condition when window will really closed, you can put on body tag or using window object</p>
<blockquote><p>&lt;body onUnload=&#8221;doUnload()&#8221;&gt;</p>
<p>&lt;script language=&#8221;Javascript&#8221;&gt;<br />
function doUnload() {<br />
// do your code here<br />
}<br />
&lt;/script&gt;</p></blockquote>
<p>or using window object</p>
<blockquote><p>function doUnload() {<br />
// do your code here<br />
}<br />
window.onunload = doUnload;</p></blockquote>
<p>I hope this article is help you on handling user when closing browser windows or page using javascript.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.balistupa.com%2Fblog%2F2010%2F07%2Fhow-to-handle-user-closing-browser-windows-or-page-using-javascript%2F';
  addthis_title  = 'How+to+handle+user+closing+browser+windows+or+page+using+javascript';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.balistupa.com/blog/2010/07/how-to-handle-user-closing-browser-windows-or-page-using-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to print javascript object properties</title>
		<link>http://www.balistupa.com/blog/2009/08/how-to-print-javascript-object-properties/</link>
		<comments>http://www.balistupa.com/blog/2009/08/how-to-print-javascript-object-properties/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 07:32:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[html]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=88</guid>
		<description><![CDATA[Sometime we need to print the structure data that return by a function. I was work on a task for google map and need to print object properties of Placemarks object on javascript. I need to analyze what kind of structure data return by geocoding function. The code below is a short function to print [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime we need to print the structure data that return by a function. I was work on a task for google map and need to print object properties of Placemarks object on javascript. I need to analyze what kind of structure data return by geocoding function. The code below is a short function to print object properties in javascript</p>
<blockquote><p>function isObject(obj) {<br />
return obj.constructor == Object;<br />
}</p>
<p>function print_object(object, level){<br />
var tab = &#8220;&#8221;;<br />
if(level &gt; 0){<br />
for(i = 0; i &lt; level; i++) tab += &#8220;\t&#8221;;<br />
}<br />
var str = &#8220;&#8221;;<br />
for(prop in object) {<br />
if(!isObject(object[prop])) str += tab + prop + &#8221; value :&#8221; + object[prop] + &#8220;\n&#8221;;<br />
else str += tab + prop + &#8220;\n&#8221; + print_object(object[prop], level + 1);<br />
}<br />
return str;<br />
}</p></blockquote>
<p>and how to use this function is really simple approach</p>
<blockquote><p>address = addresses.Placemark[0];<br />
alert(print_object(address, 0));</p></blockquote>
<p>in this scenario, i would like to print first placemark object return by geocoding function. Parameter level is use to make nice print view using tab character.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.balistupa.com%2Fblog%2F2009%2F08%2Fhow-to-print-javascript-object-properties%2F';
  addthis_title  = 'How+to+print+javascript+object+properties';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.balistupa.com/blog/2009/08/how-to-print-javascript-object-properties/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to do GROUP BY HAVING in CakePHP</title>
		<link>http://www.balistupa.com/blog/2009/08/how-to-do-group-by-having-in-cakephp/</link>
		<comments>http://www.balistupa.com/blog/2009/08/how-to-do-group-by-having-in-cakephp/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 04:23:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[cakephp]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=86</guid>
		<description><![CDATA[Before June 2008, there is no clean implementation for GROUP BY. commonly people code with CakePHP will put GROUP BY sintak on conditions, something like this
$this-&#62;Product-&#62;find(&#8217;all&#8217;, array(&#8216;conditions&#8217; =&#62; &#8216;1=1 GROUP BY Product.category_id&#8217;));
Now CakePhp have a clean sintak for GROUP BY by new additional paramater on find function. We can use &#8216;group&#8217; to define GROUP BY [...]]]></description>
			<content:encoded><![CDATA[<p>Before June 2008, there is no clean implementation for GROUP BY. commonly people code with CakePHP will put GROUP BY sintak on conditions, something like this</p>
<p><span>$this-&gt;Product-&gt;find(&#8217;all&#8217;, array(</span><span>&#8216;conditions&#8217; =&gt; &#8216;1=1 <strong class="highlight">GROUP</strong> <strong class="highlight">BY</strong> Product.category_id&#8217;));</span></p>
<p>Now CakePhp have a clean sintak for GROUP BY by new additional paramater on find function. We can use &#8216;group&#8217; to define GROUP BY on cakephp. For example</p>
<p>$this-&gt;Product-&gt;find(&#8217;all&#8217;, array(&#8217;fields&#8217; =&gt; array(&#8217;Product.category_id&#8217;, &#8216;COUNT(Product.hotel_id) as total&#8217;), &#8216;<strong>group</strong>&#8216; =&gt; array(&#8217;Product.category_id&#8217;)));</p>
<p>How if we want to have HAVING sintak on query? i ussually use this solution for new cakephp</p>
<p>$this-&gt;Product-&gt;find(&#8217;all&#8217;, array(&#8217;fields&#8217; =&gt; array(&#8217;Product.category_id&#8217;, &#8216;COUNT(Product.hotel_id) as total&#8217;), &#8216;group&#8217; =&gt; array(&#8217;Product.category_id <strong>HAVING</strong> COUNT(Product.hotel_id) &gt; 1&#8242;)));</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.balistupa.com%2Fblog%2F2009%2F08%2Fhow-to-do-group-by-having-in-cakephp%2F';
  addthis_title  = 'How+to+do+GROUP+BY+HAVING+in+CakePHP';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.balistupa.com/blog/2009/08/how-to-do-group-by-having-in-cakephp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Passing data or parameter to another Activity Android</title>
		<link>http://www.balistupa.com/blog/2009/08/passing-data-or-parameter-to-another-activity-android/</link>
		<comments>http://www.balistupa.com/blog/2009/08/passing-data-or-parameter-to-another-activity-android/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 04:34:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[android]]></category>

		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=83</guid>
		<description><![CDATA[Sometime we need to pass data or parameter to another Activity on Android. Only one activity is active at once. An activity open new activity for result and opened activity need parameter to set their interface or another option based on request. So it is important a system can handle sending and retrieve parameter between [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime we need to pass data or parameter to another Activity on Android. Only one activity is active at once. An activity open new activity for result and opened activity need parameter to set their interface or another option based on request. So it is important a system can handle sending and retrieve parameter between two Activity.</p>
<p>To open an activity and wait for a result, we can use this sintax</p>
<blockquote><p>Intent newIntent = new Intent(this.getApplicationContext(), ActivityClass2.class);<br />
startActivityForResult(newIntent, 0);</p></blockquote>
<p>ActivityClass2 is the class name of activity that we need to create and then open it from current activity. startActivityForResult is a method to run newActivity. Later we can have the result by add this function on current Activity<span id="more-83"></span></p>
<blockquote><p>protected void onActivityResult(int requestCode, int resultCode, Intent data)</p></blockquote>
<p>First to send a data or parameter to newActivity we can use this sintax</p>
<blockquote><p><strong>Bundle bundle = new Bundle();<br />
bundle.putString(&#8221;param1&#8243;, &#8220;test&#8221;);<br />
</strong><br />
Intent newIntent = new Intent(this.getApplicationContext(), ActivityClass2.class);<br />
<strong>newIntent.putExtras(bundle);</strong><br />
startActivityForResult(newIntent, 0);</p></blockquote>
<p>On ActivityClass2, we can read this parameter using this sintax</p>
<blockquote><p>Bundle bundle = this.getIntent().getExtras();<br />
String param1 = bundle.getString(&#8221;param1&#8243;);</p></blockquote>
<p>be carefull to use param1, because it can be null if we didn&#8217;t set it.</p>
<p>So it is very easy to send or passing data or parameter between two activity in Android. One last thing is to return a value for startActivityForResult, we can add this line code to close ActivityClass2 and return focus to opener plus send data to opener activity.</p>
<blockquote><p>Bundle bundle = new Bundle();<br />
bundle.putString(&#8221;status&#8221;, &#8220;OK&#8221;);<br />
Intent mIntent = new Intent();<br />
mIntent.putExtras(bundle);<br />
setResult(RESULT_OK, mIntent);<br />
finish();</p></blockquote>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.balistupa.com%2Fblog%2F2009%2F08%2Fpassing-data-or-parameter-to-another-activity-android%2F';
  addthis_title  = 'Passing+data+or+parameter+to+another+Activity+Android';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.balistupa.com/blog/2009/08/passing-data-or-parameter-to-another-activity-android/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Forcing inner join on belongTo and hasOne</title>
		<link>http://www.balistupa.com/blog/2009/07/forcing-inner-join-on-belongto-and-hasone/</link>
		<comments>http://www.balistupa.com/blog/2009/07/forcing-inner-join-on-belongto-and-hasone/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 07:13:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[cakephp]]></category>

		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=81</guid>
		<description><![CDATA[By default, belongsTo and hasOne using LEFT JOIN relation between parent and child table or model. We can forcing the relationship to use either INNER JOIN or LEFT JOIN based on our need. Cakephp has add new option when binding model, name type: value is LEFT or INNER.
For example we have parent table Author and [...]]]></description>
			<content:encoded><![CDATA[<p>By default, belongsTo and hasOne using LEFT JOIN relation between parent and child table or model. We can forcing the relationship to use either INNER JOIN or LEFT JOIN based on our need. Cakephp has add new option when binding model, name type: value is LEFT or INNER.</p>
<p>For example we have parent table Author and hasOne Post, we can set INNER JOIN relation by default on model class or in controller using bindModel. In this example the hasOne relation set on model class</p>
<blockquote><p>&lt;?php<br />
class Author extends AppModel {<br />
var $name = &#8216;Author&#8217;;<br />
var $hasOne = array(’Post’=&gt;array(’type’=&gt;’INNER’));<br />
}<br />
?&gt;</p></blockquote>
<p>and running on controller</p>
<blockquote><p>$this-&gt;Author-&gt;find(&#8217;all&#8217;);</p></blockquote>
<p>cakephp will generate query for author table.</p>
<blockquote><p>SELECT `Author`.`id`, `Author`.`name`, `Post`.`id`, `Post`.`post_id`, `Post`.`title` FROM `authors` AS `Author` INNER JOIN `posts` AS `Post` ON (`Post`.`post_id` = `Author`.`id`) WHERE 1 = 1</p></blockquote>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.balistupa.com%2Fblog%2F2009%2F07%2Fforcing-inner-join-on-belongto-and-hasone%2F';
  addthis_title  = 'Forcing+inner+join+on+belongTo+and+hasOne';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.balistupa.com/blog/2009/07/forcing-inner-join-on-belongto-and-hasone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Find a data in mysql Array field</title>
		<link>http://www.balistupa.com/blog/2009/07/find-a-data-in-mysql-array-field/</link>
		<comments>http://www.balistupa.com/blog/2009/07/find-a-data-in-mysql-array-field/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 06:01:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[mysql]]></category>

		<category><![CDATA[query tips]]></category>

		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=78</guid>
		<description><![CDATA[I want to show you a situation that probably happen to you when build a mysql query. The situation can be vary but basically same condition. For example we have places table to store all beautiful places around the world. And a categories table to classify our places data. The rule is a place can [...]]]></description>
			<content:encoded><![CDATA[<p>I want to show you a situation that probably happen to you when build a mysql query. The situation can be vary but basically same condition. For example we have places table to store all beautiful places around the world. And a categories table to classify our places data. The rule is a place can be put on one or some categories. To achieve this function we just add a field into places table that save category id list.</p>
<p>So places table will have id, name, categories fields. and categories table have id, name. We want to save category list into categories field on places table. The data will look like this &#8216;2,3,4,5,6,7,8&#8242;. A question will come to your mind about how to grab or find a matching id inside this categories, for example we want to show all place with category id 5.</p>
<p>We cannot use LIKE in this example because it cannot match perfectly on many digit number. So i found a solution that easy to do. The query to find all data inside mysql Array field is</p>
<blockquote><p>SELECT * FROM places WHERE FIND_IN_SET(5, categories)</p></blockquote>
<p>Another solution is by adding new table to save category list for place. But my solution look nice, right?</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.balistupa.com%2Fblog%2F2009%2F07%2Ffind-a-data-in-mysql-array-field%2F';
  addthis_title  = 'Find+a+data+in+mysql+Array+field';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.balistupa.com/blog/2009/07/find-a-data-in-mysql-array-field/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to install eclipse for android on windows?</title>
		<link>http://www.balistupa.com/blog/2009/07/how-to-install-eclipse-for-android-on-windows/</link>
		<comments>http://www.balistupa.com/blog/2009/07/how-to-install-eclipse-for-android-on-windows/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 04:30:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[android]]></category>

		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=75</guid>
		<description><![CDATA[You can use any text editor to write a java code for android, and then compile using JDK tools. Create android package (APK) using android sdk tools and then install and run application on emulator. But we need a tool to automatic all android development process. One android IDE that commonly used by android developer [...]]]></description>
			<content:encoded><![CDATA[<p>You can use any text editor to write a java code for android, and then compile using JDK tools. Create android package (APK) using android sdk tools and then install and run application on emulator. But we need a tool to automatic all android development process. One android IDE that commonly used by android developer is eclipse. Using eclipse you can have an integrated development environment for android through Android plugin, such as</p>
<ul>
<li>write or code java source for android application</li>
<li>good overview for your project inside project manager</li>
<li>user friendly interface to create new android project</li>
<li>compile and debugging is as easy as desktop application development</li>
<li>nice java source code editor with high text editing functionality for developer</li>
<li>setting emulator also easy with good overview using DDMS perspective</li>
<li>run android application inside emulator with simple click</li>
</ul>
<p>There are many more advantage using eclipse as your IDE for android. Believe me it makes you enjoy coding android with their nice interface and automatic process.</p>
<p><span id="more-75"></span><strong>Installing eclipse for android</strong></p>
<ol>
<li>Install JRE or JDK, but i suggest you to install JDK as we will develop java application. Read last article about <a href="http://www.balistupa.com/blog/2009/07/how-to-install-android-sdk-on-windows/">installing jdk for android</a>.</li>
<li>Download Eclipse IDE for Java Developers at http://www.eclipse.org/downloads/. Its about 92 MB.</li>
<li>Extract the zip file into a folder for example D:\ANDROID after downloaded</li>
<li>at this step you will have D:\ANDROID\eclipse folder</li>
<li>run D:\ANDROID\eclipse\eclipse.exe. On first time you will asked for workspace directory. It is a directory where you want your android project to be stored. For now just create new folder WORKSPACE in D:\ANDROID</li>
<li>install android sdk, you can read on <a href="http://www.balistupa.com/blog/2009/07/how-to-install-android-sdk-on-windows/">installing android sdk</a> article.</li>
<li>Now you need to connect eclipse and android sdk</li>
<li>on eclipse GUI, select Windows &gt; Preferences menu on top.</li>
<li>select android and then locate your SDK Location, on my machine is D:\ANDROID\android-sdk, and then click apply</li>
<li>on eclipse GUI, select Help &gt; Software Updates. some eclipse version maybe different menu location or name</li>
<li>click Available software tabs and then click Add site</li>
<li>You can try use this Location : https://dl-ssl.google.com/android/eclipse/ or http://dl-ssl.google.com/android/eclipse/. and then click OK</li>
<li>check the checkbox before https://dl-ssl.google.com/android/eclipse/ or http://dl-ssl.google.com/android/eclipse/ and then click Finish</li>
<li>It will direct you to download interface, wait until finish</li>
<li>at the end you will need to run plugins installation, just follow the step on interface.</li>
</ol>
<p>At this point you already have a ready IDE for creating android application. Have fun and keep reading on my article about using eclipse to create android application.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.balistupa.com%2Fblog%2F2009%2F07%2Fhow-to-install-eclipse-for-android-on-windows%2F';
  addthis_title  = 'How+to+install+eclipse+for+android+on+windows%3F';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.balistupa.com/blog/2009/07/how-to-install-eclipse-for-android-on-windows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to install android sdk on windows?</title>
		<link>http://www.balistupa.com/blog/2009/07/how-to-install-android-sdk-on-windows/</link>
		<comments>http://www.balistupa.com/blog/2009/07/how-to-install-android-sdk-on-windows/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 03:22:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[android]]></category>

		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=72</guid>
		<description><![CDATA[For whom that doesn&#8217;t know yet the android, it is a new platform that basically run on gphone mobile device. GPhone stand for Google Phone, i think google want to spread their business to mobile device technology. But android is not for gphone only, at least nokia will have android on their device in future. [...]]]></description>
			<content:encoded><![CDATA[<p>For whom that doesn&#8217;t know yet the android, it is a new platform that basically run on gphone mobile device. GPhone stand for Google Phone, i think google want to spread their business to mobile device technology. But android is not for gphone only, at least nokia will have android on their device in future. So for developer it is a good market to make an application run on android platform. Best thing is android give developer a software development kit (SDK) that based on java programming language. And this SDK is open to all developer and has big community. This article is about installing android sdk on your windows machine.</p>
<p>First of all you need a java library installed on your machine. It can be a JRE or JDK, but i suggest you to install JDK as we want to develop a java application on our machine.</p>
<p><span id="more-72"></span><strong>Installing JDK for android</strong></p>
<ol>
<li> go to http://java.sun.com/javase/downloads/index.jsp</li>
<li>find Java SE Development (JDK) section. The latest JDK version at the moment is JDK 6 Update 14</li>
<li>Click on Download Button</li>
<li>Run the executable installation file after download finished</li>
</ol>
<p>Note : you can use J2EE, but J2SE is enough for android.</p>
<p><strong>Installing android SDK</strong></p>
<ol>
<li>download <strong>http://developer.android.com/sdk/1.5_r3/index.html</strong> based on your Operating System platform. In my machine i use Windows so i download <strong>android-sdk-windows-1.5_r3.zip</strong></li>
<li>extract <strong>android-sdk-windows-1.5_r3.zip</strong> into a folder for example <strong>D:\android-sdk</strong></li>
<li>add <strong>D:\android-sdk\tools</strong> into PATH environmental variables on your system. You can find it on Control Panels &gt; Systems</li>
<li>please restart your computer</li>
</ol>
<p>At this point you have an android sdk that installed on your machine. You are ready to use android sdk and run using their great android emulator. You can coding using your text editor and compile using JDK and then create Android Package using Android SDK and then run it using android emulator. But i suggest you to use eclipse because it is more easier to build android application using eclipse automatic process.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.balistupa.com%2Fblog%2F2009%2F07%2Fhow-to-install-android-sdk-on-windows%2F';
  addthis_title  = 'How+to+install+android+sdk+on+windows%3F';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.balistupa.com/blog/2009/07/how-to-install-android-sdk-on-windows/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
