lyyb2001

          只是為方便自己找記錄而已
          posts - 57, comments - 27, trackbacks - 0, articles - 5
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 ::  :: 管理

          @import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); @import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); 在/Library/LaunchDaemons下
          新建svn.sh,內容如下

          /usr/bin/svnserve -d -r /Users/YingBo/svn/repository


          chmod +x svn.sh


          新建com.skycity.svn.plist,內容如下

          <?xml version="1.0" encoding="UTF-8"?>  

          <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

          <plist version="1.0">

            <dict>

              <key>KeepAlive</key>

              <true/>

              <key>Label</key>

              <string>com.skycity.svn</string>

              <key>ProgramArguments</key>

              <array>

              <string>/Library/LaunchDaemons/svn.sh</string>

              </array>

            </dict>

          </plist>


          設置開機自動啟動

           sudo launchctl load -w /Library/LaunchDaemons/com.skycity.svn.plist


          設置開機不自動啟動

           sudo launchctl unload -w /Library/LaunchDaemons/com.skycity.svn.plist

          posted @ 2015-03-27 10:36 skycity 閱讀(172) | 評論 (0)編輯 收藏

          查看當前java版本
          $ java -version

          java version "1.8.0_25"

          Java(TM) SE Runtime Environment (build 1.8.0_25-b17)

          Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

          $ which java
          /usr/bin/java

          $ ls -l /usr/bin/java

          lrwxr-xr-x  1 root  wheel  74 12 26 10:24 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java


          ls -l /System/Library/Frameworks/JavaVM.framework/Versions/

          total 64

          lrwxr-xr-x  1 root  wheel   10 12 26 10:24 1.4 -> CurrentJDK

          lrwxr-xr-x  1 root  wheel   10 12 26 10:24 1.4.2 -> CurrentJDK

          lrwxr-xr-x  1 root  wheel   10 12 26 10:24 1.5 -> CurrentJDK

          lrwxr-xr-x  1 root  wheel   10 12 26 10:24 1.5.0 -> CurrentJDK

          lrwxr-xr-x  1 root  wheel   10 12 26 10:24 1.6 -> CurrentJDK

          lrwxr-xr-x  1 root  wheel   10 12 26 10:24 1.6.0 -> CurrentJDK

          drwxr-xr-x  8 root  wheel  272 12 26 14:10 A

          lrwxr-xr-x  1 root  wheel    1 12 26 10:24 Current -> A

          lrwxr-xr-x  1 root  wheel   59 12 26 10:24 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents


          由此可知,當前java所對應的文件是/System/Library/Frameworks/JavaVm.Framework/Vesions/A/Commons/java

           /System/Library/Frameworks/JavaVM.framework/Versions/下的jdk 1.4-1.6的版本,全部指向/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

          posted @ 2015-03-20 10:24 skycity 閱讀(288) | 評論 (0)編輯 收藏

          yum remove ibus* yum remove scim* yum install fcitx fcitx-table fcitx-table-chinese fcitx-pinyin

          posted @ 2015-03-20 09:42 skycity 閱讀(117) | 評論 (0)編輯 收藏

          有這樣一個串
          Read([SQLServer#10.5.219.21#mas_db],[select * from material where machine_seq='!dbo.repair.machine_seq' and b='@@dbo.test.cc' and c='!!dbo.test.dd' and d='@dbo.repair' and e='sd.bf' and f='@aa.bg' and g='#dbo.repair.machine_name' and h=@dbo.repair.owner],[en_US])
          需要解析中間的select * from material where machine_seq='!dbo.repair.machine_seq' and b='@@dbo.test.cc' and c='!!dbo.test.dd' and d='@dbo.repair' and e='sd.bf' and f='@aa.bg' and g='#dbo.repair.machine_name' and h=@dbo.repair.owner
          還需要滿足'@@','@','!'(前后包含單引號),的變量取出來
          @schema.table.fieldName     @dbo.repair.machine_seq要點:獲取界面上某個控件錄入的值;
          #schema.table     #dbo.reapir要點:獲取這個表的記錄行數;
          !schema.table.fieldName   !dbo.repair.qty要點:統計dbo.repair表qty總和. 相當于Sum(qty)性質.
          @@constName   @@User_ID要點:獲取內存變量值;

          實現如下:
          package com.lenovo.nabf.util;

          import java.util.ArrayList;
          import java.util.List;
          import java.util.regex.Matcher;
          import java.util.regex.Pattern;

          public class NabfUtilTest {
              public static final Pattern PatternSql = Pattern.compile("\\'(([#!]{1}|[@]{1,2})[\\w\\.]+?)\\'"); // match '@dbo.repair.machine_seq'
              public static final Pattern PatternReadString = Pattern.compile(".+?,\\[([\\w\\.\\s{*!@#=\'}]+?)\\],.+?");  //match Read([db],[sqlstring],[lang])得到sqlstring的值
              public static void main(String args[]){
                   String readString="Read([SQLServer#10.5.219.21#mas_db],[select * from material where "
                      + "machine_seq='!dbo.repair.machine_seq' and b='@@dbo.test.cc' "
                      + "and c='!!dbo.test.dd' and d='@dbo.repair' and e='sd.bf' and f='@aa.bg' "
                      + "and g='#dbo.repair.machine_name' and h=@dbo.repair.owner],[en_US])"; 
                  System.out.println(readString);
                  System.out.println(analysisReadStr(readString));
                  List list=NabfUtil.getRegexMatchedList(readString);
                  for(String s:list){
                       System.out.println(s);
                  }
                  String sqlString = NabfUtil.getStringByAnalysisReadString(readString);
                  System.out.println(sqlString);
              } 
              public static ArrayList getRegexMatchedList(String readString){
                  String sqlString = analysisReadStr(readString);
                  ArrayList matchList=new ArrayList();
                  Matcher matcher = PatternSql.matcher(sqlString);
                  int lastEndIndex = 0;
                  while (matcher.find(lastEndIndex)) {
                      matchList.add(matcher.group(1));
                      lastEndIndex = matcher.end();
                  }
                  return matchList;
              }
              public static String getStringByAnalysisReadString(String readString){
                  String sqlString = analysisReadStr(readString);
                  Matcher matcher = PatternSql.matcher(sqlString);
                  StringBuilder sb = new StringBuilder();
                  int lastEndIndex = 0;
                  while (matcher.find(lastEndIndex)) {
                      sb.append(sqlString.substring(lastEndIndex, matcher.start()));
                      lastEndIndex = matcher.end();
                  }
                  sb.append(sqlString.substring(lastEndIndex));
                  return sb.toString();
              }
              private static String analysisReadStr(String readString){
                  Matcher matcher = PatternReadString.matcher(readString);
                  int lastEndIndex = 0;
                  String sqlString="";
                  while (matcher.find(lastEndIndex)) {
                           sqlString=matcher.group(1);
                           lastEndIndex = matcher.end();
                  }
                  return sqlString;
             }
          }

          posted @ 2015-03-20 09:41 skycity 閱讀(221) | 評論 (0)編輯 收藏

          JDepend 一個開放源代碼的可以用來評價Java程序質量的優秀工具,它遍歷Java class的文件目錄,以Java包(package)為單位,為每一個包/類自動生成 包的依賴程度,穩定性,可靠度等的評價報告,根據這些報告,我們可以得到包或類之間的依賴關系,并分析出包的穩定程度,抽象程度,是否存在循環依賴關系 等。
          我們可以根據JDepend給出的報告數據,分析出我們的包是否是可靠的,穩定的,健壯的包,是否符合面向對象的設計原則。
          JDepend 一個開放源代碼的可以用來評價Java程序質量的優秀工具,它遍歷Java class的文件目錄,以Java包(package)為單位,為每一個包/類自動生成 包的依賴程度,穩定性,可靠度等的評價報告,根據這些報告,我們可以得到包或類之間的依賴關系,并分析出包的穩定程度,抽象程度,是否存在循環依賴關系 等。
          我們可以根據JDepend給出的報告數據,分析出我們的包是否是可靠的,穩定的,健壯的包,是否符合面向對象的設計原則。
          一個具有穩定性,擴展性,可維護性的軟件系統要求系統設計遵循面向對象的設計原則。一般來說,面向對象的設計原則要求滿足高聚合,低耦合,禁止循環依賴等基本原則。
          JDepend生成的Java包的質量評價報告主要包括:
          Number of Classes and Interfaces(TC):實現類與抽象接口的數目
          CC:包內具體的實現類的數目
          AC:包內抽象類和接口類的數目
          Abstractness (A):包的抽象度。指一個包內包含的抽象類或接口占整個包中的類的比重。即A=AC/TC,該值處于0,1之間,若A=0,說明包內不包含任何抽象類或接口;若A=1,說明包內全部是抽象類或接口。
          Efferent Couplings (Ce):離心耦合。被該包依賴的外部包的數目(i.e. outgoing dependencies),該數值越大,說明該包越不獨立(因為依賴了別的包),也越不穩定。
          Afferent Couplings (Ca):向心耦合。依賴該包(包含的類)的外部包(類)的數目(i.e. incoming dependencies),該數值越大,說明該包的擔當的職責越大,也就越穩定。
          Instability (I):衡量一個包的不穩定程度。I=Ce/(Ce+Ca)。它的值處于[0,1]之間。I=0時,沒有依賴外部包,此時包是最穩定的,反之I=1,沒有外部依賴“我”,則說明包極不穩定。
          Distance from the Main Sequence (D): 該指標主要用來評價包的抽象程度與穩定程度的平衡關系,它可以用二維直線圖 A + I = 1 來表示。D=abs((A + I) - 1),也就是說D為 一個包的抽象度 + 包的不穩定程度 - 1 的絕對值。一個理想的包是:完全抽象的(A=1,I=0),非常穩定的(I=0),這時D=0;或者是:完全具體類構成的包(A=0,I=1),非常不穩定的 (I=1),這時同樣也有D=0。D=0說明包的抽象程度與穩定程度是平衡的,反之D=1說明包的平衡程度被嚴重破壞。D值越大,越需要受到關注。                                       
          面向的設計原則之一The Stable Abstractions Principle (SAP):穩定抽象等價原則指出了包的穩定程度與它的抽象程度(接口的數目)成正比,也就是說,一個包內包含的接口所占的比重越大,這個包就越穩定。

          posted @ 2015-03-20 09:40 skycity 閱讀(219) | 評論 (0)編輯 收藏

           J2SE 8 = 52,
           J2SE 7 = 51,
           J2SE 6.0 = 50,
           J2SE 5.0 = 49,
           JDK 1.4 = 48,
           JDK 1.3 = 47,
           JDK 1.2 = 46,
           JDK 1.1 = 45

          posted @ 2015-03-20 09:38 skycity 閱讀(211) | 評論 (0)編輯 收藏

          萬分號,費率的地方用得著,網上不好找,留著先?

          posted @ 2013-02-21 11:41 skycity 閱讀(200) | 評論 (0)編輯 收藏

               摘要:   閱讀全文

          posted @ 2012-09-29 11:36 skycity 閱讀(419) | 評論 (0)編輯 收藏

               摘要:   閱讀全文

          posted @ 2008-12-22 09:24 skycity 閱讀(1082) | 評論 (0)編輯 收藏

               摘要:   閱讀全文

          posted @ 2008-12-18 21:59 skycity 閱讀(291) | 評論 (0)編輯 收藏

          僅列出標題
          共6頁: 上一頁 1 2 3 4 5 6 下一頁 
          主站蜘蛛池模板: 望江县| 通渭县| 克什克腾旗| 余干县| 凭祥市| 梨树县| 临海市| 北碚区| 萨嘎县| 剑阁县| 长丰县| 阿城市| 武义县| 海兴县| 米林县| 伊川县| 泰宁县| 石阡县| 武义县| 彭州市| 济阳县| 巫溪县| 佳木斯市| 裕民县| 安吉县| 永胜县| 恭城| 阿拉善右旗| 揭西县| 陵水| 河西区| 望奎县| 镶黄旗| 闸北区| 平湖市| 太仓市| 繁峙县| 辽中县| 昭通市| 自贡市| 佳木斯市|