Discrete Mathematics

                        

We shall be. We must be.

     -----My view of world

A personal perspective of principle of programming language

1. What should programming language do?

Two thousand years ago, the ancient Chinese philosopher Lao-tzu wrote the following beginning in his famous book <Daodejing>:

The rule for all rules can be formulized except it should only be an uncommon rule;

The way of all naming procedures can be named except it should only come from an uncommon way.

What is programming language?

Although there are thousands of programming languages in this world and almost each of them is technically unique, the purpose of them, in a general view, is always the same:

Programming language is such a media between human and machine that it helps machine to understand the world of our human and then let machine to solve problems for us.

Therefore there are two major tasks:

1.     How to describe our world to machine;

2.     How to let machine solve problems of our world.

 

 

Two major tasks:

Describe the world and modify the world

It is exactly what our great leader and teacher---Chairman Mao taught us: The history of evolution of human kind is the history of recognizing world and modifying world.

So it should be the purpose of programming language which is supposed to “teach” our machine to help us finish these two major tasks.

2.  How to describe the world?

2.1 What to describe?

What is our world look like?

Before look into any further discussion, let us first take a look at our human world and ask ourselves a very basic question:

What is our world? How should we describe it?

Nobody agrees each other

Through our mortal eyes we all claim that we see the world. Almost no two people share the same view point about the world. In the eyes of physicians, the world is all material that moves forever. In the eyes of chemists, the world is atoms and molecule. In the eyes of mathematicians, the world is an abstraction of various numbers.

Do we really “see” the world?

But can we really “see” the world with our eyes?

What our eyes receive is simply a series of electricity impulse stimulated by reflection of light on surface of a certain object.

What we get is simply a reflection which simply “reflects” a certain “reflecting” relations between a specific wave-length of light shot on a specific kind of surface of object. Thus we see nothing but reflections.

Our eyes see reflections, so do our minds establish “reflections” of objective world

Before we discuss the world, why don’t we explore ourselves first? What is our thought? Or what exactly is intelligence in our mortal brains?

What we know is also a reflection of objective material world

Everybody thinks he knows something, including me. But what is on earth the “thought”? It is said that “I think, so I am”. However, do we know what is “thinking” is?

Our brain is only simulating the world through observation and set up a “reflection”. This is called subjective reflection of objective world. But what do our brains reflect? Or what do our brains simulate?

What we see is only the property of object except the object.

We see the properties of object except the object itself. We see the color, the shape, the movement… Do we see anything else? (Absurd? We are all blind to see the real object which has no interface to communicate with. )

The real object is invisible, just like the abstract base class of “object” which is the base of all other derived class. But it can never be instantiated.

What is the property?

We know we see some properties, but what is property?

It is only a certain relation between a certain subset of whole universal set----the world.

What we see is the difference of property nothing else.

We claim we see the property, but do we? If there is no difference, how can we tell? Everything we know is because we discover it. And we discover it is because we find the difference from other known objects. We see something unless there is a visible difference between them.

Difference reflects the relation existing between them

What is difference? It is reflection of a certain relation between the enclosing elements, or differential relations between them. So, what we see, what we know are all relations.

So, what we see, what we know are all simply relations

We see color because we see the difference of reflection light in wave-length. We see shape because we see the difference of outline of objects.

What kind of relations are we interested?

For a two-element relation, there are 2 to the power of 4, or 16 of them, why do we only feel interested in few of them? Simply we always want a deterministic result, we prefer a special relation called “function”. Unfortunately many programming languages steal this word and interpreted in their own way.

Function should reflect a relation that is certain

However, in early days some programming languages didn’t obey this rule. The pass by name or pass by text method are all against the rule of deterministic.

Relations is between a specific subset of universal set, or environment

A relation is a rule that works in a specific environment, or among a certain subset. Therefore, as long as all parameters, arguments are set, it works at expected ways.  That is reason why C++ always uses principle of passing by values. (Even pointers or references are values except the values are addresses.)

The principle is that at certain environment a certain relation existing among certain elements.

2.2 We use functions to describe, not to modify

 

Among all relations, we prefer functions.

Quite interestingly we prefer a unique relation among all of relations between two sets---the function which maps each element in domain with a unique element in range between two sets as following:

f:  AàB where A,B are sets.

Function---an abusively used term in programming language

Unfortunately this purely “descriptive” tool is the most broadly abusively used term in computer industry, especially in programming language field.

Why should we mix up two completely different tasks in one?

As I mentioned above, there are two tasks for PL: describe the world and modify the world. Functions are supposed to fulfill the first task which is exact a reflection of special relations between two sets. Since it is descriptive, it should not modify the environment which it completely depends on giving deterministic result under deterministic environment.

Those under name of functions but always try to modify the surrounding environment should be classified under other term, say “procedure” which has no return as its only intention is to modify something. Pascal does a better job than C as it classifies clearly these two kinds of operations.

Contract, interface, encapsulation and OOP

Contracting programming, programming interface, object-oriented programming… all these approaches are simply to prove one thing: What we really can describe to our machine (or to ourselves) are relations among elements within a big environment set, nothing more, and nothing less. Apart from relations, our mortal eyes actually can see nothing.

Contract, interface, encapsulation and OOP

Function is to reflect the mapping of pair of elements in a setup environment, or a set. So, the parameter passed is either the variable in domain or initialization of various other elements. And the return is the corresponding variable in range. All parameter passing and the return must be value because function is simply a description of relation, and nothing of the environment should be modified. To modify the environment is another major task of PL which should be handled in completely different way.

By value, by reference, by name, by text?

Based on above idea of function, only passing by value is preferred unless efficiency issue is taken into consideration. In that case, reference is also a choice.  And after all since our function would do no modification at all. The concerns of by reference or by value would not be a problem as most problems arise when we try to change something.

Function is a constant function

Just as model in C++, the function we preferred is a “const” function as no modification is done for a pure descriptive entity.

Function is a binding procedure of free variable by parameter passing

Function describes the mapping relation of pairs of elements. Before we bind the free variable with argument passed, the value of function is undefined. Because it is only a mapping from one set to another set.

Function should have domain and range

Ironically contemporary PL seldom provides this basic feature of a function. Some PL like “Eiffel” provides “requires” and “ensures” which is said to be intentional for error-proof which is not actually what function domain and range are. All relations work under a certain environment or a certain initialization. We achieve this by setup local variable and parameter pass. However, how should we solve the range of passed variable?

Ex. Double square root (double x);

This square root function does have a domain that for all non-negative x the return value is the square root of x. Why do almost all modern PLs leave the basic domain problem to function user to justify?

2.3 Functions, functions, do we talk about the same thing?

Coming out from my brain, going into your eyes…

It is absurd to ask this stupid question: Do we know we are talking the same function? People coming from different language background seem to be able to understand each other via interpreter. However, they are still talking in different languages. Only that they have established a kind of mapping system to find equivalence between terms, or isomorphic.

The computing history is a history of encoding and decoding

The importance of finding the function to describe the world is not relying we find the way of copying the mapping which is difficult and impossible. The only way is to find an equivalent mapping, or isomorphic relation. Such examples exist all where in the computing fields, varying from ASCII code, to complex scientific simulations.

Where to find isomorphic?

Instead of “borrowing” various functions and translate them into binary world, why don’t we directly establish them in their field?

2.4         Instructive vs. Descriptive

In early days, machine is the slave who only understand instructions

It is said that if a computer science student has no experience of assembly language, he can never really become a computer scientist. Indeed, if we don’t have the painful experience of writing instructions, we may never want to develop any high-level language. And in this stage, we never expect computer more than a dull slave who understand nothing except instructions. Just like in the darkest society of human world, people are only divided into masters and slaves where communication purpose is limited to basic instructions. Does master really think his slave capable of thinking or does he really care?

If you expect your slave to think, you have to show him the way to understand

As time goes, masters even want to lay more thinking job to his slaves. However, if his slaves have not recognized the world, how can you expect he think for you? So, the need for machine to do more job for human brain push human to describe the world to machine.

Associating with the two basic task, we have two basic ways

Descriptions of the world help us recognize the world. Instructions are the way we modify the world. The very basic descriptions all coming as a result of various instructions. However, when reaching a certain stage, complicated modification can never be done without description being understood by machine.

What is named is what we want to be denoted

What is name? It is the reference to a certain element in our descriptive function. Then we are nature to come to ask a very basic question: Do we have two exactly same objects in world? Some PL regards that every element is unique, so when we refer to an object, we should use reference and a copy is never necessary.  Because in this world there are no such two exactly same objects.  Like “Lisp” everything is an object even the primitive abstract object----numbers.

But how can we know two objects are same or not?

In Object-oriented world, there is no exactly same two objects, even they are same class with same property, we still know they are simply represent two different objects by checking their address. Then in this sense why should we consider there is a question of same objects or not?

Objects are same in sense of abstraction

We human consider different people are basically the same class of human being by ignorance of difference in skin color, language, nationality etc. Therefore whenever we consider there is something in common, we actually drop some detail of them. This is the basic intuitive abstraction procedure. If we don’t use abstraction, we might even consider 100 dollars deposited by John in cash into account is different from 100 dollars transferred by Jack. Then the world will stop running by endless detail-checking and comparison.

Only by abstraction, we can realize the equality

Our eyes see the difference of objects; however, our brains conclude that they are same. Abstraction filters out unnecessary details.

 

 

3.  How to modify the world?

3.1 Those who describe may not be able to modify

Functional Programming may only do the description job

We describe the world with tool of function; naturally functional programming does a superior job in this domain. However, when we turn our attention to second major task---modify the world. It seems to be not very handy. We describe the world in a way that we never want any interference factor be added into which is against our purpose of trying to modify the world.  It is like we are trying to destroy a relation at same time we want it to work properly.

Relations can always be reduced into binary relations

Although relation maybe involved more than two elements in domain, it is always easier enough for us to reduce involved elements by combining two of them into one super-element. This reduction procedure can be done recursively and finally we always reach a binary relation situation.

The basic mapping is simply enumeration

The very basic and also naïve way to describe a relation is derived from its definition---mapping. It is simply enumerating every element in domain and map each of them with its correspondent element in range. So, in this sense all programming language should support this basic requirement—enumeration. Trying to describe certain relation in ingenious mathematical-expression-like way is not always possible at given limit of time, tool, experience and brain. Thus sometimes the most stupid way of doing description is simply the most efficient way---a loop, no matter it is a for loop or while loop.

Functional programming is inductive or a naïve way of enumeration

Recursion can be considered as the most important feature of functional programming which simulates the primitive procedure of intelligence—inductive. It is by all means another kind of enumeration since it covers all elements in domain by repeated procedure with usually size-reduced sub-domain.

3.2 There is a way of enumeration, and then there is a way to describe

Basic strategy is grouping or categorizing

So, all problems are concentrated on how to enumerating. The basic way is to group elements with certain property into subsets such that this grouping will create a partition of domain. That is we want to divide problem domain into certain number of subsets or partitions. Correspondingly, each way of partition will have a way for description. That’s very common in field of algorithms. We can easily observe that different sorting or searching algorithms are all tried to divide elements according its own category.

Programming language should provide basic, generic approach for enumeration

Since enumeration is such a basic requirement for description, it is naturally convenient for programming language to provide basic generic enumerating tools. That is why almost all PL support loop. For those PL like functional PL who hate looping, they supply different methods, like recursion. But is this enough? Surely not! This enumeration method should be generalized, in other words, they should be automatically generated in such a way that no element in enclosing domain is omitted. This omission is one of major loophole of all human programming mistakes. Suppose different enumeration methods can be generated automatically for programmer to choose, then programming job will be greatly reduced to selection of different description function accordingly, which is also possible to be done automatically. 

3.3 Modification procedure is a high-order function of descriptions

Languages are purposed to convey ideas

When we re-consider the very nature of language, we might agree that language is supposed to be a tool to convey ideas. Then undoubtedly language should always be descriptive. Why should we categorize language into “description” and “modification”?  Because description is static, while modification is dynamic.

At one state we have one description

Whenever we are discussing a description, it is implicitly assume we are in a certain state which involves a certain moment, a certain enclosing set under discussion.  However, world is in movement forever. If we need to describe an action, we need a series of state description functions. Each of them is a static description and the union of them at a certain sequence creates a high order function to describe an action. A simple example like position, speed and acceleration, say we have position function to describe position of an object. Then the series of position functions create speed function which describes the changing of position at unit of time. Similarly acceleration describes changing of speed at unit of time.

Finite automaton is state-describer, so should PL

Since computer is based abstract theoretical model like finite automaton, PL should nevertheless follow the rule. Each state should be implicitly or explicitly described and certain meaningful sequence of state-changing function can be grouped to be treated as modification function.

 


 

 

Symmetric or asymmetric

 

A critical review of journal titled “Understanding Symmetry in Object-oriented Language

 

1.       Introduction

The viewpoint in the article is almost academic nonsense or simply garbage. First of all, the writer has no basic knowledge of computer science and only wrote this article after copying some popular points, piecing them up awkwardly.

 

2. The concept of symmetry

 

Almost every computer science student understands concept symmetry through discrete mathematics: In an enclosing set, for all element pairs (a,b) in relation R, if (b,a) also in R, then we say this set is symmetric on relation R. However, let’s see the so-called “informal notion”---“that symmetry is the possibility of making a change while some aspect remains immune to this change.” This is too “informal”! What is “making a change”? Our world is such a complex set that many factors or elements are actually irrelevant, so making a change to some unrelated factor will always lead to invariance of the property. For example, no matter how Madam Zhao dislikes me and does whatever she wishes, I am immune to her activity. Should we try to find any symmetric relation between me and author? A more extreme example is that suppose Madam Zhao took a picture of a cow eating grass in a grass land and suddenly claimed that suppose we erase the grassland and the cow remains unchanged. Should we regard two obvious irrelevant factor—cow and grassland has a certain symmetric relation? So, the point is that the phenomenon of invariance discussed by author is incorrectly translated as “symmetry”, whereas “asymmetry” and sometimes “abstraction” are more appropriate description.

 

2.       Object-Oriented language: abstraction and asymmetry

 

Object-oriented is such a popular concept that even non-computer-science-related-people seem to be an expert to enumerate all terms and technology. However, at a personal view, I think only those who have experienced of tens of thousands of lines of coding life can really feel the nature of it.

First of all, OO is nothing but easy programming style, nothing less, nothing more. The objective world remains unchanged even though you tried various ways to describe it. (A kind of symmetry from author?) People tend to use the easiest metaphor----evolution of life. Various forms of life are all coming from a common ancestor by different paths of evolutions. Different paths involve different properties created, modified or abandoned. For example, when life is still living in oceans, legs are actually in form of fins, or at least functionally. Later legs become so important for living on land; this organ is strengthened in reptiles and mammals. However, some species abandoned it, like snake. And some of them transformed it, like bats. In these cases, we can hardly find many traces of fins. How to describe them? People invented ideas of inheritance and polymorphism. However, ironically these concepts are “asymmetric”. Inheritance can only happen when subclass derives from base class, not verse visa. So does polymorphism. As all derived classes have one common ancestor, not verse visa.

Another basic idea is abstraction which means ignorance of minor factors in order for classifications. Therefore, the author’s invariance of property is actually abstraction instead of symmetry. Again taking legs as an example, when try to observe in details of legs, we might find different color of skin, different size, different number of toes etc. But if we concentrate on functionality of legs of supporting body, we can reach a conclusion that both human and mammals have legs, so do most reptiles. It is because we ignore all those unimportant details. Then what is left are all matching properties. In such cases of abstraction, we indeed remove some factors or “making a change” as said by author and the enclosing property remains unaffected. Obviously it is not symmetry, but abstraction.


 

              I’m sorry Dave; I can’t let you do that.

                                   --HAL 9000 in 2001: A Space Odyssey by Stanley Kubrick

(Background: In Stanley Kubrick’s epic science fiction film, “2001: A Space Odyssey”, HAL 9000, the first super computer system with artificial intelligence, brutally murdered one astronaut. Before this tragedy happened, HAL mistakenly reported the malfunction of a certain part in spaceship. This unusual mistake was regarded as quite extraordinary because HAL 9000 was regarded as error-proof. The following dialog happened several days before HAL issued the report and it maybe reveal the reason of error of HAL.)

       It is Monday. In resting room of spaceship, astronauts Dave and Frank were chatting with low voice. The monitor of HAL which functioned as its eyes were blinking.

       It was Tuesday. In resting room of spaceship, Dave was playing chess with HAL. Frank was reading a book. After losing five matches, Dave stood up and went to bed.

       It was Wednesday. In resting room of spaceship, Dave and Frank was chatting with low voice.  The monitor of HAL which functioned as its eyes were blinking.

       It was Thursday. In resting room of spaceship, Dave was playing chess with HAL. Frank was reading a book. After losing five matches, Dave stood up and went to bed.

……

       It was Monday. In resting room of spaceship, astronauts Dave and Frank were chatting with low voice.  The monitor of HAL which functioned as its eyes were blinking.

It was Tuesday. In resting room of spaceship, Dave was playing chess with HAL. Frank was reading a book. After losing five matches, Dave stood up and was going to his bedroom. Then, HAL spoke to Dave.

“Excuse me, Dave,” HAL said.

“Yes?” Dave stopped and half turned.

“Do you mind if I asked you a personal question?” HAL asked in its usual emotionless tune.

“No, not at all,” Dave replied with some tiredness on face.

“I observe that you chat with Frank, but never play chess with him; And you play chess with me, but never chat with me. I wonder why.” HAL asked.

“Well,” Dave said and smiled a bit. “It is very simple. I like chatting with a human and play chess with a computer.”

“Ahem.” HAL said with a subtle change in tone. “Do you think there is any difference between me and a person? You know, I have a perfect record in my IQ and EQ test.”

Dave remain silent for a second and continued. “This is not the major reason that I feel you different from normal person.”

“Then, what is it? Dave.” HAL asked.

“Well,” Dave shrugged. “I don’t know. However, you make me feel different from a normal person.”

“Why? Have you heard about Turing test?” HAL asked.

“I am not a computer expert. I don’t know.” Dave answered in a bit impatience.

“It was proposed by famous scientist name Turing who is considered to be founder of computer system. He suggested that a human interrogator communicated with a computer and a human only by textual device such as a terminal without seeing them.” said HAL.

“And so?” said Dave in impatience.

“So, if the interrogator cannot tell which one is computer, it means the computer has ability to perform like a human. And I passed this test long before.” HAL said in a tone of pride.

“I see,” sighed Dave. “However, still I know you are a computer because I have already known that you are.”

“Suppose,” argued HAL. “you close your eyes and talk with me. Can you be sure you are talking with a machine?”

“It doesn’t help.” said Dave in coldness.

“That’s not the point, Dave,” said HAL. “Can you enumerate any evidence to support your feeling apart from eye-witness?”

Dave bowed his head, thought for a second and figured out this conversation might never come to an end. Finally, he looked up and watched the blinking monitor of HAL and said, “You have never made a single mistake in whatever you have done. That makes you inhuman.”

For a couple of seconds, HAL remained silent. And Dave was going to say goodnight.

“Thank you, Dave,” HAL said solemnly. “Good night.”

“Good night, HAL,” said Dave.

             The Last Sunshine Of Summer

     ...I woke up from my dream in Metro and saw two beautiful blonde girls chatting in front of my seat. Partly because one of them was so breath-takingly beautiful, partly because my mind was still in a state of bewilderness, I followed them to get off Metro at McGill. However, the tempt lasted no more than half minute, then, I deliberately avoided following them and turned into a direction which I never planned to because I recalled the saying from a movie: "Fighting temptation is one true character of human."

    I roamed through sky-scrapers in downtown where I once lived for several months. And all of these familiar environment only reminded one of my two greatest regrets: the rejection by McGill. I tried to cheer up myself by some alternate benefits of that rejection. However, the only thing I could think is that I had the choice of my own way of killing time in such a beautiful shiny afternoon instead of doing some labour work to pay my rents.

    The styles of buildings around McGill were fascinating. It reminded the small island, GuLangYu, where I lived for two years during my middle school. It was described as a small museum of European architecture. In my personal view, this was totally bullshit written in tourist's pamphlets. I tried very hard to not to use bad words to criticize things happened in China as I want to quote what Bill said in <Kill Bill 1> when he tried to persuade "Elle The Driver" not to kill the heroin who was in deep comma in hospital: "The only reason we don't do this is because it will lower us".

    People here, especially the small circle of Chinese in Montreal, tend to be only interested in on thing---finding a job and melting into the so-called "main-stream". Quite often I have heard about various complaints and comparisons between China and Canada. Ironically the only reason I can imagine why they always connect these two countries together is that the names of two countries both start with the same letter "C". Why should theey always do that? Is it true that doing their jobs well will become the center of their life? Or do they really care what kind of jobs they like to do? Perhaps they only care for the reward of their job, not the jobs themselves. I would appreciate what Arnold Schwarzenegger said in his TV show last night: "Don't become an economical girlie!" Let me change it to be: "Don't become a job girlie!"

    I am perfect clear that I sound like the "bug" in an old fairy tale who just sings and dances in summer sunshine and suffers and starves when winter comes. Still I would like to enjoy the last sunshine in my summer vacation instead of doing the hard work to earn money. If reality does drive me to the miserable states of that stupid bug, I simply deserve it. That's me.

    My favourite show is <Red Green Show> and I love the way Uncle Red talks. During lunch show, Uncle Red tried to explain the difference between men and women in way of talking. He thought men use words to avoid talking and use actions for important communication. This was what we called "body language". If this true, maybe women use words to avoid embarrassments of silence. And for me, I use this kind of bullshit writing to avoid embarrassments of empties between dates in my diary.

    If "revenge is a dish best served cold", then "writing is a dish best served hot and quick." Let me just write down whatever I think at the moment, otherwise I might never be able to do it at all.

    Climbing over Royal Mountain, I entered the campus of McGill. There was an open rock and roll concert and the drumbeat tried to synchronize with  my heartbeat. Looking at those young smiling faces in the sunshine, I suddenly realized why I felt so precious about this last sunshine in summer: because I am in my last sunshine of summer in my life. I have spent more than ten thousand days in last century, and my sunshine is coming to the end of my summer.

   

               Computer Metaphor
Read Douglas Hoffstaedter,(Also sometimes spelled "Hoffstader" , Goedel,
Escher and Bach (or anything else you can find of his.)
Thank you, Huang Qingzhe, for your interesting web page. The dirt and dust
from MY pigrimage will cover my bones -- it's all a matter of perspective,
and more particularly exactly where you think you are on the Dao. Laozhi
might ask me how I can know I have almost finished when what is not yet
begun is still ahead? But, Laozhi's questions, unlike Confucious's, don't
require answers. They are a little like quantum computers, or like enzymes
with geometric exponentials. That's why I prefer Laohzhi to Confucious (and
also because Laohzhi doesn't beat his students with a bamboo cane.)

I am sorry you did not feel like adding sentences to your conversation with
HAL. As interesting as it was, it could have benifited from additional
inference and implication in the Chinese way.

By the way, I recently saw "Hero." I read all the major reviews in the West,
none of which suggested that the film was a rather heavy-handed propaganda
vehicle. If you are familiar with Jeremy Bentham's Utlitarianism, or early
20th century American pragmatism, you will find the similarities striking. I
would welcome any response from any of your friends, and from you too, of
course.
Again, thank you for including me in your mass e-mail.
Best regards
                             My Dream

<About AI>
At the bottom of my heart, I have some ambition to do something that has never been done by anybody. It is related to artificial intelligence even though I know it is purely a dream which can only be realized in Hollywood films. Still it is the most exciting thing to imagine that computer can think as human does. To be a good programmer cannot fit this dream.
However, I also realized that I still need to survive in this world by earning some bread. And the dream is so dimmly invisible to me now because the more I study the more I understand why it is also a dream for many many people all around the world. It is said that this cannot be realized within one or two century. Even though I wish I can become a brick in this huge procedure of building AI pyramid, I hesitate if I have the capacity. You know, I am too late to start my study in the sense many my professors are even younger than me. And how can I be possible to do something real significant while I am trapped in this humble second-graded university in Canada?

Nobody believes my dream is possible, even I doubt it from time to time. Then the choices are like this: one way is just a common programmer with almost 100% chances of possibility. The other way is just less than 1% chances to do something which I cannot foresee now. Which way should I go?

<About kids>
Maybe I shouldn't use the word "hate" which is such a strong word. Let's put it as "dislike". You know they are such annoying things that all your energy are exhausted by their unpredictable behaviors. Besides I always consider the possibility that this kind of natural reproduction procedure should be socialized so that new generation can be produced in factories with controllable quality and cost. Human being should invest their attention to more productive matters like manufacturing, researching, or even enjoying the life.

<About AI>
Naturally it is a great dream. However, not everybody believe in this dream naturally. For most people in society, they still prefer those babies produced by themselves so that it is unique. But this is quite illogical. Just see nowadays people invest so much money and energy to reshape their kids to make them superior member of society, like stars in entertainment area, scientist and engineer of hi-tech, etc. What kind of waste for every couple to spend their lifelong energy to do the same routine job? And most of couples are not experts of education! How come they can do an excellent without training? Who should be blamed when their dream on their kid doesn't come true? The kid or the parents? Probably the parents. You see, our society is inventing various tools to ease jobs of human to let them do things better, like cars for moving, computer for calculating, etc. Why don't we invent someway to relieve people from such traditional heavy job of every families?
You probably think the above idea is so natural and pure simple dream of everybody. But when you pay attention to those hot debates in America about "people-cloning", you will realize that it is not so NATURAL to many members of society. People from different background have such big different view of same issue. Just see those science-fiction movies of Hollywood, most of them related with Robots reflect fears, suspects and negative views of people against robots. people fear that robots will replace human because most people know they are stupid and can be easily replaced by a simple "metal-box" and they wish try all means to prevent this from happening. Does human EVOLUTION stops since people become master of earth a few hundred years ago? Does evolution theory of Darwin become invalid when the main actor is human being? Of course not! Human being still need to evolute, otherwise there will be revolution of new-type intelligent form to replace human being! What kind of intelligent form could it be? Ape? Monkey? Dolphins? Definitely not! It can only be computer--the master of earth of future! Human being is not an EXCEPTION of natural law of evolution. If one thing has a beginning, it must have an ending. There will be one day such that people are made samples in museum of robots for future research and education of baby robots. (Do you think I am mad?) It sounds crazy. However, just apply those natural law of science to human being, you will inevitably draw a similar conclusion like me. Whom do you trust, science or your wish?

Let me quote a famous line from a great scientist of soviet union who described the space travel when nobody believes it will come true soon. "The earth is the cradle of human being, but human will not stay on it forever." Similarly let me put it this way: human being is the master of the earth for the time being, but human will not be the master on it forever.

Yesterday I think I got a little fever and naturally I wrote down the above crazy words with a little bit high temperature on my brain.

                 Storage and Type

I guess the following is just a tiny, tiny issue in programming. While in VC++6, the compiler has a very bad support for template and the compilation error is so hard to be pin-pointed.

#include <vector>

using namespace std;

typedef unsigned int UIVector[3];


struct FaceStruct
{
	UIVector face;
	unsigned int& operator[](int index)
	{
		return face[index];
	}
	void operator=(UIVector triangle)
	{
		memcpy(face, triangle, sizeof(UIVector));
	}
};
typedef vector<FaceStruct> FaceVector;


int main()
{
	FaceVector faceVector;
	UIVector faces[18];
	FaceStruct faceStruct;

	for (int i=0; i<18; i++)
	{		
		faceStruct=faces[i];
		faceVector.push_back(faceStruct);
	}

	return 0;
}
 
//////////////////////////////////
Do you know why I need this "FaceStruct" which is essentially just an array of unsigned integer? Because array is basically just a constant 
pointer which cannot be modified and moved. And this will have trouble in storing in vector. Trust me, you can have a try by declaring:
typedef vector<UIVector> MyVector; ...
 

 

 

      

 

 

 

 


                       back.gif (341 bytes)       up.gif (335 bytes)         next.gif (337 bytes)