text:
typedef enum {
    HUDTypeSuccess,
    HUDTypeError,
    HUDTypeLoding,
    HUDTypeInfo,
    HUDTypeProgress
} HUDType;

@implementation AnnLSVPHUD

+ (void)initialize {
    [super initialize];

    [SVProgressHUD setFont:[UIFont systemFontOfSize:14.0]];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    [SVProgressHUD setMinimumDismissTimeInterval:1.5];
}

+ (void)showSuccessWithStatus:(NSString *)status {
    [self LMJShowWithType:HUDTypeSuccess Status:status Image:nil Progress:NSNotFound];
}

+ (void)showErrorWithStatus:(NSString *)status {
    [self LMJShowWithType:HUDTypeError Status:status Image:nil Progress:NSNotFound];
}

+ (void)showLodingWithStatus:(NSString *)status {
    [self LMJShowWithType:HUDTypeLoding Status:status Image:nil Progress:NSNotFound];
}

+ (void)showInfoWithStatus:(NSString *)status {
    [self LMJShowWithType:HUDTypeInfo Status:status Image:nil Progress:NSNotFound];
}

+ (void)showProgress:(CGFloat)progress Status:(NSString *)status {
    [self LMJShowWithType:HUDTypeProgress Status:status Image:nil Progress:progress];
}

+ (void)dismissHUD {
    [SVProgressHUD dismiss];
}

// 私有方法
+ (void)LMJShowWithType:(HUDType)type Status:(NSString *)status Image:(UIImage *)img Progress:(CGFloat)progress {

    switch (type) {

        case HUDTypeSuccess:
            [SVProgressHUD showSuccessWithStatus:status];
            break;
        case HUDTypeError:
            [SVProgressHUD showErrorWithStatus:status];
            break;
        case HUDTypeLoding:
            [SVProgressHUD showWithStatus:status];
            break;
        case HUDTypeInfo:
            [SVProgressHUD showInfoWithStatus:status];
            break;
        case HUDTypeProgress:
            [SVProgressHUD showProgress:progress status:status];
            break;

        default:
            break;
    }

}

@end


text:
<!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
       "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">

<!--
File: tiles-defs.xml
Author: Joshua Forester
Date: 2009/08/05
Description: Tiles definitions file for all of the site.
-->

<tiles-definitions>

    <definition name=".dashboardLayout" template="/views/LayoutDashboard.jsp">
      <put-attribute name="title" value="CHANGE ME TITLE" />
      <put-attribute name="ProcessingHeader" value="/views/ProcessingHeader.jsp" />
      <put-attribute name="DoctypeHeader" value="/views/DoctypeHeader.jsp" />
      <put-attribute name="Link1" value=".DefaultContent" />
      <put-attribute name="Link2" value="/views/LinkRDB.jsp" />
      <put-attribute name="Meta" value="/views/Meta.jsp" />
      <put-attribute name="Script" value=".DefaultScript" />
      <put-attribute name="Body" value="/views/Body.jsp" />
      <put-attribute name="TopAds" value="/views/MainSlideshow.jsp" />
      <put-attribute name="MainMenu" value=".DefaultMainMenu" />
      <put-attribute name="SubMenu" value=".DefaultSubMenu" />
      <put-attribute name="ContentTopLt1" value=".DefaultNotice" />
      <put-attribute name="ContentTopLt2" value=".DefaultContent" />
      <put-attribute name="ContentTopLt3" value=".DefaultContent" />
      <put-attribute name="ContentTopLt4" value=".DefaultContent" />
      <put-attribute name="ContentTopLt5" value=".DefaultContent" />
      <put-attribute name="ContentLt1" value=".DefaultContent" />
      <put-attribute name="ContentLt2" value=".DefaultContent" />
      <put-attribute name="ContentLt3" value=".DefaultContent" />
      <put-attribute name="ContentLt4" value=".DefaultContent" />
      <put-attribute name="ContentLt5" value=".DefaultContent" />
      <put-attribute name="ContentMd1" value=".DefaultContent" />
      <put-attribute name="ContentMd2" value=".DefaultContent" />
      <put-attribute name="ContentMd3" value=".DefaultContent" />
      <put-attribute name="ContentMd4" value=".DefaultContent" />
      <put-attribute name="ContentMd5" value=".DefaultContent" />
      <put-attribute name="ContentRt1" value=".DefaultContent" />
      <put-attribute name="ContentRt2" value=".DefaultContent" />
      <put-attribute name="ContentRt3" value="/views/liveCoverageSponsor.jsp" />
      <put-attribute name="ContentRt4" value="/views/addThisVertical.jsp" />
      <put-attribute name="ContentRt5" value=".DefaultContent" />
      <put-attribute name="GoogleAnalytics" value="/views/googleAnalytics.jsp" />
      <put-attribute name="Footer1" value="/views/Footer.jsp" />
      <put-attribute name="Footer2" value=".DefaultContent" />
    </definition>

    <definition name=".viewLayout" template="/views/LayoutView.jsp">
      <put-attribute name="title" value="CHANGE ME TITLE" />
      <put-attribute name="ProcessingHeader" value="/views/ProcessingHeader.jsp" />
      <put-attribute name="DoctypeHeader" value="/views/DoctypeHeader.jsp" />
      <put-attribute name="Link1" value=".DefaultContent" />
      <put-attribute name="Link2" value="/views/LinkRDB.jsp" />
      <put-attribute name="Meta" value="/views/Meta.jsp" />
      <put-attribute name="Script" value=".DefaultScript" />
      <put-attribute name="Body" value="/views/Body.jsp" />
      <put-attribute name="TopAds" value="/views/MainSlideshow.jsp" />
      <put-attribute name="MainMenu" value=".DefaultMainMenu" />
      <put-attribute name="SubMenu" value=".DefaultSubMenu" />
      <put-attribute name="ContentTopLt1" value=".DefaultNotice" />
      <put-attribute name="ContentTopLt2" value=".DefaultContent" />
      <put-attribute name="ContentTopLt3" value=".DefaultContent" />
      <put-attribute name="ContentTopLt4" value=".DefaultContent" />
      <put-attribute name="ContentTopLt5" value=".DefaultContent" />
      <put-attribute name="GoogleAnalytics" value="/views/googleAnalytics.jsp" />
      <put-attribute name="Footer1" value="/views/addThisHorizontal.jsp" />
      <put-attribute name="Footer2" value="/views/Footer.jsp" />
    </definition>

    <definition name=".rawLayout" template="/views/LayoutRaw.jsp">
      <put-attribute name="title" value="CHANGE ME TITLE" />
      <put-attribute name="ProcessingHeader" value="/views/ProcessingHeader.jsp" />
      <put-attribute name="DoctypeHeader" value="/views/DoctypeHeader.jsp" />
      <put-attribute name="Link1" value=".DefaultContent" />
      <put-attribute name="Link2" value="/views/LinkRDB.jsp" />
      <put-attribute name="Meta" value="/views/Meta.jsp" />
      <put-attribute name="Script" value=".DefaultScript" />
      <put-attribute name="Body" value="/views/Body.jsp" />
      <put-attribute name="ContentTopLt1" value=".DefaultContent" />
      <put-attribute name="ContentTopLt2" value=".DefaultContent" />
      <put-attribute name="ContentTopLt3" value=".DefaultContent" />
      <put-attribute name="ContentTopLt4" value=".DefaultContent" />
      <put-attribute name="ContentTopLt5" value=".DefaultContent" />
      <put-attribute name="GoogleAnalytics" value="/views/googleAnalytics.jsp" />
      <put-attribute name="Footer1" value="/views/Footer.jsp" />
    </definition>

    <definition name=".DefaultScript" template="/views/Script.jsp">
      <put-list-attribute name="jsfilesList">
	<add-attribute value="http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js" />
	<add-attribute value="/js/s3-slider.min.js" />
	<add-attribute value="/js/rdb.js" />
      </put-list-attribute>
    </definition>

    <definition name=".DefaultMainMenu" template="/views/MainMenu.jsp">
      <put-attribute name="mainMenuItem" value="home" />
    </definition>

    <definition name=".DefaultSubMenu" template="/views/SubMenu.jsp">
      <put-attribute name="mainMenuItem" value="home" />
      <put-attribute name="subMenuItem" value="home" />
    </definition>

    <definition name=".DefaultNotice" template="/views/NoticeWelcome.jsp">
      <put-attribute name="pageTitle" value="Page Title" />
      <put-attribute name="submitUrl" value="/d/submitUrl.htm" />
    </definition>

    <definition name=".DefaultContent" template="/views/Content.jsp">
      <put-attribute name="pageTitle" value="Page Title" />
      <put-attribute name="submitUrl" value="/d/submitUrl.htm" />
    </definition>

    <!-- Views -->
    <definition name=".releasenotes_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Release Notes" />
      <put-attribute name="ContentTopLt2" value="/views/releasenotes.jsp" />
    </definition>
    <definition name=".releasenotes_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Release Notes" />
      <put-attribute name="ContentTopLt2" value="/views/releasenotes.jsp" />
    </definition>
    <definition name=".releasenotes_view" extends=".viewLayout">
      <put-attribute name="title" value="Release Notes" />
      <put-attribute name="ContentTopLt2" value="/views/releasenotes.jsp" />
    </definition>
    <definition name=".releasenotes_raw" extends=".rawLayout">
      <put-attribute name="title" value="Release Notes" />
      <put-attribute name="ContentTopLt2" value="/views/releasenotes.jsp" />
    </definition>

    <definition name=".leaderboardLegend_view" extends=".viewLayout">
      <put-attribute name="title" value="Leaderboard Legend" />
      <put-attribute name="ContentTopLt2" value="/views/leaderboardLegend.jsp" />
    </definition>

    <definition name=".accessDenied_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Access Denied" />
      <put-attribute name="ContentTopLt2" value="/views/accessDenied.jsp" />
    </definition>

    <definition name=".ownershiperror_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Ownership Error" />
      <put-attribute name="ContentTopLt2" value="/views/ownershiperror.jsp" />
    </definition>

    <definition name=".noleaderboardstodisplay_dashboard" extends=".rawLayout">
      <put-attribute name="title" value="No Leaderboard" />
      <put-attribute name="ContentTopLt2" value="/views/noLeaderboards.jsp" />
    </definition>

    <definition name=".listLeaderboardsFull_raw" extends=".rawLayout">
      <put-attribute name="title" value="Leaderboards - Full" />
      <put-attribute name="Script" value=".ScriptListLeaderboardsFull" />
      <put-attribute name="ContentTopLt2" value="/views/listLeaderboardsFull.jsp" />
    </definition>

    <definition name=".listLeaderboardsFull_view" extends=".viewLayout">
      <put-attribute name="title" value="Leaderboards - Full" />
      <put-attribute name="Script" value=".ScriptListLeaderboardsFull" />
      <put-attribute name="ContentTopLt2" value="/views/listLeaderboardsFull.jsp" />
      <put-attribute name="ContentTopLt3" value="/views/liveChat.jsp" />
    </definition>

    <definition name=".listLeaderboardsFull_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Leaderboards - Full" />
      <put-attribute name="Link1" value="/views/LinkLbd.jsp" />
      <put-attribute name="Script" value=".ScriptListLeaderboardsFull" />
      <put-attribute name="ContentTopLt2" value="/views/listLeaderboardsFull.jsp" />
      <put-attribute name="ContentTopLt3" value="/views/liveChat.jsp" />
      <put-attribute name="ContentRt1" value="/views/listLbdUpdatesVertical.jsp" />
    </definition>

    <definition name=".ScriptListLeaderboardsFull" template="/views/Script.jsp">
      <put-list-attribute name="jsfilesList">
	<add-attribute value="http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js" />
	<add-attribute value="/js/s3-slider.min.js" />
	<add-attribute value="/js/jquery-ui-1.7.2.min.js" />
        <add-attribute value="/js/rdb.js" />
	<add-attribute value="/js/lbd.js" />
	<add-attribute value="/js/lbdupdates.js" />
      </put-list-attribute>
    </definition>

    <definition name=".listLeaderboardsList_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Leaderboards - List" />
      <put-attribute name="ContentTopLt2" value="/views/listLeaderboardsList.jsp" />
    </definition>

    <definition name=".listLeaderboardsShort_raw" extends=".rawLayout">
      <put-attribute name="title" value="Leaderboards - Short" />
      <put-attribute name="ContentTopLt2" value="/views/listLeaderboardsShort.jsp" />
    </definition>

    <!-- Login -->
    <definition name=".loginForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Login" />
      <put-attribute name="Body" value="/views/loginBody.jsp" />
      <put-attribute name="ContentTopLt2" value=".loginContent" />
    </definition>

    <definition name=".loginContent" template="/views/loginForm.jsp">
      <put-attribute name="pageTitle" value="Login" />
      <put-attribute name="submitUrl" value="/j_spring_security_check" />
    </definition>

    <definition name=".loginSuccess_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Login Success" />
      <put-attribute name="ContentTopLt2" value="/views/loginSuccess.jsp" />
    </definition>

    <definition name=".logoutSuccess_view" extends=".viewLayout">
      <put-attribute name="title" value="Logout" />
      <put-attribute name="ContentTopLt2" value="/views/logoutSuccess.jsp" />
    </definition>

    <!-- Event CRUD -->
    <definition name=".listEvents_view" extends=".viewLayout">
      <put-attribute name="title" value="List Events" />
      <put-attribute name="ContentTopLt2" value="/views/listEvents.jsp" />
    </definition>

    <definition name=".addEventForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Add Event" />
      <put-attribute name="Script" value=".ScriptEditEvent" />
      <put-attribute name="ContentTopLt2" value=".addEventContent" />
    </definition>

    <definition name=".addEventContent" template="/views/editEventForm.jsp">
      <put-attribute name="pageTitle" value="Add Event" />
      <put-attribute name="submitUrl" value="/d/addEvent.htm" />
    </definition>

    <definition name=".editEventForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Edit Event" />
      <put-attribute name="Script" value=".ScriptEditEvent" />
      <put-attribute name="ContentTopLt2" value=".editEventContent" />
    </definition>
    <definition name=".editEventForm_view" extends=".viewLayout">
      <put-attribute name="title" value="Edit Event" />
      <put-attribute name="Script" value=".ScriptEditEvent" />
      <put-attribute name="ContentTopLt2" value=".editEventContent" />
    </definition>
    <definition name=".editEventForm_raw" extends=".rawLayout">
      <put-attribute name="title" value="Edit Event" />
      <put-attribute name="Script" value=".ScriptEditEvent" />
      <put-attribute name="ContentTopLt2" value=".editEventContent" />
    </definition>

    <definition name=".editEventContent" template="/views/editEventForm.jsp">
      <put-attribute name="pageTitle" value="Edit Event" />
      <put-attribute name="submitUrl" value="/d/editEvent.htm" />
    </definition>

    <definition name=".ScriptEditEvent" template="/views/Script.jsp">
      <put-list-attribute name="jsfilesList">
	<add-attribute value="http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js" />
	<add-attribute value="/tp/local/ckeditor/ckeditor.js" />
	<add-attribute value="/tp/local/ckeditor/adapters/jquery.js" />
	<add-attribute value="/js/jquery.blockUI-2.29.js" />
	<add-attribute value="/js/s3-slider.min.js" />
	<add-attribute value="/js/rdb.js" />
	<add-attribute value="/js/event.js" />
      </put-list-attribute>
    </definition>

    <definition name=".editEventFormSubmitted_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Event Submitted" />
      <put-attribute name="ContentTopLt2" value="/views/editEventFormSubmitted.jsp" />
    </definition>

    <definition name=".deleteEventConfirm_view" extends=".viewLayout">
      <put-attribute name="title" value="Delete Event Confirm" />
      <put-attribute name="ContentTopLt2" value="/views/deleteEventConfirm.jsp" />
    </definition>

    <definition name=".deleteEventSuccess_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Event Deleted" />
      <put-attribute name="ContentTopLt2" value="/views/deleteEventSuccess.jsp" />
    </definition>

    <!-- Course CRUD -->
    <definition name=".listCourses_view" extends=".viewLayout">
      <put-attribute name="title" value="List Courses" />
      <put-attribute name="ContentTopLt2" value="/views/listCourses.jsp" />
    </definition>

    <definition name=".addCourseForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Add Course" />
      <put-attribute name="Script" value=".ScriptEditCourse" />
      <put-attribute name="ContentTopLt2" value=".addCourseContent" />
    </definition>

    <definition name=".addCourseContent" template="/views/editCourseForm.jsp">
      <put-attribute name="pageTitle" value="Add Course" />
      <put-attribute name="submitUrl" value="/d/addCourse.htm" />
    </definition>

    <definition name=".editCourseForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Edit Course" />
      <put-attribute name="Script" value=".ScriptEditCourse" />
      <put-attribute name="ContentTopLt2" value=".editCourseContent" />
    </definition>

    <definition name=".editCourseContent" template="/views/editCourseForm.jsp">
      <put-attribute name="pageTitle" value="Edit Course" />
      <put-attribute name="submitUrl" value="/d/editCourse.htm" />
    </definition>

    <definition name=".ScriptEditCourse" template="/views/Script.jsp">
      <put-list-attribute name="jsfilesList">
	<add-attribute value="http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js" />
	<add-attribute value="/tp/local/ckeditor/ckeditor.js" />
	<add-attribute value="/tp/local/ckeditor/adapters/jquery.js" />
	<add-attribute value="/js/jquery.blockUI-2.29.js" />
	<add-attribute value="/js/s3-slider.min.js" />
	<add-attribute value="/js/rdb.js" />
	<add-attribute value="/js/course.js" />
      </put-list-attribute>
    </definition>

    <definition name=".editCourseFormSubmitted_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Course Submitted" />
      <put-attribute name="ContentTopLt2" value="/views/editCourseFormSubmitted.jsp" />
    </definition>

    <definition name=".deleteCourseConfirm_view" extends=".viewLayout">
      <put-attribute name="title" value="Delete Course Confirm" />
      <put-attribute name="ContentTopLt2" value="/views/deleteCourseConfirm.jsp" />
    </definition>

    <definition name=".deleteCourseSuccess_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Course Deleted" />
      <put-attribute name="ContentTopLt2" value="/views/deleteCourseSuccess.jsp" />
    </definition>

    <definition name=".showDescription_view" extends=".viewLayout">
      <put-attribute name="title" value="Course Description" />
      <put-attribute name="ContentTopLt2" value="/views/courseDesc.jsp" />
    </definition>

    <!-- Division CRUD -->
    <definition name=".listDivisions_view" extends=".viewLayout">
      <put-attribute name="title" value="List Divisions" />
      <put-attribute name="ContentTopLt2" value="/views/listDivisions.jsp" />
    </definition>

    <definition name=".addDivisionForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Add Division" />
      <put-attribute name="ContentTopLt2" value=".addDivisionContent" />
    </definition>

    <definition name=".addDivisionContent" template="/views/editDivisionForm.jsp">
      <put-attribute name="pageTitle" value="Add Division" />
      <put-attribute name="submitUrl" value="/d/addDivision.htm" />
    </definition>

    <definition name=".editDivisionForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Edit Division" />
      <put-attribute name="ContentTopLt2" value=".editDivisionContent" />
    </definition>

    <definition name=".editDivisionContent" template="/views/editDivisionForm.jsp">
      <put-attribute name="pageTitle" value="Edit Division" />
      <put-attribute name="submitUrl" value="/d/editDivision.htm" />
    </definition>

    <definition name=".editDivisionFormSubmitted_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Division Submitted" />
      <put-attribute name="ContentTopLt2" value="/views/editDivisionFormSubmitted.jsp" />
    </definition>

    <definition name=".deleteDivisionConfirm_view" extends=".viewLayout">
      <put-attribute name="title" value="Delete Division Confirm" />
      <put-attribute name="ContentTopLt2" value="/views/deleteDivisionConfirm.jsp" />
    </definition>

    <definition name=".deleteDivisionSuccess_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Division Deleted" />
      <put-attribute name="ContentTopLt2" value="/views/deleteDivisionSuccess.jsp" />
    </definition>

    <!-- ControlPoint CRUD -->
    <definition name=".listControlPoints_view" extends=".viewLayout">
      <put-attribute name="title" value="List Control Points" />
      <put-attribute name="ContentTopLt2" value="/views/listControlPoints.jsp" />
    </definition>

    <definition name=".addControlPointForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Add Control Point" />
      <put-attribute name="ContentTopLt2" value=".addControlPointContent" />
    </definition>

    <definition name=".addControlPointContent" template="/views/editControlPointForm.jsp">
      <put-attribute name="pageTitle" value="Add Control Point" />
      <put-attribute name="submitUrl" value="/d/addControlPoint.htm" />
    </definition>

    <definition name=".editControlPointForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Edit Control Point" />
      <put-attribute name="ContentTopLt2" value=".editControlPointContent" />
    </definition>

    <definition name=".editControlPointContent" template="/views/editControlPointForm.jsp">
      <put-attribute name="pageTitle" value="Edit Control Point" />
      <put-attribute name="submitUrl" value="/d/editControlPoint.htm" />
    </definition>

    <definition name=".editControlPointFormSubmitted_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Control Point Submitted" />
      <put-attribute name="ContentTopLt2" value="/views/editControlPointFormSubmitted.jsp" />
    </definition>

    <definition name=".deleteControlPointConfirm_view" extends=".viewLayout">
      <put-attribute name="title" value="Delete Control Point Confirm" />
      <put-attribute name="ContentTopLt2" value="/views/deleteControlPointConfirm.jsp" />
    </definition>

    <definition name=".deleteControlPointSuccess_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Control Point Deleted" />
      <put-attribute name="ContentTopLt2" value="/views/deleteControlPointSuccess.jsp" />
    </definition>

    <!-- Competitor CRUD -->
    <definition name=".listCompetitors_view" extends=".viewLayout">
      <put-attribute name="title" value="List Competitors" />
      <put-attribute name="ContentTopLt2" value="/views/listCompetitors.jsp" />
    </definition>

    <definition name=".showCompetitorMap_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Competitor Map" />
      <put-attribute name="ContentTopLt2" value="/views/competitorMap.jsp" />
    </definition>

    <definition name=".listPersons_view" extends=".viewLayout">
      <put-attribute name="title" value="List Competitors" />
      <put-attribute name="ContentTopLt2" value="/views/listPersons.jsp" />
    </definition>

    <definition name=".addCompetitorForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Add Competitor" />
      <put-attribute name="ContentTopLt2" value=".addCompetitorContent" />
    </definition>

    <definition name=".addCompetitorContent" template="/views/editCompetitorForm.jsp">
      <put-attribute name="pageTitle" value="Add Competitor" />
      <put-attribute name="submitUrl" value="/d/addCompetitor.htm" />
    </definition>

    <definition name=".editCompetitorForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Edit Competitor" />
      <put-attribute name="ContentTopLt2" value=".editCompetitorContent" />
    </definition>

    <definition name=".editCompetitorContent" template="/views/editCompetitorForm.jsp">
      <put-attribute name="pageTitle" value="Edit Competitor" />
      <put-attribute name="submitUrl" value="/d/editCompetitor.htm" />
    </definition>

    <definition name=".editCompetitorFormSubmitted_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Competitor Submitted" />
      <put-attribute name="ContentTopLt2" value="/views/editCompetitorFormSubmitted.jsp" />
    </definition>

    <definition name=".deleteCompetitorConfirm_view" extends=".viewLayout">
      <put-attribute name="title" value="Delete Competitor Confirm" />
      <put-attribute name="ContentTopLt2" value="/views/deleteCompetitorConfirm.jsp" />
    </definition>

    <definition name=".deleteCompetitorSuccess_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Competitor Deleted" />
      <put-attribute name="ContentTopLt2" value="/views/deleteCompetitorSuccess.jsp" />
    </definition>

    <!-- Admin CRUD -->
    <definition name=".listAdmins_view" extends=".viewLayout">
      <put-attribute name="title" value="List Admins" />
      <put-attribute name="ContentTopLt2" value="/views/listAdmins.jsp" />
    </definition>

    <definition name=".addAdminForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Add Admin" />
      <put-attribute name="ContentTopLt2" value=".addAdminContent" />
    </definition>

    <definition name=".addAdminContent" template="/views/editAdminForm.jsp">
      <put-attribute name="pageTitle" value="Add Admin" />
      <put-attribute name="submitUrl" value="/d/addAdmin.htm" />
    </definition>

    <definition name=".editAdminForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Edit Admin" />
      <put-attribute name="ContentTopLt2" value=".editAdminContent" />
    </definition>

    <definition name=".editAdminContent" template="/views/editAdminForm.jsp">
      <put-attribute name="pageTitle" value="Edit Admin" />
      <put-attribute name="submitUrl" value="/d/editAdmin.htm" />
    </definition>

    <definition name=".editAdminFormSubmitted_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Admin Submitted" />
      <put-attribute name="ContentTopLt2" value="/views/editAdminFormSubmitted.jsp" />
    </definition>

    <definition name=".deleteAdminConfirm_view" extends=".viewLayout">
      <put-attribute name="title" value="Delete Admin Confirm" />
      <put-attribute name="ContentTopLt2" value="/views/deleteAdminConfirm.jsp" />
    </definition>

    <definition name=".deleteAdminSuccess_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Admin Deleted" />
      <put-attribute name="ContentTopLt2" value="/views/deleteAdminSuccess.jsp" />
    </definition>

    <!-- Team CRUD -->
    <definition name=".listTeams_view" extends=".viewLayout">
      <put-attribute name="title" value="List Teams" />
      <put-attribute name="ContentTopLt2" value="/views/listTeams.jsp" />
    </definition>

    <definition name=".addTeamForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Add Team" />
      <put-attribute name="ContentTopLt2" value=".addTeamContent" />
    </definition>

    <definition name=".addTeamContent" template="/views/editTeamForm.jsp">
      <put-attribute name="pageTitle" value="Add Team" />
      <put-attribute name="submitUrl" value="/d/addTeam.htm" />
    </definition>

    <definition name=".editTeamForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Edit Team" />
      <put-attribute name="ContentTopLt2" value=".editTeamContent" />
    </definition>

    <definition name=".editTeamContent" template="/views/editTeamForm.jsp">
      <put-attribute name="pageTitle" value="Edit Team" />
      <put-attribute name="submitUrl" value="/d/editTeam.htm" />
    </definition>

    <definition name=".editTeamFormSubmitted_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Team Submitted" />
      <put-attribute name="ContentTopLt2" value="/views/editTeamFormSubmitted.jsp" />
    </definition>

    <definition name=".deleteTeamConfirm_view" extends=".viewLayout">
      <put-attribute name="title" value="Delete Team Confirm" />
      <put-attribute name="ContentTopLt2" value="/views/deleteTeamConfirm.jsp" />
    </definition>

    <definition name=".deleteTeamSuccess_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Team Deleted" />
      <put-attribute name="ContentTopLt2" value="/views/deleteTeamSuccess.jsp" />
    </definition>

    <!-- Rank CRUD -->
    <definition name=".listRanks_view" extends=".viewLayout">
      <put-attribute name="title" value="List Ranks" />
      <put-attribute name="ContentTopLt2" value="/views/listRanks.jsp" />
    </definition>

    <!-- CpVisit CRUD -->
    <definition name=".listCpVisits_view" extends=".viewLayout">
      <put-attribute name="title" value="List CP Visits" />
      <put-attribute name="ContentTopLt2" value="/views/listCpVisits.jsp" />
    </definition>

    <definition name=".addCpVisitForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Add CP Visit" />
      <put-attribute name="ContentTopLt2" value=".addCpVisitContent" />
    </definition>

    <definition name=".addCpVisitContent" template="/views/editCpVisitForm.jsp">
      <put-attribute name="pageTitle" value="Add CP Visit" />
      <put-attribute name="submitUrl" value="/d/addCpVisit.htm" />
    </definition>

    <definition name=".editCpVisitForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Edit CP Visit" />
      <put-attribute name="ContentTopLt2" value=".editCpVisitContent" />
    </definition>

    <definition name=".editCpVisitContent" template="/views/editCpVisitForm.jsp">
      <put-attribute name="pageTitle" value="Edit CP Visit" />
      <put-attribute name="submitUrl" value="/d/editCpVisit.htm" />
    </definition>

    <definition name=".editCpVisitFormSubmitted_dashboard" extends=".viewLayout">
      <put-attribute name="title" value="CP Visit Submitted" />
      <put-attribute name="ContentTopLt2" value="/views/editCpVisitFormSubmitted.jsp" />
      <put-attribute name="ContentTopLt3" value="/views/listCpVisits.jsp" />
    </definition>

    <definition name=".deleteCpVisitConfirm_view" extends=".viewLayout">
      <put-attribute name="title" value="Delete CP Visit Confirm" />
      <put-attribute name="ContentTopLt2" value="/views/deleteCpVisitConfirm.jsp" />
    </definition>

    <definition name=".deleteCpVisitSuccess_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="CP Visit Deleted" />
      <put-attribute name="ContentTopLt2" value="/views/deleteCpVisitSuccess.jsp" />
    </definition>

    <!-- CpVisit Batch CRUD -->
    <definition name=".editCpVisitBatchForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Edit CP Visit Batch" />
      <put-attribute name="Script" value=".ScriptEditCpVisitBatch" />
      <put-attribute name="Body" value="/views/BodyEditCpVisitBatch.jsp" />
      <put-attribute name="ContentTopLt2" value=".editCpVisitBatchContent" />
    </definition>

    <definition name=".editCpVisitBatchContent" template="/views/editCpVisitBatchForm.jsp">
      <put-attribute name="pageTitle" value="Edit CP Visit Batch" />
      <put-attribute name="submitUrl" value="/d/editCpVisitBatch.htm" />
    </definition>

    <definition name=".ScriptEditCpVisitBatch" template="/views/Script.jsp">
      <put-list-attribute name="jsfilesList">
	<add-attribute value="http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js" />
	<add-attribute value="/js/jquery.blockUI-2.29.js" />
	<add-attribute value="/js/s3-slider.min.js" />
	<add-attribute value="/js/rdb.js" />
	<add-attribute value="/js/editCpVisitBatch.js" />
      </put-list-attribute>
    </definition>

    <definition name=".editCpVisitBatchFormSubmitted_view" extends=".viewLayout">
      <put-attribute name="title" value="CP Visit Batch Submitted" />
      <put-attribute name="ContentTopLt2" value="/views/editCpVisitBatchFormSubmitted.jsp" />
      <put-attribute name="ContentTopLt3" value="/views/listCpVisits.jsp" />
    </definition>

    <!-- Comparator CRUD -->
    <definition name=".listComparators_view" extends=".viewLayout">
      <put-attribute name="title" value="List Comparators" />
      <put-attribute name="ContentTopLt2" value="/views/listComparators.jsp" />
    </definition>

    <definition name=".addComparatorForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Add Comparator" />
      <put-attribute name="ContentTopLt2" value=".addComparatorContent" />
    </definition>

    <definition name=".addComparatorContent" template="/views/editComparatorForm.jsp">
      <put-attribute name="pageTitle" value="Add Comparator" />
      <put-attribute name="submitUrl" value="/d/addComparator.htm" />
    </definition>

    <definition name=".editComparatorForm_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Edit Comparator" />
      <put-attribute name="ContentTopLt2" value=".editComparatorContent" />
    </definition>

    <definition name=".editComparatorContent" template="/views/editComparatorForm.jsp">
      <put-attribute name="pageTitle" value="Edit Comparator" />
      <put-attribute name="submitUrl" value="/d/editComparator.htm" />
    </definition>

    <definition name=".editComparatorFormSubmitted_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Comparator Submitted" />
      <put-attribute name="ContentTopLt2" value="/views/editComparatorFormSubmitted.jsp" />
    </definition>

    <definition name=".deleteComparatorConfirm_view" extends=".viewLayout">
      <put-attribute name="title" value="Delete Comparator Confirm" />
      <put-attribute name="ContentTopLt2" value="/views/deleteComparatorConfirm.jsp" />
    </definition>

    <definition name=".deleteComparatorSuccess_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Comparator Deleted" />
      <put-attribute name="ContentTopLt2" value="/views/deleteComparatorSuccess.jsp" />
    </definition>

    <!-- Leaderboard Updates -->
    <definition name=".listLbdUpdates_view" extends=".viewLayout">
      <put-attribute name="title" value="List Leaderboard Updates" />
      <put-attribute name="Script" value=".ScriptListLbdUpdates" />
      <put-attribute name="ContentTopLt2" value="/views/listLbdUpdatesVertical.jsp" />
    </definition>

    <definition name=".listLbdUpdates_raw" extends=".rawLayout">
      <put-attribute name="title" value="List Leaderboard Updates" />
      <put-attribute name="Script" value=".ScriptListLbdUpdates" />
      <put-attribute name="ContentTopLt2" value="/views/listLbdUpdatesVertical.jsp" />
    </definition>

    <definition name=".ScriptListLbdUpdates" template="/views/Script.jsp">
      <put-list-attribute name="jsfilesList">
	<add-attribute value="http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js" />
	<add-attribute value="/js/s3-slider.min.js" />
        <add-attribute value="/js/rdb.js" />
	<add-attribute value="/js/lbdupdates.js" />
      </put-list-attribute>
    </definition>

    <!-- Race Updates -->
    <definition name=".listUpdates_view" extends=".viewLayout">
      <put-attribute name="title" value="List Updates" />
      <put-attribute name="Link1" value="/views/LinkUpdates.jsp" />
      <put-attribute name="Script" value=".ScriptListUpdates" />
      <put-attribute name="ContentTopLt2" value="/views/updates.jsp" />
    </definition>

    <definition name=".ScriptListUpdates" template="/views/Script.jsp">
      <put-list-attribute name="jsfilesList">
	<add-attribute value="http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js" />
	<add-attribute value="/js/s3-slider.min.js" />
	<add-attribute value="/js/jquery-ui-1.7.2.min.js" />
        <add-attribute value="/js/rdb.js" />
	<add-attribute value="/js/updates.js" />
      </put-list-attribute>
    </definition>

    <!-- Google Maps views -->
    <definition name=".listControlPointsGmap_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Google Map - Control Points" />
      <put-attribute name="Link1" value="/views/LinkLbd.jsp" />
      <put-attribute name="Script" value=".ScriptListControlPointsGmap" />
      <put-attribute name="ContentTopLt2" value="/views/listControlPointsGmap.jsp" />
      <put-attribute name="ContentTopLt3" value="/views/liveChat.jsp" />
      <put-attribute name="ContentRt1" value="/views/gmapController.jsp" />
    </definition>

    <definition name=".ScriptListControlPointsGmap" template="/views/ScriptListControlPointsGmap.jsp">
      <put-list-attribute name="jsfilesList">
	<add-attribute value="http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js" />
	<add-attribute value="http://www.mytopo.com/google/mytopo.js" />
	<add-attribute value="/js/s3-slider.min.js" />
	<add-attribute value="/js/jquery-ui-1.7.2.min.js" />
	<add-attribute value="/js/rdb.js" />
	<add-attribute value="/js/gmap.js" />
      </put-list-attribute>
    </definition>

    <!-- for add registration flow -->
    <definition name=".addRegistrationSelectEvent_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Registration - Event" />
      <put-attribute name="ContentTopLt2" value="/views/addRegistrationSelectEvent.jsp" />
    </definition>

    <definition name=".addRegistrationSelectCourseDivision_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Registration - Course/Division" />
      <put-attribute name="ContentTopLt2" value="/views/addRegistrationSelectCourseDivision.jsp" />
    </definition>

    <definition name=".addRegistrationSelectMembers_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Registration - Members" />
      <put-attribute name="ContentTopLt2" value="/views/addRegistrationSelectMembers.jsp" />
    </definition>

    <definition name=".addRegistrationEditCompetitors_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Registration - Event" />
      <put-attribute name="ContentTopLt2" value="/views/addRegistrationEditCompetitors.jsp" />
    </definition>

    <definition name=".addRegistrationConfirmation_dashboard" extends=".dashboardLayout">
      <put-attribute name="title" value="Registration - Event" />
      <put-attribute name="ContentTopLt2" value="/views/addRegistrationConfirmation.jsp" />
    </definition>

    <!-- for testing only -->
    <definition name=".test" extends=".viewLayout">
      <put-attribute name="title" value="Test" />
      <put-attribute name="ContentTopLt2" value="/views/test.jsp" />
    </definition>

</tiles-definitions>

redpajama_set_name: RedPajamaGithub


text:
import re, sys

DEFAULT_DIST = 0.0
DEFAULT_LEN = 0

def main(argv):

    # Directions
    if len(argv[1:]) < 1:
        sys.stderr.write('Using defaults - for help, use {0} -h\n'.format(argv[0]))

    min_dist = DEFAULT_DIST
    min_len = DEFAULT_LEN
    words = []

    # help or min distance
    if len(argv[1:]) > 0:
        if argv[1] in '--help':
            print 'Delete single matches to improve monotonicity of alignments'
            print ''
            print 'usage:', argv[0], 'min_rel_dist', 'min_seg_len', \
              'word_list', '<', 'matcher.out', '>', 'matcher.out.mon'
            print ''
            print 'min_rel_dist - minimum relative distance for deletion' + \
              '(default = X)'
            print 'min_seg_len  - minimum segment length (reference) to' + \
              'consider (default = X)'
            print 'word_list    - file of words, one per line, to consider' + \
              'for deletion (default = all words)'
            sys.exit()
        else:
            min_dist = float(argv[1])

    # min length
    if len(argv[1:]) > 1:
        min_len = int(argv[2])

    # word list
    if len(argv[1:]) > 2:
        words_in = open(argv[3])
        for line in words_in:
            words.append(line.strip().split()[0])
        words_in.close()

    # Read alignments
    while True:
        # Next line should be 'Alignment...'
        line = sys.stdin.readline()
        # End of file
        if not line:
            break
        if not line.startswith('Alignment'):
            print 'Error: file does not start with Alignment line'
            print 'Please use exact output of Matcher'
            sys.exit(1)
        print line,
        sen1 = sys.stdin.readline()
        words1 = sen1.split()
        print sen1,
        sen2 = sys.stdin.readline()
        words2 = sen2.split()
        print sen2,
        print sys.stdin.readline(),
        # Read matches
        match_words2 = []
        match_words1 = []
        match_start2 = []
        match_start1 = []
        match_len2 = []
        match_len1 = []
        mods = []
        scores = []
        while True:
            line = sys.stdin.readline()
            if not line.strip():
                break
            m2, m1, mod, score = line.split()
            m2_s, m2_l = map(int, m2.split(':'))
            match_start2.append(m2_s)
            match_len2.append(m2_l)
            match_words2.append(words2[m2_s : m2_s + m2_l])
            m1_s, m1_l = map(int, m1.split(':'))
            match_start1.append(m1_s)
            match_len1.append(m1_l)
            match_words1.append(words1[m1_s : m1_s + m1_l])
            mods.append(mod)
            scores.append(score)
        # For sentences minimum length or above that have more than one match
        if len(words2) >= min_len and len(mods) > 1:
            # Look for stray matches
            for i in range(len(mods)):
                # Phrase matches safe
                if match_len1[i] > 1 or match_len2[i] > 1:
                    continue
                # Words not on list safe
                if words:
                    if words2[match_start2[i]] not in words \
                      and words1[match_start1[i]] not in words:
                        continue
                # Distance from monotonicity with previous match
                if i == 0:
                    dist_prev = 0
                else:
                    dist_prev = abs((match_start1[i] - match_start1[i - 1]) \
                      - (match_start2[i] - match_start2[i - 1]))
                # Distance from monotonicity with next match
                if i == len(mods) - 1:
                    dist_next = 0
                else:
                    dist_next = abs((match_start1[i + 1] - match_start1[i]) \
                      - (match_start2[i + 1] - match_start2[i]))
                # Anchored matches safe
                if i != 0 and dist_next == 0:
                        continue
                if i != len(mods) - 1 and dist_prev == 0:
                    continue
                # Total jump distance
                dist = min(dist_prev, dist_next)
                # Delete if exceeds threshold
                if float(dist) / len(words2) >= min_dist:
                    mods[i] = -1 # dist / len(words2)

        # Write new match lines
        for i in range(len(mods)):
            print '{0}:{1}\t\t\t{2}:{3}\t\t\t{4}\t\t{5}'.format( \
              match_start2[i], match_len2[i], match_start1[i], match_len1[i], \
              mods[i], scores[i])
        print ''

if __name__ == '__main__' : main(sys.argv)


text:
define(function(require, exports, module) {

    var Lazyload = require('echo.js');

    exports.run = function() {
        Lazyload.init();
        $('#free').on('click', function(event) {
        	window.location.href = $(this).val();
        });
    };

});


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Xml;
using System.Web.Caching;
using System.IO;

namespace GroupDocs.Metadata.Live.Demos.UI.Config
{
	/// <summary>
	/// Acts as a helper class for the website's global.asax file
	/// </summary>
	public class GlobalAppHelper
	{
		public GlobalAppHelper(HttpContext hc, HttpApplicationState appState, string SessionID, string language)
		{
			//if (GroupDocsAppsContext.Current == null)
			GroupDocsAppsContext.atcc = new GroupDocsAppsContext(hc); // sync the context

			string ResourcesFile = hc.Server.MapPath("~/App_Data/resources_EN" + ".xml");   // reference all the extra info and resources files
			if (language.Trim() != "")
			{
				string filPath = hc.Server.MapPath("~/App_Data/resources_" + language + ".xml");
				if (File.Exists(filPath))
				{
					ResourcesFile = filPath;
				}
			}

			// Load info from all these files into the cache
			initResources(ResourcesFile, SessionID);
		}
		/// <summary>
		/// Reads/parses the resources file and loads them into the cache in form of a dictionary
		/// </summary>
		/// <param name="ResourcesFile"></param>
		private void initResources(string ResourcesFile, string SessionID)
		{
			SessionID = "R" + SessionID;
			if (GroupDocsAppsContext.Current.Cache[SessionID] == null)
			{
				// Added to solve the file not found problem, the wait is one time only when the application initializes or associated files are modified
				//System.Threading.Thread.Sleep(500);
				Dictionary<string, string> resources = new Dictionary<string, string>();
				XmlDocument xd = new XmlDocument();
				// TextWriter tr = (TextWriter)File.CreateText("F:\\assets\\my.log");tr.WriteLine(ResourcesFile);
				// tr.WriteLine(File.Exists(ResourcesFile)); tr.Close();
				if (ResourcesFile.Trim() != "")
				{
					xd.Load(ResourcesFile);
				}
				XmlNodeList xl = xd.SelectNodes("resources/res"); // use xpath to reach the res tag within resources
				foreach (XmlNode n in xl) // read the name attribute for key name and values from in between the tags
					resources.Add(n.Attributes["name"].Value, n.InnerText);

				// Add this dictionary into the cache with no expiration and associate a reload method in case of file change

				//GroupDocsAppsContext.Current.Cache.Remove(SessionID);
				GroupDocsAppsContext.Current.Cache.Add(
				   SessionID,
					resources,
					new CacheDependency(ResourcesFile),
					Cache.NoAbsoluteExpiration,
					Cache.NoSlidingExpiration,
					CacheItemPriority.NotRemovable,
					delegate (string key, object value, CacheItemRemovedReason reason) { initResources(ResourcesFile, SessionID); });
			}
		}
	}
}


text:
using CodeEditor.ContentTypes;
using CodeEditor.IO;

namespace CodeEditor.Text.Data.Implementation
{
	internal class TextDocument : ITextDocument
	{
		private readonly IFile _file;
		private readonly ITextBuffer _buffer;

		public TextDocument(IFile file, IContentType contentType)
		{
			_file = file;
			_buffer = new TextBuffer(file.ReadAllText(), contentType);
		}

		public IFile File
		{
			get { return _file; }
		}

		public ITextBuffer Buffer
		{
			get { return _buffer; }
		}

		public void Save()
		{
			_file.WriteAllText(_buffer.CurrentSnapshot.Text);
		}
	}
}


text:
<head>
  <script src='//cloud.tinymce.com/stable/tinymce.min.js'></script>
  <script>
  tinymce.init({
    selector: 'textarea',  // change this value according to your HTML
  plugin: 'a_tinymce_plugin',
  a_plugin_option: true,
  a_configuration_option: 400,
  skin: 'lightgray'
  });
  </script>
</head>

<div class="form-group">
    <!-- SERVICE CATEGORY NAME -->
    <?php $service_category_title = $request->get('service_titlename') ? $request->get('service_title') : @$service->service_category_title ?>
    {!! Form::label($title, trans('service::service_admin.title').':') !!}
    {!! Form::textarea($title, $service_category_title, ['class' => 'form-control', 'placeholder' => trans('service::service_admin.title').'']) !!}
    <!-- /SERVICE CATEGORY NAME -->

     <!-- SERVICE CATEGORY ND -->
    <?php $service_category_nd = $request->get('service_titlename') ? $request->get('service_nd') : @$service->service_category_nd ?>
    {!! Form::label($nd, trans('service::service_admin.nd').':') !!}
    {!! Form::textarea($nd, $service_category_nd, ['class' => 'form-control', 'placeholder' => trans('service::service_admin.nd').'']) !!}
    <!-- /SERVICE CATEGORY ND -->

</div>


text:
'use strict';
/* jshint unused: false */

var should = require('chai').should();
var expect = require('chai').expect;
var _ = require('lodash');

var bitcore = require('../../..');
var Transaction = bitcore.Transaction;
var PrivateKey = bitcore.PrivateKey;
var Address = bitcore.Address;
var Script = bitcore.Script;
var Signature = bitcore.crypto.Signature;
var MultiSigScriptHashInput = bitcore.Transaction.Input.MultiSigScriptHash;

describe('MultiSigScriptHashInput', function() {

  var privateKey1 = new PrivateKey('T35QnUj2z2sAg5NHg8n73RaXvrgRQb6Ubk7jeHwYatXDHFvTPJyA');
  var privateKey2 = new PrivateKey('TAE7EKgdc8XHwfuv63iWt6VnKxdjgL587oXXhDmTfYp3n339ANkU');
  var privateKey3 = new PrivateKey('TA2ixrTAf2jULJcrLtrFcXWpcd2RjR4JsDamBGYCPsYHDrUoVdrp');
  var public1 = privateKey1.publicKey;
  var public2 = privateKey2.publicKey;
  var public3 = privateKey3.publicKey;
  var address = new Address('33zbk2aSZYdNbRsMPPt6jgy6Kq1kQreqeb');
  var witnessAddress = new Address([public1, public2, public3], 2, null, Address.PayToWitnessScriptHash);

  var output = {
    address: '33zbk2aSZYdNbRsMPPt6jgy6Kq1kQreqeb',
    txId: '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140',
    outputIndex: 0,
    script: new Script(address),
    satoshis: 1000000
  };

  var witnessOutput = {
    address: 'ltc1qd2kqrwpmz5m6lc42jmgn5vum3ggfkp0kateh6kzqle0jyldwmtxqave7ef',
    txId: '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140',
    outputIndex: 0,
    script: new Script(witnessAddress),
    satoshis: 1000000
  };

  it('can count missing signatures', function() {
    var transaction = new Transaction()
      .from(output, [public1, public2, public3], 2)
      .to(address, 1000000);
    var input = transaction.inputs[0];

    input.countSignatures().should.equal(0);

    transaction.sign(privateKey1);
    input.countSignatures().should.equal(1);
    input.countMissingSignatures().should.equal(1);
    input.isFullySigned().should.equal(false);

    transaction.sign(privateKey2);
    input.countSignatures().should.equal(2);
    input.countMissingSignatures().should.equal(0);
    input.isFullySigned().should.equal(true);
  });
  it('returns a list of public keys with missing signatures', function() {
    var transaction = new Transaction()
      .from(output, [public1, public2, public3], 2)
      .to(address, 1000000);
    var input = transaction.inputs[0];

    _.every(input.publicKeysWithoutSignature(), function(publicKeyMissing) {
      var serialized = publicKeyMissing.toString();
      return serialized === public1.toString() ||
              serialized === public2.toString() ||
              serialized === public3.toString();
    }).should.equal(true);
    transaction.sign(privateKey1);
    _.every(input.publicKeysWithoutSignature(), function(publicKeyMissing) {
      var serialized = publicKeyMissing.toString();
      return serialized === public2.toString() ||
              serialized === public3.toString();
    }).should.equal(true);
  });
  it('can clear all signatures', function() {
    var transaction = new Transaction()
      .from(output, [public1, public2, public3], 2)
      .to(address, 1000000)
      .sign(privateKey1)
      .sign(privateKey2);

    var input = transaction.inputs[0];
    input.isFullySigned().should.equal(true);
    input.clearSignatures();
    input.isFullySigned().should.equal(false);
  });
  it('can estimate how heavy is the output going to be', function() {
    var transaction = new Transaction()
      .from(output, [public1, public2, public3], 2)
      .to(address, 1000000);
    var input = transaction.inputs[0];
    input._estimateSize().should.equal(257);
  });
  it('uses SIGHASH_ALL by default', function() {
    var transaction = new Transaction()
      .from(output, [public1, public2, public3], 2)
      .to(address, 1000000);
    var input = transaction.inputs[0];
    var sigs = input.getSignatures(transaction, privateKey1, 0);
    sigs[0].sigtype.should.equal(Signature.SIGHASH_ALL);
  });
  it('roundtrips to/from object', function() {
    var transaction = new Transaction()
      .from(output, [public1, public2, public3], 2)
      .to(address, 1000000)
      .sign(privateKey1);
    var input = transaction.inputs[0];
    var roundtrip = new MultiSigScriptHashInput(input.toObject());
    roundtrip.toObject().should.deep.equal(input.toObject());
  });
  it('roundtrips to/from object when not signed', function() {
    var transaction = new Transaction()
      .from(output, [public1, public2, public3], 2)
      .to(address, 1000000);
    var input = transaction.inputs[0];
    var roundtrip = new MultiSigScriptHashInput(input.toObject());
    roundtrip.toObject().should.deep.equal(input.toObject());
  });
  it('will get the scriptCode for nested witness', function() {
    var address = Address.createMultisig([public1, public2, public3], 2, 'testnet', true);
    var utxo = {
      address: address.toString(),
      txId: '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140',
      outputIndex: 0,
      script: new Script(address),
      satoshis: 1000000
    };
    var transaction = new Transaction()
      .from(utxo, [public1, public2, public3], 2, true)
      .to(address, 1000000);
    var input = transaction.inputs[0];
    var scriptCode = input.getScriptCode();
    scriptCode.toString('hex').should.equal('695221025c95ec627038e85b5688a9b3d84d28c5ebe66e8c8d697d498e20fe96e3b1ab1d2102cdddfc974d41a62f1f80081deee70592feb7d6e6cf6739d6592edbe7946720e72103c95924e02c240b5545089c69c6432447412b58be43fd671918bd184a5009834353ae');
  });
  it('will get the satoshis buffer for nested witness', function() {
    var address = Address.createMultisig([public1, public2, public3], 2, 'testnet', true);
    var utxo = {
      address: address.toString(),
      txId: '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140',
      outputIndex: 0,
      script: new Script(address),
      satoshis: 1000000
    };
    var transaction = new Transaction()
      .from(utxo, [public1, public2, public3], 2, true)
      .to(address, 1000000);
    var input = transaction.inputs[0];
    var satoshisBuffer = input.getSatoshisBuffer();
    satoshisBuffer.toString('hex').should.equal('40420f0000000000');
  });

  describe('P2WSH', function() {
    it('can count missing signatures', function() {
      var transaction = new Transaction()
        .from(witnessOutput, [public1, public2, public3], 2)
        .to(address, 1000000);
      var input = transaction.inputs[0];

      input.countSignatures().should.equal(0);

      transaction.sign(privateKey1);
      input.countSignatures().should.equal(1);
      input.countMissingSignatures().should.equal(1);
      input.isFullySigned().should.equal(false);

      transaction.sign(privateKey2);
      input.countSignatures().should.equal(2);
      input.countMissingSignatures().should.equal(0);
      input.isFullySigned().should.equal(true);
    });
    it('returns a list of public keys with missing signatures', function() {
      var transaction = new Transaction()
        .from(witnessOutput, [public1, public2, public3], 2)
        .to(address, 1000000);
      var input = transaction.inputs[0];

      _.every(input.publicKeysWithoutSignature(), function(publicKeyMissing) {
        var serialized = publicKeyMissing.toString();
        return serialized === public1.toString() ||
                serialized === public2.toString() ||
                serialized === public3.toString();
      }).should.equal(true);
      transaction.sign(privateKey1);
      _.every(input.publicKeysWithoutSignature(), function(publicKeyMissing) {
        var serialized = publicKeyMissing.toString();
        return serialized === public2.toString() ||
                serialized === public3.toString();
      }).should.equal(true);
    });
    it('can clear all signatures', function() {
      var transaction = new Transaction()
        .from(witnessOutput, [public1, public2, public3], 2)
        .to(address, 1000000)
        .sign(privateKey1)
        .sign(privateKey2);

      var input = transaction.inputs[0];
      input.isFullySigned().should.equal(true);
      input.clearSignatures();
      input.isFullySigned().should.equal(false);
    });
    it('can estimate how heavy is the output going to be', function() {
      var transaction = new Transaction()
        .from(witnessOutput, [public1, public2, public3], 2)
        .to(address, 1000000);
      var input = transaction.inputs[0];
      input._estimateSize().should.equal(64.25);
    });
    it('uses SIGHASH_ALL by default', function() {
      var transaction = new Transaction()
        .from(witnessOutput, [public1, public2, public3], 2)
        .to(address, 1000000);
      var input = transaction.inputs[0];
      var sigs = input.getSignatures(transaction, privateKey1, 0);
      sigs[0].sigtype.should.equal(Signature.SIGHASH_ALL);
    });
    it('roundtrips to/from object', function() {
      var transaction = new Transaction()
        .from(witnessOutput, [public1, public2, public3], 2)
        .to(address, 1000000)
        .sign(privateKey1);
      var input = transaction.inputs[0];
      var roundtrip = new MultiSigScriptHashInput(input.toObject());
      roundtrip.toObject().should.deep.equal(input.toObject());
    });
    it('roundtrips to/from object when not signed', function() {
      var transaction = new Transaction()
        .from(witnessOutput, [public1, public2, public3], 2)
        .to(address, 1000000);
      var input = transaction.inputs[0];
      var roundtrip = new MultiSigScriptHashInput(input.toObject());
      roundtrip.toObject().should.deep.equal(input.toObject());
    });
    it('will get the scriptCode', function() {
      var transaction = new Transaction()
        .from(witnessOutput, [public1, public2, public3], 2, true)
        .to(address, 1000000);
      var input = transaction.inputs[0];
      var scriptCode = input.getScriptCode();
      scriptCode.toString('hex').should.equal('695221025c95ec627038e85b5688a9b3d84d28c5ebe66e8c8d697d498e20fe96e3b1ab1d2102cdddfc974d41a62f1f80081deee70592feb7d6e6cf6739d6592edbe7946720e72103c95924e02c240b5545089c69c6432447412b58be43fd671918bd184a5009834353ae');
    });
    it('will get the satoshis buffer', function() {
      var transaction = new Transaction()
        .from(witnessOutput, [public1, public2, public3], 2, true)
        .to(address, 1000000);
      var input = transaction.inputs[0];
      var satoshisBuffer = input.getSatoshisBuffer();
      satoshisBuffer.toString('hex').should.equal('40420f0000000000');
    });
  });

});


text:
package com.explodingpixels.widgets;

import javax.swing.Icon;

/**
 * An interface for provider's of {@link Icon}s.
 */
public interface IconProvider {

    /**
     * Gets the {@link Icon} for this element.
     *
     * @return the {@code Icon} for this element.
     */
    Icon getIcon();

}


text:
<?php

if ( !class_exists( 'smallermobs_Branding' ) ) {

	/**
	* The Branding module
	*/
	class smallermobs_Branding {

		function __construct() {
			add_action( 'wp_head', array( $this, 'icons' ) );
		}

		function icons() {
			global $ss_settings;

			$favicon_item    = $ss_settings['favicon'];
			$apple_icon_item = $ss_settings['apple_icon'];

			// Add the favicon
			if ( ! empty( $favicon_item['url'] ) && $favicon_item['url'] != '' ) {
				$favicon = smallermobs_Image::_resize( $favicon_item['url'], 32, 32, true, false );

				echo '<link rel="shortcut icon" href="'.$favicon['url'].'" type="image/x-icon" />';
			}

			// Add the apple icons
			if ( ! empty( $apple_icon_item['url'] ) ) {
				$iphone_icon        = smallermobs_Image::_resize( $apple_icon_item['url'], 57, 57, true, false );
				$iphone_icon_retina = smallermobs_Image::_resize( $apple_icon_item['url'], 57, 57, true, true );
				$ipad_icon          = smallermobs_Image::_resize( $apple_icon_item['url'], 72, 72, true, false );
				$ipad_icon_retina   = smallermobs_Image::_resize( $apple_icon_item['url'], 72, 72, true, true );
				?>

				<link rel="apple-touch-icon-precomposed" href="<?php echo $iphone_icon['url'] ?>">
				<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo $iphone_icon_retina['url'] ?>">
				<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php echo $ipad_icon['url'] ?>">
				<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo $ipad_icon_retina['url'] ?>">
				<?php
			}
		}

		/*
		 * The site logo.
		 * If no custom logo is uploaded, use the sitename
		 */
		public static function logo() {
			global $ss_settings;
			$logo  = $ss_settings['logo'];

			if ( ! empty( $logo['url'] ) ) {
				$branding = '';
			} else {
				$branding = '' . get_bloginfo( 'name' ) . '';
			}

			return $branding;
		}
	}
}


text:
package org.springframework.cloud.cloudfoundry.discovery;

import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.cloudfoundry.client.lib.CloudCredentials;
import org.cloudfoundry.client.lib.CloudFoundryClient;
import org.cloudfoundry.client.lib.domain.CloudApplication;
import org.cloudfoundry.client.lib.domain.InstanceInfo;
import org.cloudfoundry.client.lib.domain.InstanceState;
import org.cloudfoundry.client.lib.domain.InstancesInfo;
import org.springframework.cloud.client.DefaultServiceInstance;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.core.env.Environment;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * A Cloud Foundry v2 API-aware implementation of the {@link DiscoveryClient discovery
 * client} SPI. Cloud Foundry already retains a registry of running applications which we
 * expose here as services. Newer versions of Cloud Foundry support instance-specific
 * networking, but as the Cloud Foundry client API doesn't yet support that, this
 * {@link DiscoveryClient implementation doesn't either}.
 *

 * You need to provide an instance of the {@link CloudFoundryClient}. A workable
 * configuration looks like this:
 *

 *
 *

 * @Bean
 * CloudFoundryClient cloudFoundryClient(
 * 		@Value("${MY_CUSTOM_CF_API:https://api.run.pivotal.io}") String api,
 * 		CloudCredentials cc) throws MalformedURLException {
 * 	CloudFoundryClient cloudFoundryClient = new CloudFoundryClient(cc, URI.create(api)
 * 			.toURL());
 * 	cloudFoundryClient.login();
 * 	return cloudFoundryClient;
 * }
 *

 *

 * You can configure all sorts of other things including which Cloud Foundry cloud
 * controller URI to use, how and whether to use an HTTP proxy, and more using alternative
 * constructors. As configured above, the client will talk to all services and
 * applications deployed in all spaces and organizations. Use one of the
 * {@link CloudFoundryClient#CloudFoundryClient(CloudCredentials, URL, String, String)}
 * variants to specify which space and organization to use.
 *

 *
 * @author Josh Long
 * @author Spencer Gibb
 * @author Dave Syer
 */
public class CloudFoundryDiscoveryClient implements DiscoveryClient {

	private static final String DESCRIPTION = "Cloud Foundry "
			+ DiscoveryClient.class.getName() + " implementation";

	private static final Log log = LogFactory.getLog(CloudFoundryDiscoveryClient.class);

	private final ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().build();

	private final CloudFoundryClient cloudFoundryClient;

	private final String vcapApplicationName;

	public CloudFoundryDiscoveryClient(CloudFoundryClient cloudFoundryClient,
			Environment environment) {

		this.cloudFoundryClient = cloudFoundryClient;

		String vcapApplication = environment.getProperty("VCAP_APPLICATION");

		try {
			JsonNode jsonNode = objectMapper.readTree(vcapApplication);
			JsonNode appNameNode = jsonNode.get("application_name");

			this.vcapApplicationName = appNameNode.toString().replaceAll("\"", "");

			log.debug("Current ServiceInstance information...");
			log.debug("\tvcapApplicationName: " + this.vcapApplicationName);

		}
		catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	@Override
	public String description() {
		return DESCRIPTION;
	}

	@Override
	public ServiceInstance getLocalServiceInstance() {
		List<ServiceInstance> serviceInstances = null;
		try {
			CloudApplication application = this.cloudFoundryClient
					.getApplication(this.vcapApplicationName);
			serviceInstances = this
					.createServiceInstancesFromCloudApplications(Collections
							.singletonList(application));
		}
		catch (Exception e) {
			log.warn("Could not determine local service instance: " + e.getClass() + " ("
					+ e.getMessage() + ")");
		}
		return serviceInstances != null && serviceInstances.size() > 0 ? serviceInstances
				.iterator().next() : null;
	}

	@Override
	public List<ServiceInstance> getInstances(String s) {
		CloudApplication applications = this.cloudFoundryClient.getApplication(s);
		return this.createServiceInstancesFromCloudApplications(Collections
				.singletonList(applications));
	}

	private boolean isRunning(CloudApplication ca) {
		InstancesInfo ii = this.cloudFoundryClient.getApplicationInstances(ca);
		List<InstanceInfo> instances;
		if (ii != null && (instances = ii.getInstances()) != null) {
			for (InstanceInfo resolved : instances) {
				InstanceState state = resolved.getState();
				if (state != null && state.equals(InstanceState.RUNNING)) {
					return true;
				}
			}
		}
		return false;
	}

	@Override
	public List<String> getServices() {
		List<String> services = new ArrayList<>();
		List<CloudApplication> applications = this.cloudFoundryClient.getApplications();
		Set<String> serviceIds = new HashSet<>();
		for (CloudApplication ca : applications) {
			if (isRunning(ca)) {
				serviceIds.add(ca.getName());
			}
		}
		services.addAll(serviceIds);
		return services;
	}

	protected List<ServiceInstance> createServiceInstancesFromCloudApplications(
			Collection<CloudApplication> cloudApplications) {
		Set<ServiceInstance> serviceInstances = new HashSet<>();
		for (CloudApplication ca : cloudApplications) {
			if (isRunning(ca)) {
				serviceInstances.add(new CloudFoundryServiceInstance(ca));
			}
		}
		List<ServiceInstance> instances = new ArrayList<>();
		instances.addAll(serviceInstances);
		return instances;
	}

	public static class CloudFoundryServiceInstance extends DefaultServiceInstance {

		private final CloudApplication cloudApplication;

		public CloudApplication getCloudApplication() {
			return cloudApplication;
		}

		public CloudFoundryServiceInstance(CloudApplication ca) {
			super(ca.getName(), ca.getUris().iterator().next(), 80, false);

			this.cloudApplication = ca;
		}
	}
}


text:
Pattern: Unnecessary `block_given?`

Issue: -

## Description

Identifies unnecessary use of a `block_given?` where explicit check of block argument would suffice.

## Examples

```ruby
# bad
def method(&block)
  do_something if block_given?
end

# good
def method(&block)
  do_something if block
end

# good - block is reassigned
def method(&block)
  block ||= -> { do_something }
  warn "Using default ..." unless block_given?
  # ...
end
```

## Further Reading

* [RuboCop - Performance/BlockGivenWithExplicitBlock](https://docs.rubocop.org/rubocop-performance/cops_performance.html#performanceblockgivenwithexplicitblock)


text:
module Qpid::Proton

  # The SASL layer is responsible for establishing an authenticated and/or
  # encrypted tunnel over which AMQP frames are passed between peers.
  #
  # The peer acting as the SASL client must provide authentication
  # credentials.
  #
  # The peer acting as the SASL server must provide authentication against the
  # received credentials.
  #
  # @example
  #   # SCENARIO: the remote endpoint has not initialized their connection
  #   #           then the local endpoint, acting as a SASL server, decides
  #   #           to allow an anonymous connection.
  #   #
  #   #           The SASL layer locally assumes the role of server and then
  #   #           enables anonymous authentication for the remote endpoint.
  #   #
  #   sasl = @transport.sasl
  #   sasl.server
  #   sasl.mechanisms("ANONYMOUS")
  #   sasl.done(Qpid::Proton::SASL::OK)
  #
  class SASL

    # Negotation has not completed.
    NONE = Cproton::PN_SASL_NONE
    # Authentication succeeded.
    OK = Cproton::PN_SASL_OK
    # Authentication failed due to bad credentials.
    AUTH = Cproton::PN_SASL_AUTH

    # Constructs a new instance for the given transport.
    #
    # @param transport [Transport] The transport.
    #
    # @private A SASL should be fetched only from its Transport
    #
    def initialize(transport)
      @impl = Cproton.pn_sasl(transport.impl)
    end

    # Sets the acceptable SASL mechanisms.
    #
    # @param mechanisms [String] The space-delimited set of mechanisms.
    #
    # @example Use anonymous SASL authentication.
    #  @sasl.mechanisms("GSSAPI CRAM-MD5 PLAIN")
    #
    def mechanisms(mechanisms)
      Cproton.pn_sasl_mechanisms(@impl, mechanisms)
    end

    # Returns the outcome of the SASL negotiation.
    #
    # @return [Fixnum] The outcome.
    #
    def outcome
      outcome = Cprotn.pn_sasl_outcome(@impl)
      return nil if outcome == NONE
      outcome
    end

    # Set the condition of the SASL negotiation.
    #
    # @param outcome [Fixnum] The outcome.
    #
    def done(outcome)
      Cproton.pn_sasl_done(@impl, outcome)
    end

  end

end


text:
package org.formula.event;

public interface FormListener {

	public void formPropertyEdited(FormPropertyEditedEvent e);

	public void formInitialized(FormInitializedEvent e);

	public void formPropertyRefreshed(FormPropertyRefreshedEvent e);

	public void formRefreshed(FormRefreshedEvent e);

	public void formCommitted(FormCommittedEvent e);

	public void formRolledBack(FormRolledBackEvent e);

}


text:
package com.digitalplay.network.ireader.common.search;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.util.Assert;

public class SearchFilter {

	public static final String separator = "_";

	private String fieldName;
	private Object value;
	private SearchOperator operator;
    private  String key;

	public SearchFilter(String fieldName, SearchOperator operator, Object value) {
		this.fieldName = fieldName;
		this.value = value;
		this.operator = operator;
		 this.key = this.fieldName + separator + this.operator;
	}

	static SearchFilter newSearchFilter(final String key, final Object value) throws SearchException {

        Assert.notNull(key, "Condition key must not null");

        String[] searchs = StringUtils.split(key, separator);

        if (searchs.length == 0) {
            throw new SearchException("Condition key format must be : property or property_op");
        }

        String searchProperty = searchs[0];

        SearchOperator operator = null;
        if (searchs.length == 1) {
            operator = SearchOperator.custom;
        } else {
            try {
                operator = SearchOperator.valueOf(searchs[1]);
            } catch (IllegalArgumentException e) {
                throw new InvlidSearchOperatorException(searchProperty, searchs[1]);
            }
        }

        boolean allowBlankValue = SearchOperator.isAllowBlankValue(operator);
        boolean isValueBlank = (value == null);
        isValueBlank = isValueBlank || (value instanceof String && StringUtils.isBlank((String) value));
        isValueBlank = isValueBlank || (value instanceof List && ((List) value).size() == 0);
        //过滤掉空值,即不参与查询
        if (!allowBlankValue && isValueBlank) {
            return null;
        }

        SearchFilter searchFilter = newSearchFilter(searchProperty, operator, value);

        return searchFilter;
    }

    static SearchFilter newSearchFilter(final String searchProperty, final SearchOperator operator, final Object value) {
        return new SearchFilter(searchProperty, operator, value);
    }

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public SearchOperator getOperator() {
		return operator;
	}

	public void setOperator(SearchOperator operator) {
		this.operator = operator;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public boolean isUnaryFilter() {
        String operatorStr = getOperator().getSymbol();
        return StringUtils.isNotEmpty(operatorStr) && operatorStr.startsWith("is");
    }

}