text:
package com.xinqihd.sns.gameserver.proto;

public final class XinqiBseUserInput {
  private XinqiBseUserInput() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
  }
  public interface BseUserInputOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required string type = 1;
    boolean hasType();
    String getType();

    // required string title = 2;
    boolean hasTitle();
    String getTitle();

    // required string message = 3;
    boolean hasMessage();
    String getMessage();

    // optional string usersession = 4;
    boolean hasUsersession();
    String getUsersession();
  }
  public static final class BseUserInput extends
      com.google.protobuf.GeneratedMessage
      implements BseUserInputOrBuilder {
    // Use BseUserInput.newBuilder() to construct.
    private BseUserInput(Builder builder) {
      super(builder);
    }
    private BseUserInput(boolean noInit) {}

    private static final BseUserInput defaultInstance;
    public static BseUserInput getDefaultInstance() {
      return defaultInstance;
    }

    public BseUserInput getDefaultInstanceForType() {
      return defaultInstance;
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.internal_static_com_xinqihd_sns_gameserver_proto_BseUserInput_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.internal_static_com_xinqihd_sns_gameserver_proto_BseUserInput_fieldAccessorTable;
    }

    private int bitField0_;
    // required string type = 1;
    public static final int TYPE_FIELD_NUMBER = 1;
    private java.lang.Object type_;
    public boolean hasType() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    public String getType() {
      java.lang.Object ref = type_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        if (com.google.protobuf.Internal.isValidUtf8(bs)) {
          type_ = s;
        }
        return s;
      }
    }
    private com.google.protobuf.ByteString getTypeBytes() {
      java.lang.Object ref = type_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((String) ref);
        type_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // required string title = 2;
    public static final int TITLE_FIELD_NUMBER = 2;
    private java.lang.Object title_;
    public boolean hasTitle() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    public String getTitle() {
      java.lang.Object ref = title_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        if (com.google.protobuf.Internal.isValidUtf8(bs)) {
          title_ = s;
        }
        return s;
      }
    }
    private com.google.protobuf.ByteString getTitleBytes() {
      java.lang.Object ref = title_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((String) ref);
        title_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // required string message = 3;
    public static final int MESSAGE_FIELD_NUMBER = 3;
    private java.lang.Object message_;
    public boolean hasMessage() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    public String getMessage() {
      java.lang.Object ref = message_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        if (com.google.protobuf.Internal.isValidUtf8(bs)) {
          message_ = s;
        }
        return s;
      }
    }
    private com.google.protobuf.ByteString getMessageBytes() {
      java.lang.Object ref = message_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((String) ref);
        message_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string usersession = 4;
    public static final int USERSESSION_FIELD_NUMBER = 4;
    private java.lang.Object usersession_;
    public boolean hasUsersession() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    public String getUsersession() {
      java.lang.Object ref = usersession_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        if (com.google.protobuf.Internal.isValidUtf8(bs)) {
          usersession_ = s;
        }
        return s;
      }
    }
    private com.google.protobuf.ByteString getUsersessionBytes() {
      java.lang.Object ref = usersession_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((String) ref);
        usersession_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    private void initFields() {
      type_ = "";
      title_ = "";
      message_ = "";
      usersession_ = "";
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasType()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasTitle()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasMessage()) {
        memoizedIsInitialized = 0;
        return false;
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getTypeBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getTitleBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(3, getMessageBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeBytes(4, getUsersessionBytes());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getTypeBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, getTitleBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(3, getMessageBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(4, getUsersessionBytes());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    public static com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInputOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.internal_static_com_xinqihd_sns_gameserver_proto_BseUserInput_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.internal_static_com_xinqihd_sns_gameserver_proto_BseUserInput_fieldAccessorTable;
      }

      // Construct using com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        type_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        title_ = "";
        bitField0_ = (bitField0_ & ~0x00000002);
        message_ = "";
        bitField0_ = (bitField0_ & ~0x00000004);
        usersession_ = "";
        bitField0_ = (bitField0_ & ~0x00000008);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput.getDescriptor();
      }

      public com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput getDefaultInstanceForType() {
        return com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput.getDefaultInstance();
      }

      public com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput build() {
        com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      private com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput buildParsed()
          throws com.google.protobuf.InvalidProtocolBufferException {
        com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(
            result).asInvalidProtocolBufferException();
        }
        return result;
      }

      public com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput buildPartial() {
        com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput result = new com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.type_ = type_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.title_ = title_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.message_ = message_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        result.usersession_ = usersession_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput) {
          return mergeFrom((com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput other) {
        if (other == com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput.getDefaultInstance()) return this;
        if (other.hasType()) {
          setType(other.getType());
        }
        if (other.hasTitle()) {
          setTitle(other.getTitle());
        }
        if (other.hasMessage()) {
          setMessage(other.getMessage());
        }
        if (other.hasUsersession()) {
          setUsersession(other.getUsersession());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasType()) {

          return false;
        }
        if (!hasTitle()) {

          return false;
        }
        if (!hasMessage()) {

          return false;
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder(
            this.getUnknownFields());
        while (true) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              this.setUnknownFields(unknownFields.build());
              onChanged();
              return this;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                this.setUnknownFields(unknownFields.build());
                onChanged();
                return this;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              type_ = input.readBytes();
              break;
            }
            case 18: {
              bitField0_ |= 0x00000002;
              title_ = input.readBytes();
              break;
            }
            case 26: {
              bitField0_ |= 0x00000004;
              message_ = input.readBytes();
              break;
            }
            case 34: {
              bitField0_ |= 0x00000008;
              usersession_ = input.readBytes();
              break;
            }
          }
        }
      }

      private int bitField0_;

      // required string type = 1;
      private java.lang.Object type_ = "";
      public boolean hasType() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      public String getType() {
        java.lang.Object ref = type_;
        if (!(ref instanceof String)) {
          String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
          type_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      public Builder setType(String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        type_ = value;
        onChanged();
        return this;
      }
      public Builder clearType() {
        bitField0_ = (bitField0_ & ~0x00000001);
        type_ = getDefaultInstance().getType();
        onChanged();
        return this;
      }
      void setType(com.google.protobuf.ByteString value) {
        bitField0_ |= 0x00000001;
        type_ = value;
        onChanged();
      }

      // required string title = 2;
      private java.lang.Object title_ = "";
      public boolean hasTitle() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      public String getTitle() {
        java.lang.Object ref = title_;
        if (!(ref instanceof String)) {
          String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
          title_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      public Builder setTitle(String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        title_ = value;
        onChanged();
        return this;
      }
      public Builder clearTitle() {
        bitField0_ = (bitField0_ & ~0x00000002);
        title_ = getDefaultInstance().getTitle();
        onChanged();
        return this;
      }
      void setTitle(com.google.protobuf.ByteString value) {
        bitField0_ |= 0x00000002;
        title_ = value;
        onChanged();
      }

      // required string message = 3;
      private java.lang.Object message_ = "";
      public boolean hasMessage() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      public String getMessage() {
        java.lang.Object ref = message_;
        if (!(ref instanceof String)) {
          String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
          message_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      public Builder setMessage(String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        message_ = value;
        onChanged();
        return this;
      }
      public Builder clearMessage() {
        bitField0_ = (bitField0_ & ~0x00000004);
        message_ = getDefaultInstance().getMessage();
        onChanged();
        return this;
      }
      void setMessage(com.google.protobuf.ByteString value) {
        bitField0_ |= 0x00000004;
        message_ = value;
        onChanged();
      }

      // optional string usersession = 4;
      private java.lang.Object usersession_ = "";
      public boolean hasUsersession() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      public String getUsersession() {
        java.lang.Object ref = usersession_;
        if (!(ref instanceof String)) {
          String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
          usersession_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      public Builder setUsersession(String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        usersession_ = value;
        onChanged();
        return this;
      }
      public Builder clearUsersession() {
        bitField0_ = (bitField0_ & ~0x00000008);
        usersession_ = getDefaultInstance().getUsersession();
        onChanged();
        return this;
      }
      void setUsersession(com.google.protobuf.ByteString value) {
        bitField0_ |= 0x00000008;
        usersession_ = value;
        onChanged();
      }

      // @@protoc_insertion_point(builder_scope:com.xinqihd.sns.gameserver.proto.BseUserInput)
    }

    static {
      defaultInstance = new BseUserInput(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:com.xinqihd.sns.gameserver.proto.BseUserInput)
  }

  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_com_xinqihd_sns_gameserver_proto_BseUserInput_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_com_xinqihd_sns_gameserver_proto_BseUserInput_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n\022BseUserInput.proto\022 com.xinqihd.sns.ga" +
      "meserver.proto\"Q\n\014BseUserInput\022\014\n\004type\030\001" +
      " \002(\t\022\r\n\005title\030\002 \002(\t\022\017\n\007message\030\003 \002(\t\022\023\n\013" +
      "usersession\030\004 \001(\tB\023B\021XinqiBseUserInput"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
        public com.google.protobuf.ExtensionRegistry assignDescriptors(
            com.google.protobuf.Descriptors.FileDescriptor root) {
          descriptor = root;
          internal_static_com_xinqihd_sns_gameserver_proto_BseUserInput_descriptor =
            getDescriptor().getMessageTypes().get(0);
          internal_static_com_xinqihd_sns_gameserver_proto_BseUserInput_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_com_xinqihd_sns_gameserver_proto_BseUserInput_descriptor,
              new java.lang.String[] { "Type", "Title", "Message", "Usersession", },
              com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput.class,
              com.xinqihd.sns.gameserver.proto.XinqiBseUserInput.BseUserInput.Builder.class);
          return null;
        }
      };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        }, assigner);
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
* @name: S15.5.4.14_A7;
* @section: 15.5.4.14, 13.2;
* @assertion: String.prototype.split can't be used as constructor;
* @description: Checking if creating the String.prototype.split object fails;
*/

var __FACTORY = String.prototype.split;

try {
  var __instance = new __FACTORY;
  $FAIL('#1: __FACTORY = String.prototype.split; "__instance = new __FACTORY" lead to throwing exception');
} catch (e) {}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
G. H. K. Thwaites & J. D. Hooker, Enum. pl. zeyl. 67. 1858

#### Original name
null

### Remarks
null


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.hybridcontainerservice.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Configurations for provisioning the cluster with HTTP proxy servers. */
@Fluent
public final class HttpProxyConfig extends HttpProxyConfigResponse {
    /*
     * Password to use for connecting to proxy server
     */
    @JsonProperty(value = "password")
    private String password;

    /** Creates an instance of HttpProxyConfig class. */
    public HttpProxyConfig() {
    }

    /**
     * Get the password property: Password to use for connecting to proxy server.
     *
     * @return the password value.
     */
    public String password() {
        return this.password;
    }

    /**
     * Set the password property: Password to use for connecting to proxy server.
     *
     * @param password the password value to set.
     * @return the HttpProxyConfig object itself.
     */
    public HttpProxyConfig withPassword(String password) {
        this.password = password;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public HttpProxyConfig withHttpProxy(String httpProxy) {
        super.withHttpProxy(httpProxy);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public HttpProxyConfig withHttpsProxy(String httpsProxy) {
        super.withHttpsProxy(httpsProxy);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public HttpProxyConfig withNoProxy(List<String> noProxy) {
        super.withNoProxy(noProxy);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public HttpProxyConfig withTrustedCa(String trustedCa) {
        super.withTrustedCa(trustedCa);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public HttpProxyConfig withUsername(String username) {
        super.withUsername(username);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
    }
}


text:
#if defined(_MSC_VER) && _MSC_VER < 1300
#pragma warning(disable:4786)
#endif

#ifdef POSIX
extern "C" {
#include <sys/time.h>
}
#endif

#include "talk/base/common.h"
#include "talk/base/logging.h"
#include "talk/base/messagequeue.h"
#include "talk/base/physicalsocketserver.h"

namespace talk_base {

const uint32 kMaxMsgLatency = 150;  // 150 ms

//------------------------------------------------------------------
// MessageQueueManager

MessageQueueManager* MessageQueueManager::instance_;

MessageQueueManager* MessageQueueManager::Instance() {
  // Note: This is not thread safe, but it is first called before threads are
  // spawned.
  if (!instance_)
    instance_ = new MessageQueueManager;
  return instance_;
}

MessageQueueManager::MessageQueueManager() {
}

MessageQueueManager::~MessageQueueManager() {
}

void MessageQueueManager::Add(MessageQueue *message_queue) {
  // MessageQueueManager methods should be non-reentrant, so we
  // ASSERT that is the case.
  ASSERT(!crit_.CurrentThreadIsOwner());
  CritScope cs(&crit_);
  message_queues_.push_back(message_queue);
}

void MessageQueueManager::Remove(MessageQueue *message_queue) {
  ASSERT(!crit_.CurrentThreadIsOwner());  // See note above.
  CritScope cs(&crit_);
  std::vector<MessageQueue *>::iterator iter;
  iter = std::find(message_queues_.begin(), message_queues_.end(), message_queue);
  if (iter != message_queues_.end())
    message_queues_.erase(iter);
}

void MessageQueueManager::Clear(MessageHandler *handler) {
  ASSERT(!crit_.CurrentThreadIsOwner());  // See note above.
  CritScope cs(&crit_);
  std::vector<MessageQueue *>::iterator iter;
  for (iter = message_queues_.begin(); iter != message_queues_.end(); iter++)
    (*iter)->Clear(handler);
}

//------------------------------------------------------------------
// MessageQueue

MessageQueue::MessageQueue(SocketServer* ss)
    : ss_(ss), new_ss(false), fStop_(false), fPeekKeep_(false), active_(false) {
  if (!ss_) {
    new_ss = true;
    ss_ = new PhysicalSocketServer();
  }
}

MessageQueue::~MessageQueue() {
  if (active_) {
    MessageQueueManager::Instance()->Remove(this);
    Clear(NULL);
  }
  if (new_ss)
    delete ss_;
}

void MessageQueue::set_socketserver(SocketServer* ss) {
  if (new_ss)
    delete ss_;
  new_ss = false;
  ss_ = ss;
}

void MessageQueue::Stop() {
  fStop_ = true;
  ss_->WakeUp();
}

bool MessageQueue::IsStopping() {
  return fStop_;
}

void MessageQueue::Restart() {
  fStop_ = false;
}

bool MessageQueue::Peek(Message *pmsg, int cmsWait) {
  if (fPeekKeep_) {
    *pmsg = msgPeek_;
    return true;
  }
  if (!Get(pmsg, cmsWait))
    return false;
  msgPeek_ = *pmsg;
  fPeekKeep_ = true;
  return true;
}

bool MessageQueue::Get(Message *pmsg, int cmsWait) {
  // Return and clear peek if present
  // Always return the peek if it exists so there is Peek/Get symmetry

  if (fPeekKeep_) {
    *pmsg = msgPeek_;
    fPeekKeep_ = false;
    return true;
  }

  // Get w/wait + timer scan / dispatch + socket / event multiplexer dispatch

  int cmsTotal = cmsWait;
  int cmsElapsed = 0;
  uint32 msStart = Time();
  uint32 msCurrent = msStart;
  while (true) {
    // Check for sent messages

    ReceiveSends();

    // Check queues

    int cmsDelayNext = kForever;
    {
      CritScope cs(&crit_);

      // Check for delayed messages that have been triggered
      // Calc the next trigger too

      while (!dmsgq_.empty()) {
        if (msCurrent < dmsgq_.top().msTrigger_) {
          cmsDelayNext = dmsgq_.top().msTrigger_ - msCurrent;
          break;
        }
        msgq_.push(dmsgq_.top().msg_);
        dmsgq_.pop();
      }

      // Check for posted events

      while (!msgq_.empty()) {
        *pmsg = msgq_.front();
        if (pmsg->ts_sensitive) {
          long delay = TimeDiff(msCurrent, pmsg->ts_sensitive);
          if (delay > 0) {
            LOG_F(LS_WARNING) << "id: " << pmsg->message_id << "  delay: "
                              << (delay + kMaxMsgLatency) << "ms";
          }
        }
        msgq_.pop();
        if (MQID_DISPOSE == pmsg->message_id) {
          ASSERT(NULL == pmsg->phandler);
          delete pmsg->pdata;
          continue;
        }
        return true;
      }
    }

    if (fStop_)
      break;

    // Which is shorter, the delay wait or the asked wait?

    int cmsNext;
    if (cmsWait == kForever) {
      cmsNext = cmsDelayNext;
    } else {
      cmsNext = cmsTotal - cmsElapsed;
      if (cmsNext < 0)
        cmsNext = 0;
      if ((cmsDelayNext != kForever) && (cmsDelayNext < cmsNext))
        cmsNext = cmsDelayNext;
    }

    // Wait and multiplex in the meantime
    ss_->Wait(cmsNext, true);

    // If the specified timeout expired, return

    msCurrent = Time();
    cmsElapsed = msCurrent - msStart;
    if (cmsWait != kForever) {
      if (cmsElapsed >= cmsWait)
        return false;
    }
  }
  return false;
}

void MessageQueue::ReceiveSends() {
}

void MessageQueue::Post(MessageHandler *phandler, uint32 id,
    MessageData *pdata, bool time_sensitive) {
  if (fStop_)
    return;

  // Keep thread safe
  // Add the message to the end of the queue
  // Signal for the multiplexer to return

  CritScope cs(&crit_);
  EnsureActive();
  Message msg;
  msg.phandler = phandler;
  msg.message_id = id;
  msg.pdata = pdata;
  if (time_sensitive) {
    msg.ts_sensitive = Time() + kMaxMsgLatency;
  }
  msgq_.push(msg);
  ss_->WakeUp();
}

void MessageQueue::PostDelayed(int cmsDelay, MessageHandler *phandler,
    uint32 id, MessageData *pdata) {
  if (fStop_)
    return;

  // Keep thread safe
  // Add to the priority queue. Gets sorted soonest first.
  // Signal for the multiplexer to return.

  CritScope cs(&crit_);
  EnsureActive();
  Message msg;
  msg.phandler = phandler;
  msg.message_id = id;
  msg.pdata = pdata;
  dmsgq_.push(DelayedMessage(cmsDelay, &msg));
  ss_->WakeUp();
}

int MessageQueue::GetDelay() {
  CritScope cs(&crit_);

  if (!msgq_.empty())
    return 0;

  if (!dmsgq_.empty()) {
    int delay = dmsgq_.top().msTrigger_ - Time();
    if (delay < 0)
      delay = 0;
    return delay;
  }

  return kForever;
}

void MessageQueue::Clear(MessageHandler *phandler, uint32 id) {
  CritScope cs(&crit_);

  // Remove messages with phandler

  if (fPeekKeep_) {
    if (phandler == NULL || msgPeek_.phandler == phandler) {
      if (id == MQID_ANY || msgPeek_.message_id == id) {
        delete msgPeek_.pdata;
        fPeekKeep_ = false;
      }
    }
  }

  // Remove from ordered message queue

  size_t c = msgq_.size();
  while (c-- != 0) {
    Message msg = msgq_.front();
    msgq_.pop();
    if (phandler != NULL && msg.phandler != phandler) {
      msgq_.push(msg);
    } else {
      if (id == MQID_ANY || msg.message_id == id) {
        delete msg.pdata;
      } else {
        msgq_.push(msg);
      }
    }
  }

  // Remove from priority queue. Not directly iterable, so use this approach

  std::queue<DelayedMessage> dmsgs;
  while (!dmsgq_.empty()) {
    DelayedMessage dmsg = dmsgq_.top();
    dmsgq_.pop();
    if (phandler != NULL && dmsg.msg_.phandler != phandler) {
      dmsgs.push(dmsg);
    } else {
      if (id == MQID_ANY || dmsg.msg_.message_id == id) {
        delete dmsg.msg_.pdata;
      } else {
        dmsgs.push(dmsg);
      }
    }
  }
  while (!dmsgs.empty()) {
    dmsgq_.push(dmsgs.front());
    dmsgs.pop();
  }
}

void MessageQueue::Dispatch(Message *pmsg) {
  pmsg->phandler->OnMessage(pmsg);
}

void MessageQueue::EnsureActive() {
  ASSERT(crit_.CurrentThreadIsOwner());
  if (!active_) {
    active_ = true;
    MessageQueueManager::Instance()->Add(this);
  }
}

} // namespace talk_base


text: export const DEFAULT_URL = 'http://data.fixer.io/api';


text:
<?xml version="1.0" encoding="UTF-8"?>
<object name="course_category">
    <properties>
        <property
            name="id"
            type="integer"
            unsigned="1"
            notnull="1"
            autoincrement="true" />
        <property
            name="name"
            type="text"
            length="100"
            notnull="1"
            default="" />
        <property
            name="parent_id"
            type="integer"
            notnull="1"
            default="0" />
        <property
            name="display_order"
            type="integer"
            unsigned="1"
            notnull="1" />
        <property
            name="code"
            type="text"
            length="25"
            default="" />
        <property
            name="state"
            type="integer"
            notnull="1"
            default="0" />
    </properties>
    <index name="parent_id">
        <indexproperty name="parent_id" />
    </index>
    <index name="display_order">
        <indexproperty name="display_order" />
    </index>
</object>


text:
namespace TransactionService.Migrations
{
    using System.Data.Entity.Migrations;

    internal sealed class Configuration : DbMigrationsConfiguration<TransactionService.Data.TransactionServiceContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = true;
        }
    }
}


text:
class Model;

struct Shader : public IShader
{
    mat<2, 3, float> varying_uv;  // triangle uv coordinates, written by the vertex shader, read by the fragment shader
    mat<4, 3, float> varying_tri; // triangle coordinates (clip coordinates), written by VS, read by FS
    mat<3, 3, float> varying_nrm; // normal per vertex to be interpolated by FS
    Vec3f light_dir;
    Model * pModel = nullptr;

    Vec4f vertex(int iface, int nthvert) override;
    bool fragment(Vec3f bar, TGAColor & color) override;

    void setLightDirection(Vec3f & direction);
};


text:
#ifndef DocumentAnimations_h
#define DocumentAnimations_h

#include "CSSPropertyNames.h"

namespace WebCore {

class Document;
class FrameView;
class Node;

class DocumentAnimations  {
public:
    static void serviceOnAnimationFrame(Document&, double monotonicAnimationStartTime);
    static void serviceBeforeGetComputedStyle(Node&, CSSPropertyID);
    static void serviceAfterStyleRecalc(Document&);

private:
    DocumentAnimations() { }
};

} // namespace

#endif


text:
package cn.dongjak.table2bean.builder.java;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;

import cn.dongjak.table2bean.builder.AbstractCode;

public class JavaClass extends AbstractCode {
	private static Logger logger = Logger.getLogger(JavaClass.class.getName());
	private String packagePath;
	private String name;
	private File file;
	private List<JavaClassImport> imports;
	private List<JavaClassField> fields;
	private List<String> implementList;
	private String classExtend;
	private boolean asParentGenericType;

	public String getName() {
		return name;
	}

	/**
	 * 自动将该类型作为父类的泛型类型.
	 *
	 * @return
	 */
	public boolean isAsParentGenericType() {
		return asParentGenericType;
	}

	public void setAsParentGenericType(boolean asParentGenericType) {
		this.asParentGenericType = asParentGenericType;
	}

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

	public File getFile() {
		return file;
	}

	public void setFile(File file) {
		this.file = file;
	}

	public JavaClass(String name) {
		super();
		this.name = name;
	}

	public List<JavaClassImport> getImports() {
		return imports;
	}

	public void setImports(List<JavaClassImport> imports) {
		this.imports = imports;
	}

	public String getClassExtend() {
		return classExtend;
	}

	public void setClassExtend(String classExtend) {
		this.classExtend = classExtend;
	}

	public String getPackagePath() {
		return packagePath;
	}

	public void setPackagePath(String packagePath) {
		this.packagePath = packagePath;
	}

	public static Logger getLogger() {
		return logger;
	}

	public static void setLogger(Logger logger) {
		JavaClass.logger = logger;
	}

	public List<JavaClassField> getFields() {
		return fields;
	}

	public void setFields(List<JavaClassField> fields) {
		this.fields = fields;
	}

	@Override
	public List<String> getCode() {
		List<String> code = new ArrayList<String>();
		code.add(String.format("package %s;", this.packagePath));
		for (JavaClassImport classImport : this.imports)
			code.addAll(classImport.getCode());
		code.add(String.format("public class %s %s %s{", this.name,
				(StringUtils.isNotBlank(this.classExtend) ? String.format("extends %s",
						isAsParentGenericType() ? this.classExtend + String.format("<%s>", name) : this.classExtend)
						: ""),
				(this.implementList != null && this.implementList.size() > 0)
						? String.format("implements %s", String.join(",", this.implementList)) : ""));

		for (JavaClassField classField : this.fields)
			code.addAll(classField.getCode());
		code.add("}");
		return code;
	}

	public void write() {
		try {
			if (!this.file.exists())
				this.file.createNewFile();
			FileUtils.writeLines(this.file, this.getCode());
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void setClassImplements(List<String> beanTemplateImplementClass) {
		this.implementList = beanTemplateImplementClass;
	}
}


text:
<?php

namespace Admin\AdminBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * LivresRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class LivresRepository extends EntityRepository
{
	public function getAll($categorie)
    {
        $query = $this->getEntityManager()->createQuery(
        	'SELECT A FROM AdminBundle:Livres A
            WHERE A.collection = :categorie');

        $query->setParameter('categorie', $categorie);
        return $query->getResult();

    }

    public function getTwo($sousCat)
    {
        $query = $this->getEntityManager()->createQuery(
        	'SELECT A FROM AdminBundle:Livres A
            WHERE A.categorie = :sousCat');

        $query->setParameter('sousCat', $sousCat);
        try{
        	return $query->getResult();
        }
        catch (\Doctrine\Orm\NoResultException $e) {
			return null;
		}
    }

    public function getPremiere()
    {
        $query = $this->getEntityManager()->createQuery(
            'SELECT A FROM AdminBundle:Livres A
            WHERE A.premiere = true')
            ->setMaxResults(2);

        try{
            return $query->getResult();
        }
        catch (\Doctrine\Orm\NoResultException $e) {
            return null;
        }

    }

     public function getFileNames($id)
    {
        $query = $this->getEntityManager()->createQuery(
            'SELECT A FROM AdminBundle:Livres A
            WHERE A.id = :id');

        $query->setParameter('id', $id);
        try{
            return $query->getResult();
        }
        catch (\Doctrine\Orm\NoResultException $e) {
            return null;
        }
    }
}


text:
void ofxWinError();
#else

#include <winuser.h>
#include <commdlg.h>
#include <Shobjidl.h>
#include "ofBaseTypes.h"

// Dialogs
//------------------------------------------------------------------------------
ofColor ofxWinColorDialog();

// Cursor
//------------------------------------------------------------------------------
// Choose cursor here: http://msdn.microsoft.com/library/windows/desktop/ms648391.aspx
void ofxWinCursor(LPCTSTR name);

// Taskbar
//------------------------------------------------------------------------------
class ofxWinTaskbarProgress {
public:
	ofxWinTaskbarProgress();
	virtual ~ofxWinTaskbarProgress();

	void SetProgressState(HWND hwnd, TBPFLAG flag);
	void SetProgressValue(HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal);

private:
	bool setup();
	ITaskbarList3* m_pITaskBarList;
	bool m_bFailed;
};

#endif
#endif


text:
//
//  RgNetWorkObject.h
//  RogueKitDemo
//
//  Created by Rogue on 16/3/17.
//  Copyright © 2016年 Rogue. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 *  判断网络数据类型
 */
typedef NS_ENUM(NSInteger, RogueNetWorkType) {
    /**
     *  返回的网络数据正确
     */
    RogueNetWorkRight       = 0,
    /**
     *  返回的网络数据有错
     */
    RogueNetWorkWrong       = 1,
    /**
     *  连接网络失败
     */
    RogueNetWorkSystemWrong = 2
};

@interface RgNetWorkObject : NSObject

+ (void)postMethod:(NSString *)method parameters:(NSDictionary *)parameters complete:(void (^)(NSDictionary *response, RogueNetWorkType networkType))complete;

+ (void)getMethod:(NSString *)method parameters:(NSDictionary *)parameters complete:(void (^)(NSDictionary *response, RogueNetWorkType networkType))complete;

@end


text:
"""Test deprecation of reqSigs and addresses RPC fields."""

from test_framework.messages import (
    tx_from_hex,
)
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
    assert_equal,
    hex_str_to_bytes
)

class AddressesDeprecationTest(BitcoinTestFramework):
    def set_test_params(self):
        self.num_nodes = 2
        self.extra_args = [[], ["-deprecatedrpc=addresses"]]

    def skip_test_if_missing_module(self):
        self.skip_if_no_wallet()

    def run_test(self):
        self.test_addresses_deprecation()

    def test_addresses_deprecation(self):
        node = self.nodes[0]
        coin = node.listunspent().pop()

        inputs = [{'txid': coin['txid'], 'vout': coin['vout']}]
        outputs = [{node.getnewaddress(): 0.99}, {"fee": 49.01}]
        raw = node.createrawtransaction(inputs, outputs)
        signed = node.signrawtransactionwithwallet(raw)['hex']

        # This transaction is derived from test/util/data/txcreatemultisig1.json
        tx = tx_from_hex(signed)
        tx.vout[0].scriptPubKey = hex_str_to_bytes("522102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff39721021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d2102df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb48553ae")
        tx_signed = node.signrawtransactionwithwallet(tx.serialize().hex())['hex']
        txid = node.sendrawtransaction(hexstring=tx_signed, maxfeerate=0)

        self.log.info("Test RPCResult scriptPubKey no longer returns the fields addresses or reqSigs by default")
        hash = node.generateblock(output=node.getnewaddress(), transactions=[txid])['hash']
        # Ensure both nodes have the newly generated block on disk.
        self.sync_blocks()
        script_pub_key = node.getblock(blockhash=hash, verbose=2)['tx'][-1]['vout'][0]['scriptPubKey']
        assert 'addresses' not in script_pub_key and 'reqSigs' not in script_pub_key

        self.log.info("Test RPCResult scriptPubKey returns the addresses field with -deprecatedrpc=addresses")
        script_pub_key = self.nodes[1].getblock(blockhash=hash, verbose=2)['tx'][-1]['vout'][0]['scriptPubKey']
        assert_equal(script_pub_key['addresses'], ['2dpE1QZAo6evnMACWLCdofgqCsdfFNLf3of', '2doxeNfNAyhGfb5jePJWf2kBb4tT49FQ9ai', '2dcmeySetSvTSUxEEjdt4Rsh2MSxUP3AYFS'])
        assert_equal(script_pub_key['reqSigs'], 2)

if __name__ == "__main__":
    AddressesDeprecationTest().main()


text:
require  'spec_helper'

describe Admin::UserDatas::StoreCreditsController do
  # fixtures :all
  render_views
  before(:each) do
    activate_authlogic
    @cur_user = FactoryGirl.create(:admin_user)
    login_as(@cur_user)
    @user = FactoryGirl.create(:user)
  end

  it "show action should render show template" do
    get :show, :user_id => @user.id
    expect(response).to render_template(:show)
  end

  it "edit action should render edit template" do
    get :edit, :user_id => @user.id
    expect(response).to render_template(:edit)
  end

  it "update action should render edit template when model is invalid" do
    put :update, :user_id => @user.id, :amount_to_add => 'ABC'
    expect(response).to render_template(:edit)
  end

  it "update action should redirect when model is valid" do
    StoreCredit.any_instance.stubs(:valid?).returns(true)
    put :update, :user_id => @user.id, :amount_to_add => '20.0'
    expect(response).to redirect_to(admin_user_datas_user_store_credits_url(@user))
  end
  it "update action should redirect when model is valid" do
    StoreCredit.any_instance.stubs(:valid?).returns(true)
    put :update, :user_id => @user.id, :amount_to_add => '-20.00'
    expect(response).to redirect_to(admin_user_datas_user_store_credits_url(@user))
  end
end


text:
'use strict';

/**
 * Module dependencies
 */
var mediumsPolicy = require('../policies/mediums.server.policy'),
  mediums = require('../controllers/mediums.server.controller');

module.exports = function (app) {
  // Mediums collection routes
  app.route('/api/mediums').all(mediumsPolicy.isAllowed)
    .get(mediums.list)
    .post(mediums.create);

  // Single medium routes
  app.route('/api/mediums/:mediumId').all(mediumsPolicy.isAllowed)
    .get(mediums.read)
    .put(mediums.update)
    .delete(mediums.delete);

  // Finish by binding the medium middleware
  app.param('mediumId', mediums.mediumByID);
};


text:
<?php

namespace Bolt\Tests\Provider;

use Bolt\Session\Generator\GeneratorInterface;
use Bolt\Session\Serializer\SerializerInterface;
use Bolt\Tests\BoltUnitTest;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;

/**
 * @covers \Bolt\Provider\SessionServiceProvider
 *
 * @author Gawain Lynch <gawain.lynch@gmail.com>
 * @author Carson Full <carsonfull@gmail.com>
 */
class SessionServiceProviderTest extends BoltUnitTest
{
    public function testProvider()
    {
        $app = $this->getApp();

        $this->assertInstanceOf(AttributeBagInterface::class, $app['session.bag.attribute']);
        $this->assertInstanceOf(FlashBagInterface::class, $app['session.bag.flash']);
        $this->assertInstanceOf(MetadataBag::class, $app['session.bag.metadata']);
        $this->assertInstanceOf(GeneratorInterface::class, $app['session.generator']);
        $this->assertInstanceOf(SerializerInterface::class, $app['session.serializer']);

        $this->assertInstanceOf(SessionStorageInterface::class, $app['session.storage']);
        $this->assertInstanceOf(SessionInterface::class, $app['session']);
        $this->assertInstanceOf(EventSubscriberInterface::class, $app['session.listener']);

        $this->assertArrayHasKey('name', $app['session.options']);
        $this->assertArrayHasKey('restrict_realm', $app['session.options']);
        $this->assertArrayHasKey('cookie_lifetime', $app['session.options']);
        $this->assertArrayHasKey('cookie_domain', $app['session.options']);
        $this->assertArrayHasKey('cookie_secure', $app['session.options']);
        $this->assertArrayHasKey('cookie_httponly', $app['session.options']);
    }
}


text:
;(function(document, window, undefined) {
function parseQueryString() {
    var parts = location.search.replace(/^[?]/, "").split("&"),
        i     = 0,
        l     = parts.length,
        GET   = {};

    for (; i < l; i++) {
        if (!parts[i]) { continue; }
        part = parts[i].split("=");
        GET[unescape(part[0])] = unescape(part[1]);
    }

    return GET;
}
window.jigsaw = window.jigsaw || {};
jigsaw.GET = parseQueryString();
}(document, window));


text:
var Engine;
(function (Engine) {
    function context(canvas) {
        const gl = (canvas.getContext('webgl') ||
            canvas.getContext('experimental-webgl'));
        if (!gl)
            throw "Couldn't initialize WebGL!";
        return gl;
    }
    Engine.context = context;
    function initScreen(gl) {
        gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
        gl.clearColor(0.0, 0.0, 0.0, 1.0);
        gl.enable(gl.DEPTH_TEST);
        gl.enable(gl.CULL_FACE);
        gl.frontFace(gl.CCW);
        gl.cullFace(gl.BACK);
    }
    Engine.initScreen = initScreen;
    function clearScreen(gl) {
        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
    }
    Engine.clearScreen = clearScreen;
    function createShaderProgram(gl, vertexSource, fragmentSource) {
        function setupShader(shader, source) {
            gl.shaderSource(shader, source);
            gl.compileShader(shader);
            if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))
                console.error("Shader:", gl.getShaderInfoLog(shader));
            return shader;
        }
        const vertShader = setupShader(gl.createShader(gl.VERTEX_SHADER), vertexSource);
        const fragShader = setupShader(gl.createShader(gl.FRAGMENT_SHADER), fragmentSource);
        const program = gl.createProgram();
        gl.attachShader(program, vertShader);
        gl.attachShader(program, fragShader);
        gl.linkProgram(program);
        if (!gl.getProgramParameter(program, gl.LINK_STATUS))
            throw "program: " + gl.getProgramInfoLog(program);
        gl.validateProgram(program);
        if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS))
            throw "program: " + gl.getProgramInfoLog(program);
        return program;
    }
    Engine.createShaderProgram = createShaderProgram;
    function bufferModel(gl, model) {
        const VBO = gl.createBuffer();
        const IBO = gl.createBuffer();
        gl.bindBuffer(gl.ARRAY_BUFFER, VBO);
        gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(model.mesh), gl.STATIC_DRAW);
        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, IBO);
        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(model.indices), gl.STATIC_DRAW);
        return { VBO: VBO, IBO: IBO, nIndices: model.indices.length };
    }
    Engine.bufferModel = bufferModel;
})(Engine || (Engine = {}));


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Smart Kitchen</title>

    <link rel="stylesheet" href="css/bootstrap.min.css"/>
    <link rel="stylesheet" href="css/font-awesome.min.css"/>
    <link rel="stylesheet" href="css/style.min.css"/>
    <link rel="stylesheet" href="css/jquery.dataTables.min.css"/>
    <link rel="stylesheet" href="css/jquery.dataTables_themeroller.css"/>

    <link rel="apple-touch-icon" sizes="57x57" href="img/favicons/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="img/favicons/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="img/favicons/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="img/favicons/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="img/favicons/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="img/favicons/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="img/favicons/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="img/favicons/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="img/favicons/apple-touch-icon-180x180.png">
    <link rel="icon" type="image/png" href="img/favicons/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="img/favicons/favicon-194x194.png" sizes="194x194">
    <link rel="icon" type="image/png" href="img/favicons/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="img/favicons/android-chrome-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="img/favicons/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="img/favicons/manifest.json">
    <meta name="msapplication-TileColor" content="#ffc40d">
    <meta name="msapplication-TileImage" content="img/favicons/mstile-144x144.png">
    <meta name="theme-color" content="#26b7d4">

    <![if !IE]>

    <![endif]>

            <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".spa-navbar-collapse">
                Toggle navigation

            </button>
            Smart Kitchen

                    Get Started

                    About

                    Select other member

                    Dashboard

                      Log Out

                      {{"Enter your Kitchen!"}}
                      Hello {{activeMember.Firstname}}!


text:
using namespace Math;
//Emission Properties and other particle structs

__declspec(align(16)) struct EmissionProperties
{
    XMFLOAT3 LastEmitPosW;
    float EmitSpeed;
    XMFLOAT3 EmitPosW;
    float FloorHeight;
    XMFLOAT3 EmitDirW;
    float Restitution;
    XMFLOAT3 EmitRightW;
    float EmitterVelocitySensitivity;
    XMFLOAT3 EmitUpW;
    UINT MaxParticles;
    XMFLOAT3 Gravity;
    UINT TextureID;
    XMFLOAT3 EmissiveColor;
    float pad1;
    XMUINT4 RandIndex[64];
};

EmissionProperties* CreateEmissionProperties();

struct ParticleSpawnData
{
    float AgeRate;
    float RotationSpeed;
    float StartSize;
    float EndSize;
    XMFLOAT3 Velocity; float Mass;
    XMFLOAT3 SpreadOffset; float Random;
    Color StartColor;
    Color EndColor;
};

struct ParticleMotion
{
    XMFLOAT3 Position;
    float Mass;
    XMFLOAT3 Velocity;
    float Age;
    float Rotation;
    UINT ResetDataIndex;
};

struct ParticleVertex
{
    XMFLOAT3 Position;
    XMFLOAT4 Color;
    float Size;
    UINT TextureID;
};

struct ParticleScreenData
{
    float Corner[2];
    float RcpSize[2];
    float Color[4];
    float Depth;
    float TextureIndex;
    float TextureLevel;
    uint32_t Bounds;
};


text:
using System.Diagnostics;
using System.Linq;
using FluentAssertions;
using Xunit;
using System;

namespace Okanshi.Test
{
#if NET46
    public class PerformanceCounterTest
    {
        public PerformanceCounterTest()
        {
            DefaultMonitorRegistry.Instance.Clear();
        }

        [Fact]
        public void Okanshimonitor_can_create_instance()
        {
            PerformanceCounterMonitor p = OkanshiMonitor.PerformanceCounter(PerformanceCounterConfig.Build("Memory", "Available Bytes"), "name");
            p.Should().NotBeNull();
        }

        [Fact]
        public void Okanshimonitor_can_create_instance_with_tags()
        {
            PerformanceCounterMonitor p = OkanshiMonitor.PerformanceCounter(PerformanceCounterConfig.Build("Memory", "Available Bytes"),"name", new[]{new Tag("a","b")});
            p.Should().NotBeNull();
        }

        [Fact]
        public void Performance_counter_without_instance_name()
        {
            var performanceCounter = new PerformanceCounter("Memory", "Available Bytes");

            var monitor = new PerformanceCounterMonitor(MonitorConfig.Build("Test"),
                PerformanceCounterConfig.Build("Memory", "Available Bytes"));

            monitor.GetValues()
                .Single()
                .Value
                .Should()
                .BeGreaterThan(0)
                .And.BeApproximately(performanceCounter.NextValue(), 1000000,
                    "Because memory usage can change between the two values");
        }

        [Fact]
        public void Performance_counter_with_instance_name()
        {
            var performanceCounter = new PerformanceCounter("Process", "Private Bytes", Process.GetCurrentProcess().ProcessName);

            var monitor = new PerformanceCounterMonitor(MonitorConfig.Build("Test"),
                PerformanceCounterConfig.Build("Process", "Private Bytes", Process.GetCurrentProcess().ProcessName));

            monitor.GetValues()
                .Single()
                .Value
                .Should()
                .BeGreaterThan(0)
                .And.BeApproximately(performanceCounter.NextValue(), 1000000,
                    "Because memory usage can change between the two values");
        }

        [Fact]
        public void Performance_counter_consists_of_a_single_value()
        {
            var monitor = new PerformanceCounterMonitor(MonitorConfig.Build("Test"),
                PerformanceCounterConfig.Build("Process", "Private Bytes", Process.GetCurrentProcess().ProcessName));

            monitor.GetValues().Should().HaveCount(1);
        }

        [Fact]
        public void Value_is_called_value()
        {
            var monitor = new PerformanceCounterMonitor(MonitorConfig.Build("Test"),
                PerformanceCounterConfig.Build("Process", "Private Bytes", Process.GetCurrentProcess().ProcessName));
            monitor.GetValues().Single().Name.Should().Be("value");
        }
    }
#endif
}


text:
"""
Integration test to see if the image promotion process is working for the
Spinnaker Kubernetes V2 integration.
"""

# Standard python modules.
import sys
import random
import string
import json

# citest modules.
from citest.service_testing import HttpContractBuilder
from citest.service_testing import NoOpOperation
import citest.kube_testing as kube
import citest.json_contract as jc
import citest.json_predicate as jp
import citest.service_testing as st

# Spinnaker modules.
import spinnaker_testing as sk
import spinnaker_testing.gate as gate
import spinnaker_testing.frigga as frigga
import citest.base

ov_factory = jc.ObservationPredicateFactory()

class KubeV2CacheTestScenario(sk.SpinnakerTestScenario):
  """Defines the scenario for the kube v2 cache test.
  """

  @classmethod
  def new_agent(cls, bindings):
    """Implements citest.service_testing.AgentTestScenario.new_agent."""
    agent = gate.new_agent(bindings)
    agent.default_max_wait_secs = 180
    return agent

  @classmethod
  def initArgumentParser(cls, parser, defaults=None):
    """Initialize command line argument parser.

    Args:
      parser: argparse.ArgumentParser
    """
    super(KubeV2CacheTestScenario, cls).initArgumentParser(
        parser, defaults=defaults)

    defaults = defaults or {}
    parser.add_argument(
      '--test_namespace', default='default',
      help='The namespace to manage within the tests.')

  def __init__(self, bindings, agent=None):
    """Constructor.

    Args:
      bindings: [dict] The data bindings to use to configure the scenario.
      agent: [GateAgent] The agent for invoking the test operations on Gate.
    """
    super(KubeV2CacheTestScenario, self).__init__(bindings, agent)
    bindings = self.bindings

    # We'll call out the app name because it is widely used
    # because it scopes the context of our activities.
    # pylint: disable=invalid-name
    self.TEST_APP = bindings['TEST_APP']

    # Take just the first if there are multiple
    # because some uses below assume just one.
    self.TEST_NAMESPACE = bindings['TEST_NAMESPACE'].split(',')[0]

    self.mf = sk.KubernetesManifestFactory(self)
    self.mp = sk.KubernetesManifestPredicateFactory()

  def create_app(self):
    """Creates OperationContract that creates a new Spinnaker Application."""
    contract = jc.Contract()
    return st.OperationContract(
        self.agent.make_create_app_operation(
            bindings=self.bindings, application=self.TEST_APP,
            account_name=self.bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT']),
        contract=contract)

  def delete_app(self):
    """Creates OperationContract that deletes a new Spinnaker Application."""
    contract = jc.Contract()
    return st.OperationContract(
        self.agent.make_delete_app_operation(
            application=self.TEST_APP,
            account_name=self.bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT']),
        contract=contract)

  def deploy_deployment(self, image):
    """Creates OperationContract for deploying and substituting one image into
    a Deployment object

    To verify the operation, we just check that the deployment was created with
    the correct image.
    """
    name = self.TEST_APP + '-deployment'
    account = self.bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT']
    payload = self.agent.make_json_payload_from_kwargs(
        job=[{
            'cloudProvider': 'kubernetes',
            'moniker': {
                'app': self.TEST_APP
            },
            'account': account,
            'source': 'text',
            'type': 'deployManifest',
            'user': '[anonymous]',
            'manifests': [self.mf.deployment(name, image)],
        }],
        description='Deploy manifest',
        application=self.TEST_APP)

    builder = kube.KubeContractBuilder(self.kube_v2_observer)
    (builder.new_clause_builder('Deployment created',
                                retryable_for_secs=15)
     .get_resources(
         'deploy',
         extra_args=[name, '--namespace', self.TEST_NAMESPACE])
     .EXPECT(self.mp.deployment_image_predicate(image)))

    return st.OperationContract(
        self.new_post_operation(
            title='deploy_manifest', data=payload, path='tasks'),
        contract=builder.build())

  def deploy_service(self):
    """Creates an OperationContract for deploying a service object

    To verify the operation, we just check that the service was created.
    """
    name = self.TEST_APP + '-service'
    account = self.bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT']
    payload = self.agent.make_json_payload_from_kwargs(
        job=[{
            'cloudProvider': 'kubernetes',
            'moniker': {
                'app': self.TEST_APP
            },
            'account': account,
            'source': 'text',
            'type': 'deployManifest',
            'user': '[anonymous]',
            'manifests': [self.mf.service(name)],
        }],
        description='Deploy manifest',
        application=self.TEST_APP)

    builder = kube.KubeContractBuilder(self.kube_v2_observer)
    (builder.new_clause_builder('Service created',
                                retryable_for_secs=15)
     .get_resources(
         'service',
         extra_args=[name, '--namespace', self.TEST_NAMESPACE])
     .EXPECT(self.mp.service_selector_predicate('app', self.TEST_APP)))

    return st.OperationContract(
        self.new_post_operation(
            title='deploy_manifest', data=payload, path='tasks'),
        contract=builder.build())

  def check_manifest_endpoint_exists(self, kind):
    name = self.TEST_APP + '-' + kind
    account = self.bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT']
    builder = HttpContractBuilder(self.agent)
    (builder.new_clause_builder('Has recorded a manifest')
       .get_url_path('/manifests/{account}/{namespace}/{name}'.format(
           account=account,
           namespace=self.TEST_NAMESPACE,
           name='{}%20{}'.format(kind, name)
       ))
       .EXPECT(
           ov_factory.value_list_contains(jp.DICT_MATCHES({
               'account': jp.STR_EQ(account)
           }))
    ))

    return st.OperationContract(
        NoOpOperation('Has recorded a manifest'),
        contract=builder.build())

  def check_applications_endpoint(self):
    account = self.bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT']
    builder = HttpContractBuilder(self.agent)
    (builder.new_clause_builder('Has recorded an app for the deployed manifest')
       .get_url_path('/applications')
       .EXPECT(
           ov_factory.value_list_contains(jp.DICT_MATCHES({
               'name': jp.STR_EQ(self.TEST_APP),
               'accounts': jp.STR_SUBSTR(account),
           }))
    ))

    return st.OperationContract(
        NoOpOperation('Has recorded an application'),
        contract=builder.build())

  def check_server_groups_endpoint(self, kind, image, has_lb=True):
    name = self.TEST_APP + '-' + kind
    account = self.bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT']
    builder = HttpContractBuilder(self.agent)
    lb_pred = (
        jp.LIST_MATCHES([jp.STR_EQ('service {}-service'.format(self.TEST_APP))])
        if has_lb else jp.LIST_EQ([])
    )
    (builder.new_clause_builder('Has recorded a server group for the deployed manifest')
       .get_url_path('/applications/{}/serverGroups'.format(self.TEST_APP))
       .EXPECT(
           ov_factory.value_list_contains(jp.DICT_MATCHES({
               'name': jp.STR_SUBSTR(name),
               'cluster': jp.STR_EQ(kind + ' ' + name),
               'account': jp.STR_EQ(account),
               'cloudProvider': jp.STR_EQ('kubernetes'),
               'buildInfo': jp.DICT_MATCHES({
                   'images': jp.LIST_MATCHES([jp.STR_EQ(image)]),
               }),
               'loadBalancers': lb_pred,
           }))
    ))

    return st.OperationContract(
        NoOpOperation('Has recorded a server group'),
        contract=builder.build())

  def check_load_balancers_endpoint(self, kind):
    name = kind + ' ' + self.TEST_APP + '-' + kind
    account = self.bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT']
    builder = HttpContractBuilder(self.agent)
    (builder.new_clause_builder('Has recorded a load balancer')
       .get_url_path('/applications/{}/loadBalancers'.format(self.TEST_APP))
       .EXPECT(
           ov_factory.value_list_contains(jp.DICT_MATCHES({
               'name': jp.STR_EQ(name),
               'kind': jp.STR_EQ(kind),
               'account': jp.STR_EQ(account),
               'cloudProvider': jp.STR_EQ('kubernetes'),
               'serverGroups': jp.LIST_MATCHES([
                 jp.DICT_MATCHES({
                   'account': jp.STR_EQ(account),
                   'name': jp.STR_SUBSTR(self.TEST_APP),
                 }),
               ]),
           }))
    ))

    return st.OperationContract(
        NoOpOperation('Has recorded a load balancer'),
        contract=builder.build())

  def check_clusters_endpoint(self, kind):
    name = kind + ' ' + self.TEST_APP + '-' + kind
    account = self.bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT']
    builder = HttpContractBuilder(self.agent)
    (builder.new_clause_builder('Has recorded a cluster for the deployed manifest')
       .get_url_path('/applications/{}/clusters'.format(self.TEST_APP))
       .EXPECT(
           ov_factory.value_list_contains(jp.DICT_MATCHES({
               account: jp.LIST_MATCHES([jp.STR_EQ(name)]),
           }))
    ))

    return st.OperationContract(
        NoOpOperation('Has recorded a cluster'),
        contract=builder.build())

  def check_detailed_clusters_endpoint(self, kind):
    name = kind + ' ' + self.TEST_APP + '-' + kind
    url_name = name.replace(' ', '%20')
    account = self.bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT']
    builder = HttpContractBuilder(self.agent)
    (builder.new_clause_builder('Has recorded a cluster for the deployed manifest')
       .get_url_path('/applications/{app}/clusters/{account}/{name}'.format(
         app=self.TEST_APP, account=account, name=url_name))
       .EXPECT(
           ov_factory.value_list_contains(jp.DICT_MATCHES({
               'accountName': jp.STR_EQ(account),
               'name': jp.STR_EQ(name),
               'serverGroups': jp.LIST_MATCHES([
                 jp.DICT_MATCHES({
                   'account': jp.STR_EQ(account),
                 })
               ]),
           }))
    ))

    return st.OperationContract(
        NoOpOperation('Has recorded a cluster'),
        contract=builder.build())

  def delete_kind(self, kind, version=None):
    """Creates OperationContract for deleteManifest

    To verify the operation, we just check that the Kubernetes deployment
    is no longer visible (or is in the process of terminating).
    """
    bindings = self.bindings
    name = self.TEST_APP + '-' + kind
    payload = self.agent.make_json_payload_from_kwargs(
        job=[{
            'cloudProvider': 'kubernetes',
            'type': 'deleteManifest',
            'account': bindings['SPINNAKER_KUBERNETES_V2_ACCOUNT'],
            'user': '[anonymous]',
            'kinds': [ kind ],
            'location': self.TEST_NAMESPACE,
            'options': { },
            'labelSelectors': {
                'selectors': [{
                    'kind': 'EQUALS',
                    'key': 'app',
                    'values': [ self.TEST_APP ]
                }]
            }
        }],
        application=self.TEST_APP,
        description='Destroy Manifest')

    if version is not None:
      name = name + '-' + version

    builder = kube.KubeContractBuilder(self.kube_v2_observer)
    (builder.new_clause_builder('Manifest Removed')
     .get_resources(
         kind,
         extra_args=[name, '--namespace', self.TEST_NAMESPACE])
     .EXPECT(self.mp.not_found_observation_predicate()))

    return st.OperationContract(
        self.new_post_operation(
            title='delete_kind', data=payload, path='tasks'),
        contract=builder.build())

class KubeV2CacheTest(st.AgentTestCase):
  """The test fixture for the KubeV2CacheTest.

  This is implemented using citest OperationContract instances that are
  created by the KubeV2CacheTestScenario.
  """
  # pylint: disable=missing-docstring

  @property
  def scenario(self):
    return citest.base.TestRunner.global_runner().get_shared_data(
        KubeV2CacheTestScenario)

  def test_a_create_app(self):
    self.run_test_case(self.scenario.create_app())

  def test_b1_deploy_deployment(self):
    self.run_test_case(self.scenario.deploy_deployment('library/nginx'))

  def test_b1_deploy_service(self):
    self.run_test_case(self.scenario.deploy_service())

  def test_b2_check_manifest_endpoint(self):
    self.run_test_case(self.scenario.check_manifest_endpoint_exists('deployment'))

  def test_b2_check_applications_endpoint(self):
    self.run_test_case(self.scenario.check_applications_endpoint())

  def test_b2_check_clusters_endpoint(self):
    self.run_test_case(self.scenario.check_clusters_endpoint('deployment'))

  def test_b2_check_detailed_clusters_endpoint(self):
    self.run_test_case(self.scenario.check_detailed_clusters_endpoint('deployment'))

  def test_b2_check_server_groups_endpoint(self):
    self.run_test_case(self.scenario.check_server_groups_endpoint('deployment', 'library/nginx'))

  def test_b2_check_load_balancers_endpoint(self):
    self.run_test_case(self.scenario.check_load_balancers_endpoint('service'))

  def test_b3_delete_service(self):
    self.run_test_case(self.scenario.delete_kind('service'), max_retries=2)

  def test_b4_check_server_groups_endpoint_no_load_balancer(self):
    self.run_test_case(self.scenario.check_server_groups_endpoint('deployment', 'library/nginx', has_lb=False))

  def test_b9_delete_deployment(self):
    self.run_test_case(self.scenario.delete_kind('deployment'), max_retries=2)

  def test_z_delete_app(self):
    # Give a total of a minute because it might also need
    # an internal cache update
    self.run_test_case(self.scenario.delete_app(),
                       retry_interval_secs=8, max_retries=8)

def main():
  """Implements the main method running this cache test."""

  defaults = {
      'TEST_STACK': 'tst',
      'TEST_APP': 'kubv2cache' + KubeV2CacheTestScenario.DEFAULT_TEST_ID
  }

  return citest.base.TestRunner.main(
      parser_inits=[KubeV2CacheTestScenario.initArgumentParser],
      default_binding_overrides=defaults,
      test_case_list=[KubeV2CacheTest])

if __name__ == '__main__':
  sys.exit(main())


text:
package eksamen2014ord;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Scanner;

public class Quiz {

	private ArrayList<Question> questions = new ArrayList<>();

	public void addQuestion(Question q){
		questions.add(q);
	}

	void run(){
		Scanner scanner = new Scanner(System.in);

		for (Question question : questions){
			question.askQuestion(System.out);
			String string = scanner.nextLine();
			while(!(question.checkAnswer(string))){
				System.out.println("WRONG!!!");
				string = scanner.nextLine();
			}
		}
		scanner.close();

	}

	void initFromFile() {
		Scanner inn;

		try{
			inn = new Scanner(new FileReader("input.txt"));

		System.out.println("test init success");

		String question = "";
		String answar = "";
		String alt ="";

		while (inn.hasNextLine()){
			//hvis hwile løkke får kjøre vet vi at det er et spørsmål og et svar
			System.out.println(("mm"));
			question=inn.nextLine();
			System.out.println(question);
			answar=inn.nextLine();
			System.out.println(answar);
			System.out.println("-------------");
			alt="";
			//Hvis det da finnes en linje til --> som er lengre enn 1 lang, så vet vi at det er alternativ
			if((inn.hasNextLine())){
				String doh = inn.nextLine();
				if (doh.length()>1){
					alt+=doh + "\n";
					while(inn.hasNextLine()){
						String doh2 = inn.nextLine();
						alt+= doh2+ "\n";
						if (doh2.isEmpty()){

							break;
						}
					}

				}

			}

				Question q;
				if(alt.equals("")){
					 q = new Question(question,answar);
				}
				else{
					 q = new Question(question,answar,alt);
				}
				addQuestion(q);
				//continue;

			}

			inn.close();

		}
		catch (FileNotFoundException e){System.err.println("øsdlkjskøgmslkørgm");}

	}

	public static void main(String[] args){
		Quiz qiz = new Quiz();
		/*Question q1 = new Question("Hva heter forfatteren av dette programmet?", "marius");
		Question q2 = new Question("Hva heter hovedstaden i norge?", "oslo");
		Question q3 = new Question("hvor høy er Galhøpiggen?", "2469", "2539\n2469\n1111");
		qiz.addQuestion(q1);
		qiz.addQuestion(q2);
		qiz.addQuestion(q3);*/
		System.out.println(System.getProperty("user.dir"));

			qiz.initFromFile();

		qiz.run();

	}
}


text: PHP Plugin provider


text:
package org.bitj.wire.messages;

import com.google.common.collect.ImmutableList;
import org.bitj.Sha256Hash;
import org.bitj.wire.BitcoinInputStream;
import org.bitj.wire.BitcoinOutputStream;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.net.ProtocolException;
import java.util.Objects;

import static com.google.common.base.Objects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.bitj.utils.Utils.MAX_UINT_32;

public class GetBlocksMsg extends Msg {

  // 10 consecutive blocks + log(2, 1024 years * 365 days * 24 hours * 6 blocks) + genesis block
  public static final int MAX_LOCATOR_OBJECT_SIZE = 10 + 26 + 1;

  protected long version = VersionMsg.PROTOCOL_VERSION;
  protected ImmutableList<Sha256Hash> blockLocator;
  protected Sha256Hash stopHash = Sha256Hash.ZERO;

  @Override
  public String name() {
    return "getblocks";
  }

  public GetBlocksMsg(ImmutableList<Sha256Hash> blockLocator) {
    checkArgument(blockLocator != null && !blockLocator.isEmpty());
    this.blockLocator = blockLocator;
  }

  public GetBlocksMsg(long version, ImmutableList<Sha256Hash> blockLocator, Sha256Hash stopHash) {
    checkArgument(version >= 0 && version <= MAX_UINT_32);
    checkArgument(blockLocator != null && !blockLocator.isEmpty());
    checkNotNull(stopHash);
    this.version = version;
    this.blockLocator = blockLocator;
    this.stopHash = stopHash;
  }

  @Override
  public byte[] serializePayload() throws IOException {
    BitcoinOutputStream out = new BitcoinOutputStream(new ByteArrayOutputStream());
    out.writeUnsInt32LE(version);
    out.writeUnsVarInt(blockLocator.size());
    for (Sha256Hash hash : blockLocator)
      out.writeSha256HashLE(hash);
    out.writeSha256HashLE(stopHash);
    return out.toByteArray();
  }

  public static GetBlocksMsg deserializePayload(BitcoinInputStream in) throws IOException {
    long version = in.readUnsInt32LE();
    BigInteger length = in.readUnsVarInt();
    if (length.compareTo(BigInteger.valueOf(MAX_LOCATOR_OBJECT_SIZE)) > 0)
      throw new TooMany("Locator object claims to contain " + length + " > " + MAX_LOCATOR_OBJECT_SIZE + " block hashes");
    ImmutableList.Builder<Sha256Hash> blockLocator = new ImmutableList.Builder<>();
    for (long i = 0; i < length.longValue(); i++) {
      Sha256Hash hash = in.readSha256HashLE();
      blockLocator.add(hash);
    }
    Sha256Hash stopHash = in.readSha256HashLE();
    return new GetBlocksMsg(version, blockLocator.build(), stopHash);
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    GetBlocksMsg that = (GetBlocksMsg) o;
    return Objects.equals(this.version, that.version) &&
      Objects.equals(this.blockLocator, that.blockLocator) &&
      Objects.equals(this.stopHash, that.stopHash);
  }

  @Override
  public int hashCode() {
    return Objects.hash(version, blockLocator, stopHash);
  }

  @Override
  public String toString() {
    return toStringHelper(this)
      .add("version", version)
      .add("blockLocator", blockLocator)
      .add("stopHash", stopHash)
      .toString();
  }

  public static class TooMany extends ProtocolException {
    public TooMany(String s) { super(s); }
  }

}


text:
import { IRootScopeService } from 'angular';
import { StateService } from '@uirouter/angularjs';

export interface IDeckRootScope extends IRootScopeService {
  $state: StateService;
  authenticating: boolean;
  feature: any;
  pageTitle: string;
  routing: boolean;
}


text:
package org.kitesdk.apps.spi.jobs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.kitesdk.apps.streaming.StreamDescription;
import org.kitesdk.apps.streaming.StreamingJob;

public interface StreamingJobManager<T extends StreamingJob> {

  /**
   * Installs the job to the cluster.
   */
  public void install(FileSystem fs, Path appRoot);

  /**
   * Starts the job instance installed at the given location.
   */
  public void start(FileSystem fs, Path appRoot);

  /**
   * Runs the stream in a local setting.
   */
  public void run();

}


text:
@implementation NSManagedObject (ExistingObject)

- (BOOL)isValidInCurrentContext {
	return (    self.isDeleted          == NO
			&&  self.hasBeenDeleted     == NO
			&&  self.doesExist          == YES
			&&  self.hasValidContext    == YES);
}

- (BOOL)doesExist {
	NSManagedObjectContext *moc = [self managedObjectContext];
	if ([moc existingObjectWithID:self.objectID error:NULL]) {
		// object is valid, go ahead and use it
		return YES;
	}
	return NO;
}

- (BOOL)hasValidContext {
	if (self.managedObjectContext == nil) {
		// Assume that the managed object has been deleted.
		return NO;
	}
	return YES;
}

- (BOOL)hasBeenDeleted {
	return (self.doesExist == NO);
}

@end


text:
package packages

func osNotAppEngine() {}


text:
package org.testng.internal;

import org.testng.ITestClass;
import org.testng.ITestContext;
import org.testng.ITestNGMethod;
import org.testng.ITestResult;
import org.testng.collections.Lists;
import org.testng.internal.TestMethodArguments.Builder;
import org.testng.xml.XmlSuite;

import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;

public class TestMethodWithDataProviderMethodWorker implements Callable<List<ITestResult>> {

  private final ITestNGMethod m_testMethod;
  private final Object[] m_parameterValues;
  private final Object m_instance;
  private final Map<String, String> m_parameters;
  private final ITestClass m_testClass;
  private final ITestNGMethod[] m_beforeMethods;
  private final ITestNGMethod[] m_afterMethods;
  private final ConfigurationGroupMethods m_groupMethods;
  private final ITestContext m_testContext;
  private int m_parameterIndex;
  private boolean m_skipFailedInvocationCounts;
  private int m_invocationCount;
  private final ITestResultNotifier m_notifier;
  private final ITestInvoker m_testInvoker;

  private final List<ITestResult> m_testResults = Lists.newArrayList();
  private int m_failureCount;

  public TestMethodWithDataProviderMethodWorker(
      ITestInvoker testInvoker, ITestNGMethod testMethod,
      int parameterIndex,
      Object[] parameterValues,
      Object instance,
      Map<String, String> parameters,
      ITestClass testClass,
      ITestNGMethod[] beforeMethods,
      ITestNGMethod[] afterMethods,
      ConfigurationGroupMethods groupMethods,
      ITestContext testContext,
      boolean skipFailedInvocationCounts,
      int invocationCount,
      int failureCount,
      ITestResultNotifier notifier) {
    this.m_testInvoker = testInvoker;
    m_testMethod = testMethod;
    m_parameterIndex = parameterIndex;
    m_parameterValues = parameterValues;
    m_instance = instance;
    m_parameters = parameters;
    m_testClass = testClass;
    m_beforeMethods = beforeMethods;
    m_afterMethods = afterMethods;
    m_groupMethods = groupMethods;
    m_skipFailedInvocationCounts = skipFailedInvocationCounts;
    m_testContext = testContext;
    m_invocationCount = invocationCount;
    m_failureCount = failureCount;
    m_notifier = notifier;
  }

  @Override
  public List<ITestResult> call() {
    List<ITestResult> tmpResults = Lists.newArrayList();
    long start = System.currentTimeMillis();
    XmlSuite suite = m_testContext.getSuite().getXmlSuite();

    final ITestInvoker.FailureContext failure = new ITestInvoker.FailureContext();
    failure.count = m_failureCount;
    try {
      tmpResults.add(
          m_testInvoker.invokeTestMethod(
              new Builder().usingInstance(m_instance)
                  .forTestMethod(m_testMethod).withParameterValues(m_parameterValues)
                  .withParametersIndex(m_parameterIndex).withParameters(m_parameters)
                  .forTestClass(m_testClass).usingBeforeMethods(m_beforeMethods)
                  .usingAfterMethods(m_afterMethods).usingGroupMethods(m_groupMethods)
                  .build(), suite,
              failure));
    } finally {
      m_failureCount = failure.count;
      if (failure.instances.isEmpty()) {
        m_testResults.addAll(tmpResults);
      } else {
        for (Object instance : failure.instances) {
          List<ITestResult> retryResults = Lists.newArrayList();

          m_failureCount =
              m_testInvoker.retryFailed(
                  new Builder().usingInstance(instance)
                      .forTestMethod(m_testMethod).withParameterValues(m_parameterValues)
                      .withParametersIndex(m_parameterIndex).withParameters(m_parameters)
                      .forTestClass(m_testClass).usingBeforeMethods(m_beforeMethods)
                      .usingAfterMethods(m_afterMethods).usingGroupMethods(m_groupMethods)
                      .build(), retryResults,
                      m_failureCount,
                      m_testContext
              )
                  .count;
          m_testResults.addAll(retryResults);
        }
      }

      //
      // If we have a failure, skip all the
      // other invocationCounts
      //

      // If not specified globally, use the attribute
      // on the annotation
      //
      if (!m_skipFailedInvocationCounts) {
        m_skipFailedInvocationCounts = m_testMethod.skipFailedInvocations();
      }
      if (m_failureCount > 0 && m_skipFailedInvocationCounts) {
        while (m_invocationCount-- > 0) {
          ITestResult r =
              TestResult.newEndTimeAwareTestResult(m_testMethod, m_testContext, null, start);
          r.setStatus(TestResult.SKIP);
          m_testResults.add(r);
          m_testInvoker.runTestResultListener(r);
          m_notifier.addSkippedTest(m_testMethod, r);
        }
      }
    }
    m_parameterIndex++;

    return m_testResults;
  }

  public int getInvocationCount() {
    return m_invocationCount;
  }
}


text:
describe('Add and delete a new chapter through book form', () => {
    beforeEach(() => {
        cy.visit('/book/list');
        cy.url().should('eq', Cypress.config('baseUrl') + '/book/list');
        cy.get('tr').contains(/^Książka$/).parent().find('[title="Edycja"]').click().then(() => {
            cy.url().should('contain', Cypress.config('baseUrl') + '/book/edit');
        });

        cy.clickTab('Rozdziały');
    });

    it('Adds and delete a new chapter via ajax submission', () => {
        cy.get('#chapters').find('[title="Nowy rozdział"]').click().then(() => {
            cy.get('#modal-form').contains('Nowy rozdział').should('be.visible');
            cy.get('#modal-form').find('input[name="next_chapter[title]"]').type('Kolejny rozdział');
            cy.get('#modal-form').contains('Zapisz').click();
            cy.contains('Pomyślnie dodano nowy rozdział o tytule "Kolejny rozdział"').should('be.visible').parent().find('button').click();
        });

        cy.get('#chapters').contains('Kolejny rozdział').parent().find('[title="Usuń"]').click().then(() => {
            cy.get('#modal-confirm').click().then(() => {
                cy.contains('Rozdział "Kolejny rozdział" został usunięty.').should('be.visible').parent().find('button').click();
            });
        });
    });
});


text:
namespace peloton {
namespace catalog {

class DatabaseCatalogObject;
class TableCatalogObject;
class IndexCatalogObject;

class CatalogCache {
  friend class Transaction;
  friend class DatabaseCatalog;
  friend class TableCatalog;
  friend class IndexCatalog;
  friend class DatabaseCatalogObject;
  friend class TableCatalogObject;
  friend class IndexCatalogObject;

 public:
  CatalogCache() {}
  CatalogCache(CatalogCache const &) = delete;
  CatalogCache &operator=(CatalogCache const &) = delete;

 private:
  std::shared_ptr<DatabaseCatalogObject> GetDatabaseObject(oid_t database_oid);
  std::shared_ptr<DatabaseCatalogObject> GetDatabaseObject(
      const std::string &name);

  std::shared_ptr<TableCatalogObject> GetCachedTableObject(oid_t table_oid);
  std::shared_ptr<IndexCatalogObject> GetCachedIndexObject(oid_t index_oid);
  std::shared_ptr<IndexCatalogObject> GetCachedIndexObject(
      const std::string &index_name);

  // database catalog cache interface
  bool InsertDatabaseObject(
      std::shared_ptr<DatabaseCatalogObject> database_object);
  bool EvictDatabaseObject(oid_t database_oid);
  bool EvictDatabaseObject(const std::string &database_name);

  // cache for database catalog object
  std::unordered_map<oid_t, std::shared_ptr<DatabaseCatalogObject>>
      database_objects_cache;
  std::unordered_map<std::string, std::shared_ptr<DatabaseCatalogObject>>
      database_name_cache;
};

}  // namespace catalog
}  // namespace peloton


text:
package com.ly.java.thrift.compareServer;

import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;

public class TNonblockingClientDemo {

	public static final String SERVER_IP = Constant.SERVER_ADDR;
	public static final int SERVER_PORT = Constant.SERVER_PORT;
	public static final int TIMEOUT = 3000;

	/**
	 *
	 * @param userName
	 */
	public String startClient(String userName) {
		// 设置传输通道
		TTransport transport = null;
		try {
			// 协议要和服务端一致
			transport = new TFramedTransport(new TSocket(SERVER_IP, SERVER_PORT, TIMEOUT));
			TProtocol protocol = new TCompactProtocol(transport);

			// 创建Client
			UserService.Client client = new UserService.Client(protocol);

			transport.open();
			String result = client.getUser(userName);
			System.out.println(Thread.currentThread().getName() + "  result : " + result);
			return result;
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		} finally {
			// 关闭资源
			if (transport != null && transport.isOpen())
				transport.close();
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		TNonblockingClientDemo client = new TNonblockingClientDemo();
		String aa = client.startClient("Michael");

	}

}


text:
#ifndef __D3D11RENDERWINDOW_H__
#define __D3D11RENDERWINDOW_H__

#include "OgreD3D11Prerequisites.h"
#include "OgreRenderWindow.h"

namespace Ogre
{
	class D3D11RenderWindow : public RenderWindow
	{
	public:
		/** Constructor.
		@param instance The application instance
		@param driver The root driver
		@param deviceIfSwapChain The existing D3D device to create an additional swap chain from, if this is not
		the first window.
		*/
		D3D11RenderWindow(HINSTANCE instance, D3D11Device & device, IDXGIFactory1*	pDXGIFactory);
		~D3D11RenderWindow();
		void create(const String& name, unsigned int width, unsigned int height,
			bool fullScreen, const NameValuePairList *miscParams);
		void setFullscreen(bool fullScreen, unsigned int width, unsigned int height);
		void destroy(void);
		bool isVisible() const;
		bool isClosed() const { return mClosed; }
		bool isHidden() const { return mHidden; }
		void setHidden(bool hidden);
		void reposition(int left, int top);
		void resize(unsigned int width, unsigned int height);
		void swapBuffers( bool waitForVSync = true );
		HWND getWindowHandle() const;

		void getCustomAttribute( const String& name, void* pData );
		/** Overridden - see RenderTarget.
		*/
		virtual void copyContentsToMemory(const PixelBox &dst, FrameBuffer buffer);
		bool requiresTextureFlipping() const;

		// Method for dealing with resize / move & 3d library
		void windowMovedOrResized();

		/// Get the presentation parameters used with this window
		DXGI_SWAP_CHAIN_DESC* getPresentationParameters(void);

		/// @copydoc RenderTarget::update
		void update(bool swap);

		/** Create (or recreate) the D3D device or SwapChain for this window.
		*/
		void createD3DResources();

		/** Destroy the D3D device or SwapChain for this window.
		*/
		void destroyD3DResources();

		/// Are we in the middle of switching between fullscreen and windowed
		bool _getSwitchingFullscreen() const;
		/// Indicate that fullscreen / windowed switching has finished
		void _finishSwitchingFullscreen();

	protected:
		HINSTANCE mInstance;			// Process instance
		D3D11Device & mDevice;			// D3D11 driver
		IDXGIFactory1*	mpDXGIFactory;
		HWND	mHWnd;					// Win32 Window handle
		bool	mIsExternal;			// window not created by Ogre
		bool	mSizing;
		bool	mClosed;
		bool	mHidden;
		bool	mIsSwapChain;			// Is this a secondary window?
		bool	mSwitchingFullscreen;	// Are we switching from fullscreen to windowed or vice versa

		// -------------------------------------------------------
		// DirectX-specific
		// -------------------------------------------------------

		// Pointer to swap chain, only valid if mIsSwapChain
		IDXGISwapChain * mpSwapChain;
		DXGI_SWAP_CHAIN_DESC md3dpp;
		DXGI_SAMPLE_DESC mFSAAType;
		//DWORD mFSAAQuality;
		UINT mDisplayFrequency;
		bool mVSync;
		unsigned int mVSyncInterval;
		bool mUseNVPerfHUD;
		ID3D11RenderTargetView*		mRenderTargetView;
		ID3D11DepthStencilView*		mDepthStencilView;
		ID3D11Texture2D*			mpBackBuffer;

		// just check if the multisampling requested is supported by the device
		bool _checkMultiSampleQuality(UINT SampleCount, UINT *outQuality, DXGI_FORMAT format);

	};
}
#endif


text:
#ifdef __GNUC__
#  pragma GCC diagnostic ignored "-Wmissing-declarations"
#  if defined __clang__ || defined __APPLE__
#    pragma GCC diagnostic ignored "-Wmissing-prototypes"
#    pragma GCC diagnostic ignored "-Wextra"
#  endif
#endif

#ifndef __OPENCV_TEST_PRECOMP_HPP__
#define __OPENCV_TEST_PRECOMP_HPP__

#include <fstream>

#include "opencv2/ts.hpp"
#include "opencv2/ts/cuda_test.hpp"

#include "opencv2/cudabgsegm.hpp"
#include "opencv2/video.hpp"

#include "opencv2/opencv_modules.hpp"
#include "cvconfig.h"

#endif


text:
'use strict';

var CronJob = require('cron').CronJob;
var CSV = require('fast-csv');
var fs = require('fs');

var mongoose = require('mongoose');
//var Promise = require('promise');
var Player = mongoose.model('Player');

var RatingUpdateSchedule = mongoose.model('RatingUpdateSchedule');

// get list of files in directory:
/*
    var SET_FILES_FOR_PROCESSING = function() {

    // Get a list of all CSV's from data directory:
    fs.readdir('app/data/', function (err, files) {

        console.log(files.length + ' files found in directory.');

        for (var i = files.length - 1; i >= 0; i--) {

            // Check if files have been processed:
            checkExists(files[i]);
        }

        console.log('Process complete.'.green);
    });

    var checkExists = function (fileName) {

        console.log('Checking file ' + fileName + '...');

        if(fileName !== '') {

            // Using directory file name to check database for file:
            RatingUpdateSchedule.findOne({ 'fileName' : fileName }, function (err, file) {

                if(!file) {

                    var fileSegments = fileName.split('-');

                    if(fileSegments.length === 6) {

                        if(fileSegments[0] === '555' && fileSegments[1] === '888') {

                                // FILE HAS PASSED BASIC VALIDATION! :-)

                                console.info('New file found, adding to database.'.green);

                                var newList = new RatingUpdateSchedule({
                                    fileName: fileName,
                                    body: fileSegments[2],
                                    gameType: fileSegments[3],
                                    month: fileSegments[4],
                                    year: fileSegments[5].split('.')[0],
                                    waitingForProcess: true,
                                    processDate: null,
                                    isProcessing: false,
                                    allowReprocess: false
                                });

                                newList.save(function (err, list) {
                                        if (err) {
                                           // error = true;
                                            return console.error(err);
                                        }
                                });

                        } else {
                            console.error('File invalid, key check does not match! ' + fileName.red);
                        }
                    } else {
                        console.error('File invalid, string name format needs to be {xxx-xxx-body-gameType-month-year} file is: ' + fileName.red);
                    }
                } else {
                    console.warn('File exists, moving on.'.yellow);
                }
            });

        }

    };

    };

    // check files against db

    var GET_FILE_NAMES_FOR_PROCESSING = function() {

        console.log('getting files!');

    	var list = function () {
    		return RatingUpdateSchedule.find({ '$or' : [ {'waitingForProcess': true } , { 'allowReprocess' : true } ] }, function (err, files) {

                    if(err) {
                        return err;
                    }

                    console.log('got files.');
                    return files;
    		});
    	};

    	var processList = list();

        .then(function () {

            for (var i = processList.length - 1; i >= 0; i--) {
                console.log('Doing something with ' + processList[i].fileName);
            }

        });

    };

*/

//GET_FILE_NAMES_FOR_PROCESSING();

// return files which need processing

// process files