mardi 26 avril 2011

connection words

This is what a teacher gave me few years ago.

Expressing Cause:
- Since (informal)
- As (informal)
- Due to the fact that /Due to (formal)
- Owing to the fact that/ Owing to (formal)

Expressing Consequence:
- Therefore (formal)
- Consequenly (formal)
- Hence (formal)
- And that's why (informal)
- Accordingly (formal)

Expressing Contrast:
- Yet (neutral)
- However (neutral)
- Mind you (informal)
- In contrast (formal)
- Although (neutral)
- (Even) though (neutral)
- Much as (neutral)
- In spite of the fact that/ In spite of (neutral)
- Despite the fact that/ Despite

Additional information:
- Furthemore (formal)
- In addition (formal)
- Moreover (formal)
- On top of that (informal)
- Besides this/ Besides the fact that (neutral)
- As well as that (neutral)
- Not only...but (also) (neutral)

vendredi 15 avril 2011

gnuplut Oblique

This is documented, albeit obscurely, in "help set term postscript":
In addition to the standard postscript fonts, an oblique version of the
Symbol font, useful for mathematics, is defined. It is called
"Symbol-Oblique".

mardi 12 avril 2011

to do

1.动词+介词to+动名词

⑴ admit to doing sth 承认做了某事

⑵ apply to doing sth 适用于做某事

⑶ object to doing sth 反对做某事

⑷ see to doing sth 负责做某事

⑸ stick to doing sth 坚持做某事

⑹ take to doing sth 喜欢上做某事

2.动词+宾语+介词to+动名词

⑴ apply oneself to doing sth 专心致力于做某事

⑵ devote sth to doing sth 把……献给做某事

⑶ devote oneself to doing sth 献身于做某事

⑷ limit sth to doing 把……限制在某事的范围内

⑸ reduce sb to doing sth 使某人沦为做某事

3.动词+名词+介词to+动名词

⑴ give one’s life to doing sth 献身于做某事

⑵ give one’s mind to doing sth 专心做某事

⑶ have a dislike to doing sth 厌恶做某事

⑷ have an eye to doing sth 注意做某事

⑸ have an objection to doing sth 反对(反感)做某事

⑹ pay attention to doing sth 注意做某事

⑺ set one’s mind to doing sth 决心做某事

4.be+形容词+介词to+动名词

⑴ be equal to doing sth 等于做某事, 能胜任做某事

⑵ be used to doing sth 习惯于做某事

⑶ be opposed to doing sth 反对做某事

⑷ be reduced to doing sth 使某人沦为做某事

⑸ be devoted to doing sth 把时间(钱、精力等)献给做某事

⑹ be limited to doing sth 把……限制在做某事的范围内

5.其他结构+介词to+动名词

⑴ get down to doing sth 开始做某事,认真处理某事

⑵ look forward to doing sth 盼望做某事

⑶ what do you say to doing sth 你认为做某事如何?

latex symbol

\begin{table}[htbp]
\centering
\caption{LDA measuring locations and their symbols}
\label{tab:}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}\hline
$s^*$ & 0.21 & 0.31 & 0.41 & 0.50 & 0.60 & 0.70 & 0.80 & 0.90 & 0.99 \\ \hline
$x/c_a$& 0.21 & 0.31 & 0.41 & 0.50 & 0.60 & 0.70 & 0.80 & 0.90 & 0.99 \\ \hline
Symbol-EXP & $\boxdot$ & $\blacksquare$ &$\odot$ & $\bullet$ & $\vartriangle$&$\blacktriangle$&$\triangledown$ & $\blacktriangledown$ & $\Diamond$\\ \hline
Symbol-CFD & $\boxdot$ & $\blacksquare$ &$\odot$ & $\bullet$ & $\vartriangle$&$\blacktriangle$&$\triangledown$ & $\blacktriangledown$ & $\Diamond$\\ \hline
\end{tabular}
\end{table}
% Symbol & $\boxdot$ & $\blacksquare$ &$\odot$ & $\bollet$ & $\vartriangle$&$\blacktriangle$&$\triangledown$ & $\blacktriangledown$ & $\Diamond$\\ \hline

gnuplot infinity

dvipdf -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -dPDFSETTINGS=/printer midspan.dvi

dimanche 10 avril 2011

英语中副词的位置

副词是英语中用法比较灵活的一类词,主要用来修饰动词、形容词或另一类副词。不同的副词在句子中的位置是不同的。以下就笔者所见作一小结。
1.时间副词(now,then,recently,soon, just now,right away,etc.)可以放在整个句子或从句之前或后,并通常放在句末。其中 then,recently可以放在动词之前;still常放在动词之前或系动词、助动词、情态动词之后;而yet常放于句末,并且句子常用否定形式。例如:
I'll then turn to my classmates for help.
When all the students finished the morning exercise,he was still asleep.
We haven't finished the work yet.
2.地点副词(here,there,down,anywhere,everywhere,inside,etc.)和方式副词(well,quickly,kindly,etc.)常放在宾语之后,或不及物动词之后。其中here,there,up,down等副词与不及物动词go,come,stand,walk, lie等词连用时,副词可置于句首。如句子主语是名词或名词短语时,句子需用完全倒装语序。例如:
There stands the tower.
Down came the rain.
We looked for the lost wallet here and there,but in vain.
3.程度副词(very,quite,almost,fairly, nearly,just,extremely,hardly,etc.)常放在被修饰词之前,但当very修饰动词时,常与 much连用并置于句末。例如:
I like her very much.
With one false movement,he nearly loses the whole game.
4.频度副词(ever,never,often,always, seldom,sometimes,etc.)常放在动词之前,或系动词、助动词、情态动词之后。其中some- times也常置于句首。例如:
I have never been to America.
Sometimes he phones me,and sometimes he writes to me.

5.关于副词only的位置。only可以修饰名词、代词、动词、形容词、副词等,通常放在被修饰词之前。但是,当only放在动词之前时,句子可能有几种含义,这就得靠上下文的意思来正确理解。例如:
It was only an coincidence.
They only have coffee in the morning.(可以理解为:他们早上只喝咖啡。或:他们只在早上喝咖啡。)
注:(1)当程度副词与频度副词同时在句子中出现时,程度副词通常前置修饰频度副词。例如:
He hardly ever leaves his house all the day.
The president of our university is nearly always occupied.
(2)当时间、地点、程度与方式副词同时在句子中出现时,常把程度副词放在最前面,方式副词放在地点副词之前,时间副词放在最后。但是,句中动词是动态动词(go,come, leave,arrive, etc.)时,则常把地点副词放在方式副词之前。例如:
They performed pretty well in the city hall last night.
She went home quickly.
(3)可作定语的副词(如here,there,back, ahead,abroad,below,above,yesterday,before, etc.)通常放在被修饰名词之后。例如:
We will see a beautiful picture about the country in the years ahead.
The atmosphere here is seriously polluted.

vendredi 8 avril 2011

gnuplot function

2. FUNCTIONS
In general, any mathematical expression accepted by C, FORTRAN, Pascal, or BASIC may be plotted. The precedence of operators is determined by the specifications of the C programming language.

The supported functions include:

__________________________________________________________
Function Returns
----------- ------------------------------------------
abs(x) absolute value of x, |x|
acos(x) arc-cosine of x
asin(x) arc-sine of x
atan(x) arc-tangent of x
cos(x) cosine of x, x is in radians.
cosh(x) hyperbolic cosine of x, x is in radians
erf(x) error function of x
exp(x) exponential function of x, base e
inverf(x) inverse error function of x
invnorm(x) inverse normal distribution of x
log(x) log of x, base e
log10(x) log of x, base 10
norm(x) normal Gaussian distribution function
rand(x) pseudo-random number generator
sgn(x) 1 if x > 0, -1 if x < 0, 0 if x=0
sin(x) sine of x, x is in radians
sinh(x) hyperbolic sine of x, x is in radians
sqrt(x) the square root of x
tan(x) tangent of x, x is in radians
tanh(x) hyperbolic tangent of x, x is in radians
___________________________________________________________
Bessel, gamma, ibeta, igamma, and lgamma functions are also
supported. Many functions can take complex arguments.
Binary and unary operators are also supported.
The supported operators in Gnuplot are the same as the corresponding operators in the C programming language, except that most operators accept integer, real, and complex arguments. The ** operator (exponentiation) is supported as in FORTRAN. Parentheses may be used to change the order of evaluation. The variable names x, y, and z are used as the default independent variables.

mercredi 6 avril 2011

copy

! using coefficient of fiting
open(14,file="output/"//filename(1:20)//"_output_fit_coefficient.dat",status="OLD")
read(14,*)ncoeffi
print*,"ncoeffi=",ncoeffi
do icoeffi=1,ncoeffi
read(14,*)
read(14,*) norder
print*,"norder=",norder
read(14,*) dmin, dmax
print*,"dmin=",dmin
do iorder=0,norder
read(14,*)cvars,cvars,coeffi(iorder)
print*,"coeffi=",iorder,coeffi(iorder)
enddo
if(icoeffi==1)then
open(20,file="output/"//filename(1:20)//"_output_dcpdn.dat")
write(20,"(A)")"# dis(mm) dcpdn"
endif
do i=1,np
if(d(i)>=dmin .and. d(i) dcpdn=0
do iorder=1,norder
dcpdn=dcpdn+iorder*coeffi(iorder)*d(i)**(iorder-1)
enddo
write(20,"(2(E19.10e3))")d(i),dcpdn
endif
enddo
if(icoeffi==ncoeffi)then
close(20)
endif
enddo
close(14)

linux命令

1、rev —— 将字符串或者文件的内容逆序输出:

$ echo hello,world|rev
dlrow,olleh

2、tac —— 将文件的内容倒置输出:

$ cat a.txt
Hello
Google
Command

$ tac a.txt
Command
Google
Hello

3、seq —— 输出等差数列:

$ seq 1 3 22
1
4
7
10
13
16
19
22

4、hexedit —— 用16进制形式编辑文件:

$ cat a.txt
Hello
Google
Command

$ hexedit a.txt

00000000 48 65 6C 6C 6F 0D 0A 47 6F 6F 67 6C 65 0D 0A 43 Hello..Google..C
00000010 6F 6D 6D 61 6E 64 0A ommand.
00000020

5、sed '1!G;h;$!d' a.txt —— 将a.txt文件的内容倒置输出,效果和tac的差不多:

$ cat a.txt
Hello
Google
Command

$ sed '1!G;h;$!d' a.txt
Command
Google
Hello

6、sed '/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//' —— 将字符逆序输出,效果和rev命令差不多:

$ echo a b c d e f g|sed '/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//'
g f e d c b a

7、head -N —— 输出指定的前N行:

$ seq 10|head -4
1
2
3
4

8、tail -N —— 输出指定的末N行:

$ seq 10|tail -4
7
8
9
10

9、w —— 输出当前登录shell的用户信息:

$ w
05:52:07 up 3:57, 1 user, load average: 0.00, 0.00, 0.00
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
Lxmxn tty0 05:09 0.00s 0.00s 20.24s /bin/bash --login -i

10、d —— 显示当前目录的的文件列表,和ls -l的效果差不多:

$ d

/home/Lxmxn/:
rwxr-xr-x Lxmxn:None 0 Jun 05 04:09 my/
rw-r--r-- Lxmxn:None 84 Jun 21 17:34 -file
rw-r--r-- Lxmxn:None 23 Jun 22 15:24 a.txt
rw-r--r-- Lxmxn:None 2 Jun 22 15:27 aa.txt
rw-r--r-- Lxmxn:None 9 Jun 22 18:01 b.txt

11、tr [a-z] [A-Z] —— 将小写字符转换成大写

$ echo Hello,everybody|tr '[a-z]' '[A-Z]'
HELLO,EVERYBODY

12、alias —— 定义命令的别名

$ alias OK="seq 10"

$ OK
1
2
3
4
5
6
7
8
9
10

13、unset —— 取消对变量的定义

$ z=lxmxn

$ set|grep ^z
z=lxmxn

$ echo $z
lxmxn

$ unset z

$ set|grep ^z

$ echo $z

14、file —— 判断文件的类型

$ file bb.txt
bb.txt: ASCII text

$ file names.bat
names.bat: MS-DOS batch file text

15、ps —— 显示当前运行的进程信息

$ ps -f
UID PID PPID TTY STIME COMMAND
Python 464 1 0 19:08:20 /usr/bin/bash
Python 3568 1 con 01:41:12 /usr/bin/rxvt
Python 952 3568 1 01:41:12 /usr/bin/bash
Python 4056 952 1 01:58:33 /usr/bin/ps

16、col —— 去掉控制字符

$ echo -e "hello\flxmxn"
hello
lxmxn

$ echo -e "hello\flxmxn"|col -b
hello lxmxn

17、type —— 判断各种命令的类型

$ type cd
cd is a shell builtin

$ type cls
cls is aliased to `clear'

$ type gawk
gawk is /usr/bin/gawk

18、cal 7 2007 —— 在命令行显示2007年7月的日历

$ cal 7 2007
July 2007
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

19、ping www.baidu.com - 3 —— ping 百度3次

$ ping www.baidu.com - 3
PING www.a.shifen.com (220.181.37.4): 0 data bytes
8 bytes from 220.181.37.4: icmp_seq=0 ttl=52
8 bytes from 220.181.37.4: icmp_seq=1 ttl=52
8 bytes from 220.181.37.4: icmp_seq=2 ttl=52

----www.a.shifen.com PING Statistics----
3 packets transmitted, 3 packets received, 0.0% packet loss

20、tee —— 将输入同时输出到屏幕和文件

$ cal 7 2007|tee cal.txt
July 2007
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

$ cat cal.txt
July 2007
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

21、du /home —— 显示/home目录下各目录的容量

$ du /home
0 /home/PythonLee/.emacs.d/auto-save-list
0 /home/PythonLee/.emacs.d
1330 /home/PythonLee/my/cu
1554 /home/PythonLee/my
0 /home/PythonLee/.mc
1875 /home/PythonLee
1875 /home

22、pg /etc/wgetrc —— 分页显示文件wgetrc的内容

23、sort file —— 将文件file按照ASCII码大小排序

24、stat qq.txt —— 查看文件qq.txt的详细属性信息

$ stat qq.txt
File: “qq.txt”
Size: 0 Blocks: 0 IO Block: 1024 普通空文件
Device: cd39be7fh/3443113599d Inode: 13652776205351375325 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 500/PythonLee) Gid: ( 513/ None)
Access: 2007-07-01 00:00:00.000000000 +0800
Modify: 2007-07-01 21:28:26.000000000 +0800
Change: 2007-07-01 21:28:26.000000000 +0800


25、touch qq.txt —— 更改文件的日期

$ stat qq.txt
File: “qq.txt”
Size: 0 Blocks: 0 IO Block: 1024 普通空文件
Device: cd39be7fh/3443113599d Inode: 13652776205351375325 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 500/PythonLee) Gid: ( 513/ None)
Access: 2007-07-01 00:00:00.000000000 +0800
Modify: 2007-07-01 21:28:26.000000000 +0800
Change: 2007-07-01 21:28:26.000000000 +0800

$ touch qq.txt

$ stat qq.txt
File: “qq.txt”
Size: 0 Blocks: 0 IO Block: 1024 普通空文件
Device: cd39be7fh/3443113599d Inode: 13652776205351375325 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 500/PythonLee) Gid: ( 513/ None)
Access: 2007-07-02 00:00:00.000000000 +0800
Modify: 2007-07-02 06:49:28.000000000 +0800
Change: 2007-07-02 06:49:28.000000000 +0800