text:
package jp.scriptkidie.datacopy.sql.model.educationdb;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class CommunicationLinesExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public CommunicationLinesExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andEquipmentNoIsNull() {
            addCriterion("EQUIPMENT_NO is null");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoIsNotNull() {
            addCriterion("EQUIPMENT_NO is not null");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoEqualTo(Long value) {
            addCriterion("EQUIPMENT_NO =", value, "equipmentNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoNotEqualTo(Long value) {
            addCriterion("EQUIPMENT_NO <>", value, "equipmentNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoGreaterThan(Long value) {
            addCriterion("EQUIPMENT_NO >", value, "equipmentNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoGreaterThanOrEqualTo(Long value) {
            addCriterion("EQUIPMENT_NO >=", value, "equipmentNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoLessThan(Long value) {
            addCriterion("EQUIPMENT_NO <", value, "equipmentNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoLessThanOrEqualTo(Long value) {
            addCriterion("EQUIPMENT_NO <=", value, "equipmentNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoIn(List<Long> values) {
            addCriterion("EQUIPMENT_NO in", values, "equipmentNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoNotIn(List<Long> values) {
            addCriterion("EQUIPMENT_NO not in", values, "equipmentNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoBetween(Long value1, Long value2) {
            addCriterion("EQUIPMENT_NO between", value1, value2, "equipmentNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentNoNotBetween(Long value1, Long value2) {
            addCriterion("EQUIPMENT_NO not between", value1, value2, "equipmentNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoIsNull() {
            addCriterion("EQUIPMENT_REPORT_NO is null");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoIsNotNull() {
            addCriterion("EQUIPMENT_REPORT_NO is not null");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoEqualTo(Integer value) {
            addCriterion("EQUIPMENT_REPORT_NO =", value, "equipmentReportNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoNotEqualTo(Integer value) {
            addCriterion("EQUIPMENT_REPORT_NO <>", value, "equipmentReportNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoGreaterThan(Integer value) {
            addCriterion("EQUIPMENT_REPORT_NO >", value, "equipmentReportNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoGreaterThanOrEqualTo(Integer value) {
            addCriterion("EQUIPMENT_REPORT_NO >=", value, "equipmentReportNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoLessThan(Integer value) {
            addCriterion("EQUIPMENT_REPORT_NO <", value, "equipmentReportNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoLessThanOrEqualTo(Integer value) {
            addCriterion("EQUIPMENT_REPORT_NO <=", value, "equipmentReportNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoIn(List<Integer> values) {
            addCriterion("EQUIPMENT_REPORT_NO in", values, "equipmentReportNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoNotIn(List<Integer> values) {
            addCriterion("EQUIPMENT_REPORT_NO not in", values, "equipmentReportNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoBetween(Integer value1, Integer value2) {
            addCriterion("EQUIPMENT_REPORT_NO between", value1, value2, "equipmentReportNo");
            return (Criteria) this;
        }

        public Criteria andEquipmentReportNoNotBetween(Integer value1, Integer value2) {
            addCriterion("EQUIPMENT_REPORT_NO not between", value1, value2, "equipmentReportNo");
            return (Criteria) this;
        }

        public Criteria andStartYmdIsNull() {
            addCriterion("START_YMD is null");
            return (Criteria) this;
        }

        public Criteria andStartYmdIsNotNull() {
            addCriterion("START_YMD is not null");
            return (Criteria) this;
        }

        public Criteria andStartYmdEqualTo(String value) {
            addCriterion("START_YMD =", value, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdNotEqualTo(String value) {
            addCriterion("START_YMD <>", value, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdGreaterThan(String value) {
            addCriterion("START_YMD >", value, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdGreaterThanOrEqualTo(String value) {
            addCriterion("START_YMD >=", value, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdLessThan(String value) {
            addCriterion("START_YMD <", value, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdLessThanOrEqualTo(String value) {
            addCriterion("START_YMD <=", value, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdLike(String value) {
            addCriterion("START_YMD like", value, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdNotLike(String value) {
            addCriterion("START_YMD not like", value, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdIn(List<String> values) {
            addCriterion("START_YMD in", values, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdNotIn(List<String> values) {
            addCriterion("START_YMD not in", values, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdBetween(String value1, String value2) {
            addCriterion("START_YMD between", value1, value2, "startYmd");
            return (Criteria) this;
        }

        public Criteria andStartYmdNotBetween(String value1, String value2) {
            addCriterion("START_YMD not between", value1, value2, "startYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdIsNull() {
            addCriterion("END_YMD is null");
            return (Criteria) this;
        }

        public Criteria andEndYmdIsNotNull() {
            addCriterion("END_YMD is not null");
            return (Criteria) this;
        }

        public Criteria andEndYmdEqualTo(String value) {
            addCriterion("END_YMD =", value, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdNotEqualTo(String value) {
            addCriterion("END_YMD <>", value, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdGreaterThan(String value) {
            addCriterion("END_YMD >", value, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdGreaterThanOrEqualTo(String value) {
            addCriterion("END_YMD >=", value, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdLessThan(String value) {
            addCriterion("END_YMD <", value, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdLessThanOrEqualTo(String value) {
            addCriterion("END_YMD <=", value, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdLike(String value) {
            addCriterion("END_YMD like", value, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdNotLike(String value) {
            addCriterion("END_YMD not like", value, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdIn(List<String> values) {
            addCriterion("END_YMD in", values, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdNotIn(List<String> values) {
            addCriterion("END_YMD not in", values, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdBetween(String value1, String value2) {
            addCriterion("END_YMD between", value1, value2, "endYmd");
            return (Criteria) this;
        }

        public Criteria andEndYmdNotBetween(String value1, String value2) {
            addCriterion("END_YMD not between", value1, value2, "endYmd");
            return (Criteria) this;
        }

        public Criteria andTelNoDivIsNull() {
            addCriterion("TEL_NO_DIV is null");
            return (Criteria) this;
        }

        public Criteria andTelNoDivIsNotNull() {
            addCriterion("TEL_NO_DIV is not null");
            return (Criteria) this;
        }

        public Criteria andTelNoDivEqualTo(String value) {
            addCriterion("TEL_NO_DIV =", value, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivNotEqualTo(String value) {
            addCriterion("TEL_NO_DIV <>", value, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivGreaterThan(String value) {
            addCriterion("TEL_NO_DIV >", value, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivGreaterThanOrEqualTo(String value) {
            addCriterion("TEL_NO_DIV >=", value, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivLessThan(String value) {
            addCriterion("TEL_NO_DIV <", value, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivLessThanOrEqualTo(String value) {
            addCriterion("TEL_NO_DIV <=", value, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivLike(String value) {
            addCriterion("TEL_NO_DIV like", value, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivNotLike(String value) {
            addCriterion("TEL_NO_DIV not like", value, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivIn(List<String> values) {
            addCriterion("TEL_NO_DIV in", values, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivNotIn(List<String> values) {
            addCriterion("TEL_NO_DIV not in", values, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivBetween(String value1, String value2) {
            addCriterion("TEL_NO_DIV between", value1, value2, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andTelNoDivNotBetween(String value1, String value2) {
            addCriterion("TEL_NO_DIV not between", value1, value2, "telNoDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivIsNull() {
            addCriterion("COMMUNICATION_DIV is null");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivIsNotNull() {
            addCriterion("COMMUNICATION_DIV is not null");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivEqualTo(String value) {
            addCriterion("COMMUNICATION_DIV =", value, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivNotEqualTo(String value) {
            addCriterion("COMMUNICATION_DIV <>", value, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivGreaterThan(String value) {
            addCriterion("COMMUNICATION_DIV >", value, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivGreaterThanOrEqualTo(String value) {
            addCriterion("COMMUNICATION_DIV >=", value, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivLessThan(String value) {
            addCriterion("COMMUNICATION_DIV <", value, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivLessThanOrEqualTo(String value) {
            addCriterion("COMMUNICATION_DIV <=", value, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivLike(String value) {
            addCriterion("COMMUNICATION_DIV like", value, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivNotLike(String value) {
            addCriterion("COMMUNICATION_DIV not like", value, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivIn(List<String> values) {
            addCriterion("COMMUNICATION_DIV in", values, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivNotIn(List<String> values) {
            addCriterion("COMMUNICATION_DIV not in", values, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivBetween(String value1, String value2) {
            addCriterion("COMMUNICATION_DIV between", value1, value2, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andCommunicationDivNotBetween(String value1, String value2) {
            addCriterion("COMMUNICATION_DIV not between", value1, value2, "communicationDiv");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoIsNull() {
            addCriterion("DIAL_PHONE_NO is null");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoIsNotNull() {
            addCriterion("DIAL_PHONE_NO is not null");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoEqualTo(String value) {
            addCriterion("DIAL_PHONE_NO =", value, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoNotEqualTo(String value) {
            addCriterion("DIAL_PHONE_NO <>", value, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoGreaterThan(String value) {
            addCriterion("DIAL_PHONE_NO >", value, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoGreaterThanOrEqualTo(String value) {
            addCriterion("DIAL_PHONE_NO >=", value, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoLessThan(String value) {
            addCriterion("DIAL_PHONE_NO <", value, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoLessThanOrEqualTo(String value) {
            addCriterion("DIAL_PHONE_NO <=", value, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoLike(String value) {
            addCriterion("DIAL_PHONE_NO like", value, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoNotLike(String value) {
            addCriterion("DIAL_PHONE_NO not like", value, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoIn(List<String> values) {
            addCriterion("DIAL_PHONE_NO in", values, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoNotIn(List<String> values) {
            addCriterion("DIAL_PHONE_NO not in", values, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoBetween(String value1, String value2) {
            addCriterion("DIAL_PHONE_NO between", value1, value2, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andDialPhoneNoNotBetween(String value1, String value2) {
            addCriterion("DIAL_PHONE_NO not between", value1, value2, "dialPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoIsNull() {
            addCriterion("NRT_PHONE_NO is null");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoIsNotNull() {
            addCriterion("NRT_PHONE_NO is not null");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoEqualTo(String value) {
            addCriterion("NRT_PHONE_NO =", value, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoNotEqualTo(String value) {
            addCriterion("NRT_PHONE_NO <>", value, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoGreaterThan(String value) {
            addCriterion("NRT_PHONE_NO >", value, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoGreaterThanOrEqualTo(String value) {
            addCriterion("NRT_PHONE_NO >=", value, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoLessThan(String value) {
            addCriterion("NRT_PHONE_NO <", value, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoLessThanOrEqualTo(String value) {
            addCriterion("NRT_PHONE_NO <=", value, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoLike(String value) {
            addCriterion("NRT_PHONE_NO like", value, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoNotLike(String value) {
            addCriterion("NRT_PHONE_NO not like", value, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoIn(List<String> values) {
            addCriterion("NRT_PHONE_NO in", values, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoNotIn(List<String> values) {
            addCriterion("NRT_PHONE_NO not in", values, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoBetween(String value1, String value2) {
            addCriterion("NRT_PHONE_NO between", value1, value2, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNrtPhoneNoNotBetween(String value1, String value2) {
            addCriterion("NRT_PHONE_NO not between", value1, value2, "nrtPhoneNo");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdIsNull() {
            addCriterion("NON_NOTIFICATION_CD is null");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdIsNotNull() {
            addCriterion("NON_NOTIFICATION_CD is not null");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdEqualTo(String value) {
            addCriterion("NON_NOTIFICATION_CD =", value, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdNotEqualTo(String value) {
            addCriterion("NON_NOTIFICATION_CD <>", value, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdGreaterThan(String value) {
            addCriterion("NON_NOTIFICATION_CD >", value, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdGreaterThanOrEqualTo(String value) {
            addCriterion("NON_NOTIFICATION_CD >=", value, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdLessThan(String value) {
            addCriterion("NON_NOTIFICATION_CD <", value, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdLessThanOrEqualTo(String value) {
            addCriterion("NON_NOTIFICATION_CD <=", value, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdLike(String value) {
            addCriterion("NON_NOTIFICATION_CD like", value, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdNotLike(String value) {
            addCriterion("NON_NOTIFICATION_CD not like", value, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdIn(List<String> values) {
            addCriterion("NON_NOTIFICATION_CD in", values, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdNotIn(List<String> values) {
            addCriterion("NON_NOTIFICATION_CD not in", values, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdBetween(String value1, String value2) {
            addCriterion("NON_NOTIFICATION_CD between", value1, value2, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andNonNotificationCdNotBetween(String value1, String value2) {
            addCriterion("NON_NOTIFICATION_CD not between", value1, value2, "nonNotificationCd");
            return (Criteria) this;
        }

        public Criteria andCreateDateIsNull() {
            addCriterion("CREATE_DATE is null");
            return (Criteria) this;
        }

        public Criteria andCreateDateIsNotNull() {
            addCriterion("CREATE_DATE is not null");
            return (Criteria) this;
        }

        public Criteria andCreateDateEqualTo(Date value) {
            addCriterion("CREATE_DATE =", value, "createDate");
            return (Criteria) this;
        }

        public Criteria andCreateDateNotEqualTo(Date value) {
            addCriterion("CREATE_DATE <>", value, "createDate");
            return (Criteria) this;
        }

        public Criteria andCreateDateGreaterThan(Date value) {
            addCriterion("CREATE_DATE >", value, "createDate");
            return (Criteria) this;
        }

        public Criteria andCreateDateGreaterThanOrEqualTo(Date value) {
            addCriterion("CREATE_DATE >=", value, "createDate");
            return (Criteria) this;
        }

        public Criteria andCreateDateLessThan(Date value) {
            addCriterion("CREATE_DATE <", value, "createDate");
            return (Criteria) this;
        }

        public Criteria andCreateDateLessThanOrEqualTo(Date value) {
            addCriterion("CREATE_DATE <=", value, "createDate");
            return (Criteria) this;
        }

        public Criteria andCreateDateIn(List<Date> values) {
            addCriterion("CREATE_DATE in", values, "createDate");
            return (Criteria) this;
        }

        public Criteria andCreateDateNotIn(List<Date> values) {
            addCriterion("CREATE_DATE not in", values, "createDate");
            return (Criteria) this;
        }

        public Criteria andCreateDateBetween(Date value1, Date value2) {
            addCriterion("CREATE_DATE between", value1, value2, "createDate");
            return (Criteria) this;
        }

        public Criteria andCreateDateNotBetween(Date value1, Date value2) {
            addCriterion("CREATE_DATE not between", value1, value2, "createDate");
            return (Criteria) this;
        }

        public Criteria andCreateUserIsNull() {
            addCriterion("CREATE_USER is null");
            return (Criteria) this;
        }

        public Criteria andCreateUserIsNotNull() {
            addCriterion("CREATE_USER is not null");
            return (Criteria) this;
        }

        public Criteria andCreateUserEqualTo(String value) {
            addCriterion("CREATE_USER =", value, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserNotEqualTo(String value) {
            addCriterion("CREATE_USER <>", value, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserGreaterThan(String value) {
            addCriterion("CREATE_USER >", value, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserGreaterThanOrEqualTo(String value) {
            addCriterion("CREATE_USER >=", value, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserLessThan(String value) {
            addCriterion("CREATE_USER <", value, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserLessThanOrEqualTo(String value) {
            addCriterion("CREATE_USER <=", value, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserLike(String value) {
            addCriterion("CREATE_USER like", value, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserNotLike(String value) {
            addCriterion("CREATE_USER not like", value, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserIn(List<String> values) {
            addCriterion("CREATE_USER in", values, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserNotIn(List<String> values) {
            addCriterion("CREATE_USER not in", values, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserBetween(String value1, String value2) {
            addCriterion("CREATE_USER between", value1, value2, "createUser");
            return (Criteria) this;
        }

        public Criteria andCreateUserNotBetween(String value1, String value2) {
            addCriterion("CREATE_USER not between", value1, value2, "createUser");
            return (Criteria) this;
        }

        public Criteria andUpdateDateIsNull() {
            addCriterion("UPDATE_DATE is null");
            return (Criteria) this;
        }

        public Criteria andUpdateDateIsNotNull() {
            addCriterion("UPDATE_DATE is not null");
            return (Criteria) this;
        }

        public Criteria andUpdateDateEqualTo(Date value) {
            addCriterion("UPDATE_DATE =", value, "updateDate");
            return (Criteria) this;
        }

        public Criteria andUpdateDateNotEqualTo(Date value) {
            addCriterion("UPDATE_DATE <>", value, "updateDate");
            return (Criteria) this;
        }

        public Criteria andUpdateDateGreaterThan(Date value) {
            addCriterion("UPDATE_DATE >", value, "updateDate");
            return (Criteria) this;
        }

        public Criteria andUpdateDateGreaterThanOrEqualTo(Date value) {
            addCriterion("UPDATE_DATE >=", value, "updateDate");
            return (Criteria) this;
        }

        public Criteria andUpdateDateLessThan(Date value) {
            addCriterion("UPDATE_DATE <", value, "updateDate");
            return (Criteria) this;
        }

        public Criteria andUpdateDateLessThanOrEqualTo(Date value) {
            addCriterion("UPDATE_DATE <=", value, "updateDate");
            return (Criteria) this;
        }

        public Criteria andUpdateDateIn(List<Date> values) {
            addCriterion("UPDATE_DATE in", values, "updateDate");
            return (Criteria) this;
        }

        public Criteria andUpdateDateNotIn(List<Date> values) {
            addCriterion("UPDATE_DATE not in", values, "updateDate");
            return (Criteria) this;
        }

        public Criteria andUpdateDateBetween(Date value1, Date value2) {
            addCriterion("UPDATE_DATE between", value1, value2, "updateDate");
            return (Criteria) this;
        }

        public Criteria andUpdateDateNotBetween(Date value1, Date value2) {
            addCriterion("UPDATE_DATE not between", value1, value2, "updateDate");
            return (Criteria) this;
        }

        public Criteria andUpdateUserIsNull() {
            addCriterion("UPDATE_USER is null");
            return (Criteria) this;
        }

        public Criteria andUpdateUserIsNotNull() {
            addCriterion("UPDATE_USER is not null");
            return (Criteria) this;
        }

        public Criteria andUpdateUserEqualTo(String value) {
            addCriterion("UPDATE_USER =", value, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserNotEqualTo(String value) {
            addCriterion("UPDATE_USER <>", value, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserGreaterThan(String value) {
            addCriterion("UPDATE_USER >", value, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserGreaterThanOrEqualTo(String value) {
            addCriterion("UPDATE_USER >=", value, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserLessThan(String value) {
            addCriterion("UPDATE_USER <", value, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserLessThanOrEqualTo(String value) {
            addCriterion("UPDATE_USER <=", value, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserLike(String value) {
            addCriterion("UPDATE_USER like", value, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserNotLike(String value) {
            addCriterion("UPDATE_USER not like", value, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserIn(List<String> values) {
            addCriterion("UPDATE_USER in", values, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserNotIn(List<String> values) {
            addCriterion("UPDATE_USER not in", values, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserBetween(String value1, String value2) {
            addCriterion("UPDATE_USER between", value1, value2, "updateUser");
            return (Criteria) this;
        }

        public Criteria andUpdateUserNotBetween(String value1, String value2) {
            addCriterion("UPDATE_USER not between", value1, value2, "updateUser");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}


text:
using Paramore.Darker;
using Paramore.Darker.Attributes;
using Paramore.Darker.Policies;
using Paramore.Darker.QueryLogging;
using SampleMinimalApi.Domain;

namespace SampleMinimalApi.QueryHandlers;

public sealed class GetPersonNameQuery : IQuery<string>
{
    public GetPersonNameQuery(int personId)
    {
        PersonId = personId;
    }

    public int PersonId { get; }
}

public sealed class GetPersonQueryHandler : QueryHandlerAsync<GetPersonNameQuery, string>
{
    [QueryLogging(1)]
    [FallbackPolicy(2)]
    [RetryableQuery(3, DarkerSettings.SomethingWentTerriblyWrongCircuitBreakerName)]
    public override async Task<string> ExecuteAsync(GetPersonNameQuery query,
        CancellationToken cancellationToken = default)
    {
        var repository = new PersonRepository();
        return await repository.GetNameById(query.PersonId, cancellationToken);
    }

    public override Task<string> FallbackAsync(GetPersonNameQuery query, CancellationToken cancellationToken = default)
    {
        // this will happen when the circuit is broken or when the id doesn't exist
        return Task.FromResult("Linus Torvalds");
    }
}

redpajama_set_name: RedPajamaGithub


text:
package jenkins.metrics.api;

import com.codahale.metrics.Metric;
import com.codahale.metrics.MetricSet;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.ExtensionPoint;

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Provides metrics to register.
 */
public abstract class MetricProvider implements ExtensionPoint {
    protected static Map.Entry<String, Metric> metric(String name, Metric metric) {
        return metric == null ? null : new StringImmutableEntry<Metric>(name, metric);
    }

    protected static MetricSet metrics(Map.Entry<String, Metric>... metrics) {
        final Map<String, Metric> result = new LinkedHashMap<String, Metric>(metrics.length);
        for (Map.Entry<String, Metric> metric : metrics) {
            if (metric != null && metric.getValue() != null) {
                result.put(metric.getKey(), metric.getValue());
            }
        }
        return new FixedMetricSet(result);
    }

    protected static MetricSet metrics(Map<String, Metric> metrics) {
        final Map<String, Metric> result = new LinkedHashMap<String, Metric>(metrics.size());
        for (Map.Entry<String, Metric> metric : metrics.entrySet()) {
            if (metric != null && metric.getValue() != null) {
                result.put(metric.getKey(), metric.getValue());
            }
        }
        return new FixedMetricSet(result);
    }

    /**
     * Returns the set of metrics to register.
     *
     * @return the set of metrics to register.
     */
    @NonNull
    public abstract MetricSet getMetricSet();

    private static class FixedMetricSet implements MetricSet {
        private final Map<String, Metric> result;

        public FixedMetricSet(Map<String, Metric> result) {
            this.result = Collections.unmodifiableMap(result);
        }

        public Map<String, Metric> getMetrics() {
            return result;
        }
    }
}


text:
package libble.generalizedLinear

import libble.linalg.{DenseVector, Vector}
import libble.linalg.implicits._

/**
  * In this class, you should give your own gradient of function.
  * We give some instances of different losses.
  * If you want to run optimization on your own function, you should extend
  * this class, and override functions.
  */
abstract class LossFunc extends Serializable {
  /**
    * The gradient of a convex function is obtained by a deltafactor*x (where x is the data point).
    * Here, we return this gradient factor.
    *
    * @param data
    * @param label
    * @param weights
    * @return delta factor
    *
    */

  def deltaF(data: Vector, label: Double, weights: WeightsVector): Vector

  def deltaF(data: Vector, label: Double, weights: Vector): Vector
  /**
    * Here we return the gradient factor and loss.
    *
    * @param data
    * @param label
    * @param weights
    * @return delta cumulate to cum,and loss
    */
  def deltaFWithLoss(data: Vector, label: Double, weights: Vector): (Vector, Double)

  /**
    * Give the prediction on data with the weights.
    *
    * @param data
    * @param weights
    * @return predict Result
    */
  def predict(data: Vector, weights: Vector): Double

  def log1pExp(x: Double): Double = {
    if (x > 0) {
      x + math.log1p(math.exp(-x))
    } else {
      math.log1p(math.exp(x))
    }
  }
}

/**
  * ******************Codes bellow has reference to mllib.optimization._
  */
/**
  * Here we defined the logistic Loss.
  *
  * @param classNum
  */
class LogisticLoss(classNum: Int) extends LossFunc {

  def this() = this(2)

  /**
    * The gradient of a convex function is obtained by a deltafactor*x (where x is the data point).
    * Here, we return this gradient factor.
    *
    * @param data
    * @param label
    * @param weights
    * @return delta factor
    *
    */
  override def deltaF(data: Vector, label: Double, weights: WeightsVector): Vector = {
    require((data.size % weights.size) == 0 || classNum == (weights.size / data.size + 1), "weights size not match!!!")
    classNum match {
      case 2 => {
        val margin = -1.0 * (weights * data)
        val factor = (1.0 / (1.0 + math.exp(margin))) - label
        new DenseVector(Array(factor))
      }
      case _ => {
        val dim = data.size
        var marginY = 0.0
        var maxIndex = 0
        var maxMargin = Double.NegativeInfinity
        val margins = Array.tabulate(classNum - 1) { p =>
          var tMargin = 0.0
          data.foreachActive((i, v) => {
            if (v != 0) {
              tMargin += v * weights(p * dim + i)
            }
          })
          if (p == (label - 1))
            marginY = tMargin
          if (tMargin > maxMargin) {
            maxIndex = p
            maxMargin = tMargin
          }
          tMargin
        }

        val sum = {
          var temp = 0.0
          if (maxMargin > 0) {
            for (i <- 0 until classNum - 1) {
              margins(i) -= maxMargin
              if (i == maxIndex) {
                temp += math.exp(-maxMargin)
              }
              else {
                temp += math.exp(margins(i))
              }
            }
          } else {
            for (i <- 0 until classNum - 1) {
              temp += math.exp(margins(i))
            }
          }
          temp
        }
        val deltaFactor = new Array[Double](classNum - 1)

        for (i <- 0 until classNum - 1) {
          val la = {
            if (label != 0.0 && label == i + 1)
              1.0
            else
              0.0
          }
          deltaFactor(i) = math.exp(margins(i)) / (sum + 1.0) - la
        }

        new DenseVector(deltaFactor)
      }
    }
  }

  def deltaF(data: Vector, label: Double, weights: Vector): Vector= {
    require((data.size % weights.size) == 0 || classNum == (weights.size / data.size + 1), "weights size not match!!!")
    classNum match {
      case 2 => {
        val margin = -1.0 * (weights * data)
        val factor = (1.0 / (1.0 + math.exp(margin))) - label
        new DenseVector(Array(factor))
      }
      case _ => {
        val dim = data.size
        var marginY = 0.0
        var maxIndex = 0
        var maxMargin = Double.NegativeInfinity
        val margins = Array.tabulate(classNum - 1) { p =>
          var tMargin = 0.0
          data.foreachActive((i, v) => {
            if (v != 0) {
              tMargin += v * weights(p * dim + i)
            }
          })
          if (p == (label - 1))
            marginY = tMargin
          if (tMargin > maxMargin) {
            maxIndex = p
            maxMargin = tMargin
          }
          tMargin
        }

        val sum = {
          var temp = 0.0
          if (maxMargin > 0) {
            for (i <- 0 until classNum - 1) {
              margins(i) -= maxMargin
              if (i == maxIndex) {
                temp += math.exp(-maxMargin)
              }
              else {
                temp += math.exp(margins(i))
              }
            }
          } else {
            for (i <- 0 until classNum - 1) {
              temp += math.exp(margins(i))
            }
          }
          temp
        }
        val deltaFactor = new Array[Double](classNum - 1)

        for (i <- 0 until classNum - 1) {
          val la = {
            if (label != 0.0 && label == i + 1)
              1.0
            else
              0.0
          }
          deltaFactor(i) = math.exp(margins(i)) / (sum + 1.0) - la
        }

        new DenseVector(deltaFactor)
      }
    }
  }

  /**
    * Here we return the gradient factor and loss.
    *
    * @param data
    * @param label
    * @param weights
    * @return delta fator,and loss
    */
  override def deltaFWithLoss(data: Vector, label: Double, weights: Vector): (Vector, Double) = {
    require((data.size % weights.size) == 0 || classNum == (weights.size / data.size + 1), "weights size not match!!!")
    classNum match {
      case 2 => {
        val margin = -1.0 * (data * weights)
        val factor = (1.0 / (1.0 + math.exp(margin))) - label
        if (label > 0) {
          (new DenseVector(Array(factor)), log1pExp(margin))
        }
        else {
          (new DenseVector(Array(factor)), log1pExp(margin) - margin)
        }
      }
      case _ => {
        val dim = data.size
        var marginY = 0.0
        var maxIndex = 0
        var maxMargin = Double.NegativeInfinity
        val margins = Array.tabulate(classNum - 1) { p =>
          var tMargin = 0.0
          data.foreachActive((i, v) => {
            if (v != 0.0) {
              tMargin += v * weights(p * dim + i)
            }
          })
          if (p == (label - 1))
            marginY = tMargin
          if (tMargin > maxMargin) {
            maxIndex = p
            maxMargin = tMargin
          }
          tMargin
        }

        val sum = {
          var temp = 0.0
          if (maxMargin > 0) {
            for (i <- 0 until classNum - 1) {
              margins(i) -= maxMargin
              if (i == maxIndex) {
                temp += math.exp(-maxMargin)
              }
              else {
                temp += math.exp(margins(i))
              }
            }
          } else {
            for (i <- 0 until classNum - 1) {
              temp += math.exp(margins(i))
            }
          }
          temp
        }
        val deltaFactor = new Array[Double](classNum - 1)

        for (i <- 0 until classNum - 1) {
          val la = {
            if (label != 0.0 && label == i + 1)
              1.0
            else
              0.0
          }
          deltaFactor(i) = math.exp(margins(i)) / (sum + 1.0) - la
        }
        var loss = {
          if (label > 0.0) {
            math.log1p(sum) - marginY
          } else {
            math.log1p(sum)
          }
        }
        if (maxMargin > 0) {
          loss += maxMargin
        }

        (new DenseVector(deltaFactor), loss)
      }
    }
  }

  /**
    * Give the prediction on data with the weights.
    *
    * @param data
    * @param weights
    * @return predict Result
    */
  override def predict(data: Vector, weights: Vector): Double = {
    require((data.size % weights.size) == 0 || classNum == (weights.size / data.size + 1), "weights size not match!!!")
    classNum match {
      case 2 =>
        val margin = -(data * weights)
        1.0 / log1pExp(margin)
      case _ =>
        var maxMargin = 0.0
        var softMax = 0
        val dataSize = data.size
        for (p <- 0 until classNum) {
          var margin = 0.0
          data.foreachActive((i, v) =>
            margin += v * weights(p * dataSize + i)
          )
          if (margin > maxMargin) {
            maxMargin = margin
            softMax = p
          }

        }
        softMax
    }

  }

}

/**
  * Here we defined the hinge Loss
  */
class HingeLoss extends LossFunc {
  /**
    * The gradient of a convex function is obtained by a deltafactor*x (where x is the data point).
    * Here, we return this gradient factor.
    *
    * @param data
    * @param label
    * @param weights
    * @return delta factor
    *
    */
  override def deltaF(data: Vector, label: Double, weights: WeightsVector): Vector = {
    val innerP = weights * data
    val factor = 2 * label - 1.0
    if (1.0 > factor * innerP) {
      new DenseVector(Array(-factor))
    }
    else {
      new DenseVector(1)
    }
  }

  override def deltaF(data: Vector, label: Double, weights: Vector): Vector = {
    val innerP = weights * data
    val factor = 2 * label - 1.0
    if (1.0 > factor * innerP) {
      new DenseVector(Array(-factor))
    }
    else {
      new DenseVector(1)
    }
  }

  /**
    * Here we return the gradient factor and loss.
    *
    * @param data
    * @param label
    * @param weights
    * @return delta cumulate to cum,and loss
    */
  override def deltaFWithLoss(data: Vector, label: Double, weights: Vector): (Vector, Double) = {
    val innerP = weights * data
    val factor = 2 * label - 1.0
    if (1.0 > factor * innerP) {
      (new DenseVector(Array(-factor)), 1.0 - factor * innerP)
    }
    else {
      (new DenseVector(1), 0.0)
    }
  }

  /**
    * Give the prediction on data with the weights
    *
    * @param data
    * @param weights
    * @return predict Result
    */
  override def predict(data: Vector, weights: Vector): Double = {
    weights * data
  }
}

/**
  * Here we defined the least square Loss.
  */
class LeastSquareLoss extends LossFunc {
  /**
    * The gradient of a convex function is obtained by a deltafactor*x (where x is the data point).
    * Here, we return this gradient factor.
    *
    * @param data
    * @param label
    * @param weights
    * @return delta factor
    *
    */
  override def deltaF(data: Vector, label: Double, weights: WeightsVector): Vector = {
    new DenseVector(Array(weights * data - label))
  }

  override def deltaF(data: Vector, label: Double, weights: Vector): Vector = {
    new DenseVector(Array(weights * data - label))
  }
  /**
    * Here we return the gradient factor and loss.
    *
    * @param data
    * @param label
    * @param weights
    * @return delta cumulate to cum,and loss
    */
  override def deltaFWithLoss(data: Vector, label: Double, weights: Vector): (Vector, Double) = {
    val deltaF = weights * data - label
    (new DenseVector(Array(deltaF)), deltaF * deltaF / 2.0)
  }

  /**
    * Give the prediction on data with the weights.
    *
    * @param data
    * @param weights
    * @return predict Result
    */
  override def predict(data: Vector, weights: Vector): Double = {
    data * weights
  }
}

/** ***********************************************************************************/


text:
package nl.dechateau.vertx.orchestration;

import nl.dechateau.vertx.orchestration.handler.AbstractDecisionHandler;
import nl.dechateau.vertx.orchestration.handler.CallHandler;

/**
 * Interface for the fluent API of the call sequence builder.
 */
public interface CallSyntax {
    CallSyntax addCall(final Class<? extends CallHandler> handler);

    CallSyntax addParallelCalls(final Class<? extends CallHandler>... handlers);

    CallSyntax addDecision(final Class<? extends AbstractDecisionHandler> handler,
                           final ExecutionUnit<?> whenTrue);

    CallSyntax addDecision(final Class<? extends AbstractDecisionHandler> handler,
                           final ExecutionUnit<?> whenTrue, final ExecutionUnit<?> whenFalse);

    CallSequence build();
}


text:
package org.infobip.mobile.messaging.util;

import org.infobip.mobile.messaging.MobileMessagingProperty;
import org.infobip.mobile.messaging.tools.MobileMessagingTestCase;
import org.junit.Test;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;

/**
 * @author sslavin
 * @since 29/08/16.
 */
public class PreferenceHelperTest extends MobileMessagingTestCase {

    @Test
    public void test_privateSharedPrefsNotDeleted_onClearingOfPublicAppPrefs() throws Exception {
        PreferenceHelper.getPublicSharedPreferences(context).edit().clear().commit();
        PreferenceHelper.getPrivateMMSharedPreferences(context).edit().clear().commit();
        PreferenceHelper.saveUsePrivateSharedPrefs(context, false);

        MobileMessagingProperty key1 = MobileMessagingProperty.APP_USER_ID;
        MobileMessagingProperty key2 = MobileMessagingProperty.USER_DATA;
        MobileMessagingProperty key3 = MobileMessagingProperty.UNREPORTED_CUSTOM_ATTRIBUTES;
        String value = "some value";

        // saving to public storage
        PreferenceHelper.saveString(context, key1, value);
        PreferenceHelper.saveString(context, key2, value);
        // saving to private storage
        PreferenceHelper.saveUsePrivateSharedPrefs(context, true);
        PreferenceHelper.saveString(context, key3, value);

        assertTrue(PreferenceHelper.publicPrefsContains(context, key1));
        assertEquals(value, PreferenceHelper.getPublicSharedPreferences(context).getString(key1.getKey(), null));
        assertTrue(PreferenceHelper.publicPrefsContains(context, key2));
        assertEquals(value, PreferenceHelper.getPublicSharedPreferences(context).getString(key2.getKey(), null));
        assertTrue(PreferenceHelper.contains(context, key3));
        assertEquals(value, PreferenceHelper.findString(context, key3));

        PreferenceHelper.getPublicSharedPreferences(context).edit().clear().apply();

        assertFalse(PreferenceHelper.getPublicSharedPreferences(context).contains(key1.getKey()));
        assertFalse(PreferenceHelper.getPublicSharedPreferences(context).contains(key2.getKey()));
        assertFalse(PreferenceHelper.getPublicSharedPreferences(context).contains(key3.getKey()));
        assertTrue(PreferenceHelper.getPrivateMMSharedPreferences(context).contains(key3.getKey()));
        assertEquals(value, PreferenceHelper.getPrivateMMSharedPreferences(context).getString(key3.getKey(), null));
    }

    @Test
    public void test_shouldMigrateSharedPrefsFromPublicToPrivate_publicPrefsPresent() throws Exception {
        PreferenceHelper.getPublicSharedPreferences(context).edit().clear().commit();
        PreferenceHelper.getPrivateMMSharedPreferences(context).edit().clear().commit();
        PreferenceHelper.saveUsePrivateSharedPrefs(context, false);

        MobileMessagingProperty key1 = MobileMessagingProperty.APPLICATION_CODE;
        MobileMessagingProperty key3 = MobileMessagingProperty.PUSH_REGISTRATION_ENABLED;
        String value = "some value";

        // saving to public storage
        PreferenceHelper.saveString(context, key1, value);
        PreferenceHelper.saveBoolean(context, key3, true);

        assertFalse(PreferenceHelper.shouldMigrateToPrivatePrefs(context));
        assertTrue(PreferenceHelper.publicPrefsContains(context, key1));
        assertEquals(value, PreferenceHelper.findString(context, key1));
        assertTrue(PreferenceHelper.publicPrefsContains(context, key3));
        assertTrue(PreferenceHelper.getPublicSharedPreferences(context).getBoolean(key3.getKey(), false));

        // switching to private storage
        PreferenceHelper.saveUsePrivateSharedPrefs(context, true);
        assertTrue(PreferenceHelper.shouldMigrateToPrivatePrefs(context));
        assertFalse(PreferenceHelper.privatePrefsContains(context, key1));
        assertFalse(PreferenceHelper.privatePrefsContains(context, key3));

        // migrate
        PreferenceHelper.migrateToPrivatePrefs(context);

        assertTrue(PreferenceHelper.privatePrefsContains(context, key1));
        assertEquals(value, PreferenceHelper.findString(context, key1));
        assertTrue(PreferenceHelper.privatePrefsContains(context, key3));
        assertTrue(PreferenceHelper.getPrivateMMSharedPreferences(context).getBoolean(key3.getKey(), false));

        // should keep public encrypted prefs
        assertTrue(PreferenceHelper.publicPrefsContains(context, key1));
        assertFalse(PreferenceHelper.publicPrefsContains(context, key3));
    }

    @Test
    public void test_shouldNotMigrateSharedPrefsFromPublicToPrivate() throws Exception {
        MobileMessagingProperty key1 = MobileMessagingProperty.APPLICATION_CODE;
        MobileMessagingProperty key3 = MobileMessagingProperty.PUSH_REGISTRATION_ENABLED;
        String value = "some value";

        assertFalse(PreferenceHelper.shouldMigrateToPrivatePrefs(context));
        assertFalse(PreferenceHelper.publicPrefsContains(context, key1));
        assertFalse(PreferenceHelper.publicPrefsContains(context, key3));

        PreferenceHelper.saveString(context, key1, value);
        PreferenceHelper.saveBoolean(context, key3, true);

        assertFalse(PreferenceHelper.shouldMigrateToPrivatePrefs(context));
        assertTrue(PreferenceHelper.privatePrefsContains(context, key1));
        assertTrue(PreferenceHelper.privatePrefsContains(context, key3));
        assertFalse(PreferenceHelper.publicPrefsContains(context, key1));
        assertFalse(PreferenceHelper.publicPrefsContains(context, key3));
    }

    @Test
    public void test_encryptedPreferencesTest() throws Exception {
        String key = "thisIsMyUnencryptedKey";
        String value = "thisIsMyUnencryptedData";

        PreferenceHelper.saveString(context, key, value, true);
        String foundValue = PreferenceHelper.findString(context, key, null, true);
        String foundUnencryptedValue = PreferenceHelper.findString(context, key, null);

        assertFalse(value.equals(foundUnencryptedValue));
        assertEquals(value, foundValue);
    }

    @Test
    public void test_shouldFindAndRemoveDeviceInstanceIdAsEncryptedProperty() throws Exception {
        PreferenceHelper.saveString(context, MobileMessagingProperty.INFOBIP_REGISTRATION_ID, "StubStringValue");

        assertTrue(PreferenceHelper.contains(context, MobileMessagingProperty.INFOBIP_REGISTRATION_ID));
        assertEquals("StubStringValue", PreferenceHelper.findString(context, MobileMessagingProperty.INFOBIP_REGISTRATION_ID));

        PreferenceHelper.remove(context, MobileMessagingProperty.INFOBIP_REGISTRATION_ID);

        assertFalse(PreferenceHelper.contains(context, MobileMessagingProperty.INFOBIP_REGISTRATION_ID));
        assertNull(PreferenceHelper.findString(context, MobileMessagingProperty.INFOBIP_REGISTRATION_ID));
    }
}


text:
define([], function () {

  // ## The Dataflow Graph
  //
  // In order to be able to forward changes to values which depend on those
  // changes we need to construct a dataflow graph. Each node in this graph
  // will hold a value (or a way of calculating that value). Each edge links
  // a value to other values which depend on it.

  class Node {

    // A node mainly consists of two things: the current value of the node, and
    // an optional function for calculating that value. It will be up to the
    // engine to trigger this calculation as needed.
    constructor(value_or_calculation) {
      this.current_value = null
      this.calculation = null

      // Each node will need a way to track the nodes which depend on it;
      // which nodes are "downstream" from it.
      this.downstream_nodes = new Set()

      // Upon recalculation the set of edges may change, and some existing
      // edges may no longer be needed. In order to be able to clean these up
      // we also track the nodes which were used in the calculation; the nodes
      // "upstream" from this one.
      this.upstream_nodes = new Set()

      // We check the argument to see whether or not it is a function, and set
      // the node's state accordingly. If it is a function we schedule this
      // node for (re-)calculation.
      if (typeof value_or_calculation === 'function') {
        this.calculation = value_or_calculation
        schedule_one_for_recalculation(this)

      } else
        this.current_value = value_or_calculation
    }

    // Recalculation of a node means evaluating its calculation function, and
    // using the result as the new value. In addition to that, we will say
    // whether or not the value actually changed. This information will be
    // useful to the dataflow engine to decide whether or not the downstream
    // nodes will need to be recalculated as well.
    recalculate() {
      let new_value = this.calculation()
      let value_has_changed = new_value != this.current_value
      this.current_value = new_value
      return value_has_changed
    }

    // While a node is being recalculated it may/will need to ask other nodes
    // for their value. When this happens, if we know which node is doing the
    // recalculation, we can link that node as being downstream from this one.
    //
    // Doing it this way means the client doesn't have to encode the links
    // him/herself, making it automatic and less error-prone.
    value() {
      if (node_being_recalculated) {
        this.downstream_nodes.add(node_being_recalculated)
        node_being_recalculated.upstream_nodes.add(this)
      }

      return this.current_value
    }

    // A node's value may also be updated by the client. When this happens, and
    // if the value is a new value, then we will schedule all downstream nodes
    // for recalculation.
    becomes(new_value) {
      if (new_value == this.current_value) return

      this.current_value = new_value
      schedule_all_for_recalculation(this.downstream_nodes)
    }
  }

  // ## The Engine
  //
  // Let's now get to the engine driving the calculations. As a start the
  // engine needs to keep track of which nodes require recalculation. For this
  // we set up a simple queue of the pending nodes.
  let nodes_to_be_recalculated = []

  // The engine will recalculate one node at a time. While it does so, it keeps
  // track of that node so we can use it to link up the dataflow graph (as done
  // in the Node class).
  let node_being_recalculated = null

  // The scheduling function then. We make use of the Javascript runtime to
  // invoke our engine as soon as possible.
  function schedule_engine() {
    if (!node_being_recalculated) setImmediate(run_engine)
  }

  // The above gets wrapped in two utility functions which can request
  // recalculation of one or more nodes. They add any given nodes to the queue,
  // but try to avoid duplicates.
  function schedule_one_for_recalculation(node) {
    if (nodes_to_be_recalculated.indexOf(node) < 0)
      nodes_to_be_recalculated.push(node)

    schedule_engine()
  }

  function schedule_all_for_recalculation(nodes) {
    if (!nodes || nodes.size == 0) return

    for (let node of nodes)
      if (nodes_to_be_recalculated.indexOf(node) < 0)
        nodes_to_be_recalculated.push(node)

    schedule_engine()
  }

  // Which leaves us with the core engine loop. It is really simple: take the
  // next node in the queue (if any) and recalculate it. Keep doing that until
  // there are no more nodes left.
  function run_engine() {
    while (nodes_to_be_recalculated.length > 0) {
      node_being_recalculated = nodes_to_be_recalculated.shift()

      // TODO Allow a node to enable/disable this behaviour ?
      for (let node of node_being_recalculated.upstream_nodes)
        node.downstream_nodes.delete(this)
      node_being_recalculated.upstream_nodes.clear()

      let value_changed = node_being_recalculated.recalculate()

      if (value_changed)
        for (let node of node_being_recalculated.downstream_nodes)
          if (nodes_to_be_recalculated.indexOf(node) < 0)
            nodes_to_be_recalculated.push(node)

      node_being_recalculated = null
    }
  }

  // ## Public API
  //
  // OK, so I'm taking some liberties here in order to make code using this
  // dataflow engine more readable (in my personal opinion).

  return {
    // This is the most basic way of interacting with the engine: it let's you
    // define a new node:
    is: (value_or_fn) => new Node(value_or_fn),
    // So we could now write `this.name = dfntly.is('Once-ler')`. And then we
    // could use `.value()` and `becomes(new_value)` to interact with that node.
    // And that's fine, but we can do better.

    // Javascript has support for getters and setters which will let you use
    // plain old assignment, but route it through some custom methods. So rather
    // than having to write `this.name.becomes('Lorax')` we could write
    // `this.name = Lorax`. So that's what we do here:
    define: (scope, name, value_or_fn) => {
      const node = new Node(value_or_fn)
      Object.defineProperty(scope, name, {
        get() { return node.value() },
        set(value) { node.becomes(value) }
      });
    },
  }

  // And that's our basic dataflow engine established. Now head over to the
  // examples to see it in action !
})


text:
<title> / linq.collections.LinqListFunctionsJava7.ElementAtOrDefault</title>
<link rel="stylesheet" href="..\..\style.css">

linq.collections / LinqListFunctionsJava7 / ElementAtOrDefault

ElementAtOrDefault

fun <ElementType> ElementAtOrDefault(list: AbstractList<ElementType?>, index: Int): ElementType?

Returns the element at the specified index in list or null if the index is out of range

Parameters

list - the collection

index - the index of the item to return

Return

the item at the specified index in list


text:
const test = require('tape')
const nlp = require('../_lib')

test('pos-basic-tag:', function (t) {
  let arr = [
    ['John is pretty', ['Person', 'Copula', 'Adjective']],
    ['John was lofty', ['Person', 'Copula', 'Adjective']],
    ['John Smith was lofty', ['FirstName', 'LastName', 'Copula', 'Adjective']],
    ['asdfes was lofty', ['Noun', 'Copula', 'Adjective']],
    ['asdfes lksejfj was lofty', ['Noun', 'Noun', 'Copula', 'Adjective']],
    ['Spencer Kelly is in Canada', ['Person', 'Person', 'Copula', 'Preposition', 'Place']],
    ['He is in Canada', ['Pronoun', 'Copula', 'Preposition', 'Place']],
    ['5 red roses', ['Value', 'Adjective', 'Noun']],
    ['3 trains', ['Value', 'Noun']],
    ['3 trainers', ['Value', 'Noun']],
    ['5 buses', ['Value', 'Noun']],
    ['101010101010101010101010101010101010101010', ['NumericValue']],

    ['walk the walk', ['Verb', 'Determiner', 'Noun']],
    ['Peter the man', ['Person', 'Determiner', 'Noun']],
    // ['book the flight', ['Verb', 'Determiner', 'Noun']],

    ['one dream', ['Value', 'Singular']],
    ['two dreams', ['Value', 'Plural']],

    // modal verbs
    ['can buy', ['Modal', 'Verb']],
    ['he can', ['Pronoun', 'Verb']],
    ['the can', ['Determiner', 'Noun']],

    ['will earn', ['Modal', 'Verb']],
    ['they will', ['Pronoun', 'Verb']],
    ['the will', ['Determiner', 'Noun']],

    ['may leave', ['Modal', 'Verb']],
    ['they may', ['Pronoun', 'Verb']],
    ['this may', ['Determiner', 'Noun']],

    //slang, contractions
    ['u r nice', ['Pronoun', 'Copula', 'Adjective']],
    ['canadian bacon', ['Demonym', 'Noun']],
    ['canadian dollar', ['Currency', 'Currency']],

    //possessive rules
    ["john lkjsdf's", ['Person', 'Possessive']],
    ["john lkjsdf's house", ['Person', 'Possessive', 'Noun']],
    ["john Lkjsdf's house", ['Person', 'Possessive', 'Noun']],
    ["john Lkjsdf's House", ['Person', 'Possessive', 'Noun']],
    ["mark's question mark", ['Possessive', 'Noun', 'Noun']],

    //question-words
    ['who is good?', ['QuestionWord', 'Copula', 'Adjective']],
    ['which is good?', ['QuestionWord', 'Copula', 'Adjective']],
    // ['bacon which is good', ['Noun', 'Pronoun', 'Copula', 'Adjective']],
    // ['bacon which really is good', ['Noun', 'Pronoun', 'Adverb', 'Copula', 'Adjective']],
    // ['Douglas who really is good', ['Person', 'Pronoun', 'Adverb', 'Copula', 'Adjective']],

    //web text things
    ['lkj@fun.com', ['Email']],
    ['j@f.ti', ['Email']],
    ['j@ti', ['Noun']],
    ['@ti', ['AtMention']],
    ['#funtimes', ['HashTag']],
    ['http://fun.com/cool?fun=yes', ['Url']],
    ['#cool fun.com @cooman', ['HashTag', 'Url', 'AtMention']],

    //determiner-corrections
    ['this rocks dude', ['Determiner', 'Verb', 'Noun']],
    ['that rocks dude', ['Determiner', 'Verb', 'Noun']],
    ['the rocks dude', ['Determiner', 'Plural', 'Noun']],
    ['these rocks dude', ['Determiner', 'Plural', 'Noun']],
    ['those rocks dude', ['Determiner', 'Plural', 'Noun']],
    ['the test string', ['Determiner', 'Noun', 'Noun']],

    //people
    ['John swim', ['Person', 'Verb']],
    ['John, John', ['Person', 'Person']],
    ['John, you', ['FirstName', 'Pronoun']],
    ['John you', ['MaleName', 'Pronoun']],
    ['you John you', ['Pronoun', 'Person', 'Pronoun']],
    // ['10 + 9', ['Value', 'Symbol', 'Value']],
    // ['2 * 90 = 180', ['Value', 'Symbol', 'Value', 'Symbol', 'Value']],
    // ['one - seventy-six', ['Value', 'Symbol', 'Value']],
    ['The stream runs', ['Determiner', 'Noun', 'Verb']],
    ['The stream really runs', ['Determiner', 'Noun', 'Adverb', 'Verb']],
    ['The nice stream really runs', ['Determiner', 'Adjective', 'Noun', 'Adverb', 'Verb']],

    ['he is walking', ['Pronoun', 'Copula', 'Gerund']],
    ['walking is fun', ['Activity', 'Copula', 'Adjective']],
    ["walking's great", ['Activity', 'Copula', 'Adjective']],
    ['jack cheered', ['Person', 'PastTense']],
    ['jack guarded', ['Person', 'PastTense']],
    ['jack is guarded', ['Person', 'Copula', 'Adjective']],
    ['jack seems guarded', ['Person', 'Verb', 'Adjective']],
    //more
    ['there are reasons', ['Noun', 'Copula', 'Plural']],
    ['there were many walks', ['Noun', 'Copula', 'Adjective', 'Plural']],
    ['there were the walks', ['Noun', 'Copula', 'Determiner', 'Noun']],

    ['it was fixed', ['Noun', 'Copula', 'PastTense']],
    ['it will be boxed', ['Noun', 'Verb', 'Verb', 'PastTense']],
    //ambiguous adverbs
    ['it was pretty', ['Noun', 'Copula', 'Adjective']],
    ['it was pretty cool', ['Noun', 'Copula', 'Adverb', 'Adjective']],
    // ['it was really pretty cool', ['Noun', 'Copula', 'Adverb', 'Adverb', 'Adjective']],
    ['it was just', ['Noun', 'Copula', 'Adjective']],
    ['it was just gorgeous', ['Noun', 'Copula', 'Adverb', 'Adjective']],

    ['butterfly', ['Singular']],
    ['he blamed the girl', ['Pronoun', 'PastTense', 'Determiner', 'Singular']],
    ['his fine', ['Possessive', 'Noun']],

    //acronyms
    // ['contracted AIDS', ['PastTense', 'Acronym']],
    ['contacted nbc', ['PastTense', 'Acronym']],
    ['UNESCO', ['Acronym']],
    ['NAFTA', ['Acronym']],

    ['city/town', ['Noun', 'Noun']],
    ['boyfriend to Jane', ['Noun', 'Conjunction', 'Person']],
    // ['boyfriend of Jane', ['Noun', 'Conjunction', 'Person']],
    ['his fines', ['Possessive', 'Noun']],
    ['100+ rumours', ['Value', 'Plural']],
    ['John & John,', ['Noun', 'Noun', 'Noun']],
    // ['i am gutted', ['Noun', 'PastTense', 'Adjective']],
    ['N.V.,', ['Noun']],

    // verb suffixes
    ['lied', ['PastTense']],
    ['lies', ['PresentTense']],
    ['owed', ['PastTense']],
    ['owes', ['PresentTense']],
    ['aced', ['PastTense']],
    ['vied', ['PastTense']],
    ['vies', ['PresentTense']],
    ['husked', ['PastTense']],
    ['husks', ['PresentTense']],
    ['masked', ['PastTense']],
    ['planned', ['PastTense']],
    ['hummed', ['PastTense']],

    // numberrange
    ['it was 1-2 kg woooh', ['Noun', 'PastTense', 'NumberRange', 'NumberRange', 'NumberRange', 'Unit', 'Expression']],
    ['1-1', ['NumberRange', 'NumberRange', 'NumberRange']],
    ['12-12', ['NumberRange', 'NumberRange', 'NumberRange']],
    ['123-123', ['NumberRange', 'NumberRange', 'NumberRange']],
    ['1234-1234', ['Noun']],

    ['bakes', ['PresentTense']],
    ['fakes', ['PresentTense']],
    ['makes', ['PresentTense']],
    ['mistakes', ['PresentTense']],
    ['overtakes', ['PresentTense']],
    ['remakes', ['PresentTense']],
    ['retakes', ['PresentTense']],
    ['forsakes', ['PresentTense']],
    ['shakes', ['PresentTense']],
    ['snakes', ['PresentTense']],
    ['takes', ['PresentTense']],
    ['undertakes', ['PresentTense']],

    ['baked', ['PastTense']],
    ['faked', ['PastTense']],
    ['maked', ['PastTense']],
    ['mistaked', ['PastTense']],
    ['overtook', ['PastTense']],
    ['remaked', ['PastTense']],
    ['retaked', ['PastTense']],
    ['forsaked', ['PastTense']],
    ['shaked', ['PastTense']],
    ['snaked', ['PastTense']],
    ['took', ['PastTense']],
    ['undertook', ['PastTense']],

    //phrasal verb tense
    ['head-over', ['PresentTense', 'Particle']],
    ['head-under', ['PresentTense', 'Particle']],
    ['haze-over', ['PresentTense', 'Particle']],
    ['hazed-over', ['PastTense', 'Particle']],
    ['headed-over', ['PastTense', 'Particle']],
    ['heading-under', ['Gerund', 'Particle']],
    ['healing-over', ['Gerund', 'Particle']],

    //abbreviations
    [
      'col. Patrick said march and feb. etc.',
      ['Abbreviation', 'Person', 'PastTense', 'Month', 'Conjunction', 'Abbreviation', 'Abbreviation'],
    ],
    [`i met April O'neil`, ['Pronoun', 'PastTense', 'Person', 'Person']],

    // adjectives
    ['germans are nice', ['Demonym', 'Verb', 'Adjective']],
    ['Iraqis are nice', ['Plural', 'Copula', 'Adjective']],
    ['canadians are nice', ['ProperNoun', 'Verb', 'Adjective']],
    ['thom is smart', ['ProperNoun', 'Verb', 'Adjective']],

    // [`ANA, ENA, CCP etc.`, ['Acronym', 'Acronym', 'Acronym', 'Abbreviation']],
    [`as disgusting as`, ['Preposition', 'Adjective', 'Preposition']],
    [`more disgusting than`, ['Adverb', 'Adjective', 'Preposition']],
    [`was so nausiating`, ['Copula', 'Adverb', 'Adjective']],
    [`extremely moving`, ['Adverb', 'Adjective']],
    [`each promising image`, ['Determiner', 'Adjective', 'Singular']],
    [`this reckoning`, ['Determiner', 'Noun']],
    [`it was redefining`, ['Pronoun', 'Copula', 'Adjective']],
    [`it was a redefining moment`, ['Pronoun', 'Copula', 'Determiner', 'Adjective', 'Noun']],
    [`he is redefining art`, ['Pronoun', 'Copula', 'Verb', 'Noun']],
    [`revealing his guts`, ['Verb', 'Possessive', 'Plural']],
    // [`the ruling party`, ['Determiner', 'Adjective', 'Singular']],
    [`i found it isolating`, ['Noun', 'PastTense', 'Noun', 'Adjective']],
    // [`promising to leave`, ['Gerund', 'Conjunction', 'Verb']],
    [`distressing us`, ['Gerund', 'Noun']],
    [`loving you`, ['Gerund', 'Noun']],
    [`it was disgusting`, ['Pronoun', 'Copula', 'Adjective']],
    [`dark green`, ['Adverb', 'Adjective']],
    [`kinda sparkly`, ['Adverb', 'Adjective']],
    [`quite stunning`, ['Adverb', 'Adjective']],
    [`slowly stunning`, ['Adverb', 'Verb']],
    [`quite awfully stunning`, ['Adverb', 'Adverb', 'Adjective']],
    [`quite awfully swimming`, ['Adverb', 'Adverb', 'Verb']],
    ['is doing well', ['Copula', 'Gerund', 'Adverb']],
    ['well, no.', ['Expression', 'Negative']],
    ['he is well', ['Pronoun', 'Copula', 'Adjective']],
    ['is well made', ['Copula', 'Adverb', 'Adjective']],
    ['at some point', ['Preposition', 'Determiner', 'Noun']],
    ['to a point', ['Conjunction', 'Determiner', 'Noun']],

    // infinitive-noun
    [`a tv show`, ['Determiner', 'Noun', 'Noun']],
    [`send me a currency report.`, ['Infinitive', 'Pronoun', 'Determiner', 'Noun', 'Noun']],
    // [`a close watch on`, ['Determiner', 'Adjective', 'Noun', 'Preposition']],
    [` a surgery date of`, ['Determiner', 'Noun', 'Noun', 'Preposition']],
    [`A girl hit a boy.`, ['Determiner', 'Noun', 'Infinitive', 'Determiner', 'Noun']],
    [`a auto repair shop.`, ['Determiner', 'Noun', 'Noun', 'Noun']],
    // timezones
    ['Morocco Standard Time', ['Timezone', 'Timezone', 'Timezone']],
    ['GMT+9', ['Timezone']],
    ['3pm EST', ['Time', 'Timezone']],
    ['3pm eastern time', ['Time', 'Timezone', 'Timezone']],
    ['pacific standard time', ['Timezone', 'Timezone', 'Timezone']],
    ['korea daylight time', ['Timezone', 'Timezone', 'Timezone']],
  ]
  arr.forEach(function (a) {
    let terms = nlp(a[0]).json(0).terms
    terms.forEach((term, i) => {
      let tag = a[1][i]
      let found = term.tags.some(tg => tg === tag)
      t.equal(found, true, a[0] + "  - '" + term.text + ' #' + tag)
    })
  })
  t.end()
})


text:
/**
 * Used for matching things. Primarily used to pick out methods to which to
 * apply interceptors.
 */
package org.elasticsearch.common.inject.matcher;


text:
layout: page
title: Pride Temple Solutions Trade Fair
date: 2016-05-24
author: Jeffrey Osborne
tags: weekly links, java
status: published
summary: Nam commodo volutpat sem. Nunc at.
banner: images/banner/leisure-01.jpg
booking:
  startDate: 09/21/2018
  endDate: 09/24/2018
  ctyhocn: HKYNCHX
  groupCode: PTSTF
published: true
---
Duis in mi sagittis, aliquam dolor et, pretium ipsum. Etiam a elementum urna. Sed nec malesuada orci. Ut sollicitudin ligula a dictum tristique. Ut pharetra velit vitae augue tempor, convallis ornare neque consectetur. Donec malesuada pretium tempor. Pellentesque augue neque, volutpat sit amet dictum vitae, pharetra in turpis. Aenean vestibulum dictum mi vitae sollicitudin. Vivamus elit eros, ornare quis dui vel, posuere rutrum quam. Morbi id lectus ligula. Ut lobortis iaculis ligula, in sodales nisl viverra et. Nam tincidunt est leo, ac luctus ex feugiat sit amet. Maecenas eu sodales odio, dapibus tincidunt sem. Praesent nec dolor eu ex elementum imperdiet.

* Quisque finibus ipsum eu ante egestas commodo
* Aenean pulvinar dui et nulla mollis ornare.

Nulla ullamcorper lacus id venenatis sodales. Mauris vestibulum ipsum quam, ac volutpat neque hendrerit id. Donec et erat maximus, sollicitudin eros a, mattis dui. Quisque vel viverra est. Suspendisse urna dui, ornare a hendrerit eu, rhoncus sed ipsum. Aliquam erat volutpat. Quisque non lacinia tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus scelerisque lectus sit amet lectus scelerisque tincidunt. Proin lobortis ante in luctus accumsan. Vivamus aliquet ut urna a ornare.


text:
<!DOCTYPE html>

x

x


text:
<?php

namespace ProAuth\Providers;

class Google extends \ProAuth\OAuth2
{
    /**
     * The API endpoint
     * @var string
     */
    public $apiEndpoint = 'https://www.googleapis.com/oauth2/v1/';

    /**
     * The authorization endpoint
     * @var string
     */
    public $authorizeEndpoint = 'https://accounts.google.com/o/oauth2/auth';

    /**
     * The access token endpoint
     * @var string
     */
    public $tokenEndpoint = 'https://accounts.google.com/o/oauth2/token';
}


text: Rails.application.config.session_store :cookie_store, key: '_bongo_session'


text:
var erato = function() {
	var handleTostarMessage = function(message) {

		toastr.options = {
			"closeButton": true,
			"progressBar": true,
			"positionClass": "toast-top-center",
			"onclick": null,
			"showDuration": "300",
			"hideDuration": "1000",
			"timeOut": "5000",
			"extendedTimeOut": "1000",
			"showEasing": "swing",
			"hideEasing": "linear",
			"showMethod": "fadeIn",
			"hideMethod": "fadeOut"
		};
		toastr['info'](message);
	}

	var handleTopNavActive =  function($dom) {
		$('ul#top-nav').children().removeClass('active');

		$dom.parent().addClass('active');
		$dom.append('');
	}

	/* init datatable with filter */
	var handleInitDatatable = function($dom) {
		var oTable = $dom.DataTable({
			"order": [],

			"lengthMenu": [
				[5, 10, 20, -1],
				[5, 10, 20, "All"] // change per page values here
			],
			// set the initial value
			"pageLength": 10,

			"pagingType": "bootstrap_full_number",

			"language": {
					"lengthMenu": "  _MENU_ 记录",
					"sLengthMenu": "每页 _MENU_ 条记录",
					"sInfo": "显示 _START_ 至 _END_ 共有 _TOTAL_ 条记录",
					"sInfoEmpty": "记录为空",
					"sInfoFiltered": " - 从 _MAX_ 条记录中",
					"sZeroRecords": "结果为空",
					"sSearch": "搜索:",
					"paginate": {
						"previous":"Prev",
						"next": "Next",
						"last": "Last",
						"first": "First"
					}
				},

			"dom": "<'row'<'col-md-6 col-sm-12'l><'col-md-6 col-sm-12'f>r><'table-scrollable't><'row'<'col-md-5 col-sm-12'i><'col-md-7 col-sm-12' p>>", // horizobtal scrollable datatable

			initComplete: function () {
				var api = this.api();

				api.columns().indexes().flatten().each( function ( i ) {
					var column = api.column( i );
					if ($(column.footer()).attr('data-filter') == 'true') {

						var select = $('<select class="form-control"><option value=""></option></select>')
							.appendTo( $(column.footer()).empty() )
							.on( 'change', function () {
								var val = $.fn.dataTable.util.escapeRegex(
									$(this).val()
								);

								column
									.search( val ? '^'+val+'$' : '', true, false )
									.draw();
							});

						column.data().unique().sort().each( function ( d, j ) {
							var re = /<[^>]+>/;
							if (re.test(d)) {
								select.append('<option value="' + $(d).html() + '">' + $(d).html() + '</option>')
							} else {
								select.append('<option value="' + d + '">' + d + '</option>')
							}
						});
					}
				} );
			}
		});

		return oTable;
	}

	var handleInitEditTable = function($dom, $new) {
		function restoreRow(oTable, nRow) {
            var aData = oTable.fnGetData(nRow);
            var jqTds = $('>td', nRow);

            for (var i = 0, iLen = jqTds.length; i < iLen; i++) {
                oTable.fnUpdate(aData[i], nRow, i, false);
            }

            oTable.fnDraw();
        }

        function editRow(oTable, nRow, colLength) {
            var aData = oTable.fnGetData(nRow);
            var jqTds = $('>td', nRow);
			for(var i = 0; i < colLength; i++) {
				jqTds[i].innerHTML = '<input type="text" class="form-control input-small" value="' + aData[i] + '">';
			}
            jqTds[colLength - 2].innerHTML = '保存';
            jqTds[colLength - 1].innerHTML = '取消';
        }

        function saveRow(oTable, nRow, colLength) {
            var jqInputs = $('input', nRow);
			for (var i = 0; i < colLength; i++) {
				oTable.fnUpdate(jqInputs[i].value, nRow, i, false);
			}
            oTable.fnUpdate('编辑', nRow, colLength - 2, false);
            oTable.fnUpdate('删除', nRow, colLength - 1, false);
            oTable.fnDraw();
        }

        function cancelEditRow(oTable, nRow) {
            var jqInputs = $('input', nRow);
            oTable.fnUpdate(jqInputs[0].value, nRow, 0, false);
            oTable.fnUpdate(jqInputs[1].value, nRow, 1, false);
            oTable.fnUpdate(jqInputs[2].value, nRow, 2, false);
            oTable.fnUpdate(jqInputs[3].value, nRow, 3, false);
			oTable.fnUpdate(jqInputs[4].value, nRow, 4, false);
            oTable.fnUpdate('Edit', nRow, 5, false);
            oTable.fnDraw();
        }

        var table = $dom;

        var oTable = table.dataTable({
            "dom": "t",

            "lengthMenu": [
                [5, 15, 20, -1],
                [5, 15, 20, "All"] // change per page values here
            ],
            // set the initial value
            "pageLength": 10,

            "language": {
                "lengthMenu": " _MENU_ records"
            },

            "order": [
                [0, "asc"]
            ] // set first column as a default sort by asc
        });

        var nEditing = null;
        var nNew = false;
		var colLength = oTable.api().columns()[0].length;

        $new.click(function (e) {
            e.preventDefault();

            if (nNew && nEditing) {
                if (confirm("Previose row not saved. Do you want to save it ?")) {
                    saveRow(oTable, nEditing, colLength); // save
                    $(nEditing).find("td:first").html("Untitled");
                    nEditing = null;
                    nNew = false;

                } else {
                    oTable.fnDeleteRow(nEditing); // cancel
                    nEditing = null;
                    nNew = false;

                    return;
                }
            }

			var emptyRow = new Array(colLength);
			for (var i = 0; i < emptyRow.length; i++) {
				emptyRow[i] = '';
			}
            var aiNew = oTable.fnAddData(emptyRow);
            var nRow = oTable.fnGetNodes(aiNew[0]);
            editRow(oTable, nRow, colLength);
            nEditing = nRow;
            nNew = true;
        });

        table.on('click', '.delete', function (e) {
            e.preventDefault();

            if (confirm("是否确认删除本行 ?") == false) {
                return;
            }

            var nRow = $(this).parents('tr')[0];
            oTable.fnDeleteRow(nRow);
            //alert("Deleted! Do not forget to do some ajax to sync with backend :)");
        });

        table.on('click', '.cancel', function (e) {
            e.preventDefault();
            if (nNew) {
                oTable.fnDeleteRow(nEditing);
                nEditing = null;
                nNew = false;
            } else {
                restoreRow(oTable, nEditing);
                nEditing = null;
            }
        });

        table.on('click', '.edit', function (e) {
            e.preventDefault();

            /* Get the row as a parent of the link that was clicked on */
            var nRow = $(this).parents('tr')[0];

            if (nEditing !== null && nEditing != nRow) {
                /* Currently editing - but not this row - restore the old before continuing to edit mode */
                restoreRow(oTable, nEditing);
                editRow(oTable, nRow, colLength);
                nEditing = nRow;
            } else if (nEditing == nRow && this.innerHTML == "Save") {
                /* Editing this row and want to save it */
                saveRow(oTable, nEditing, colLength);
                nEditing = null;
                alert("Updated! Do not forget to do some ajax to sync with backend :)");
            } else {
                /* No edit in progress - let's start one */
                editRow(oTable, nRow, colLength);
                nEditing = nRow;
            }
        });
	}

	var handleInitDatePicker = function($dom, today) {
		if (today == true) {
			$dom.datepicker({
				format: "yyyy-mm-dd",
				weekStart: 7,
				language: "zh-CN",
				autoclose: true,
				todayHighlight: true
			});
		} else {
			$dom.datepicker({
                format: "yyyy-mm-dd",
                weekStart: 7,
                language: "zh-CN",
                autoclose: true
            });
		}
	}

	return {
		showMessage: function(message) {
			handleTostarMessage(message);
		},

		topNavActive: function($dom) {
            handleTopNavActive($dom);
        },

		initDatatable: function($dom) {
			return handleInitDatatable($dom);
		},

		initEditTable: function($dom, $new) {
			return handleInitEditTable($dom, $new);
		},

		initDatePicker: function($dom, today) {
			handleInitDatePicker($dom, today);
		}
	};
}();


text:
(function(f, define){
    define([ "./kendo.core" ], f);
})(function(){

(function() {

(function ($, angular, undefined) {
    if (!kendo.support.customElements) {
        return;
    }
    if (angular && (angular.version.major == 1 || angular.injector)) {
        return;
    }
    var TAGNAMES = {
        editor         : "textarea",
        numerictextbox : "input",
        datepicker     : "input",
        datetimepicker : "input",
        timepicker     : "input",
        autocomplete   : "input",
        colorpicker    : "input",
        maskedtextbox  : "input",
        dropdownlist   : "select",
        multiselect    : "select",
        upload         : "input",
        validator      : "form",
        button         : "button",
        mobilebutton        : "a",
        mobilebackbutton    : "a",
        mobiledetailbutton  : "a",
        listview       : "ul",
        mobilelistview : "ul",
        treeview       : "ul",
        menu           : "ul",
        contextmenu    : "ul",
        actionsheet    : "ul"
    };

    var EVENT_PREFIX = "on-";

    var registered = [];

    kendo.onWidgetRegistered(function(entry) {
        var elementName = entry.prefix + entry.widget.prototype.options.name.toLowerCase();
        if (registered.indexOf(elementName) === -1) {
            registered.push(elementName);
            registerElement(elementName, entry.widget);
        }
    });

    var jsonRegExp = /^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/;
    var jsonFormatRegExp = /^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/;
    var numberRegExp = /^(\+|-?)\d+(\.?)\d*$/;

    function parseOption(element, option) {
        var value = element.getAttribute(option);

        if (value === null) {
            value = undefined;
        } else if (value === "null") {
            value = null;
        } else if (value === "true") {
            value = true;
        } else if (value === "false") {
            value = false;
        } else if (numberRegExp.test(value)) {
            value = parseFloat(value);
        } else if (jsonRegExp.test(value) && !jsonFormatRegExp.test(value)) {
            value = new Function("return (" + value + ")")(); // jshint ignore:line
        }

        return value;
    }

    function parseOptions(element, options) {
        var result = {};

        Object.keys(options).concat("dataSource").forEach(function(name) {
            if (element.hasAttribute(kendo.toHyphens(name))) {
                result[name] = parseOption(element, kendo.toHyphens(name));
            }
        });

        return result;
    }

    function cloneEvent(e) {
        var result = {};

        Object.keys(e).forEach(function(key) {
            if (key[0] != "_") {
                result[key] = e[key];
            }
        });

        return result;
    }

    function eventHandler(eventName, e) {
        var event = document.createEvent("CustomEvent");

        event.initCustomEvent(eventName, /*bubbles*/ false, /*cancelable*/true, cloneEvent(e));

        this.dispatchEvent(event);

        if (event.defaultPrevented) {
            e.preventDefault();
        }
    }

    function expose(component, obj) {
        var props  = Object.keys(obj);
        for(var idx = 0; idx <= props.length; idx++) {
            if(typeof(obj[props[idx]]) === "function"){
                if(!component[props[idx]]) {
                    component[props[idx]] = obj[props[idx]].bind(component.widget);
                }
            }else{
                if (props[idx] === "options") {
                    continue;
                }

                component[props[idx]] = component[props[idx]] || obj[props[idx]];
            }
        }
    }

    function registerElement(name, widget) {
        var options = widget.prototype.options;

        var prototype = Object.create(HTMLElement.prototype);

        Object.defineProperty(prototype, 'options', {
            get: function() {
                return this.widget.options;
            },

            set: function(options) {
                var instance = this.widget;
                options = $.extend(true, {}, instance.options, options);

                var _wrapper = $(instance.wrapper)[0];
                var _element = $(instance.element)[0];

                instance._destroy();

                var newElement = document.createElement(TAGNAMES[name] || "div");

                if (_wrapper && _element) {
                    _wrapper.parentNode.replaceChild(_element, _wrapper);
                    $(_element).replaceWith(newElement);
                }

                if (instance.value) {
                    options.value = instance.value();
                }

                instance.init(newElement, options);

                this.bindEvents();

            }
        });

        prototype.bindEvents = function() {
            widget.prototype.events.forEach(function(eventName) {
                this.widget.bind(eventName, eventHandler.bind(this, eventName));

                if (this.hasAttribute(EVENT_PREFIX + eventName)) {
                    this.bind(eventName, function(e) {
                        window[this.getAttribute(EVENT_PREFIX + eventName)].call(this, e);
                    }.bind(this));
                }
            }.bind(this));
        };

        prototype.attachedCallback = function() {
            var that = this;
            var element = document.createElement(TAGNAMES[name] || "div");

            $(element).append(that.childNodes);
            $(element).attr("class", $(that).attr("class"));
            $(element).attr("style", $(that).attr("style"));
            that.appendChild(element);
            that.widget = new widget(element, parseOptions(that, options));

            var obj = that.widget;
            do {
                expose(that, obj);
            } while ((obj = Object.getPrototypeOf(obj)));

            this.bindEvents();
        };

        prototype.detachedCallback = function() {
            kendo.destroy(this.element);
        };

        kendo.webComponents.push("kendo-" + name);

        document.registerElement("kendo-" + name, {
            prototype: prototype
        });
    }
})(window.kendo.jQuery, window.angular);

})();

return window.kendo;

}, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });


text:
char *kFieldOrder[] = {
	"EUF-GUID",
	"SessionID",
	"AppID",
	"Context",
	NULL
};

P2PContents::P2PContents(void) {
	fDirty = true;
};

P2PContents::~P2PContents(void) {
};

void P2PContents::AddField(const char *field, const char *contents, int32 length) {
	fDirty = true;
	if (length == -1) length = strlen(contents);

	BMallocIO * value = new BMallocIO();
	value->Write(contents, length);

	fFields[field] = value;
};

int32 P2PContents::Fields(void) {
	return fFields.size();
};

int32 P2PContents::FieldAt(int32 index, char *contents) {
	return -1;
};

void P2PContents::AppendContent(char *content, int32 length) {
	fDirty = true;
	if (length == -1) length = strlen(content);

	fContents.Write(content, length);
};

char *P2PContents::Content(void) {
	return (char *)fContents.Buffer();
};

int32 P2PContents::ContentLength(void) {
	return fContents.BufferLength();
};

char *P2PContents::Flatten(void) {
	if (fDirty) {
		fFlattened.SetSize(0);
		fFlattened.Seek(0, SEEK_SET);

		fieldmap::iterator fIt;
		int index = 0;
		char *name = kFieldOrder[index];

		while ((name = kFieldOrder[index++]) != NULL) {
			fIt = fFields.find(name);
			if (fIt != fFields.end()) {
				fFlattened.Write(fIt->first.String(), fIt->first.Length());
				fFlattened.Write(": ", strlen(": "));
				fFlattened.Write((char *)fIt->second->Buffer(), fIt->second->BufferLength());
				fFlattened.Write("\r\n", strlen("\r\n"));
			};
		};

		for (fIt = fFields.begin(); fIt != fFields.end(); fIt++) {
			bool alreadyUsed = false;
			index = 0;
			while ((name = kFieldOrder[index++]) != NULL) {
				if (fIt->first == name) {
					alreadyUsed = true;
					break;
				};
			};
			if (alreadyUsed == false) {
				fFlattened.Write(fIt->first.String(), fIt->first.Length());
				fFlattened.Write(": ", strlen(": "));
				fFlattened.Write((char *)fIt->second->Buffer(), fIt->second->BufferLength());
				fFlattened.Write("\r\n", strlen("\r\n"));
			};
		};

//		fieldmap::iterator fIt;
//		for (fIt = fFields.begin(); fIt != fFields.end(); fIt++) {
//			fFlattened.Write(fIt->first.String(), fIt->first.Length());
//			fFlattened.Write(": ", strlen(": "));
//			fFlattened.Write(fIt->second->Buffer(), fIt->second->BufferLength());
//			fFlattened.Write("\r\n", strlen("\r\n"));
//		};

		fFlattened.Write(fContents.Buffer(), fContents.BufferLength());
		fFlattened.Write("\r\n", strlen("\r\n"));
//		int8 null = 0;
		char null = '\0';
		fFlattened.Write((char *)&null, sizeof(null));

		fDirty = false;
	};

	return (char *)fFlattened.Buffer();
};

int32 P2PContents::FlattenedLength(void) {
	if (fDirty) Flatten();

	return fFlattened.BufferLength();
};

void P2PContents::Debug(void) {
	char *buff = Flatten();
	int32 len = FlattenedLength();

	for (int32 i = 0; i < len; i++) {
		if ((buff[i] == '\n') || (buff[i] == '\r'))
			printf("%c", buff[i]);
		else if ((buff[i] < 0x20) || (buff[i] > 0x7e))
			printf("0x%x", (unsigned char)buff[i]);
		else
			printf("%c", buff[i]);
	};
};


text:
package hudson.model.listeners;

import static org.junit.Assert.assertEquals;

import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.scm.ChangeLogSet;
import hudson.scm.SCM;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.mockito.Mockito;

@SuppressWarnings("deprecation")
public class SCMListenerTest {

    @Issue("JENKINS-23522")
    @SuppressWarnings("rawtypes")
    @Test public void onChangeLogParsed() throws Exception {
        SCM scm = Mockito.mock(SCM.class);
        BuildListener bl = Mockito.mock(BuildListener.class);
        ChangeLogSet cls = Mockito.mock(ChangeLogSet.class);
        AbstractBuild ab = Mockito.mock(AbstractBuild.class);
        AbstractProject ap = Mockito.mock(AbstractProject.class);
        Mockito.when(ab.getProject()).thenReturn(ap);
        Mockito.when(ap.getScm()).thenReturn(scm);
        for (L l : new L[] {new L1(), new L2(), new L3()}) {
            assertEquals(0, l.cnt);
            l.onChangeLogParsed(ab, bl, cls);
            assertEquals(1, l.cnt);
            l.onChangeLogParsed(ab, scm, bl, cls);
            assertEquals(2, l.cnt);
        }
        Run r = Mockito.mock(Run.class);
        TaskListener tl = Mockito.mock(TaskListener.class);
        L l = new L1();
        l.onChangeLogParsed(r, scm, tl, cls);
        assertEquals("cannot handle this", 0, l.cnt);
        l = new L2();
        l.onChangeLogParsed(r, scm, tl, cls);
        assertEquals("does handle this", 1, l.cnt);
        l = new L3();
        l.onChangeLogParsed(r, scm, tl, cls);
        assertEquals("cannot handle this", 0, l.cnt);
    }

    private static class L extends SCMListener {
        int cnt;
    }

    private static class L1 extends L {
        @Override public void onChangeLogParsed(AbstractBuild<?, ?> build, BuildListener listener, ChangeLogSet<?> changelog) {
            cnt++;
        }
    }

    private static class L2 extends L {
        @Override public void onChangeLogParsed(Run<?, ?> build, SCM scm, TaskListener listener, ChangeLogSet<?> changelog) {
            cnt++;
        }
    }

    private static class L3 extends L {
        @Override public void onChangeLogParsed(AbstractBuild<?, ?> build, BuildListener listener, ChangeLogSet<?> changelog) throws Exception {
            cnt++;
            super.onChangeLogParsed(build, listener, changelog);
        }
    }

}