text:
/**
 * Autogenerated by Thrift Compiler (1.0.0-dev)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.github.mistertea.boardgame.landshark;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.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"})
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2014-1-15")
public class PlayerState implements org.apache.thrift.TBase<PlayerState, PlayerState._Fields>, java.io.Serializable, Cloneable, Comparable<PlayerState> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PlayerState");

  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.SET, (short)2);
  private static final org.apache.thrift.protocol.TField LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("location", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField CASH_FIELD_DESC = new org.apache.thrift.protocol.TField("cash", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField QUIT_FIELD_DESC = new org.apache.thrift.protocol.TField("quit", org.apache.thrift.protocol.TType.BOOL, (short)5);

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

  public String name; // required
  public Set<String> properties; // required
  public int location; // required
  public int cash; // required
  public boolean quit; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    NAME((short)1, "name"),
    PROPERTIES((short)2, "properties"),
    LOCATION((short)3, "location"),
    CASH((short)4, "cash"),
    QUIT((short)5, "quit");

    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: // NAME
          return NAME;
        case 2: // PROPERTIES
          return PROPERTIES;
        case 3: // LOCATION
          return LOCATION;
        case 4: // CASH
          return CASH;
        case 5: // QUIT
          return QUIT;
        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 __LOCATION_ISSET_ID = 0;
  private static final int __CASH_ISSET_ID = 1;
  private static final int __QUIT_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.LOCATION, new org.apache.thrift.meta_data.FieldMetaData("location", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.CASH, new org.apache.thrift.meta_data.FieldMetaData("cash", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.QUIT, new org.apache.thrift.meta_data.FieldMetaData("quit", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PlayerState.class, metaDataMap);
  }

  public PlayerState() {
    this.properties = new HashSet<String>();

    this.location = 0;

    this.cash = 0;

    this.quit = false;

  }

  public PlayerState(
    String name,
    Set<String> properties,
    int location,
    int cash,
    boolean quit)
  {
    this();
    this.name = name;
    this.properties = properties;
    this.location = location;
    setLocationIsSet(true);
    this.cash = cash;
    setCashIsSet(true);
    this.quit = quit;
    setQuitIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public PlayerState(PlayerState other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetName()) {
      this.name = other.name;
    }
    if (other.isSetProperties()) {
      Set<String> __this__properties = new HashSet<String>(other.properties);
      this.properties = __this__properties;
    }
    this.location = other.location;
    this.cash = other.cash;
    this.quit = other.quit;
  }

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

  @Override
  public void clear() {
    this.name = null;
    this.properties = new HashSet<String>();

    this.location = 0;

    this.cash = 0;

    this.quit = false;

  }

  public String getName() {
    return this.name;
  }

  public PlayerState setName(String name) {
    this.name = name;
    return this;
  }

  public void unsetName() {
    this.name = null;
  }

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

  public void setNameIsSet(boolean value) {
    if (!value) {
      this.name = null;
    }
  }

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

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

  public void addToProperties(String elem) {
    if (this.properties == null) {
      this.properties = new HashSet<String>();
    }
    this.properties.add(elem);
  }

  public Set<String> getProperties() {
    return this.properties;
  }

  public PlayerState setProperties(Set<String> properties) {
    this.properties = properties;
    return this;
  }

  public void unsetProperties() {
    this.properties = null;
  }

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

  public void setPropertiesIsSet(boolean value) {
    if (!value) {
      this.properties = null;
    }
  }

  public int getLocation() {
    return this.location;
  }

  public PlayerState setLocation(int location) {
    this.location = location;
    setLocationIsSet(true);
    return this;
  }

  public void unsetLocation() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LOCATION_ISSET_ID);
  }

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

  public void setLocationIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LOCATION_ISSET_ID, value);
  }

  public int getCash() {
    return this.cash;
  }

  public PlayerState setCash(int cash) {
    this.cash = cash;
    setCashIsSet(true);
    return this;
  }

  public void unsetCash() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CASH_ISSET_ID);
  }

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

  public void setCashIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CASH_ISSET_ID, value);
  }

  public boolean isQuit() {
    return this.quit;
  }

  public PlayerState setQuit(boolean quit) {
    this.quit = quit;
    setQuitIsSet(true);
    return this;
  }

  public void unsetQuit() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __QUIT_ISSET_ID);
  }

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

  public void setQuitIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __QUIT_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case NAME:
      if (value == null) {
        unsetName();
      } else {
        setName((String)value);
      }
      break;

    case PROPERTIES:
      if (value == null) {
        unsetProperties();
      } else {
        setProperties((Set<String>)value);
      }
      break;

    case LOCATION:
      if (value == null) {
        unsetLocation();
      } else {
        setLocation((Integer)value);
      }
      break;

    case CASH:
      if (value == null) {
        unsetCash();
      } else {
        setCash((Integer)value);
      }
      break;

    case QUIT:
      if (value == null) {
        unsetQuit();
      } else {
        setQuit((Boolean)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case NAME:
      return getName();

    case PROPERTIES:
      return getProperties();

    case LOCATION:
      return Integer.valueOf(getLocation());

    case CASH:
      return Integer.valueOf(getCash());

    case QUIT:
      return Boolean.valueOf(isQuit());

    }
    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 NAME:
      return isSetName();
    case PROPERTIES:
      return isSetProperties();
    case LOCATION:
      return isSetLocation();
    case CASH:
      return isSetCash();
    case QUIT:
      return isSetQuit();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name))
        return false;
      if (!this.name.equals(that.name))
        return false;
    }

    boolean this_present_properties = true && this.isSetProperties();
    boolean that_present_properties = true && that.isSetProperties();
    if (this_present_properties || that_present_properties) {
      if (!(this_present_properties && that_present_properties))
        return false;
      if (!this.properties.equals(that.properties))
        return false;
    }

    boolean this_present_location = true;
    boolean that_present_location = true;
    if (this_present_location || that_present_location) {
      if (!(this_present_location && that_present_location))
        return false;
      if (this.location != that.location)
        return false;
    }

    boolean this_present_cash = true;
    boolean that_present_cash = true;
    if (this_present_cash || that_present_cash) {
      if (!(this_present_cash && that_present_cash))
        return false;
      if (this.cash != that.cash)
        return false;
    }

    boolean this_present_quit = true;
    boolean that_present_quit = true;
    if (this_present_quit || that_present_quit) {
      if (!(this_present_quit && that_present_quit))
        return false;
      if (this.quit != that.quit)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    return 0;
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetProperties()).compareTo(other.isSetProperties());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProperties()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLocation()).compareTo(other.isSetLocation());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLocation()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.location, other.location);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCash()).compareTo(other.isSetCash());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCash()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cash, other.cash);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetQuit()).compareTo(other.isSetQuit());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQuit()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quit, other.quit);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

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

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

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

    sb.append("name:");
    if (this.name == null) {
      sb.append("null");
    } else {
      sb.append(this.name);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("properties:");
    if (this.properties == null) {
      sb.append("null");
    } else {
      sb.append(this.properties);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("location:");
    sb.append(this.location);
    first = false;
    if (!first) sb.append(", ");
    sb.append("cash:");
    sb.append(this.cash);
    first = false;
    if (!first) sb.append(", ");
    sb.append("quit:");
    sb.append(this.quit);
    first = false;
    sb.append(")");
    return sb.toString();
  }

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

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.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 org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class PlayerStateStandardSchemeFactory implements SchemeFactory {
    public PlayerStateStandardScheme getScheme() {
      return new PlayerStateStandardScheme();
    }
  }

  private static class PlayerStateStandardScheme extends StandardScheme<PlayerState> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, PlayerState struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PROPERTIES
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set8 = iprot.readSetBegin();
                struct.properties = new HashSet<String>(2*_set8.size);
                for (int _i9 = 0; _i9 < _set8.size; ++_i9)
                {
                  String _elem10;
                  _elem10 = iprot.readString();
                  struct.properties.add(_elem10);
                }
                iprot.readSetEnd();
              }
              struct.setPropertiesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LOCATION
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.location = iprot.readI32();
              struct.setLocationIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CASH
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.cash = iprot.readI32();
              struct.setCashIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // QUIT
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.quit = iprot.readBool();
              struct.setQuitIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.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(org.apache.thrift.protocol.TProtocol oprot, PlayerState struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.name != null) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        oprot.writeString(struct.name);
        oprot.writeFieldEnd();
      }
      if (struct.properties != null) {
        oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
        {
          oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.properties.size()));
          for (String _iter11 : struct.properties)
          {
            oprot.writeString(_iter11);
          }
          oprot.writeSetEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(LOCATION_FIELD_DESC);
      oprot.writeI32(struct.location);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(CASH_FIELD_DESC);
      oprot.writeI32(struct.cash);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(QUIT_FIELD_DESC);
      oprot.writeBool(struct.quit);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class PlayerStateTupleSchemeFactory implements SchemeFactory {
    public PlayerStateTupleScheme getScheme() {
      return new PlayerStateTupleScheme();
    }
  }

  private static class PlayerStateTupleScheme extends TupleScheme<PlayerState> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, PlayerState struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetName()) {
        optionals.set(0);
      }
      if (struct.isSetProperties()) {
        optionals.set(1);
      }
      if (struct.isSetLocation()) {
        optionals.set(2);
      }
      if (struct.isSetCash()) {
        optionals.set(3);
      }
      if (struct.isSetQuit()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetName()) {
        oprot.writeString(struct.name);
      }
      if (struct.isSetProperties()) {
        {
          oprot.writeI32(struct.properties.size());
          for (String _iter12 : struct.properties)
          {
            oprot.writeString(_iter12);
          }
        }
      }
      if (struct.isSetLocation()) {
        oprot.writeI32(struct.location);
      }
      if (struct.isSetCash()) {
        oprot.writeI32(struct.cash);
      }
      if (struct.isSetQuit()) {
        oprot.writeBool(struct.quit);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, PlayerState struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.name = iprot.readString();
        struct.setNameIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TSet _set13 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.properties = new HashSet<String>(2*_set13.size);
          for (int _i14 = 0; _i14 < _set13.size; ++_i14)
          {
            String _elem15;
            _elem15 = iprot.readString();
            struct.properties.add(_elem15);
          }
        }
        struct.setPropertiesIsSet(true);
      }
      if (incoming.get(2)) {
        struct.location = iprot.readI32();
        struct.setLocationIsSet(true);
      }
      if (incoming.get(3)) {
        struct.cash = iprot.readI32();
        struct.setCashIsSet(true);
      }
      if (incoming.get(4)) {
        struct.quit = iprot.readBool();
        struct.setQuitIsSet(true);
      }
    }
  }

}


text:
Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created and maintained by [Mark Otto](http://twitter.com/mdo) and [Jacob Thornton](http://twitter.com/fat).

This is the Sass version of Bootstrap. A port of Bootstrap from Less to Sass. This project is focused on being a 1:1 port of the original. Please do not submit issues or pull requests for issues with Bootstrap itself. Those should be pushed upstream in the Less version.

To get started, check out <http://getbootstrap.com>!

## SASS: Quick start

Three quick start options are available:

* [Download the latest release](https://github.com/jlong/sass-twitter-bootstrap/zipball/master).
* Clone the repo: `git clone git://github.com/jlong/sass-bootstrap.git`.
* Install with [Bower](http://bower.io): `bower install --save sass-bootstrap`.

## SASS: Usage

You can use the Sass Bootstrap by dropping the compiled CSS into any new project and start cranking.

Because SASS always outputs standard css, just link to the final output like normal:

`<link rel="stylesheet" type="text/css" href="./dist/css/bootstrap.css">`

For more info, refer to the docs!

## SASS: Basic modification

You can learn more about Sass at:

[sass-lang.com](http://sass-lang.com)

Sass runs as a local GEM on your system. You can run `sass --watch lib/bootstrap.scss:dist/css/bootstrap.css`

## Quick start

Three quick start options are available:

* [Download the latest release](https://github.com/twbs/bootstrap/releases/tag/v3.0.0).
* Clone the repo: `git clone https://github.com/twbs/bootstrap.git`.
* Install with [Bower](http://bower.io): `bower install bootstrap`.

Read the [Getting Started page](http://getbootstrap.com/getting-started/) for information on the framework contents, templates and examples, and more.

### What's included

Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:

```
bootstrap/
├── css/
│   ├── bootstrap.css
│   ├── bootstrap.min.css
│   ├── bootstrap-theme.css
│   └── bootstrap-theme.min.css
├── js/
│   ├── bootstrap.js
│   └── bootstrap.min.js
└── fonts/
    ├── glyphicons-halflings-regular.eot
    ├── glyphicons-halflings-regular.svg
    ├── glyphicons-halflings-regular.ttf
    └── glyphicons-halflings-regular.woff
```

We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). Fonts from Glyphicons are included, as is the optional Bootstrap theme.

## Bugs and feature requests

Have a bug or a feature request? [Please open a new issue](https://github.com/twbs/bootstrap/issues). Before opening any issue, please search for existing issues and read the [Issue Guidelines](https://github.com/necolas/issue-guidelines), written by [Nicolas Gallagher](https://github.com/necolas/).

You may use [this JS Bin](http://jsbin.com/aKiCIDO/1/edit) as a template for your bug reports.

## Documentation

Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages at <http://getbootstrap.com>. The docs may also be run locally.

### Running documentation locally

1. If necessary, [install Jekyll](http://jekyllrb.com/docs/installation) (requires v1.x).
2. From the root `/bootstrap` directory, run `jekyll serve` in the command line.
  - **Windows users:** run `chcp 65001` first to change the command prompt's character encoding ([code page](http://en.wikipedia.org/wiki/Windows_code_page)) to UTF-8 so Jekyll runs without errors.
3. Open <http://localhost:9001> in your browser, and voilà.

Learn more about using Jekyll by reading its [documentation](http://jekyllrb.com/docs/home/).

### Documentation for previous releases

Documentation for v2.3.2 has been made available for the time being at <http://getbootstrap.com/2.3.2/> while folks transition to Bootstrap 3.

[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download.

## Compiling CSS and JavaScript

Bootstrap uses [Grunt](http://gruntjs.com/) with convenient methods for working with the framework. It's how we compile our code, run tests, and more. To use it, install the required dependencies as directed and then run some Grunt commands.

### Install Grunt

From the command line:

1. Install `grunt-cli` globally with `npm install -g grunt-cli`.
2. Navigate to the root `/bootstrap` directory, then run `npm install`. npm will look at [package.json](package.json) and automatically install the necessary local dependencies listed there.

When completed, you'll be able to run the various Grunt commands provided from the command line.

**Unfamiliar with `npm`? Don't have node installed?** That's a-okay. npm stands for [node packaged modules](http://npmjs.org/) and is a way to manage development dependencies through node.js. [Download and install node.js](http://nodejs.org/download/) before proceeding.

### Available Grunt commands

#### Build - `grunt`
Run `grunt` to run tests locally and compile the CSS and JavaScript into `/dist`. **Uses [recess](http://twitter.github.io/recess/) and [UglifyJS](http://lisperator.net/uglifyjs/).**

#### Only compile CSS and JavaScript - `grunt dist`
`grunt dist` creates the `/dist` directory with compiled files. **Uses [recess](http://twitter.github.io/recess/) and [UglifyJS](http://lisperator.net/uglifyjs/).**

#### Tests - `grunt test`
Runs [JSHint](http://jshint.com) and [QUnit](http://qunitjs.com/) tests headlessly in [PhantomJS](http://phantomjs.org/) (used for CI).

#### Watch - `grunt watch`
This is a convenience method for watching just Less files and automatically building them whenever you save.

### Troubleshooting dependencies

Should you encounter problems with installing dependencies or running Grunt commands, uninstall all previous dependency versions (global and local). Then, rerun `npm install`.

## Contributing

Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.

More over, if your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the [Code Guide](http://github.com/mdo/code-guide), maintained by [Mark Otto](http://github.com/mdo).

Editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at <http://editorconfig.org>.

With v3.1, we're moving from the Apache 2 to the MIT license for the Bootstrap code (not the docs). Please see the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md) for more information.

## Community

Keep track of development and community news.

* Follow [@twbootstrap on Twitter](http://twitter.com/twbootstrap).
* Read and subscribe to [The Official Bootstrap Blog](http://blog.getbootstrap.com).
* Have a question that's not a feature request or bug report? [Ask on the mailing list.](http://groups.google.com/group/twitter-bootstrap)
* Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##twitter-bootstrap` channel.

## Versioning

For transparency and insight into our release cycle, and for striving to maintain backward compatibility, Bootstrap will be maintained under the Semantic Versioning guidelines as much as possible.

Releases will be numbered with the following format:

`<major>.<minor>.<patch>`

And constructed with the following guidelines:

* Breaking backward compatibility bumps the major (and resets the minor and patch)
* New additions without breaking backward compatibility bumps the minor (and resets the patch)
* Bug fixes and misc changes bumps the patch

For more information on SemVer, please visit <http://semver.org/>.

## SASS: Developers

We have included a Rakefile with convenience methods for working with the SASS Bootstrap library.

+ **build** - `rake build`
This will run the less compiler on the bootstrap lib and regenerate the docs dir.
The lessc compiler is required for this command to run.

+ **watch** - `rake watch`
This is a convenience method for watching your Sass files and automatically building them whenever you save.

## Authors

**Mark Otto**

+ <http://twitter.com/mdo>
+ <http://github.com/mdo>

**Jacob Thornton**

+ <http://twitter.com/fat>
+ <http://github.com/fat>

## SASS: Conversion less to Sass

The Twitter Bootstrap was lovingly converted to Sass by:

**John W. Long**

+ http://twitter.com/johnwlong
+ http://github.com/jlong

**Jeremy Hinegardner**

+ http://twitter.com/copiousfreetime
+ http://github.com/copiousfreetime

**m5o**

+ http://twitter.com/m5o
+ http://github.com/m5o

**smt**

+ http://twitter.com/tudorstudio
+ http://github.com/smt

And [others](https://github.com/jlong/sass-twitter-bootstrap/contributors)

## SASS: Conversion Quick Tips

* replace @ with $
* replace . with @include for mixins
* replace `spin` with `adjust-hue`
* add !default to variable definitions
* replace #gradient > .vertical with @include gradient-vertical
* replace #grid > .style with @include grid-style
* use grid-core and grid-fluid mixins instead of #grid > .core and #grid > .fluid
* use font-shorthand instead of #font > .shorthand
* replace fadein with fade-in
* move @import for reset below mixins, because it uses tab-focus mixin in bootstrap.scss
* explicitly provide .clearfix, .hide-text and .input-block-level for compatibility with LESS output
* pass grid-* mixin arguments to generators, because otherwise the generator mixins will use the default variables pull transition definition into variable

## Sass: Installation via Composer

If you already use Composer, the php dependency manager, installing
sass-twitter-bootstrap is as simple as typing :
```shell
composer.phar require jlong/sass-bootstrap:x.y.z
```
This will install version x.y.z from packagist.org

You'll probably want to make sure you get minor updates, like this:
```shell
composer.phar require jlong/sass-bootstrap:~x.y.z
```
or like this:
```shell
composer.phar require jlong/sass-bootstrap:x.y.*
```

## Copyright and license

Copyright 2013 Twitter, Inc under [the Apache 2.0 license](LICENSE).

redpajama_set_name: RedPajamaGithub


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.12
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.intel.analytics.bigdl.friesian.serving.recall.faiss.swighnswlib;

public class SWIGTYPE_p_std__unordered_mapT_long_faiss__IndexBinaryHash__InvertedList_t {
  private transient long swigCPtr;

  protected SWIGTYPE_p_std__unordered_mapT_long_faiss__IndexBinaryHash__InvertedList_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
    swigCPtr = cPtr;
  }

  protected SWIGTYPE_p_std__unordered_mapT_long_faiss__IndexBinaryHash__InvertedList_t() {
    swigCPtr = 0;
  }

  protected static long getCPtr(SWIGTYPE_p_std__unordered_mapT_long_faiss__IndexBinaryHash__InvertedList_t obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }
}


text:
/**
 * @file TestSettings.cpp
 * @brief Contains unit tests to check if settings are applied correctly.
 */

// library includes
#include <IrrIMGUI/UnitTest/UnitTest.h>
#include <IrrIMGUI/IIMGUIHandle.h>
#include <IrrIMGUI/IrrIMGUI.h>
#include <IrrIMGUI/IrrIMGUIDebug.h>
#include <sstream>
#include <string>
#include <iostream>

using namespace IrrIMGUI;

TEST_GROUP(TestIMGUISettings)
{
  std::streambuf * mpStreamBuffer;

  TEST_SETUP()
  {
    mpStreamBuffer = Debug::ErrorOutput.rdbuf();
  }

  TEST_TEARDOWN()
  {
    Debug::ErrorOutput.rdbuf(mpStreamBuffer);
  }
};

TEST(TestIMGUISettings, checkIfMouseCursorEnableIsApplied)
{
  ImGuiIO &rIMGUI = ImGui::GetIO();

  irr::IrrlichtDevice * const pDevice = irr::createDevice(irr::video::EDT_NULL);
  SIMGUISettings Settings;

  {
    Settings.mIsGUIMouseCursorEnabled = false;

    IIMGUIHandle * const pGUI = createIMGUI(pDevice, nullptr, &Settings);

    CHECK_EQUAL(false, rIMGUI.MouseDrawCursor);
    CHECK_EQUAL(true,  pDevice->getCursorControl()->isVisible());
    CHECK_EQUAL(false, pGUI->getSettings().mIsGUIMouseCursorEnabled);

    Settings.mIsGUIMouseCursorEnabled = true;
    pGUI->setSettings(Settings);

    CHECK_EQUAL(true,  rIMGUI.MouseDrawCursor);
    CHECK_EQUAL(false, pDevice->getCursorControl()->isVisible());
    CHECK_EQUAL(true,  pGUI->getSettings().mIsGUIMouseCursorEnabled);

    Settings.mIsGUIMouseCursorEnabled = false;
    pGUI->setSettings(Settings);

    CHECK_EQUAL(false, rIMGUI.MouseDrawCursor);
    CHECK_EQUAL(true,  pDevice->getCursorControl()->isVisible());
    CHECK_EQUAL(false, pGUI->getSettings().mIsGUIMouseCursorEnabled);

    pGUI->drop();
  }

  {
    Settings.mIsGUIMouseCursorEnabled = true;

    IIMGUIHandle * const pGUI = createIMGUI(pDevice, nullptr, &Settings);

    CHECK_EQUAL(true,  rIMGUI.MouseDrawCursor);
    CHECK_EQUAL(false, pDevice->getCursorControl()->isVisible());
    CHECK_EQUAL(true,  pGUI->getSettings().mIsGUIMouseCursorEnabled);

    Settings.mIsGUIMouseCursorEnabled = false;
    pGUI->setSettings(Settings);

    CHECK_EQUAL(false, rIMGUI.MouseDrawCursor);
    CHECK_EQUAL(true,  pDevice->getCursorControl()->isVisible());
    CHECK_EQUAL(false, pGUI->getSettings().mIsGUIMouseCursorEnabled);

    Settings.mIsGUIMouseCursorEnabled = true;
    pGUI->setSettings(Settings);

    CHECK_EQUAL(true,  rIMGUI.MouseDrawCursor);
    CHECK_EQUAL(false, pDevice->getCursorControl()->isVisible());
    CHECK_EQUAL(true,  pGUI->getSettings().mIsGUIMouseCursorEnabled);

    pGUI->drop();
  }

  pDevice->drop();

  return;
}

TEST(TestIMGUISettings, checkIfMemoryTrackingSettingsAreApplied)
{
  std::stringstream ErrorString;
  Debug::ErrorOutput.rdbuf(ErrorString.rdbuf());

  ImGuiIO &rIMGUI = ImGui::GetIO();

  irr::IrrlichtDevice * const pDevice = irr::createDevice(irr::video::EDT_NULL);
  SIMGUISettings Settings;

  {
    ErrorString.str("");
    Settings.mIsIMGUIMemoryAllocationTrackingEnabled = true;

    IIMGUIHandle * const pGUI = createIMGUI(pDevice, nullptr, &Settings);

    // allocate IMGUI memory for 100 integer values.
    ImVector<int> Values;
    Values.resize(100);

    // This will shutdown IMGUI, thus with enabled tracking an Error is thrown.
    pGUI->drop();

    CHECK_NOT_EQUAL(std::string::npos, ErrorString.str().find("{IrrIMGUI} There are 1 allocated memory blocks that have not been deallocated so far!"));
  }

  {
    ErrorString.str("");
    Settings.mIsIMGUIMemoryAllocationTrackingEnabled = false;

    IIMGUIHandle * const pGUI = createIMGUI(pDevice, nullptr, &Settings);

    // allocate IMGUI memory for 100 integer values.
    ImVector<int> Values;
    Values.resize(100);

    // This will shutdown IMGUI, thus with enabled tracking an Error is thrown.
    pGUI->drop();

    CHECK(std::string::npos == ErrorString.str().find("{IrrIMGUI} There are 1 allocated memory blocks that have not been deallocated so far!"));
  }

  {
    ErrorString.str("");
    Settings.mIsIMGUIMemoryAllocationTrackingEnabled = true;

    IIMGUIHandle * const pGUI = createIMGUI(pDevice, nullptr, &Settings);

    Settings.mIsIMGUIMemoryAllocationTrackingEnabled = false;

    pGUI->setSettings(Settings);

    // allocate IMGUI memory for 100 integer values.
    ImVector<int> Values;
    Values.resize(100);

    // This will shutdown IMGUI, thus with enabled tracking an Error is thrown.
    pGUI->drop();

    CHECK(std::string::npos == ErrorString.str().find("{IrrIMGUI} There are 1 allocated memory blocks that have not been deallocated so far!"));
  }

  {
    ErrorString.str("");
    Settings.mIsIMGUIMemoryAllocationTrackingEnabled = false;

    IIMGUIHandle * const pGUI = createIMGUI(pDevice, nullptr, &Settings);

    Settings.mIsIMGUIMemoryAllocationTrackingEnabled = true;

    pGUI->setSettings(Settings);

    // allocate IMGUI memory for 100 integer values.
    ImVector<int> Values;
    Values.resize(100);

    // This will shutdown IMGUI, thus with enabled tracking an Error is thrown.
    pGUI->drop();

    CHECK(std::string::npos != ErrorString.str().find("{IrrIMGUI} There are 1 allocated memory blocks that have not been deallocated so far!"));
  }

  pDevice->drop();

  return;
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>org.gradle.api.reporting.dependencies (Gradle API 2.2.1)</title>
<meta name="keywords" content="org.gradle.api.reporting.dependencies package">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" title="Style">
<link href="../../../../../groovy.ico" type="image/x-icon" rel="shortcut icon">
<link href="../../../../../groovy.ico" type="image/x-icon" rel="icon">

Overview

Package

Class

Deprecated

Index

Help

Frames

No Frames

Package org.gradle.api.reporting.dependencies

 Types responsible for generating dependency reports.

Interface Summary

                        Interface
                        Description

                                    DependencyReportContainer

                            The set of reports that can be generated by the HtmlDependencyReportTask task type.

Class Summary

                        Class
                        Description

                                    HtmlDependencyReportTask

                            Generates an HTML dependency report.

Overview

Package

Class

Deprecated

Index

Help

Frames

No Frames

Gradle API 2.2.1


text:
package org.firstinspires.ftc.team7316.modes;

import org.firstinspires.ftc.team7316.util.Loopable;
import org.firstinspires.ftc.team7316.util.Scheduler;

/**
 * Used for those autonomodes that have a single command (basically a lot of files)
 * It takes in a command in the constructor.
 */
public abstract class CommandAuto extends BaseOpMode {

    protected abstract Loopable getTask();

    @Override
    public void init() {
        super.init();
        Scheduler.instance.addTask(getTask());
    }

    @Override
    public void onInit() { // Make the classes more compact

    }

    @Override
    public void onLoop() {

    }

}


text:
<!doctype html>

  <title>video.src - reflection test</title>

spec reference

  <video id="video" src="foo">
   <source src="barbaz" />
  </video>


text:
{# Import the theme's layout. #}
{% extends "!layout.html" %}

{%- set header_title = '' %}
{%- set header_title_key = 'header_title' %}
{%- set header_subtitle = '' %}
{%- set header_subtitle_key = 'header_subtitle' %}
{%- set launchpage = '' %}
{%- set launchpage_key = 'launchpage' %}
{%- if meta is defined %}
    {%- if header_title_key in meta.keys() %}
        {%- set header_title = meta.get(header_title_key) %}
    {%- endif %}
    {%- if header_subtitle_key in meta.keys() %}
        {%- set header_subtitle = meta.get(header_subtitle_key) %}
    {%- endif %}
    {%- if launchpage_key in meta.keys() %}
        {%- set launchpage = 'ENABLE' %}
    {%- endif %}
{%- endif %}

{# Custom CSS overrides #}
{% set css_files = css_files + ['_static/bounca.css'] %}

{%- block extrahead %}
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="BounCA let your create a PKI, sign and revoke server and client X.509 v3 SSL certificates with an easy to use web interface.">
    <meta name=keywords content="OpenSSL, PKI, X509, SSL, PKCS12, PEM, Certificate, Key, Root Authority, Certificate Authority, Security, Encryption, Authorisation, Authentications">
    <meta name="author" content="Repleo, Jeroen Arnoldus <jeroen@repleo.nl>">

    <meta itemprop="name" content="BounCA.org - Personal Key Management">
    <meta itemprop="description" content="BounCA let your create a PKI, sign and revoke server and client X.509 v3 SSL certificates with an easy to use web interface.">
    <meta itemprop="image" content="https://www.bounca.org/_images/BounCA-logo.png">

    <meta name="twitter:card" value="summary">
    <meta name="twitter:site" content="@gobounca">
    <meta name="twitter:creator" content="@repleo_sw">
    <meta name="twitter:image" content="https://www.bounca.org/_images/BounCA-logo.png">
    <meta name="twitter:title" content="BounCA.org - Personal Key Management">
    <meta name="twitter:description" content="BounCA let your create a PKI, sign and revoke server and client X.509 v3 SSL certificates with an easy to use web interface.">

    <meta property="og:title" content="BounCA.org - Personal Key Management" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="https://www.bounca.org" />
    <meta property="og:image" content="https://www.bounca.org/_images/BounCA-logo.png" />
    <meta property="og:description" content="BounCA let your create a PKI, sign and revoke server and client X.509 v3 SSL certificates with an easy to use web interface." />
    <meta property="og:site_name" content="BounCA" />

    <link rel="apple-touch-icon" sizes="57x57" href="/_images/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/_images/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/_images/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/_images/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/_images/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/_images/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/_images/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/_images/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/_images/apple-touch-icon-180x180.png">
    <link rel="icon" type="image/png" href="/_images/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="/_images/android-chrome-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="/_images/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="/_images/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="/_images/manifest.json">
    <link rel="mask-icon" href="/_images/safari-pinned-tab.svg" color="#5bbad5">
    <link rel="shortcut icon" href="/_images/favicon.ico">
    <meta name="msapplication-TileColor" content="#da532c">
    <meta name="msapplication-TileImage" content="/_images/mstile-144x144.png">
    <meta name="msapplication-config" content="/_images/browserconfig.xml">
    <meta name="theme-color" content="#ffffff">
{{ super () }}
{% endblock %}

{% block content %}
{%- if header_title %}

        <form action="https://www.paypal.com/donate" method="post" target="_top" align="right">
            <input type="hidden" name="hosted_button_id" value="5C4W8F7XYQDZ4" />
            <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />

        </form>

{{ header_title }}

{{ header_subtitle }}

{%  endif %}
{%- if launchpage %}
    {% include "launchpage.html" %}
{%  endif %}
{{ super() }}
{% endblock %}

{% block footer %}

              Back to top
              {% if theme_source_link_position == "footer" %}

                {% include "sourcelink.html" %}
              {% endif %}

Home

GitLab

Contribute?

Share on:

Twitter

Follow us:

@gobounca

Designed and built by Repleo.

Code licensed Apache 2.0, docs CC BY 4.0.

		    {%- if last_updated %}
		      {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}

		    {%- endif %}

{% endblock %}


text:
package org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.fpga;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.curator.shaded.com.google.common.collect.Lists;
import org.apache.hadoop.fs.Path;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

public class TestIntelFpgaOpenclPlugin {
  private IntelFpgaOpenclPlugin plugin;

  @Before
  public void setup() {
    plugin = new IntelFpgaOpenclPlugin();
  }

  @Test
  public void testLocalizedIPfileFound() {
    Map<Path, List<String>> resources = createResources();

    String path = plugin.retrieveIPfilePath("fpga", "workDir", resources);

    assertEquals("Retrieved IP file path", "/test/fpga.aocx", path);
  }

  @Test
  public void testLocalizedIPfileNotFound() {
    Map<Path, List<String>> resources = createResources();

    String path = plugin.retrieveIPfilePath("dummy", "workDir", resources);

    assertNull("Retrieved IP file path", path);
  }

  @Test
  public void testLocalizedIpfileNotFoundWithNoLocalResources() {
    String path = plugin.retrieveIPfilePath("fpga", "workDir", null);

    assertNull("Retrieved IP file path", path);
  }

  @Test
  public void testIPfileNotDefined() {
    Map<Path, List<String>> resources = createResources();

    String path = plugin.retrieveIPfilePath(null, "workDir", resources);

    assertNull("Retrieved IP file path", path);
  }

  private Map<Path, List<String>> createResources() {
    Map<Path, List<String>> resources = new HashMap<>();
    resources.put(new Path("/test/fpga.aocx"),
        Lists.newArrayList("/symlinked/fpga.aocx"));
    return resources;
  }
}


text:
<?php

namespace PhpOffice\PhpSpreadsheet\Worksheet;

use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;

class ColumnCellIterator extends CellIterator
{
    /**
     * Current iterator position.
     *
     * @var int
     */
    private $currentRow;

    /**
     * Column index.
     *
     * @var string
     */
    private $columnIndex;

    /**
     * Start position.
     *
     * @var int
     */
    private $startRow = 1;

    /**
     * End position.
     *
     * @var int
     */
    private $endRow = 1;

    /**
     * Create a new row iterator.
     *
     * @param Worksheet $subject The worksheet to iterate over
     * @param string $columnIndex The column that we want to iterate
     * @param int $startRow The row number at which to start iterating
     * @param int $endRow Optionally, the row number at which to stop iterating
     */
    public function __construct(Worksheet $subject = null, $columnIndex = 'A', $startRow = 1, $endRow = null)
    {
        // Set subject
        $this->worksheet = $subject;
        $this->columnIndex = Coordinate::columnIndexFromString($columnIndex);
        $this->resetEnd($endRow);
        $this->resetStart($startRow);
    }

    /**
     * (Re)Set the start row and the current row pointer.
     *
     * @param int $startRow The row number at which to start iterating
     *
     * @throws PhpSpreadsheetException
     *
     * @return ColumnCellIterator
     */
    public function resetStart($startRow = 1)
    {
        $this->startRow = $startRow;
        $this->adjustForExistingOnlyRange();
        $this->seek($startRow);

        return $this;
    }

    /**
     * (Re)Set the end row.
     *
     * @param int $endRow The row number at which to stop iterating
     *
     * @throws PhpSpreadsheetException
     *
     * @return ColumnCellIterator
     */
    public function resetEnd($endRow = null)
    {
        $this->endRow = ($endRow) ? $endRow : $this->worksheet->getHighestRow();
        $this->adjustForExistingOnlyRange();

        return $this;
    }

    /**
     * Set the row pointer to the selected row.
     *
     * @param int $row The row number to set the current pointer at
     *
     * @throws PhpSpreadsheetException
     *
     * @return ColumnCellIterator
     */
    public function seek($row = 1)
    {
        if (($row < $this->startRow) || ($row > $this->endRow)) {
            throw new PhpSpreadsheetException("Row $row is out of range ({$this->startRow} - {$this->endRow})");
        } elseif ($this->onlyExistingCells && !($this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $row))) {
            throw new PhpSpreadsheetException('In "IterateOnlyExistingCells" mode and Cell does not exist');
        }
        $this->currentRow = $row;

        return $this;
    }

    /**
     * Rewind the iterator to the starting row.
     */
    public function rewind()
    {
        $this->currentRow = $this->startRow;
    }

    /**
     * Return the current cell in this worksheet column.
     *
     * @return null|\PhpOffice\PhpSpreadsheet\Cell\Cell
     */
    public function current()
    {
        return $this->worksheet->getCellByColumnAndRow($this->columnIndex, $this->currentRow);
    }

    /**
     * Return the current iterator key.
     *
     * @return int
     */
    public function key()
    {
        return $this->currentRow;
    }

    /**
     * Set the iterator to its next value.
     */
    public function next()
    {
        do {
            ++$this->currentRow;
        } while (($this->onlyExistingCells) &&
            (!$this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $this->currentRow)) &&
            ($this->currentRow <= $this->endRow));
    }

    /**
     * Set the iterator to its previous value.
     */
    public function prev()
    {
        if ($this->currentRow <= $this->startRow) {
            throw new PhpSpreadsheetException("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
        }

        do {
            --$this->currentRow;
        } while (($this->onlyExistingCells) &&
            (!$this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $this->currentRow)) &&
            ($this->currentRow >= $this->startRow));
    }

    /**
     * Indicate if more rows exist in the worksheet range of rows that we're iterating.
     *
     * @return bool
     */
    public function valid()
    {
        return $this->currentRow <= $this->endRow;
    }

    /**
     * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
     *
     * @throws PhpSpreadsheetException
     */
    protected function adjustForExistingOnlyRange()
    {
        if ($this->onlyExistingCells) {
            while ((!$this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $this->startRow)) &&
                ($this->startRow <= $this->endRow)) {
                ++$this->startRow;
            }
            if ($this->startRow > $this->endRow) {
                throw new PhpSpreadsheetException('No cells exist within the specified range');
            }
            while ((!$this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $this->endRow)) &&
                ($this->endRow >= $this->startRow)) {
                --$this->endRow;
            }
            if ($this->endRow < $this->startRow) {
                throw new PhpSpreadsheetException('No cells exist within the specified range');
            }
        }
    }
}


text:
(function(){

// header 上に吸着
var headerLayer = new Layer( new Stage( 640, 80 ) );
headerLayer.verticalAlign = "top";
headerLayer.scaleMode = "showAll";

// content 多少端が切れてもいいデザインで、必ず表示したいものは中央に寄せる
var contentLayer = new Layer(  new Stage( 300, 300 )  );
contentLayer.verticalAlign = "middle";
contentLayer.scaleMode = Layer.SCALE_NO_BORDER;

// header 下に吸着
var footerLayer = new Layer( new Stage( 640, 80 ) );
footerLayer.verticalAlign = "bottom";
footerLayer.scaleMode = "showAll";

//
window.addLayer( contentLayer );
window.addLayer( footerLayer );
window.addLayer( headerLayer );

//

//
var header = new TextField();
header.width = 640;
header.height = 80;
header.background = true;
header.backgroundColor = 0x0;
header.defaultTextFormat = new TextFormat( null, 30, 0xffffff );
header.text = "header";
header.alpha = 0.7;
headerLayer.content.addChild( header );

//
var image = new Image();
image.src = "assets/images/image.png";
image.onload = function() {
	contentLayer.verticalAlign = "middle";
	contentLayer.scaleMode = "noBorder";
    contentLayer.content.addChild( new Bitmap( new BitmapData( image ) ) );
}

//
var footer = new TextField();
footer.width = 640;
footer.height = 80;
footer.background = true;
footer.backgroundColor = 0x0;
footer.defaultTextFormat = new TextFormat( null, 30, 0xffffff );
footer.text = "footer";
footer.alpha = 0.7;
footerLayer.content.addChild( footer );

})();


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Interface net.jini.admin.JoinAdmin (River-Internet vtrunk API Documentation)</title>
<meta name="date" content="2016-03-28">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
net.jini.admin.JoinAdmin

Packages that use JoinAdmin

Package
Description

org.apache.river.fiddler

Provides the server side of an implementation of the lookup discovery service
(see LookupDiscoveryService).

org.apache.river.mercury

Provides implementations of the
EventMailbox service.

org.apache.river.outrigger

This is an implementation of a JavaSpaces technology-enabled service.

Uses of JoinAdmin in org.apache.river.fiddler

Subinterfaces of JoinAdmin in org.apache.river.fiddler

Modifier and Type
Interface and Description

interface
FiddlerAdmin

An administrative interface for the Fiddler implementation of the
 lookup discovery service (see Fiddler).

Uses of JoinAdmin in org.apache.river.mercury

Subinterfaces of JoinAdmin in org.apache.river.mercury

Modifier and Type
Interface and Description

interface
MailboxAdmin

An administrative interface for the mercury implementation
 of the event mailbox service.

Uses of JoinAdmin in org.apache.river.outrigger

Subinterfaces of JoinAdmin in org.apache.river.outrigger

Modifier and Type
Interface and Description

interface
ConstrainableJavaSpaceAdmin

Deprecated.

The JavaSpace05.contents
             method can be used to view the space's contents.

interface
JavaSpaceAdmin

Deprecated.

Invoke the JoinAdmin and DestroyAdmin methods though those interfaces.  A view
             of the space contents can be obtained through the
             JavaSpace05.contents
             method.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.


text:
package example.burden;

import hobby.wei.c.anno.proguard.Burden;

/**
 * @author Wei Chou(weichou2010@gmail.com)
 * @version 1.0, 25/04/2017
 * @see example.Synthetic
 */
public class L {
    /**
     * When be annotated with {@link Burden}, this method will be deleted on proguard task,
     * and the string literal parameters which are not referenced in any other kept fields will be deleted from
     * jar/dex (but this takes some skill, details see {@link Burden}).
     * Note: if the method's return-type is not "void", otherwise.
     * <p>
     * 当方法被{@link Burden}标注,则会在混淆任务中被删除,同时参数中如果用到了字符串[字面量],
     * 但没有被其它任何未删除的变量引用,也会最终从jar/dex中被彻底删除(但这需要一些技巧,详见{@link Burden}文档)。
     * 注意:如果本方法的返回值不是"void", 则不会应用上述规则。
     *
     * @param o    log tag.
     * @param s    formatted string literal.
     * @param args format args.
     */
    @Burden
    public static void i(Object o, String s, Object... args) {
        checkArgs(args);
        Log.i(TAG(o), String.format(s, args));
    }

    // mock from some SDK
    public static class Log {
        static void i(String tag, String msg) {
            // print
        }
    }

    @Burden
    private static String TAG(Object o) {
        final String prefix = "prefix-";
        if (o instanceof String) return prefix + o;
        if (o instanceof Class) return prefix + ((Class<?>) o).getSimpleName();
        return prefix + o.getClass().getSimpleName();
    }

    @Burden
    public static S s(String s) {
        return S.obtain(s);
    }

    public static class S {
        public static S obtain(String s) {
            final S wrapper = null/*some codes wrap String s.*/;
            return wrapper;
        }
    }

    @Burden
    private static void checkArgs(Object... args) {
        if (args != null && args.length > 0) {
            for (Object o : args) {
                if (o instanceof String) throw new IllegalArgumentException("must use L.s(s) instead.");
            }
        }
    }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.operator.scalar;

import com.facebook.presto.annotation.UsedByGeneratedCode;
import com.facebook.presto.bytecode.BytecodeBlock;
import com.facebook.presto.bytecode.BytecodeNode;
import com.facebook.presto.bytecode.ClassDefinition;
import com.facebook.presto.bytecode.MethodDefinition;
import com.facebook.presto.bytecode.Parameter;
import com.facebook.presto.bytecode.Scope;
import com.facebook.presto.bytecode.Variable;
import com.facebook.presto.bytecode.control.ForLoop;
import com.facebook.presto.bytecode.control.IfStatement;
import com.facebook.presto.common.PageBuilder;
import com.facebook.presto.common.QualifiedObjectName;
import com.facebook.presto.common.block.Block;
import com.facebook.presto.common.block.BlockBuilder;
import com.facebook.presto.common.type.MapType;
import com.facebook.presto.common.type.StandardTypes;
import com.facebook.presto.common.type.Type;
import com.facebook.presto.common.type.TypeSignatureParameter;
import com.facebook.presto.metadata.BoundVariables;
import com.facebook.presto.metadata.FunctionAndTypeManager;
import com.facebook.presto.metadata.SqlScalarFunction;
import com.facebook.presto.spi.function.FunctionKind;
import com.facebook.presto.spi.function.Signature;
import com.facebook.presto.spi.function.SqlFunctionVisibility;
import com.facebook.presto.sql.gen.CallSiteBinder;
import com.facebook.presto.sql.gen.SqlTypeBytecodeExpression;
import com.facebook.presto.sql.gen.lambda.BinaryFunctionInterface;
import com.google.common.collect.ImmutableList;
import com.google.common.primitives.Primitives;

import java.lang.invoke.MethodHandle;
import java.util.Optional;

import static com.facebook.presto.bytecode.Access.FINAL;
import static com.facebook.presto.bytecode.Access.PRIVATE;
import static com.facebook.presto.bytecode.Access.PUBLIC;
import static com.facebook.presto.bytecode.Access.STATIC;
import static com.facebook.presto.bytecode.Access.a;
import static com.facebook.presto.bytecode.Parameter.arg;
import static com.facebook.presto.bytecode.ParameterizedType.type;
import static com.facebook.presto.bytecode.expression.BytecodeExpressions.add;
import static com.facebook.presto.bytecode.expression.BytecodeExpressions.and;
import static com.facebook.presto.bytecode.expression.BytecodeExpressions.constantInt;
import static com.facebook.presto.bytecode.expression.BytecodeExpressions.constantNull;
import static com.facebook.presto.bytecode.expression.BytecodeExpressions.lessThan;
import static com.facebook.presto.bytecode.expression.BytecodeExpressions.notEqual;
import static com.facebook.presto.bytecode.expression.BytecodeExpressions.subtract;
import static com.facebook.presto.bytecode.instruction.VariableInstruction.incrementVariable;
import static com.facebook.presto.common.type.TypeSignature.parseTypeSignature;
import static com.facebook.presto.metadata.BuiltInTypeAndFunctionNamespaceManager.DEFAULT_NAMESPACE;
import static com.facebook.presto.operator.scalar.BuiltInScalarFunctionImplementation.ArgumentProperty.functionTypeArgumentProperty;
import static com.facebook.presto.operator.scalar.BuiltInScalarFunctionImplementation.ArgumentProperty.valueTypeArgumentProperty;
import static com.facebook.presto.operator.scalar.BuiltInScalarFunctionImplementation.NullConvention.RETURN_NULL_ON_NULL;
import static com.facebook.presto.spi.function.Signature.typeVariable;
import static com.facebook.presto.sql.gen.SqlTypeBytecodeExpression.constantType;
import static com.facebook.presto.type.UnknownType.UNKNOWN;
import static com.facebook.presto.util.CompilerUtils.defineClass;
import static com.facebook.presto.util.CompilerUtils.makeClassName;
import static com.facebook.presto.util.Reflection.methodHandle;

public final class MapFilterFunction
        extends SqlScalarFunction
{
    public static final MapFilterFunction MAP_FILTER_FUNCTION = new MapFilterFunction();
    private static final MethodHandle STATE_FACTORY = methodHandle(MapFilterFunction.class, "createState", MapType.class);

    private MapFilterFunction()
    {
        super(new Signature(
                QualifiedObjectName.valueOf(DEFAULT_NAMESPACE, "map_filter"),
                FunctionKind.SCALAR,
                ImmutableList.of(typeVariable("K"), typeVariable("V")),
                ImmutableList.of(),
                parseTypeSignature("map(K,V)"),
                ImmutableList.of(parseTypeSignature("map(K,V)"), parseTypeSignature("function(K,V,boolean)")),
                false));
    }

    @Override
    public SqlFunctionVisibility getVisibility()
    {
        return SqlFunctionVisibility.PUBLIC;
    }

    @Override
    public boolean isDeterministic()
    {
        return false;
    }

    @Override
    public String getDescription()
    {
        return "return map containing entries that match the given predicate";
    }

    @Override
    public BuiltInScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, FunctionAndTypeManager functionAndTypeManager)
    {
        Type keyType = boundVariables.getTypeVariable("K");
        Type valueType = boundVariables.getTypeVariable("V");
        MapType mapType = (MapType) functionAndTypeManager.getParameterizedType(StandardTypes.MAP, ImmutableList.of(
                TypeSignatureParameter.of(keyType.getTypeSignature()),
                TypeSignatureParameter.of(valueType.getTypeSignature())));
        return new BuiltInScalarFunctionImplementation(
                false,
                ImmutableList.of(
                        valueTypeArgumentProperty(RETURN_NULL_ON_NULL),
                        functionTypeArgumentProperty(BinaryFunctionInterface.class)),
                generateFilter(mapType),
                Optional.of(STATE_FACTORY.bindTo(mapType)));
    }

    @UsedByGeneratedCode
    public static Object createState(MapType mapType)
    {
        return new PageBuilder(ImmutableList.of(mapType));
    }

    private static MethodHandle generateFilter(MapType mapType)
    {
        CallSiteBinder binder = new CallSiteBinder();
        Type keyType = mapType.getKeyType();
        Type valueType = mapType.getValueType();
        Class<?> keyJavaType = Primitives.wrap(keyType.getJavaType());
        Class<?> valueJavaType = Primitives.wrap(valueType.getJavaType());

        ClassDefinition definition = new ClassDefinition(
                a(PUBLIC, FINAL),
                makeClassName("MapFilter"),
                type(Object.class));
        definition.declareDefaultConstructor(a(PRIVATE));

        Parameter state = arg("state", Object.class);
        Parameter block = arg("block", Block.class);
        Parameter function = arg("function", BinaryFunctionInterface.class);
        MethodDefinition method = definition.declareMethod(
                a(PUBLIC, STATIC),
                "filter",
                type(Block.class),
                ImmutableList.of(state, block, function));

        BytecodeBlock body = method.getBody();
        Scope scope = method.getScope();
        Variable positionCount = scope.declareVariable(int.class, "positionCount");
        Variable position = scope.declareVariable(int.class, "position");
        Variable pageBuilder = scope.declareVariable(PageBuilder.class, "pageBuilder");
        Variable mapBlockBuilder = scope.declareVariable(BlockBuilder.class, "mapBlockBuilder");
        Variable singleMapBlockWriter = scope.declareVariable(BlockBuilder.class, "singleMapBlockWriter");
        Variable keyElement = scope.declareVariable(keyJavaType, "keyElement");
        Variable valueElement = scope.declareVariable(valueJavaType, "valueElement");
        Variable keep = scope.declareVariable(Boolean.class, "keep");

        // invoke block.getPositionCount()
        body.append(positionCount.set(block.invoke("getPositionCount", int.class)));

        // prepare the single map block builder
        body.append(pageBuilder.set(state.cast(PageBuilder.class)));
        body.append(new IfStatement()
                .condition(pageBuilder.invoke("isFull", boolean.class))
                .ifTrue(pageBuilder.invoke("reset", void.class)));
        body.append(mapBlockBuilder.set(pageBuilder.invoke("getBlockBuilder", BlockBuilder.class, constantInt(0))));
        body.append(singleMapBlockWriter.set(mapBlockBuilder.invoke("beginBlockEntry", BlockBuilder.class)));

        SqlTypeBytecodeExpression keySqlType = constantType(binder, keyType);
        BytecodeNode loadKeyElement;
        if (!keyType.equals(UNKNOWN)) {
            // key element must be non-null
            loadKeyElement = new BytecodeBlock().append(keyElement.set(keySqlType.getValue(block, position).cast(keyJavaType)));
        }
        else {
            loadKeyElement = new BytecodeBlock().append(keyElement.set(constantNull(keyJavaType)));
        }

        SqlTypeBytecodeExpression valueSqlType = constantType(binder, valueType);
        BytecodeNode loadValueElement;
        if (!valueType.equals(UNKNOWN)) {
            loadValueElement = new IfStatement()
                    .condition(block.invoke("isNull", boolean.class, add(position, constantInt(1))))
                    .ifTrue(valueElement.set(constantNull(valueJavaType)))
                    .ifFalse(valueElement.set(valueSqlType.getValue(block, add(position, constantInt(1))).cast(valueJavaType)));
        }
        else {
            loadValueElement = new BytecodeBlock().append(valueElement.set(constantNull(valueJavaType)));
        }

        body.append(new ForLoop()
                .initialize(position.set(constantInt(0)))
                .condition(lessThan(position, positionCount))
                .update(incrementVariable(position, (byte) 2))
                .body(new BytecodeBlock()
                        .append(loadKeyElement)
                        .append(loadValueElement)
                        .append(keep.set(function.invoke("apply", Object.class, keyElement.cast(Object.class), valueElement.cast(Object.class)).cast(Boolean.class)))
                        .append(new IfStatement("if (keep != null && keep) ...")
                                .condition(and(notEqual(keep, constantNull(Boolean.class)), keep.cast(boolean.class)))
                                .ifTrue(new BytecodeBlock()
                                        .append(keySqlType.invoke("appendTo", void.class, block, position, singleMapBlockWriter))
                                        .append(valueSqlType.invoke("appendTo", void.class, block, add(position, constantInt(1)), singleMapBlockWriter))))));

        body.append(mapBlockBuilder
                .invoke("closeEntry", BlockBuilder.class)
                .pop());
        body.append(pageBuilder.invoke("declarePosition", void.class));
        body.append(constantType(binder, mapType)
                .invoke(
                        "getObject",
                        Object.class,
                        mapBlockBuilder.cast(Block.class),
                        subtract(mapBlockBuilder.invoke("getPositionCount", int.class), constantInt(1)))
                .ret());

        Class<?> generatedClass = defineClass(definition, Object.class, binder.getBindings(), MapFilterFunction.class.getClassLoader());
        return methodHandle(generatedClass, "filter", Object.class, Block.class, BinaryFunctionInterface.class);
    }
}


text:
package ssh

import (
	"bytes"
	"crypto"
	"crypto/dsa"
	"crypto/ecdsa"
	"crypto/elliptic"
	"crypto/rsa"
	"crypto/x509"
	"encoding/asn1"
	"encoding/base64"
	"encoding/pem"
	"errors"
	"fmt"
	"io"
	"math/big"
	"strings"

	"golang.org/x/crypto/ed25519"
)

// These constants represent the algorithm names for key types supported by this
// package.
const (
	KeyAlgoRSA      = "ssh-rsa"
	KeyAlgoDSA      = "ssh-dss"
	KeyAlgoECDSA256 = "ecdsa-sha2-nistp256"
	KeyAlgoECDSA384 = "ecdsa-sha2-nistp384"
	KeyAlgoECDSA521 = "ecdsa-sha2-nistp521"
	KeyAlgoED25519  = "ssh-ed25519"
)

// parsePubKey parses a public key of the given algorithm.
// Use ParsePublicKey for keys with prepended algorithm.
func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err error) {
	switch algo {
	case KeyAlgoRSA:
		return parseRSA(in)
	case KeyAlgoDSA:
		return parseDSA(in)
	case KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521:
		return parseECDSA(in)
	case KeyAlgoED25519:
		return parseED25519(in)
	case CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01:
		cert, err := parseCert(in, certToPrivAlgo(algo))
		if err != nil {
			return nil, nil, err
		}
		return cert, nil, nil
	}
	return nil, nil, fmt.Errorf("ssh: unknown key algorithm: %v", algo)
}

// parseAuthorizedKey parses a public key in OpenSSH authorized_keys format
// (see sshd(8) manual page) once the options and key type fields have been
// removed.
func parseAuthorizedKey(in []byte) (out PublicKey, comment string, err error) {
	in = bytes.TrimSpace(in)

	i := bytes.IndexAny(in, " \t")
	if i == -1 {
		i = len(in)
	}
	base64Key := in[:i]

	key := make([]byte, base64.StdEncoding.DecodedLen(len(base64Key)))
	n, err := base64.StdEncoding.Decode(key, base64Key)
	if err != nil {
		return nil, "", err
	}
	key = key[:n]
	out, err = ParsePublicKey(key)
	if err != nil {
		return nil, "", err
	}
	comment = string(bytes.TrimSpace(in[i:]))
	return out, comment, nil
}

// ParseKnownHosts parses an entry in the format of the known_hosts file.
//
// The known_hosts format is documented in the sshd(8) manual page. This
// function will parse a single entry from in. On successful return, marker
// will contain the optional marker value (i.e. "cert-authority" or "revoked")
// or else be empty, hosts will contain the hosts that this entry matches,
// pubKey will contain the public key and comment will contain any trailing
// comment at the end of the line. See the sshd(8) manual page for the various
// forms that a host string can take.
//
// The unparsed remainder of the input will be returned in rest. This function
// can be called repeatedly to parse multiple entries.
//
// If no entries were found in the input then err will be io.EOF. Otherwise a
// non-nil err value indicates a parse error.
func ParseKnownHosts(in []byte) (marker string, hosts []string, pubKey PublicKey, comment string, rest []byte, err error) {
	for len(in) > 0 {
		end := bytes.IndexByte(in, '\n')
		if end != -1 {
			rest = in[end+1:]
			in = in[:end]
		} else {
			rest = nil
		}

		end = bytes.IndexByte(in, '\r')
		if end != -1 {
			in = in[:end]
		}

		in = bytes.TrimSpace(in)
		if len(in) == 0 || in[0] == '#' {
			in = rest
			continue
		}

		i := bytes.IndexAny(in, " \t")
		if i == -1 {
			in = rest
			continue
		}

		// Strip out the beginning of the known_host key.
		// This is either an optional marker or a (set of) hostname(s).
		keyFields := bytes.Fields(in)
		if len(keyFields) < 3 || len(keyFields) > 5 {
			return "", nil, nil, "", nil, errors.New("ssh: invalid entry in known_hosts data")
		}

		// keyFields[0] is either "@cert-authority", "@revoked" or a comma separated
		// list of hosts
		marker := ""
		if keyFields[0][0] == '@' {
			marker = string(keyFields[0][1:])
			keyFields = keyFields[1:]
		}

		hosts := string(keyFields[0])
		// keyFields[1] contains the key type (e.g. "ssh-rsa").
		// However, that information is duplicated inside the
		// base64-encoded key and so is ignored here.

		key := bytes.Join(keyFields[2:], []byte(" "))
		if pubKey, comment, err = parseAuthorizedKey(key); err != nil {
			return "", nil, nil, "", nil, err
		}

		return marker, strings.Split(hosts, ","), pubKey, comment, rest, nil
	}

	return "", nil, nil, "", nil, io.EOF
}

// ParseAuthorizedKeys parses a public key from an authorized_keys
// file used in OpenSSH according to the sshd(8) manual page.
func ParseAuthorizedKey(in []byte) (out PublicKey, comment string, options []string, rest []byte, err error) {
	for len(in) > 0 {
		end := bytes.IndexByte(in, '\n')
		if end != -1 {
			rest = in[end+1:]
			in = in[:end]
		} else {
			rest = nil
		}

		end = bytes.IndexByte(in, '\r')
		if end != -1 {
			in = in[:end]
		}

		in = bytes.TrimSpace(in)
		if len(in) == 0 || in[0] == '#' {
			in = rest
			continue
		}

		i := bytes.IndexAny(in, " \t")
		if i == -1 {
			in = rest
			continue
		}

		if out, comment, err = parseAuthorizedKey(in[i:]); err == nil {
			return out, comment, options, rest, nil
		}

		// No key type recognised. Maybe there's an options field at
		// the beginning.
		var b byte
		inQuote := false
		var candidateOptions []string
		optionStart := 0
		for i, b = range in {
			isEnd := !inQuote && (b == ' ' || b == '\t')
			if (b == ',' && !inQuote) || isEnd {
				if i-optionStart > 0 {
					candidateOptions = append(candidateOptions, string(in[optionStart:i]))
				}
				optionStart = i + 1
			}
			if isEnd {
				break
			}
			if b == '"' && (i == 0 || (i > 0 && in[i-1] != '\\')) {
				inQuote = !inQuote
			}
		}
		for i < len(in) && (in[i] == ' ' || in[i] == '\t') {
			i++
		}
		if i == len(in) {
			// Invalid line: unmatched quote
			in = rest
			continue
		}

		in = in[i:]
		i = bytes.IndexAny(in, " \t")
		if i == -1 {
			in = rest
			continue
		}

		if out, comment, err = parseAuthorizedKey(in[i:]); err == nil {
			options = candidateOptions
			return out, comment, options, rest, nil
		}

		in = rest
		continue
	}

	return nil, "", nil, nil, errors.New("ssh: no key found")
}

// ParsePublicKey parses an SSH public key formatted for use in
// the SSH wire protocol according to RFC 4253, section 6.6.
func ParsePublicKey(in []byte) (out PublicKey, err error) {
	algo, in, ok := parseString(in)
	if !ok {
		return nil, errShortRead
	}
	var rest []byte
	out, rest, err = parsePubKey(in, string(algo))
	if len(rest) > 0 {
		return nil, errors.New("ssh: trailing junk in public key")
	}

	return out, err
}

// MarshalAuthorizedKey serializes key for inclusion in an OpenSSH
// authorized_keys file. The return value ends with newline.
func MarshalAuthorizedKey(key PublicKey) []byte {
	b := &bytes.Buffer{}
	b.WriteString(key.Type())
	b.WriteByte(' ')
	e := base64.NewEncoder(base64.StdEncoding, b)
	e.Write(key.Marshal())
	e.Close()
	b.WriteByte('\n')
	return b.Bytes()
}

// PublicKey is an abstraction of different types of public keys.
type PublicKey interface {
	// Type returns the key's type, e.g. "ssh-rsa".
	Type() string

	// Marshal returns the serialized key data in SSH wire format,
	// with the name prefix.
	Marshal() []byte

	// Verify that sig is a signature on the given data using this
	// key. This function will hash the data appropriately first.
	Verify(data []byte, sig *Signature) error
}

// CryptoPublicKey, if implemented by a PublicKey,
// returns the underlying crypto.PublicKey form of the key.
type CryptoPublicKey interface {
	CryptoPublicKey() crypto.PublicKey
}

// A Signer can create signatures that verify against a public key.
type Signer interface {
	// PublicKey returns an associated PublicKey instance.
	PublicKey() PublicKey

	// Sign returns raw signature for the given data. This method
	// will apply the hash specified for the keytype to the data.
	Sign(rand io.Reader, data []byte) (*Signature, error)
}

type rsaPublicKey rsa.PublicKey

func (r *rsaPublicKey) Type() string {
	return "ssh-rsa"
}

// parseRSA parses an RSA key according to RFC 4253, section 6.6.
func parseRSA(in []byte) (out PublicKey, rest []byte, err error) {
	var w struct {
		E    *big.Int
		N    *big.Int
		Rest []byte `ssh:"rest"`
	}
	if err := Unmarshal(in, &w); err != nil {
		return nil, nil, err
	}

	if w.E.BitLen() > 24 {
		return nil, nil, errors.New("ssh: exponent too large")
	}
	e := w.E.Int64()
	if e < 3 || e&1 == 0 {
		return nil, nil, errors.New("ssh: incorrect exponent")
	}

	var key rsa.PublicKey
	key.E = int(e)
	key.N = w.N
	return (*rsaPublicKey)(&key), w.Rest, nil
}

func (r *rsaPublicKey) Marshal() []byte {
	e := new(big.Int).SetInt64(int64(r.E))
	// RSA publickey struct layout should match the struct used by
	// parseRSACert in the x/crypto/ssh/agent package.
	wirekey := struct {
		Name string
		E    *big.Int
		N    *big.Int
	}{
		KeyAlgoRSA,
		e,
		r.N,
	}
	return Marshal(&wirekey)
}

func (r *rsaPublicKey) Verify(data []byte, sig *Signature) error {
	if sig.Format != r.Type() {
		return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, r.Type())
	}
	h := crypto.SHA1.New()
	h.Write(data)
	digest := h.Sum(nil)
	return rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), crypto.SHA1, digest, sig.Blob)
}

func (r *rsaPublicKey) CryptoPublicKey() crypto.PublicKey {
	return (*rsa.PublicKey)(r)
}

type dsaPublicKey dsa.PublicKey

func (r *dsaPublicKey) Type() string {
	return "ssh-dss"
}

// parseDSA parses an DSA key according to RFC 4253, section 6.6.
func parseDSA(in []byte) (out PublicKey, rest []byte, err error) {
	var w struct {
		P, Q, G, Y *big.Int
		Rest       []byte `ssh:"rest"`
	}
	if err := Unmarshal(in, &w); err != nil {
		return nil, nil, err
	}

	key := &dsaPublicKey{
		Parameters: dsa.Parameters{
			P: w.P,
			Q: w.Q,
			G: w.G,
		},
		Y: w.Y,
	}
	return key, w.Rest, nil
}

func (k *dsaPublicKey) Marshal() []byte {
	// DSA publickey struct layout should match the struct used by
	// parseDSACert in the x/crypto/ssh/agent package.
	w := struct {
		Name       string
		P, Q, G, Y *big.Int
	}{
		k.Type(),
		k.P,
		k.Q,
		k.G,
		k.Y,
	}

	return Marshal(&w)
}

func (k *dsaPublicKey) Verify(data []byte, sig *Signature) error {
	if sig.Format != k.Type() {
		return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type())
	}
	h := crypto.SHA1.New()
	h.Write(data)
	digest := h.Sum(nil)

	// Per RFC 4253, section 6.6,
	// The value for 'dss_signature_blob' is encoded as a string containing
	// r, followed by s (which are 160-bit integers, without lengths or
	// padding, unsigned, and in network byte order).
	// For DSS purposes, sig.Blob should be exactly 40 bytes in length.
	if len(sig.Blob) != 40 {
		return errors.New("ssh: DSA signature parse error")
	}
	r := new(big.Int).SetBytes(sig.Blob[:20])
	s := new(big.Int).SetBytes(sig.Blob[20:])
	if dsa.Verify((*dsa.PublicKey)(k), digest, r, s) {
		return nil
	}
	return errors.New("ssh: signature did not verify")
}

func (k *dsaPublicKey) CryptoPublicKey() crypto.PublicKey {
	return (*dsa.PublicKey)(k)
}

type dsaPrivateKey struct {
	*dsa.PrivateKey
}

func (k *dsaPrivateKey) PublicKey() PublicKey {
	return (*dsaPublicKey)(&k.PrivateKey.PublicKey)
}

func (k *dsaPrivateKey) Sign(rand io.Reader, data []byte) (*Signature, error) {
	h := crypto.SHA1.New()
	h.Write(data)
	digest := h.Sum(nil)
	r, s, err := dsa.Sign(rand, k.PrivateKey, digest)
	if err != nil {
		return nil, err
	}

	sig := make([]byte, 40)
	rb := r.Bytes()
	sb := s.Bytes()

	copy(sig[20-len(rb):20], rb)
	copy(sig[40-len(sb):], sb)

	return &Signature{
		Format: k.PublicKey().Type(),
		Blob:   sig,
	}, nil
}

type ecdsaPublicKey ecdsa.PublicKey

func (key *ecdsaPublicKey) Type() string {
	return "ecdsa-sha2-" + key.nistID()
}

func (key *ecdsaPublicKey) nistID() string {
	switch key.Params().BitSize {
	case 256:
		return "nistp256"
	case 384:
		return "nistp384"
	case 521:
		return "nistp521"
	}
	panic("ssh: unsupported ecdsa key size")
}

type ed25519PublicKey ed25519.PublicKey

func (key ed25519PublicKey) Type() string {
	return KeyAlgoED25519
}

func parseED25519(in []byte) (out PublicKey, rest []byte, err error) {
	var w struct {
		KeyBytes []byte
		Rest     []byte `ssh:"rest"`
	}

	if err := Unmarshal(in, &w); err != nil {
		return nil, nil, err
	}

	key := ed25519.PublicKey(w.KeyBytes)

	return (ed25519PublicKey)(key), w.Rest, nil
}

func (key ed25519PublicKey) Marshal() []byte {
	w := struct {
		Name     string
		KeyBytes []byte
	}{
		KeyAlgoED25519,
		[]byte(key),
	}
	return Marshal(&w)
}

func (key ed25519PublicKey) Verify(b []byte, sig *Signature) error {
	if sig.Format != key.Type() {
		return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, key.Type())
	}

	edKey := (ed25519.PublicKey)(key)
	if ok := ed25519.Verify(edKey, b, sig.Blob); !ok {
		return errors.New("ssh: signature did not verify")
	}

	return nil
}

func (k ed25519PublicKey) CryptoPublicKey() crypto.PublicKey {
	return ed25519.PublicKey(k)
}

func supportedEllipticCurve(curve elliptic.Curve) bool {
	return curve == elliptic.P256() || curve == elliptic.P384() || curve == elliptic.P521()
}

// ecHash returns the hash to match the given elliptic curve, see RFC
// 5656, section 6.2.1
func ecHash(curve elliptic.Curve) crypto.Hash {
	bitSize := curve.Params().BitSize
	switch {
	case bitSize <= 256:
		return crypto.SHA256
	case bitSize <= 384:
		return crypto.SHA384
	}
	return crypto.SHA512
}

// parseECDSA parses an ECDSA key according to RFC 5656, section 3.1.
func parseECDSA(in []byte) (out PublicKey, rest []byte, err error) {
	var w struct {
		Curve    string
		KeyBytes []byte
		Rest     []byte `ssh:"rest"`
	}

	if err := Unmarshal(in, &w); err != nil {
		return nil, nil, err
	}

	key := new(ecdsa.PublicKey)

	switch w.Curve {
	case "nistp256":
		key.Curve = elliptic.P256()
	case "nistp384":
		key.Curve = elliptic.P384()
	case "nistp521":
		key.Curve = elliptic.P521()
	default:
		return nil, nil, errors.New("ssh: unsupported curve")
	}

	key.X, key.Y = elliptic.Unmarshal(key.Curve, w.KeyBytes)
	if key.X == nil || key.Y == nil {
		return nil, nil, errors.New("ssh: invalid curve point")
	}
	return (*ecdsaPublicKey)(key), w.Rest, nil
}

func (key *ecdsaPublicKey) Marshal() []byte {
	// See RFC 5656, section 3.1.
	keyBytes := elliptic.Marshal(key.Curve, key.X, key.Y)
	// ECDSA publickey struct layout should match the struct used by
	// parseECDSACert in the x/crypto/ssh/agent package.
	w := struct {
		Name string
		ID   string
		Key  []byte
	}{
		key.Type(),
		key.nistID(),
		keyBytes,
	}

	return Marshal(&w)
}

func (key *ecdsaPublicKey) Verify(data []byte, sig *Signature) error {
	if sig.Format != key.Type() {
		return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, key.Type())
	}

	h := ecHash(key.Curve).New()
	h.Write(data)
	digest := h.Sum(nil)

	// Per RFC 5656, section 3.1.2,
	// The ecdsa_signature_blob value has the following specific encoding:
	//    mpint    r
	//    mpint    s
	var ecSig struct {
		R *big.Int
		S *big.Int
	}

	if err := Unmarshal(sig.Blob, &ecSig); err != nil {
		return err
	}

	if ecdsa.Verify((*ecdsa.PublicKey)(key), digest, ecSig.R, ecSig.S) {
		return nil
	}
	return errors.New("ssh: signature did not verify")
}

func (k *ecdsaPublicKey) CryptoPublicKey() crypto.PublicKey {
	return (*ecdsa.PublicKey)(k)
}

// NewSignerFromKey takes an *rsa.PrivateKey, *dsa.PrivateKey,
// *ecdsa.PrivateKey or any other crypto.Signer and returns a corresponding
// Signer instance. ECDSA keys must use P-256, P-384 or P-521.
func NewSignerFromKey(key interface{}) (Signer, error) {
	switch key := key.(type) {
	case crypto.Signer:
		return NewSignerFromSigner(key)
	case *dsa.PrivateKey:
		return &dsaPrivateKey{key}, nil
	default:
		return nil, fmt.Errorf("ssh: unsupported key type %T", key)
	}
}

type wrappedSigner struct {
	signer crypto.Signer
	pubKey PublicKey
}

// NewSignerFromSigner takes any crypto.Signer implementation and
// returns a corresponding Signer interface. This can be used, for
// example, with keys kept in hardware modules.
func NewSignerFromSigner(signer crypto.Signer) (Signer, error) {
	pubKey, err := NewPublicKey(signer.Public())
	if err != nil {
		return nil, err
	}

	return &wrappedSigner{signer, pubKey}, nil
}

func (s *wrappedSigner) PublicKey() PublicKey {
	return s.pubKey
}

func (s *wrappedSigner) Sign(rand io.Reader, data []byte) (*Signature, error) {
	var hashFunc crypto.Hash

	switch key := s.pubKey.(type) {
	case *rsaPublicKey, *dsaPublicKey:
		hashFunc = crypto.SHA1
	case *ecdsaPublicKey:
		hashFunc = ecHash(key.Curve)
	case ed25519PublicKey:
	default:
		return nil, fmt.Errorf("ssh: unsupported key type %T", key)
	}

	var digest []byte
	if hashFunc != 0 {
		h := hashFunc.New()
		h.Write(data)
		digest = h.Sum(nil)
	} else {
		digest = data
	}

	signature, err := s.signer.Sign(rand, digest, hashFunc)
	if err != nil {
		return nil, err
	}

	// crypto.Signer.Sign is expected to return an ASN.1-encoded signature
	// for ECDSA and DSA, but that's not the encoding expected by SSH, so
	// re-encode.
	switch s.pubKey.(type) {
	case *ecdsaPublicKey, *dsaPublicKey:
		type asn1Signature struct {
			R, S *big.Int
		}
		asn1Sig := new(asn1Signature)
		_, err := asn1.Unmarshal(signature, asn1Sig)
		if err != nil {
			return nil, err
		}

		switch s.pubKey.(type) {
		case *ecdsaPublicKey:
			signature = Marshal(asn1Sig)

		case *dsaPublicKey:
			signature = make([]byte, 40)
			r := asn1Sig.R.Bytes()
			s := asn1Sig.S.Bytes()
			copy(signature[20-len(r):20], r)
			copy(signature[40-len(s):40], s)
		}
	}

	return &Signature{
		Format: s.pubKey.Type(),
		Blob:   signature,
	}, nil
}

// NewPublicKey takes an *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey,
// ed25519.PublicKey, or any other crypto.Signer and returns a corresponding
// Signer instance. ECDSA keys must use P-256, P-384 or P-521.
func NewPublicKey(key interface{}) (PublicKey, error) {
	switch key := key.(type) {
	case *rsa.PublicKey:
		return (*rsaPublicKey)(key), nil
	case *ecdsa.PublicKey:
		if !supportedEllipticCurve(key.Curve) {
			return nil, errors.New("ssh: only P-256, P-384 and P-521 EC keys are supported.")
		}
		return (*ecdsaPublicKey)(key), nil
	case *dsa.PublicKey:
		return (*dsaPublicKey)(key), nil
	case ed25519.PublicKey:
		return (ed25519PublicKey)(key), nil
	default:
		return nil, fmt.Errorf("ssh: unsupported key type %T", key)
	}
}

// ParsePrivateKey returns a Signer from a PEM encoded private key. It supports
// the same keys as ParseRawPrivateKey.
func ParsePrivateKey(pemBytes []byte) (Signer, error) {
	key, err := ParseRawPrivateKey(pemBytes)
	if err != nil {
		return nil, err
	}

	return NewSignerFromKey(key)
}

// encryptedBlock tells whether a private key is
// encrypted by examining its Proc-Type header
// for a mention of ENCRYPTED
// according to RFC 1421 Section 4.6.1.1.
func encryptedBlock(block *pem.Block) bool {
	return strings.Contains(block.Headers["Proc-Type"], "ENCRYPTED")
}

// ParseRawPrivateKey returns a private key from a PEM encoded private key. It
// supports RSA (PKCS#1), DSA (OpenSSL), and ECDSA private keys.
func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) {
	block, _ := pem.Decode(pemBytes)
	if block == nil {
		return nil, errors.New("ssh: no key found")
	}

	if encryptedBlock(block) {
		return nil, errors.New("ssh: cannot decode encrypted private keys")
	}

	switch block.Type {
	case "RSA PRIVATE KEY":
		return x509.ParsePKCS1PrivateKey(block.Bytes)
	case "EC PRIVATE KEY":
		return x509.ParseECPrivateKey(block.Bytes)
	case "DSA PRIVATE KEY":
		return ParseDSAPrivateKey(block.Bytes)
	case "OPENSSH PRIVATE KEY":
		return parseOpenSSHPrivateKey(block.Bytes)
	default:
		return nil, fmt.Errorf("ssh: unsupported key type %q", block.Type)
	}
}

// ParseDSAPrivateKey returns a DSA private key from its ASN.1 DER encoding, as
// specified by the OpenSSL DSA man page.
func ParseDSAPrivateKey(der []byte) (*dsa.PrivateKey, error) {
	var k struct {
		Version int
		P       *big.Int
		Q       *big.Int
		G       *big.Int
		Priv    *big.Int
		Pub     *big.Int
	}
	rest, err := asn1.Unmarshal(der, &k)
	if err != nil {
		return nil, errors.New("ssh: failed to parse DSA key: " + err.Error())
	}
	if len(rest) > 0 {
		return nil, errors.New("ssh: garbage after DSA key")
	}

	return &dsa.PrivateKey{
		PublicKey: dsa.PublicKey{
			Parameters: dsa.Parameters{
				P: k.P,
				Q: k.Q,
				G: k.G,
			},
			Y: k.Priv,
		},
		X: k.Pub,
	}, nil
}

// Implemented based on the documentation at
// https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key
func parseOpenSSHPrivateKey(key []byte) (*ed25519.PrivateKey, error) {
	magic := append([]byte("openssh-key-v1"), 0)
	if !bytes.Equal(magic, key[0:len(magic)]) {
		return nil, errors.New("ssh: invalid openssh private key format")
	}
	remaining := key[len(magic):]

	var w struct {
		CipherName   string
		KdfName      string
		KdfOpts      string
		NumKeys      uint32
		PubKey       []byte
		PrivKeyBlock []byte
	}

	if err := Unmarshal(remaining, &w); err != nil {
		return nil, err
	}

	pk1 := struct {
		Check1  uint32
		Check2  uint32
		Keytype string
		Pub     []byte
		Priv    []byte
		Comment string
		Pad     []byte `ssh:"rest"`
	}{}

	if err := Unmarshal(w.PrivKeyBlock, &pk1); err != nil {
		return nil, err
	}

	if pk1.Check1 != pk1.Check2 {
		return nil, errors.New("ssh: checkint mismatch")
	}

	// we only handle ed25519 keys currently
	if pk1.Keytype != KeyAlgoED25519 {
		return nil, errors.New("ssh: unhandled key type")
	}

	for i, b := range pk1.Pad {
		if int(b) != i+1 {
			return nil, errors.New("ssh: padding not as expected")
		}
	}

	if len(pk1.Priv) != ed25519.PrivateKeySize {
		return nil, errors.New("ssh: private key unexpected length")
	}

	pk := ed25519.PrivateKey(make([]byte, ed25519.PrivateKeySize))
	copy(pk, pk1.Priv)
	return &pk, nil
}


text:
#pragma once
#include <aws/elasticmapreduce/EMR_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace EMR
{
namespace Model
{
  enum class InstanceFleetType
  {
    NOT_SET,
    MASTER,
    CORE,
    TASK
  };

namespace InstanceFleetTypeMapper
{
AWS_EMR_API InstanceFleetType GetInstanceFleetTypeForName(const Aws::String& name);

AWS_EMR_API Aws::String GetNameForInstanceFleetType(InstanceFleetType value);
} // namespace InstanceFleetTypeMapper
} // namespace Model
} // namespace EMR
} // namespace Aws


text:
package com.piglin.optimization;

public class Knapsack {

    /**
     * Knapsack Problem
     *

     * Greedy algorithm
     *

     * Continuous knapsack problem
     *
     * @param values   values of items
     * @param weights  weights of items
     * @param capacity knapsack capacity
     */
    public static void knapsackProblem(int[] values, int[] weights, int capacity) {

        int distinctItems = values.length;

        /* Initialize knapsack */
        int[] selected = new int[distinctItems];

        for (int i = 0; i < distinctItems; i++) {
            selected[i] = 0;
        }

        int weight=0;
        int index = 0;
        while (weight <= capacity && index < distinctItems) {
                if (weight + weights[index] <= capacity) {
                    /* Maximize value */
                    selected[index] = 1;
                    weight = weight + weights[index];
                }
                index++;

        }

        System.out.println("\nSolution:\n");
        for (int i = 0; i < selected.length; i++) {
            System.out.print(selected[i] + "\t");
        }
        System.out.println();
        /*for (int i = 0; i < m.length; i++) {
            for (int j = 0; j < m[i].length; j++) {
                System.out.print(m[i][j] + "\t");
            }
            System.out.println();
        }*/
    }

}