Rumah, ah

Malam perjuangan telah usai
Pembenaran-pembenaran panjang yang biasa saling berdebat dan membela
Kini telah usang

Di rantau
Di seberang pulau tanah rumah
Hangat pasir putih di pinggir pantai tetap sama
Bau hujan yang jatuh ke tanah tetap sama, lembabnya, uapnya, suasananya

Namun apa gerangan yang tetap dapat disebut tanah rumah
Bila pengikatnya telah runtuh diruntuhkan harapan

Tak ada lagi sembunyi di balik kebun tebu
Memadu rindu, menyemai hangat gairah masa remaja
Tak bisa lagi mengatur waktu mengendap dalam gelap
Menjemput kelengahan situasi untuk mereguk nira manis sang kekasih

Herannya bagaimana amat bodohnya tanah rumah
Dipersembahkan pada nasib malang yang menghapuskan artinya
Menghapuskan arti rumah, arti dirinya sendiri

Sejak mulut-mulut manis para pembisik
Dan rayu-rayu dibalik kasih sayang sanak saudara
Telah diambil kekasih oleh pria tanah sebrang

Kini nira itu tak lagi manis
Begitupula rumah tak lagi terasa rumah

Bahkan saat kaki, paru dan telinga bernostalgia dengan tanah rumah
Hati tetap tak dapat melupakan bahwa ini bukan rumah
Saat mata melihat sanak saudara dan kawan
Masih terasa benci dendam akan kegagalan mereka mempertahankan rumah

XOR encryption on c++

Recently I studied about encryption; It was quite hard for me to catch up but at least now I know a little bit about it. My target was simple, I able to implement most simple encryption by my self. After reading some article and tutorial I found about XOR chipper.

What is it?

XOR operation is simple; If there is two clause and one of them is true so the result is true, but not if both of them true.

So here is truth table of XOR operation :
Baca lebih lanjut

Berseberang Pandang

Rinai malam berdiri rapi menjejak lantai berbatu
Berseberang pandang dengan pohon kayu putih
Menguarkan rindu tak berbalas
Tak tuntas

Berdiri agak condong kedepan
Berusaha mendekat walau hanya selipat kusut baju tak bersetrika
‘aku melihatmu dari sini walau tak memandangmu’

Rinai malam berjalan pelan menyusuri jalan berlubang dan berbatu
Menjauh tak searah dengan bunga-bunga kayu putih
Bunga itu merah, indah dan semerbak meruapkan mantera romansa

‘Wahai karang yang membatu dan tak tertembus
Tetaplah di depanku’

Rinai malam, diam menggigili waktu
Tergoyang angin mendambakan kelegaan
Memeluki waktu tanpa mendekapnya
Menciumi masa tanpa mendekatinya

Arrange list of int

I just took online test for C++ programmer position, it was really interesting; But for porting programmer like me -which implementing anything is mere only on memory :p – this question is really hard for me.

Here is the question :

Write a function `arrange` that can take any non-negative integer as a argument and return it with it’s digits in descending order. Descending order means that you take the highest digit and place the next highest digit immediately after it. e.g.
arrange(145263)
=> 654321

arrange(1254859723)
=> 9875543221

Sorting is very easy, I have a lot of premade function to handle it. Processing the number was made me numb for some minutes, I took 20 minutes to figure out how to do it – maan I’m really stupid, it’s really easy! – .

int arrange(int y)
{
 int b = y;
 int value[100];
 int size=0;
 while(b!=0){
 int tenth = pow(10,size +1);
 value[size] = (b % tenth)/ (tenth/10);
 b -= value[size]*(tenth/10);
 size++;
 }
 selSort(value,size);
 for(int in=0;in<size;in++){
 cout<<value[in];
 }
}

That’s the function I created to process numbers to array of integer, so I could sort it. Well I wrote it in hurry because I spent too much time on numbing. Look, that function is not good, there are some technique to simplify it.

Binary search with STL

Hello all, long time since I wrote about C++ thingy. Then let me introduce you to binary search in C++, however in this article I won’t write how to implement Binary search on C++; Instead we use STL’s binary search.

First, create class to provide interface to our data and binary search functionally.

class b_search
{
private:
 int size;
 int *list;
public:
 b_search(int *list, int size)
 {
 this->list = list;
 this->size = size;
 }
 void find(int item)
 {
 if(binary_search(list,list+size,item))
 cout<<item<<" found"<<endl;
 else
 cout<<item<<" not found"<<endl;
 }
};

Then lets use it : Baca lebih lanjut