摘要: 一、 MySQL权限级别介绍 全局——可以管理整个MySQL 库——可以管理指定的数据库 表——可以管理指定数据库的指定表 字段——可以管理指定数据库的指定表的指定字段 权限存储在mysql库的user, db, tables_priv, columns_priv, procs_priv这几个系统表 阅读全文
posted @ 2022-04-06 14:31 tao10203 阅读(162) 评论(0) 推荐(0) 编辑
摘要: ##Socket函数 #include <sys/types.h> #include <sys/socket.h> int socket(int domain, int type, int protocol); domain 协议族: AF_OCAL, AF_INT, AF_INET7 type S 阅读全文
posted @ 2021-04-16 19:06 tao10203 阅读(51) 评论(0) 推荐(0) 编辑
摘要: ###查找第一个不大于x的值 bool BinarySearch(int i, int j, vector<int> nums, int target) { while (i < j) { int mid = (j - i) / 2 + i; if (nums[mid] <= target) i = 阅读全文
posted @ 2021-03-30 21:00 tao10203 阅读(93) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int add(int a, int b) { int c; while(b!=0){ c=(unsigned int)(a&b)<<1;//进位 a^=b;//a+b b=c;//进位赋给b,直到没有进位,因为a加上进位可能还产生进位 } retu 阅读全文
posted @ 2021-03-29 20:14 tao10203 阅读(35) 评论(0) 推荐(0) 编辑
摘要: #include <unistd.h> int pipe(int pipefd[2]); 功能:创建一个匿名管道,用来进程间通信。 参数:int pipefd[2] 这个数组是一个传出参数。 pipefd[0] 对应的是管道的读端 pipefd[1] 对应的是管道的写端 返回值: 成功 0 失败 - 阅读全文
posted @ 2021-03-29 17:14 tao10203 阅读(146) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: string reverseWords(string s) { int n = s.size(); string ans = ""; for (int i = n - 1; i >= 0; i--) { if (s[i] != ' ') { int 阅读全文
posted @ 2021-03-28 20:24 tao10203 阅读(24) 评论(0) 推荐(0) 编辑
摘要: ####IPC: Inter Processes Communication 进程是一个独立的资源分配单位,不同进程(用户进程)的资源是独立的,没有关联,不能在一个进程中直接访问另一个进程的资源。 但是进程不是孤立的,不同的进程需要进行信息的交互和状态的传递等,因此需要进程间通信 ####进程间通信 阅读全文
posted @ 2021-03-28 20:10 tao10203 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 便捷方法 struct Node { int x,y; bool operator <(Node a) const { return y < a.y; } bool operator >(Node a) const { return y > a.y; } }; priority_queue<Node 阅读全文
posted @ 2020-11-23 20:09 tao10203 阅读(587) 评论(0) 推荐(0) 编辑
摘要: 1103 Integer Factorization (30分) The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You 阅读全文
posted @ 2020-11-22 17:33 tao10203 阅读(119) 评论(0) 推荐(0) 编辑
摘要: prim的基本思想是对图G(V,E)设置集合S来存放已经被访问的顶点 每次从集合V-S(未加入最小生成树的节点)中选择与集合S最近点顶点u(用d[u]记录u与S的最短距离),将u加入集合S,同时将这个节点与集合S最近的边加入最小生成树 以顶点u作为集合S与V-S的接口,优化从u出发能达到的且还未访问 阅读全文
posted @ 2020-11-01 21:10 tao10203 阅读(114) 评论(0) 推荐(0) 编辑