Thursday, June 19, 2008

Don’t Rely on Undefined Behavior

C++ Primer 4/e has again a good advice:『
Programs that use undefined behavior are in error. If they work, it is only by coincidence. Undefined behavior results from a program error that the compiler cannot detect or from an error that would be too much trouble to detect.
Unfortunately, programs that contain undefined behavior can appear to execute correctly in some circumstances and/or on one compiler. There is no guarantee that the same program, compiled under a different compiler or even a subsequent release of the current compiler, will continue to run correctly. Nor is there any guarantee that what works with one set of inputs will work with another.
Programs should not (knowingly) rely on undefined behavior. Similarly, programs usually should not rely on machine-dependent behavior, such as assuming that the size of an int is a fixed and known value. Such programs are said to be nonportable. When the program is moved to another machine, any code that relies on machine-dependent behavior may have to be found and corrected. Tracking down these sorts of problems in previously working programs is, mildly put, a profoundly unpleasant task.』
Chinese translation said:『程式如果使用「無明確定的行為」,便是犯了錯誤。如果它們可以成功執行,那只是運氣使然。「無名確定義的行為」起因於未被編譯器偵測到、或太難被偵測到的程式錯誤。
不幸的是,程式如果代有無明確定義的行為,在某些情況和(或)在某個編譯器下也許能正確執行,卻無法保證在不同編譯器下或甚至目前編譯器的新版本下繼續正確執行。並且即使在某一組輸入下能夠成功執行,也不能保證在其他輸入下能夠成功。
因此,程式不應該(故意地)倚賴「無明確定義的行為」!
同樣道理,程式通常不應該倚賴與機器相依的行為,例如「假設int的大小固定且已知」等等。這種程式被稱為不可移植(nonportable)。當這種程式被移植到其他機器,我們就必須找出並修正任何與機器相依的程式碼。在原本可運行的程式中追蹤這一類的問題,說得溫和點,是件極不愉快的工作。』
Here may be mentioned the machine's problems, but many situations in different OS it makes the nonportable problems.Last year I wrote the paper and found many source codes running at Unix.But it can't be compiled at Windows.So finally I use Java to code.Although I feel Java is some slow,it can run at many different OS.
I like to choice GTK and not choice Microsoft GUI .Because I concern the portable problem.But it is diffcult to use GTK.So I like the author said : "a profoundly unleasent task".

gentle achi

some gentle.

achi go


Sophia draw a picture for me.I like the picture.Very cool!

Thursday, June 12, 2008

Initialized and Uninitialized Variables

C++ Primer 4/e has such a concept:『Initialization is an important concept in C++ and one to which we will return throughout this book.

Initialized variables are those that are given a value when they are defined. Uninitialized variables are not given an initial value:



   int val1 = 0;     // initialized
int val2; // uninitialized

It is almost always right to give a variable an initial value, but we are not required to do so. When we are certain that the first use of a variable gives it a new value, then there is no need to invent an initial value. For example, our first nontrivial program on page 6 defined uninitialized variables into which we immediately read values.


When we define a variable, we should give it an initial value unless we are certain that the initial value will be overwritten before the variable is used for any other purpose. If we cannot guarantee that the variable will be reset before being read, we should initialize it.』


And Chinese book explains:『初始化(initialization) 在C++ 中是個重要概念,本書將一再提及。


已初始化變數是「定義時便獲得初值」的變數,未初始化變數則沒有獲得初值:



int val1 = 0; //已初始化
int val2; //未初始化
「給變數一個初值」幾乎永遠是正確的行為,但並不是非那麼做不可。如果我們很肯定第一次使用某變數時會給它一個值,那麼就沒有必要為他設想一個初值。例如我們在「p.6」第一個「有所事事」的程式中定義了未初始化變數,隨後立刻把值讀入。

定義變數時應該給予初值,除非我們確定這個初值在該變數第一次被使用前會被覆蓋掉(overwritten)。如果我們無法保證為某變數讀取數值之前該變數會被重新設值(reset),就應該將初始化。』


This concept is useful to me, however in C or other languages, even though php.

pighead

Tuesday, June 10, 2008

Make Money - A new way

Ha Ha! Recenly I register a website will be the Europes biggest advertsing media on blogs.I'm very lucky.My achi's blog can be approved.The site name is Bloggerwave.Everyone in Taiwan  can try to register the site.Hope everybody earn much money.This is an excited chance.May God bless you.

Friday, June 6, 2008

Asia Area FamilySearch Support Manager


Job Vacancy



Position   Asia Area FamilySearch Support Manager


Organization  Family History Department, Worldwide Support Division

Location   Taiwan Service Center

Post Date  June 5, 2008 

Job Description 

  • Lead a large distribution organization of individuals, processes and structures that provide support to the Area Presidency, Stake Presidencies, Bishops, Family History Centers and Directors, Ward Family History Consultants, Family History Church Service Missionaries, members and non-members involved in Family History work.

  • Provide overall management, direction and decision making for FamilySearch Support in the area.

  • Design and implement strategies to increase Family History and Temple work in the area.

  • Provide recruitment, training, deployment, direction, coordination and FamilySearch tools to local missionaries and volunteers. Coordinate the work of the Asia Call Centre.

  • Work closely with the Acquisitions Division to coordinate and allocate resources to support Family History records acquisition efforts.

  • Provide local interface for priesthood leaders with the Area Support Office and the Asia Call Centre.

  • Manage the Asia Area FamilySearch Support budget.


 

Requirements 




  • Bachelor’s degree or equivalent experience in managing remotely delivered customer service.

  • A strong business background

  • A minimum of 5 years experience managing service organization in Asia including the development and implementation of business strategies.

  • Experience delivering a high level of service and support in an international environment which has diverse language and cultural challenges.

  • Excellent interpersonal, presentation and communication skills in understanding, serving, and supporting leaders, members, and non-members within a geographical region.

  • Strong leadership skills in developing a proactive vision to support the redemption of the dead.

  • Experience in Church leadership positions.

  • Financial management and budgetary control experience

  • Team building and team management experience, including working collaboratively with organizations and individuals who do not report directly to the FamilySearch Manager.

  • Fluency in both spoken and written English and Mandarin.


 

Consideration will be given to applicants living throughout the Asia ecclesiastical area. Applications close on 29th June 2008. Qualified Church members with current temple recommend, please apply with detailed resume and a recent photo to:




  •  Service Center Manager

  •   Taiwan Service Center

  •  5, Lane 183, China Hua Street, Taipei, Taiwan 106 

  •   Facsimile: 2192-4999

  •   E-mail:     LiangCa@ldschurch.org


Application will be closed on June 29, 2008