2008年3月20日 星期四

Global gtags introduction

Global gtags introduction

在Linux 下去瀏覽OpenSouce code 是一件痛苦的事, 怎麼說呢? 因為一個大型的專案中要找到一個struct 的結構或是某個函式的定義是非常不容易的, 當然我們可以使用grep 來搜索, 但是如果有工具可以快速的告訴我們某個函式在那幾個程式中有用到, 不是一件美好的事嗎!

如果你是使用IDE 來寫程式而且用的編輯器有提供函式列表功能的話, 那你就可以跳個今天要介紹的GNU Global (source code tag system) project.

安裝方法:
安裝的話很簡單到Global download 去下載最新的版本, 而我安裝的是glogal-5.6.2
下載後解開tar ball, 然後執行./configure && make && makeinst all

使用:
切換到專案目錄下執行gtags, 之後目錄下分別會產生四個gtags 的檔案
GPATH 路徑名稱的資料庫
GTAGS 物件定義的資料庫
GRTAGS 物件關連的資料庫
GSYMS 其他標誌的資料庫

之後可以用global 這個指令來搜尋, 例如
global func1 #func1 是被定義在那個檔案之中
global -r func1 #那個檔案有呼叫 func1

若是覺得這樣還是太麻煩, 可以再搭配htags 製作HTML 文件喔.

2008年1月16日 星期三

find 使用技巧

尋找5分鐘內修改的檔案並排除 test目錄
find . -path "./test" -prune -o -cmin -5 -print

尋找超過2G 的檔案
find / -size +2000000k



find + md5sum to check file integrity
find . -name '*' -type f -exec md5sum '{}' >checksum.md5 \; 

刪除副檔名為png 的檔案
find . -name "*.png" | xargs -i rm {}
find . -name "*.png" -exec rm {} \;


Recursive update files timestamp
find . -exec touch {} \;

date 應用

顯示前天日期 date -d "2 days ago" +%Y%m%d

顯示後天日期 date -d "2 days ago" +%Y%m%d
..依此類推

2008年1月9日 星期三

Google: Cluster Computing and MapReduce Lecture

從Google codes 上看到, 是講有關Cluster Computing

Lecture 1 - Introduction


slides

Lecture 2 - MapReduce
slides

Lecture 3 - Distributed File Systems
slides

Lecture 4 - Clustering Algorithms
slides

Lecture 5 - Graph Algorithms
slides

原文網址
http://code.google.com/edu/content/submissions/mapreduce-minilecture/listing.html

2008年1月8日 星期二

KOSE ESPRIQUE 廣告

主題曲: 無敵的妳 福山雅治

4-1


4-2


4-3


4-4