개인적으로 vim, eclipse 로 요즘 웹 개발을 하고 있습니다. SVN을 사용하면서 일반적으로 아래의 제외/무시 패턴을 사용하면 불필요한 파일은 Commit하지 않게 됩니다. ~* *~ * *.bak .* *.class Thumbs.db *.tmp *.~* _*.*
이번에 회사에서 블로그를 운영한다고 아이네임즈에서 웹 호스팅을 받고, TextCube를 설치하였답니다. 그런데, 글쓰기에서 파일 업로드가 되지 않는거에요. 그래서 디버깅을 해보니까.... 이상하게도 SWF Uploader에서만 403 에러를 뱉는 것이었습니다.. (정확하게는 302 -> http://error.uhost.co.kr/stop/403_Error_Page.html 이동)
그래서 호스팅업체에 문의해서 확인해 보니까 웹 방화벽님께서 막아주시더군요. 아무튼 이렇게 저렇게 테스트 해보니까 SWF Upload가 될 경우에는 방화벽에서 막히고, FF나 IE 등에서 업로드 될 경우엔 막히지 않더군요.
그래서 일단 해결책으로 config.php 에서 $service['flashuploader'] = false; 를 설정하여 해결을 했습니다.
웹방화벽에서 막은 이유는 "... request body: Multipart: final boundary missing ..."이라는데 SWF에서 업로드 될 경우엔 마지막 부스래기가 빠진건지.. 나원참... -_-;
gvim을 사용하다가 몇가지 맘에는 컬러 스키마중에서 고민이 되더라구요. 그러다가 random colors vim 으로 검색을 했더니 짠 하고 나오는게 있더군요.
아래 코드를 vimrc 에 등록하고 gvim 을 다시 켜보면! 랜덤하게 색상이 변경되는 것을 볼 수 있습니다.
" Create the comma-separated list of colorscheme files let s:colors = substitute(globpath(&runtimepath, 'colors/*.vim'), '\n', ',', 'g') if strlen(s:colors) " Count the number of color schemes let s:num = strlen(substitute(s:colors, '[^,]\+', '', 'g')) + 1 if s:num > 1 let s:loop = localtime() % s:num " Rotate the list s:loop times while s:loop let s:colors = substitute(s:colors, '^\([^,]\+\),\(.*\)$', '\2,\1', '') let s:loop = s:loop - 1 endwhile endif let s:color = matchstr(s:colors, '^[^,]\+') unlet! g:colors_name execute 'source' s:color " Prevent the message from disappearing redraw " 스킨이름을 보고 싶으면 아래 주석을 푸세요~ "echomsg 'Color applied: '.(exists('g:colors_name') ? g:colors_name : '').' ('.s:color.')' endif unlet! s:colors s:color s:num s:loop
[edit] - [startup settings] 에 등록하시고 :wq! 하고 실행하면 짠~ 하고 계속 바뀝니다 ^^
FreeBSD에서 apache 2.2를 설치하고 httpd.conf 가 아닌... extra/httpd-vhost.conf 등을 vim 으로 열게 되면 Syntax highlight가 되지 않습니다.
이것은 filetype.vim 에 등록된 내용하고 맞지 않기 때문인데요. 아래 처럼 수정해주시면 문법 강조가 잘 될 것입니다.
/usr/local/share/vim/vim72/filetype.vim 을 열어서 114 줄로 이동 또는 httpd.conf 로 검색하여 해당 부분을 찾아서 아래 내용 처럼 수정합니다. ※ vim72는 설치된 vim의 버전에 따라서 다릅니다. /usr/local/share/vim 으로 가서 확인해보세요~
일반적인 설정 au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/ap ache2/*.conf* call s:StarSetf('apache')
#1 apache22 디렉토리를 몽땅 설정 au BufNewFile,BufRead
httpd.conf*,/usr/local/etc/apache22/*.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/ap
ache2/*.conf* call s:StarSetf('apache')
#2 httpd-*.conf 를 인식하도록 설정 au BufNewFile,BufRead
httpd.conf*,httpd-*.conf,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/ap
ache2/*.conf* call s:StarSetf('apache')
그리고 :wq! 후에 vim /usr/local/etc/apache22/extra/httpd-vhost.conf 등을 열어봅시다~
.vimrc 파일에 아래 내용을 추가 해 놓으면 문서을 열때 자동으로 cp949, utf8 등을 선택해서 보여줍니다. gvim이라면 편집→StartupSettings 에 추가하세요~
" vim 에서 UTF-8, euc-kr 한글문서 그냥 열기.
" {{{ Locale settings
" Try to come up with some nice sane GUI fonts. Also try to set a sensible
" value for fileencodings based upon locale. These can all be overridden in
" the user vimrc file.
if v:lang =~? "^ko"
set fileencodings=euc-kr
set fileencoding=euc-kr
set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-*
elseif v:lang =~? "^ja_JP"
set fileencodings=euc-jp
set fileencoding=euc-jp
set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*
elseif v:lang =~? "^zh_TW"
set fileencodings=big5
set fileencoding=big5
set
guifontset=-sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1,-taipei-fixed-medium-r-normal--16-150-75-75-c-160-big5-0
elseif v:lang =~? "^zh_CN"
set fileencodings=gb2312
set fileencoding=gb2312
set guifontset=*-r-*
endif
" If we have a BOM, always honour that rather than trying to guess.
if &fileencodings !~? "ucs-bom"
set fileencodings^=ucs-bom
set fileencoding=ucs-bom
else
set fileencodings+=ucs-bom
endif
" Always check for UTF-8 when trying to determine encodings.
if &fileencodings !~? "utf-8"
set fileencodings^=utf-8
set fileencoding=utf-8
else
set fileencodings+=utf-8
endif " }}}
This article show you how to keep a window always on top. A friend asked me about this question,I searched it on the internet and found some codes but none of them works well,so I think it is necessary to write a article about to help the beginners.
To keep a window always on top,you should do as flowing: 1.Create a Dialog based project(Similarly,you can create other projects). 2.Add flowing declare in *Dlg.h between "{{AFX_MSG" and "AFX_MSG}}"
afx_msg int OnCreate(LPCREATESTRUCT lpRes);
3.Add flowing function in *Dlg.cpp:
int *Dlg::OnCreate(LPCREATESTRUCT lpRes) { this->SetWindowPos(&CWnd::wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); return CDialog::OnCreate(lpRes); }
4.Modify Message map codes,add flowing sentence between BEGIN_MESSAGE_MAP and END_MESSAGE_MAP():
ON_WM_CREATE()
After doing above,compile and build you project,you will find that your window will keep always on top!That's it ,thank you!