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 f(): | |
| for cluster in range(10000): | |
| expression = f'"cluster_id" = {cluster}' | |
| layer = QgsProject.instance().mapLayersByName('turn_cluster_trajectories')[0] | |
| layer.setSubsetString(expression) | |
| if len(layer) == 0: | |
| continue | |
| layer = QgsProject.instance().mapLayersByName('normalized_trace_turns')[0] | |
| layer.setSubsetString(expression) | |
| qgis.utils.iface.zoomToActiveLayer() |
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 textwrap import wrap | |
| import re | |
| import itertools | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from sklearn.metrics import confusion_matrix | |
| def plot_confusion_matrix( |
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 -g mouse on | |
| # Vim-like panel navigation | |
| bind h select-pane -L | |
| bind j select-pane -D | |
| bind k select-pane -U | |
| bind l select-pane -R | |
| # remap prefix from 'C-b' to 'Alt-e' | |
| unbind C-b |
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 set_random_seed(seed_value, use_cuda=True): | |
| np.random.seed(seed_value) # cpu vars | |
| torch.manual_seed(seed_value) # cpu vars | |
| random.seed(seed_value) # Python | |
| os.environ['PYTHONHASHSEED'] = str(seed_value) # Python hash buildin | |
| if use_cuda: | |
| torch.cuda.manual_seed(seed_value) | |
| torch.cuda.manual_seed_all(seed_value) # gpu vars | |
| torch.backends.cudnn.deterministic = True #needed | |
| torch.backends.cudnn.benchmark = False |
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
| # version 1.0 | |
| FROM ubuntu | |
| RUN \ | |
| apt-get update && \ | |
| apt-get install -y \ | |
| vim \ | |
| git | |
| RUN \ |
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
| apt-get install -y openssh-server && \ | |
| sed -i "\$aPasswordAuthentication yes\nPermitRootLogin yes" /etc/ssh/sshd_config && \ | |
| echo 'root:docker' | chpasswd |
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 smarttab | |
| set smartindent | |
| filetype plugin indent on | |
| " show existing tab with 4 spaces width | |
| set tabstop=4 | |
| " when indenting with '>', use 4 spaces width | |
| set shiftwidth=4 | |
| " On pressing tab, insert 4 spaces | |
| set expandtab |
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
| #! /bin/bash | |
| TEMP_DIR=/tmp | |
| VERSION=`curl --silent "https://api.github.com/repos/protocolbuffers/protobuf/releases/latest" | grep -Po '"tag_name": "v\K.*?(?=")'` | |
| echo "Version $VERSION will be installed" | |
| [[ -z VERSION ]] && echo "Could not get version from github" |
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 tensorflow as tf | |
| from keras.backend.tensorflow_backend import set_session | |
| config = tf.ConfigProto() | |
| config.gpu_options.allow_growth = True | |
| set_session(tf.Session(config=config)) |
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
| pip install jupyter_contrib_nbextensions | |
| pip install jupyter_nbextensions_configurator | |
| pip install yapf | |
| jupyter contrib nbextension install --user | |
| jupyter nbextensions_configurator enable --user | |
| # Installation of vim_bindings | |
| mkdir -p $(jupyter --data-dir)/nbextensions | |
| # Now clone the repository | |
| cd $(jupyter --data-dir)/nbextensions |