2016年11月19日 星期六

delete key not work in Vim on Mac

To solve this problem, adding the following setting in .vimrc
set backspace = 2

They are the same thing.

Reference:
http://cenalulu.github.io/linux/why-my-backspace-not-work-in-vim/

2016年11月18日 星期五

Homebrew doctor memo

檢測目前hombrew是否有問題
To check if there is problem in current brew.
$ brew doctor

結果如下
Here's the result


homebrew會很貼心的告訴我們有什麼問題, 以及該怎麼解決問題
brew will tell you what is the problem now, and how to solve it.
如上圖,
問題
Here we got the warning message:
Warning: /Users/james.jmart/Library/Caches/Homebrew isn't writable.

解決方式
The following is the solution suggest by brew:
sudo chown -R $(whoami) /Users/james.jmart/Library/Caches/Homebrew

在終端機貼上上述指令即可解決問題
So, execute the command offered by brew above.

我們在執行完上述指令後, 再執行一次brew doctor檢驗看看
After execute the command, we check brew again by using brew doctor




Cool, Done !!!




2016年11月7日 星期一

Using Python with Virtualenv


很多時候會面臨到不同開發專案會使用不同的開發環境(Python)與套件
除此之外, 還可能會使用不同的套件, 更可能會面臨到相同套件不同版本的問題
使用Virtualenv可以解決困擾
In many situations, you have to develop your projects in various environments to meet each needs.
However install all the needed model package and python version will make your box very dirty.
Virtualenv can solve this kinds of problem.

1. Create an virtual environment in a directory
$ cd proj_directory
$ virtualenv -p /usr/local/bin/python3.5 virtualenv_name

2. Start virtual env
$ source virtualenv_name/bin/activate

除此之外, 此時亦可以透過pipe安裝套件到virtual environment, 與世隔絕
Besides, you can install other python module package in virtual environment by using pipe command, to ensure the developing environment isolate.

3. 結束目前virtual environment
3. End current virtual environment
$ deactivate

刪除virtual environment
If you want to get ride of the virtual environment, using the following command.
$ cd proj_directory
$ rmvirtualenv virtualenv_name

Reference:

Virtual Environments

解壓縮SAP SAR檔 - Decompress SAP SAR file


先下載SAPCAR from SAP Support
You need go to SAP Support website, and download SAPCAR tool.

指令, 建議將SAPCAR與要解壓縮的SAR檔案放在同一目錄下
Before enter the following command in terminal, put SAPCAR and the target in the same directory.
sapcar -xvf xxx.sar

done