导言
以现实中实际使用的应用为基础,根据其领域和应用计算特点来分类。
1 | len(day) |
strings, lists, tuples
1 | # Correct: |
1 | try: |
调参需要测试间隔值
1 | for i in range(1, 101, 3): |
enumerate 函数结合 for 循环遍历 list,以修改 list 中的元素。enumerate 函数返回一个包含元组的迭代器,其中每个元组包含当前遍历元素的索引和值。在 for 循环中,我们通过索引 i 修改了列表中的元素。1 | # 对于 二维list appDataDict |
itertools — 为高效循环而创建迭代器的函数
1 | for a,b,c in permutations((a,b,c)): |
x = round(x,3)# 保留小数点后三位
1 | %c 格式化字符及其ASCII码 |
1 | print("My name is %s and weight is %d kg!" % ('Zara', 21)) |
' '.join(pass_list) and pass_list.split(" ")
对齐"\n".join(["%-10s" % item for item in List_A])
1 | text = "Hello, world!" |
Python2.6 开始,通过 {} 和 : 来代替以前的 %
1 | >>>"{} {}".format("hello", "world") # 不设置指定位置,按默认顺序 |
数字处理
1 | print("{:.2f}".format(3.1415926)) # 保留小数点后两位 |
https://www.runoob.com/python/python-lists.html
1 | #创建元组 |
1 | tinydict = {'a': 1, 'b': 2, 'b': '3'} |
empty dict
1 | a= {} |
1 | a_dict = {'color': 'blue'} |
1 | del tinydict['Name'] # 删除键是'Name'的条目 |
1 | tinydict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'} |
无序不重复序列
1 | a= set() # 空set |
1 | thisset.add("Facebook") |
1 | s.remove( x ) |
1 | setL=set(listV) |
1 | my_set = {'Geeks', 'for', 'geeks'} |
https://blog.csdn.net/weixin_63719049/article/details/125680242
Intel SDM(Software Developer's Manual)
This set consists of
| volume | Descriptions | pages(size) |
|---|---|---|
| volume 1 | Basic Architecture | 500 pages(3MB) |
| volume 2 (combined 2A, 2B, 2C, and 2D) | full instruction set reference | 2522 pages(10.8MB) |
| volume 3 (combined 3A, 3B, 3C, and 3D) | system programming guide | 1534 pages(8.5MB) |
| volume 4 | MODEL-SPECIFIC REGISTERS (MSRS) | 520 pages |
volume3: Memory management(paging), protection, task management, interrupt and exception handling, multi-processor support, thermal and power management features, debugging, performance monitoring, system management mode, virtual machine extensions (VMX) instructions, Intel® Virtualization Technology (Intel® VT), and Intel® Software Guard Extensions (Intel® SGX).
more graph and easier to read.
暂无
暂无
上面回答部分来自ChatGPT-3.5,没有进行正确性的交叉校验。
https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html
timedatectl 是一个管理日期和时间的工具,可以用来永久设置系统时间和时区。
1 | sudo timedatectl set-time "2024-10-26 19:12:19" |
如果发现时区也不正确,可以用下面的命令设置时区:
1 | sudo timedatectl set-timezone "Asia/Shanghai" |
例如,将时区设置为中国标准时间 (CST, UTC+8),时区名称需要使用 timedatectl list-timezones 查看可用的时区列表。
1 | df -h . |
deep为1
1 | du -h -d . |
1 | # thi |
ps aux linux command whill show no zero cpu usage when the process is sleeping beacuse of its snapshots mechanism
1 | dpkg: 处理归档 /var/cache/apt/archives/bat_0.12.1-1build1_arm64.deb (--unpack)时出错: |
1 | sudo apt-get purge -h |
tree -L DepthSIze Folder_Path
1 | #分析symbols |
综合来看,使用 nm -gDC <filename> 命令可以查看一个二进制可执行文件或者共享库中的全局符号表和动态符号表,并将包含其中的 C++ 符号名还原成源代码中的名称。
1 | shaojiemike@snode6 ~/github/gem5 [10:49:56] |
It is all started with two confusing situation.
ps aux | grep -v process_name, the process is in Sl+ state. But the cpu usage is not zero.watch "ps aux |grep 3496617" always show the same cpu usage percentage, which is very confusing beacause htop always show up-down value. and pidstat -p 3516617 show cpu% less than 100%.