lyyb2001

只是为方便自己找记录而已
posts - 57, comments - 27, trackbacks - 0, articles - 5
  BlogJava :: 首页 :: 新随笔 :: 联系 ::  :: 管理

@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); @import url(http://www.blogjava.net/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 阅读(160) | 评论 (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 阅读(273) | 评论 (0)编辑 收藏

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

posted @ 2015-03-20 09:42 skycity 阅读(107) | 评论 (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 阅读(190) | 评论 (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 阅读(199) | 评论 (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 阅读(194) | 评论 (0)编辑 收藏

万分号,费率的地方用得着,网上不好找,留着先

posted @ 2013-02-21 11:41 skycity 阅读(193) | 评论 (0)编辑 收藏

     摘要:   阅读全文

posted @ 2012-09-29 11:36 skycity 阅读(400) | 评论 (0)编辑 收藏

     摘要:   阅读全文

posted @ 2008-12-22 09:24 skycity 阅读(1074) | 评论 (0)编辑 收藏

     摘要:   阅读全文

posted @ 2008-12-18 21:59 skycity 阅读(270) | 评论 (0)编辑 收藏

仅列出标题
共6页: 上一页 1 2 3 4 5 6 下一页