text:
package org.docksidestage.postgresql.dbflute.cbean.cq.bs;

import java.util.*;

import org.dbflute.cbean.*;
import org.dbflute.cbean.chelper.*;
import org.dbflute.cbean.ckey.*;
import org.dbflute.cbean.coption.*;
import org.dbflute.cbean.cvalue.ConditionValue;
import org.dbflute.cbean.ordering.*;
import org.dbflute.cbean.scoping.*;
import org.dbflute.cbean.sqlclause.SqlClause;
import org.dbflute.dbmeta.DBMetaProvider;
import org.docksidestage.postgresql.dbflute.allcommon.*;
import org.docksidestage.postgresql.dbflute.cbean.*;
import org.docksidestage.postgresql.dbflute.cbean.cq.*;

/**
 * The abstract condition-query of summary_product.
 * @author DBFlute(AutoGenerator)
 */
public abstract class AbstractBsSummaryProductCQ extends AbstractConditionQuery {

    // ===================================================================================
    //                                                                         Constructor
    //                                                                         ===========
    public AbstractBsSummaryProductCQ(ConditionQuery referrerQuery, SqlClause sqlClause, String aliasName, int nestLevel) {
        super(referrerQuery, sqlClause, aliasName, nestLevel);
    }

    // ===================================================================================
    //                                                                             DB Meta
    //                                                                             =======
    @Override
    protected DBMetaProvider xgetDBMetaProvider() {
        return DBMetaInstanceHandler.getProvider();
    }

    public String asTableDbName() {
        return "summary_product";
    }

    // ===================================================================================
    //                                                                               Query
    //                                                                               =====
    /**
     * Equal(=). And NullIgnored, OnlyOnceRegistered.

     * product_id: {int4(10)}
     * @param productId The value of productId as equal. (basically NotNull: error as default, or no condition as option)
     */
    public void setProductId_Equal(Integer productId) {
        doSetProductId_Equal(productId);
    }

    protected void doSetProductId_Equal(Integer productId) {
        regProductId(CK_EQ, productId);
    }

    /**
     * GreaterThan(>). And NullIgnored, OnlyOnceRegistered.

     * product_id: {int4(10)}
     * @param productId The value of productId as greaterThan. (basically NotNull: error as default, or no condition as option)
     */
    public void setProductId_GreaterThan(Integer productId) {
        regProductId(CK_GT, productId);
    }

    /**
     * LessThan(<). And NullIgnored, OnlyOnceRegistered.

     * product_id: {int4(10)}
     * @param productId The value of productId as lessThan. (basically NotNull: error as default, or no condition as option)
     */
    public void setProductId_LessThan(Integer productId) {
        regProductId(CK_LT, productId);
    }

    /**
     * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered.

     * product_id: {int4(10)}
     * @param productId The value of productId as greaterEqual. (basically NotNull: error as default, or no condition as option)
     */
    public void setProductId_GreaterEqual(Integer productId) {
        regProductId(CK_GE, productId);
    }

    /**
     * LessEqual(<=). And NullIgnored, OnlyOnceRegistered.

     * product_id: {int4(10)}
     * @param productId The value of productId as lessEqual. (basically NotNull: error as default, or no condition as option)
     */
    public void setProductId_LessEqual(Integer productId) {
        regProductId(CK_LE, productId);
    }

    /**
     * RangeOf with various options. (versatile)

     * {(default) minNumber <= column <= maxNumber}

     * And NullIgnored, OnlyOnceRegistered.

     * product_id: {int4(10)}
     * @param minNumber The min number of productId. (basically NotNull: if op.allowOneSide(), null allowed)
     * @param maxNumber The max number of productId. (basically NotNull: if op.allowOneSide(), null allowed)
     * @param opLambda The callback for option of range-of. (NotNull)
     */
    public void setProductId_RangeOf(Integer minNumber, Integer maxNumber, ConditionOptionCall<RangeOfOption> opLambda) {
        setProductId_RangeOf(minNumber, maxNumber, xcROOP(opLambda));
    }

    /**
     * RangeOf with various options. (versatile)

     * {(default) minNumber <= column <= maxNumber}

     * And NullIgnored, OnlyOnceRegistered.

     * product_id: {int4(10)}
     * @param minNumber The min number of productId. (basically NotNull: if op.allowOneSide(), null allowed)
     * @param maxNumber The max number of productId. (basically NotNull: if op.allowOneSide(), null allowed)
     * @param rangeOfOption The option of range-of. (NotNull)
     */
    public void setProductId_RangeOf(Integer minNumber, Integer maxNumber, RangeOfOption rangeOfOption) {
        regROO(minNumber, maxNumber, xgetCValueProductId(), "product_id", rangeOfOption);
    }

    /**
     * InScope {in (1, 2)}. And NullIgnored, NullElementIgnored, SeveralRegistered.

     * product_id: {int4(10)}
     * @param productIdList The collection of productId as inScope. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductId_InScope(Collection<Integer> productIdList) {
        doSetProductId_InScope(productIdList);
    }

    protected void doSetProductId_InScope(Collection<Integer> productIdList) {
        regINS(CK_INS, cTL(productIdList), xgetCValueProductId(), "product_id");
    }

    /**
     * NotInScope {not in (1, 2)}. And NullIgnored, NullElementIgnored, SeveralRegistered.

     * product_id: {int4(10)}
     * @param productIdList The collection of productId as notInScope. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductId_NotInScope(Collection<Integer> productIdList) {
        doSetProductId_NotInScope(productIdList);
    }

    protected void doSetProductId_NotInScope(Collection<Integer> productIdList) {
        regINS(CK_NINS, cTL(productIdList), xgetCValueProductId(), "product_id");
    }

    /**
     * IsNull {is null}. And OnlyOnceRegistered.

     * product_id: {int4(10)}
     */
    public void setProductId_IsNull() { regProductId(CK_ISN, DOBJ); }

    /**
     * IsNotNull {is not null}. And OnlyOnceRegistered.

     * product_id: {int4(10)}
     */
    public void setProductId_IsNotNull() { regProductId(CK_ISNN, DOBJ); }

    protected void regProductId(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueProductId(), "product_id"); }
    protected abstract ConditionValue xgetCValueProductId();

    /**
     * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered.

     * product_name: {varchar(50)}
     * @param productName The value of productName as equal. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductName_Equal(String productName) {
        doSetProductName_Equal(fRES(productName));
    }

    protected void doSetProductName_Equal(String productName) {
        regProductName(CK_EQ, productName);
    }

    /**
     * NotEqual(<>). And NullOrEmptyIgnored, OnlyOnceRegistered.

     * product_name: {varchar(50)}
     * @param productName The value of productName as notEqual. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductName_NotEqual(String productName) {
        doSetProductName_NotEqual(fRES(productName));
    }

    protected void doSetProductName_NotEqual(String productName) {
        regProductName(CK_NES, productName);
    }

    /**
     * InScope {in ('a', 'b')}. And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered.

     * product_name: {varchar(50)}
     * @param productNameList The collection of productName as inScope. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductName_InScope(Collection<String> productNameList) {
        doSetProductName_InScope(productNameList);
    }

    protected void doSetProductName_InScope(Collection<String> productNameList) {
        regINS(CK_INS, cTL(productNameList), xgetCValueProductName(), "product_name");
    }

    /**
     * NotInScope {not in ('a', 'b')}. And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered.

     * product_name: {varchar(50)}
     * @param productNameList The collection of productName as notInScope. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductName_NotInScope(Collection<String> productNameList) {
        doSetProductName_NotInScope(productNameList);
    }

    protected void doSetProductName_NotInScope(Collection<String> productNameList) {
        regINS(CK_NINS, cTL(productNameList), xgetCValueProductName(), "product_name");
    }

    /**
     * LikeSearch with various options. (versatile) {like '%xxx%' escape ...}. And NullOrEmptyIgnored, SeveralRegistered.

     * product_name: {varchar(50)}

     *
e.g. setProductName_LikeSearch("xxx", op -> op.likeContain());

     * @param productName The value of productName as likeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option)
     * @param opLambda The callback for option of like-search. (NotNull)
     */
    public void setProductName_LikeSearch(String productName, ConditionOptionCall<LikeSearchOption> opLambda) {
        setProductName_LikeSearch(productName, xcLSOP(opLambda));
    }

    /**
     * LikeSearch with various options. (versatile) {like '%xxx%' escape ...}. And NullOrEmptyIgnored, SeveralRegistered.

     * product_name: {varchar(50)}

     *
e.g. setProductName_LikeSearch("xxx", new LikeSearchOption().likeContain());

     * @param productName The value of productName as likeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option)
     * @param likeSearchOption The option of like-search. (NotNull)
     */
    public void setProductName_LikeSearch(String productName, LikeSearchOption likeSearchOption) {
        regLSQ(CK_LS, fRES(productName), xgetCValueProductName(), "product_name", likeSearchOption);
    }

    /**
     * NotLikeSearch with various options. (versatile) {not like 'xxx%' escape ...}

     * And NullOrEmptyIgnored, SeveralRegistered.

     * product_name: {varchar(50)}
     * @param productName The value of productName as notLikeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option)
     * @param opLambda The callback for option of like-search. (NotNull)
     */
    public void setProductName_NotLikeSearch(String productName, ConditionOptionCall<LikeSearchOption> opLambda) {
        setProductName_NotLikeSearch(productName, xcLSOP(opLambda));
    }

    /**
     * NotLikeSearch with various options. (versatile) {not like 'xxx%' escape ...}

     * And NullOrEmptyIgnored, SeveralRegistered.

     * product_name: {varchar(50)}
     * @param productName The value of productName as notLikeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option)
     * @param likeSearchOption The option of not-like-search. (NotNull)
     */
    public void setProductName_NotLikeSearch(String productName, LikeSearchOption likeSearchOption) {
        regLSQ(CK_NLS, fRES(productName), xgetCValueProductName(), "product_name", likeSearchOption);
    }

    /**
     * PrefixSearch {like 'xxx%' escape ...}. And NullOrEmptyIgnored, SeveralRegistered.

     * product_name: {varchar(50)}
     * @param productName The value of productName as prefixSearch. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductName_PrefixSearch(String productName) {
        setProductName_LikeSearch(productName, xcLSOPPre());
    }

    /**
     * IsNull {is null}. And OnlyOnceRegistered.

     * product_name: {varchar(50)}
     */
    public void setProductName_IsNull() { regProductName(CK_ISN, DOBJ); }

    /**
     * IsNullOrEmpty {is null or empty}. And OnlyOnceRegistered.

     * product_name: {varchar(50)}
     */
    public void setProductName_IsNullOrEmpty() { regProductName(CK_ISNOE, DOBJ); }

    /**
     * IsNotNull {is not null}. And OnlyOnceRegistered.

     * product_name: {varchar(50)}
     */
    public void setProductName_IsNotNull() { regProductName(CK_ISNN, DOBJ); }

    protected void regProductName(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueProductName(), "product_name"); }
    protected abstract ConditionValue xgetCValueProductName();

    /**
     * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered.

     * product_status_code: {bpchar(3)}
     * @param productStatusCode The value of productStatusCode as equal. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductStatusCode_Equal(String productStatusCode) {
        doSetProductStatusCode_Equal(fRES(productStatusCode));
    }

    protected void doSetProductStatusCode_Equal(String productStatusCode) {
        regProductStatusCode(CK_EQ, productStatusCode);
    }

    /**
     * NotEqual(<>). And NullOrEmptyIgnored, OnlyOnceRegistered.

     * product_status_code: {bpchar(3)}
     * @param productStatusCode The value of productStatusCode as notEqual. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductStatusCode_NotEqual(String productStatusCode) {
        doSetProductStatusCode_NotEqual(fRES(productStatusCode));
    }

    protected void doSetProductStatusCode_NotEqual(String productStatusCode) {
        regProductStatusCode(CK_NES, productStatusCode);
    }

    /**
     * InScope {in ('a', 'b')}. And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered.

     * product_status_code: {bpchar(3)}
     * @param productStatusCodeList The collection of productStatusCode as inScope. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductStatusCode_InScope(Collection<String> productStatusCodeList) {
        doSetProductStatusCode_InScope(productStatusCodeList);
    }

    protected void doSetProductStatusCode_InScope(Collection<String> productStatusCodeList) {
        regINS(CK_INS, cTL(productStatusCodeList), xgetCValueProductStatusCode(), "product_status_code");
    }

    /**
     * NotInScope {not in ('a', 'b')}. And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered.

     * product_status_code: {bpchar(3)}
     * @param productStatusCodeList The collection of productStatusCode as notInScope. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductStatusCode_NotInScope(Collection<String> productStatusCodeList) {
        doSetProductStatusCode_NotInScope(productStatusCodeList);
    }

    protected void doSetProductStatusCode_NotInScope(Collection<String> productStatusCodeList) {
        regINS(CK_NINS, cTL(productStatusCodeList), xgetCValueProductStatusCode(), "product_status_code");
    }

    /**
     * LikeSearch with various options. (versatile) {like '%xxx%' escape ...}. And NullOrEmptyIgnored, SeveralRegistered.

     * product_status_code: {bpchar(3)}

     *
e.g. setProductStatusCode_LikeSearch("xxx", op -> op.likeContain());

     * @param productStatusCode The value of productStatusCode as likeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option)
     * @param opLambda The callback for option of like-search. (NotNull)
     */
    public void setProductStatusCode_LikeSearch(String productStatusCode, ConditionOptionCall<LikeSearchOption> opLambda) {
        setProductStatusCode_LikeSearch(productStatusCode, xcLSOP(opLambda));
    }

    /**
     * LikeSearch with various options. (versatile) {like '%xxx%' escape ...}. And NullOrEmptyIgnored, SeveralRegistered.

     * product_status_code: {bpchar(3)}

     *
e.g. setProductStatusCode_LikeSearch("xxx", new LikeSearchOption().likeContain());

     * @param productStatusCode The value of productStatusCode as likeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option)
     * @param likeSearchOption The option of like-search. (NotNull)
     */
    public void setProductStatusCode_LikeSearch(String productStatusCode, LikeSearchOption likeSearchOption) {
        regLSQ(CK_LS, fRES(productStatusCode), xgetCValueProductStatusCode(), "product_status_code", likeSearchOption);
    }

    /**
     * NotLikeSearch with various options. (versatile) {not like 'xxx%' escape ...}

     * And NullOrEmptyIgnored, SeveralRegistered.

     * product_status_code: {bpchar(3)}
     * @param productStatusCode The value of productStatusCode as notLikeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option)
     * @param opLambda The callback for option of like-search. (NotNull)
     */
    public void setProductStatusCode_NotLikeSearch(String productStatusCode, ConditionOptionCall<LikeSearchOption> opLambda) {
        setProductStatusCode_NotLikeSearch(productStatusCode, xcLSOP(opLambda));
    }

    /**
     * NotLikeSearch with various options. (versatile) {not like 'xxx%' escape ...}

     * And NullOrEmptyIgnored, SeveralRegistered.

     * product_status_code: {bpchar(3)}
     * @param productStatusCode The value of productStatusCode as notLikeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option)
     * @param likeSearchOption The option of not-like-search. (NotNull)
     */
    public void setProductStatusCode_NotLikeSearch(String productStatusCode, LikeSearchOption likeSearchOption) {
        regLSQ(CK_NLS, fRES(productStatusCode), xgetCValueProductStatusCode(), "product_status_code", likeSearchOption);
    }

    /**
     * PrefixSearch {like 'xxx%' escape ...}. And NullOrEmptyIgnored, SeveralRegistered.

     * product_status_code: {bpchar(3)}
     * @param productStatusCode The value of productStatusCode as prefixSearch. (basically NotNull, NotEmpty: error as default, or no condition as option)
     */
    public void setProductStatusCode_PrefixSearch(String productStatusCode) {
        setProductStatusCode_LikeSearch(productStatusCode, xcLSOPPre());
    }

    /**
     * IsNull {is null}. And OnlyOnceRegistered.

     * product_status_code: {bpchar(3)}
     */
    public void setProductStatusCode_IsNull() { regProductStatusCode(CK_ISN, DOBJ); }

    /**
     * IsNullOrEmpty {is null or empty}. And OnlyOnceRegistered.

     * product_status_code: {bpchar(3)}
     */
    public void setProductStatusCode_IsNullOrEmpty() { regProductStatusCode(CK_ISNOE, DOBJ); }

    /**
     * IsNotNull {is not null}. And OnlyOnceRegistered.

     * product_status_code: {bpchar(3)}
     */
    public void setProductStatusCode_IsNotNull() { regProductStatusCode(CK_ISNN, DOBJ); }

    protected void regProductStatusCode(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueProductStatusCode(), "product_status_code"); }
    protected abstract ConditionValue xgetCValueProductStatusCode();

    /**
     * Equal(=). And NullIgnored, OnlyOnceRegistered.

     * latest_purchase_datetime: {timestamp(29, 6)}
     * @param latestPurchaseDatetime The value of latestPurchaseDatetime as equal. (basically NotNull: error as default, or no condition as option)
     */
    public void setLatestPurchaseDatetime_Equal(java.time.LocalDateTime latestPurchaseDatetime) {
        regLatestPurchaseDatetime(CK_EQ,  latestPurchaseDatetime);
    }

    /**
     * GreaterThan(>). And NullIgnored, OnlyOnceRegistered.

     * latest_purchase_datetime: {timestamp(29, 6)}
     * @param latestPurchaseDatetime The value of latestPurchaseDatetime as greaterThan. (basically NotNull: error as default, or no condition as option)
     */
    public void setLatestPurchaseDatetime_GreaterThan(java.time.LocalDateTime latestPurchaseDatetime) {
        regLatestPurchaseDatetime(CK_GT,  latestPurchaseDatetime);
    }

    /**
     * LessThan(<). And NullIgnored, OnlyOnceRegistered.

     * latest_purchase_datetime: {timestamp(29, 6)}
     * @param latestPurchaseDatetime The value of latestPurchaseDatetime as lessThan. (basically NotNull: error as default, or no condition as option)
     */
    public void setLatestPurchaseDatetime_LessThan(java.time.LocalDateTime latestPurchaseDatetime) {
        regLatestPurchaseDatetime(CK_LT,  latestPurchaseDatetime);
    }

    /**
     * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered.

     * latest_purchase_datetime: {timestamp(29, 6)}
     * @param latestPurchaseDatetime The value of latestPurchaseDatetime as greaterEqual. (basically NotNull: error as default, or no condition as option)
     */
    public void setLatestPurchaseDatetime_GreaterEqual(java.time.LocalDateTime latestPurchaseDatetime) {
        regLatestPurchaseDatetime(CK_GE,  latestPurchaseDatetime);
    }

    /**
     * LessEqual(<=). And NullIgnored, OnlyOnceRegistered.

     * latest_purchase_datetime: {timestamp(29, 6)}
     * @param latestPurchaseDatetime The value of latestPurchaseDatetime as lessEqual. (basically NotNull: error as default, or no condition as option)
     */
    public void setLatestPurchaseDatetime_LessEqual(java.time.LocalDateTime latestPurchaseDatetime) {
        regLatestPurchaseDatetime(CK_LE, latestPurchaseDatetime);
    }

    /**
     * FromTo with various options. (versatile) {(default) fromDatetime <= column <= toDatetime}

     * And NullIgnored, OnlyOnceRegistered.

     * latest_purchase_datetime: {timestamp(29, 6)}
     *
e.g. setLatestPurchaseDatetime_FromTo(fromDate, toDate, op -> op.compareAsDate());

     * @param fromDatetime The from-datetime(yyyy/MM/dd HH:mm:ss.SSS) of latestPurchaseDatetime. (basically NotNull: if op.allowOneSide(), null allowed)
     * @param toDatetime The to-datetime(yyyy/MM/dd HH:mm:ss.SSS) of latestPurchaseDatetime. (basically NotNull: if op.allowOneSide(), null allowed)
     * @param opLambda The callback for option of from-to. (NotNull)
     */
    public void setLatestPurchaseDatetime_FromTo(java.time.LocalDateTime fromDatetime, java.time.LocalDateTime toDatetime, ConditionOptionCall<FromToOption> opLambda) {
        setLatestPurchaseDatetime_FromTo(fromDatetime, toDatetime, xcFTOP(opLambda));
    }

    /**
     * FromTo with various options. (versatile) {(default) fromDatetime <= column <= toDatetime}

     * And NullIgnored, OnlyOnceRegistered.

     * latest_purchase_datetime: {timestamp(29, 6)}
     *
e.g. setLatestPurchaseDatetime_FromTo(fromDate, toDate, new FromToOption().compareAsDate());

     * @param fromDatetime The from-datetime(yyyy/MM/dd HH:mm:ss.SSS) of latestPurchaseDatetime. (basically NotNull: if op.allowOneSide(), null allowed)
     * @param toDatetime The to-datetime(yyyy/MM/dd HH:mm:ss.SSS) of latestPurchaseDatetime. (basically NotNull: if op.allowOneSide(), null allowed)
     * @param fromToOption The option of from-to. (NotNull)
     */
    public void setLatestPurchaseDatetime_FromTo(java.time.LocalDateTime fromDatetime, java.time.LocalDateTime toDatetime, FromToOption fromToOption) {
        String nm = "latest_purchase_datetime"; FromToOption op = fromToOption;
        regFTQ(xfFTHD(fromDatetime, nm, op), xfFTHD(toDatetime, nm, op), xgetCValueLatestPurchaseDatetime(), nm, op);
    }

    /**
     * DateFromTo. (Date means yyyy/MM/dd) {fromDate <= column < toDate + 1 day}

     * And NullIgnored, OnlyOnceRegistered.

     * latest_purchase_datetime: {timestamp(29, 6)}
     *

     * e.g. from:{2007/04/10 08:24:53} to:{2007/04/16 14:36:29}
     *  column >= '2007/04/10 00:00:00' and column < '2007/04/17 00:00:00'
     *

     * @param fromDate The from-date(yyyy/MM/dd) of latestPurchaseDatetime. (basically NotNull: if op.allowOneSide(), null allowed)
     * @param toDate The to-date(yyyy/MM/dd) of latestPurchaseDatetime. (basically NotNull: if op.allowOneSide(), null allowed)
     */
    public void setLatestPurchaseDatetime_DateFromTo(java.time.LocalDateTime fromDate, java.time.LocalDateTime toDate) {
        setLatestPurchaseDatetime_FromTo(fromDate, toDate, xcDFTOP());
    }

    /**
     * IsNull {is null}. And OnlyOnceRegistered.

     * latest_purchase_datetime: {timestamp(29, 6)}
     */
    public void setLatestPurchaseDatetime_IsNull() { regLatestPurchaseDatetime(CK_ISN, DOBJ); }

    /**
     * IsNotNull {is not null}. And OnlyOnceRegistered.

     * latest_purchase_datetime: {timestamp(29, 6)}
     */
    public void setLatestPurchaseDatetime_IsNotNull() { regLatestPurchaseDatetime(CK_ISNN, DOBJ); }

    protected void regLatestPurchaseDatetime(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueLatestPurchaseDatetime(), "latest_purchase_datetime"); }
    protected abstract ConditionValue xgetCValueLatestPurchaseDatetime();

    // ===================================================================================
    //                                                                     ScalarCondition
    //                                                                     ===============
    /**
     * Prepare ScalarCondition as equal.

     * {where FOO = (select max(BAR) from ...)}
     *

     * cb.query().scalar_Equal().avg(purchaseCB -> {
     *     purchaseCB.specify().columnPurchasePrice(); // *Point!
     *     purchaseCB.query().setPaymentCompleteFlg_Equal_True();
     * });
     *

     * @return The object to set up a function. (NotNull)
     */
    public HpSLCFunction<SummaryProductCB> scalar_Equal() {
        return xcreateSLCFunction(CK_EQ, SummaryProductCB.class);
    }

    /**
     * Prepare ScalarCondition as equal.

     * {where FOO <> (select max(BAR) from ...)}
     *

     * cb.query().scalar_Equal().avg(purchaseCB -> {
     *     purchaseCB.specify().columnPurchasePrice(); // *Point!
     *     purchaseCB.query().setPaymentCompleteFlg_Equal_True();
     * });
     *

     * @return The object to set up a function. (NotNull)
     */
    public HpSLCFunction<SummaryProductCB> scalar_NotEqual() {
        return xcreateSLCFunction(CK_NES, SummaryProductCB.class);
    }

    /**
     * Prepare ScalarCondition as greaterThan.

     * {where FOO > (select max(BAR) from ...)}
     *

     * cb.query().scalar_Equal().avg(purchaseCB -> {
     *     purchaseCB.specify().columnPurchasePrice(); // *Point!
     *     purchaseCB.query().setPaymentCompleteFlg_Equal_True();
     * });
     *

     * @return The object to set up a function. (NotNull)
     */
    public HpSLCFunction<SummaryProductCB> scalar_GreaterThan() {
        return xcreateSLCFunction(CK_GT, SummaryProductCB.class);
    }

    /**
     * Prepare ScalarCondition as lessThan.

     * {where FOO < (select max(BAR) from ...)}
     *

     * cb.query().scalar_Equal().avg(purchaseCB -> {
     *     purchaseCB.specify().columnPurchasePrice(); // *Point!
     *     purchaseCB.query().setPaymentCompleteFlg_Equal_True();
     * });
     *

     * @return The object to set up a function. (NotNull)
     */
    public HpSLCFunction<SummaryProductCB> scalar_LessThan() {
        return xcreateSLCFunction(CK_LT, SummaryProductCB.class);
    }

    /**
     * Prepare ScalarCondition as greaterEqual.

     * {where FOO >= (select max(BAR) from ...)}
     *

     * cb.query().scalar_Equal().avg(purchaseCB -> {
     *     purchaseCB.specify().columnPurchasePrice(); // *Point!
     *     purchaseCB.query().setPaymentCompleteFlg_Equal_True();
     * });
     *

     * @return The object to set up a function. (NotNull)
     */
    public HpSLCFunction<SummaryProductCB> scalar_GreaterEqual() {
        return xcreateSLCFunction(CK_GE, SummaryProductCB.class);
    }

    /**
     * Prepare ScalarCondition as lessEqual.

     * {where FOO <= (select max(BAR) from ...)}
     *

     * cb.query().scalar_LessEqual().max(new SubQuery<SummaryProductCB>() {
     *     public void query(SummaryProductCB subCB) {
     *         subCB.specify().setFoo... // derived column for function
     *         subCB.query().setBar...
     *     }
     * });
     *

     * @return The object to set up a function. (NotNull)
     */
    public HpSLCFunction<SummaryProductCB> scalar_LessEqual() {
        return xcreateSLCFunction(CK_LE, SummaryProductCB.class);
    }

    @SuppressWarnings("unchecked")
    protected <CB extends ConditionBean> void xscalarCondition(String fn, SubQuery<CB> sq, String rd, HpSLCCustomized<CB> cs, ScalarConditionOption op) {
        assertObjectNotNull("subQuery", sq);
        SummaryProductCB cb = xcreateScalarConditionCB(); sq.query((CB)cb);
        String pp = keepScalarCondition(cb.query()); // for saving query-value
        cs.setPartitionByCBean((CB)xcreateScalarConditionPartitionByCB()); // for using partition-by
        registerScalarCondition(fn, cb.query(), pp, rd, cs, op);
    }
    public abstract String keepScalarCondition(SummaryProductCQ sq);

    protected SummaryProductCB xcreateScalarConditionCB() {
        SummaryProductCB cb = newMyCB(); cb.xsetupForScalarCondition(this); return cb;
    }

    protected SummaryProductCB xcreateScalarConditionPartitionByCB() {
        SummaryProductCB cb = newMyCB(); cb.xsetupForScalarConditionPartitionBy(this); return cb;
    }

    // ===================================================================================
    //                                                                    Full Text Search
    //                                                                    ================
    /**
     * Match for full-text search.

     * @param textColumn The text column. (NotNull, StringColumn, TargetTableColumn)
     * @param conditionValue The condition value. (NullAllowed: if null or empty, no condition)
     */
    public void match(org.dbflute.dbmeta.info.ColumnInfo textColumn, String conditionValue) {
        assertObjectNotNull("textColumn", textColumn);
        match(newArrayList(textColumn), conditionValue);
    }

    /**
     * Match for full-text search.

     * @param textColumnList The list of text column. (NotNull, NotEmpty, StringColumn, TargetTableColumn)
     * @param conditionValue The condition value. (NullAllowed: if null or empty, no condition)
     */
    public void match(List<org.dbflute.dbmeta.info.ColumnInfo> textColumnList, String conditionValue) {
        xdoMatchByLikeSearch(textColumnList, conditionValue);
    }

    @Override
    protected String xescapeFullTextSearchValue(String conditionValue) {
        return conditionValue; // non escape
    }

    @Override
    protected LikeSearchOption xcreateMatchLikeSearch() {
        return new PostgreSQLMatchLikeSearch();
    }

    @Override
    protected org.dbflute.dbway.ExtensionOperand xgetPostgreSQLMatchOperand() {
        return DBFluteConfig.getInstance().getFullTextSearchOperand();
    }

    // ===================================================================================
    //                                                                        Manual Order
    //                                                                        ============
    /**
     * Order along manual ordering information.
     *

     * cb.query().addOrderBy_Birthdate_Asc().withManualOrder(op -> {
     *     op.when_GreaterEqual(priorityDate); // e.g. 2000/01/01
     * });
     * // order by
     * //   case
     * //     when BIRTHDATE >= '2000/01/01' then 0
     * //     else 1
     * //   end asc, ...
     *
     * cb.query().addOrderBy_MemberStatusCode_Asc().withManualOrder(op -> {
     *     op.when_Equal(CDef.MemberStatus.Withdrawal);
     *     op.when_Equal(CDef.MemberStatus.Formalized);
     *     op.when_Equal(CDef.MemberStatus.Provisional);
     * });
     * // order by
     * //   case
     * //     when MEMBER_STATUS_CODE = 'WDL' then 0
     * //     when MEMBER_STATUS_CODE = 'FML' then 1
     * //     when MEMBER_STATUS_CODE = 'PRV' then 2
     * //     else 3
     * //   end asc, ...
     *

     *
This function with Union is unsupported!

     *
The order values are bound (treated as bind parameter).

     * @param opLambda The callback for option of manual-order containing order values. (NotNull)
     */
    public void withManualOrder(ManualOrderOptionCall opLambda) { // is user public!
        xdoWithManualOrder(cMOO(opLambda));
    }

    /**
     * Order along manual ordering information.
     *

     * ManualOrderOption mop = new ManualOrderOption();
     * mop.when_GreaterEqual(priorityDate); // e.g. 2000/01/01
     * cb.query().addOrderBy_Birthdate_Asc().withManualOrder(mop);
     * // order by
     * //   case
     * //     when BIRTHDATE >= '2000/01/01' then 0
     * //     else 1
     * //   end asc, ...
     *
     * ManualOrderOption mop = new ManualOrderOption();
     * mop.when_Equal(CDef.MemberStatus.Withdrawal);
     * mop.when_Equal(CDef.MemberStatus.Formalized);
     * mop.when_Equal(CDef.MemberStatus.Provisional);
     * cb.query().addOrderBy_MemberStatusCode_Asc().withManualOrder(mop);
     * // order by
     * //   case
     * //     when MEMBER_STATUS_CODE = 'WDL' then 0
     * //     when MEMBER_STATUS_CODE = 'FML' then 1
     * //     when MEMBER_STATUS_CODE = 'PRV' then 2
     * //     else 3
     * //   end asc, ...
     *

     *
This function with Union is unsupported!

     *
The order values are bound (treated as bind parameter).

     * @param option The option of manual-order containing order values. (NotNull)
     */
    public void withManualOrder(ManualOrderOption option) { // is user public!
        xdoWithManualOrder(option);
    }

    // ===================================================================================
    //                                                                    Small Adjustment
    //                                                                    ================
    // ===================================================================================
    //                                                                       Very Internal
    //                                                                       =============
    protected SummaryProductCB newMyCB() {
        return new SummaryProductCB();
    }
    // very internal (for suppressing warn about 'Not Use Import')
    protected String xabUDT() { return Date.class.getName(); }
    protected String xabCQ() { return SummaryProductCQ.class.getName(); }
    protected String xabLSO() { return LikeSearchOption.class.getName(); }
    protected String xabSLCS() { return HpSLCSetupper.class.getName(); }
    protected String xabSCP() { return SubQuery.class.getName(); }
}


text:
using System.Collections.Generic;
using System.Linq;

namespace DotSpatial.Symbology
{
    /// <summary>
    /// Contains extension methods for ILegendItems.
    /// </summary>
    public static class LegendItemExt
    {
        #region Methods

        /// <summary>
        /// Searches through the LegendItems recursively, looking for the 0 index
        /// member of the deepest part of the tree.
        /// </summary>
        /// <param name="self">this</param>
        /// <returns>The found member.</returns>
        public static ILegendItem BottomMember(this ILegendItem self)
        {
            if (self != null && self.LegendItems != null && self.LegendItems.Any())
            {
                var items = self.LegendItems.ToList();

                for (int i = items.Count - 1; i >= 0; i--)
                {
                    if (items[i].LegendItemVisible)
                    {
                        if (items[i].IsExpanded)
                        {
                            return BottomMember(items[i]);
                        }

                        return items[i];
                    }
                }
            }

            return self;
        }

        /// <summary>
        /// Checks whether the item is a child item of the given parent.
        /// </summary>
        /// <param name="self">This legend item.</param>
        /// <param name="parent">The parent item.</param>
        /// <returns>True, if this is a child of the given parent.</returns>
        public static bool IsChildOf(this ILegendItem self, ILegendItem parent)
        {
            if (self == null || parent == null) return false;

            var item = self;
            while ((item = item.GetParentItem()) != null)
            {
                if (item == parent) return true;
            }

            return false;
        }

        /// <summary>
        /// This method starts with this legend item and tests to see if it can contain
        /// the specified target. As it moves up the
        /// </summary>
        /// <param name="startItem">This legend item</param>
        /// <param name="dropItem">The target legend item to test</param>
        /// <returns>An ILegendItem that is one of the parent items of this item, but that can receive the target.</returns>
        public static ILegendItem GetValidContainerFor(this ILegendItem startItem, ILegendItem dropItem)
        {
            if (startItem == null || dropItem == null) return null;
            if (startItem.CanReceiveItem(dropItem)) return startItem;

            ILegendItem item = startItem;
            while ((item = item.GetParentItem()) != null)
            {
                if (item.CanReceiveItem(dropItem))
                {
                    return item;
                }
            }

            return null;
        }

        /// <summary>
        /// Gets the index at which the positionBase is situated in the parent. This can be used to determine the index the item that gets moved should be inserted.
        /// </summary>
        /// <param name="parent">The legend item the moving item should be added to.</param>
        /// <param name="positionBase">The item that is used to determine the new position of the moving item.</param>
        /// <returns>The new position of the moving item.</returns>
        public static int InsertIndex(this ILegendItem parent, ILegendItem positionBase)
        {
            if (parent == null || positionBase == null) return -1;

            ILegendItem item = positionBase;

            if (item == parent)
            {
                return item.LegendItems.Count();
            }

            while (item != null)
            {
                var p = item.GetParentItem();

                if (p == parent)
                {
                    var items = p.LegendItems.ToList();
                    return items.IndexOf(item);
                }

                item = p;
            }

            return -1;
        }

        /// <summary>
        /// This method starts with this legend item and searches through the
        /// parent groups until it finds a valid mapframe.
        /// </summary>
        /// <param name="self">The ILegendItem to start from</param>
        /// <returns>The IMapFrame that contains this item.</returns>
        public static IFrame ParentMapFrame(this ILegendItem self)
        {
            ILegendItem current = self;
            IFrame frame = current as IFrame;
            while (current != null)
            {
                if (frame != null) return frame;

                current = current.GetParentItem();
                frame = current as IFrame;
            }

            return null;
        }

        #endregion
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.github.niwaniwa.we.core.player;

import java.util.List;

import com.github.niwaniwa.we.core.api.callback.Callback;
import com.github.niwaniwa.we.core.twitter.TwitterManager;

import twitter4j.Status;
import twitter4j.StatusUpdate;

public interface Twitter {

    /**
     * TwitterManagerクラスを返します
     *
     * @return twittermanager
     */
    public abstract TwitterManager getTwitterManager();

    /**
     * ツイートの送信
     *
     * @param update StatusUpdate
     */
    public void updateStatus(StatusUpdate update);

    /**
     * ツイートの送信
     *
     * @param update   StatusUpdate
     * @param callback 終了後に実行するインスタンス
     */
    public void updateStatus(StatusUpdate update, Callback callback);

    /**
     * ツイートの送信
     *
     * @param tweet 文字列
     */
    public void updateStatus(String tweet);

    /**
     * タイムラインの取得
     *
     * @return List status
     */
    public List<Status> getTimeLine();

}


text:
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

$string['contentheader'] = 'Content';
$string['dnduploadmakefolder'] = 'Unzip files and create folder';
$string['folder:addinstance'] = 'Add a new folder';
$string['folder:managefiles'] = 'Manage files in folder module';
$string['folder:view'] = 'View folder content';
$string['foldercontent'] = 'Files and subfolders';
$string['modulename'] = 'Folder';
$string['modulename_help'] = 'The folder module enables a teacher to display a number of related files inside a single folder, reducing scrolling on the course page. A zipped folder may be uploaded and unzipped for display, or an empty folder created and files uploaded into it.

A folder may be used

* For a series of files on one topic, for example a set of past examination papers in pdf format or a collection of image files for use in student projects
* To provide a shared uploading space for teachers on the course page (keeping the folder hidden so that only teachers can see it)';
$string['modulename_link'] = 'mod/folder/view';
$string['modulenameplural'] = 'Folders';
$string['neverseen'] = 'Never seen';
$string['page-mod-folder-x'] = 'Any folder module page';
$string['page-mod-folder-view'] = 'Folder module main page';
$string['pluginadministration'] = 'Folder administration';
$string['pluginname'] = 'Folder';
$string['display'] = 'Display folder contents';
$string['display_help'] = 'If you choose to display the folder contents on a course page, there  will be no link to a separate page.
The description will be displayed only if "Display description on course page" is checked.<br />
Also note that participants view actions can not be logged in this case.';
$string['displaypage'] = 'On a separate page';
$string['displayinline'] = 'Inline on a course page';
$string['noautocompletioninline'] = 'Automatic completion on viewing of activity can not be selected together with "Display inline" option';
$string['showexpanded'] = 'Show sub-folders expanded';
$string['showexpanded_help'] = 'If enabled, will display sub-folders expanded by default. Else, sub-folders will display collapsed.';


text:
Docker 1.9 : Manipulation des volumes

        <button id="read-blog" class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-button--colored mdl-shadow--8dp">
            open_in_new
        </button>

Ca fait maintenant un bout de temps que je joue avec Docker de manière régulière. Entre expérimentation, refactoring etc… j'ai accumulé finalement un nombre impressionant d'image et de containers.

Jusqu'à présent, j'ai tout géré en mode « YOLO ! on gérera ça plus tard ». Plus tard, c'est maintenant !


text:
class Thread: public atomic
{
	public:
		/// Constructor.
		Thread (std::string worker_name, int worker_number, std::ofstream& event_log);
		/// State initialization function.
		void init ();
		/// Internal transition function.
		void delta_int ();
		/// External transition function.
		void delta_ext (stime_t e, const adevs_bag<PortValue>& x);
		/// Confluent transition function.
		void delta_conf (const adevs_bag<PortValue>& x);
		/// Output function.
		void output_func (adevs_bag<PortValue>& y);
		/// Output value garbage collection.
		void gc_output (adevs_bag<PortValue>& g);
		/// Destructor.
		~Thread ();

		static const port_t ServiceDemandInput;
		static const port_t ServiceCompletionOutput;

	private:
		std::string worker_name_;
		int worker_number_;
		std::ofstream * event_log_;
		std::string current_element_id_;
		int current_thread_id_;
};

#endif


text:
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="48dip"
        android:gravity="center_vertical"
        android:text="未使用SmartImageView:"/>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <ImageView
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:scaleType="fitStart"
            android:id="@+id/image_left"
            android:layout_weight="1"
            android:layout_margin="10dip"
            android:background="@android:color/black"
            android:src="@mipmap/plane" />

        <ImageView
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:scaleType="fitStart"
            android:layout_weight="1"
            android:layout_margin="10dip"
            android:id="@+id/image_right"
            android:background="@android:color/black"
            android:src="@mipmap/plane" />

    </LinearLayout>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="48dip"
        android:gravity="center_vertical"
        android:text="使用SmartImageView:"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <com.fuhongliang.smartimageview.SmartImageView
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:scaleType="fitXY"
            android:id="@+id/siv_left"
            android:layout_weight="1"
            android:layout_margin="10dip"
            android:background="@android:color/black"
            android:src="@mipmap/plane" />

        <com.fuhongliang.smartimageview.SmartImageView
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:scaleType="fitXY"
            android:layout_weight="1"
            android:layout_margin="10dip"
            android:id="@+id/siv_right"
            android:background="@android:color/black"
            android:src="@mipmap/plane" />
    </LinearLayout>

</LinearLayout>


text:
/*
  Summary

*/

import React from 'react';
import utils from '../utils';
let formatPrice = utils.formatPrice;
let formatDate = utils.formatDate;

class Summary extends React.Component {

  render() {

    return (

Total due {formatDate(this.props.due)}

        {formatPrice(this.props.total)}

    )
  }

};

Summary.propTypes = {
  total : React.PropTypes.number,
  due : React.PropTypes.string
}

export default Summary;


text:
#pragma once

#include <stddef.h>

#include <utils/Mutex.h>
#include <utils/RefBase.h>
#include <utils/Timers.h>

#include <ui/FenceTime.h>

#include <memory>

namespace android {

class FenceTime;

class DispSync {
public:
    class Callback {
    public:
        Callback() = default;
        virtual ~Callback();
        virtual void onDispSyncEvent(nsecs_t when) = 0;

    protected:
        Callback(Callback const&) = delete;
        Callback& operator=(Callback const&) = delete;
    };

    DispSync() = default;
    virtual ~DispSync();

    virtual void reset() = 0;
    virtual bool addPresentFence(const std::shared_ptr<FenceTime>&) = 0;
    virtual void beginResync() = 0;
    virtual bool addResyncSample(nsecs_t timestamp, bool* periodFlushed) = 0;
    virtual void endResync() = 0;
    virtual void setPeriod(nsecs_t period) = 0;
    virtual nsecs_t getPeriod() = 0;
    virtual void setRefreshSkipCount(int count) = 0;
    virtual status_t addEventListener(const char* name, nsecs_t phase, Callback* callback,
                                      nsecs_t lastCallbackTime) = 0;
    virtual status_t removeEventListener(Callback* callback, nsecs_t* outLastCallback) = 0;
    virtual status_t changePhaseOffset(Callback* callback, nsecs_t phase) = 0;
    virtual nsecs_t computeNextRefresh(int periodOffset) const = 0;
    virtual void setIgnorePresentFences(bool ignore) = 0;
    virtual nsecs_t expectedPresentTime() = 0;

    virtual void dump(std::string& result) const = 0;

protected:
    DispSync(DispSync const&) = delete;
    DispSync& operator=(DispSync const&) = delete;
};

namespace impl {

class DispSyncThread;

// DispSync maintains a model of the periodic hardware-based vsync events of a
// display and uses that model to execute period callbacks at specific phase
// offsets from the hardware vsync events.  The model is constructed by
// feeding consecutive hardware event timestamps to the DispSync object via
// the addResyncSample method.
//
// The model is validated using timestamps from Fence objects that are passed
// to the DispSync object via the addPresentFence method.  These fence
// timestamps should correspond to a hardware vsync event, but they need not
// be consecutive hardware vsync times.  If this method determines that the
// current model accurately represents the hardware event times it will return
// false to indicate that a resynchronization (via addResyncSample) is not
// needed.
class DispSync : public android::DispSync {
public:
    explicit DispSync(const char* name);
    ~DispSync() override;

    void init(bool hasSyncFramework, int64_t dispSyncPresentTimeOffset);

    // reset clears the resync samples and error value.
    void reset() override;

    // addPresentFence adds a fence for use in validating the current vsync
    // event model.  The fence need not be signaled at the time
    // addPresentFence is called.  When the fence does signal, its timestamp
    // should correspond to a hardware vsync event.  Unlike the
    // addResyncSample method, the timestamps of consecutive fences need not
    // correspond to consecutive hardware vsync events.
    //
    // This method should be called with the retire fence from each HWComposer
    // set call that affects the display.
    bool addPresentFence(const std::shared_ptr<FenceTime>& fenceTime) override;

    // The beginResync, addResyncSample, and endResync methods are used to re-
    // synchronize the DispSync's model to the hardware vsync events.  The re-
    // synchronization process involves first calling beginResync, then
    // calling addResyncSample with a sequence of consecutive hardware vsync
    // event timestamps, and finally calling endResync when addResyncSample
    // indicates that no more samples are needed by returning false.
    //
    // This resynchronization process should be performed whenever the display
    // is turned on (i.e. once immediately after it's turned on) and whenever
    // addPresentFence returns true indicating that the model has drifted away
    // from the hardware vsync events.
    void beginResync() override;
    // Adds a vsync sample to the dispsync model. The timestamp is the time
    // of the vsync event that fired. periodFlushed will return true if the
    // vsync period was detected to have changed to mPendingPeriod.
    //
    // This method will return true if more vsync samples are needed to lock
    // down the DispSync model, and false otherwise.
    // periodFlushed will be set to true if mPendingPeriod is flushed to
    // mIntendedPeriod, and false otherwise.
    bool addResyncSample(nsecs_t timestamp, bool* periodFlushed) override;
    void endResync() override;

    // The setPeriod method sets the vsync event model's period to a specific
    // value. This should be used to prime the model when a display is first
    // turned on, or when a refresh rate change is requested.
    void setPeriod(nsecs_t period) override;

    // The getPeriod method returns the current vsync period.
    nsecs_t getPeriod() override;

    // setRefreshSkipCount specifies an additional number of refresh
    // cycles to skip.  For example, on a 60Hz display, a skip count of 1
    // will result in events happening at 30Hz.  Default is zero.  The idea
    // is to sacrifice smoothness for battery life.
    void setRefreshSkipCount(int count) override;

    // addEventListener registers a callback to be called repeatedly at the
    // given phase offset from the hardware vsync events.  The callback is
    // called from a separate thread and it should return reasonably quickly
    // (i.e. within a few hundred microseconds).
    // If the callback was previously registered, and the last clock time the
    // callback was invoked was known to the caller (e.g. via removeEventListener),
    // then the caller may pass that through to lastCallbackTime, so that
    // callbacks do not accidentally double-fire if they are unregistered and
    // reregistered in rapid succession.
    status_t addEventListener(const char* name, nsecs_t phase, Callback* callback,
                              nsecs_t lastCallbackTime) override;

    // removeEventListener removes an already-registered event callback.  Once
    // this method returns that callback will no longer be called by the
    // DispSync object.
    // outLastCallbackTime will contain the last time that the callback was invoked.
    // If the caller wishes to reregister the same callback, they should pass the
    // callback time back into lastCallbackTime (see addEventListener).
    status_t removeEventListener(Callback* callback, nsecs_t* outLastCallbackTime) override;

    // changePhaseOffset changes the phase offset of an already-registered event callback. The
    // method will make sure that there is no skipping or double-firing on the listener per frame,
    // even when changing the offsets multiple times.
    status_t changePhaseOffset(Callback* callback, nsecs_t phase) override;

    // computeNextRefresh computes when the next refresh is expected to begin.
    // The periodOffset value can be used to move forward or backward; an
    // offset of zero is the next refresh, -1 is the previous refresh, 1 is
    // the refresh after next. etc.
    nsecs_t computeNextRefresh(int periodOffset) const override;

    // In certain situations the present fences aren't a good indicator of vsync
    // time, e.g. when vr flinger is active, or simply aren't available,
    // e.g. when the sync framework isn't present. Use this method to toggle
    // whether or not DispSync ignores present fences. If present fences are
    // ignored, DispSync will always ask for hardware vsync events by returning
    // true from addPresentFence() and addResyncSample().
    void setIgnorePresentFences(bool ignore) override;

    // Determine the expected present time when a buffer acquired now will be displayed.
    nsecs_t expectedPresentTime();

    // dump appends human-readable debug info to the result string.
    void dump(std::string& result) const override;

private:
    void updateModelLocked();
    void updateErrorLocked();
    void resetLocked();
    void resetErrorLocked();

    enum { MAX_RESYNC_SAMPLES = 32 };
    enum { MIN_RESYNC_SAMPLES_FOR_UPDATE = 6 };
    enum { NUM_PRESENT_SAMPLES = 8 };
    enum { MAX_RESYNC_SAMPLES_WITHOUT_PRESENT = 4 };
    enum { ACCEPTABLE_ZERO_ERR_SAMPLES_COUNT = 64 };

    const char* const mName;

    // mPeriod is the computed period of the modeled vsync events in
    // nanoseconds.
    nsecs_t mPeriod;

    // mIntendedPeriod is the intended period of the modeled vsync events in
    // nanoseconds. Under ideal conditions this should be similar if not the
    // same as mPeriod, plus or minus an observed error.
    nsecs_t mIntendedPeriod = 0;

    // mPendingPeriod is the proposed period change in nanoseconds.
    // If mPendingPeriod differs from mPeriod and is nonzero, it will
    // be flushed to mPeriod when we detect that the hardware switched
    // vsync frequency.
    nsecs_t mPendingPeriod = 0;

    // mPhase is the phase offset of the modeled vsync events.  It is the
    // number of nanoseconds from time 0 to the first vsync event.
    nsecs_t mPhase;

    // mReferenceTime is the reference time of the modeled vsync events.
    // It is the nanosecond timestamp of the first vsync event after a resync.
    nsecs_t mReferenceTime;

    // mError is the computed model error.  It is based on the difference
    // between the estimated vsync event times and those observed in the
    // mPresentFences array.
    nsecs_t mError;

    // mZeroErrSamplesCount keeps track of how many times in a row there were
    // zero timestamps available in the mPresentFences array.
    // Used to sanity check that we are able to calculate the model error.
    size_t mZeroErrSamplesCount;

    // Whether we have updated the vsync event model since the last resync.
    bool mModelUpdated;

    // These member variables are the state used during the resynchronization
    // process to store information about the hardware vsync event times used
    // to compute the model.
    nsecs_t mResyncSamples[MAX_RESYNC_SAMPLES] = {0};
    size_t mFirstResyncSample = 0;
    size_t mNumResyncSamples = 0;
    int mNumResyncSamplesSincePresent;

    // These member variables store information about the present fences used
    // to validate the currently computed model.
    std::shared_ptr<FenceTime> mPresentFences[NUM_PRESENT_SAMPLES]{FenceTime::NO_FENCE};
    size_t mPresentSampleOffset;

    int mRefreshSkipCount;

    // mThread is the thread from which all the callbacks are called.
    sp<DispSyncThread> mThread;

    // mMutex is used to protect access to all member variables.
    mutable Mutex mMutex;

    // This is the offset from the present fence timestamps to the corresponding
    // vsync event.
    int64_t mPresentTimeOffset;

    // Ignore present (retire) fences if the device doesn't have support for the
    // sync framework
    bool mIgnorePresentFences;

    std::unique_ptr<Callback> mZeroPhaseTracer;

    // Flag to turn on logging in systrace.
    bool mTraceDetailedInfo = false;
};

} // namespace impl

} // namespace android


text:
import os
import sys
import unittest

from compiled_file_system import CompiledFileSystem
from example_zipper import ExampleZipper
from in_memory_object_store import InMemoryObjectStore
from local_file_system import LocalFileSystem
from memcache_file_system import MemcacheFileSystem

class ExampleZipperTest(unittest.TestCase):
  def setUp(self):
    object_store = InMemoryObjectStore('')
    self._file_system = MemcacheFileSystem(
        LocalFileSystem(os.path.join(sys.path[0], 'test_data')),
        object_store)
    self._example_zipper = ExampleZipper(
        self._file_system,
        CompiledFileSystem.Factory(self._file_system, object_store),
        'example_zipper')

  def testCreateZip(self):
    # Cache manifest.json as unicode and make sure ExampleZipper doesn't error.
    self._file_system.ReadSingle('example_zipper/basic/manifest.json')
    self.assertTrue(len(self._example_zipper.Create('basic')) > 0)

if __name__ == '__main__':
  unittest.main()


text:
namespace LegacyBounce.Framework {
    public class Iis7WebSiteBinding {
        [Dependency]
        public Task<string> Protocol;

        [Dependency]
        public Task<string> Information;
    }
}


text:
#ifndef GrVkDescriptorSet_DEFINED
#define GrVkDescriptorSet_DEFINED

#include "include/gpu/vk/GrVkTypes.h"
#include "src/gpu/vk/GrVkDescriptorSetManager.h"
#include "src/gpu/vk/GrVkManagedResource.h"

#include <cinttypes>

class GrVkDescriptorPool;
class GrVkGpu;

class GrVkDescriptorSet : public GrVkRecycledResource {
public:
    GrVkDescriptorSet(GrVkGpu* gpu,
                      VkDescriptorSet descSet,
                      GrVkDescriptorPool* pool,
                      GrVkDescriptorSetManager::Handle handle);

    ~GrVkDescriptorSet() override {}

    const VkDescriptorSet* descriptorSet() const { return &fDescSet; }

#ifdef SK_TRACE_MANAGED_RESOURCES
    void dumpInfo() const override {
        SkDebugf("GrVkDescriptorSet: %" PRIdPTR " (%d refs)\n", (intptr_t)fDescSet,
                 this->getRefCnt());
    }
#endif

private:
    void freeGPUData() const override;
    void onRecycle() const override;

    VkDescriptorSet                          fDescSet;
    SkDEBUGCODE(mutable) GrVkDescriptorPool* fPool;
    GrVkDescriptorSetManager::Handle         fHandle;

    using INHERITED = GrVkRecycledResource;
};

#endif


text:
alias ls='pwd;ls --classify --color=auto --escape'

# typos become slightly amusing, while still useful
alias sl='ls --reverse'

# lists all (no group information)
alias la='ls -o --all --human-readable'

# lists less info, but still long-form
alias l='ls -g --no-group --all --human-readable --group-directories-first'

# lists sorted by time
alias lt="ls -l \
             --almost-all \
             --sort=time \
             --reverse \
             --human-readable \
             --time-style=+'%F %T' \
             --indicator-style=slash \
             --color=never | \
          awk '{print \$6,\$7,\$8,\$9,\$10}'"

# lists files larger than $1
function lz()
{
    if [[ -z $1 ]]; then
        find . -type f -a -size +1M -a -writable -a -readable;
    else
        find . -type f -a -size +$1 -a -writable -a -readable;
    fi
}

# cd aliases ##########################################################
# - goes to last directory
alias -- -='cd -'

# global aliases
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'

# suffix aliases ######################################################
alias -s tex=vim
alias -s html=chromium
alias -s gif=feh
alias -s png=feh
alias -s jpg=feh
alias -s jpeg=feh

# yay random numbers
function random()
{
    if [[ -z $1 ]] then;
        echo "Usage: random number1 [number2]"
    else
        if [[ -z $2 ]] then;
            [[ 0 -lt $1 ]]  && lo=0  && hi=$1
            [[ 0 -ge $1 ]]  && lo=$1 && hi=0
        else
            [[ $1 -lt $2 ]] && lo=$1 && hi=$2
            [[ $1 -ge $2 ]] && lo=$2 && hi=$1
        fi
        let "range = $hi - $lo + 1"
        if [[ $range -ne 0 ]] then;
            let "rand = ( ${RANDOM} % $range ) + $lo"
            echo $[$rand]
        else
            echo $lo
        fi
    fi
}

# always use my pager to page
alias less=$PAGER
alias more=$PAGER

# give redshift my location
alias redshift='redshift -l 42.360026:-71.088179 &'

# colorful grep
alias grep='grep --color=auto'

# mkdir makes recursively and is verbose
alias mkdir='mkdir --parents --verbose'

# colorful diff
alias diff='colordiff'

# useful du defaults
alias du='du --total --human-readable --max-depth 1 --one-file-system'

# useful df defaults
alias df='df --total --human-readable'

# nowrap on nano
alias nano='nano --nowrap'

# not infinite pings
alias ping='ping -c 5'

# readable dmesg
alias dmesg='dmesg --human --color'

# safer rm prompts when removing recursively or many files, preserves root, with a timeout
alias rm=' timeout 3 rm -Iv --one-file-system --preserve-root'

# safer mv prompts before overwrite and is verbose
alias mv='mv --interactive --verbose'

# safer cp prompts before overwrite and is verbose
alias cp='cp --interactive --verbose'

# safer ch* preserves root
alias chown='chown --preserve-root --verbose'
alias chmod='chmod --preserve-root --verbose'
alias chgrp='chgrp --preserve-root --verbose'

# reverse a word
function ohce()
{
    echo "${(j::)${(@Oa)${(s::):-$1}}}"
}

# test if a parameter is numeric
function numeric()
{
    [[ $1 == <-> ]] && echo true || echo false
}

# Remove zero length files from a directory
alias rmclean='rm -i *(.L0);find . -maxdepth 1 -not -name . -type d -ok rmdir --ignore-fail-on-non-empty {} \;'

# Show only the ip-address from ``ifconfig device''
alias myip="ifconfig | grep $WIRELESS -A8 | grep 'inet ' | awk '{print \$2}'"

# get a "ls -l" on all the files in the tree that are younger than a
# specified age (e.g "ls -l" all the files in the tree that where
# modified in the last 2 days)
alias ly='ls -tld **/*(m-2)'

alias history='fc -l 1'

#rtorrent
alias rt='tmux attach -t rt'

# push/pop
alias pu='pushd'
alias po='popd'

# fix 'sound card used more than once' issue, by closing all things using sound card
alias fixsnd="for id in \$(lsof | grep snd | awk '{print \$2}' | sort -u); do kill \$id; done; pulseaudio -k"

# because I'm lazy
alias wifi='sudo wifi-menu'

# reload zshrc
alias rezsh='source ~/.zshrc'


text:
/profile

As an authenticated user
I want to see my user name in the nav bar
With a dropdown menu where I can visit 'My Profile'
So that I may edit my profile.

When visiting this page
I want to see a profile area where I may edit my name and bio
And be informed that this information is hidden from the review committee.

And I want to see an 'Identity Services' area
So that I may edit my email and password.


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2015 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:orientation="vertical"
    style="?android:attr/buttonBarStyle">

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/app_name" />

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        style="?android:attr/buttonBarStyle">

        <Button
            android:id="@+id/notification_button_gain"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/button_gain_name"
            style="?android:attr/buttonBarButtonStyle" />
        <Button
            android:id="@+id/notification_button_transient_pause"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/button_transient_pause_name"
            style="?android:attr/buttonBarButtonStyle" />
        <Button
            android:id="@+id/notification_button_transient_duck"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/button_transient_duck_name"
            style="?android:attr/buttonBarButtonStyle" />
        <Button
            android:id="@+id/notification_button_hide"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/button_hide_notification_name"
            style="?android:attr/buttonBarButtonStyle" />

    </LinearLayout>

</LinearLayout>


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
	<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width,height=device-height">

    <link rel="stylesheet" type="text/css" href="../../lib/css/ionic.min.css">

	<ion-nav-bar class="bar-positive">
		<ion-nav-back-button></ion-nav-back-button>
	</ion-nav-bar>

	<ion-nav-view></ion-nav-view>


text:
package io.coodoo.framework.listing.control;

import static org.junit.Assert.assertEquals;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.dbunit.DatabaseUnitException;
import org.hibernate.HibernateException;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import io.coodoo.framework.listing.boundary.ListingParameters;
import io.coodoo.framework.listing.dbunit.AbstractDbUnitTest;
import io.coodoo.framework.listing.dbunit.model.TestNumbersEntity;

public class NumbersTest extends AbstractDbUnitTest {

    @BeforeClass
    public static void initDB() throws HibernateException, DatabaseUnitException, SQLException {
        datasetXml = "numbers-dataset.xml";
        initEntityManager();
    }

    @Before
    public void initFilterParams() {
        parameters = new ListingParameters();
        parameters.setLimit(Integer.MAX_VALUE);
    }

    @Test
    public void testDatasetLoaded() {

        TestNumbersEntity result = entityManager.find(TestNumbersEntity.class, 1L);

        assertEquals(1L, result.getId().longValue());
    }

    @Ignore
    @Test
    public void testGernerate() throws IOException {

        List<String> lines = new ArrayList<>();

        lines.add("<?xml version='1.0' encoding='UTF-8'?>");
        lines.add("<dataset>");

        for (Long id = 1L; id <= 1000; id++) {

            String line = "<TEST_NUMBERS_ENTITY ID='" + id + "'";
            line += " LONG_CLASS='" + id + "'";
            line += " LONG_PRIMITIVE='" + id + "'";
            line += " LONG_STRING='" + id + "'";
            line += " INT_CLASS='" + id + "'";
            line += " INT_PRIMITIVE='" + id + "'";
            line += " INT_STRING='" + id + "'";
            line += " SHORT_CLASS='" + id + "'";
            line += " SHORT_PRIMITIVE='" + id + "'";
            line += " SHORT_STRING='" + id + "' />";
            lines.add(line);
        }
        lines.add("</dataset>");

        Path file = Paths.get("src/test/resources/numbers-dataset.xml");
        Files.write(file, lines, Charset.forName("UTF-8"));
    }

}


text:
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2012 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0

package com.google.appinventor.client.boxes;

import static com.google.appinventor.client.Ode.MESSAGES;

import com.google.appinventor.client.explorer.youngandroid.ProfilePage;
import com.google.appinventor.client.explorer.youngandroid.ProjectList;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.TabPanel;

/**
 * TabPanel implementation for private user profile.
 *
 */
public final class PrivateUserProfileTabPanel extends TabPanel {

  // Singleton project explorer box instance (only one project explorer allowed)
  private static final PrivateUserProfileTabPanel INSTANCE = new PrivateUserProfileTabPanel();
  // Project list for young android
  private ProfilePage profile;
  // Tab container
  private FlowPanel profileContainer = new FlowPanel();

  /**
   * Returns the singleton projects list box.
   *
   * @return  project list box
   */
  public static PrivateUserProfileTabPanel getPrivateUserProfileTabPanel() {
    return INSTANCE;
  }

  /**
   * Creates new Gallery Tab Panel
   */
  private PrivateUserProfileTabPanel() {
    profile = new ProfilePage("-1",  0);
    profileContainer.add(profile);
    this.add(profileContainer, MESSAGES.profilePageBoxCaption());
    this.selectTab(0);

    // Styling options
    this.addStyleName("gallery");
  }

  public void loadProfileImage(){
    profile.loadImage();
  }

}


text:
/*************************************************************************/
/*  gltf_skeleton.h                                                      */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#ifndef GLTF_SKELETON_H
#define GLTF_SKELETON_H

#include "core/io/resource.h"
#include "gltf_document.h"

class GLTFSkeleton : public Resource {
	GDCLASS(GLTFSkeleton, Resource);
	friend class GLTFDocument;

private:
	// The *synthesized* skeletons joints
	Vector<GLTFNodeIndex> joints;

	// The roots of the skeleton. If there are multiple, each root must have the
	// same parent (ie roots are siblings)
	Vector<GLTFNodeIndex> roots;

	// The created Skeleton3D for the scene
	Skeleton3D *godot_skeleton = nullptr;

	// Set of unique bone names for the skeleton
	Set<String> unique_names;

	Map<int32_t, GLTFNodeIndex> godot_bone_node;

	Vector<BoneAttachment3D *> bone_attachments;

protected:
	static void _bind_methods();

public:
	Vector<GLTFNodeIndex> get_joints();
	void set_joints(Vector<GLTFNodeIndex> p_joints);

	Vector<GLTFNodeIndex> get_roots();
	void set_roots(Vector<GLTFNodeIndex> p_roots);

	Skeleton3D *get_godot_skeleton();

	// Skeleton *get_godot_skeleton() {
	// 	return this->godot_skeleton;
	// }
	// void set_godot_skeleton(Skeleton p_*godot_skeleton) {
	// 	this->godot_skeleton = p_godot_skeleton;
	// }

	Array get_unique_names();
	void set_unique_names(Array p_unique_names);

	//Map<int32_t, GLTFNodeIndex> get_godot_bone_node() {
	//	return this->godot_bone_node;
	//}
	//void set_godot_bone_node(Map<int32_t, GLTFNodeIndex> p_godot_bone_node) {
	//	this->godot_bone_node = p_godot_bone_node;
	//}
	Dictionary get_godot_bone_node();
	void set_godot_bone_node(Dictionary p_indict);

	//Dictionary get_godot_bone_node() {
	//	return VariantConversion::to_dict(this->godot_bone_node);
	//}
	//void set_godot_bone_node(Dictionary p_indict) {
	//	VariantConversion::set_from_dict(this->godot_bone_node, p_indict);
	//}

	BoneAttachment3D *get_bone_attachment(int idx);

	int32_t get_bone_attachment_count();
};
#endif // GLTF_SKELETON_H


text:
using Microsoft.Win32.SafeHandles;
using System;
using System.Runtime.InteropServices;

internal partial class Interop
{
    internal partial class mincore
    {
        [DllImport(Libraries.Memory_L1_0, EntryPoint = "OpenFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)]
        internal static extern SafeMemoryMappedFileHandle OpenFileMapping(int dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, string lpName);
    }
}


text:
//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
//  This source code is licensed under the BSD-style license found in the
//  LICENSE file in the root directory of this source tree. An additional grant
//  of patent rights can be found in the PATENTS file in the same directory.
#include "table/meta_blocks.h"

#include <map>
#include <string>

#include "db/table_properties_collector.h"
#include "rocksdb/table.h"
#include "rocksdb/table_properties.h"
#include "table/block.h"
#include "table/format.h"
#include "table/internal_iterator.h"
#include "table/persistent_cache_helper.h"
#include "table/table_properties_internal.h"
#include "util/coding.h"

namespace rocksdb {

MetaIndexBuilder::MetaIndexBuilder()
    : meta_index_block_(new BlockBuilder(1 /* restart interval */)) {}

void MetaIndexBuilder::Add(const std::string& key,
                           const BlockHandle& handle) {
  std::string handle_encoding;
  handle.EncodeTo(&handle_encoding);
  meta_block_handles_.insert({key, handle_encoding});
}

Slice MetaIndexBuilder::Finish() {
  for (const auto& metablock : meta_block_handles_) {
    meta_index_block_->Add(metablock.first, metablock.second);
  }
  return meta_index_block_->Finish();
}

PropertyBlockBuilder::PropertyBlockBuilder()
    : properties_block_(new BlockBuilder(1 /* restart interval */)) {}

void PropertyBlockBuilder::Add(const std::string& name,
                               const std::string& val) {
  props_.insert({name, val});
}

void PropertyBlockBuilder::Add(const std::string& name, uint64_t val) {
  assert(props_.find(name) == props_.end());

  std::string dst;
  PutVarint64(&dst, val);

  Add(name, dst);
}

void PropertyBlockBuilder::Add(
    const UserCollectedProperties& user_collected_properties) {
  for (const auto& prop : user_collected_properties) {
    Add(prop.first, prop.second);
  }
}

void PropertyBlockBuilder::AddTableProperty(const TableProperties& props) {
  Add(TablePropertiesNames::kRawKeySize, props.raw_key_size);
  Add(TablePropertiesNames::kRawValueSize, props.raw_value_size);
  Add(TablePropertiesNames::kDataSize, props.data_size);
  Add(TablePropertiesNames::kIndexSize, props.index_size);
  Add(TablePropertiesNames::kNumEntries, props.num_entries);
  Add(TablePropertiesNames::kNumDataBlocks, props.num_data_blocks);
  Add(TablePropertiesNames::kFilterSize, props.filter_size);
  Add(TablePropertiesNames::kFormatVersion, props.format_version);
  Add(TablePropertiesNames::kFixedKeyLen, props.fixed_key_len);
  Add(TablePropertiesNames::kColumnFamilyId, props.column_family_id);

  if (!props.filter_policy_name.empty()) {
    Add(TablePropertiesNames::kFilterPolicy, props.filter_policy_name);
  }
  if (!props.comparator_name.empty()) {
    Add(TablePropertiesNames::kComparator, props.comparator_name);
  }

  if (!props.merge_operator_name.empty()) {
    Add(TablePropertiesNames::kMergeOperator, props.merge_operator_name);
  }
  if (!props.property_collectors_names.empty()) {
    Add(TablePropertiesNames::kPropertyCollectors,
        props.property_collectors_names);
  }
  if (!props.column_family_name.empty()) {
    Add(TablePropertiesNames::kColumnFamilyName, props.column_family_name);
  }

  if (!props.compression_name.empty()) {
    Add(TablePropertiesNames::kCompression, props.compression_name);
  }
}

Slice PropertyBlockBuilder::Finish() {
  for (const auto& prop : props_) {
    properties_block_->Add(prop.first, prop.second);
  }

  return properties_block_->Finish();
}

void LogPropertiesCollectionError(
    Logger* info_log, const std::string& method, const std::string& name) {
  assert(method == "Add" || method == "Finish");

  std::string msg =
    "Encountered error when calling TablePropertiesCollector::" +
    method + "() with collector name: " + name;
  Log(InfoLogLevel::ERROR_LEVEL, info_log, "%s", msg.c_str());
}

bool NotifyCollectTableCollectorsOnAdd(
    const Slice& key, const Slice& value, uint64_t file_size,
    const std::vector<std::unique_ptr<IntTblPropCollector>>& collectors,
    Logger* info_log) {
  bool all_succeeded = true;
  for (auto& collector : collectors) {
    Status s = collector->InternalAdd(key, value, file_size);
    all_succeeded = all_succeeded && s.ok();
    if (!s.ok()) {
      LogPropertiesCollectionError(info_log, "Add" /* method */,
                                   collector->Name());
    }
  }
  return all_succeeded;
}

bool NotifyCollectTableCollectorsOnFinish(
    const std::vector<std::unique_ptr<IntTblPropCollector>>& collectors,
    Logger* info_log, PropertyBlockBuilder* builder) {
  bool all_succeeded = true;
  for (auto& collector : collectors) {
    UserCollectedProperties user_collected_properties;
    Status s = collector->Finish(&user_collected_properties);

    all_succeeded = all_succeeded && s.ok();
    if (!s.ok()) {
      LogPropertiesCollectionError(info_log, "Finish" /* method */,
                                   collector->Name());
    } else {
      builder->Add(user_collected_properties);
    }
  }

  return all_succeeded;
}

Status ReadProperties(const Slice& handle_value, RandomAccessFileReader* file,
                      const Footer& footer, const ImmutableCFOptions &ioptions,
                      TableProperties** table_properties) {
  assert(table_properties);

  Slice v = handle_value;
  BlockHandle handle;
  if (!handle.DecodeFrom(&v).ok()) {
    return Status::InvalidArgument("Failed to decode properties block handle");
  }

  BlockContents block_contents;
  ReadOptions read_options;
  read_options.verify_checksums = false;
  Status s;
  s = ReadBlockContents(file, footer, read_options, handle, &block_contents,
                        ioptions, false /* decompress */);

  if (!s.ok()) {
    return s;
  }

  Block properties_block(std::move(block_contents));
  std::unique_ptr<InternalIterator> iter(
      properties_block.NewIterator(BytewiseComparator()));

  auto new_table_properties = new TableProperties();
  // All pre-defined properties of type uint64_t
  std::unordered_map<std::string, uint64_t*> predefined_uint64_properties = {
      {TablePropertiesNames::kDataSize, &new_table_properties->data_size},
      {TablePropertiesNames::kIndexSize, &new_table_properties->index_size},
      {TablePropertiesNames::kFilterSize, &new_table_properties->filter_size},
      {TablePropertiesNames::kRawKeySize, &new_table_properties->raw_key_size},
      {TablePropertiesNames::kRawValueSize,
       &new_table_properties->raw_value_size},
      {TablePropertiesNames::kNumDataBlocks,
       &new_table_properties->num_data_blocks},
      {TablePropertiesNames::kNumEntries, &new_table_properties->num_entries},
      {TablePropertiesNames::kFormatVersion,
       &new_table_properties->format_version},
      {TablePropertiesNames::kFixedKeyLen,
       &new_table_properties->fixed_key_len},
      {TablePropertiesNames::kColumnFamilyId,
       &new_table_properties->column_family_id},
  };

  std::string last_key;
  for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {
    s = iter->status();
    if (!s.ok()) {
      break;
    }

    auto key = iter->key().ToString();
    // properties block is strictly sorted with no duplicate key.
    assert(last_key.empty() ||
           BytewiseComparator()->Compare(key, last_key) > 0);
    last_key = key;

    auto raw_val = iter->value();
    auto pos = predefined_uint64_properties.find(key);

    if (pos != predefined_uint64_properties.end()) {
      // handle predefined rocksdb properties
      uint64_t val;
      if (!GetVarint64(&raw_val, &val)) {
        // skip malformed value
        auto error_msg =
          "Detect malformed value in properties meta-block:"
          "\tkey: " + key + "\tval: " + raw_val.ToString();
        Log(InfoLogLevel::ERROR_LEVEL, ioptions.info_log, "%s",
        error_msg.c_str());
        continue;
      }
      *(pos->second) = val;
    } else if (key == TablePropertiesNames::kFilterPolicy) {
      new_table_properties->filter_policy_name = raw_val.ToString();
    } else if (key == TablePropertiesNames::kColumnFamilyName) {
      new_table_properties->column_family_name = raw_val.ToString();
    } else if (key == TablePropertiesNames::kComparator) {
      new_table_properties->comparator_name = raw_val.ToString();
    } else if (key == TablePropertiesNames::kMergeOperator) {
      new_table_properties->merge_operator_name = raw_val.ToString();
    } else if (key == TablePropertiesNames::kPropertyCollectors) {
      new_table_properties->property_collectors_names = raw_val.ToString();
    } else if (key == TablePropertiesNames::kCompression) {
      new_table_properties->compression_name = raw_val.ToString();
    } else {
      // handle user-collected properties
      new_table_properties->user_collected_properties.insert(
          {key, raw_val.ToString()});
    }
  }
  if (s.ok()) {
    *table_properties = new_table_properties;
  } else {
    delete new_table_properties;
  }

  return s;
}

Status ReadTableProperties(RandomAccessFileReader* file, uint64_t file_size,
                           uint64_t table_magic_number,
                           const ImmutableCFOptions &ioptions,
                           TableProperties** properties) {
  // -- Read metaindex block
  Footer footer;
  auto s = ReadFooterFromFile(file, file_size, &footer, table_magic_number);
  if (!s.ok()) {
    return s;
  }

  auto metaindex_handle = footer.metaindex_handle();
  BlockContents metaindex_contents;
  ReadOptions read_options;
  read_options.verify_checksums = false;
  s = ReadBlockContents(file, footer, read_options, metaindex_handle,
                        &metaindex_contents, ioptions, false /* decompress */);
  if (!s.ok()) {
    return s;
  }
  Block metaindex_block(std::move(metaindex_contents));
  std::unique_ptr<InternalIterator> meta_iter(
      metaindex_block.NewIterator(BytewiseComparator()));

  // -- Read property block
  bool found_properties_block = true;
  s = SeekToPropertiesBlock(meta_iter.get(), &found_properties_block);
  if (!s.ok()) {
    return s;
  }

  TableProperties table_properties;
  if (found_properties_block == true) {
    s = ReadProperties(meta_iter->value(), file, footer, ioptions, properties);
  } else {
    s = Status::NotFound();
  }

  return s;
}

Status FindMetaBlock(InternalIterator* meta_index_iter,
                     const std::string& meta_block_name,
                     BlockHandle* block_handle) {
  meta_index_iter->Seek(meta_block_name);
  if (meta_index_iter->status().ok() && meta_index_iter->Valid() &&
      meta_index_iter->key() == meta_block_name) {
    Slice v = meta_index_iter->value();
    return block_handle->DecodeFrom(&v);
  } else {
    return Status::Corruption("Cannot find the meta block", meta_block_name);
  }
}

Status FindMetaBlock(RandomAccessFileReader* file, uint64_t file_size,
                     uint64_t table_magic_number,
                     const ImmutableCFOptions &ioptions,
                     const std::string& meta_block_name,
                     BlockHandle* block_handle) {
  Footer footer;
  auto s = ReadFooterFromFile(file, file_size, &footer, table_magic_number);
  if (!s.ok()) {
    return s;
  }

  auto metaindex_handle = footer.metaindex_handle();
  BlockContents metaindex_contents;
  ReadOptions read_options;
  read_options.verify_checksums = false;
  s = ReadBlockContents(file, footer, read_options, metaindex_handle,
                        &metaindex_contents, ioptions, false /* do decompression */);
  if (!s.ok()) {
    return s;
  }
  Block metaindex_block(std::move(metaindex_contents));

  std::unique_ptr<InternalIterator> meta_iter;
  meta_iter.reset(metaindex_block.NewIterator(BytewiseComparator()));

  return FindMetaBlock(meta_iter.get(), meta_block_name, block_handle);
}

Status ReadMetaBlock(RandomAccessFileReader* file, uint64_t file_size,
                     uint64_t table_magic_number,
                     const ImmutableCFOptions &ioptions,
                     const std::string& meta_block_name,
                     BlockContents* contents) {
  Status status;
  Footer footer;
  status = ReadFooterFromFile(file, file_size, &footer, table_magic_number);
  if (!status.ok()) {
    return status;
  }

  // Reading metaindex block
  auto metaindex_handle = footer.metaindex_handle();
  BlockContents metaindex_contents;
  ReadOptions read_options;
  read_options.verify_checksums = false;
  status = ReadBlockContents(file, footer, read_options, metaindex_handle,
                             &metaindex_contents, ioptions,
                             false /* decompress */);
  if (!status.ok()) {
    return status;
  }

  // Finding metablock
  Block metaindex_block(std::move(metaindex_contents));

  std::unique_ptr<InternalIterator> meta_iter;
  meta_iter.reset(metaindex_block.NewIterator(BytewiseComparator()));

  BlockHandle block_handle;
  status = FindMetaBlock(meta_iter.get(), meta_block_name, &block_handle);

  if (!status.ok()) {
    return status;
  }

  // Reading metablock
  return ReadBlockContents(file, footer, read_options, block_handle, contents,
                           ioptions, false /* decompress */);
}

}  // namespace rocksdb


text:
cd ./GladLive.Security.Common.Tests
dnx test
cd ..


text:
package com.lmax.ant.paralleljunit;

class AdditiveParser
{
    private final NumberParser numberParser;
    private final int defaultThreads;

    public AdditiveParser(final NumberParser numberParser, final int defaultThreads)
    {
        this.numberParser = numberParser;
        this.defaultThreads = defaultThreads;
    }

    public int parse(final String threadsParam)
    {
        return defaultThreads + numberParser.parse(threadsParam);
    }
}


text:
package com.hellokoding.springboot;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class EditController {
    @RequestMapping("/edit")
    public String edit() {
        return "edit";
    }
}


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

	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>%d{yyyy.MM.dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n
			</pattern>
		</encoder>
	</appender>

	<logger name="no.bekk" level="TRACE" />

	<root level="INFO">
		<appender-ref ref="STDOUT" />
	</root>
</configuration>


text:
var _ = require('underscore');
var FormView = require('./__FormView'),
	$ = require('jquery'),
    productTpl = require('../templates/_entityProductCard.tpl'),
	ProductCard = require('../models/ProductCard');
var config = require('../conf');

exports = module.exports = FormView.extend({

	el: '#productForm',

	modelFilled: false,

	initialize: function(options) {
		this.router = options.router;
		this.model = new ProductCard({_id: options.id});
		var page = $(productTpl);
		var editTemplate = $('#editTemplate', page).html();
		this.template = _.template(_.unescape(editTemplate || ''));
		FormView.prototype.initialize.apply(this, options);
	},

	events: {
		'keyup input[type=text]': 'inputText',
		'keyup input[name="goods[name]"]': 'getGoods',
		'click li.list-group-item': 'selectGoods',
		'submit form': 'submit',
		'click .back': 'cancel',
	},

	load: function(){
		if(this.model.isNew()){
			this.modelFilled = true;
			return;
		}
		this.model.fetch({
			xhrFields: {
				withCredentials: true
			},
		});
	},

	inputText: function(evt){
		var that = this;
		//clear error
		this.$(evt.currentTarget).parent().removeClass('has-error');
		this.$(evt.currentTarget).parent().find('span.help-block').empty();
		var arr = this.$(evt.currentTarget).serializeArray();
		_.each(arr,function(obj){
			var error = that.model.preValidate(obj.name,obj.value);
			if(error){
				//set error
				this.$(evt.currentTarget).parent().addClass('has-error');
				this.$(evt.currentTarget).parent().find('span.help-block').text(error);
			}
		})
		return false;
	},

	getGoods: function(evt){
		this.$('#goods').empty();
		var that = this;
		var searchStr = this.$('input[name="goods[name]"]').val() || '';
		if(searchStr.length > 1){
			$.ajax({
				url: config.api.host + '/goods?type=search&per=10&searchStr=' + searchStr,
				type: 'GET',
				fields: {
					withCredentials: true
				}
			}).done(function(data){
				data = data || [];
				var goods = '
';
				data.forEach(function(item){
					goods += '
'+
							item.barcode + '|' +
							item.name  + '|' +
							item.category + '|' +
							item.price + item.unit + '|' +
							item.quantity + '
';
				});
				goods += '
';
				that.$('#goods').html(goods);
			});
		}
		return false;
	},

	selectGoods: function(evt){
		var goods = $(evt.currentTarget).text().split('|');
		this.$('input[name="goods[id]"]').val(goods[0]);
		this.$('input[name="goods[name]"]').val(goods[1]);
		this.$('#goods').empty();
		return false;
	},

	submit: function() {
		var that = this;
		//clear errors
		this.$('form-group').removeClass('has-error');
		this.$('form-group').find('span.help-block').empty();
		var arr = this.$('form').serializeArray();
		var errors = [];
		_.each(arr,function(obj){
			var error = that.model.preValidate(obj.name,obj.value);
			if(!_.isEmpty(error)){
				errors.push(error);
				//set serrors
				that.$('[name="' + obj.name + '"]').parent().addClass('has-error');
				that.$('[name="' + obj.name + '"]').parent().find('span.help-block').text(error);
				return false;
			}
		});
		if(!_.isEmpty(errors)) return false;
		//validate finished.

		var object = this.$('form').serializeJSON();
		this.model.set(object);
		// console.log(this.model.attributes);
		this.model.save(null, {
			xhrFields: {
				withCredentials: true
			},
		});
		return false;
	},

	cancel: function(){
		this.router.navigate('product/card/index',{trigger: true, replace: true});
		return false;
	},

	//fetch event: done
	done: function(response){
		if(!this.modelFilled){
			//first fetch: get model
			this.modelFilled = true;
			this.render();
		}else{
			//second fetch: submit
			this.router.navigate('product/card/index',{trigger: true, replace: true});
		}
	},

	render: function(){
		this.$el.html(this.template({model: this.model.toJSON()}));
		var category = this.model.get('category');
		this.$('input[name=category][value='+ category +']').attr('checked',true);
		var status = this.model.get('status');
		this.$('input[name=status][value='+ status +']').attr('checked',true);
		if(this.model.isNew()) this.$('.panel-title').text('新增产品');
		return this;
	},
});


text:
package org.springframework.cloud.kubernetes.fabric8.istio;

import java.util.Arrays;

import jakarta.annotation.PostConstruct;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.kubernetes.fabric8.istio.utils.MeshUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;

/**
 * Auto configuration for Istio bootstrap.
 *
 * @author Mauricio Salatino
 */
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(value = "spring.cloud.istio.enabled", matchIfMissing = true)
@EnableConfigurationProperties(IstioClientProperties.class)
public class IstioBootstrapConfiguration {

	private static final Log LOG = LogFactory.getLog(IstioBootstrapConfiguration.class);

	private static final String ISTIO_PROFILE = "istio";

	@Bean
	@ConditionalOnMissingBean
	public MeshUtils istioMeshUtils(IstioClientProperties istioClientProperties) {
		return new MeshUtils(istioClientProperties);
	}

	@EnableConfigurationProperties(IstioClientProperties.class)
	protected static class IstioDetectionConfiguration {

		private final MeshUtils utils;

		private final ConfigurableEnvironment environment;

		public IstioDetectionConfiguration(MeshUtils utils, ConfigurableEnvironment environment) {
			this.utils = utils;
			this.environment = environment;
		}

		@PostConstruct
		public void detectIstio() {
			addIstioProfile(this.environment);
		}

		void addIstioProfile(ConfigurableEnvironment environment) {
			if (this.utils.isIstioEnabled()) {
				if (hasIstioProfile(environment)) {
					if (LOG.isDebugEnabled()) {
						LOG.debug("'istio' already in list of active profiles");
					}
				}
				else {
					if (LOG.isDebugEnabled()) {
						LOG.debug("Adding 'istio' to list of active profiles");
					}
					environment.addActiveProfile(ISTIO_PROFILE);
				}
			}
			else {
				if (LOG.isDebugEnabled()) {
					LOG.debug("Not running inside kubernetes with istio enabled. Skipping 'istio' profile activation.");
				}
			}
		}

		private boolean hasIstioProfile(Environment environment) {
			return Arrays.stream(environment.getActiveProfiles()).anyMatch(ISTIO_PROFILE::equalsIgnoreCase);
		}

	}

}