Skip to content

Instantly share code, notes, and snippets.

‎‎​
@Natsu-Akatsuki
Natsu-Akatsuki / Color.cmake
Last active November 23, 2022 14:36
CMake
# ref https://stackoverflow.com/questions/18968979/how-to-get-colorized-output-with-cmake
if (NOT WIN32)
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(ColourBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
@Natsu-Akatsuki
Natsu-Akatsuki / .bashrc
Last active July 25, 2022 04:22
Ubuntu
catkin_log() {
pkg_name=$1
cd "$(catkin locate -L)"/"${pkg_name}"/
}
# 配置conda命令行补全
CONDA_ROOT="${HOME}/anaconda3"
if [[ -r $CONDA_ROOT/etc/profile.d/bash_completion.sh ]]; then
source $CONDA_ROOT/etc/profile.d/bash_completion.sh
fi
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from scipy.optimize import minimize
def test01():
"""
优化单一变量
:return:
# v2.0 2022.3.31
# >>> 基础镜像 >>>
FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu20.04
# >>> 修改源,并安装apt包 >>>
# rm /etc/apt/sources.list.d/*: 删除cuda sources,避免无法update
RUN sed -i s@/archive.ubuntu.com/@/mirrors.ustc.edu.cn/@g /etc/apt/sources.list \
&& sed -i '37,49d' /etc/apt/sources.list \
&& rm /etc/apt/sources.list.d/* \
&& apt update \
#!/bin/bash
adjust_fan() {
pcie_pos=$1
target_state=$2
cur_state=$(sudo racadm get "System.PCIESlotLFM.${pcie_pos}" | grep LFMMode | cut -c 9-)
if [ "$target_state" != "$cur_state" ]; then
sudo racadm set System.PCIESlotLFM."${pcie_pos}".LFMMode "${target_state}"
echo "风扇调整为:${target_state}模式(Custom: off Automatic: on)"
fi
"latex-workshop.chktex.enabled": true,
"latex-workshop.latex.outDir": "%DIR%/build",
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.recipes": [
{
"name": "pdflatex ➞ bibtex ➞ pdflatex × 2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",

‎‎​

Topic

论文题目(精简)

Class Content
论文标题
单位
论文类别
@Natsu-Akatsuki
Natsu-Akatsuki / .condarc
Last active June 11, 2022 12:40
envSetup
auto_activate_base: false
channels:
- conda-forge
- defaults