Computer
-
Visual Studio 2010 Find & Replace 창 크기 버그Computer/Software 2011. 10. 4. 17:44
Visual Studio 2010 은 Find & Replace 창 버그가 있어서, Ctrl+F 를 누를 때마다 크기가 점점 커져서 불편해 진다. Microsoft에서 Patch를 내 놓았는데 실행하고 나면 문제가 해결된다. https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30518 VS 2011은 찾기가 좀 더 편리하게 바뀌기 때문에 기대가 된다.
-
x86 PUSH, POP instruction semanticsComputer/Program Analysis 2011. 8. 29. 14:36
For Lvalue, ESP is applied after calculating ESP. For Rvalue, ESP is applied before calculating ESP. Therefore, POP [esp] ::= esp := esp0 + 4 [esp] = [esp0 + 4] := [esp0] PUSH [esp] ::= esp := esp0 - 4 [esp] = [esp0 - 4] := [esp0] POP [esp+4] ::= esp := esp0 + 4 [esp] = [esp0 + 4] := [esp + 4] = [esp0 + 4] ==> [esp0 + 4] = [esp0 + 4] => no change PUSH [esp+4] ::= esp := esp0 - 4 [esp] = [esp0 - ..
-
Visual C++ 실행파일 실행 후 종료시까지 기다리기Computer/Programming 2011. 7. 11. 14:11
Project 두 개를 합치고 싶기는 하지만, 이름이 충돌해서 합치는 것이 곤란하다. 그래서 분리된 실행 파일로 놓고 한 실행 파일에서 다른 실행 파일을 호출하고 끝날 때까지 기다리도록 했다. STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); if( !CreateProcess( NULL, // No module name (use command line) "c:\\Temp\\Optimizer.exe", // Command line NULL, // Process handle not inheritable NULL, // Thread handle..
-
stl::map에서 updateComputer/Programming 2011. 6. 29. 10:45
stl::map에 에서 이미 존재하는 항목을 update하기 위해서는 다음과 같이 사용한다. #include #include void main() { std::map test1; test1[0] = 1; test1[1] = 2; test1[1] = 3; for (auto it = test1.begin(); it != test1.end(); it++) { printf("%d %d\n", it->first, it->second); } } 배열에 값을 할당하듯 사용하면 해당되는 key 값이 없으면 map에 새로 추가되고, 해당되는 key 값이 없으면 map에 있는 해당 항목 값이 변경된다. 그런데 stl::map 구조를 pointer로 선언했을 때는 배열 사용하듯 할 수가 없고 값의 변경을 위한 함수가 따로 ..
-
visual c++ 에서 std::string에서 formatted string을 찍어주기 위한 코드Computer/Programming 2011. 6. 21. 18:22
formatstdsting.h #include #include std::string format(const char *fmt, ...); std::string format_arg_list(const char *fmt, va_list args); formatstdstring.cpp #include "formatstdstring.h" #pragma warning(disable:4996) std::string format(const char *fmt, ...) { va_list args; va_start(args, fmt); std::string s = format_arg_list(fmt, args); va_end(args); return s; } std::string format_arg_list(const ..
-
VirtualBox VM 이미지 복사하기Computer/Software 2011. 3. 16. 16:43
Oracle VirtualBox에 Snapshot 기능이 있긴 하지만 이미지 클론을 만들어서 여러 가지 실험을 하고 싶은데 GUI에서는 방법이 보이지 않는다. 내부적으로 기능이 있는데 버전이 올라가면서 약간씩 바뀌고 있다. 방법은 다음과 같다. 1, VirtualBox VM을 저장하는 폴더에 있는 .VDI 파일을 복사한다. "C:\Program Files\Oracle\VirtualBox\VBoxManage" clonehd xp.vdi xp_clone.vdi 2. hduuid가 겹치지 않게 하기 위해 sethduuid를 변경시킨다. "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" internalcommands sethduuid xp_clode.vdi 3. ID가..