景顺's profile予人玫瑰,手留余香PhotosBlogListsMore Tools Help

Blog


    June 29

    Insertion sort

    #include <stdio.h>
    #include <stdlib.h>
    #define MAX 5
    void show(int arr[], int len){
     int i;
     for (i = 0 ; i < len ;i ++)
      printf ("%d = %d\n",i, arr[i]);
    }
    void insertion_sort(int arr[], int len){
     int i,j,k,temp_i;
     int key;
     if (len == 0) return;
     for (i = 1 ; i < len; i ++) {
      key = arr[i];
      for (j =i-1 ; j >=0; j--){
       if (key < arr[j]){
        arr[j+1] = arr[j];
        arr[j] = key;
       }//end if
       else
       {
        break;
       }
      }// end for j
     }//end for i
    }
    int main(void){
     int i ;
     int arr[MAX];
     for (i = 0 ; i <MAX ;i ++)
      scanf("%d\n",arr + i);
     printf ("before sort\n");
     show (arr,MAX);
     insertion_sort(arr,MAX);
     printf ("after sort\n");
     show (arr,MAX);
     return 0;
    }
      
    June 28

    examination questions of RO

    //convert a string to a number

    #include <stdio.h>
    #include <stdlib.h>
    #define ERROR 1000000000
    int char_to_i(const char val)
    {
        int rtn ;
        if (val < '0' || val >'9') return ERROR;
        rtn = val - '0';
        return rtn; 
    }
    double a_to_i(const char * val)
    {   
        int len ;
        double sum;
        int negative;
        int is_decimal;
        int current;
        double current_d;
        int distance;
        int i,j;

        sum = 0;
        len = strlen(val);
        negative = 0;
        is_decimal = 0;
        distance = 0;
        current_d = 0;
        for (i =0; i < len ; i ++)
        {
            if (val[i] == '-') {
                if (negative) return ERROR;//can not have 2 '-'
                negative = 1;
                continue;
            }

            if (val[i] == '.') {
                if (is_decimal) return ERROR;// can not have 2 '.'
                is_decimal = 1;
                continue;
            }
            current = char_to_i (val[i]);
            if (current == ERROR) return ERROR;
            current_d =(double) current;
            if (is_decimal){
                distance ++;
                for (j = 0 ; j < distance ; j++) current_d=current_d/10;
                sum += current_d;
            }else{
                sum = sum*10 + current_d;
            }
        }
        if (negative) sum = 0 - sum;
        return sum;
    }
    int main(void)
    {
        char in[255];
        printf("Plea input a string to test!\n");
        scanf("%s ",in);
        printf("the value is %f",a_to_i(in));
        return 0;
    }

    June 27

    Graduation

    We need to experience a lot of graduations in our lives.No matter feeling sad to separate with classmates and teachers, or wondering the new lieves we are going to face,  graduations means a lot to to us.

    Today I attended my son's  graduation ceremony from kindergarten.I had thought graduations did not make sense to children, and the ceremony was just a simple precess. It's really suprise me that the teachers really took serious of that ceremony.

    After the lecture from the host and the president ,  the children began to do some performance. Their teacher keep busy directing them to act well or seat quiet. As a powerpoint was showing on the screen, the host recall some scenes of the children's activity.

    1 image

    Enventually, it's time to the children say goodbye to their teach. The teacher's tear burn out her eyes, and she said she always welcome her children come back to see her. All the parents were deeply affected by her love.

    June 26

    my answer to the test

    //1 year ago, I had this test, then join current company. Now, I think I'v got some improvement , no recursion, manipulate a tree.

    #include <stdio.h>
    #include <stdlib.h>
    #define MAX_LENGTH 100

    int seed;
    typedef struct _node{
          struct _node * children[MAX_LENGTH];
          int children_count ;
          int value;
          int level;
          struct    _node * parent;
    }node;

    int radom()
    {
        return seed++;
    }

    node * create_tree(int level)
    {
        node * stack [MAX_LENGTH];
        int stack_length;
        node * current;
        node * root;
        node * new_node;
        int i ;
        if (level == 0) return 0;
        stack_length = 0;
        root = malloc(sizeof(node));
        root -> parent = 0;
        root -> level = 0;
        root -> value = radom();
        root -> children_count = 2;
        stack [stack_length++] = root;
        printf ("now create a node's value is %d\n", root->value);
        while(stack_length > 0)
        {
            current = stack[--stack_length];
            for ( i = 0 ; i < current ->children_count ; i ++ )
            {
                new_node = malloc(sizeof(node));
                new_node->level =  current->level + 1;
                new_node->value = radom();
                new_node->parent = current;
                new_node->children_count = 2;
                current -> children [i] = new_node;
                if (new_node ->level < level)
                {
                    stack [stack_length ++] = new_node;
                }
                else
                {
                    new_node -> children_count = 0;
                }
                printf ("now create a node's value is %d\n", new_node->value);
            }
        }
        return root;
    }

    void tranvers_tree(node * root)
    {
        node * stack[ MAX_LENGTH];
        int stack_length;
        node * current ;
        int i;
        stack_length = 0;
        stack [stack_length++] = root;
        while(stack_length > 0)
        {
            current = stack [--stack_length ];
            printf("current node's value is %d\n",current -> value);
            for (i = 0; i < current ->children_count ;i ++)
            {
                //printf("current node's children's  value is %d\n",current ->children[i] -> value);
                stack [stack_length ++] = current -> children[i];
            }
        }
    }
    int main(void)
    {
        seed = 0;
        printf("Create tree\n");
        node * root = create_tree (3);
        printf("tranvers tree\n");
        tranvers_tree (root);
    }

    2 New Tools

    Much as we complain about Microsoft's products,  we are no longer avoid using their product. Recently , I found 2 windows live writer and windows live mail are quite attractive.

    The following pictrue is taken from windows live writer, it looks quite windows vistal style. And it's functions are good too, such as inserting pictrue, inserting image,etc...

    1

    The following pictrue is taken from windows live mail.By using it to edit email, you don't need to worry about session time out any more. And the speed of get emails through it is more faster than through internet.

     image

    June 24

    Motorola 7789

    Motorola 7789 is a mobile phone produced by Motorola Ltd. It's a device for calling and sending text message. It's composed of an antenna, a cover and a main body. It is made of plastic. The main body of it is a rectangular box, the box is about 1*3*9cm. The antenna of it is tubular, the diameter  of the antenna is about 0.5 cm.  The cover of it is rectangular board, the base of the cover is about 3*4.

    June 22

    A man should fight for his ideas


    'I just want live a peace,ordinary life with my family' , maybe some celebrities will think so.  In the light of that statement , I'm this kind of luck man, I love my family , I'm health, and I can got salary from my company every month.  But the bad thing is , I don't want just be a ordinary guy, a guy work but have not brilliant success. And as a ordinary guy, I worry about my child's education , and worry about medical things. I try my best, with my parents' help, I managed to buy a house, but I sould pay half of my salary to bank every month . Anyway, my trouble is I don't want just be a ordinary guy.

    Yesteday, I finished reading a book,'c++ Primer'. To improve my coding skill, I have paid much time to reading books ,such as  c, c++, oracle, design patterner. I think now is the time I pratice something, so I want to join some open source projects.  But it seems this kind of projects need learning some skills of build up the envirment. I dont's know whether I can consist on doing it, and I don't know whether I can still have enough time in next half year. Maybe that's why I'm ordinary, I don't have engouh confident. I will try, a man sould fight for his ideas.

    June 21

    Europe cup 2008

    I like Netherlands very much,  but I really worry about it, the defender seems not good enough. Tonight , Netherland vesues Russia, no one knows what will happen.
     
    Actually, Europe cup 2008 remainds me a alot of histories.
     
    The first time I know about football is world cup 1990 at Italy, German win the champion.Ruud Gullit impressed me by his special hair, at that time, I think it's very cool, he and F Frank Rijkard and Van Basten are called  three musketeers. They really at their best time, but they lose to German. Will they regret all their life? At least, I remember their after 18 years.
     
    When 1994 world cup coming, I'm prepare my university entrance examination, After my examination, the finals is between Brazil and Itali. Roberto Baggio is really a good football player, he saved Itali 2 times, and took the team to the finals, and even at the final, he created alot chances to his friends, but there is a stupid guy lost all of them.Baggio is not a lucky guy,at  penalty kick, the ball flight up to the goal.
     
    1998 is really bad time to me, I even had not watch world cup game. Saying good bye to college time, having a bad job, we drunk all day...
     
    2002 and 2006 wrold cup, I had lost the passion about football. It seems strange, I was dream of watching world cup, but when I have time, I lost my interest. Some times I will have a look , but it seems all the stars are as good as 10 years ago.
     
    Anyway, tonight, I will watch Netherland to recall my younger time.
     
     
    June 20

    I Wonder

    [ti:I Wonder]
    [ar:Kanye West]
    [al:Graduation]
    Find your dreams come true
    And I wonder if you know
    What it means, what it means
    And I wonder if you know
    What it means, what it means
    And I wonder if you know
    What it means to find your dreams
    I\'ve been waiting on this my whole life
    These dreams be waking me up at night
    You say I think I\'m never wrong
    You know what, maybe you\'re right, aight
    And I wonder if you know
    What it means, what it means
    And I wonder if you know
    What it means to find your dreams
    You say he get on your f**king nerves
    You hope that he get what he deserves, word
    Do you even remember what the issue is
    You just trying to find where the tissue is
    You can still be who you wish you is
    It ain\'t happen yet
    And that\'s what the intuition is
    When you hop back in the car
    Drive back to the crib
    Run back to their arms
    The smokescreens
    The chokes and the screams
    You ever wonder what it all really mean
    And I wonder if you know
    What it means, what it means
    And I wonder if you know
    What it means to find your dreams
    And I\'m back on my grind
    A psychic read my lifeline
    Told me in my lifetime
    My name would help light up the Chicago skyline
    And that\'s what I\'m
    Seven o\'clock, that\'s primetime
    Heaven\'ll watch, God calling from the hotlines
    Why he keep giving me hot lines
    I\'m a star, how could I not shine
    How many ladies in the house
    How many ladies in the house without a spouse
    Something in your blouse got me feeling so aroused
    What you about
    On that independent shit
    Trade it all for a husband and some kids
    You ever wonder what it all really mean
    You ever wonder if you\'ll find your dreams
    June 19

    Lazy man is perfact

    If  a man changes his jobs frequently, for some bosses, this man is not a trustful man and can not be hired. But bosses can not put all the blame on employees. In fact, some employees are responsible and want to contibute to the company, but his boss just treat him as a tool, not a man having ideas. By disgarding his ideas, commanding him rudly, a boss can dispel a employee's passion easily. In the light of this statment, a lazy man is perfact to some bosses.
     
    There are some tips for being a lazy man who can win the trust his boss.
    + foreigner are always boss, no matter he is a project manager , department manager, or senior engineer.
    + bosses are always right,say he is right if your boss disagree your opnions.
    + use 'thanks' all the time.
     
     
     
     
     

    English teacher

    Our company offers us some English trainning on Monday and Thursday.  One colleague recommand me the Monday techer, so I took Monday class serval times. I have something to do this Monday, so I attend the Thursday course.To my suprise,  Thursday teacher is a young British Lady, and her perfact British accent is so attractive.  it's wonderful, I hope I had taken her class before.
    June 17

    (转)如此乱译美国《独立宣言》是为什么?

    <摘自互联网,并不代表本人观点,本人不为此承担任何政治责任>
     
    如此乱译美国《独立宣言》是为什么?


    范学德

    (虽然来到美国十四年了,但我看到的亦不过是管中窥豹而已。据美国一位大法官讲,美国成功的基础就在宗教,教育和法律。而前两点,恰恰被国人严重忽视,所以,我不免会多记录几笔,且请原谅在先)

    《独立宣言》是人类历史上最重要的人权文件之一。但在流行的《独立宣言》的中译本中,《独立宣言》中最重要的一句话却译得大错特错,这样的错误再也不应该继续下去了。

    英文中的这一段话是:

    We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty, and the pursuit of Happiness.

    流行翻译为:“我们认为这些真理是不言而喻 的:人人生而平等,他们都从他们的"造物主"那边被赋予了某些不可转让的权利,其中包括生命权、自由权和追求幸福的权利。”

    关键在这一句:“all men are created equal”。

    把“all men are created equal,”翻译成“人人生而平等”,显然是错了,并且是不应该发生的错误。

    现在,有人出来纠正这个错误了,张玉明将其翻译为“所有的人是受造而平等的”(见《传扬》杂志2005年二月号),任东来将它翻译为“造物者创造了平等的个人”,(这是我在《法律史学术网》上查到的。)据李道揆在《美国研究》2001年第2期上介绍,关于《独立宣言》,近三十年来,中文有五个译本。不知道那一位有心人能够找到这五个译本,看看它们对这一句话都是如何翻译的。

    为什么在这样一句很普通的英文上,会翻译得如此离谱,这是为什么?是不是某种无神论的世界观在作怪?
    (或者只是简单地沿袭了早期的翻译?——范注)

    很显然,美国的先祖很清楚,人并不是生而平等的,无论是从长相的美丑,身体的强弱,天资的聪明与愚笨,还是家庭的贫富,人都不是生而平等的。但是,无论这一切如何不同,人受造而平等,造物主所创造的个人是平等的。

    这就牵涉到了三个观念:第一,造物主。《独立宣言》承认有一位造物主,所有的人都是被他所创造的,人是一个受造者。第二,人之平等就在于,人的生命中内在地包含了人之为人所不可剥夺的自由,价值和尊严,这一切不以外在的任何条件而转移。连批评基督教>基督教的美国独立斗士潘恩都引证了这样的一段话来论证这个观点:“上帝说,我们要照着我们的形象,按着我们的样式造人。上帝就照着自己的形象造人,乃是照着他的形象造男造女”(见《圣经》第一篇《创世记》)。第三,这样的自由,价值和尊严由于是被上帝所赋予给每一个人的,因此,任何政府和个人都没有权利剥夺人的自由,践踏人的尊严。

    由此才可以理解,紧接着上面那句话,《独立宣言》立即宣称:“为了保障这些权 利,人们才在他们之间建立政府,而政府之正当权力,则来自被统治者的同意。任何形式的政府,只要破坏上述目的,人民就有权利改变或废除它,并建立新政府; 新政府赖以奠基的原则,得以组织权力的方式,都要最大可能地增进民众的安全和幸福。”

    由此才可以理解,为什么以无神论立国的国家,统治者敢于肆无忌惮地践踏人权。道理很简单,因为他们不相信神,也不怕神。

    “所有的人是受造而平等的”。人们可以不赞成《独立宣言》中宣扬的这个观念,但你却不能把它说成“人人生而平等”。

    哪是明显的伪造,说谎

     

    这里要讨论的只有一件事,就是这样重要的一份历史文献(不是诗歌小说),里面这样简单并且十分重要的一句话(“that all men are created equal” ),到底是否应当按照它本来的并且十分明显的意思直接翻译出来。

    由“that all men are created equal”开始的这一段话,是整个独立宣言的理论的基础。

    我提出以下理由支持我的观点:

    翻译的前提是理解。根据解释学的一般原理。

    1.首先我们应当确认我们所面对的是哪一种文体。独立宣言属于历史文献,不是小说诗歌,所以,对于它无论是直译还是意译,都应该准确地表达作者本来的意思。

    2.直接探讨这句话字面上的意思。that all men are created equal” 一句话中的are created 非常明显,不是出生的意思,而是被创造。

    3.联系上下文确定这句话的意思。紧接着上句话,宣言马上说: that all men are created equal, that they are endowed by their Creator 。。。很明显。作者说that all men are created,是表达一切人都是被他们的(by their Creator)造物主创造的。

    4.从整个文本中进一步确定这句话的意思。由“that all men are created equal”开始的这一段话,是整个独立宣言的理论的基础。它正与最后一句话相呼应,那句话是:為了支持這篇宣言,我們堅決信賴上帝的庇佑,以我們的生命、我們的財產和我們神聖的名譽,彼此宣誓。它直接用了“上帝”一词。


    5.确定这句话要表达的思想,与作者在全篇文章中要表达的思想在逻辑上是否一致。如果没有这个逻辑前提——所有的人都是被一个造物主(原文用的是单数,大写),那么,每一个人都被赋予了种种不可剥夺(不可转让)的平等权利的结论,就相互矛盾了。很显然,作者要回答一个问题:人权的源头在哪里?不是在政府,而是在造物主。

    因此,这些权利不是天生的,父母给的,(父母给的,父母就可以取回),也不是社会或者国家给的(他们也可以取回),而是造物主给的。这样,独立宣言的写作者在一开始就赋予人权一个神圣的源头——造物主。

    很明显,宣言作者是在告诉英国政府,人所应当享有的哪些权利,不是你恩赐的,而是造物主给每一个人的,因此,你没有任何权利剥夺这些权利!

    政府没有权利剥夺人权。这在当时是一个具有极其革命性,颠覆性的宣告。而且,它宣告的有理,因为它直接付诸于美国人都可以理解的造物主的观念。

    6.在整个文化情境中理解作者所使用的基本概念。“创造”(creat)在西方文化中是一个非常重要的观念。它表达的是一个从无到有的过程。“生”是从有到有,不同形态的转化。而创造不是。当“创造”(creat)讲到人时,自然把人同他们的造物主直接联系起来——造物主与被创造者,就是说,所有的人都是被造物主所创造的,他们在被造上是平等的。

    而这样的创造观念,只能够与西方人的宗教信仰联系起来,而当时的美国人的宗教信仰,是他们世界观的决定性部分

    7.联系到当时的整个社会情境。当时社会上的人,对于一个概念是怎么理解的。注意,宣言的作者不是写哲学教科书,而是直接对大众说话。他们的话必须为大众所能够理解。而当时美国大众的绝大多数是相信上帝的,是相信人是被上帝所创造的。(即是自然神论者,也不公开否认造物主的观念),因此,说所有的人被造而平等,他们立即就能够明白。尽管,他们完全明白这一点,还需要一个历史过程。

    8.最后一句。翻译西方历史文献,首先是为了了解当时的美国人是怎么说,怎么想的。而不是我们希望他们怎么说,怎么想的,更不要为了我们的理解力或者现实需要,就改动那些非常明白的直接的意思。如此,才能够实现文化的交流。不然,我们会把一切外来的观念,都打伤中国的烙印,并宣称是自古有之,我们的老祖宗早就说过了。

     并且,即使在谈论人权,西方也有不同的概念体系。比如,法国人权宣言和世界人权宣言就都没有提到造物主。因此,我们既不能用美国人权宣言代替法国人权宣言,也不能相反,尽管它们有许多相同的基本观念。

    退一万步,如果说早期的翻译是由于不了解美国文化而误译,那么,现在也是该纠正这个错误了。错误并不因为大家都接受就正确了,正如错误并不由于权力的支持就有理了

    June 16

    New Concept English

    In current time, technology develops fast, special effects on film shock our eyes and ears, but films can never have the same power as  literature. Industry makes thing huge, but these things are not as delicacy as tradition.
     
    New Concept English is familiar too us as a meterial to leaning English. I disgard it because I find a lot of new things from internet, NCE seems a little behind the times. But, recently, I got some videos of NCE training, I found NCE is still the best course I have got.
     
    One type of English course is called 'business English', there are some scenes such as meeting, shopping,greeting. In my opinion, the purpose of this type of training is just making People lazy and silly. Without the culture, any quick learning methods are useless. And there is another kind of method called 'crazy English', it really a good way to taught people how to looks or sounds crazy. For NCE, if you try to understand it and enjoy it, you will feel the interesting of assembling words.
    June 15

    The Chronicles of Narnia: Prince Caspian

    It's a film worth seeing, but it did not attracted me very much, much less shocking me.
     
    Narnia was a peace and happy place,with some speakable animals and special humans. After A group of human broke in and distroyed everything, some of Narnia citizen hide in a forest. For some reasons,a prince Caspian and 4 young man came to Narnia to help them. A battle between Narnia citizen bad human broke out...
     
    Something in the story impressed me,
    + about faith, our faith is getting faint when we grow up. that's why the most little girl can see a lot of things than her sister and brothers. As adults, we always think we are clever than kids, but in fact, we are foolish than them,you see, they are happier than us.
     
    + about reality and dream, the 4 young man spent a lot of days in Narnia, but when they went back to London, there was only a second past. It's hard to identify reality and dream. it took our years to get a good job, a big house,  but we will lost them quickly,years later, will we go to annother place just like the kids went back to London?
    June 14

    Happy father's day

    Tomorrow is father's day. Hop all fathers heathy and happy!

    Happy father's day

    Tomorrow is father's day. Hop all fathers heathy and happy!
    June 13

    Busyness trip to India

    My visa to India is OK, now. So, maybe, 2 or 3 weeks later, I will go to India.
     
    There is a lot of tell about India, most of them are not good, such as
    + The weather in Indea is hot, it makes people uncomfortable.
    + The work at India is hard, they work 6 day a week, and overtime work is required.
    + They are not polite to Chinese , someone had been robed.
    + The food there is untolerable, they eat food by hands, unbeliveable.
     
    Anyway, I have no chioice, so accept it...
     
    June 12

    eMule - fans

    I found I'm a total eMule-fans, I like download everything from Internet.
     
    Every time I goto http://www.verycd.com , I can't resist the tempt of new Movies, favourite softwares and fond musics...To keep everythings I like, I bought a new hard disk,a mobie disk,a DVD writer. The result is , less of them give me a happy time, most of them I only touch it 1 or 2 times. Recently, I found some website supplies online services,such as  musics、movies、pictures and books. your don't need to worry about how to reserve them,just enjoy it. So I see some TV show online, I can see some part at Comany at rest time, and when I go home, I can continue.
     
    The thing is , using online-website take away the funs of  downloading process from me. You see, when you download a film by eMule, it will take you more than 2 hours, in these time , you can image how wandful the film is, and you see the film introuduction times and times. It really a happy process, waiting and imaging.  Easyer get, easyer lost...
     

    Harry Potter

    I watch the film again...
    A little thin boy wares a pair of glasses,  with wicked smile .
    Cool, I like this boy too. He lives with his aunt , but his aunt does not like him, and his cousin baits him.
    But infact, he is not a ordinary guy, you know what? He is a wezard, his is famous, he born to do something great.
     
    It's a dream of alot of boys ,maybe adults too, we bear the plain of day after day, but dreams nerver stop.
    June 11

    Papa and Mana

    I have put their picture to the left...
    They are getting old, but still looks good.
     
    A strong man stand up for himself, a stronger man stand up for others.
    I think they are stronger men.