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
| # 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
| 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
| 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
| a = np.arange(10) # (10, ) | |
| a.reshape(-1, 1) # (10, 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
| import 'package:flutter/material.dart'; | |
| void main() => runApp(MaterialApp( | |
| home: MyApp(), | |
| )); | |
| class MyApp extends StatefulWidget { | |
| @override | |
| _MyAppState createState() => new _MyAppState(); | |
| } |
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
| ## Session Management | |
| Sessions are useful for completely separating work environments. I have a ‘Work’ session and a ‘Play’ session; in ‘Work’, I keep everything open that I need during my day-to-day development, while in ‘Play’, I keep open current open-source gems or other work I hack on at home. | |
| tmux new -s session_name | |
| creates a new tmux session named session_name | |
| tmux attach -t session_name | |
| attaches to an existing tmux session named session_name | |
| tmux switch -t session_name | |
| switches to an existing session named session_name |
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_columns_ndarray = long_audio_vector.reshape((-1, num_of_channels)) |
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 | |
| file_names = os.listdir("file_path") |
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
| for (std::vector<int>::const_iterator i = vecName.begin(); i != vecName.end(); ++i) | |
| std::cout << *i << std::endl; |