기타정보2010. 9. 8. 19:45

컴퓨터의 성능이 느려졌을 때에 체크해볼 부분..

기본적으로 윈도우의 재설치나 하드 조각모음
프로그램의 정리이런 기본적인 부분이 아니라.

CMOS에서 CPU의 온도를 확인..
CPU 온도가 50~60도를 넘어선다면..

CPU-Z라는 프로그램을 찾아 깔아서
작업을 할때에 컴퓨터의 클럭을 확인해본다.

참고로 콘로 6600 2.4G 를 사용중이였는데..
어제 확인해보니 1.6G로 설정되어 돌아가고 있었다.

물론 메인보드자체에서 MIN, MAX가 있어서, 일을 할때에 MAX로 안할땐 MIN으로 설정을 해주어
클럭이 1.6G~2.4G를 왔다 갔다 하기도 하지만..

CPU 기본 온도가 높아버리면
MAX값을 MIN값으로 자동 고정해버리는 경우가 생기는 것 같다.

온도가 70도를 넘었었는데 우선 쿨러의 먼지를 잘 제거하고 다시 하니
50이하를 유지.. (방열판 사이에 먼지가 완전 가득차 있었던 상황)

CMOS Load optimized?를 한 후에 재부팅해서 사용하니
1.6~2.4G 잘 왔따 갔다 하고 있음..

그 동안 스타크래프트2 속도가 왜 느린가 했더니
CPU 온도 때문에 1.6G로 돌아가고 있었음.. -ㅅ-

완전.. 업그레이드 한 느낌..

그리고 GIGABYTE메인보드를 사용중인데..
CIA2던가.. 그 기능을 설정하면 안정저긴 범위에서 자동으로 오버를 해줘서..
현재는 2.8까지 올라감.. 만족 중!

한동안은 더 버틸 수 있을 듯 +_+
스타2도 높음으로 1920 X 1200 에서 할만해지고..




Posted by 김경문
게임프로그래밍2010. 8. 11. 18:00

프로젝트 속성 자체에

STL 관련 define이 되어 있는 부분이 존재한다.

다른 라이브러리나 프로젝트 종속이 되어 있는 상태에서

양쪽 STL 관련 define이 다르다면

STL 사용시 양쪽에서 다른 결과를 가져올 수 있다.


프로젝트 속성 자체에 있는 define을 지우거나

prepare compile header를 사용한다면

맨 위에

디파인을 동일시 되도록 잘 정의를 해주면

문제가 해결..







Posted by 김경문
게임프로그래밍2010. 8. 9. 20:04

MAX SDK 설치 후

howto / 3dsmaxPluginWizard

readme.txt를 읽고

따라 하면 된다.


간략하게 정리하면
1. 경로설정
2. 특정 폴더로 파일 복사
3. 아마 2005가 아니면 VcWizard버젼을 맞춰줘야 할 듯..

VS2008에서 VC Wizard 버젼 설정
Wizard=VsWizard.VsWizardEngine.8.0 -> Wizard=VsWizard.VsWizardEngine.9.0

Posted by 김경문
카테고리 없음2010. 8. 4. 15:24

1

 

Posted by 김경문
카테고리 없음2009. 1. 5. 13:56

Format Specification Fields: printf and wprintf Functions

A format specification, which consists of optional and required fields, has the following form:

%[flags] [width] [.precision] [{h | l | I64 | L}]type

Each field of the format specification is a single character or a number signifying a particular format option. The simplest format specification contains only the percent sign and a type character (for example, %s). If a percent sign is followed by a character that has no meaning as a format field, the character is copied to stdout. For example, to print a percent-sign character, use %%.

The optional fields, which appear before the type character, control other aspects of the formatting, as follows:

type

Required character that determines whether the associated argument is interpreted as a character, a string, or a number (see Table R.3).

flags

Optional character or characters that control justification of output and printing of signs, blanks, decimal points, and octal and hexadecimal prefixes (see Table R.4). More than one flag can appear in a format specification.

width

Optional number that specifies the minimum number of characters output. (See printf Width Specification.)

precision

Optional number that specifies the maximum number of characters printed for all or part of the output field, or the minimum number of digits printed for integer values (see Table R.5).

h | l | I64 | L

Optional prefixes to type-that specify the size of argument (see Table R.6).


 

Flag Directives

The first optional field of the format specification is flags. A flag directive is a character that justifies output and prints signs, blanks, decimal points, and octal and hexadecimal prefixes. More than one flag directive may appear in a format specification.

Table R.4   Flag Characters

Flag Meaning Default
Left align the result within the given field width. Right align.
+ Prefix the output value with a sign (+ or –) if the output value is of a signed type. Sign appears only for negative signed values (–).
0 If width is prefixed with 0, zeros are added until the minimum width is reached. If 0 and – appear, the 0 is ignored. If 0 is specified with an integer format (i, u, x, X, o, d) the 0 is ignored. No padding.
blank (' ') Prefix the output value with a blank if the output value is signed and positive; the blank is ignored if both the blank and + flags appear. No blank appears.
# When used with the o, x, or X format, the # flag prefixes any nonzero output value with 0, 0x, or 0X, respectively. No blank appears.
When used with the e, E, or f format, the # flag forces the output value to contain a decimal point in all cases. Decimal point appears only if digits follow it.
When used with the g or G format, the # flag forces the output value to contain a decimal point in all cases and prevents the truncation of trailing zeros.

Ignored when used with c, d, i, u, or s.

Decimal point appears only if digits follow it. Trailing zeros are truncated.


 

 

printf Width Specification

The second optional field of the format specification is the width specification. The width argument is a nonnegative decimal integer controlling the minimum number of characters printed. If the number of characters in the output value is less than the specified width, blanks are added to the left or the right of the values — depending on whether the – flag (for left alignment) is specified — until the minimum width is reached. If width is prefixed with 0, zeros are added until the minimum width is reached (not useful for left-aligned numbers).

The width specification never causes a value to be truncated. If the number of characters in the output value is greater than the specified width, or if width is not given, all characters of the value are printed (subject to the precision specification).

If the width specification is an asterisk (*), an int argument from the argument list supplies the value. The width argument must precede the value being formatted in the argument list. A nonexistent or small field width does not cause the truncation of a field; if the result of a conversion is wider than the field width, the field expands to contain the conversion result.


 

Precision Specification

The third optional field of the format specification is the precision specification. It specifies a nonnegative decimal integer, preceded by a period (.), which specifies the number of characters to be printed, the number of decimal places, or the number of significant digits (see Table R.5). Unlike the width specification, the precision specification can cause either truncation of the output value or rounding of a floating-point value. If precision is specified as 0 and the value to be converted is 0, the result is no characters output, as shown below:

printf( "%.0d", 0 );      /* No characters output */

If the precision specification is an asterisk (*), an int argument from the argument list supplies the value. The precision argument must precede the value being formatted in the argument list.

The type determines the interpretation of precision and the default when precision is omitted, as shown in Table R.5.

Table R.5   How Precision Values Affect Type

Type Meaning Default
c, C The precision has no effect. Character is printed.
d, i, u, o, x, X The precision specifies the minimum number of digits to be printed. If the number of digits in the argument is less than precision, the output value is padded on the left with zeros. The value is not truncated when the number of digits exceeds precision. Default precision is 1.
e, E The precision specifies the number of digits to be printed after the decimal point. The last printed digit is rounded. Default precision is 6; if precision is 0 or the period (.) appears without a number following it, no decimal point is printed.
f The precision value specifies the number of digits after the decimal point. If a decimal point appears, at least one digit appears before it. The value is rounded to the appropriate number of digits. Default precision is 6; if precision is 0, or if the period (.) appears without a number following it, no decimal point is printed.
g, G The precision specifies the maximum number of significant digits printed. Six significant digits are printed, with any trailing zeros truncated.
s, S The precision specifies the maximum number of characters to be printed. Characters in excess of precision are not printed. Characters are printed until a null character is encountered.

If the argument corresponding to a floating-point specifier is infinite, indefinite, or NaN, printf gives the following output.

Value Output
+ infinity 1.#INFrandom-digits
– infinity –1.#INFrandom-digits
Indefinite (same as quiet NaN) digit.#INDrandom-digits
NAN digit.#NANrandom-digits


 

printf Type Field Characters

The type character is the only required format field ; it appears after any optional format fields. The type character determines whether the associated argument is interpreted as a character, string, or number. The types C and S, and the behavior of  c and s with printf functions, are Microsoft extensions and are not ANSI-compatible.

Table R.3   printf Type Field Characters

Character Type Output Format
c int or wint_t When used with printf functions, specifies a single-byte character; when used with wprintf functions, specifies a wide character.
C int or wint_t When used with printf functions, specifies a wide character; when used with wprintf functions, specifies a single-byte character.
d int Signed decimal integer.
i int Signed decimal integer.
o int Unsigned octal integer.
u int Unsigned decimal integer.
x int Unsigned hexadecimal integer, using “abcdef.”
X int Unsigned hexadecimal integer, using “ABCDEF.”
e double Signed value having the form [ – ]d.dddd e [sign]ddd where d is a single decimal digit, dddd is one or more decimal digits, ddd is exactly three decimal digits, and sign is + or –.
E double Identical to the e format except that E rather than e introduces the exponent.
f double Signed value having the form [ – ]dddd.dddd, where dddd is one or more decimal digits. The number of digits before the decimal point depends on the magnitude of the number, and the number of digits after the decimal point depends on the requested precision.
g double Signed value printed in f or e format, whichever is more compact for the given value and precision. The e format is used only when the exponent of the value is less than –4 or greater than or equal to the precision argument. Trailing zeros are truncated, and the decimal point appears only if one or more digits follow it.
G double Identical to the g format, except that E, rather than e, introduces the exponent (where appropriate).
n Pointer to integer Number of characters successfully written so far to the stream or buffer; this value is stored in the integer whose address is given as the argument.
p Pointer to void Prints the address pointed to by the argument in the form xxxx:yyyy where xxxx is the segment and yyyy is the offset, and the digits x and y are uppercase hexadecimal digits.
s String When used with printf functions, specifies a single-byte–character string; when used with wprintf functions, specifies a wide-character string. Characters are printed up to the first null character or until the precision value is reached.
S String When used with printf functions, specifies a wide-character string; when used with wprintf functions, specifies a single-byte–character string. Characters are printed up to the first null character or until the precision value is reached.


 

Size and Distance Specification

The optional prefixes to type, h, l, and L, specify the “size” of argument (long or short, single-byte character or wide character, depending upon the type specifier that they modify). These type-specifier prefixes are used with type characters in printf functions or wprintf functions to specify interpretation of arguments, as shown in the following table. These prefixes are Microsoft extensions and are not ANSI-compatible.

Table R.6   Size Prefixes for printf and wprintf Format-Type Specifiers

To Specify Use Prefix With Type Specifier
long int l d, i, o, x, or X
long unsigned int l u
short int h d, i, o, x, or X
short unsigned int h u
__int64 I64 d, i, o, u, x, or X
Single-byte character with printf functions h c or C
Single-byte character with wprintf functions h c or C
Wide character with printf functions l c or C
Wide character with wprintf functions l c or C
Single-byte – character string with printf functions h s or S
Single-byte – character string with wprintf functions h s or S
Wide-character string with printf functions l s or S
Wide-character string with wprintf functions l s or S

Thus to print single-byte or wide-characters with printf functions and wprintf functions, use format specifiers as follows.

To Print Character As Use Function With Format Specifier
single byte printf c, hc, or hC
single byte wprintf C, hc, or hC
wide wprintf c, lc, or lC
wide printf C, lc, or lC

To print strings with printf functions and wprintf functions, use the prefixes h and l analogously with format type-specifiers s and S.

Posted by 김경문
알고리즘공부2008. 12. 10. 18:42

시간복잡도
 - 알고리즘의 성능(속도) 측정 법
 
문제의 크기
 - 입력된 데이터의 갯수나 양을 의미 한다.
 - n 또는 N으로 표기 한다.

O 표기법
 - O( f(n) )  최대 함수f(n)에 비례하는 시간이 걸린 다는 것을 의미한다.


입력된 데이터를 처리 했을 때, 걸리는 시간을 표기함으로써
알고리즘 성능을 알 수 있다고 이해하면 쉬울 듯 하다.

보통 언급이 없을 경우, 걸리는 시간은 최악의 경우(Worst case)를 말한다.



표기 방법에는 대표적으로

O(1) - N에 상관없이 일정한 시간이 걸림  (상수시간)
O(N) - N에 따라 선형적으로 시간이 증가 됨 (선형시간)
O(logN) - N에 따라 Log 함수처럼 시간이 증가 됨
              (선형보다 좋은 시간 복잡도를 보이면 이렇게 표기하는 것 같은데.. -_-)
O(NlogN) - O(N) 보다 걸리고 O(N^2)"제곱" 보다 적게 시간이 소요됨

O(N^2) - N에 따라 제곱의 그래프 모양으로 시간이 증가 됨


보통 O(1)이 가장 좋으나 거의 없는 경우 같고
O(logN) -> O(N) -> O(NlogN) 의 순으로 좋다고 할 수 있다.


개인적으로 머리가 수학적이지 못해서.. ㅠㅠ

Posted by 김경문
일반프로그래밍2008. 11. 25. 18:39

클래스 내부에 인터페이스에

public 선언시
 - 외부 접근(O)
 - 상속 받은 클래스에서 접근(O)

protected 선언시
 - 외부 접근(X)
 - 상속 받은 클래스에서 접근(O)

private 선언시
 - 외부 접근(X)
 - 상속 받은 클래스에서 접근(X)


클래스 상속시에는 쉽게 설명하여,,
제한을 한다고 보면 좋을 듯 하다.

노출이 많은 수준을 public, protected, private 순으로 봤을 때

상속 받은 클래스의 인터페이스들을
public 상속은, 최대를 public으로
protected 상속은, 최대를 protected로
private 상속은, 최대를 private로

즉 최상위의 public 함수더라도
protected로 상속 받으면 protected가 된다고 보면 좋겠다.


class CBase
{
public:
 CBase()
 {
 }

 ~CBase()
 {
 }

 void Public()
 {
 }

protected:
 void Protected()
 {
 }

private:
 void Private()
 {
 }

public:
 int m_nPublic;
protected:
 int m_nProtected;
private:
 int m_nPrivate;
};


class CChild : protected CBase
{
public:
 CChild()
 {
  Public();
  Protected();
  //Private();

  m_nPublic = 0;
  m_nProtected = 0;
  //m_nPrivate = 0;
 }

 ~CChild()
 {
 }
};


int main()
{
 CChild Test;
 Test.Public();  // protected로 상속 받은 상태라 -> 에러
 return 0;
}

Posted by 김경문
일반프로그래밍2007. 10. 24. 16:05
함수 설명
_set_new_handler 동적 메모리 할당이 실패했을 때 호출되는 콜백 함수를 설정한다.
_set_new_mode malloc 함수가 실패했을 때 _set_new_handler에서 설정한 함수를 호출할 것인가의 여부를 반환한다.
set_terminate 처리되지 않은 예외로 인해 프로그램이 종료될 때 호출할 함수를 설정한다.
set_unexpected 처리되지 않은 예외가 발생했을 때 호출할 함수를 설정한다.
uncaught_exception ???
_set_error_mode 에러 발생시 메시지 출력되는 곳(콘솔화면 또는 메시지박스)을 설정한다.
_set_purecall_handler 순수 가상 함수가 호출되었을 때 호출할 콜백 함수를 설정한다.
_set_sbh_threshold Small Block Heap에 할당되는 메모리의 최대양을 설정한다.
_set_se_translator Win32 Structured Exception을 C++ Exception으로 처리 가능하게 한다. 자세한 것은 StructuredExceptionAsCppException 페이지를 참고.
_set_security_error_handler BufferOverrun이 발생했을 때 호출할 콜백 함수를 설정한다.
_setmaxstdio 동시에 열 수 있는 최대 파일 갯수를 설정한다. ulimit와 비슷하다.
_matherr math.h 함수 실행 에러 발생시 호출되는 함수(?)
_fpieee_flt IEEE 부동 소수점 연산 예외 발생시 호출되는 함수를 설정한다.
atexit 메인 함수가 반환된 후 호출되는 함수를 설정한다


출처 : http://juno.springnote.com/pages/38910
Posted by 김경문