Monday, December 22, 2008

parallel desktops 安装。

软件可以从主页上下载,序列号用GNE747-B2KJ82-8GAW8F-0TTB0H-SWE0BJ  ( for 4.0)。


origin 下载:

http://chem8.org/viewthread-17087.html
http://www.portablesoft.cn/read.php/9.htm
http://3ddown.com/soft/26459.htm
英文版序列号(Serial):GF3S4-9489-7201111
德文版序列号(Serial):SF8T5-9489-7201111
日文版序列号(Serial):LF9I6-9489-7201111

Saturday, December 06, 2008

macbook pro亮度变化。

macbook pro屏幕亮度会根据周围环境亮度变化。解决办法是在display里去掉 automatically adjust the brightness...



http://www.machome.com.cn/viewthread.php?tid=28785&extra=&page=1

Wednesday, December 03, 2008

mac airport grapher

http://www.chimoosoft.com/products/apgrapher/#downloads


AP Grapher is a freeware program for Mac OS X which searches for and displays nearby wireless (AirPort/WiFi) access points along with information about their percent availability, maximum signal strength, and last contact time. The grapher window allows you to graph multiple signal strength parameters for the base station you are currently connected to and optionally display them in the dock icon. Many user configurable preferences allow you to customize its behavior including refresh rate and optional display in the dock icon or menu extra.

Tuesday, November 18, 2008

matlab2

http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/

Friday, November 14, 2008

chinese dictionary

http://www.zdic.net/zd/zi/ZdicE7Zdic97Zdic9E.htm

Tuesday, November 11, 2008

matlab figure creation trick.

http://nibot-lab.livejournal.com/73290.html

http://merkel.zoneo.net/Latex/natbib.php

Selecting citation style and punctuation

Use the command \bibpunct with one optional and 6 mandatory arguments:
  1. the opening bracket symbol, default = (
  2. the closing bracket symbol, default = )
  3. the punctuation between multiple citations, default = ;
  4. the letter `n' for numerical style, or `s' for numerical superscript style, any other letter for author-year, default = author-year;
  5. the punctuation that comes between the author names and the year
  6. the punctuation that comes between years or numbers when common author lists are suppressed (default = ,);

The optional argument is the character preceding a post-note, default is a comma plus space. In redefining this character, one must include a space if one is wanted.

Example 1, \bibpunct{[}{]}{,}{a}{}{;} changes the output of

\citepjon90,jon91,jam92
into [Jones et al. 1990; 1991, James et al. 1992].

Example 2, \bibpunct[; ]{(}{)}{,}{a}{}{;} changes the output of

\citep[and references therein]{jon90}
into (Jones et al. 1990; and references therein).

Saturday, November 08, 2008

感冒.

http://www.hantang.org.cn/CTM/XSLW/200708/1433.htm

真正正统中医学在治疗感冒时,最常使用的处方我帮大家归纳一下,让大家都好记,也都会使用。中医治疗感冒是依据不同的感冒症状来开立处方,不是依据西医区分为那类病毒来开方子的。

1.桂枝汤 : 处方内容是桂枝10 白芍10 生姜二片 炙甘草10 红枣十枚,每付药加入六碗水使用大火来煮成二碗,成人于每三小时空腹时喝一碗,小孩减半,服用后会得到微汗出来,这个处方使用的最多,民众如果在服用第一碗汤药后,感冒症状就好了,就不需要去服用第二碗,服用此汤药后需要喝一点粥,来帮助药力达到四肢末梢,如此就可以将感冒病毒清除于体外,病人会迅速恢复过来,使用此方时要注意病人的感冒症状,当你发现感冒病人有出汗同时全身肌肉痛,不喜欢被风吹到身体,加上一点发烧又没有胃口时,你就可以按照我说的比例来抓药服用,在服用过后的第二天中午,如果病人的胃口恢复,就代表病已经完全好了

2.麻黄汤 : 处方内容是麻黄5 桂枝10 杏仁5 炙甘草10,每付药加入三碗水然后用大火煮成一碗,空腹时服用,这个处方是专门治疗一种特殊的感冒主要症状是非常怕冷,身体关节疼痛,发烧,没有汗,这个感冒症状多发生于冬天寒冷时,但是也有时会发生在夏天,大家只要记住一点,只要出现这个症状就可以使用它,唯一要注意的是如果你有心脏病的记录,就不可以服用它,其它的都可以服用

3.葛根汤 :处方内容是葛根15 麻黄5 桂枝10 白芍10 生姜二片 炙甘草10 大枣十枚,每付药加入六碗水使用大火来煮成二碗,成人于每三小时空腹时喝一碗,小孩减半,服用后会得到微汗出来,此方多用于小孩感冒发烧喉咙痛时,这是因为病人是在发汗时得到的感冒,主要症状是后项强痛,头痛又怕风吹,身体肌肉疼痛,喉咙痛,口渴等等,同时这个处方我们也可以给正在发水痘而发烧的小孩吃,在退烧的同时可以将水痘逼出体外,小孩服用后的第二天会全身起水痘,看似很吓人,其实病已经好转,病人烧退,体力也同时会好转,当病人烧退同时胃口恢复时就可以停药了

4.大青龙汤 :处方内容是麻黄10 杏仁10 石膏20 炙甘草10 桂枝15 生姜二片 大枣十枚,每付药加入六碗水使用大火来煮成二碗,成人于每三小时空腹时喝一碗,小孩减半,服用后会得汗出来,此方主要的感冒症状是发烧,咳嗽吐浊痰,病人自觉体外怕冷体内很热,体表没有出汗,有身体疼痛现象,口渴又没有胃口,此时就可以服用这个处方,大青龙汤是我国千年来专门用来治疗瘟疫之类的传染病时所使用的最有效处方,近来发生所谓的禽流感,就是大青龙汤证,民众一旦发现得到此病而当你们当地的西医与中医都宣布无法治疗时,大家就可以使用此方来保命

5.小青龙汤 : 处方内容是麻黄10 白芍10 干姜5 细辛5 桂枝15 五味子10 炙甘草10 半夏10,每付药加入六碗水使用大火来煮成二碗,成人于每三小时空腹时喝一碗,小孩减半,服用后会得汗出来,此方主要的感冒症状是发烧,咳嗽吐清白痰,病人自觉身体里面非常冷,体表没有出汗,也有身体疼痛现象,没有口渴也没有胃口,喉咙中时常觉得痒痒的想咳嗽,有时感觉背后两肩胛骨之间有一块如拳大的冷块区,此时就可以服用这个处方,服用后身体会出汗,之后高烧就会退去,咳嗽就会好转


6.小柴胡汤 : 处方内容是柴胡15 半夏15 黄芩15 党参15 生姜二片 大枣十枚 炙甘草10,每付药加入六碗水使用大火来煮成二碗,成人于早晚餐前空腹时喝一碗,小孩减半,此方主要症状是病人自觉忽冷忽热,有呕心感,同时两胸肋位感觉有胀满感,这时就可以服用此方,还有要注意一点,就是女子在月经期中,如果得到任何感冒时,无论妳其它感冒症状是如何不同,请一律使用此方就可以恢复过来,千万不要去吃其它处方,如果妳同时有严重的痛经问题,妳可以在此方中自行加入茜草15,白芍25,而煮法与服用方法不变

大家在使用上方治疗感冒的同时, 请注意一点就是当你服药后的第二天中午时,你感到肚子很饿,这就是证据,证明了你的感冒完全已经好了,如果第二天中午病人仍然没有胃口,就必须继续吃药直 到好为止,上面的六剂处方是我国用之千年的经典之方,使用至今仍然不需要更改内容,而且效果是一剂就知,药物又非常廉价,人人都可以负担得起,同时又是真 正可以将感冒治好的处方,西洋人至今仍然连个感冒都无法治好,所以西医差中医有千年以上的距离,这才是真正的中医学,而你们现在周围的中医都是温病派中 医,这些中医不是真正正统的中医,所以跟西医一样都无法治疗感冒,而上面处方中我开的麻黄,桂枝等等,对你们这里的中医来说是非常之恐惧,他们一生都未使 用过这些药物,而这就是他们之所以无法治病的原因所在,因此当你拿这药单去药房抓药时,如果药房刁难你,这不足为奇,因为你们那边从未有一位中医敢如此开 药的,请大家安心使用,我保证绝对是效果迅速,又完全无副作用,请大家将此篇论文到处去贴,同时如果有湖南乡亲看到这篇时,请将这篇打印出来,分送给亲友 们,大家如果都知道感冒可以照这样处理,相信整个湖南省乡亲们都必将更健康更富足,而且更快乐的过日子,最后祝福大家身体健康,万事如意

附带一小插曲 : 一位你们的湖南长沙人士,女,44岁, 她是我一位美国病人的姐姐,当时我在长沙需要待上一晚,于是我的病人就来看我,同时将其姐也一起带来,希望我能提供一点意见给她,她因为右乳房有很大的硬 块,照过片子后被发现其中有阴影在,于是你们当地得西医就要她做切片,她的妹妹是我的病人,所以深知这种切片会让病情更坏,于是强力阻止她去做,坚持要等 我来看后再做决定,我一望其面,第一句话就是问她,妳几岁? 她回答说44岁,我一看她的鼻子就已经知道此女离婚了,我为了确认病因所在,所以要追根就底问,于是我再问妳的先生好吗? 她居然说她跟她的子女们很好,真是鸡同鸭讲,于是我只好直接问她,那妳跟先生的相处好吗? 此时她妹妹已经知道我要找什么? 于是替她回答说她姐姐已经离婚了,然后我问她是何时离的? 她说是2005年离婚,我再问她妳何时发现妳的乳房有硬块? 她回答说是2006年, 也就是离婚后才有的,湖南乡亲们请注意,直到目前为止西方医学尚未了解到乳癌的成因,它们连奶水就是月经也不知道,而中医知道乳癌的病因是心脏引起奶水无 法完全下达子宫后,停留在乳房中过久所造成的病,所以病人的心理很重要,当她失去婚姻后,她必然非常难过伤心,于是造成奶水停积在右乳房中,这就是乳房硬 块的来源,而西医的病理检查方式是无法查到病人已经离婚,所以他们不知道真正病因在此,只是一昧的要求病人做切片,这不但无济于事,病人一旦切片后病情必 然会更恶化,这样只会造成我施治上的困难,完全无助于治疗,希望所有湖南乡亲都要了解乳癌对中医而言是可以治疗的,如果不做任何中西医的治疗,平均也可以 活14年, 但是如果妳给西医治疗,经过切片,开刀,化疗后,妳最多只能活十年,有时五年都不到就走了,也就是说妳不治疗可以活得比给西医治疗还长还有生活质量的,当 然妳如果找到好中医来治,效果必将更好,存活率必然上升,希望大家告诉大家有癌症时要找真正中医来治疗,不要给这些西医与温病派中医来治,同时希望大家都 远离西药,因为许多癌症就是因为长期吃西药后才造成的后果,我们一起预祝这位多情的湘女,平安健康,心想事成

生活上的小点滴在湖南时我的学生吃了你们超市中购买的甜头之后,牙齿立刻有紧缩的反应,这是人工白砂糖造成的,请湖南乡亲们不要去买任何甜食中有加入人工白砂糖的食物,因为这种白砂糖就是胃癌与胰脏癌的来源,吃甜食可以,但是一定要吃使用蔗糖或是红糖制造的甜食,这种甜食不但好吃,甚而对牙齿跟肠胃都很好的,请大家注意一下

Friday, November 07, 2008

cumulative possibility in matlab

2*cdf('normal', [1,2,3,4,5,6], 0,1)-1

Saturday, October 25, 2008

one link

http://www.cooaoo.com/article.asp?id=133

中医

腰经常酸痛有好的按摩方法吗?

按尺泽,手腰痛点或第二掌骨全息腰.每穴5分钟.



字号 7pt 8pt 9pt 10pt 12pt 15pt 18pt 20pt 25pt 30pt 肩痛,大腿外侧痛两穴一次治愈
患者,男,瓦工,四十岁,主诉半月前肩部疼痛,大腿外侧疼痛,医院就诊为肩周炎,坐骨神经痛,吃药半月仍疼痛不止,行走困难,右臂活动受限不能上抬,花医药费六百多圆,从两百公里外乘车来我处就诊,我为其点按尺泽穴,足四五趾缝间痛点各五分钟,大腿不再疼痛,行走如常,手臂活动正常,只是原来贴膏药处还有点痛,第二天早晨已如常人,嘱其自按一次巩固疗效高兴而去.第三天我电话联系,说已好了,如此疗效,我也惊奇.按摩原理:1,大腿外侧痛,大部分原因是胆经淤积寒气过多,尺泽穴属肺经,胆属木,肺属金,五行中金克木,故有此疗效.<人体工作手册>中有阐述.2,足四五趾缝间压痛点是治肩周炎特效点.凡肩部疾病都可治疗,按摩一族不可不知,我的按摩方法不讲什么手法,属于难登大雅之堂一类的,故认同感较差,发出来请同道评议.(原想不再发帖,但看到坛里求助之人不少,而有些病我恰好又能治,固忍不住再次发帖,让更多的病人知道方便快捷的治病方法一直是我追求的目标)


http://ngotcm.com/forum/viewthread.php?tid=32210&extra=page%3D1

Tuesday, October 14, 2008

c shell redirection.

http://www.mathinfo.u-picardie.fr/asch/f/MeCS/courseware/users/help/general/unix/redirection.html

http://hi.baidu.com/sanshan/blog/item/98e4c3ce3313690593457e69.html


http://www.linuxdevcenter.com/pub/a/linux/lpt/13_01.html (this is the best link I have seen)


Table 1: Common Standard I/O Redirections

Functioncshsh
Send stdout to fileprog > fileprog > file
Send stderr to file
prog 2> file
Send stdout and stderr to fileprog >& fileprog > file 2>&1
Take stdin from fileprog < fileprog < file
Send stdout to end of fileprog >> fileprog >> file
Send stderr to end of file
prog 2>> file
Send stdout and stderr to end of fileprog >>& fileprog >> file 2>&1
Read stdin from keyboard until c prog <<cprog <<c
Pipe stdout to prog2prog | prog2prog | prog2
Pipe stdout and stderr to prog2prog |& prog2prog 2>&1 | prog2


  • The C shell doesn't give you an easy way to redirect standard output without redirecting standard error. A simple trick will help you do this. To put standard output and standard error in different files, give a command like:

    % ( prog > output ) >& errors
  • /dev/null

    http://topic.csdn.net/t/20020906/15/1002026.html
    http://bbs.chinaunix.net/viewthread.php?tid=749535

    check this link for the device usage.

    1 - denotes stdout ( standard output )
    2 - denotes stderr ( standard error )
    /dev/null . apparently is null , nothing , empty , zero etc , etc .

    2>/dev/null - redirect stderr to nothing , it turns stderr off.

    >/dev/null 2>&1 also can write as 1>/dev/null 2>&1 - stdout redirect to /dev/null (no stdout) ,and redirect stderr to stdout (stderr gone as well) . end up it turns both stderr and stdout off

    a little practice may help to undstand above .
    #ls /usr /nothing
    #ls /usr /nothing 2>/dev/null
    #ls /usr /nothing >/dev/null 2>&1

    perl ternary operator

    Usually only one statement can be used. However, if one would like to use more than one statement, one will have to use the logical operator "and" combining with the open parathesis " ( )"instead of the semicolon ";"


    Here is my example to create a new perl file:


    #!/usr/bin/perl -w
    #use strict


    ### create a perl script template.


    $created_filename=$ARGV[0];


    if(-e "$created_filename\.pl"){
    print "The created file has already existed. To override, input Y(y) or N(n), then press Enter\n";

    rep2: $_=; chomp;



    /^n(o)?/i ? print "The same named file has already existed and file creation is given up.\n"
    :/^ye+s?/i ? print "The file will be created\n"
    : (print "input wrong, please input Ye(s) or N(o)!!" and print " here is a test\n" and goto rep2);

    # if (/^n(o)?/i){
    # print "The same named file has already existed and file creation is given up.\n";
    # }elsif(/^ye+s?/){
    # print "The file will be created\n";
    # }else{
    #
    # print "input wrong, please input Yes or No!!\n";
    # goto rep2;
    # #redo;

    }
    local *TR; open TR, ">$created_filename\.pl";
    print TR "\#\!\/usr\/bin\/perl \-w\n";
    print TR "\#use strict\n";



    $mode=0777;
    chmod $mode, "$created_filename\.pl";

    Friday, October 10, 2008

    人体经络图.

    http://www.ngotcm.com/bbs/?action_viewthread_tid_30693.html

    Thursday, October 09, 2008

    how to remove blank lines in a file with perl

    I found one way to get it work.

    The text file (rsp3.txt):
    -----
    (blank)
    (blank)
    p2_xe_1996-02-16.rsp
    p2_xe_1996-03-08.rsp
    p2_xe_1996-04-18.rsp
    (blank)
    (blank)
    p2_xe_1996-05-20.rsp
    p2_xe_1996-06-20.rsp
    p2_xe_1996-06-20.rsp
    ------------------------

    script:


    #!/usr/bin/perl -w


    $response_file=`cat rsp3.txt`;

    $length1=length($response_file);



    print "$response_file";

    print "$length1\n";

    $response_file=~s/^\n//gm;
    print "$response_file";

    $length2=length($response_file);
    print "$length2\n";

    Tuesday, October 07, 2008

    perl links.

    command line options for perl:
    http://perldoc.perl.org/perlrun.html
    http://www.perl.com/pub/a/2004/08/09/commandline.html?page=2

    install my own perl module:
    http://servers.digitaldaze.com/extensions/perl/modules.html

    how to convert the UT time to MJD
    http://coding.derkeiler.com/Archive/Perl/comp.lang.perl.misc/2008-02/msg00699.html

    the package for the conversion between MJD and UT
    http://search.cpan.org/~cphil/Astro-0.69/

    I have written one script which convert the MJD into UT time using the module above:

    ---------------------------------------------------------------------------------------
    #!/usr/bin/perl -w

    #### input file: (1) mjd.txt which contains all the mjd dates. please make sure the file existing
    #### in the working direcotory before the run.
    #### output: the converted mjd numbers.

    #### usage: ./mjd_conv.pl


    use lib qw(/data/lgou/perl/module/lib/perl5/site_perl /data/lgou/perl/module/lib/perl5/);
    use Astro::Time;


    my ($day, $month, $dayno, $year, $ut, $mjd);


    $inputfile=$ARGV[0];

    @mjd_array=`cat $inputfile`;

    for $mjd (@mjd_array){


    ($day, $month, $year, $ut) = mjd2cal($mjd);
    printf("mjd2cal: MJD %.5f ==> $year/%02d/%02d (%s)\n", $mjd,
    $month, $day, turn2str($ut, 'H', 0));

    }

    Monday, October 06, 2008

    one useful link combining matlab figure plot and latex

    http://www.math.umn.edu/~aoleg/latex_tips/latex_tips.shtml

    Wednesday, August 27, 2008

    unix command "find"

    http://www.athabascau.ca/html/depts/compserv/webunit/HOWTO/find.htm

    Some examples of using UNIX find command.

    Contents:

    Introduction
    Search for file with a specific name in a set of files (-name)
    How to apply a unix command to a set of file (-exec).
    How to apply a complex selection of files (-o and -a).
    How to search for a string in a selection of files (-exec grep ...).

    Introduction

    The find command allows the Unix user to process a set of files and/or directories in a file subtree.

    You can specify the following:

    • where to search (pathname)
    • what type of file to search for (-type: directories, data files, links)
    • how to process the files (-exec: run a process against a selected file)
    • the name of the file(s) (-name)
    • perform logical operations on selections (-o and -a)

    Search for file with a specific name in a set of files (-name)

    find . -name "rc.conf" -print

    This command will search in the current directory and all sub directories for a file named rc.conf.

    Note: The -print option will print out the path of any file that is found with that name. In general -print wil print out the path of any file that meets the find criteria.

    How to apply a unix command to a set of file (-exec).

    find . -name "rc.conf" -exec chmod o+r '{}' \;

    This command will search in the current directory and all sub directories. All files named rc.conf will be processed by the chmod -o+r command. The argument '{}' inserts each found file into the chmod command line. The \; argument indicates the exec command line has ended.

    The end results of this command is all rc.conf files have the other permissions set to read access (if the operator is the owner of the file).

    How to apply a complex selection of files (-o and -a).

    find /usr/src -not \( -name "*,v" -o -name ".*,v" \) '{}' \; -print

    This command will search in the /usr/src directory and all sub directories. All files that are of the form '*,v' and '.*,v' are excluded. Important arguments to note are:

    • -not means the negation of the expression that follows
    • \( means the start of a complex expression.
    • \) means the end of a complex expression.
    • -o means a logical or of a complex expression.
      In this case the complex expression is all files like '*,v' or '.*,v'

    The above example is shows how to select all file that are not part of the RCS system. This is important when you want go through a source tree and modify all the source files... but ... you don't want to affect the RCS version control files.

    How to search for a string in a selection of files (-exec grep ...).

    find . -exec grep "www.athabasca" '{}' \; -print

    This command will search in the current directory and all sub directories. All files that contain the string will have their path printed to standard output.

    If you want to just find each file then pass it on for processing use the -q grep option. This finds the first occurrance of the search string. It then signals success to find and find continues searching for more files.

    find . -exec grep -q "www.athabasca" '{}' \; -print

    This command is very important for process a series of files that contain a specific string. You can then process each file appropriately. An example is find all html files with the string "www.athabascau.ca". You can then process the files with a sed script to change those occurrances of "www.athabascau.ca" with "intra.athabascau.ca".

    perl tutorial collection!

    http://www.cs.cf.ac.uk/Dave/PERL/node1.html

    http://www.unix.com.ua/orelly/perl/prog3/index.htm

    http://affy.blogspot.com/p5be/index.htm


    http://www.cs.cf.ac.uk/Dave/PERL/perl_caller.html

    http://homepages.ulb.ac.be/~dgonze/SCRIPTS/scripts.html

    Tuesday, August 26, 2008

    perl tutorial link.

    http://www.tizag.com/perlT/perlarrays.php

    Thursday, August 14, 2008

    linksys router setup.

    On the main setup page the ""Internet Connection Type"" should be
    on ""Obtain IP Automatically - DHCP “. Click on the Save Settings
    button.
    Now click on the sub tab ""MAC address clone"".
    - Click on enable
    Click Clone & click save settings
    Check WAN Ip on Status page of router ....
    If getting Valid Ip .... try going online
    If not ... power cycle for 4-5 minutes & then agian check the WAN Ip address .....

    Wednesday, July 09, 2008

    Color in latex.

    Colortbl and xcolor packages support the color in latex. However, it can be used with the class file "article". It doesn't support the emulateapj class, which is a pity. The reason why I prefer emulateapj class is that the emulateapj has a good-looking table.


    Here are some basic examples for the usage of colortbl and xcolor:

    colortbl:

    \begin{table}[ht]
    %\scriptsize
    %\rowcolors[\hline]{2}{rgb:red!50,2;green!50,2;blue!0,1}{}
    \caption{rxte data for Model phabs(simpl(kerrbb2)) with nH fixed at 0.46e22$\rm cm^{-2}$ (3.0-8.0 keV) }
    \centering
    \begin{tabular}{c c c c c c>{\columncolor[gray]{.8}} c>{\columncolor[gray]{.5}} c c c c c}
    \begin{tabular}{c c c c c c c c c c c c c c}
    \hline\hline
    \hline\hline
    .......
    \end{table}

    Xcolor:

    \begin{table}[ht]
    \caption{rxte data for Model phabs(simpl(kerrbb2)) with nH fixed at 0.46e22$\rm cm^{-2}$ (3.0-20.0 keV) }
    \centering
    \rowcolors[\hline]{2}{rgb:red!50,2;green!50,2;blue!0,1}{}
    \begin{tabular}{c c c c c c c c c c c c}
    \hline\hline
    .........
    \end{table}

    useful perl link

    http://www.comp.leeds.ac.uk/Perl/associative.html

    latex link.

    latex tips:

    http://www.cse.iitd.ernet.in/~anup/homepage/UNIX/latex.html

    how to get all the files on ftp site without interactive answer?

    http://bbs.chinaunix.net/archiver/?tid-596912.html

    use the command "prompt" before use the command "mget". The purpose of "prompt" is to turn off the interactive mode.


    "get" is getting one single file.
    "mget" is getting multiple files.

    ftp command collection:

    http://www.computerhope.com/software/ftp.htm

    Thursday, June 05, 2008

    how to view iphone mag in firefox (independent of platform)

    http://lifehacker.com/393296/read-full-magazines-for-free-with-or-without-an-iphone

    setup the firefox to simulate the iphone platform.

    here is the tutorial:

    http://paininthetech.com/2007/10/03/fake-iphone-user-agent/

    open .chm file in linux

    the easy tool is the browser Konqueror.

    http://www.cyberciti.biz/faq/open-chm-file-under-linuxfreebsd/

    Wednesday, June 04, 2008

    http://www.ats.ucla.edu/stat/fileman/unix_cmds.htm

    Commonly Used Unix-like Commands


    head [-n] [files]
    Print the first few lines of one or more files. It is a shell-command and has to be issued at shell prompt.
    For usage, use head --help.

    Example:

    C:\wbin\examples>sh
    $head unix_cmd.txt
    agrep.exe
    ansi2knr.exe
    basename.exe
    bc.exe
    bison.exe
    bunzip2.exe
    bzip2.exe
    bzip2recover.exe
    cat.exe
    chgrp.exe

    Example: Output the first three line of ASCII data file fixed.txt to fixed_small.txt.

    C:\wbin\examples>more fixed.txt
    123456
    234445
    334566
    456577
    534345
    676767
    C:\wbin\examples>sh
    $head -3 fixed.txt >fixed_small.txt
    C:\wbin\examples>wc -l fixed_small.txt
    3 fixed_small.txt

    tail [options] [file]
    Print the last ten lines of the names file.
    For usage, use tail --help.

    Example:

    C:\wbin\examples>tail unix_cmd.txt
    uuencode.exe
    wc.exe
    wget.exe
    wget.hlp
    which.exe
    whoami.exe
    xargs.exe
    yes.exe
    zcat.exe
    zip.exe

    wc [options] [files]
    Print a character, word, and line count for files.
    For usage, use wc --help.

    Example 1: Count the number of rows in the file.

    C:\wbin\examples>more fixed.txt
    123456
    234445
    334566
    456577
    534345
    676767
    C:\wbin\examples>wc -l fixed.txt
    6 fixed.txt

    Example 2: Print the length of the longest line.

    E:\temp>more odd.txt
    1 2 3 4 5 6 7
    1 2 3 4 5 6 7 8 9 0
    11 22 3 3 444 555 6 77 88
    222 444 55
    E:\temp>wc -L odd.txt
    25 odd.txt

    cut options [files]
    Select a list of columns or fields from one or more files. Option -c or -f must be specified.
    For usage, use cut --help.

    Example1: Free format

    C:\wbin\examples>more f2.txt
    john b a
    tina b a
    C:\wbin\examples>cut -d" " -f2 grade.txt
    b
    b

    Example 2: Fixed format

    C:\wbin\examples>more fixed.txt
    123456
    234445
    334566
    456577
    534345
    676767
    C:\wbin\examples>cut -c2-3 fixed.txt
    23
    34
    34
    56
    34
    76

    join [options] file1 file2
    Join the common lines of sorted file1 and sorted file2 (merge two files).
    For usage, use join --help.

    Example 1:

    C:\wbin\examples>more score.txt
    john 81 91
    mark 82 93
    tina 88 92
    C:\wbin\examples>more grade.txt
    john b a
    tina b a
    C:\wbin\examples>join score.txt grade.txt > final.txt
    C:\wbin\examples>more final.txt
    john 81 91 b a
    tina 88 92 b a

    Example 2: Pair each score with its grade.

    C:\wbin\examples>join -o 1.1 1.2 2.2 1.3 2.3 score.txt grade.txt
    john 81 b 91 a
    tina 88 b 92 a

    paste [options] files
    Merge corresponding lines of one or more files into vertical columns, separated by tab.
    For usage, use paste --help.

    Example:

    C:\wbin\examples>more c1.txt
    1
    2
    3
    4
    5
    6
    C:\wbin\examples>more c23.txt
    23
    34
    34
    56
    34
    76
    C:\wbin\examples>paste c1.txt c23.txt
    1 23
    2 34
    3 34
    4 56
    5 34
    6 76

    cat [options] [file] ...
    Concatenate and write files.
    For usage, use cat --help.

    Example 1: Write a file to the screen (standard out).

    C:\>cat file1.txt
    a1 a2 a3
    1 3 4
    2 9 0
    3 10 2
    4 11 2

    Example 2: Concatenating (stacking) two files.

    C:\>cat file1.txt
    a1 a2 a3
    1 3 4
    2 9 0
    3 10 2
    4 11 2
    C:\>cat file2.txt
    5 12 0
    6 9 1
    7 8 3
    C:\>cat file1.txt file2.txt > whole.txt
    C:\>cat whole.txt
    a1 a2 a3
    1 3 4
    2 9 0
    3 10 2
    4 11 2
    5 12 0
    6 9 1
    7 8 3

    Example 3: Stacking multiple files with the same file extension

    C:\>cat file1.txt
    a1 a2 a3
    1 3 4
    2 9 0
    3 10 2
    4 11 2
    C:\>cat file2.txt
    5 12 0
    6 9 1
    7 8 3
    C:\>cat file3.txt
    9 12 7
    10 12 0
    11 23 34
    C:\>cat *.txt
    a1 a2 a3
    1 3 4
    2 9 0
    3 10 2
    4 11 2
    5 12 0
    6 9 1
    7 8 3
    9 12 7
    10 12 0
    11 23 34
    C:\>cat *.txt > big
    C:\>cat big
    a1 a2 a3
    1 3 4
    2 9 0
    3 10 2
    4 11 2
    5 12 0
    6 9 1
    7 8 3
    9 12 7
    10 12 0
    11 23 34

    Remark: Notice that the file big does not have extension .txt. This is to avoid an infinite loop due to the use of wild card '*'.


    sort [options] [files]
    Sort the lines of the named files, typically in alphabetical order.
    For usage, use sort --help.

    Example 1:

    beta (124) % cat hsbfew.txt
    id female race ses schtyp prog read write math science socst
    70 0 4 1 1 1 57 52 41 47 57
    121 1 4 2 1 3 68 59 53 63 61
    86 0 4 3 1 1 44 33 54 58 31
    141 0 4 3 1 3 63 44 47 53 56
    172 0 4 2 1 2 47 52 57 53 61
    113 0 4 2 1 2 44 52 51 63 61
    50 0 3 2 1 1 50 59 42 53 61
    11 0 1 2 1 2 34 46 45 39 36
    84 0 4 2 1 1 63 57 54 58 51
    48 0 3 2 1 2 57 55 52 50 51
    75 0 4 2 1 3 60 46 51 53 61
    60 0 4 2 1 2 57 65 51 63 61
     beta(125)% sort -n hsbfew.txt
    id female race ses schtyp prog read write math science socst
    11 0 1 2 1 2 34 46 45 39 36
    48 0 3 2 1 2 57 55 52 50 51
    50 0 3 2 1 1 50 59 42 53 61
    60 0 4 2 1 2 57 65 51 63 61
    70 0 4 1 1 1 57 52 41 47 57
    75 0 4 2 1 3 60 46 51 53 61
    84 0 4 2 1 1 63 57 54 58 51
    86 0 4 3 1 1 44 33 54 58 31
    113 0 4 2 1 2 44 52 51 63 61
    121 1 4 2 1 3 68 59 53 63 61
    141 0 4 3 1 3 63 44 47 53 56
    172 0 4 2 1 2 47 52 57 53 61

    fgrep [options] [pattern] [files]
    Search one or more files for lines that match a literal, text-string pattern. Because fgrep does not support regular expressions, it is faster than grep.
    For usage, use fgrep --help.

    Example 1: Search for lines that contains "john". The option -i is used to ignore uppercase and lowercase distinction.

    C:\wbin\examples>more score.txt
    john 81 91
    mark 82 93
    tina 88 92
    C:\wbin\examples>fgrep "john" score.txt
    john 81 91
    C:\wbin\examples>fgrep -i "JOHN" score.txt
    john 81 91

    grep [options] regexp [files]
    Search one or more files for lines that match a regular expression regexp.
    For usage, use grep --help.

    Example 1: Search for lines that contain a particular character.

    C:\wbin\examples>more problem.txt
    123456
    23?445
    334566
    456x77
    534345
    676767
    C:\wbin\examples>grep "?" problem.txt
    23?445

    Example 2:

    C:\wbin\examples>grep "[x?]" problem.txt
    23?445
    456x77

    Example 3:


    gawk [options] -f script_file input_file(s)
    gawk [options] 'script' file(s)
    A pattern-matching program for processing files, especially when files are databases.
    For usage, use gawk --help.

    Example1: Print the maximal record length of a file.

    C:\wbin\examples>cat reclength.awk
    BEGIN {len = 0}
    {
    test = length($0)
    if ( test > len) len = test
    }
    END {print "The maximal record length is " len}
    C:\wbin\examples>gawk -f reclength.awk score.txt
    The maximal record length is 10

    Example 2: Print the second column of a file.

    C:\wbin\examples>more score.txt
    john 81 91
    mark 82 93
    tina 88 92
    C:\wbin\examples>gawk  '{print $2}' score.txt
    81
    82
    88

    Example 3: Print the number of records of each line.

    C:\wbin\examples>more temp
    1 70 0 4 1 1 1 57 52 41 47 57
    2 121 1 4 2 1 3 68 59 53 63 61
    3 86 0 4 3 1 1 44 33 54 58 31
    4 141 0 4 3 1 3 63 44 47 53 56
    5 172 0 4 2 1 2 47 52 57 53 61
    6 113 0 4 2 1 2 44 52 51 63 61
    7 50 0 3 2 1 1 50 59 42 53 61
    8 11 0 1 2 1 2 34 46 45 39 36
    9 84 0 4 2 1 1 63 57 54 58 51
    10 48 0 3 2 1 2 57 55 52 50 51
    11 75 0 4 2 1 3 60 46 51 53 61
    C:\wbin\examples>gawk '{print NF}'  temp
    12
    12
    12
    12
    12
    12
    12
    12
    12
    12
    12
    Example 4: Deleting the first line of a file. The first line of file test.txt has variable names. Sometimes, it may be useful to delete the first line, or multiple lines.
    E:\awk_stuff>more test.txt
    a b c
    1 2 3
    2 3 5
    3 5 7
    1 2 3
    2 3 4
    4 5 5
    2 4 6
    E:\awk_stuff>sh
    $ gawk 'NR >1' noname.txt
    $ cat noname.txt
    1 2 3
    2 3 5
    3 5 7
    1 2 3
    2 3 4
    4 5 5
    2 4 6

    seq [options] first increment last
    Generate a sequence of integers, with a user-selected increment.
    For usage, use seq --help.

    Example 1: Use the default for first (1) and increment (1).

    C:\wbin>seq 5
    1
    2
    3
    4
    5

    Example 2:

    C:\wbin>seq 0 10 100
    0
    10
    20
    30
    40
    50
    60
    70
    80
    90
    100

    od [options] [file]
    Octal dump; produce a dump (normally octal) of the named file.
    For usage, use od --help.


    sum [option] file
    Calculate and print a checksum and the number of (512-byte) blocks for file.
    For usage, use sum --help.

    Example:

    beta (119) % sum hsb2.sas7bdat
    27863 25 hsb2.sas7bdat

    fold [options] [files]
    Break the lines of the named files so that they are no wider than the specified width.
    For usage, use fold --help.

    Example:

    C:\wbin\examples>more score.txt
    john 81 91
    mark 82 93
    tina 88 92

    C:\wbin\examples>fold -w 5 score.txt
    john
    81 91
    mark
    82 93
    tina
    88 92

    dd [option = value]
    Make a copy of an input file (if = ) using the specified conditions, and send the results to the output file (or standard output if of is not specified).
    For usage, use dd --help.

    Example : Convert an input file to all uppercase:

    D:\temp>more score.txt
    john 81 91
    mark 82 93
    tina 88 92
    D:\temp>dd if=score.txt of=score_up.txt conv=ucase
    0+1 records in
    0+1 records out
    D:\temp>more score_up.txt
    JOHN 81 91
    MARK 82 93
    TINA 88 92

    tr [options][string1][string2]
    Performing substitution of characters from string1 to string2 or deletion of characters in string1.
    For usage, use tr --help.

    Example1: Change uppercase to lowercase in a file:

    D:\temp>more score.txt
    john 81 91
    mark 82 93
    tina 88 92
    D:\temp>tr '[a-z]' '[A-Z]' <> score1.txt
    D:\temp>more score1.txt
    JOHN 81 91
    MARK 82 93
    TINA 88 92

    Example 2: Delete ^M character appended to the end of each line:

    Let's say we have a file called test.csv that has an extra character ^M at the end of each line as illustrated below.

    18,307,130,3504,12,70,1,8,0
    15,350,165,3693,12,70,1,8,0
    18,318,150,3436,11,70,1,8,0
    16,304,150,3433,12,70,1,8,0
    17,302,140,3449,11,70,1,8,0
    15,429,198,4341,10,70,1,8,0

    We can do use tr command as follows.

    tr -d "\015"  test1.csv

    The new file test1.csv will look like this:

    18,307,130,3504,12,70,1,8,0
    15,350,165,3693,12,70,1,8,0
    18,318,150,3436,11,70,1,8,0
    16,304,150,3433,12,70,1,8,0
    17,302,140,3449,11,70,1,8,0
    15,429,198,4341,10,70,1,8,0

    Note: 1) Place to download the Unix utilities for Windows: http://unxutils.sourceforge.net/

    2) See more complete document: http://www.gnu.org/manual/manual.html

    Tuesday, June 03, 2008

    wd vs. we in iplot of xspec.

    wd will output the plot into one data file without saving the figure properties, e.g. scale of the axies, label of the axises, etc (the file extension is .qdp).

    we, besides outputing the data, also output the figure properties into a separate file (whose extension is .pco).

    Monday, June 02, 2008

    latex table command collection.

    http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html

    http://www.mackichan.com/index.html?techtalk/501.htm~mainFrame

    http://www.mackichan.com/index.html?techtalk/501.htm~mainFrame

    Thursday, May 22, 2008

    how to display the directory only.

    in linux or unix, one can use the command below to display the directory only:

    ls -l | grep ^d

    ls -l | grep ^d | gawk '{print $9}'

    other tips as well:

    echo */
    ls-d ./*/
    ls -d */
    find . -type d

    all above will list the directories.

    Tuesday, February 05, 2008

    check font list in linux

    with command fc-list

    Monday, January 28, 2008

    some new phrases.

    close in: verb: advance or converge on

    put one finger on: identify

    getaway car:
    A getaway car is a car used to make a getaway, i.e. one used flee the scene of a crime. Getaway cars are prevalent especially in bank robberies as the criminals need to avoid apprehension by law enforcers such as police. Often stolen cars are used. In some cases the criminals discard the getaway car to hide their tracks by dumping it in a river or setting the car on fire.

    Monday, January 07, 2008

    grppha

    ftp://ftp.xray.mpe.mpg.de/xmm/service/data_analysis/EPIC_PN/spectral/spec_bin.html

    input files: source.fits, backgr.fits
    output file: source_grp.fits.fits
    instrument: EPIC PN and MOS, IMAGING mode


  • We have created a source and background spectrum source.fits and backgr.fits as described on the pages for the EPIC PN detector or for the EPIC MOS detector
  • It will ask you for the input and output names, e.g.

    Please enter PHA filename[] source.fits
    Please enter output filename[] source_grp.fits

    grppha will not overwrite an existing file. It will simply crash. To avoid this, either delete or rename the old file, or set clobber=yes.
  • Another useful page for grppha command is linked below:
  • http://heasarc.gsfc.nasa.gov/docs/journal/grppha4.html
    There are many examples out there, eg.
    To use GRPPHA in a non-interactive manner with no chatter:
    unix> grppha infile='test.pha' outfile='new.pha' chatter=0 comm='group 1 2048 4&bad 1-10&exit'