티스토리 툴바

pengguni tistory

http://goo.gl/reXX

sem_init()에서 sem_t를 제대로 init해주지 않는 것으로 보인다.
sem_t variable은 반드시 memset()을 이용해서 initialize해 줄 것!
Posted by 펭기니 Trackback 0 Comment 0

C++ casts

2010/08/11 16:55 : Dev tips
const_cast<TO_TYPE>(FROM_OBJ) : const 속성을 없애는데 사용한다. 다른 방법은 없다.
static_cast
<TO_TYPE>(FROM_OBJ) : C style cast와 가장 유사한 형태. 단, parent class --> child class시 check를 하지 않으므로 문제 발생의 요지가 있다!
dynamic_cast<TO_TYPE>(FROM_OBJ) : runtime type check가 가능함. 따라서 parent class --> child class시 사용하면 type check를 통해서 exception이나 null (포인터의 경우)을 리턴한다.
reinterpret_cast<TO_TYPE>(FROM_OBJ) : low level casting. Compiler와 target platform에 대해서 잘 알고 있는 것이 아니라면 안쓰는 것이 좋다.

dynamic_cast는 대부분의 경우 "메우" 느리고 비효율 적으로 구현되어 있다. 따라서 가능하면 쓰지말고 virtual func를 parent class에 추가하거나 container를 이용해서 child class를 직접 지정하는 방식으로 피해가도록 한다!
Posted by 펭기니 Trackback 0 Comment 0
"프로그램"을 한다는 사람들이 알아야 할 것들을 짚어주는 책.

프로그래머라면 "당연히" 알고 있어야 할 지식 뿐만 아니라 "관용적"으로 알고 있어야 할 지식도 가득 들어있다.

시간이 없어서 주요 부분만 읽어야 한다면 항목 이외에 아래의 장들을 읽어봐야 한다.

1장 스타일
2장 알고리즘과 데이터 구조
3장 설계와 구현
Posted by 펭기니 Trackback 0 Comment 0

git for survival... -_-;;

2010/04/14 16:03 : Dev tips
1. remote repository 가져 오기
git clone ssh://user@some.server.com/subdir/project.git

2. remote list 보기
git remote -v

3. remote 상세 정보 확인 (*origin : remote repository clone하면 자동으로 지정 됨)
git remote show origin

4. master branch가 없는 경우 특정 branch가져 오기
git branch --track -b brLocalName origin/brRemoteName

5. 변경 사항 확인
git status

6. 수정사항 stage
git add [Changed files]

7. Commit (Local repository만 변경됨!!)
git commit

8. Remote repository update (branch의 default값은 master, remote-name도 생략 가능)
git push [remote-name] [branch]

9. 변경사항 rollback
git checkout [file_name]

10. remote의 branch로 update하기 (clone로 가져와서 remote설정이 되어 있는 경우)
git pull

Posted by 펭기니 Trackback 0 Comment 0

LS_COLORS

2010/04/14 15:22 : Dev tips
LS_COLORS='no=00:fi=00:di=00;94:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:
ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:
*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:
*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:
*.png=00;35:*.tif=00;35:'

참고 할 URL

Posted by 펭기니 Trackback 0 Comment 0