dd命令用于转换和复制文件,不过它的复制不同于cp。之前提到过关于 Linux 的很重要的一点,一切即文件,在 Linux 上,硬件的设备驱动(如硬盘)和特殊设备文件(如/dev/zero和/dev/random)都像普通文件一样,只是在各自的驱动程序中实现了对应的功能,dd 也可以读取文件或写入这 ...
分类:
其他好文 时间:
2019-08-27 01:04:25
阅读次数:
86
背景 几种拷贝方式 方式1:Copying in Two Sample System Calls read(file, tmp_buf, len); write(socket, tmp_buf, len); 1. 首先,调用read时,文件A copy到了kernel模式; 2. 之后,CPU控制将 ...
分类:
编程语言 时间:
2019-08-20 12:32:52
阅读次数:
94
状态定义:$f_{i,j}$表示将前$i$件物品放入容量为$j$的背包中所能获得的最大价值 推理:第$i$件物品放或不放 方程:$f_{i,j}=max(f_{i 1,j},f_{i 1,j C_i}+W_i)$ $\Updownarrow $ 空间优化: $f_j$表示剩余$j$的被包能放下的最大 ...
分类:
其他好文 时间:
2019-08-18 16:02:05
阅读次数:
85
g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report 问题原因是因为内存不足 使用交换分区来解决: sudo dd if=/dev/zero of=/swapfile bs=64M ...
分类:
其他好文 时间:
2019-08-17 15:02:31
阅读次数:
90
import pymysql#使用pymysql模块conn=pymysql.connect(host='127.0.0.1',post=3306,user='root',passwd='zero',db='mysql')#连接数据库cousor=conn.cursor()#建立游标sql="CRE ...
分类:
数据库 时间:
2019-08-13 00:21:10
阅读次数:
156
题目链接:http://icpc.upc.edu.cn/problem.php?cid=1828&pid=7 题目描述 Now you have a string consists of uppercase letters, two integers A and B. We call a subst ...
分类:
其他好文 时间:
2019-08-10 14:03:38
阅读次数:
103
A. From Hero to Zero 通过取余快速运行第一步即可。由于$a \% b (a = b) include using namespace std; typedef long long LL; int main(){ int T; scanf("%d", &T); while(T ){ ...
分类:
其他好文 时间:
2019-08-10 10:18:22
阅读次数:
77
Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right. Note that elements beyond ...
分类:
其他好文 时间:
2019-08-10 10:08:31
阅读次数:
95
```
"number-leading-zero": "never", // 去掉小数点前面的0
``` ``` "prettier.stylelintIntegration": true, // vscode settings.json 文件中配置, prettier 会按照.stylelintr... ...
分类:
其他好文 时间:
2019-08-09 13:16:16
阅读次数:
105
1、通过ps命令的两种选项形式查看进程信息 2、通过top命令查看进程 3、通过pgrep命令查看sshd服务的进程号 [root@localhost ~]# pgrep -l sshd 1484 sshd 2755 sshd 4、查看系统进程树 5、使dd if=/dev/zero of=/roo ...
分类:
系统相关 时间:
2019-08-08 20:51:12
阅读次数:
148