Archive for November, 2008

30
Nov
08

Beginner, Intermediate, and Advanced

Beginner : Don’t know the rule yet, and then you start learning it.

Intermediate : Already know the rule, then you follow it.

Advanced : Either break the rule, or make you own rule.

25
Nov
08

Why ML always use LEAVE but not ENTER?

DISCLAIMER : this joke is not for the non-geek or the faint-hearted. You’ve been warned.

Q: In every proc, the stack frame is created by PUSH EBP and MOV EBP,ESP instead of ENTER. Why is this?

00405910  /.  55            PUSH EBP
00405911  |.  8BEC         MOV EBP,ESP
00405913  |.  56            PUSH ESI
00405914  |.  57            PUSH EDI                                ;  ntdll.7C910738
00405915  |.  5F            POP EDI                                  ;  kernel32.7C816D4F
00405916  |.  5E            POP ESI                                  ;  kernel32.7C816D4F
00405917  |.  C9            LEAVE
00405918  \.  C2 0800     RETN 8

A: The uP is female.  You always enter slowly, leave as quickly as possible.

Whatever that means … :mrgreen:

Link

24
Nov
08

The one rule

There is only one rule, and the rule is :

“There are no rules.”

EOM

19
Nov
08

Font menarik

Kutipan :

“A beautiful handwriting font of unknown origin, first popularized by E.W.Dijkstra. Excellent for slides that appear to be carefully written, and for short, deep technical notes.”

Hasil uji coba :

Whoa ! Cantik sekali !
Tertarik ? Font itu bisa diperoleh dari sini

12
Nov
08

(NS4W) One hot chick !

BEWARE: THIS POST CAN BE VEERRRYYY PORNOGRAPHIC !!!!

See ?

That’s a one hot chick !!

:mrgreen:

11
Nov
08

Yet another “Hello World” in C

Pada eksperimen berikut ini, compiler yang saya pakai adalah MS Visual C++ 2008.

Tipikal program “Hello World” di C kira-kira adalah sebagai berikut (asumsikan nama file hello.c) :

#include <stdio.h>

int main(){
    printf("Hello World");
    return 0;
}

Compile :

cl hello.c

Jadilah suatu executable berukuran 48 KB. Kalau menurut anda 48 KB masih terlalu besar, anda bisa menghindari penggunaan C runtime, dan code diatas menjadi sebagai berikut :

#include <windows.h>

void main(){
    DWORD chars;
    HANDLE stdout = GetStdHandle(STD_OUTPUT_HANDLE);
    WriteConsoleA(stdout,"Hello World",11,&chars,0);
    ExitProcess(0);
}

Compile :

cl /c hello.c
link /nodefaultlib /entry:main hello.obj kernel32.lib

Hasilnya ? Executable berukuran 2.5 KB. Yay !! Kalau ditulis ulang dengan 100% assembly, kayanya bisa lebih compact lagi. He he entahlah gimana …

Pentingkah optimasi semacam ini ? Saya pikir tidak. Harddisk bergiga-giga sudah relatif murah.

Lebih baik mengoptimasi algoritma yang digunakan untuk meningkatkan efisiensi.

Tapi kalau anda membuat sesuatu, katakanlah virus atau demoscene, optimasi ukuran diatas memang diperlukan. Dan adakalanya membuat program sekecil-kecilnya adalah guilty pleasure di kalangan programmer.

Yah, mau diapain lagi ? :mrgreen:

06
Nov
08

Cara mengcompile kernel Linux

Biar gak lupa, taro di blog ah. Sorry kalo gak up to date, soalnya saya tulisan ini saya buat tahun 2007, pas ngerjain Buku Kunyuk :mrgreen:

Beberapa tahapan dalam kompilasi kernel:

Mendownload kernel. Ada banyak situs di internet tempat mendownload kernel. Tapi ada baiknya jika anda mengunjungi situs resminya, yaitu “kernel.org”. Anda bisa melihat beraneka versi kernel dan patchnya disana.Format penamaan kernel Linux adalah linux-X.YY.ZZ.tar.gz atau linux-X.YY.ZZ.tar.bz2, dimana: X = major number; Y = minor number; ZZ = revision number. Contoh: linux-2.6.20. Angka 2 adalah major number (angka 2 ini jarang berubah dan baru berubah jika sudah terjadi perubahan besar) Angka 6 adalah minor number (karena 6 adalah bilangan genap, berarti kernel ini versi stabil) Angka 20 menunjukkan nomor revisi.

Mengekstrak kernel. Source code kernel Anda yang lama bisa dilihat di direktori /usr/src/linux. Supaya source code kernel sebelumnya tidak hilang, ekstraklah kernel yang baru di direktori yang berbeda, misal /usr/src/linux-2.6.20 (tentunya sesuaikan angka-angka tersebut dengan versi kernel yang anda pakai).

Buat symbolic link.
ln -s linux-2.6.20 linux

Konfigurasi kernel. Sebelum proses kompilasi, anda memiliki 2 pilihan, yaitu membuat konfigurasi baru, atau menggunakan konfigurasi kernel sebelumnya. Jika anda ingin membuat konfigurasi baru, maka jalankan perintah: make xconfig (atau make menuconfig). Pada tahap ini, anda mengkonfigurasi kernel sesuai dengan hardware yang ada di komputer anda. Isinya antara lain mengatur jenis prosesor, memory, networking, USB, dsb. Dengan ini, kernel bisa bekerja optimal pada hardware yang ada Setelah berkas configurasi (.config) terbentuk, anda bisa memulai proses kompilasi. Sedangkan jika anda ingin menggunakan konfigurasi kernel yang lama, anda bisa mengcopy berkas .config dari direktori kernel yang lama ke direktori kernel yang baru, lalu menjalankan perintah: make oldconfig

Kompilasi. Jalankan perintah “make bzImage”. Proses kompilasi kernel bisa memakan waktu cukup lama, dan sangat mungkin terjadi kesalahan disitu. Jika ada kesalahan, coba lakukan lagi konfigurasi kernel. Setelah itu, coba lakukan kompilasi lagi. Jika sukses, terbentuk berkas bzImage di/usr/src/linux-2.6.20/arch/i386/boot. Copy ke direktori /boot dengan perintah:
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.20

Selanjutnya, kompilasi modul. Jalankan perintah:
make modules

diikuti oleh :
make modules_install

Terbentuk berkas System.map. Copylah ke /boot dengan perintah:
cp System.map /boot/System.map-2.6.20

Supaya kernel yang baru bisa digunakan, ubahlah konfigurasi bootloader anda supaya ia mengetahui dimana kernel yang baru berada. Misal jika anda menggunakan Lilo, modifikasi berkas lilo.conf (ada di /etc), atau jika anda menggunakan grub, modifikasi berkas menu.lst (ada di /boot/grub). Khusus jika anda menggunakan lilo, jalankan perintah lilo. Setelah itu, reboot komputer anda.

Sumber asli

04
Nov
08

Procrastination

Hmm …

Discussion
Procrastination is a complex psychological behavior that affects everyone to some degree or another. With some it can be a minor problem; with others it is a source of considerable stress and anxiety. Procrastination is only remotely related to time management, (procrastinators often know exactly what they should be doing, even if they cannot do it), which is why very detailed schedules usually are no help.

Characteristics
The procrastinator is often remarkably optimistic about his ability to complete a task on a tight deadline; this is usually accompanied by expressions of reassurance that everything is under control. (Therefore, there is no need to start.) For example, he may estimate that a paper will take only five days to write; he has fifteen days; there is plenty of time; no need to start. Lulled by a false sense of security, time passes. At some point, he crosses over an imaginary starting time and suddenly realizes, “Oh no! – I am not in control! There isn’t enough time!”

Four Simple Reasons for Procrastination
1. Difficult – the task seems hard to do; we naturally tend to avoid difficult things in favor of those which seem easy to us.
2. Time-consuming – the task will take large blocks of time, and large blocks of time are unavailable until the weekend.
3. Lack of knowledge or skills – no one wants to make mistakes, so wait until you learn how before you start.
4. Fears – everyone will know how you screwed up.

Artikel lengkapnya bisa dibaca disini.

Semoga berguna untuk para procrastinator, seperti saya, yang ingin cepat sembuh dari penyakit kronis ini.

:mrgreen:

02
Nov
08

Yet Another System Monitor

Anda menggunakan GNU/Linux atau *BSD ?

Pernah menggunakan resource monitor seperti Conky atay GKrellM ?

Nah, jika anda bosan menggunakan tool diatas, ada baiknya mencoba Hot Babe :

Hot-babe is a small graphical utility which displays the system activity in a very special way. When the CPU is idle, it displays a dressed girl, and when the activity goes up, as the temperature increases, the girl begins to und****, to finish totally n***d when the system activity reaches 100%. Of course, if you can be shocked by nudity, don’t use it!

Walah ! :mrgreen:

Bisa-bisa saya kena UUAPP. Kabur ah …