安装NVIDIA驱动
查看系统适合驱动
ubuntu-drivers devices安装recommended的驱动,重启机器
sudo ubuntu-drivers autoinstall
sudo apt install nvidia-driver-525
reboot默认安装CUDA12
日常学习、工作的点滴记录
ubuntu-drivers devicessudo ubuntu-drivers autoinstall
sudo apt install nvidia-driver-525
reboot默认安装CUDA12
列表进行包含类比较,只能用遍历的方法这是比较麻烦的,可以使用set()转成集合进行包含比较。
list1 = ["one","two","three"]
list2 = ["one","three","two","four"]
set(list1).issubset(set(list2))
set(list2).issuperset(set(list1))
list1 = ["one","two","three","five"]
list2 = ["one","three","two","four"]
set(list1).intersection(set(list2))list1 = ["one","two","three","five"]
list2 = ["one","three","two","four"]
set(list1).symmetric_difference(set(list2))list1 = ["one","two","three","five"]
list2 = ["one","three","two","four"]
set(list1).difference(set(list2))
set(list2).difference(set(list1))list1 = ["one","two","three","five"]
list2 = ["one","three","two","four"]
set(list1).union(set(list2)) pythondeitertools模块下提供了一些用于生成排列组合的工具函数。
其中combinations为常用的函数:
import itertools
list1 = [1, 3, 4, 5]
list2 = list(itertools.combinations(list1, 2))
print(list2)
返回结果:
[(1, 3), (1, 4), (1, 5), (3, 4), (3, 5), (4, 5)]
mkdir /var/db/mongodbsudo docker pull mongo
sudo docker run -itd --name mongo –-restart=always -v /var/db/mongodb:/data/db -p 27017:27017 mongo
sudo docker exec -it mongo bash mailq
postsuper -d ALL