Monday, December 18, 2006


I'm listening to a audio on Youtube. the client explained detailly twenty minutes, the Verizon still cannot understand the differences between 0.002 cents and 0.002 dollars.

May be the service of Verizon a makeing fun, haha.
That client's blog is
The cheque from xkcd to Verizon:

Monday, December 11, 2006

The Epic of Gilgamesh

"In those days the world teemed, the people multiplied, the world bellowed like a wild bull, and the great god was aroused by the clamor. Enlil heard the clamor and he said to the gods in council, ' The uproar of mankind is intolerable and sleep is no longer possible by reason of the babel.' So the gods agreed to exterminate mankind. Enlil did this, but Ea [Summerian Enki, god of the waters] because of his oath warned me in a dream ..., ' Tear down your house and build a boat, abandon possessions and look for life, despise worldly goods and save your soul alive. Tear down your house, I say, and build a boat. ...Then take up into the boat the seed of all living creatures...'[Utnapishtim did as he was told, and then the destruction came.]
"For six days and six nights the winds blew, torrent and tempest and flood overwhelmed the world, tempest and flood raged together like warring hosts. When the seventhday dawned the storm from the south subsided, the sea grew clam, the flood was stifled; I looked at the face of the world and there was silence, all mankind was turned to clay. The surface of the sea stretched as flat as a rooftop; I opened for land in vain, but fourteen leagues distant there appeared a mountain, and there the boat grounded; on the mountain of Nisir the boat held fast, she held fast and did not budge.... When the seventh day dawned I loosed a dove and let her go. She flew away, but finding no resting-place she returned. Then I loosed a swallow, and she flew away but finding no resting-place she returned. I loosed a raven, she saw that the waters had retreated, she ate, she flew around, she cawed, and she did not come back. Then I threw everything open to the four winds, I made a sacrifice and poured out a libation on the mountain top."

A section from Western Civilization : A Brief History , third edition page 12.

History always acts like before always, doesn't it like Noah's Ark ? And the same flood happened in china, the second dynasty Shang, for saving our home from the great flood, lord Yu contributed his life. Someone who have watched Stargate? Lord Yu is a Goa'uld in Stargate.

Monday, October 30, 2006

A Big Progress

A stupid mistake disturbed me for many days!!! Damn.
When I was trying to drawing a mesh, I've assigned a right transformation matrix, but I've forgot to restore that to the original one, that causes smaller mesh become smaller, further mesh become further #- -

Now the next step is make it support texture, and support cG interface.

What I've done for this:
  1. Flexible, extensible architecture (more percisely should be called as a framework)
  2. Full featured customed Mesh Model (.x Mesh loading, .lcbm Mesh Loading, and .lcbm persistent, .x text mesh persistent), 6000 faster than DirectX's built-in .x mesh loader
  3. Full featured camera controller
  4. DirectX UI RAD Designer (Design a DXUI is as easy as you can do in VS.NET's RAD mode)

And i've forgot to say what it is, I'm planning to use this demo, a Virtual Classroom to request another big project, Virtual School, haha, that will be pretty cool!!!

A simple pascal compiler

The subject Compiler's Principle, the professor asked me to build a simple pascal's compiler, from tokenlization to code generation, except the optimization part, to earn the full scores in experiment. and I did, that doesn't spend me too much time, all codes I wrote manually, no any connections with yacc,lex,flex,bision,antlr, and all this sorts of tools.

After all the experiments are done, I may open the source of the compiler, that's not complex, and that's a good tutorial for the beginners.

May be the professor will ask me to build a coressponding virtual machine to run the generated code. that'll be a big problem :(
The architecture's description (Without the instruction set):
Architecture of the Virtual Machine:

The VM is a stack-based structure, have no any general registers, all the operation are done via stack operations.
Inner registers(inaccessible in the the assembly):
Instruction Pointer Register
Return value Register
Call Stack Register
Stack Frame Register

The VM's architecture depends on two sorts of stack, one is Call Stack, element of the stack is StackFrame,
and the Stack Frame contains the second stack, the operation stack.
That's, whatevery what's in the current stack, it will not be able to affect the next invokation.

VM Context will contains:
Call Stack - Stores all stack frames, when the size is 0, the program will end.
Registers - Including the instruction pointer register, return value register
Code Segment- Points to the actual code in the memory.

Stack Frame will contains:
Procedure Configure Block - Configure the resources used by the current procedure
Instruction Pointer - Used to store temporarily IP when a new stack frame pushed into the call stack
Parameters - The caller will put the top data in the stack into this place, the number of parameters is specified by the PCB.
Data Stack - The data stack, size will be specified by the PCB
Local Variants - Same as Parameters, but it will not copy top datas in the caller's stack

The definition of return value: A running procedure, the top data in the stack will be sent to the RV register

Procedure Configure Block
Stack Configure:
maxstack n 16 bits, the maximum of stack (can be ignored in the VM, only needed while optimization and JIT generation used in high performance)
arguments n 16 bits, the count of parameters of current procedure
locals n 16bits, the count of local variants.

Friday, October 20, 2006

Good book met bad translator... ...

NVIDIA recommended four books, but only half of them are published in China.
I owned <GPU Gems> and <The Cg Tutorial>'s chinese translated version.
The <GPU Gems> have many authors, it's translators have many either. the different experiences of these different translators caused this book have many translation style, that's a big weakness of this nice book.

These days I'm hanging on the <The Cg Tutorial>, even if it's a quite old book( published in 2004), but the old cannot cover it's brilliance, the same as <GPU Gems> it's blemish is translation, many glossaries is wrong.

Wednesday, October 18, 2006

So boring... ...

Everyday facing my screen, facing my book.
Maybe I'm insane, I shouldn't spend so much time to achieve my dream, I'm wasting my youth, my life.

i'm escaping too much, but I know, it's not ready to repick my confidence.
wait to the next week, wait for my project's been accepted by school, and, take a rest?find a girlfriend? or still continue on my dream? too many issues disturbing me.

I wish one day I can think where to have dinner instead of functional programming, where to hang around with my friends instead of collision detection, where to share my emotion with my girlfriend instead of shadow volume.

no pain, no gain. hope i'm on my right way... ... fuck!
Left is my shelf in my dorm, and right picture is my bedroom (my home), haha, only thing can make me proud :(

Another Blog

This blog I've registered many months ago. but there the China Telecom had banned the blogspot's address. the monopolization always shame! Before this Blog, i got few, but maybe I don't have the interesting in blogging, they are wasted.

And these days I heard the China Telecom started to ban router, I'm angry! What the hell it's doing! Any one who wants to use internet must use single telephone line to access in, no share and no tolerate any more!