프로그램 사용/vi2010. 1. 28. 12:07
vi 내부에서 외부 프로그램을 실행하는 방법으로
:! 명령어
를 입력하는 방법이 있다.

[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Vim/Documents/Tip/ExternalCommand]


$ vi ./src/modules/modules.c

ABOUT-NLS  INSTALL.win32  NEWS        bootstrap    config.status   doc       m4          rvlc      test              vlc.compile.log
AUTHORS    INSTALL.wince  README      compat       configure       extras    make-alias  share     toolbox
COPYING    MAINTAINERS    THANKS      compile      configure.ac    http.pre  modules     src       vlc
ChangeLog  Makefile       aclocal.m4  config.h     configure.help  include   po          stamp-h1  vlc-config
HACKING    Makefile.am    autotools   config.h.in  configure.log   libs      projects    svlc      vlc-config.in
INSTALL    Makefile.in    bin         config.log   cvlc            libtool   qvlc        tags      vlc-config.in.in

Press ENTER or type command to continue

VI 에서 편집중에
:! ls
를 실행한 결과
Posted by 구차니
퇴근길도 사람은 붐빈다(당연한가?)

사람들은 북적대고 서로 마주보고 있으면 민망하고 그래서 한발 물러서다보니
지하철 비좁은 틈에 거리가 생긴다. 그러면 다른사람들이 더 비좁아질테고..

아무튼 그 비좁은 틈에서도 열심히 신문과 책을 읽는 사람들이 보인다.
책을 읽는걸 보면 아주 머리가 텅텅 소리 내는 사람은 아닐진데..
아직 수양이 부족한걸까? 자신의 지식욕을 위해 약간의 양보를 하지 않는다니..
이런 저런생각이 들었다.


핸드폰 매너모드로 안하고 문자보내는 군상들
볼륨 이빠이 해놓고 듣는 귀머거리들


이러한 사람들을 보고있노라면, 이딴 세상 망해버려! 라는 소리가 절로 나오긴 한다.
머.. 그러지 말라고 이야기 못하는 나도 문제이긴 하군.

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

연말정산 배우자 등록  (2) 2010.02.03
"하루늦은" 퇴근일기 - 20100202  (4) 2010.02.03
나도 늙은게야 -ㅁ-  (8) 2010.01.17
출근일기 - 20100113  (2) 2010.01.13
퇴근일기 - 20100111  (4) 2010.01.12
Posted by 구차니
MBLee.no.brain 하나로도 충분한디 버거운디, 왜 너까정 GR이냐 ㄱ-

이기수 고대 총장 "우리나라 등록금 싸"
[링크 : http://media.daum.net/society/education/view.html?tvcateid=1003&newsid=20100127154816175&p=mbn]
Posted by 구차니
프로그램 사용/gcc2010. 1. 27. 17:18
#if 문이라던가 각종 전처리기용 문구들은
여러가지 확장을 통해서 컴파일을 하기 때문에 source insight 등의 힘을 빌려도 분석하기 어려운 면이 있다.

일반적으로 컴파일러는 전처리기 - 컴파일 - 어셈블 - 링크 과정을 거치는데(아마도?)
전처리기 까지만 거친 결과를 stdout 으로 출력해준다.

$ man gcc
       -E  Stop after the preprocessing stage; do not run the compiler proper.
            The output is in the form of preprocessed source code, which is sent to the standard output.

           Input files which don't require preprocessing are ignored.

[링크 : http://linux.die.net/man/1/gcc]

$ cat test.c
#if 1
int test;
#else
int tt;
#endif

int main()
{
        return 0;
}

$ gcc -E test.c
# 1 "test.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.c"

int test;




int main()
{
 return 0;
}


#include 하는 모든 파일을 확장하기 때문에, #include <stdio.h>만 해도 내용이 엄청 길어진다.
그리고 줄단위로 처리하기 때문에 사라진 #if 문 대신 엔터만 남아 위와 같이 휑~하게 나왔다.


[링크 : http://cafe.naver.com/devctrl/949]
Posted by 구차니
프로그램 사용/vi2010. 1. 27. 15:42
set 명령어 모음을 보려면(설정된 값들)

:set all 하면 나온다.
우르르르 나오긴 하는데 음.. 머가 먼지는 ㄱ-

:set all
--- 옵션 ---
  aleph=224           foldclose=          mousemodel=extend   swapfile
noarabic              foldcolumn=0        mousetime=500       swapsync=fsync
  arabicshape         foldenable        nonumber              switchbuf=
noallowrevins         foldexpr=0          numberwidth=4       synmaxcol=3000
noaltkeymap           foldignore=#        omnifunc=           syntax=cpp
  ambiwidth=single    foldlevel=0         operatorfunc=       tabline=
noautochdir           foldlevelstart=-1 nopaste               tabpagemax=10
noautoindent          foldmethod=manual   pastetoggle=        tabstop=8
noautoread            foldminlines=1      patchexpr=          tagbsearch
noautowrite           foldnestmax=20      patchmode=          taglength=0
noautowriteall        formatexpr=       nopreserveindent      tagrelative
  background=light    formatoptions=tcq   previewheight=12    tagstack
nobackup              formatprg=        nopreviewwindow       term=xterm
  backupcopy=auto     fsync               printdevice=      notermbidi
  backupext=~       nogdefault            printencoding=      termencoding=
  backupskip=/tmp/*   helpheight=20       printfont=courier noterse
nobinary              helplang=ko         printmbcharset=     textauto
nobomb              nohidden              printmbfont=      notextmode
  bufhidden=          history=50          prompt              textwidth=0
  buflisted         nohkmap               pumheight=0         thesaurus=
  buftype=          nohkmapp              quoteescape=\     notildeop
  cdpath=,,         nohlsearch          noreadonly            timeout
  cedit=^F          noicon                redrawtime=2000     timeoutlen=1000
  charconvert=        iconstring=         remap             notitle
nocindent           noignorecase          report=2            titlelen=85
  cinoptions=         iminsert=0        norevins              titlestring=
  cmdheight=1         imsearch=0        norightleft         nottimeout
  cmdwinheight=7      includeexpr=        ruler               ttimeoutlen=-1
  columns=87        noincsearch           rulerformat=        ttybuiltin
nocompatible          indentexpr=         scroll=28           ttyfast
  completefunc=     noinfercase         noscrollbind          ttymouse=xterm2
noconfirm           noinsertmode          scrolljump=1        ttyscroll=999
nocopyindent          isprint=@,161-255   scrolloff=0         ttytype=xterm
  cpoptions=aABceFs   joinspaces        nosecure              undolevels=1000
  cscopepathcomp=0    key=                selectmode=         updatecount=200
  cscopeprg=cscope    keymap=             shell=/bin/bash     updatetime=4000
  cscopequickfix=     keymodel=           shellcmdflag=-c     verbose=0
nocscopetag           keywordprg=man      shellquote=         verbosefile=
  cscopetagorder=0    langmap=            shelltemp           virtualedit=
nocscopeverbose       langmenu=           shellxquote=      novisualbell
nocursorcolumn        laststatus=1      noshiftround          warn
nocursorline        nolazyredraw          shiftwidth=8      noweirdinvert
  debug=            nolinebreak         noshortname           whichwrap=b,s
nodelcombine          lines=57            showbreak=          wildchar=<Tab>
  dictionary=       nolisp              noshowcmd             wildcharm=0
nodiff              nolist              noshowfulltag         wildignore=
  diffexpr=           listchars=eol:$   noshowmatch         nowildmenu
  diffopt=filler      loadplugins         showmode            wildmode=full
nodigraph             magic               showtabline=1       wildoptions=
  display=            makeef=             sidescroll=0        window=56
  eadirection=both    makeprg=make        sidescrolloff=0     winheight=1
noedcompatible        matchtime=5       nosmartcase         nowinfixheight
  encoding=utf-8      maxcombine=2      nosmartindent       nowinfixwidth
  endofline           maxfuncdepth=100  nosmarttab            winminheight=1
  equalprg=           maxmem=254460     nospell               winwidth=20
noerrorbells          maxmemtot=254460    spellfile=          wrap
  esckeys             menuitems=25        spelllang=en        wrapmargin=0
  eventignore=      nomodeline            spellsuggest=best   wrapscan
noexpandtab           modelines=5       nosplitbelow          write
noexrc                modifiable        nosplitright        nowriteany
  fileformat=unix   nomodified            startofline         writebackup
  filetype=cpp        more                statusline=         writedelay=0
nofkmap               mouse=              suffixesadd=
  backspace=indent,eol,start
  backupdir=.,~/tmp,~/
  breakat= ^I!@*-+;:,./?
  casemap=internal,keepascii
  cinkeys=0{,0},0),:,0#,!^F,o,O,e
  cinwords=if,else,while,do,for,switch
  comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
  commentstring=/*%s*/
  complete=.,w,b,u,t,i
  completeopt=menu,preview
  define=^\s*#\s*define
  directory=.,~/tmp,/var/tmp,/tmp
  errorfile=errors.err
  errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier
 is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%
m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f',%X%*\a[%
*\d]: Leaving directory `%f',%D%*\a: Entering directory `%f',%X%*\a: Leaving directory
`%f',%DMaking %*\a in %f,%f|%l| %m
  fileencoding=utf-8
  fileencodings=ucs-bom,utf-8,default,latin1
  fileformats=unix,dos
  fillchars=vert:|,fold:-
  foldmarker={{{,}}}
  foldopen=block,hor,mark,percent,quickfix,search,tag,undo
  foldtext=foldtext()
  formatlistpat=^\s*\d\+[\]:.)}\t ]\s*
  grepformat=%f:%l:%m,%f:%l%m,%f  %l%m
  grepprg=grep -n $* /dev/null
  guicursor=n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block
  helpfile=/usr/share/vim/vim72/doc/help.txt
  highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMs
g,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visua
l,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:Di
ffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu
,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColum
n,.:CursorLine
  include=^\s*#\s*include
  indentkeys=0{,0},:,0#,!^F,o,O,e
  isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=
  isident=@,48-57,_,192-255
  iskeyword=@,48-57,_,192-255
  lispwords=defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,defin
e-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,
deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etype
case,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-p
rog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-fro
m-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,de
fine-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,
store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accesso
rs,with-accessors*,defclass,defmethod,print-unreadable-object
  matchpairs=(:),{:},[:]
  maxmempattern=1000
  mkspellmem=460000,2000,500
  nrformats=octal,hex
  paragraphs=IPLPPPQPP TPHPLIPpLpItpplpipbp
  path=.,/usr/include,,
  printexpr=system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' ' . v:f
name_in) . delete(v:fname_in) + v:shell_error
  printheader=%<%f%h%m%=페이지 %N
  printoptions=paper:a4
  rightleftcmd=search
  runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim72,/
usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after
  scrollopt=ver,jump
  sections=SHNHH HUnhsh
  selection=inclusive
  sessionoptions=blank,buffers,curdir,folds,help,options,tabpages,winsize
  shellpipe=2>&1| tee
  shellredir=>%s 2>&1
  shortmess=filnxtToO
  spellcapcheck=[.?!]\_[\])'"^I ]\+
  suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.
out,.toc
  tags=./tags,./TAGS,tags,TAGS
  titleold=빔을 날게 해 주셔서 고맙습니다
  viewdir=~/.vim/view
  viewoptions=folds,options,cursor
  viminfo='100,<50,s10,h



[링크 : http://www.eng.hawaii.edu/Tutor/vi.html]
Posted by 구차니
Linux2010. 1. 27. 11:09
patch -p0 < filename 이라고 스크립트가 되어있었는데 귀차니즘으로
patch -p0 filename 라고 했더니 끝나지 않아서 man page에서 확인하니


SYNOPSIS
       patch [options] [originalfile [patchfile]]

       but usually just

       patch -pnum < patchfile

[링크 : http://linux.die.net/man/1/patch]

엄훠 히밤~
착한 아이는 스크립트 대로 하세요~ ㅋㅋ
Posted by 구차니
일단 놀 치프틴 모자 벗길려면 창으로 머리 두방 이상 맞추랜다.. 어쩔 ㄱ-

[링크 : http://www.thisisgame.com/board/view.php?id=321411&board=0&category=12101&subcategory=&page=2&best=&searchmode=&search=&orderby=&token=]



아무튼 맨날 누워서 구경하다가 막상 놀 치프틴을 잡으려니 손발이 후덜후덜
다리가 오그라들지만, 그래도 일단 용감 무식하게 돌진!!





"퍽!!!!"





머.. 이러면 고추되는거임 -ㅁ-


개인적인 리시타 공략법은
  1. 되도록이면 맞지 않는다.
  2. 맞아도 정줄 놓지 않는다면 최대한 회피한다.
아무튼 슬립대시 D랭까지 배운후 슬립스루를 F랭 배우면(이건 F랭 밖에 없는가?) 두번 연타로 회피가 가능해지니
조금더 안정적으로 진행할수 있게 되니, 다른거 올리기 전에 슬립대시 D랭부터 일단 고고싱

아무튼, 7레벨, 컴뱃 B랭, 슬립대시 D랭인 상황인데
(키보드 조작 기준)
S+S+D+A+A 조합으로 치고 빠지니 금세 잡힌다.(물론 무기를 바꾸어서 그렇겠지만)
일단 회피는 공격 타입에 따라서 완전 후진 보다는,
S+S+D+↓+A+→+A 식으로 대각선 방향 빠져주는 것이 좋다.(ㄴ 자로 빠지게 됨)
(음.. 동시에 S+S+D+→+A+A 이렇게 대각선 회피도 되려나?)


개발노트의 타격판정 동영상에서 캡쳐
뒤에있다가 앞으로 나오면서 공격을 하기에 뒤로 빠져도 맞을 가능성이 있으니
되도록이면 대각선 방향으로 빠지는게 유리하다.

다른 "북쪽폐허" 보스들도, 공격을 주의하면서
위와 같은 조합으로 두대만 때리고 도망가고 스태미나 보면서 적당하게 도망다니고
그러면 그리 어렵지 않게 잡을수 있다.


사족 : 밟는걸 몰라서 거미를 못 터트렸는데 ㄱ-

개발자 노트를 보니 A+S 하거나 다운된 몹은 D로 발차기를 할 수 있다고 한다.
[링크 : http://heroes.nexon.com/news/devstory.aspx?no=4&mode=view&page=3]
Posted by 구차니
지하철을 타고 출근하는 건 책을 읽을수 있어서 좋다. (근데 어쩌라구!)



책을 읽다가 보니 문득 드는 생각.
"미래에는 게임이 TV를 대체하지 않을까?"

TV의 단방향성에 비하면
PC의 게임은 어느정도 제한되어는 있지만
"상호작용"을 하며 스스로 내용을 "만들어"가는 구조를 취하고 있다.

자신의 "행동"에 "쾌감"을 느낄수 있으며
TV에서 타인에 의해 만들어지는 컨텐츠에 대한 공감을 끌어내는걸 넘어선 "경험"을 같이하는 "사람"을 만나게 되는
이러한 행위들로 인해, TV와 게임은 다르다고 할 수 있지만 결국에는 대체 되지 않을까라는 생각이 들었다.





(아니면 말구 ㅋㅋ)
Posted by 구차니
프로그램 사용/VLC2010. 1. 26. 17:56
Youtube의 Asteroid Impact (HD) 를 play 하는데 필요한 모듈을 캡쳐했다.



리눅스쪽이 녹색, 윈도우쪽이 파란색이다.
일단 눈에 띄는 차이점은, audio output과 video ouput 부분이다.

'프로그램 사용 > VLC' 카테고리의 다른 글

VLC cross compile시 오류 (vlc-1.0.4)  (0) 2010.02.03
VLC 1.0.4 cross compile + busybox  (0) 2010.02.02
VLC로 youtube 동영상 감상하기  (0) 2010.01.26
youtube mobile on VLC  (0) 2010.01.18
VLC compile [링크]  (0) 2010.01.15
Posted by 구차니
Linux2010. 1. 26. 15:54
How seperate directory and filename from path.

getfilename()
getdirectorypath()

이런식으로 좀 구현해주면 덧나나 싶을 정도로
은근히 검색해도 안나오는 녀석이었는데, 은근히 용도가 많은 녀석이다.

#include <libgen.h>
char *dirname(char *path);
char *basename(char *path);

path          dirname        basename
"/usr/lib"     "/usr"        "lib"
"/usr/"        "/"           "usr"
"usr"          "."           "usr"
"/"            "/"           "/"
"."            "."           "."
".."           "."           ".."


[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/man/3/basename]

path가 절대경로이든, 상대경로이든 dirname()과 basename()은 알아서 분리해준다.

[링크 : http://linux.die.net/man/3/basename]
[링크 : http://linux.die.net/man/3/dirname]

#include <string.h>
char *strdup(const char *s);
#define _GNU_SOURCE
#include <string.h>
char *strndup(const char *s, size_t n);
char *strdupa(const char *s);
char *strndupa(const char *s, size_t n);

The strdup() function returns a pointer to a new string which is a duplicate of the string s. Memory for the new string is obtained with malloc(3), and can be freed with free(3).

[링크 : http://linux.die.net/man/3/strdup]

[링크 : http://www.unix.com/unix-dummies-questions-answers/100617-how-get-directory-name-its-path.html]

오늘의 교훈 : 쉘에서 되면 당연히 API로도 존재한다!


Posted by 구차니