-
Select venv in Jupyter notebook:
conda install nb_conda_kernels
; -
Maya install numpy: unzip whl file and copy the folder to
%MAYA_INSTALL_DIR%\Python\Lib\site-packages
; -
Pycharm tricks from zhihu (Chinese);
-
Specify TeX compiler in your document, add
!TEX TS-program = lualatex
. This directive is understood by most TeX IDEs. More TeX directives see here; -
While annotating a codebase (C++ for example), in Visual Studio, change color of
XML Doc Comment
(in Tools->Options->Environment->Fonts and Colors). Start annotation using///
instead of regular comment//
; -
To work with different ssh identities on the same machine, simply change
~/.ssh/config
:# Personal GitHub account Host github.com HostName github.com User git AddKeysToAgent yes IdentityFile ~/.ssh/your_customized_id_rsa
-
One-shot
git difftool
for specific file extensions# set difftool git config --global diff.tool bc git config --global difftool.bc.path "c:/Program Files/Beyond Compare 4/bcomp.exe" # diff in one shot, -d for dir-diff git difftool -d commit_id_1 commit_id_2 -- '*.cpp' '*.hpp'
-
WSL doesn't start on win10. Solution;
-
xelatex
running slow. Try to deletetexlive/${version}/texmf-var/fonts/cache;
-
If debugger fails to stop at breakpoint, maybe you forgot to generate debugging symbol (duh..., to verify this, use objdump);
-
Linux is case-sensitive but Windows is not, it may cause problem with cross-platform code. Here is a solution to make windows folders case-sensitive
-
Fix git connection issues on WSL:
touch ~/.ssh/config chmod 755 ~/.ssh/config sudo nano ~/.ssh/config # add the following to this config Host github.com Hostname ssh.github.com Port 22 # restart ssh sudo /etc/init.d/ssh restart # verify ssh -T [email protected]
- Find and replace a string in multiple files using
find
andsed
(note the trailing\;
):
find /home/user/directory -name \*.c -exec sed -i "s/cybernetnews/cybernet/g" {} \;
Ref:
Target Debugging and Launching
Quick Start to Use Visual Studio Code for C++ Programmers in Linux
C++ Development using Visual Studio Code, CMake and LLDB
Steps:
- Install VS Code extensions: WSL remote development, C/C++ extension in Windows;
- Configure WSL:
sudo apt-get update
sudo apt-get install build-essential gdb cmake
sudo apt-get install freeglut3 freeglut3-dev binutils-gold libglew-dev mesa-common-dev libglew1.5-dev libglm-dev #OpenGL optional
-
Install X client (
xming
for example, then forward X usingexport DISPLAY=:0
; a modern X client is mobaxterm -
Configure
launch.json
for your project; -
In WSL, from project folder, type
code .
.
[alias]
co = checkout
br = branch
ci = commit
st = status
dt = difftool -d
[core]
autocrlf = true
[user]
email = xxx
name = xxx
# Make sure you have meld installed
[diff]
tool = meld
guitool = meld
[difftool]
prompt = false
[difftool "meld"]
cmd = meld \"$LOCAL\" \"$REMOTE\"
{
"font_size": 13,
"word_wrap": "true",
"match_brackets_angle": true // especially for dealing with ugly stl output...
}