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 com­put­er sci­ence, an FM-index is a com­pressed full-text sub­string index based on the Bur­rows-Wheel­er trans­form, with some sim­i­lar­i­ties to the suf­fix array. It was cre­at­ed by Paolo Fer­rag­i­na and Gio­van­ni Manzini, who describe it as an oppor­tunis­tic data struc­ture as it allows com­pres­sion of the input text while still per­mit­ting fast sub­string queries. The name stands for Full-text index in Min­ute space.

It can be used to effi­cient­ly find the num­ber of occur­rences of a pat­tern with­in the com­pressed text, as well as locate the posi­tion of each occur­rence. Both the query time and stor­age space require­ments are sublinear[clarification need­ed] with respect to the size of the input data.

The orig­i­nal authors have devised improve­ments to their orig­i­nal approach and dubbed it “FM-Index ver­sion 2″. A fur­ther improve­ment, the alpha­bet-friend­ly FM-index, com­bi­nes the use of com­pres­sion boost­ing and wavelet trees to sig­nif­i­cant­ly reduce the space usage for large alpha­bets.

The FM-index has found use in, among oth­er places, bioin­for­mat­ics.

DAVID — web service

  1. The data anno­tat­ed with tool (Perl ver­sion) can only gen­er­at­ed accord­ing to the old data­base rather than new.(unsolved yet 20160710)

windows 10 安装流程

  1. https://www.microsoft.com/en-us/software-download/windows10
  2. down­load “media cre­ation tool”;
  3. run “media cre­ation tool”;
  4. Select Cre­ate instal­la­tion media for anoth­er PC.
  5. down­load .iso file.

Three Rs and Five Freedoms

The Three Rs tenet (Replace­ment, Reduc­tion and Refine­ment) guides sci­en­tists on the eth­i­cal use of ani­mals in sci­ence.

  • Replace­ment refers to meth­ods which avoid or replace the use of ani­mals in an area where ani­mals would oth­er­wise have been used
  • Reduc­tion refers to any strat­e­gy that will result in few­er ani­mals being used
  • Refine­ment refers to the mod­i­fi­ca­tion of hus­bandry or exper­i­men­tal pro­ce­dures to min­i­mize pain and dis­tress

The Five Freedoms Are:

  1. Free­dom from hunger and thirst (by ready access to fresh water and a diet to main­tain full health and vigour).
  2. Free­dom from dis­com­fort (by pro­vid­ing an appro­pri­ate envi­ron­ment includ­ing shel­ter and a com­fort­able rest­ing area).
  3. Free­dom from pain, injury and dis­ease (by pre­ven­tion or rapid diag­no­sis and treat­ment).
  4. Free­dom to express nor­mal behav­iour (by pro­vid­ing suf­fi­cient space, prop­er facil­i­ties and com­pa­ny of the animal’s own kind).
  5. Free­dom from fear and dis­tress (by ensur­ing con­di­tions and treat­ment which avoid men­tal suf­fer­ing).

relat­ed infor­ma­tion:

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 argu­ment is true
    or(logical val­ue 1, log­i­cal val­ue 2, …)
  2. isna: returns true if val­ue equals #N/A
    isna(value)
  3. isblank: returns true if val­ue refers to an emp­ty cell
    isblank(value)
  4. not: revers­es the val­ue of the argu­ment
    not(logical val­ue)
  5. na: not avail­able. returns the error val­ue #N/A
    na()

苏幕遮

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

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

山水落日雾
山水落日雾

范仲淹

学而第一

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

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

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

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

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

1 — Subtraction Games

Let S be a set of pos­i­tive inte­gers. The sub­trac­tion game with sub­trac­tion set S is played as fol­lows. From a pile with a large num­ber, say n, of chips, two play­ers alter­nate moves.  A move con­sists of remov­ing s chips from the pile where s ∈S. Last play­er to move wins.