This file contains hidden or 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
| # install cygwin64 of x86 version. | |
| # once you installed the application, close it. | |
| # run PowerShell as Admin, and input follows: | |
| .\setup-x86.exe -q -P wget -P gcc-g++ -P make -P diffutils -P libmpfr-devel -P libgmp-devel -P libmpc-devel | |
| # the command installs gcc compiler which is necessary | |
| # download spin and ispin files from [here](http://spinroot.com/spin/Src/index.html) | |
| # extract | |
| # open cygwin |
This file contains hidden or 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
| # sudo apt install pip | |
| sudo apt-get update | |
| sudo apt-get install -y git vim-nox python-setuptools python-all-dev flex bison traceroute | |
| sudo apt install python3-pip | |
| git clone git://github.com/mininet/mininet | |
| cd mininet | |
| git tag # list available versions | |
| git checkout 2.3.0d3 # or whatever version you wish to install | |
| cd .. |
This file contains hidden or 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.concurrent.*; | |
| public class Restaurant { | |
| Meal meal; | |
| ExecutorService exec = Executors.newCachedThreadPool(); | |
| WaitPerson waitPerson = new WaitPerson(this); | |
| Chef chef = new Chef(this); | |
| public Restaurant() { | |
| exec.execute(chef); |
This file contains hidden or 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
| sudo apt-get update | |
| sudo apt update | |
| sudo apt upgrade | |
| sudo apt-get install -y mysql-server | |
| sudo apt-get install -y java | |
| # Test MySQL service | |
| systemctl status mysql.service | |
| # Install Python2 and Python3-pip | |
| sudo apt install -y python2.7 python-pip |
This file contains hidden or 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
| public void printMatrix(int[][] matrix) { | |
| for (int row = 0; row < matrix.length; row++) { | |
| for (int col = 0; col < matrix[row].length; col++) { | |
| System.out.printf("%4d", matrix[row][col]); | |
| } | |
| System.out.println(); | |
| } | |
| } |
This file contains hidden or 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
| public class BST { | |
| private TreeNode root; | |
| private TreeNode findRecursive(TreeNode node, int t) { | |
| if (node == null) return null; | |
| if (node.val == t) return node; | |
| else if (node.val > t) return findRecursive(node.left, t); | |
| else return findRecursive(node.right, t); | |
| } |
This file contains hidden or 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
| public class ArrayList<T> implements ILIst<T> { | |
| private T[] arrays; | |
| private int size; | |
| private static final int INIT_CAPABILITY = 16; | |
| public static final float RESIZE_FACTOR = 0.75f; | |
| public ArrayList() { | |
| this.arrays = (T[]) new Object[INIT_CAPABILITY]; | |
| this.size = 0; | |
| } |
This file contains hidden or 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
| var e = document.createElement('script'); | |
| e.setAttribute('src', 'https://nytimes.github.io/svg-crowbar/svg-crowbar.js'); | |
| e.setAttribute('class', 'svg-crowbar'); | |
| document.body.appendChild(e); |
This file contains hidden or 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
| @echo OFF | |
| echo 清楚所有程序 && CheckNetIsolation.exe LoopbackExempt -c 1>nul | |
| cd %USERPROFILE%\AppData\Local\Packages | |
| echo 开始添加程序 | |
| for /d %%i in (*) do echo 添加程序%%i && CheckNetIsolation.exe LoopbackExempt -a -n = %%i 1>nul | |
| pause |
This file contains hidden or 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
| public class QuickUnionUF{ | |
| private int[] id; | |
| public QuickUnionUF(int N) { | |
| id = new int[N]; | |
| for (int i=0;i<N;i++) { | |
| id[i] = i; | |
| } | |
| } | |
| // depth of tree |