android Update Amazon FireTV to FireOS 5 Developer Preview Go to this web site: https://developer.amazon.com/public/solutions/platforms/android-fireos Now go to your Fire TV. Settings > About > Check For System Update

administrator password How to Change the Computer Name in Ubuntu Open a terminal window. 2. At the input prompt you will see this structure: “nicholas@computer-name:~$ _ “ So you have to edit the hostname file: “sudo nano /etc/hostname “ When prompted, enter the administrator

Alias 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

android 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

5 cent 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

cha Interview Practice 26 - String Right-rotation Question Write a program to right-rotate a string by m characters. Right-rotating a string means moving m characters at the left of string to the right. Is it required the time complexity is

cha Interview Practice 25 - Longest Consecutive Digits Question Given a function prototype: int continumax(char *output_string,char *input_string). Implement it to find the longest consecutive digits. This function must return the length of the longest digits. The found

how Interview Practice 22 - Card Guessing Question Consider there are 4 blue and 4 red cards. Host gets 2 cards randomly, no one knows what cards they are. Then he places 2 random cards at the forehead of each

app Interview Practice 21 - Summing Combinations Question Given a integers m and n, generate all combination within 1 to n that would give the sum m. For example, for m=5 and n=5, the combinations are {5}, {4+

cha Interview Practice 20 - Convert String to Integer Question Convert the inputted string to an integer. For example, “345” will output 345. Solution Though it looks simple, in fact it is pretty tricky. First we need to make the concept clear.

app Interview Practice 17 - Find The String Appeared Once Question Given a string, write an algorithm to find the character inside that appeared only once. For example, the result for string “abaccdeff” is b. Solution We can use a hashtable to count

find Interview Practice 14 - Find Integer With Wanted Sum Question Given a sorted integer list and an integer, find two integer in the list such that the sum of the two integers equals the given integer. It is required that the time

cha Interview Practice 13 - Last Kth Node of Linked List Question Given a linked list, find the Kth last node in a linked list. The last 0th node is the tail node in the linked list. Solution Easy task. Construct 2 pointers: P1

interview Interview Practice 12 - Sum from 1 to N Unconventionally Question Sum up 1 to n without using division, multiplication, for loop, while loop, if else, switch and condition statement (A?B:C). Solution 1 Actually, for loop can be simulated through making

binary Interview Practice 11 - Greatest Distance Between Two Nodes in Binary Tree Question Get the greatest distance between two nodes in a binary tree. Assume links between nodes are bidirectional. Distance is defined as the amount of nodes connected along the path linked two nodes.

app Interview Practice 10 - Reverse Sentence Question Simple task, reverse words in a sentence. Solution In Python, this can be simple because of the build-in functions. We can just split the sentence by spaces, reverse the list, and join

binary Interview Practice 09 - Verify Post-order Sequence of BST Question Construct an algorithm to verify if a set of numbers is the post-order search result of a binary search tree. Let the figure at the right hand side as an example, the

code Interview Practice 07 - Determine if Two Linked Lists Intersect Question Given 2 linked list head pointers, determine whether they intersect at some point. Solution First of all, linked list can have loop or not, and this gives 3 possible situations. For the

app Interview Practice 06 - Appearance Count of Numbers Question 腾讯面试题： 给你10分钟时间，根据上排给出十个数，在其下排填出对应的十个数 要求下排每个数都是先前上排那十个数在下排出现的次数。 上排的十个数如下： 【0，1，2，3，4，5，6，7，8，9】 Solution 初看此题，貌似很难，10分钟过去了，可能有的人，题目都还没看懂。 举一个例子， 数值: 0,1,2,3,4,5,6,7,

code Interview Practice 05 - K Smallest Elements in List Question 输入n个整数，输出其中最小的k个。 例如输入1，2，3，4，5，6，7和8这8个数字， 则最小的4个数字为1，2，3和4。 Sample Code [expand title=”Sample Code in C++” tag=”h4″] include using namespace std; class MinK { private: int array; int

code Interview Practice 03 - Longest Sequence that Makes the Greatest Sum Question 输入一个整形数组，数组里有正数也有负数。 数组中连续的一个或多个整数组成一个子数组，每个子数组都有一个和。 求所有子数组的和的最大值。要求时间复杂度为O(n)。 例如输入的数组为1, -2, 3, 10, -4, 7, 2, -5，和最大的子数组为3, 10, -4, 7, 2， 因此输出为该子数组的和18。 From a set of positive and negative integers, find the longest

android Tons of things working on it’s been a while since the last post. After coming to new york, I have been very busy on my study, personal projects and (of course) playing around. studying in new york