網頁

顯示具有 Tool 標籤的文章。 顯示所有文章
顯示具有 Tool 標籤的文章。 顯示所有文章

2013年3月26日

diff and patch

Linux 中 Diff 命令的功能為逐行比較兩個文字檔案,列出其不同之處。它對給出的檔進行系統的檢查,並顯示出兩個檔中所有不同的行,不要求事先對檔進行排序。

用 diff 工具可以將兩個檔案的差異性輸出成一個補丁檔。有了這個補丁檔,我們可以利用 patch 工具幫助我們從舊檔案升級成新檔案,或者從新檔案還原成舊檔案。所以 diff 和 patch 搭配在一起,威力無窮啊。

首先我們要做個小實驗,準備兩個文字檔叫做 old 和 new,檔案內容分別如下

Valgrind: a powerful memory profiling tool

Install

apt-get install valgrind

Usage

valgrind --leak-check=full --log-file=vglog ./a.out

Reference

wwwsqldesigner: Visual web-based SQL modelling tool

WWW SQL Designer allows users to create database designs, which can be saved/loaded and exported to SQL scripts. Various databases and languages are supported. Ability to import existing database design.

About

Hi and welcome to WWW SQL Designer! This tool allows you to draw and create database schemas (E-R diagrams) directly in browser, without the need for any external programs (flash). You only need JavaScript enabled. The Designer works perfectly in Mozillas (Firefox, Seamonkey), Internet Explorers (6, 7, 8), Safari and Operas. Konqueror works, but the experience is limited.

Many database features are supported, such as keys, foreign key constraints, comments and indexes. You can either save your design (for further loading & modifications), print it or export as SQL script. It is possible to retrieve (import) schema from existing database.

Install IMDbPY

Install Tools

apt-get install python-setuptools
apt-get install python-dev
apt-get install libmysqlclient15-dev
easy_install -U SQLObject
easy_install MySQL-python
easy_install psycopg2

  • SQLObject is a popular Object Relational Manager for providing an object interface to your database, with tables as classes, rows as instances, and columns as attributes.
  • MySQL-python is the most popular MySQL adapter for the Python
  • Psycopg2 is the most popular PostgreSQL adapter for the Python

Tabs and Indent in Vim

Vim 中關於 tab 的相關設定,大致上就是 tabstop 、expandtab、shiftwidth、softtabstop 這四個變數,要搞懂其中的道理著實不容易啊。所以就將我所理解的部分,做個筆記。

下面是我從國外網站關於這四個變數的英文敘述,先列在下面比較好釐清他們之間的關係

expandtab

When expandtab is set, hitting Tab in insert mode will produce the appropriate number of spaces.

這個變數大致上是在大型專案多人開發的時候,為了避免大家的 coding style 不同,造成版面上的混亂,因此將所有的 tab 用 space 來做取代,可以讓大家看到一致的面貌。正常情況下不建議打開這個變數,假設一個 tab 用四個 space 做取代,space 所站的空間就會變成 tab 的四倍大。

2013年3月25日

SlickEdit 2011 常用設定

快速鍵

  • Find : Ctrl + f
  • Replace:Ctrl + r
  • Jump:Ctrl + j
  • Previous Buffer:Ctrl + p
  • Next Buffer:Ctrl + n
  • Change Dir:Ctrl + d
  • Find matched Braces:Ctrl + ]
  • Go to Definition:Ctrl + .
  • Go to Reference :Ctrl + /