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
find . -maxdepth 1 -type d | grep -i Native |
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
Set<String> set = saved.getAll().keySet(); | |
String[] mystring = set.toArray(new String[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
With recursion | |
find . -type d | grep -i <search-term> | |
Without recursion | |
find . -type d -maxdepth 1 | grep -i <search-term> | |
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
// Tags: Arithmetic Slices, Dynamic Programming | |
/** | |
* Problem: | |
* A sequence of numbers is called arithmetic if it consists of at least | |
* three elements and if the difference between any two consecutive elements | |
* is the same. | |
* | |
* For example, these are arithmetic sequences: | |
* |
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
// Tags: anagram, hash map | |
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* Problem: | |
* Given two strings s and t , write a function to determine if t is an | |
* anagram of s. | |
* |
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
// Tags: recursion, bit manipulation, reduce to zero | |
/** | |
* Problem: | |
* Given a non-negative integer num, return the number of steps to reduce it | |
* to zero. If the current number is even, you have to divide it by 2, | |
* otherwise, you have to subtract 1 from it. | |
* | |
* Example 1: | |
* |
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
// Tags: Stack, Absolute Path, Canonical Path | |
/** | |
* Problem: | |
* Given a string path, which is an absolute path (starting with a slash '/') | |
* to a file or directory in a Unix-style file system, convert it to the | |
* simplified canonical path. | |
* | |
* In a Unix-style file system, a period '.' refers to the current directory, | |
* a double period '..' refers to the directory up a level, and any multiple |
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
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), | |
missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun | |
First fix: Reinstall Xcode toolkit | |
`$ xcode-select --install` | |
Second fix: Reset | |
`$ sudo xcode-select --reset` |
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
1. Create `KeyBindings` folder in `~/Library` | |
2. Create a `DefaultKeyBinding.dict` file and store it the `KeyBindings` with the following contents: | |
{ | |
"\UF729" = moveToBeginningOfParagraph:; // home | |
"\UF72B" = moveToEndOfParagraph:; // end | |
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home | |
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end | |
"^\UF729" = moveToBeginningOfDocument:; // ctrl-home | |
"^\UF72B" = moveToEndOfDocument:; // ctrl-end |
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
## In terminal: | |
`brew install pygments` | |
## In TexStudio Preferences | |
Add `-shell-escape` flag to the `pdflatex` line | |
`"pdflatex" -synctex=1 -shell-escape -interaction=nonstopmode %.tex` | |
## If /usr/local/bin/pygmentize exists, delete it | |
`sudo rm -rf /usr/local/bin/pygmentize` |
NewerOlder