Learn the Rules, Break The Rules, and Create the New Ones...

Hi... My name is Rizky Prihanto. You can call me RQ, or Rizky either. I am currently living on Bandung, Indonesia. Had a lot of works and research about Enterprise Information Systems (majoring on education and e-governments). I have bunch of interests (some friends call it 'freakz') about MySQL Opensource Database and now I am one of the administrator of MySQL Indonesia User Group - the opensource community initialized by Sun Microsystems Indonesia.

My Company PT Cinox Media Insani, Bandung, Indonesia. I work here since 2008 and I take responsibility as Chief of Software Architect. My job is about planning, imaginating, fantasy-ing, concepting, and build the infrastructure of the new information systems (or app engines) which going to be implemented.

This blog This is my blog that represent my current opinion, research and experiences about anything in Software Engineering. Written since 2007 (actually) and has been vaccum for a lot of while. And now I wanna ressurrect this blog (optimistically) from the long-long-hibernation with something fresh and new ideas -- still about MySQL, software engineering, development, and may be something managerial here.

About the tagline I've learned the statement above from some paper written by Kent Beck about Extreme Programming (XP) methodology -- some sort of practical software development methods which have no boundaries. That's very inspiring me a lot. I have written some article on this blog that tell my interpretation about that statement here.

My Another Blogs I have classifying my blogs into some sort of genre. The blog that you read here right now is my primary blog that tell you (majoring) about IT stuff. But if you wanna look another side of me, you can visit here, here, here,or here. Hope it'll be interesting for some of you.

Credits I would thanks to Blogger for this great blog platform. Skinpress who designed this Wordpress template (which is bloggerized by Free Blogger Templates). My appreciate is also going to you who give your generously time for visiting my blog.

10 Tipe Programmer

Dicomot dari blogs.techrepublic.com

Programmers enjoy a reputation for being peculiar people. In fact, even within the development community, there are certain programmer archetypes that other programmers find strange. Here are 10 types of programmers you are likely to run across. Can you think of any more?

Note: This information is also available as a PDF download.

#1: Gandalf

This programmer type looks like a short-list candidate to play Gandalf in The Lord of the Rings. He (or even she!) has a beard halfway to his knees, a goofy looking hat, and may wear a cape or a cloak in the winter. Luckily for the team, this person is just as adept at working magic as Gandalf. Unluckily for the team, they will need to endure hours of stories from Gandalf about how he or she to walk uphill both ways in the snow to drop off the punch cards at the computer room. The Gandalf type is your heaviest hitter, but you try to leave them in the rear and call them up only in times of desperation.

#2: The Martyr

In any other profession, The Martyr is simply a “workaholic.” But in the development field, The Martyr goes beyond that and into another dimension. Workaholics at least go home to shower and sleep. The Martyr takes pride in sleeping at the desk amidst empty pizza boxes. The problem is, no one ever asked The Martyr to work like this. And he or she tries to guilt-trip the rest of the team with phrases like, “Yeah, go home and enjoy dinner. I’ll finish up the next three week’s worth of code tonight.”

#3: Fanboy

Watch out for Fanboy. If he or she corners you, you’re in for a three-hour lecture about the superiority of Dragonball Z compared to Gundam Wing, or why the Playstation 3 is better than the XB 360. Fanboy’s workspace is filled with posters, action figures, and other knick-knacks related to some obsession, most likely imported from Japan. Not only are Fanboys obnoxious to deal with, they often put so much time into the obsession (both in and out of the office) that they have no clue when it comes to doing what they were hired to do.

#4: Vince Neil

This 40-something is a throwback to 1984 in all of the wrong ways. Sporting big hair, ripped stonewashed jeans, and a bandana here or there, Vince sits in the office humming Bon Jovi and Def Leppard tunes throughout the workday. This would not be so bad if “Pour Some Sugar on Me” was not so darned infectious.

Vince is generally a fun person to work with, and actually has a ton of experience, but just never grew up. But Vince becomes a hassle when he or she tries living the rock ‘n roll lifestyle to go with the hair and hi-tops. It’s fairly hard to work with someone who carries a hangover to work every day.

#5: The Ninja

The Ninja is your team’s MVP, and no one knows it. Like the legendary assassins, you do not know that The Ninja is even in the building or working, but you discover the evidence in the morning. You fire up the source control system and see that at 4 AM, The Ninja checked in code that addresses the problem you planned to spend all week working on, and you did not even know that The Ninja was aware of the project! See, while you were in Yet Another Meeting, The Ninja was working.

Ninjas are so stealthy, you might not even know their name, but you know that every project they’re on seems to go much more smoothly. Tread carefully, though. The Ninja is a lone warrior; don’t try to force him or her to work with rank and file.

#6: The Theoretician

The Theoretician knows everything there is to know about programming. He or she can spend four hours lecturing about the history of an obscure programming language or providing a proof of how the code you wrote is less than perfectly optimal and may take an extra three nanoseconds to run. The problem is, The Theoretician does not know a thing about software development. When The Theoretician writes code, it is so “elegant” that mere mortals cannot make sense of it. His or her favorite technique is recursion, and every block of code is tweaked to the max, at the expense of timelines and readability.

The Theoretician is also easily distracted. A simple task that should take an hour takes Theoreticians three months, since they decide that the existing tools are not sufficient and they must build new tools to build new libraries to build a whole new system that meets their high standards. The Theoretician can be turned into one of your best players, if you can get him or her to play within the boundaries of the project itself and stop spending time working on The Ultimate Sorting Algorithm.

#7: The Code Cowboy

The Code Cowboy is a force of nature that cannot be stopped. He or she is almost always a great programmer and can do work two or three times faster than anyone else. The problem is, at least half of that speed comes by cutting corners. The Code Cowboy feels that checking code into source control takes too long, storing configuration data outside of the code itself takes too long, communicating with anyone else takes too long… you get the idea.

The Code Cowboy’s code is a spaghetti code mess, because he or she was working so quickly that the needed refactoring never happened. Chances are, seven pages’ worth of core functionality looks like the “don’t do this” example of a programming textbook, but it magically works. The Code Cowboy definitely does not play well with others. And if you put two Code Cowboys on the same project, it is guaranteed to fail, as they trample on each other’s changes and shoot each other in the foot.

Put a Code Cowboy on a project where hitting the deadline is more important than doing it right, and the code will be done just before deadline every time. The Code Cowboy is really just a loud, boisterous version of The Ninja. While The Ninja executes with surgical precision, The Code Cowboy is a raging bull and will gore anything that gets in the way.

#8: The Paratrooper

You know those movies where a sole commando is air-dropped deep behind enemy lines and comes out with the secret battle plans? That person in a software development shop is The Paratrooper. The Paratrooper is the last resort programmer you send in to save a dying project. Paratroopers lack the patience to work on a long-term assignment, but their best asset is an uncanny ability to learn an unfamiliar codebase and work within it. Other programmers might take weeks or months to learn enough about a project to effectively work on it; The Paratrooper takes hours or days. Paratroopers might not learn enough to work on the core of the code, but the lack of ramp-up time means that they can succeed where an entire team might fail.

#9: Mediocre Man

“Good enough” is the best you will ever get from Mediocre Man. Don’t let the name fool you; there are female varieties of Mediocre Man too. And he or she always takes longer to produce worse code than anyone else on the team. “Slow and steady barely finishes the race” could describe Mediocre Man’s projects. But Mediocre Man is always just “good enough” to remain employed.

When you interview this type, they can tell you a lot about the projects they’ve been involved with but not much about their actual involvement. Filtering out the Mediocre Man type is fairly easy: Ask for actual details of the work they’ve done, and they suddenly get a case of amnesia. Let them into your organization, though, and it might take years to get rid of them.

#10: The Evangelist

No matter what kind of environment you have, The Evangelist insists that it can be improved by throwing away all of your tools and processes and replacing them with something else. The Evangelist is actually the opposite of The Theoretician. The Evangelist is outspoken, knows an awful lot about software development, but performs very little actual programming.

The Evangelist is secretly a project manager or department manager at heart but lacks the knowledge or experience to make the jump. So until The Evangelist is able to get into a purely managerial role, everyone else needs to put up with his or her attempts to revolutionize the workplace.


kira2 aku termasuk tipe yang mana yak?


Beberapa hari yang lalu, teman sekampungku di Samarinda (1smail) nanya via YM : "Q koq aku ngga bs ngecek field yg case-sensitive ya? semuanya dianggap insensitive". Hmm, dia pake MySQL. Frontend yg dia pake adalah PHP. Dia udah ngasi aku script dia. 'SELECT * FROM TAnggota WHERE Username = $username;' ~> efeknya, apapun isi variabel $username, komparasi stringnya tetep dianggap case-insensitive..

Kucoba di console-ku.

SELECT 'User' = 'uSeR';

hasilnya 0 (alias false)...

wah, udah case-sensitive koq. Trus kulaporin ke dia. "MySQL case-sensitive koq.. kmu nya aja yg keliru paling." *hehehe, tuduhan tak berdasar*... tp 1smail tetep bersikukuh klo dia nyoba di field dia bakal diperlakukan case-insensitive.

Trus aku coba2 buka MySQL manual.. ketemu tulisan kya gini :

Normally, if any expression in a string comparison is case sensitive, the comparison is performed in case-sensitive fashion.

*bingung aku. MySQL bilang, dia case-sensitive. Aku coba, case-sensitive. Koq 1smail coba, case-insensitive yak?

trus aku search2 lagi MySQL manual... ketemu lagi tulisan kya gini :

By default, MySQL searches are not case sensitive (although there are some character sets that are never case insensitive, such as czech). This means that if you search with col_name LIKE 'a%', you get all column values that start with A or a. If you want to make this search case sensitive, make sure that one of the operands has a case sensitive or binary collation. For example, if you are comparing a column and a string that both have the latin1 character set, you can use the COLLATE operator to cause either operand to have the latin1_general_cs or latin1_bin collation.

OALAAAAHH, ngono tho... masalah collation ternyata. (Aku lumayan berpengalaman utk masalah CHARSET n COLLATION ini, mengingat beberapa minggu yang lalu aku cukup disibukin ttg gimana caranya masukin query utk field dgn value berupa tulisan arab. heheHe..., tuntutan profesi...)

Trus, kusuru 1smail checking struktur tabelnya TAnggota dia. Cek, column `username` nya apa charset n collationnya. Ternyata, charset = latin1 dan collation = latin1_swedish_ci

Itu dia masalahnya gas..

latin1_swedish_ci ~> ci di sini refer to 'case-insensitive'. Jelas, column username akan diperlakukan insensitive pada string comparison. Ta' suruh ganti collationnya jadi latin1_general_cs. Trus coba lagi.


*Tp muncul 1 pertanyaan, kenapa di engine MySQL ku ngga perlu nyetting collation bisa?

Ternyata, pendekatan yg di-ijinkan MySQL utk nentuin collation ada beberapa cara :
1. cara CASTING. on-the-fly. dilakukan ketika melakukan query. contoh :

SELECT * FROM Table_Name WHERE col_name COLLATE latin1_general_cs LIKE 'a%'

2. definisiin pas pembuatan DDL. pas CREATE TABLE. contoh :

col_name CHARACTER SET latin1 COLLATE latin1_general_cs

3. tambahin parameter pas run service MySQL:

4. setting di my.ini (ato my.cnf)

cara no 3 & 4 akan mbikin settingan default MySQL pas create table baru akan nge-apply collation-nya column otomatis akan jadi latin1_general_cs.

dan ternyata pas ta' check-n-recheck, ternyata dulu aku nyetting my.ini ku dgn system variable seperti itu. makanya MySQL Engine ku secara default melakukan string comparison nerapin mode sensitif.. Hehehe, maklum, dah lama ngga ngobok2 settingan server. Aku klo bolak-balik reinstall MySQL (karna bolak-balik reinstall OS?) tinggal copy-in my.ini ku ke directory tertentu n aktivasi server ku pake command-prompt

E:\MySQL\bin>mysqld-nt --install MySQL --defaults-file="E:\MySQL\my-shiepp.ini"

semua database-ku, login account ku, n settingan ku, akan kembali seperti sedia kala...

Begitulah, MySQL. menarik emang.. apalagi liat nasionalisme mereka yg nyetting default collation pake latin1_swedish_ci. Swedia, their homeland... Salute utk MySQL. berhasil mengibarkan panji-panji Viking Kuning di dunia internasional...

Merah putih kapan ya?



if isRunningDariVB = true...

Kadang pas lagi ndevelop code, kita suka masang2 msgbox di control2 seperti label, image, ato object2 lain utk melakukan pengecekan code. Yah, misalnya utk ngecek lebar form kah, ato ngecek lebar kolom listview kah, ato ngecek hal2 lain yg ngga bisa dilakukan tanpa meng-compile (ato pake immediate window).. Kegiatan model gini umum disebut "meng-capture nilai property control pas runtime" (ini istilah yg aku buat sendiri sih, ngga resmi n ngga ilmiah xixixi). Fungsinya cuman utk menunjang konstruksi aplikasi aja, bukan utk ditujukan ke interaksi end-user...

Nah, kadang pas aplikasi udah kelar, kita lupa ngapus tu msg-msgbox. Akhirnya, pas ada user yg ngga sengaja nge-klik control yg tadinya kita pasang msgbox itu ~ bisa-bisa nongol deh tu msgbox. Huh..., malu-maluin aja...

Sebenarnya, teknik meng-capture property control pake msgbox itu ngga terlalu bagus utk dibiasakan... Kita bisa manfaatin immediate window sbg output. Misal biasanya kita menuliskan code begini

MsgBox "FChild.Width = " & FChild.width & vbNewLine & "FChild.Height = " & FChild.Height

bisa kita ganti jadi :

debug.print "FChild.Width = " & FChild.width & vbNewLine & "FChild.Height = " & FChild.Height

fungsinya sama!

cuma, klo pake debug.print - informasi width/height yg kita inginkan itu munculnya di immediate window. Immediate Window? Makanan jenis apa itu?? Coba tekan Ctrl-G. Ntar muncul tuh form nya.


ada kalanya ngga keren jg make debug.print. Nggak eye-catching. Lagian, pasti njengkelin klo di event-event sebelumnya kita jg munculin debug.print, bakal penuh tu immediate window n mo nyari nilai property control pas runtime akan makin menjengkelkan. ribet.

... kembali ke metode msgbox ? ...

(ntar jangan lupa di-bersihin code nya ya klo dah mo mbikin EXE)

... wah form ku ratusan, Q. kadang aku butuh delivery EXE scr cepat ke client utk demo-in progress ku... gimana ya. ngga ada waktu utk ngebersihin code ku. kmu ada teknik lain?...


(tapi, sebelumnya, janji dulu... pas aplikasimu bener2 mau kmu launching ~ bukan sekedar prototyping or demoin progress thox ~ kmu tetep harus ngebersihin code mu dari sampah2 code.)

... iya deh, aku janji...


coba bikin function ini :

Public Function IsRunningDariVB() As Boolean
On Error GoTo Hell
Debug.Print 1 / 0
IsRunningDariVB = False
Exit Function

IsRunningDariVB = True
End Function

trus, utk contoh cara pemakaiannya :

Private Sub Label1_click()
if isRunningDariVB = true then
msgbox "FChild.Width = " & FChild.width & vbNewLine & "FChild.Height = " & FChild.Height
end if
End Sub

udah, beres. Klo u ngeklik Label1 pas ngompile biasa dari VB, akan muncul msgboxnya. Tapi, pas u udah bikin EXE trus u coba jalanin tu EXE n coba ngeklik Label1 ~ ngga bakal muncul messagebox apa-apa..


keren kan?

Abang Qvezst emang tidak diragukan lagi ke-cakep-an face nya.... xixixi



PS : Ingat janjimu utk ngebersihin code pas u bener-bener siap nge-deploy aplikasi mu. Awas klo nggak!

Maksain Resolusi Monitor

Sodara-sodara, sekali lagi diobral.. seri "PEMAKSAAN SETTING" yang lain, sekali lagi, dari Abang Qvezst Al-Cakepnye Naujubille... Yak, dipili-dipili... Baca satu blog dapat tiga. Tinggal dipili... mo maksain regional setting, mo maksain settingan date/time. Dipili-dipili, barang baru-barang baru. Masih hangat. Maksain resolusi-maksain resolusi... Ayo dipili-dipili...


Suka nge-game? Pasti pernah tau kan option untuk mode FULLSCREEN, ato milih resolusi sesuai dengan kekuatan VGA? Dulu, maen NFS Underground dengan NVidia GeForce4 MX lebih 'ringan' klo nge-apply resolusi kecil (800x600) ketimbang 1024x768. Suka main Counter-Strike? Presisi crosshair jauh lebih asik klo maen di mode 640x480 ketimbang di resolusi besar yang malah bikin kecil ukuran kursor.. Alhasil, mbidik kepala teroris jadil lebih akurat, tajam, dan terpercaya...

Lha, gimana kita niru tu ide supaya aplikasi dari VB yg kita buat bisa juga ngganti resolusi sesuai yang kita mau?

*sebentar2, sebelum dilanjut ~ apa manfaatnya ngganti2 resolusi? Buat aplikasi database, maksain resolusi utk apa? ~

Hmm..., ngga buat apa2 sih. Iseng aja. Yaa, supaya lebih ber-estetika aja lah... Mgkn ente bikin aplikasi di kompie 1024x768. Ukuran form utama nya juga 1024x768. Ente udah ngedesain control2nya n segalanya supaya "FIT TO SCREEN". Eh, tiba2 pas di-deploy, resolusi monitor d kompie client kondisinya beragam. Ada yang masang 800x600, ada yg masang 1125x864, ada yg lebih tinggi, ada yg lebih kecil... Hancur deh settingan ente... Mau gitu ente?

Alasan lain, ya bisa aja ente nambah fasilitas pilihan resolusi di option menu aplikasi ente. Buat keren-kerenan, mungkin? heHe... Ato ente emang lagi pengen bikin game (entah game biasa ato software pembelajaran), bukan aplikasi database...

Oke deh, ngga terlalu penting alasan (yang terkesan dibuat-buat) kenapa diperlukan pemaksaan resolusi monitor. Klo u suka, pakailah. Klo ngga butuh, ya abaikanlah. Gitu aja koq repot?

Yawda..., simak aja deh modul berikut :

Option Explicit

Private Declare Function EnumDisplaySettings Lib "user32" _
Alias "EnumDisplaySettingsA" (ByVal lpszDeviceName As Long, _
ByVal iModeNum As Long, _
lpDevMode As Any) As Boolean
Private Declare Function ChangeDisplaySettings Lib "user32" _
Alias "ChangeDisplaySettingsA" (lpDevMode As Any, _
ByVal dwFlags As Long) As Long
Private Declare Function ExitWindowsEx Lib "user32" _
(ByVal uFlags As Long, ByVal dwReserved As Long) As Long

Private Const
Private Const CCFORMNAME = 32
Private Const DM_BITSPERPEL = &H40000
Private Const DM_PELSWIDTH = &H80000
Private Const DM_PELSHEIGHT = &H100000
Private Const CDS_TEST = &H4

Private Type DEVMODE
dmDeviceName As String * CCDEVICENAME
dmSpecVersion As Integer
dmDriverVersion As Integer
dmSize As Integer
dmDriverExtra As Integer
dmFields As Long
dmOrientation As Integer
dmPaperSize As Integer
dmPaperLength As Integer
dmPaperWidth As Integer
dmScale As Integer
dmCopies As Integer
dmDefaultSource As Integer
dmPrintQuality As Integer
dmColor As Integer
dmDuplex As Integer
dmYResolution As Integer
dmTTOption As Integer
dmCollate As Integer
dmFormName As String * CCFORMNAME
dmUnusedPadding As Integer
dmBitsPerPel As Integer
dmPelsWidth As Long
dmPelsHeight As Long
dmDisplayFlags As Long
dmDisplayFrequency As Long
End Type


Public Type
ScreenX As Long
ScreenY As Long
End Type

TResolusiAsli As TUkuranResolusi

Public Sub GetCurrentResolution()
TResolusiAsli.ScreenX = Screen.Width \ Screen.TwipsPerPixelX
TResolusiAsli.ScreenY = Screen.Height \ Screen.TwipsPerPixelY
End Sub

Public Function UbahResolusi(ByVal ScreenX As Long, ByVal ScreenY As Long, _
Optional ByVal KedalamanWarna As Integer = 32) As Boolean
Dim erg As Long
erg& = EnumDisplaySettings(0&, 0&, DevM)
DevM.dmPelsWidth = ScreenX
DevM.dmPelsHeight = ScreenY
DevM.dmBitsPerPel = KedalamanWarna
'test perubahan dulu... support ngga monitor nya makae resolusi yg mo diset...
erg& = ChangeDisplaySettings(DevM, CDS_TEST)
erg& = ChangeDisplaySettings(DevM, CDS_UPDATEREGISTRY)
UbahResolusi = True
'klo ngga support, ya nggak jadi perubahan.
MsgBox "Oops..., monitor anda nggak support dengan resolusi " & _
ScreenX & "x" & ScreenY & "", vbOKOnly + vbSystemModal, "Error"
UbahResolusi = False
End If
End Function

Cara kerjanya begini :
Pas aplikasi mu baru jalan, simpan dulu
settingan resolusi awal komputermu. Caranya dengan manggil procedure GetCurrentResolution() di dalam Sub Main(). Informasi resolusi awal itu akan disimpan di variabel global TResolusiAsli.ScreenX dan TResolusiAsli.ScreenY

Public Sub Main()
End Sub

Setelah itu, ubahlah resolusi sesuai dengan resolusi yg kita inginkan dengan manggil function UbahResolusi() dengan parameter ukuran width, ukuran height, dan parameter optional berupa kedalaman warna. Tu function akan menghasilkan nilai balik berupa TRUE, kalo penggantian resolusi baru sukses, or FALSE klo penggantian resolusi baru gagal..

Public Sub Main()
if UbahResolusi(800, 600) = false then end
End Sub

That's it... dalam sekejap resolusi monitor mu akan berubah ke settingan resolusi yang kmu inginkan.. (klo di contoh, dia akan nge-switch ke resolusi 800x600).

Trus, sebagaimana 'pemaksaan-pemaksaan setting' lainnya, mustinya ada donk cara supaya 'menghentikan pemaksaan' tersebut. Kembalikan ke normal...

IYAP! BetuLL sekali! Itulah fungsinya GetCurrentResolution() tadi. Klo aplikasi udah diakhiri, ya silakan kembalikan resolusi ke settingan awal pake function yang sama. Tapi parameter inputnya diambil dari nilai variabel global
TResolusiAsli.ScreenX dan TResolusiAsli.ScreenY .

Private Sub FUtama_Unload(Cancel As Integer)
Call UbahResolusi(TResolusiAsli.ScreenX, TResolusiAsli.ScreenY)
End Sub

Dan, kembalilah settingan resolusi monitor mu seperti sediakala...

Bagaimana-bagaimana? Cool, kan?

Emang, Abang Qvezst bener-bener cakep bangedd deh ach... Shiepp deh pokoke. Hehehe...

Met mencoba. (n jangan takut monitormu rusak. udah ada handlernya koq di API Calls-nya.. tu function udah di-testing bolak balik koq.. *selama kucik-kucik dalam 'the making of' module ini sempet juga sih makan korban 1 unit monitor tua bosok yang emang udah terlalu uzur untuk nge-apply resolusi 1280x1024. hihihi...)

Salam dari Malang, ...eh, Ponorogo...

PS :
setelah ini kira2 seri 'pemaksaan setting' yang lain yang asyik utk di-uthex-uthex apa lagi yak? Kalo ada ide, masukan, wishlist, silakan kabar-kabarin aku via comment dgn nge-klik link di bawah artikel ini, shoutbox di sebelah kiri blog ini, ato YM, ato kirim imel bisa juga, ke rizky.prihanto@gmail.com

Ah, obok-obok komponen JEDI VCL nya Delphi aaah, siapatau ada ide mo bikin apa. (Sori buat penggemar delphi, environment favoritmu kupake 'cuman' utk jalan sore-sore nyari-nyari inspirasi doank. Imple, teuteup d VB... xixixixi..)