Check the status of a tool
sudo systemctl status docker
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
| /** | |
| * String manipulation | |
| */ | |
| // 1. Parse string with delimiter | |
| String phone = "012-3456789"; | |
| String[] output = phone.split("-"); | |
| // Note: When split string with delimater with "." or " ", instead of directly using them, we have to using the double slash | |
| // to help, i.e. | |
| String[] digits = version.split("\\."); |
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
| { | |
| "workbench.startupEditor": "newUntitledFile", | |
| "breadcrumbs.enabled": true | |
| } |
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
| function insertionSort (nums) { | |
| for(let i = 1; i < nums.length; i++){ | |
| let temp = nums[i]; | |
| let j = i - 1; | |
| while(j >= 0 && temp < nums[j]){ | |
| console.log(nums); | |
| nums[j+1] = nums[j]; | |
| j--; | |
| } | |
| nums[j + 1] = temp; |
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
| # If you come from bash you might have to change your $PATH. | |
| # export PATH=$HOME/bin:/usr/local/bin:$PATH | |
| # Add auto suggestions | |
| source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh | |
| # Remove Default username | |
| DEFAULT_USER=Zingoer | |
| # Path to your oh-my-zsh installation. |
Create a new M*N 2D array:
int[][] matrix = new int[n][m];//first is the row numbers, second is the column numbersGet the length of the M*N 2D array:
int n = matrix.length;//n rows
int m = matrix[0].length;//m columns