我的評論
re: 強大的 ant scp 和 sshexec G_G 2008-12-24 16:24
<?xml version="1.0" encoding="UTF-8"?>
<project name="ssh">
<property file="ssh.properties" />
<tstamp>
<format property="TODAY" pattern="yyyyMMddHHmm" />
</tstamp>
<property name="ssh.path" value="/data/meganotes/shell/" />
<target name="shell/ 文件 上載/覆蓋">
<input addproperty="scp_coverage_shell_file"
message="輸入(ssh/ 下文件名 \n\r 上載或覆蓋 到服務器 218 ${ssh.path} ):">
</input>
<input
message="請確定是否使用 ssh/${scp_coverage_shell_file} 覆蓋服務器中 ${ssh.host}:${ssh.path}${scp_coverage_shell_file} (y,n)"
validargs="y,n" addproperty="do.coverage" defaultvalue="n" />
<condition property="do.abort">
<equals arg1="n" arg2="${do.coverage}" />
</condition>
<fail if="do.abort">退出</fail>
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="
mkdir -p ${ssh.path}backup/${TODAY} ;
if [ -f ${ssh.path}${scp_coverage_shell_file} ] ;
then
cp ${ssh.path}${scp_coverage_shell_file} ${ssh.path}backup/${TODAY}/ ;
fi ;
">
</sshexec>
<scp file="ssh/${scp_coverage_shell_file}"
todir="${ssh.myName}:${ssh.myPass}@${ssh.host}:${ssh.path}"
trust="true" verbose="true" />
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="chmod 777 ${ssh.path}${scp_coverage_shell_file}">
</sshexec>
</target>
<target name="shell/ 文件查看">
<input addproperty="show_shell_file" message="輸入查看文件名(*sh):"
defaultvalue="*">
</input>
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="ls /data/meganotes/shell/${show_shell_file}">
</sshexec>
</target>
<target name="shell/ 文件拷貝">
<input addproperty="scp_shell_file"
message="輸入 /data/meganotes/shell/ 下需要文件名(cp 到 ssh 下):">
</input>
<scp
file="${ssh.myName}:${ssh.myPass}@${ssh.host}:/data/meganotes/shell/${scp_shell_file}"
todir="ssh" trust="true" verbose="true" />
</target>
<target name="admin-mvn組合操作">
<exec executable="cmd">
<arg value="/c" />
<arg value="${basedir}/sh/mvn/meganotes_mvn_clear.bat" />
</exec>
<exec executable="cmd">
<arg value="/c" />
<arg value="${basedir}/sh/mvn/meganotes_mvn_install.bat" />
</exec>
<exec executable="cmd">
<arg value="/c" />
<arg value="${basedir}/sh/mvn/mn_mod_admin_mvn_intall.bat" />
</exec>
</target>
<target name="admin-tomcat日志">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true" command="${ssh.adminRunLog}">
</sshexec>
</target>
<target name="schedule-tomcat日志">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="${ssh.scheduleRunLog}">
</sshexec>
</target>
<target name="查找2008/下Mp3沒轉128-64文件夾">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true" command="${ssh.64k}">
</sshexec>
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true" command="${ssh.128k}">
</sshexec>
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="${ssh.128kto64k.err}">
</sshexec>
</target>
<target name="admin模塊測試">
<input addproperty="admin_test_input"
message="測試類輸入(Video*Test):" defaultvalue="*Test">
</input>
<echo message="${admin_test_input}"></echo>
<exec executable="cmd">
<arg value="/c" />
<arg
value="${basedir}/sh/admin_test.bat ${admin_test_input} " />
</exec>
</target>
</project>
re: 2008-9-23 E G_G 2008-09-26 09:43
offers 提出
integration 綜合
extendsive 寬廣
standard 標準
integration 綜合
extendsive 寬廣
standard 標準
re: 支付寶終于支持Firefox了 G_G 2008-09-15 18:55
終于連 虛擬機里的 windows 也可以不要了
re: 基于Ext的WebIM全面更新,歡迎體驗 G_G 2008-08-28 09:26
不支持 Linux 上瀏覽器 FireFox ; Opera。。
re: java regex 正則部分高級特性使用 G_G 2008-08-11 18:21
匹配多行
public class Main {
public static void main(String[] args) {
String str = "<html>\r\n" +
"<body>\n" +
"<h1>title</h1>\r\n" +
"<h2>title2</h2>\r\n" +
"</body>\r\n" +
"</html>\n";
Pattern pattern = Pattern.compile("<body>[\\S\\s]*?</body>");
Matcher matcher = pattern.matcher(str);
while( matcher.find()){
System.out.println("______________");
System.out.println( matcher.group() );
}
}
}
結果:
______________
<body>
<h1>title</h1>
<h2>title2</h2>
</body>
http://www.codepub.com/info/2007/02/info-11598-6.html參考
public class Main {
public static void main(String[] args) {
String str = "<html>\r\n" +
"<body>\n" +
"<h1>title</h1>\r\n" +
"<h2>title2</h2>\r\n" +
"</body>\r\n" +
"</html>\n";
Pattern pattern = Pattern.compile("<body>[\\S\\s]*?</body>");
Matcher matcher = pattern.matcher(str);
while( matcher.find()){
System.out.println("______________");
System.out.println( matcher.group() );
}
}
}
結果:
______________
<body>
<h1>title</h1>
<h2>title2</h2>
</body>
http://www.codepub.com/info/2007/02/info-11598-6.html參考
re: 發布一個Blogjava備份數據的閱讀器 G_G 2008-08-05 15:06
不頂 不行
謝謝了
謝謝了
re: 極簡風格Web架構,jsp+jdbc的二次復辟 G_G 2008-07-31 15:26
支持下
不敢使用 jdbc 的人
jdbc4.0 已經很強大了 ;我們應該直面 她
Java SE 6中的JDBC 4.0增強
http://dev2dev.bea.com.cn/techdoc/20061025892.html
不敢使用 jdbc 的人
jdbc4.0 已經很強大了 ;我們應該直面 她
Java SE 6中的JDBC 4.0增強
http://dev2dev.bea.com.cn/techdoc/20061025892.html
re: 一道題面試題! G_G 2008-07-31 10:22
謝謝提醒
我收集到 int[] iis 數據后直接返回 !
不過 我使用的 Map,Collection 只是為 返回后 的使用方便哦!
最核心的 循環體內 是使用基本數據類型 ,還是 單元操作
if(
( itmp >=int_a && itmp<=int_z ) ||
( itmp>=int_A && itmp<=int_Z ) | (itmp=(itmp+(int_a-int_A)))>=int_a
){
iis[itmp-int_a]++ ;
}
當了也是出于私心 秀下 自己對 jdk 的了解了 ^_^
我收集到 int[] iis 數據后直接返回 !
不過 我使用的 Map,Collection 只是為 返回后 的使用方便哦!
最核心的 循環體內 是使用基本數據類型 ,還是 單元操作
if(
( itmp >=int_a && itmp<=int_z ) ||
( itmp>=int_A && itmp<=int_Z ) | (itmp=(itmp+(int_a-int_A)))>=int_a
){
iis[itmp-int_a]++ ;
}
當了也是出于私心 秀下 自己對 jdk 的了解了 ^_^
re: 中國男兒應該學習的對象 G_G 2008-07-30 11:32
有點感觸 !
re: SQL語句性能調整原則 G_G 2008-07-24 09:45
拜讀
謝謝了
謝謝了
re: 我的 ssh demo G_G 2008-06-27 09:44
文件下載路徑以修改
re: Html Parse 最佳實踐 G_G 2008-06-19 14:09
同意上樓 說的
re: Hibernate 級聯添加刪除 G_G 2008-06-16 16:05
你參考下此文檔 第2點第一條
Hibernate 數據庫設計_1
Hibernate 數據庫設計_1
re: hibernate 多服務器數據同步問題(支持延遲同步)[未登錄] G_G 2008-04-17 09:51
在此我還沒用 spring
不 好意思
不 好意思
re: 權限設計的探討閱讀后感 G_G 2008-04-14 09:20
@一農
謝謝提醒!
謝謝提醒!
re: 分頁查詢+hbn G_G 2008-03-12 13:58
re: 設計測試用例的目的 -- 個人觀點[未登錄] G_G 2008-03-04 00:11
@Slipper Feng
軟件質量是做出來的,不是測出來的!!
軟件質量是做出來的,不是測出來的!!
re: 解析Java Class文件格式 G_G 2008-01-30 09:23
占個位置 等!!!
re: 改變開發方式的 hbm+rmic[未登錄] G_G 2007-12-26 09:23
@隔葉黃鶯
謝謝提醒
謝謝提醒
re: 改變開發方式的 hbm+rmic G_G 2007-12-24 18:30
對于剛接觸 EJB 的我 來說
這原理的 使用 還是 很吸引 我的
@隔葉黃鶯
我們位置不同吧!你可能已經一大牛了
呵呵
這原理的 使用 還是 很吸引 我的
@隔葉黃鶯
我們位置不同吧!你可能已經一大牛了
呵呵
re: 什么是人才?[未登錄] G_G 2007-12-15 13:02
沒什么話說
對我們繁華的80年 是一次很好的教育
感謝
對我們繁華的80年 是一次很好的教育
感謝
re: EJB小例 G_G 2007-12-05 16:23
大哥說:
Skynet :
RemoteBinding 那他的用途是什么?
☆藍藍心情★ 16:19:57
Jboss的對JPA的實現采用Hibernate,而其他的公司,如bea,sun等的實現采用的oracle公司的 toplink
Skynet 16:20:02
RemoteBinding 那他的用途是什么?
☆藍藍心情★ 16:20:22
你以前搞過Hibernate,就到jboss的JPA實現上展示下身手
☆藍藍心情★ 16:20:35
設置遠程JNDI名字
☆藍藍心情★ 16:20:57
所以客戶端在通過JNDI lookup的時候,用的就是這個名字
☆藍藍心情★ 16:21:33
不同中間件的實現,默認JNDI名字是不一樣的,所以不一定是***/Remote或***/Local
☆藍藍心情★ 16:22:00
相當于我們今天RMI的那個serviceName一樣
☆藍藍心情★ 16:22:07
bind方法的參數
Skynet :
RemoteBinding 那他的用途是什么?
☆藍藍心情★ 16:19:57
Jboss的對JPA的實現采用Hibernate,而其他的公司,如bea,sun等的實現采用的oracle公司的 toplink
Skynet 16:20:02
RemoteBinding 那他的用途是什么?
☆藍藍心情★ 16:20:22
你以前搞過Hibernate,就到jboss的JPA實現上展示下身手
☆藍藍心情★ 16:20:35
設置遠程JNDI名字
☆藍藍心情★ 16:20:57
所以客戶端在通過JNDI lookup的時候,用的就是這個名字
☆藍藍心情★ 16:21:33
不同中間件的實現,默認JNDI名字是不一樣的,所以不一定是***/Remote或***/Local
☆藍藍心情★ 16:22:00
相當于我們今天RMI的那個serviceName一樣
☆藍藍心情★ 16:22:07
bind方法的參數
re: dojo0.9學習(1)--dojo.declare G_G 2007-12-05 16:11
哦 謝謝提醒
re: EJB原理學習_RMIC G_G 2007-12-05 15:41
在次感謝 ‘☆藍藍心情★’ 細心的幫助
re: hibernate 多服務器數據同步問題(支持延遲同步) G_G 2007-12-05 10:27
@TonySoft
哦 是數據同步
開源數據同步框架!能說的具體點嗎?
我先在知道的就只有EJB但好想不是開元等級的 !
哦 是數據同步
開源數據同步框架!能說的具體點嗎?
我先在知道的就只有EJB但好想不是開元等級的 !
re: hibernate 多服務器數據同步問題(支持延遲同步) G_G 2007-12-04 10:05
re: hibernate 多服務器數據同步問題(支持延遲同步) G_G 2007-12-03 22:17
代碼 我一定在明天 給出
這就 獻丑了
這就 獻丑了
re: 測試 servlet(轉) G_G 2007-11-16 15:37
re: StrutsTestCase 不需要 寫 classpath 方法 ^_^ G_G 2007-11-09 17:20
你可以用
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
new File(
classLoader.get URL 什么方法名字不太記的了
);
寫邏輯名就可以如你的:
/WebRoot/WEB-INF/web.xml
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
new File(
classLoader.get URL 什么方法名字不太記的了
);
寫邏輯名就可以如你的:
/WebRoot/WEB-INF/web.xml
re: StrutsTestCase 不需要 寫 classpath 方法 ^_^ G_G 2007-11-09 17:16
@李泳
不是怎么理解的你的io操作!不要寫物理路徑。
我告訴你一種方法
這通過Classload來加載 寫邏輯路徑 就沒有這什么考慮的了
可以參考我blog里的介紹
http://www.aygfsteel.com/Good-Game/archive/2007/08/09/128154.html
中的 hbn 加載文件
不是怎么理解的你的io操作!不要寫物理路徑。
我告訴你一種方法
這通過Classload來加載 寫邏輯路徑 就沒有這什么考慮的了
可以參考我blog里的介紹
http://www.aygfsteel.com/Good-Game/archive/2007/08/09/128154.html
中的 hbn 加載文件
re: dom4j 學習 G_G 2007-11-09 17:13
@姜利陽
都是 jdk中xml的包裝類 dom4j 和 jdom (我jdom沒太看呵呵)
都是 jdk中xml的包裝類 dom4j 和 jdom (我jdom沒太看呵呵)
re: CGLib 學習 G_G 2007-11-09 17:11
@雨奏
限制或副作用到沒感覺到
但功能明顯太單薄了
和aspectj沒的比 切入表達式 的aspectj 和只可以硬編碼的切CGlib
的功能用下就知道 CGlib 太簡單了
但他好用,好上手,給5分鐘就上了
aspectj 我花了2星期才到理解程度 呵呵
限制或副作用到沒感覺到
但功能明顯太單薄了
和aspectj沒的比 切入表達式 的aspectj 和只可以硬編碼的切CGlib
的功能用下就知道 CGlib 太簡單了
但他好用,好上手,給5分鐘就上了
aspectj 我花了2星期才到理解程度 呵呵
re: dom4j 學習 G_G 2007-11-06 17:59
謝謝
re: 我的編碼設計(利用junit設計) G_G 2007-10-26 17:48
(轉)@拋出異常的愛 經典的說:
測試就是分解后的需求
。。。。。
如果需求變了找到這些測試修改之
。。。。。
需求變更的過程就是不停的修改測試用例的過程
如何寫一個可用的測試?
1.一般例
2.特例
3.可能出現的特例但現在沒有提出來的,不必寫測試
4.不可能出現的特例 拋異常(就是你說的那兩種卡)。
寫測試之前要先把你說的圖畫出來
測試是文檔化,可自動檢查的圖形。
用人的眼睛來比較圖與代碼的區別,
那是上世紀的活,這個世紀不用了。
測試就是分解后的需求
。。。。。
如果需求變了找到這些測試修改之
。。。。。
需求變更的過程就是不停的修改測試用例的過程
如何寫一個可用的測試?
1.一般例
2.特例
3.可能出現的特例但現在沒有提出來的,不必寫測試
4.不可能出現的特例 拋異常(就是你說的那兩種卡)。
寫測試之前要先把你說的圖畫出來
測試是文檔化,可自動檢查的圖形。
用人的眼睛來比較圖與代碼的區別,
那是上世紀的活,這個世紀不用了。
re: cell報表學習(一) G_G 2007-10-26 09:42
呵呵 我們公司也是用這個
用了一年了 呵呵
用了一年了 呵呵
re: 魔鬼也覺得悲哀 G_G 2007-10-22 15:20
*_*!
離我好近的地方啊
離我好近的地方啊
re: AOP 學習筆記 G_G 2007-10-18 18:16
我會邊學習邊記錄的
re: Google宕機了? G_G 2007-10-15 17:02
我遇到 有許多次了
re: 技術挑戰——根據編碼函數寫出解碼函數 G_G 2007-10-12 17:16
等 等
java 好象是 16 為是吧
那第一句的
int j1 = abyte0[l++] & 0xff;
只 給 后 面 8位與 前面的補0 也與
!@#$%
這怎么反 啊
等結果
java 好象是 16 為是吧
那第一句的
int j1 = abyte0[l++] & 0xff;
只 給 后 面 8位與 前面的補0 也與
!@#$%
這怎么反 啊
等結果
re: 技術挑戰——根據編碼函數寫出解碼函數 G_G 2007-10-12 17:03
呵呵 解碼 G_G
這也被你整出來 !·#¥%……
仔細看了下
// 這好說 與 111.... 到時候 不變 到 j1
// 還真玩人
int j1 = abyte0[l++] & 0xff;
//k1 ,l1 得到 0 或 abyte0[l++]
int k1 = l >= i ? 0 : abyte0[l++] & 0xff;
int l1 = l >= i ? 0 : abyte0[l++] & 0xff;
// >>> ??什么東西 難道是 j1>> (>>2) ?
//>> 是 和 除 /2 有點同 1101 >> 0110 : 1
int i2 = j1 >>> 2;
// ....... (無語)
int j2 = (j1 & 3) << 4 | k1 >>> 4;
int k2 = (k1 & 0xf) << 2 | l1 >>> 6;
int l2 = l1 & 0x3f;
//靜態塊中定義的 cChar 定義的 什么 A..Z 9..0 a..z
ac[i1++] = cChar[i2];
ac[i1++] = cChar[j2];
// ..... 外頭的 l1 還是 不好好一步一步走的 !·#¥%……
ac[i1] = i1 >= j ? '=' : cChar[k2];
i1++;
ac[i1] = i1 >= j ? '=' : cChar[l2];
看來 我 好好當代碼工人把 (有點不干啊 )
這也被你整出來 !·#¥%……
仔細看了下
// 這好說 與 111.... 到時候 不變 到 j1
// 還真玩人
int j1 = abyte0[l++] & 0xff;
//k1 ,l1 得到 0 或 abyte0[l++]
int k1 = l >= i ? 0 : abyte0[l++] & 0xff;
int l1 = l >= i ? 0 : abyte0[l++] & 0xff;
// >>> ??什么東西 難道是 j1>> (>>2) ?
//>> 是 和 除 /2 有點同 1101 >> 0110 : 1
int i2 = j1 >>> 2;
// ....... (無語)
int j2 = (j1 & 3) << 4 | k1 >>> 4;
int k2 = (k1 & 0xf) << 2 | l1 >>> 6;
int l2 = l1 & 0x3f;
//靜態塊中定義的 cChar 定義的 什么 A..Z 9..0 a..z
ac[i1++] = cChar[i2];
ac[i1++] = cChar[j2];
// ..... 外頭的 l1 還是 不好好一步一步走的 !·#¥%……
ac[i1] = i1 >= j ? '=' : cChar[k2];
i1++;
ac[i1] = i1 >= j ? '=' : cChar[l2];
看來 我 好好當代碼工人把 (有點不干啊 )
re: hbn 筆記 G_G 2007-10-12 16:21
Configuration ->
//方法 doConfigure 有 dom4j用法
protected Configuration doConfigure(org.dom4j.Document doc)
//方法 doConfigure 有 dom4j用法
protected Configuration doConfigure(org.dom4j.Document doc)
re: jsp頁面 模塊化 (top+left+center)格式 G_G 2007-10-12 10:14
javascript 定義到 一個js中
后 幾個jsp 共用 這個 js
后 幾個jsp 共用 這個 js
re: 整理近幾天處理JSP頁面中遇到的幾個問題 G_G 2007-10-10 15:07
呵呵
好實在的程序員啊
G_G
好實在的程序員啊
G_G
re: hbn 筆記 G_G 2007-10-10 10:57
hbn 加載文件
ConfigHelper.getResourceAsStream
public static InputStream getResourceAsStream(String resource) {
String stripped = resource.startsWith("/") ?
resource.substring(1) : resource;
InputStream stream =null;
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if (classLoader!=null) {
stream = classLoader.getResourceAsStream( stripped );
}
if ( stream ==null ) {
Environment.class.getResourceAsStream( resource );
}
if ( stream ==null ) {
stream = Environment.class.getClassLoader().getResourceAsStream( stripped );
}
if ( stream ==null ) {
thrownew HibernateException( resource +" not found" );
}
return stream;
}
re: hbn 筆記 G_G 2007-10-10 10:50
源碼分析
在 Factory中
private static final ThreadLocal threadLocal = new ThreadLocal();
的使用 可以參考
http://www.java3z.com/cwbwebhome/article/article2a/275.jsp?id=324
線程安全
Session session = (Session) threadLocal.get();
if (session == null) {
if (sessionFactory == null) {
try {
cfg.configure(CONFIG_FILE_LOCATION);
sessionFactory = cfg.buildSessionFactory();
}
catch (Exception e) {
System.err.println("%%%% Error Creating SessionFactory %%%%");
e.printStackTrace();
}
}
session = sessionFactory.openSession();
threadLocal.set(session);
}
return session;
在 Factory中
private static final ThreadLocal threadLocal = new ThreadLocal();
的使用 可以參考
http://www.java3z.com/cwbwebhome/article/article2a/275.jsp?id=324
線程安全
Session session = (Session) threadLocal.get();
if (session == null) {
if (sessionFactory == null) {
try {
cfg.configure(CONFIG_FILE_LOCATION);
sessionFactory = cfg.buildSessionFactory();
}
catch (Exception e) {
System.err.println("%%%% Error Creating SessionFactory %%%%");
e.printStackTrace();
}
}
session = sessionFactory.openSession();
threadLocal.set(session);
}
return session;
re: 讓 java 動態 G_G 2007-10-10 09:28
@Unmi
謝謝提醒
謝謝提醒
re: Bean_to_Bean 賦值完整解決(可用在實際開發) G_G 2007-09-29 12:05
謝謝提醒
re: 原創小框架: 動態面向對象數據庫操作(不要影射類哦) G_G 2007-09-21 15:47
^_^
re: 原創小框架: 動態面向對象數據庫操作(不要影射類哦) G_G 2007-09-21 15:08
我希望有人 和我一起把這個小東西 弄成個 開元框架