安裝和配置簡述
* 英文指南
* 配置tomcat
o 修改 server.xml ,在connector 加 URIEncoding="UTF-8"
o 修改 catalina.sh ,加一行 CATALINA_OPTS="-DHUDSON_HOME=~/apprun/hudsonhome/ -Xms512m -Xmx512m"
+ 其中 HUDSON_HOME 是 hudson 的配置和運行文件所在地
o 修改 tomcat-users.xml
+ <role rolename="admin"/>
+ <user username="hudson" password="hudson" roles="admin"/>
* 把下載的hudson.war 放在 tomcat 的webapps 下,hudson 會自動啟動起來,部署就完成了
o 可以訪問,比如 http://****:18080/hudson/
* 安裝 jdk
* 安裝 ant
* 配置hudson
o 配置和管理需要登陸 ,login
o 打開管理頁面,比如 http://****:18080/hudson/configure
o 配置安全 ,Enable security ,兩個選項:Delegate to servlet container --〉Legacy mode
o 配置 jdk 路徑, 比如 /home/**/tools/jdk1.6.0_13/
o 配置 ant 路徑, 比如 /home/**/apprun/ant171
o 配置 System Admin E-mail Address ,//寫一個很多項目公用的email
o 記得 save
* 新建一個job
o 配置和管理需要登陸 ,login
o new job ,選項 :Build a free-style software project
o 配置 ,比如 :**:18080/hudson/job/icontent/configure
+ 填寫svn 路徑 ,比如 :http://svn.****
+ Build Triggers,選Poll SCM ,schedule 符合 cron 規則
+ Build ,invoke ant ,填寫 ant target
+ Post-build Actions ,選 E-mail Notification , Recipients 填寫郵件地址
* 配置linux 的環境變量
o vi .bash_profile
o JAVA_HOME=$HOME/tools/jdk1.6.0_13
o PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:$HOME/apprun/ant171/bin
o LANG=zh_CN.GB2312 //encoding 與.java 源代碼文件的編碼一致 ,這樣javadoc 不會有警告
o LC_CTYPE=zh_CN.GB2312
easy!
great tool!
1. hibernate 變得不太重要了,jdbc 就很好
2. 數據庫不夠用了,bdb
3. bdb 不夠用了, 自己寫b+ tree
4. java 不行了,得用 c++
看來,這個轉變是個革命。搞不好得丟飯碗。
從想做一個創業者,到想做一個proferssional 。
<西津渡圖解軟件項目管理 〉從1年半之前,每當有新的感受,就修訂一些。為自己的成長作個備注吧。
code-block with mingw ,setup .
set path=c:\program file\code blocks\mingw\bin;%path%
bjam --toolset=gcc-3.4.5 --prefix=d:\boost\b137345 --build-type=complete install
很久沒有來blogjava 了。
一個原因是,關注的內容與blogjava 的東西,重疊的太少了。
不過,我也納悶,我該去哪里找自己的同好?
blogjava 在云計算,web2.0 ,這些前途領域,沒有什么內容。
struts,hibernate,spring, acegi,lucene 這些都是成熟的東西了。
說一下我最近用過的東西:
hadoop,hbase,zookeeper,深入研究了java concurrent.
下一步的方向是寫一個,distribute document oriented file system.
技術和互聯網的發展,絕對是web2.0,云計算,兩端厚的架構。blogjava 也該多這方面的內容了。
Conducting and Reviewing the Software Design Model
The design model resides at the core of the software engineering process. It is the place where quality is built into the software (and the place where quality is assessed. For this checklist, the more questions that elicit a negative response, the higher the risk that the analysis model will adequately serve its purpose. . For this checklist, the more questions that elicit a negative response, the higher the risk that the design model will not adequately serve its purpose.
General issues:
o Does the overall design implement all explicit requirements? Has a traceability table been developed?
設計對需求的匹配?
o Does the overall design achieve all implicit requirements?
o Is the design represented in a form that is easily understood by outsiders?
易理解?
o Is design notation standardized? Consistent?
o Does the overall design provide sufficient information for test case design?
可測試。
o Is the design created using recognizable architectural and procedural patterns?
常用的架構 和模式?
o Does the design strive to incorporate reusable components?
重用組件?
o Is the design modular?
模塊化
o Has the design defined both procedural and data abstractions that can be reused?
重用的過程 / 數據 抽象?
o Has the design been defined and represented in a stepwise fashion?
逐漸細化的表述?
o Has the resultant software architecture been partitioned for ease of implementation? Maintenance?
可部署性? 可維護性?
o Have the concepts of information hiding and functional independence been followed throughout the design?
封裝性?
o Has a Design Specification been developed for the software?
文檔?
For data design:
o Have data objected defined in the analysis model been properly translated into required data structured?
數據映射with analysis?
o Do the data structures contain all attributes defined in the analysis model?
數據屬性?
o Have any new data structures and/or attributes been defined at design time?
新的數據結構?
o How do any new data structures and/or attributes related to the analysis model and to overall user requirements?
用戶需求與數據結構匹配嗎?
o Have the simplest data structures required to do the job been chosen?
數據結構簡單嗎?
o Can the data structures be implemented directly in the programming language of choice?
編程語言適合數據結構?
o How are data communicated between software components?
軟件組件之間的數據交換?
o Do explicit data components (e.g., a database) exist? If so, what is their role?
數據庫?
For architectural design:
o Has a library of architectural styles been considered prior to the definition of the resultant software architecture?
架構模式?
o Has architectural tradeoff analysis been performed?
架構分析的tradeoff?
o Is the resultant software architecture a recognizable architectural style?
認可的架構風格?
o Has the architecture been exercised against existing usage scenarios?
架構有應用示例嗎?
o Has an appropriate mapping been used to translate the analysis model into the architectural model?
分析和架構之間的mapping?
o Can quality characteristics associated with the resultant architecture (e.g., a factored call-and-return architecture) be readily identified from information provided in the design model?
架構的質量特點?
For user interface design:
o Have the results of task analysis been documented?
o Have goals for each user task been identified?
o Has an action sequence been defined for each user task?
o Have various states of the interface been documented?
o Have objects and actions that appear within the context of the interface been defined?
o Have the three "golden rules" (SEPA, 5/e, p. 402) been maintained throughout the GUI design?
o Has flexible interaction been defined as a design criterion throughout the interface?
o Have expert and novice modes of interaction been defined?
o Have technical internals been hidden from the causal user?
o Is the on-screen metaphor (if any) consistent with the overall applications?
o Are icons clear and understandable?
o Is interaction intuitive?
o Is system response time consistent across all tasks?
o Has an integrated help facility been implemented?
o Are all error message displayed by the interface easy to understand? Do they help the user resolve the problem quickly?
o Is color being used effectively?
o Has a prototype for the interface been developed?
o Have user's impressions of the prototype been collected in an organized manner?
For component-level design:
* Have proof of correctness techniques (SEPA, 5/e, Chapter 26) been applied to all algorithms?
算法正確性?
* Has each algorithm been "desk-tested" to uncover errors? Is each algorithm correct?
算法?
* Is the design of the algorithm consistent with the data structured that the component manipulates?
算法?
* Have algorithmic design alternatives been considered? If yes, why was this design chosen?
替代算法考慮了嗎?
* Has the complexity of each algorithm been computed?
每個算法的復雜性考慮了嗎?
* Have structured programming constructs been used throughout?
結構好嗎?
西津渡最近在修改
99街購物搜索引擎,www.99jie.com
根據體會,修訂了圖解軟件項目管理一文。這是今年以來的第三次較大修訂。
有需要者請下載。
西津渡圖解軟件項目管理
下邊是目錄。
第一章 項目管理的目標
一、 產品,周期,成本的約束。
二、 關鍵路徑管理
三、 可行性分析很重要
四、 人際技巧
五、 談判技巧
第二章 項目過程
一、 計劃階段
二、 架構階段和技術攻關
三、 迭代階段
四、 結束階段
第三章 分析,形成specification
一、 最重要的是specification 發揮作用
二、 重要的創造性工作
三、 選擇適合的表達方式
四、 數據以及數據的key 和約束
五、 測試腳本
六、 Review ,評審
第四章 設計系統UI
一、 一幅圖勝過千句話
第五章 設計,code ,build ,test
第六章 部署和重構
第七章 風險
一、 分析風險
二、 技術風險
三、 所有的風險是人的風險,trust and capable
四、 記住50%以上的軟件項目以失敗告終
五、 所有的風險是管理的風險,遵循一套項目管理哲學
第八章 保持項目的進展
一、 對項目負責,做出決定
二、 讓進展可見,持續集成
三、執行,并檢查
四、 解決沖突,大家都是兄弟姐妹
五、 能擔當者是項目經理
六、 關鍵路徑的變更
第九章 總結經驗
第十章 一些效率關鍵指標
第十一章 項目管理工具
第十二章 參考
第十三章 口訣
http://www.xker.com/edu/dev/104/0652109570034579.html
十二、不要在循環中調用synchronized(同步)方法
方法的同步需要消耗相當大的資料,在一個循環中調用它絕對不是一個好主意。
例子:
import java.util.Vector;
public class SYN {
public synchronized void method (Object o) {
}
private void test () {
for (int i = 0; i < vector.size(); i++) {
method (vector.elementAt(i)); // violation
}
}
private Vector vector = new Vector (5, 5);
}
更正:
不要在循環體中調用同步方法,如果必須同步的話,推薦以下方式:
import java.util.Vector;
public class SYN {
public void method (Object o) {
}
private void test () {
synchronized{//在一個同步塊中執行非同步方法
for (int i = 0; i < vector.size(); i++) {
method (vector.elementAt(i));
}
}
}
private Vector vector = new Vector (5, 5);
}
十三、將try/catch塊移出循環
把try/catch塊放入循環體內,會極大的影響性能,如果編譯JIT被關閉或者你所使用的是一個不帶JIT的JVM,性能會將下降21%之多!
例子:
import java.io.FileInputStream;
public class TRY {
void method (FileInputStream fis) {
for (int i = 0; i < size; i++) {
try { // violation
_sum += fis.read();
} catch (Exception e) {}
}
}
private int _sum;
}
更正:
將try/catch塊移出循環
void method (FileInputStream fis) {
try {
for (int i = 0; i < size; i++) {
_sum += fis.read();
}
} catch (Exception e) {}
}
參考資料:
Peter Haggar: "Practical Java - Programming Language Guide".
Addison Wesley, 2000, pp.81 – 83
十九、不要在循環體中實例化變量
在循環體中實例化臨時變量將會增加內存消耗
例子:
import java.util.Vector;
public class LOOP {
void method (Vector v) {
for (int i=0;i < v.size();i++) {
Object o = new Object();
o = v.elementAt(i);
}
}
}
更正:
在循環體外定義變量,并反復使用
import java.util.Vector;
public class LOOP {
void method (Vector v) {
Object o;
for (int i=0;i<v.size();i++) {
o = v.elementAt(i);
}
}
}
二十一、盡可能的使用棧變量
如果一個變量需要經常訪問,那么你就需要考慮這個變量的作用域了。static? local?還是實例變量?訪問靜態變量和實例變量將會比訪問局部變量多耗費2-3個時鐘周期。
例子:
public class USV {
void getSum (int[] values) {
for (int i=0; i < value.length; i++) {
_sum += value[i]; // violation.
}
}
void getSum2 (int[] values) {
for (int i=0; i < value.length; i++) {
_staticSum += value[i];
}
}
private int _sum;
private static int _staticSum;
}
更正:
如果可能,請使用局部變量作為你經常訪問的變量。
你可以按下面的方法來修改getSum()方法:
void getSum (int[] values) {
int sum = _sum; // temporary local variable.
for (int i=0; i < value.length; i++) {
sum += value[i];
}
_sum = sum;
}
參考資料:
Peter Haggar: "Practical Java - Programming Language Guide".
Addison Wesley, 2000, pp.122 – 125
http://www.javafan.net/menu/jczs/200701/20070108185247.html
1). 簡單的認為 .append() 效率好于 "+" 是錯誤的!
2). 不要使用 new 創建 String
3). 注意 .intern() 的使用
4). 在編譯期能夠確定字符串值的情況下,使用"+"效率最高
5). 避免使用 "+=" 來構造字符串
6). 在聲明StringBuffer對象的時候,指定合適的capacity,不要使用默認值(18)
7). 注意以下二者的區別不一樣
- String s = "a" + "b";
- String s = "a";
s += "b";
關鍵點
1. 無論何時只要可能的話使用字符串字面量來常見字符串而不是使用new關鍵字來創建字符串。
2. 無論何時當你要使用new關鍵字來創建很多內容重復的字符串的話,請使用String.intern()方法。
3. +操作符會為字符串連接提供最佳的性能――當字符串是在編譯期決定的時候。
4. 如果字符串在運行期決定,使用一個合適的初期容量值初始化的StringBuffer會為字符串連接提供最佳的性能。