- 博客(4)
- 收藏
- 关注
原创 c++格式化时间
#include <ctime> #include <iostream> void timestamp() { # define TIME_SIZE 40 static char time_buffer[TIME_SIZE]; const struct std::tm *tm_ptr; std::time_t now; now = std::time ( NULL ); tm_ptr = std::localtime ( &now ); st
2021-11-29 11:23:25 195
原创 判断一个数是否是2的整数次幂
十进制(n) 二进制(n) 二进制(n-1) 结论 2 10 01 n&(n-1) == 0 4 100 011 n&(n-1) == 0 8 1000 0111 n&(n-1) == 0 16 10000 01111 n&(n-1) == 0 反过来,判断一个数的二进制位全是1,则 n&(n+1) == 0; ...
2021-10-13 11:45:33 69
原创 Android 添加SELinux权限
文件类型:*.te,通常位于 */system/sepolicy/vendor 目录下 示例: selinux权限报错: avc: denied { read } for pid=1831 comm="servicemanager" name="current" dev="proc" ino=62432 scontext=u:r:servicemanager:s0 tcontext=u:r:networkserver:s0 tclass=file permissive=1 解析: scontex: 源对
2021-09-29 10:19:59 191
原创 组播实现示例:udp demo
组播示例:udp demo@TOC 代码如下(示例): #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <netdb.h> #include <errno.h> #include<
2021-09-23 16:52:09 454
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人