헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤헤
2010년 4월 14일 수요일
플래폼 SDK? 윈도우 SDK?
내가 윈도코딩하던 시절은 그냥 플래폼 SDK 였는데 지금은 닷넷 SDK 와 함께 윈도 SDK 로 합쳐진 모양.
정확한 용어를 알고 사용해야겠지.
http://en.wikipedia.org/wiki/Microsoft_Windows_SDK
The difference between these three SDKs lies in their area of specialization: Platform SDK specializes in developing applications for Windows 2000, XP and Windows Server 2003. .NET Framework SDK is dedicated to developing applications for .NET Framework 1.1 and .NET Framework 2.0. Windows SDK is the successor of the two and supports developing applications for Windows XP, Windows Vista, Windows 7, Windows Server 2008, .NET Framework 3.0 and .NET Framework 3.5.[2]It contains extensive documentation and nearly 1000 samples.
분명 내기억에는 플래폼 SDK 이고 버전도 연도로 붙던것으로 기억하는데 최근들어 뒤져보니 WinSDK 7.0 뭐 이런식으로 불리고 있길래 궁금해서 찾아봤다.
windows 7 에어로 스냅인 어케 끄는겨?
WM_SIZING 받아 조절해서 일정 비율에 맞게 리사이징 되도록 했는데 이 빌어먹을 스냅인 이란 새 기능은 이걸 뛰어넘어서 리사이징을 해버리네. 여기저기 검색해도 유저입장에서 끄는 방법(제어판, 레지스트리등등)만 나오고..
열심히 msdn 을 뒤져서 아래 페이지를 찾았는데(고생했다. snapin 은 너무 일반적인 단어라 검색이 힘들고 레지스트리 수정방법에서 이런 기능을 윈도우 어래인징 이라고 부르는걸 알게되서 이걸로 검색해낸것)
SystemParametersInfo Function
SPI_SETWINARRANGING, SPI_SETSNAPSIZING 를 쓰면 뭔가 될거 같은데 저놈의 값을 아직 알수가 없네. 다음번 플래폼 SDK 가 나올때까지 일단 보류.
아 그리고 참고로.. 보통 에어로 기능이라고 하는것에 대해서는 DWM 으로 검색하면 된다.
Enable and Control DWM Composition 읽어보자
추가.
흠 WinSDK 7.0 을 받는중... 이었는데 취소. 곧 7.1 이 나온다 하니 기다렸다가 해결해보자.
열심히 msdn 을 뒤져서 아래 페이지를 찾았는데(고생했다. snapin 은 너무 일반적인 단어라 검색이 힘들고 레지스트리 수정방법에서 이런 기능을 윈도우 어래인징 이라고 부르는걸 알게되서 이걸로 검색해낸것)
SystemParametersInfo Function
SPI_SETWINARRANGING, SPI_SETSNAPSIZING 를 쓰면 뭔가 될거 같은데 저놈의 값을 아직 알수가 없네. 다음번 플래폼 SDK 가 나올때까지 일단 보류.
아 그리고 참고로.. 보통 에어로 기능이라고 하는것에 대해서는 DWM 으로 검색하면 된다.
Enable and Control DWM Composition 읽어보자
추가.
흠 WinSDK 7.0 을 받는중... 이었는데 취소. 곧 7.1 이 나온다 하니 기다렸다가 해결해보자.
2010년 4월 4일 일요일
2010년 4월 1일 목요일
window 에서 emacs 와 cscope 사용을 위한 준비
전에도 위키등에 몇번 적었는데 이번에 새로 세팅을 하게되서 최소한의 절차만 적어둔다.
후에 내가 읽어보는게 목적.
- cscope 다운로드
http://code.google.com/p/cscope-win32/
이번에 다시 뒤져보니 win32 port 가 다시 진행되는듯? 이전엔 16.0 이던가 하는 이상한 버전으로 오랫동안 멈춰있어서 쓰기가 좀 거북했었는데.. 우왕굿. - xcscope.el 세팅
나야 emacs 설정들을 mercurial 로 관리하고 있고 리파지토리를 dropbox 로 들고있으니 새로 받을 일은 없지만 적어둔다.
[code]
(require 'xcscope)[/code] - cscope-indexer 설치
나는 주로 c:/bin 또는 c:/opt/bin 에 넣어둔다. 이쪽 툴들도 dropbox 에 짱박아야 겠군...펼쳐두기..
[code]
#! /bin/sh
###############################################################################
#
# File: cscope-indexer
# RCS: $Header: /cvs/root/cscope/cscope/contrib/xcscope/cscope-indexer,v 1.1.1.1 2002/01/09 18:50:30 umeshv Exp $
# Description: Script to index files for cscope
#
# This script generates a list of files to index
# (cscope.out), which is then (optionally) used to
# generate a cscope database. You can use this script
# to just build a list of files, or it can be used to
# build a list and database. This script is not used to
# just build a database (skipping the list of files
# step), as this can be simply done by just calling
# "cscope -b".
#
# Normally, cscope will do its own indexing, but this
# script can be used to force indexing. This is useful
# if you need to recurse into subdirectories, or have
# many files to index (you can run this script from a
# cron job, during the night). It is especially useful
# for large projects, which can contstantly have source
# files added and deleted; by using this script, the
# changing sources files are automatically handled.
#
# Currently, any paths containing "/CVS/" or "/RCS/" are
# stripped out (ignored).
#
# This script is written to use only basic shell features, as
# not all shells have advanced features.
#
# Author: Darryl Okahata
# Created: Thu Apr 27 17:12:14 2000
# Modified: Tue Jun 19 09:47:45 2001 (Darryl Okahata) darrylo@soco.agilent.com
# Language: Shell-script
# Package: N/A
# Status: Experimental
#
# (C) Copyright 2000, Darryl Okahata, all rights reserved.
#
###############################################################################
#
# Usage:
#
# cscope-indexer [ -v ] [-f database_file ] [-i list_file ] [ -l ] [ -r ]
#
# where:
#
# -f database_file
# Specifies the cscope database file (default: cscope.out).
#
# -i list_file
# Specifies the name of the file into which the list of files
# to index is placed (default: cscope.files).
#
# -l
# Suppress the generation/updating of the cscope database
# file. Only a list of files is generated.
#
# -r
# Recurse into subdirectories to locate files to index.
# Without this option, only the current directory is
# searched.
#
# -v
# Be verbose. Output simple progress messages.
#
#
###############################################################################
set -e
# May have to edit this:
PATH="/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin:$PATH"
export PATH
LIST_ONLY=
DIR='.'
LIST_FILE='cscope.files'
DATABASE_FILE='cscope.out'
RECURSE=
VERBOSE=
export DIR RECURSE # Need to pass these to subprocesses
while [ -n "$1" ]
do
case "$1" in
-f)
if [ "X$2" = "X" ]
then
echo "$0: No database file specified" >&2
exit 1
fi
DATABASE_FILE="$2"
shift
;;
-i)
if [ "X$2" = "X" ]
then
echo "$0: No list file specified" >&2
exit 1
fi
LIST_FILE="$2"
shift
;;
-l)
LIST_ONLY=1
;;
-r)
RECURSE=1
;;
-v)
VERBOSE=1
;;
*)
DIR="$1"
;;
esac
shift
done
cd $DIR
if [ "X$VERBOSE" != "X" ]
then
echo "Creating list of files to index ..."
fi
(
if [ "X$RECURSE" = "X" ]
then
# Ugly, inefficient, but it works.
for f in *
do
echo "$DIR/$f"
done
else
find $DIR \( -type f -o -type l \)
fi
) | \
egrep -i '\.([chly](xx|pp)*|cc|hh)$' | \
sed -e '/\/CVS\//d' -e '/\/RCS\//d' -e 's/^\.\///' | \
sort > $LIST_FILE
if [ "X$VERBOSE" != "X" ]
then
echo "Creating list of files to index ... done"
fi
if [ "X$LIST_ONLY" != "X" ]
then
exit 0
fi
if [ "X$VERBOSE" != "X" ]
then
echo "Indexing files ..."
fi
cscope -b -i $LIST_FILE -f $DATABASE_FILE
if [ "X$VERBOSE" != "X" ]
then
echo "Indexing files ... done"
fi
exit 0
[/code] - cscope-indexer 가 쉘스크립트이므로 msys shell 을 깔아준다.
나야 어차피 mingw 를 자주 쓰니 문제 없지만 혹시나 cscope 때문에 쉘까지 까는게 싫다면 다른 방식으로 스크립트를 만들면 해결될듯. 목록만들고 cscope -b 돌리는게 전부다. - emacs 가 cscope-indexer 를 실행할수 있도록 cscope-indexer.bat 파일을 만든다. 역시 c:/bin 또는 c:/opt/bin 을 애용중
[code]
C:\msys\1.0\bin\sh cscope-indexer %1 %2 %3 %4 %5 %6 %7 %8 %9[/code] - 시스템헤더랄까? 윈도쪽에선 뭐라고 해야 하나 어쨌건 프로젝트마다 공통적으로 쓰는 헤더들을 찾도록 cscope-database-regexps 를 지정해준다. 아래는 간단한 예제
[code]
(setq cscope-database-regexps
'(
;; 이런식으로 추가해 나가자. 상세한것은 C-h v cscope-database-regexps
("C:/HOME/src/foo/src"
(t)
("C:/HOME/src/foo/extlibs"))
;; more
;; default
("."
(t)
("C:/Boost/include/boost-1_42/boost")
("C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include")
("C:/Program Files/Microsoft Visual Studio 9.0/VC/include")
t)))[/code] - 위에서 지정한 세개의 기본검색 경로에 각각 cscope.out 을 만들어준다. 간단히 emacs 에서 C-c s I 로 지정해줘도 되지만 C++ 표준헤더의 경우 확장자가 없어서 이방법으로는 누락이 되니 직접 cscope.files 를 만들고 이를 통해 cscope.out 을 뽑는 수고를 해야 한다. gnu find 등을 쓰면 간단.
우왕ㅋ굳ㅋ
현재 나는 gnu global 이 주력 태깅툴이고 cscope 는 cscope-database-regexps 때문에 프로젝트 외부 코드를 따라갈때 쓴다. 즉 어떤 프로젝트 루트가 foo 일때 foo 이하는 빌드시 gtags 를 매번 돌려서 태깅을 해두고 코딩시 내가 찾으려는 심볼이 프로젝트 내부의 것인지 외부것인지 정도는 머리속에 들어있으니 상황따라 global, cscope 를 구분해서 쓰는 편.
2010년 3월 27일 토요일
2010년 3월 26일 금요일
Microsoft Application Verifier
http://www.microsoft.com/downloads/details.aspx?familyid=c4a25ab9-649d-4a1b-b4a7-c9d8b095df18&displaylang=en
이런게 있었네.
valgrind 정도의 기능을 원하는데.. 일단 함 써보자.
사용법은 http://msdn.microsoft.com/en-us/library/aa480483.aspx 또는 그냥 appverif.exe 실행
당연히 valgrind 만큼 편하진 않은데 로우리소스 테스트등 재미난게 보인다.
추가.
으음...
그닥 맘에 드는 툴은 아니네.
그래도 기억해두자.
추가
http://stackoverflow.com/questions/413477/is-there-a-good-valgrind-substitute-for-windows
도 적어둔다. 주로 상용툴 야그라 나랑 무관하지만.
google perftools 로 heap 만이라도 체크해볼까? 흠
2010년 3월 21일 일요일
파이어폭스 검색 사이트 등록, 파이어제스쳐 RD 기능
사무실에서는 영어사전을 깔아서 쓰고있는데 집에까지 깔기는 싫고.. 어쩌다 검색할일이 있지만 집에선 키보드위에 손올리고 있는일이 적으니 마우스만으로 해야했다. 사무실이야 손이 키보드에 붙어있으니 파폭 키워드 검색으로 대부분 해결을 하지만...
그래서 파이어제스쳐중 RD 기능을 쓰기로 헀다.
http://mycroft.mozdev.org/
을통해 네이버영어사전을 등록하고 단어 선택후 RD 긁으면 끝.
2010년 3월 19일 금요일
cmake, visual studio 사용자를 위해서 솔루션 뽑아주는 배치파일
나야 nmake, jom 류를 쓰지만 다른이들은 스튜디오를 주로 쓰니 아래 배치파일을 만들어 mkbld.bat 등으로 이름지어서 소스트리에 포함했다. bootstrap.bat 등이 더 적당한 이름이겠지만..
bld 를 만들고 그안에 debug, release 를 각각 만들어서 솔루션을 만들어주는 구조.
솔루션만들거면 디버그 릴리즈 구분하지 않아도 되는데 그럴경우 install 명령이 릴리즈 타겟만 설치하려고 하는 문제가 있어서 (버그인가?) 이런 형태로 사용하게 됐다.
bld 디렉토리는 는 hg 등에서 ignore 해주는것 잊지말자.
[code]
@echo off
if exist bld (
goto err
)
mkdir bld
cd bld
mkdir debug
cd debug
cmake -D CMAKE_CONFIGURATION_TYPES:string=Debug ..\..
cd ..
mkdir release
cd release
cmake -D CMAKE_CONFIGURATION_TYPES:string=Release ..\..
cd ..\..
goto exit
:err
@echo bld directory exists
:exit
@echo on
[/code]
bld 를 만들고 그안에 debug, release 를 각각 만들어서 솔루션을 만들어주는 구조.
솔루션만들거면 디버그 릴리즈 구분하지 않아도 되는데 그럴경우 install 명령이 릴리즈 타겟만 설치하려고 하는 문제가 있어서 (버그인가?) 이런 형태로 사용하게 됐다.
bld 디렉토리는 는 hg 등에서 ignore 해주는것 잊지말자.
[code]
@echo off
if exist bld (
goto err
)
mkdir bld
cd bld
mkdir debug
cd debug
cmake -D CMAKE_CONFIGURATION_TYPES:string=Debug ..\..
cd ..
mkdir release
cd release
cmake -D CMAKE_CONFIGURATION_TYPES:string=Release ..\..
cd ..\..
goto exit
:err
@echo bld directory exists
:exit
@echo on
[/code]
2010년 3월 18일 목요일
jom, nmake 에 -j 기능(병렬 컴파일) 구현한놈 우왕ㅋ굳ㅋ
cmake 릴리즈노트를 읽다가 NMake Makefiles JOM 제네레이터가 추가된걸 보고 궁금해서 뒤져보니 우왕ㅋ굳ㅋ 이놈이 바로 nmake 에 -j 붙인놈이네.
http://labs.trolltech.com/blogs/2009/03/27/speeding-up-visual-c-qt-builds/
http://qt.gitorious.org/qt-labs/jom
다운로드
바로 테스트 해봤는데 시간 줄어드는거 측정까진 못해보고 코어 여러개 쓰는것만 확인했다.
바로 얼마전에 찾다가 못찾았는데 이제라도 찾았으니 다행.
그나저나 cmake 로 솔루션 만들어서 본격적으로 다른이들과 같이 써보니 문제가 좀 많네.
나야 nmake 나 jom 쓰면 쾌적하지만
헐..
솔루션쪽까지 만들어주는건 꽤나 성가시다.
http://labs.trolltech.com/blogs/2009/03/27/speeding-up-visual-c-qt-builds/
http://qt.gitorious.org/qt-labs/jom
다운로드
바로 테스트 해봤는데 시간 줄어드는거 측정까진 못해보고 코어 여러개 쓰는것만 확인했다.
바로 얼마전에 찾다가 못찾았는데 이제라도 찾았으니 다행.
그나저나 cmake 로 솔루션 만들어서 본격적으로 다른이들과 같이 써보니 문제가 좀 많네.
나야 nmake 나 jom 쓰면 쾌적하지만
헐..
솔루션쪽까지 만들어주는건 꽤나 성가시다.
mercurial subrepo
http://mercurial.selenic.com/wiki/subrepos
리소스가 덩치가 너무 커서 subrepo 를 이용 소스코드와 리소스를 분리해봤다.
근데 subrepo 쓰기가 좀 까다롭네. 아래쪽 리파지토리에서 푸쉬를 한후 위쪽 리파지토리에서 커밋을 해줘야 한다. 이 커밋을 잊지말자.
그리고 버그인지 clone 직후 default-path 가 이상하게 들어있다.( 패스구분자가 / 와 \ 가 섞인다) 현재는 매번 clone 후 수작업으로 손보고 있긴 한데... 뭐 수정되겠지
두가지만 기억해두자.
상위리포에서 커밋 잊지말것.
hg debugsub 명령 기억해둘것.
리소스가 덩치가 너무 커서 subrepo 를 이용 소스코드와 리소스를 분리해봤다.
근데 subrepo 쓰기가 좀 까다롭네. 아래쪽 리파지토리에서 푸쉬를 한후 위쪽 리파지토리에서 커밋을 해줘야 한다. 이 커밋을 잊지말자.
그리고 버그인지 clone 직후 default-path 가 이상하게 들어있다.( 패스구분자가 / 와 \ 가 섞인다) 현재는 매번 clone 후 수작업으로 손보고 있긴 한데... 뭐 수정되겠지
두가지만 기억해두자.
상위리포에서 커밋 잊지말것.
hg debugsub 명령 기억해둘것.
피드 구독하기:
글 (Atom)