Archive for the ‘Umum’ Category

Is there any ‘evil’ inside me

February 19, 2016 Leave a comment


Scary title isn’t? Hahahaha. But I think this is the answer to what’s happening today. Evil mean unexpressed emotions. Where it comes from? Why they exist?  Read more…

Categories: Umum

Why I like her?

February 13, 2016 Leave a comment

Once upon a time she asked me why I like her. A difficult question to answer. Because at that time I don’t understand why can fall in love with her. I kept asking myself why I fell in love with her. It takes a few weeks for me to be able to answer that question.


So, this is six main reasons why I love her: Read more…

Categories: Umum

After 4 years

About 4 years ago I met a woman. After a few weeks I finally fell in love with her. But at that time I had no opportunity to tell her that I like her. Until finally there was another man who did it. It was a very painful memory. The worst part is I can not control my emotions, I work a mess in a few weeks. Now, after four years I meet with someone. Read more…

Categories: Umum

Moving git repository to new server

1. Fetch all of the remote branches and tags from the existing repository to our local index

git fetch origin

2. Check all branch

git branch -a

3. Add new ssh config for new server. Create new file with text editor, I use notepad++, name with config. For windows save in C:\Users\sashihara\.ssh. After this you will have 3 file, config, id_rsa, id_rsa_aws.

Host host1 ip_host1
 HostName ip_host1
 IdentityFile C:\Users\sashihara\.ssh\id_rsa
 User gituser

Host host2 ip_host2
 HostName ip_host2
 IdentityFile C:\Users\sashihara\.ssh\id_rsa_aws
 User gituser

4. Add new remote origin, give different name. You must already have new git repository  (repo/app/new.git)

git remote add origin-new ssh://gituser@ip_host2/repo/app/new.git

5. Push to a new origin

git push --all origin-new

6. Push tags to a new origin

git push --tags new-origin

7. [optional] remove origin and rename new origin

git remote rm origin
git remote rename origin-new origin


Categories: Umum

Export PUTTY Sessions list

Type this command on command prompt

regedit /e "%userprofile%\desktop\putty-sessions.reg" HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions

That command will export putty session list to putty-sessions.req file locate on Desktop

If you want to export all setting, use this command

regedit /e "%userprofile%\desktop\putty.reg" HKEY_CURRENT_USER\Software\SimonTatham
Categories: Umum


February 22, 2015 Leave a comment

Problem Statement

At the annual meeting of Board of Directors of Acme Inc, every one starts shaking hands with everyone else in the room. Given the fact that any two persons shake hand exactly once, Can you tell the total count of handshakes?

Input Format
The first line contains the number of test cases T, T lines follow.
Each line then contains an integer N, the total number of Board of Directors of Acme.

Output Format

Print the number of handshakes for each test-case in a new line.


1 <= T <= 1000
0 < N < 106

This problem is about combinations. The formula is

For factorial calculation I’m using recursive with memoization to optimization process. Read more…

The Love-Letter Mystery

February 22, 2015 Leave a comment

James found a love letter his friend Harry has written for his girlfriend. James is a prankster, so he decides to meddle with the letter. He changes all the words in the letter into palindromes.

To do this, he follows 2 rules:

  1. He can reduce the value of a letter, e.g. he can change ‘d’ to ‘c’, but he cannot change ‘c’ to ‘d’.
  2. In order to form a palindrome, if he has to repeatedly reduce the value of a letter, he can do it until the letter becomes ‘a’. Once a letter has been changed to ‘a’, it can no longer be changed.

Each reduction in the value of any letter is counted as a single operation. Find the minimum number of operations required to convert a given string into a palindrome.

Read more…

Categories: Umum Tags: , ,