레이블이 컴퓨터인 게시물을 표시합니다. 모든 게시물 표시
레이블이 컴퓨터인 게시물을 표시합니다. 모든 게시물 표시

2022년 9월 7일 수요일

cmake try_compile / try_run

 CMakeLists.txt 에서 컴파일 옵션이나 지원하는 기능을 확인할 때 try_compile 이나 try_run 을 쓰는 경우가 있다. 이때 실제 이 명령에서 어떻게 확인했는가를 알고 싶을 때 OUTPUT_VARIABLE 을 설정하면 된다.

예)

try_run(RUN_${FEATURE} COMPILE_${FEATURE}
${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp
CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS}
LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES}
OUTPUT_VARIABLE TRY_OUT)
message("TRY_OUT: ${TRY_OUT}")

위 예에서는 실제 실행했던 명령이나 결과값을 TRY_OUT 이란 변수에 저장하고, 이 내용을 message 를 통해서 출력해 준다. 이렇게 하면 실제 어떤 컴파일러와 옵션으로 컴파일 및 링킹을 했고 결과를 어떻게 확인했는지 알수 있다.


2018년 4월 15일 일요일

Bookmarks

The bookmark sync is broken on chrome, and it produces duplicated bookmarks reordering aside from my intention. So instead of using chrome's bookmark, I'm using this page for keeping each bookmarks.

2016년 9월 27일 화요일

iterative depth-first traversal post-order

depth-first traveral 은 크게 pre-order / in-order / post-order tranversal 로 나누어 진다. 이 중 in-order 는 children 의 개수에 따라 정의가 애매하므로 pre-order 와 post-order 만 정리해 보도록 한다.
pre-order depth-first traversal

recursive algorithm:

do_explorer
  set node visited
  do something
  for each children of the node
    call do_explorer


iterative algorithm:

do_explorer
  create a stack
  push node
  while stack is not empty
    pop node
    set node visited
    do something
    for each children of the node
      push child into stack if child is not visited


post-order depth-first traversal

recursive algorithm:

do_explorer
  set node visited
  for each children of the node
    call do_explorer
  do something


iterative algorithm:

do_explorer
  create a stack
  push node
  while stack is not empty
    peek a node
    if all children of the node is processed
       pop the node
       do something
    else 
       process next sibling of the node (push stack if not visited yet)

2016년 3월 8일 화요일

윈도우 개발 환경

cross platform 개발 환경을 추구하는 상태에서 기존에 mingw32 를 써 왔었는데, 최근에 보니 마지막 업데이트가 2013년 정도이고 이후 변한게 없었다. 왜 그런가 봤더니 64bits 가 나오면서 mingw64 로 넘어가서 사람들이 주로 쓰는 것은 이것인 것 같았다. 이에 따라 전체적인 윈도우에서의 컴파일러 / 개발 환경을 다음과 같이 바꾸기로 했다.

  • 컴파일러: mingw64 (x84_64, posix)
  • 환경: msys2
cygwin 도 고려 대상이었지만 DLL 의존성 때문에 cygwin 은 버리기로 했다.

P.S.
그나저나 .bashrc 는 어디로 사라진 걸까.

2016년 1월 15일 금요일

Windows 10 시작메뉴 복구

어느 순간부터 시작 메뉴 버튼을 눌러도 윈도우 키를 눌러도 나오는 것이 없어지는 경우가 생긴다. 이를 복구하기 위한 방법을 찾아봤지만 제대로 되는 방법은 하나도 없었다. 간신히 제대로 된 방법을 찾은 것은 바로 아래 링크이다.

  • http://www.urtech.ca/2015/09/solved-fix-windows-10-start-button-does-nothing-in-10-minutes/
원리는 간단하다. 시작 메뉴의 database 가 깨졌기 때문에 다른 계정을 만들어서 새로 만든 깨끗한 database 를 복사해서 사용하는 것이다.

2015년 10월 19일 월요일

Champions of Conte

If you save up your units, yes you can have willpower and double edge. I haven't bothered....

Good setup:

Offense: (+10.5% crit rate, +52% crit dmg)
5 - precision
5 - Cruelty
1 - in all prereqs

Defense: (50% to resist block break)
5 - Stand your ground
1 or 4 - Perfect block
1 - in all pre-reqs
Optional: 3 salve, 3 recovery. (I haven't bothered yet)

Utility:
2 or 3 - dexterity (+20-33% increase in next attacks crit rate)
3 - pretrify
3 - pacify
3 - stupify
2 - Parry (stun duration increases with perfect block chance)
1 - pre-reqs


Do the offense first and use the stony cores for that. I did it without spending $0.01. Just save units from arena milestones, arena crystals, and completion/exploration awards.
FYI - always open arena crystals in batches of 10,20, or 30. If you open 10 at a time (20K battle chips), and press the open button, you will always get 15-75 units.

2015년 10월 17일 토요일

codelite v.s. code::blocks

지금까지 code::blocks 가 가장 나은 cross platform ide 라고 생각했는데, 버전 업데이트가 늦고 아마도 codelite 로 분화하여 계속 발전해 온 것 같다. 이에 맞춰 앞으로 code::blocks 에서 codelite 로 ide 환경을 바꿔서 개발하도록 할까 한다.

2015년 10월 16일 금요일

Mac 에서 wxWidgets 빌드하기


  • 일단 3.0.2 stable 버전에서는 문제가 있어 github 에서 받은 버전으로 컴파일해서 사용한다
  • 윈도우 때 사용했던 configure 옵션
    • --enable-monolithic --disable-shared --enable-optimise --enable-accel --enable-dccache 
  • libc++ 버전 문제로 다음 옵션이 추가되어야 한다
    • --with-macosx-version-min=10.7 CXXFLAGS="-stdlib=libc++ -std=c++11" OBJCXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS="-stdlib=libc++"

2015년 8월 6일 목요일

2015년 3월 17일 화요일

C / C++ 개발 환경

자바 언어가 사용하기엔 좋지만 항상 걸리는 점들이 있다. 첫번째는 자바는 JRE 환경이 필요하다는 저과 두번째는 오라클과 구글의 관계이다. 최근에 구글이 자바 관련 소송에서 졌기 때문에 자바의 입지가 그만큼 좁아졌다. 이에 따라 다시 한 번 C / C++ 개발 환경을 주 개발 환경으로 꾸며 보려고 한다.
이전에 정리한 것과 달라지는 것은 eclipse 에서 Code::Block 으로 바꾼 점이다. eclipse 역시 자바 기반으로 만들어진 툴이라 자바에 대한 의존성이 생기기 때문에 Code::Block 으로 바꾸기로 했다. GTK 를 GUI designer 없이 쓰는 것이 쉽지는 않아 보이나 성능 이슈도 있고 GUI designer 의 의존성을 버리기 위해 이렇게 하기로 했다.

GTK 와 wxWidgets 사이에선 wxWidgets 가 여러모로 우수한 것으로 보인다. 또한 GUI 프로그래밍을 C 로 한다는 것이 의외로 많은 문제를 가져오는 것 같다. 그래서 wxWidgets 를 C++ 환경으로 만들어 보는 것이 어떨까 싶다.

아마도 이런 환경에 익숙해지려면 좀 많은 시간이 필요할 것 같다.

2015년 2월 26일 목요일

winmail.dat / TNEF 포멧 제거 방법

Disabling TNEF in Outlook

The sender can avoid sending TNEF attachments by by turning off TNEF in Outlook. When Outlook is configured to send e-mail in "Outlook Rich Text Format", it may use TNEF. When it sends in "HTML" or "Plain Text", it uses standard, compatible formats. There are two options for disbling TNEF:
In at least Outlook 2002 (a.k.a. Outlook XP) and Outlook 2003, if it's being used at a business, the following is recommended to ensure compatibility with corporate mail systems:
  1. On the "Tools" menu, click "Options", then click the "Mail Format" tab, and then the "Internet Format" button.
  2. Set "When sending Outlook Rich Text messages to Internet ..." to either "Convert to HTML format" or "Convert to Plain Text format".

In all versions of Outlook, you can disable TNEF completely:
  1. On the "Tools" menu, click "Options", and then click the "Mail Format" tab.
  2. In the "Send in this message format" list, click "Plain Text" or "HTML", and then click "OK". 

원문은 위를 확인하면 되고, 아래와 같이 안내하도록 하자.

아래와 같이 Outlook 의 "도구" 메뉴에서 "메일" 메뉴에서 "작성할 메시지 형식" 을 HTML 로 설정해 주세요.