# fetch source
sudo yum install git
sudo yum install wget
# to compile
sudo yum install java-1.7.0-openjdk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# update repo version | |
repo selfupdate --no-repo-verify | |
# reset all repos | |
repo forall -vc "git reset --hard" | |
# clean and delete unstaged changes | |
repo forall -vc "git clean -df" | |
# pull all repos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Nicholas Wong <[email protected]>. | |
* Gradle build file to set up variables for JaCoCo. | |
* The following tasks will be created in normal circumstance. | |
* | |
* - Create JaCoCo HTML and XML Reports | |
* jacocoDebug | |
* jacocoRelease | |
* | |
* - Open JaCoCo HTML Report in Mac OSX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Solution1 { | |
public static void main(String[] args) { | |
try { | |
// read in matrix | |
Scanner scanner = new Scanner(System.in); | |
int length = Integer.parseInt(scanner.nextLine()); | |
int[][] matrix = new int[length][length]; | |
for (int i = 0; i < length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# node structure | |
class Node: | |
value = None | |
left = None | |
right = None | |
# constructor | |
def __init__(self, value, left=None, right=None): | |
self.value = value | |
self.left = left |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# run this to install | |
# sudo su install-sublime-text-3.sh | |
# modify this if you need another version or or architecture | |
URL="http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3083_x64.tar.bz2" | |
SHORTCUT="[Desktop Entry] | |
Name=Sublime Text 3 | |
Comment=Edit text files |
if you encounter this error
out/host/linux-x86/bin/jack: line 131: 31049 Killed $SERVER_PRG $SERVER_PORT_SERVICE $SERVER_PORT_ADMIN $SERVER_COUNT $SERVER_NB_COMPILE $SERVER_TIMEOUT >> $SERVER_LOG 2>&1
ERROR: Cannot launch Jack server
make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex] Error 41
make: *** Waiting for unfinished jobs....
its because ~/.jack has an incorrect permission you can fix it with
Idea
# stack: a stack that store the current combination
# items: available items, each item has a value
# available_space: the spaces left of the current combination
# index: the index of items it is going to match
function find_combinations_recursively(stack, items, available_space, index):
# check for invalid target or value
value = items[index]
Define Node
static class Node {
int value;
Node left, right;
}
Depth First Recursive Traversal (Pre-order)
Define Node
static class Node {
int value;
Node left, right;
}
Breathe First Iterative Traversal
OlderNewer