隨筆 - 175  文章 - 202  trackbacks - 0
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          第一個Blog,記錄哈哈的生活

          常用鏈接

          留言簿(16)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          收藏夾

          Java links

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          通過 XMLEncoder 可以將 JavaBean 序列化為 XML 形式

          String?file?=?"D:/temp/a.obj";
          FileOutputStream?fos?
          =?new?FileOutputStream(file);
          XMLEncoder?encoder?
          =?new?XMLEncoder(fos);
          encoder.writeObject(a);
          encoder.flush();
          encoder.close();
          fos.close();

          序列化結果

          <?xml?version="1.0"?encoding="UTF-8"?>?
          <java?version="1.4.2_08"?class="java.beans.XMLDecoder">?
          ?
          <object?class="A">?
          ??
          <void?property="a">?
          ???
          <string>a</string>?
          ??
          </void>?
          ??
          <void?property="b">?
          ???
          <object?class="B">?
          ????
          <void?property="e">?
          ?????
          <string>e</string>?
          ????
          </void>?
          ????
          <void?property="f">?
          ?????
          <string>f</string>?
          ????
          </void>?
          ???
          </object>?
          ??
          </void>?
          ??
          <void?property="c">?
          ???
          <string>c</string>?
          ??
          </void>?
          ??
          <void?property="d">?
          ???
          <string>d</string>?
          ??
          </void>?
          ?
          </object>?
          </java>?

          通過 XMLDecoder 來將 XML 內容反序列化

          String?file?=?"D:/temp/a.obj";
          FileInputStream?fis?
          =?new?FileInputStream(file);
          XMLDecoder?decoder?
          =?new?XMLDecoder(fis);
          A?obj?
          =?(A)?decoder.readObject();
          fis.close();
          System.out.println(obj);
          posted @ 2007-01-16 17:27 哈哈的日子 閱讀(714) | 評論 (0)編輯 收藏

          起因:
           CruiseControl 與 JBoss 進程啟動在固定的端口上,分別為 1099 和 8080 ,每次殺掉這兩個進程的時候,就手動的執行 netstat -anp | grep 1099 和 netstat -anp | grep 8080 ,看到進程號,把他們殺掉,然后重啟。

          郁悶:
          ???但這樣實在是太麻煩了,每天調試程序,重啟 n 遍,看得我眼睛都花了。想辦法自動殺死。

          解決部分:
          ???想起了當初使用 awk 命令得到進程號,有了進程號,不就可以 kill -9 干掉他了!快樂,開始找 awk 命令用法,google 了一下,可以使用 netstat -anp | grep 1099 | gawk '{print substr($7,0,index($7,"/java")-1)}' 命令得到我想要的進程號,但說什么都不能對這個進程號運行 kill -9 ,再找!

          解決問題:
          ???google 了一下,可以使用
          ???kill -9 `netstat -anp | grep 1099 | gawk '{print substr($7,0,index($7,"/java")-1)}'`
          ???果然好用!
          ???想起了使用過的 cd = `pwd` 原來 ` 號包圍起來的命令可以執行,并放在相應位置上。

          遺留問題:
          ???解決問題時,還 google 到,可以使用 netstat -anp | grep 1099 | gawk '{print substr($7,0,index($7,"/java")-1)}' | xargs?-t?-i?kill?-9?{} 來完成,需要了解管道符號的作用了。

          posted @ 2007-01-16 10:18 哈哈的日子 閱讀(433) | 評論 (0)編輯 收藏
          svn 支持多個版本庫的管理,可以將不同部門,不同項目組的代碼庫同時管理。

          比如:

          建立代碼庫根目錄 repos

          在其中建立 dept1 , dept2

          repos
          ├─dept1
          └─dept2

          在 dept1 中建立 proj1 , proj2
          在 dept2 中建立 proj3 , proj4

          repos
          ├─dept1
          │? ├─proj1
          │? └─proj2
          └─dept2
          ??? ├─proj3
          ??? └─proj4

          然后運行

          svnadmin create repos/dept1/proj1
          svnadmin create repos/dept1/proj2
          svnadmin create repos/dept2/proj3
          svnadmin create repos/dept2/proj4

          ps:實際上 proj1-proj4 可以不建,svnadmin create 會自動創建。

          最后

          svnserve -d -r repos 或使用 apache 就可以了

          使用 svn://IP/dept1/proj1 或 http://IP/dept/proj1 可以訪問
          posted @ 2007-01-15 11:41 哈哈的日子 閱讀(913) | 評論 (0)編輯 收藏
               摘要:   閱讀全文
          posted @ 2007-01-11 09:45 哈哈的日子 閱讀(431) | 評論 (0)編輯 收藏
               摘要: 一.安裝subversion
          二.建立Repository(保存文檔各個版本的數據庫)
          三.配置Repository
          四.啟動subversion服務器
          五.客戶端的使用   閱讀全文
          posted @ 2007-01-10 16:39 哈哈的日子 閱讀(495) | 評論 (0)編輯 收藏

          在 CruiseControl 中需要監測 ClearCase 中的變化,以便在變化時進行構建動作。

          配置如下:

          <modificationset quietperiod="5">
          ??????<clearcase branch="dev_ct2.0" viewpath="D:\temp\cruisecontrol-bin-2.5 view\hello\group_ct\temp\test_project\hello" />
          <modificationset>

          CruiseControl 會每次調用

          cleartool lshistory -branch dev_ct2.0 -r -nco -since 10-一月-2007.09:59:23 -fmt %u#~#%Nd#"~#%En#~#%Vn#~#%o#~#!%l#~#!%a#~#%Nc@#@#@#@#@#@#@#@#@#@#@#@

          這個命令去監測 ClearCase 的變化

          其中?dev_ct2.0 與配置的 branch?一致 -since 后面的時間保存在 listeners 中,默認一般為 status.txt 中


          ps:有個問題就是這個命令不會監測沒有在 View 中的文件的變化,也就是說,只在 ClearCase 根目錄(因為其它目錄中增加ClearCase認為目錄變化,會監測到)中增加文件而沒有更改文件,這個命令認為沒有變化!

          posted @ 2007-01-10 10:53 哈哈的日子 閱讀(817) | 評論 (1)編輯 收藏

          如果是 jar 包,在 Plugin 中配置

          <build>
          ? <plugins>
          ??? <plugin>
          ????? <groupId>org.apache.maven.plugins</groupId>
          ????? <artifactId>maven-jar-plugin</artifactId>
          ????? <configuration>
          ??????? <archive>
          ????????? <addMavenDescriptor>false</addMavenDescriptor>
          ??????? </archive>
          ????? </configuration>
          ??? </plugin>
          ? </plugins>
          </build>

          如果是 war 包,在 Plugin 中配置

          <build>
          ? <plugins>
          ??? <plugin>
          ????? <groupId>org.apache.maven.plugins</groupId>
          ????? <artifactId>maven-war-plugin</artifactId>
          ????? <configuration>
          ??????? <archive>
          ????????? <addMavenDescriptor>false</addMavenDescriptor>
          ??????? </archive>
          ????? </configuration>
          ??? </plugin>
          ? </plugins>
          </build>

          這個是在 maven-archiver 中設置的,可以查看代碼。

          ?

          posted @ 2007-01-04 20:37 哈哈的日子 閱讀(4459) | 評論 (0)編輯 收藏

          ?public static String getSystemEnv(String name) {
          ??final String perfix = "env";
          ??Project project = new Project();
          ??Property property = new Property();
          ??property.setProject(project);
          ??property.setEnvironment(perfix);
          ??property.execute();
          ??return project.getProperty(perfix + "." + name);
          ?}

          同樣可以利用這個方法處理 properties 文件中 ${} 引用。

          posted @ 2007-01-04 14:14 哈哈的日子 閱讀(193) | 評論 (0)編輯 收藏
               摘要:   閱讀全文
          posted @ 2007-01-04 07:58 哈哈的日子 閱讀(280) | 評論 (0)編輯 收藏
          規格說明是必不可少的,我理解 Scrum 中的 UserStory 就是規格的一部分,但規格還包含了更多的東西,比如部分的需求,在華為的時候,需求是在規格之前的,分成不同的文檔寫成,不知道在 Scrum 中,是如何來描述需求的,是否是在 UserStory 中一并完成了?

          進度表一章最大的感覺就是那段塞木塊,要么增大盒子,要么丟掉木塊。有了進度表,就給了你這樣的選擇。

          目前的項目中,這兩個東西都是沒有的,一是導致進度延遲看不到,二是心里沒底,人心惶惶。

          盲點,軟件做了這么久了,對這些最基本的東西還是沒有深刻的理解,早該學習了,再玩就要餓死了。
          posted @ 2007-01-01 09:12 哈哈的日子 閱讀(174) | 評論 (0)編輯 收藏
          僅列出標題
          共17頁: First 上一頁 9 10 11 12 13 14 15 16 17 下一頁 
          主站蜘蛛池模板: 沈阳市| 隆回县| 襄汾县| 永胜县| 武冈市| 章丘市| 永登县| 深州市| 屏南县| 色达县| 察雅县| 诏安县| 汶上县| 贺州市| 虞城县| 阳春市| 水城县| 蓬莱市| 九江市| 上杭县| 图片| 久治县| 安岳县| 岳阳县| 东乌珠穆沁旗| 贵州省| 卢湾区| 旬阳县| 滕州市| 合阳县| 仙游县| 曲松县| 建平县| 陆丰市| 西畴县| 孝义市| 县级市| 博客| 赣榆县| 祁阳县| 望城县|