记录
vim
set number
syntax on
"colorscheme industry
set tabstop=4
set shiftwidth=4
set autoindent
set expandtab
set softtabstop=4
set cursorline
autocmd filetype cpp nnoremap <F5> :w <CR> :!g++ -std=c++14 -O2 -Wall % -o %:r && ./%:r<CR>
autocmd filetype cpp nnoremap cpf i#include <bits/stdc++.h><Esc>ousing namespace std;<Esc>o<Esc>o#define debug(x) cerr << #x << " is " << x << endl<Esc>otypedef long long ll;<Esc>otypedef pair<int, int> P;<Esc>oconst int INF = 0x3f3f3f3f;<Esc>o<CR>int main()<Esc>o{<Esc>oios::sync_with_stdio(false);<Esc>ocin.tie(0);<Esc>o<CR>return 0;<Esc>o}<Esc>kki
LaTeX
Algorithm
\begin{algorithm}[H]
\caption{DBSCAN 聚类}
\label{alg:DBSCAN}
\begin{algorithmic}[1]
\Require 样本集 $D=\{\bm{x}_1,\bm{x}_2,\cdots,\bm{x}_m\}$; 邻域参数 $(\epsilon, MinPts)$.
\Ensure 簇划分 $\mathcal{C} = \{C_1,C_2,\cdots,C_k\}$.
\State 初始化核心对象集合:$\Omega=\oslash$;
\For {$j=1,2,\cdots,m$}
\State 确定样本 $\bm{x}_j$ 的 $\epsilon$-邻域 $N_\epsilon(\bm{x}_j)$;
\If {$N_\epsilon(\bm{x}_j)\ge MinPts$}
\State 将样本 $\bm{x}_j$ 加入核心对象集合: $\Omega=\Omega\bigcup\{\bm{x_j}\}$;
\EndIf
\EndFor
\State 初始化聚类簇数: $k=0$;
\State 初始化未访问样本集合: $\Gamma=D$;
\While {$\Omega\neq\oslash$}
\State 记录当前未访问样本集合: $\Gamma_{\mathrm{old}}=\Gamma$;
\State 随机选取一个核心对象 $\bm{o}\in\Omega$,初始化队列 $Q=<\bm{o}>$;
\State $\Gamma=\Gamma\backslash\{\bm{o}\}$;
\While {$Q\neq\oslash$}
\State 取出队列 $Q$ 中的首个样本 $\bm{q}$;
\If {$N_\epsilon(\bm{q})\ge MinPts$}
\State 令 $\Delta=N_\epsilon(\bm{q})\bigcap\Gamma$;
\State 将 $\Delta$ 中的样本加入队列 $Q$;
\State $\Gamma=\Gamma\backslash\Delta$;
\EndIf
\EndWhile
\State $k=k+1$, 生成聚类簇 $C_k=\Gamma_{\mathrm{old}}\backslash\Gamma$;
\State $\Omega=\Omega\backslash C_k$;
\EndWhile
\end{algorithmic}
\end{algorithm}
List
\documentclass[letterpaper]{article}
\usepackage{fullpage}
\usepackage{amsmath,amssymb,amsthm,enumitem}
\begin{document}
To convert from general form to standard form, we will follow these steps:
\begin{enumerate}[leftmargin=*,labelindent=16pt,label=\bfseries Step \arabic*.]
\item Ensure the coefficient of the terms in $x^2$ and $y^2$ are 1 respectively.
\item Group the terms containing $x$ and $y$ respectively. Move the constant to the RHS.
\item Take half of the coefficient of the linear terms in both $x$ and $y$, square it and add it to both sides.
\item Rewrite the result in factored form.
\end{enumerate}
\end{document}
\begin{enumerate}
\renewcommand{\labelenumi}{\bfseries \textit{Step} \theenumi.}
\item 任意选择一个未访问过的点 P。
\item 标记点 P 为已访问。
\item 计算得到所有从 P 关于 Eps 和 MinPts 密度可达的点的集合 NeighborPts。
\item 若 P 不是核心对象,标记点 P 为噪声,跳转步骤 S1 重新选取 P;若 P 为核心对象,则扩展当前核心对象 P 的所属簇 (expandCluster 函数)。
\item 判断是否所有点均已被访问,若是则跳转 \textbf{\textit{Step} 6}; 若否则继续 \textbf{\textit{Step} 1$\sim$5} 步骤。
\item DBSCAN 算法运行结束,返回 Cluster 分类数组。
\end{enumerate}
Image
\begin{figure}[htbp]
\centering
\includegraphics[width=0.7\textwidth]{figure/LPC1F.pdf}
\caption{figure name} \label{fig:LPC1F}
\end{figure}
\begin{figure}[htbp]
\centering
% \begin{subfigure}[t]{0.45\textwidth}
\begin{minipage}[t]{0.48\textwidth}
\centering
\includegraphics[width=\textwidth]{00001.jpg}
\caption{第一帧} \label{fig:firstframe}
\end{minipage}
\begin{minipage}[t]{0.48\textwidth}
\centering
\includegraphics[width=\textwidth]{00141.jpg}
\caption{最后一帧} \label{fig:lastframe}
\end{minipage}
\end{figure}
\begin{figure}[htbp]
\centering
\begin{minipage}[t]{0.33\textwidth}
\centering
\includegraphics[width=5cm]{figure/wordcloud_A.png}
\caption{Wordcloud of level A} \label{fig:wordcloud_A}
\end{minipage}
\begin{minipage}[t]{0.33\textwidth}
\centering
\includegraphics[width=5cm]{figure/wordcloud_B.png}
\caption{Wordcloud of level B} \label{fig:wordcloud_B}
\end{minipage}
\begin{minipage}[t]{0.33\textwidth}
\centering
\includegraphics[width=5cm]{figure/wordcloud_C.png}
\caption{Wordcloud of level C} \label{fig:wordcloud_C}
\end{minipage}
\end{figure}
Table
\usepackage[table]{xcolor}
\definecolor{lightblue}{RGB}{222, 234, 246}
%\vspace{-0.5cm}
\begin{table}[htbp]
\setlength{\abovecaptionskip}{0cm}
\setlength{\belowcaptionskip}{-0.2cm}
\rowcolors{2}{white}{lightblue}
\begin{center}
\caption{Indicator values from references}
\begin{tabular}{c|c|c}
\Xhline{4\arrayrulewidth}
\textbf{Level} & \textbf{BI} & \textbf{Status of Biodiversity} \\ \hline
\textbf{I} & $\mathrm{BI}\ge0.6$ & \begin{tabular}[c]{@{}c@{}}rich in species, high vegetation productivity, \\ high-quality ecological environment, \\ little influence from human activities, \\ suitable for biological survival and reproduction\end{tabular} \\
\textbf{II} & $0.4\le\mathrm{BI}<0.6$ & \begin{tabular}[c]{@{}c@{}}good vegetation productivity, \\ good ecological environment quality\end{tabular} \\
\textbf{III} & $0.2\le\mathrm{BI}<0.4$ & \begin{tabular}[c]{@{}c@{}}few species, low vegetation productivity, \\ high human disturbance\end{tabular} \\
\textbf{IV} & $\mathrm{BI}<0.2$ & \begin{tabular}[c]{@{}c@{}}poor species, poor ecological environment, \\ low biodiversity, single ecosystem type\end{tabular} \\ \Xhline{4\arrayrulewidth}
\end{tabular} \label{tab:indicator}
\end{center}
\end{table}
\vspace{-0.6cm}
conda
## Create the virtual environment
conda create -n 'environment_name'
conda create --name myenv python=3.9
pip install --upgrade pip
## Activate the virtual environment
conda activate 'environment_name'
## Make sure that ipykernel is installed
pip install --user ipykernel
## Add the new virtual environment to Jupyter
python -m ipykernel install --user --name='environment_name'
## To list existing Jupyter virtual environments
jupyter kernelspec list
## To list existing conda environments
conda env list
## To remove conda environment
conda env remove -n 'environment_name'
## To remove the environment from Jupyter
jupyter kernelspec uninstall 'environment_name'
conda info
conda list --show-channel-urls
conda env create -f environment.yml
posted by 2inf

浙公网安备 33010602011771号