用tensorflow的conv2d卷积实现均值blur import numpy as npimport matplotlib.pyplot as pltimport cv2import tensorflow as tffrom tensorflow.python.framework import graph_utilimport timeblur_size = 31s_time = time.time()# (height, width, channel)BGR -- > HWC,RGB# img = cv2.imread(
多线程信号cond_wait()为什么使用while int empty_slot = 5;producer(){ while(1) { lock(&empty_cnt_lock); while(empty_slot == 0){ cond_wait(&empty_cond, &empty_cnt_lock); } empty_slot --; unlock(&empty_cnt_lock); .
将字符串作为shell命令执行 eval: eval [arg ...] Execute arguments as a shell command. Combine ARGs into a single string, use the result as input to the shell, and execute the resulting commands. Exit Status: Returns exit status of command or success if.
sizeof用法 #include <stdio.h>#include <stdlib.h>void test(char *p){ printf("p: %lu %s ", sizeof(p), p);}int main(){ char str[30] = "zhang"; char str_two[7][8] = {0}; printf("str: %lu %s ", sizeof(str), str); printf("str_two: %lu ", s.
strncat越界,踩内存 #include <string.h>#include <stdio.h> #include <stdlib.h>int main(){ char *a = (char *)malloc(sizeof(char) * 10); char w[30]="WWWWWWWWWWWWWWWWWWWWWWWWWWWW"; printf("w[30]: %c ", w[30]); //越界 memcpy(a, "123456789", 10); mem.
VirtualBox 中虚拟机扩容ubuntu硬盘空间,完全图形化操作 1、关闭虚拟机2、打开cmd窗口,进入到VirtualBox目录下(C:\Program Files\Oracle\VirtualBox),可以看到改目录下面有VBoxManage.exe3、VBoxManage modifyhd <虚拟硬盘路径> --resize 204800,例如:扩容到200GB,命令如下: VBoxManage modifyhd "D:\vm_ubuntu\ubuntu18.04\ubuntu18.04.vdi" --resize 204800...
获取文件大小fseek、stat、fstat #include <sys/stat.h>#include <unistd.h>#include <stdio.h>#include <fcntl.h>/*************************************************************************struct stat { dev_t st_dev; //文件的设备编号 ino_t s.
dirname与basename的用法注意 #include <stdio.h>#include <stdlib.h>#include <string.h>#include <libgen.h>int main(){ char in_filename[128] = "/tmp/test_name.file"; char out_filename[128]; char *dirc = NULL, *basec = NULL, *bname = NULL, *dname = NULL;.
shell 变量名中包含变量 eval接受一个字符串作为它的参数,并对它进行评估,就好像你在命令行上键入了该字符串一样。(如果你传递了几个参数,它们首先与它们之间的空格相连接。)eval echo \${$n}运行传递给的参数eval。扩展后,参数是echo和${1}。所以eval echo \${$n}运行命令echo ${1}。string=idid=1stream_1="111111"cmd="{$(eval echo \${stream_${id}}), 222222}"ech...
Makefile中空格与tab makefile实际上是在一个文件中用两种完全不同的“语言”编写的。recipe(运行编译器,echo等的命令)是用shell脚本语法编写的。不在recipe中的其余makefile是用makefile语法编写的。为了使make能够区分配方和不是配方的东西,它使用了TAB字符。因此,以TAB开头的行被假定为recipe的一部分,因此它们是shell脚本并传递给shell进行解析。而不以TAB开头的行不能成为recipe的一部分,它们必须是make语法,用空格。ifneq是makefile
数组名 、 函数名 和 数组名取地址 、 函数名取地址 #include <stdio.h>#include <stdlib.h>#include <string.h>void test(){ printf("123456");}int main(){ char a[10]; printf("&a:%p, a:%p, &a[0]:%p ", &am...
从内存中保存yuv文件 数据是NV12YYYYYYYYYYYYYYYYUVUVUVUV frame_y_buf = (u8 *)malloc(width * height); if (frame_y_buf == NULL) { printf("allocate frame_y_buf error, line:%d!", __LINE__); rval = -1; b...
获取数组的第一大值和第二大值 #include <stdio.h>#include <stdlib.h>#include <string.h>int arry[10] = {8, 2, 4, 6, 8, 3, 1};int main(){ int n = 0, i = 0 ,j = 0; int max_value = 0, max_value_index = 0; i...
Win10 打开OpenSSH 一、安装OpenSSH 客户端 、OpenSSH 服务器设置 -> 管理可选功能 -> 添加功能 -> [OpenSSH 客户端] [OpenSSH 服务器]二、启动服务并设置为自动启动SSH服务 -> 启动SSH服务 ->属性 -> 启动选择 -> 自动ubuntu$ scp 1.txt xxx@company@1...