text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: merkle.proto

package com.github.jtendermint.jabci.types;

/**
 *

 * Proof is Merkle proof defined by the list of ProofOps
 *

 *
 * Protobuf type {@code com.github.jtendermint.jabci.types.Proof}
 */
public  final class Proof extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:com.github.jtendermint.jabci.types.Proof)
    ProofOrBuilder {
private static final long serialVersionUID = 0L;
  // Use Proof.newBuilder() to construct.
  private Proof(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private Proof() {
    ops_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private Proof(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              ops_ = new java.util.ArrayList<com.github.jtendermint.jabci.types.ProofOp>();
              mutable_bitField0_ |= 0x00000001;
            }
            ops_.add(
                input.readMessage(com.github.jtendermint.jabci.types.ProofOp.parser(), extensionRegistry));
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        ops_ = java.util.Collections.unmodifiableList(ops_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.github.jtendermint.jabci.types.Merkle.internal_static_com_github_jtendermint_jabci_types_Proof_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.github.jtendermint.jabci.types.Merkle.internal_static_com_github_jtendermint_jabci_types_Proof_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.github.jtendermint.jabci.types.Proof.class, com.github.jtendermint.jabci.types.Proof.Builder.class);
  }

  public static final int OPS_FIELD_NUMBER = 1;
  private java.util.List<com.github.jtendermint.jabci.types.ProofOp> ops_;
  /**
   * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
   */
  public java.util.List<com.github.jtendermint.jabci.types.ProofOp> getOpsList() {
    return ops_;
  }
  /**
   * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
   */
  public java.util.List<? extends com.github.jtendermint.jabci.types.ProofOpOrBuilder>
      getOpsOrBuilderList() {
    return ops_;
  }
  /**
   * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
   */
  public int getOpsCount() {
    return ops_.size();
  }
  /**
   * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
   */
  public com.github.jtendermint.jabci.types.ProofOp getOps(int index) {
    return ops_.get(index);
  }
  /**
   * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
   */
  public com.github.jtendermint.jabci.types.ProofOpOrBuilder getOpsOrBuilder(
      int index) {
    return ops_.get(index);
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    for (int i = 0; i < ops_.size(); i++) {
      output.writeMessage(1, ops_.get(i));
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    for (int i = 0; i < ops_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, ops_.get(i));
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.github.jtendermint.jabci.types.Proof)) {
      return super.equals(obj);
    }
    com.github.jtendermint.jabci.types.Proof other = (com.github.jtendermint.jabci.types.Proof) obj;

    if (!getOpsList()
        .equals(other.getOpsList())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getOpsCount() > 0) {
      hash = (37 * hash) + OPS_FIELD_NUMBER;
      hash = (53 * hash) + getOpsList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.github.jtendermint.jabci.types.Proof parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.github.jtendermint.jabci.types.Proof parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.github.jtendermint.jabci.types.Proof parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.github.jtendermint.jabci.types.Proof parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.github.jtendermint.jabci.types.Proof parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.github.jtendermint.jabci.types.Proof parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.github.jtendermint.jabci.types.Proof parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.github.jtendermint.jabci.types.Proof parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.github.jtendermint.jabci.types.Proof parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.github.jtendermint.jabci.types.Proof parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.github.jtendermint.jabci.types.Proof parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.github.jtendermint.jabci.types.Proof parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.github.jtendermint.jabci.types.Proof prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *

   * Proof is Merkle proof defined by the list of ProofOps
   *

   *
   * Protobuf type {@code com.github.jtendermint.jabci.types.Proof}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:com.github.jtendermint.jabci.types.Proof)
      com.github.jtendermint.jabci.types.ProofOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.github.jtendermint.jabci.types.Merkle.internal_static_com_github_jtendermint_jabci_types_Proof_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.github.jtendermint.jabci.types.Merkle.internal_static_com_github_jtendermint_jabci_types_Proof_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.github.jtendermint.jabci.types.Proof.class, com.github.jtendermint.jabci.types.Proof.Builder.class);
    }

    // Construct using com.github.jtendermint.jabci.types.Proof.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getOpsFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (opsBuilder_ == null) {
        ops_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        opsBuilder_.clear();
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.github.jtendermint.jabci.types.Merkle.internal_static_com_github_jtendermint_jabci_types_Proof_descriptor;
    }

    @java.lang.Override
    public com.github.jtendermint.jabci.types.Proof getDefaultInstanceForType() {
      return com.github.jtendermint.jabci.types.Proof.getDefaultInstance();
    }

    @java.lang.Override
    public com.github.jtendermint.jabci.types.Proof build() {
      com.github.jtendermint.jabci.types.Proof result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.github.jtendermint.jabci.types.Proof buildPartial() {
      com.github.jtendermint.jabci.types.Proof result = new com.github.jtendermint.jabci.types.Proof(this);
      int from_bitField0_ = bitField0_;
      if (opsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          ops_ = java.util.Collections.unmodifiableList(ops_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.ops_ = ops_;
      } else {
        result.ops_ = opsBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.github.jtendermint.jabci.types.Proof) {
        return mergeFrom((com.github.jtendermint.jabci.types.Proof)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.github.jtendermint.jabci.types.Proof other) {
      if (other == com.github.jtendermint.jabci.types.Proof.getDefaultInstance()) return this;
      if (opsBuilder_ == null) {
        if (!other.ops_.isEmpty()) {
          if (ops_.isEmpty()) {
            ops_ = other.ops_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureOpsIsMutable();
            ops_.addAll(other.ops_);
          }
          onChanged();
        }
      } else {
        if (!other.ops_.isEmpty()) {
          if (opsBuilder_.isEmpty()) {
            opsBuilder_.dispose();
            opsBuilder_ = null;
            ops_ = other.ops_;
            bitField0_ = (bitField0_ & ~0x00000001);
            opsBuilder_ =
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getOpsFieldBuilder() : null;
          } else {
            opsBuilder_.addAllMessages(other.ops_);
          }
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.github.jtendermint.jabci.types.Proof parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.github.jtendermint.jabci.types.Proof) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.util.List<com.github.jtendermint.jabci.types.ProofOp> ops_ =
      java.util.Collections.emptyList();
    private void ensureOpsIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        ops_ = new java.util.ArrayList<com.github.jtendermint.jabci.types.ProofOp>(ops_);
        bitField0_ |= 0x00000001;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.github.jtendermint.jabci.types.ProofOp, com.github.jtendermint.jabci.types.ProofOp.Builder, com.github.jtendermint.jabci.types.ProofOpOrBuilder> opsBuilder_;

    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public java.util.List<com.github.jtendermint.jabci.types.ProofOp> getOpsList() {
      if (opsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(ops_);
      } else {
        return opsBuilder_.getMessageList();
      }
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public int getOpsCount() {
      if (opsBuilder_ == null) {
        return ops_.size();
      } else {
        return opsBuilder_.getCount();
      }
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public com.github.jtendermint.jabci.types.ProofOp getOps(int index) {
      if (opsBuilder_ == null) {
        return ops_.get(index);
      } else {
        return opsBuilder_.getMessage(index);
      }
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public Builder setOps(
        int index, com.github.jtendermint.jabci.types.ProofOp value) {
      if (opsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureOpsIsMutable();
        ops_.set(index, value);
        onChanged();
      } else {
        opsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public Builder setOps(
        int index, com.github.jtendermint.jabci.types.ProofOp.Builder builderForValue) {
      if (opsBuilder_ == null) {
        ensureOpsIsMutable();
        ops_.set(index, builderForValue.build());
        onChanged();
      } else {
        opsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public Builder addOps(com.github.jtendermint.jabci.types.ProofOp value) {
      if (opsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureOpsIsMutable();
        ops_.add(value);
        onChanged();
      } else {
        opsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public Builder addOps(
        int index, com.github.jtendermint.jabci.types.ProofOp value) {
      if (opsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureOpsIsMutable();
        ops_.add(index, value);
        onChanged();
      } else {
        opsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public Builder addOps(
        com.github.jtendermint.jabci.types.ProofOp.Builder builderForValue) {
      if (opsBuilder_ == null) {
        ensureOpsIsMutable();
        ops_.add(builderForValue.build());
        onChanged();
      } else {
        opsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public Builder addOps(
        int index, com.github.jtendermint.jabci.types.ProofOp.Builder builderForValue) {
      if (opsBuilder_ == null) {
        ensureOpsIsMutable();
        ops_.add(index, builderForValue.build());
        onChanged();
      } else {
        opsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public Builder addAllOps(
        java.lang.Iterable<? extends com.github.jtendermint.jabci.types.ProofOp> values) {
      if (opsBuilder_ == null) {
        ensureOpsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, ops_);
        onChanged();
      } else {
        opsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public Builder clearOps() {
      if (opsBuilder_ == null) {
        ops_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        opsBuilder_.clear();
      }
      return this;
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public Builder removeOps(int index) {
      if (opsBuilder_ == null) {
        ensureOpsIsMutable();
        ops_.remove(index);
        onChanged();
      } else {
        opsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public com.github.jtendermint.jabci.types.ProofOp.Builder getOpsBuilder(
        int index) {
      return getOpsFieldBuilder().getBuilder(index);
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public com.github.jtendermint.jabci.types.ProofOpOrBuilder getOpsOrBuilder(
        int index) {
      if (opsBuilder_ == null) {
        return ops_.get(index);  } else {
        return opsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public java.util.List<? extends com.github.jtendermint.jabci.types.ProofOpOrBuilder>
         getOpsOrBuilderList() {
      if (opsBuilder_ != null) {
        return opsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(ops_);
      }
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public com.github.jtendermint.jabci.types.ProofOp.Builder addOpsBuilder() {
      return getOpsFieldBuilder().addBuilder(
          com.github.jtendermint.jabci.types.ProofOp.getDefaultInstance());
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public com.github.jtendermint.jabci.types.ProofOp.Builder addOpsBuilder(
        int index) {
      return getOpsFieldBuilder().addBuilder(
          index, com.github.jtendermint.jabci.types.ProofOp.getDefaultInstance());
    }
    /**
     * repeated .com.github.jtendermint.jabci.types.ProofOp ops = 1;
     */
    public java.util.List<com.github.jtendermint.jabci.types.ProofOp.Builder>
         getOpsBuilderList() {
      return getOpsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.github.jtendermint.jabci.types.ProofOp, com.github.jtendermint.jabci.types.ProofOp.Builder, com.github.jtendermint.jabci.types.ProofOpOrBuilder>
        getOpsFieldBuilder() {
      if (opsBuilder_ == null) {
        opsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.github.jtendermint.jabci.types.ProofOp, com.github.jtendermint.jabci.types.ProofOp.Builder, com.github.jtendermint.jabci.types.ProofOpOrBuilder>(
                ops_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        ops_ = null;
      }
      return opsBuilder_;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:com.github.jtendermint.jabci.types.Proof)
  }

  // @@protoc_insertion_point(class_scope:com.github.jtendermint.jabci.types.Proof)
  private static final com.github.jtendermint.jabci.types.Proof DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.github.jtendermint.jabci.types.Proof();
  }

  public static com.github.jtendermint.jabci.types.Proof getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<Proof>
      PARSER = new com.google.protobuf.AbstractParser<Proof>() {
    @java.lang.Override
    public Proof parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new Proof(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<Proof> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<Proof> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.github.jtendermint.jabci.types.Proof getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>edu.uniandes.ecos.PSP2.Interfaces (program6 1.0 API)</title>
<meta name="date" content="2017-05-03">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

edu.uniandes.ecos.PSP2.Interfaces

Interfaces

IController

IView

redpajama_set_name: RedPajamaGithub


text:
import Ember from 'ember';

export default Ember.Component.extend({
  authentication: Ember.inject.service(),

  actions: {
    authenticateWithOAuth2() {
      this.set('errorMessage', null);
      let { identification, password } = this.getProperties('identification', 'password');

      this.get('authentication')
        .withUsernameAndPassword(identification, password)
        .catch((error) => {
          this.set('errorMessage', error.message);
        });
    }
  }
});


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">

        <title>Proplist – Proplist v1.1.0</title>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="ExDoc">

    <link rel="stylesheet" href="dist/app.css">

  <button type="button" class="btn btn-default btn-sm" data-toggle="offcanvas">

  </button>

      Proplist v1.1.0

    Overview

      Modules

      Exceptions

      Protocols

        Search
        <input type="text" id="search_field" class="form-control" placeholder="Search" autocomplete="off" autofocus="autofocus" results="0">

          <button class="btn btn-default" type="button"></button>

        <button type="button" class="btn btn-default btn-sm" data-toggle="offcanvas">

        </button>
        Proplist v1.1.0 → Overview → Proplist

        Proplist

Summary

Types

Functions

A proplist is a list of tuples where the first element
of the tuple is a binary and the second element can be
any value.

A proplist may have duplicated props so it is not strictly
a dictionary. However most of the functions in this module
behave exactly as a dictionary and mimic the API defined
by the Dict behaviour.

For example, Proplist.get/3 will get the first entry matching
the given prop, regardless if duplicated entries exist.
Similarly, Proplist.put/3 and Proplist.delete/3 ensure all
duplicated entries for a given prop are removed when invoked.

A handful of functions exist to handle duplicated props, in
particular, Enum.into/2 allows creating new proplist without
removing duplicated props, get_values/2 returns all values for
a given prop and delete_first/2 deletes just one of the existing
entries.

Since a proplist list is simply a list, all the operations defined
in Enum and List can be applied.

        Source

Summary

  delete(proplist, prop)

Deletes the entries in the proplist list for a specific prop

  delete(proplist, prop, value)

Deletes the entries in the proplist list for a prop with value

  delete_first(proplist, prop)

Deletes the first entry in the proplist list for a specific prop

  drop(proplist, props)

Drops the given props from the proplist list

  equal?(left, right)

Checks if two proplists are equal

  fetch!(proplist, prop)

Fetches the value for specific prop

  fetch(proplist, prop)

Fetches the value for a specific prop and returns it in a tuple

  get(proplist, prop, default \\ nil)

Gets the value for a specific prop

  get_and_update(proplist, prop, fun)

Gets the value from prop and updates it, all in one pass

  get_lazy(proplist, prop, fun)

Gets the value for a specific prop

  get_values(proplist, prop)

Gets all values for a specific prop

  has_prop?(proplist, prop)

Returns whether a given prop exists in the given proplist

  merge(d1, d2)

Merges two proplist lists into one

  merge(d1, d2, fun)

Merges two proplist lists into one

  new()

Returns an empty property list, i.e. an empty list

  new(pairs)

Creates a proplist from an enumerable

  new(pairs, transform)

Creates a proplist from an enumerable via the transformation function

  pop(proplist, prop, default \\ nil)

Returns the first value associated with prop in the proplist
list as well as the proplist list without prop

  pop_first(proplist, prop, default \\ nil)

Returns the first value associated with prop in the proplist
list as well as the proplist list without that particular occurrence
of prop

  pop_lazy(proplist, prop, fun)

Returns the first value associated with prop in the proplist
as well as the proplist without prop

  proplist?(arg1)

Checks if the given argument is a proplist list or not

  props(proplist)

Returns all props from the proplist list

  put(proplist, prop, value)

Puts the given value under prop

  put_new(proplist, prop, value)

Puts the given value under prop unless the entry prop
already exists

  put_new_lazy(proplist, prop, fun)

Evaluates fun and puts the result under prop
in proplist unless prop is already present

  split(proplist, props)

Takes all entries corresponding to the given props and extracts them into a
separate proplist list

  take(proplist, props)

Takes all entries corresponding to the given props and returns them in a new
proplist list

  update!(proplist, prop, fun)

Updates the prop with the given function

  update(list, prop, initial, fun)

Updates the prop with the given function

  values(proplist)

Returns all values from the proplist list

Types

    prop :: binary

    value :: any

    t :: [{prop, value}]

    t(value) :: [{prop, value}]

Functions

    delete(proplist, prop)

      (function)
      #
      ↑

Specs:

delete(t, prop) :: t

Deletes the entries in the proplist list for a specific prop.

If the prop does not exist, returns the proplist list unchanged.
Use delete_first/2 to delete just the first entry in case of
duplicated props.

Examples

iex> Proplist.delete([{"a", 1}, {"b", 2}], "a")
[{"b", 2}]

iex> Proplist.delete([{"a", 1}, {"b", 2}, {"a", 3}], "a")
[{"b", 2}]

iex> Proplist.delete([{"b", 2}], "a")
[{"b", 2}]

    Source

    delete(proplist, prop, value)

      (function)
      #
      ↑

Specs:

delete(t, prop, value) :: t

Deletes the entries in the proplist list for a prop with value.

If no prop with value exists, returns the proplist list unchanged.

Examples

iex> Proplist.delete([{"a", 1}, {"b", 2}], "a", 1)
[{"b", 2}]

iex> Proplist.delete([{"a", 1}, {"b", 2}, {"a", 3}], "a", 3)
[{"a", 1}, {"b", 2}]

iex> Proplist.delete([{"b", 2}], "a", 5)
[{"b", 2}]

    Source

    delete_first(proplist, prop)

      (function)
      #
      ↑

Specs:

delete_first(t, prop) :: t

Deletes the first entry in the proplist list for a specific prop.

If the prop does not exist, returns the proplist list unchanged.

Examples

iex> Proplist.delete_first([{"a", 1}, {"b", 2}, {"a", 3}], "a")
[{"b", 2}, {"a", 3}]

iex> Proplist.delete_first([{"b", 2}], "a")
[{"b", 2}]

    Source

    drop(proplist, props)

      (function)
      #
      ↑

Drops the given props from the proplist list.

Duplicated props are preserved in the new proplist list.

Examples

iex> d = [{"a", 1}, {"b", 2}, {"c", 3}, {"d", 4}]
iex> Proplist.drop(d, ["b", "d"])
[{"a", 1}, {"c", 3}]

iex> d = [{"a", 1}, {"b", 2}, {"c", 3}, {"d", 4}, {"e", 5}]
iex> Proplist.drop(d, ["b", "d"])
[{"a", 1}, {"c", 3}, {"e", 5}]

    Source

    equal?(left, right)

      (function)
      #
      ↑

Specs:

equal?(t, t) :: boolean

Checks if two proplists are equal.

Two proplists are considered to be equal if they contain
the same props and those props contain the same values.

Examples

iex> Proplist.equal?([{"a", 1}, {"b", 2}], [{"b", 2}, {"a", 1}])
true

    Source

    fetch(proplist, prop)

      (function)
      #
      ↑

Specs:

fetch(t, prop) :: {:ok, value} | :error

Fetches the value for a specific prop and returns it in a tuple.

If the prop does not exist, returns :error.

Examples

iex> Proplist.fetch([{"a", 1}], "a")
{:ok, 1}

iex> Proplist.fetch([{"a", 1}], "b")
:error

    Source

    fetch!(proplist, prop)

      (function)
      #
      ↑

Specs:

fetch!(t, prop) :: value | no_return

Fetches the value for specific prop.

If prop does not exist, a KeyError is raised.

Examples

iex> Proplist.fetch!([{"a", 1}], "a")
1

iex> Proplist.fetch!([{"a", 1}], "b")
** (KeyError) key "b" not found in: [{"a", 1}]

    Source

    get(proplist, prop, default \\ nil)

      (function)
      #
      ↑

Specs:

get(t, prop, value) :: value

Gets the value for a specific prop.

If prop does not exist, return the default value (nil if no default value).

If duplicated entries exist, the first one is returned.
Use get_values/2 to retrieve all entries.

Examples

iex> Proplist.get([{"a", 1}], "a")
1

iex> Proplist.get([{"a", 1}], "b")
nil

iex> Proplist.get([{"a", 1}], "b", 3)
3

    Source

    get_and_update(proplist, prop, fun)

      (function)
      #
      ↑

Specs:

get_and_update(t, prop, (value -> {value, value})) :: {value, t}

Gets the value from prop and updates it, all in one pass.

This fun argument receives the value of prop (or nil if prop
is not present) and must return a two-elements tuple: the "get" value (the
retrieved value, which can be operated on before being returned) and the new
value to be stored under prop.

The returned value is a tuple with the "get" value returned by fun and a new
proplist with the updated value under prop.

Examples

iex> Proplist.get_and_update [{"a", 1}], "a", fn(current_value) ->
...>   {current_value, current_value + 1}
...> end
{1, [{"a", 2}]}

    Source

    get_lazy(proplist, prop, fun)

      (function)
      #
      ↑

Specs:

get_lazy(t, prop, (() -> value)) :: value

Gets the value for a specific prop.

If prop does not exist, lazily evaluates fun and returns its result.

If duplicated entries exist, the first one is returned.
Use get_values/2 to retrieve all entries.

Examples

iex> proplist = [{"a", 1}]
iex> fun = fn ->
...>   :result
...> end
iex> Proplist.get_lazy(proplist, "a", fun)
1
iex> Proplist.get_lazy(proplist, "b", fun)
:result

    Source

    get_values(proplist, prop)

      (function)
      #
      ↑

Specs:

get_values(t, prop) :: [value]

Gets all values for a specific prop.

Examples

iex> Proplist.get_values([{"a", 1}, {"a", 2}], "a")
[1,2]

    Source

    has_prop?(proplist, prop)

      (function)
      #
      ↑

Specs:

has_prop?(t, prop) :: boolean

Returns whether a given prop exists in the given proplist.

Examples

iex> Proplist.has_prop?([{"a", 1}], "a")
true

iex> Proplist.has_prop?([{"a", 1}], "b")
false

    Source

    merge(d1, d2)

      (function)
      #
      ↑

Specs:

merge(t, t) :: t

Merges two proplist lists into one.

If they have duplicated props, the one given in the second argument wins.

Examples

iex> Proplist.merge([{"a", 1}, {"b", 2}], [{"a", 3}, {"d", 4}]) |> Enum.sort
[{"a", 3}, {"b", 2}, {"d", 4}]

    Source

    merge(d1, d2, fun)

      (function)
      #
      ↑

Specs:

merge(t, t, (prop, value, value -> value)) :: t

Merges two proplist lists into one.

If they have duplicated props, the given function is invoked to solve conflicts.

Examples

iex> Proplist.merge([{"a", 1}, {"b", 2}], [{"a", 3}, {"d", 4}], fn (_k, v1, v2) ->
...>   v1 + v2
...> end)
[{"a", 4}, {"b", 2}, {"d", 4}]

    Source

    new()

      (function)
      #
      ↑

Specs:

new :: t

Returns an empty property list, i.e. an empty list.

    Source

    new(pairs)

      (function)
      #
      ↑

Specs:

new(Enum.t) :: t

Creates a proplist from an enumerable.

Duplicated entries are removed, the latest one prevails.
Unlike Enum.into(enumerable, []),
Proplist.new(enumerable) guarantees the props are unique.

Examples

iex> Proplist.new([{"b", 1}, {"a", 2}])
[{"a", 2}, {"b", 1}]

    Source

    new(pairs, transform)

      (function)
      #
      ↑

Creates a proplist from an enumerable via the transformation function.

Duplicated entries are removed, the latest one prevails.
Unlike Enum.into(enumerable, [], fun),
Proplist.new(enumerable, fun) guarantees the props are unique.

Examples

iex> Proplist.new(["a", "b"], fn (x) -> {x, x} end) |> Enum.sort
[{"a", "a"}, {"b", "b"}]

    Source

    pop(proplist, prop, default \\ nil)

      (function)
      #
      ↑

Specs:

pop(t, prop, value) :: {value, t}

Returns the first value associated with prop in the proplist
list as well as the proplist list without prop.

All duplicated props are removed. See pop_first/3 for
removing only the first entry.

Examples

iex> Proplist.pop [{"a", 1}], "a"
{1,[]}

iex> Proplist.pop [{"a", 1}], "b"
{nil,[{"a", 1}]}

iex> Proplist.pop [{"a", 1}], "b", 3
{3,[{"a", 1}]}

iex> Proplist.pop [{"a", 1}], "b", 3
{3,[{"a", 1}]}

iex> Proplist.pop [{"a", 1}, {"a", 2}], "a"
{1,[]}

    Source

    pop_first(proplist, prop, default \\ nil)

      (function)
      #
      ↑

Returns the first value associated with prop in the proplist
list as well as the proplist list without that particular occurrence
of prop.

Duplicated props are not removed.

Examples

iex> Proplist.pop_first [{"a", 1}], "a"
{1,[]}

iex> Proplist.pop_first [{"a", 1}], "b"
{nil,[{"a", 1}]}

iex> Proplist.pop_first [{"a", 1}], "b", 3
{3,[{"a", 1}]}

iex> Proplist.pop_first [{"a", 1}], "b", 3
{3,[{"a", 1}]}

iex> Proplist.pop_first [{"a", 1}, {"a", 2}], "a"
{1,[{"a", 2}]}

    Source

    pop_lazy(proplist, prop, fun)

      (function)
      #
      ↑

Specs:

pop_lazy(t, prop, (() -> value)) :: {value, t}

Returns the first value associated with prop in the proplist
as well as the proplist without prop.

All duplicated props are removed. See pop_first/3 for
removing only the first entry.

Examples

iex> proplist = [{"a", 1}]
iex> fun = fn ->
...>   :result
...> end
iex> Proplist.pop_lazy(proplist, "a", fun)
{1, []}
iex> Proplist.pop_lazy(proplist, "b", fun)
{:result, [{"a", 1}]}

    Source

    proplist?(arg1)

      (function)
      #
      ↑

Specs:

proplist?(term) :: boolean

Checks if the given argument is a proplist list or not.

    Source

    props(proplist)

      (function)
      #
      ↑

Specs:

props(t) :: [prop]

Returns all props from the proplist list.

Duplicated props appear duplicated in the final list of props.

Examples

iex> Proplist.props([{"a", 1}, {"b", 2}])
["a", "b"]

iex> Proplist.props([{"a", 1}, {"b", 2}, {"a", 3}])
["a", "b", "a"]

    Source

    put(proplist, prop, value)

      (function)
      #
      ↑

Specs:

put(t, prop, value) :: t

Puts the given value under prop.

If a previous value is already stored, all entries are
removed and the value is overridden.

Examples

iex> Proplist.put([{"a", 1}, {"b", 2}], "a", 3)
[{"a", 3}, {"b", 2}]

iex> Proplist.put([{"a", 1}, {"b", 2}, {"a", 4}], "a", 3)
[{"a", 3}, {"b", 2}]

    Source

    put_new(proplist, prop, value)

      (function)
      #
      ↑

Specs:

put_new(t, prop, value) :: t

Puts the given value under prop unless the entry prop
already exists.

Examples

iex> Proplist.put_new([{"a", 1}], "b", 2)
[{"b", 2}, {"a", 1}]

iex> Proplist.put_new([{"a", 1}, {"b", 2}], "a", 3)
[{"a", 1}, {"b", 2}]

    Source

    put_new_lazy(proplist, prop, fun)

      (function)
      #
      ↑

Specs:

put_new_lazy(t, prop, (() -> value)) :: t

Evaluates fun and puts the result under prop
in proplist unless prop is already present.

Examples

iex> proplist = [{"a", 1}]
iex> fun = fn ->
...>   3
...> end
iex> Proplist.put_new_lazy(proplist, "a", fun)
[{"a", 1}]
iex> Proplist.put_new_lazy(proplist, "b", fun)
[{"b", 3}, {"a", 1}]

    Source

    split(proplist, props)

      (function)
      #
      ↑

Takes all entries corresponding to the given props and extracts them into a
separate proplist list.

Returns a tuple with the new list and the old list with removed props.

Keys for which there are no entires in the proplist list are ignored.

Entries with duplicated props end up in the same proplist list.

Examples

iex> d = [{"a", 1}, {"b", 2}, {"c", 3}, {"d", 4}]
iex> Proplist.split(d, ["a", "c", "e"])
{[{"a", 1}, {"c", 3}], [{"b", 2}, {"d", 4}]}

iex> d = [{"a", 1}, {"b", 2}, {"c", 3}, {"d", 4}, {"e", 5}]
iex> Proplist.split(d, ["a", "c", "e"])
{[{"a", 1}, {"c", 3}, {"e", 5}], [{"b", 2}, {"d", 4}]}

    Source

    take(proplist, props)

      (function)
      #
      ↑

Takes all entries corresponding to the given props and returns them in a new
proplist list.

Duplicated props are preserved in the new proplist list.

Examples

iex> d = [{"a", 1}, {"b", 2}, {"c", 3}, {"d", 4}]
iex> Proplist.take(d, ["a", "c", "e"])
[{"a", 1}, {"c", 3}]

iex> d = [{"a", 1}, {"b", 2}, {"c", 3}, {"d", 4}, {"e", 5}]
iex> Proplist.take(d, ["a", "c", "e"])
[{"a", 1}, {"c", 3}, {"e", 5}]

    Source

    update(list, prop, initial, fun)

      (function)
      #
      ↑

Specs:

update(t, prop, value, (value -> value)) :: t

Updates the prop with the given function.

If the prop does not exist, inserts the given initial value.

If there are duplicated props, they are all removed and only the first one
is updated.

Examples

iex> Proplist.update([{"a", 1}], "a", 13, &(&1 * 2))
[{"a", 2}]

iex> Proplist.update([{"a", 1}], "b", 11, &(&1 * 2))
[{"a", 1}, {"b", 11}]

    Source

    update!(proplist, prop, fun)

      (function)
      #
      ↑

Specs:

update!(t, prop, (value -> value)) :: t | no_return

Updates the prop with the given function.

If the prop does not exist, raises KeyError.

If there are duplicated props, they are all removed and only the first one
is updated.

Examples

iex> Proplist.update!([{"a", 1}], "a", &(&1 * 2))
[{"a", 2}]

iex> Proplist.update!([{"a", 1}], "b", &(&1 * 2))
** (KeyError) key "b" not found in: [{"a", 1}]

    Source

    values(proplist)

      (function)
      #
      ↑

Specs:

values(t) :: [value]

Returns all values from the proplist list.

Examples

iex> Proplist.values([{"a", 1}, {"b", 2}])
[1,2]

    Source


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
    In case of error reports,
    a similar file with your tester directory name as file name should be saved in the _ERRORS directory.
-->
<errors>
    <error creationdate="" lastmoddate="" status="" testpath="">
        <!--
            One error node for one error.
            creationdate: use=mandatory; description=the creation data of the node; format=DD.MM.YYYY
            lastmoddate: use=mandatory; description= the last modification date of the node; format=DD.MM.YYYY
            status: use=mandatory; description=the current error status. We will use the lamp system,
              ergo there are 3 possible values: green (good), yellow (hmmm), red (bad).
            testpath: use:optional; description=If the error is related to the big picture of the test,
              type in the path of the uploaded test directory.
        -->
        Description of the error
    </error>
    <error creationdate="9.2.2014" lastmoddate="9.2.2014" status="open" testpath="files/transade_example.xml">
        Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: 0
        at scala.collection.LinearSeqOptimized$class.apply(LinearSeqOptimized.scala:52)
        at scala.collection.immutable.List.apply(List.scala:84)
        at scala.xml.NodeSeq.apply(NodeSeq.scala:52)
        at deburnat.transade.gui.center.TransTree$$anonfun$peer$1$$anonfun$apply$1.apply(TransTree.scala:91)
        at deburnat.transade.gui.center.TransTree$$anonfun$peer$1$$anonfun$apply$1.apply(TransTree.scala:85)
    </error >

    <error  creationdate="9.2.2014">
        this is just a proposition not an errorrrr!!!!!!.
        I think the application need an option to delete all the registering file (Transfer).
    </error>
</errors>


text:
<?xml version="1.0"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
	xmlns:xsl="http://www.milyn.org/xsd/smooks/xsl-1.1.xsd">

	<!--
		On the "b" element, when it is a child of the "c" element,
		a XSLT transformation is done using the defined xsl file.
	 -->
    <xsl:xsl applyOnElement="c/b">
        <xsl:template>/transforms/BasicXslTransform.xsl</xsl:template>
    </xsl:xsl>

</smooks-resource-list>


text:
var Q = require("q");
var axios = require("axios");
var Backend = require("hr.backend");

var rpc = new Backend({
    prefix: "rpc"
});

rpc.defaultMethod({
    execute: function(args, options, method) {
        return Q(axios.post("rpc/"+method, args))
        .then(function(res) {
            return res.data.result || {};
        }, function(err) {
            var e = new Error(err.data.error || err);
            e.code = err.status;

            return Q.reject(e);
        });
    }
});

module.exports = rpc;


text:
(function(context) {

var ohauth = {};

ohauth.qsString = function(obj) {
    return Object.keys(obj).sort().map(function(key) {
        return encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]);
    }).join('&');
};

ohauth.sha = sha1();

ohauth.stringQs = function(str) {
    return str.split('&').reduce(function(obj, pair){
        var parts = pair.split('=');
        obj[parts[0]] = (null === parts[1]) ? '' : decodeURIComponent(parts[1]);
        return obj;
    }, {});
};

ohauth.xhr = function(method, url, auth, data, options, callback) {
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function() {
        if (4 == xhr.readyState && 0 !== xhr.status) callback(xhr);
    };
    var headers = (options && options.header) || { 'Content-Type': 'application/x-www-form-urlencoded' };
    xhr.open(method, url, true);
    xhr.setRequestHeader('Authorization', 'OAuth ' + ohauth.authHeader(auth));
    for (var h in headers) xhr.setRequestHeader(h, headers[h]);
    xhr.send(data);
};

ohauth.nonce = function() {
    for (var o = ''; o.length < 6;) {
        o += '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'[Math.floor(Math.random() * 61)];
    }
    return o;
};

ohauth.authHeader = function(obj) {
    return Object.keys(obj).sort().map(function(key) {
        return encodeURIComponent(key) + '="' + encodeURIComponent(obj[key]) + '"';
    }).join(', ');
};

ohauth.timestamp = function() { return ~~((+new Date()) / 1000); };

ohauth.percentEncode = function(s) {
    return encodeURIComponent(s)
    .replace(/\!/g, '%21').replace(/\'/g, '%27')
    .replace(/\*/g, '%2A').replace(/\(/g, '%28').replace(/\)/g, '%29');
};

ohauth.baseString = function(method, url, params) {
    if (params.oauth_signature) delete params.oauth_signature;
    return [
        method,
        ohauth.percentEncode(url),
        ohauth.percentEncode(ohauth.qsString(params))].join('&');
};

ohauth.signature = function(oauth_secret, token_secret, baseString) {
    return ohauth.sha.b64_hmac_sha1(
        ohauth.percentEncode(oauth_secret) + '&' +
        ohauth.percentEncode(token_secret),
        baseString);
};

context.ohauth = ohauth;

})(this);


text:
@class CreateAccount;
@class ItemsViewController;

@interface FollowersTableViewController : CoreDataTableViewController
{
    ItemsViewController *itemsViewController;
    SynchronizeFollowersItems *synchronizeFollowers;
}

@property (strong,nonatomic) SynchronizeFollowersItems *synchronizeFollowers;

- (NSFetchedResultsController *)followerFetchedResultController:(NSNumber *)userId;

@end


text:
import unittest

from parameterized import parameterized

from graph_diff.graph_diff_algorithm import GraphDiffAlgorithm
from graph_diff.graph_diff_algorithm.graph_map_comparator import GraphMapComparatorByEdgeNum
from graph_diff.nirvana_object_model.pipeline import Pipeline
from graph_diff.nirvana_object_model.worflow_generator.standard_workflow_generator import StandardWorkflowGenerator
from graph_diff.nirvana_object_model.workflow import Workflow
from graph_diff.nirvana_object_model.workflow_to_graph_converter import WorkflowToGraphConverter
from graph_diff.nirvana_object_model.workflow_to_graph_converter.complete_workflow_to_graph_converter import \
    CompleteWorkflowToGraphConverter
from graph_diff.nirvana_object_model.workflow_to_graph_converter.simple_workflow_to_graph_converter import \
    SimpleWorkflowToGraphConverter
from graph_diff.ordered_ant_algorithm.ordered_ant_algorithm import OrderedAntAlgorithm as AntAlgorithm
from graph_diff.unordered_ant_algorithm import UnorderedAntAlgorithm

def generate_parameters(algo, number_of_tests, *args):
    return sum([[(str(i) + "_" + str(type(generator).__name__),
                  algo,
                  generator.generate_workflow(),
                  generator.generate_workflow(),
                  converter) for _ in range(0, number_of_tests)]
                for i, (generator, converter) in enumerate(args)], [])

class GraphWithRepetitiveNodesWithRootTest(unittest.TestCase):
    NUMBER_OF_TESTS = 10
    comparator = GraphMapComparatorByEdgeNum()
    parameters = sum([generate_parameters(algo,
                                          NUMBER_OF_TESTS,
                                          (StandardWorkflowGenerator().generate_blocks(20, 200),
                                           CompleteWorkflowToGraphConverter()),
                                          (StandardWorkflowGenerator().generate_blocks(20, 200),
                                           SimpleWorkflowToGraphConverter()))
                      for algo in (AntAlgorithm(), UnorderedAntAlgorithm())], [])

    @parameterized.expand(parameters)
    def test_random(self,
                    _,
                    algo: GraphDiffAlgorithm,
                    graph1: Workflow,
                    graph2: Workflow,
                    converter: WorkflowToGraphConverter):
        Pipeline(algorithm=algo,
                 workflow_converter=converter).get_diff(graph1, graph2)

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


text:
package com.sevenbridges.apiclient.impl.ds;

import com.sevenbridges.apiclient.lang.Assert;
import com.sevenbridges.apiclient.lang.Collections;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * This {@link Map} is used to store a single instance of Resource's data which is shared among all
 * Resource instances describing the same server-side item (i.e, having the very same href). Locks
 * are used to provide thread-safe Map operations.
 *
 * @see com.sevenbridges.apiclient.impl.ds.DefaultDataStore
 */
public class Enlistment implements Map<String, Object> {

  protected final Map<String, Object> backingMap;  //Protected by read/write lock
  protected final Lock readLock;
  protected final Lock writeLock;

  public Enlistment(Map<String, Object> map) {
    ReadWriteLock rwl = new ReentrantReadWriteLock();
    this.readLock = rwl.readLock();
    this.writeLock = rwl.writeLock();
    this.backingMap = new LinkedHashMap<>();
    setProperties(map);
  }

  public final void setProperties(Map<String, Object> properties) {
    if (properties != null) {
      writeLock.lock();
      try {
        this.backingMap.clear();
        this.backingMap.putAll(properties);
      } finally {
        writeLock.unlock();
      }
    }
  }

  @Override
  public int hashCode() {
    readLock.lock();
    try {
      return this.backingMap.isEmpty() ? 0 : this.backingMap.hashCode();
    } finally {
      readLock.unlock();
    }
  }

  @Override
  public int size() {
    readLock.lock();
    try {
      return this.backingMap.size();
    } finally {
      readLock.unlock();
    }
  }

  @Override
  public boolean isEmpty() {
    readLock.lock();
    try {
      return this.backingMap.isEmpty();
    } finally {
      readLock.unlock();
    }
  }

  @Override
  public boolean containsKey(Object key) {
    Assert.isInstanceOf(String.class, key);
    readLock.lock();
    try {
      return this.backingMap.containsKey(key);
    } finally {
      readLock.unlock();
    }
  }

  @Override
  public boolean containsValue(Object value) {
    readLock.lock();
    try {
      return this.backingMap.containsValue(value);
    } finally {
      readLock.unlock();
    }
  }

  @Override
  public Object get(Object key) {
    Assert.isInstanceOf(String.class, key);
    readLock.lock();
    try {
      return this.backingMap.get(key);
    } finally {
      readLock.unlock();
    }
  }

  @Override
  public Object put(String key, Object value) {
    writeLock.lock();
    Object previous;
    try {
      previous = this.backingMap.put(key, value);
    } finally {
      writeLock.unlock();
    }
    return previous;
  }

  @Override
  public Object remove(Object key) {
    Assert.isInstanceOf(String.class, key);
    writeLock.lock();
    try {
      Object object = this.backingMap.remove(key);
      return object;
    } finally {
      writeLock.unlock();
    }
  }

  @Override
  public void putAll(Map<? extends String, ?> m) {
    if (Collections.isEmpty(m)) {
      return;
    }
    writeLock.lock();
    try {
      this.backingMap.putAll(m);
    } finally {
      writeLock.unlock();
    }
  }

  @Override
  public void clear() {
    writeLock.lock();
    try {
      this.backingMap.clear();
    } finally {
      writeLock.unlock();
    }
  }

  @Override
  public Set<String> keySet() {
    readLock.lock();
    try {
      Set<String> keys = this.backingMap.keySet();
      return new LinkedHashSet<>(keys);
    } finally {
      readLock.unlock();
    }
  }

  @Override
  public Collection<Object> values() {
    readLock.lock();
    try {
      return this.backingMap.values();
    } finally {
      readLock.unlock();
    }
  }

  @Override
  public Set<Entry<String, Object>> entrySet() {
    readLock.lock();
    try {
      return this.backingMap.entrySet();
    } finally {
      readLock.unlock();
    }
  }

  @Override
  public boolean equals(Object o) {
    if (!(o instanceof Enlistment)) {
      return false;
    }
    Enlistment other = (Enlistment) o;
    readLock.lock();
    try {
      other.readLock.lock();
      try {
        return this.backingMap.equals(other);
      } finally {
        other.readLock.unlock();
      }
    } finally {
      readLock.unlock();
    }
  }

}


text:
using System.Threading.Tasks;
namespace SignalR
{
    public interface IGroupManager
    {
        Task AddToGroup(string connectionId, string groupName);
        Task RemoveFromGroup(string connectionId, string groupName);
    }
}


text:
import { Network } from './types/network.type';
import { NetworkConfig } from './types/network-config.type';
import { ConnectionInfo } from './types/connection-info.type';
import { HotspotDevice } from './types/hotspot-device.type';
/**
 * @name Hotspot
 * @description
 * @usage
 * ```js
 * import {Hotspot, Network} from 'ionic-native';
 *
 * ...
 *     Hotspot.scanWifi().then((networks: Array<Network>) => {
 *         console.log(networks);
 *     });
 * ...
 *
 * ```
 */
export declare class Hotspot {
    static isAvailable(): Promise<boolean>;
    static toggleWifi(): Promise<boolean>;
    /**
     * Configures and starts hotspot with SSID and Password
     *
     * @param {string}    SSID        - SSID of your new Access Point
     * @param {string}    mode        - encryption mode (Open, WEP, WPA, WPA_PSK)
     * @param {string}    password    - password for your new Access Point
     *
     * @return {Promise<void>}        - Promise to call once hotspot is started, or reject upon failure
     */
    static createHotspot(ssid: string, mode: string, password: string): Promise<void>;
    /**
     * Turns on Access Point
     *
     * @return {Promise<boolean>} - true if AP is started
     */
    static startHotspot(): Promise<boolean>;
    /**
     * Configures hotspot with SSID and Password
     *
     * @param {string}    SSID        - SSID of your new Access Point
     * @param {string}    mode        - encryption mode (Open, WEP, WPA, WPA_PSK)
     * @param {string}    password    - password for your new Access Point
     *
     * @return {Promise<void>}        - Promise to call when hotspot is configured, or reject upon failure
     */
    static configureHotspot(ssid: string, mode: string, password: string): Promise<void>;
    /**
     * Turns off Access Point
     *
     * @return {Promise<boolean>} - Promise to turn off the hotspot, true on success, false on failure
     */
    static stopHotspot(): Promise<boolean>;
    /**
     * Checks if hotspot is enabled
     *
     * @return {Promise<void>}    - Promise that hotspot is enabled, rejected if it is not enabled
     */
    static isHotspotEnabled(): Promise<void>;
    static getAllHotspotDevices(): Promise<Array<HotspotDevice>>;
    /**
     * Connect to a WiFi network
     *
     * @param {string}    ssid
     *      SSID to connect
     * @param {string}    password
     *      password to use
     *
     * @return {Promise<void>}
     *      Promise that connection to the WiFi network was successfull, rejected if unsuccessful
     */
    static connectToWifi(ssid: string, password: string): Promise<void>;
    /**
     * Connect to a WiFi network
     *
     * @param {string}   ssid
     *      SSID to connect
     * @param {string}   password
     *      Password to use
     * @param {string}   authentication
     *      Authentication modes to use (LEAP, SHARED, OPEN)
     * @param {string[]} encryption
     *      Encryption modes to use (CCMP, TKIP, WEP104, WEP40)
     *
     * @return {Promise<void>}
     *      Promise that connection to the WiFi network was successfull, rejected if unsuccessful
     */
    static connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: Array<string>): Promise<void>;
    /**
     * Add a WiFi network
     *
     * @param {string}    ssid
     *      SSID of network
     * @param {string}    mode
     *      Authentication mode of (Open, WEP, WPA, WPA_PSK)
     * @param {string}    password
     *      Password for network
     *
     * @return {Promise<void>}
     *      Promise that adding the WiFi network was successfull, rejected if unsuccessful
     */
    static addWifiNetwork(ssid: string, mode: string, password: string): Promise<void>;
    /**
     * Remove a WiFi network
     *
     * @param {string}    ssid
     *      SSID of network
     *
     * @return {Promise<void>}
     *      Promise that removing the WiFi network was successfull, rejected if unsuccessful
     */
    static removeWifiNetwork(ssid: string): Promise<void>;
    static isConnectedToInternet(): Promise<boolean>;
    static isConnectedToInternetViaWifi(): Promise<boolean>;
    static isWifiOn(): Promise<boolean>;
    static isWifiSupported(): Promise<boolean>;
    static isWifiDirectSupported(): Promise<boolean>;
    static scanWifi(): Promise<Array<Network>>;
    static scanWifiByLevel(): Promise<Array<Network>>;
    static startWifiPeriodicallyScan(interval: number, duration: number): Promise<any>;
    static stopWifiPeriodicallyScan(): Promise<any>;
    static getNetConfig(): Promise<NetworkConfig>;
    static getConnectionInfo(): Promise<ConnectionInfo>;
    static pingHost(ip: string): Promise<string>;
    /**
     * Gets MAC Address associated with IP Address from ARP File
     *
     * @param {string}        ip  - IP Address that you want the MAC Address of
     *
     * @return {Promise<string>}  - A Promise for the MAC Address
     */
    static getMacAddressOfHost(ip: string): Promise<string>;
    /**
     * Checks if IP is live using DNS
     *
     * @param {string}        ip  - IP Address you want to test
     *
     * @return {Promise<boolean>} - A Promise for whether the IP Address is reachable
     */
    static isDnsLive(ip: string): Promise<boolean>;
    /**
     * Checks if IP is live using socket And PORT
     *
     * @param {string}        ip  - IP Address you want to test
     *
     * @return {Promise<boolean>} - A Promise for whether the IP Address is reachable
     */
    static isPortLive(ip: string): Promise<boolean>;
    /**
     * Checks if device is rooted
     *
     * @return {Promise<boolean>} - A Promise for whether the device is rooted
     */
    static isRooted(): Promise<boolean>;
}


text:
package org.apache.activemq.artemis.tests.integration.journal;

import java.io.File;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;

import org.apache.activemq.artemis.ArtemisConstants;
import org.apache.activemq.artemis.core.io.SequentialFileFactory;
import org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory;
import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory;
import org.apache.activemq.artemis.core.journal.LoaderCallback;
import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
import org.apache.activemq.artemis.core.journal.RecordInfo;
import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
import org.apache.activemq.artemis.jlibaio.LibaioContext;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.apache.activemq.artemis.tests.util.SpawnedVMSupport;
import org.junit.Assert;
import org.junit.Test;

/**
 * This test spawns a remote VM, as we want to "crash" the VM right after the journal is filled with data
 */
public class ValidateTransactionHealthTest extends ActiveMQTestBase {

   private static final int OK = 10;

   @Test
   public void testAIO() throws Exception {
      internalTest("aio", getTestDir(), 10000, 100, true, true, 1);
   }

   @Test
   public void testAIOHugeTransaction() throws Exception {
      internalTest("aio", getTestDir(), 10000, 10000, true, true, 1);
   }

   @Test
   public void testAIOMultiThread() throws Exception {
      internalTest("aio", getTestDir(), 1000, 100, true, true, 10);
   }

   @Test
   public void testAIONonTransactionalNoExternalProcess() throws Exception {
      internalTest("aio", getTestDir(), 1000, 0, true, false, 10);
   }

   @Test
   public void testNIO() throws Exception {
      internalTest("nio", getTestDir(), 10000, 100, true, true, 1);
   }

   @Test
   public void testNIOHugeTransaction() throws Exception {
      internalTest("nio", getTestDir(), 10000, 10000, true, true, 1);
   }

   @Test
   public void testNIOMultiThread() throws Exception {
      internalTest("nio", getTestDir(), 1000, 100, true, true, 10);
   }

   @Test
   public void testNIONonTransactional() throws Exception {
      internalTest("nio", getTestDir(), 10000, 0, true, true, 1);
   }

   @Test
   public void testNIO2() throws Exception {
      internalTest("nio2", getTestDir(), 10000, 100, true, true, 1);
   }

   @Test
   public void testNIO2HugeTransaction() throws Exception {
      internalTest("nio2", getTestDir(), 10000, 10000, true, true, 1);
   }

   @Test
   public void testNIO2MultiThread() throws Exception {
      internalTest("nio2", getTestDir(), 1000, 100, true, true, 10);
   }

   @Test
   public void testNIO2NonTransactional() throws Exception {
      internalTest("nio2", getTestDir(), 10000, 0, true, true, 1);
   }

   // Package protected ---------------------------------------------

   private void internalTest(final String type,
                             final String journalDir,
                             final long numberOfRecords,
                             final int transactionSize,
                             final boolean append,
                             final boolean externalProcess,
                             final int numberOfThreads) throws Exception {
      try {
         if (type.equals("aio") && !LibaioContext.isLoaded()) {
            // Using System.out as this output will go towards junit report
            System.out.println("AIO not found, test being ignored on this platform");
            return;
         }

         // This property could be set to false for debug purposes.
         if (append) {
            if (externalProcess) {
               Process process = SpawnedVMSupport.spawnVM(ValidateTransactionHealthTest.class.getCanonicalName(), type, journalDir, Long.toString(numberOfRecords), Integer.toString(transactionSize), Integer.toString(numberOfThreads));
               process.waitFor();
               Assert.assertEquals(ValidateTransactionHealthTest.OK, process.exitValue());
            }
            else {
               JournalImpl journal = ValidateTransactionHealthTest.appendData(type, journalDir, numberOfRecords, transactionSize, numberOfThreads);
               journal.stop();
            }
         }

         reload(type, journalDir, numberOfRecords, numberOfThreads);
      }
      finally {
         File file = new File(journalDir);
         deleteDirectory(file);
      }
   }

   private void reload(final String type,
                       final String journalDir,
                       final long numberOfRecords,
                       final int numberOfThreads) throws Exception {
      JournalImpl journal = ValidateTransactionHealthTest.createJournal(type, journalDir);

      journal.start();
      Loader loadTest = new Loader(numberOfRecords);
      journal.load(loadTest);
      Assert.assertEquals(numberOfRecords * numberOfThreads, loadTest.numberOfAdds);
      Assert.assertEquals(0, loadTest.numberOfPreparedTransactions);
      Assert.assertEquals(0, loadTest.numberOfUpdates);
      Assert.assertEquals(0, loadTest.numberOfDeletes);

      journal.stop();

      if (loadTest.ex != null) {
         throw loadTest.ex;
      }
   }

   // Inner classes -------------------------------------------------

   static class Loader implements LoaderCallback {

      int numberOfPreparedTransactions = 0;

      int numberOfAdds = 0;

      int numberOfDeletes = 0;

      int numberOfUpdates = 0;

      long expectedRecords = 0;

      Exception ex = null;

      long lastID = 0;

      public Loader(final long expectedRecords) {
         this.expectedRecords = expectedRecords;
      }

      @Override
      public void addPreparedTransaction(final PreparedTransactionInfo preparedTransaction) {
         numberOfPreparedTransactions++;

      }

      @Override
      public void addRecord(final RecordInfo info) {
         if (info.id == lastID) {
            System.out.println("id = " + info.id + " last id = " + lastID);
         }

         ByteBuffer buffer = ByteBuffer.wrap(info.data);
         long recordValue = buffer.getLong();

         if (recordValue != info.id) {
            ex = new Exception("Content not as expected (" + recordValue + " != " + info.id + ")");

         }

         lastID = info.id;
         numberOfAdds++;

      }

      @Override
      public void deleteRecord(final long id) {
         numberOfDeletes++;

      }

      @Override
      public void updateRecord(final RecordInfo info) {
         numberOfUpdates++;

      }

      @Override
      public void failedTransaction(final long transactionID,
                                    final List<RecordInfo> records,
                                    final List<RecordInfo> recordsToDelete) {
      }

   }

   // Remote part of the test =================================================================

   public static void main(final String[] args) throws Exception {

      if (args.length != 5) {
         System.err.println("Use: java -cp <classpath> " + ValidateTransactionHealthTest.class.getCanonicalName() +
                               " aio|nio <journalDirectory> <NumberOfElements> <TransactionSize> <NumberOfThreads>");
         System.exit(-1);
      }
      System.out.println("Running");
      String journalType = args[0];
      String journalDir = args[1];
      long numberOfElements = Long.parseLong(args[2]);
      int transactionSize = Integer.parseInt(args[3]);
      int numberOfThreads = Integer.parseInt(args[4]);

      try {
         ValidateTransactionHealthTest.appendData(journalType, journalDir, numberOfElements, transactionSize, numberOfThreads);

         // We don't stop the journal on the case of an external process...
         // The test is making sure that committed data can be reloaded fine...
         // i.e. commits are sync on disk as stated on the transaction.
         // The journal shouldn't leave any state impeding reloading the server
      }
      catch (Exception e) {
         e.printStackTrace(System.out);
         System.exit(-1);
      }

      // Simulating a crash on the system right after the data was committed.
      Runtime.getRuntime().halt(ValidateTransactionHealthTest.OK);
   }

   public static JournalImpl appendData(final String journalType,
                                        final String journalDir,
                                        final long numberOfElements,
                                        final int transactionSize,
                                        final int numberOfThreads) throws Exception {
      final JournalImpl journal = ValidateTransactionHealthTest.createJournal(journalType, journalDir);

      journal.start();
      journal.load(new LoaderCallback() {

         @Override
         public void addPreparedTransaction(final PreparedTransactionInfo preparedTransaction) {
         }

         @Override
         public void addRecord(final RecordInfo info) {
         }

         @Override
         public void deleteRecord(final long id) {
         }

         @Override
         public void updateRecord(final RecordInfo info) {
         }

         @Override
         public void failedTransaction(final long transactionID,
                                       final List<RecordInfo> records,
                                       final List<RecordInfo> recordsToDelete) {
         }
      });

      LocalThread[] threads = new LocalThread[numberOfThreads];
      final AtomicLong sequenceTransaction = new AtomicLong();

      for (int i = 0; i < numberOfThreads; i++) {
         threads[i] = new LocalThread(journal, numberOfElements, transactionSize, sequenceTransaction);
         threads[i].start();
      }

      Exception e = null;
      for (LocalThread t : threads) {
         t.join();

         if (t.e != null) {
            e = t.e;
         }
      }

      if (e != null) {
         throw e;
      }

      return journal;
   }

   public static JournalImpl createJournal(final String journalType, final String journalDir) {
      JournalImpl journal = new JournalImpl(10485760, 2, 2, 0, 0, ValidateTransactionHealthTest.getFactory(journalType, journalDir), "journaltst", "tst", 500);
      return journal;
   }

   public static SequentialFileFactory getFactory(final String factoryType, final String directory) {
      if (factoryType.equals("aio")) {
         return new AIOSequentialFileFactory(new File(directory), ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, 10, false);
      }
      else if (factoryType.equals("nio2")) {
         return new NIOSequentialFileFactory(new File(directory), true, 1);
      }
      else {
         return new NIOSequentialFileFactory(new File(directory), false, 1);
      }
   }

   static class LocalThread extends Thread {

      final JournalImpl journal;

      final long numberOfElements;

      final int transactionSize;

      final AtomicLong nextID;

      Exception e;

      public LocalThread(final JournalImpl journal,
                         final long numberOfElements,
                         final int transactionSize,
                         final AtomicLong nextID) {
         super();
         this.journal = journal;
         this.numberOfElements = numberOfElements;
         this.transactionSize = transactionSize;
         this.nextID = nextID;
      }

      @Override
      public void run() {
         try {
            int transactionCounter = 0;

            long transactionId = nextID.incrementAndGet();

            for (long i = 0; i < numberOfElements; i++) {

               long id = nextID.incrementAndGet();

               ByteBuffer buffer = ByteBuffer.allocate(512 * 3);
               buffer.putLong(id);

               if (transactionSize != 0) {
                  journal.appendAddRecordTransactional(transactionId, id, (byte) 99, buffer.array());

                  if (++transactionCounter == transactionSize) {
                     System.out.println("Commit transaction " + transactionId);
                     journal.appendCommitRecord(transactionId, true);
                     transactionCounter = 0;
                     transactionId = nextID.incrementAndGet();
                  }
               }
               else {
                  journal.appendAddRecord(id, (byte) 99, buffer.array(), false);
               }
            }

            if (transactionCounter != 0) {
               journal.appendCommitRecord(transactionId, true);
            }

            if (transactionSize == 0) {
               journal.debugWait();
            }
         }
         catch (Exception e) {
            this.e = e;
         }

      }
   }

}


text:
export default {
    type: {
        showText: 'cat-action-show-text',
        setTexting: 'cat-action-set-texting'
    },
    model: {
        screen: {
            width: 'screen.width',
            height: 'screen.height',
        },
        corner: {
            node: 'corner.model',
            screen: 'corner.screen'
        },
        state: {
            is: {
                texting: 'state.is.texting'
            }
        },
        tween: {
            moveToAnimated: 'tween.moveToAnimated',
            texting: 'tween.texting'
        },
        text: {
            promise: {
                sequence: {
                    promise: 'text.promise.sequence.promise',
                    resolve: 'text.promise.sequence.resolve',
                    reject: 'text.promise.sequence.reject'
                }
            },
            current: 'text.current',
            currentTextIndex: 'text.currentTextIndex',
        },
        node: {
            width: 'node.width',
            height: 'node.height',
            halfWidth: 'node.halfWidth',
            halfHeight: 'node.halfHeight'
        }
    }
};


text:
import { NotificationType } from './notification-type.enum'
import { Snippet } from '../../snippet/interfaces/snippet'
import { User } from '../../core/interfaces/user/user'
import { Request } from '../../request/interfaces/request'
import { Observable } from 'rxjs/Observable'

export interface Notification {
    id: string
    type: NotificationType
    user: Observable<User>
    snippetName: string
    snippetId: string
    request?: boolean
    requestId?: string
    language?: string
    read: boolean
    date: Date
}


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**connect_url** | **string** | URL to the settings screen to connect.  Null if the provider is already connected. | [optional]
**list_count** | **int** | list_count | [optional]
**lists** | [**\ultracart\v2\models\EmailThirdPartyList[]**](EmailThirdPartyList.md) | lists | [optional]
**logo_url** | **string** | logo_url | [optional]
**name** | **string** | name | [optional]
**supports_add_tags** | **bool** | True if this provider can support adding tags | [optional]
**supports_list_subscribe** | **bool** | True if this provider can support list subscribe | [optional]
**supports_list_unsubscribe** | **bool** | True if this provider can support list unsubscribe | [optional]
**supports_remove_tags** | **bool** | True if this provider can support remove tags | [optional]
**tag_count** | **int** | tag_count | [optional]
**tags** | [**\ultracart\v2\models\EmailThirdPartyTag[]**](EmailThirdPartyTag.md) | tags | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
UIDatePicker::UIDatePicker() {
}

void UIDatePicker::InitFromXIB(XIBObject* obj) {
    UIControl::InitFromXIB(obj);

    _outputClassName = "UIDatePicker";
}

void UIDatePicker::InitFromStory(XIBObject* obj) {
    UIControl::InitFromStory(obj);

    _outputClassName = "UIDatePicker";
}

void UIDatePicker::ConvertStaticMappings(NIBWriter* writer, XIBObject* obj) {
    UIControl::ConvertStaticMappings(writer, obj);
}


text:
class GerdaoMailer < ApplicationMailer

  default from: "Email@email.com"

end


text:
    margin-top: 50px;
}

#parameter-box,
#signin-panel {
    margin-top: 20px;
}

a.navbar-brand:link,
a.navbar-brand:visited,
a.navbar-brand:active,
a.navbar-brand:hover {
    color: #ffffff;
}

.jumbotron {
    background-image: url('/images/doctor-563428.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    padding-top: 100px;
    padding-bottom: 100px;
    text-align: center;
    color: #ffffff;
}

.jumbotron .hk-title {
    font-weight: bold;
}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="HandheldFriendly" content="True" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="robots" content="index, follow" />

  <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,400;0,700;1,400&family=Source+Sans+Pro:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="https://ptyagicodecamp.github.io/theme/stylesheet/style.min.css">

    <link id="pygments-light-theme" rel="stylesheet" type="text/css"
          href="https://ptyagicodecamp.github.io/theme/pygments/monokai.min.css">

  <link rel="stylesheet" type="text/css" href="https://ptyagicodecamp.github.io/theme/font-awesome/css/fontawesome.css">
  <link rel="stylesheet" type="text/css" href="https://ptyagicodecamp.github.io/theme/font-awesome/css/brands.css">
  <link rel="stylesheet" type="text/css" href="https://ptyagicodecamp.github.io/theme/font-awesome/css/solid.css">

    <link href="https://ptyagicodecamp.github.io/static/custom.css" rel="stylesheet">

    <link href="https://ptyagicodecamp.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="tech&Life Atom">

    <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
    <link rel="icon" href="/images/favicon.ico" type="image/x-icon">

    <meta name="theme-color" content="#333333">

    <meta name="msapplication-navbutton-color" content="#333333">

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

    <meta name="msapplication-TileColor" content="#333333">

<meta name="author" content="ptyagi" />
<meta name="description" content="Code recipe for implementing AnimatedPositioned Flutter widget." />
<meta name="keywords" content="AnimatedPositioned, cross-platform, flutter, code-recipes, android, android Studio, iOS, development">

<meta property="og:site_name" content="tech&Life"/>
<meta property="og:title" content="Animating using AnimatedPositioned Flutter widget"/>
<meta property="og:description" content="Code recipe for implementing AnimatedPositioned Flutter widget."/>
<meta property="og:locale" content="en_US"/>
<meta property="og:url" content="https://ptyagicodecamp.github.io/animating-using-animatedpositioned-flutter-widget.html"/>
<meta property="og:type" content="article"/>
<meta property="article:published_time" content="2019-11-14 13:33:00-05:00"/>
<meta property="article:modified_time" content=""/>
<meta property="article:author" content="https://ptyagicodecamp.github.io/author/ptyagi.html">
<meta property="article:section" content="Flutter"/>
<meta property="article:tag" content="AnimatedPositioned"/>
<meta property="article:tag" content="cross-platform"/>
<meta property="article:tag" content="flutter"/>
<meta property="article:tag" content="code-recipes"/>
<meta property="article:tag" content="android"/>
<meta property="article:tag" content="android Studio"/>
<meta property="article:tag" content="iOS"/>
<meta property="article:tag" content="development"/>
<meta property="og:image" content="https://ptyagicodecamp.github.io/images/profile.jpg">

  <title>tech&Life – Animating using AnimatedPositioned Flutter widget</title>

        tech&Life

Explore | Life | Mobile | Software Engineering

              Support

              Codementor

      Home

      Archives
      Categories
      Tags

      Atom

Animating using AnimatedPositioned Flutter widget

      Posted on November 14, 2019 in Flutter

Introduction

AnimatedPositioned widget is the animated version of the Positioned widget.

In this article, we'll see how AnimatedPositioned widget is used to animate an image in it. We'll observe animation behavior for various types of curves.

Target Audience: Beginner

Recipe: Animating an image in AnimatedPositioned widget.

Focus Widget: AnimatedPositioned

Goal: Animate an image inside AnimatedPositioned using various types given AnimationCurves

AnimationCurves:

Checkout YouTube video:

Structure of AnimatedPositioned widget

AnimatedPositioned uses duration and curve properties to animate from previous position to a new position. The duration value controls how long animation would take whereas curve property's value provides the type of animation Curve

AnimatedPositioned(
      width: selected ? 400.0 : 200.0,
      height: selected ? 200.0 : 400.0,
      duration: Duration(seconds: 2),
      curve: dropDownValue != null ? dropDownValue.curveCubic : Curves.linear,
      child: Image.asset('assets/images/sea.jpg'),
    ),

Recipe's Code Structure

I'm using a drop down to choose the different type of curve. Animation curves used in this code recipe are available in the source code as well as here.

AnimatedPositioned needs to be implemented inside a StatefulWidget since it can only animate when position is changed.

AnimationCurve dropDownValue holds the current selection from the AnimationCurves drop down widget.

class AnimatedPositionedDemo extends StatefulWidget {
  @override
  _AnimatedPositionedDemoState createState() => _AnimatedPositionedDemoState();
}

class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
  AnimationCurve dropDownValue;
  bool selected = false;

  ...
}

Boolean selected keeps track of when 'Animate' button is pressed or image is touched.

'Animate' button next to dropDown widget. It updates the value of selected as below:

Widget playAnimation(BuildContext context) {
  return RaisedButton(
    color: Colors.blueAccent,
    child: Text("Animate"),
    onPressed: () => setState(() {
      selected = !selected;
    }),
  );
}

Implementing AnimatedPositioned widget

AnimatedPositioned widget's default position or width / height are  200.0 and 400.0 respectively. When user presses 'Animate' button for a selected Curve type in dropDown widget, position or width and height are updated to 400.0 and 200.0 respectively. AnimatedPositioned updates its position to a new value with in 2 seconds as provided in duration attribute using current selection for curve property.

Widget animatedPositionedWidget(BuildContext context) {
  return AnimatedPositioned(
    width: selected ? 400.0 : 200.0,
    height: selected ? 200.0 : 400.0,
    duration: Duration(seconds: 2),
    curve: dropDownValue != null ? dropDownValue.curveCubic : Curves.linear,
    child: Image.asset('assets/images/sea.jpg'),
  );
}

I encourage you to Checkout the code below, and play around with different types of Curve animations to pick an animation that would work best for you.

Source code repo

AnimatedPositioned code recipe is available here

Source code for all other animation code recipes is available here

References:

AnimatedPositioned

Animation Curves

Happy cooking with Flutter :)

Liked the article ?
Couldn't find a topic of your interest ? Please leave comments or email me about topics you would like me to write !
BTW I love cupcakes and coffee both :)

      AnimatedPositioned
      cross-platform
      flutter
      code-recipes
      android
      android Studio
      iOS
      development

Like this article? Share it with your friends!

    Please enable JavaScript to view comments.

  © 2022  - This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

Built with Pelican using Flex theme

    <svg width="80"
         height="80"
         viewBox="0 0 250 250"
         style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;"
         aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor"
              style="transform-origin: 130px 106px;"
              class="octo-arm">
        </path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor"
              class="octo-body">
        </path>
    </svg>


text:
// $Date: 2014-04-04 16:35:38 +0400 (Пт., 04 апр. 2014) $
// $Revision: 906 $

#ifndef __pyhrol_type_base_h__
#define __pyhrol_type_base_h__

#include <vector>
#include <map>
#include <ostream>

#include <pyport.h>
#include <object.h>
#include <methodobject.h>
#include <descrobject.h>

#include "pyhrol_tuples.h"
#include "pyhrol_exception_handler.h"
#include "self_addressed_cstring.h"

namespace pyhrol
{

template <class T> class TypeBase
{
public:
  typedef T endosome_t;

  struct T_struct
  {
  private:
    PyObject_HEAD
  public:
    T endosome;
    inline operator PyObject *()
    {
      return reinterpret_cast<PyObject *>(this);
    }
  };

  struct argObject
  {
    PyTypeObject &cls;
    PyObject *pobj;

    inline argObject(PyObject *_pobj = NULL)
      : cls(m_get())
      , pobj(_pobj)
    {
    }

    inline operator T *() const
    {
      return &reinterpret_cast<typename TypeBase<T>::T_struct *>(pobj)->endosome;
    }
    inline operator T &() const
    {
      return reinterpret_cast<typename TypeBase<T>::T_struct *>(pobj)->endosome;
    }
    inline T *operator ->() const
    {
      return &reinterpret_cast<typename TypeBase<T>::T_struct *>(pobj)->endosome;
    }
    inline T *get() const
    {
      return &reinterpret_cast<typename TypeBase<T>::T_struct *>(pobj)->endosome;
    }
  };

  const char *name() const;
  operator PyTypeObject &();
  operator const PyTypeObject &() const;
  const PyTypeObject *operator ->() const;

  const size_t id;
  static const size_t endosome_offset;

  T_struct *allocate();
  void free(T_struct *) const throw();
  static T_struct *allocate_static();
  static void free_static(T_struct *) throw();

  virtual ~TypeBase();

protected:
  TypeBase(const char */*name*/, const char */*doc*/ = NULL);
  TypeBase();

  virtual const void *address(const T &) const = 0;
  virtual void constructor(T &, Tuples &) const;
  virtual void destructor(T &) const = 0;
  virtual void print(std::ostream &, const T &) const = 0;
  virtual const std::string repr(const T &) const = 0;
  virtual void str(std::ostream &, const T &) const = 0;

  PyTypeObject m_type_object;

  void m_add_method(const char */*name*/, const PyCFunction &/*_method*/, const char */*help*/, const int /*flags*/ = 0);
  void m_add_method(const char */*name*/, const PyCFunctionWithKeywords &/*_method*/, const char */*help*/, const int /*flags*/ = 0);
  void m_add_method(const char */*name*/, const PyNoArgsFunction &/*_method*/, const char */*help*/, const int /*flags*/ = 0);
  void m_add_getseter(const char */*name*/, const getter &/*_get*/, const setter &/*_set*/, const char */*doc*/);

  static TypeBase &m_get(TypeBase * = NULL);

private:
  TypeBase(const TypeBase &);
  TypeBase &operator= (const TypeBase &);

  void m_init(const char */*name*/, const char */*doc*/);

  static PyObject *mediator_constructor(PyTypeObject */*type*/, PyObject */*args*/, PyObject */*kwds*/);

  struct call_constructor: exceptionHandler
  {
    const bool is_probe;
    Tuples &args;
    PyTypeObject *ptype;
    PyObject *retval;
    const char * const signature;
    virtual void call();
    call_constructor(Tuples &, PyTypeObject *, const char *_signature, const bool);
  };

  struct call_destructor: exceptionHandler
  {
    PyObject *self;
    const char * const signature;
    const TypeBase<T> &type;
    virtual void call();
    call_destructor(PyObject *, const char *_signature);
  };

  struct call_print: exceptionHandler
  {
    const T &self;
    FILE *fp;
    const char * const signature;
    const TypeBase<T> &type;
    int retval;
    virtual void call();
    call_print(const PyObject *, FILE *, const char *_signature);
  };

  struct call_repr: exceptionHandler
  {
    const T &self;
    const char * const signature;
    const TypeBase<T> &type;
    PyObject *retval;
    virtual void call();
    call_repr(const PyObject *, const char *_signature);
  };

  struct call_str: exceptionHandler
  {
    const T &self;
    const char * const signature;
    const TypeBase<T> &type;
    PyObject *retval;
    virtual void call();
    call_str(const PyObject *, const char *_signature);
  };

  static void mediator_destructor(PyObject* self);
  static int mediator_print(PyObject *self, FILE *fp, int /*flags*/);
  static PyObject *mediator_repr(PyObject *self);
  static PyObject *mediator_str(PyObject *self);

  typedef std::vector<PyMethodDef> methods_t;
  typedef std::vector<PyGetSetDef> getseters_t;

  methods_t m_methods;
  getseters_t m_getseters;
};

} //namespace pyhrol

#endif //__pyhrol_type_base_h__


text:
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe OrganisationsController do
  before :each do
    login
    session[:organisation_id] = nil

    @payment_plan = PaymentPlans.create_payment_plan!
  end

  describe "edit" do
    def do_call
      get :edit, :id => @organisation.id
    end

    before :each do
      @organisation = Organisations.create_organisation! :users => [@user]
    end

    it_should_behave_like "it's successful"
    it_should_behave_like "it sets @current_organisation"

    it "should assign the organisation" do
      do_call
      assigns[:organisation].should == @organisation
    end
  end

  describe "update" do
    def do_call
      put :update, :id => @organisation.id,
        :organisation => {:name => @name}
    end

    before :each do
      @organisation = Organisations.create_organisation! :users => [@user]
    end

    it_should_behave_like "it sets @current_organisation"

    describe "success" do
      before :each do
        @name = 'some valid name'
      end

      it "should redirect to the organisations index" do
        do_call
        response.should redirect_to(organisations_url)
      end
    end

    describe "failure" do
      before :each do
        @name = ''
      end

      it "should re-render the edit page" do
        do_call
        response.should render_template('organisations/edit')
      end
    end
  end

  describe "new" do
    def do_call
      get :new
    end

    it "should instantiate a new organisation" do
      do_call
      assigns[:organisation].should be_an(Organisation)
    end

    it "should instantiate plans" do
      do_call
      assigns[:payment_plans].first.should be_a(PaymentPlan)
    end

    it_should_behave_like "it sets @current_organisation"
  end

  describe "create" do
    def do_call(params = {})
      post :create, :organisation => {
        :name => 'New name',
        :payment_plan_id => @payment_plan.id.to_s
      }.merge(params)
    end

    it_should_behave_like "it sets @current_organisation"

    describe "success" do
      it "should switch to the new organisation" do
        do_call
        organisation = Organisation.last(:order => 'id')
        session[:organisation_id].should == organisation.id
      end

      it "should redirect to the home url" do
        do_call
        response.should redirect_to(home_url)
      end

      it "should create a new organisation" do
        lambda {do_call}.should change(Organisation, :count).by(1)
      end

      it "should assign the organisation to the user" do
        do_call
        Organisation.last(:order => 'id').users.should == [@user]
      end
    end

    describe "failure" do
      it "should re-render the new page" do
        do_call :name => ''
        response.should render_template('organisations/new')
      end

      it "should not create an organisation" do
        lambda {do_call(:name => '')}.should_not change(Organisation, :count)
      end

      it "should assign payment plans" do
        do_call :name => ''
        assigns[:payment_plans].first.should be_a(PaymentPlan)
      end
    end
  end

  describe "index" do
    def do_call
      get :index
    end

    it "should assign the user's organisations" do
      do_call
      assigns[:organisations].should == @user.organisations
    end

    it_should_behave_like "it sets @current_organisation"
  end
end