## 求下一个排列数

LeetCode上遇到这么一个题：Next Permutation

## 整数除法与右移运算

C/C++中整数除法，去除小数部分，整数部分作为返回结果。

#include <stdio.h>
int main(void) {
printf("%d\n%d\n", 6>>2, -6>>2);
return 0;
}


## 谈谈localhost

$python3 ./manage.py runserver ... Starting development server at http://127.0.0.1:8000/ ...  然后想起laravel项目也是8000端口，就同时启动laravel项目： $ php artisan serve
Laravel development server started on http://localhost:8000/


• 群聊
• 私聊
• 消息提醒
• 用户状态标记
• 聊天记录保存
• 表情支持

## 实现tee

The tee command reads its standard input until end-of-file, writing a copy of the input to standard output and to the file named in its command-line argument. (We show an example of the use of this command when we discuss FIFOs in Section 44.7.) Implement tee using I/O system calls. By default, tee overwrites any existing file with the given name. Implement the –a command-line option (tee –a file), which causes tee to append text to the end of a file if it already exists. (Refer to Appendix B for a description of the getopt() function, which can be used to parse command-line options.)

tee能够从标准输入读入，然后输出同样内容到标准输出，同时也会写到指定的文件中。如果文件存在那么就覆盖，若指定了-a选项，那么就追加内容到文件尾。

## 《The Linux Programming Interface》第三章系统概述练习

When using the Linux-specific reboot() system call to reboot the system, the second argument, magic2, must be specified as one of a set of magic numbers (e.g., LINUX_REBOOT_MAGIC2 ). What is the significance of these numbers? (Converting them to hexadecimal provides a clue.)