text:
package org.apache.hadoop.hive.ql.udf.generic;

import java.util.ArrayList;

import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.parse.SemanticException;
import org.apache.hadoop.hive.ql.util.JavaDataModel;
import org.apache.hadoop.hive.serde2.io.DoubleWritable;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.StructField;
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils;
import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
import org.apache.hadoop.io.LongWritable;

/**
 * Compute the Pearson correlation coefficient corr(x, y), using the following
 * stable one-pass method, based on:
 * "Formulas for Robust, One-Pass Parallel Computation of Covariances and
 * Arbitrary-Order Statistical Moments", Philippe Pebay, Sandia Labs
 * and "The Art of Computer Programming, volume 2: Seminumerical Algorithms",
 * Donald Knuth.
 *
 *  Incremental:
 *   n : <count>
 *   mx_n = mx_(n-1) + [x_n - mx_(n-1)]/n : <xavg>
 *   my_n = my_(n-1) + [y_n - my_(n-1)]/n : <yavg>
 *   c_n = c_(n-1) + (x_n - mx_(n-1))*(y_n - my_n) : <covariance * n>
 *   vx_n = vx_(n-1) + (x_n - mx_n)(x_n - mx_(n-1)): <variance * n>
 *   vy_n = vy_(n-1) + (y_n - my_n)(y_n - my_(n-1)): <variance * n>
 *
 *  Merge:
 *   c_(A,B) = c_A + c_B + (mx_A - mx_B)*(my_A - my_B)*n_A*n_B/(n_A+n_B)
 *   vx_(A,B) = vx_A + vx_B + (mx_A - mx_B)*(mx_A - mx_B)*n_A*n_B/(n_A+n_B)
 *   vy_(A,B) = vy_A + vy_B + (my_A - my_B)*(my_A - my_B)*n_A*n_B/(n_A+n_B)
 *
 */
@Description(name = "corr",
    value = "_FUNC_(y,x) - Returns the Pearson coefficient of correlation\n"
        + "between a set of number pairs",
    extended = "The function takes as arguments any pair of numeric types and returns a double.\n"
        + "Any pair with a NULL is ignored.\n"
        + "If applied to an empty set: NULL is returned.\n"
        + "If N*SUM(x*x) = SUM(x)*SUM(x): NULL is returned.\n"
        + "If N*SUM(y*y) = SUM(y)*SUM(y): NULL is returned.\n"
        + "Otherwise, it computes the following:\n"
        + "   COVAR_POP(x,y)/(STDDEV_POP(x)*STDDEV_POP(y))\n"
        + "where neither x nor y is null,\n"
        + "COVAR_POP is the population covariance,\n"
        + "and STDDEV_POP is the population standard deviation.")
public class GenericUDAFCorrelation extends AbstractGenericUDAFResolver {

  @Override
  public GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters) throws SemanticException {
    if (parameters.length != 2) {
      throw new UDFArgumentTypeException(parameters.length - 1,
          "Exactly two arguments are expected.");
    }

    if (parameters[0].getCategory() != ObjectInspector.Category.PRIMITIVE) {
      throw new UDFArgumentTypeException(0,
          "Only primitive type arguments are accepted but "
          + parameters[0].getTypeName() + " is passed.");
    }

    if (parameters[1].getCategory() != ObjectInspector.Category.PRIMITIVE) {
        throw new UDFArgumentTypeException(1,
            "Only primitive type arguments are accepted but "
            + parameters[1].getTypeName() + " is passed.");
    }

    switch (((PrimitiveTypeInfo) parameters[0]).getPrimitiveCategory()) {
    case BYTE:
    case SHORT:
    case INT:
    case LONG:
    case FLOAT:
    case DOUBLE:
    case TIMESTAMP:
    case DECIMAL:
      switch (((PrimitiveTypeInfo) parameters[1]).getPrimitiveCategory()) {
      case BYTE:
      case SHORT:
      case INT:
      case LONG:
      case FLOAT:
      case DOUBLE:
      case TIMESTAMP:
      case DECIMAL:
        return new GenericUDAFCorrelationEvaluator();
      case STRING:
      case BOOLEAN:
      case DATE:
      default:
        throw new UDFArgumentTypeException(1,
            "Only numeric type arguments are accepted but "
            + parameters[1].getTypeName() + " is passed.");
      }
    case STRING:
    case BOOLEAN:
    case DATE:
    default:
      throw new UDFArgumentTypeException(0,
          "Only numeric type arguments are accepted but "
          + parameters[0].getTypeName() + " is passed.");
    }
  }

  /**
   * Evaluate the Pearson correlation coefficient using a stable one-pass
   * algorithm, based on work by Philippe Pébay and Donald Knuth.
   *
   *  Incremental:
   *   n : <count>
   *   mx_n = mx_(n-1) + [x_n - mx_(n-1)]/n : <xavg>
   *   my_n = my_(n-1) + [y_n - my_(n-1)]/n : <yavg>
   *   c_n = c_(n-1) + (x_n - mx_(n-1))*(y_n - my_n) : <covariance * n>
   *   vx_n = vx_(n-1) + (x_n - mx_n)(x_n - mx_(n-1)): <variance * n>
   *   vy_n = vy_(n-1) + (y_n - my_n)(y_n - my_(n-1)): <variance * n>
   *
   *  Merge:
   *   c_X = c_A + c_B + (mx_A - mx_B)*(my_A - my_B)*n_A*n_B/n_X
   *   vx_(A,B) = vx_A + vx_B + (mx_A - mx_B)*(mx_A - mx_B)*n_A*n_B/(n_A+n_B)
   *   vy_(A,B) = vy_A + vy_B + (my_A - my_B)*(my_A - my_B)*n_A*n_B/(n_A+n_B)
   *
   */
  public static class GenericUDAFCorrelationEvaluator extends GenericUDAFEvaluator {

    // For PARTIAL1 and COMPLETE
    private PrimitiveObjectInspector xInputOI;
    private PrimitiveObjectInspector yInputOI;

    // For PARTIAL2 and FINAL
    private transient StructObjectInspector soi;
    private transient StructField countField;
    private transient StructField xavgField;
    private transient StructField yavgField;
    private transient StructField xvarField;
    private transient StructField yvarField;
    private transient StructField covarField;
    private LongObjectInspector countFieldOI;
    private DoubleObjectInspector xavgFieldOI;
    private DoubleObjectInspector yavgFieldOI;
    private DoubleObjectInspector xvarFieldOI;
    private DoubleObjectInspector yvarFieldOI;
    private DoubleObjectInspector covarFieldOI;

    // For PARTIAL1 and PARTIAL2
    private Object[] partialResult;

    // For FINAL and COMPLETE
    private DoubleWritable result;

    @Override
    public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException {
      super.init(m, parameters);

      // init input
      if (mode == Mode.PARTIAL1 || mode == Mode.COMPLETE) {
        assert (parameters.length == 2);
        yInputOI = (PrimitiveObjectInspector) parameters[0];
        xInputOI = (PrimitiveObjectInspector) parameters[1];
      } else {
        assert (parameters.length == 1);
        soi = (StructObjectInspector) parameters[0];

        countField = soi.getStructFieldRef("count");
        xavgField = soi.getStructFieldRef("xavg");
        yavgField = soi.getStructFieldRef("yavg");
        xvarField = soi.getStructFieldRef("xvar");
        yvarField = soi.getStructFieldRef("yvar");
        covarField = soi.getStructFieldRef("covar");

        countFieldOI =
            (LongObjectInspector) countField.getFieldObjectInspector();
        xavgFieldOI =
            (DoubleObjectInspector) xavgField.getFieldObjectInspector();
        yavgFieldOI =
            (DoubleObjectInspector) yavgField.getFieldObjectInspector();
        xvarFieldOI =
            (DoubleObjectInspector) xvarField.getFieldObjectInspector();
        yvarFieldOI =
            (DoubleObjectInspector) yvarField.getFieldObjectInspector();
        covarFieldOI =
            (DoubleObjectInspector) covarField.getFieldObjectInspector();
      }

      // init output
      if (mode == Mode.PARTIAL1 || mode == Mode.PARTIAL2) {
        // The output of a partial aggregation is a struct containing
        // a long count, two double averages, two double variances,
        // and a double covariance.

        ArrayList<ObjectInspector> foi = new ArrayList<ObjectInspector>();

        foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector);
        foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector);
        foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector);
        foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector);
        foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector);
        foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector);

        ArrayList<String> fname = new ArrayList<String>();
        fname.add("count");
        fname.add("xavg");
        fname.add("yavg");
        fname.add("xvar");
        fname.add("yvar");
        fname.add("covar");

        partialResult = new Object[6];
        partialResult[0] = new LongWritable(0);
        partialResult[1] = new DoubleWritable(0);
        partialResult[2] = new DoubleWritable(0);
        partialResult[3] = new DoubleWritable(0);
        partialResult[4] = new DoubleWritable(0);
        partialResult[5] = new DoubleWritable(0);

        return ObjectInspectorFactory.getStandardStructObjectInspector(fname, foi);

      } else {
        setResult(new DoubleWritable(0));
        return PrimitiveObjectInspectorFactory.writableDoubleObjectInspector;
      }
    }

    @AggregationType(estimable = true)
    static class StdAgg extends AbstractAggregationBuffer {
      long count; // number n of elements
      double xavg; // average of x elements
      double yavg; // average of y elements
      double xvar; // n times the variance of x elements
      double yvar; // n times the variance of y elements
      double covar; // n times the covariance
      @Override
      public int estimate() { return JavaDataModel.PRIMITIVES2 * 6; }
    };

    @Override
    public AggregationBuffer getNewAggregationBuffer() throws HiveException {
      StdAgg result = new StdAgg();
      reset(result);
      return result;
    }

    @Override
    public void reset(AggregationBuffer agg) throws HiveException {
      StdAgg myagg = (StdAgg) agg;
      myagg.count = 0;
      myagg.xavg = 0;
      myagg.yavg = 0;
      myagg.xvar = 0;
      myagg.yvar = 0;
      myagg.covar = 0;
    }

    @Override
    public void iterate(AggregationBuffer agg, Object[] parameters) throws HiveException {
      assert (parameters.length == 2);
      Object py = parameters[0];
      Object px = parameters[1];
      if (px != null && py != null) {
        StdAgg myagg = (StdAgg) agg;
        double vx = PrimitiveObjectInspectorUtils.getDouble(px, xInputOI);
        double vy = PrimitiveObjectInspectorUtils.getDouble(py, yInputOI);
        double deltaX = vx - myagg.xavg;
        double deltaY = vy - myagg.yavg;
        myagg.count++;
        myagg.xavg += deltaX / myagg.count;
        myagg.yavg += deltaY / myagg.count;
        if (myagg.count > 1) {
          myagg.covar += deltaX * (vy - myagg.yavg);
          myagg.xvar += deltaX * (vx - myagg.xavg);
          myagg.yvar += deltaY * (vy - myagg.yavg);
        }
      }
    }

    @Override
    public Object terminatePartial(AggregationBuffer agg) throws HiveException {
      StdAgg myagg = (StdAgg) agg;
      ((LongWritable) partialResult[0]).set(myagg.count);
      ((DoubleWritable) partialResult[1]).set(myagg.xavg);
      ((DoubleWritable) partialResult[2]).set(myagg.yavg);
      ((DoubleWritable) partialResult[3]).set(myagg.xvar);
      ((DoubleWritable) partialResult[4]).set(myagg.yvar);
      ((DoubleWritable) partialResult[5]).set(myagg.covar);
      return partialResult;
    }

    @Override
    public void merge(AggregationBuffer agg, Object partial) throws HiveException {
      if (partial != null) {
        StdAgg myagg = (StdAgg) agg;

        Object partialCount = soi.getStructFieldData(partial, countField);
        Object partialXAvg = soi.getStructFieldData(partial, xavgField);
        Object partialYAvg = soi.getStructFieldData(partial, yavgField);
        Object partialXVar = soi.getStructFieldData(partial, xvarField);
        Object partialYVar = soi.getStructFieldData(partial, yvarField);
        Object partialCovar = soi.getStructFieldData(partial, covarField);

        long nA = myagg.count;
        long nB = countFieldOI.get(partialCount);

        if (nA == 0) {
            // Just copy the information since there is nothing so far
            myagg.count = countFieldOI.get(partialCount);
            myagg.xavg = xavgFieldOI.get(partialXAvg);
            myagg.yavg = yavgFieldOI.get(partialYAvg);
            myagg.xvar = xvarFieldOI.get(partialXVar);
            myagg.yvar = yvarFieldOI.get(partialYVar);
            myagg.covar = covarFieldOI.get(partialCovar);
        }

        if (nA != 0 && nB != 0) {
          // Merge the two partials
          double xavgA = myagg.xavg;
          double yavgA = myagg.yavg;
          double xavgB = xavgFieldOI.get(partialXAvg);
          double yavgB = yavgFieldOI.get(partialYAvg);
          double xvarB = xvarFieldOI.get(partialXVar);
          double yvarB = yvarFieldOI.get(partialYVar);
          double covarB = covarFieldOI.get(partialCovar);

          myagg.count += nB;
          myagg.xavg = (xavgA * nA + xavgB * nB) / myagg.count;
          myagg.yavg = (yavgA * nA + yavgB * nB) / myagg.count;
          myagg.xvar += xvarB + (xavgA - xavgB) * (xavgA - xavgB) * nA * nB / myagg.count;
          myagg.yvar += yvarB + (yavgA - yavgB) * (yavgA - yavgB) * nA * nB / myagg.count;
          myagg.covar +=
              covarB + (xavgA - xavgB) * (yavgA - yavgB) * ((double) (nA * nB) / myagg.count);
        }
      }
    }

    @Override
    public Object terminate(AggregationBuffer agg) throws HiveException {
      StdAgg myagg = (StdAgg) agg;

      if (myagg.count == 0 || myagg.xvar == 0.0d || myagg.yvar == 0.0d) {
          return null;
      } else {
          DoubleWritable result = getResult();
          result.set(
                  myagg.covar
                  / java.lang.Math.sqrt(myagg.yvar)
                  / java.lang.Math.sqrt(myagg.xvar)
                  );
          return result;
      }
    }

    public void setResult(DoubleWritable result) {
      this.result = result;
    }

    public DoubleWritable getResult() {
      return result;
    }
  }

}


text:
from keras.models import Sequential
from keras.layers.core import Flatten, Dense, Dropout
from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.optimizers import SGD
from keras import backend as K
import cv2, numpy as np
import ipdb

def VGG_16(weights_path=None):
    K.set_image_dim_ordering('th')      # set model to be ordered in dimensions for theano

    # build the VGG-16 model
    model = Sequential()
    model.add(ZeroPadding2D((1,1),input_shape=(3,224,224)))
    model.add(Convolution2D(64, 3, 3, activation='relu'))
    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(64, 3, 3, activation='relu'))
    model.add(MaxPooling2D((2,2), strides=(2,2)))

    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(128, 3, 3, activation='relu'))
    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(128, 3, 3, activation='relu'))
    model.add(MaxPooling2D((2,2), strides=(2,2)))

    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(256, 3, 3, activation='relu'))
    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(256, 3, 3, activation='relu'))
    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(256, 3, 3, activation='relu'))
    model.add(MaxPooling2D((2,2), strides=(2,2)))

    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(512, 3, 3, activation='relu'))
    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(512, 3, 3, activation='relu'))
    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(512, 3, 3, activation='relu'))
    model.add(MaxPooling2D((2,2), strides=(2,2)))

    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(512, 3, 3, activation='relu'))
    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(512, 3, 3, activation='relu'))
    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(512, 3, 3, activation='relu'))
    model.add(MaxPooling2D((2,2), strides=(2,2)))

    model.add(Flatten())
    model.add(Dense(4096, activation='relu'))
    model.add(Dropout(0.5))
    model.add(Dense(4096, activation='relu'))
    model.add(Dropout(0.5))
    model.add(Dense(1000, activation='softmax'))

    # now load the pre-trained weights
    if weights_path:
        model.load_weights(weights_path)

    # to fine-tune we need to remove the last layer of the model which has 4096 classes
    model.layers.pop()
    model.add(Dense(2,activation='softmax'))

    # now we can fine-tune the model

    return model

if __name__ == "__main__":
    im = cv2.resize(cv2.imread('cat.jpg'), (224, 224)).astype(np.float32)
    im[:,:,0] -= 103.939
    im[:,:,1] -= 116.779
    im[:,:,2] -= 123.68
    im = im.transpose((2,0,1))
    im = np.expand_dims(im, axis=0)

    # Test pretrained model
    model = VGG_16('weights/vgg16_weights.h5')
    sgd = SGD(lr=0.1, decay=1e-6, momentum=0.9, nesterov=True)
    model.compile(optimizer=sgd, loss='categorical_crossentropy', metrics=['accuracy'])
    out = model.predict(im)
print np.argmax(out)

redpajama_set_name: RedPajamaGithub


text:
//
//  GTLPlusComment.h
//

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   Google+ API (plus/v1)
// Description:
//   The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
//   https://developers.google.com/+/api/
// Classes:
//   GTLPlusComment (0 custom class methods, 11 custom properties)
//   GTLPlusCommentActor (0 custom class methods, 6 custom properties)
//   GTLPlusCommentInReplyToItem (0 custom class methods, 2 custom properties)
//   GTLPlusCommentObject (0 custom class methods, 3 custom properties)
//   GTLPlusCommentPlusoners (0 custom class methods, 1 custom properties)
//   GTLPlusCommentActorClientSpecificActorInfo (0 custom class methods, 1 custom properties)
//   GTLPlusCommentActorImage (0 custom class methods, 1 custom properties)
//   GTLPlusCommentActorVerification (0 custom class methods, 1 custom properties)
//   GTLPlusCommentActorClientSpecificActorInfoYoutubeActorInfo (0 custom class methods, 1 custom properties)

#if GTL_BUILT_AS_FRAMEWORK
  #import "GTL/GTLObject.h"
#else
  #import "GTLObject.h"
#endif

@class GTLPlusCommentActor;
@class GTLPlusCommentActorClientSpecificActorInfo;
@class GTLPlusCommentActorClientSpecificActorInfoYoutubeActorInfo;
@class GTLPlusCommentActorImage;
@class GTLPlusCommentActorVerification;
@class GTLPlusCommentInReplyToItem;
@class GTLPlusCommentObject;
@class GTLPlusCommentPlusoners;

// ----------------------------------------------------------------------------
//
//   GTLPlusComment
//

@interface GTLPlusComment : GTLObject

// The person who posted this comment.
@property (nonatomic, retain) GTLPlusCommentActor *actor;

// ETag of this response for caching purposes.
@property (nonatomic, copy) NSString *ETag;

// The ID of this comment.
// identifier property maps to 'id' in JSON (to avoid Objective C's 'id').
@property (nonatomic, copy) NSString *identifier;

// The activity this comment replied to.
@property (nonatomic, retain) NSArray *inReplyTo;  // of GTLPlusCommentInReplyToItem

// Identifies this resource as a comment. Value: "plus#comment".
@property (nonatomic, copy) NSString *kind;

// The object of this comment.
@property (nonatomic, retain) GTLPlusCommentObject *object;

// People who +1'd this comment.
@property (nonatomic, retain) GTLPlusCommentPlusoners *plusoners;

// The time at which this comment was initially published. Formatted as an RFC
// 3339 timestamp.
@property (nonatomic, retain) GTLDateTime *published;

// Link to this comment resource.
@property (nonatomic, copy) NSString *selfLink;

// The time at which this comment was last updated. Formatted as an RFC 3339
// timestamp.
@property (nonatomic, retain) GTLDateTime *updated;

// This comment's verb, indicating what action was performed. Possible values
// are:
// - "post" - Publish content to the stream.
@property (nonatomic, copy) NSString *verb;

@end

// ----------------------------------------------------------------------------
//
//   GTLPlusCommentActor
//

@interface GTLPlusCommentActor : GTLObject

// Actor info specific to particular clients.
@property (nonatomic, retain) GTLPlusCommentActorClientSpecificActorInfo *clientSpecificActorInfo;

// The name of this actor, suitable for display.
@property (nonatomic, copy) NSString *displayName;

// The ID of the actor.
// identifier property maps to 'id' in JSON (to avoid Objective C's 'id').
@property (nonatomic, copy) NSString *identifier;

// The image representation of this actor.
@property (nonatomic, retain) GTLPlusCommentActorImage *image;

// A link to the Person resource for this actor.
@property (nonatomic, copy) NSString *url;

// Verification status of actor.
@property (nonatomic, retain) GTLPlusCommentActorVerification *verification;

@end

// ----------------------------------------------------------------------------
//
//   GTLPlusCommentInReplyToItem
//

@interface GTLPlusCommentInReplyToItem : GTLObject

// The ID of the activity.
// identifier property maps to 'id' in JSON (to avoid Objective C's 'id').
@property (nonatomic, copy) NSString *identifier;

// The URL of the activity.
@property (nonatomic, copy) NSString *url;

@end

// ----------------------------------------------------------------------------
//
//   GTLPlusCommentObject
//

@interface GTLPlusCommentObject : GTLObject

// The HTML-formatted content, suitable for display.
@property (nonatomic, copy) NSString *content;

// The object type of this comment. Possible values are:
// - "comment" - A comment in reply to an activity.
@property (nonatomic, copy) NSString *objectType;

// The content (text) as provided by the author, stored without any HTML
// formatting. When creating or updating a comment, this value must be supplied
// as plain text in the request.
@property (nonatomic, copy) NSString *originalContent;

@end

// ----------------------------------------------------------------------------
//
//   GTLPlusCommentPlusoners
//

@interface GTLPlusCommentPlusoners : GTLObject

// Total number of people who +1'd this comment.
@property (nonatomic, retain) NSNumber *totalItems;  // unsignedIntValue

@end

// ----------------------------------------------------------------------------
//
//   GTLPlusCommentActorClientSpecificActorInfo
//

@interface GTLPlusCommentActorClientSpecificActorInfo : GTLObject

// Actor info specific to YouTube clients.
@property (nonatomic, retain) GTLPlusCommentActorClientSpecificActorInfoYoutubeActorInfo *youtubeActorInfo;

@end

// ----------------------------------------------------------------------------
//
//   GTLPlusCommentActorImage
//

@interface GTLPlusCommentActorImage : GTLObject

// The URL of the actor's profile photo. To resize the image and crop it to a
// square, append the query string ?sz=x, where x is the dimension in pixels of
// each side.
@property (nonatomic, copy) NSString *url;

@end

// ----------------------------------------------------------------------------
//
//   GTLPlusCommentActorVerification
//

@interface GTLPlusCommentActorVerification : GTLObject

// Verification for one-time or manual processes.
@property (nonatomic, copy) NSString *adHocVerified;

@end

// ----------------------------------------------------------------------------
//
//   GTLPlusCommentActorClientSpecificActorInfoYoutubeActorInfo
//

@interface GTLPlusCommentActorClientSpecificActorInfoYoutubeActorInfo : GTLObject

// ID of the YouTube channel owned by the Actor.
@property (nonatomic, copy) NSString *channelId;

@end


text:
package org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation;

import java.nio.charset.StandardCharsets;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.locks.ReentrantLock;

import org.junit.jupiter.api.Test;

import org.springframework.boot.actuate.management.ThreadDumpEndpoint;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
import org.springframework.restdocs.operation.preprocess.ContentModifyingOperationPreprocessor;
import org.springframework.restdocs.payload.JsonFieldType;

import static org.springframework.restdocs.operation.preprocess.Preprocessors.preprocessResponse;
import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath;
import static org.springframework.restdocs.payload.PayloadDocumentation.responseFields;
import static org.springframework.restdocs.payload.PayloadDocumentation.subsectionWithPath;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
 * Tests for generating documentation describing {@link ThreadDumpEndpoint}.
 *
 * @author Andy Wilkinson
 */
class ThreadDumpEndpointDocumentationTests extends MockMvcEndpointDocumentationTests {

	@Test
	void jsonThreadDump() throws Exception {
		ReentrantLock lock = new ReentrantLock();
		CountDownLatch latch = new CountDownLatch(1);
		new Thread(() -> {
			try {
				lock.lock();
				try {
					latch.await();
				}
				finally {
					lock.unlock();
				}
			}
			catch (InterruptedException ex) {
				Thread.currentThread().interrupt();
			}
		}).start();
		this.mockMvc.perform(get("/actuator/threaddump").accept(MediaType.APPLICATION_JSON)).andExpect(
				status().isOk()).andDo(
						MockMvcRestDocumentation
								.document("threaddump/json", preprocessResponse(limit("threads")),
										responseFields(fieldWithPath("threads").description("JVM's threads."),
												fieldWithPath("threads.[].blockedCount").description(
														"Total number of times that the thread has been blocked."),
												fieldWithPath("threads.[].blockedTime").description(
														"Time in milliseconds that the thread has spent "
																+ "blocked. -1 if thread contention "
																+ "monitoring is disabled."),
												fieldWithPath("threads.[].daemon")
														.description("Whether the thread is a daemon "
																+ "thread. Only available on Java 9 or later.")
														.optional().type(JsonFieldType.BOOLEAN),
												fieldWithPath("threads.[].inNative")
														.description("Whether the thread is executing native code."),
												fieldWithPath("threads.[].lockName")
														.description("Description of the object on which the "
																+ "thread is blocked, if any.")
														.optional().type(JsonFieldType.STRING),
												fieldWithPath("threads.[].lockInfo")
														.description("Object for which the thread is blocked waiting.")
														.optional().type(JsonFieldType.OBJECT),
												fieldWithPath("threads.[].lockInfo.className")
														.description("Fully qualified class name of the lock object.")
														.optional().type(JsonFieldType.STRING),
												fieldWithPath("threads.[].lockInfo.identityHashCode")
														.description("Identity hash code of the lock object.")
														.optional().type(JsonFieldType.NUMBER),
												fieldWithPath("threads.[].lockedMonitors")
														.description("Monitors locked by this thread, if any"),
												fieldWithPath("threads.[].lockedMonitors.[].className")
														.description("Class name of the lock object.").optional()
														.type(JsonFieldType.STRING),
												fieldWithPath("threads.[].lockedMonitors.[].identityHashCode")
														.description("Identity hash code of the lock object.")
														.optional().type(JsonFieldType.NUMBER),
												fieldWithPath("threads.[].lockedMonitors.[].lockedStackDepth")
														.description("Stack depth where the monitor was locked.")
														.optional().type(JsonFieldType.NUMBER),
												subsectionWithPath("threads.[].lockedMonitors.[].lockedStackFrame")
														.description("Stack frame that locked the monitor.").optional()
														.type(JsonFieldType.OBJECT),
												fieldWithPath("threads.[].lockedSynchronizers")
														.description("Synchronizers locked by this thread."),
												fieldWithPath("threads.[].lockedSynchronizers.[].className")
														.description("Class name of the locked synchronizer.")
														.optional().type(JsonFieldType.STRING),
												fieldWithPath("threads.[].lockedSynchronizers.[].identityHashCode")
														.description("Identity hash code of the locked synchronizer.")
														.optional().type(JsonFieldType.NUMBER),
												fieldWithPath("threads.[].lockOwnerId")
														.description("ID of the thread that owns the object on which "
																+ "the thread is blocked. `-1` if the "
																+ "thread is not blocked."),
												fieldWithPath("threads.[].lockOwnerName")
														.description("Name of the thread that owns the "
																+ "object on which the thread is blocked, if any.")
														.optional().type(JsonFieldType.STRING),
												fieldWithPath("threads.[].priority")
														.description("Priority of the thread. Only "
																+ "available on Java 9 or later.")
														.optional().type(JsonFieldType.NUMBER),
												fieldWithPath("threads.[].stackTrace")
														.description("Stack trace of the thread."),
												fieldWithPath("threads.[].stackTrace.[].classLoaderName")
														.description("Name of the class loader of the "
																+ "class that contains the execution "
																+ "point identified by this entry, if "
																+ "any. Only available on Java 9 or later.")
														.optional().type(JsonFieldType.STRING),
												fieldWithPath("threads.[].stackTrace.[].className")
														.description("Name of the class that contains the "
																+ "execution point identified by this entry."),
												fieldWithPath("threads.[].stackTrace.[].fileName")
														.description("Name of the source file that "
																+ "contains the execution point "
																+ "identified by this entry, if any.")
														.optional().type(JsonFieldType.STRING),
												fieldWithPath("threads.[].stackTrace.[].lineNumber")
														.description("Line number of the execution "
																+ "point identified by this entry. "
																+ "Negative if unknown."),
												fieldWithPath("threads.[].stackTrace.[].methodName")
														.description("Name of the method."),
												fieldWithPath("threads.[].stackTrace.[].moduleName")
														.description("Name of the module that contains "
																+ "the execution point identified by "
																+ "this entry, if any. Only available "
																+ "on Java 9 or later.")
														.optional().type(JsonFieldType.STRING),
												fieldWithPath("threads.[].stackTrace.[].moduleVersion")
														.description("Version of the module that "
																+ "contains the execution point "
																+ "identified by this entry, if any. "
																+ "Only available on Java 9 or later.")
														.optional().type(JsonFieldType.STRING),
												fieldWithPath("threads.[].stackTrace.[].nativeMethod")
														.description("Whether the execution point is a native method."),
												fieldWithPath("threads.[].suspended")
														.description("Whether the thread is suspended."),
												fieldWithPath("threads.[].threadId").description("ID of the thread."),
												fieldWithPath("threads.[].threadName")
														.description("Name of the thread."),
												fieldWithPath("threads.[].threadState")
														.description("State of the thread ("
																+ describeEnumValues(Thread.State.class) + ")."),
												fieldWithPath("threads.[].waitedCount")
														.description("Total number of times that the thread has waited"
																+ " for notification."),
												fieldWithPath("threads.[].waitedTime")
														.description("Time in milliseconds that the thread has spent "
																+ "waiting. -1 if thread contention "
																+ "monitoring is disabled"))));
		latch.countDown();
	}

	@Test
	void textThreadDump() throws Exception {
		this.mockMvc.perform(get("/actuator/threaddump").accept(MediaType.TEXT_PLAIN)).andExpect(status().isOk())
				.andDo(MockMvcRestDocumentation.document("threaddump/text",
						preprocessResponse(new ContentModifyingOperationPreprocessor((bytes, mediaType) -> {
							String content = new String(bytes, StandardCharsets.UTF_8);
							int mainThreadIndex = content.indexOf("\"main\" - Thread");
							String truncatedContent = (mainThreadIndex >= 0) ? content.substring(0, mainThreadIndex)
									: content;
							return truncatedContent.getBytes();
						}))));
	}

	@Configuration(proxyBeanMethods = false)
	@Import(BaseDocumentationConfiguration.class)
	static class TestConfiguration {

		@Bean
		ThreadDumpEndpoint endpoint() {
			return new ThreadDumpEndpoint();
		}

	}

}


text:
'use strict';

function createRouteFromObject(obj) {
    var code = "";

    if (obj.condition)
        code += "if (!(" + obj.condition + ")) { cb(null, message); return; } ";

    if (obj.retval)
        code += "cb = context.returncb;";

    if (obj.process)
        code += obj.process;

    if (obj.route)
        code += "context.post(" + JSON.stringify(obj.route) + ", message, cb);"
    else {
        var retval;

        if (obj.transform)
            retval = obj.transform
        else
            retval = "message";

        code += "cb(null, " + retval + ");";
    }

    code = "try { " + code + " } catch (err) { cb(err, null); }";

    var fn = new Function("message", "context", "cb", code);

    return fn;
}

function createRouteFromFunction(fn) {
    if (fn.length == 1)
        return function (message, context, cb) {
            try {
                var newmsg = fn(message);

                setImmediate(function () {
                    cb(null, newmsg);
                });
            }
            catch (err) {
                setImmediate(function () {
                    cb(err, null);
                });
            }
        }

    if (fn.length == 2)
        return function (message, context, cb) {
            try {
                var newmsg = fn(message, context);

                setImmediate(function () {
                    cb(null, newmsg);
                });
            }
            catch (err) {
                setImmediate(function () {
                    cb(err, null);
                });
            }
        }

    return fn;
}

function createRouteFromArray(elements) {
    var fns = [];

    elements.forEach(function (element) {
        fns.push(createRoute(element));
    });

    var l = fns.length;

    return function (message, context, cb) {
        var k = 0;

        doStep();

        function doStep() {
            if (k >= l) {
                setImmediate(function () { cb(null, message) });
                return;
            }

            context.returncb = cb;

            fns[k++](message, context, function (err, newmsg) {
                if (err) {
                    cb(err, null);
                    return;
                }

                message = newmsg;

                setImmediate(doStep);
            });
        };
    };
}

function createRoute(routedef) {
    if (typeof routedef == 'function')
        return createRouteFromFunction(routedef);

    if (Array.isArray(routedef))
        return createRouteFromArray(routedef);

    if (typeof routedef == 'object')
        return createRouteFromObject(routedef);
}

module.exports = {
    create: createRoute
};


text:
package net.ozwolf.raml.resources;

import net.ozwolf.raml.configuration.ApiSpecsConfiguration;
import net.ozwolf.raml.exception.RamlValidationException;
import net.ozwolf.raml.model.RamlModel;
import net.ozwolf.raml.views.ApiView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.ServiceUnavailableException;
import javax.ws.rs.core.MediaType;

@Path("/api")
public class ApiResource {
    private final String specificationFile;
    private final ApiSpecsConfiguration configuration;

    private final static Logger LOGGER = LoggerFactory.getLogger(ApiResource.class);

    public ApiResource(String specificationFile, ApiSpecsConfiguration configuration) {
        this.specificationFile = specificationFile;
        this.configuration = configuration;
    }

    @GET
    @Produces(MediaType.TEXT_HTML)
    public ApiView get() {
        try {
            return new ApiView(RamlModel.create(specificationFile, configuration));
        } catch (RamlValidationException e) {
            LOGGER.error("RAML specification is invalid.", e);
            throw new ServiceUnavailableException("RAML specification has errors.  See log for details.");
        }
    }

    @Path("/raw")
    @Produces("text/plain")
    public String getRaw(){
        throw new ServiceUnavailableException("This resource is currently not available due to pending work on the RAML Parser third party library.");
    }

    public static ApiResource resource(String specificationFile, ApiSpecsConfiguration configuration) {
        return new ApiResource(specificationFile, configuration);
    }
}


text:
int main(int argc, char** argv)
{
    QCoreApplication app(argc, argv);
    QCoreApplication::setApplicationName("zot");
    QCoreApplication::setApplicationVersion("0.1");

    QCommandLineParser parser;
    parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
    parser.addHelpOption();
    parser.addVersionOption();

    QCommandLineOption fileOption("file", "Specify a zot binary file to run.", "file");
    parser.addOption(fileOption);

    QCommandLineOption programOption("program", "Specify a zot binary program to run.", "program");
    parser.addOption(programOption);

    QCommandLineOption inputOption("input", "Specify a zot binary input to run.", "input");
    parser.addOption(inputOption);

    QCommandLineOption interpreterOption("interpreter", "Specify a zot interpreter to use (c++|js). Default is c++.", "interpreter", "c++");
    parser.addOption(interpreterOption);

    QCommandLineOption skiOption("ski", "Specify to translate from SKI calculus.");
    parser.addOption(skiOption);

    QCommandLineOption translateOption("translate", "Translate program (zotToSki, zotToSkiTicks, skiToZot, skiToSkiTicks, skiTicksToZot, skiTicksToSki).", "translate");
    parser.addOption(translateOption);

    QCommandLineOption verboseOption("verbose", "Verbose execution evaluation for c++ interpreter.");
    parser.addOption(verboseOption);

    parser.process(*QCoreApplication::instance());

    bool isFile = parser.isSet(fileOption);
    bool isProgram = parser.isSet(programOption);
    bool isInput = parser.isSet(inputOption);
    bool isSki = parser.isSet(skiOption);
    bool isVerbose = parser.isSet(verboseOption);

    if ((isFile && isProgram) || (!isFile && !isProgram))
        parser.showHelp(-1);

    QString program;

    if (isFile) {
        QString fileName = parser.value(fileOption);
        QFile file(fileName);
        if (!file.exists()) {
            qDebug() << "Error: file does not exist: " << fileName;
            exit(-1);
        }

        if (!file.open(QIODevice::ReadOnly)) {
            qDebug() << "Error: could not open file for reading: " << fileName;
            exit(-1);
        }

        QFileInfo info(file);
        isSki = info.suffix() == "ski";
        program = file.readAll();
    } else if (isProgram) {
        program = parser.value(programOption);
    }

    // Remove all whitespace
    program = program.simplified();
    program.replace(" ", "");

    if (isSki && !parser.isSet(translateOption))
        program = Ski::toZot(program);

    if (isInput)
        program.append(parser.value(inputOption));

    // Remove all whitespace from input too
    program = program.simplified();
    program.replace(" ", "");

    if (parser.isSet(translateOption)) {
        QString translate = parser.value(translateOption);
        QString out;
        if (translate == "zotToSki") {
            out = Ski::fromSkiTicks(Zot::toSki(program));
        } else if (translate =="zotToSkiTicks") {
            out = Zot::toSki(program);
        } else if (translate =="skiToZot") {
            out = Ski::toZot(program);
        } else if (translate =="skiToSkiTicks") {
            out = Ski::toSkiTicks(program);
        } else if (translate =="skiTicksToZot") {
            out = Ski::toZot(program);
        } else if (translate =="skiTicksToSki") {
            out = Ski::fromSkiTicks(program);
        } else {
            parser.showHelp(-1);
        }
        printf("%s\n", qPrintable(out));
        return EXIT_SUCCESS;
    }

    QString interpreter = parser.value(interpreterOption);
    if (interpreter == "c++") {
        Zot zot(isVerbose);
        QString out = zot.run(program);
        if (!out.isEmpty())
            printf("%s\n", qPrintable(out));
    } else if (interpreter == "js") {
        ZotJS zot;
        QString out = zot.run(program);
        if (!out.isEmpty())
            printf("%s\n", qPrintable(out));
    } else {
        parser.showHelp(-1);
    }

    return EXIT_SUCCESS;
}


text:
using System;
using System.Web.Mvc;

using Moq;
using NUnit.Framework;

using Parser.Auth.Contracts;
using Parser.MvcClient.Controllers;

namespace Parser.MvcClient.Tests.ControllersTests.OwnerControllerTests
{
    [TestFixture]
    public class Constructor_Should
    {
        [Test]
        public void CreateCorrectInstance_WhenParametersAreValid()
        {
            // Arrange
            var authOwnerService = new Mock<IAuthOwnerService>();

            // Act
            var actualInstance = new OwnerController(authOwnerService.Object);

            // Assert
            Assert.That(actualInstance, Is.Not.Null);
            Assert.That(actualInstance, Is.InstanceOf<Controller>());
        }

        [Test]
        public void ThrowArgumentNullException_WhenIAuthOwnerServiceParameterIsNull()
        {
            // Arrange
            IAuthOwnerService authOwnerService = null;

            // Act & Assert
            Assert.That(
                () => new OwnerController(authOwnerService),
                Throws.InstanceOf<ArgumentNullException>().With.Message.Contains(nameof(IAuthOwnerService)));
        }
    }
}


text:
<?php

/**
 * Catalog product form gallery content
 *
 * @category   Mage
 * @package    Mage_Adminhtml
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content extends Mage_Adminhtml_Block_Widget
{
    /**
     * Type of uploader block
     *
     * @var string
     */
    protected $_uploaderType = 'uploader/multiple';

    public function __construct()
    {
        parent::__construct();
        $this->setTemplate('catalog/product/helper/gallery.phtml');
    }

    protected function _prepareLayout()
    {
        $this->setChild('uploader',
            $this->getLayout()->createBlock($this->_uploaderType)
        );

        $this->getUploader()->getUploaderConfig()
            ->setFileParameterName('image')
            ->setTarget(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/catalog_product_gallery/upload'));

        $browseConfig = $this->getUploader()->getButtonConfig();
        $browseConfig
            ->setAttributes(array(
                'accept' => $browseConfig->getMimeTypesByExtensions('gif, png, jpeg, jpg')
            ));

        Mage::dispatchEvent('catalog_product_gallery_prepare_layout', array('block' => $this));

        return parent::_prepareLayout();
    }

    /**
     * Retrive uploader block
     *
     * @return Mage_Uploader_Block_Multiple
     */
    public function getUploader()
    {
        return $this->getChild('uploader');
    }

    /**
     * Retrive uploader block html
     *
     * @return string
     */
    public function getUploaderHtml()
    {
        return $this->getChildHtml('uploader');
    }

    public function getJsObjectName()
    {
        return $this->getHtmlId() . 'JsObject';
    }

    public function getAddImagesButton()
    {
        return $this->getButtonHtml(
            Mage::helper('catalog')->__('Add New Images'),
            $this->getJsObjectName() . '.showUploader()',
            'add',
            $this->getHtmlId() . '_add_images_button'
        );
    }

    public function getImagesJson()
    {
        if(is_array($this->getElement()->getValue())) {
            $value = $this->getElement()->getValue();
            if(count($value['images'])>0) {
                foreach ($value['images'] as &$image) {
                    $image['url'] = Mage::getSingleton('catalog/product_media_config')
                                        ->getMediaUrl($image['file']);
                }
                return Mage::helper('core')->jsonEncode($value['images']);
            }
        }
        return '[]';
    }

    public function getImagesValuesJson()
    {
        $values = array();
        foreach ($this->getMediaAttributes() as $attribute) {
            /* @var $attribute Mage_Eav_Model_Entity_Attribute */
            $values[$attribute->getAttributeCode()] = $this->getElement()->getDataObject()->getData(
                $attribute->getAttributeCode()
            );
        }
        return Mage::helper('core')->jsonEncode($values);
    }

    /**
     * Enter description here...
     *
     * @return array
     */
    public function getImageTypes()
    {
        $imageTypes = array();
        foreach ($this->getMediaAttributes() as $attribute) {
            /* @var $attribute Mage_Eav_Model_Entity_Attribute */
            $imageTypes[$attribute->getAttributeCode()] = array(
                'label' => $attribute->getFrontend()->getLabel() . ' '
                         . Mage::helper('catalog')->__($this->getElement()->getScopeLabel($attribute)),
                'field' => $this->getElement()->getAttributeFieldName($attribute)
            );
        }
        return $imageTypes;
    }

    public function hasUseDefault()
    {
        foreach ($this->getMediaAttributes() as $attribute) {
            if($this->getElement()->canDisplayUseDefault($attribute))  {
                return true;
            }
        }

        return false;
    }

    /**
     * Enter description here...
     *
     * @return array
     */
    public function getMediaAttributes()
    {
        return $this->getElement()->getDataObject()->getMediaAttributes();
    }

    public function getImageTypesJson()
    {
        return Mage::helper('core')->jsonEncode($this->getImageTypes());
    }

}


text:
<?	// Connects to my Database
    $db = mysqli_connect('www.mglezh-loc.com','root','','portfolio');
	// Check connection
	if (mysqli_connect_errno())
	{
	  echo "Failed to connect to MySQL: " . mysqli_connect_error();
	}
    mysqli_set_charset($db,"utf8");
?>


text:
var add = require('../.');
describe('small integers', function () {
	describe('in positive range', function () {
		it('works with numbers', function (done) {
			add(1, 1, function (err, result) {
				expect(err).toEqual(null, 'small integers are valid');
				expect(result).toEqual('2', '1+1 should be "2"');
				done();
			});
		});
		it('works with strings', function (done) {
			add('1', '1', function (err, result) {
				expect(err).toEqual(null, 'small integers are valid');
				expect(result).toEqual('2', '1+1 should be "2"');
				done();
			});
		});
		it('works with carry', function (done) {
			add('5', '5', function (err, result) {
				expect(err).toEqual(null, 'small integers are valid');
				expect(result).toEqual('10', '5+5 should be "10"');
				done();
			});
		});

	});
});


text:
namespace OakKeywordTokenTags
{

	/// A list of auxialiary tags for keywords, as well as the Ident tag, which is equivalent to ITokenSplitRule :: kAuxTag_Default

	const uint64_t kKeywordAuxTags_Ident = 0;

	const uint64_t kKeywordAuxTags_True = 1;
	const uint64_t kKeywordAuxTags_False = 2;
	const uint64_t kKeywordAuxTags_Null = 3;

	const uint64_t kKeywordAuxTags_Bool = 4;
	const uint64_t kKeywordAuxTags_Int8 = 5;
	const uint64_t kKeywordAuxTags_Int16 = 6;
	const uint64_t kKeywordAuxTags_Int32 = 7;
	const uint64_t kKeywordAuxTags_Int64 = 8;
	const uint64_t kKeywordAuxTags_IntPtr = 9;
	const uint64_t kKeywordAuxTags_UInt8 = 10;
	const uint64_t kKeywordAuxTags_UInt16 = 11;
	const uint64_t kKeywordAuxTags_UInt32 = 12;
	const uint64_t kKeywordAuxTags_UInt64 = 13;
	const uint64_t kKeywordAuxTags_UIntPtr = 14;
	const uint64_t kKeywordAuxTags_Void = 15;
	const uint64_t kKeywordAuxTags_Char = 16;
	const uint64_t kKeywordAuxTags_Float32 = 17;
	const uint64_t kKeywordAuxTags_Float64 = 18;
	const uint64_t kKeywordAuxTags_String8 = 19;
	const uint64_t kKeywordAuxTags_String16 = 20;
	const uint64_t kKeywordAuxTags_String32 = 21;

	const uint64_t kKeywordAuxTags_Namespace = 22;
	const uint64_t kKeywordAuxTags_Import = 23;
	const uint64_t kKeywordAuxTags_Struct = 24;
	const uint64_t kKeywordAuxTags_Trait = 25;
	const uint64_t kKeywordAuxTags_Function = 26;
	const uint64_t kKeywordAuxTags_Return = 27;
	const uint64_t kKeywordAuxTags_Enum = 28;
	const uint64_t kKeywordAuxTags_Ignore = 29;
	const uint64_t kKeywordAuxTags_Mut = 30;
	const uint64_t kKeywordAuxTags_Public = 31;
	const uint64_t kKeywordAuxTags_New = 32;
	const uint64_t kKeywordAuxTags_Delete = 33;
	const uint64_t kKeywordAuxTags_Init = 34;
	const uint64_t kKeywordAuxTags_Drop = 35;
	const uint64_t kKeywordAuxTags_If = 36;
	const uint64_t kKeywordAuxTags_Else = 37;
	const uint64_t kKeywordAuxTags_While = 38;
	const uint64_t kKeywordAuxTags_Do = 39;
	const uint64_t kKeywordAuxTags_For = 40;
	const uint64_t kKeywordAuxTags_Match = 41;
	const uint64_t kKeywordAuxTags_Bind = 42;
	const uint64_t kKeywordAuxTags_Implement = 43;
	const uint64_t kKeywordAuxTags_Self = 44;
	const uint64_t kKeywordAuxTags_Inline = 45;
	const uint64_t kKeywordAuxTags_Break = 46;
	const uint64_t kKeywordAuxTags_Loop = 47;
	const uint64_t kKeywordAuxTags_Const = 48;
	const uint64_t kKeywordAuxTags_Require = 49;
	const uint64_t kKeywordAuxTags_Where = 50;
	const uint64_t kKeywordAuxTags_Alias = 51;
	const uint64_t kKeywordAuxTags_Other = 52;

	const uint64_t kKeywordAuxTags_Mask_Meaning = 0xFFF;

	const uint64_t kKeywordAuxTags_Mask_Localization = 0xFFFFF000;
	const uint64_t kKeywordAuxTags_Shift_Localization = 12;

	const uint64_t kKeywordAuxTags_Localization_EN = 0x00000;
	const uint64_t kKeywordAuxTags_Localization_FR = 0x00001;

	/// A list of the human-readable forms of keywords.
	const char * const KeywordAuxTagNames [] =
	{

		"IDENT",
		"TRUE",
		"FALSE",
		"NULL",
		"BOOL",
		"INT_8",
		"INT_16",
		"INT_32",
		"INT_64",
		"INT_PTR",
		"UINT_8",
		"UINT_16",
		"UINT_32",
		"UINT_64",
		"UINT_PTR",
		"VOID",
		"CHAR",
		"FLOAT_32",
		"FLOAT_64",
		"STRING_8",
		"STRING_16",
		"STRING_32",
		"NAMESPACE",
		"IMPORT",
		"STRUCT",
		"TRAIT",
		"FUNCTION",
		"RETURN",
		"ENUM",
		"IGNORE",
		"MUT",
		"PUBLIC",
		"NEW",
		"DELETE",
		"INIT",
		"DROP",
		"IF",
		"ELSE",
		"WHILE",
		"DO",
		"FOR",
		"MATCH",
		"BIND",
		"IMPLEMENT",
		"SELF",
		"INLINE",
		"BREAK",
		"LOOP",
		"CONST",
		"REQUIRE",
		"WHERE",
		"ALIAS",
		"OTHER",

	};

}

#endif


text:
layout: default
published: true
---

{{ page.title }}

    {{ content }}

    Written on {{ page.date | date: "%B %e, %Y" }}

  {% include disqus.html disqus_identifier=page.disqus_identifier %}


text:
package annotations.server;

import javax.jws.WebService;

@WebService(endpointInterface="annotations.server.AddNumbersIF")
public class AddNumbersImpl {

    /**
     * @param number1 an int > 0
     * @param number2 an int > 0
     * @return The sum
     * @throws AddNumbersException
     *             if any of the numbers to be added is negative.
     */
    public int addNumbers(int number1, int number2) throws AddNumbersException {
        if (number1 < 0 || number2 < 0) {
                throw new AddNumbersException("Negative number cant be added!",
                                "Numbers: " + number1 + ", " + number2);
        }
        return number1 + number2;
    }
}


text:
package com.intellij.ui.components;

import com.intellij.util.Alarm;
import com.intellij.util.ui.Animator;

/**
 * @author Sergey.Malenkov
 */
abstract class TwoWayAnimator {
  private final Alarm myAlarm = new Alarm();
  private final MyAnimator myForwardAnimator;
  private final MyAnimator myBackwardAnimator;

  private final int myMaxFrame;
  private int myFrame;
  float myValue;

  abstract void onValueUpdate();

  TwoWayAnimator(String name, int totalFrames, int pauseForward, int durationForward, int pauseBackward, int durationBackward) {
    myMaxFrame = totalFrames - 1;
    myForwardAnimator = new MyAnimator(name + "ForwardAnimator", totalFrames, durationForward, pauseForward, true);
    myBackwardAnimator = new MyAnimator(name + "BackwardAnimator", totalFrames, durationBackward, pauseBackward, false);
  }

  void start(boolean forward) {
    stop();
    MyAnimator animator = forward ? myForwardAnimator : myBackwardAnimator;
    if (!forward ? myFrame > 0 : myFrame < myMaxFrame) {
      if (forward ? myFrame > 0 : myFrame < myMaxFrame) {
        animator.run();
      }
      else {
        myAlarm.addRequest(animator, animator.myPause);
      }
    }
  }

  void rewind(boolean forward) {
    stop();
    if (forward) {
      if (myFrame != myMaxFrame) setFrame(myMaxFrame);
    }
    else {
      if (myFrame != 0) setFrame(0);
    }
  }

  void stop() {
    myAlarm.cancelAllRequests();
    myForwardAnimator.suspend();
    myBackwardAnimator.suspend();
  }

  void setFrame(int frame) {
    myFrame = frame;
    myValue = frame == 0 ? 0 : frame == myMaxFrame ? 1 : (float)frame / myMaxFrame;
    onValueUpdate();
  }

  private final class MyAnimator extends Animator implements Runnable {
    private final int myPause;

    private MyAnimator(String name, int totalFrames, int cycleDuration, int pause, boolean forward) {
      super(name, totalFrames, cycleDuration, false, forward);
      myPause = pause;
    }

    @Override
    public void run() {
      reset();
      resume();
    }

    @Override
    public void paintNow(int frame, int totalFrames, int cycle) {
      if (isForward() ? (frame > myFrame) : (frame < myFrame)) {
        setFrame(frame);
      }
    }

    @Override
    protected void paintCycleEnd() {
      setFrame(isForward() ? myMaxFrame : 0);
    }
  }
}


text:
namespace palo {

class MemPool;
class TupleRow;

// Node for in-memory merge joins:
// find the minimal tuple and output
class MergeJoinNode : public ExecNode {
public:
    MergeJoinNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs);

    ~MergeJoinNode();

    virtual Status init(const TPlanNode& tnode, RuntimeState* state = nullptr);
    virtual Status prepare(RuntimeState* state);
    virtual Status open(RuntimeState* state);
    virtual Status get_next(RuntimeState* state, RowBatch* row_batch, bool* eos);
    virtual Status close(RuntimeState* state);

    static const char* LLVM_CLASS_NAME;

protected:
    void debug_string(int indentation_level, std::stringstream* out) const;

private:
    // our equi-join predicates "<lhs> = <rhs>" are separated into
    // _left_exprs (over child(0)) and _right_exprs (over child(1))
    // check which expr is min
    std::vector<ExprContext*> _left_expr_ctxs;
    std::vector<ExprContext*> _right_expr_ctxs;

    // non-equi-join conjuncts from the JOIN clause
    std::vector<ExprContext*> _other_join_conjunct_ctxs;

    bool _eos;            // if true, nothing left to return in get_next()

    struct ChildReaderContext {
        RowBatch batch;
        int row_idx;
        bool is_eos;
        TupleRow* current_row;
        ChildReaderContext(const RowDescriptor& desc, int batch_size, MemTracker* mem_tracker) :
            batch(desc, batch_size, mem_tracker), row_idx(0), is_eos(false), current_row(NULL) {
        }
    };
    // _left_batch must be cleared before calling get_next().  used cache child(0)'s data
    // _rigth_batch must be cleared before calling get_next().  used cache child(1)'s data
    // does not initialize all tuple ptrs in the row, only the ones that it
    // is responsible for.
    boost::scoped_ptr<ChildReaderContext> _left_child_ctx;
    boost::scoped_ptr<ChildReaderContext> _right_child_ctx;
    // _build_tuple_idx[i] is the tuple index of child(1)'s tuple[i] in the output row
    std::vector<int> _right_tuple_idx;
    int _right_tuple_size;
    int _left_tuple_size;
    RowBatch* _out_batch;

    typedef int (*CompareFn)(const void*, const void*);
    std::vector<CompareFn> _cmp_func;

    // byte size of result tuple row (sum of the tuple ptrs, not the tuple data).
    // This should be the same size as the probe tuple row.
    int _result_tuple_row_size;

    void create_output_row(TupleRow* out, TupleRow* left, TupleRow* right);
    Status compare_row(TupleRow* left_row, TupleRow* right_row, bool* is_lt);
    Status get_next_row(RuntimeState* state, TupleRow* out_row, bool* eos);
    Status get_input_row(RuntimeState* state, int child_idx);
};

}

#endif


text:
import sys

try:
    from Tkinter import *
except ImportError:
    from tkinter import *

try:
    import ttk
    py3 = 0
except ImportError:
    import tkinter.ttk as ttk
    py3 = 1

import vrex_help_support

def vp_start_gui():
    '''Starting point when module is the main routine.'''
    global val, w, root
    root = Tk()
    root.title('Vrex_Help')
    root.geometry('609x626+171+285')
    w = Vrex_Help (root)
    vrex_help_support.init(root, w)
    root.mainloop()

w = None
def create_Vrex_Help (root, param=None):
    '''Starting point when module is imported by another program.'''
    global w, w_win, rt
    rt = root
    w = Toplevel (root)
    w.title('Vrex_Help')
    w.geometry('609x626+171+285')
    w_win = Vrex_Help (w)
    vrex_help_support.init(w, w_win, param)
    return w_win

def destroy_Vrex_Help ():
    global w
    w.destroy()
    w = None

class Vrex_Help:
    def __init__(self, master=None):
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2'
        _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}'
        _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2'
        font10 = "-family {DejaVu Sans} -size 16 -weight normal -slant " + \
            " roman -underline 0 -overstrike 0"
        font12 = "-family {DejaVu Sans} -size 14 -weight normal -slant " + \
            " roman -underline 0 -overstrike 0"
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.',background=_bgcolor)
        self.style.configure('.',foreground=_fgcolor)
        self.style.configure('.',font=font10)
        self.style.map('.',background=
            [('selected', _compcolor), ('active',_ana2color)])
        master.configure(highlightbackground="wheat")
        master.configure(highlightcolor="black")

        self.TScrolledtext1 = ScrolledText (master)
        self.TScrolledtext1.place(relx=0.02,rely=0.02,relheight=0.9
                ,relwidth=0.95)
        self.TScrolledtext1.configure(background="white")
        self.TScrolledtext1.configure(font=font10)
        self.TScrolledtext1.configure(insertborderwidth="3")
        self.TScrolledtext1.configure(selectbackground="#c4c4c4")
        self.TScrolledtext1.configure(width=10)
        self.TScrolledtext1.configure(wrap=WORD)

        self.Button1 = Button (master)
        self.Button1.place(relx=0.45,rely=0.93,height=30,width=69)
        self.Button1.configure(activebackground="#f9f9f9")
        self.Button1.configure(command=vrex_help_support.close)
        self.Button1.configure(disabledforeground="#b8a786")
        self.Button1.configure(font=font12)
        self.Button1.configure(highlightbackground="wheat")
        self.Button1.configure(text='''Close''')

        self.TSizegrip1 = ttk.Sizegrip(master)
        self.TSizegrip1.place(anchor=SE,relx=1.0,rely=1.0)

# The following code is added to facilitate the Scrolled widgets you specified.
class AutoScroll(object):
    '''Configure the scrollbars for a widget.'''

    def __init__(self, master):
        vsb = ttk.Scrollbar(master, orient='vertical', command=self.yview)
        hsb = ttk.Scrollbar(master, orient='horizontal', command=self.xview)

        self.configure(yscrollcommand=self._autoscroll(vsb),
            xscrollcommand=self._autoscroll(hsb))
        self.grid(column=0, row=0, sticky='nsew')
        vsb.grid(column=1, row=0, sticky='ns')
        hsb.grid(column=0, row=1, sticky='ew')

        master.grid_columnconfigure(0, weight=1)
        master.grid_rowconfigure(0, weight=1)

        # Copy geometry methods of master  (took from ScrolledText.py)
        if py3:
            methods = Pack.__dict__.keys() | Grid.__dict__.keys() \
                  | Place.__dict__.keys()
        else:
            methods = Pack.__dict__.keys() + Grid.__dict__.keys() \
                  + Place.__dict__.keys()

        for meth in methods:
            if meth[0] != '_' and meth not in ('config', 'configure'):
                setattr(self, meth, getattr(master, meth))

    @staticmethod
    def _autoscroll(sbar):
        '''Hide and show scrollbar as needed.'''
        def wrapped(first, last):
            first, last = float(first), float(last)
            if first <= 0 and last >= 1:
                sbar.grid_remove()
            else:
                sbar.grid()
            sbar.set(first, last)
        return wrapped

    def __str__(self):
        return str(self.master)

def _create_container(func):
    '''Creates a ttk Frame with a given master, and use this new frame to
    place the scrollbars and the widget.'''
    def wrapped(cls, master, **kw):
        container = ttk.Frame(master)
        return func(cls, container, **kw)
    return wrapped

class ScrolledText(AutoScroll, Text):
    '''A standard Tkinter Text widget with scrollbars that will
    automatically show/hide as needed.'''
    @_create_container
    def __init__(self, master, **kw):
        Text.__init__(self, master, **kw)
        AutoScroll.__init__(self, master)

if __name__ == '__main__':
    vp_start_gui()


text:
#include <iostream>
#include <iterator>

#include "couchdb/CouchDB.hpp"

#define TEST_DB_NAME "db_test1"
#define TEST_ID      "id_test1"

using namespace std;

// TODO: debug why copy is not working correctly below
template<typename T>
void output(const vector<T> &v, ostream &out)
{
   typename vector<T>::const_iterator i = v.begin();
   const typename vector<T>::const_iterator &iEnd = v.end();
   for(; i != iEnd; ++i)
      out << *i << " ";
}

static void printDatabases(CouchDB::Connection &conn)
{
   vector<string> dbs = conn.listDatabases();
   copy(dbs.begin(), dbs.end(), ostream_iterator<string>(cout, " "));
   cout << endl;
}

static void printDocuments(CouchDB::Database db)
{
   vector<CouchDB::Document> docs = db.listDocuments();
   cout << db.getName() << " has " << docs.size() << " documents: ";
   //copy(docs.begin(), docs.end(), ostream_iterator<CouchDB::Document>(cout, " "));
   output(docs, cout);
   cout << endl;
}

static void printAttachments(CouchDB::Document &doc)
{
   vector<CouchDB::Attachment> attachments = doc.getAllAttachments();
   cout << "Attachments for document " << doc << ": ";
   //copy(attachments.begin(), attachments.end(), ostream_iterator<CouchDB::Attachment>(cout, " "));
   output(attachments, cout);
   cout << endl;
}

static CouchDB::Variant createRecord(int key, const string &value,
                                   const string &value2, double dValue)
{
   CouchDB::Object obj;
   obj["key"]    = CouchDB::createVariant(key);
   obj["value"]  = CouchDB::createVariant(value);
   obj["value2"] = CouchDB::createVariant(value2);
   obj["dValue"] = CouchDB::createVariant(dValue);
   return CouchDB::createVariant(obj);
}

int main()
{
#ifdef WIN32
   SetEnvironmentVariable("http_proxy", "");
#else
   setenv("http_proxy", "", 1);
#endif

   try
   {
      const std::string url = "http://stage-rd-6:5984";
      CouchDB::Connection conn(url);
      cout << "CouchDB version: " << conn.getCouchDBVersion() << endl;

      cout << "Initial database set: ";
      printDatabases(conn);

      cout << "Creating test database" << endl;

      conn.createDatabase(TEST_DB_NAME);

      cout << "New database set: ";
      printDatabases(conn);

      CouchDB::Database db = conn.getDatabase(TEST_DB_NAME);

      CouchDB::Array records;
      records.push_back(createRecord(12345, "T1", "DIE", 5.0));
      records.push_back(createRecord(45678, "T2", "C0" , 6.0));
      records.push_back(createRecord(89012, "T3", "C1" , 7.0));

      CouchDB::Object obj;
      obj["x1"]      = CouchDB::createVariant("A12345");
      obj["x2"]      = CouchDB::createVariant("ABCDEF");
      obj["records"] = CouchDB::createVariant(records);

      CouchDB::Variant data = CouchDB::createVariant(obj);
      cout << "Creating new document" << endl;
      CouchDB::Document doc = db.createDocument(data);
      cout << "Created doc: " << doc << endl;

      printDocuments(db);

      CouchDB::Document testDoc = db.getDocument(doc.getID());

      cout << "Document in database: "
           << testDoc << ": "
           << testDoc.getData() << endl;

      cout << "Comparing docs: " << doc << " and " << testDoc << endl;

      if(doc == testDoc)
         cout << "Verified documents are the same" << endl;
      else
         cout << "Documents differ:" << endl
              << doc.getData() << endl
              << testDoc.getData() << endl;

      cout << "Creating a version of the document with id: " << TEST_ID << endl;
      CouchDB::Document docId = db.createDocument(data, TEST_ID);
      cout << "Created new document: " << docId << endl;

      docId.addAttachment("h1", "text/plain", "hello world");
      docId.addAttachment("h2", "text/plain", "cool world");

      CouchDB::Attachment a = docId.getAttachment("h1");
      cout << "Got attachment: " << a << ": " << a.getData() << endl;

      printAttachments(docId);

      cout << "Removing attachment: " << a << endl;
      docId.removeAttachment(a.getID());

      printAttachments(docId);

      cout << "Trying to access removed attachment: " << a << endl;

      try
      {
         string badData = a.getData();
         cout << "ERROR: Got valid data for removed attachment: " << badData << endl;
      }
      catch(CouchDB::Exception &e)
      {
         cerr << "Unable to retrieve data for removed attachment (GOOD): " << e.what() << endl;
      }

      docId.remove();

      cout << "Copying document: " << doc << endl;
      CouchDB::Document copyDoc = doc.copy(TEST_ID);
      cout << "Got document copy: " << copyDoc << endl;
      copyDoc.remove();

      doc.remove();

      cout << "Docs removed" << endl;

      printDocuments(db);

      cout << "Trying to retrieve data for removed document: " << testDoc << endl;

      try
      {
         data = testDoc.getData();
         cout << "ERROR: Got valid data for removed document: " << data << endl;
      }
      catch(CouchDB::Exception &e)
      {
         cerr << "Unable to retrieve data for removed document (GOOD): " << e.what() << endl;
      }

      cout << "Removing test database" << endl;

      conn.deleteDatabase(TEST_DB_NAME);

      cout << "Final database set: ";
      printDatabases(conn);

      cout << "All tests passed" << endl;
   }
   catch(exception &e)
   {
      cerr << "Exception: " << e.what() << endl;
   }
   catch(...)
   {
      cerr << "Caught unknown exception in main..." << endl;
   }
}


text:
<stix:STIX_Package
	xmlns:cyboxCommon="http://cybox.mitre.org/common-2"
	xmlns:cybox="http://cybox.mitre.org/cybox-2"
	xmlns:cyboxVocabs="http://cybox.mitre.org/default_vocabularies-2"
	xmlns:example="http://example.com"
	xmlns:incident="http://stix.mitre.org/Incident-1"
	xmlns:ta="http://stix.mitre.org/ThreatActor-1"
	xmlns:stixCommon="http://stix.mitre.org/common-1"
	xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"
	xmlns:stix-ciqidentity="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1"
	xmlns:stix="http://stix.mitre.org/stix-1"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xal="urn:oasis:names:tc:ciq:xal:3"
	xmlns:xnl="urn:oasis:names:tc:ciq:xnl:3"
	xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3"
	xsi:schemaLocation="
	http://cybox.mitre.org/common-2 http://cybox.mitre.org/XMLSchema/common/2.1/cybox_common.xsd
	http://cybox.mitre.org/cybox-2 http://cybox.mitre.org/XMLSchema/core/2.1/cybox_core.xsd
	http://cybox.mitre.org/default_vocabularies-2 http://cybox.mitre.org/XMLSchema/default_vocabularies/2.1/cybox_default_vocabularies.xsd
	http://stix.mitre.org/Incident-1 http://stix.mitre.org/XMLSchema/incident/1.1.1/incident.xsd
	http://stix.mitre.org/ThreatActor-1 http://stix.mitre.org/XMLSchema/threat_actor/1.1.1/threat_actor.xsd
	http://stix.mitre.org/common-1 http://stix.mitre.org/XMLSchema/common/1.1.1/stix_common.xsd
	http://stix.mitre.org/default_vocabularies-1 http://stix.mitre.org/XMLSchema/default_vocabularies/1.1.1/stix_default_vocabularies.xsd
	http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1 http://stix.mitre.org/XMLSchema/extensions/identity/ciq_3.0/1.1.1/ciq_3.0_identity.xsd
	http://stix.mitre.org/stix-1 http://stix.mitre.org/XMLSchema/core/1.1.1/stix_core.xsd
	urn:oasis:names:tc:ciq:xal:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xAL.xsd
	urn:oasis:names:tc:ciq:xnl:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xNL.xsd
	urn:oasis:names:tc:ciq:xpil:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xPIL.xsd" id="example:Package-68da9575-7706-4bc3-a2f7-c62e93ee1bab" version="1.1.1" timestamp="2013-09-28T06:16:00+00:00">
    <stix:Incidents>
        <stix:Incident id="example:incident-76c43f02-abf0-4382-a8ad-c8d1c416ce58" timestamp="2014-05-10T00:58:19+00:00" xsi:type='incident:IncidentType'>
            <incident:Title>In 2011, the NSA OIG was notified that, in 2011, the subject had tasked the telephone number of her foreign-national boyfriend and other foreign nationals and that she reviewed the resultant collection.  The subject reported this activity during an investigation into another matter.    The subject asserted that it was her practice to enter foreign national phone numbers she obtained in social settings into the SIGINT system to ensure that she was not talking to "shady characters" and to help mission.</incident:Title>
            <incident:External_ID source="VERIS">789F0A4D-6261-480B-B989-09F5477D1134</incident:External_ID>
            <incident:Time>
                <incident:Initial_Compromise precision="year">2011-01-01T00:00:00</incident:Initial_Compromise>
            </incident:Time>
            <incident:Reporter>
                <stixCommon:Identity xsi:type='stix-ciqidentity:CIQIdentity3.0InstanceType'>
                    <ExtSch:Specification xmlns:ExtSch="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1">
  <xpil:PartyName xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xnl:NameLine xmlns:xnl="urn:oasis:names:tc:ciq:xnl:3">swidup</xnl:NameLine>
  </xpil:PartyName>
</ExtSch:Specification>
                </stixCommon:Identity>
            </incident:Reporter>
            <incident:Victim xsi:type='stix-ciqidentity:CIQIdentity3.0InstanceType'>
                <ExtSch:Specification xmlns:ExtSch="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1">
  <xpil:PartyName xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xnl:NameLine xmlns:xnl="urn:oasis:names:tc:ciq:xnl:3">US National Security Agency (NSA)</xnl:NameLine>
  </xpil:PartyName>
  <xpil:Addresses xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xpil:Address>
      <xal:Country xmlns:xal="urn:oasis:names:tc:ciq:xal:3">
        <xal:NameElement>US</xal:NameElement>
      </xal:Country>
      <xal:AdministrativeArea xmlns:xal="urn:oasis:names:tc:ciq:xal:3">
        <xal:NameElement>DC</xal:NameElement>
      </xal:AdministrativeArea>
    </xpil:Address>
  </xpil:Addresses>
</ExtSch:Specification>
            </incident:Victim>
            <incident:Affected_Assets>
                <incident:Affected_Asset>
                    <incident:Type>Database</incident:Type>
                    <incident:Nature_Of_Security_Effect>
                        <incident:Property_Affected>
                            <incident:Property xsi:type="stixVocabs:LossPropertyVocab-1.0">Confidentiality</incident:Property>
                            <incident:Description_Of_Effect>Other</incident:Description_Of_Effect>
                        </incident:Property_Affected>
                    </incident:Nature_Of_Security_Effect>
                </incident:Affected_Asset>
            </incident:Affected_Assets>
            <incident:Impact_Assessment>
                <incident:Impact_Qualification xsi:type="stixVocabs:ImpactQualificationVocab-1.0">Unknown</incident:Impact_Qualification>
            </incident:Impact_Assessment>
            <incident:Attributed_Threat_Actors>
                <incident:Threat_Actor>
                    <stixCommon:Threat_Actor idref="example:threatactor-0fd75229-3bbd-4d9b-ba13-9968ceed6f0d" xsi:type='ta:ThreatActorType'/>
                </incident:Threat_Actor>
            </incident:Attributed_Threat_Actors>
            <incident:Security_Compromise xsi:type="stixVocabs:SecurityCompromiseVocab-1.0">Yes</incident:Security_Compromise>
            <incident:Discovery_Method>Int - reported by employee</incident:Discovery_Method>
            <incident:Information_Source>
                <stixCommon:Identity>
                    <stixCommon:Name>vcdb</stixCommon:Name>
                </stixCommon:Identity>
                <stixCommon:Tools>
                    <cyboxCommon:Tool>
                        <cyboxCommon:Name>veris2stix</cyboxCommon:Name>
                        <cyboxCommon:Vendor>MITRE</cyboxCommon:Vendor>
                        <cyboxCommon:Version>0.1</cyboxCommon:Version>
                    </cyboxCommon:Tool>
                    <cyboxCommon:Tool>
                        <cyboxCommon:Name>VERIS schema</cyboxCommon:Name>
                        <cyboxCommon:Vendor>Verizon</cyboxCommon:Vendor>
                        <cyboxCommon:Version>1.3.0</cyboxCommon:Version>
                    </cyboxCommon:Tool>
                </stixCommon:Tools>
                <stixCommon:References>
                    <stixCommon:Reference>http://www.grassley.senate.gov/judiciary/upload/NSA-Surveillance-09-11-13-response-from-IG-to-intentional-misuse-of-NSA-authority.pdf</stixCommon:Reference>
                </stixCommon:References>
            </incident:Information_Source>
        </stix:Incident>
    </stix:Incidents>
    <stix:Threat_Actors>
        <stix:Threat_Actor id="example:threatactor-0fd75229-3bbd-4d9b-ba13-9968ceed6f0d" timestamp="2014-12-22T16:30:08.615000+00:00" xsi:type='ta:ThreatActorType'>
            <ta:Type timestamp="2014-12-22T16:30:08.615000+00:00">
                <stixCommon:Value xsi:type="stixVocabs:ThreatActorTypeVocab-1.0">Insider Threat</stixCommon:Value>
                <stixCommon:Description>Unknown</stixCommon:Description>
            </ta:Type>
            <ta:Motivation timestamp="2014-12-22T16:30:08.615000+00:00">
                <stixCommon:Value>Other</stixCommon:Value>
            </ta:Motivation>
        </stix:Threat_Actor>
    </stix:Threat_Actors>
</stix:STIX_Package>