How to Change the Computer Name in Ubuntu

1. Open a terminal window. 2. At the input prompt you will see this structure: “` nicholas@computer-name:~$ _ “` 3. So you have to edit the hostname file: “` sudo nano /etc/hostname “` 4. When prompted, enter the administrator password and hit Enter. 5. The hostname file will open, showing the current computer name. Replace the…

Read more...

No solution stacks listed in elastic beanstalk configuration

It is how you do the elastic beanstalk configurations. eb init You would be very frustrated when you can select no available solution stacks… Select a solution stack. Available solution stacks are: Select (1 to 0): It is because the credentials you use don’t have administrator rights. Go to Identity and Access Management (IAM) and add…

Read more...

Unable to install Homebrew

Unable to install Homebrew with this? ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)” What’s happened -e:70: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 ==> This script will install: /usr/local/bin/brew /usr/local/Library/… /usr/local/share/man/man1/brew.1 Press RETURN to continue or any other key to abort ==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew Password: ==> Downloading and installing Homebrew… remote: Counting objects:…

Read more...

Awesome New Layout!

Well, it is always good to have a refreshing layout. I spent like 2 days to tweak my website layout. It’s really awesome. Useless widgets are removed and background changed. There is even a whole new typography. I love it so much!

Read more...

Happy Android Development with Gradle

Recently I have been working a lot on migrating android projects to use gradle building system. Seriously it is much better than the old time. I can easily use libraries on maven repositories and customize my building process. I also no long need to create a desperate project for testing. Awesome!

Read more...

Interview Practice Extra 07 – Universal Value Binary Tree

Question Design an algorithm to verify that a tree is a universal value binary tree. Universal value binary tree means all value in that tree is the same. Solution There is two approach for this problem. One is with recursive function and another is with iterative function. For this problem, iterative function makes simpler answer. However,…

Read more...

Interview Practice Extra 06 – Vending Machine

Question This is an actual question I encountered in an Amazon phone interview in November 2013. You are going to design the money changing algorithm for a vending machine. That is, after any purchase, the machine makes change to users with a combination of coins. And the machine only have 3 types of coins: nickel…

Read more...

Interview Practice Extra 05 – Identify Prime Numbers

Question Write an algorithm to identify prime numbers from a list of numbers ranging 0-100. Solution The main question is actually to write a program to check if a number is prime. There are 4 situations. 1. If number is 0 or 1, it is not prime. 2. if the number is 2, it is…

Read more...

Interview Practice Extra 04 – Remove Node from Singly Linked List

Question How do you remove a node from a singly linked list, given only that node? Head node is not given. Solution Set next of this node to the next of the next node. node->next = node->next->next; Reference Glassdoor

Read more...

Interview Practice 28 – Counting One in Binary Expression

Question Given a number, find the number of 1 in the number’s binary expression. For example, binary express of 10 is 1010. So the number of 1 in it is 2. Solution To solve this, we can check each bit by shifting the bits one by one. 1. 1010 -> check 0 2. 101 -> check…

Read more...