<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 6, 文章 - 1, 評論 - 13, 引用 - 0
    數據加載中……

    2011年10月19日

    職責鏈(Chain of Responsibility)模式

         摘要: 一、 職責鏈(Chain of Responsibility)模式 責任鏈模式是一種對象的行為模式【GOF95】。在責任鏈模式里,很多對象由每一個對象對其下家的引用而連接起來形成一條鏈。請求在這個鏈上傳遞, 直到鏈上的某一個對象決定處理此請求。發出這個請求的客戶端并不知道鏈上的哪一個對象最終處理這個請求,這使得系統可以在不影響客戶端的情況下動態地重新 組織鏈和分配責任。 從擊鼓傳花談起 ...  閱讀全文

    posted @ 2011-11-08 20:53 風清揚 閱讀(281) | 評論 (0)編輯 收藏

    eclipse中修改java和jsp字體及大小

     1.更改java文件大小設置
    Window->preferences->General->Appearance->Colors   and   Fonts->
    Java->Java Editor Text Font->右邊按鈕Change 
    英文版默認的是Courier New 常規 10
    2.更改jsp文件大小設置
    Window->preferences->General->Appearance->Colors   and   Fonts->
    Basic->TextFont->右邊按鈕Change 

    posted @ 2011-11-05 10:07 風清揚 閱讀(7929) | 評論 (1)編輯 收藏

    常用js正則表達式

    intege:"^-?[1-9]\\d*$", //整數
    intege1:"^[1-9]\\d*$", //正整數
    intege2:"^-[1-9]\\d*$", //負整數
    num:"^([+-]?)\\d*\\.?\\d+$", //數字
    num1:"^(([0-9]+.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*.[0-9]+)|([0-9]*[1-9][0-9]*))$",//正數(包括浮點和整數)
    num2:"^-[1-9]\\d*|0$", //負數(負整數 + 0)
    decmal:"^([+-]?)\\d*\\.\\d+$", //浮點數
    decmal1:"^[1-9]\\d*.\\d*|0.\\d*[1-9]\\d*$",   //正浮點數
    decmal2:"^-([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*)$",  //負浮點數
    decmal3:"^-?([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*|0?.0+|0)$",  //浮點數
    decmal4:"^[1-9]\\d*.\\d*|0.\\d*[1-9]\\d*|0?.0+|0$",   //非負浮點數(正浮點數 + 0)
    decmal5:"^(-([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*))|0?.0+|0$",  //非正浮點數(負浮點數 + 0)
    email:"^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$", //郵件
    color:"^[a-fA-F0-9]{6}$", //顏色
    url:"^http[s]?:\\/\\/([\\w-]+\\.)+[\\w-]+([\\w-./?%&=]*)?$", //url
    chinese:"^[\\u4E00-\\u9FA5\\uF900-\\uFA2D]+$", //僅中文
    ascii:"^[\\x00-\\xFF]+$", //僅ACSII字符
    zipcode:"^\\d{6}$", //郵編
    mobile:"^(13|15|18)[0-9]{9}$", //手機
    ip4:"^(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)$", //ip地址
    notempty:"^\\S+$", //非空
    picture:"(.*)\\.(jpg|bmp|gif|ico|pcx|jpeg|tif|png|raw|tga)$", //圖片
    rar:"(.*)\\.(rar|zip|7zip|tgz)$", //壓縮文件
    date:"^\\d{4}(\\-|\\/|\.)\\d{1,2}\\1\\d{1,2}$", //日期
    time:"^([0-1]\\d|2[0-3]):[0-5]\\d:[0-5]\\d$", //時間
    qq:"^[1-9]*[1-9][0-9]*$", //QQ號碼
    tel:"^(([0\\+]\\d{2,3}-)?(0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$", //電話號碼的函數(包括驗證國內區號,國際區號,分機號)
    username:"^\\w+$", //用來用戶注冊。匹配由數字、26個英文字母或者下劃線組成的字符串
    letter:"^[A-Za-z]+$", //字母
    letter_u:"^[A-Z]+$", //大寫字母
    letter_l:"^[a-z]+$", //小寫字母
    idcard:"^[1-9]([0-9]{14}|[0-9]{17})$" //身份證

    posted @ 2011-10-29 19:15 風清揚 閱讀(318) | 評論 (0)編輯 收藏

    Access restriction: The type BASE64Encoder is not accessible due to restrict

    在Eclipse中編寫Java代碼時,用到了BASE64Decoder,import sun.misc.BASE64Decoder;可是Eclipse提示:
    Access restriction : The type BASE64Decoder is not accessible due to restriction on required library C:\Program
    files\java\jre6\lib\rt.jar
    Access restriction : The constructor BASE64Decoder() is not accessible due to restriction on required library C:\Program files\java\jre6\lib\rt.jar
    搞不懂是為什么,最后在http://forums.dzone.com/eclipse/384-access-restriction- problems.html找到答案,只需要在project build path中先移除JRE System Library,再添加庫JRE System Library,重新編譯后就一切正常了。但是我仍然很疑惑是為什么。。。
    原文見:http://zhoushuyan.cn/java/the-type-base64decoder-is-not-accessible-due-to-restriction-on-required-library/
    ------------------------------
    Windows -> Preferences -> Java -> Compiler -> Errors/Warnings ->
    Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning

    轉自:
    http://palwang.iteye.com/blog/906425

    posted @ 2011-10-26 22:29 風清揚 閱讀(29244) | 評論 (11)編輯 收藏

    SmartClient中Criteria 和 AdvancedCriteria的理解

    時間不早了,就少寫一些了。

    Criteria for selecting only a matching set of records from a DataSource. Criteria can be applied on the client and server. Unless configured otherwise, criteria will generally be applied client-side by ResultSets via ResultSet.applyFilter().

    Client- and server-side systems built into SmartClient understand two criteria formats by default: simple key-value pairs (Criteria) or the AdvancedCriteria format.

    Simple key-value Criteria are represented via a JavaScript Object where each property specifies the name and required value for a field. Multiple legal values for a field can be provided as an Array. For example:

     var criteria = {     field1 : "value1",     field2 : ["value2", "value3"]  }  
    Would select all records where field1 has value "value1" and where field2 has either "value2" or "value3". When writing custom client and server-side filtering logic, criteria must be a JavaScript Object but the properties of that Object can contain whatever data you want. When
     sent to the SmartClient server, the Java representation of the criteria is described here. When sent to other servers, the operationBinding.dataProtocol affects the format.

    格式相當簡單。注意前面字段field1,是不需要將引號的.

    AdvancedCriteria is a format for representing search criteria which may include operators on field values such as "less than", or may include sub-clauses such as several criteria applied to fields joined by an "OR" operator.

    SmartClient DataSources can use AdvancedCriteria to search a list of Records, and the SmartClient Java Server can translate AdvancedCriteria to either SQL or Hibernate queries (Note: The server-side AdvancedCriteria handling feature is only available with the Power and Enterprise Editions of SmartClient; the Pro Edition is limited to ordinary criteria handling on the server side).可惜Power版和Enterprise版都老貴老貴的,企業版的都有按CPU賣的了,暈倒。

    If the entire dataset is cached locally, SmartClient can perform AdvancedCriteria filtering on the client, avoiding a server call.

    An AdvancedCriteria is an ordinary JavaScript object which can be created directly with JavaScript literal notation. For example:

    var advancedCriteria = {
    _constructor:"AdvancedCriteria",
    operator:"and",
    criteria:[
    // this is a Criterion
    { fieldName:"salary", operator:"lessThan", value:"80000" },
    { operator:"or", criteria:[
    { fieldName:"title", operator:"iContains", value:"Manager" },
    { fieldName:"reports", operator:"notNull" }
    ]
    }
    ]
    }
    An AdvancedCriteria is in effect a Criterion that has been marked with _constructor:"AdvancedCriteria" to mark it as complete criteria.

    posted @ 2011-10-24 23:08 風清揚 閱讀(389) | 評論 (0)編輯 收藏

    test

    test

    posted @ 2011-10-19 19:45 風清揚 閱讀(331) | 評論 (1)編輯 收藏

    主站蜘蛛池模板: 亚洲级αV无码毛片久久精品| 免费国产黄网站在线观看视频| 爱爱帝国亚洲一区二区三区| 国产精品亚洲片夜色在线| 亚洲国产精品综合一区在线| 亚洲精品国产手机| 亚洲国产亚洲片在线观看播放| 亚洲视屏在线观看| 亚洲免费人成视频观看| 亚洲一级高清在线中文字幕| 亚洲人成毛片线播放| 亚洲av无码国产综合专区| 中文字幕在线观看亚洲日韩| 亚洲av无码专区在线电影| 久久亚洲中文字幕无码| 九九视频高清视频免费观看 | 国产aⅴ无码专区亚洲av麻豆| 中文字幕久久亚洲一区 | 无码日韩精品一区二区免费| 成人性生交大片免费看无遮挡| 欧美在线看片A免费观看| 四虎永久在线精品免费影视 | 在线天堂免费观看.WWW| 成熟女人特级毛片www免费| 国产精品久久免费视频| 亚洲AV永久无码精品一区二区国产 | 欧洲精品码一区二区三区免费看| 特a级免费高清黄色片 | 久久综合亚洲色hezyo| 九九久久精品国产免费看小说| a在线观看免费视频| 免费在线观看h片| 免费看的黄色大片| 亚洲一区二区三区在线视频| 亚洲AV乱码久久精品蜜桃| 亚洲一级视频在线观看| 四虎国产精品永免费| 免费A级毛片av无码| 在线观看永久免费视频网站| 亚洲中文久久精品无码ww16| 亚洲美女人黄网成人女|