Linux command prompt

  1. 简介:PS1为正常情况下提示符;PS2为开始跨行输入时的提示符;
  2. PS1配置分为两个部分,一部分是显示内容,另一部分是输入内容。
  3. 编辑 .bashrc 文件:
vim ~/.bashrc
F=Font,B=Background
F=30-37,B=40-47 [35;40:紫红色字;黑底][37;40:白色字;黑底]

Example: 
PS1='\[\e[35;40m\][\u@\t \w]\n\$ \[\e[37;40m\]'
PS1='\[\e[F;Bm\][\u@\t \w]\$ \[\e[F;Bm\]', change both color
PS1='\[\e[Fm\]  [\u@\t \w]\$ \[\e[Fm\]', don't change bg color

4. 使配置生效

source ~/.bashrc

5. 常用参数

\d :#代表日期,格式为weekday month date,例如:"Mon Aug 1"

\H :#完整的主机名称

\h :#仅取主机的第一个名字

\t :#显示时间为24小时格式,如:HH:MM:SS

\T :#显示时间为12小时格式

\A :#显示时间为24小时格式:HH:MM

\u :#当前用户的账号名称

\v :#BASH的版本信息

\w :#完整的工作目录名称

\W :#利用basename取得工作目录名称,所以只会列出最后一个目录

\# :#下达的第几个命令

\$ :#提示字符,如果是root时,提示符为:# ,普通用户则为:$

\n :#换行

网络连接信息

  1. 什么是子网掩码?
    1. 它是一种用来指明一个IP地址的哪些位标识的是主机所在的子网,以及哪些位标识的是主机的位的掩码。
  2. 什么是默认网关
    1. 局域网里面统一收发信息的机器的IP
  3. 什么是DHCP服务器?
    1. 用来为局域网中的电脑默认分发IP的机器,遵守DHCP(一种协议);
  4. 什么是NAT?
    1. 连接内网与外网的中转站;
  5. 什么是DNS?
    1. 一个将域名与IP相互映射的数据库

FM-index

In computer science, an FM-index is a compressed full-text substring index based on the Burrows-Wheeler transform, with some similarities to the suffix array. It was created by Paolo Ferragina and Giovanni Manzini, who describe it as an opportunistic data structure as it allows compression of the input text while still permitting fast substring queries. The name stands for Full-text index in Minute space.

It can be used to efficiently find the number of occurrences of a pattern within the compressed text, as well as locate the position of each occurrence. Both the query time and storage space requirements are sublinear[clarification needed] with respect to the size of the input data.

The original authors have devised improvements to their original approach and dubbed it “FM-Index version 2“. A further improvement, the alphabet-friendly FM-index, combines the use of compression boosting and wavelet trees to significantly reduce the space usage for large alphabets.

The FM-index has found use in, among other places, bioinformatics.

Three Rs and Five Freedoms

The Three Rs tenet (Replacement, Reduction and Refinement) guides scientists on the ethical use of animals in science.

  • Replacement refers to methods which avoid or replace the use of animals in an area where animals would otherwise have been used
  • Reduction refers to any strategy that will result in fewer animals being used
  • Refinement refers to the modification of husbandry or experimental procedures to minimize pain and distress

The Five Freedoms Are:

  1. Freedom from hunger and thirst (by ready access to fresh water and a diet to maintain full health and vigour).
  2. Freedom from discomfort (by providing an appropriate environment including shelter and a comfortable resting area).
  3. Freedom from pain, injury and disease (by prevention or rapid diagnosis and treatment).
  4. Freedom to express normal behaviour (by providing sufficient space, proper facilities and company of the animal’s own kind).
  5. Freedom from fear and distress (by ensuring conditions and treatment which avoid mental suffering).

related information:

http://www.ccac.ca/en_/standards/guidelines
http://3rs.ccac.ca/en/
http://3rs.ccac.ca/en/about/
http://3rs.ccac.ca/en/about/three-rs.html
http://3rs.ccac.ca/en/about/animal-welfare.html

windows系统一般重装流程

  1. 安装U深度,U盘启动盘制作工具:http://down.ushendu.com/20160514/UShenDu_STA_pe.exe
  2. 启动软件
  3. 选择配置:智能模式,HDD-FAT32,兼容模式,默认设置
  4. 选择好优盘,点击开始制作;(整个过程可能需要5到10分钟)
  5. 将之前下载好的系统镜像放到,GHO文件夹下;
  6. 重启电脑,选择从U盘启动,重启电脑;
  7. 选择“运行U深度Win03PE2013增强版”;
  8. 进入winpe系统后,会自动弹出对话窗口“U深度装机工具”,并检测出之前存放于U盘中的ghost系统;(Ghost系统是指通过赛门铁克公司(Symantec Corporation)出品的Ghost在装好的操作系统中进行镜像克隆的版本,通常GHOST用于操作系统的备份,在系统不能正常启动的时候用来进行恢复的。)
  9. 选择所要安装的硬盘分区,点击确定;
  10. 然后软件会,解压文件到选择的硬盘分区,然后重启电脑开始安装;

LibreOffice Calc – common functions

  1. or: returns true if an argument is true
    or(logical value 1, logical value 2, …)
  2. isna: returns true if value equals #N/A
    isna(value)
  3. isblank: returns true if value refers to an empty cell
    isblank(value)
  4. not: reverses the value of the argument
    not(logical value)
  5. na: not available. returns the error value #N/A
    na()

苏幕遮

碧云天,黄叶地,秋色连波,波上寒烟翠。山映斜阳天接水,芳草无情,更在斜阳外。

黯乡魂,追旅思。夜夜除非,好梦留人睡。明月楼高休独倚,酒入愁肠,化作相思泪。

山水落日雾
山水落日雾

范仲淹

学而第一

1.子曰:“学而时习之,不亦说(悦)乎?有朋自远方来,不亦乐乎?人不知而不愠,不亦君子乎?”

2.有子曰:“其为人也孝弟(悌),而好犯上者,鲜矣!不好犯上,而好作乱者,未之有也。君子务本,本立而道生。孝弟也者,其为仁之本与(yú)!”

3.子曰:“巧言令色,鲜矣仁。”

4.曾子曰:“吾日三省吾身:为人谋而不忠乎?与朋友交而不信乎?传(chuán)不习乎?”

5.子曰:“道(dǎo)千乘(shèng)之国,敬事而信,节用而爱人,使民以时。”

1 – Subtraction Games

Let S be a set of positive integers. The subtraction game with subtraction set S is played as follows. From a pile with a large number, say n, of chips, two players alternate moves.  A move consists of removing s chips from the pile where s ∈S. Last player to move wins.