微博上看到的,惬意的图片,分享~






一、概述 克隆一个虚拟机之后,开启网卡报错:
|
1 |
Device eth0 does not seem to be present, delaying initialization.[FAILED] |
网上百度之后解决了,原理就不分析了,网上多的是,也不想去弄清楚原理,记录下解决方法。 二、解决方法 打开 vi /etc/udev/rules.d/70-persistent-net.rul ... 阅读更多
一、概述 X-Forwarded-For, X-Real-IP, remote_addr 是 http 协议中用来表示客户端地址的请求头。 X-Forwarded-For 和 X-Real-IP 只有请求存在代理时才有值,而 remote_addr 一直存在。 X-Forwarded-For:记录代理服务器的地址, ... 阅读更多
一、概述 标准库类型 string 用来表示可变长的字符串序列,使用它需要包含 string 头文件。 作为标准库的一部分,它被定义在 std 命名空间中,使用前需要加上以下代码:
|
1 2 |
#include <string> using std::string; |
## string/string.h/cstring 三者的区别 ... 阅读更多
一、创建用户
|
1 |
create user "user"@"host" identified by "123456" |
查询当前用户:
|
1 2 3 4 5 6 7 |
mysql> select user, host from user; +------+-----------+ | user | host | +------+-----------+ | root | 127.0.0.1 | +------+-----------+ 8 rows in set (0.00 sec) |
二、授权
|
1 2 3 4 |
grant [privileges] on db.table to "user"@"host" // 授予用户所有权限 grant all privileges on *.* to "maqian"@"%" |
三、修改用户密码 [crayon-694ae04098ab77 ... 阅读更多
微博上看到的,惬意的图片,分享~






一、未定义变量的初始值和变量作用域 下列 C/C++代码的输出结果是什么:
|
1 2 3 4 5 6 7 8 9 10 |
#include <stdio.h> int i = 1; int main(){ int i = i; printf("%d ", i); return 0; } |
c 语言中,局部变量的优先级会高于全局变量。这里 int i = i; 中的 i 和全局变量中的 i 是无关的。 对于全局变量和静态变量,没有初始化系统会默认置零。而局部变量 ... 阅读更多
一、问题描述 给定一个数 n,求该数转换成二进制后包含的 1 的个数。 二、代码实现 非常老也是非常经典的一个面试题,第一次面试的时候就遇到了,这里只要把 n 和 n-1 循环按位与就可以了。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#include <stdio.h> int main(){ int n, cnt; while(scanf("%d", &n) != EOF){ cnt = 0; while (n){ cnt ++; n = n & (n - 1); } printf("%d\n", cnt); } return 0; } |
三、变形 题目非常老,经常会被变形。例如把该过程封装成 ... 阅读更多
参考文档:官方安装文档,安装方法已经制作成一键安装脚本位于码云。 git clone https://gitee.com/vazd/subversion-installer.git 运行 install_svn.sh 即可完成安装。 一、安装必备组件 依赖项:yum install autoconf l ... 阅读更多
后来,我总算学会了,如何去爱。可惜你,早已远去,消失在人海。 后来,终于在眼泪中明白,有些人,一旦错过就不再。