04 2020 档案
摘要:#include<stdio.h> #include<stdlib.h> int main() { int ret = rename("./file_mmap","/root/file_mmap"); if(ret<0) { perror("rename error\n"); } /*** (1)
阅读全文
摘要:数组是一个大的集合,定义一个大数据类型变量 (看成整体) #include "stdafx.h" #include <stdio.h> #include <string.h> #include <math.h> // 顺序stack #define Max 20 struct stack { cha
阅读全文
摘要:他们都是容器,存需要的东西用的。 普通链表:每次指针指向的节点的首地址,因此非常好访问节点的各个member的数据。 内核链表就不一样了:定义了List_head,之后的节点指向都是节点的里面的list指针域,因此它不是这个结构体的首地址,因此想访问整个结构体变量,就必须采用一种骚操作,得到这个结构
阅读全文
摘要:echo 1 > /proc/sys/kernel/sysrq echo b > /proc/sysrq-trigger linux重启命令 (需要两条) du -sh xxx 查看文件夹包含里面大小 (看做整体 全集) ls -lh xxx 查看文件夹内部组件大小 (部分 子集)
阅读全文
摘要:git add ./* xxx xx -f //添加到暂存区 git add -A ./* xxx -f git rm xxx git reset HEAD 全部撤销
阅读全文
摘要:每次输入密码的时候,都是空荡荡的,好烦躁。 解决: #sudo visudo //行尾 可添加如下的 Defaults pwfeedback 修改如下操作:
阅读全文
摘要:http://ffmpeg.org/ // 下载 我想找一个mp4转yuv,找了半天,没有找到。 mp4转yuv ffmpeg -i test.mp4 test.yuv 播放yuv ffplay.exe -f rawvideo -video_size 720x720 -i test.yuv
阅读全文
摘要:fp = fopen("D:\\pthread\\Pre-built.2\\111.yuv", "rb+"); // 绝对路径 符号 \\
阅读全文
摘要:http://www.libsdl.org/ // 代码是雷神写的 我只是拿过来使用而已 #include "stdafx.h" #include <string.h> #include <iostream> extern "C" { #include "SDL.h" }; #undef main
阅读全文
摘要:https://learngitbranching.js.org/?demo=&locale=zh_CN
阅读全文
摘要:(1) 运用链表,可以各种前进和后退. (2) 每个节点采用的继承机制. (3) 它的命令之间存在同步关系,做完一件事情,需要中间灵活的选择哪个(一个或者多个)命令,这个和linux命令不一样的地方。
阅读全文
摘要:我们除了在工作区 还在一个分支上 git branch -a 查看我们在哪个分支上面 git merge xxx(我们想要的分支) 操作一遍就会明白的 主要应用场景: (1)新功能开发合并到master分支(或者想要的分支上面) 实验的话: 可以不需要搭建自己的环境 自己多建立几个测试的分支 疯狂操
阅读全文
摘要:track:追踪 untrack:没有追踪 还有一个 git branch -a 发现出现了不在任何一个分支上面 使用下面这个命令也可以有效 解决方法: git clean -f
阅读全文
摘要:git grep -n "module_init"
阅读全文
摘要:实际工作中,我们事情需要不断的回溯,直到success. 添加commit: git commit -m "提交者:xxx " 然后你还可以操作文件夹里面的操作 git commit --amend 会进入 nano编辑器 可以编辑中午 记得保存. 如果不想改变commit的话 可以使用 git c
阅读全文
摘要:平行模块化风格代码: 优点:代码易读,风格明确,代码表面看起来来思路清晰 易与多人开发。 缺点: 结构混乱 各个模块的 通信模块内部之间的关系混乱 由于是平行和简单的结构 实际上如果模块之间有关联,会导致软件混乱。 解决:层次化组件化软件
阅读全文
摘要:git 中会突然冒出这个。。。。。。。。。 一脸懵。。。 ^ 使用的是 ctrl键 。。
阅读全文
摘要:git reflog: 知道所有操作记录. git log:显示是提交的版本号 两者意识不一样。 { git rm -rf xxx git add xxx 两个是常用的命令 对比一下svn svn也有commit和 rm 命令 git commit -m "提交者:xxxx" git pull or
阅读全文
摘要:https://www.ibm.com/support/knowledgecenter/zh/SS8PJ7_9.6.1/com.ibm.rsa_base.nav.doc/topics/crootintro_rsa_base.html git就是这样设计的 https://www.cnblogs.co
阅读全文
摘要:// Queue.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include <stdio.h> #include <string.h> // 队列是现实生活中理想模型一种 忽略很多细节 但即使这样 依然很有用 // Task:实现一个数据队列 数组实现 任务
阅读全文
摘要:Visual studio调试: 定位代码 缩小调试范围 打断点 不断继续run 查看需要变量值与自己预期结果 判断哪里问题 #include "stdafx.h" #include <stdio.h> #include <string.h> const char* str[] = { "Hello
阅读全文
摘要:字符串数组是指针数组,需要使用二级指针 #include "stdafx.h" #include <stdio.h> #include <string.h> const char* str[] = { "Hello","abc","applef","man","C程序设计","指针数组" }; co
阅读全文
摘要:(1) 线程系统的三个基本要素:执行环境,调度,同步。 同步: 使用互斥量来保护共享数据,使用条件变量来通信,使用条件变量来通信,其他同步机制,如信号量管道和消息队列。互斥量允许线程在访问共享数据 锁定他,以避免其他线程干扰。条件变量允许线程等待共享数据到达某个期望的状态。(队列非空或者资源可用)
阅读全文
摘要:使用c库操作文件 #include "stdafx.h" #include <stdio.h> #include <pthread.h> #include <assert.h> #include <windows.h> #include <string.h> static void* Functio
阅读全文
摘要:我们写的代码最终都要编译成为二进制程序,然后这个程序放到内存里面去。 和多进程比较一下 区别
阅读全文
摘要:进程和线程调度理解,就是操作系统让线程或者进程进入生命周期各种状态。 隐形的手。
阅读全文
摘要:设备号 进程号 线程号 姓名 万物有个名字 万物通过名字来进行识别 多个同样性质的东西。
阅读全文
摘要:#include "stdafx.h" #include <pthread.h> #include <stdio.h> #include <windows.h> #include <stdio.h> //#include <assert.h> int main(int argc, _TCHAR *a
阅读全文
摘要:系统调用的函数api头文件 kernel\include\uapi\asm-generic #include <unistd.h> #include <sys/syscall.h> #include <sys/types.h> #include <signal.h> #include <stdio.
阅读全文
摘要:IO就是读数据或者写数据 包含一个时间概念在里面 包含一个system概念 读数据的策略 阻塞和非阻塞时设备访问的两种基本形式。使用这两种形式,驱动程序可以灵活地支持阻塞和非阻塞的访问。select函数底层实现,里面实现用就是等待队列。 阻塞调用时指调用结果返回之前,当前线程挂起。函数只有得到结果之
阅读全文
摘要:#ifndef _IMPLEMENT_H #define _IMPLEMENT_H #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif #define _WIN32_WINNT 0x400 #include <windows.h> /* * In case
阅读全文
摘要:#include "stdafx.h" #include <pthread.h> #include <stdio.h> void * thread_routine(void*arg); void * thread_routine(void*arg) { return arg; } int main(
阅读全文
摘要:#include "pthread.h" #include "implement.h" int pthread_attr_init (pthread_attr_t * attr) /* * * DOCPUBLIC * Initializes a thread attributes object wi
阅读全文
摘要:2.1 节讲诉创建和管理线程的编程内容,即如何建立线程,线程在程序中如何表示,以及建立线程后能对他们进行的基本操作。 2.2 讲诉线程的生命周期,从线程建立到线程回收。该节将讲诉线程所有能够经历的调度状态。
阅读全文
摘要:方法一 #include "stdafx.h" #include <stdio.h> #include <assert.h> #include <windows.h> #include <process.h> // 包含这个头文件就行 方法二 移植posix库: 移植官网: ftp://source
阅读全文
摘要:所有英文字符都是使用字符数组存储的,也就是打通了计算机与英语的联系。 static void strarray_printf(char *data, int len) { int i; for (i = 0; i < len; i++) { printf("0x%02x ", data[i]); }
阅读全文
摘要:这篇文章说的很好 https://www.cnblogs.com/yaoqingzhuan/p/10889718.html 我遇到的坑: (1) .~bash 是在home目录下面的 (2)export里面的路径错误 也不会报错 所以的要认真看一下 我在这里坑过。 (3)直接export xxx 命
阅读全文

浙公网安备 33010602011771号