text:
/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.xiaomi.infra.galaxy.sds.thrift;

import libthrift091.scheme.IScheme;
import libthrift091.scheme.SchemeFactory;
import libthrift091.scheme.StandardScheme;

import libthrift091.scheme.TupleScheme;
import libthrift091.protocol.TTupleProtocol;
import libthrift091.protocol.TProtocolException;
import libthrift091.EncodingUtils;
import libthrift091.TException;
import libthrift091.async.AsyncMethodCallback;
import libthrift091.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
/**
 * 兼容旧sdk
 * Authorization头包含的内容
 */
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2019-4-24")
public class HttpAuthorizationHeader implements libthrift091.TBase<HttpAuthorizationHeader, HttpAuthorizationHeader._Fields>, java.io.Serializable, Cloneable, Comparable<HttpAuthorizationHeader> {
  private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("HttpAuthorizationHeader");

  private static final libthrift091.protocol.TField VERSION_FIELD_DESC = new libthrift091.protocol.TField("version", libthrift091.protocol.TType.STRING, (short)1);
  private static final libthrift091.protocol.TField USER_TYPE_FIELD_DESC = new libthrift091.protocol.TField("userType", libthrift091.protocol.TType.I32, (short)2);
  private static final libthrift091.protocol.TField SECRET_KEY_ID_FIELD_DESC = new libthrift091.protocol.TField("secretKeyId", libthrift091.protocol.TType.STRING, (short)3);
  private static final libthrift091.protocol.TField SECRET_KEY_FIELD_DESC = new libthrift091.protocol.TField("secretKey", libthrift091.protocol.TType.STRING, (short)4);
  private static final libthrift091.protocol.TField SIGNATURE_FIELD_DESC = new libthrift091.protocol.TField("signature", libthrift091.protocol.TType.STRING, (short)5);
  private static final libthrift091.protocol.TField ALGORITHM_FIELD_DESC = new libthrift091.protocol.TField("algorithm", libthrift091.protocol.TType.I32, (short)6);
  private static final libthrift091.protocol.TField SIGNED_HEADERS_FIELD_DESC = new libthrift091.protocol.TField("signedHeaders", libthrift091.protocol.TType.LIST, (short)7);
  private static final libthrift091.protocol.TField SUPPORT_ACCOUNT_KEY_FIELD_DESC = new libthrift091.protocol.TField("supportAccountKey", libthrift091.protocol.TType.BOOL, (short)8);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new HttpAuthorizationHeaderStandardSchemeFactory());
    schemes.put(TupleScheme.class, new HttpAuthorizationHeaderTupleSchemeFactory());
  }

  public String version; // optional
  /**
   *
   * @see UserType
   */
  public UserType userType; // optional
  public String secretKeyId; // optional
  /**
   * 直接使用sercetKey,此项被设置时,signature将被忽略,
   * 非安全传输应使用签名
   */
  public String secretKey; // optional
  /**
   * 如secretKey未设置,则认为使用签名,此时必须设置,
   * 被签名的正文格式:header1[\nheader2[\nheader3[...]]],
   * 如使用默认SUGGESTED_SIGNATURE_HEADERS时为:$host\n$timestamp\n$md5
   */
  public String signature; // optional
  /**
   * 签名HMAC算法,客户端可定制,
   * 使用签名时必须设置
   *
   * @see MacAlgorithm
   */
  public MacAlgorithm algorithm; // optional
  /**
   * 包含所有签名涉及到的部分,建议使用SUGGESTED_SIGNATURE_HEADERS,
   * 服务端未强制必须使用所列headers,定制的client自己负责签名的安全强度,
   * 使用签名时必须设置
   */
  public List<String> signedHeaders; // optional
  public boolean supportAccountKey; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements libthrift091.TFieldIdEnum {
    VERSION((short)1, "version"),
    /**
     *
     * @see UserType
     */
    USER_TYPE((short)2, "userType"),
    SECRET_KEY_ID((short)3, "secretKeyId"),
    /**
     * 直接使用sercetKey,此项被设置时,signature将被忽略,
     * 非安全传输应使用签名
     */
    SECRET_KEY((short)4, "secretKey"),
    /**
     * 如secretKey未设置,则认为使用签名,此时必须设置,
     * 被签名的正文格式:header1[\nheader2[\nheader3[...]]],
     * 如使用默认SUGGESTED_SIGNATURE_HEADERS时为:$host\n$timestamp\n$md5
     */
    SIGNATURE((short)5, "signature"),
    /**
     * 签名HMAC算法,客户端可定制,
     * 使用签名时必须设置
     *
     * @see MacAlgorithm
     */
    ALGORITHM((short)6, "algorithm"),
    /**
     * 包含所有签名涉及到的部分,建议使用SUGGESTED_SIGNATURE_HEADERS,
     * 服务端未强制必须使用所列headers,定制的client自己负责签名的安全强度,
     * 使用签名时必须设置
     */
    SIGNED_HEADERS((short)7, "signedHeaders"),
    SUPPORT_ACCOUNT_KEY((short)8, "supportAccountKey");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // VERSION
          return VERSION;
        case 2: // USER_TYPE
          return USER_TYPE;
        case 3: // SECRET_KEY_ID
          return SECRET_KEY_ID;
        case 4: // SECRET_KEY
          return SECRET_KEY;
        case 5: // SIGNATURE
          return SIGNATURE;
        case 6: // ALGORITHM
          return ALGORITHM;
        case 7: // SIGNED_HEADERS
          return SIGNED_HEADERS;
        case 8: // SUPPORT_ACCOUNT_KEY
          return SUPPORT_ACCOUNT_KEY;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __SUPPORTACCOUNTKEY_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.VERSION,_Fields.USER_TYPE,_Fields.SECRET_KEY_ID,_Fields.SECRET_KEY,_Fields.SIGNATURE,_Fields.ALGORITHM,_Fields.SIGNED_HEADERS,_Fields.SUPPORT_ACCOUNT_KEY};
  public static final Map<_Fields, libthrift091.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.VERSION, new libthrift091.meta_data.FieldMetaData("version", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
    tmpMap.put(_Fields.USER_TYPE, new libthrift091.meta_data.FieldMetaData("userType", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.EnumMetaData(libthrift091.protocol.TType.ENUM, UserType.class)));
    tmpMap.put(_Fields.SECRET_KEY_ID, new libthrift091.meta_data.FieldMetaData("secretKeyId", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
    tmpMap.put(_Fields.SECRET_KEY, new libthrift091.meta_data.FieldMetaData("secretKey", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
    tmpMap.put(_Fields.SIGNATURE, new libthrift091.meta_data.FieldMetaData("signature", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
    tmpMap.put(_Fields.ALGORITHM, new libthrift091.meta_data.FieldMetaData("algorithm", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.EnumMetaData(libthrift091.protocol.TType.ENUM, MacAlgorithm.class)));
    tmpMap.put(_Fields.SIGNED_HEADERS, new libthrift091.meta_data.FieldMetaData("signedHeaders", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.ListMetaData(libthrift091.protocol.TType.LIST,
            new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))));
    tmpMap.put(_Fields.SUPPORT_ACCOUNT_KEY, new libthrift091.meta_data.FieldMetaData("supportAccountKey", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.BOOL)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(HttpAuthorizationHeader.class, metaDataMap);
  }

  public HttpAuthorizationHeader() {
    this.version = "SDS-V1";

    this.userType = com.xiaomi.infra.galaxy.sds.thrift.UserType.APP_ANONYMOUS;

    this.signedHeaders = new ArrayList<String>();

    this.supportAccountKey = false;

  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public HttpAuthorizationHeader(HttpAuthorizationHeader other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetVersion()) {
      this.version = other.version;
    }
    if (other.isSetUserType()) {
      this.userType = other.userType;
    }
    if (other.isSetSecretKeyId()) {
      this.secretKeyId = other.secretKeyId;
    }
    if (other.isSetSecretKey()) {
      this.secretKey = other.secretKey;
    }
    if (other.isSetSignature()) {
      this.signature = other.signature;
    }
    if (other.isSetAlgorithm()) {
      this.algorithm = other.algorithm;
    }
    if (other.isSetSignedHeaders()) {
      List<String> __this__signedHeaders = new ArrayList<String>(other.signedHeaders);
      this.signedHeaders = __this__signedHeaders;
    }
    this.supportAccountKey = other.supportAccountKey;
  }

  public HttpAuthorizationHeader deepCopy() {
    return new HttpAuthorizationHeader(this);
  }

  @Override
  public void clear() {
    this.version = "SDS-V1";

    this.userType = com.xiaomi.infra.galaxy.sds.thrift.UserType.APP_ANONYMOUS;

    this.secretKeyId = null;
    this.secretKey = null;
    this.signature = null;
    this.algorithm = null;
    this.signedHeaders = new ArrayList<String>();

    this.supportAccountKey = false;

  }

  public String getVersion() {
    return this.version;
  }

  public HttpAuthorizationHeader setVersion(String version) {
    this.version = version;
    return this;
  }

  public void unsetVersion() {
    this.version = null;
  }

  /** Returns true if field version is set (has been assigned a value) and false otherwise */
  public boolean isSetVersion() {
    return this.version != null;
  }

  public void setVersionIsSet(boolean value) {
    if (!value) {
      this.version = null;
    }
  }

  /**
   *
   * @see UserType
   */
  public UserType getUserType() {
    return this.userType;
  }

  /**
   *
   * @see UserType
   */
  public HttpAuthorizationHeader setUserType(UserType userType) {
    this.userType = userType;
    return this;
  }

  public void unsetUserType() {
    this.userType = null;
  }

  /** Returns true if field userType is set (has been assigned a value) and false otherwise */
  public boolean isSetUserType() {
    return this.userType != null;
  }

  public void setUserTypeIsSet(boolean value) {
    if (!value) {
      this.userType = null;
    }
  }

  public String getSecretKeyId() {
    return this.secretKeyId;
  }

  public HttpAuthorizationHeader setSecretKeyId(String secretKeyId) {
    this.secretKeyId = secretKeyId;
    return this;
  }

  public void unsetSecretKeyId() {
    this.secretKeyId = null;
  }

  /** Returns true if field secretKeyId is set (has been assigned a value) and false otherwise */
  public boolean isSetSecretKeyId() {
    return this.secretKeyId != null;
  }

  public void setSecretKeyIdIsSet(boolean value) {
    if (!value) {
      this.secretKeyId = null;
    }
  }

  /**
   * 直接使用sercetKey,此项被设置时,signature将被忽略,
   * 非安全传输应使用签名
   */
  public String getSecretKey() {
    return this.secretKey;
  }

  /**
   * 直接使用sercetKey,此项被设置时,signature将被忽略,
   * 非安全传输应使用签名
   */
  public HttpAuthorizationHeader setSecretKey(String secretKey) {
    this.secretKey = secretKey;
    return this;
  }

  public void unsetSecretKey() {
    this.secretKey = null;
  }

  /** Returns true if field secretKey is set (has been assigned a value) and false otherwise */
  public boolean isSetSecretKey() {
    return this.secretKey != null;
  }

  public void setSecretKeyIsSet(boolean value) {
    if (!value) {
      this.secretKey = null;
    }
  }

  /**
   * 如secretKey未设置,则认为使用签名,此时必须设置,
   * 被签名的正文格式:header1[\nheader2[\nheader3[...]]],
   * 如使用默认SUGGESTED_SIGNATURE_HEADERS时为:$host\n$timestamp\n$md5
   */
  public String getSignature() {
    return this.signature;
  }

  /**
   * 如secretKey未设置,则认为使用签名,此时必须设置,
   * 被签名的正文格式:header1[\nheader2[\nheader3[...]]],
   * 如使用默认SUGGESTED_SIGNATURE_HEADERS时为:$host\n$timestamp\n$md5
   */
  public HttpAuthorizationHeader setSignature(String signature) {
    this.signature = signature;
    return this;
  }

  public void unsetSignature() {
    this.signature = null;
  }

  /** Returns true if field signature is set (has been assigned a value) and false otherwise */
  public boolean isSetSignature() {
    return this.signature != null;
  }

  public void setSignatureIsSet(boolean value) {
    if (!value) {
      this.signature = null;
    }
  }

  /**
   * 签名HMAC算法,客户端可定制,
   * 使用签名时必须设置
   *
   * @see MacAlgorithm
   */
  public MacAlgorithm getAlgorithm() {
    return this.algorithm;
  }

  /**
   * 签名HMAC算法,客户端可定制,
   * 使用签名时必须设置
   *
   * @see MacAlgorithm
   */
  public HttpAuthorizationHeader setAlgorithm(MacAlgorithm algorithm) {
    this.algorithm = algorithm;
    return this;
  }

  public void unsetAlgorithm() {
    this.algorithm = null;
  }

  /** Returns true if field algorithm is set (has been assigned a value) and false otherwise */
  public boolean isSetAlgorithm() {
    return this.algorithm != null;
  }

  public void setAlgorithmIsSet(boolean value) {
    if (!value) {
      this.algorithm = null;
    }
  }

  public int getSignedHeadersSize() {
    return (this.signedHeaders == null) ? 0 : this.signedHeaders.size();
  }

  public java.util.Iterator<String> getSignedHeadersIterator() {
    return (this.signedHeaders == null) ? null : this.signedHeaders.iterator();
  }

  public void addToSignedHeaders(String elem) {
    if (this.signedHeaders == null) {
      this.signedHeaders = new ArrayList<String>();
    }
    this.signedHeaders.add(elem);
  }

  /**
   * 包含所有签名涉及到的部分,建议使用SUGGESTED_SIGNATURE_HEADERS,
   * 服务端未强制必须使用所列headers,定制的client自己负责签名的安全强度,
   * 使用签名时必须设置
   */
  public List<String> getSignedHeaders() {
    return this.signedHeaders;
  }

  /**
   * 包含所有签名涉及到的部分,建议使用SUGGESTED_SIGNATURE_HEADERS,
   * 服务端未强制必须使用所列headers,定制的client自己负责签名的安全强度,
   * 使用签名时必须设置
   */
  public HttpAuthorizationHeader setSignedHeaders(List<String> signedHeaders) {
    this.signedHeaders = signedHeaders;
    return this;
  }

  public void unsetSignedHeaders() {
    this.signedHeaders = null;
  }

  /** Returns true if field signedHeaders is set (has been assigned a value) and false otherwise */
  public boolean isSetSignedHeaders() {
    return this.signedHeaders != null;
  }

  public void setSignedHeadersIsSet(boolean value) {
    if (!value) {
      this.signedHeaders = null;
    }
  }

  public boolean isSupportAccountKey() {
    return this.supportAccountKey;
  }

  public HttpAuthorizationHeader setSupportAccountKey(boolean supportAccountKey) {
    this.supportAccountKey = supportAccountKey;
    setSupportAccountKeyIsSet(true);
    return this;
  }

  public void unsetSupportAccountKey() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUPPORTACCOUNTKEY_ISSET_ID);
  }

  /** Returns true if field supportAccountKey is set (has been assigned a value) and false otherwise */
  public boolean isSetSupportAccountKey() {
    return EncodingUtils.testBit(__isset_bitfield, __SUPPORTACCOUNTKEY_ISSET_ID);
  }

  public void setSupportAccountKeyIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUPPORTACCOUNTKEY_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case VERSION:
      if (value == null) {
        unsetVersion();
      } else {
        setVersion((String)value);
      }
      break;

    case USER_TYPE:
      if (value == null) {
        unsetUserType();
      } else {
        setUserType((UserType)value);
      }
      break;

    case SECRET_KEY_ID:
      if (value == null) {
        unsetSecretKeyId();
      } else {
        setSecretKeyId((String)value);
      }
      break;

    case SECRET_KEY:
      if (value == null) {
        unsetSecretKey();
      } else {
        setSecretKey((String)value);
      }
      break;

    case SIGNATURE:
      if (value == null) {
        unsetSignature();
      } else {
        setSignature((String)value);
      }
      break;

    case ALGORITHM:
      if (value == null) {
        unsetAlgorithm();
      } else {
        setAlgorithm((MacAlgorithm)value);
      }
      break;

    case SIGNED_HEADERS:
      if (value == null) {
        unsetSignedHeaders();
      } else {
        setSignedHeaders((List<String>)value);
      }
      break;

    case SUPPORT_ACCOUNT_KEY:
      if (value == null) {
        unsetSupportAccountKey();
      } else {
        setSupportAccountKey((Boolean)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case VERSION:
      return getVersion();

    case USER_TYPE:
      return getUserType();

    case SECRET_KEY_ID:
      return getSecretKeyId();

    case SECRET_KEY:
      return getSecretKey();

    case SIGNATURE:
      return getSignature();

    case ALGORITHM:
      return getAlgorithm();

    case SIGNED_HEADERS:
      return getSignedHeaders();

    case SUPPORT_ACCOUNT_KEY:
      return Boolean.valueOf(isSupportAccountKey());

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case VERSION:
      return isSetVersion();
    case USER_TYPE:
      return isSetUserType();
    case SECRET_KEY_ID:
      return isSetSecretKeyId();
    case SECRET_KEY:
      return isSetSecretKey();
    case SIGNATURE:
      return isSetSignature();
    case ALGORITHM:
      return isSetAlgorithm();
    case SIGNED_HEADERS:
      return isSetSignedHeaders();
    case SUPPORT_ACCOUNT_KEY:
      return isSetSupportAccountKey();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof HttpAuthorizationHeader)
      return this.equals((HttpAuthorizationHeader)that);
    return false;
  }

  public boolean equals(HttpAuthorizationHeader that) {
    if (that == null)
      return false;

    boolean this_present_version = true && this.isSetVersion();
    boolean that_present_version = true && that.isSetVersion();
    if (this_present_version || that_present_version) {
      if (!(this_present_version && that_present_version))
        return false;
      if (!this.version.equals(that.version))
        return false;
    }

    boolean this_present_userType = true && this.isSetUserType();
    boolean that_present_userType = true && that.isSetUserType();
    if (this_present_userType || that_present_userType) {
      if (!(this_present_userType && that_present_userType))
        return false;
      if (!this.userType.equals(that.userType))
        return false;
    }

    boolean this_present_secretKeyId = true && this.isSetSecretKeyId();
    boolean that_present_secretKeyId = true && that.isSetSecretKeyId();
    if (this_present_secretKeyId || that_present_secretKeyId) {
      if (!(this_present_secretKeyId && that_present_secretKeyId))
        return false;
      if (!this.secretKeyId.equals(that.secretKeyId))
        return false;
    }

    boolean this_present_secretKey = true && this.isSetSecretKey();
    boolean that_present_secretKey = true && that.isSetSecretKey();
    if (this_present_secretKey || that_present_secretKey) {
      if (!(this_present_secretKey && that_present_secretKey))
        return false;
      if (!this.secretKey.equals(that.secretKey))
        return false;
    }

    boolean this_present_signature = true && this.isSetSignature();
    boolean that_present_signature = true && that.isSetSignature();
    if (this_present_signature || that_present_signature) {
      if (!(this_present_signature && that_present_signature))
        return false;
      if (!this.signature.equals(that.signature))
        return false;
    }

    boolean this_present_algorithm = true && this.isSetAlgorithm();
    boolean that_present_algorithm = true && that.isSetAlgorithm();
    if (this_present_algorithm || that_present_algorithm) {
      if (!(this_present_algorithm && that_present_algorithm))
        return false;
      if (!this.algorithm.equals(that.algorithm))
        return false;
    }

    boolean this_present_signedHeaders = true && this.isSetSignedHeaders();
    boolean that_present_signedHeaders = true && that.isSetSignedHeaders();
    if (this_present_signedHeaders || that_present_signedHeaders) {
      if (!(this_present_signedHeaders && that_present_signedHeaders))
        return false;
      if (!this.signedHeaders.equals(that.signedHeaders))
        return false;
    }

    boolean this_present_supportAccountKey = true && this.isSetSupportAccountKey();
    boolean that_present_supportAccountKey = true && that.isSetSupportAccountKey();
    if (this_present_supportAccountKey || that_present_supportAccountKey) {
      if (!(this_present_supportAccountKey && that_present_supportAccountKey))
        return false;
      if (this.supportAccountKey != that.supportAccountKey)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List<Object> list = new ArrayList<Object>();

    boolean present_version = true && (isSetVersion());
    list.add(present_version);
    if (present_version)
      list.add(version);

    boolean present_userType = true && (isSetUserType());
    list.add(present_userType);
    if (present_userType)
      list.add(userType.getValue());

    boolean present_secretKeyId = true && (isSetSecretKeyId());
    list.add(present_secretKeyId);
    if (present_secretKeyId)
      list.add(secretKeyId);

    boolean present_secretKey = true && (isSetSecretKey());
    list.add(present_secretKey);
    if (present_secretKey)
      list.add(secretKey);

    boolean present_signature = true && (isSetSignature());
    list.add(present_signature);
    if (present_signature)
      list.add(signature);

    boolean present_algorithm = true && (isSetAlgorithm());
    list.add(present_algorithm);
    if (present_algorithm)
      list.add(algorithm.getValue());

    boolean present_signedHeaders = true && (isSetSignedHeaders());
    list.add(present_signedHeaders);
    if (present_signedHeaders)
      list.add(signedHeaders);

    boolean present_supportAccountKey = true && (isSetSupportAccountKey());
    list.add(present_supportAccountKey);
    if (present_supportAccountKey)
      list.add(supportAccountKey);

    return list.hashCode();
  }

  @Override
  public int compareTo(HttpAuthorizationHeader other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetVersion()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.version, other.version);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUserType()).compareTo(other.isSetUserType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserType()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.userType, other.userType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSecretKeyId()).compareTo(other.isSetSecretKeyId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSecretKeyId()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.secretKeyId, other.secretKeyId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSecretKey()).compareTo(other.isSetSecretKey());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSecretKey()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.secretKey, other.secretKey);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSignature()).compareTo(other.isSetSignature());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSignature()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.signature, other.signature);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAlgorithm()).compareTo(other.isSetAlgorithm());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAlgorithm()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.algorithm, other.algorithm);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSignedHeaders()).compareTo(other.isSetSignedHeaders());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSignedHeaders()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.signedHeaders, other.signedHeaders);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSupportAccountKey()).compareTo(other.isSetSupportAccountKey());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSupportAccountKey()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.supportAccountKey, other.supportAccountKey);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("HttpAuthorizationHeader(");
    boolean first = true;

    if (isSetVersion()) {
      sb.append("version:");
      if (this.version == null) {
        sb.append("null");
      } else {
        sb.append(this.version);
      }
      first = false;
    }
    if (isSetUserType()) {
      if (!first) sb.append(", ");
      sb.append("userType:");
      if (this.userType == null) {
        sb.append("null");
      } else {
        sb.append(this.userType);
      }
      first = false;
    }
    if (isSetSecretKeyId()) {
      if (!first) sb.append(", ");
      sb.append("secretKeyId:");
      if (this.secretKeyId == null) {
        sb.append("null");
      } else {
        sb.append(this.secretKeyId);
      }
      first = false;
    }
    if (isSetSecretKey()) {
      if (!first) sb.append(", ");
      sb.append("secretKey:");
      if (this.secretKey == null) {
        sb.append("null");
      } else {
        sb.append(this.secretKey);
      }
      first = false;
    }
    if (isSetSignature()) {
      if (!first) sb.append(", ");
      sb.append("signature:");
      if (this.signature == null) {
        sb.append("null");
      } else {
        sb.append(this.signature);
      }
      first = false;
    }
    if (isSetAlgorithm()) {
      if (!first) sb.append(", ");
      sb.append("algorithm:");
      if (this.algorithm == null) {
        sb.append("null");
      } else {
        sb.append(this.algorithm);
      }
      first = false;
    }
    if (isSetSignedHeaders()) {
      if (!first) sb.append(", ");
      sb.append("signedHeaders:");
      if (this.signedHeaders == null) {
        sb.append("null");
      } else {
        sb.append(this.signedHeaders);
      }
      first = false;
    }
    if (isSetSupportAccountKey()) {
      if (!first) sb.append(", ");
      sb.append("supportAccountKey:");
      sb.append(this.supportAccountKey);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws libthrift091.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out)));
    } catch (libthrift091.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in)));
    } catch (libthrift091.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class HttpAuthorizationHeaderStandardSchemeFactory implements SchemeFactory {
    public HttpAuthorizationHeaderStandardScheme getScheme() {
      return new HttpAuthorizationHeaderStandardScheme();
    }
  }

  private static class HttpAuthorizationHeaderStandardScheme extends StandardScheme<HttpAuthorizationHeader> {

    public void read(libthrift091.protocol.TProtocol iprot, HttpAuthorizationHeader struct) throws libthrift091.TException {
      libthrift091.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == libthrift091.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // VERSION
            if (schemeField.type == libthrift091.protocol.TType.STRING) {
              struct.version = iprot.readString();
              struct.setVersionIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // USER_TYPE
            if (schemeField.type == libthrift091.protocol.TType.I32) {
              struct.userType = com.xiaomi.infra.galaxy.sds.thrift.UserType.findByValue(iprot.readI32());
              struct.setUserTypeIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SECRET_KEY_ID
            if (schemeField.type == libthrift091.protocol.TType.STRING) {
              struct.secretKeyId = iprot.readString();
              struct.setSecretKeyIdIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // SECRET_KEY
            if (schemeField.type == libthrift091.protocol.TType.STRING) {
              struct.secretKey = iprot.readString();
              struct.setSecretKeyIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // SIGNATURE
            if (schemeField.type == libthrift091.protocol.TType.STRING) {
              struct.signature = iprot.readString();
              struct.setSignatureIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // ALGORITHM
            if (schemeField.type == libthrift091.protocol.TType.I32) {
              struct.algorithm = com.xiaomi.infra.galaxy.sds.thrift.MacAlgorithm.findByValue(iprot.readI32());
              struct.setAlgorithmIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // SIGNED_HEADERS
            if (schemeField.type == libthrift091.protocol.TType.LIST) {
              {
                libthrift091.protocol.TList _list0 = iprot.readListBegin();
                struct.signedHeaders = new ArrayList<String>(_list0.size);
                String _elem1;
                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
                {
                  _elem1 = iprot.readString();
                  struct.signedHeaders.add(_elem1);
                }
                iprot.readListEnd();
              }
              struct.setSignedHeadersIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // SUPPORT_ACCOUNT_KEY
            if (schemeField.type == libthrift091.protocol.TType.BOOL) {
              struct.supportAccountKey = iprot.readBool();
              struct.setSupportAccountKeyIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(libthrift091.protocol.TProtocol oprot, HttpAuthorizationHeader struct) throws libthrift091.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.version != null) {
        if (struct.isSetVersion()) {
          oprot.writeFieldBegin(VERSION_FIELD_DESC);
          oprot.writeString(struct.version);
          oprot.writeFieldEnd();
        }
      }
      if (struct.userType != null) {
        if (struct.isSetUserType()) {
          oprot.writeFieldBegin(USER_TYPE_FIELD_DESC);
          oprot.writeI32(struct.userType.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.secretKeyId != null) {
        if (struct.isSetSecretKeyId()) {
          oprot.writeFieldBegin(SECRET_KEY_ID_FIELD_DESC);
          oprot.writeString(struct.secretKeyId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.secretKey != null) {
        if (struct.isSetSecretKey()) {
          oprot.writeFieldBegin(SECRET_KEY_FIELD_DESC);
          oprot.writeString(struct.secretKey);
          oprot.writeFieldEnd();
        }
      }
      if (struct.signature != null) {
        if (struct.isSetSignature()) {
          oprot.writeFieldBegin(SIGNATURE_FIELD_DESC);
          oprot.writeString(struct.signature);
          oprot.writeFieldEnd();
        }
      }
      if (struct.algorithm != null) {
        if (struct.isSetAlgorithm()) {
          oprot.writeFieldBegin(ALGORITHM_FIELD_DESC);
          oprot.writeI32(struct.algorithm.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.signedHeaders != null) {
        if (struct.isSetSignedHeaders()) {
          oprot.writeFieldBegin(SIGNED_HEADERS_FIELD_DESC);
          {
            oprot.writeListBegin(new libthrift091.protocol.TList(libthrift091.protocol.TType.STRING, struct.signedHeaders.size()));
            for (String _iter3 : struct.signedHeaders)
            {
              oprot.writeString(_iter3);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetSupportAccountKey()) {
        oprot.writeFieldBegin(SUPPORT_ACCOUNT_KEY_FIELD_DESC);
        oprot.writeBool(struct.supportAccountKey);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class HttpAuthorizationHeaderTupleSchemeFactory implements SchemeFactory {
    public HttpAuthorizationHeaderTupleScheme getScheme() {
      return new HttpAuthorizationHeaderTupleScheme();
    }
  }

  private static class HttpAuthorizationHeaderTupleScheme extends TupleScheme<HttpAuthorizationHeader> {

    @Override
    public void write(libthrift091.protocol.TProtocol prot, HttpAuthorizationHeader struct) throws libthrift091.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetVersion()) {
        optionals.set(0);
      }
      if (struct.isSetUserType()) {
        optionals.set(1);
      }
      if (struct.isSetSecretKeyId()) {
        optionals.set(2);
      }
      if (struct.isSetSecretKey()) {
        optionals.set(3);
      }
      if (struct.isSetSignature()) {
        optionals.set(4);
      }
      if (struct.isSetAlgorithm()) {
        optionals.set(5);
      }
      if (struct.isSetSignedHeaders()) {
        optionals.set(6);
      }
      if (struct.isSetSupportAccountKey()) {
        optionals.set(7);
      }
      oprot.writeBitSet(optionals, 8);
      if (struct.isSetVersion()) {
        oprot.writeString(struct.version);
      }
      if (struct.isSetUserType()) {
        oprot.writeI32(struct.userType.getValue());
      }
      if (struct.isSetSecretKeyId()) {
        oprot.writeString(struct.secretKeyId);
      }
      if (struct.isSetSecretKey()) {
        oprot.writeString(struct.secretKey);
      }
      if (struct.isSetSignature()) {
        oprot.writeString(struct.signature);
      }
      if (struct.isSetAlgorithm()) {
        oprot.writeI32(struct.algorithm.getValue());
      }
      if (struct.isSetSignedHeaders()) {
        {
          oprot.writeI32(struct.signedHeaders.size());
          for (String _iter4 : struct.signedHeaders)
          {
            oprot.writeString(_iter4);
          }
        }
      }
      if (struct.isSetSupportAccountKey()) {
        oprot.writeBool(struct.supportAccountKey);
      }
    }

    @Override
    public void read(libthrift091.protocol.TProtocol prot, HttpAuthorizationHeader struct) throws libthrift091.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(8);
      if (incoming.get(0)) {
        struct.version = iprot.readString();
        struct.setVersionIsSet(true);
      }
      if (incoming.get(1)) {
        struct.userType = com.xiaomi.infra.galaxy.sds.thrift.UserType.findByValue(iprot.readI32());
        struct.setUserTypeIsSet(true);
      }
      if (incoming.get(2)) {
        struct.secretKeyId = iprot.readString();
        struct.setSecretKeyIdIsSet(true);
      }
      if (incoming.get(3)) {
        struct.secretKey = iprot.readString();
        struct.setSecretKeyIsSet(true);
      }
      if (incoming.get(4)) {
        struct.signature = iprot.readString();
        struct.setSignatureIsSet(true);
      }
      if (incoming.get(5)) {
        struct.algorithm = com.xiaomi.infra.galaxy.sds.thrift.MacAlgorithm.findByValue(iprot.readI32());
        struct.setAlgorithmIsSet(true);
      }
      if (incoming.get(6)) {
        {
          libthrift091.protocol.TList _list5 = new libthrift091.protocol.TList(libthrift091.protocol.TType.STRING, iprot.readI32());
          struct.signedHeaders = new ArrayList<String>(_list5.size);
          String _elem6;
          for (int _i7 = 0; _i7 < _list5.size; ++_i7)
          {
            _elem6 = iprot.readString();
            struct.signedHeaders.add(_elem6);
          }
        }
        struct.setSignedHeadersIsSet(true);
      }
      if (incoming.get(7)) {
        struct.supportAccountKey = iprot.readBool();
        struct.setSupportAccountKeyIsSet(true);
      }
    }
  }

}


text:
package io.takari.swagger.v12;

import java.util.Collections;
import java.util.List;
import java.util.Map;

public class Model {

  private String id;
  private String description;
  private List<String> requiredProperties;
  private Map<String,Property> properties;

  public Model(String id, String description) {
    this.id = id;
    this.description = description;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public List<String> getRequiredProperties() {
    return requiredProperties;
  }

  public void setRequiredProperties(List<String> requiredProperties) {
    this.requiredProperties = requiredProperties;
  }

  public Map<String,Property> getProperties() {
    return properties;
  }

  public void setProperties(Map<String,Property> properties) {
    this.properties = properties;
  }

  public String getName() {
    return getId();
  }

  public List<String> getEnumValues() {
    return Collections.emptyList();
  }

  public Object getDefaultValue() {
    return null;
  }

  public Number getMinimum() {
    return null;
  }

  public Number getMaximum() {
    return null;
  }

}

redpajama_set_name: RedPajamaGithub


text:
package uk.ac.ebi.pride.archive.web.service.client.peptide;

import uk.ac.ebi.pride.archive.web.service.client.ArchiveClient;
import uk.ac.ebi.pride.archive.web.service.config.AbstractArchiveWsConfig;
import uk.ac.ebi.pride.archive.web.service.model.peptide.PsmDetailList;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * @author ypriverol
 *
 */
public class PeptideWsClient extends ArchiveClient{

    /**
     * Default constructor for Archive clients
     *
     * @param config
     */
    public PeptideWsClient(AbstractArchiveWsConfig config) {
        super(config);
    }

    /**
     * List of Peptides by Project Accession
     * @param projectAccession
     * @param page
     * @param show
     * @return
     * @throws IOException
     */
    public PsmDetailList getPsmsByProject(String projectAccession, int page, int show) throws IOException {

        Map<String, String> args = new HashMap<String, String>();
        args.put("page", "" + page);
        args.put("show", "" + show);

        String url = String.format("%s://%s/pride/ws/archive/peptide/list/project/%s?%s",
                config.getProtocol(), config.getHostName(), projectAccession, "&page={page}&show={show}");

        return this.restTemplate.getForObject(url, PsmDetailList.class, args);

    }

    /**
     * Number of Peptides by Project Accession
     * @param projectAccession
     * @return
     * @throws IOException
     */
    public int countPsmsByProject(String projectAccession) throws IOException {

        String url = String.format("%s://%s/pride/ws/archive/peptide/count/project/%s",
        config.getProtocol(), config.getHostName(), projectAccession);

        return this.restTemplate.getForObject(url, Integer.class);

    }

    /**
     * List of Psms by Project and Sequences
     * @param projectAccession
     * @param sequence
     * @return
     */
    public PsmDetailList getPsmsByProjectAndSequence(String projectAccession, String sequence){

        String url = String.format("%s://%s/pride/ws/archive/peptide/list/project/%s/sequence/%s",
                config.getProtocol(), config.getHostName(), projectAccession, sequence);

        return this.restTemplate.getForObject(url, PsmDetailList.class);
    }

    /**
     * Number of PSms by Project and Sequence
     * @param projectAccession
     * @param sequence
     * @return
     */
    public int countPsmsByProjectAndSequence(String projectAccession, String sequence){

        String url = String.format("%s://%s/pride/ws/archive/peptide/count/project/%s/sequence/%s",
                config.getProtocol(), config.getHostName(), projectAccession, sequence);

        return this.restTemplate.getForObject(url, Integer.class);
    }

    /**
     * List of Peptides by Assay Accession
     * @param assayAccession
     * @param page
     * @param show
     * @return
     * @throws IOException
     */
    public PsmDetailList getPsmsByAssay(String assayAccession, int page, int show) throws IOException {

        Map<String, String> args = new HashMap<String, String>();
        args.put("page", "" + page);
        args.put("show", "" + show);

        String url = String.format("%s://%s/pride/ws/archive/peptide/list/assay/%s?%s",
                config.getProtocol(), config.getHostName(), assayAccession, "&page={page}&show={show}");

        return this.restTemplate.getForObject(url, PsmDetailList.class, args);

    }

    /**
     * Number of Peptides by Assay Accession
     * @param assayAccession
     * @return
     * @throws IOException
     */
    public int countPsmsByAssay(String assayAccession) throws IOException {

        String url = String.format("%s://%s/pride/ws/archive/peptide/count/assay/%s",
                config.getProtocol(), config.getHostName(), assayAccession);

        return this.restTemplate.getForObject(url, Integer.class);

    }

    /**
     * List of Psms by Project and Sequences
     * @param assayAccession
     * @param sequence
     * @return
     */
    public PsmDetailList getPsmsByAssayAndSequence(String assayAccession, String sequence){

        String url = String.format("%s://%s/pride/ws/archive/peptide/list/assay/%s/sequence/%s",
                config.getProtocol(), config.getHostName(), assayAccession, sequence);

        return this.restTemplate.getForObject(url, PsmDetailList.class);
    }

    /**
     * Number of PSms by Project and Sequence
     * @param assayAccession
     * @param sequence
     * @return
     */
    public int countPsmsByAssayAndSequence(String assayAccession, String sequence){

        String url = String.format("%s://%s/pride/ws/archive/peptide/count/assay/%s/sequence/%s",
                config.getProtocol(), config.getHostName(), assayAccession, sequence);

        return this.restTemplate.getForObject(url, Integer.class);
    }
}


text:
ActiveRecord::Schema.define(:version => 20130512154153) do

  create_table "galaxies_elliptical_galaxies", :force => true do |t|
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "galaxies_lenticular_galaxies", :force => true do |t|
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "galaxies_spiral_galaxies", :force => true do |t|
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "planets_exoplanets", :force => true do |t|
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "planets_rogue_planets", :force => true do |t|
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

end


text:
import React, { Component } from 'react'
import { Text, TouchableOpacity } from 'react-native'
import styles from './Styles/DrawerButtonStyles'
import ExamplesRegistry from '../Services/ExamplesRegistry'

// Example
ExamplesRegistry.add('Drawer Button', () =>
  <DrawerButton
    text='Example left drawer button'
    onPress={() => window.alert('Your drawers are showing')}
  />
)

type DrawerButtonProps = {
  text: string,
  onPress: () => void
}

class DrawerButton extends Component {
  props: DrawerButtonProps

  render () {
    return (
      <TouchableOpacity onPress={this.props.onPress}>
        <Text style={styles.text}>{this.props.text}</Text>
      </TouchableOpacity>
    )
  }
}

export default DrawerButton


text:
const port = process.env.PORT || '8080';
const host = process.env.HOST || '0.0.0.0';
const express = require('express');
const app = express();

app.use(require('./src'));

app.listen(port, host);

console.log('Server running on, %s:%d', host, port);

module.exports = app;
module.exports.baseUrl = 'http://' + host + ':' + port;

if (!process.env.TESTING) {
  require('./fixture').reset();
}


text:
'use strict';
eventsApp.directive('collapsible', function () {
    // Directive defination object
    return {
        restrict: 'E',
        transclude: true,
        replace: true,
        template: '

{{name}}

',
        scope: {
            name: '@'
        },
        controller: function($scope) {
            $scope.visible = false;
            $scope.toggle = function() {
                $scope.visible = !$scope.visible;
            }
        },
    };
});


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace DfmHttpService
{
    using System;
    using System.Net;
    using System.Threading;

    internal class DfmHttpServer
    {
        private readonly HttpListener _listener = new HttpListener();
        private ManualResetEvent _processing = new ManualResetEvent(true);
        private readonly IHttpHandler _handler;
        private int _status;

        public DfmHttpServer(IHttpHandler handler, string host, string port)
        {
            if (string.IsNullOrEmpty(host))
            {
                port = PreviewConstants.ServerHost;
            }
            if (string.IsNullOrEmpty(port))
            {
                port = PreviewConstants.ServerPort;
            }
            string UrlPrefix = $"http://{host}:{port}/";
            _listener.Prefixes.Add(UrlPrefix);
            _handler = handler;
        }

        public void Start()
        {
            var status = Interlocked.CompareExchange(ref _status, 1, 0);
            if (status != 0)
            {
                return;
            }

            _listener.Start();
            _processing.Reset();
            // Inform extension that server is ready to handle request
            Console.WriteLine("Ready");
            RunServerCore();
        }

        public void Terminate()
        {
            var status = Interlocked.CompareExchange(ref _status, 0, 1);
            if (status != 1)
            {
                return;
            }
            _listener.Stop();
            _processing.Set();
        }

        public void WaitForExit()
        {
            _processing.WaitOne();
            _listener.Close();
            _processing = null;
        }

        private void RunServerCore()
        {
            _listener.BeginGetContext(async ar =>
            {
                try
                {
                    var httpContext = _listener.EndGetContext(ar);
                    RunServerCore();
                    try
                    {
                        var context = new ServiceContext { HttpContext = httpContext, Server = this };
                        await _handler.HandleAsync(context);
                    }
                    catch (HandlerClientException ex)
                    {
                        Utility.ReplyClientErrorResponse(httpContext, $"Error occurs while handling context, {ex.Message}");
                    }
                    catch (HandlerServerException ex)
                    {
                        Utility.ReplyServerErrorResponse(httpContext, $"Error occurs while handling context, {ex.Message}");
                    }
                    catch (Exception ex)
                    {
                        Utility.ReplyServerErrorResponse(httpContext, $"Error occurs, {ex.ToString()}");
                    }
                }
                catch (HttpListenerException)
                {
                }
            }, null);
        }
    }
}


text:
class CannedBrowsingDataAppCacheHelper;
class CannedBrowsingDataDatabaseHelper;
class CannedBrowsingDataIndexedDBHelper;
class CannedBrowsingDataLocalStorageHelper;
class CookiesTreeModel;
class TabContents;
class Profile;

namespace net {
class CookieMonster;
}

class TabSpecificContentSettings
    : public RenderViewHostDelegate::ContentSettings,
      public TabContentsObserver {
 public:
  TabSpecificContentSettings(TabContents* tab);

  virtual ~TabSpecificContentSettings() {}

  // Resets the |content_blocked_| and |content_accessed_| arrays, except for
  // CONTENT_SETTINGS_TYPE_COOKIES related information.
  void ClearBlockedContentSettingsExceptForCookies();

  // Resets all cookies related information.
  void ClearCookieSpecificContentSettings();

  // Clears the Geolocation settings.
  void ClearGeolocationContentSettings();

  // Changes the |content_blocked_| entry for popups.
  void SetPopupsBlocked(bool blocked);

  // Updates Geolocation settings on navigation.
  void GeolocationDidNavigate(
      const NavigationController::LoadCommittedDetails& details);

  // Returns whether a particular kind of content has been blocked for this
  // page.
  bool IsContentBlocked(ContentSettingsType content_type) const;

  // Returns true if content blockage was indicated to the user.
  bool IsBlockageIndicated(ContentSettingsType content_type) const;

  void SetBlockageHasBeenIndicated(ContentSettingsType content_type);

  // Returns whether a particular kind of content has been accessed. Currently
  // only tracks cookies.
  bool IsContentAccessed(ContentSettingsType content_type) const;

  const std::set<std::string>& BlockedResourcesForType(
      ContentSettingsType content_type) const;

  // Returns the GeolocationSettingsState that controls the
  // geolocation API usage on this page.
  const GeolocationSettingsState& geolocation_settings_state() const {
    return geolocation_settings_state_;
  }

  // Returns a CookiesTreeModel object for the recoreded allowed cookies.
  CookiesTreeModel* GetAllowedCookiesTreeModel();

  // Returns a CookiesTreeModel object for the recoreded blocked cookies.
  CookiesTreeModel* GetBlockedCookiesTreeModel();

  bool load_plugins_link_enabled() { return load_plugins_link_enabled_; }
  void set_load_plugins_link_enabled(bool enabled) {
    load_plugins_link_enabled_ = enabled;
  }

  // RenderViewHostDelegate::ContentSettings implementation.
  virtual void OnContentBlocked(ContentSettingsType type,
                                const std::string& resource_identifier);
  virtual void OnCookiesRead(const GURL& url,
                             const net::CookieList& cookie_list,
                             bool blocked_by_policy);
  virtual void OnCookieChanged(const GURL& url,
                               const std::string& cookie_line,
                               const net::CookieOptions& options,
                               bool blocked_by_policy);
  virtual void OnIndexedDBAccessed(const GURL& url,
                                   const string16& description,
                                   bool blocked_by_policy);
  virtual void OnLocalStorageAccessed(const GURL& url,
                                      DOMStorageType storage_type,
                                      bool blocked_by_policy);
  virtual void OnWebDatabaseAccessed(const GURL& url,
                                     const string16& name,
                                     const string16& display_name,
                                     unsigned long estimated_size,
                                     bool blocked_by_policy);
  virtual void OnAppCacheAccessed(const GURL& manifest_url,
                                  bool blocked_by_policy);
  virtual void OnGeolocationPermissionSet(const GURL& requesting_frame,
                                          bool allowed);

  // TabContentsObserver overrides.
  virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
  virtual void DidNavigateMainFramePostCommit(
      const NavigationController::LoadCommittedDetails& details,
      const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE;
  virtual void DidStartProvisionalLoadForFrame(int64 frame_id,
                                               bool is_main_frame,
                                               const GURL& validated_url,
                                               bool is_error_page) OVERRIDE;

 private:
  class LocalSharedObjectsContainer {
   public:
    explicit LocalSharedObjectsContainer(Profile* profile);
    ~LocalSharedObjectsContainer();

    // Empties the container.
    void Reset();

    net::CookieMonster* cookies() const { return cookies_; }
    CannedBrowsingDataAppCacheHelper* appcaches() const {
      return appcaches_;
    }
    CannedBrowsingDataDatabaseHelper* databases() const {
      return databases_;
    }
    CannedBrowsingDataIndexedDBHelper* indexed_dbs() const {
      return indexed_dbs_;
    }
    CannedBrowsingDataLocalStorageHelper* local_storages() const {
      return local_storages_;
    }
    CannedBrowsingDataLocalStorageHelper* session_storages() const {
      return session_storages_;
    }

    CookiesTreeModel* GetCookiesTreeModel();

    bool empty() const;

   private:
    DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer);

    scoped_refptr<net::CookieMonster> cookies_;
    scoped_refptr<CannedBrowsingDataAppCacheHelper> appcaches_;
    scoped_refptr<CannedBrowsingDataDatabaseHelper> databases_;
    scoped_refptr<CannedBrowsingDataIndexedDBHelper> indexed_dbs_;
    scoped_refptr<CannedBrowsingDataLocalStorageHelper> local_storages_;
    scoped_refptr<CannedBrowsingDataLocalStorageHelper> session_storages_;
  };

  void AddBlockedResource(ContentSettingsType content_type,
                          const std::string& resource_identifier);

  void OnContentAccessed(ContentSettingsType type);

  // Stores which content setting types actually have blocked content.
  bool content_blocked_[CONTENT_SETTINGS_NUM_TYPES];

  // Stores if the blocked content was messaged to the user.
  bool content_blockage_indicated_to_user_[CONTENT_SETTINGS_NUM_TYPES];

  // Stores which content setting types actually were accessed.
  bool content_accessed_[CONTENT_SETTINGS_NUM_TYPES];

  // Stores the blocked resources for each content type.
  // Currently only used for plugins.
  scoped_ptr<std::set<std::string> >
      blocked_resources_[CONTENT_SETTINGS_NUM_TYPES];

  // Stores the blocked/allowed cookies.
  LocalSharedObjectsContainer allowed_local_shared_objects_;
  LocalSharedObjectsContainer blocked_local_shared_objects_;

  // Manages information about Geolocation API usage in this page.
  GeolocationSettingsState geolocation_settings_state_;

  // Stores whether the user can load blocked plugins on this page.
  bool load_plugins_link_enabled_;

  DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings);
};

#endif  // CHROME_BROWSER_TAB_CONTENTS_TAB_SPECIFIC_CONTENT_SETTINGS_H_


text:
import sys, gc

def make_cycle():
    l = { }
    l[0] = l

def main():
    collected = gc.collect()
    print "Garbage collector: collected %d objects." % (collected)
    print "Creating cycles..."
    for i in range(10):
        make_cycle()
    collected = gc.collect()
    print "Garbage collector: collected %d objects." % (collected)

if __name__ == "__main__":
    ret = main()
    sys.exit(ret)


text:
class Glassfish < Formula
  desc "Java EE application server"
  homepage "https://glassfish.java.net"
  url "http://download.java.net/glassfish/4.1.1/release/glassfish-4.1.1.zip"
  sha256 "1b20d42b7d97d0282b90b3f6ec958138f1e81a500468f391ff5aa06afb599b9c"

  bottle :unneeded

  def install
    rm_rf Dir["bin/*.bat"]
    libexec.install Dir["*", ".org.opensolaris,pkg"]
  end

  def caveats; <<-EOS.undent
    The home of GlassFish Application Server 4 is:
      #{opt_libexec}

    You may want to add the following to your .bash_profile:
      export GLASSFISH_HOME=#{opt_libexec}
      export PATH=${PATH}:${GLASSFISH_HOME}/bin

    Note: The support scripts used by GlassFish Application Server 4
    are *NOT* linked to bin.
  EOS
  end
end


text:
#include "js-parser-internal.h"
#include "js-scanner-internal.h"
#include "lit-char-helpers.h"

#if JERRY_PARSER

/** \addtogroup parser Parser
 * @{
 *
 * \addtogroup jsparser JavaScript
 * @{
 *
 * \addtogroup jsparser_scanner Scanner
 * @{
 */

/**
 * Add the "async" literal to the literal pool.
 */
void
scanner_add_async_literal (parser_context_t *context_p, /**< context */
                           scanner_context_t *scanner_context_p) /**< scanner context */
{
  lexer_lit_location_t async_literal;

  JERRY_ASSERT (context_p->stack_top_uint8 == SCAN_STACK_USE_ASYNC);

  parser_stack_pop_uint8 (context_p);
  parser_stack_pop (context_p, &async_literal, sizeof (lexer_lit_location_t));

  lexer_lit_location_t *lit_location_p =
    scanner_add_custom_literal (context_p, scanner_context_p->active_literal_pool_p, &async_literal);

  lit_location_p->type |= SCANNER_LITERAL_IS_USED;

  if (scanner_context_p->active_literal_pool_p->status_flags & SCANNER_LITERAL_POOL_IN_WITH)
  {
    lit_location_p->type |= SCANNER_LITERAL_NO_REG;
  }
} /* scanner_add_async_literal */

/**
 * Init scanning the body of an arrow function.
 */
static void
scanner_check_arrow_body (parser_context_t *context_p, /**< context */
                          scanner_context_t *scanner_context_p) /**< scanner context */
{
  lexer_next_token (context_p);

  scanner_context_p->active_literal_pool_p->status_flags |= SCANNER_LITERAL_POOL_ARROW;

  if (context_p->token.type != LEXER_LEFT_BRACE)
  {
    scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;
    parser_stack_push_uint8 (context_p, SCAN_STACK_ARROW_EXPRESSION);
    return;
  }

  lexer_next_token (context_p);
  parser_stack_push_uint8 (context_p, SCAN_STACK_FUNCTION_ARROW);
  scanner_check_directives (context_p, scanner_context_p);
} /* scanner_check_arrow_body */

/**
 * Process arrow function with argument list.
 */
void
scanner_check_arrow (parser_context_t *context_p, /**< context */
                     scanner_context_t *scanner_context_p) /**< scanner context */
{
  parser_stack_pop_uint8 (context_p);

  lexer_next_token (context_p);

  if (context_p->token.type != LEXER_ARROW || (context_p->token.flags & LEXER_WAS_NEWLINE))
  {
    if (context_p->stack_top_uint8 == SCAN_STACK_USE_ASYNC)
    {
      scanner_add_async_literal (context_p, scanner_context_p);
    }

    scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
    scanner_pop_literal_pool (context_p, scanner_context_p);
    return;
  }

  if (context_p->stack_top_uint8 == SCAN_STACK_USE_ASYNC)
  {
    parser_stack_pop (context_p, NULL, sizeof (lexer_lit_location_t) + 1);
  }

  scanner_literal_pool_t *literal_pool_p = scanner_context_p->active_literal_pool_p;
  uint16_t status_flags = literal_pool_p->status_flags;

  bool is_async_arrow = (status_flags & SCANNER_LITERAL_POOL_MAY_ASYNC_ARROW) != 0;

  status_flags |= SCANNER_LITERAL_POOL_ARROW_FLAGS;
  status_flags &=
    (uint16_t) ~(SCANNER_LITERAL_POOL_IN_WITH | SCANNER_LITERAL_POOL_GENERATOR | SCANNER_LITERAL_POOL_ASYNC);

  context_p->status_flags &= (uint32_t) ~(PARSER_IS_GENERATOR_FUNCTION | PARSER_IS_ASYNC_FUNCTION);

  if (is_async_arrow)
  {
    status_flags |= SCANNER_LITERAL_POOL_ASYNC;
    context_p->status_flags |= PARSER_IS_ASYNC_FUNCTION;
  }

  literal_pool_p->status_flags = status_flags;

  scanner_filter_arguments (context_p, scanner_context_p);
  scanner_check_arrow_body (context_p, scanner_context_p);
} /* scanner_check_arrow */

/**
 * Process arrow function with a single argument.
 */
void
scanner_scan_simple_arrow (parser_context_t *context_p, /**< context */
                           scanner_context_t *scanner_context_p, /**< scanner context */
                           const uint8_t *source_p) /**< identifier end position */
{
  uint16_t status_flags = SCANNER_LITERAL_POOL_ARROW_FLAGS;

  context_p->status_flags &= (uint32_t) ~(PARSER_IS_GENERATOR_FUNCTION | PARSER_IS_ASYNC_FUNCTION);

  if (scanner_context_p->async_source_p != NULL)
  {
    JERRY_ASSERT (scanner_context_p->async_source_p == source_p);

    status_flags |= SCANNER_LITERAL_POOL_ASYNC;
    context_p->status_flags |= PARSER_IS_ASYNC_FUNCTION;
  }

  scanner_literal_pool_t *literal_pool_p = scanner_push_literal_pool (context_p, scanner_context_p, status_flags);
  literal_pool_p->source_p = source_p;

  lexer_lit_location_t *location_p = scanner_add_literal (context_p, scanner_context_p);
  location_p->type |= SCANNER_LITERAL_IS_ARG;

  /* Skip the => token, which size is two. */
  context_p->source_p += 2;
  PARSER_PLUS_EQUAL_LC (context_p->column, 2);
  context_p->token.flags = (uint8_t) (context_p->token.flags & ~LEXER_NO_SKIP_SPACES);

  scanner_check_arrow_body (context_p, scanner_context_p);
} /* scanner_scan_simple_arrow */

/**
 * Process the next argument of a might-be arrow function.
 */
void
scanner_check_arrow_arg (parser_context_t *context_p, /**< context */
                         scanner_context_t *scanner_context_p) /**< scanner context */
{
  JERRY_ASSERT (context_p->stack_top_uint8 == SCAN_STACK_ARROW_ARGUMENTS);

  const uint8_t *source_p = context_p->source_p;
  bool process_arrow = false;

  scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;

  if (context_p->token.type == LEXER_THREE_DOTS)
  {
    lexer_next_token (context_p);
  }

  switch (context_p->token.type)
  {
    case LEXER_RIGHT_PAREN:
    {
      scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION_END;
      return;
    }
    case LEXER_LITERAL:
    {
      if (context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
      {
        break;
      }

      scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;

      if (lexer_check_arrow (context_p))
      {
        process_arrow = true;
        break;
      }

      lexer_lit_location_t *argument_literal_p = scanner_append_argument (context_p, scanner_context_p);

      scanner_detect_eval_call (context_p, scanner_context_p);

      lexer_next_token (context_p);

      if (context_p->token.type == LEXER_COMMA || context_p->token.type == LEXER_RIGHT_PAREN)
      {
        return;
      }

      if (context_p->token.type != LEXER_ASSIGN)
      {
        break;
      }

      if (argument_literal_p->type & SCANNER_LITERAL_IS_USED)
      {
        JERRY_ASSERT (argument_literal_p->type & SCANNER_LITERAL_EARLY_CREATE);
        return;
      }

      scanner_binding_literal_t binding_literal;
      binding_literal.literal_p = argument_literal_p;

      parser_stack_push (context_p, &binding_literal, sizeof (scanner_binding_literal_t));
      parser_stack_push_uint8 (context_p, SCAN_STACK_BINDING_INIT);
      return;
    }
    case LEXER_LEFT_SQUARE:
    case LEXER_LEFT_BRACE:
    {
      scanner_append_hole (context_p, scanner_context_p);
      scanner_push_destructuring_pattern (context_p, scanner_context_p, SCANNER_BINDING_ARROW_ARG, false);

      if (context_p->token.type == LEXER_LEFT_BRACE)
      {
        parser_stack_push_uint8 (context_p, 0);
        parser_stack_push_uint8 (context_p, SCAN_STACK_OBJECT_LITERAL);
        scanner_context_p->mode = SCAN_MODE_PROPERTY_NAME;
        return;
      }

      parser_stack_push_uint8 (context_p, SCAN_STACK_ARRAY_LITERAL);
      scanner_context_p->mode = SCAN_MODE_BINDING;
      lexer_next_token (context_p);
      return;
    }
  }

  scanner_pop_literal_pool (context_p, scanner_context_p);
  parser_stack_pop_uint8 (context_p);

  if (context_p->stack_top_uint8 == SCAN_STACK_USE_ASYNC)
  {
    scanner_add_async_literal (context_p, scanner_context_p);
  }

  parser_stack_push_uint8 (context_p, SCAN_STACK_PAREN_EXPRESSION);

  if (process_arrow)
  {
    scanner_scan_simple_arrow (context_p, scanner_context_p, source_p);
  }
} /* scanner_check_arrow_arg */

/**
 * Detect async functions.
 *
 * @return true, if async is followed by a function keyword, false otherwise
 */
bool
scanner_check_async_function (parser_context_t *context_p, /**< context */
                              scanner_context_t *scanner_context_p) /**< scanner context */
{
  JERRY_ASSERT (lexer_token_is_async (context_p));
  JERRY_ASSERT (scanner_context_p->mode == SCAN_MODE_PRIMARY_EXPRESSION
                || scanner_context_p->mode == SCAN_MODE_PRIMARY_EXPRESSION_AFTER_NEW);
  JERRY_ASSERT (scanner_context_p->async_source_p != NULL);

  lexer_lit_location_t async_literal = context_p->token.lit_location;

  lexer_next_token (context_p);

  if (!(context_p->token.flags & LEXER_WAS_NEWLINE))
  {
    if (context_p->token.type == LEXER_KEYW_FUNCTION)
    {
      return true;
    }

    if (context_p->token.type == LEXER_LITERAL && context_p->token.lit_location.type == LEXER_IDENT_LITERAL)
    {
      if (!lexer_check_arrow (context_p))
      {
        scanner_raise_error (context_p);
      }

      scanner_scan_simple_arrow (context_p, scanner_context_p, scanner_context_p->async_source_p);
      scanner_context_p->async_source_p = NULL;
      return false;
    }

    if (context_p->token.type == LEXER_LEFT_PAREN)
    {
      parser_stack_push (context_p, &async_literal, sizeof (lexer_lit_location_t));
      parser_stack_push_uint8 (context_p, SCAN_STACK_USE_ASYNC);
      return false;
    }
  }

  lexer_lit_location_t *lit_location_p =
    scanner_add_custom_literal (context_p, scanner_context_p->active_literal_pool_p, &async_literal);
  lit_location_p->type |= SCANNER_LITERAL_IS_USED;

  if (scanner_context_p->active_literal_pool_p->status_flags & SCANNER_LITERAL_POOL_IN_WITH)
  {
    lit_location_p->type |= SCANNER_LITERAL_NO_REG;
  }

  scanner_context_p->async_source_p = NULL;
  scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
  return false;
} /* scanner_check_async_function */

/**
 * Check whether the statement of an if/else construct is a function statement.
 */
void
scanner_check_function_after_if (parser_context_t *context_p, /**< context */
                                 scanner_context_t *scanner_context_p) /**< scanner context */
{
  lexer_next_token (context_p);
  scanner_context_p->mode = SCAN_MODE_STATEMENT;

  if (JERRY_UNLIKELY (context_p->token.type == LEXER_KEYW_FUNCTION))
  {
    scanner_literal_pool_t *literal_pool_p;
    literal_pool_p = scanner_push_literal_pool (context_p, scanner_context_p, 0);

    literal_pool_p->source_p = context_p->source_p;
    parser_stack_push_uint8 (context_p, SCAN_STACK_PRIVATE_BLOCK);
  }
} /* scanner_check_function_after_if */

#if JERRY_MODULE_SYSTEM

/**
 * Check whether the next token is meta.
 */
void
scanner_check_import_meta (parser_context_t *context_p) /**< context */
{
  lexer_next_token (context_p);

  if (context_p->token.type != LEXER_LITERAL || context_p->token.lit_location.type != LEXER_IDENT_LITERAL
      || context_p->token.keyword_type != LEXER_KEYW_META
      || (context_p->token.lit_location.status_flags & LEXER_LIT_LOCATION_HAS_ESCAPE))
  {
    scanner_raise_error (context_p);
  }

  lexer_next_token (context_p);

  context_p->global_status_flags |= ECMA_PARSE_INTERNAL_HAS_IMPORT_META;
} /* scanner_check_import_meta */

#endif /* JERRY_MODULE_SYSTEM */

/**
 * Arrow types for scanner_scan_bracket() function.
 */
typedef enum
{
  SCANNER_SCAN_BRACKET_NO_ARROW, /**< not an arrow function */
  SCANNER_SCAN_BRACKET_SIMPLE_ARROW, /**< simple arrow function */
  SCANNER_SCAN_BRACKET_ARROW_WITH_ONE_ARG, /**< arrow function with one argument */
} scanner_scan_bracket_arrow_type_t;

/**
 * Scan bracketed expressions.
 */
void
scanner_scan_bracket (parser_context_t *context_p, /**< context */
                      scanner_context_t *scanner_context_p) /**< scanner context */
{
  size_t depth = 0;
  const uint8_t *arrow_source_p;
  const uint8_t *async_source_p = NULL;
  scanner_scan_bracket_arrow_type_t arrow_type = SCANNER_SCAN_BRACKET_NO_ARROW;

  JERRY_ASSERT (context_p->token.type == LEXER_LEFT_PAREN);

  do
  {
    arrow_source_p = context_p->source_p;
    depth++;
    lexer_next_token (context_p);
  } while (context_p->token.type == LEXER_LEFT_PAREN);

  scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;

  switch (context_p->token.type)
  {
    case LEXER_LITERAL:
    {
      if (context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
      {
        arrow_source_p = NULL;
        break;
      }

      const uint8_t *source_p = context_p->source_p;

      if (lexer_check_arrow (context_p))
      {
        arrow_source_p = source_p;
        arrow_type = SCANNER_SCAN_BRACKET_SIMPLE_ARROW;
        break;
      }

      size_t total_depth = depth;

      while (depth > 0 && lexer_check_next_character (context_p, LIT_CHAR_RIGHT_PAREN))
      {
        lexer_consume_next_character (context_p);
        depth--;
      }

      if (context_p->token.keyword_type == LEXER_KEYW_EVAL
          && lexer_check_next_character (context_p, LIT_CHAR_LEFT_PAREN))
      {
        /* A function call cannot be an eval function. */
        arrow_source_p = NULL;
        const uint16_t flags = (uint16_t) (SCANNER_LITERAL_POOL_CAN_EVAL | SCANNER_LITERAL_POOL_HAS_SUPER_REFERENCE);

        scanner_context_p->active_literal_pool_p->status_flags |= flags;
        break;
      }

      if (total_depth == depth)
      {
        if (lexer_check_arrow_param (context_p))
        {
          JERRY_ASSERT (depth > 0);
          depth--;
          break;
        }

        if (JERRY_UNLIKELY (lexer_token_is_async (context_p)))
        {
          async_source_p = source_p;
        }
      }

      if (depth == total_depth - 1 && lexer_check_arrow (context_p))
      {
        arrow_type = SCANNER_SCAN_BRACKET_ARROW_WITH_ONE_ARG;
        break;
      }

      if (context_p->stack_top_uint8 == SCAN_STACK_USE_ASYNC)
      {
        scanner_add_async_literal (context_p, scanner_context_p);
      }

      arrow_source_p = NULL;
      break;
    }
    case LEXER_THREE_DOTS:
    case LEXER_LEFT_SQUARE:
    case LEXER_LEFT_BRACE:
    case LEXER_RIGHT_PAREN:
    {
      JERRY_ASSERT (depth > 0);
      depth--;
      break;
    }
    default:
    {
      arrow_source_p = NULL;
      break;
    }
  }

  if (JERRY_UNLIKELY (scanner_context_p->async_source_p != NULL) && (arrow_source_p == NULL || depth > 0))
  {
    scanner_context_p->async_source_p = NULL;
  }

  while (depth > 0)
  {
    parser_stack_push_uint8 (context_p, SCAN_STACK_PAREN_EXPRESSION);
    depth--;
  }

  if (arrow_source_p != NULL)
  {
    JERRY_ASSERT (async_source_p == NULL);

    if (arrow_type == SCANNER_SCAN_BRACKET_SIMPLE_ARROW)
    {
      scanner_scan_simple_arrow (context_p, scanner_context_p, arrow_source_p);
      return;
    }

    parser_stack_push_uint8 (context_p, SCAN_STACK_ARROW_ARGUMENTS);

    uint16_t status_flags = 0;

    if (JERRY_UNLIKELY (scanner_context_p->async_source_p != NULL))
    {
      status_flags |= SCANNER_LITERAL_POOL_MAY_ASYNC_ARROW;
      arrow_source_p = scanner_context_p->async_source_p;
      scanner_context_p->async_source_p = NULL;
    }

    scanner_literal_pool_t *literal_pool_p;
    literal_pool_p = scanner_push_literal_pool (context_p, scanner_context_p, status_flags);
    literal_pool_p->source_p = arrow_source_p;

    if (arrow_type == SCANNER_SCAN_BRACKET_ARROW_WITH_ONE_ARG)
    {
      scanner_append_argument (context_p, scanner_context_p);
      scanner_detect_eval_call (context_p, scanner_context_p);

      context_p->token.type = LEXER_RIGHT_PAREN;
      scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION_END;
    }
    else if (context_p->token.type == LEXER_RIGHT_PAREN)
    {
      scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION_END;
    }
    else
    {
      scanner_check_arrow_arg (context_p, scanner_context_p);
    }
  }
  else if (JERRY_UNLIKELY (async_source_p != NULL))
  {
    scanner_context_p->async_source_p = async_source_p;
    scanner_check_async_function (context_p, scanner_context_p);
  }
} /* scanner_scan_bracket */

/**
 * Check directives before a source block.
 */
void
scanner_check_directives (parser_context_t *context_p, /**< context */
                          scanner_context_t *scanner_context_p) /**< scanner context */
{
  scanner_context_p->mode = SCAN_MODE_STATEMENT_OR_TERMINATOR;

  while (context_p->token.type == LEXER_LITERAL && context_p->token.lit_location.type == LEXER_STRING_LITERAL)
  {
    bool is_use_strict = false;

    if (lexer_string_is_use_strict (context_p) && !(context_p->status_flags & PARSER_IS_STRICT))
    {
      is_use_strict = true;
      context_p->status_flags |= PARSER_IS_STRICT;
    }

    lexer_next_token (context_p);

    if (!lexer_string_is_directive (context_p))
    {
      if (is_use_strict)
      {
        context_p->status_flags &= (uint32_t) ~PARSER_IS_STRICT;
      }

      /* The string is part of an expression statement. */
      scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
      break;
    }

    if (is_use_strict)
    {
      scanner_context_p->active_literal_pool_p->status_flags |= SCANNER_LITERAL_POOL_IS_STRICT;
    }

    if (context_p->token.type == LEXER_SEMICOLON)
    {
      lexer_next_token (context_p);
    }
  }
} /* scanner_check_directives */

/**
 * @}
 * @}
 * @}
 */

#endif /* JERRY_PARSER */


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>ShenHengheng, M.E. - Personal Homepage</title>

	<link href="css/bootstrap.min.css" rel="stylesheet">
	<link href="css/isikdogan.css" rel="stylesheet">
  <link href="css/font-awesome.min.css" rel="stylesheet">

              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                  Toggle navigation

              </button>

 About Me

 Projects

 Blogs

 CV

 GitHub

 YouTube

 LinkedIn

        ShenHengheng, M.E.

        Machine Learning Intern

        ICT, Beijing

         CV

News

New Blog: https://www.41sh.cn, Feb 28, 2019

Joined shiyanlou, Sep 19, 2014

Joined China Undergraduate Mathematical Contest in Modeling, July 10, 2015

joined the national mechanical creative design contest-Luoyang , Mar 1, 2016

Deep Learning Course Repo, Aug 13, 2017

Machine Learning And Deep Learning Notes Plans. Sep 16, 2017

Deep Learning Notes is comming..., Nov 3, 2017

tourGuide forwardend development, please visit in mobile, Nov 10, 2017

Welcome to ReadAILib, Dec 20, 2017

Welcome to My File Storage dir, Dec 13, 2018

Experience

World MOOC Learner, June 2014 - Present

Coursera, Edx, Udacity ......

certificate 23+ course

Education

MSc, Computer Technology, Sep 2017

University of Chinese Academy of Sciences, Beijing, China
Laboratory for unknow

BSc, Network Engineering, June 2013

Anyang Institute of Technology, Anyang, China

Related Courses

Deep Learning and Neural Network, Machine Learning, Image And Video Processing, Big Data Introduction, Network Programming.Multi-Variable Statistic Analysis, Data Science, Deep Learning, Statistic Learning

Presentation

NMF Slides

Docker Slides

Internet Of Things Slide

Crypto Slide

Skills

Primary: Python, Go, Java, Docker, K8s. Scala

Prior Experience: R, Matlab, C, C++, C#, , SQL, HTML/CSS

Tools/Libraries/Environments: SpringMVC, SpringBoot, Django, Flask,Beego, Docker, OpenCV, TensorFlow, PyTorch

MicroController: Esp8266, Raspberry Pi, Arduino,...

BigData Tools: Zookeeper, MarkLogic, Hadoop, Spark, Storm, Kafka, Activamq,RabbitMQ, MongoDB, ES, MySQL, Redis, Flume, Kubernetes, Service Mesh, Blockchain...

	<link rel="icon" href="favicon.ico">
	<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>


text:
#include "test_program.h"
#include "CL/cl.h"

#include <cstdlib>
#include <cstring>

const char program_source[] =
    "#warning We need that line\n"
    "\n"
    "__kernel void test(__global float4 *a, __global float4 *b) {\n"
    "   int i = get_global_id(0);\n"
    "\n"
    "   a[i].xwyz = 3.1415926f * b[0].xyzw * b[0].wzyx;\n"
    "}\n";

START_TEST (test_create_program)
{
    cl_platform_id platform = 0;
    cl_device_id device;
    cl_context ctx;
    cl_program program;
    cl_int result;

    const char *src = program_source;
    size_t program_len = sizeof(program_source);

    result = clGetDeviceIDs(platform, CL_DEVICE_TYPE_DEFAULT, 1, &device, 0);
    fail_if(
        result != CL_SUCCESS,
        "unable to get the default device"
    );

    ctx = clCreateContext(0, 1, &device, 0, 0, &result);
    fail_if(
        result != CL_SUCCESS || ctx == 0,
        "unable to create a valid context"
    );

    program = clCreateProgramWithSource(ctx, 0, &src, 0, &result);
    fail_if(
        result != CL_INVALID_VALUE,
        "count cannot be 0"
    );

    program = clCreateProgramWithSource(ctx, 1, 0, 0, &result);
    fail_if(
        result != CL_INVALID_VALUE,
        "strings cannot be NULL"
    );

    program = clCreateProgramWithSource(ctx, 1, &src, &program_len,
                                        &result);
    fail_if(
        result != CL_SUCCESS,
        "cannot create a program from source with sane arguments"
    );

    clReleaseProgram(program); // Sorry

    program = clCreateProgramWithSource(ctx, 1, &src, 0, &result);
    fail_if(
        result != CL_SUCCESS,
        "lengths can be NULL and it must work"
    );

    result = clBuildProgram(program, 1, &device, "", 0, 0);
    fail_if(
        result != CL_SUCCESS,
        "cannot build a valid program"
    );

    clReleaseProgram(program);
    clReleaseContext(ctx);
}
END_TEST

START_TEST (test_program_binary)
{
    cl_platform_id platform = 0;
    cl_device_id device;
    cl_context ctx;
    cl_program program;
    cl_int result, binary_status;

    const char *src = program_source;
    size_t program_len = sizeof(program_source);

    result = clGetDeviceIDs(platform, CL_DEVICE_TYPE_DEFAULT, 1, &device, 0);
    fail_if(
        result != CL_SUCCESS,
        "unable to get the default device"
    );

    ctx = clCreateContext(0, 1, &device, 0, 0, &result);
    fail_if(
        result != CL_SUCCESS || ctx == 0,
        "unable to create a valid context"
    );

    program = clCreateProgramWithSource(ctx, 1, &src, &program_len, &result);
    fail_if(
        result != CL_SUCCESS,
        "cannot create a program from source with sane arguments"
    );

    result = clBuildProgram(program, 1, &device, "", 0, 0);
    fail_if(
        result != CL_SUCCESS,
        "cannot build a valid program"
    );

    size_t binary_size = 0;
    unsigned char *binary_data = 0;

    result = clGetProgramInfo(program, CL_PROGRAM_BINARY_SIZES, sizeof(size_t),
                              (void *)&binary_size, 0);
    fail_if(
        result != CL_SUCCESS || binary_size == 0,
        "cannot get the binary size of the program"
    );

    binary_data = (unsigned char *)std::malloc(binary_size);

    result = clGetProgramInfo(program, CL_PROGRAM_BINARIES, sizeof(unsigned char *),
                              (void *)&binary_data, 0);
    fail_if(
        result != CL_SUCCESS,
        "cannot get the program's binary"
    );

    clReleaseProgram(program);

    program = clCreateProgramWithBinary(ctx, 1, &device, &binary_size,
                                        (const unsigned char **)&binary_data,
                                        &binary_status, &result);
    fail_if(
        result != CL_SUCCESS || binary_status != CL_SUCCESS,
        "cannot create a program from a previously-built binary"
    );

    clReleaseProgram(program);
    clReleaseContext(ctx);
}
END_TEST

START_TEST (test_program_build_info)
{
    cl_platform_id platform = 0;
    cl_device_id device;
    cl_context ctx;
    cl_program program;
    cl_int result;

    const char *src = program_source;

    result = clGetDeviceIDs(platform, CL_DEVICE_TYPE_DEFAULT, 1, &device, 0);
    fail_if(
        result != CL_SUCCESS,
        "unable to get the default device"
    );

    ctx = clCreateContext(0, 1, &device, 0, 0, &result);
    fail_if(
        result != CL_SUCCESS || ctx == 0,
        "unable to create a valid context"
    );

    program = clCreateProgramWithSource(ctx, 1, &src, 0, &result);
    fail_if(
        result != CL_SUCCESS,
        "lengths can be NULL and it must work"
    );

    result = clBuildProgram(program, 1, &device, "", 0, 0);
    fail_if(
        result != CL_SUCCESS,
        "cannot build a valid program"
    );

    char *log = 0;
    size_t log_len;

    result = clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG,
                                   0, 0, &log_len);
    fail_if(
        result != CL_SUCCESS,
        "cannot get the build log len"
    );
    fail_if(
        log_len == 0,
        "we put a warning in the source, log cannot be of lentgth 0"
    );

    log = (char *)std::malloc(log_len);

    result = clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG,
                                   log_len, log, 0);
    fail_if(
        result != CL_SUCCESS,
        "cannot get the build log"
    );
    fail_if(
        !std::strstr(log, "We need that line"),
        "the build log doesn't contain the warning found in the source"
    );

    clReleaseProgram(program);
    clReleaseContext(ctx);
}
END_TEST

TCase *cl_program_tcase_create(void)
{
    TCase *tc = NULL;
    tc = tcase_create("program");
    tcase_add_test(tc, test_create_program);
    tcase_add_test(tc, test_program_binary);
    tcase_add_test(tc, test_program_build_info);
    return tc;
}


text:
@interface RATreeNode ()

@property (nonatomic) BOOL expanded;

@end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using OpenIDConnect.Core.Models.UserManagement;
using OpenIDConnect.IdentityServer.MembershipReboot.Models;

namespace OpenIDConnect.IdentityServer.MembershipReboot.Extensions
{
    public static class PropertyMetadataExtensions
    {
        public static bool TrySet(this IEnumerable<PropertyMetadata> properties, object instance, string type, string value, out UserManagementResult result)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }
            result = null;

            var executableProperty = properties.SingleOrDefault(x => x.ClaimType == type) as ExecutablePropertyMetadata;
            if (executableProperty != null)
            {
                return executableProperty.TrySet(instance, value, out result);
            }

            return false;
        }

        public static bool TrySet(this PropertyMetadata property, object instance, string value, out UserManagementResult result)
        {
            if (property == null)
            {
                throw new ArgumentNullException(nameof(property));
            }
            result = null;

            var executableProperty = property as ExecutablePropertyMetadata;
            if (executableProperty != null)
            {
                result = executableProperty.Set(instance, value);
                return true;
            }

            return false;
        }

        public static bool TryGet(this PropertyMetadata property, object instance, out string value)
        {
            if (property == null)
            {
                throw new ArgumentNullException(nameof(property));
            }

            var executableProperty = property as ExecutablePropertyMetadata;
            if (executableProperty != null)
            {
                value = executableProperty.Get(instance);
                return true;
            }

            value = null;
            return false;
        }
    }
}


text:
title: Creating a new container
localeTitle: Criando um novo contêiner
---
Criando um contêiner usando o Docker CLI

```yaml
docker create [OPTIONS] IMAGE [COMMAND] [ARG...]
```

# Exemplos

Crie e inicie um contêiner

```sh
$ docker create -t -i fedora bash

```