2009年1月10日

[Emacs / Java] JDEE on Windows (1)

Quick Reference about Install JDEE (Java Development Environment for Emacs) on Windows. (Summary of JDEE Installation Guide)

  • Install Emacs.
    1. download emacs.
    2. install to "C:\Program Files\emacs".
    3. register emacs:
      cd "C:\Program Files\emacs\bin"
      addpm
  • Install Java Tools.
    1. download Java SE Development Kit (JDK) 6 Update 11.
    2. download Java SE 6 Documentation.
    3. install to "C:\Program Files\Java\jdk1.6.0_11".
  • Install Cygwin.
    1. download setup program.
    2. install to "C:\cygwin".
  • Install JDEE, CEDET, Emacs Lisp library and ECB.
    1. download jdee, CEDET, elib and ecb.
    2. unpack them to "C:\cygwin\home\username\emacs\site\".
    3. the directory tree looks like:
      C:\cygwin\home\username\emacs\site
      C:\cygwin\home\username\emacs\site\jde
      C:\cygwin\home\username\emacs\site\jde\lisp
      C:\cygwin\home\username\emacs\site\jde\......
      C:\cygwin\home\username\emacs\site\cedet
      C:\cygwin\home\username\emacs\site\cedet\speedbar
      C:\cygwin\home\username\emacs\site\cedet\......
      C:\cygwin\home\username\emacs\site\elib
      ......
  • Assign Environment Variables.
    1. set the user's environment vars. (我的電腦->內容->進階->環境變數->使用者變數->新增)
    2. HOME=C:\cygwin\home\username
    3. PATH=C:\cygwin\bin
  • Setup Emacs.
    1. download minimal .emacs file.
    2. copy it to "C:\cygwin\home\username\emacs\.emacs"
    3. edit the ".emacs" file. and add these lines.
      (custom-set-variables
      '(current-language-environment "Chinese-BIG5")
      '(default-coding-system "chinese-big5")
      '(default-input-method "chinese-b5-tsangchi")
      '(jde-jdk-registry (quote (("1.5.0" . "C:/Program Files/Java/jdk1.6.0_11"))))
      )
      (add-to-list 'load-path (expand-file-name "~/emacs/site/ecb"))
      (require 'ecb-autoloads)
  • Patch and Compile JDEE.
    1. download 02_workaround_for_bytecompiling_efc.
    2. run the setup program of cygwin again. and install the "patch", "make", "emacs", ...... packages.
    3. patch the file: "C:\cygwin\home\ic-mfhsieh\emacs\site\jde\lisp\efc.el"
    4. Run emacs.
    5. execute the emacs command: M-x jde-compile-jde
  • Compile CEDET, elib and ecb.
    1. run cygwin bash shell.
    2. make cedet and elib.
      cd ~/emacs/site/cedet; make
      cd ~/emacs/site/elib; make
    3. run emacs. and execute the emacs command: M-x ecb-byte-compile


閱讀全文 ...

2009年1月4日

[My Way] 2009.1.1 中和-北橫-宜蘭 單車行

1. 單就單車這件事來說的話,我 2008 立下的心願是拿到 NeverStop 永不放棄系列 的五面完賽奬牌,去年算是已經完成目標了。今年呢,則是希望能北、中、南橫各走一趟,如果能來個三橫一豎的話,那就更棒了。於是,趁著元旦四天連假,先完成北橫這項目標。(底下是在臺七線77公里處拍的照片)

PICT0060_P

2. 元旦當天是一大早 5 點半就與車友約碰頭了,大概是 6 點左右從中和出發。一進臺七乙線,就到處看得到下面這種花朵,不過,因為前幾天都是下雨,大部份的花朵都凋萎了。

PICT0002_P

3. 三民的 7-11,在臺七乙線與臺七線的交接處。走北橫的車友,很多都是約在這休息或中繼的吧!

PICT0006_P

4. 車友覺得輪胎氣壓似乎有點不足,正在打氣中。

PICT0007_P

5. 楓紅的時機似乎過了,路上只偶爾見得到一些楓 (槭?) 樹。

PICT0008_P

6. 大概也是因為前兩天都下雨吧!滿地都是落花。

PICT0010_P

7. 角板山的 7-11。冬日的太陽,暖暖地照著,實在是十分舒服。四天連假,不少車友都相約出遊。

PICT0013_P

8. 羅浮橋。

PICT0014_P

9. 從羅浮橋望向復興橋。

PICT0015_P

10. 著名的羅馬公路標誌。雖然今天不走這條路,不過,既然到了,當然是要拍張照。

PICT0019_P

11. 山谷一景。現場看到的感覺狀闊多了,手頭的隨手相機實在是拍不出那樣的感覺。

PICT0022_P

12. 滿地的落葉,似乎是要見證昔日滿山的楓紅。

PICT0025_P

13. 遠處不知名的水壩,水霧氤氳。

PICT0027_P

14. 肚子餓了,買張蝦餅充飢。

PICT0028_P

15. 萬綠叢中一點紅。

PICT0033_P

16. 巴陵大橋旁的幾棵楓樹。

PICT0034_P

17. 在巴陵大橋的自拍照。

PICT0036_P

18. 從新的巴陵大橋望向舊的巴陵橋,我們打算走舊的巴陵橋。

PICT0039_P

19. 舊的巴陵橋。

PICT0041_P

20. 我們一行人的四部車與巴陵橋的合照。

PICT0043_P

21. 救國團巴陵山莊。在巴陵吃完午餐後,在這小睡了一下。不過,我是睡醒後,一整個無力,反倒是騎不太動了!

PICT0047_P

22. 明池山莊。這大概是北橫的最高點左右。

PICT0055_P

23. 從明池山莊口望向宜蘭那端,天氣整個陰陰的,看來不太妙。過了四陵後,氣溫整個下降,到了明池,天氣更是整個轉冷,昨日氣象預告這一帶氣温會降到 5-6 度,看來不假。再加上時間已晚 (已經下午四點半了),看來這後半段的下坡路有得受了。

PICT0057_P

24. 同行的車友首度單日破百,拍照留念。這時其實已經是下午 5 點半了,山區整個轉黑。從明池下坡過來,一路大霧微雨,再加上冷風吹拂,大家其實都凍得受不了,手指也幾乎僵直了。宜蘭這一側的天氣與西半部完全兩樣,與上午的狀況完全不同,全部的衣服都穿上身了,騎行中還是覺得發冷。

PICT0061_P

25. 大家都冷得受不了。下車暖身一下,繼續最後的一段旅程。

PICT0062_P

26. 晚上 9 點,總算到宜蘭的首都客運了,準備上車回家。大概是中途遊山玩水的時間拖太久了,中午又睡了一個多小時,等到下山時天氣整個轉冷,再加上微雨,下坡速度也只能控制在 20 ~ 30km/hr 之間。整趟路大約花了 15 個小時,實在是遠遠超出預估的想像。

PICT0063_P

27. 最後補張軌跡圖。不過,在最後一段路時,軌跡紀錄器正好沒電了,漏了一小段大約數公里的軌跡。

Route-Street (by mfhsieh)

28. 高度 vs. 距離圖。

Elevation - Distance (by mfhsieh)



閱讀全文 ...

2008年12月27日

[Emacs] Key Sequence and Describe

備忘,查詢用。

主要是整理自以前中研院的一份 pdf 檔,不過,現在好像 google 不到了?

Chapter 2 Emacs on-line help
2.3 Ctrl-h Prefix
C-h c describe-key-briefly
C-h k describe-key
C-h w where-is
C-h a apropos-command
C-h v describe-variable
C-h i info
Chapter 4 About the Emacs
4.2 Exiting Emacs
C-x C-c save-buffers-kill-emacs
4.4 Buffers and Windows
M-x recovery-file 'recovery-file'
C-h v describe-variable
M-x set-variable 'set-variable'
C-x b switch-to-buffer
C-x k 'kill-buffer'
C-x C-b list-buffers
M-x buffer-menu 'buffer-menu'
C-x 0 delete-window
C-x 1 delete-other-windows
C-x 2 split-window-vertically
C-x 3 split-window-horizontally
C-x o other-window
C-x ^ enlarge-window
C-x } enlarge-window-horizontally
C-l recenter
Chapter 5 Basic Emacs Editing Commands
5.1 Loading/Saving File
M-x execute-extended-command
C-x C-f find-file
C-x i insert-file
M-x pwd 'pwd'
C-x C-s save-buffer
C-x C-w write-file
C-x s save-some-buffers
5.2 Emacs Basic Editing Command
M-x overwrite-mode 'overwrite-mode'
C-q quoted-insert
C-j newline-and-indent
C-f forward-char
C-b backward-char
M-f forward-word
M-b backward-word
C-a move-beginning-of-line
C-e move-end-of-line
C-n next-line
C-p previous-line
C-v scroll-up
M-v scroll-down
C-x < scroll-left
C-x > scroll-right
M-< beginning-of-buffer
M-> end-of-buffer
C-x [ backward-page
C-x ] forward-page
C-x C-p mark-page
M-x goto-char 'goto-char'
M-x goto-line 'goto-line'
C-u universal-argument
M-x what-page 'what-page'
C-x l count-lines-page
M-x what-line 'what-line'
C-x = what-cursor-position
M-= count-lines-region
M-x line-number-mode 'line-number-mode'
C-x u advertised-undo
C-d / <del> delete-char
DEL / delete-backward-char
M-\ delete-horizontal-space
M-SPC just-one-space
M-d kill-word
M-DEL backward-kill-word
C-k kill-line
C-x C-o delete-blank-lines
5.3 Yanking
C-y yank
M-y yank-pop
5.4 Marking Text
C-@ set-mark-command
C-SPC set-mark-command
C-x C-x exchange-point-and-mark
C-x C-p mark-page
C-w kill-region
C-x r s copy-to-register
C-x C-l downcase-region
C-x C-u upcase-region
5.5 Moving Text and Copying Text
C-x k kill-buffer
M-w kill-ring-save
C-x r d delete-rectangle
C-x r k kill-rectangle
C-x r y yank-rectangle
C-x r o open-rectangle
M-x clear-rectangle 'clear-rectangle'
M-x string-rectangle 'string-rectangle'
5.6 Undoing Change
C-x u advertised-undo
C-/ undo
C-_ undo
Chapter 6 Advanced Emacs Editing Commands
6.1 Searching Text
C-s isearch-forward
C-r isearch-backward
C-g keyboard-quit
C-M-s / C-s isearch-forward-regexp
C-M-r / C-r isearch-backward-regexp
6.2 Replacing Text
M-x replace-string 'replace-string'
M-x replace-regexp 'replace-regexp'
M-x query-replace 'query-replace'
M-x query-replace-regexp 'query-replace-regexp'
6.3 Regular Expression
. 代表除了newline外的任一個字元
* 字元重複的次數,從0次到無限多次
+ 字元重複的次數,從1次到無限多次
? 字元重複的次數,不是0次就是1次
[...] 字集
[^...] ^出現在字集的第一個字元,表示以下皆非的意思
[.-.] 簡化範圍性的字集的表示法
^ 表示列首
$ 表示列尾
\ 跳脫字元
\| 表示選擇的用法
\(...\) 將範圍規範出來,並置入緩衝區
\d d表數字。把緩衝區的內容取出來
\< 尋找word的開頭
\> 尋找word的結尾


閱讀全文 ...

2008年12月19日

[My Way] 2008.10.11 NeverStop 洄瀾極限挑戰200K

2008.10.11 NeverStop 洄瀾極限挑戰200K,遲到兩個多月的文章。:)

1. 從大會的賽事相簿中挖出來的。終點前。

DSC_1967

2. 第一次搭兩鐵專車,一邊放車,一邊坐人。聽說有的車廂是統一把車子倒過來放,空間會比較大。

PICT0115

3. 本來天氣陰陰的,氣象預報也說可能會下雨。不過,一到東部,太陽就出來了。看到滿滿的陽光,大家都擠到同一側來拍照。

PICT0125

4. 好不容易找到的民宿。這次太晚訂旅舍,差一點就訂不到房間,後來是在 Mobile01 求救,才有車友指點到 Amigos 來。唯一的缺點是 Amigos 就在花蓮火車站附近,離會場鯉魚潭有點距離。

PICT0132

5. 在往鯉魚潭報到的路上。當天的太陽很有氣勢的破雲而出,不過,技術太爛,拍不出那樣的感覺。

PICT0135

6. 因為隔天一大早 (05:00) 就要出發,大部份的人都選擇前一天就來報到。

PICT0138

7. 鯉魚潭。上次到花蓮跑 300K 時,來去勿勿,連鯉魚潭都沒看到。

PICT0141

8. 指點我到 Amigos 訂房的車友在長榮地勤服務,他帶來不少 "實用" 的紅豆麵包,我們正在分配隔日要用的口糧。

PICT0149

9. 睡前清點隨身的行李。我居然要帶這麼多東西在身上跑 200KM,沒擺出來看,還真感覺不出份量這麼多!

PICT0155

10. 其實這次的天氣不好,一早出發時就下雨,大家都是在雨中行進。還好後來雨漸漸停了。這是在第一個補給站的自拍照,花的時間好像與前一次差不多?

PICT0168

11. 全家這次與大會合作,送每位參賽的選手一張可以對換熱狗或是飯糰的點券。另外,全家也在路上開了間臨時的攤位,服務選手,也順便做點生意。

PICT0170

12. 一樣是從大會的賽事相簿中挖出來的。在上舞鶴臺地的坡道上。

DSC_5317

13. 我鞋襪全濕透又乾了,悶悶的很難受,乾脆脫下鞋子來透氣。

PICT0174

14. 終於到終點了,拿下我第四面的參賽獎牌。不過,平均速度居然比前次跑 300KM 時還慢!

PICT0180



閱讀全文 ...

2008年12月16日

[My Way] 2008.12.07 NeverStop 挑戰陽金P字山道

本來去年就想跑一次 P 字山道,不過,終究是沒鼓起勇氣。

今年打算一口氣參加 NeverStop 的五項賽事,前四項都順利完賽了,就只剩這年尾的最後一項:陽金 P 字山道

挑戰路線(全程約75公里): 故宮博物院 → 至善公園 → 仰德大道 → 陽明山國家公園遊客中心 → 竹子湖 → 陽金公路至高點(海拔約800M)→ 陽金公路(連續下坡約20K)→ 金山 → 萬里 → 大坪國小(海拔約400M,陡下坡及髮夾彎)→ 風櫃嘴至高點(海拔約600M)→ (連續下坡約7K)→ 楓林橋 → 明德樂園 → 平菁路 → 平等國小(海拔約400M)→ 逃玩小鎮 → 青山小鎮 → 冷水坑停車場(海拔約750M)

pmap

底下是軌跡圖。因為整個路徑狀似 P 字,所以這條路線被暱稱作 P 字山道。

Route-Street

成績算差強人意,除了下坡很快外,上坡都很慢!大概是用了 5 個半小時左右。

Elevation Speed vs. Distance

最後補張終點衝線的照片!

DSC06365



閱讀全文 ...