Muninn's story

SEARCH RESAULT : 글 검색 결과 - 잊어먹을까봐 저장하는 놈들 (총 22개)

POST : 잊어먹을까봐 저장하는 놈들/programming

legacy code에서의 agile을 할려면?

프로그래밍 서적을 간간히 읽어오면서 계속 하고 싶었던 것들 - TDD, Refactoring.

현재 내가 개발하는 모듈에 적용하기는 정말 힘들다. 머, 일단 legacy code 위에서 시작해야 한다는 것과 embed system에 적용되야 한다는 것도 문제지만, 무엇보다도 나 스스로 이러한 개발 방법들을 적용하는 것을 귀찮아 한다는 것.

사실, refactoring 한다고 말해놓고는 function 내부를 무작정 고쳐보기도 했지만, 이를 위한 unit test는 준비조차 하지 않는 말도안되는 만행을 저지른 것은 정말 부끄럽다. 지금이라도 늦지 않았다는 생각에 내가 맡고 있는 part의 내부를 차곡 차곡 쪼개서 독립 모듈을 만드는 작업과 이를 동작시키기 위한 외부 환경 - device driver, system api 등에 대한 mock 을 구성하는데 몇주가 걸린듯 하다.

절반정도의 작업을 진행하면서 한가지 느끼는 것. '부지런해야지. 게을러지면 안돼'
쉽게 가는 길이 나를 자꾸 유혹하지만, 거기에 빠져들면 다시 legcacy code의 수렁으로 빠질 것 같다.
top

posted at

2009. 4. 21. 13:40


POST : 잊어먹을까봐 저장하는 놈들/env

QEMU : 에뮬레이션을 통한 가상화 - 하드웨어 환경을 에뮬리션하여 게스트 플랫폼을 가상화한다.

QEMU 이해를 위해 요약 (참고: http://www.ibm.com/developerworks/kr/library/l-qemu/index.html)

1. QEMU 운영모드
  1) 사용자 모드 에뮬레이션
    - 호스트 CPU로 동적 변환 과정을 수행하고 리눅스 시스템 호출을 바꾸는 방법으로 특정 CPU용으로 만들어진 프로세스를 다른 CPU에서 수행하도록 만든다.
  2) 시스템 모드 에뮬레이션
    - 프로세서와 관련 주변 장치를 포함한 전체 시스템을 에뮬레이션 한다.

2. 동적 변환기
  1) 에뮬레이션을 제공하기 위해 게스트 CPU를 호스트 CPU용 명령으로 실행 중에 바꿔준다.
    - 목표 명령어를 우선 마이크로 연산자로 바꾸는 방식으로 동적 변환을 수행한다.(컴파일된 C 코드 조각)
    - 핵심 변환기는 목표 명령어를 동적 변환을 위한 마이크로 연산자로 사상한다.
    - 부하 최소를 위해 변환될 코드 블록을 캐시한다. (16MB 블록에 캐시)
   
3. 지원 주변 장치
  1) PC
    - VGA(Video Graphics Array), PS/2 마우스와 키보드, IDE(Integrated Development Environment) 하드 디스크와 CD-ROM 인터페이스.
    - NE2000 PCI(Peripheral Controller Interconnect) 네트워크 어댑터, 직렬 포트, 다양한 사운드 카드, UHCI(PCI Universal Host Controller Interface) USB(Universal Serial Bus) 컨트롤러.
    - 255개 CPU까지 프로세서 SMP(Symmetric MultiProcessing)를 지원.
  2)ARM Versatile 기본 보드(926E를 활용하는), MIPS 보드 지원.



 



top

posted at

2009. 4. 15. 13:29


POST : 잊어먹을까봐 저장하는 놈들/version control

Git doc install error

git 설치시 doc install 수행 중에 아래 msg 가 나오는 경우

MSGFMT po/de.msg make[1]: *** [po/de.msg] Error 127
make: *** [all] Error 2

tcl 8.4 / tk 8.4 install 해야 한다. (gettext?)
top

posted at

2009. 4. 12. 23:42


POST : 잊어먹을까봐 저장하는 놈들/env

find를 이용하여 cscope.files를 쉽게 작성

SRC=/home/iam/src
SRC_TAG=/home/iam/tags

PWD=pwd
find    $SRC \( -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.cc' -o -name '*.x' -o -name '*.s' -o -name '*.S' \) -print > $SRC_TAG/cscope.files
cd $SRC_TAG
rm *.out
cscope -b -q
cd $PWD
top

posted at

2009. 4. 9. 20:27


POST : 잊어먹을까봐 저장하는 놈들/env

doxygen.vim : doxygen을 쉽게 쉽게

"
" FILE: doxygen.vim
"
" ABSTRACT: file and function comments with doxygen syntax
"
" Provides two abbreviations for inserting file and function comments.
"
" The function comment abbr tries to scan a function definition to extract
" the parameters and the return type. This "parse function" is not perfect
" and might result in error, but it's better than nothing ;-).
"
" Global Parameters are:
"
" - g:fullid                The name of the developer.
" - g:DoxyDateFormat        The date format used for the file comment
"                           (parameter to strftime)
" - g:DoxyVoidParamString   What to use for a empty parameter list?
"
" AUTHOR: Ralf Schandl <schandl@de.ibm.com>
"
" $Id: doxygen.vim,v 1.1 2000/12/27 12:01:24 rks Exp $
"
" =============================================================================
"

" insert doxygen function header
iab _DFH <C-R>=DoxyFuncComment()<CR><ESC>XXi*<esc>?\\brief<CR>2dwi
"iab _DFH <C-R>=DoxyFuncComment()<CR><ESC>XXi*<esc>?\\brief<CR>A
" insert only parameter list (can be used if param list changed)
iab _DFHp <SPACE><C-R>=DoxyParamList()<CR>

" insert doxygen file header
iab _DMH <C-R>=DoxyFileComment()<CR><ESC>XXi*<esc>?\\brief<CR>2dwi

if !exists("g:fullid")
    let g:fullid = 'Developer name not set. Set it in "g:fullid"'
endif

if !exists("g:DoxyDateFormat")
    let g:DoxyDateFormat = '%a %b %d %T %Z %Y'
endif

if !exists("g:DoxyVoidParamString")
    "let g:DoxyVoidParamString = ""
    let g:DoxyVoidParamString = "\@param void"
endif

" returns the text part for the parameter list
function! DoxyParamList()
    normal mz
    normal /(^M
    normal "ay%

    let p = CScanParam(@a)
    if p == ""
        let p = g:DoxyVoidParamString
    else
        let p = substitute(p, ',', "\n\\\@param ", "g")
        let p = substitute(p, '^', "\\\@param ", "g")
    endif
    normal `z
    return p
endfunction

" scans the parameter list and returns a comma separated list of the
" parameters
" This function is not a C syntax scanner, but only tries to do its best
" with regular expressions.
function! CScanParam(pl)
    let p = a:pl
    "echo "p1:<" . p . ">"
    if p =~ '^( *\(void\)\= *)$' || p =~ "^( *)$"
        let p = ""
    else
        " remove linebreaks in parameter list
        let p = substitute(p, "\n", ' ', "g")
        "echo "p2:<" . p . ">"
        " replace multiple spaces with one space and remove spce before
        " commas
        let p = substitute(p, '\s\s*', ' ', "g")
        let p = substitute(p, '\s,', ',', "g")
        "echo "p3:<" . p . ">"
        " remove types
        let p = substitute(p, '[^,]\S* \=\(const \)\=\** \(const \)\=\**\(\S*[,)]\)', '\3', "g")
        "echo "p4:<" . p . ">"
        " if functions pointer parameter, remove parameter list
        let p = substitute(p, ').*),', "),", "g")
        let p = substitute(p, ').*))$', "))", "g")
        "echo "p4a:<" . p . ">"
        " remove leading and trailing brackets
        let p = substitute(p, '^(', "", "")
        let p = substitute(p, ')$', "", "")
        "echo "p5:<" . p . ">"
    endif
    "echo "p6:<" . p . ">"

    return p
endfunction

" returns the returntype of a function
" This function is not fail save!
function! CScanRet()
    normal mz
    normal /(^MB
    let c = col(".")
    if c == 1
        normal k
    endif
    let l = getline(".")

    let l = substitute(l, '\s\s*', ' ', "g")
    let l = substitute(l, '^\s*\(virtual \|static \|const \)* *\(\S* *\**\).*$', '\2', "")

    'z
    return l
endfunction

" returns the text for a function comment
function! DoxyFileComment()
    let C = '' .
        \ "/*!\n" .
        \ "\\file " . expand('%:p:t') . "\n" .
        \ "\n" .
        \ "\\brief\n" .
        \ "\n" .
        \ "\n$" . "Id$" .
        \ "\n" .
        \ "\n\\author " . g:fullid . "\n" .
        \ "\\date   " . strftime(g:DoxyDateFormat) . "\n" .
        \ "/"
    return C
endfunction

"    vim:tw=75 et ts=4 sw=4 sr ai comments=\:\" formatoptions=croq
"
"---------[ END OF FILE doxygen.vim ]------------------------------------------

회사에서 Doxygen style로 comment를 작성하하고해서 검색해서 찾아낸 plug-in. 좀 수정해서 쓰고 있는데, function comment, file comment 사용하는데는 편하게 쓰고 있습니다. 
top

posted at

2009. 4. 9. 20:23


POST : 잊어먹을까봐 저장하는 놈들/env

Kernel-based Virtual Machine (KVM)

Full virtualization on i386 and amd64 hardware
Using KVM, one can run multiple virtual PCs, each running unmodified Linux or
Windows images. Each virtual machine has private virtualized hardware: a
network card, disk, graphics adapter, etc.

KVM (for Kernel-based Virtual Machine) is a full virtualization solution for
Linux hosts on x86 (32 and 64-bit) hardware.

KVM is intended for systems where the processor has hardware support for
virtualization, see below for details.  All combinations of 32-bit and 64-bit
host and guest systems are supported, except 64-bit guests on 32-bit hosts.

KVM requires your system to support hardware virtualization, provided by AMD's
SVM capability or Intel's VT. To find out if your processor has the necessary
support, do as follows:

* Make sure you run Linux 2.6.16 or newer for AMD processors, or
Linux 2.6.15 for Intel processors.  Older Linux versions do not report
the virtualization capabilities.

* Run this command in a shell: egrep '^flags.*(vmx|svm)' /proc/cpuinfo

If it prints anything, the processor provides hardware virtualization
support and is suitable for use with KVM.

Without hardware support, you can use qemu instead, possibly with the kqemu
package for better performance.

The recommended qemu package contains the script
/usr/sbin/qemu-make-debian-root, which uses debootstrap to build a Debian disk
image. See the man page for qemu-make-debian-root. The suggested hal package
is only used for automatically reporting the system bios version and computer
model when reporting bugs.

KVM consists of two loadable kernel modules (kvm.ko and either kvm-amd.ko or
kvm-intel.ko) and a userspace component. This package contains the userspace
component, and you can get the kernel modules from the standard kernel images
or build them yourself from the kvm-source package which provides the module
source.

top

posted at

2009. 4. 8. 23:11


POST : 잊어먹을까봐 저장하는 놈들/env

Simple DirectMedia Layer

SDL is a library that allows programs portable low level access to a video
framebuffer, audio output, mouse, and keyboard.

qemu를 설치하기 위해서는 SDL or Cocoa가 install 되어 있어야 한다.
top

posted at

2009. 4. 8. 23:07


POST : 잊어먹을까봐 저장하는 놈들/env

vimrc

매번 서버 옮길때마다 추가하기 귀찮아서, 여기다 백업!.

--------------------------------------------------
set ignorecase
set infercase
set ai
colorscheme ron
set exrc
syntax on
set nocindent
set tabstop=4
set shiftwidth=4
set nu
set hlsearch

set encoding=utf-8
set tenc=utf-8,cp949
set fenc=utf-8
set fencs=utf-8,cp949,cp932,euc-jp,shift-jis,big5,latin1,ucs-2le
"set fileencodings=utf-8,cp949
" autocommand
autocmd BufWritePre * :%s/\s\+$//e

" function key
map > g
map <
map zz [{v]}zf

filetype on

"set showmatch

" cscope configuration
set csto=0
set cst
set cscopequickfix=s-,g-,d-,c-,t-,e-,f-,i-
set nocsverb
set cspc=0
com! -nargs=1 F cs find f <args>

" taglist configuration
let Tlist_Use_Right_Window = 0
let Tlist_Compact_Format = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_Display_Tag_Scope = 1
let Tlist_Max_Submenu_Items = 25
let Tlist_WinWidth = 35
let Tlist_Use_SingleClick = 1
let Tlist_Display_Prototype = 0
let Tlist_Exit_OnlyWindow = 0
let Tlist_File_Fold_Auto_Close = 1
let Tlist_Show_One_File = 1
set updatetime=1000

" minibufexplorer
let g:miniBufExplMapWindowNavVim = 0
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchWindows = 0
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1

set nocompatible

map ,e :e <C-R>=expand("%:p:h") . "/" <CR>

"function InsertTabWrapper()
"      let col = col('.') - 1
"      if !col || getline('.')[col - 1] !~ '\k'
"          return "\<tab>"
"      else
"          return "\<c-p>"
"      endif
"endfunction

"inoremap <TAB> <C-R>=InsertTabWrapper()<CR>

" Buffer Explorer
let g:bufExplorerDetailedHelp=0

"let g:bufExplorerSortBy='number'     " Sort by the buffer's number.
"let g:bufExplorerSortBy='name'       " Sort by the buffer's name.
let g:bufExplorerSortBy='mru'        " Sort by most recently used.
"let g:bufExplorerSortBy='fullPath'   " Sort by full file path name.

"let g:bufExplorerSplitType='v'
"let g:bufexplorersplitvertsize=50
let g:bufExplorerOpenMode=1    " Open using current window
let g:bufExplorerSortDirection=1   " Sort in forward order
let g:bufExplorerSplitOutPathName=1  " Split the path and file name.

map <C-J> :BufExplorer<CR>
map ,w  
set hlsearch

" for omnicppcomplete plugin
set nocp
filetype plugin on
let OmniCpp_DisplayMode = 1
"let OmniCpp_SelectFirstItem = 1

" cscope sync.
map <F5> :cs kill 0<CR>:cs kill 1<CR>:!cs<CR>:cs add $SRCTAG/cscope.out<CR>:cs add $DRVTAG/cscope.out<CR>

cs add $SRCTAG/cscope.out
cs add $DRVTAG/cscope.out
source /home/hyun12/.vimplug/cscope_maps.vim
source /home/hyun12/.vimplug/doxygen.vim
source /home/hyun12/.vimplug/bufexplorer.vim
source /home/hyun12/.vimplug/taglist.vim

let VCSCommandDiffSplit='vertical'


nmap ,cl :VCSLog -q<CR>
nmap ,cL :VCSLog -v<CR>
nmap ,cm :!svn stat \| grep -v '^?'<CR>
nmap ,cv <Plug>VCSVimDiff
nmap ,cu <Plug>VCSUpdate
nmap ,cs <Plug>VCSStatus
nmap ,cr <Plug>VCSReview
nmap ,cq <Plug>VCSRevert
nmap ,ci <Plug>VCSInfo
nmap ,cg <Plug>VCSClearAndGotoOriginal
nmap ,cd <Plug>VCSDiff
nmap ,cD <Plug>VCSDelete
nmap ,cc <Plug>VCSCommit
nmap ,cG <Plug>VCSClearAndGotoOriginal
nmap ,cn <Plug>VCSAnnotate
nmap ,ca <Plug>VCSAdd
nmap ,g <Plug>VCSClearAndGotoOriginal

com! -nargs=* Diff VCSVimDiff <args>
com! -nargs=* Log VCSLog <args>
--------------------------------------------------
top

posted at

2009. 4. 8. 10:49


POST : 잊어먹을까봐 저장하는 놈들/version control

Git 관련 링크

git : home
Git User's Manual
Git - SVN Crash Course : svn 사용자였던 사람들이 쉽게 접근하도록 정리 되어 있음.

top

posted at

2009. 4. 6. 20:17


POST : 잊어먹을까봐 저장하는 놈들/version control

git diff 실행시 ESC] 출력되는 문제


앞뒤 생략하고 .bashrc 등에

export LESS="-erX"

추가.

자세한 내용은 여기 참조.
top

posted at

2009. 4. 6. 20:08


CONTENTS

Muninn's story
BLOG main image

RSS 2.0Tattertools
공지
아카이브
최근 글 최근 댓글 최근 트랙백
카테고리 태그 구름사이트 링크