2007-11-18

Eclipse で WideStudio/MWT #01

Eclipse: http://eclipsewiki.net/eclipse/
WideStudio : http://www.widestudio.org/ja/

Eclipse インストール
http://eclipsewiki.net/eclipse/index.php?%A5%A4%A5%F3%A5%B9%A5%C8%A1%BC%A5%EB
- JRE のインストール : http://www.java.com/ja/download/manual.jsp
-- Linux RPM (自己解凍ファイル) を選択/ダウンロード
--- 手順: http://www.java.com/ja/download/help/5000010500.xml#rpm
# chmod a+x jre-6u3-linux-i586-rpm.bin
# ./jre-6u3-linux-i586-rpm.bin
(snip)
Do you agree to the above lisence terms? [yes or no]
yes
- Eclipse のインストール :
-- Eclipse のダウンロード : http://www.eclipse.org/downloads/index.php
--- Eclipse IDE for C/C++ Developers の Linux 版を選択/ダウンロード
# tar xzf eclipse-cpp-europa-fall2-linux-gtk.tar.gz
# mv ./eclipse /usr/local

-- もしくは(http://sourceware.org/eclipse/)
# yum -y install eclipse-cdt

WideStudio のインストール
http://www.widestudio.org/ja/download-eclipse.html
$ wget http://www.widestudio.org/ws-v3.97.6-src.tar.gz
$ tar xzf ws-v3.97.6-src.tar.gz
$ cd ws-v3.97-6
$ ./configure
$ make runtime
$ make mwt_java
# make install

# wget http://www.widestudio.org/nab-mwt/nab-mwt.linux-gtk.0.9.7.zip
# unzip nab-mwt.linux-gtk.0.9.7.zip -d /usr/local/eclipse/

Eclipse 起動
[Window] メニュー [Open Perspective] → [Other...] を選択
[MWT Development] が見つからない・・・。

(つづく)

2007-11-03

no file on this line

.emacs
http://www.fuji.sakura.ne.jp/~yada/wiki.cgi?page=052slackware9#p12
(add-hook 'dired-mode-hook
          '(lambda ()
             (setenv "LANG" "C")))

2007-10-30

Makefile #02

SHELL = /bin/sh

CC
= gcc

CFLAGS
= -g -Wall

LIBS
= -lm


TARGET = test
SRC
= sin01.c cos02.c tan03.c

OBJS
= $(SRC:.c=.o)

DEPEND
= Makefile.depend


all
: $(TARGET)


depend
:

<-- TAB -->$(CC) -MM -MG $(SRC) > $(DEPEND)


$(TARGET): $(OBJS)

<-- TAB -->
$(CC) -o $@ $^ $(LIBS)

.c.o
:

<-- TAB -->$(CC) -c $(CFLAGS) $<

clean
:

<-- TAB -->-rm -f $(OBJS) $(TARGET) $(DEPEND) *~

-include
Makefile.depend

2007-10-28

TeX 環境設定

TeX まわりのインストール
$ yum -y install tetex* gv gsvirew xpdf
AUCTeX のインストール
http://pop-club.hp.infoseek.co.jp/emacs/auctex-jp.html
$ cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/cvsroot/auctex co auctex
$ cd auctex
$ ./autogen.sh
$ ./configure
$ make && make install

.emacs の設定
http://tmcosmos.org/linux/fedora/7/settings07.html
;===================================
; AUCTeX
;===================================

(require 'tex-site)
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(setq TeX-default-mode 'japanese-latex-mode)
(setq japanese-TeX-command-default "pTeX")
(setq japanese-LaTeX-command-default "pLaTeX")
(setq japanese-LaTeX-default-style "jsarticle")
(setq preview-image-type 'dvipng)
(setq TeX-file-extensions '("tex" "sty" "cls" "ltx" "texi" "texinfo" "dtx"))
(setq kinsoku-limit 10)
(setq LaTeX-indent-level 4)
(setq TeX-output-view-style '(("^dvi$" "." "/usr/bin/pxdvi %d")))
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
4. AUCTeX の使い方
http://tmcosmos.org/linux/fedora/7/settings07.html
C-c C-c : コンパイルやプレビュー
C-c C-s : 節などを追加
C-c C-e : 式や箇条書きなどの環境を追加
C-c C-p C-d : Emacs内で図や数式をプレビュー (preview-latex)
C-c C-p C-p : preview-latex モードで、カーソルの場所だけプレビュー
C-c C-p C-c C-d : preview-latex モードの解除
C-c C-o C-f : Fold(footnoteやciteなどを短縮表示)モードへ入る
C-c C-o C-b : バッファ全体のFolding
C-c C-o C-r : リージョンのFolding
C-c C-o C-o : 状況に応じてFolding/Unfolding
C-c C-o b : Foldモードの解除



2007-10-27

sed 連続 (空白|スペース) 置換

連続した空白(スペース)をコロンに置換

成功した例(OK):
$ sed 's/  */:/g' hoge.txt
$ sed 's/\s\s*/:/g' hoge.txt
$
sed 's/[[:blank:]][[:blank:]]*/:/g' hoge.txt

失敗した例(NG):
$ sed 's/ +/:/g' hoge.txt
$ sed 's/\s+/:/g' hoge.txt
$ sed
's/[[:blank:]]+/:/g' hoge.txt

何故?

2007-10-26

Makefile

SHELL = /bin/sh

CC = gcc
CFLAGS = -Wall -g
LIBS =
TARGETS = mycat myhead mygrep myls mymkdir myrmdir myln myrm mymv

all: $(TARGETS)

$(TARGETS): %:%.o
<- TAB ->$(CC) -o $@ $< $(LIBS)

.c.o:
<- TAB ->$(CC) -c $(CFLAGS) $<

clean:
<- TAB ->-rm -f $(TARGETS)
<- TAB ->-rm -f *.o *~