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