Thursday, May 20, 2010

[RTX] LINK : error LNK2001: 無法解析的外部符號 __load_config_used

LINK : error LNK2001: 無法解析的外部符號 __load_config_used

在屬性>連結器>最後的欄位 貼上 /safeseh:no 就可了!

原因:當使用新版本的編譯器進行編譯,偶爾會產生結構化異常信息,那麼在默認情況下,安全結構化異常處理將是打開的,可以使用/SAFESEH:NO命令行選項來關閉安全結構化異常處理。


我猜是因為RTX的SEH跟WIN32的有一些差異~導致在呼叫的時候會產生問題~我就先關掉了! 不知道會不會影響其他設定!


[研究] 棧是什麼? (就是堆疊 Stack)

搞了半天 其實 棧 就是 Stack 堆疊

不要再忘記啦!

Wednesday, May 19, 2010

[研究]要怎麼證明一個東西錯了呢?

這幾天碰到一個問題"老闆說:Anderson你去證明這個東西沒有這個功能"

證明他沒有該用什麼方法呢?

先說證明有好了:

以邏輯來說就是find a answer 答案很多時只要找到一個就算找出來了

如果答案只有一個當然就是 find the answer

有時候這會是很簡單的,但通常都不太容易

那證明不存在(OR沒有)呢?

1.找出所有的方法證明皆不成功,則方法不存在

缺點:除非確定找出所有的方法,否則不能說不存在

2.找出和已知OR真理矛盾的事情

缺點:有的時候不太好証

3.已知它不行,證明它不行:

缺點:有的時候你証不出來的事情,不一定是錯的,有可能是你不會證!!


我的問題就卡在3.囉!!

証出來的東西不一定是東西,有可能是我不會OR還沒找到答案!

以上的東西在我念完黃子嘉的離散數學之後有深刻的體會。

[C++][引用] Interpreting HRESULT Values

In the Microsoft® Windows® operating system, error codes are returned as signed 32-bit HRESULT values that indicate the status of an operation. The high-order sign bit indicates success or failure of the particular method function call.

Interpreting HRESULTs

The HRESULT data type is composed of fields depicted by the following diagram:

Bb401631.f3689902-86e5-404d-be3a-b743af20a2ad(en-us,MSDN.10).gif

The 32-bit value is used to describe an error or warning and is composed of a 1-bit code that indicates the severity (S) of the condition; 0 for success and 1 for failure. The severity code is followed by 4 reserved bits depicted as R, C, N, and r, and then by an 11-bit facility code that indicates responsibility for the error or warning that is defined in the method implementation.

The Facility codes and Error codes are defined by the Winerror.h header file. The following table lists some typical HRESULT values:

Return value/codeDescription

0x00000000
S_OK

Operation successful

0x80004001
E_NOTIMPL

Not implemented

0x80004002
E_NOINTERFACE

Interface not supported

0x80004004
E_ABORT

Operation aborted

0x80004005
E_FAIL

Unspecified failure

0x80070057
E_INVALIDARG

One or more arguments are invalid

For more information about HRESULT, Facility Codes (Codes in FACILITY_ITF), and mapping Win32 error values (HRESULT_FROM_WIN32) into an HRESULT, see Microsoft Developer Network (MSDN).

Note Because error codes are implementation specific, two identical HRESULTs that are returned from two different interfaces can have different meanings.

Interpreting HRESULT Values

[C][引用]printf( ) 的列印格式、控制字元、修飾子


列印格式--輸出敘述
%c-字元
%s-字串
%d-十進位整數
%u-無號十進位整數
%o-無號八進位整數
%x-無號十六進位整數,以 0 ~ f 表示
%X-無號十六進位整數,以 0 ~ F 表示--
%f-浮點數,小數點型式
%e-浮點數,指數e型式
%E-浮點數,指數E型式
%g-印出 %f %e 較短者
%G-印出 %F %E 較短者
%p-指標位址
%%-印出百分比符號

-

-控制字元---功能
\a-警告音
\b-倒退
\f-換頁
\n-換行
\r-歸位
\t-跳格
\’-印出單引號
\』-印出雙引號
\\-反斜線
\/-斜線
\d-八進位 Ascii 碼
\x-十六進位 Ascii 碼--


修飾子--功能-範例
--向左對齊-%-3d
+-將數值的正負號顯示出來-%+5d
空白-數值為正值時,留一格空白;為負值時,顯示負號-% 6f
0-將固定欄位長度的數值前空白處填上 0;與 – 修飾子同時使用時,此修飾子無效---%07.2f--
數字-欄位長度,當數值的位數大於所定的欄位長度時,欄位會自動加寬它的長度-%9d
.-數值以 %e, %E, %f 型式表示時,決定小數點後所要顯示的位數-%4.3f
h-表示 short int 或是 unsigned short int-%5h
l-表示 long int 或是 unsigned long int-%lu


引用 Never Give Up

Labels