隨筆 - 175  文章 - 202  trackbacks - 0
          <2025年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          第一個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();

          序列化結(jié)果

          <?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 內(nèi)容反序列化

          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 進(jìn)程啟動在固定的端口上,分別為 1099 和 8080 ,每次殺掉這兩個進(jìn)程的時候,就手動的執(zhí)行 netstat -anp | grep 1099 和 netstat -anp | grep 8080 ,看到進(jìn)程號,把他們殺掉,然后重啟。

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

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

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

          遺留問題:
          ???解決問題時,還 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 哈哈的日子 閱讀(435) | 評論 (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 會自動創(chuàng)建。

          最后

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

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

          在 CruiseControl 中需要監(jiān)測 ClearCase 中的變化,以便在變化時進(jìn)行構(gòu)建動作。

          配置如下:

          <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 會每次調(diào)用

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

          這個命令去監(jiān)測 ClearCase 的變化

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


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

          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 中設(shè)置的,可以查看代碼。

          ?

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

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

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

          盲點,軟件做了這么久了,對這些最基本的東西還是沒有深刻的理解,早該學(xué)習(xí)了,再玩就要餓死了。
          posted @ 2007-01-01 09:12 哈哈的日子 閱讀(175) | 評論 (0)編輯 收藏
          僅列出標(biāo)題
          共17頁: First 上一頁 9 10 11 12 13 14 15 16 17 下一頁 
          主站蜘蛛池模板: 茂名市| 大姚县| 武夷山市| 泾源县| 邛崃市| 溧水县| 侯马市| 松潘县| 安丘市| 星座| 东阳市| 定结县| 伽师县| 黑山县| 交口县| 鱼台县| 北海市| 扶余县| 扎鲁特旗| 凤阳县| 吴桥县| 库尔勒市| 屏东县| 射洪县| 内黄县| 三门县| 温泉县| 云龙县| 广德县| 乃东县| 当阳市| 青河县| 长宁县| 凌海市| 民勤县| 绵竹市| 大冶市| 宜春市| 陕西省| 平乡县| 穆棱市|