text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/devtools/cloudbuild/v1/cloudbuild.proto

package com.google.cloudbuild.v1;

/**
 *
 *
 *

 * Artifact uploaded using the PythonPackage directive.
 *

 *
 * Protobuf type {@code google.devtools.cloudbuild.v1.UploadedPythonPackage}
 */
public final class UploadedPythonPackage extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v1.UploadedPythonPackage)
    UploadedPythonPackageOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use UploadedPythonPackage.newBuilder() to construct.
  private UploadedPythonPackage(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private UploadedPythonPackage() {
    uri_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new UploadedPythonPackage();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloudbuild.v1.Cloudbuild
        .internal_static_google_devtools_cloudbuild_v1_UploadedPythonPackage_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloudbuild.v1.Cloudbuild
        .internal_static_google_devtools_cloudbuild_v1_UploadedPythonPackage_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloudbuild.v1.UploadedPythonPackage.class,
            com.google.cloudbuild.v1.UploadedPythonPackage.Builder.class);
  }

  public static final int URI_FIELD_NUMBER = 1;
  private volatile java.lang.Object uri_;
  /**
   *
   *
   *

   * URI of the uploaded artifact.
   *

   *
   * string uri = 1;
   *
   * @return The uri.
   */
  @java.lang.Override
  public java.lang.String getUri() {
    java.lang.Object ref = uri_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      uri_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * URI of the uploaded artifact.
   *

   *
   * string uri = 1;
   *
   * @return The bytes for uri.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getUriBytes() {
    java.lang.Object ref = uri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      uri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int FILE_HASHES_FIELD_NUMBER = 2;
  private com.google.cloudbuild.v1.FileHashes fileHashes_;
  /**
   *
   *
   *

   * Hash types and values of the Python Artifact.
   *

   *
   * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
   *
   * @return Whether the fileHashes field is set.
   */
  @java.lang.Override
  public boolean hasFileHashes() {
    return fileHashes_ != null;
  }
  /**
   *
   *
   *

   * Hash types and values of the Python Artifact.
   *

   *
   * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
   *
   * @return The fileHashes.
   */
  @java.lang.Override
  public com.google.cloudbuild.v1.FileHashes getFileHashes() {
    return fileHashes_ == null
        ? com.google.cloudbuild.v1.FileHashes.getDefaultInstance()
        : fileHashes_;
  }
  /**
   *
   *
   *

   * Hash types and values of the Python Artifact.
   *

   *
   * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
   */
  @java.lang.Override
  public com.google.cloudbuild.v1.FileHashesOrBuilder getFileHashesOrBuilder() {
    return getFileHashes();
  }

  public static final int PUSH_TIMING_FIELD_NUMBER = 3;
  private com.google.cloudbuild.v1.TimeSpan pushTiming_;
  /**
   *
   *
   *

   * Output only. Stores timing information for pushing the specified artifact.
   *

   *
   *
   * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return Whether the pushTiming field is set.
   */
  @java.lang.Override
  public boolean hasPushTiming() {
    return pushTiming_ != null;
  }
  /**
   *
   *
   *

   * Output only. Stores timing information for pushing the specified artifact.
   *

   *
   *
   * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The pushTiming.
   */
  @java.lang.Override
  public com.google.cloudbuild.v1.TimeSpan getPushTiming() {
    return pushTiming_ == null
        ? com.google.cloudbuild.v1.TimeSpan.getDefaultInstance()
        : pushTiming_;
  }
  /**
   *
   *
   *

   * Output only. Stores timing information for pushing the specified artifact.
   *

   *
   *
   * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  @java.lang.Override
  public com.google.cloudbuild.v1.TimeSpanOrBuilder getPushTimingOrBuilder() {
    return getPushTiming();
  }

  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 {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_);
    }
    if (fileHashes_ != null) {
      output.writeMessage(2, getFileHashes());
    }
    if (pushTiming_ != null) {
      output.writeMessage(3, getPushTiming());
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_);
    }
    if (fileHashes_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFileHashes());
    }
    if (pushTiming_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPushTiming());
    }
    size += getUnknownFields().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.google.cloudbuild.v1.UploadedPythonPackage)) {
      return super.equals(obj);
    }
    com.google.cloudbuild.v1.UploadedPythonPackage other =
        (com.google.cloudbuild.v1.UploadedPythonPackage) obj;

    if (!getUri().equals(other.getUri())) return false;
    if (hasFileHashes() != other.hasFileHashes()) return false;
    if (hasFileHashes()) {
      if (!getFileHashes().equals(other.getFileHashes())) return false;
    }
    if (hasPushTiming() != other.hasPushTiming()) return false;
    if (hasPushTiming()) {
      if (!getPushTiming().equals(other.getPushTiming())) return false;
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + URI_FIELD_NUMBER;
    hash = (53 * hash) + getUri().hashCode();
    if (hasFileHashes()) {
      hash = (37 * hash) + FILE_HASHES_FIELD_NUMBER;
      hash = (53 * hash) + getFileHashes().hashCode();
    }
    if (hasPushTiming()) {
      hash = (37 * hash) + PUSH_TIMING_FIELD_NUMBER;
      hash = (53 * hash) + getPushTiming().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage 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.google.cloudbuild.v1.UploadedPythonPackage parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage 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.google.cloudbuild.v1.UploadedPythonPackage parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage 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.google.cloudbuild.v1.UploadedPythonPackage 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;
  }
  /**
   *
   *
   *

   * Artifact uploaded using the PythonPackage directive.
   *

   *
   * Protobuf type {@code google.devtools.cloudbuild.v1.UploadedPythonPackage}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v1.UploadedPythonPackage)
      com.google.cloudbuild.v1.UploadedPythonPackageOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloudbuild.v1.Cloudbuild
          .internal_static_google_devtools_cloudbuild_v1_UploadedPythonPackage_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloudbuild.v1.Cloudbuild
          .internal_static_google_devtools_cloudbuild_v1_UploadedPythonPackage_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloudbuild.v1.UploadedPythonPackage.class,
              com.google.cloudbuild.v1.UploadedPythonPackage.Builder.class);
    }

    // Construct using com.google.cloudbuild.v1.UploadedPythonPackage.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      uri_ = "";

      if (fileHashesBuilder_ == null) {
        fileHashes_ = null;
      } else {
        fileHashes_ = null;
        fileHashesBuilder_ = null;
      }
      if (pushTimingBuilder_ == null) {
        pushTiming_ = null;
      } else {
        pushTiming_ = null;
        pushTimingBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloudbuild.v1.Cloudbuild
          .internal_static_google_devtools_cloudbuild_v1_UploadedPythonPackage_descriptor;
    }

    @java.lang.Override
    public com.google.cloudbuild.v1.UploadedPythonPackage getDefaultInstanceForType() {
      return com.google.cloudbuild.v1.UploadedPythonPackage.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloudbuild.v1.UploadedPythonPackage build() {
      com.google.cloudbuild.v1.UploadedPythonPackage result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloudbuild.v1.UploadedPythonPackage buildPartial() {
      com.google.cloudbuild.v1.UploadedPythonPackage result =
          new com.google.cloudbuild.v1.UploadedPythonPackage(this);
      result.uri_ = uri_;
      if (fileHashesBuilder_ == null) {
        result.fileHashes_ = fileHashes_;
      } else {
        result.fileHashes_ = fileHashesBuilder_.build();
      }
      if (pushTimingBuilder_ == null) {
        result.pushTiming_ = pushTiming_;
      } else {
        result.pushTiming_ = pushTimingBuilder_.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.google.cloudbuild.v1.UploadedPythonPackage) {
        return mergeFrom((com.google.cloudbuild.v1.UploadedPythonPackage) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloudbuild.v1.UploadedPythonPackage other) {
      if (other == com.google.cloudbuild.v1.UploadedPythonPackage.getDefaultInstance()) return this;
      if (!other.getUri().isEmpty()) {
        uri_ = other.uri_;
        onChanged();
      }
      if (other.hasFileHashes()) {
        mergeFileHashes(other.getFileHashes());
      }
      if (other.hasPushTiming()) {
        mergePushTiming(other.getPushTiming());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      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 {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                uri_ = input.readStringRequireUtf8();

                break;
              } // case 10
            case 18:
              {
                input.readMessage(getFileHashesFieldBuilder().getBuilder(), extensionRegistry);

                break;
              } // case 18
            case 26:
              {
                input.readMessage(getPushTimingFieldBuilder().getBuilder(), extensionRegistry);

                break;
              } // case 26
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private java.lang.Object uri_ = "";
    /**
     *
     *
     *

     * URI of the uploaded artifact.
     *

     *
     * string uri = 1;
     *
     * @return The uri.
     */
    public java.lang.String getUri() {
      java.lang.Object ref = uri_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        uri_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * URI of the uploaded artifact.
     *

     *
     * string uri = 1;
     *
     * @return The bytes for uri.
     */
    public com.google.protobuf.ByteString getUriBytes() {
      java.lang.Object ref = uri_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        uri_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * URI of the uploaded artifact.
     *

     *
     * string uri = 1;
     *
     * @param value The uri to set.
     * @return This builder for chaining.
     */
    public Builder setUri(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      uri_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * URI of the uploaded artifact.
     *

     *
     * string uri = 1;
     *
     * @return This builder for chaining.
     */
    public Builder clearUri() {

      uri_ = getDefaultInstance().getUri();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * URI of the uploaded artifact.
     *

     *
     * string uri = 1;
     *
     * @param value The bytes for uri to set.
     * @return This builder for chaining.
     */
    public Builder setUriBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      uri_ = value;
      onChanged();
      return this;
    }

    private com.google.cloudbuild.v1.FileHashes fileHashes_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloudbuild.v1.FileHashes,
            com.google.cloudbuild.v1.FileHashes.Builder,
            com.google.cloudbuild.v1.FileHashesOrBuilder>
        fileHashesBuilder_;
    /**
     *
     *
     *

     * Hash types and values of the Python Artifact.
     *

     *
     * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
     *
     * @return Whether the fileHashes field is set.
     */
    public boolean hasFileHashes() {
      return fileHashesBuilder_ != null || fileHashes_ != null;
    }
    /**
     *
     *
     *

     * Hash types and values of the Python Artifact.
     *

     *
     * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
     *
     * @return The fileHashes.
     */
    public com.google.cloudbuild.v1.FileHashes getFileHashes() {
      if (fileHashesBuilder_ == null) {
        return fileHashes_ == null
            ? com.google.cloudbuild.v1.FileHashes.getDefaultInstance()
            : fileHashes_;
      } else {
        return fileHashesBuilder_.getMessage();
      }
    }
    /**
     *
     *
     *

     * Hash types and values of the Python Artifact.
     *

     *
     * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
     */
    public Builder setFileHashes(com.google.cloudbuild.v1.FileHashes value) {
      if (fileHashesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        fileHashes_ = value;
        onChanged();
      } else {
        fileHashesBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     *

     * Hash types and values of the Python Artifact.
     *

     *
     * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
     */
    public Builder setFileHashes(com.google.cloudbuild.v1.FileHashes.Builder builderForValue) {
      if (fileHashesBuilder_ == null) {
        fileHashes_ = builderForValue.build();
        onChanged();
      } else {
        fileHashesBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     *

     * Hash types and values of the Python Artifact.
     *

     *
     * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
     */
    public Builder mergeFileHashes(com.google.cloudbuild.v1.FileHashes value) {
      if (fileHashesBuilder_ == null) {
        if (fileHashes_ != null) {
          fileHashes_ =
              com.google.cloudbuild.v1.FileHashes.newBuilder(fileHashes_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          fileHashes_ = value;
        }
        onChanged();
      } else {
        fileHashesBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     *

     * Hash types and values of the Python Artifact.
     *

     *
     * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
     */
    public Builder clearFileHashes() {
      if (fileHashesBuilder_ == null) {
        fileHashes_ = null;
        onChanged();
      } else {
        fileHashes_ = null;
        fileHashesBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     *

     * Hash types and values of the Python Artifact.
     *

     *
     * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
     */
    public com.google.cloudbuild.v1.FileHashes.Builder getFileHashesBuilder() {

      onChanged();
      return getFileHashesFieldBuilder().getBuilder();
    }
    /**
     *
     *
     *

     * Hash types and values of the Python Artifact.
     *

     *
     * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
     */
    public com.google.cloudbuild.v1.FileHashesOrBuilder getFileHashesOrBuilder() {
      if (fileHashesBuilder_ != null) {
        return fileHashesBuilder_.getMessageOrBuilder();
      } else {
        return fileHashes_ == null
            ? com.google.cloudbuild.v1.FileHashes.getDefaultInstance()
            : fileHashes_;
      }
    }
    /**
     *
     *
     *

     * Hash types and values of the Python Artifact.
     *

     *
     * .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloudbuild.v1.FileHashes,
            com.google.cloudbuild.v1.FileHashes.Builder,
            com.google.cloudbuild.v1.FileHashesOrBuilder>
        getFileHashesFieldBuilder() {
      if (fileHashesBuilder_ == null) {
        fileHashesBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloudbuild.v1.FileHashes,
                com.google.cloudbuild.v1.FileHashes.Builder,
                com.google.cloudbuild.v1.FileHashesOrBuilder>(
                getFileHashes(), getParentForChildren(), isClean());
        fileHashes_ = null;
      }
      return fileHashesBuilder_;
    }

    private com.google.cloudbuild.v1.TimeSpan pushTiming_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloudbuild.v1.TimeSpan,
            com.google.cloudbuild.v1.TimeSpan.Builder,
            com.google.cloudbuild.v1.TimeSpanOrBuilder>
        pushTimingBuilder_;
    /**
     *
     *
     *

     * Output only. Stores timing information for pushing the specified artifact.
     *

     *
     *
     * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     *
     *
     * @return Whether the pushTiming field is set.
     */
    public boolean hasPushTiming() {
      return pushTimingBuilder_ != null || pushTiming_ != null;
    }
    /**
     *
     *
     *

     * Output only. Stores timing information for pushing the specified artifact.
     *

     *
     *
     * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     *
     *
     * @return The pushTiming.
     */
    public com.google.cloudbuild.v1.TimeSpan getPushTiming() {
      if (pushTimingBuilder_ == null) {
        return pushTiming_ == null
            ? com.google.cloudbuild.v1.TimeSpan.getDefaultInstance()
            : pushTiming_;
      } else {
        return pushTimingBuilder_.getMessage();
      }
    }
    /**
     *
     *
     *

     * Output only. Stores timing information for pushing the specified artifact.
     *

     *
     *
     * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     *
     */
    public Builder setPushTiming(com.google.cloudbuild.v1.TimeSpan value) {
      if (pushTimingBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        pushTiming_ = value;
        onChanged();
      } else {
        pushTimingBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     *

     * Output only. Stores timing information for pushing the specified artifact.
     *

     *
     *
     * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     *
     */
    public Builder setPushTiming(com.google.cloudbuild.v1.TimeSpan.Builder builderForValue) {
      if (pushTimingBuilder_ == null) {
        pushTiming_ = builderForValue.build();
        onChanged();
      } else {
        pushTimingBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     *

     * Output only. Stores timing information for pushing the specified artifact.
     *

     *
     *
     * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     *
     */
    public Builder mergePushTiming(com.google.cloudbuild.v1.TimeSpan value) {
      if (pushTimingBuilder_ == null) {
        if (pushTiming_ != null) {
          pushTiming_ =
              com.google.cloudbuild.v1.TimeSpan.newBuilder(pushTiming_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          pushTiming_ = value;
        }
        onChanged();
      } else {
        pushTimingBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     *

     * Output only. Stores timing information for pushing the specified artifact.
     *

     *
     *
     * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     *
     */
    public Builder clearPushTiming() {
      if (pushTimingBuilder_ == null) {
        pushTiming_ = null;
        onChanged();
      } else {
        pushTiming_ = null;
        pushTimingBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     *

     * Output only. Stores timing information for pushing the specified artifact.
     *

     *
     *
     * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     *
     */
    public com.google.cloudbuild.v1.TimeSpan.Builder getPushTimingBuilder() {

      onChanged();
      return getPushTimingFieldBuilder().getBuilder();
    }
    /**
     *
     *
     *

     * Output only. Stores timing information for pushing the specified artifact.
     *

     *
     *
     * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     *
     */
    public com.google.cloudbuild.v1.TimeSpanOrBuilder getPushTimingOrBuilder() {
      if (pushTimingBuilder_ != null) {
        return pushTimingBuilder_.getMessageOrBuilder();
      } else {
        return pushTiming_ == null
            ? com.google.cloudbuild.v1.TimeSpan.getDefaultInstance()
            : pushTiming_;
      }
    }
    /**
     *
     *
     *

     * Output only. Stores timing information for pushing the specified artifact.
     *

     *
     *
     * .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     *
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloudbuild.v1.TimeSpan,
            com.google.cloudbuild.v1.TimeSpan.Builder,
            com.google.cloudbuild.v1.TimeSpanOrBuilder>
        getPushTimingFieldBuilder() {
      if (pushTimingBuilder_ == null) {
        pushTimingBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloudbuild.v1.TimeSpan,
                com.google.cloudbuild.v1.TimeSpan.Builder,
                com.google.cloudbuild.v1.TimeSpanOrBuilder>(
                getPushTiming(), getParentForChildren(), isClean());
        pushTiming_ = null;
      }
      return pushTimingBuilder_;
    }

    @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:google.devtools.cloudbuild.v1.UploadedPythonPackage)
  }

  // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.UploadedPythonPackage)
  private static final com.google.cloudbuild.v1.UploadedPythonPackage DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloudbuild.v1.UploadedPythonPackage();
  }

  public static com.google.cloudbuild.v1.UploadedPythonPackage getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<UploadedPythonPackage> PARSER =
      new com.google.protobuf.AbstractParser<UploadedPythonPackage>() {
        @java.lang.Override
        public UploadedPythonPackage parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

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

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

  @java.lang.Override
  public com.google.cloudbuild.v1.UploadedPythonPackage getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}


text:
package com.spike.text.lucene.indexing.basic;

import static com.spike.text.lucene.util.LuceneAppUtil.getMemDirectory;
import static org.junit.Assert.assertNotNull;

import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.DoubleField;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.IntField;
import org.apache.lucene.document.LongField;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.store.Directory;
import org.junit.Test;

import com.spike.text.lucene.util.LuceneAppUtil;
import com.spike.text.lucene.util.anno.BookPartEnum;
import com.spike.text.lucene.util.anno.LuceneInAction2ndBook;

@LuceneInAction2ndBook(part = BookPartEnum.CORE_LUCENE, chapter = 2, section = { 6 })
public class IndexingNonStringFieldTest {
  // directory in memory
  private Directory directory = getMemDirectory();

  private IndexWriter getIndexWriter() {
    return LuceneAppUtil.getIndexWriter(directory, new WhitespaceAnalyzer());
  }

  @Test
  public void number() throws IOException {
    IndexWriter indexWriter = this.getIndexWriter();

    Document document = new Document();
    DoubleField numbericField = new DoubleField("number", 19.99D, Store.YES);
    // change the value
    numbericField.setDoubleValue(29.99D);
    document.add(numbericField);

    indexWriter.close();
  }

  @Test
  public void timestamp() {
    LongField field = new LongField("timestamp", new Date().getTime(), Store.YES);
    assertNotNull(field.numericValue());
    System.out.println(field.stringValue());

    field.setLongValue(new Date().getTime());
    assertNotNull(field.numericValue());
    System.out.println(field.stringValue());
  }

  @Test
  public void day() {
    int value = (int) (new Date().getTime() / 24 / 3600);
    IntField field = new IntField("day", value, Store.YES);

    assertNotNull(field.numericValue());
    System.out.println(field.numericValue());

    value = (int) (new Date().getTime() / 24 / 3600);
    field.setIntValue(value);
    assertNotNull(field.numericValue());
    System.out.println(field.numericValue());
  }

  /**
   * usage of {@link Calendar}
   */
  @Test
  public void yearMonthDayAsInt() {
    Calendar calendar = Calendar.getInstance(Locale.CHINA);
    calendar.setTime(new Date());

    int year = calendar.get(Calendar.YEAR);
    System.out.println(year);
    // count fom 0
    int month = calendar.get(Calendar.MONTH) + 1;
    System.out.println(month);
    // count from 1
    int day = calendar.get(Calendar.DAY_OF_MONTH);
    System.out.println(day);

    int value = year * 10000 + month * 100 + day;
    System.out.println(value);

    IntField field = new IntField("dayOfMonth", value, Store.YES);

    assertNotNull(field.numericValue());
    System.out.println(field.numericValue());
  }
}

redpajama_set_name: RedPajamaGithub


text:
module Celluloid
  module Net
    module Imap
      VERSION = "0.0.1"
    end
  end
end


text:
namespace Bloggable.Web.Config.ServicePackages
{
    using System.Data.Entity;

    using Bloggable.Common.Constants;
    using Bloggable.Data;
    using Bloggable.Data.Contracts.Helpers;
    using Bloggable.Data.Contracts.Repositories;
    using Bloggable.Data.Helpers;
    using Bloggable.Data.Models;
    using Bloggable.Data.Repositories;

    using Microsoft.AspNet.Identity.EntityFramework;

    using SimpleInjector;
    using SimpleInjector.Integration.Web;
    using SimpleInjector.Packaging;

    public class DataPackage : IPackage
    {
        public void RegisterServices(Container container)
        {
            var webRequestLifestyle = new WebRequestLifestyle();

            container.Register(() => new BloggableDbContext(AppSettingConstants.DefaultDbConnectionName), webRequestLifestyle);
            container.Register<DbContext>(container.GetInstance<BloggableDbContext>, webRequestLifestyle);
            container.Register<IdentityDbContext<User>>(container.GetInstance<BloggableDbContext>, webRequestLifestyle);

            container.Register(typeof(IRepository<>), typeof(EfRepository<>), webRequestLifestyle);
            container.Register(typeof(IDeletableEntityRepository<>), typeof(EfDeletableEntityRepository<>), webRequestLifestyle);

            container.Register<IEntityKeyTypesProvider, EfEntityKeyTypesProvider>();
        }
    }
}


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	errorHandler = require('./errors.server.controller'),
	ProgramSheet = mongoose.model('ProgramSheet'),
	_ = require('lodash');

/**
 * Create a Program sheet
 */
exports.create = function(req, res) {
	var programSheet = new ProgramSheet(req.body);
	programSheet.user = req.user;

	programSheet.save(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(programSheet);
		}
	});
};

/**
 * Show the current Program sheet
 */
exports.read = function(req, res) {
	res.jsonp(req.programSheet);
};

/**
 * Update a Program sheet
 */
exports.update = function(req, res) {
	var programSheet = req.programSheet ;

	programSheet = _.extend(programSheet , req.body);

	programSheet.save(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(programSheet);
		}
	});
};

/**
 * Delete an Program sheet
 */
exports.delete = function(req, res) {
	var programSheet = req.programSheet ;

	programSheet.remove(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(programSheet);
		}
	});
};

/**
 * List of Program sheets
 */
exports.list = function(req, res) {
	ProgramSheet.find().sort('-created').populate('user', 'displayName').exec(function(err, programSheets) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(programSheets);
		}
	});
};

/**
 * Program sheet middleware
 */
exports.programSheetByID = function(req, res, next, id) {
	ProgramSheet.findById(id).populate('user', 'displayName').exec(function(err, programSheet) {
		if (err) return next(err);
		if (! programSheet) return next(new Error('Failed to load Program sheet ' + id));
		req.programSheet = programSheet ;
		next();
	});
};

/**
 * Program sheet authorization middleware
 */
exports.hasAuthorization = function(req, res, next) {
	if (req.programSheet.user.id !== req.user.id) {
		return res.status(403).send('User is not authorized');
	}
	next();
};


text:
import pandas as pd
import numpy as np

from drain.model import y_subset

y = pd.DataFrame({
    'score':[.1,1,.2,.3,0],
    'true':[True, False, np.nan,False,True],
    'test':[True, True, True, False, False],
    'attr':[False, True, False, False, False],
})

def test_subset_query():
    assert set(y_subset(y, query='attr').index) == set([1])

def test_subset_dropna():
   assert set(y_subset(y, dropna=True).index) == set([0,1,3,4])

def test_subset_k():
   assert set(y_subset(y, k=2).index) == set([1,3])


text:
using Nop.Core.Domain.Catalog;

namespace Nop.Data.Mapping.Catalog
{
    public partial class ProductMap : NopEntityTypeConfiguration<Product>
    {
        public ProductMap()
        {
            this.ToTable("Product");
            this.HasKey(p => p.Id);
            this.Property(p => p.Name).IsRequired().HasMaxLength(400);
            this.Property(p => p.MetaKeywords).HasMaxLength(400);
            this.Property(p => p.MetaTitle).HasMaxLength(400);
            this.Property(p => p.Sku).HasMaxLength(400);
            this.Property(p => p.ManufacturerPartNumber).HasMaxLength(400);
            this.Property(p => p.Gtin).HasMaxLength(400);
            this.Property(p => p.AdditionalShippingCharge).HasPrecision(18, 4);
            this.Property(p => p.Price).HasPrecision(18, 4);
            this.Property(p => p.OldPrice).HasPrecision(18, 4);
            this.Property(p => p.ProductCost).HasPrecision(18, 4);
            this.Property(p => p.MinimumCustomerEnteredPrice).HasPrecision(18, 4);
            this.Property(p => p.MaximumCustomerEnteredPrice).HasPrecision(18, 4);
            this.Property(p => p.Weight).HasPrecision(18, 4);
            this.Property(p => p.Length).HasPrecision(18, 4);
            this.Property(p => p.Width).HasPrecision(18, 4);
            this.Property(p => p.Height).HasPrecision(18, 4);
            this.Property(p => p.RequiredProductIds).HasMaxLength(1000);
            this.Property(p => p.AllowedQuantities).HasMaxLength(1000);
            this.Property(p => p.BasepriceAmount).HasPrecision(18, 4);
            this.Property(p => p.BasepriceBaseAmount).HasPrecision(18, 4);

            this.Ignore(p => p.ProductType);
            this.Ignore(p => p.BackorderMode);
            this.Ignore(p => p.DownloadActivationType);
            this.Ignore(p => p.GiftCardType);
            this.Ignore(p => p.LowStockActivity);
            this.Ignore(p => p.ManageInventoryMethod);
            this.Ignore(p => p.RecurringCyclePeriod);
            this.Ignore(p => p.RentalPricePeriod);

            this.HasMany(p => p.ProductTags)
                .WithMany(pt => pt.Products)
                .Map(m => m.ToTable("Product_ProductTag_Mapping"));
        }
    }
}


text:
(function( w, $ ){
	w.componentNamespace = w.componentNamespace || w;

	var pluginName = "dialog", cl, ev,
		nullHash = "dialog",
		doc = w.document,
		docElem = doc.documentElement,
		body = doc.body,
		$html = $( docElem );

	var Dialog = w.componentNamespace.Dialog = function( element ){
		this.$el = $( element );
		this.$background =
			$( doc.createElement('div') ).addClass( cl.bkgd ).appendTo( "body");
		this.hash = this.$el.attr( "id" ) + "-dialog";

		this.isOpen = false;
		this.positionMedia = this.$el.attr( 'data-set-position-media' );
		this.isTransparentBackground = this.$el.is( '[data-transbg]' );
	};

	Dialog.events = ev = {
		open: pluginName + "-open",
		close: pluginName + "-close"
	};

	Dialog.classes = cl = {
		open: pluginName + "-open",
		opened: pluginName + "-opened",
		content: pluginName + "-content",
		close: pluginName + "-close",
		closed: pluginName + "-closed",
		bkgd: pluginName + "-background",
		bkgdOpen: pluginName + "-background-open",
		bkgdTrans: pluginName + "-background-trans"
	};

	Dialog.prototype.isSetScrollPosition = function() {
		return !this.positionMedia ||
			( w.matchMedia && w.matchMedia( this.positionMedia ).matches );
	};

	Dialog.prototype.destroy = function() {
		this.$background.remove();
	};

	Dialog.prototype.open = function( e ) {
		this.$background[ 0 ].style.height = Math.max( docElem.scrollHeight, docElem.clientHeight ) + "px";
		this.$el.addClass( cl.open );
		this.$background.addClass( cl.bkgdOpen );
		this._setBackgroundTransparency();

		if( this.isSetScrollPosition() ) {
			this.scroll = "pageYOffset" in w ? w.pageYOffset : ( docElem.scrollY || docElem.scrollTop || ( body && body.scrollY ) || 0 );
			this.$el[ 0 ].style.top = this.scroll + "px";
		} else {
			this.$el[ 0 ].style.top = '';
		}

		$html.addClass( cl.open );
		this.isOpen = true;

		location.hash = this.hash;

		if( doc.activeElement ){
			this.focused = doc.activeElement;
		}
		this.$el[ 0 ].focus();

		this.$el.trigger( cl.opened );
	};

	Dialog.prototype._setBackgroundTransparency = function() {
		if( this.isTransparentBackground ){
			this.$background.addClass( cl.bkgdTrans );
		}
	};

	Dialog.prototype.close = function(){
		if( !this.isOpen ){
			return;
		}

		this.$el.removeClass( cl.open );

		this.$background.removeClass( cl.bkgdOpen );
		$html.removeClass( cl.open );

		if( this.focused ){
			this.focused.focus();
		}

		if( this.isSetScrollPosition() ) {
			w.scrollTo( 0, this.scroll );
		}

		this.isOpen = false;

		this.$el.trigger( cl.closed );
	};
}( this, jQuery ));


text:
using Orchard.Mvc.Routes;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;

namespace Q42.DbTranslations
{
    public class Routes : IRouteProvider {
        public IEnumerable<RouteDescriptor> GetRoutes() {
            const string areaName = "Q42.DbTranslations";
            const string controllerName = "Dashboard";
            return new[] {
                new RouteDescriptor
                {
                    Route = new Route(
                        "system/statictranslations",
                        new RouteValueDictionary
                        {
                            {"area", areaName},
                            {"controller", controllerName},
                            {"action", "Index"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary
                        {
                            {"area", areaName}
                        },
                        new MvcRouteHandler())
                },
                new RouteDescriptor
                {
                    Route = new Route(
                        "system/statictranslations/import",
                        new RouteValueDictionary
                        {
                            {"area", areaName},
                            {"controller", controllerName},
                            {"action", "Import"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary
                        {
                            {"area", areaName}
                        },
                        new MvcRouteHandler())
                },
                new RouteDescriptor
                {
                    Route = new Route(
                        "system/statictranslations/search",
                        new RouteValueDictionary
                        {
                            {"area", areaName},
                            {"controller", controllerName},
                            {"action", "Search"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary
                        {
                            {"area", areaName}
                        },
                        new MvcRouteHandler())
                },
                new RouteDescriptor {
                    Route = new Route(
                        "system/statictranslations/culture/{culture}",
                        new RouteValueDictionary {
                                                    {"area", areaName},
                                                    {"controller", controllerName},
                                                    {"action", "Culture"}
                                                },
                        new RouteValueDictionary {
                                                    {"culture", ".+"}
                                                },
                        new RouteValueDictionary {
                                                    {"area", areaName}
                                                },
                        new MvcRouteHandler())
                },
                new RouteDescriptor {
                    Route = new Route(
                        "system/statictranslations/culture/{culture}/details",
                        new RouteValueDictionary {
                            {"area", areaName},
                            {"controller", controllerName},
                            {"action", "Details"}
                        },
                        new RouteValueDictionary {
                            {"culture", ".+"}
                        },
                        new RouteValueDictionary {
                            {"area", areaName}
                        },
                        new MvcRouteHandler())
                },
            };
        }

        public void GetRoutes(ICollection<RouteDescriptor> routes) {
            foreach (RouteDescriptor routeDescriptor in GetRoutes()) {
                routes.Add(routeDescriptor);
            }
        }
    }
}


text:
package effio

/*
 * effio provides ways to build a suite of fio tests & devices, combine them
 * then generate reports / graphs.
 *
 * The fio config file name is stripped of its path and .fio extension to be
 * used in composite test names. A test against the above device with
 * "rand_512b_write_iops.fio" will be named
 * "rand_512b_write_iops-samsung_840_pro_256".
 */

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"path"
	"path/filepath"
	"time"
)

type Suite struct {
	Name        string      `json:"name"`         // a name given to the suite on the command line
	Path        string      `json:"path"`         // path for writing benchmark data out
	MinTs       time.Time   `json:"min_ts"`       // time the suite was started
	MaxTs       time.Time   `json:"max_ts"`       // time the suite finished
	EffioCmd    []string    `json:"effio_cmd"`    // os.Args() of the effio command used
	SuiteJson   string      `json:"suite_json"`   // metadata about the suite of tests
	FioCommands FioCommands `json:"fio_commands"` // fio commands run/to be run
}

// NewSuite returns an initialized Suite with the given
// id and the Created field set to the current time.
func NewSuite(name string, pathArg string) Suite {
	absPath, err := filepath.Abs(pathArg)
	if err != nil {
		log.Fatalf("Could not determine the absolute path of '%s': %s\n", pathArg, err)
	}

	spath := path.Join(absPath, name)
	fname := path.Join(absPath, name, "suite.json")

	return Suite{
		Name:        name,
		Path:        spath,
		MinTs:       time.Now(),
		EffioCmd:    os.Args,
		SuiteJson:   fname,
		FioCommands: FioCommands{},
	}
}

// Run the whole suite one at a time letting fio write its output into
// the suite directories. Repeated runs will overwrite files; behavior
// is dependent on what fio does with existing files for now.
func (suite *Suite) Run(rerun bool) {
	for _, fcmd := range suite.FioCommands {
		// rerun = true means all benchmarks get re-run
		// when false, only benchmarks with missing or empty output.json get run
		if !rerun {
			if fcmd.FioJsonSize() > 0 {
				continue
			}
		}

		fmt.Printf("Running benchmark %q ...\n", fcmd.Name)
		fcmd.MinTs = time.Now()
		fcmd.Run()
		fcmd.MaxTs = time.Now()
		elapsed := fcmd.MaxTs.Sub(fcmd.MinTs)
		fmt.Printf("Finished benchmark %q in %s.\n", fcmd.Name, elapsed.String())
	}

	suite.MaxTs = time.Now()
}

// Populate the suite with the (cartesian) product of Devices x FioConfTmpls
// to get all combinations (in memory).
func (suite *Suite) Populate(dl Devices, ftl FioConfTmpls) {
	for _, tp := range ftl {
		for _, dev := range dl {
			if dev.Ignore {
				continue
			}

			// These conventions could be defined higher up in the call stack
			// but this makes things a little easier to modify down the road.
			fcmdName := fmt.Sprintf("%s-%s", dev.Name, tp.Name)
			fcmdPath := path.Join(suite.Path, fcmdName)
			args := []string{"--output-format=json", "--output=output.json", "config.fio"}

			// fio adds _$type.log to log file names so only provide the base name
			fcmd := FioCommand{
				Name:        fcmdName,
				FioName:     tp.Name,
				SuiteName:   suite.Name,
				Path:        fcmdPath,
				FioArgs:     args,
				FioFile:     "config.fio",
				FioJson:     "output.json",
				FioBWLog:    "bw",
				FioLatLog:   "lat",
				FioIopsLog:  "iops",
				CmdJson:     "command.json",
				CmdScript:   "run.sh",
				FioConfTmpl: tp,
				Device:      dev,
			}

			suite.FioCommands = append(suite.FioCommands, &fcmd)
		}
	}
}

// WriteAll() writes a suite out to a set of directories and files.
func (suite *Suite) WriteAll() {
	suite.mkdirAll()

	suite.WriteSuiteJson()

	for _, fcmd := range suite.FioCommands {
		fcmd.WriteFioConf()
		fcmd.WriteFcmdJson()
		fcmd.WriteCmdScript()
	}
}

// WriteSuiteJson() dumps the suite data structure to a JSON file. This
// file is used by some effio subcommands, such as run_suite and various
// reports.
// <suite path>/<suite id>/suite.json
func (suite *Suite) WriteSuiteJson() {
	js, err := json.MarshalIndent(suite, "", "  ")
	if err != nil {
		log.Fatalf("Failed to encode suite data as JSON: %s\n", err)
	}

	// MarshalIndent does not follow the final brace with a newline
	js = append(js, byte('\n'))

	err = ioutil.WriteFile(suite.SuiteJson, js, 0644)
	if err != nil {
		log.Fatalf("Failed to write suite JSON data file '%s': %s\n", suite.SuiteJson, err)
	}
}

// mkdirAll() creates the directory structure of a test suite
// under directory 'path'. This must be called before the Write*()
// methods or they will fail. It only makes sense to call this after
// Populate().
func (suite *Suite) mkdirAll() {
	for _, fcmd := range suite.FioCommands {
		err := os.MkdirAll(fcmd.Path, 0755)
		if err != nil {
			log.Fatalf("Failed to create directory '%s': %s\n", fcmd.Path, err)
		}
	}
}


text:
package org.zstack.network.service.virtualrouter;

import org.zstack.header.search.APISearchReply;

public class APISearchVirtualRouterVmReply extends APISearchReply {

}


text:
module Image
  class OsImagesController < ::Image::ApplicationController
    # before_action :load_visibility, only: [:index, :show]

    def index
      @images = paginatable(per_page: 15) do |pagination_options|
        services.image.images(filter_params.merge(pagination_options))
      end

      # this is relevant in case an ajax paginate call is made.
      # in this case we don't render the layout, only the list!
      if request.xhr?
        render partial: 'list', locals: { images: @images }
      else
        # comon case, render index page with layout
        render action: :index
      end
    end

    def show
      @image = services.image.find_image(params[:id])

      properties = @image.attributes.clone.stringify_keys
      known_attributes = %w[
        name id status visibility protected size
        container_format disk_format created_at updated_at owner
      ]
      known_attributes.each { |known| properties.delete(known) }
      additional_properties = properties.delete('properties')
      properties.merge!(additional_properties) if additional_properties

      @properties = properties.sort_by { |k, _v| k }
    end

    def new; end

    def create
      render plain: 'create'
    end

    def edit; end

    def update
      render plain: 'update'
    end

    def destroy
      @image = services.image.find_image(params[:id])
      @success = (@image && @image.destroy)
    end

    protected

    def filter_params
      raise 'has to be implemented in subclass'
    end
  end
end


text:
package edu.ynu.lab7;

import java.util.Scanner;

public class UseCourse {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		System.out.println("########Ĺðº£20121120138###########");
		System.out.println("ÊäÈëÄãҪѡÔñµÄ¿Î³Ì£¨1-5£©£º");
		int a=in.nextInt();
		CollegeCourse course=new CollegeCourse(a);
		Lab lab=new Lab(a);
		System.out.println("The cost of your course is $"+course.Cost());
		System.out.println("there is a $"+lab.Cost()+" lab fee");
		System.out.println("The cost of your course is $"+(course.Cost()+lab.Cost()));
		System.out.println("########Ĺðº£20121120138###########");

	}

}


text:
package org.apache.accumulo.core.spi.scan;

import java.util.Map;

import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.spi.common.ServiceEnvironment;

import com.google.common.base.Preconditions;

/**
 * A per table scan dispatcher that decides which executor should be used to process a scan. For
 * information about configuring, find the documentation for the {@code table.scan.dispatcher} and
 * {@code table.scan.dispatcher.opts.} properties.
 *
 * @since 2.0.0
 * @see org.apache.accumulo.core.spi
 */
public interface ScanDispatcher {

  /**
   * The method parameters for {@link ScanDispatcher#init(InitParameters)}. This interface exists so
   * the API can evolve and additional parameters can be passed to the method in the future.
   *
   * @since 2.0.0
   */
  public interface InitParameters {
    /**
     *
     * @return The configured options. For example if the table properties
     *         {@code table.scan.dispatcher.opts.p1=abc} and
     *         {@code table.scan.dispatcher.opts.p9=123} were set, then this map would contain
     *         {@code p1=abc} and {@code p9=123}.
     */
    Map<String,String> getOptions();

    TableId getTableId();

    ServiceEnvironment getServiceEnv();
  }

  /**
   * This method is called once after a ScanDispatcher is instantiated.
   */
  default void init(InitParameters params) {
    Preconditions.checkArgument(params.getOptions().isEmpty(), "No options expected");
  }

  /**
   * The method parameters for {@link ScanDispatcher#dispatch(DispatchParmaters)}. This interface
   * exists so the API can evolve and additional parameters can be passed to the method in the
   * future.
   *
   * @since 2.0.0
   * @deprecated since 2.1.0 replaced by {@link DispatchParameters} and
   *             {@link ScanDispatcher#dispatch(DispatchParameters)}
   */
  @Deprecated(since = "2.1.0")
  public interface DispatchParmaters extends DispatchParameters {}

  /**
   * @return Should return one of the executors named params.getScanExecutors().keySet()
   *
   * @deprecated since 2.1.0 please implement {@link #dispatch(DispatchParameters)} instead of this.
   *             Accumulo will only call {@link #dispatch(DispatchParameters)} directly, it will
   *             never call this. However the default implementation of
   *             {@link #dispatch(DispatchParameters)} calls this method.
   */
  @Deprecated(since = "2.1.0")
  default String dispatch(DispatchParmaters params) {
    throw new UnsupportedOperationException();
  }

  /**
   * The method parameters for {@link ScanDispatcher#dispatch(DispatchParameters)}. This interface
   * exists so the API can evolve and additional parameters can be passed to the method in the
   * future.
   *
   * @since 2.1.0
   */
  public interface DispatchParameters {
    /**
     * @return information about the scan to be dispatched.
     */
    ScanInfo getScanInfo();

    /**
     * @return the currently configured scan executors
     */
    Map<String,ScanExecutor> getScanExecutors();

    ServiceEnvironment getServiceEnv();
  }

  /**
   * Accumulo calls this method for each scan batch to determine what executor to use and how to
   * utilize cache for the scan.
   *
   * @since 2.1.0
   */

  default ScanDispatch dispatch(DispatchParameters params) {
    String executor = dispatch((DispatchParmaters) params);
    if (executor.equals(DefaultScanDispatch.DEFAULT_SCAN_DISPATCH.getExecutorName()))
      return DefaultScanDispatch.DEFAULT_SCAN_DISPATCH;

    return ScanDispatch.builder().setExecutorName(executor).build();
  }
}


text:
An interpreted assembly.

Try running it:

    ./vm.py < new.asm
    ./asmRepl.py < example.asm
    ./asmRepl.py ### interactive session, type exit to leave

Currently, the runtimes are built on python, but they could easily be converted to a language like C.
Really, a simple project indeed.

It's worth noting that `vm.py` is a non-interactive, but feature-complete runtime, and does not share the same language syntax as `asmRepl.py`.  `asmRepl.py`, thus, is not feature-complete, but is interactive and is a work in progress that currently implements a stack and functions. It does not have complete control-flow capabilities yet.


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>neptune_erlang_run_job (erlang_helper.rb)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />

# File erlang_helper.rb, line 11
def neptune_erlang_run_job(nodes, job_data, secret)
  return BAD_SECRET_MSG unless valid_secret?(secret)
  Djinn.log_debug("erlang - run")

  Thread.new {
    keyname = @creds['keyname']
    nodes = Djinn.convert_location_array_to_class(nodes, keyname)

    ENV['HOME'] = "/root"

    code = job_data['@code'].split(/\//)[-1]

    unless my_node.is_shadow?
      Djinn.log_run("rm -rfv /tmp/#{code}")
    end
    sleep(1)

    remote = job_data['@code']
    storage = job_data['@storage']
    creds = neptune_parse_creds(storage, job_data)

    Repo.get_output(remote, storage, creds, "/tmp/#{code}")

    module_name = code.split(/\./)[0]
    Djinn.log_debug("got code #{code}, trying to run module #{module_name}")
    Djinn.log_run("chmod +x #{code}")
    Djinn.log_run("cd /tmp; erl -noshell -run #{module_name} main > #{ERLANG_OUTPUT}")

    Repo.set_output(job_data["@output"], ERLANG_OUTPUT, storage, creds, IS_FILE)

    remove_lock_file(job_data)

    Djinn.log_run("rm -rfv /tmp/#{code}")
  }

  return "OK"
end


text:
Screen based simulation is a software that give medical practitioners or doctors a chance to learn and practice their medical skills anywhere and anytime based on a variety of real-world scenarios. The software is under MIT license.

The link of prezi for our idea: <https://prezi.com/l439-pshlxmg/screen-based-simulation/>

##Architecture
- Java based Server
- User Interface: Unity
- Web Frame: Java Spark
- Database: MySQL

##Mentors
- Dr. William McIvor
- Dr. Karen Thickman
- Dr. Ravi Starzl
- Prof. Ralf Brown
- Prof. Christopher Langmead
- Prof. John Vu

##Partnership
- [BioGears](https://www.biogearsengine.com/), an open source, comprehensive, extensible human physiology engine.
- Peter M. Winter Institute for Simulation, Education, and Research([WISER](http://www.wiser.pitt.edu/)), University of Pittsburgh

##Development Team
We are now all graduate studnets at School of Computer Science, Carnegie Mellon University. We are using scrum and agile methodology to develop this software. Currently, We are building our Minumum Viable Product.


text:
##########################################################################
#Aqueduct - Compliance Remediation Content
#Copyright (C) 2011,2012
#  Vincent C. Passaro (vincent.passaro@gmail.com)
#  Shannon Mitchell (shannon.mitchell@fusiontechnology-llc.com)
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 51 Franklin Street, Fifth Floor,
#Boston, MA  02110-1301, USA.
##########################################################################

###################### Fotis Networks LLC ###############################
# By Vincent C. Passaro                                                 #
# Fotis Networks LLC	                                                #
# Vincent[.]Passaro[@]fotisnetworks[.]com                               #
# www.fotisnetworks.com	                                                #
###################### Fotis Networks LLC ###############################
#
#  _____________________________________________________________________
# |  Version |   Change Information  |      Author        |    Date    |
# |__________|_______________________|____________________|____________|
# |    1.0   |   Initial Script      | Vincent C. Passaro | 1-Aug-2012 |
# |          |   Creation            |                    |            |
# |__________|_______________________|____________________|____________|
#

#######################DISA INFORMATION##################################
# Group ID (Vulid): V-842
# Group Title: GEN004920
# Rule ID: SV-37537r1_rule
# Severity: medium
# Rule Version (STIG-ID): GEN004920
# Rule Title: The ftpusers file must be owned by root.
#
# Vulnerability Discussion: If the file ftpusers is not owned by root, an
# unauthorized user may modify the file to allow unauthorized accounts to
# use FTP.
#
# Responsibility: System Administrator
# IAControls: ECLP-1
#
# Check Content:
#
# Check the ownership of the ftpusers file.

# Procedure:
# For gssftp:
# ls -l /etc/ftpusers

# For vsftp:
# ls -l /etc/vsftpd.ftpusers /etc/vsftpd/ftpusers
# If the ftpusers file is not owned by root, this is a finding

#
# Fix Text:
#
# Change the owner of the ftpusers file to root.
# For gssftp:
# chown root /etc/ftpusers

# For vsftp:
# chown root /etc/vsftpd.ftpusers /etc/vsftpd/ftpusers

#######################DISA INFORMATION##################################

# Global Variables
PDI=GEN004920

# Start-Lockdown
for FTPFILE in /etc/vsftpd/ftpusers /etc/vsftpd.ftpusers /etc/ftpusers
do

  if [ -a "$FTPFILE" ]
  then
    CUROWN=`stat -c %U $FTPFILE`;
    if [ "$CUROWN" != "root" ]
      then
        chown root $FTPFILE
    fi
  fi

done


text:
- install node (0.10.x) recommended
- install dependencies:
```
npm install
```
- execute grunt
```
grunt
```

the assets are created in `public/assets/:version/` and after this you can run rails app as always


text:
%Load Random Forest Results
r = h5read('randomforest_results_wg.h5', '/roc_vals');
loglog(r(1,:), r(2,:), '-s');
ylabel('TP Rate')
xlabel('Avg # Falses per Scan')
grid on
legend('GaussianFit')
%Load Ilastik Results


text:
require_relative 'value_validator'

module StackMaster
  module SparkleFormation
    module CompileTime
      class StringValidator < ValueValidator

        def initialize(name, definition, parameter)
          @name = name
          @definition = definition
          @parameter = parameter
        end

        private

        def check_is_valid
          return true unless @definition[:type] == :string
          invalid_values.empty?
        end

        def invalid_values
          values = build_values(@definition, @parameter)
          values.reject { |value| value.is_a?(String)}
        end

        def create_error
          "#{@name}:#{invalid_values} are not Strings"
        end

      end
    end
  end
end


text:
import optparse

import pygst
pygst.require("0.10")
import gst
import pygtk
import gtk
import gobject

import code

class Main:

    def next_file(self):
        filename=self.files.pop()
        print filename
        self.min,self.max = None,None
        self.pipeline.set_state(gst.STATE_NULL)
        self.filesrc.set_property("location", filename)
        self.pipeline.set_state(gst.STATE_PLAYING)

    def __init__(self, files):

        self.files = files

        pipeline = gst.Pipeline("mypipeline")
        self.pipeline=pipeline

# source: file
        filesrc = gst.element_factory_make("filesrc", "audio")
        self.filesrc = filesrc
        self.next_file()
        pipeline.add(filesrc)

# decoder
        decode = gst.element_factory_make("decodebin", "decode")
        decode.connect("new-decoded-pad", self.OnDynamicPad)
        pipeline.add(decode)
        filesrc.link(decode)

# convert from this to that?!!
        convert = gst.element_factory_make("audioconvert", "convert")
        pipeline.add(convert)
# store to attribute so OnDynamicPad() can get it
        self.convert = convert

# monitor audio level
        level = gst.element_factory_make("level", "level")
        level.set_property("message", True)
        pipeline.add(level)
        convert.link(level)

# send it to alsa
        alsa = gst.element_factory_make("alsasink", "alsa")
        pipeline.add(alsa)
        level.link(alsa)

# keep refernce to pipleline so it doesn't get destroyed
        self.pipeline=pipeline
        pipeline.set_state(gst.STATE_PLAYING)

        bus = pipeline.get_bus()
        bus.add_signal_watch()
        bus.connect("message", self.on_message)

    def OnDynamicPad(self, dbin, pad, islast):
        print "OnDynamicPad Called!"
        # print pad.get_caps()[0].get_name()
        if pad.get_caps()[0].get_name().startswith('audio'):
            pad.link(self.convert.get_pad("sink"))
        # code.interact(local=locals())

    def on_message(self, bus, message):
        t = message.type
        if t == gst.MESSAGE_ELEMENT \
                and message.structure.get_name()=='level':

            levs = [message.structure[type] for type in ("rms","peak","decay")]
            levs = [int(l[0]) for l in levs]
            lev = levs[1]
            # rms = 10.0**(lev / 20.0)
            # print lev, "*"* int(-lev/2)
            if self.min is None or lev < self.min:
                self.min = lev
            if self.max is None or lev > self.max:
                self.max = lev
            dif= self.max-self.min
            print levs, self.min, self.max, dif
            if levs[1]>-10:
                pass
                # self.next_file()

        elif t == gst.MESSAGE_EOS:
            # self.player.set_state(gst.STATE_NULL)
            self.next_file()

def parse_args():
    parser = optparse.OptionParser()
    options, args = parser.parse_args()
    return options,args

if __name__=='__main__':
    options,args = parse_args()
    gobject.threads_init()
    p=Main(args)
    gtk.main()


text:
[![Build Status](https://travis-ci.org/ianagbip1oti/ProC.svg?branch=master)](https://travis-ci.org/ianagbip1oti/ProC)
[![Coverage Status](https://coveralls.io/repos/github/ianagbip1oti/ProC/badge.svg?branch=master)](https://coveralls.io/github/ianagbip1oti/ProC?branch=master)

Hawt new programming language

## Requirements

Initial list as provided by [@InitializeSahib](http://github.com/InitializeSahib)

- c-like syntax (but can deviate a little)
- no do/end stuff (edited)
- no case-based syntax (looking at you, go)
- no -> operator
- native string type
- should be simpler than C (e.g. not ASM)
- optional: actual module system
- optional: package manager for modules

Additional requirements upon further discussion:

- Static Typing
- Compiled (Note, I believe this will be possible to add, even with initially being an interpreted language)

## Build and Run

### Stack

```bash
> stack build
> stack exec ProC examples/hello_world.proc
```


text:
namespace Kangarooper.Text
{
    internal static class TestCategories
    {
        internal const string Performance = nameof(Performance);
    }
}


text:
package engine.pathfinding;

/**
 * Thrown when querying a path for the next point, but the path has ended.
 *
 * @author Kaighn
 *
 */
public class EndOfPathException extends Exception {
    private static final long serialVersionUID = 1L;
}


text:
<?php

namespace Kolibri\Forms;

use Phalcon\Forms\Element\Hidden;
use Phalcon\Forms\Element\TextArea;
use Phalcon\Forms\Form;
use Phalcon\Validation\Validator\PresenceOf;
use Phalcon\Validation\Validator\Regex;

class Edit extends Form
{
    public function initialize()
    {
        $content = new TextArea('content', ['rows' => 35, 'style' => 'display: none', 'spellcheck' => 'false']);
        $content->addValidator(
            new PresenceOf([
                'message' => 'Some content is required',
            ])
        );
        $this->add($content);

        $id = new Hidden('id');
        $id->addValidator(
            new Regex([
                'pattern' => '/[0-9]*/',
                'message' => 'The page id can only be numerical',
            ])
        );
        $this->add($id);
    }
}


text:
<?php

/**
 * InstantCheckout
 *
 * @category   LCB
 * @package    LCB_InstantCheckout
 * @author     Silpion Tomasz Gregorczyk <tom@leftcurlybracket.com>
 */
class LCB_InstantCheckout_Model_Redirect {

    const REDIRECT_CART = 'cart';
    const REDIRECT_CHECKOUT = 'checkout';

    public function toOptionArray()
    {
        return array(
            array('value' => self::REDIRECT_CART, 'label' => Mage::helper('instantcheckout')->__('Redirect to the cart')),
            array('value' => self::REDIRECT_CHECKOUT, 'label' => Mage::helper('instantcheckout')->__('Redirect to the checkout'))
        );
    }

}


text:
var ClBackbone = $CL.namespace('Cl.Backbone');

$CL.require('Cl.Backbone.View');

ClBackbone.FormView = function() {};

ClBackbone.FormView = $CL.extendClass(ClBackbone.FormView, ClBackbone.View, {
    form : null,
    submitCallback : function() {},
    events : {
        'click input[type=submit]' : 'onSubmit',
        'submit form' : 'onSubmit',
    },
    setForm : function(form) {
        this.form = form;
    },
    getForm : function() {
        return this.form;
    },
    setSubmitCallback : function(submitCallback) {
        this.submitCallback = submitCallback;
    },
    render : function() {
        this.data['form'] = this.getForm();

        Cl.Backbone.View.prototype.render.call(this);

        this.form.refresh();
    },
    onSubmit : function(e) {
        e.preventDefault();
        if (this.form.isValid()) {
            this.submitCallback(this.form.getData());
        } else {
            this.render();
        }
    }
});


text:
void generate(QString target,QMap<QString, QString> pairs,QString path);

QString readAndReplace(QString filePath, QMap<QString,QString> pairs);

#endif // GENERATOR_H


text:
import ctypes
import ctypes.util
import os

try:
    # If possible, get nicer tracebacks from low-level signals.
    import faulthandler
    faulthandler.enable()
except:
    pass

from .v31 import *

class _Mock(object):
    def __init__(self, *args, **kwargs):
        pass

try:
    _llvm = ctypes.cdll.LoadLibrary(os.path.join(os.path.dirname(__file__), "_llvm.so"))
    _libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library("c"))

    def _func(func_name, restype, argtypes=[]):
        """Creates ctypes wrapper for an LLVM API function.

        LLVM{name} -> llvm.{name}

        """
        g = globals()

        g[func_name] = getattr(_llvm, "LLVM" + func_name)
        g[func_name].restype = restype
        g[func_name].argtypes = argtypes

except OSError:
    # Allows us to complete the module import when LLMV library
    # is not available; currently used for documentation building.
    def _func(func_name, restype, argtypes=[]):
        globals()[func_name] = _Mock

class owned_c_char_p(ctypes.c_char_p):
    """Char pointer which collects the memory of the return value."""

    def __del__(self):
        _libc.free(self)

Bool = ctypes.c_int
FALSE = 0
TRUE = 1

# Context
class OpaqueContext(ctypes.Structure):
    pass

ContextRef = ctypes.POINTER(OpaqueContext)

_func("GetGlobalContext", ContextRef)

# Module
class OpaqueModule(ctypes.Structure):
    pass

ModuleRef = ctypes.POINTER(OpaqueModule)

_func("ModuleCreateWithName", ModuleRef)
_func("GetModuleName", ctypes.c_char_p, [ModuleRef])
_func("DumpModule", None, [ModuleRef])
_func("DumpModuleToString", owned_c_char_p, [ModuleRef])
_func("DisposeModule", None, [ModuleRef])

_func("DisposeMessage", None, [ctypes.c_char_p])

# Linker
(LinkerDestroySource, LinkerPreserveSource) = range(2)

_func("LinkModules__", Bool,
      [ModuleRef, ModuleRef, ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)])

# Type
class OpaqueType(ctypes.Structure):
    pass

TypeRef = ctypes.POINTER(OpaqueType)

TypeKind = ctypes.c_int

_func("VoidType", TypeRef)
_func("FloatType", TypeRef)
_func("DoubleType", TypeRef)
_func("IntType", TypeRef, [ctypes.c_uint])

_func("GetTypeKind", TypeKind, [TypeRef])
_func("GetIntTypeWidth", ctypes.c_uint, [TypeRef])

# Sequential types
_func("PointerType", TypeRef, [TypeRef, ctypes.c_uint])
_func("VectorType", TypeRef, [TypeRef, ctypes.c_uint])
_func("ArrayType", TypeRef, [TypeRef, ctypes.c_uint])

_func("GetElementType", TypeRef, [TypeRef])

# Value
class OpaqueValue(ctypes.Structure):
    pass

ValueRef = ctypes.POINTER(OpaqueValue)

_func("TypeOf", TypeRef, [ValueRef])
_func("SetValueName", None, [ValueRef, ctypes.c_char_p])
_func("GetValueName", ctypes.c_char_p, [ValueRef])
_func("DumpValue", None, [ValueRef])

# Operations on scalar constants
_func("ConstNull", ValueRef, [TypeRef])
_func("ConstInt", ValueRef, [TypeRef, ctypes.c_ulonglong, Bool])
_func("ConstReal", ValueRef, [TypeRef, ctypes.c_double])

_func("ConstString", ValueRef, [ctypes.c_char_p, ctypes.c_uint, Bool])
_func("ConstArray", ValueRef, [TypeRef, ctypes.POINTER(ValueRef), ctypes.c_uint])

_func("IsATerminatorInst", ValueRef, [ValueRef])

Opcode = ctypes.c_int

# Globals
_func("AddGlobal", ValueRef, [ModuleRef, TypeRef, ctypes.c_char_p])
_func("GetNamedGlobal", ValueRef, [ModuleRef, ctypes.c_char_p])
_func("SetInitializer", None, [ValueRef, ValueRef])
_func("SetGlobalConstant", None, [ValueRef, Bool])

# Functions
_func("FunctionType", TypeRef, [TypeRef, ctypes.POINTER(TypeRef), ctypes.c_uint, ctypes.c_int])
_func("AddFunction", ValueRef, [ModuleRef, ctypes.c_char_p, TypeRef])
_func("GetNamedFunction", ValueRef, [ModuleRef, ctypes.c_char_p])
_func("SetLinkage", None, [ValueRef, ctypes.c_int])
_func("GetParam", ValueRef, [ValueRef, ctypes.c_uint])
_func("GetReturnType", TypeRef, [TypeRef])

_func("AddAttribute", None, [ValueRef, ctypes.c_int]);

_func("AddFunctionAttr", None, [ValueRef, ctypes.c_int])

NoAliasAttribute = 1 << 6
AlwaysInlineAttribute = 1 << 12

def function_return_type(func):
    """Gets the return type directly from a function object."""
    return GetReturnType(GetElementType(TypeOf(func)))

_func("GetIntrinsicDeclaration", ValueRef,
      [ModuleRef, ctypes.c_uint, ctypes.POINTER(TypeRef), ctypes.c_uint])

_func("GetIntrinsicCount__", ctypes.c_uint, [])
_func("GetIntrinsicName__", owned_c_char_p, [ctypes.c_uint])

# This is False if we're generating docs didn't build the LLVM interface
if GetIntrinsicCount__ is not _Mock:
    INTRINSICS = dict((GetIntrinsicName__(i).value, i) for i in range(GetIntrinsicCount__()))
    """Intrinsic map; from name to intrinsic ID to use with GetIntrinsicDeclaration."""

ExternalLinkage = 0
PrivateLinkage = 8

# Structure Types
_func("StructType", TypeRef, [ctypes.POINTER(TypeRef), ctypes.c_uint, ctypes.c_bool])
_func("StructCreateNamed", TypeRef, [ContextRef, ctypes.c_char_p])
_func("StructSetBody", None, [TypeRef,
                              ctypes.POINTER(TypeRef),
                              ctypes.c_uint, ctypes.c_bool])

_func("GetStructName", ctypes.c_char_p, [TypeRef])

# Blocks
class OpaqueBasicBlock(ctypes.Structure):
    pass

BasicBlockRef = ctypes.POINTER(OpaqueBasicBlock)

_func("AppendBasicBlock", BasicBlockRef, [ValueRef, ctypes.c_char_p])
_func("MoveBasicBlockBefore", None, [BasicBlockRef, BasicBlockRef])
_func("MoveBasicBlockAfter", None, [BasicBlockRef, BasicBlockRef])
_func("GetBasicBlockParent", ValueRef, [BasicBlockRef])
_func("DeleteBasicBlock", None, [BasicBlockRef])

_func("GetEntryBasicBlock", BasicBlockRef, [ValueRef])
_func("GetFirstInstruction", ValueRef, [BasicBlockRef])
_func("GetLastInstruction", ValueRef, [BasicBlockRef])

# Phi expressions
_func("AddIncoming", None, [ValueRef, ctypes.POINTER(ValueRef),
                            ctypes.POINTER(BasicBlockRef),
                            ctypes.c_uint])

# Builder
class OpaqueBuilder(ctypes.Structure):
    pass

BuilderRef = ctypes.POINTER(OpaqueBuilder)

_func("CreateBuilder", BuilderRef)
_func("DisposeBuilder", None, [BuilderRef])
_func("PositionBuilderAtEnd", None, [BuilderRef, BasicBlockRef])
_func("PositionBuilder", None, [BuilderRef, BasicBlockRef, ValueRef])
_func("GetInsertBlock", BasicBlockRef, [BuilderRef])

_func("GetParentModule__", ModuleRef, [BuilderRef])

# Terminators
_func("BuildRetVoid", ValueRef, [BuilderRef])
_func("BuildRet", ValueRef, [BuilderRef, ValueRef])
_func("BuildBr", ValueRef, [BuilderRef, BasicBlockRef])
_func("BuildCondBr", ValueRef, [BuilderRef, ValueRef,
                                BasicBlockRef, BasicBlockRef])

# Float Expressions
for name in ("BuildFAdd", "BuildFSub", "BuildFMul", "BuildFDiv", "BuildFRem"):
    _func(name, ValueRef, [BuilderRef, ValueRef, ValueRef, ctypes.c_char_p])

_func("BuildFNeg", ValueRef, [BuilderRef, ValueRef, ctypes.c_char_p])
_func("BuildFCmp", ValueRef, [BuilderRef, ctypes.c_int, ValueRef, ValueRef, ctypes.c_char_p])

# Int expressions
for name in ("BuildAdd", "BuildSub", "BuildMul", "BuildUDiv", "BuildSDiv", "BuildSRem", "BuildLShr"):
    _func(name, ValueRef, [BuilderRef, ValueRef, ValueRef, ctypes.c_char_p])

_func("BuildNeg", ValueRef, [BuilderRef, ValueRef, ctypes.c_char_p])
_func("BuildICmp", ValueRef, [BuilderRef, ctypes.c_int, ValueRef, ValueRef, ctypes.c_char_p])

_func("BuildNot", ValueRef, [BuilderRef, ValueRef, ctypes.c_char_p])
for name in ("BuildAnd", "BuildOr", "BuildXor"):
    _func(name, ValueRef, [BuilderRef, ValueRef, ValueRef, ctypes.c_char_p])

# Memory

_func("BuildLoad", ValueRef, [BuilderRef, ValueRef, ctypes.c_char_p])
_func("BuildStore", ValueRef, [BuilderRef, ValueRef, ValueRef])
_func("BuildGEP", ValueRef, [BuilderRef, ValueRef,
                             ctypes.POINTER(ValueRef), ctypes.c_uint,
                             ctypes.c_char_p])
_func("BuildStructGEP", ValueRef, [BuilderRef, ValueRef, ctypes.c_uint, ctypes.c_char_p])

_func("BuildAlloca", ValueRef, [BuilderRef, TypeRef, ctypes.c_char_p])
_func("BuildArrayAlloca", ValueRef, [BuilderRef, TypeRef, ValueRef, ctypes.c_char_p])

_func("BuildMalloc", ValueRef, [BuilderRef, TypeRef, ctypes.c_char_p])
_func("BuildArrayMalloc", ValueRef, [BuilderRef, TypeRef, ValueRef, ctypes.c_char_p])

# Casting
Trunc = 30
ZExt = 31
FPToSI = 34
SIToFP = 36
FPTrunc = 37
FPExt = 38
BitCast = 41

_func("BuildCast", ValueRef, [BuilderRef, Opcode, ValueRef, TypeRef, ctypes.c_char_p])
_func("BuildPointerCast", ValueRef, [BuilderRef, ValueRef, TypeRef, ctypes.c_char_p])

# Misc
_func("BuildPhi", ValueRef, [BuilderRef, TypeRef, ctypes.c_char_p])
_func("BuildCall", ValueRef, [BuilderRef, ValueRef,
                              ctypes.POINTER(ValueRef), ctypes.c_uint,
                              ctypes.c_char_p])
_func("BuildSelect", ValueRef, [BuilderRef, ValueRef, ValueRef, ValueRef, ctypes.c_char_p])

_func("BuildExtractElement", ValueRef, [BuilderRef, ValueRef, ValueRef, ctypes.c_char_p])
_func("BuildInsertElement", ValueRef, [BuilderRef, ValueRef, ValueRef, ValueRef, ctypes.c_char_p])

# Analysis
VerifierFailureAction = ctypes.c_int
(AbortProcessAction, PrintMessageAction, ReturnStatusAction) = range(3)

_func("VerifyFunction", Bool, [ValueRef, VerifierFailureAction])

# Metadata
_func("MDString", ValueRef, [ctypes.c_char_p, ctypes.c_uint])
_func("MDNode__", ValueRef, [ctypes.POINTER(ValueRef), ctypes.c_uint])
_func("SetNamedMetadata__", None, [ValueRef, ctypes.c_char_p, ValueRef])

# Target
class OpaqueTarget(ctypes.Structure):
    pass

class OpaqueTargetData(ctypes.Structure):
    pass

class OpaqueTargetMachine(ctypes.Structure):
    pass

TargetRef = ctypes.POINTER(OpaqueTarget)
TargetDataRef = ctypes.POINTER(OpaqueTargetData)
TargetMachineRef = ctypes.POINTER(OpaqueTargetMachine)

_func("InitializeNativeTarget__", Bool, [])
_func("GetDefaultTargetTriple__", owned_c_char_p, [])
_func("LookupTarget__", TargetRef, [ctypes.c_char_p, ctypes.POINTER(ctypes.c_char_p)])

_func("GetFirstTarget", TargetRef, [])
_func("GetNextTarget", TargetRef, [TargetRef])
_func("GetTargetDescription", ctypes.c_char_p, [TargetRef])

_func("CreateTargetMachine", TargetMachineRef,
      [TargetRef, ctypes.c_char_p, ctypes.c_char_p,
       ctypes.c_char_p, ctypes.c_int,
       ctypes.c_int, ctypes.c_int])

_func("DisposeTargetMachine", None, [TargetMachineRef])
_func("GetTargetMachineData", TargetDataRef, [TargetMachineRef])
_func("TargetMachineEmitToFile", Bool, [TargetMachineRef, ModuleRef,
                                        ctypes.c_char_p, ctypes.c_int,
                                        ctypes.POINTER(ctypes.c_char_p)])

# Pass Managers
class OpaquePassManager(ctypes.Structure):
    pass

class OpaquePassManagerBuilder(ctypes.Structure):
    pass

PassManagerRef = ctypes.POINTER(OpaquePassManager)
PassManagerBuilderRef = ctypes.POINTER(OpaquePassManagerBuilder)

_func("CreatePassManager", PassManagerRef, [])
_func("DisposePassManager", None, [PassManagerRef])
_func("RunPassManager", Bool, [PassManagerRef, ModuleRef])

_func("PassManagerBuilderCreate", PassManagerBuilderRef, [])
_func("PassManagerBuilderDispose", None, [PassManagerBuilderRef])

_func("PassManagerBuilderSetOptLevel", None, [PassManagerBuilderRef, ctypes.c_uint])
_func("PassManagerBuilderUseInlinerWithThreshold", None, [PassManagerBuilderRef, ctypes.c_uint])
_func("PassManagerBuilderPopulateModulePassManager", None,
      [PassManagerBuilderRef, PassManagerRef])

_func("AddTargetData", None, [TargetDataRef, PassManagerRef])

# Execution engine
class OpaqueExecutionEngine(ctypes.Structure):
    pass

ExecutionEngineRef = ctypes.POINTER(OpaqueExecutionEngine)

_func("CreateJITCompilerForModule", Bool,
      [ctypes.POINTER(ExecutionEngineRef), ModuleRef,
       ctypes.c_uint, ctypes.POINTER(ctypes.c_char_p)])

_func("GetExecutionEngineTargetData", TargetDataRef, [ExecutionEngineRef])
_func("GetPointerToGlobal", ctypes.c_void_p, [ExecutionEngineRef, ValueRef])

_func("DisposeExecutionEngine", None, [ExecutionEngineRef])

# Memory Buffers
class OpaqueMemoryBuffer(ctypes.Structure):
    pass

MemoryBufferRef = ctypes.POINTER(OpaqueMemoryBuffer)

_func("CreateMemoryBufferWithContentsOfFile", Bool,
      [ctypes.c_char_p, ctypes.POINTER(MemoryBufferRef), ctypes.POINTER(ctypes.c_char_p)])
_func("DisposeMemoryBuffer", None, [MemoryBufferRef])

# Bitcode Readers
_func("ParseBitcode", Bool,
      [MemoryBufferRef, ctypes.POINTER(ModuleRef), ctypes.POINTER(ctypes.c_char_p)])

# Command line options
_func("ParseEnvironmentOptions", None, [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p])
if os.environ.get("NITROUS_LLVM_OPTS"):
    ParseEnvironmentOptions("nitrous", "NITROUS_LLVM_OPTS", None)

def address_of(r):
    """Returns LLVM reference (eg. ValueRef) pointer value."""
    return ctypes.cast(r, ctypes.c_void_p).value

def types_equal(tx, ty):
    """Returns True if *tx* is the same LLVMTypeRef as *ty*.

    To check equality, retrieve and compare raw pointer values.

    """
    # In LLVM, getting the same type (eg. IntType(32)) yields
    # same unique pointer value each time its invoked.
    return address_of(tx) == address_of(ty)

def get_intrinsic(builder, name, spec):
    """Return intrinsic declaration for name and specialization types."""
    module = GetParentModule__(builder)
    i = INTRINSICS["llvm.{0}".format(name)]
    return GetIntrinsicDeclaration(module, i, spec, len(spec))

def build_py_idiv(builder, a, b, name):
    """Build expression for floor integer division.

    As seen in Cython:

        long q = a / b;
        long r = a - q*b;
        q -= ((r != 0) & ((r ^ b) < 0));
        return q;

    """

    q = BuildSDiv(builder, a, b, name + "_q")
    r = BuildSub(builder, a, BuildMul(builder, q, b, name + "_r"), name + "_sub")

    # TODO Assumes signed integers
    zero = ConstNull(TypeOf(r))
    q_sub = BuildAnd(builder,
                     BuildICmp(builder, IntNE, r, zero, name + "_cmp_1"),
                     BuildICmp(builder, IntSLT,
                               BuildXor(builder, r, b, name + "_xor"),
                               zero, name + "_cmp_2"),
                     name + "_q_and")

    return BuildSub(builder, q,
                    BuildCast(builder, ZExt, q_sub, TypeOf(a), name + "_cast"),
                    name)

def build_pow(builder, a, b, name):
    """Builds an expression for a ** b."""
    pow = get_intrinsic(builder, "pow", (TypeRef * 1)(TypeOf(a)))
    v = BuildCall(builder, pow, (ValueRef * 2)(a, b), 2, "call")
    return v

# Modulo (%) implementation for integers and floats
#
#   r = a (s|f)rem b
#   if (a >> (sizeof(a) * 8)) ^ (b >> (sizeof(b) * 8)) == 1:
#       return -r
#   else
#       return r

def _mod_scale(builder, int_a, int_b):
    """When building `mod`, returns True if the result of `rem` should
    be scaled by -1, False otherwise.

    Assume *int_a* and *int_b* are integers of equal size.

    """
    ty = TypeOf(int_a)
    size = GetIntTypeWidth(ty)

    one = ConstInt(ty, 1, True)
    sign_shift = ConstInt(ty, size - 1, True)

    sign_a = BuildLShr(builder, int_a, sign_shift, "")
    cond_a = BuildICmp(builder, IntEQ, sign_a, one, "")

    sign_b = BuildLShr(builder, int_b, sign_shift, "")
    cond_b = BuildICmp(builder, IntEQ, sign_b, one, "")

    return BuildXor(builder, cond_a, cond_b, "")

def build_smod(builder, a, b, name):
    """Builds expression for signed int modulo."""

    rem = BuildSRem(builder, a, b, "")
    neg_rem = BuildMul(builder, rem, ConstInt(TypeOf(rem), -1, True), "")

    return BuildSelect(builder, _mod_scale(builder, a, b), neg_rem, rem, name)

def build_fmod(builder, a, b, name):
    """Builds expression for floating point modulo."""

    kind = GetTypeKind(TypeOf(a))
    if kind == FloatTypeKind:
        size = 32
    elif kind == DoubleTypeKind:
        size = 64
    else:
        raise TypeError("Cannot build %: unknown float type kind")

    int_ty = IntType(size)
    int_a = BuildCast(builder, BitCast, a, int_ty, "")
    int_b = BuildCast(builder, BitCast, b, int_ty, "")

    rem = BuildFRem(builder, a, b, "")
    neg_rem = BuildFMul(builder, rem, ConstReal(TypeOf(rem), -1), "")

    return BuildSelect(builder, _mod_scale(builder, int_a, int_b), neg_rem, rem, name)

def link_modules(dst, src):
    """Link source module into destination one.

    Source module is destroyed.

    """
    message = ctypes.c_char_p()
    status = LinkModules__(dst, src, LinkerDestroySource, ctypes.byref(message))
    if status != 0:
        error = RuntimeError("Could not link modules: {0}".format(message.value))
        llvm.DisposeMessage(message)
        raise error


text:
/*
 *

 * 版权: ©2011
 *

 */
package org.young.isocket.threadpool;

import java.util.concurrent.RejectedExecutionException;

/**
 * Exception thrown when a rejects to accept
 * a given task for execution.
 *
 * @author yangjun2
 * @email yangjun1120@gmail.com
 */
public class JobRejectedException extends RejectedExecutionException {

    private static final long serialVersionUID = 4597045330724064199L;

    /**
     * Create a new JobRejectedException
     * with the specified detail message and no root cause.
     * @param msg the detail message
     */
    public JobRejectedException(String msg) {
        super(msg);
    }

    /**
     * Create a new JobRejectedException
     * with the specified detail message and the given root cause.
     * @param msg the detail message
     * @param cause the root cause (usually from using an underlying
     * API such as the java.util.concurrent package)
     * @see java.util.concurrent.RejectedExecutionException
     */
    public JobRejectedException(String msg, Throwable cause) {
        super(msg, cause);
    }

}


text:
<?php
/* Prototype  : bool array_key_exists(mixed $key, array $search)
 * Description: Checks if the given key or index exists in the array
 * Source code: ext/standard/array.c
 * Alias to functions: key_exists
 */

/*
 * Check the position of the internal array pointer after calling array_key_exists()
 */

echo "*** Testing array_key_exists() : usage variations ***\n";

$input = array ('one' => 'un', 'two' => 'deux', 'three' => 'trois');

echo "\n-- Call array_key_exists() --\n";
var_dump($result = array_key_exists('one', $input));

echo "\n-- Position of Internal Pointer in Original Array: --\n";
echo key($input) . " => " . current ($input) . "\n";

echo "Done";
?>