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
| TextEditor diagnosticsBox; | |
| void logMessage(const String& m){ | |
| diagnosticsBox.moveCaretToEnd(); | |
| diagnosticsBox.insertTextAtCaret(m + newLine); | |
| } | |
| // resized() | |
| diagnosticsBox.setBounds; |
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
| youtube-dl --extract-audio --audio-format wav --audio-quality 0 --postprocessor-args "-ss 00:00:00.00 -t 00:05:00.00" https://www.youtube.com/watch?v=n | |
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
| # Try Gammatonefilter | |
| t = np.linspace(0, 1, 1000) # Time | |
| f = 4 # center freq | |
| theta = 0 # phase | |
| b = 1 # filter bandwidth | |
| n = 3 # filter order | |
| a = 1. # Amp | |
| g = a * np.power(t, (n-1)) * np.exp(-2 * np.pi * b * t) * np.cos(2 * np.pi * f * t + theta) |
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
| # List of string to a long string. | |
| alist = ['1', '2', '3', '4'] | |
| alist_joint = ' '.join(alist) | |
| # Long string to list | |
| astring = '1 2 3 4' | |
| alist = astring.split(sep=' ') |
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
| n = 1234 | |
| rev=0 | |
| while(n>0): | |
| dig=n%10 | |
| rev=rev*10+dig | |
| n=n//10 |
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
| from collections import defaultdict | |
| item_list = 'spam spam egg egg spam'.split() | |
| count = defaultdict(int) | |
| for item in item_list: | |
| count[item] += 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
| Step 1: In order to remove existing files from the repository: | |
| find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch | |
| Step 2: Add this line '.DS_Store' to your .gitignore file, which can be found at the top level of your repository (or create if it isn't there already. Use the following command to do so: | |
| echo .DS_Store >> .gitignore | |
| Step 3: Then run the following command: |
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 os | |
| project_root = os.path.dirname(os.path.abspath(__file__)) |
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
| $ docker run -it --rm --name ds -p 8888:8888 jupyter/datescience-notebook |
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
| def batch_generator(items, batch_size): | |
| batch = [] | |
| i = 0 | |
| for item in items: | |
| batch.append(item) | |
| if len(batch) == batch_size: | |
| yield batch | |
| batch = [] | |
| yield batch |