Pages

Thursday, December 30, 2010

POM

- He lives in black and white world, there is no room for grey area-

- Money will always come and go, no use of saving it or hold on to it too tightly. You just have to spend it wisely-

Sunday, December 26, 2010

Setting new dedicated server

I'm migrating my VPS server to a new dedicated server. So i need to repeat the same proses I've done for the old server to this one. For future reference , I'm going to document my steps :)


Setting swappiness

To set the vm.swappiness permanently you need to edit the /etc/sysctl.conf file and add the line

vm.swappiness=10

The default number usually 60. The smaller the number means that your system is unlikely to swap process from memory to the swap space. To see the change, use :

cat /proc/sys/vm/swappiness


Installing Sun JDK package

I'm still very fond to use the JDK from SUN, to do that in ubuntu you need to follow this steps.

You can add the repository manually by editing /etc/apt/sources.list
or installing the package python-software-properties and run

sudo apt-get install mysql-server-5.1

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"

Then, update the repository information and install the jdk

sudo apt-get update
sudo apt-get install sun-java6-jdk

Installing MySQL
sudo apt-get install mysql-server-5.1
vi /etc/mysql/my.cnf #change the default port


Installing glassfish
wget -b -c -i http://download.java.net/glassfish/3.0.1/release/glassfish-3.0.1.zip -o log.out
sudo apt-get install unzip
unzip glassfish-3.0.1.zip

Start glassfish
./glassfish/bin/asadmin start-domain domain1

Connect to the admin console and change the admin password
http://yourip.net:4848/
enterprise server > administrator password
logout and re-login

If you want a more secure and thorough set-up you can follow this guide. I usually just change the port in the admin console to 80.

Installing Apache
sudo apt-get install apache2

enable reverse proxy
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo /etc/init.d/apache2 restart

add reverse proxy context
sudo vi /etc/apache2/sites-enabled/000-default
ProxyPass /itsme/ http://www.mysite.net:8080/itsme/
ProxyPassReverse /itsme/ http://www.mysite.net:8080/itsme/

if you have a problem "client denied by server configuration proxy" you need to modify the proxy.conf to allow access to your site. So far the only solution i know is by adding allow all or commenting deny all in the proxy.conf file. To edit the conf file, use this command :
sudo vi /etc/apache2/mods-enabled/proxy.conf

if you wan't to pass the original ip through your proxy server follow this link.

Setting mercurial server
To set the mercurial server you can see my previous post.

Using subdomain for mercurial server
To do this you need to add a CNAME entry to your DNS Server. For example I ask my hosting support to add CNAME entry for hg.myserver.net.

After that, you just need to copy the virtual host from the 000-default files and add

ServerName hg.myserver.net

And you should be able to access your hg server using http://hg.myserver.net/hg

I've edited the location and path for this virtual server so i can access it using http://hg.myserver.net/repo. Better than the redundant hg for the url :)

Start glassfish at reboot time
Create a glassfish.sh file at your home directory, copy the code below as the content

#!/bin/sh
#
### BEGIN INIT INFO
# Provides:          scriptname
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     3 4 5
# Default-Stop:      0 1 2 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

GLASSFISH_HOME="/home/mreunion/glassfish/"

case "$1" in
start)
    $GLASSFISH_HOME/bin/asadmin start-domain
    ;;
stop)
    $GLASSFISH_HOME/bin/asadmin stop-domain
    ;;
restart)
    $GLASSFISH_HOME/bin/asadmin restart-domain
    ;;
force-reload)
    $GLASSFISH_HOME/bin/asadmin restart-domain
    ;;
*)
    echo "usage: $0 (start|stop|restart|help)"
esac

sudo cp glassfish.sh /etc/init.d/
sudo chmod +x glassfish.sh
sudo update-rc.d glassfish.sh defaults

Tuesday, December 14, 2010

Wireless setup

So i've got this Linksys WAP54G in my home, and try to set it up. I'm having trouble with the automatic setup, so reading this helps a lot.

Now i can ping and connect to my access point, I'm facing another problem. I didn't have any dhcp server. That's why my ubuntu laptop keep turning off the wifi connection. Setting the auto wireless to have a static ip address fix the problem.

Last but not least, i try connecting through my htc hero. Found the same problem , this article help me set the static ip address.

The funny thing i setup all this, because I'm having a problem adding a third gmail account on my htc hero.It keep saying it need reliable network.  Trying to clear the application data didn't work. So as a worked around i delete my second gmail account, and login to youtube using my third gmail account. And it worked.

Well at least after all this now i have a Wifi Access point in my home now :)

Friday, November 26, 2010

The word

So, what is life ? 
If a single living organism  live and died so soon,
Do heaven ? or Hell ? l is filled with them ? 
In that short time living, does it meant anything ? 
Or do they got a second chance, 
to be reborn with the same soul every time ? 

And if we see the universe, 
that's so wide a cross , space and time. 
Do we.. that look smaller than amoeba for them, 
matter ? 

Do our story will ever be heard, 
one hundred thousand year from now ? 
our tiny spark of light in history. 

And what do these rules that we hold on so tightly,
to obey, to follow, and to pass on. 
Would they matter to life ? 

Sometimes, a simple happiness is enough. 
Why does it so hard to get ? 
And when someone finally get it, 
then why do so many people want to take it away ? 

Life is cruel, life is random, life is not ordinary. 
Then Why ..... 

Do we even bothered.


Tuesday, November 23, 2010

way

More Lost Than A Child
Angry with the world
For though I'll be sorry for what i'll do
Neither of this is a concern of you

Cause I am who I am
I've become what I've dream I become
A dream where no angel, only shadow and despair

For those of you citizens of this world
My apologies
But life .....
Is not merely all about human

The times ...

There are times when you feel like, live isn't worth living anymore.

And today I've wondered. What my limit would be.

Saturday, November 20, 2010

Type of computer engineer

I believe The Computer Engineer Folks *yeah bad grammar* Could be generally separated into two categories.

  1. The one that like to solve computer problem like algorithm, building a compiler, using the most efficient way. They think coding is an Art
  2. And the one that only thinks programming as merely a tools to quickly solve real world problem.
And sadly, both type doesn't really have a place in my country. Hopefully one day i can make a place, for both :)

Thursday, November 4, 2010

Tapestr 5 production mode

I think i made very stupid mistake. When i developed my apps i usually set Tapestry 5 production mode to false in my app module using this line :

        configuration.add(SymbolConstants.PRODUCTION_MODE, "false");

since its programmable, this configuration is carried over when i deploy my apps to the server. What I've should have done is I need to override this configuration in the server so my apps would run on production mode. Adding this context-param in my web.xml hopefully would do the job.


<context-param>
<param-name>tapestry.production-mode</param-name>
<param-value>false</param-value>
</context-param>

It gives a little time for me in facing my server memory problem that has been maxed out.

Thursday, October 14, 2010

Setting your own private Mercurial server

update : the steps in this post has been updated for using mercurial 1.7.2

First of all I want to say that this wiki link is amazing, it's complete and robust. But even with the best guide sometime you've made mistakes. Never hurt to have many reference :)

So to simply put it,  this is my steps in implementing that guide. As a background i have an ubuntu server that i will be using as my own private mercurial server. I already have some code that works with google mercurial server. So its a matter switching repositories. And I also already have an apache server running on my server.

Now, Lucid lynx comes with mercurial 1.4. If you want to install Mercurial 1.5, 1.6, or 1.7 you need a new repo :

sudo add-apt-repository ppa:mercurial-ppa/releases
sudo apt-get update
sudo apt-get install mercurial

Don't forget to check the version using
hg -v

The steps

Pre-install

Installing mercurial in ubuntu is as easy as running
$>sudo apt-get install mercurial

Finding the hgweb.cgi file

First we need to find the hgweb.cgi file. Usually it resides in /usr/share/doc/mercurial-common/examples/hgweb.cgi . If you can't find it using locate or executing this command should do it.
$>find / -iname hgweb.cgi

go to the /usr/lib/cgi-bin/ and create hg directory. Copy the hgweb.cgi to /usr/lib/cgi-bin/hg/. Then make it executbale using this command
chmod  755

Creating the user and directories

Create user hguser with www-data as its group. it should have the /home/hguser as its default home. Now login as the hguser, change the .bashrc for hguser. You can use
vi ~/.bashrc

Add this line at the end of the file and save it:

umask 002

With the umask set, the file and directories created by the hguser will have group write permission. So the www-data (default apache user) can create and write any file in the repository. Now create hg directory for our repositories, so now we have /home/hguser/hg for our repositories yay !

for my setup I'm using 2 repositories, one for development and one for release. So under the hg directory, I created 2 other directory,
/home/hguser/hg/dev and
/home/hguser/hg/stable

Now you can logout from the hguser and back to your default user.

Setting the apache server

As I mention already have an apache2 server running. My server 80 is already used by something else, so i'm using another port for apache. Lets say port 9000. To do this you must edit the ports.conf file and make the changes accordingly. You can use this command :

sudo vi /etc/apache2/ports.conf


You also need to change the port on the default apache file to 9000. You can use this command :

sudo vi /etc/apach2/sites-enabled/000-default


still in the 000-default files, activate the cgi script. The easiest way is by using Script Alias, add the lines bellow to the 000-default files:
ScriptAlias /hg /usr/lib/cgi-bin/hg/hgweb.cgi

Setting Mercurial Repositories

To enable mercurial for multiple repository, it is easier to use the hgweb.config file.
First login as the hguser.
Create the hgweb.config under the hg directory

The hgweb.config file should contain :
[collections]
/home/hguser/hg/ = /home/hguser/hg/

edit the hgweb.cgi and update the config line to the line bellow :
config = "/home/hguser/hg/hgweb.config"

Restart the apache server, than you should be able to access http://yourserver/hg directory

Allowing Push

I'm allowing all authenticated user to push to the repository, and since the most important thing is make the repo up and running, I'm making SSL implementation none mandatory. So to allow push you need to edit the /etc/mercurial/hgrc and add the following line below

[web]
allow_push = *
push_ssl = false

Adding Authentication


To add the authentication to your mercurial server you need to add the line bellow to the 000-default file, just under the script alias should suffice.
<location /hg>
                AuthType Basic
                AuthName "Mercurial repositories"
                AuthUserFile /home/hguser/hg/hgusers
                Require valid-user
        </Location>

Now login as the hguser and go to the hg directory. To create the hgusers authentication file and create the first user you can use the comand bellow :
htpasswd -c /home/user/hg/hgusers frodo

to add another user you can remove the -c flag

htpasswd /home/user/hg/hgusers sam

restart apache and you should be able to to access the repo at :

http://www.yourserver.com:9000/hg/


Trouble Shooting

The trouble shooting section in the wiki is very good. I just highlight some here since I've encountered them in my installation. 

If you find the error message bellow in your apache2 error log. 

/var/lib/python-support/python2.6/mercurial/hgweb/common.py:24: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6

you're using and older mercurial that work quite right with the latest python implementation. To suppress it add the following lines to the hgweb.cgi immediately after any sys.path adjustment :

import warnings
warnings.simplefilter("ignore", DeprecationWarning)

And if you're able to create a new repo and synch it to your local komputer but  failing when pushing or cloning your existing repo to the server. Try  changing the hguser/hg directory permission recursively to 777. If that did work than you didn't set your permission correctly.

Good luck

Something ...

Has changed in me ... 

Sunday, October 10, 2010

Loosing home...

Why do the Aquarians travel the universe with its massive fleet
Why do the Kharak's people build a Mothership to travel the stars in a journey to take them Home.
Home...
What is home..

Its not just a place, a thing, people. Its everything that represent who you were.
So if you're planning to loose it, to leave everything behind
With nothing to comeback to,
What does that makes you ?

Never the less, I'm loosing my home ...

One more day ...

One more day, hold on for one more day. The only thing I'm holding on to. What the meaning of living if you cant see the future. What the meaning of passing the day when you feel nothing, no emotion. Just sitting here watching this blank screen. The only window that connect you with some world.

One more day, would i would be able to hold on for one more day ...

Wednesday, October 6, 2010

Kalau...

... semua orang berpegang kepada satu orang untuk selalu kuat. Sementara mereka berkutat dengan problem mereka masing-masing. Bukankah lama kelamaan orang ini akhirnya akan hancur juga ?

Tuesday, October 5, 2010

Enam Purnama Berlalu...

Akhirnya sampai juga ke tahap ini, enam bulan. Bukan waktu yang singkat tapi terasa begitu cepat berlalu.What am I doing ? What are the things that I've done ? ...

Enam bulan yang lalu, setelah membulatkan tekad. Gw membagi proses ini kedalam 2 tahap. Enam bulan pertama, dimana gw bebas melakukan apa saja, bereksperimen, membangun sebuah entity tanpa ada deadline, roadmap, atau role model. Hanya berusaha untuk fleksible dan take what ever live throw at me dalam mewujudkan keinginan gw. Lalu setelah enam bulan berlalu, di evaluasi, apakah ada yang bisa di seriusin, atau hanya sekedar keinginan, impian yang tidak punya pijakan di dunia nyata ?

Kalau memang ada, gunakan enam bulan berikutnya untuk serius, membuat sesuatu, moneytizing and turn it to business. Dan setelah satu tahun, kalau tidak berhasil, gunakan sisa waktu dan sisa tabungan untuk mencari kerja. Get back to the real life. That was the plan...

Sekarang, setelah merasakan, gw gak ingin kembali.Gw ingin berhasil di dunia ini. Kalau jatuh harus bisa bangun lagi. Kalau gagal, sedih , menangis meraung-raung lalu esok, coba lagi ! Buat hal baru, mulai kembali dari awal. Banyak yang bilang, di dunia baru ini, lu belum benar2 teruji sampai sudah merasakan sink to the bottom, not just ordinary bottom, but rock bottom !

So where am I now ? What about my evaluation ? To be honest, I don't know. Evaluation didn't seem to matter as much as before. That's what funny about this world. Today you can feel like a king, and tomorrow some how you just hit rock bottom. Becoming the lowest on the totem pool, so I learn to not carve  anything in stone.

I guess I'm kinda satisfied with where I am now. Don't have any money though. I'll be ecstatic if my position is a bit better economically, but this will suffice. So, what tomorrow will bring me ? I hope something nice. Tonight, I can only dream :)

Sleep Tight :)

Tuesday, September 28, 2010

Monday, September 27, 2010

....

Gak kuat lagi, gak kebayang bagaimana kalau tinggal ber-empat :(

Thursday, September 23, 2010

Indonesia

Sebetulnya bangsa indonesia bukannya tidak punya kemampuan untuk bangkit dan maju dalam persaingan menjadi bangsa terdepan di bumi ini. Tetapi bangsa ini tidak pernah diberikan kesempatan saja.

Tidak pernah diberikan kesempatan, karena disaat akan maju, kekuatan-kekuatan luar akan campur tangan untuk menggoyang keadaan indonesia dari dalam. Tidak pernah diberikan kesempatan karena disaat akan maju, harta kekayaan alamnya dirampok oleh orang2 serakah yang hanya memikirkan diri sendiri. Tidak diberi kesempatan maju, karena kekuasaan hanya berputar di segelintir orang saja. Dan yang paling penting, tidak diberi kesempatan, karena informasi tentang indonesia hanya dapat diakses oleh orang-orang tertentu saja. Sehingga bangsa ini tidak mengerti apa yang sebenarnya terjadi di negaranya.

Suatu hari, semua itu akan berubah. Berikan aku satu kesempatan !

~FD

Tuesday, September 21, 2010

...

I don't really want to do this.

Thursday, September 9, 2010

1431 Hijriah

Alhamdulillah, proyek rhamadhan tahun ini sukses. Berhasil mengkhatamkan juz 30 beserta artinya. Gak terlalu berat kalau dari sisi effort, bahkan gw berhasil selesai di hari ke 20, dimana sisa hari dipakai untuk mengulang beberapa bagian yang gw suka. Tapi tantangan terbesarnya adalah di niat dan semangat :) Untungnya aura Ramadhan banyak membantu :)

Mudah2an esok bisa memulai project yang lebih besar. Mulai dari Juz pertama, gak tahu bakal berapa lama waktu yang dibutuhkan, tapi gw selalu penasaran, setidaknya ingin satu kali membaca dan memahami isi Al-Qur'an.

-: Selamat hari raya Idul Fitri 1431 Hijriah, semoga semua ini menjadi awal baru bagi kita dalam proses selalu mencoba mengubah diri menjadi semakin baik. :-

Saturday, September 4, 2010

Storing image in File System or SQLite

That's the question that has been ask a lot, but if you google about it. It doesn't give a very definite answer. So here's the thing that I found out at the moment (Probably changed in time)

If your image is  < 1 MB Store it in SQLite. Because it will give you centralized and simple access to the images. And SQLite is still efficient handling blob with that size. 

If your image is > 1 MB just store the reference to the file in the database while the actual image is stored in the file system. Preferable the directory is relative to your current directory. 

The 1 MB limitation is derived from here, but some say 2 MB is still acceptable, i guess you just have to try it for your self.

Thursday, September 2, 2010

Tapestry 5 and Interface

As you see from this Tapestry FAQ, I just realized that my bad habit has cost me some of the advantaged of using Tapestry. I often lazy in creating an Interface when binding a Tapestry Service. It turns out that if you don't give an Interface for the service, Tapestry will create the implementation immediately after injection. While I was expecting it will be instantiated only after the first method of the service is invoked.

Well, i guess its time to dig up some old code :)

Saturday, August 21, 2010

F.U.D

Fear, Uncertainty, Doubt.


Persis sekali, hal yang sedang gw rasakan saat ini. Sering sekali berkutat dengan pertanyaan, apasih yang sebenarnya gw kerjakan ini. Apa mungkin cara-cara gw yang tidak ingin berkompromi dengan cara yang ada saat ini akan berhasil ? Memberikan terobosan baru di negara yang semua orang pesimis bisa berubah ?

I Only have one weapon, belive ! 


Percaya kalau melakukan yang benar, suatu saat akan dikasih jalan. Tetapi, seiring waktu berlalu. Tanpa ada sedikit tanda-tanda bahwa gw berjalan ke arah yang benar. Kepercayaan itu semakin terkikis dan menipis ... 



F.U.D

Fear, Uncertainty, Doubt.


Persis sekali, hal yang sedang gw rasakan saat ini. Sering sekali berkutat dengan pertanyaan, apasih yang sebenarnya gw kerjakan ini. Apa mungkin cara-cara gw yang tidak ingin berkompromi dengan cara yang ada saat ini akan berhasil ? Memberikan terobosan baru di negara yang semua orang pesimis bisa berubah ?

I Only have one weapon, belive ! 


Tetapi, seiring waktu berlalu. Tanpa ada petunjuk apapun, tanda-tanda bahwa gw berjalan ke arah yang benar. Kepercayaan itu terkikis dan semakin menipis....



Monday, August 16, 2010

Culture clash

Mungkin karena sedang ramadhan, jadi hobi nulis yang beginian :)

Entah kenapa saat ini perbedaan antara masyarakat muslim dan non muslim menjadi blur. Dulu walaupun  masyarakat diasimilasi agar tidak terjadi perpecahan atau dikotomi agama, perbedaan dalam perilaku sehari-hari masih terlihat cukup. Di saat Allah berbeda dengan allah.

Belakangan ini saya sering sekali menemui teman2 non muslim yang bicara Alhamdulillah disaat mendapat rejeki, Astagfirullah hal adzim disaat terkejut, Insya Allah , Masya Allah, dan lain-lain. Kalau dipikir-pikir malah agak lucu, karena terkadang ada teman-teman muslim yang walaupun sholat 5 waktunya lancar, tetapi tidak mempunyai kebiasaan ini :)

Saya tidak akan membahas dari kelayakan ataupun fiqih karena pengetahuan saya nol besar dalam hal itu. Tapi yang menarik diangkat adalah; "Kalau begitu yang membedakan kita (Muslim) dengan mereka itu apa ?"

Secara esensi mungkin mereka tidak begitu paham, tetapi secara garis besar mereka mengerti maksud dari setiap kata itu walaupun sekedar dari kebiasaan. Tapi saya rasa ada sebagian masyarakat muslim di indonesia (kalau bukan sebagian besar) yang mungkin juga tidak paham tentang hal ini sampai ke esensinya.

Kesimpulan yang saya dapat, Yang membedakan, dan kalau kita ingin dibedakan, mengenai hal diatas dengan rekan-rekan non-muslim kita saat mengucapkan kata-kata tersebut, adalah Keyakinan ! Di saat kita mengucapkan kata tersebut kita harus yakin dan sadar, bahwa kata-kata tersebut adalah Doa. Doa yang memiliki arti mendalam. Komunikasi langsung dengan sang khalik tentang keadaan kita di saat tersebut. Sebuah Back channel reserved only for my self :). Bukan sekedar kultur semata atau ucapan yang didapat dari pergaulan sehari-hari. Tanpa hal itu sebagai dasar, saya rasa kita sedikit-demi-sedikit mulai kehilangan jati diri kita sebagai muslim.

~FD

Friday, August 13, 2010

Kadar Iman

Saat satu ayat dari surat Abasa yang sempat membuat saya sedikit terdiam. Terjemahannya kurang lebih begini :

Adapun orang-orang itu, adalah orang-orang yang telah merasa cukup tentang dirinya. 

Yang ada penjelasan sedikit dari tafsirnya :

Maksudnya, pembesar-pembesar Quraisy yang diharapkan masuk islam oleh Rasullullah S.A.Q padahal mereka tidak membutuhkan keimanan lagi, sebab sudah merasa kuat dan kaya.

Yang membuat saya terdiam adalah, betapa benarnya pernyataan itu di jaman sekarang. Melihat ke diri sendiri, karena punya posisi, kekuatan dan harta yang cukup. Saya sudah merasa menjadi orang yang baik, tinggi derajatnya. Tanpa sadar bahwa kadar keimanan yang menentukan tinggi-rendahnya derajat seseorang di mata sang khalik, tidak ada kaitannya sama sekali hal-hal tersebut :( 

Android and T5 Assets Lesson of the month :)

Okay, this is from few days back, just have the time to write it.

I'm serving an android installer (.apk) in my Tapestry 5 website. I used asset to do this, its not architectural choice, but its the only thing i knew at the moment. The problem with using my regular approach, form based/Action link. Is that they generate very particular URL. Some android browser requires that the URL Consist of <url>/<filename>.apk so it will be treated as an installer. Thus why the Asset approach.

Couple of days a go. A friend of mine contacted me that he wasn't able to download my apps through his android phone. He keep getting error message about the installer. After couple of messages, i found out the size of the downloaded apps is not the same with the file on the server. And no matter how many times he refresh it he keeps getting the same file. Even when he tried to download from his laptop. He's using his office Wifi, so I asked him if to use GPRS/3G. Seems to fix the problem.

But since a bit tech savvy, he tried the same method using android emulator. Then he send the error message to me. Its about some error chunk size bla.. bla.. proxy bla.. bla.. Turn out that android still having problem with password protected wifi connection. Lesson No 1.

That problem fixed or at least I know about the root cause, I'm interested in finding out the other one. Why he keep receiving the same corrupted installer though he refresh it many times. So finally i have a proper reading about T5 Assets documentation :)

The things you need to know about Assets, since its an asset it have a very specific behavior.Asset is a static content, usually its a static image or css. So it is assumed that Asset rarely changed and expected to exist in deploy time (not dynamic). So if the .apk file didn't exist when the page is rendered, it will show an error page instead the page you want to access. This is happened although the link is not clicked yet.

Another thing about the Asset, is that is have a very long expiration time. The benefit is that the asset will be cached by the browser (and maybe the proxy server ?) for a long time. Giving some performance boost and reduce load for the server. But this also what makes my friend keep receiving the same corrupted installer. That's Lesson number 2, 3 about T5 Asset.

Since I've got time, I find another way to handle this scenario. Turn out this scenario could be handled pretty easy using T5 event link :) Well, learning bit by bit everyday is not a sin right :D

Tuesday, August 10, 2010

Stupid SVN Mistake :(

Okay, i've just wasted 4 hour of my time because some stupid mistake that i made.

Today, suddenly my local SVN server just stop working. I keep getting some error message :


Server sent unexpected return value (500 Internal Server Error) in response to OPTIONS request for ...

It worked fine yesterday ?

Trying to retrace changes that I've done in the past few days, I've remembered that i made some update to the subclipse client. This throw me into some wild goose chase. Long story short, after changing some settings, change svn client etc, finally i found the core of my problem looking at the httpd.conf file for my svn server.

I have this kind of Computer-OCD. When ever i see a file that i didn't know i tend to erase it. Later this day i found a passwd file in my C:\ drive. Thinking that no body use it, immediately i hit the Delete button. Lesson learned, that this file actually my password file for accessing my local svn server, and I simply forgotten about it. So i create new password file named svn-passwd to store my password and the svn worked fine.

Wednesday, August 4, 2010

Language of the Angels

Apa kamu pernah coba berbicara dengan seseorang yang begitu pendiam ? Sangking pendiamnya sampai terkadang dia tidak mengeluarkan sepatah katapun untuk menanggapi perkataan yang kita lontarkan. Satu-satunya tanda bahwa dia paham apa yang kita katakan hanyalah dengan melihat tatapan matanya yang menhindari tatapan kita, bibir yang mencibir saat mendengarkan suatu nasehat, tangan yang bergerak untuk menopang dagunya untuk menandakan kebosanan.

Bukan berarti mereka sama sekali tidak mendengar, kadang2 belalakan mata menunjukkan keterkejutan, atau alis yang berkerut dengan tatapan tajam tanda ketidak setujuan, menunjukkan bahwa mereka tetap berkomunikasi, walaupun tidak ada kata-kata yang keluar.

Berkomunikasi seperti itu terkadang melelahkan dan butuh kesabaran yang tinggi. Tetapi dibandingkan kata-kata yang mudah untuk dimanipulasi oleh lidah tak bertulang. Metode komunikasi seperti ini terkadang terasa penuh kejujuran.

Where am I going with this ? Seperti inilah kita berkomunikasi dengan tuhan. Ketika kita begitu banyak berkata-kata, memohon ampun, sumpah serapah, memaki-maki melihat keinginan yang tidak terwujud atau derita di dunia ini yang seakan-akan tiada akhir. Begitu lelah kita meminta, berkata-kata, meraung-raung, tetapi seakan tidak ada jawaban, hanya kekosongan yang ada di atas sana, hampa, nothing exists.

Seperti apa yang gw angkat diawal, terkadang komunikasi itu tidak selalu seperti yang kita inginkan. Ketika tidak ada suara menjawab, mungkin kita lah yang tidak mengerti bahasanya. Kita hanya perlu sedikit lepas dari ke-egoisan diri. Untuk tidak berpikir mengenai sesuati dari our own term and view saja. Mungkin jawaban itu sudah ada di sekitar kita, tapi kitanya kurang awas melihat senyuman , tatapan atau kerutan alis dari alam ini.

Saat ini yang gw pahami untuk mulai memahami bahasa ini adalah dengan menghentikan singularity dari flow waktu kita. Disaat alur yang terlihat hanyalah alur kehidupan dunia saja, baik itu pekerjaan, karir, hobi, anak , istri , dsb. Disaat diwaktu ibadah, sholat badan bergerak tetapi pikiran kita tidak lepas dari apa yang sedang dan akan dikerjakan setelah sholat. Cobalah untuk berhenti sejenak di akhir sholat, untuk beristigfar, bukan sekedar bertasbih sesuai rutinitas. Tapi menghentikan waktu yang berputar di dunia ini, sampai disaat kata-kata istigfar berhasil menyelubungi diri kita, memberikan kesendirian dari dunia untuk sejenak. Dan at that brief moment in time. Kita bisa melihat diri kita sendiri, alam sekitar dan kejadian2 yang terjadi, dengan bahasa dan pemahaman yang berbeda.

~FD

Tuesday, August 3, 2010

Suffering

If you wanted to know who suffer the most, you look for some that gripping so tightly to justice. Like no other force exist in this world. And although she/he is a mess, she/he cares about other more than her/his self.

Definitely that person needed help. Cause everyone needs a savior in one moment of their life. But in this case, the savior couldn't be just any ordinary person.

Monday, July 26, 2010

Sibuk

Sangking sibuknya dengan kegiatan duniawi, sampai lupa bulan puasa sebentar lagi hadir. Mudah2an tahun ini dapet berkah, petunjuk yang benar-benar bisa meluruskan jalan gw. I'm getting tired of this :(

Tuesday, July 6, 2010

Demons

Everyone has his/her own demons to fight. A never ending battle, day by day. And today , one of my demon win big time over me. I no longer know how to fight it off, moreover to kill it. All i can do is prolong the inevitable and undermine the effect, eventually I'm going to loose unless i get some help from the outside.

~SoTired

Thursday, June 24, 2010

Selangkah Maju

Sedang memikirkan sebuah slogan yang cocok untuk sebuah gerakan. Entah kenapa yang terpikir adalah kata-kata berbahasa inggris.
- Yes, we can !
- Go
- Move Forward
- A little step in the long road

Mungkin efek globalisasi benar sudah melindas negara kita. Otak-otak kreatif kaum muda kita sepertinya selalu mengangkat versi timur dari ide-ide barat :) Ketika di minta berpikir kreatif orizinal indonesia, hasilnya seperti ini :)

Tetapi akhirnya kata itu ditemukan, "Selangkah Maju".

Selangkah Maju demi indonesia,
Selangkah Maju di bidang yang kita kuasai.
Berhenti berpikir besar, bermimpi-mimpi indah.
Potensi, potensi, potensi itu saja yang selalu kita banggakan.
Kita memang punya begitu banyak potensi,
Tapi tidak pernah mampu mewujudkannya :)

Oleh karena itu, berhentilah.
Tengadahkan wajah ke atas, pejamkan mata perlahan-lahan.
Bayangkan hal yang paling kamu sukai.
Ketika apa yang ada di benak sudah dirasakan oleh seluruh tubuh.
Ambil selangkah maju, langkah-langkah kecil, di dorong rasa ingin tahu dan kebebasan.
Bukan impian kosong atau slogan semata.
Karena selangkah maju itu adalah jalan kita, untuk mengubah negara ini.

Wednesday, June 23, 2010

Encounter

I'm looking for that special encounter,
where its only a moment but feels like eternity.
Where no words exchanged,
only eyes were met.

To not ask, To not say.
To be in a moment in time, where time seems to meet its end.
No more journey after this, No more waiting for the One.
This is the place where exactly I want to be !

Monday, June 14, 2010

Phailed !

Ah gagal nih mau bikin app ke dua. Udah hampir satu bulan progressnya gak bagus, gak sampe2 ke versi 0.1. Terus juga tanya sana-sini sepertinya animo-nya tidak terlalu bagus. Harus cari ide lain.

Huh.. usaha 1 bulan terbuang, tapi harus tahu kapan untuk cut losses dan mulai yang baru.

Tuesday, June 1, 2010

This GMail trick is awesome

http://i.imgur.com/7z3om.png

I'm thinking of re-subscribing all of my milist using this trick :P

Friday, May 28, 2010

Tapestry 5 grid paging with hibernate

This is something that i expected to exist in tapestry. Since i "know" T5 from the first release, back then this class isn't available yet. So back then i created my own paging method with 2 additional action link above Tapestry Grid. 

But now its so easy. If you want to create paging for your grid, you just have to return the HibernateDataSource with the session and your class for your grid source parameter. Like this : 

return new HibernateGridDataSource(session, OrderForm.class);

Its something very simple. But when you're in the middle of something, sometimes its too easy to overcomplicate stuff (Not thinking straight, i previously implements my own GridDataSource for my hibernate class). Everything work out of the box (paging, sorting,etc)

Also the grid has a reset() method for reseting the Sort Ordering.


update : 


i found the easiest way to add default column sort for now is by implementing this method. 


@Component(id="orderGrid")
private Grid grid;


@SetupRender
void setDefaultSortOrder() {
if(grid.getSortModel().getSortConstraints().isEmpty()) {
// call it twice to make it desc ordered
grid.getSortModel().updateSort("orderDate");
grid.getSortModel().updateSort("orderDate");
}
} 


don't forget to reset the sort order to see the result.

Wednesday, May 26, 2010

I learn something new today :)

Thanks to geoff jumpstart, I finally learn how to protect tapestry page in a more 'classier' way. I've been meaning to learn this, but only able to do it now. The guide is here. The concept is very similar with me, only the the implementation differs.  While i'm using basic method of extending base page by their role. Jumpstart uses annotation, way cool :D

So now i'm trying to implement it using annotation. Its very straight forward actually, since the concept is very familiar. Even the autologin concept is very familiar. But of course he's doing it far better and classier than me and i think i will change it too :)

Jumpstart uses system properties to set the autologin properties, while I implement in the code. Since the system properties wouldn't be available when i deploy my apps to the server. I don't have to worry about forgetting to reset the autologin properties when i want to deploy my apps to the server.

To set the system properties in eclipse wtp, you just

  • go to the server window > right click > open 
  • in the bottom of general information > click open launch configuration
  • select the arguments tab, and in the vm argument box add
  • -Dmyapp.autologin="true"
  • restart your server
Cool and Classy :D

~FD

Monday, May 24, 2010

First experience with SQLLite

Well it more like the first problem i have with SQLLite in android. If you follow the notepad tutorial for android, you're going to think that this is like any regular database mapping in java. Especially for those of you that used to working with ORM such as hibernate.

When you want to add a second table naturally you'll create another class to handle that table. Well it turn out in SQLLite (in the SQLiteOpenHelper Constructor) if the database is already open, then it wont call the next onCreate() method. So your second table wouldn't be created.

this link explain it more throughly. To solve it you need to put the table creation in one place. The better approach is to open the db in a single class and pass around the handler to other class that actually handle the database functionality. That way you wont be stuck with one single file to handle the database (we're trying to stick with OOP principles here) :).

Another good link about DB/SQLLite handling in android is this link. This will tell you how to ship your android application with prebake database file.

~FD

Sunday, May 23, 2010

Second Milestone

Today is a second milestone for me. Its exactly 2 month since I quit my job. I'm a little behind, haven't release my second apps yet. But May isn't over, hopefully i can manage in this last few days.

Tuesday, May 18, 2010

Forget to create trunk folder in SVN

Another one about SVN. Since i'm a bit hurry when adding my project to my SVN repositories. I forgot to create the common directories (trunk, branch and tags). After my project is stable i decided to move the code to the proper directories before tagging it.

After quick i found a simple and effective way. Since I'm working on windows, i made a simple batch script for it. Beware it tested lightly, and I didn't tune it to be a generic script.

@echo off
set repo=http://localhost/svn/myProject
echo "Repository location " %repo%

echo "Creating SVNTemp directory"
del SVNTemp
mkdir SVNTemp

echo "Checking out source from repo"
svn checkout %repo% SVNTemp

echo "Creating trunk in repo"
svn mkdir %repo%/trunk -m "creating trunk"

cd SVNTemp
FOR /F %%a IN ('dir /b *') do (
echo "Moving %%a to trunk"
C:\Progra~1\Subversion\bin\svn.exe mv %%a trunk
)
svn commit -m "organizing to trunk"
cd ..
@echo on

Tuesday, May 11, 2010

1 Of 2 Fear

Udah lama emosi gw gak memuncak seperti ini. Dulu udah sering marah, berantem, capek. Jadi sekarang lebih milih diam aja , paling2 dibilang cuek abis. Tapi gak ada yang bakal sakit hati kena gw semprot, dan gw gak bakal uring2an berminggu2.

Tapi tanggal 9 dan 10 Mei ini nyokap memang bener2 keterlaluan. Tapi tetep aja gak bisa marah sama nyokap sendiri, gak mau nyakitin hati, but don't push me !

Saturday, May 8, 2010

The mystifying URL Encoding

I just found out about this things. I never really care about the difference between URL and URI. Whatever it is I just figured it will point to a resource somewhere in the internet. For all i know they can be used interchangeably, so far.

It turn out, when you're trying to generate your own URL programmatic-ally , it matters. One thing to know, that it encode space differently. URL will encode space into + as demand by html 4.0 specification. While with URI you can get the usual %20 character.

And what more annoying is this fact.  That you can't simply use URLEncoder to encode and decode URL, but you need to create a URI then execute the toURL() method.

Tapestry URL


Now something specific about tapestry. Since I'm creating an android client that will talk with tapestry server. I need to generate my own URL. In this URL fiasco it turn out that tapestry has its own URL Encoding policy. You can see the change in this jira. Tapestry substitute the '%' character with '$00'.

Luckily the you can get tapestry URLEncoder implementation from tapestry code. So i just use that class in my android app. And one problem solved.

Oh another thing i found out. Tapestry page isn't debug able with eclipse WTP. But the services are.

Cheers

~FD

Its not easy

Well, its not easy when you're always at home and people think that you're just wasting your saving money. Ditching out a well payed job and many opportunities.

Its not easy, especially when they didn't understand about your field of work. Hell, even some of the people in your line of work couldn't see as far as you and other see.

Its not easy. But at least I'm thankful that my parent never ever force their decision on me. Although they sometimes didn't understand why i do it. And sometimes brought up question that i couldn't answer at the moment. I could only smile, and hope they will see it at the end.

Its not easy. But this is my choice, and i will go through it no matter what happened.

Siapakah pengguna tapestry 5 di indonesia ?

Judul di atas adalah pertanyaan yang muncul di kepala saya saat ini. Semenjak dulu 'canggih tetapi susah' adalah sebuah paradigma yang melekat dengan Tapestry. Tadinya saya pikir dengan keluarnya tapestry 5 (T5) akhirnya tapestry akan bisa jadi booming. Mungkin bukan saya sendiri yang berpikir seperti itu, tetapi para pengguna tapestry yang lain juga berpikir seperti itu. Tapi pada kenyataanya hal itu tidak terjadi.

Hingga saat ini, dimana tapestry dengan versi 5.1.0.5 yang sudah cukup stabil. Ternyata labelnya tetap melekat. Saya sendiri harus mengakui belajar Tapestry itu tidak mudah, sampai sekarang pun masih seperti orang bego :D.

Tetapi ini juga yang membuat saya tidak bisa lepas dari T5, terutama disaat seperti sekarang. Dimana saya merasa perlu untuk mendalami satu hal secara serius. Tidak hanya belajar kulitnya saja seperti selama ini. Tapestry itu canggih, apalagi di T5, banyak konsep2 yang mendahului jamannya. Selain itu tapestry banyak 'memaksa' kita untuk menggunakan cara2 yang 'benar' dengan segala jenis design pattern yang perlu kita pelajari. Bukan sekedar framework hack and slash :)

Mungkin itu juga sebabnya tapestry begitu sulit untuk di kuasai. Tetapi bagi saya sendiri mempelajari T5 dengan baik menjadi begitu berharga. Banyak hal yang bisa saya pelajari, semakin kelihatan perbedaan keahlian dalam mendalami konsep java dan web setiap kali saya mempelajari sesuatu. Pengalaman ini suatu saat pasti akan menjadi begitu berharga.

Dan sekarang yang menjadi pertanyaan saya adalah. Apakah ada orang lain di indonesia yang memiliki pikiran yang sama dengan saya. Kalau seandainya ada komunitasnya betapa senangnya bisa saling bertukar pengetahuan sebagai pengguna T5.

I'm sure we can learn a lot :D

Cheers

Wednesday, May 5, 2010

Removing folder from SVN

Well, i haven't use SVN for a long time, so my memory is a bit lacking. I initially import all of my project to SVN, but I've forgotten some folder that should be excluded from the initial import. Such as generated bin files. And i want to remove it from SVN versioning.

The solution is pretty simple, you go to the folder that you didn't want to manage in windows explorer. Search for file and folder containing .svn, and don't forget to check search subdirectory, and search hidden file option. Sort by folder, delete all of the .svn folder.

Then go to eclipse, update your project. And then the bin  folder will have a question mark near it. Just right click add to svn:ignore. And you're finished. The bin folder wouldn't be managed by SVN any longer.

Update :
After migrating to eclipse galileo subclipse somehow treat this workaround  as un-ignored error. The better approach is to delete the folder from SVN Repositories View and check out the code again, and then add the folder to svn:ignore. The subclipse wiki explain in more detail.


~SD

Saturday, May 1, 2010

Color Harmony

Well, for someone like me who is color illiterate , this seems to be the perfect place to start. By learning it you make sure that the user that uses your web doesn't get a headache every time they uses your apps. :D

And this tool from Adobe is amazing :D

My SUN has set, its time to SEARCH for a new one :)

I wonder if the title is appropriate :D

Tepat 38 hari semenjak gw berhenti kerja kantoran. Yes, my SUN has set. Sebuah perusahaan yang punya begitu banyak inovasi dan penuh kultur keterbukaan. Untuk pindah dari kultur seperti ini ke kultur big O yang menomorsatukan sales number diatas semua hal, sepertinya bukanlah sebuah pilihan. Dan untungnya, gw bukan sendirian yang berpikir seperti ini. Bahkan JG pun memutuskan untuk berhenti.

In SEARCHing a new one,  sepertinya memang hanya perusahaan itu yang punya kultur mirip. Mendorong keterbukaan dan juga mendorong melakukan good things. Tetapi itu mungkin akan menjadi cerita di lain waktu.

Kembali ke gw, udah Mei saja :D. Tadinya mau menulis banyak hal, merayakan tepat satu bulan berhenti dengan menumpahkan pikiran dan angan-angan kedalam blog. Tapi gak jadi :) gak usah dipaksakan, pada waktunya nanti yang ingin ditulis pasti akan ditulis. Goodnewsnya waktu yg tadinya akan digunakan untuk menulis, dimanfaatkan untuk mengerjakan sesuatu yang lebih produktif.

Di awal-awal long vacation,  gw berhasil olahraga rutin, lari pagi untuk mengembalikan kondisi fisik. Masih keep kontak dengan teman2 kantor dengan main bulutangkis dan futsal. Tapi sayangnya karena cedera futsal dipertandingan lain di kampus, olahraga paginya terpaksa di stop dulu. Gw gak mau cedera ini jadi parah dan kambuhan.

I'm a lot happier, sholat lebih teratur, bisa Nemenin nyokap di rumah karena lagi gak ada pembantu buat nemenin. Banyak belajar ulang mengenai konsep-konsep di tapestry dan javascript yang selama ini belajar sambil lalu. Dan akhir pekan lalu, gw merelease aplikasi pertama gw di android.

Ternyata banyak hal dapat dilakukan dalam waktu satu bulan. Perbedaannya besar sekali melakukan hal yang lu bener-bener suka, dengan melakukan mundane job at the office. Ucapan terimakasih dari tiap-tiap orang yang menggunakan aplikasi lu benar2 terasa nikmatnya.

Tapi satu hal yang benar-benar gw pahamin. Dalam keadaan seperti ini, dukungan dari teman dan komunitas benar-benar terasa manfaatnya. Disaat ragu dan bimbang tentang apa yang kita kerjakan, would it matter ? A nudge in the shoulder and a little push really2 meant a lot.

So whats next ?

Gw berencana untuk tetap fokus di hal yang gw kerjakan saat ini. Belajar lebih jauh tentang android, memperbaiki aplikasi gw, dan mudah2an me-release aplikasi ke dua gw di android di bulan ini. Wish me luck :D

Tuesday, April 20, 2010

Tapestry 5 and Quartz

Using Quartz with tapestry is pretty easy , thanks to the ChenilleKit project. By following the guide in the chenillekit-quartz project you can use quartz to schedule jobs in your application. But in my case, i need to modify the example a little to make it work.

in the Bundle class :

    private void createBundle() {
        try {
            trigger =  new CronTrigger("myCronTrigger", "CronTriggerGroup", "0 42 7/1 ? * *");
        } catch (ParseException e) {
            e.printStackTrace();
        }
       
        jobDetail = new JobDetail("myJob", null, CrawlingJob.class);
        jobDetail.getJobDataMap().put("crawlingJob", crawlingJob);
        jobDetail.getJobDataMap().put("crawler", crawler);
    }

I'm adding the job (crawlingJob) and the actual services (crawler) into the job data map. So in the Job class :

    public void execute(JobExecutionContext context) throws JobExecutionException {
        System.out.println("Execute job Scheduled Crawler at : " + new Date());
       
        Crawler crawler = (Crawler) context.getJobDetail().getJobDataMap().get("crawler");
        crawler.updateData(CrawlAjax.URL);       
    }
we only need to extract the service class from the context and then execute the real method. As simple as that. And the AFAIK the minimum library you need to include to make it work is :
  • chenillekit-quartz-1.0.2.jar
  • commons-codec-1.4.jar
  • commons-collections-3.1.jar
  • quartz-all-1.6.5.jar

Monday, April 19, 2010

Using block to invoke client Javascript code in Tapestry 5

In my previous post  I've been able to create a self updating tapestry zone.But its only halfway of what i want to do. Although I already give 2 button to start and stop the timer, i want it to be more automatic.Simply said, the server need to send a response that will trigger the stopTimer js function when the crawling process is finished.

To do this I'm using 2 block. The first block contain the regular content that will be returned from the server. While the second block contains the content and an embedded javascript that will invoke the stopTimer function in the client browser. This is the changes I made to my previous post.

The Code

Template Code :
        <t:zone t:id="infoZone" t:update="show">   
        </t:zone><br/>
       
        <t:block id="info">
            Updating Message ....
            <p t:type="OutputRaw" t:value="${message}">
                Text Output
            </p>
        </t:block>

        <t:block id="infoWithScript">
            Update Stopped
            <p t:type="OutputRaw" t:value="${message}">
                Text Output
            </p>
            <script type="text/javascript">
                stopTimer();
            </script>
        </t:block>

    <a t:type="actionlink" t:id="crawl" href="#">Start Crawl</a> &nbsp;

In the template code I'm adding the two block named "info" and "infoWithScript". The block will not be rendered by default. And also I added another actionlink that will change the state in the server and start the crawling process.

Changes in java code :
    @Inject
    private Block _info;
   
    @Inject
    private Block _infoWithScript;

    Object onActionFromRefreshZone() {
        if(crawler.getCrawlStatus() == Crawler.CRAWL_STARTED) {
            crawler.setCrawlStatus(Crawler.CRAWL_CRAWLING);
            crawler.updateData(URL);
        }
       
        if(crawler.getCrawlStatus() == Crawler.CRAWL_END) {
            crawler.setCrawlStatus(Crawler.CRAWL_IDLE);
            return _infoWithScript;
        }
        return _info;
    }

    void onActionFromCrawl() {
        crawler.setCrawlStatus(Crawler.CRAWL_STARTED);
    }

    public String getMessage() {
        return ProgressNotifier.getMessage();
    }

In the java code we add the two block that will be return by onActionFromRefrezhZone. This method will check if the crawl status in our services class is changed to started, then it will execute update data (the method that will invoke the real process and add messages to the ProgressNotifier).

At the end of the updateData method, the crawl status will be set to CRAWL_END. So the onActionFromRefreshZone will return the block that contain the embedded js to turn off the timer. And return the status to the original CRAWL_IDLE state.

Nothing changes in the client js script.

~FD

Friday, April 16, 2010

Ajax Zone with Interval in Tapestry 5

I'm planning to create a zone that will keep requesting data from the server at certain interval. Seems simple enough to do in Tapestry 5 right ?

But because of my lack of understanding about Ajax and Javascript concept, I've venture to many place to make it. ZoneUpdate, Progressive Display is a few things that i look a bit deep. Trying to understand their inner work, just to find out in which part could I add this simple code.

After a day struggling, i found out that my original idea work just fine. Yeah when its about web, ajax and javascript, I SUCKS ! BIG TIME !

So here's the code to make it work, so no other newbie would get lost like I Do.


The Code

I'm using the sample code from Zone Component in Tapestry 5.
Here's the template page :

<body>
<h1> Crawl Ajax </h1>
<h2> Timer Zone </h2>
   
    <div style="margin-left: 50px">
        <t:zone t:id="time2zone">
            time2:  ${time2}
        </t:zone><br/>

        <a t:type="actionlink" t:id="refreshZone" href="#"
            t:zone="time2zone">Refresh time2 </a>
            <br/><br/>

    </div>
       
    <input type="button" onclick="startTimer()" value="Start Timer" /> <br/>   
    <input type="button" onclick="stopTimer()" value="Stop Timer" /> <br/>   

</body>

Here's the java class code :

    @InjectComponent
    private Zone _time2Zone;

    // The code
   
    void onActionFromRefreshPage() {
        // Nothing to do - the page will call getTime1() and getTime2() as it renders.
    }

    // Isn't called if the link is clicked before the DOM is fully loaded. See
    // https://issues.apache.org/jira/browse/TAP5-1 .
    Object onActionFromRefreshZone() {
        // Here we can do whatever updates we want, then return the content we want rendered.
        return _time2Zone.getBody();
    }

    public Date getTime2() {
        return new Date();
    }
   
    Object onChangeOfTimerZone() {
        return _time2Zone.getBody();
    }

And finally, Here's the Java Script code :

<script type="text/javascript">

var timerId;
var linkId='refreshZone';

function updateMyZone() {
    alert("Update Zone!" + linkId);
    var actionLink = $(linkId);
    Tapestry.findZoneManager( actionLink ).updateFromURL( actionLink.href );
}

function startTimer() {
    alert('yohoo');
    timerId = window.setInterval('updateMyZone()', 2000);
}

function stopTimer() {
    clearInterval (timerId);
}
</script>

As you can see i only add 2 input button to start and stop the timer. The button will invoke the javascript function that uses setInterval that will invoke updateMyZone every 2 second. The updateMyZone will emulate the actionLink behaviour to update the zone.

Bleah its 10+ line of code and it took me the whole day. *still angry and ashamed with my self*

~FD

It happened again !

Okay, some reminder for the future. I don't know how many simple tapestry project I've made, but definitely more than a few. Yet i keep falling into the same hole. I keep missing some minor detail when creating a new project. And this time I'm facing a weird problem.

My project run fine in my development environment (eclipse WTP, tomcat, windows). But when ever i deploy it to my linux server. The page didn't show , it keep getting exception :

Page xxx did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering.
 First I thought it was Case Sensitive problem. The name of the template (.tml) didn't match up to the class page. Although tapestry is case insensitive in many other things unfortunately this is something that T5 couldn't control. To bad that wasn't the problem :(

And then when i try to rebuild my project, clean, rebuild the class, and refreshing the project tree on eclipse explorer. You need to refresh the tree to make sure new/old/deleted file in the project will be the same with the wtp tomcat temp folder. The temp folder usually located in :
<your_workspace>/.metadata/.plugins/org.eclipse.wst.server.core/tmpX
 After rebuilding I found out that my local project also has the same problem, so it isn't about case sensitive. It turn out the source of my problem is this :

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
while the correct one is :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
Tapestry 5 could be very strict about this stuff, and no IDE support for Tapestry 5 certainly didn't help :( There are times when i build the html page from scratch just to test simple case, i forgot to ade the xmlns and Tapestry would just sprout some error.

It's a great framework no doubt. Years in front of its competitor. But it has its own perks *meh* Hope this can be a gentle reminder for me in the future.

~FD

Tuesday, March 23, 2010

One foot at the entrace

If you remember my september break down and what i think about my future, finally I've arrived to that point. Its a few days sooner than i expected but now I'm in front of the gate into a new world. I'm glad how it turn out. But first i need to finish few things first :)

Here's my check list for this week :
  • clean up my room and computer 
  • backup my work to dvd
  • start jogging, and what i can get with 5 days of regular road work
  • Finish my tax
  • create my first apps
  • commemorate today's event with another post on my blog :D

Monday, February 15, 2010

Akar dari frustasi

Hm.. sepertinya gw udah menemukan sedikit pencerahan, kenapa belakangan ini gw begitu mudah frustasi.

1. Sifat gw yang ingin melakukan banyak hal sendirian, setelah berhasil baru membicarakannya ke orang-orang. Ini merupakan proses pembelajaran bagi diri gw, kalau berhasil tapi dikasih tahu orang, rasanya pengetahuannya gak lengket. Makanya lebih suka untuk coba sendiri.

Jeleknya, disaat mentok, coba belok dikit mentok lagi, balik arah masih tetep mentok. Jadinya frustasi berlebihan. Padahal kalau tanya sama rekan, bisa diberikan jalan. Jadinya buang waktu berkutat ingin mengetahui semua hal kecil yang gak penting yang bikin sesuatu itu berjalan.

Agak susah dirubah sih, karena ini sifatnya kepribadian dan cara belajar. Tapi setidaknya ada hal2 di kantor yang membuat mau tidak mau, bertanya ke orang lain :D

2. Terasing dari sang khalik. Karena lingkungan kerja yang bisa di bilang agak kebarat-baratan. Atau setidaknya berakar dari ilmu barat, dimana people dianggap sebagai resource, yang diukur dari kemampuan teknikal skill-nya, kecepatan belajar, pengalaman, dst. Sebagai one of the unit of production. Tanpa diperhatikan hal spiritualnya. Hanya atribut2 teknis yang masuk kedalam KPI dan PE.

Walaupun tetap solat. Tetapi ketika melihat value diri di pekerjaan, bagaimana dinilai, bagaimana hal2 yang memberikan value kepada diri kita. Tetapi lama kelamaan, sifat berserah diri, kesabaran, dan kepemilikan waktu. Mulai tergeser oleh, deadline, harus bisa dan pendakian jenjang karir.

Manusia itu ringkih, lemah dan mudah frustasi. Hanya ketika mempunyai tempat bersandar lah mereka menjadi kuat, pantang menyerah, dan percaya apapun yang akan terjadi pasti akan terjadi. Disitulah peran penting satu kata yang bernama iman.

3. Tidur ! Gw baru baca artikel yang bilang, salah satu efek jelek dari kurang istirahat adalah MUDAH FRUSTASI ! Jadi gaya hidup ini yang tidak membedakan waktu kantor dan waktu dirumah. Bergadang dan kecanduan berlebihan terhadap internet semenjak ada Speedy. Secara langsung berkontribusi besar untuk membuat gw lebih mudah frustasi :D

Good newsnya setelah mengetahui hal-hal ini, gw bisa sedikit berbuat sesuatu. Setidaknya mencoba tidur lebih teratur dengan istirahat yang cukup. Tanpa menyalakan komputer demi download film di malam hari :))

~FD

Friday, February 12, 2010

Reverse proxy in apache 2 karmic koala

It turn out to enable reverse proxy in apache 2 is very simple. All you have to do is enable 2 module using this command :

> sudo a2enmod proxy
> sudo a2enmod proxy_http

modify the virtual host for your sample, the default is in /etc/apache2/sites-enabled/000-default

add this 2 lines for each of your context
ProxyPass /itsme/ http://www.mysite.net:8080/itsme/
ProxyPassReverse /itsme/ http://www.mysite.net:8080/itsme/

restart the apache server using
> sudo /etc/init.d/apache2 restart

and its done :D

~FD

Monday, February 8, 2010

Adam 2009

Well, i guess i found a little answer, of what i was feeling all this time. I guess for me, live was not all about collecting money to be rich, or chasing some career climbing the corporate ladder. For me it was all about connection, seeing the people that matter for you the most. Day to day, live in simplicity, enjoying each other company and honesty.

And yes, I've just watched the movie in the title.

~FD

Sunday, January 24, 2010

The Way

My last though in the matter of system-society-way. The seed of your young genius, radical entities. Will face a very thick huge wall. Before they could do something great, they need to survive first. They need someone, something to show them the way. That it is not impossible to do.

With out the glimpse of light, they would only get lost in the dark, and slowly dies and fade away.

~FD

The Society

Every society need a stable structure for it to be able to grow. But some time that stability if stagnant for a long time. It can drug us with being pro to the status Quo. That attitude could only bring the collapse of the society. We must keep evolving.

That is why, people that has new ideas, free being, radical entity. Must have a way to exist and survive in the society. That is the only way we could survive the test of time.


~FD

The systems

Di analisa D-I-S-C gw tergolong orang yang high S-C. Nilai Stability dan Compliancenya tergolong tinggi. Ini artinya gw termasuk orang yang nyaman berada didalam sebuah struktur yang baku dan sudah memiliki rule dengan standar operating procedurenya.

Tapi sejujurnya semenjak dulu gw selalu memimpikan hidup hidup sebagai seorang laki-laki sejati. Yang dalam kamus gw itu berarti hidup dengan prinsip, hanya menjunjung tinggi kebenaran, dan tidak terbelenggu harta dan posisi. Mengatakan sejujurnya apa yang ada di depan matanya, dan bisa meyadarkan orang-orang banyak untuk hidup di jalan yang benar. That's right, plain old stereotype from comic book of righteous hero.

Padahal kalau dipetakan ke realitas, gw sendiri yakin, bahwa pahlawan2 di buku komik itu tidak bisa 100% bertindak seperti yang mereka lakukan. Too many coincidence, people dies and live is always a bitch. But still... it must be wonderful to live like that. Every morning woke up feeling fresh and happy, living side-by-side with what you truly believe, and every day is pretty good day to die.

Tapi itu semua sepertinya berat untuk bisa hidup di jaman ini. Kita sebagai masyarakat sudah terlalu diperbudak dengan sistem. Kalau tidak mempunya cicilan rumah dan mobil untuk 15 tahun ke depan, tidak bisa hidup layak. Kalau tidak punya asuransi, tidak bisa melahirkan anak. Dan sakit berkepanjangan hanya akan menyeret orang-orang yang kita tinggalkan dengan hutang segunung yang harus dibayarkan ke pihak rumah sakit. And because of that we always live in fear. Bangun setiap pagi memikirkan 10 tahun kedepan,tidak pernah menikmati hari ini, membayangkan apakah kestabilan yang kita miliki ini akan tetap ada ?

Hutang yang membebani kita membuat kita tumpul untuk perduli terhadap sekitar kita. Sisi kemanusiaan semakin terkikis. Bayangkan betapa murahnya harga nyawa seorang manusia di jaman ini. Dengan uang asuransi 100 juta, seakan-akan semua kesedihan keluarga bisa ditebus lunas. 25 tahun pengorbanan membesarkan seorang anak terhapus dengan seuntai kata maaf seremonial tanpa niat yang sudah di ulang sebanyak 100.000 kali.

Bagaimana 1000 nyawa adalah harga yang layak untuk menyelamatkan 1.000.000 orang. Bagaimana nyawa 100 prajurit, 100 suami, 100 ayah adalah harga yang telah disiapkan demi nyawa Satu orang presiden. Kalau kita dilahirkan secara fitrah dan sejajar. Siapakah yang kemudian memberikan nilai jiwa-jiwa manusia ini. Dan siapakah yang melakukan diskon besar-besaran, sale of this century ? Siapakah sebetulnya yang paling mengerti berapa besar harga nyawa seseorang itu, kecuali dirinya sendiri dan mungkin orang tuanya ?

Dan mengapa begitu mudah kita memaafkan pembunuhan atas nama kecelakaan dan kemajuan teknologi. Ketika hukuman diterima hanyalah 3 bulan bermain sinetron dimata publik. Untuk mengulangi kesalahan yang sama 6 bulan kemudian tanpa ada beban moral sedikit pun.

Apakah kita sudah begitu tumpul, hidup bagaikan mayat hidup. Mengikuti perkembangan zaman yang telah ditentukan oleh orang-orang yang tidak mengerti arti mendasar menjadi manusia. Untuk berkata sakit jika kita sakit, untuk berteriak tolong saat kita membutuhkan pertolongan, dan untuk mengulurkan tangan disaat orang lain membutuhkan pertolongan.

So tell me, how to make our selves to wake up from this fake reality.

PS: ada satu frase yang baru gw dengar tapi i fall in love with it immediately
"Kebenaran kadang-kadang tidak terlihat karena tertutup bayangan 'akal sehat'. 'Jangan menyerah', meskipun kata itu sederhana. Pada akhirnya hanya itu yang bisa kita pegang.


~FD

Wednesday, January 20, 2010

Money, between ends and means

Kalau ada yang bilang 'gw cari kantor lain dengan gaji yang lebih besar dong', dari sini sudah terlihat indikasi, bahwa bagi dia money menjadi ends. Tujuan utamanya adalah pendapatan yang lebih besar. Faktor-faktor lain seperti environment, work pressure, personal time, it all comes secondary.

Gak salah sih, bisa jadi orang yang berpikiran seperti ini belum tentu karena mata duitan. Tetapi bisa saja karena dia sudah memiliki skill set yang spesifik, tidak banyak alternatif untuk mengembangkan diri, makanya salah satu cara paling tepat untuk memotivasi diri, adalah dengan hal ini.

Tetapi untuk saat ini gw sedang mencoba menggeser perpektif gw terhadap hal ini. Bagaimana agar money menjadi 'sekedar' means untuk hal-hal yang gw lakukan. Apakah itu berarti gw sebelumnya mata duitan ? Gak juga sih, lebih tepatnya adalah ketakutan akan kehilangan pendapatan tetap perbulan. Yang jumlahnya di atas rata-rata itu. And I dont think i can make that kind of money anymore.

Tapi kembali lagi, kalau money sudah menjadi means, jumlahnya sudah tidak terlalu penting lagi. Asal cukup untuk mendanai hal-hal yang ingin lu lakukan, bisa hidup dengan layak, itu sudah lebih dari cukup. Tidak perduli dia turun naik, tidak selalu tiap bulan didapat, atau bahkan tidak sebesar pendapatan sebelumnya. Tapi untuk dapat melakukan hal itu dibutuhkan beberapa hal. Ketabahan yang tinggi dan faith yang bisa membuat tetap bersabar dan percaya bahwa rejeki itu bisa datang dari mana saja.

Tapi satu hal yang pasti gw tahu. Kalau menjadikan money sebagai ends. Hidup gw tidak akan pernah bahagia selamanya :D

~FD

Collectibles

Kalau ingat 3 tahun lalu, waktu masih bekerja di perusahaan ke dua. Setelah menabung 3 tahun akhirnya mampu beli motor sendiri. Supra-X 125 R :D cash, gak pake kredit-kreditan. Di perusahaan berikutnya dapat parka merah, gak beli sendiri sih. Tapi bisa jadi itu adalah barang paling berharga yang gw punya :P Lalu di company ini, udah dapet PX-100, Kompie baru, si Zotac, sama Hero :D

hm.. dengan adanya barang-barang itu, setidaknya bisa mengingat tangis, darah, dan air mata yang gw cucurkan saat bekerja di tempat-tempat itu. Dan mengingatkan bahwa waktu gw selama ini membawa hasil. Walaupun hasil yang paling besar adalah perubahan dalam diri gw sendiri :D

Saturday, January 16, 2010

Javascript in Tapestry5

Okay, lets start from the beginning.

This is the basic thing that i need to know :
1. how to transfer data between tapestry class and my javascript library
a. from javascript to tapestry page class
b. from page class to javascritp

2. How to invoke
a. javascript from tapestry class
b. tapestry class from javascript.

well so far the answers is :
1a. The easiest way was to create a hidden variable that could be accessed from the class.
1b. Is by returning a JSON object that being invoked by javascript. Something more or less like this,

public JSONArray getArea() {
System.out.println("=== Getting area in javascript ");

List areaMarkers = areaEngine.getAllAreaMarkers();
return jsonProcessor.marshal(areaMarkers);

}


Well for the other two is blank for me :(, I'll update this if i have the answer.

~FD

Wednesday, January 13, 2010

The future journey

this was post around 5 months ago. From that time I've overcome many other panic attack. Live was like a roller coaster. Ups and downs and more in the down side of things. Well I've survived, but its not pretty. And along the way, although you've got accustomed with this things, but slowly but sure this things are taking a toll on me.

I'm not stupid to jump to a decision only based on emotion and short term reaction. Actually I'm a very calculated and often over thinking my decision, scenario A, B, C, D and the backup :P

So that is why after five month of coming to the same conclusion, i finally take it another step. I've informed my team that i was thinking of quitting between April and August. Its not final yet, but with the current condition, I'm hoping that I have the courage to make it into reality.

The truth is I'm scared shitles to the bone. I don't know how to make money after i quit. Yes i have plan A through D, but none of it involved a safe and secure way to make a living. Hell i don't even know if anyone would buy my services or product because my QA skill sucks. And I'm too introvert to have a good network.

But i want to live my life the way i want it. Not living someone else dream. Or following the dogma of others. I want to be happy with who I am, making my existence have an impact to this world. Not merely passing live day by day, and at some point seeing the old days and wondered, where all of my time has gone ?

For all the suffering I've been through, after all the walls that I've taken down. I think i deserves and finally bought one of two years of my live to became who i really am, the true me. Creating things i want to create, exploring things i want to explore, and making sure that i have all of the time i want. I would still be the part of my family, society and the world. But at least now I'm free to the things I want and whenever i wanted to.

So now I pray that 3-6 month from now, I still have the same Courage and Bravery to take my first step to the dangerous road, the open water, the wild world. Fueled with believe and faith and surround by calmness and open mind. And somehow i manage a small smile in the process of writing this. I'm getting excited of the limitless possibility. Maybe, it would be a wonderful journey after all... :)

~FD

Why do they hate them so much ?

I've just watched Fringe latest episode, season 2 episode 11. What strike me is that why do religion is keep being pushes around ? Most tv series would picture that a priest would only hinder the main actor investigation, using dogma like some one that is not touch with progress and reality. Although in the end the actor would reveal that s/he also have to rely on faith sometimes. But i think that just bullshit! Something to soothe the message, to make sure that no riot will come out from the episode. The message was clear, you need to rely on your self first. After the result has been achieved, then you can make this lip service about philosophical thing. Wall in truth, inside you're the same cocky human as ever.

Well the media is a powerful propaganda tools. The message that has been pass to your subconsciousness, although subtle it will sink to the bottom of your mind. Especially with the new generation. No wonder this generation is close with frustrated, suicidal and criminal term. When you've been teach all of your life, that no help would come to you from the outside. That help would come in many different ways. Believe is a very important thing, and not believing another human being 100%, especially the elites, its also important thing.

This problem can be seen from many perspective. There's a lot of conspiracy theories that revolves around world domination, how to blur the edges between religion, how to mix certain religion to create a new one that would comply with the New World Order. Well i don't want to jump to the same pool. For me religion is very important, like i said before, human needs help from the outside. If we only think that all of the things is only happened because of us, because of our great talent, because of our extreme effort only. Then it would only bring a huge pressure to our fragile conscious mind. And because of that, to save the religion that i depends on so much, i rather turn inside instead of outside.

Yes, the portrait is mostly about western religion. Priest, church, etc. But if you turn the camera around to Islam, you will get the same picture. For this 500 years how much do our religion progress ? what new finding has come ? or do we do and understand the same thing as people five hundred years ago about our ritual ? or even less ?

These things, the thing that we need to know so much. These things that make us close and befriend with our souls is so hard to acquire. Over shadowed with scientific experiment and pop culture. Its like a different world, an exlusive worlds that we, the common people, the one that work, not the one that give our 100% lives to religion, has no access to. And even when we finally do, it feels so distant with the daily reality we face.

I want to bring this information to the public. I want them to have an easy access to it, and have an easy way to understand it, without prior has to understand 5 kitab, before finally getting to the point that they want to understand. I want the evolution in our 1500 year history in religion can be seen by mere people. I want the two world to be merge back to one. And i bet the way people think in the movies doesn't cover 30% of what the people of the whole earth really felt about their religion.

And what about how we spread our prophet words ? Do in the past 500 years changed much ? To be honest i hate it, i hate the way it being spread. I hate the way it being pushed into my mind, "just accept it, because its all been this way since it been taught". It feels like dogma, and we're the sentinel that cannot think freely. If science, culture and even the earth moves in 500 years, then why do religion is the only thing that stay and choose to be left behind ?

And also it gives the one that teaches it a structural divinity. Because they learn it full time, because they know it before we do, that what ever comes out from their mind is right. Weather its actually the teaching or just a product of their own mind separated from the teaching. The mind that is not critical, and cling to the power and position too much, cannot be trusted !

And that is why religion for me is like a journey, we can start from a different entry point. We can choose a different path, but as long as we have the same guidance we will always heading to the same direction.

And that is why, i enjoy the people that teaches religion without inserting words into our mouth. Or saying you can't do this, you can't do that. Blasphemy, ignorant, future tenant of hell saying things that no impact to the humans that has separated between soul and the logical being. I like the people that guide us in our journey. Teaches what is forbidden and whats not, why is that and guide us to the right action and allow us to make the mistake that will be the base to our stronger faith. And also the people that know and do what the common people do, so we doesn't feel like living in two worlds. Because in the end we are only a mere puny humans. Who without making peace and embrace our religion, would only get more frustrated and maybe someday wiped out from this earth and replace by another species. In order to survice, we must not let go of our faith !

~FD

Thursday, January 7, 2010

Sakaw

Okay, I'm frustrated.

Yeah, hampir pasti penyulutnya pekerjaan kantor. Ingin fokus, mencurahkan perhatian ke satu hal. Selalu aja ada something yang urgent mengganggu. Ter-'distract' akhirnya konsentrasi terpecah. Mencoba mengakomodasi kedua hal, you know because I'm professional. Akhirnya malah jadi stress, depresi dan kedua project jadi mandeg. Jalan kayak siput, yang ada malah marah-marah disini dan tidak perduli dengan antusiasme di awal project. Singkat kata, "Whatever !!!".

Otak gw terkadang terlalu kreatif dalam berpikir. Sangking banyaknya akhirnya tidak ada satu pun ide yang keluar, yang bisa dibilang finish. Terkadang begitu mendamba, mempunyai waktu tak terbatas untuk mengejar ide-ide. Menelorkan satu produk ke produk lain. And i mean my brain product, making what comes to mind into realization.

Tetapi harus realistis juga, ide-ide yang keluar dari otak gw gak berorientasi money, mungkin someday bisa. Tapi itu artinya hidup mengejar kebahagian tanpa memiliki uang. Berani gak yah :P

~FD

Sunday, January 3, 2010

The collapse of a Society

I was watching Jared Diamond 2003 presentation of the collapse of a society. There is two glimpse of thing that divert my attention from the presentation. First when he mention some of the society that last thousand of years and didn't collapse he mention java. And then when he sample the society that going to collapse he mention Indonesia.

And another thing, he mention that if an elite decisions often benefits them selves in the short term and the group in the long term. Especially when they able to shelter them selves from the effect. That is definitely one of the big factor that contribute to the Collapse of A Society. I've seen that symptoms too many times in my country but didn't know how counter it.

Oh well, people get what they deserves.

Firefox FLV Cache

There are some tools for storing streaming video from youtube or other site like keepvid.com or flv plugins for firefox. But usually just use the manual way. I go to the firefox cache directory, see the latest and usually the largest file size. Copy it to other directory and give it an .flv extensions.

One thing that i don't understand, when I watch a rather long videos, usually the file in the cache would only store 25,584 KB of the file. This numbers is the same no matter what long video I cache. And what rather interest me is, when i see the video in my browser. It still replay able to its full length.

Today i Google some info, and i think i found the answer. First you can type about:cache in your firefox address bar. There you can see the Disk Cache Device information. It can show you how many entries in your cache, Maximum Storage Size, Storage in use, and a link to the cache directory.

Well one thing that i realize is, the size of 25,548. Is the size of half of the default Maximum Storage Size in firefox, which is 50 MB. So i tried to increase the Maximum Storage Size to 200 MB and refresh the video I'm watching, and finally able to get the full size video, which in my experiment is 29,418 KB.

I think firefox is limiting the size of a cache file into half of the maximum Disk Space. This because its almost imposible for a cache directory to only contains a single file. Almost all the time the directory will contains more than one file.

But that doesn't answer why i could re-play the full file in my browser ?

My guess is, it is stored in the memory. To prove it i try watch the firefox memory usage in windows task manager. And close the tab and reopen it again. The memory usage drop significantly, but not quite the same as the full size of the file. But i'm guessing that my hunch is correct.

Seeing the dot

I never like apple for their Propietary View of things. But i enjoy some of their product as the finest like iPod and iTunes, never like mac though.

well this speech is clearly in mind with all of my though so far. Now, finding the courage and the necessary way is all i hope to do.

What Does your Day meant to you ?

For me, mostly its about work. What i neglect yesterday, what i need to prepare for next week project activities. Learn-learn-learn about our product, etc. While weekend was fill with lazying up at my room, and maybe some activities that would keep me from getting kicked out from this human society.

That is why i enjoy long weekend. Since taking holiday need me to prepare who in charge for me at work. Or the deadline is to short for you to take holiday reasons. In this 3 long weekend i manage to do the things that my brain wants. It do everything that it wants. Learn new things without focus, the adrenaline thrill that it needs. Waking up till morning, etc. No matter how unproductive and lazy that sounds. Somehow i fill enrich. And each days means something, i feel like I'm growing limitless to my potential.

I wish all of my day would feel like this. Not knowing of what i would learn, or what I'm going to achieve that day. Instead of in the frame of work like ogre from 8-5. Hopefully that day will come soon, somewhere in this year :D

~FD