eclipse indigoをphpで使う。インストールからちょっとした見た目の設定まで。
なんだか今使っているeclipseが重いし、indigoもリリースされたのでindigo入れてみる。
http://download.eclipse.org/eclipse/downloads/drops/R-3.7-201106131736/index.php
の Platform Runtime Binary からWindows (Supported Versions) をダウンロード.
解凍して c:\eclipse に配置。
起動→phpの開発ツールが入っていないので PHP Development Tools (PDT) SDK Feature を入れる。
Help→Install New Software で
Indigo - http://download.eclipse.org/releases/indigo
を選択→しばらく待つ。5分くらいは待つ。→ 言語一覧からPHP SDK を選んでインストール。
ついでに eclipse market place もインストール。
Help→eclipse market place から eclipse color theme を探してインストール。
背景色とかの設定:windows→preferences→General→Appearance→ColorTheme→好きなの選ぶ。
JStyleを入れる
http://www.eclipsewiki.net/eclipse/?JStyle%A5%D7%A5%E9%A5%B0%A5%A4%A5%F3
を見て入れる。windows→preferences→General→JStyleで自分好みにする。
mysqlにログインするshell
memo
#!/bin/sh PATH=/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin export PATH USER='' PASS='' DBNAME='' HOST='localhost' mysql --user=$USER --password=$PASS --database=$DBNAME --host=$HOST
期間を指定したSQL(〜秒以内のレコードを対象にする)
〜秒以内のレコードを対象にする where 節. 直接文字で入力するとDBサーバーと呼び出し側の時刻設定が違った場合に,予期しない結果が帰ったりするので,どちらを使用するかは考えよう.
SELECT DISTINCT userid FROM user_data WHERE lastupdate < NOW() AND lastupdate > SUBDATE(NOW(), INTERVAL 1800 SECOND); SELECT DISTINCT userid FROM user_data WHERE lastupdate < NOW() AND lastupdate > "2011-03-30 17:**:00";
ちなみにTIMESTAMPDIFFを使用すると遅いです.例えばこう
TIMESTAMPDIFF(SECOND, lastupdate, NOW()) BETWEEN 0 AND 86400
apacheのhttpd.conf Syntax確認
/etc/init.d/httpd -t /etc/init.d/httpd -S
で確認。-S はVirtualHostの設定も確認できる。他にも色々あってナンカややこしい。
/etc/init.d/httpd configtest
でオプションみれた
ぼくの .vimrc
随時追加中+学び中.
set encoding=japan
set fileencodings=sjis,utf-8,iso-2022-jp,euc-jp
set nu
colorscheme darkblue
set expandtab
set tabstop=4
set shiftwidth=4
set nocompatible
set title
" 対応する括弧の表示時間を2にする
set matchtime=2
" コマンドライン補完を拡張モードにする
set wildmenu
"ステータス行を表示
set laststatus=2
" ステータスラインに表示する情報の指定
set statusline=%n\:%y%F\ \|%{(&fenc!=''?&fenc:&enc).'\|'.&ff.'\|'}%m%r%=<%l/%L:%p%%>
" ステータスラインの色
highlight StatusLine term=NONE cterm=NONE ctermfg=black ctermbg=white
" 文字コードの自動認識
if &encoding !=# 'utf-8'
set encoding=japan
set fileencoding=japan
endif
if has('iconv')
let s:enc_euc = 'euc-jp'
let s:enc_jis = 'iso-2022-jp'
if iconv("\x87\x64\x87\x6a", 'cp932', 'eucjp-ms') ==# "\xad\xc5\xad\xcb"
let s:enc_euc = 'eucjp-ms'
let s:enc_jis = 'iso-2022-jp-3'
elseif iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb"
let s:enc_euc = 'euc-jisx0213'
let s:enc_jis = 'iso-2022-jp-3'
endif
if &encoding ==# 'utf-8'
let s:fileencodings_default = &fileencodings
let &fileencodings = s:enc_jis .','. s:enc_euc .',cp932'
let &fileencodings = &fileencodings .','. s:fileencodings_default
unlet s:fileencodings_default
else
let &fileencodings = &fileencodings .','. s:enc_jis
set fileencodings+=utf-8,ucs-2le,ucs-2
if &encoding =~# '^\(euc-jp\|euc-jisx0213\|eucjp-ms\)$'
set fileencodings+=cp932
set fileencodings-=euc-jp
set fileencodings-=euc-jisx0213
set fileencodings-=eucjp-ms
let &encoding = s:enc_euc
let &fileencoding = s:enc_euc
else
let &fileencodings = &fileencodings .','. s:enc_euc
endif
endif
unlet s:enc_euc
unlet s:enc_jis
endif
if has('autocmd')
function! AU_ReCheck_FENC()
if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0
let &fileencoding=&encoding
endif
endfunction
autocmd BufReadPost * call AU_ReCheck_FENC()
endif
set fileformats=unix,dos,mac
if exists('&ambiwidth')
set ambiwidth=double
endif
http://www.kawaz.jp/pukiwiki/?vim
ここの文字コード自動認識をいただきました.