JavaScript is disabled or you're using old browser, please turn on your JavaScript or upgrade your browser to see fancy looking.
Archive for the ‘coding’ Category

  Older Entries 

Design Pattern Dalam PHP (Bagian I)

Design Pattern? Mungkin bagi yang pernah mendengarnya tentu familiar dengan bukunya Gang of Four “Design Patterns: Elements of Reusable Object-Oriented Software”. Lalu apa itu design pattern? Konsep sederhana dibalik design pattern adalah solusi untuk masalah umum yang didokumentasikan oleh seorang yang berpengalaman dalam pengembangan aplikasi. Umumnya masalah yang ada sering ditemui dalam beberapa proses pengembangan sehingga dinamai pola (pattern). Sedangkan desain yang digunakan untuk mengatasi pola masalah tersebut umumnya digunakan agar kode menjadi less-coupled (tidak terlalu mempengaruhi kode lainnya jika ada perubahan ke depannya), mudah dimantain, portabel, mudah dibaca, dapat diterapkan dalam tim yang dinamis dan untuk skala proyek yang kompleks. Design Pattern dapat digunakan dalam bahasa pemrograman apa saja, khususnya bahasa pemrograman yang OOP, tak terkecuali PHP. Ada banyak design pattern, saya akan bahas empat design pattern (Singleton, Registry, Adapter dan Observer) terlebih dahulu dan akan saya lanjutkan pattern lainnya di tulisan lainnya.
Read the rest of this entry »

Quick Tips to Help You get Accepted on Google Summer of Code

I’ve great news that, AFAIK, there are two students from Indonesia that have been accepted on Google Summer of Code 2010. They are (drum roll please) Akeda and Dwi. I’ve been posted a message on gsoc student mailing list to alert other Indonesian students, but no one replying. So, I guess there’s only me and dwi get accepted this year. Since, I’ve accepeted I’ll give my own tips on how to get accepted as a student of Google Summer of Code. The key is write a good proposal and communicate with your mentoring project oftenly. A good proposal is not your first try proposal. When you writing your proposal for the first time oftenly it’s just a draft proposal. You need to ask your mentoring project some feedbacks and iterate the process by rewrite and ask again until the mentoring project says okay. This year is a little bit different, some mentoring organisations posts some bugs tagged for applicants and each applicant should work, on bug(s) by submitting patch for that bug. I did this. Doing this means your chance to get attentions from mentoring organisation is higher. So, you need to touch the codebase of the project which you have interest on it. Because of this you shouldn’t have to submit a proposal as much as you think to get accepted. The increased quantity of your proposals may even decreased overall proposal qualities, since you have to split your focus.

Okay, you’ve got the picture? Alright, how about the content of good proposal? Some mentoring organisations were kind enough to give us templates of proposal to work on. The templates are general as it should have a brief description about the project you have interested in, implementation plans, timeline and short biography about yourself. You should focus (IMHO) on writing your implementation plans and timeline. A google summer of code project is around 3 or 4 months duration, so it can be said as a medium project for a single developer. The key is how good you describe the problem and its solution. When you touched the codebase of a project for submitting patch, you get the benefits on how you’ll describe the software on your proposal. Use the name of the classes, methods, libraries that related to your project and how you’ll using it to solve the problem. Mentoring organisations will pick up student that already familiar with their codebase. Don’t write too much, use screenshots if available. If your project is a complex one, divide your project into three or four subprojects then define the timeline of each subprojects. Well, that’s my own quick tips. I hope Indonesian students will aware about this event on the next year :) .

Sebelum Menggunakan Email Component CakePHP

Yang umum dalam halaman pendaftaran adalah selesai mendaftar akan ada konfirmasi telah mendaftar. Halaman konfirmasi tersebut bisa saja dengan halaman web atau dikirim ke email pendaftar. Kebetulan saya sedang mengerjakan hal serupa dimana konfirmasi juga dikirimkan ke email pendaftar. Saya menggunakan CakePHP untuk mengembangkan aplikasi, dimana telah tersedia komponen Email untuk memudahkan pekerjaan seperti ini. Penjelasan di cookbook CakePHP, bagian Email Component itu sudah cukup jelas dan sudah saya coba. Tapi jika Anda mengalami kendala tidak terkirimnya Email, mungkin saja sistem operasi Anda belum terinstall MTA (Mail Transfer Agent). Anda bisa gunakan sendmail. Instalasi MTA dan asosiasinya dengan DNS Server-nya tidak akan saya jelaskan disini, saya sendiripun belum pernah mencoba :D . Untuk coba-coba saat pengembangan, Anda bisa menggunakan MTA sendmail. Saya menggunakan Ubuntu, untuk menginstall-nya gunakan perintah ini:

sudo apt-get install sendmail mailutils

Untuk mencoba mengirim email bisa gunakan utiliti mail :

mail -s "Test" me@example.net < /var/log/email.info

Ini akan mengirim email ke me@example.net dengan subject Test dan isi pesannya adalah isi dari berkas /var/log/email.info. Kebetulan server development di tempat saya MTA-nya sudah terasosiasi dengan DNS Server-nya jadi saya bisa menerima email tersebut ke inbox gmail saya, tanpa masuk ke spam, from-nya otomatis terisi oleh nama_user_di_server_development@nama_domain. Jika belum terasosiasi dengan DNS-Server-nya akan nyangkut di spam. Jika sudah terinstall MTA dan bisa terkirim emailnya ke tujuan, saatnya mencobanya dengan CakePHP. Good luck!

svn:ignore yang menjengkelkan

Saat melihat blog Pak Budi Rahardjo saya jadi terpacu untuk menulis kembali. Konten blog tidak perlu selalu berisi hal teknis yang memerlukan waktu untuk menulisnya, tapi bisa kondisi hari ini. Yup hari ini saya dijengkelkan dengan sistem kontrol versi Subversion. Saya mulai membiasakan pekerjaan dan proyek pribadi untuk dikontrol versinya sejak saya bekerja di SIG. Yang menjengkelkan dari Subversion adalah exclude berkas yang tidak perlu di rekam versinya. Dalam Subversion digunakan perintah svn propedit svn:ignore untuk mengabaikan berkas di direktori kerja kita.

Tapi apabila kita banyak menggunakan berkas konfigurasi yang terpisah di beberapa direktori dan juga berkas temporari yang dihasilkan aplikasi, pekerjaan ini menjadi menjengkelkan. Belum lagi pengguna Subversion yang melupakan hal ini dan meng-commit berkas yang kita abaikan. Lalu kita ulang lagi svn rm dan menggunakan svn propedit svn:ignore kembali. Apakah ada solusi untuk ini ? Atau gunakan sistem kontrol versi lainnya seperti Git? Untuk Git, saya belum begitu paham. Tapi saya sudah coba gunakan github untuk skrip sederhana saya sekaligus untuk belajar. Jika saya tertarik, saya akan pindahkan proyek iseng saya ke github.

World University Names Database

I’ve been searching for university names database, but i didn’t find complete database that covers at least universities in 240 countries. I decide to crawl university names in LinkedIn and Webometric, since both give university names based on country code. If you are in hurry to get university names database, you can download them here. If you are interested to know how to crawl the LinkedIn and Webometric university names data and build the database, then hang on with me.

I used Python to crawl LinkedIn and Webometric. It was accidental, when i edit my profile on my LinkedIn, firebug shows ajax get request to populate university names on select element. So here is my python code to get LinkedIn university names based on country code:
Read the rest of this entry »

  Older Entries