text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cercospora grisella Peck

### Remarks
null


text:
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace IBM.WatsonDeveloperCloud.Discovery.v1.Model
{
    /// <summary>
    /// CreateCollectionRequest.
    /// </summary>
    public class CreateCollectionRequest
    {
        /// <summary>
        /// The language of the documents stored in the collection, in the form of an ISO 639-1 language code.
        /// </summary>
        /// <value>The language of the documents stored in the collection, in the form of an ISO 639-1 language code.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum LanguageEnum
        {

            /// <summary>
            /// Enum EN for en
            /// </summary>
            [EnumMember(Value = "en")]
            EN,

            /// <summary>
            /// Enum ES for es
            /// </summary>
            [EnumMember(Value = "es")]
            ES,

            /// <summary>
            /// Enum DE for de
            /// </summary>
            [EnumMember(Value = "de")]
            DE,

            /// <summary>
            /// Enum AR for ar
            /// </summary>
            [EnumMember(Value = "ar")]
            AR,

            /// <summary>
            /// Enum FR for fr
            /// </summary>
            [EnumMember(Value = "fr")]
            FR,

            /// <summary>
            /// Enum IT for it
            /// </summary>
            [EnumMember(Value = "it")]
            IT,

            /// <summary>
            /// Enum JA for ja
            /// </summary>
            [EnumMember(Value = "ja")]
            JA,

            /// <summary>
            /// Enum KO for ko
            /// </summary>
            [EnumMember(Value = "ko")]
            KO,

            /// <summary>
            /// Enum PT_BR for pt-br
            /// </summary>
            [EnumMember(Value = "pt-br")]
            PT_BR
        }

        /// <summary>
        /// The language of the documents stored in the collection, in the form of an ISO 639-1 language code.
        /// </summary>
        /// <value>The language of the documents stored in the collection, in the form of an ISO 639-1 language code.</value>
        [JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
        public LanguageEnum? Language { get; set; }
        /// <summary>
        /// The name of the collection to be created.
        /// </summary>
        /// <value>The name of the collection to be created.</value>
        [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
        public string Name { get; set; }
        /// <summary>
        /// A description of the collection.
        /// </summary>
        /// <value>A description of the collection.</value>
        [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)]
        public string Description { get; set; }
        /// <summary>
        /// The ID of the configuration in which the collection is to be created.
        /// </summary>
        /// <value>The ID of the configuration in which the collection is to be created.</value>
        [JsonProperty("configuration_id", NullValueHandling = NullValueHandling.Ignore)]
        public string ConfigurationId { get; set; }
    }

}

redpajama_set_name: RedPajamaGithub


text:
DEFINE_bool(tera_replication_read_try_all, false, "try to read all replicas instread of randomly choose one");
DEFINE_bool(tera_replication_write_need_all_success, false, "return OK only if all replicas write success");
DEFINE_string(tera_replication_conf_paths, "../conf/tera.flag", "paths for flag files. use \';\' to split");

namespace tera {

class RowMutationReplicateImpl : public RowMutationReplicate {
public:
    RowMutationReplicateImpl(const std::vector<RowMutation*>& row_mutations,
                             const std::vector<Table*>& tables)
        : row_mutations_(row_mutations),
          tables_(tables),
          user_callback_(NULL),
          user_context_(NULL),
          finish_cond_(&mutex_),
          finish_count_(0),
          success_row_mutation_(NULL),
          fail_row_mutation_(NULL) {
        CHECK_GT(row_mutations_.size(), 0u);
        for (size_t i = 0; i < row_mutations_.size(); i++) {
            row_mutations_[i]->SetCallBack(RowMutationCallback);
            row_mutations_[i]->SetContext(this);
        }
    }

    virtual ~RowMutationReplicateImpl() {
        for (size_t i = 0; i < row_mutations_.size(); i++) {
            delete row_mutations_[i];
        }
    }

    virtual const std::string& RowKey() {
        return row_mutations_[0]->RowKey();
    }

    virtual void Put(const std::string& value) {
        for (size_t i = 0; i < row_mutations_.size(); i++) {
            row_mutations_[i]->Put(value);
        }
    }

    virtual void Put(const std::string& value, int32_t ttl) {
        for (size_t i = 0; i < row_mutations_.size(); i++) {
            row_mutations_[i]->Put(value, ttl);
        }
    }

    virtual void DeleteRow() {
        for (size_t i = 0; i < row_mutations_.size(); i++) {
            row_mutations_[i]->DeleteRow();
        }
    }

    virtual void SetCallBack(Callback callback) {
        user_callback_ = callback;
    }

    virtual Callback GetCallBack() {
        return user_callback_;
    }

    virtual void SetContext(void* context) {
        user_context_ = context;
    }

    virtual void* GetContext() {
        return user_context_;
    }

    virtual const ErrorCode& GetError() {
        if (fail_row_mutation_ == NULL) {
            CHECK_NOTNULL(success_row_mutation_);
            return success_row_mutation_->GetError();
        }
        if (success_row_mutation_ == NULL) {
            CHECK_NOTNULL(fail_row_mutation_);
            return fail_row_mutation_->GetError();
        }
        if (FLAGS_tera_replication_write_need_all_success) {
            return fail_row_mutation_->GetError();
        } else {
            return success_row_mutation_->GetError();
        }
    }

public:
    const std::vector<RowMutation*>& GetRowMutationList() {
        return row_mutations_;
    }

    const std::vector<Table*>& GetTableList() {
        return tables_;
    }

    bool IsAsync() {
        return (user_callback_ != NULL);
    }

    void Wait() {
        CHECK(user_callback_ == NULL);
        MutexLock l(&mutex_);
        while (finish_count_ < row_mutations_.size()) {
            finish_cond_.Wait();
        }
    }

private:
    RowMutationReplicateImpl(const RowMutationReplicateImpl&);
    void operator=(const RowMutationReplicateImpl&);

    static void RowMutationCallback(RowMutation* mutation) {
        RowMutationReplicateImpl* mutation_rep = (RowMutationReplicateImpl*)mutation->GetContext();
        mutation_rep->ProcessCallback(mutation);
    }

    void ProcessCallback(RowMutation* mutation) {
        mutex_.Lock();
        if (mutation->GetError().GetType() == tera::ErrorCode::kOK) {
            if (success_row_mutation_ == NULL) {
                success_row_mutation_ = mutation;
            }
        } else {
            if (fail_row_mutation_ == NULL) {
                fail_row_mutation_ = mutation;
            }
        }
        if (++finish_count_ == row_mutations_.size()) {
            if (user_callback_ != NULL) {
                mutex_.Unlock(); // remember to unlock
                user_callback_(this);
                return; // remember to return
            } else {
                finish_cond_.Signal();
            }
        }
        mutex_.Unlock();
    }

    std::vector<RowMutation*> row_mutations_;
    std::vector<Table*> tables_;
    RowMutationReplicate::Callback user_callback_;
    void* user_context_;

    Mutex mutex_;
    CondVar finish_cond_;
    uint32_t finish_count_;
    RowMutation* success_row_mutation_;
    RowMutation* fail_row_mutation_;
};

class RowReaderReplicateImpl : public RowReaderReplicate {
public:
    RowReaderReplicateImpl(const std::vector<RowReader*>& row_readers,
                           const std::vector<Table*>& tables)
        : row_readers_(row_readers),
          tables_(tables),
          user_callback_(NULL),
          user_context_(NULL),
          finish_cond_(&mutex_),
          finish_count_(0),
          valid_row_reader_(NULL) {
        CHECK_GT(row_readers_.size(), 0u);
        for (size_t i = 0; i < row_readers_.size(); i++) {
            row_readers_[i]->SetCallBack(RowReaderCallback);
            row_readers_[i]->SetContext(this);
        }
    }

    virtual ~RowReaderReplicateImpl() {
        for (size_t i = 0; i < row_readers_.size(); i++) {
            delete row_readers_[i];
        }
    }

    virtual const std::string& RowName() {
        return row_readers_[0]->RowName();
    }

    virtual void SetCallBack(Callback callback) {
        user_callback_ = callback;
    }

    virtual void SetContext(void* context) {
        user_context_ = context;
    }

    virtual void* GetContext() {
        return user_context_;
    }

    virtual ErrorCode GetError() {
        CHECK_NOTNULL(valid_row_reader_);
        return valid_row_reader_->GetError();
    }

    virtual std::string Value() {
        CHECK_NOTNULL(valid_row_reader_);
        return valid_row_reader_->Value();
    }

public:
    const std::vector<RowReader*>& GetRowReaderList() {
        return row_readers_;
    }

    const std::vector<Table*>& GetTableList() {
        return tables_;
    }

    bool IsAsync() {
        return (user_callback_ != NULL);
    }

    void Wait() {
        CHECK(user_callback_ == NULL);
        MutexLock l(&mutex_);
        while (finish_count_ < row_readers_.size()) {
            finish_cond_.Wait();
        }
    }

private:
    RowReaderReplicateImpl(const RowReaderReplicateImpl&);
    void operator=(const RowReaderReplicateImpl&);

    static void RowReaderCallback(RowReader* reader) {
        RowReaderReplicateImpl* reader_rep = (RowReaderReplicateImpl*)reader->GetContext();
        reader_rep->ProcessCallback(reader);
    }

    void ProcessCallback(RowReader* reader) {
        mutex_.Lock();
        if (valid_row_reader_ == NULL && reader->GetError().GetType() == tera::ErrorCode::kOK) {
            valid_row_reader_ = reader;
        }
        if (++finish_count_ == row_readers_.size()) {
            // if all readers fail, use readers[0]
            if (valid_row_reader_ == NULL) {
                valid_row_reader_ = row_readers_[0];
            }
            if (user_callback_ != NULL) {
                mutex_.Unlock(); // remember to unlock
                user_callback_(this);
                return; // remember to return
            } else {
                finish_cond_.Signal();
            }
        }
        mutex_.Unlock();
    }

    std::vector<RowReader*> row_readers_;
    std::vector<Table*> tables_;
    RowReaderReplicate::Callback user_callback_;
    void* user_context_;

    Mutex mutex_;
    CondVar finish_cond_;
    uint32_t finish_count_;
    RowReader* valid_row_reader_;
};

/// 表接口
class TableReplicateImpl : public TableReplicate {
public:
    TableReplicateImpl(std::vector<Table*> tables) : tables_(tables) {}
    virtual ~TableReplicateImpl() {
        for (size_t i = 0; i < tables_.size(); i++) {
            delete tables_[i];
        }
    }

    virtual RowMutationReplicate* NewRowMutation(const std::string& row_key) {
        std::vector<RowMutation*> row_mutations;
        for (size_t i = 0; i < tables_.size(); i++) {
            row_mutations.push_back(tables_[i]->NewRowMutation(row_key));
        }
        return new RowMutationReplicateImpl(row_mutations, tables_);
    }

    virtual void ApplyMutation(RowMutationReplicate* mutation_rep) {
        RowMutationReplicateImpl* mutation_rep_impl = (RowMutationReplicateImpl*)mutation_rep;
        bool is_async = mutation_rep_impl->IsAsync();
        const std::vector<RowMutation*>& mutation_list = mutation_rep_impl->GetRowMutationList();
        const std::vector<Table*>& table_list = mutation_rep_impl->GetTableList();
        // in async mode, after the last call of ApplyMutation, we should not access
        // 'mutation_rep_impl' anymore, that's why we assign the value of 'mutation_list.size()'
        // to a local variable 'mutation_num'
        size_t mutation_num = mutation_list.size();
        for (size_t i = 0; i < mutation_num; i++) {
            table_list[i]->ApplyMutation(mutation_list[i]);
        }
        if (!is_async) {
            mutation_rep_impl->Wait();
        }
    }

    virtual RowReaderReplicate* NewRowReader(const std::string& row_key) {
        std::vector<RowReader*> row_readers;
        std::vector<Table*> tables;
        if (FLAGS_tera_replication_read_try_all) {
            for (size_t i = 0; i < tables_.size(); i++) {
                row_readers.push_back(tables_[i]->NewRowReader(row_key));
                tables.push_back(tables_[i]);
            }
        } else {
            size_t i = random() % tables_.size();
            row_readers.push_back(tables_[i]->NewRowReader(row_key));
            tables.push_back(tables_[i]);
        }
        return new RowReaderReplicateImpl(row_readers, tables);
    }

    virtual void Get(RowReaderReplicate* reader_rep) {
        RowReaderReplicateImpl* reader_rep_impl = (RowReaderReplicateImpl*)reader_rep;
        bool is_async = reader_rep_impl->IsAsync();
        const std::vector<RowReader*>& reader_list = reader_rep_impl->GetRowReaderList();
        const std::vector<Table*>& table_list = reader_rep_impl->GetTableList();
        size_t reader_num = reader_list.size();
        for (size_t i = 0; i < reader_num; i++) {
            table_list[i]->Get(reader_list[i]);
        }
        if (!is_async) {
            reader_rep_impl->Wait();
        }
    }

private:
    TableReplicateImpl(const TableReplicateImpl&);
    void operator=(const TableReplicateImpl&);

    std::vector<Table*> tables_;
};

class ClientReplicateImpl : public ClientReplicate {
public:
    /// 打开表格, 失败返回NULL
    virtual TableReplicate* OpenTable(const std::string& table_name, ErrorCode* err) {
        std::vector<Table*> tables;
        for (size_t i = 0; i < clients_.size(); i++) {
            Table* table = clients_[i]->OpenTable(table_name, err);
            if (table == NULL) {
                for (size_t j = 0; j < tables.size(); j++) {
                    delete tables[j];
                }
                return NULL;
            }
            tables.push_back(table);
        }
        return new TableReplicateImpl(tables);
    }

    ClientReplicateImpl(const std::vector<Client*>& clients) : clients_(clients) {}
    virtual ~ClientReplicateImpl() {
        for (size_t i = 0; i < clients_.size(); i++) {
            delete clients_[i];
        }
    }

private:
    ClientReplicateImpl(const ClientReplicateImpl&);
    void operator=(const ClientReplicateImpl&);

    std::vector<Client*> clients_;
};

void ClientReplicate::SetGlogIsInitialized() {
    Client::SetGlogIsInitialized();
}

ClientReplicate* ClientReplicate::NewClient(const std::string& confpath,
                                            const std::string& log_prefix,
                                            ErrorCode* err) {
    utils::LoadFlagFile(confpath);
    std::string conf_paths = FLAGS_tera_replication_conf_paths;
    std::vector<std::string> confs;
    size_t token_pos = 0;
    while (token_pos < conf_paths.size()) {
        size_t delim_pos = conf_paths.find(';', token_pos);
        std::string token(conf_paths, token_pos, delim_pos - token_pos);
        if (!token.empty()) {
            confs.push_back(token);
        }
        if (delim_pos == std::string::npos) {
            break;
        }
        token_pos = delim_pos + 1;
    }

    std::vector<Client*> clients;
    for (size_t i = 0; i < confs.size(); i++) {
        Client* client = Client::NewClient(confs[i], log_prefix, err);
        if (client == NULL) {
            for (size_t j = 0; j < clients.size(); j++) {
                delete clients[j];
            }
            return NULL;
        }
        clients.push_back(client);
    }
    return new ClientReplicateImpl(clients);
}

ClientReplicate* ClientReplicate::NewClient(const std::string& confpath, ErrorCode* err) {
    return NewClient(confpath, "tera", err);
}

ClientReplicate* ClientReplicate::NewClient() {
    return NewClient("", NULL);
}

} // namespace tera


text:
<?php

class OC_JSON{
	static protected $send_content_type_header = false;
	/**
	 * set Content-Type header to jsonrequest
	 */
	public static function setContentTypeHeader($type='application/json'){
		if (!self::$send_content_type_header){
			// We send json data
			header( 'Content-Type: '.$type );
			self::$send_content_type_header = true;
		}
	}

	/**
	* Check if the app is enabled, send json error msg if not
	*/
	public static function checkAppEnabled($app){
		if( !OC_App::isEnabled($app)){
			$l = new OC_L10N('core');
			self::error(array( 'data' => array( 'message' => $l->t('Application is not enabled') )));
			exit();
		}
	}

	/**
	* Check if the user is logged in, send json error msg if not
	*/
	public static function checkLoggedIn(){
		if( !OC_User::isLoggedIn()){
			$l = new OC_L10N('core');
			self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
			exit();
		}
	}

	/**
	* Check if the user is a admin, send json error msg if not
	*/
	public static function checkAdminUser(){
		self::checkLoggedIn();
		if( !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
			$l = new OC_L10N('core');
			self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
			exit();
		}
	}

	/**
	* Send json error msg
	*/
	public static function error($data = array()){
		$data['status'] = 'error';
		self::encodedPrint($data);
	}

	/**
	* Send json success msg
	*/
	public static function success($data = array()){
		$data['status'] = 'success';
		self::encodedPrint($data);
	}

	/**
	* Encode and print $data in json format
	*/
	public static function encodedPrint($data,$setContentType=true){
		if($setContentType){
			self::setContentTypeHeader();
		}
		echo json_encode($data);
	}
}


text:
 "use strict";
if (!Array.from) {
  Array.from = (function () {
    var toStr = Object.prototype.toString;
    var isCallable = function (fn) {
      return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
    };
    var toInteger = function (value) {
      var number = Number(value);
      if (isNaN(number)) { return 0; }
      if (number === 0 || !isFinite(number)) { return number; }
      return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
    };
    var maxSafeInteger = Math.pow(2, 53) - 1;
    var toLength = function (value) {
      var len = toInteger(value);
      return Math.min(Math.max(len, 0), maxSafeInteger);
    };
    return function from(arrayLike) {
      var C = this, items = Object(arrayLike);
      if (arrayLike == null) {
        throw new TypeError('Array.from requires an array-like object - not null or undefined');
      }
      var mapFn = arguments.length > 1 ? arguments[1] : void undefined, T;
      if (typeof mapFn !== 'undefined') {
        if (!isCallable(mapFn)) {
          throw new TypeError('Array.from: when provided, the second argument must be a function');
        }
        if (arguments.length > 2) {
          T = arguments[2];
        }
      }
      var len = toLength(items.length);
      var A = isCallable(C) ? Object(new C(len)) : new Array(len);
      var k = 0;
      var kValue;
      while (k < len) {
        kValue = items[k];
        if (mapFn) {
          A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
        } else {
          A[k] = kValue;
        }
        k += 1;
      }
      A.length = len;
      return A;
    }
  }());
}

if (!Array.prototype.includes) {
  Array.prototype.includes = function(searchElement  ) {
    var O = Object(this);
    var len = parseInt(O.length) || 0;
    if (len === 0) {
      return false;
    }
    var n = parseInt(arguments[1]) || 0;
    var k;
    if (n >= 0) {
      k = n;
    } else {
      k = len + n;
      if (k < 0) {k = 0;}
    }
    var currentElement;
    while (k < len) {
      currentElement = O[k];
      if (searchElement === currentElement ||
         (searchElement !== searchElement && currentElement !== currentElement)) {
        return true;
      }
      k++;
    }
    return false;
  };
}

if (!String.prototype.includes) {
  String.prototype.includes = function(search, start) {
    if (search instanceof RegExp) {
      throw TypeError('first argument must not be a RegExp');
    }
    if (start === undefined) { start = 0; }
    return this.indexOf(search, start) !== -1;
  };
}


text:
package com.taobao.api.domain;

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

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.taobao.api.TaobaoObject;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.mapping.ApiListField;

/**
 * Item(商品)结构
 *
 * @author auto create
 * @since 1.0, null
 */

@Entity
@Table(name = "top_item")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Item extends TaobaoObject {

	private static final long serialVersionUID = 1565651212948155555L;

	/**
	 * 售后服务ID,该字段仅在taobao.item.get接口中返回
	 */
	@ApiField("after_sale_id")
	private Long afterSaleId;

	/**
	 * 商品上传后的状态。onsale出售中,instock库中
	 */
	@ApiField("approve_status")
	private String approveStatus;

	/**
	 * 商城返点比例,为5的倍数,最低0.5%
	 */
	@ApiField("auction_point")
	private Long auctionPoint;

	/**
	 * 代充商品类型。只有少数类目下的商品可以标记上此字段,具体哪些类目可以上传可以通过taobao.itemcat.features.get获得。在代充商品的类目下,不传表示不标记商品类型(交易搜索中就不能通过标记搜到相关的交易了)。可选类型:
time_card(点卡软件代充)
fee_card(话费软件代充)
	 */
	@ApiField("auto_fill")
	private String autoFill;

	/**
	 * 基础色数据
	 */
	@ApiField("change_prop")
	private String changeProp;

	/**
	 * 商品所属的叶子类目 id
	 */
	@ApiField("cid")
	private Long cid;

	/**
	 * 货到付款运费模板ID
	 */
	@ApiField("cod_postage_id")
	private Long codPostageId;

	/**
	 * Item的发布时间,目前仅供taobao.item.add和taobao.item.get可用
	 */
	@ApiField("created")
	private Date created;

	/**
	 * 下架时间(格式:yyyy-MM-dd HH:mm:ss)
	 */
	@ApiField("delist_time")
	private Date delistTime;

	/**
	 * 发货时间信息
	 */
	@ApiField("delivery_time")
	private DeliveryTime deliveryTime;

	/**
	 * 商品描述, 字数要大于5个字符,小于25000个字符
	 */
	@ApiField("desc")
	private String desc;

	/**
	 * 宝贝描述规范化模块锚点信息
	 */
	@ApiField("desc_module_info")
	private DescModuleInfo descModuleInfo;

	/**
	 * 商品url
	 */
	@ApiField("detail_url")
	private String detailUrl;

	/**
	 * ems费用,格式:5.00;单位:元;精确到:分
	 */
	@ApiField("ems_fee")
	private String emsFee;

	/**
	 * 快递费用,格式:5.00;单位:元;精确到:分
	 */
	@ApiField("express_fee")
	private String expressFee;

	/**
	 * 宝贝特征值,
只有在Top支持的特征值才能保存到宝贝上
	 */
	@ApiField("features")
	private String features;

	/**
	 * 食品安全信息,包括:生产许可证编号、产品标准号、厂名、厂址等
	 */
	@ApiField("food_security")
	private FoodSecurity foodSecurity;

	/**
	 * 运费承担方式,seller(卖家承担),buyer(买家承担)
	 */
	@ApiField("freight_payer")
	private String freightPayer;

	/**
	 * 针对全球购卖家的库存类型业务,有两种库存类型:现货和代购;
参数值为1时代表现货,值为2时代表代购
	 */
	@ApiField("global_stock_type")
	private String globalStockType;

	/**
	 * 支持会员打折,true/false
	 */
	@ApiField("has_discount")
	private Boolean hasDiscount;

	/**
	 * 是否有发票,true/false
	 */
	@ApiField("has_invoice")
	private Boolean hasInvoice;

	/**
	 * 橱窗推荐,true/false
	 */
	@ApiField("has_showcase")
	private Boolean hasShowcase;

	/**
	 * 是否有保修,true/false
	 */
	@ApiField("has_warranty")
	private Boolean hasWarranty;

	/**
	 * 加价幅度。如果为0,代表系统代理幅度。
在竞拍中,为了超越上一个出价,会员需要在当前出价上增加金额,这个金额就是加价幅度。卖家在发布宝贝的时候可以自定义加价幅度,也可以让系统自动代理加价。系统自动代理加价的加价幅度随着当前出价金额的增加而增加,我们建议会员使用系统自动代理加价,并请买家在出价前看清楚加价幅度的具体金额。另外需要注意是,此功能只适用于拍卖的商品。
以下是系统自动代理加价幅度表:
当前价(加价幅度 )
1-40( 1 )、41-100( 2 )、101-200(5 )、201-500 (10)、501-1001(15)、001-2000(25)、2001-5000(50)、5001-10000(100)
10001以上         200
	 */
	@ApiField("increment")
	private String increment;

	/**
	 * 用户内店宝贝装修模板id
	 */
	@ApiField("inner_shop_auction_template_id")
	private Long innerShopAuctionTemplateId;

	/**
	 * 用户自行输入的类目属性ID串。结构:"pid1,pid2,pid3",如:"20000"(表示品牌) 注:通常一个类目下用户可输入的关键属性不超过1个。
	 */
	@ApiField("input_pids")
	private String inputPids;

	/**
	 * 用户自行输入的子属性名和属性值,结构:"父属性值;一级子属性名;一级子属性值;二级子属性名;自定义输入值,....",如:"耐克;耐克系列;科比系列;科比系列;2K5",input_str需要与input_pids一一对应,注:通常一个类目下用户可输入的关键属性不超过1个。所有属性别名加起来不能超过 3999字节。
	 */
	@ApiField("input_str")
	private String inputStr;

	/**
	 * 是否是3D淘宝的商品
	 */
	@ApiField("is_3D")
	private Boolean is3D;

	/**
	 * 是否在外部网店显示
	 */
	@ApiField("is_ex")
	private Boolean isEx;

	/**
	 * 非分销商品:0,代销:1,经销:2
	 */
	@ApiField("is_fenxiao")
	private Long isFenxiao;

	/**
	 * 是否24小时闪电发货
	 */
	@ApiField("is_lightning_consignment")
	private Boolean isLightningConsignment;

	/**
	 * 商品是否为先行赔付
taobao.items.search和taobao.items.vip.search专用
	 */
	@ApiField("is_prepay")
	private Boolean isPrepay;

	/**
	 * 是否在淘宝显示
	 */
	@ApiField("is_taobao")
	private Boolean isTaobao;

	/**
	 * 是否定时上架商品
	 */
	@ApiField("is_timing")
	private Boolean isTiming;

	/**
	 * 虚拟商品的状态字段
	 */
	@ApiField("is_virtual")
	private Boolean isVirtual;

	/**
	 * 标示商品是否为新品。
值含义:true-是,false-否。
	 */
	@ApiField("is_xinpin")
	private Boolean isXinpin;

	/**
	 * 商品图片列表(包括主图)。fields中只设置item_img可以返回ItemImg结构体中所有字段,如果设置为item_img.id、item_img.url、item_img.position等形式就只会返回相应的字段
	 */
	@ApiListField("item_imgs")
	@ApiField("item_img")
	private List<ItemImg> itemImgs;

	/**
	 * 表示商品的体积,用于按体积计费的运费模板。该值的单位为立方米(m3)。
该值支持两种格式的设置:格式1:bulk:3,单位为立方米(m3),表示直接设置为商品的体积。格式2:weight:10;breadth:10;height:10,单位为米(m)
	 */
	@ApiField("item_size")
	private String itemSize;

	/**
	 * 商品的重量,用于按重量计费的运费模板。注意:单位为kg
	 */
	@ApiField("item_weight")
	private String itemWeight;

	/**
	 * 上架时间(格式:yyyy-MM-dd HH:mm:ss)
	 */
	@ApiField("list_time")
	private Date listTime;

	/**
	 * 本地生活电子交易凭证业务,目前此字段只涉及到的信息为有效期:
如果有效期为起止日期类型,此值为2012-08-06,2012-08-16
如果有效期为【购买成功日 至】类型则格式为2012-08-16
如果有效期为天数类型则格式为3
	 */
	@ApiField("locality_life")
	private LocalityLife localityLife;

	/**
	 * 商品所在地
	 */
	@ApiField("location")
	private Location location;

	/**
	 * 商品修改时间(格式:yyyy-MM-dd HH:mm:ss)
	 */
	@ApiField("modified")
	private Date modified;

	/**
	 * 卖家昵称
	 */
	@ApiField("nick")
	private String nick;

	/**
	 * 商品数量
	 */
	@ApiField("num")
	private Long num;

	/**
	 * 商品数字id
	 */
	@Id
	@ApiField("num_iid")
	private Long numIid;

	/**
	 * 是否淘1站商品
	 */
	@ApiField("one_station")
	private Boolean oneStation;

	/**
	 * 商家外部编码(可与商家外部系统对接)
	 */
	@ApiField("outer_id")
	private String outerId;

	/**
	 * 用户外店装修模板id
	 */
	@ApiField("outer_shop_auction_template_id")
	private Long outerShopAuctionTemplateId;

	/**
	 * 用于保存拍卖有关的信息
	 */
	@ApiField("paimai_info")
	private PaimaiInfo paimaiInfo;

	/**
	 * 商品主图片地址
	 */
	@ApiField("pic_url")
	private String picUrl;

	/**
	 * 平邮费用,格式:5.00;单位:元;精确到:分
	 */
	@ApiField("post_fee")
	private String postFee;

	/**
	 * 宝贝所属的运费模板ID,如果没有返回则说明没有使用运费模板
	 */
	@ApiField("postage_id")
	private Long postageId;

	/**
	 * 商品价格,格式:5.00;单位:元;精确到:分
	 */
	@ApiField("price")
	private String price;

	/**
	 * 宝贝所属产品的id(可能为空). 该字段可以通过taobao.products.search 得到
	 */
	@ApiField("product_id")
	private Long productId;

	/**
	 * 消保类型,多个类型以,分割。可取以下值:
2:假一赔三;4:7天无理由退换货;taobao.items.search和taobao.items.vip.search专用
	 */
	@ApiField("promoted_service")
	private String promotedService;

	/**
	 * 商品属性图片列表。fields中只设置prop_img可以返回PropImg结构体中所有字段,如果设置为prop_img.id、prop_img.url、prop_img.properties、prop_img.position等形式就只会返回相应的字段
	 */
	@ApiListField("prop_imgs")
	@ApiField("prop_img")
	private List<PropImg> propImgs;

	/**
	 * 属性值别名,比如颜色的自定义名称
	 */
	@ApiField("property_alias")
	private String propertyAlias;

	/**
	 * 商品属性 格式:pid:vid;pid:vid
	 */
	@ApiField("props")
	private String props;

	/**
	 * 商品属性名称。标识着props内容里面的pid和vid所对应的名称。格式为:pid1:vid1:pid_name1:vid_name1;pid2:vid2:pid_name2:vid_name2……(注:属性名称中的冒号":"被转换为:"#cln#";
分号";"被转换为:"#scln#"
)
	 */
	@ApiField("props_name")
	private String propsName;

	/**
	 * 商品所属卖家的信用等级数,1表示1心,2表示2心……,只有调用商品搜索:taobao.items.get和taobao.items.search的时候才能返回
	 */
	@ApiField("score")
	private Long score;

	/**
	 * 秒杀商品类型。打上秒杀标记的商品,用户只能下架并不能再上架,其他任何编辑或删除操作都不能进行。如果用户想取消秒杀标记,需要联系小二进行操作。如果秒杀结束需要自由编辑请联系活动负责人(小二)去掉秒杀标记。可选类型
web_only(只能通过web网络秒杀)
wap_only(只能通过wap网络秒杀)
web_and_wap(既能通过web秒杀也能通过wap秒杀)
	 */
	@ApiField("second_kill")
	private String secondKill;

	/**
	 * 是否承诺退换货服务!
	 */
	@ApiField("sell_promise")
	private Boolean sellPromise;

	/**
	 * 商品所属的店铺内卖家自定义类目列表
	 */
	@ApiField("seller_cids")
	private String sellerCids;

	/**
	 * Sku列表。fields中只设置sku可以返回Sku结构体中所有字段,如果设置为sku.sku_id、sku.properties、sku.quantity等形式就只会返回相应的字段
	 */
	@ApiListField("skus")
	@ApiField("sku")
	private List<Sku> skus;

	/**
	 * 商品新旧程度(全新:new,闲置:unused,二手:second)
	 */
	@ApiField("stuff_status")
	private String stuffStatus;

	/**
	 * 商品是否支持拍下减库存:1支持;2取消支持(付款减库存);0(默认)不更改 集市卖家默认拍下减库存; 商城卖家默认付款减库存
	 */
	@ApiField("sub_stock")
	private Long subStock;

	/**
	 * 页面模板id
	 */
	@ApiField("template_id")
	private String templateId;

	/**
	 * 商品标题,不能超过60字节
	 */
	@ApiField("title")
	private String title;

	/**
	 * 商品类型(fixed:一口价;auction:拍卖)注:取消团购
	 */
	@ApiField("type")
	private String type;

	/**
	 * 有效期,7或者14(默认是14天)
	 */
	@ApiField("valid_thru")
	private Long validThru;

	/**
	 * 商品视频列表(目前只支持单个视频关联)。fields中只设置video可以返回Video结构体中所有字段,如果设置为video.id、video.video_id、
video.url等形式就只会返回相应的字段
	 */
	@ApiListField("videos")
	@ApiField("video")
	private List<Video> videos;

	/**
	 * 商品是否违规,违规:true , 不违规:false
	 */
	@ApiField("violation")
	private Boolean violation;

	/**
	 * 对应搜索商品列表页的最近成交量,只有调用商品搜索:taobao.items.get和taobao.items.search的时候才能返回
	 */
	@ApiField("volume")
	private Long volume;

	/**
	 * 不带html标签的desc文本信息,该字段只在taobao.item.get接口中返回
	 */
	@ApiField("wap_desc")
	private String wapDesc;

	/**
	 * 适合wap应用的商品详情url ,该字段只在taobao.item.get接口中返回
	 */
	@ApiField("wap_detail_url")
	private String wapDetailUrl;

	/**
	 * 预扣库存,即付款减库存的商品现在有多少处于未付款状态的订单
	 */
	@ApiField("with_hold_quantity")
	private Long withHoldQuantity;

	/**
	 * 商品所属的商家的旺旺在线状况,
taobao.items.search和taobao.items.vip.search专用
	 */
	@ApiField("ww_status")
	private Boolean wwStatus;

	public Long getAfterSaleId() {
		return this.afterSaleId;
	}
	public void setAfterSaleId(Long afterSaleId) {
		this.afterSaleId = afterSaleId;
	}

	public String getApproveStatus() {
		return this.approveStatus;
	}
	public void setApproveStatus(String approveStatus) {
		this.approveStatus = approveStatus;
	}

	public Long getAuctionPoint() {
		return this.auctionPoint;
	}
	public void setAuctionPoint(Long auctionPoint) {
		this.auctionPoint = auctionPoint;
	}

	public String getAutoFill() {
		return this.autoFill;
	}
	public void setAutoFill(String autoFill) {
		this.autoFill = autoFill;
	}

	public String getChangeProp() {
		return this.changeProp;
	}
	public void setChangeProp(String changeProp) {
		this.changeProp = changeProp;
	}

	public Long getCid() {
		return this.cid;
	}
	public void setCid(Long cid) {
		this.cid = cid;
	}

	public Long getCodPostageId() {
		return this.codPostageId;
	}
	public void setCodPostageId(Long codPostageId) {
		this.codPostageId = codPostageId;
	}

	public Date getCreated() {
		return this.created;
	}
	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getDelistTime() {
		return this.delistTime;
	}
	public void setDelistTime(Date delistTime) {
		this.delistTime = delistTime;
	}

	public DeliveryTime getDeliveryTime() {
		return this.deliveryTime;
	}
	public void setDeliveryTime(DeliveryTime deliveryTime) {
		this.deliveryTime = deliveryTime;
	}

	public String getDesc() {
		return this.desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}

	public DescModuleInfo getDescModuleInfo() {
		return this.descModuleInfo;
	}
	public void setDescModuleInfo(DescModuleInfo descModuleInfo) {
		this.descModuleInfo = descModuleInfo;
	}

	public String getDetailUrl() {
		return this.detailUrl;
	}
	public void setDetailUrl(String detailUrl) {
		this.detailUrl = detailUrl;
	}

	public String getEmsFee() {
		return this.emsFee;
	}
	public void setEmsFee(String emsFee) {
		this.emsFee = emsFee;
	}

	public String getExpressFee() {
		return this.expressFee;
	}
	public void setExpressFee(String expressFee) {
		this.expressFee = expressFee;
	}

	public String getFeatures() {
		return this.features;
	}
	public void setFeatures(String features) {
		this.features = features;
	}

	public FoodSecurity getFoodSecurity() {
		return this.foodSecurity;
	}
	public void setFoodSecurity(FoodSecurity foodSecurity) {
		this.foodSecurity = foodSecurity;
	}

	public String getFreightPayer() {
		return this.freightPayer;
	}
	public void setFreightPayer(String freightPayer) {
		this.freightPayer = freightPayer;
	}

	public String getGlobalStockType() {
		return this.globalStockType;
	}
	public void setGlobalStockType(String globalStockType) {
		this.globalStockType = globalStockType;
	}

	public Boolean getHasDiscount() {
		return this.hasDiscount;
	}
	public void setHasDiscount(Boolean hasDiscount) {
		this.hasDiscount = hasDiscount;
	}

	public Boolean getHasInvoice() {
		return this.hasInvoice;
	}
	public void setHasInvoice(Boolean hasInvoice) {
		this.hasInvoice = hasInvoice;
	}

	public Boolean getHasShowcase() {
		return this.hasShowcase;
	}
	public void setHasShowcase(Boolean hasShowcase) {
		this.hasShowcase = hasShowcase;
	}

	public Boolean getHasWarranty() {
		return this.hasWarranty;
	}
	public void setHasWarranty(Boolean hasWarranty) {
		this.hasWarranty = hasWarranty;
	}

	public String getIncrement() {
		return this.increment;
	}
	public void setIncrement(String increment) {
		this.increment = increment;
	}

	public Long getInnerShopAuctionTemplateId() {
		return this.innerShopAuctionTemplateId;
	}
	public void setInnerShopAuctionTemplateId(Long innerShopAuctionTemplateId) {
		this.innerShopAuctionTemplateId = innerShopAuctionTemplateId;
	}

	public String getInputPids() {
		return this.inputPids;
	}
	public void setInputPids(String inputPids) {
		this.inputPids = inputPids;
	}

	public String getInputStr() {
		return this.inputStr;
	}
	public void setInputStr(String inputStr) {
		this.inputStr = inputStr;
	}

	public Boolean getIs3D() {
		return this.is3D;
	}
	public void setIs3D(Boolean is3D) {
		this.is3D = is3D;
	}

	public Boolean getIsEx() {
		return this.isEx;
	}
	public void setIsEx(Boolean isEx) {
		this.isEx = isEx;
	}

	public Long getIsFenxiao() {
		return this.isFenxiao;
	}
	public void setIsFenxiao(Long isFenxiao) {
		this.isFenxiao = isFenxiao;
	}

	public Boolean getIsLightningConsignment() {
		return this.isLightningConsignment;
	}
	public void setIsLightningConsignment(Boolean isLightningConsignment) {
		this.isLightningConsignment = isLightningConsignment;
	}

	public Boolean getIsPrepay() {
		return this.isPrepay;
	}
	public void setIsPrepay(Boolean isPrepay) {
		this.isPrepay = isPrepay;
	}

	public Boolean getIsTaobao() {
		return this.isTaobao;
	}
	public void setIsTaobao(Boolean isTaobao) {
		this.isTaobao = isTaobao;
	}

	public Boolean getIsTiming() {
		return this.isTiming;
	}
	public void setIsTiming(Boolean isTiming) {
		this.isTiming = isTiming;
	}

	public Boolean getIsVirtual() {
		return this.isVirtual;
	}
	public void setIsVirtual(Boolean isVirtual) {
		this.isVirtual = isVirtual;
	}

	public Boolean getIsXinpin() {
		return this.isXinpin;
	}
	public void setIsXinpin(Boolean isXinpin) {
		this.isXinpin = isXinpin;
	}

	public List<ItemImg> getItemImgs() {
		return this.itemImgs;
	}
	public void setItemImgs(List<ItemImg> itemImgs) {
		this.itemImgs = itemImgs;
	}

	public String getItemSize() {
		return this.itemSize;
	}
	public void setItemSize(String itemSize) {
		this.itemSize = itemSize;
	}

	public String getItemWeight() {
		return this.itemWeight;
	}
	public void setItemWeight(String itemWeight) {
		this.itemWeight = itemWeight;
	}

	public Date getListTime() {
		return this.listTime;
	}
	public void setListTime(Date listTime) {
		this.listTime = listTime;
	}

	public LocalityLife getLocalityLife() {
		return this.localityLife;
	}
	public void setLocalityLife(LocalityLife localityLife) {
		this.localityLife = localityLife;
	}

	public Location getLocation() {
		return this.location;
	}
	public void setLocation(Location location) {
		this.location = location;
	}

	public Date getModified() {
		return this.modified;
	}
	public void setModified(Date modified) {
		this.modified = modified;
	}

	public String getNick() {
		return this.nick;
	}
	public void setNick(String nick) {
		this.nick = nick;
	}

	public Long getNum() {
		return this.num;
	}
	public void setNum(Long num) {
		this.num = num;
	}

	public Long getNumIid() {
		return this.numIid;
	}
	public void setNumIid(Long numIid) {
		this.numIid = numIid;
	}

	public Boolean getOneStation() {
		return this.oneStation;
	}
	public void setOneStation(Boolean oneStation) {
		this.oneStation = oneStation;
	}

	public String getOuterId() {
		return this.outerId;
	}
	public void setOuterId(String outerId) {
		this.outerId = outerId;
	}

	public Long getOuterShopAuctionTemplateId() {
		return this.outerShopAuctionTemplateId;
	}
	public void setOuterShopAuctionTemplateId(Long outerShopAuctionTemplateId) {
		this.outerShopAuctionTemplateId = outerShopAuctionTemplateId;
	}

	public PaimaiInfo getPaimaiInfo() {
		return this.paimaiInfo;
	}
	public void setPaimaiInfo(PaimaiInfo paimaiInfo) {
		this.paimaiInfo = paimaiInfo;
	}

	public String getPicUrl() {
		return this.picUrl;
	}
	public void setPicUrl(String picUrl) {
		this.picUrl = picUrl;
	}

	public String getPostFee() {
		return this.postFee;
	}
	public void setPostFee(String postFee) {
		this.postFee = postFee;
	}

	public Long getPostageId() {
		return this.postageId;
	}
	public void setPostageId(Long postageId) {
		this.postageId = postageId;
	}

	public String getPrice() {
		return this.price;
	}
	public void setPrice(String price) {
		this.price = price;
	}

	public Long getProductId() {
		return this.productId;
	}
	public void setProductId(Long productId) {
		this.productId = productId;
	}

	public String getPromotedService() {
		return this.promotedService;
	}
	public void setPromotedService(String promotedService) {
		this.promotedService = promotedService;
	}

	public List<PropImg> getPropImgs() {
		return this.propImgs;
	}
	public void setPropImgs(List<PropImg> propImgs) {
		this.propImgs = propImgs;
	}

	public String getPropertyAlias() {
		return this.propertyAlias;
	}
	public void setPropertyAlias(String propertyAlias) {
		this.propertyAlias = propertyAlias;
	}

	public String getProps() {
		return this.props;
	}
	public void setProps(String props) {
		this.props = props;
	}

	public String getPropsName() {
		return this.propsName;
	}
	public void setPropsName(String propsName) {
		this.propsName = propsName;
	}

	public Long getScore() {
		return this.score;
	}
	public void setScore(Long score) {
		this.score = score;
	}

	public String getSecondKill() {
		return this.secondKill;
	}
	public void setSecondKill(String secondKill) {
		this.secondKill = secondKill;
	}

	public Boolean getSellPromise() {
		return this.sellPromise;
	}
	public void setSellPromise(Boolean sellPromise) {
		this.sellPromise = sellPromise;
	}

	public String getSellerCids() {
		return this.sellerCids;
	}
	public void setSellerCids(String sellerCids) {
		this.sellerCids = sellerCids;
	}

	public List<Sku> getSkus() {
		return this.skus;
	}
	public void setSkus(List<Sku> skus) {
		this.skus = skus;
	}

	public String getStuffStatus() {
		return this.stuffStatus;
	}
	public void setStuffStatus(String stuffStatus) {
		this.stuffStatus = stuffStatus;
	}

	public Long getSubStock() {
		return this.subStock;
	}
	public void setSubStock(Long subStock) {
		this.subStock = subStock;
	}

	public String getTemplateId() {
		return this.templateId;
	}
	public void setTemplateId(String templateId) {
		this.templateId = templateId;
	}

	public String getTitle() {
		return this.title;
	}
	public void setTitle(String title) {
		this.title = title;
	}

	public String getType() {
		return this.type;
	}
	public void setType(String type) {
		this.type = type;
	}

	public Long getValidThru() {
		return this.validThru;
	}
	public void setValidThru(Long validThru) {
		this.validThru = validThru;
	}

	public List<Video> getVideos() {
		return this.videos;
	}
	public void setVideos(List<Video> videos) {
		this.videos = videos;
	}

	public Boolean getViolation() {
		return this.violation;
	}
	public void setViolation(Boolean violation) {
		this.violation = violation;
	}

	public Long getVolume() {
		return this.volume;
	}
	public void setVolume(Long volume) {
		this.volume = volume;
	}

	public String getWapDesc() {
		return this.wapDesc;
	}
	public void setWapDesc(String wapDesc) {
		this.wapDesc = wapDesc;
	}

	public String getWapDetailUrl() {
		return this.wapDetailUrl;
	}
	public void setWapDetailUrl(String wapDetailUrl) {
		this.wapDetailUrl = wapDetailUrl;
	}

	public Long getWithHoldQuantity() {
		return this.withHoldQuantity;
	}
	public void setWithHoldQuantity(Long withHoldQuantity) {
		this.withHoldQuantity = withHoldQuantity;
	}

	public Boolean getWwStatus() {
		return this.wwStatus;
	}
	public void setWwStatus(Boolean wwStatus) {
		this.wwStatus = wwStatus;
	}

}


text:
var path = require('path')
var webpack = require('webpack')
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: {
    vendor: ['vue','vuex','lodash','jquery'],
    bundle: './src/main'
  },
  output: {
    path: path.join(__dirname, 'dist'),
    filename: '[hash:8].[name].js',
    publicPath: '/'
  },
  plugins: [
    new webpack.DefinePlugin({
      'process.env':{
        'NODE_ENV': JSON.stringify('production')
      }
    }),
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.UglifyJsPlugin({
        compress: { warnings: false },
        minimize: true
    }),
    new webpack.optimize.CommonsChunkPlugin({
      name: "vendor",
      //filename:"vendor.js",
      minChunks: Infinity //Infinity
    }),
    new ExtractTextPlugin('[hash:8].style.css', { allChunks: true }),
    new HtmlWebpackPlugin({
      title: "",
      template: path.join(__dirname,'src/index.html'),  //模板文件
      inject:'body',
      hash:false,    //为静态资源生成hash值
      minify:{    //压缩HTML文件
        removeComments:false,    //移除HTML中的注释
        collapseWhitespace:true    //删除空白符与换行符
      }
    }),
    new webpack.ProvidePlugin({
      $: "jquery",
      jQuery: "jquery",
      "window.jQuery": "jquery"
    })
  ],
  module: {
    loaders: [
    {
      test: /\.vue$/,  loader: 'vue',include: path.join(__dirname,'src')
    },
    {
      test: /\.js$/,  loader: 'babel', exclude: /node_modules|vue\/dist|vue-hot-reload-api|vue-router\/|vue-loader/
    },
    { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader?sourceMap' ) },
    {
      test: /\.(jpe?g|png|gif)$/i,
      loaders: [
        'url?limit=10000&name=image/[hash:8].[name].[ext]',
        'image-webpack?{progressive:true, optimizationLevel: 7, interlaced: false, pngquant:{quality: "65-90", speed: 4}}'
      ]
    },{
      test: /\.(woff|woff2|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
      loader: 'url?limit=10000&name=fonts/[hash:8].[name].[ext]'
    }

    ]
  },
  vue: {
    loaders: {
      js: 'babel'
    }
  },
  resolve: {
    root: path.resolve(__dirname, 'node_modules'),
    extensions: ['','.js','.vue','.scss','css','xml']
  }
}


text:
@interface YQSQLCache : NSObject

@property (nonatomic, copy) NSString *saveSql;
@property (nonatomic, copy) NSString *updateSql;
@property (nonatomic, copy) NSString *countSql;

@end


text:
default['threatstack']['repo_enable'] = true
default['threatstack']['validate_gpg_key'] = true
default['threatstack']['repo']['components'] = ['main']

case node['platform_family']
when 'debian'
  default['threatstack']['repo']['dist'] = node['lsb']['codename']
  default['threatstack']['repo']['url'] = 'https://pkg.threatstack.com/v2/Ubuntu'
  default['threatstack']['repo']['key'] = 'https://app.threatstack.com/APT-GPG-KEY-THREATSTACK'
when 'rhel', 'fedora', 'amazon'
  case node['platform']
  when 'amazon'
    if node['platform_version'] == '2'
      default['threatstack']['repo']['url'] = 'https://pkg.threatstack.com/v2/Amazon/2'
    else
      default['threatstack']['repo']['url'] = 'https://pkg.threatstack.com/v2/Amazon/1'
    end
  when 'centos', 'redhat'
    default['threatstack']['repo']['url'] = "https://pkg.threatstack.com/v2/EL/#{node['platform_version'].to_i}"
  else
    default['threatstack']['repo']['url'] = 'https://pkg.threatstack.com/v2/EL/7'
  end
  default['threatstack']['repo']['key'] = 'https://app.threatstack.com/RPM-GPG-KEY-THREATSTACK'
  default['threatstack']['repo']['key_file'] = '/etc/pki/rpm-gpg/RPM-GPG-KEY-THREATSTACK'
  default['threatstack']['repo']['key_file_uri'] = 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-THREATSTACK'
end


text:
import jwt from 'jsonwebtoken';
import dotenv from 'dotenv';
import passport from './auth';

dotenv.config();

module.exports = {
  login(req, res, next) {
    passport.authenticate('local', (err, user) => {
      if (err) { return res.status(404).send(err); }
      if (!user) { return res.status(404).send(user); }
      req.logIn(user, (err) => {
        if (err) { return next(err); }
        const token = jwt.sign({
          username: user.username,
          email: user.email,
          id: user.id
        },
        process.env.JWT_SECRET,
        {
          expiresIn: '2 days'
        });
        const { id, username, phone, email } = user;
        res.status(200).json({
          message: 'Login successful',
          user: { id, username, email, phone },
          token
        });
      });
    })(req, res, next);
  }
};


text:
cask "flock" do
  version "2.2.509"
  sha256 "4319dfd3eafa83dc2fa73317fb00cab8baccf938dd12dc2cefcedcab4b3fe132"

  url "https://updates.flock.co/fl_mac_electron/Flock-macOS-#{version}.dmg",
      verified: "flock.co/"
  name "Flock"
  desc "Business messaging and team collaboration app"
  homepage "https://flock.com/"

  livecheck do
    url "https://bingo.flock.co/dl.php?client=mac"
    strategy :header_match
  end

  app "Flock.app"

  zap trash: [
    "~/Library/Application Support/Flock",
    "~/Library/Logs/Flock",
    "~/Library/Preferences/to.go.osx.plist",
    "~/Library/Saved Application State/to.go.osx.savedState",
  ]
end


text:
<?php

namespace Aws\Rds\Exception;

/**
 * SNS has responded that there is a problem with the SND topic specified.
 */
class SNSInvalidTopicException extends RdsException {}


text:
define('Elements', ['Element'], function ($) {
    'use strict';

    return function (query, docNode) {
        var targets;
        var elements;

        function toArray(o) {
            var a = [];
            var i = o.length;
            a.length = i;
            while (i--) {a[i] = o[i];}
            return a;
        }

        if (query === document) {
            targets = [document];
        } else if (query instanceof Element) {
            targets = [query];
        } else if (query instanceof HTMLCollection || query instanceof NodeList) {
            targets = toArray(query);
        } else {
            targets = toArray((docNode || document).querySelectorAll(query));
        }

        elements = targets.map(function (target) {
            return $(target);
        });

        return {

            elements: function () {
                return elements;
            },

            concat: function (elems) {
                elements = elements.concat(elems.elements());
                return this;
            },

            each: function (callback) {
                elements.forEach(callback);
                return this;
            },

            //
            // DOM
            // --------------------

            elems: function () {
                return targets;
            },

            html: function (html) {
                if (typeOf(html) === 'string') {
                    return this.each(function (elem) {
                        elem.html(html);
                    });
                }
                return elements.map(function (elem) {
                    return elem.html();
                });
            },

            append: function (o) {
                return this.each(function (elem) {
                    elem.append(o);
                });
            },

            attr: function (attr, value) {
                if (value !== undefined) {
                    return this.each(function (elem) {
                        elem.attr(attr, value);
                    });
                }
                return elements.map(function (elem) {
                    return elem.attr(attr);
                });
            },

            //
            // Events
            // --------------------

            on: function(event, fn) {
                return this.each(function (elem) {
                    elem.on(event, fn);
                });
            },

            off: function(event) {
                return this.each(function (elem) {
                    elem.off(event);
                });
            },

            onReady: function() {
                return this.each(function (elem, i) {
                    elem.onReady(arguments[i]);
                });
            },

            //
            // CSS Classes
            // --------------------

            hasClass: function (className) {
                return elements.map(function (elem) {
                    return elem.hasClass(className);
                });
            },

            addClass: function (className) {
                return this.each(function (elem) {
                    elem.addClass(className);
                });
            },

            removeClass: function (className) {
                return this.each(function (elem) {
                    elem.removeClass(className);
                });
            }

        }; // return object
    }; // constructor
}); // define Elements


text:
require 'spec_helper'
require 'rack/test'

module Bosh::Director
  module Api
    describe Extensions::Scoping do
      include Rack::Test::Methods

      let(:config) do
        config = Config.load_hash(SpecHelper.spec_get_director_config)
        identity_provider = Support::TestIdentityProvider.new(config.get_uuid_provider)
        allow(config).to receive(:identity_provider).and_return(identity_provider)
        config
      end
      let(:app) { Support::TestController.new(config, true) }

      describe 'scope' do
        context 'when authorization is provided'do
          context 'as admin'
            before { basic_authorize('admin', 'admin') }

            context 'when scope is defined on a route' do
              it 'passes it to identity provider' do
                expect(get('/read').status).to eq(200)
              end
            end

            context 'when scope is not defined on a route' do
              it 'uses default scope' do
                expect(get('/test_route').status).to eq(200)
              end
            end

            context 'when scope is set for request params' do
              it 'uses defined scope on specified param' do
                expect(get('/params?name=test').status).to eq(200)
              end

              it 'uses default scope on non-specified param' do
                expect(get('/params?name=other').status).to eq(200)
              end
            end
        end

        context 'when user does not have access' do
          before { basic_authorize('reader', 'reader') }

          it 'returns a detailed error message' do
            get '/test_route'
            expect(last_response.status).to eq(401)
            expect(last_response.body).to include('Require one of the scopes:')
          end

          context 'when scope is set for request params' do
            it 'uses defined scope on specified param' do
              expect(get('/params?name=test').status).to eq(200)
            end

            it 'uses default scope on non-specified param' do
              expect(get('/params?name=other').status).to eq(401)
            end
          end

          context 'when identity provider is not UAA' do
            let(:identity_provider) { Api::LocalIdentityProvider.new({}) }

            it 'return generic error message' do
              get '/test_route'
              expect(last_response.status).to eq(401)
              expect(last_response.body).to include('Require one of the scopes:')
            end
          end
        end

        context 'when authorization is not provided' do
          context 'when controller does not require authorization' do
            class NonsecureController < Bosh::Director::Api::Controllers::BaseController
              def requires_authentication?
                false
              end

              get '/' do
                'Success'
              end
            end

            let(:app) { NonsecureController.new(config) }

            it 'succeeds' do
              get '/'
              expect(last_response.status).to eq(200)
              expect(last_response.body).to include('Success')
            end
          end

          context 'when controller requires authorization' do
            it 'returns non-authorized' do
              get '/read'
              expect(last_response.status).to eq(401)
              expect(last_response.body).to include("Not authorized: '/read'\n")
            end
          end
        end
      end
    end
  end
end


text:
//
//  CarouselSubview.h
//  YHImageCarousel
//
//  Created by zyh on 2016/12/8.
//  Copyright © 2016年 zyh. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface CarouselSubview : UIView

/**
 *  容器视图
 */
@property (nonatomic, strong) UIView *containerView;

@end

// cell基类
@interface CarouselCell : UIView

@property (nonatomic, assign) NSUInteger showTime;

@end

// image的cell派生类
@interface CarouselCellImageView : CarouselCell

@property (nonatomic, strong) UIImageView *imageView;

@end


text:
[![Build Status](https://travis-ci.org/BVLC/caffe.svg?branch=master)](https://travis-ci.org/BVLC/caffe)
[![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)

Caffe is a deep learning framework made with expression, speed, and modularity in mind.
It is developed by Berkeley AI Research ([BAIR](http://bair.berkeley.edu))/The Berkeley Vision and Learning Center (BVLC) and community contributors.

Check out the [project site](http://caffe.berkeleyvision.org) for all the details like

- [DIY Deep Learning for Vision with Caffe](https://docs.google.com/presentation/d/1UeKXVgRvvxg9OUdh_UiC5G71UMscNPlvArsWER41PsU/edit#slide=id.p)
- [Tutorial Documentation](http://caffe.berkeleyvision.org/tutorial/)
- [BAIR reference models](http://caffe.berkeleyvision.org/model_zoo.html) and the [community model zoo](https://github.com/BVLC/caffe/wiki/Model-Zoo)
- [Installation instructions](http://caffe.berkeleyvision.org/installation.html)

and step-by-step examples.

## Custom distributions

 - [Intel Caffe](https://github.com/BVLC/caffe/tree/intel) (Optimized for CPU and support for multi-node), in particular Xeon processors (HSW, BDW, SKX, Xeon Phi).
- [OpenCL Caffe](https://github.com/BVLC/caffe/tree/opencl) e.g. for AMD or Intel devices.
- [Windows Caffe](https://github.com/BVLC/caffe/tree/windows)

## Community

[![Join the chat at https://gitter.im/BVLC/caffe](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/BVLC/caffe?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Please join the [caffe-users group](https://groups.google.com/forum/#!forum/caffe-users) or [gitter chat](https://gitter.im/BVLC/caffe) to ask questions and talk about methods and models.
Framework development discussions and thorough bug reports are collected on [Issues](https://github.com/BVLC/caffe/issues).

Happy brewing!

## License and Citation

Caffe is released under the [BSD 2-Clause license](https://github.com/BVLC/caffe/blob/master/LICENSE).
The BAIR/BVLC reference models are released for unrestricted use.

Please cite Caffe in your publications if it helps your research:

    @article{jia2014caffe,
      Author = {Jia, Yangqing and Shelhamer, Evan and Donahue, Jeff and Karayev, Sergey and Long, Jonathan and Girshick, Ross and Guadarrama, Sergio and Darrell, Trevor},
      Journal = {arXiv preprint arXiv:1408.5093},
      Title = {Caffe: Convolutional Architecture for Fast Feature Embedding},
      Year = {2014}
    }


text:
namespace tmx {
	class TerrainTypes {
	public:
		Terrain* terrains;
	};
}


text:
package org.efaps.esjp.twoplan;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.PropertyException;
import javax.xml.bind.Unmarshaller;

import org.efaps.admin.datamodel.Status;
import org.efaps.admin.event.Parameter;
import org.efaps.admin.event.Return;
import org.efaps.admin.event.Return.ReturnValues;
import org.efaps.admin.program.esjp.EFapsRevision;
import org.efaps.admin.program.esjp.EFapsUUID;
import org.efaps.db.Context;
import org.efaps.db.Context.FileParameter;
import org.efaps.db.Insert;
import org.efaps.db.Instance;
import org.efaps.db.InstanceQuery;
import org.efaps.db.MultiPrintQuery;
import org.efaps.db.PrintQuery;
import org.efaps.db.QueryBuilder;
import org.efaps.db.Update;
import org.efaps.esjp.ci.CIFormTwoPlan;
import org.efaps.esjp.ci.CIProjects;
import org.efaps.esjp.ci.CITwoPlan;
import org.efaps.esjp.common.file.FileUtil;
import org.efaps.esjp.twoplan.jaxb.AbstractObject;
import org.efaps.esjp.twoplan.jaxb.Calendar;
import org.efaps.esjp.twoplan.jaxb.Entries;
import org.efaps.esjp.twoplan.jaxb.Maps;
import org.efaps.esjp.twoplan.jaxb.Project;
import org.efaps.esjp.twoplan.jaxb.WorkPackage;
import org.efaps.util.EFapsException;
import org.joda.time.DateTime;

/**
 * TODO comment!
 *
 * @author The eFaps Team
 * @version $Id$
 */
@EFapsUUID("873327ed-7c6a-498b-9251-ad04de4c0fca")
@EFapsRevision("$Rev$")
public abstract class File_Base
{

    /**
     * @param _parameter     Parameter as passed by the eFaps API
     * @return new Return
     * @throws EFapsException on error
     */
    public Return checkinPostTrigger(final Parameter _parameter)
        throws EFapsException
    {
        try {
            final Map<String, FileParameter> filePara = Context.getThreadContext().getFileParameters();
            final FileParameter file = filePara.get(CIFormTwoPlan.TwoPlan_FileForm.upload.name);
            final InputStream input = file.getInputStream();

            final JAXBContext jc = JAXBContext.newInstance(Project.class, Maps.class, Entries.class, WorkPackage.class,
                            Calendar.class);
            final Unmarshaller unmarshaller = jc.createUnmarshaller();
            final Object object = unmarshaller.unmarshal(input);

            if (object instanceof Project) {
                final Instance fileInst = _parameter.getInstance();

                final PrintQuery print = new PrintQuery(fileInst);
                print.addAttribute(CITwoPlan.File.ProjectLink);
                print.execute();
                final Long projectId = print.<Long>getAttribute(CITwoPlan.File.ProjectLink);

                final Project project = (Project) object;
                // update/insert the workpackages as tasks
                for (final WorkPackage wp : project.getWorkPackages()) {
                    updateTask(_parameter, projectId, wp, null);
                }

                //set the status for the existing files
                final QueryBuilder queryBldr = new QueryBuilder(CITwoPlan.File);
                queryBldr.addWhereAttrEqValue(CITwoPlan.File.ProjectLink, projectId);
                queryBldr.addWhereAttrEqValue(CITwoPlan.File.Status,
                                Status.find(CITwoPlan.FileStatus.uuid, "Current").getId());
                queryBldr.addWhereAttrNotEqValue(CITwoPlan.File.ID, fileInst.getId());
                final InstanceQuery query = queryBldr.getQuery();
                query.execute();
                while (query.next()) {
                    final Update update = new Update(query.getCurrentValue());
                    update.add(CITwoPlan.File.Status, Status.find(CITwoPlan.FileStatus.uuid, "Version").getId());
                    update.execute();
                }
            }
        } catch (final JAXBException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (final IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return new Return();
    }

    /**
     * Recursive method to update/insert the task defined by the given
     * workpackages.
     *
     * @param _parameter        Parameter as passed by the eFaps APi
     * @param _projectId        id of tyhe project the tasks belong to
     * @param _wp               workpackage to be used for a task
     * @param _parentTaskId     id of the parent task
     * @throws EFapsException on error
     */
    protected void updateTask(final Parameter _parameter,
                              final Long _projectId,
                              final WorkPackage _wp,
                              final Long _parentTaskId)
        throws EFapsException
    {
        final QueryBuilder queryBldr = new QueryBuilder(CIProjects.TaskAbstract);
        queryBldr.addWhereAttrEqValue(CITwoPlan.TaskAbstract.UUID, _wp.getUuid());
        final InstanceQuery query = queryBldr.getQuery();
        query.execute();
        Update update;
        if (query.next()) {
            update = new Update(query.getCurrentValue());
        } else {
            update = new Insert(CIProjects.TaskScheduled);
        }
        update.add(CIProjects.TaskAbstract.DateFrom, _wp.getStartDate());
        update.add(CIProjects.TaskAbstract.DateUntil, _wp.getFinishDate());
        update.add(CIProjects.TaskAbstract.Name, _wp.getName());
        update.add(CIProjects.TaskAbstract.Description, _wp.getDescription());
        update.add(CIProjects.TaskAbstract.ProjectAbstractLink, _projectId);
        update.add(CIProjects.TaskAbstract.StatusAbstract,
                        Status.find(CIProjects.TaskScheduledStatus.uuid, "Open").getId());
        update.add(CIProjects.TaskAbstract.ParentTaskAbstractLink, _parentTaskId);
        update.add(CITwoPlan.TaskAbstract.UUID, _wp.getUuid());
        update.execute();

        for (final WorkPackage wp : _wp.getChildren()) {
            updateTask(_parameter, _projectId, wp, update.getInstance().getId());
        }
    }

    public Return getFile42plan(final Parameter _parameter)
        throws EFapsException
    {
        final Return ret = new Return();
        File file = null;
        try {
            final FileUtil fileUtil = new FileUtil();
            file = fileUtil.getFile("2plan.prj");
            final FileOutputStream out = new FileOutputStream(file);

            final Instance projectInst = _parameter.getCallInstance();
            final PrintQuery print = new PrintQuery(projectInst);
            print.addAttribute(CIProjects.ProjectAbstract.Name, CIProjects.ProjectAbstract.Date,
                            CIProjects.ProjectAbstract.DueDate);
            print.execute();

            final Project project = new Project();
            project.setContext("manual");
            project.setUuid(UUID.randomUUID().toString());
            project.setName(print.<String>getAttribute(CIProjects.ProjectAbstract.Name));
            project.setStartDate(print.<DateTime>getAttribute(CIProjects.ProjectAbstract.Date));
            project.setFinishDate(print.<DateTime>getAttribute(CIProjects.ProjectAbstract.DueDate));

            final Calendar cal = new Calendar();
            cal.setContext("manual");
            cal.setUuid(UUID.randomUUID().toString());
            project.setCalendar(cal);

            final Maps map1 = new Maps();
            map1.setType("net.intime.crud.xml.map.path");

            final Entries entry = new Entries();
            entry.setKey("path");
            entry.setValue(print.<String>getAttribute(CIProjects.ProjectAbstract.Name));
            map1.getEntries().add(entry);
            project.getMaps().add(map1);

            final Maps map2 = new Maps();
            map2.setType("manual");

            final Entries entry2 = new Entries();
            entry2.setKey("net.intime.product.mapentry.standardWorkPackageType");
            entry2.setValue("2");
            map2.getEntries().add(entry2);
            project.getMaps().add(map2);

            project.getWorkPackages().addAll(getWorkPackages(_parameter, projectInst, null));

            final JAXBContext jc = JAXBContext.newInstance(AbstractObject.class, Calendar.class, Entries.class,
                            Maps.class, Project.class, WorkPackage.class, DateTime.class);
            final Marshaller marshaller = jc.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            marshaller.marshal(project, out);
            out.close();
        } catch (final FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (final PropertyException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (final JAXBException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (final IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        ret.put(ReturnValues.VALUES, file);
        return ret;
    }

    protected List<WorkPackage> getWorkPackages(final Parameter _parameter,
                                                final Instance _projectInst,
                                                final Long _parentId)
        throws EFapsException
    {
        final List<WorkPackage> ret = new ArrayList<WorkPackage>();
        final QueryBuilder queryBldr = new QueryBuilder(CITwoPlan.TaskAbstract);
        if (_parentId == null) {
            queryBldr.addWhereAttrIsNull(CITwoPlan.TaskAbstract.ParentTaskAbstractLink);
        } else {
            queryBldr.addWhereAttrEqValue(CITwoPlan.TaskAbstract.ParentTaskAbstractLink, _parentId);
        }
        queryBldr.addWhereAttrEqValue(CITwoPlan.TaskAbstract.ProjectAbstractLink, _projectInst.getId());
        final MultiPrintQuery multi = queryBldr.getPrint();
        multi.addAttribute(CITwoPlan.TaskAbstract.Name, CITwoPlan.TaskAbstract.Description,
                        CITwoPlan.TaskAbstract.DateFrom, CITwoPlan.TaskAbstract.DateUntil,
                        CITwoPlan.TaskAbstract.UUID);
        multi.execute();
        while (multi.next()) {
            final WorkPackage workPackage = new WorkPackage();
            workPackage.setContext("manual");
            workPackage.setType("manual");
            workPackage.setName(multi.<String>getAttribute(CITwoPlan.TaskAbstract.Name));
            workPackage.setDescription(multi.<String>getAttribute(CITwoPlan.TaskAbstract.Description));
            workPackage.setStartDate(multi.<DateTime>getAttribute(CITwoPlan.TaskAbstract.DateFrom));
            workPackage.setFinishDate(multi.<DateTime>getAttribute(CITwoPlan.TaskAbstract.DateUntil));

            // get the uuid of the task, in case that it does not have one,
            // create a new one
            String uuid = multi.<String>getAttribute(CITwoPlan.TaskAbstract.UUID);
            if (uuid == null || uuid.isEmpty()) {
                uuid = UUID.randomUUID().toString();
                final Update update = new Update(multi.getCurrentInstance());
                update.add(CITwoPlan.TaskAbstract.UUID, uuid);
                update.execute();
            }
            workPackage.setUuid(uuid);
            ret.add(workPackage);
            workPackage.getChildren().addAll(
                            getWorkPackages(_parameter, _projectInst, multi.getCurrentInstance().getId()));
        }
        return ret;
    }
}


text:
package de.learnlib.algorithms.lstar;

import java.util.List;

import de.learnlib.algorithms.lstar.AbstractAutomatonLStar.StateInfo;
import de.learnlib.datastructure.observationtable.GenericObservationTable;

/**
 * Class that contains all data that represent the internal state of the {@link AbstractAutomatonLStar} learner and its
 * DFA and Mealy implementations.
 *
 * @param <I>
 *         The input alphabet type.
 * @param <D>
 *         The output domain type.
 * @param <AI>
 *         The hypothesis type.
 * @param <S>
 *         The hypothesis state type.
 *
 * @author bainczyk
 */
public class AutomatonLStarState<I, D, AI, S> {

    private final GenericObservationTable<I, D> observationTable;
    private final AI hypothesis;
    private final List<StateInfo<S, I>> stateInfos;

    AutomatonLStarState(final GenericObservationTable<I, D> observationTable,
                        final AI hypothesis,
                        final List<StateInfo<S, I>> stateInfos) {
        this.observationTable = observationTable;
        this.hypothesis = hypothesis;
        this.stateInfos = stateInfos;
    }

    GenericObservationTable<I, D> getObservationTable() {
        return observationTable;
    }

    AI getHypothesis() {
        return hypothesis;
    }

    List<AbstractAutomatonLStar.StateInfo<S, I>> getStateInfos() {
        return stateInfos;
    }
}


text:
package org.sakaiproject.gradebookng.tool.component;

/**
 * A list of styles that get turned into CSS classes
 */
public enum GbStyle {

	GB_ITEM("gb_item"),
	COMMENT("comment"),
	EXTERNAL("external"),
	NO_CHANGES("no_changes"),
	SELECTED("selected");

	private String css;

	GbStyle(final String css) {
		this.css = css;
	}

	public String getCss() {
		return this.css;
	}

}


text:
namespace supermarx
{

class json_serializer : public serializer
{
public:
	json_serializer();
	virtual ~json_serializer();

	virtual void write_array(const std::string& name, const size_t n);
	virtual void write_object(const std::string& name, const size_t n);
	virtual void write_null(const std::string& name);

	virtual void write(const std::string& key, const uint64_t x);
	virtual void write(const std::string& key, const std::string& x);
	virtual void write(const std::string& key, const raw& x);
	virtual void write(const std::string& key, const token& x);

	virtual void dump(std::function<void(const char*, size_t)> f);
	virtual void clear();

private:
	enum type_t
	{
		array,
		map,
		non_container
	};

	struct stack_e
	{
		type_t t;
		size_t n, i;

		stack_e(type_t t, size_t n);
	};

	void add_node(const type_t t, const std::string& name, const size_t n);

	rapidjson::MemoryBuffer sb;
	rapidjson::Writer<decltype(sb)> w;

	std::stack<stack_e> stack;
};

}


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


text:
import pytest

import txredisapi as redis

@pytest.inlineCallbacks
def test_incr():
    rc = yield redis.Connection(dbid=2)
    yield rc.flushdb()

    yield rc.set("foo", 4)

    v = yield rc.get("foo")

    assert v == 4

    v = yield rc.incr("foo")

    assert v == 5

    yield rc.disconnect()

@pytest.inlineCallbacks
def test_hash_set():

    rc = yield redis.Connection(dbid=2)
    yield rc.flushdb()

    yield rc.hset("foo", "bar", "baz")

    v = yield rc.hget("foo", "bar")

    assert v == 'baz'


text:
import traceback

__all__ = [
    'Concat',
    'Epsilon',
    'Node',
    'Null',
    'Output',
    'Repeat',
    'Terminal',
    'Union',
    'dot',
    'epsilon',
    'null',
]

regular_sentinel = object()

class Node(object):
    "Base Class representing one node in a grammar graph"

    # Class variable intended to overshadowed by instance variable
    regular_ = None

null = None

class Null(Node):
    "Node representing the empty language."

    def __new__(cls, *args, **kwargs):
        global null

        if null is None:
            null = Node.__new__(cls, *args, **kwargs)

        return null

    def derivative(self, terminal):
        return null

    def nullity(self):
        return null

    def regular(self):
        return True

    def terminate(self):
        return null

    def __str__(self):
        return 'Null'

    def __repr__(self):
        return 'Null()'

    def __eq__(self, other):
        return isinstance(other, Null)

    def __hash__(self):
        return hash('null')

null = Null()

epsilon = None

class Epsilon(Node):
    "Node represnting the language consisting of only the empty string."

    def __new__(cls, *args, **kwargs):
        global epsilon

        if epsilon is None:
            epsilon = Node.__new__(cls, *args, **kwargs)

        return epsilon

    def derivative(self, terminal):
        return null

    def nullity(self):
        return epsilon

    def regular(self):
        return True

    def terminate(self):
        return epsilon

    def __str__(self):
        return 'Epsilon'

    def __repr__(self):
        return 'Epsilon()'

    def __eq__(self, other):
        return isinstance(other, Epsilon)

    def __hash__(self):
        return hash('epsilon')

epsilon  = Epsilon()

class Terminal(Node):
    "Node representing the language of a single string containing the terminal's value."

    def __new__(cls, value, *args, **kwargs):
        out = Node.__new__(cls, *args, **kwargs)
        out.value = value

        return out

    def derivative(self, terminal):
        if self.value == terminal:
            return epsilon

        return null

    def nullity(self):
        return null

    def regular(self):
        return True

    def terminate(self):
        return null

    def __str__(self):
        return str(self.value)

    def __repr__(self):
        return "Terminal('{}')".format(self.value)

    def __eq__(self, other):
        if not isinstance(other, Terminal):
            return False

        return self.value == other.value

    def __hash__(self):
        return hash(self.value)

dot = None

class Dot(Node):
    "Node representing any Terminal"

    def __new__(cls, *args, **kwargs):
        global dot

        if dot is None:
            dot = Node.__new__(cls, *args, **kwargs)

        return dot

    def derivative(self, terminal):
        return epsilon

    def nullity(self):
        return null

    def regular(self):
        return True

    def terminate(self):
        return null

    def __str__(sef):
        return '.'

    def __repr__(self):
        return 'Dot()'

    def __eq__(self, other):
        return isinstance(other, Dot)

    def __hash__(self):
        return hash('dot')

dot = Dot()

class Concat(Node):
    r'''Node representing the concatenation of all strings in the left language
        with all strings right language.
    '''

    def __new__(cls, left, right, *args, **kwargs):
        if isinstance(left, Null):
            return null

        if isinstance(right, Null):
            return null

        if isinstance(left, Epsilon):
            return right

        if isinstance(right, Epsilon):
            return left

        out = Node.__new__(cls, *args, **kwargs)

        out.left = left
        out.right = right

        return out

    def derivative(self, terminal):
        return Union(
            Concat(
                self.left.derivative(terminal),
                self.right
            ),
            Concat(
                self.left.nullity(),
                self.right.derivative(terminal)
            )
        )

    def nullity(self):
        return Concat(
            self.left.nullity(),
            self.right.nullity(),
        )

    def regular(self):
        if self.regular_ is regular_sentinel:
            self.regular_ = False
        elif self.regular_ is None:
            self.regular_ = regular_sentinel

            self.regular_ = (self.left.regular()
                    and self.right.regular())

        return self.regular_

    def terminate(self):
        return Concat(
            self.left.terminate(),
            self.right.terminate()
        )

    def __str__(self):
        return '({}{})'.format(str(self.left), str(self.right))

    def __repr__(self):
        return 'Concat({}, {})'.format(repr(self.left), repr(self.right))

    def __eq__(self, other):
        if not isinstance(other, Concat):
            return False

        return (self.left == other.left
                and self.right == other.right)

    def __hash__(self):
        return hash(('concat', self.left, self.right))

class Union(Node):
    r'''Node represting the union of all strings in the left language with all
        strings in the left language.
    '''

    def __new__(cls, left, right, *args, **kwargs):
        if isinstance(left, Null):
            return right

        if isinstance(right, Null):
            return left

        if left == right:
            return left

        out =  Node.__new__(cls, *args, **kwargs)
        out.left = left
        out.right = right

        return out

    def derivative(self, terminal):
        return Union(
            self.left.derivative(terminal),
            self.right.derivative(terminal),
        )

    def nullity(self):
        return Union(
            self.left.nullity(),
            self.right.nullity()
        )

    def regular(self):
        if self.regular_ is regular_sentinel:
            self.regular_ = False
        elif self.regular_ is None:
            self.regular_ = regular_sentinel

            self.regular_ = (self.left.regular()
                    and self.right.regular())

        return self.regular_

    def terminate(self):
        return Union(
            self.left.terminate(),
            self.right.terminate(),
        )

    def __str__(self):
        return '({}|{})'.format(str(self.left), str(self.right))

    def __repr__(self):
        return 'Union({}, {})'.format(repr(self.left), repr(self.right))

    def __eq__(self, other):
        if not isinstance(other, Union):
            return False

        return (self.left == other.left
            and self.right == other.right)

    def __hash__(self):
        return hash(('union', self.left, self.right))

class Repeat(Node):
    r'''Node representing the repetition of a language zero or more times.
    '''
    def __new__(cls, language, *args, **kwargs):
        if isinstance(language, Null):
            return null

        if isinstance(language, Epsilon):
            return epsilon

        out =  Node.__new__(cls, *args, **kwargs)
        out.language = language

        return out

    def derivative(self, terminal):
        return Concat(
            self.language.derivative(terminal),
            Repeat(self.language)
        )

    def nullity(self):
        return epsilon

    def regular(self):
        if self.regular_ is regular_sentinel:
            self.regular_ = False
        elif self.regular_ is None:
            self.regular_ = regular_sentinel

            self.regular_ = self.language.regular()

        return self.regular_

    def terminate(self):
        return self.language.terminate()

    def __str__(self):
        return '({})*'.format(str(self.language))

    def __repr__(self):
        return 'Repeat({})'.format(repr(self.language))

    def __eq__(self, other):
        if not isinstance(other, Repeat):
            return False

        return self.language == other.language

    def __hash__(self):
        return hash(('repeat', self.language))

class Output(Node):
    'Represents output symbol from a parse'

    def __new__(cls, symbol, language, *args, **kwargs):
        if language is null:
            return null

        out = Node.__new__(cls, *args, **kwargs)

        out.symbol = symbol
        out.language = language

        return out

    def derivative(self, terminal):
        return Output(self.symbol, self.language.derivative(terminal))

    def nullity(self):
        return self.language.nullity()

    def regular(self):
        return self.language.regular()

    def terminate(self):
        return Output(self.symbol, self.language.terminate())

    def __str__(self):
        return 'Output({}, {})'.format(repr(self.symbol), self.language)

    def __repr__(self):
        return 'Output({}, {})'.format(repr(self.symbol), repr(self.language))

    def __eq__(self, other):
        if not isinstance(other, Output):
            return False

        return (self.symbol == other.symbol
                and self.language == other.language)

    def __hash__(self):
        return (('output', self.symbol, self.language))


text:
class AddProviderNameToBenchmarkDefinition < ActiveRecord::Migration[5.0]
  def change
    add_column :benchmark_definitions, :provider_name, :string
  end
end


text:
<?php
//
// Copyright (c) 2008-2016 Decibel Technology Limited.
//
// @requires	translation
namespace app\decibel\authorise;

use app\decibel\model\DModel_Definition;
use app\decibel\model\field\DArrayField;
use app\decibel\model\field\DTextField;
use app\decibel\model\index\DUniqueIndex;

/**
 * Decibel Group Definition.
 *
 * @author        Timothy de Paris
 */
class DGroup_Definition extends DModel_Definition
{
    /**
     * Creates a new DGroup definition.
     *
     * @param    string $qualifiedName
     *
     * @return    static
     */
    public function __construct($qualifiedName)
    {
        parent::__construct($qualifiedName);
        // Set field information.
        $name = new DTextField(DGroup::FIELD_NAME, 'Name');
        $name->setMaxLength(100);
        $name->setRequired(true);
        $this->addField($name);
        $description = new DTextField('description', 'Description');
        $description->setMaxLength(500);
        $this->addField($description);
        $privileges = new DArrayField('privileges', 'Privileges');
        $privileges->setDescription('
The privileges assigned to a group determine what a user assigned to that group can and can\'t access.
Disabled check boxes denote that the privilege is assigned to a parent of this group.
');
        $this->addField($privileges);
        $uniqueName = new DUniqueIndex('unique_name');
        $uniqueName->addField($name);
        $this->addIndex($uniqueName);
    }
}


text:
package org.apache.flink.table.planner.plan.stream.sql

import org.apache.flink.core.testutils.FlinkMatchers.containsCause
import org.apache.flink.table.api.ValidationException
import org.apache.flink.table.planner.utils.TableTestBase

import org.junit.Test

/** Tests for window table-valued function. */
class WindowTableFunctionTest extends TableTestBase {

  private val util = streamTestUtil()
  util.tableEnv.executeSql(s"""
                              |CREATE TABLE MyTable (
                              |  a INT,
                              |  b BIGINT,
                              |  c STRING,
                              |  d DECIMAL(10, 3),
                              |  rowtime TIMESTAMP(3),
                              |  proctime as PROCTIME(),
                              |  WATERMARK FOR rowtime AS rowtime - INTERVAL '1' SECOND
                              |) with (
                              |  'connector' = 'values'
                              |)
                              |""".stripMargin)

  @Test
  def testTumbleTVF(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(TUMBLE(TABLE MyTable, DESCRIPTOR(rowtime), INTERVAL '15' MINUTE))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testTumbleTVFProctime(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(TUMBLE(TABLE MyTable, DESCRIPTOR(proctime), INTERVAL '15' MINUTE))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testHopTVF(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(
        | HOP(TABLE MyTable, DESCRIPTOR(rowtime), INTERVAL '5' MINUTE, INTERVAL '10' MINUTE))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testHopTVFProctime(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(
        | HOP(TABLE MyTable, DESCRIPTOR(proctime), INTERVAL '5' MINUTE, INTERVAL '10' MINUTE))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testCumulateTVF(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(
        | CUMULATE(TABLE MyTable, DESCRIPTOR(rowtime), INTERVAL '10' MINUTE, INTERVAL '1' HOUR))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testCumulateTVFProctime(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(
        | CUMULATE(TABLE MyTable, DESCRIPTOR(proctime), INTERVAL '10' MINUTE, INTERVAL '1' HOUR))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testWindowOnNonTimeAttribute(): Unit = {
    util.tableEnv.executeSql("""
                               |CREATE VIEW v1 AS
                               |SELECT *, LOCALTIMESTAMP AS cur_time
                               |FROM MyTable
                               |""".stripMargin)
    val sql =
      """
        |SELECT *
        |FROM TABLE(
        | TUMBLE(TABLE v1, DESCRIPTOR(cur_time), INTERVAL '15' MINUTE))
        |""".stripMargin
    thrown.expectCause(
      containsCause(
        new ValidationException(
          "The window function requires the timecol is a time attribute type, but is TIMESTAMP(3).")
      ))
    util.verifyRelPlan(sql)
  }

  @Test
  def testConflictingFieldNames(): Unit = {
    util.tableEnv.executeSql("""
                               |CREATE VIEW v1 AS
                               |SELECT *, rowtime AS window_start
                               |FROM MyTable
                               |""".stripMargin)
    val sql =
      """
        |SELECT *
        |FROM TABLE(
        | TUMBLE(TABLE v1, DESCRIPTOR(rowtime), INTERVAL '15' MINUTE))
        |""".stripMargin

    thrown.expectMessage("Column 'window_start' is ambiguous")
    thrown.expect(classOf[ValidationException])
    util.verifyRelPlan(sql)
  }

  @Test
  def testTumbleTVFWithOffset(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(TUMBLE(
        |   TABLE MyTable, DESCRIPTOR(rowtime), INTERVAL '15' MINUTE, INTERVAL '5' MINUTE))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testTumbleTVFWithNegativeOffset(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(TUMBLE(
        |   TABLE MyTable, DESCRIPTOR(rowtime), INTERVAL '15' MINUTE, INTERVAL '-5' MINUTE))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testHopTVFWithOffset(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(
        |  HOP(
        |    TABLE MyTable,
        |    DESCRIPTOR(rowtime),
        |    INTERVAL '1' MINUTE,
        |    INTERVAL '15' MINUTE,
        |    INTERVAL '5' MINUTE))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testHopTVFWithNegativeOffset(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(
        |  HOP(
        |    TABLE MyTable,
        |    DESCRIPTOR(rowtime),
        |    INTERVAL '1' MINUTE,
        |    INTERVAL '15' MINUTE,
        |    INTERVAL '-5' MINUTE))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testCumulateTVFWithOffset(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(
        |  CUMULATE(
        |    TABLE MyTable,
        |    DESCRIPTOR(rowtime),
        |    INTERVAL '1' MINUTE,
        |    INTERVAL '15' MINUTE,
        |    INTERVAL '5' MINUTE))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }

  @Test
  def testCumulateTVFWithNegativeOffset(): Unit = {
    val sql =
      """
        |SELECT *
        |FROM TABLE(
        |  CUMULATE(
        |    TABLE MyTable,
        |    DESCRIPTOR(rowtime),
        |    INTERVAL '1' MINUTE,
        |    INTERVAL '15' MINUTE,
        |    INTERVAL '-5' MINUTE))
        |""".stripMargin
    util.verifyRelPlan(sql)
  }
}


text:
001    package com.thetransactioncompany.cors;
002
003
004    import javax.servlet.http.HttpServletRequest;
005
006
007    /**
008     * Enumeration of the CORS request types.
009     *
010     * @author Vladimir Dzhuvinov
011     * @version 1.3.2 (2011-12-02)
012     */
013    public enum CORSRequestType {
014
015
016            /**
017             * Simple / actual CORS request.
018             */
019            ACTUAL,
020
021
022            /**
023             * Preflight CORS request.
024             */
025            PREFLIGHT,
026
027
028            /**
029             * Other (non-CORS) request.
030             */
031            OTHER;
032
033
034            /**
035             * Detects the CORS type of the specified HTTP request.
036             *
037             * @param request The HTTP request to check. Must not be {@code null}.
038             *
039             * @return The CORS request type.
040             */
041            public static CORSRequestType detect(final HttpServletRequest request) {
042
043                    if (request == null)
044                            throw new NullPointerException("The HTTP request must not be null");
045
046                    // All CORS request have an Origin header
047                    if (request.getHeader("Origin") == null)
048                            return OTHER;
049
050                    // We have a CORS request - determine type
051                    if (request.getHeader("Access-Control-Request-Method") != null &&
052                        request.getMethod()                                != null &&
053                        request.getMethod().equals("OPTIONS")                         )
054
055                            return PREFLIGHT;
056
057                    else
058                            return ACTUAL;
059            }
060    }


text:
class Package {
public:
    Package();

    Package(double, double, Address, Address);

    virtual double calculateCost();

    Address getSender();

    Address getReceiver();

    double getWeight();

protected:
    Address receiver;
    Address sender;

private:
    double weight;
    double costPerOunce;
};

#endif //ASSIGNMENT11_PACKAGE_H


text:
<?php
namespace oasis\names\specification\ubl\schema\xsd\CommonAggregateComponents_2;

/**
 * @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2
 * @xmlType CertificateOfOriginApplicationType
 * @xmlName CertificateOfOriginApplication
 * @var oasis\names\specification\ubl\schema\xsd\CommonAggregateComponents_2\CertificateOfOriginApplication
 */
class CertificateOfOriginApplication extends CertificateOfOriginApplicationType
{
} // end class CertificateOfOriginApplication