linux
BuckPhil
这个作者很懒,什么都没留下…
展开
-
线程互斥量
测试完成一道题(google面试题) 有四个线程1、2、3、4。线程1的功能就是输出1,线程2的功能就是输出2,以此类推………现在有四个文件ABCD。初始都为空。现要让四个文件呈如下格式:A:1 2 3 4 1 2….B:2 3 4 1 2 3….C:3 4 1 2 3 4….D:4 1 2 3 4 1….请设计程序。#include <stdio.h>#include <pthread.h>原创 2017-03-02 18:03:23 · 360 阅读 · 0 评论 -
__VA_ARGS__
内核中有这种形式的代码,遂测试一番#include <stdio.h>#define SEC_PRINT(fmt, ...) \ printf("SEC_PRINT: " fmt, ##__VA_ARGS__)#define FIR_PRINT(name, fmt, args...) \ SEC_PRINT("FIR_PRINT: %s: " fmt, name, args)int原创 2017-05-26 15:43:40 · 379 阅读 · 0 评论 -
终端打印有颜色的字体
#include <stdio.h>#define printf_grey(fmt, args...) \ printf("\e[1;30m" fmt "\e[0m", ## args)#define printf_red(fmt, args...) \ printf("\e[1;31m" fmt "\e[0m", ## args)#define printf_green(fmt,原创 2017-05-31 10:30:55 · 1254 阅读 · 0 评论 -
git 常用命令
git 常用命令创建仓库: git init添加邮箱: git config --global user.email "email@example.com"添加用户: git config --global user.name "Your Name"查看状态: git status添加文件到stage区: git add <filename ...>提交文件到仓库: git commit -m "翻译 2017-02-22 00:05:18 · 494 阅读 · 0 评论 -
chromium浏览器安装flashplayer(Ubuntu16.10)
Chromium手动安装flashplayer安装Chromium浏览器 sudo apt-get install chromium-browser 打开chromium浏览器,随便打开一个网页的视频,提示未安装flash插件,点击 立即安装,即可下载 linux 版的flashplayer。(一般是.tar.gz格式的压缩文件,下载后的位置在~/Downloads) 例如我下载的是:fl原创 2016-11-28 15:33:54 · 740 阅读 · 0 评论