-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
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
/** | |
* // This is the robot's control interface. | |
* // You should not implement it, or speculate about its implementation | |
* interface Robot { | |
* // Returns true if the cell in front is open and robot moves into the cell. | |
* // Returns false if the cell in front is blocked and robot stays in the current cell. | |
* public boolean move(); | |
* | |
* // Robot will stay in the same cell after calling turnLeft/turnRight. | |
* // Each turn will be 90 degrees. |
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
class Solution { | |
/* | |
Approach: | |
- Find start position | |
- Count number of visitable nodes in the grids | |
- A path is only valid if we read end node && all visitable nodes have been visited | |
- Perform dfs, everytime we visit a cell, we mark as visited. | |
- We cannot visit a cell more than once | |
- Handle boundary edge cases too |
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
class Solution { | |
// This approach is O(n), where n = length of string s | |
// The sliding window approach uses two pointers to traverse a string in linear time. Each character is visited | |
// at most twice | |
// There's a method `mapHasAllChars` whose time complexity may not be intuitive, so it's worth mentioning. At most | |
// each map will contain all the characters from the ascii set (0 - 255), so we know that at most we will always visit 256 | |
// keys every time we call this method. So note this => | |
// AS LONG AS WE KNOW THE WORST CASE FOR NUMBER OF LOOP ITERATIONS BEFOREHAND, THAT LOOP'S TIME COMPLEXITY IS CONSTANT | |
public String minWindow(String s, String t) { | |
//Edge Cases |
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 javax.crypto.Cipher; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
public class AESCBCDecryption { | |
static final String cipher_type = "AES/CBC/PKCS5Padding"; | |
public static void main(String[] args) { | |
String key = "57067125438768260656188878670043"; |
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
// reference: https://stackoverflow.com/questions/46310113/consume-a-delete-endpoint-from-golang | |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) | |
func sendRequest() { |
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
// Enter value in a cell | |
var valueRange = Sheets.newValueRange(); | |
valueRange.values = [["text"]]; | |
const result = Sheets.Spreadsheets.Values.update(valueRange, | |
SHEET_ID, A1_NOTATION, {valueInputOption: "RAW"}); | |
// Fetches values as a multidimensional array | |
Sheets.Spreadsheets.Values.get(SHEET_ID, RANGE) | |
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
// See https://developers.google.com/apps-script/guides/services/external | |
// and https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app | |
function fetchListOfChannels() { | |
var options = { | |
'method' : 'get', | |
'contentType': 'application/json', | |
'headers': { | |
'Authorization': 'Bearer <access_token>', | |
} | |
}; |
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
#include <stdlib.h> | |
int main(){ | |
// Read integer from line | |
int t; | |
scanf("%d",&t); | |
// Read integer from line times | |
for(int a0 = 0; a0 < t; a0++){ |
OlderNewer