2011年7月30日 星期六

(Vim) 設定 Vim 開發環境,使用 Vundle [on Windows]

0 意見
步驟1:安裝 msysgit
參考:https://github.com/gmarik/vundle/wiki/Vundle-for-Windows
記得選擇:Run git from Windows command prompt


步驟2:將 curl.cmd 放到 C:\Program Files (x86)\Git\cmd
這一步完成後,才可以使用 BundleSearch 之類的指令

步驟3:設定 Vundle

$ git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

步驟4:設定 _vimrc
參考:https://github.com/gmarik/vundle/blob/master/README.md

步驟5:放入 ctags.exe
可以放到 C:\Program Files (x86)\Vim\vim73 路徑下,
也就是 GVIM.exe 的相同目錄下

---
我的 vimrc:https://github.com/bcswlmpke/hank.vim




(Mac) 安裝 Mac Ports

0 意見
Mac Ports
http://www.macports.org/

Install MacPorts
http://www.macports.org/install.php

下載 dmg 安裝後,打開 Terminal
輸入 sudo port -v
看到 MacPorts 2.0.0 表示成功 (此我為目前安裝的版本)

(Emacs) 文字編輯器

0 意見
以往用 Vim 開發著實感受到不少好處
不過對於大專案的開發似乎在程式碼的切換與操作上較為不便
目前的開發使用 XCode 倒也還蠻適應的

廢話說了這麼多
最近看到幾個 Emacs 的網站資源,先記下來,之後有時間再來試試看。

Emacs C mode 指令速查
http://www.dev.idv.tw/mediawiki/index.php/Emacs_C_mode%E6%8C%87%E4%BB%A4%E9%80%9F%E6%9F%A5%E5%88%97%E8%A1%A8

Emacs 文字模式熱鍵對應
http://shelandy.blogspot.com/2008/01/eamcs.html

emacs wiki
http://www.emacswiki.org/

GNU Emacs on Windows
http://yehnan.blogspot.com/2010/06/gnu-emacs-on-windows.html

emacs 基本入門
http://homepage.mac.com/yenlung/WebWiki/EmacsNotes.html

emacs 快速入門
http://www.study-area.org/cyril/opentools/opentools/x42.html

2011年7月24日 星期日

(隨拍) 台北植物園

0 意見
週末去歷史博物館參觀畢卡索特展~
剛好遇到大暑這個節氣
天氣實在很熱
然後順路到植物園參觀走走~

(牛奶) 牛奶照片第二發

0 意見
上週末回嘉義~
順便拍了一些牛奶的照片
大家應該都很想念牛奶吧!

(游泳) 第七次上課記錄

0 意見
1) 自由式打水暖身

2) 自由式左手三下,右手一下,第四下也就是右手的時候換氣

3) 自由式右手三下,右手一下,第四下也就是右手的時候換氣

在做 2), 3) 的動作時,記得每一下動作完成時,身體要轉正並做延伸,再做下一個動作

手在水中向下撥的時候,不要貼大腿,而是從身體旁邊然後以手掌往上的動作向後撥

4) 仰式打水的時候,小腿打水,腳背盡量打出水面,且身體不要晃

肚子盡量挺出水面

5) 仰式換手時,一隻手(e.g. 左手)往上舉90度,此時心裡要數著腳踢水 6 下,然後右手在水平面下將水往身體中心撥,此一同時,左手為貼近頭旁邊伸直,且右手為貼著大腿,兩手同時到定位。

6) 練小蛙腳,兩手抓牆,以「腳跟」為重心,「往牆壁也就是往前」用小腿畫圓,切記不是「向下畫圓」,練習的時候,是腳做動作,不要拱背然後身體用力拉扯。

7) 兩手抓牆時,如果蛙腳做正確,試著不要抓牆,改以兩手掌貼牆,身體會向前,而不是往後。

8) 兩種練習蛙腳的方式,一個是趴在床上練習,一個是站著,然後小腿畫圓,站直;再換另一腳。

2011年7月23日 星期六

Vi Input Manager

0 意見
下載:http://www.corsofamily.net/jcorso/vi/


Vi Input Manager
by: Jason Corso
This bundle patches the Cocoa Text System to add a Vi-like command mode. After entering command-mode (typically, by hitting escape in Vi), ordinary Vi commands can be typed and the text field will be updated accordingly. Essentially, this add Vi command functionality (albeit a small subset) to any (and all) text editors that use the Cocoa text system; e.g., Safari, TeXShop, XCode, etc. Note, however, this does not work for other programs that do not use the Cocoa system.
All the text windows, will initialize in "input" mode (standard cocoa text input). You invoke the Vi-command window (exit the input mode) by hitting ` (the back-apostrophe key, this is customizable, see installation instructions) and then key in your favorite Vi commands. For example, move down a line 'j', move right 'l', delete two lines 'd2d', and so on. You enter back into "input" mode by typing the 'i'. You get the idea. Right now, you should be thinking -- "you mean the editor in XCode will behave like Vi?" Answer: Yes.

How do iOS programmers develop applications using Vim?

0 意見
原文出處:http://www.quora.com/Vim/How-do-iOS-programmers-develop-applications-using-Vim


  
How:
  1. Install macvim,
  2. Install cocoa.vim and snipMate.vim plugins by Michael Sanders.
  3. You'll still need to use xCode for a lot of things (find definition, , use Cmd-0 to toggle back to the xCode environment.
  4. get an app for dividing your screen quickly, i use left 2/3 for xcode and right 2/3 for macvim, with a 1/3 overlap in the middle on my laptop, otherwise 1/2 and 1/2 when plugged into a monitor.
  5. use : Ctl-x Ctl-o to for auto completion options
  6. if you get no match on your autoComplete on a method call using bracket syntax then try dot syntax for the correct auto complete
  7. Cmd-0 to toggle to xCode, Cmd-Shft-R to open console and Cmd-B to build to quickly do a build and see debug output
  8. Need to look up something quickly? Cmd-0 to toggle to Xcode, Cmd-Alt-Shft-? to open up xcode documentation window
  9. C-p to show local completion options (matches within currently open buffers)
  10. set macvim to open files in a new tab in same window
  11. set folding, nocompat, incsearch, virtualedit and other options in .vimrc according to your preference.

2011年7月20日 星期三

(Mac) 使用 Eclipse + TFS plugin 來做版本控制

0 意見
使用 Team Foundation Server 做版本控制的朋友,
如果在非 Windows 的環境下開發,
那麼要如何使用 TFS 版本控制的功能呢?

以 Mac OS 為例,我知道的有下面幾種方式:
1. Windows 以 Visual Studio 做版本控制,然後以 Shared Folder 的方式分享給 Mac OS 存取
2. SvnBridge 透過 SVN 做中介
3. Eclipse + TFS plugin 

目前我使用 3.,使用上覺得還蠻方便的,
對於在非 Windows 環境下開發,
且公司又是以 TFS 做版本控管的朋友應該是蠻方便的方式,
而且操作介面跟使用 Visual Studio 的選單完全一樣。

步驟:
1) 下載 eclipse-SDK-3.7-macosx-cocoa-x86_64.tar.gz
2) 下載 TFSEclipsePlugin-UpdateSiteArchive-10.1.0.zip
3) 解壓縮 Eclipse,開啟 Eclipse 主程式
4) Help -> Install New Software -> Add -> Archive 
然後選擇  TFSEclipsePlugin-UpdateSiteArchive-10.1.0.zip
在 Name 欄位任意輸入一個名稱:TFS Plugin
5) 將 Visual Studio  Team Explorer Everywhere 2010 打勾
6) 下面我有打勾的項目有
Show only the latest versions of available software
Group items by category
Show only software applicable to target environment
Contact all update sites during install to find required software
7) 按 Next 會開始安裝,接著就照步驟完成它
8) 安裝成功後會提示 restart Eclipse
9) Window -> Show View -> Other -> 選擇 Team Foundation Server -> Team Explorer
10) 按 Team Explorer 上面的+圖示,
I have read and accept the terms in the License Agreement -> Next -> 輸入 Product Key -> Next
11) 輸入 Server 位址, e.g. http://tfs.example.com:8080/tfs
12) 輸入 Username, Domain, Password
13) 然後 Next 選擇 Team Project

以上大功告成!Enjoy!






2011年7月9日 星期六

(游泳) 第六次上課記錄

0 意見
1) 穿蛙鞋,自由式打水25公尺來回

2) 穿蛙鞋,自由式換氣25公尺來回
每一下,腳多踢三下,注意身體的平衡
膝蓋與腳掌盡量貼近,減少阻力 

3) 穿蛙鞋,手交叉,仰式打水25公尺來回

4) 雙手重疊,自由式打水,45度的時候身體翻轉成仰式,換氣,再翻轉成自由式
一直重覆
順時針2次(一次轉成仰式,一次轉成自由式)
逆時針2次

5) 自由式 3 拍轉仰,左、右手兩邊都要能夠轉成仰式

6) 練蛙腳 (記得回家坐椅子練習)

7) 練蝶腰 (手往下、頭再往下、胸部內縮,然後手放鬆伸展,胸部挺出)

8) 自由式側身打水,然後一直練換氣 

(游泳) 第五次上課記錄

0 意見
游泳前一個小時不要進食

太瘦的人容易抽筋,小腿抽筋壓腳踝,腳掌抽筋則壓腳趾,腳背抽筋則反向壓腳趾

1) 暖身:自由式打水

2) 自由式換氣
頭先偷轉,然後出水面再鼻子吐氣
靠著頭的手要伸直,頭只是像脖子不動,但只轉頭的樣子轉頭換氣,不要整個頭出水面
不要整個下巴一直往上
想像仰式轉自由式的樣子
出水面的時候要吐氣與吸氣要拿捏,我目前是覺得快吐,然後不要吐乾淨,就吸氣
然後頭入水面,如同自由式側身打水時頭正朝下的姿勢

3) 打水的時候,膝蓋與腳掌盡量貼近,可減少阻力
 
4) 右手開始者,第一次 3下換氣,接下來都是 2 下換氣,才會在同一邊

5) 自由式握拳

6) 自由式每三下,則手向上指向天空時,順時針畫一個小圈
如果遇到換氣,則先換氣後,手向上的時候再畫小圈

7) 雙手手掌交握,然後自由式打水,變換成仰式 

8) 小蛙練習腿部,重心在腳跟,腳趾向上翹,動作慢,快,畫圈

9) 仰式轉自由式
如同自由式換氣一樣,要練到轉頭的動作要盡量一樣

2011年7月5日 星期二

(Ruby) 學習 Ruby 程式語言

0 意見
前一份工作在 linux 環境寫過 shell script
以前買過 perl 學習手札,但一直沒好好認真學
看過一些 python 的介紹,曾經很心動也花了一些時間研究語法

但是,現在我想學  Ruby 
為什麼?
沒有什麼原因,純粹就是想學一個 script language

那我想學 Ruby 拿來做什麼呢?

2011年7月2日 星期六

(游泳) 第四次上課記錄

0 意見
課程邁入 4/12

1. 自由式側身打水 
2. 自由式四拍轉仰
A. 第四拍完成一半時,頭在水面下先偷跑,稍微轉一下
B. 然後鼻子吐氣(要像韻律呼吸那樣大的吐氣),頭再一次向上轉正,臉朝上; 然後大口吸氣
C. 注意此時左手不要往回縮,而是無限延伸向前
D. 轉成仰式後,換氣都是「快吐快吸」
E. 腳在打水時,雙腳掌盡量貼近,不要分開
F. 新手練習時候,自由式換手採前交叉式
    側身打水
    右手背往前點到水面下,碰觸左手背,然後身體轉正
    左手向後划,右手向前延伸
3. 仰式打水,轉自由式
A. 打水增加速度後,左手開始向前延伸伸直
B. 頭先向後躺,讓胸部挺起來,然後感受一下水的位置
C. 側身打水,但頭還是臉朝上
D. 嘴巴大口吸氣後,臉正面朝下,然後維持自由式側身打水
E. 右手從大腿開始向上90度(手背朝前),然後向前點至水面下(此時仍為手背朝前)
F. 右手手背點到水面後,身體轉正,然後左手向後划,右手向前延伸
4. 仰式打水,手舉高45度 
5. 自由式四拍轉仰,但雙手握拳