text:
html {font-family:tahoma, arial ce, arial, helvetica ce, helvetica; color:#0080C0; }

body {font-family:tahoma, arial ce, arial, helvetica ce, helvetica; color:#0080C0; background-color:#EFEFEF; background-image:URL(./background.jpg); background-repeat:no-repeat;}

table {font-family:tahoma, arial ce, arial, helvetica ce, helvetica; color:#0080C0; }

tr {font-family:tahoma, arial ce, arial, helvetica ce, helvetica; color:#0080C0; }

a:hover {text-decoration:none; color:#0080C0; background-color:Silver; }

akey {color:#0080C0; }

form table tr p {background-color: #EFEFEF ; border: 1px solid #0080C0;}

td td {background-color: #EFEFEF;}

akey:hover {color:#0080C0; }

unique {color:gold; }

unique:hover {color:#0080C0; }

jmeno {color:gold; }

.p_soukroma {color:White; background-color:#406040 !important; }

.p_posel, .p_ma_team {color:White; background-color:#800000 !important; }

.odeslana {color:White; background-color:#777700 !important; }

.p_a_verejna {color:White; background-color:#008080 !important; }

.p_a_tajna {color:White; background-color:#804000 !important; }

.p_soukroma td {color:White; background-color:#406040 !important; }

.p_posel td, .p_ma_team td {color:White; background-color:#800000 !important; }

.odeslana td {color:White; background-color:#777700 !important; }

.p_a_verejna td {color:White; background-color:#008080 !important; }

.p_a_tajna td {color:White; background-color:#804000 !important; }

.noeffects {color:#0080C0; }

.noeffects:hover {color:#0080C0; }

input {text-align:Center; color:Black; background-color:Silver; }

select {text-align:Center; color:Black; background-color:Silver; }

textarea {color:Teal; background-color:Silver; -moz-border-radius:5; }

a { color: #0080C0; font-weight: bold; text-decoration: none; }

input.button {color:Black; background-color:Silver; border:Black 2px Outset; }

input.login {color:GOLD; background-color:Black; border:GOLD 1px Solid; }

iframe {color:#0080C0; border:GOLD 1px Solid; }

input.image {color:GOLD; background-color:Black; border:Black 0px Solid; }

select.brown {color:Black; background-color:A39179; }

input.brown {color:Black; background-color:A39179; border:Black 1px Solid; }

input.brown_button {color:Black; background-color:DDDDDD; border:Black 2px Outset; }

a:focus, select:focus, input:focus {color:#0080C0; border:GOLD 2px Solid; }

.c_C, .c_M, .c_B, .c_S, .c_Z, .c_N, .c_F {font-size:10px; border:GREY 1px Solid; }

.c_C {background-color:Black; }

.c_M {background-color:Navy; }

.c_B {color:Black; background-color:#C8C8C8; border:Black 1px Solid; }

.c_S {background-color:Gray; }

.c_Z {background-color:Green; }

.c_F {background-color:#62006B; }

.c_N {border:GREY 1px Solid; }

.dark {color:Black; }

.nastaveni_ali td.poradi {text-align:Right; }

.nastaveni_ali td.online_status {width:15px; }

.nastaveni_ali td.online_status {width:15px; }

.nastaveni_ali td.online_status div {margin-top:2px; margin-bottom:2px; margin-left:2px; margin-right:2px; width:10px; height:10px; border:1px solid; }

.nastaveni_ali td.online_status div.on {background-color:Green; }

.nastaveni_ali td.online_status div.off {background-color:Red; }

.nastaveni_ali td.online_status div.grey {background-color:#666666; }

.little_warning {font-size:10px; color:Red; }

.warning {font-size:12px; color:Red; }

.big_warning {font-size:15px; color:Red; }


text:
package org.jaffre;

import java.util.Stack;

import org.jaffre.spi.NoopLogger;

/**
 * @author Alexander Veit
 */
public class TestLogger implements Logger
{
	private static final TestLogger ms_instance = new TestLogger();

	private final DefaultTestLogger m_default = new DefaultTestLogger();

	private Stack<Logger> m_stack = new Stack<>();

	public static class DefaultTestLogger extends NoopLogger
	{
		public DefaultTestLogger()
		{
		}

		/**
		 * @return Always true.
		 * @see org.jaffre.Logger#isErrorEnabled().
		 */
		@Override
		public boolean isErrorEnabled()
		{
			return true;
		}

		/**
		 * Always throws a RuntimeException with
		 * the given exception as cause.
		 */
		@Override
		public void error(String p_strMessage, Throwable p_e)
		{
			throw new RuntimeException(p_strMessage, p_e);
		}

		/**
		 * Always throws a RuntimeException.
		 */
		@Override
		public void error(String p_strMessage)
		{
			throw new RuntimeException(p_strMessage);
		}

		/**
		 * @return Always true.
		 * @see org.jaffre.Logger#isWarnEnabled().
		 */
		@Override
		public boolean isWarnEnabled()
		{
			return true;
		}

		/**
		 * Always throws a RuntimeException with
		 * the given exception as cause.
		 */
		@Override
		public void warn(String p_strMessage, Throwable p_e)
		{
			throw new RuntimeException(p_strMessage, p_e);
		}

		/**
		 * Always throws a RuntimeException.
		 */
		@Override
		public void warn(String p_strMessage)
		{
			throw new RuntimeException(p_strMessage);
		}
	}

	public TestLogger()
	{
	}

	public static void push(Logger p_logger)
	{
		ms_instance.m_stack.push(p_logger);
	}

	public static Logger pop()
	{
		return ms_instance.m_stack.pop();
	}

	public static void clear()
	{
		ms_instance.m_stack.clear();
	}

	private Logger _delegate()
	{
		if (ms_instance.m_stack.isEmpty())
			return ms_instance.m_default;
		else
			return ms_instance.m_stack.peek();
	}

	/*
	 * @see org.jaffre.Logger#isErrorEnabled()
	 */
	@Override
	public boolean isErrorEnabled()
	{
		return _delegate().isErrorEnabled();
	}

	/*
	 * @see org.jaffre.Logger#error(java.lang.String)
	 */
	@Override
	public void error(String p_strMessage)
	{
		_delegate().error(p_strMessage);
	}

	/*
	 * @see org.jaffre.Logger#error(java.lang.String, java.lang.Throwable)
	 */
	@Override
	public void error(String p_strMessage, Throwable p_e)
	{
		_delegate().error(p_strMessage, p_e);
	}

	/*
	 * @see org.jaffre.Logger#isWarnEnabled()
	 */
	@Override
	public boolean isWarnEnabled()
	{
		return _delegate().isWarnEnabled();
	}

	/*
	 * @see org.jaffre.Logger#warn(java.lang.String)
	 */
	@Override
	public void warn(String p_strMessage)
	{
		_delegate().warn(p_strMessage);
	}

	/*
	 * @see org.jaffre.Logger#warn(java.lang.String, java.lang.Throwable)
	 */
	@Override
	public void warn(String p_strMessage, Throwable p_e)
	{
		_delegate().warn(p_strMessage, p_e);
	}

	/*
	 * @see org.jaffre.Logger#isInfoEnabled()
	 */
	@Override
	public boolean isInfoEnabled()
	{
		return _delegate().isInfoEnabled();
	}

	/*
	 * @see org.jaffre.Logger#info(java.lang.String)
	 */
	@Override
	public void info(String p_strMessage)
	{
		_delegate().info(p_strMessage);
	}

	/*
	 * @see org.jaffre.Logger#info(java.lang.String, java.lang.Throwable)
	 */
	@Override
	public void info(String p_strMessage, Throwable p_e)
	{
		_delegate().info(p_strMessage, p_e);
	}

	/*
	 * @see org.jaffre.Logger#isDebugEnabled()
	 */
	@Override
	public boolean isDebugEnabled()
	{
		return _delegate().isDebugEnabled();
	}

	/*
	 * @see org.jaffre.Logger#debug(java.lang.String)
	 */
	@Override
	public void debug(String p_strMessage)
	{
		_delegate().debug(p_strMessage);
	}

	/*
	 * @see org.jaffre.Logger#debug(java.lang.String, java.lang.Throwable)
	 */
	@Override
	public void debug(String p_strMessage, Throwable p_e)
	{
		_delegate().debug(p_strMessage, p_e);
	}

	/*
	 * @see org.jaffre.Logger#isTraceEnabled()
	 */
	@Override
	public boolean isTraceEnabled()
	{
		return _delegate().isTraceEnabled();
	}

	/*
	 * @see org.jaffre.Logger#trace(java.lang.String)
	 */
	@Override
	public void trace(String p_strMessage)
	{
		_delegate().trace(p_strMessage);
	}

	/*
	 * @see org.jaffre.Logger#trace(java.lang.String, java.lang.Throwable)
	 */
	@Override
	public void trace(String p_strMessage, Throwable p_e)
	{
		_delegate().trace(p_strMessage, p_e);
	}
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * @file
 *
 * Unfortunately, we need this because we can not change the Duration.hpp and Time.hpp
 * and we don't want this piece of code repeated in every function within their
 * implementation files.
 */

#ifndef ORG_OPENSPLICE_CORE_TIME_UTILS_HPP_
#define ORG_OPENSPLICE_CORE_TIME_UTILS_HPP_

#include <dds/core/Time.hpp>
#include <dds/core/Duration.hpp>
#include <org/opensplice/core/ReportUtils.hpp>

namespace org
{
namespace opensplice
{
namespace core
{
namespace timeUtils
{

os_timeW
convertTime(
    const dds::core::Time& time,
    os_int64 maxSupportedSeconds);

os_duration
convertDuration(
    const dds::core::Duration& duration);

}
}
}
}

#endif /* ORG_OPENSPLICE_CORE_TIME_HELPER_HPP_ */


text:
androidunittest
===============

Try and learn unit-test on android.
Use Android Studio.
Common test like TestCase, InstrumentTest etc.


text:
import uuid from 'node-uuid'

import Base from './Base'
import Blueprint from './Blueprint'

export default Base.extend({
  tableName: 'access_tokens',

  idAttribute: 'token',

  blueprint() {
    return this.belongsTo(Blueprint)
  },

  initialize() {
    this.on('creating', this.generateToken, this)
  },

  generateToken: function(model, attrs, options) {
    model.set('token', uuid.v4())
    return Promise.resolve(model)
  }
})


text:
package com.nucleus.vecmath;

/**
 * Definition of an axis aligned grid (quad) using a position, width/height and number of segments in x and y
 * This class can be serialized using GSON
 *
 * @author Richard Sahlin
 *
 */
public class Grid extends Rectangle {

    public final static int INDEX_X_SEGMENTS = 4;
    public final static int INDEX_Y_SEGMENTS = 5;

    /**
     * Number of values for a rectangle x,y + width, height
     */
    private static final int ELEMENTS = 6;

    public Grid(float x, float y, float width, float height, int xSegments, int ySegments) {
        super(x, y, width, height);
    }

    @Override
    public int getElementCount() {
        return ELEMENTS;
    }

    /**
     * Returns the number of segments in X
     *
     * @return
     */
    public int getXSegments() {
        return (int) values[INDEX_X_SEGMENTS];
    }

    /**
     * Returns the number of segments in Y
     *
     * @return
     */
    public int getYSegments() {
        return (int) values[INDEX_Y_SEGMENTS];
    }

}


text:
[![Build Status](https://travis-ci.org/gasagna/ArraySlices.jl.svg?branch=master)](https://travis-ci.org/gasagna/ArraySlices.jl)

# ArraySlices.jl

This is a simple Julia package that enables looping over slices of an array in a natural way. Here is a demo:

```julia
using ArraySlices

# have some array
x = randn(10, 50)

# loop over the columns
for col in columns(x)
  # do some work
  do_some_work_on_col(col)
end
```

## Installation

This package is not registered, hence installation follows the general procedure for Julia code on a git repository:
```julia
Pkg.clone("https://github.com/gasagna/ArraySlices.jl.git")
```

## Api description
There is no documentation yet, and probably never will be, as the api is very simple. This main function exported by this module is `slices`. For a given array `x`, `slices(x, Val{i})` returns a `SlicesIterator` object, to loop over the slices of `x` along dimension `i`. For instance:

```julia
x = randn(2, 3, 4)
for sl in slices(x, Val{1})
  # the sl are 3x4 SubArrays
end
```

or

```julia
x = randn(2, 3, 4)
for sl in slices(x, Val{2})
  # the sl are 2x4 SubArrays
end
```
and so on.

Two convenience functions, `columns` and `rows`, are also provided to loop over the columns and rows of two dimensional arrays.

```julia
# some data
X = [1 1;
     2 2]

for col in columns(X)
  # col is equal to the array [1, 2]
end

for (i, row) in enumerate(rows(X))
  # row is equal to the array i*[1, 1]
end
```

## Why did you do this?
I created this package because I frequently have to map functions working
in-place over some input and output data organised into arrays. For instance,
in the example below, the function `J!` maps vectors to matrices,
(e.g. the jacobian of a vector function). This package can be used to apply `J!`
to each column of `X`, storing the output in the corresponding slices of
the preallocated `Y` array.

```julia
# map a 1-dimension array to a 2-dimension array
J!{T}(y::AbstractArray{T, 2}, x::AbstractArray{T, 1}) = # blah blah

# input data, i.e. fifty vectors of length 10
X = randn(10, 50)

# output is preallocated, fifty 10x10 matrices
Y = Array{Float64}(10, 10, 50)

# apply J! to each slice - (uses foreach, available in v0.5 only)
foreach(J!, slices(Y, Val{3}), slices(X, Val{2}))
```

## Caveat
This package currently only works with `Julia` version 0.5 or lower.


text:
<?xml version="1.0" encoding="UTF-8"?>
<alvisnlp-doc author="" beta="true" date=""
	short-target="SetFeature"
	target="fr.inra.maiage.bibliome.alvisnlp.bibliomefactory.modules.SetFeature">
	<synopsis>

Set the value of a feature for a selection of elements.

	</synopsis>

	<module-doc>
		<description>

<this/> evaluates <param>target</param> as a list of elements. For each element <this/> set value of <param>featureName</param> to <param>featureValue</param>.

<this/> is useful to build plans that select a particular feature to process.

		</description>

		<param-doc mandatory="required" name="featureName"
			name-type="feature" short-type="String" type="java.lang.String">

UNDOCUMENTED

		</param-doc>

		<param-doc mandatory="required" name="target"
			short-type="Expression"
			type="fr.inra.maiage.bibliome.alvisnlp.core.corpus.expressions.Expression">

UNDOCUMENTED

		</param-doc>

		<param-doc mandatory="required" name="featureValue"
			short-type="String" type="java.lang.String">

UNDOCUMENTED

		</param-doc>

        <include-doc>fr.inra.maiage.bibliome.alvisnlp.bibliomefactory.modules.CorpusModuleParamsDoc</include-doc>
	</module-doc>
</alvisnlp-doc>


text:
package org.apache.deltaspike.test.jpa.api.transactional.nested;

import org.apache.deltaspike.jpa.api.transaction.Transactional;
import org.apache.deltaspike.test.jpa.api.shared.First;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.persistence.EntityManager;

@ApplicationScoped
public class NestedTransactionBean
{
    @Inject
    private @First EntityManager firstEntityManager;

    @Transactional
    public void executeInTransaction()
    {
    }
}


text:
namespace google {
namespace protobuf {
namespace compiler {
namespace objectivec {

// Get/Set the path to a file to load for objc class prefix lookups.
std::string PROTOC_EXPORT GetPackageToPrefixMappingsPath();
void PROTOC_EXPORT SetPackageToPrefixMappingsPath(
    const std::string& file_path);
// Get/Set if the proto package should be used to make the default prefix for
// symbols. This will then impact most of the type naming apis below. It is done
// as a global to not break any other generator reusing the methods since they
// are exported.
bool PROTOC_EXPORT UseProtoPackageAsDefaultPrefix();
void PROTOC_EXPORT SetUseProtoPackageAsDefaultPrefix(bool on_or_off);
// Get/Set the path to a file to load as exceptions when
// `UseProtoPackageAsDefaultPrefix()` is `true`. An empty string means there
// should be no exceptions.
std::string PROTOC_EXPORT GetProtoPackagePrefixExceptionList();
void PROTOC_EXPORT SetProtoPackagePrefixExceptionList(
    const std::string& file_path);

// Generator Prefix Validation Options (see objectivec_generator.cc for a
// description of each):
struct Options {
  Options();
  std::string expected_prefixes_path;
  std::vector<std::string> expected_prefixes_suppressions;
  bool prefixes_must_be_registered;
  bool require_prefixes;
};

// Escape C++ trigraphs by escaping question marks to "\?".
std::string PROTOC_EXPORT EscapeTrigraphs(const std::string& to_escape);

// Remove white space from either end of a StringPiece.
void PROTOC_EXPORT TrimWhitespace(StringPiece* input);

// Returns true if the name requires a ns_returns_not_retained attribute applied
// to it.
bool PROTOC_EXPORT IsRetainedName(const std::string& name);

// Returns true if the name starts with "init" and will need to have special
// handling under ARC.
bool PROTOC_EXPORT IsInitName(const std::string& name);

// Gets the objc_class_prefix or the prefix made from the proto package.
std::string PROTOC_EXPORT FileClassPrefix(const FileDescriptor* file);

// Gets the path of the file we're going to generate (sans the .pb.h
// extension).  The path will be dependent on the objectivec package
// declared in the proto package.
std::string PROTOC_EXPORT FilePath(const FileDescriptor* file);

// Just like FilePath(), but without the directory part.
std::string PROTOC_EXPORT FilePathBasename(const FileDescriptor* file);

// Gets the name of the root class we'll generate in the file.  This class
// is not meant for external consumption, but instead contains helpers that
// the rest of the classes need
std::string PROTOC_EXPORT FileClassName(const FileDescriptor* file);

// These return the fully-qualified class name corresponding to the given
// descriptor.
std::string PROTOC_EXPORT ClassName(const Descriptor* descriptor);
std::string PROTOC_EXPORT ClassName(const Descriptor* descriptor,
                                    std::string* out_suffix_added);
std::string PROTOC_EXPORT EnumName(const EnumDescriptor* descriptor);

// Returns the fully-qualified name of the enum value corresponding to the
// the descriptor.
std::string PROTOC_EXPORT EnumValueName(const EnumValueDescriptor* descriptor);

// Returns the name of the enum value corresponding to the descriptor.
std::string PROTOC_EXPORT EnumValueShortName(const EnumValueDescriptor* descriptor);

// Reverse what an enum does.
std::string PROTOC_EXPORT UnCamelCaseEnumShortName(const std::string& name);

// Returns the name to use for the extension (used as the method off the file's
// Root class).
std::string PROTOC_EXPORT ExtensionMethodName(const FieldDescriptor* descriptor);

// Returns the transformed field name.
std::string PROTOC_EXPORT FieldName(const FieldDescriptor* field);
std::string PROTOC_EXPORT FieldNameCapitalized(const FieldDescriptor* field);

// Returns the transformed oneof name.
std::string PROTOC_EXPORT OneofEnumName(const OneofDescriptor* descriptor);
std::string PROTOC_EXPORT OneofName(const OneofDescriptor* descriptor);
std::string PROTOC_EXPORT OneofNameCapitalized(const OneofDescriptor* descriptor);

// Returns a symbol that can be used in C code to refer to an Objective C
// class without initializing the class.
std::string PROTOC_EXPORT ObjCClass(const std::string& class_name);

// Declares an Objective C class without initializing the class so that it can
// be refrerred to by ObjCClass.
std::string PROTOC_EXPORT ObjCClassDeclaration(const std::string& class_name);

inline bool HasPreservingUnknownEnumSemantics(const FileDescriptor* file) {
  return file->syntax() == FileDescriptor::SYNTAX_PROTO3;
}

inline bool IsMapEntryMessage(const Descriptor* descriptor) {
  return descriptor->options().map_entry();
}

// Reverse of the above.
std::string PROTOC_EXPORT UnCamelCaseFieldName(const std::string& name,
                                               const FieldDescriptor* field);

enum ObjectiveCType {
  OBJECTIVECTYPE_INT32,
  OBJECTIVECTYPE_UINT32,
  OBJECTIVECTYPE_INT64,
  OBJECTIVECTYPE_UINT64,
  OBJECTIVECTYPE_FLOAT,
  OBJECTIVECTYPE_DOUBLE,
  OBJECTIVECTYPE_BOOLEAN,
  OBJECTIVECTYPE_STRING,
  OBJECTIVECTYPE_DATA,
  OBJECTIVECTYPE_ENUM,
  OBJECTIVECTYPE_MESSAGE
};

enum FlagType {
  FLAGTYPE_DESCRIPTOR_INITIALIZATION,
  FLAGTYPE_EXTENSION,
  FLAGTYPE_FIELD
};

template <class TDescriptor>
std::string GetOptionalDeprecatedAttribute(const TDescriptor* descriptor,
                                           const FileDescriptor* file = NULL,
                                           bool preSpace = true,
                                           bool postNewline = false) {
  bool isDeprecated = descriptor->options().deprecated();
  // The file is only passed when checking Messages & Enums, so those types
  // get tagged. At the moment, it doesn't seem to make sense to tag every
  // field or enum value with when the file is deprecated.
  bool isFileLevelDeprecation = false;
  if (!isDeprecated && file) {
    isFileLevelDeprecation = file->options().deprecated();
    isDeprecated = isFileLevelDeprecation;
  }
  if (isDeprecated) {
    std::string message;
    const FileDescriptor* sourceFile = descriptor->file();
    if (isFileLevelDeprecation) {
      message = sourceFile->name() + " is deprecated.";
    } else {
      message = descriptor->full_name() + " is deprecated (see " +
                sourceFile->name() + ").";
    }

    std::string result = std::string("GPB_DEPRECATED_MSG(\"") + message + "\")";
    if (preSpace) {
      result.insert(0, " ");
    }
    if (postNewline) {
      result.append("\n");
    }
    return result;
  } else {
    return "";
  }
}

std::string PROTOC_EXPORT GetCapitalizedType(const FieldDescriptor* field);

ObjectiveCType PROTOC_EXPORT
GetObjectiveCType(FieldDescriptor::Type field_type);

inline ObjectiveCType GetObjectiveCType(const FieldDescriptor* field) {
  return GetObjectiveCType(field->type());
}

bool PROTOC_EXPORT IsPrimitiveType(const FieldDescriptor* field);
bool PROTOC_EXPORT IsReferenceType(const FieldDescriptor* field);

std::string PROTOC_EXPORT
GPBGenericValueFieldName(const FieldDescriptor* field);
std::string PROTOC_EXPORT DefaultValue(const FieldDescriptor* field);
bool PROTOC_EXPORT HasNonZeroDefaultValue(const FieldDescriptor* field);

std::string PROTOC_EXPORT
BuildFlagsString(const FlagType type, const std::vector<std::string>& strings);

// Builds HeaderDoc/appledoc style comments out of the comments in the .proto
// file.
std::string PROTOC_EXPORT BuildCommentsString(const SourceLocation& location,
                                              bool prefer_single_line);

// The name the commonly used by the library when built as a framework.
// This lines up to the name used in the CocoaPod.
extern PROTOC_EXPORT const char* const ProtobufLibraryFrameworkName;
// Returns the CPP symbol name to use as the gate for framework style imports
// for the given framework name to use.
std::string PROTOC_EXPORT
ProtobufFrameworkImportSymbol(const std::string& framework_name);

// Checks if the file is one of the proto's bundled with the library.
bool PROTOC_EXPORT
IsProtobufLibraryBundledProtoFile(const FileDescriptor* file);

// Checks the prefix for the given files and outputs any warnings as needed. If
// there are flat out errors, then out_error is filled in with the first error
// and the result is false.
bool PROTOC_EXPORT ValidateObjCClassPrefixes(
    const std::vector<const FileDescriptor*>& files,
    const Options& validation_options, std::string* out_error);
// Same was the other ValidateObjCClassPrefixes() calls, but the options all
// come from the environment variables.
bool PROTOC_EXPORT ValidateObjCClassPrefixes(
    const std::vector<const FileDescriptor*>& files, std::string* out_error);

// Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform
// the input into the expected output.
class PROTOC_EXPORT TextFormatDecodeData {
 public:
  TextFormatDecodeData();
  ~TextFormatDecodeData();

  TextFormatDecodeData(const TextFormatDecodeData&) = delete;
  TextFormatDecodeData& operator=(const TextFormatDecodeData&) = delete;

  void AddString(int32_t key, const std::string& input_for_decode,
                 const std::string& desired_output);
  size_t num_entries() const { return entries_.size(); }
  std::string Data() const;

  static std::string DecodeDataForString(const std::string& input_for_decode,
                                         const std::string& desired_output);

 private:
  typedef std::pair<int32_t, std::string> DataEntry;
  std::vector<DataEntry> entries_;
};

// Helper for parsing simple files.
class PROTOC_EXPORT LineConsumer {
 public:
  LineConsumer();
  virtual ~LineConsumer();
  virtual bool ConsumeLine(const StringPiece& line, std::string* out_error) = 0;
};

bool PROTOC_EXPORT ParseSimpleFile(const std::string& path,
                                   LineConsumer* line_consumer,
                                   std::string* out_error);

bool PROTOC_EXPORT ParseSimpleStream(io::ZeroCopyInputStream& input_stream,
                                     const std::string& stream_name,
                                     LineConsumer* line_consumer,
                                     std::string* out_error);

// Helper class for parsing framework import mappings and generating
// import statements.
class PROTOC_EXPORT ImportWriter {
 public:
  ImportWriter(const std::string& generate_for_named_framework,
               const std::string& named_framework_to_proto_path_mappings_path,
               const std::string& runtime_import_prefix,
               bool include_wkt_imports);
  ~ImportWriter();

  void AddFile(const FileDescriptor* file, const std::string& header_extension);
  void Print(io::Printer* printer) const;

  static void PrintRuntimeImports(io::Printer* printer,
                                  const std::vector<std::string>& header_to_import,
                                  const std::string& runtime_import_prefix,
                                  bool default_cpp_symbol = false);

 private:
  class ProtoFrameworkCollector : public LineConsumer {
   public:
    ProtoFrameworkCollector(std::map<std::string, std::string>* inout_proto_file_to_framework_name)
        : map_(inout_proto_file_to_framework_name) {}

    virtual bool ConsumeLine(const StringPiece& line, std::string* out_error) override;

   private:
    std::map<std::string, std::string>* map_;
  };

  void ParseFrameworkMappings();

  const std::string generate_for_named_framework_;
  const std::string named_framework_to_proto_path_mappings_path_;
  const std::string runtime_import_prefix_;
  const bool include_wkt_imports_;
  std::map<std::string, std::string> proto_file_to_framework_name_;
  bool need_to_parse_mapping_file_;

  std::vector<std::string> protobuf_imports_;
  std::vector<std::string> other_framework_imports_;
  std::vector<std::string> other_imports_;
};

}  // namespace objectivec
}  // namespace compiler
}  // namespace protobuf
}  // namespace google

#include <google/protobuf/port_undef.inc>

#endif  // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__


text:
package org.knowm.xchange.ripple.dto.trade;

import org.knowm.xchange.ripple.dto.RippleAmount;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonPropertyOrder({"type", "taker_pays", "taker_gets"})
public class RippleOrderEntryRequestBody {

  @JsonProperty("type")
  private String type;
  @JsonProperty("taker_pays")
  private RippleAmount takerPays = new RippleAmount();
  @JsonProperty("taker_gets")
  private RippleAmount takerGets = new RippleAmount();

  public String getType() {
    return type;
  }

  public void setType(final String value) {
    type = value;
  }

  public RippleAmount getTakerPays() {
    return takerPays;
  }

  public void setTakerPays(final RippleAmount value) {
    takerPays = value;
  }

  public RippleAmount getTakerGets() {
    return takerGets;
  }

  public void setTakerGetsTotal(final RippleAmount value) {
    takerGets = value;
  }

  @Override
  public String toString() {
    return String.format("%s [type=%s, taker_pays=%s, taker_gets=%s]", getClass().getSimpleName(), type, takerPays, takerGets);
  }
}


text:
export function getDefaultProps() {
  return {
    AJAXSpinnerClasses:            'ajax-spinner',
    AJAXSpinnerComponentFactory:   undefined,
    AJAXSpinnerComponentProps:     {},
    AJAXSpinnerListItemClasses:    '',
    async:                         undefined,
    closeIconFactory:              React.createFactory('em'),
    closeIconClass:                '',
    debounceTimeout:               500,
    defaultGroupKey:               'default',
    groups:                        { default: { label: '', nodes: [] } },
    infiniteScrolling:             false,
    initialValue:                  [],
    inputWrapperClass:             '',
    isSubmitAsync:                 true,
    manualAJAXPrompt:              'Load more options',
    multiple:                      false,
    noMoreOptionsNotice:           'No more options available',
    noMoreOptionsListItemClasses:  '',
    onChange:                      function() { this.onChange(); },
    options:                       [],
    optionsListItemClass:          'list-item',
    pageSize:                      10,
    placeholder:                   'Please select from the dropdown or type to filter',
    rootParentId:                  'root',
    selectElementClass:            'hidden',
    selectElementName:             '',
    selectionFormatter:            this.selectionFormatter,
    selectOptionsListWrapperClass: '',
    shouldLogErrors:               false,
    smartScroll:                   false,
    spinnerImgPath:                '/images/loader.gif',
    submitMethod:                  'POST',
    submitPassword:                undefined,
    submitSelection:               this.submitSelection,
    submitUrl:                     'http://localhost:3000',
    submitUser:                    undefined,
    wrapperClass:                  ''
  };
}

export default getDefaultProps()


text:
{% load mote_tags i18n %}
{% with element.json.data.ArticleList as "article" %}

{% trans "Next up in [category]:" %}

{{article.hero.title}}

{{article.hero.subtitle}}

{% trans "Recommended:" %}

{{article.list_hero.title}}

 {{article.list_hero.subtitle}}

      {% for list_grid in  article.list_subHero %}

{{list_grid.title}}

 {{list_grid.subtitle}}

      {% endfor %}
      {% for list in  article.list %}

{{list.title}}

 {{list.subtitle}}

    {% endfor %}

{% endwith %}


text:
package com.staples_sparx.sequoia;

public interface DoubleCondition<C> {
    int childOffset(double cutPoint, int feature, C features);
}


text:
<?xml version="1.0" encoding="utf-8"?>
<alpha
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:interpolator="@android:anim/linear_interpolator"
	android:fromAlpha="0.0"
	android:toAlpha="1.0"
	android:startOffset="0"
	android:duration="250"
	android:fillBefore="false"
	android:fillAfter="true" />


text:
using AspectCore.DynamicProxy;
using System;
using System.Threading.Tasks;
using SmartSql;
using System.Data;
using SmartSql.Exceptions;

namespace SmartSql.AOP
{
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class TransactionAttribute : AbstractInterceptorAttribute
    {
        public string Alias { get; set; } = Consts.DEFAULT_SMARTSQL_CONFIG_PATH;
        public IsolationLevel Level { get; set; } = IsolationLevel.Unspecified;
        public async override Task Invoke(AspectContext context, AspectDelegate next)
        {
            var transaction = MapperContainer.Instance.GetSqlMapperByAlias(Alias);
            try
            {
                transaction.BeginTransaction();
                await next.Invoke(context);
                transaction.CommitTransaction();
            }
            catch (Exception ex)
            {
                transaction.RollbackTransaction();
                throw ex;
            }
        }
    }
}


text:
We are aware of the following projects that do similar things to octocatalog-diff:

- [Puppet's catalog_preview Puppet module](https://forge.puppet.com/puppetlabs/catalog_preview)

  Installs as a module into your Puppet codebase and helps with migration from older Puppet versions to newer ones, or from open source Puppet to Puppet Enterprise. Also provides the ability to compare environments (branches). Requires a full working Puppet installation.

- [Zack Smith's catalog_diff Puppet module](https://forge.puppet.com/zack/catalog_diff)

  Installs as a module into your Puppet codebase, allowing you to diff catalogs created by different versions of Puppet. Requires a full working Puppet installation.

- [camptocamp's puppet-catalog-diff-viewer](https://github.com/camptocamp/puppet-catalog-diff-viewer)

  A viewer for JSON reports produced by the catalog_diff Puppet module.

`octocatalog-diff` differs from the above projects by running on a system without a fully configured Puppet installation (such as a developer workstation or CI server). This approach allows developers to run it without having access to the production Puppet servers, and it does not put any load on production Puppet masters when it compiles and compares catalogs.


text:
Object::Object() {

}

Object::~Object() {
  vertices.clear();
  indices.clear();
}

bool Object::Init(const std::string& filename) {
  if (!LoadVerticiesFromFile(filename)) {
    printf("Error loading file\n");
    return false;
  }

  glGenBuffers(1, &VBO);
  glBindBuffer(GL_ARRAY_BUFFER, VBO);
  glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex) * vertices.size(), &vertices[0], GL_STATIC_DRAW);

  glGenBuffers(1, &IBO);
  glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBO);
  glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned int) * indices.size(), &indices[0], GL_STATIC_DRAW);
  return true;
}

bool Object::LoadVerticiesFromFile(const std::string& filename) {
  //declare incoming variables stuff
  Assimp::Importer importer;
  const aiScene* aiScene = importer.ReadFile(filename, aiProcess_Triangulate);
  if (aiScene == NULL) {
    std::cerr << "File contents had problmes but was successfully opened." << std::endl;
    return false;
  }

    // iterate through the meshes and go through
  for(unsigned int meshIndex = 0; meshIndex < aiScene->mNumMeshes; meshIndex++) {
    int numFacesInMesh = aiScene->mMeshes[meshIndex]->mNumFaces;
    //iterate through faces
    for(int faceIndex = 0; faceIndex < numFacesInMesh; faceIndex++) {
      //helper
      Vertex tempVert(glm::vec3(0.0), glm::vec3(0.0));

      //get val from faces' mIndeces array
      for(int i = 0; i < 3; i++) {
        //go to aiMesh's mVertices Array
        int vertexIndex = aiScene->mMeshes[meshIndex]->mFaces[faceIndex].mIndices[i];

        //get position
        for (int j = 0; j < 3; j++) {
          tempVert.position[j] = aiScene->mMeshes[meshIndex]->mVertices[vertexIndex][j];
          tempVert.color[j]=  float(rand()%100) / 100.0f;
        }

        //add to the final vec
        vertices.push_back(tempVert);
        indices.push_back(vertexIndex);
      }
    }
  }
  return true;
}

void Object::Update(unsigned int dt) {
  // angle += dt * M_PI/1000;
  // model = glm::rotate(glm::mat4(1.0f), (angle), glm::vec3(0.0, 1.0, 0.0));
}

glm::mat4 Object::GetModel() {
  return model;
}

void Object::Render() {
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);

  glBindBuffer(GL_ARRAY_BUFFER, VBO);
  glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), 0);
  glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex,color));

  glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBO);

  glDrawElements(GL_TRIANGLES, indices.size(), GL_UNSIGNED_INT, 0);

  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
}


text:
TypeStruct::TypeStruct( TypeVariant* parent ):
    TypeVariantStruct( parent ),
    m_Flags( FLAG_ACTION_ALL )
{
    // void
}

TypeStruct::~TypeStruct()
{
    Clear();
}

TypeRecord* TypeStruct::ParentRecord()
{
    return TypeVariantPtr<TypeRecord>( this->Parent() );
}

TypeStruct* TypeStruct::ParentStruct()
{
    TypeRecord* parent_record = this->ParentRecord();

    if( parent_record != 0 )
        return parent_record->ParentStruct();

    return 0;
}

TypeRecord* TypeStruct::NewRecord( TypeStateWriter& state, iterator position )
{
    TypeRecord*           record = 0;
    QString               class_name = state.Data().at( 3 );
    TypeRecordFactory*    record_factory = TypeController::FactoryFromName( class_name );

    if( record_factory != 0 )
    {
        record = record_factory->NewInstance( state, 0 );
        Insert( position, *record );
    }

    return record;
}

TypeRecord* TypeStruct::NewRecord( TypeStateWriter& state, int position )
{
    TypeRecord*           record = 0;
    QString               class_name = state.Data()[3];
    TypeRecordFactory*    record_factory = TypeController::FactoryFromName( class_name );

    if( record_factory != 0 )
    {
        record = record_factory->NewInstance( state, 0 );

        if( position >= 0 )
            Insert( position, *record );
        else
            Append( *record );
    }

    return record;
}

TypeRecord* TypeStruct::NewRecord( QString name, QString value, QString class_name, int position )
{
    TypeRecord* record = 0;
    TypeRecordFactory* record_factory = TypeController::FactoryFromName( class_name );

    if( record_factory != 0 )
    {
        record = record_factory->NewInstance( name, value, 0 );

        if( position >= 0 )
            Insert( position, *record );
        else
            Append( *record );
    }

    return record;
}

TypeRecord* TypeStruct::NewRecord( QString name, QString value, QString class_name, iterator position )
{
    TypeRecord* record = 0;
    TypeRecordFactory* record_factory = TypeController::FactoryFromName( class_name );

    if( record_factory != 0 )
    {
        record = record_factory->NewInstance( name, value, 0 );
        Insert( position, *record );
    }

    return record;
}

int TypeStruct::GetIndex( TypeRecord* record_value ) const
{
    int count = 0;

    for( TypeVariantPtr<TypeRecord> record : *this )
    {
        if( record == record_value )
            return count;

        ++count;
    }

    return -1;
}

TypeRecord* TypeStruct::FromIndex( int index ) const
{
    auto iter = begin();

    for( int count = 0; count < index; ++count )
        ++iter;

    return static_cast<TypeRecord*>( *iter );
}

TypeRecord* TypeStruct::FromId( QString record_id , bool deep ) const
{
    for( TypeVariantPtr<TypeRecord> record : *this )
    {
        if( record->Id() == record_id )
            return record;

        if( deep )
        {
            auto record_struct = record->Struct();

            if( record_struct != 0 )
            {
                record = record_struct->FromId( record_id, deep );

                if( record != 0 )
                    return record;
            }
        }
    }

    return 0;
}

TypeRecord* TypeStruct::FromName( QString record_name, bool deep ) const
{
    if( !deep )
    {
        for( TypeVariantPtr<TypeRecord> record : *this )
        {
            if( record_name == record->Name() )
                return record;
        }

        return 0;
    }

    QStringList token_sequence = record_name.split( "_" );
    const QString token_end = token_sequence.back();
    token_sequence.pop_back();
    TypeRecord* record = 0;
    const TypeStruct* record_struct = this;

    for( QString token : token_sequence )
    {
        record = record_struct->FromName( token, false );

        if( record == 0 )
            return 0;

        record_struct = record->Struct();

        if( record_struct == 0 )
            return 0;
    }

    return record_struct->FromName( token_end, false );
}


text:
/************************************************************************
*
* Flood Project © (2008-201x)
* Licensed under the simplified BSD license. All rights reserved.
*
************************************************************************/

#pragma once

#include "CppSharp.h"
#include <Core/Network/Network.h>

namespace Flood
{
    ref class Allocator;
}

namespace Flood
{
    public ref class Network
    {
    public:
        static bool NetworkInitialize();
        static void NetworkDeinitialize();
        static Flood::Allocator^ AllocatorGetNetwork();
    };
}


text:
<?xml version="1.0" encoding="utf-8"?>

<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0">
  <DefaultLanguage xmlns="" code="en-US"/>
  <App xmlns="" ProductID="{d0d69f17-adb3-4ade-937b-7fd39433d6bd}" Title="ViewGalleryType.WinPhone" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal"  Author="ViewGalleryType.WinPhone author" Description="Sample description" Publisher="ViewGalleryType.WinPhone" PublisherID="{ece209bc-e25b-415a-ab1d-28edbf4bba98}">
    <IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath>
    <Capabilities>
      <Capability Name="ID_CAP_NETWORKING"/>
      <Capability Name="ID_CAP_MEDIALIB_AUDIO"/>
      <Capability Name="ID_CAP_MEDIALIB_PLAYBACK"/>
      <Capability Name="ID_CAP_SENSORS"/>
      <Capability Name="ID_CAP_WEBBROWSERCOMPONENT"/>
    </Capabilities>
    <Tasks>
      <DefaultTask  Name ="_default" NavigationPage="MainPage.xaml"/>
    </Tasks>
    <Tokens>
      <PrimaryToken TokenID="PhoneApp1Token" TaskName="_default">
        <TemplateFlip>
          <SmallImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileSmall.png</SmallImageURI>
          <Count>0</Count>
          <BackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileMedium.png</BackgroundImageURI>
          <Title>ViewGalleryType.WinPhone</Title>
          <BackContent></BackContent>
          <BackBackgroundImageURI></BackBackgroundImageURI>
          <BackTitle></BackTitle>
          <DeviceLockImageURI></DeviceLockImageURI>
          <HasLarge></HasLarge>
        </TemplateFlip>
      </PrimaryToken>
    </Tokens>
    <ScreenResolutions>
      <ScreenResolution Name="ID_RESOLUTION_WVGA"/>
      <ScreenResolution Name="ID_RESOLUTION_WXGA"/>
      <ScreenResolution Name="ID_RESOLUTION_HD720P"/>
    </ScreenResolutions>
  </App>
</Deployment>


text:
package org.drools.eclipse.flow.ruleflow.editor;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.StringReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

import org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl;
import org.drools.core.xml.SemanticModules;
import org.drools.eclipse.DroolsEclipsePlugin;
import org.drools.eclipse.WorkItemDefinitions;
import org.drools.eclipse.flow.common.editor.GenericModelEditor;
import org.drools.eclipse.flow.ruleflow.core.RuleFlowProcessWrapper;
import org.drools.eclipse.flow.ruleflow.core.RuleFlowWrapperBuilder;
import org.drools.eclipse.flow.ruleflow.core.StartNodeWrapper;
import org.drools.eclipse.flow.ruleflow.core.WorkItemWrapper;
import org.drools.eclipse.flow.ruleflow.editor.editpart.RuleFlowEditPartFactory;
import org.drools.eclipse.util.ProjectClassLoader;
import org.eclipse.core.resources.IFile;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
import org.eclipse.gef.palette.PaletteDrawer;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.requests.SimpleFactory;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.jbpm.compiler.xml.ProcessSemanticModule;
import org.jbpm.compiler.xml.XmlProcessReader;
import org.jbpm.compiler.xml.XmlRuleFlowProcessDumper;
import org.jbpm.compiler.xml.processes.RuleFlowMigrator;
import org.jbpm.process.core.WorkDefinition;
import org.jbpm.process.core.WorkDefinitionExtension;
import org.jbpm.ruleflow.core.RuleFlowProcess;
import org.kie.api.definition.process.Process;

/**
 * Graphical editor for a RuleFlow.
 */
public class RuleFlowModelEditor extends GenericModelEditor {

    protected EditPartFactory createEditPartFactory() {
        RuleFlowEditPartFactory factory = new RuleFlowEditPartFactory();
        factory.setProject(getJavaProject());
        return factory;
    }

    protected PaletteRoot createPalette() {
        return RuleFlowPaletteFactory.createPalette();
    }

    protected Object createModel() {
        RuleFlowProcessWrapper result = new RuleFlowProcessWrapper();
        StartNodeWrapper start = new StartNodeWrapper();
        start.setConstraint(new Rectangle(100, 100, -1, -1));
        result.addElement(start);
        start.setParent(result);
        IFile file = ((IFileEditorInput)getEditorInput()).getFile();
        String name = file.getName();
        result.setName(name.substring(0, name.length() - 3));
        return result;
    }

    public RuleFlowProcessWrapper getRuleFlowModel() {
        return (RuleFlowProcessWrapper) getModel();
    }

    protected void setInput(IEditorInput input) {
        super.setInput(input);
        if (input instanceof IFileEditorInput) {
            refreshPalette(((IFileEditorInput) input).getFile());
        }
    }

    private void refreshPalette(IFile file) {
        if (getPaletteRoot().getChildren().size() <= 2) {
            // work items category not visible
            return;
        }
        IJavaProject javaProject = getJavaProject();
        if (javaProject != null) {
            try {
                ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
                ClassLoader newLoader = ProjectClassLoader.getProjectClassLoader(javaProject);
                try {
                    Thread.currentThread().setContextClassLoader(newLoader);
                    PaletteDrawer drawer = (PaletteDrawer) getPaletteRoot().getChildren().get(2);
                    List<CombinedTemplateCreationEntry> entries = new ArrayList<CombinedTemplateCreationEntry>();
                    try {
                        for (final WorkDefinition workDefinition: WorkItemDefinitions.getWorkDefinitions(file).values()) {
                            final String label;
                            String description = workDefinition.getName();
                            String icon = null;
                            if (workDefinition instanceof WorkDefinitionExtension) {
                                WorkDefinitionExtension extension = (WorkDefinitionExtension) workDefinition;
                                label = extension.getDisplayName();
                                description = extension.getExplanationText();
                                icon = extension.getIcon();
                            } else {
                                label = workDefinition.getName();
                            }

                            URL iconUrl = null;
                            if (icon != null) {
                                iconUrl = newLoader.getResource(icon);
                            }
                            if (iconUrl == null) {
                                iconUrl = DroolsEclipsePlugin.getDefault().getBundle().getEntry("icons/action.gif");
                            }
                            CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
                                label,
                                description,
                                WorkItemWrapper.class,
                                new SimpleFactory(WorkItemWrapper.class) {
                                    public Object getNewObject() {
                                        WorkItemWrapper workItemWrapper = (WorkItemWrapper) super.getNewObject();
                                        workItemWrapper.setName(label);
                                        workItemWrapper.setWorkDefinition(workDefinition);
                                        return workItemWrapper;
                                    }
                                },
                                ImageDescriptor.createFromURL(iconUrl),
                                ImageDescriptor.createFromURL(iconUrl)
                            );
                            entries.add(combined);
                        }
                    } catch (Throwable t) {
                        DroolsEclipsePlugin.log(t);
                        MessageDialog.openError(
                            getSite().getShell(), "Parsing work item definitions", t.getMessage());
                    }
                    drawer.setChildren(entries);
                } finally {
                    Thread.currentThread().setContextClassLoader(oldLoader);
                }
            } catch (Exception e) {
                DroolsEclipsePlugin.log(e);
            }
        }
    }

    protected void writeModel(OutputStream os) throws IOException {
        writeModel(os, true);
    }

    protected void writeModel(OutputStream os, boolean includeGraphics) throws IOException {
        OutputStreamWriter writer = new OutputStreamWriter(os);
        try {
            XmlRuleFlowProcessDumper dumper = XmlRuleFlowProcessDumper.INSTANCE;
            String out = dumper.dump(getRuleFlowModel().getRuleFlowProcess(), includeGraphics);
            writer.write(out);
        } catch (Throwable t) {
            DroolsEclipsePlugin.log(t);
        }
        writer.close();
    }

    protected void createModel(InputStream is) {
        try
        {
            InputStreamReader isr = new InputStreamReader(is);
            KnowledgeBuilderConfigurationImpl configuration = new KnowledgeBuilderConfigurationImpl();
            SemanticModules modules = configuration.getSemanticModules();
            modules.addSemanticModule(new ProcessSemanticModule());
            XmlProcessReader xmlReader = new XmlProcessReader( modules, Thread.currentThread().getContextClassLoader() );

            //Migrate v4 ruleflows to v5
            Reader reader = null;
            try
            {
                String xml = RuleFlowMigrator.convertReaderToString(isr);
                if (RuleFlowMigrator.needToMigrateRFM(xml))
                {
                    xml = RuleFlowMigrator.portRFToCurrentVersion(xml);
                    MessageDialog.openInformation(this.getSite().getShell(),
                            "Incompatible RuleFlow Version",
                            "WARNING! The selected RuleFlow is Drools version 4 format.\n\n" +
                            "Any changes made to this RuleFlow will be saved in Drools 5 format, which is " +
                            "not compatible with Drools 4. To convert this RuleFlow " +
                            "to Drools 5 format, select Save As from the File menu and overwrite this " +
                            "file - the new RuleFlow file will be saved in Drools 5 format.");
                }

                reader =  new StringReader(xml);

                List<Process> processes = xmlReader.read(reader);
                if (processes == null || processes.size() == 0) {
                    setModel(createModel());
                } else {
                    RuleFlowProcess process = (RuleFlowProcess) processes.get(0);
                    if (process == null) {
                        setModel(createModel());
                    } else {
                        setModel(new RuleFlowWrapperBuilder().getProcessWrapper(process, getJavaProject()));
                    }
                }
            } catch (Throwable t) {
                DroolsEclipsePlugin.log(t);
                MessageDialog.openError( getSite().getShell(),
                    "Could not read RuleFlow file",
                    "An exception occurred while reading in the RuleFlow XML: "
                        + t.getMessage() + " See the error log for more details.");
                setModel(createModel());
            }

            if (reader != null){
                reader.close();
            }
        } catch (Throwable t) {
            DroolsEclipsePlugin.log(t);
        }
    }
}


text:
#pragma once

#include "IPAllow.h"

#include "QUICApplication.h"

#include "HttpSessionAccept.h"

#include "Http3Types.h"
#include "Http3FrameDispatcher.h"
#include "Http3FrameCollector.h"
#include "Http3FrameGenerator.h"
#include "Http3FrameHandler.h"

class QUICNetVConnection;
class Http3Session;

/**
 * @brief A HTTP/3 application
 * @detail
 */
class Http3App : public QUICApplication
{
public:
  Http3App(QUICNetVConnection *client_vc, IpAllow::ACL &&session_acl, const HttpSessionAccept::Options &options);
  virtual ~Http3App();

  virtual void start();
  virtual int main_event_handler(int event, Event *data);

  // TODO: Return StreamIO. It looks bother that coller have to look up StreamIO by stream id.
  // Why not create_bidi_stream ?
  QUICConnectionErrorUPtr create_uni_stream(QUICStreamId &new_stream_id, Http3StreamType type);

protected:
  Http3Session *_ssn = nullptr;

private:
  void _handle_uni_stream_on_read_ready(int event, QUICStreamIO *stream_io);
  void _handle_uni_stream_on_write_ready(int event, QUICStreamIO *stream_io);
  void _handle_uni_stream_on_eos(int event, QUICStreamIO *stream_io);
  void _handle_bidi_stream_on_read_ready(int event, QUICStreamIO *stream_io);
  void _handle_bidi_stream_on_write_ready(int event, QUICStreamIO *stream_io);
  void _handle_bidi_stream_on_eos(int event, QUICStreamIO *stream_io);

  void _set_qpack_stream(Http3StreamType type, QUICStreamIO *stream_io);

  Http3FrameHandler *_settings_handler  = nullptr;
  Http3FrameGenerator *_settings_framer = nullptr;

  Http3FrameDispatcher _control_stream_dispatcher;
  Http3FrameCollector _control_stream_collector;

  QUICStreamIO *_remote_control_stream;
  QUICStreamIO *_local_control_stream;

  std::map<QUICStreamId, Http3StreamType> _remote_uni_stream_map;
  std::map<QUICStreamId, Http3StreamType> _local_uni_stream_map;
};

class Http3SettingsHandler : public Http3FrameHandler
{
public:
  Http3SettingsHandler(Http3Session *session) : _session(session){};

  // Http3FrameHandler
  std::vector<Http3FrameType> interests() override;
  Http3ErrorUPtr handle_frame(std::shared_ptr<const Http3Frame> frame) override;

private:
  // TODO: clarify Http3Session I/F for Http3SettingsHandler and Http3App
  Http3Session *_session = nullptr;
};

class Http3SettingsFramer : public Http3FrameGenerator
{
public:
  Http3SettingsFramer(NetVConnectionContext_t context) : _context(context){};

  // Http3FrameGenerator
  Http3FrameUPtr generate_frame(uint16_t max_size) override;
  bool is_done() const override;

private:
  NetVConnectionContext_t _context;
  bool _is_done = false; ///< Becarefull when set FIN flag on CONTROL stream. Maybe never?
  bool _is_sent = false; ///< Send SETTINGS frame only once
};


text:
import sys

DEPENDENCIES = ['numpy', 'scipy', 'nilearn', 'nibabel', 'pandas', 'patsy',
                'sklearn', 'matplotlib']

def print_package_version(package_name, indent='  '):
    try:
        package = __import__(package_name)
        version = getattr(package, '__version__', None)
        package_file = getattr(package, '__file__', )
        provenance_info = '{0} from {1}'.format(version, package_file)
    except ImportError:
        provenance_info = 'not installed'

    print('{0}{1}: {2}'.format(indent, package_name, provenance_info))

if __name__ == '__main__':
    print('=' * 120)
    print('Python %s' % str(sys.version))
    print('from: %s\n' % sys.executable)

    print('Dependencies versions')
    for package_name in DEPENDENCIES:
        print_package_version(package_name)
    print('=' * 120)


text:
//*****************************************************************************/
// Copyright (c) 1998-2005 Autodesk, Inc.
// All rights reserved.
//
// These coded instructions, statements, and computer programs contain
// unpublished proprietary information written by Autodesk, Inc., and are
// protected by Federal copyright law. They may not be disclosed to third
// parties or copied or duplicated in any form, in whole or in part, without
// the prior written consent of Autodesk, Inc.
//*****************************************************************************/

/**********************************************************************
 *<
	FILE: BrushPresets.h

	DESCRIPTION:	Brush Preset functionality for the PainterInterface

	CREATED BY:		Michaelson Britt

	HISTORY:		Created December 2004
 *>
 **********************************************************************/
#pragma once
#include "maxheap.h"
#include "maxtypes.h"
#include "ifnpub.h"
#include "GetCOREInterface.h"

// forward declarations
class IBrushPreset;
class IBrushPresetParams;
class IBrushPresetContext;
class IBrushPresetMgr;

//-----------------------------------------------------------------------------
// class IBrushPreset

//! \brief The interface to a brush preset object, holding parameters for the PainterInterface and other brush tools.
/*! The interface to Brush Preset objects.  A brush preset corresponds to a button on the
    brush preset toolbar, or a row listed in the brush preset manager dialog.
    A preset holds one set of parameters for each brush preset context registered with the manager.
    Applying or fetching a preset will apply or fetch parameters for each currently active context.
    The context and parameter objects are implemented by plug-ins, but the presets holding the
    parameter objects are implemented by the system. */
class IBrushPreset: public MaxHeapOperators {
	public:
		//! \brief Destructor
		virtual ~IBrushPreset() {;}

		//! \brief Returns an ID which uniquely identifies this preset.
		/*! Presets have an ID number unique from other presets at any given time; however
		   if a preset is deleted, its ID number may be reassigned to other presets created later. */
		virtual int			PresetID() = 0;

		//! \brief Applies parameters from the preset into the UI, as per activating its toolbar button.
		/*! For each active brush preset context, the corresponding set of parameters
		    held by the preset is applied via ApplyParams(). */
		virtual void		Apply() = 0;	// Calls ApplyParams() on every param set
		//! \brief Fetches parameters from the UI into the preset, as per deactivating its toolbar button.
		/*! For each active brush preset context, the corresponding set of parameters
		    held by the preset is fetched via FetchParams(). */
		virtual void		Fetch() = 0;	// Calls FetchParams() on every param set

		//! \brief Returns the parameter set held by the brush preset for a given context.
		/*! \param[in] contextID The ID of the context */
		virtual IBrushPresetParams* GetParams( Class_ID contextID ) = 0;
		//! \brief Returns the number of contexts for which this preset is holding parameters.
		virtual int			GetNumContexts() = 0;
		//! \brief Translates the index number of a parameter set into the corresponding context ID
		/*! \param[in] contextIndex The index of the parameter set
		    \return The context ID for the parameter set, or Class_ID(0,0) if the index is out of range */
		virtual Class_ID	GetContextID( int contextIndex ) = 0;
		//! \brief Translates the context ID for a parameter set into the corresponding index number
		/*! \param[in] contextID The ID of the context
		    \return The index of the parameter set, or -1 if the preset has no parameters for the given context */
		virtual int			GetContextIndex( Class_ID contextID ) = 0;
};

//-----------------------------------------------------------------------------
// class IBrushPresetParams

//! \brief Interface to a set of brush preset parameter values, associated with a particular Brush Preset context.
/*! Implemented by the plug-in. */
class IBrushPresetParams: public MaxHeapOperators  {
	public:
		//! \brief Destructor
		virtual ~IBrushPresetParams() {;}

		//! \brief Returns the ID of the brush preset context associated with this parameter set.
		virtual Class_ID	ContextID()=0; // The ID of the param set is equal to the ID of its context

		// The presets param object is expected to have access to its associated context.
		// These methods apply the params into the context, or fetch the param values from the context

		//! \brief Applies the values from the parameter set into the UI of the corresponding context.
		/*! The parameter object is assumed to be part of the same plug-in as its context object, and to have
		    knowledge of its state.  The parameter object should apply its values into the UI as appropriate. */
		virtual void		ApplyParams() = 0;
		//! \brief Fetches the values from the UI of the corresponding context into the parameter set.
		/*! The parameter object is assumed to be part of the same plug-in as its context object, and to have
		    knowledge of its state.  The parameter object should fetch its values from the UI as appropriate. */
		virtual void		FetchParams() = 0;

		// Use methods in the BrushPresetContext for metadata about the parameters.
		// Parameter values are stored here.

		//! \brief Returns the number of individual parameters in the parameter set.
		virtual int			GetNumParams() = 0;
		//! \brief Translates the index number of a parameter value into the corresponding parameter ID
		/*! \param[in] paramIndex The index of the parameter value
		    \return The parameter ID for the value, or zero if the index is out of range */
		virtual int			GetParamID( int paramIndex ) = 0;
		//! \brief Translates the ID of a parameter value into the corresponding parameter index number
		/*! \param[in] paramID The ID of the parameter value
		    \return The index of the parameter value, or -1 if there is no parameter with the given ID */
		virtual int			GetParamIndex( int paramID ) = 0;
		//! \brief Returns a parameter value by ID.
		/*! \param[in] paramID The ID of the parameter value
		   \return The value of the parameter */
		virtual FPValue		GetParamValue( int paramID ) = 0;
		//! \brief Sets a parameter value by ID.
		/*! \param[in] paramID The ID of the parameter value
		    \param[in] val The value to set */
		virtual void		SetParamValue( int paramID, FPValue val ) = 0;
		//! \brief Returns the value of a parameter as it should be displayed in the UI.
		/*! This is used to display values with a user-friendly format in the brush preset manager dialog.
		    For example, a minimum and maximum value of 0 and 100 might be displayed together as one entry
		    with the string value "0-100". In this case, the parameter set should return TYPE_VOID for the
		    minimum and maximum display values, but provide a third, display-only parameter, with the string value.
		    \param[in] paramID The ID of the parameter value
		    \return The value of the parameter to display in the UI */
		virtual FPValue		GetDisplayParamValue( int paramID )		{return GetParamValue(paramID);}

		//! \brief Informs the parameter set of the brush preset holding it.
		/*! This is called by the system when parameter sets are created, to make them aware of the
		    preset they are held by. No specific action is required by the parameter set.
		    \param[in] parent The brush preset parent which holds this parameter set. */
		virtual void		SetParent( IBrushPreset* parent ) = 0;
};

//-----------------------------------------------------------------------------
// class IBrushPresetContext

//! \brief The ID of the standard brush preset context, implemented by the system
/*! The standard context is responsible for the common values in the Painter Interface dialog,
    such as the brush radius and falloff.  This context is considered to be an active context
    anytime any other brush preset context is active.
    The standard parameters are listed in the first columns of the brush preset manager dialog,
    and the context-specific parameters are listed in the remaining columns */
#define STDBRUSHPRESETCONTEXT_ID	Class_ID(0,0x5fb1707c)

//! \brief Interface to a brush preset context.
/*! A context represents a specific brush-based feature, defining a set of parameters used by the features and a UI.
    Context objects are responsible for creating and deleting the parameter set objects held by a brush preset,
    and for providing general information about the parameters.
    Contexts are required to communicate with the manager in the following ways:
    1) Contexts should register themselves with the manager as soon as they loaded into memory,
    using IBrushPresetMgr::RegisterContext().  If the context plug-in is loaded before the manager plug-in,
    then the context can use a notification handler to register with the manager after system startup.
    2) When a context is active, meaning its UI is displayed and ready to begin painting, the context
    should call IBrushPresetMgr::BeginContext(), and EndContext() when the context is deactivated.
    3) When the user changes any parameter in the context's UI, the context should call IBrushPresetMgr::OnContextUpdated().
	\n
    Implemented by the plug-in. */
class IBrushPresetContext: public MaxHeapOperators {
	public:
		//! \brief Destructor
		virtual ~IBrushPresetContext() {;}

		//! \brief Returns the unique ID for the context. These ID numbers should be random, as per standard class IDs
		virtual Class_ID	ContextID() = 0;
		//! \brief Returns a name for the context.  This is for UI display and may be localized
		virtual const MCHAR*		GetContextName() = 0;

		//! \brief Creates and returns a parameter set object of appropriate type for this context.
		virtual IBrushPresetParams* CreateParams() = 0;
		//! \brief Deletes a parameter set object created by this context.
		/*! This is called by the system when the user deletes a preset or at shutdown;
		    the object passed is always a parameter set created previously by the context. */
		virtual void		DeleteParams( IBrushPresetParams* params ) = 0;

		//! \brief Returns the number of individual parameters in a parameter set of this context.
		virtual int			GetNumParams() = 0;
		//! \brief Translates the index number of a parameter value into the corresponding parameter ID
		/*! \param[in] paramIndex The index of the parameter value
		    \return The parameter ID for the value, or zero if the index is out of range */
		virtual int			GetParamID( int paramIndex ) = 0;
		//! \brief Translates the ID of a parameter value into the corresponding parameter index number
		/*! \param[in] paramID The ID of the parameter value
		    \return The index of the parameter value, or -1 if there is no parameter with the given ID */
		virtual int			GetParamIndex( int paramID ) = 0;
		//! \brief Returns the name of a parameter value
		/*! \param[in] paramID The ID of the parameter value */
		virtual const MCHAR*		GetParamName( int paramID ) = 0;
		//! \brief Returns the type of a parameter value
		/*! \param[in] paramID The ID of the parameter value */
		virtual ParamType2	GetParamType( int paramID ) = 0;

		//! \brief Returns the number of parameters that should be displayed in the brush preset manager dialog.
		virtual int			GetNumDisplayParams()					{return GetNumParams();}
		//! \brief Translates the index number of a display parameter into the corresponding parameter ID
		/*! \param[in] displayIndex The index of the display parameter
		    \return The parameter ID for the value, or zero if the index is out of range */
		virtual int			GetDisplayParamID( int displayIndex )	{return GetParamID(displayIndex);}
		//! \brief Translates the ID of a parameter value into the corresponding display parameter index number
		/*! \param[in] paramID The ID of the parameter value
		    \return The index of the parameter value, or -1 if there is no display parameter with the given ID */
		virtual int			GetDisplayParamIndex( int paramID )		{return GetParamIndex(paramID);}
		//! \brief Returns the name of a display parameter
		/*! \param[in] paramID The ID of the display parameter */
		virtual const MCHAR*		GetDisplayParamName( int paramID )		{return GetParamName(paramID);}

		//! \brief Returns whether the given parameter should be displayed in the brush preset manager dialog
		/*! \param[in] paramID The ID of the parameter
		    \return TRUE if the parameter should be displayed, FALSE otherwise */
		virtual BOOL		IsDisplayParam( int paramID )			{ UNUSED_PARAM(paramID); return TRUE;}
		//! \brief Returns whether the given parameter is transient
		/*! Transient parameters are not stored to disk.  This can be useful, for example, with
		    display-only parameters, whose value is a user-friendly string built from other non-display parameters.
		    \param[in] paramID The ID of the parameter
		    \return TRUE if the parameter is transient, FALSE otherwise */
		virtual BOOL		IsTransientParam( int paramID )			{ UNUSED_PARAM(paramID); return FALSE; }

		// Support for deferred plug-in loading

		//! \brief Returns the class ID of a plug-in implemented in the same module as this context.
		/*! The class ID is used to support deferred plug-in loading.  When the brush preset manager needs to
		    ensure that a context implementation is loaded into memory, it will load the module using this ID.
		    The manager calls this method when a context is first registered, and then stores the value
		    in the brush preset file for later use. */
		virtual Class_ID	PluginClassID()=0; // Class ID of the plug-in containing the context
		//! \brief Returns the superclass ID of a plug-in implemented in the same module as this context.
		/*! The superclass ID is used to support deferred plug-in loading.  When the brush preset manager needs to
		    ensure that a context implementation is loaded into memory, it will load the module using this ID.
		    The manager calls this method when a context is first registered, and then stores the value
		    in the brush preset file for later use. */
		virtual SClass_ID	PluginSuperClassID()=0; // Superclass ID of the plug-in containing the context
};

//-----------------------------------------------------------------------------
// class BrushPresetMgr

//! \brief Interface to the brush preset manager.
/*! The manager is a singleton object implemented by the system.
    It maintains the list of contexts and presets.
    It communicates with the contexts to track which is active, and when a context is updated.
    It tracks which preset is active in order to store parameters into the preset when contexts are updated.
    It has functionality to read and write brush preset files.
    Finally, the brush preset manager provides a maxscript interface to activate and deactivate presets. */
class IBrushPresetMgr : public FPStaticInterface {
	public:
		DECLARE_DESCRIPTOR( IBrushPresetMgr );

		//! \brief Registers a context with the manager.
		/*! Contexts should call this method at system startup,
		    or immediately when loaded into memory to support deferred loading.
		    \param[in] context The context to register */
		virtual void		RegisterContext( IBrushPresetContext* context ) = 0;
		//! \brief Unregisters a context with the manager.
		/*! Contexts may call this method if they are unloaded from memory, but it is not required during normal shutdown.
		    \param[in] context The context to unregister */
		virtual void		UnRegisterContext( IBrushPresetContext* context ) = 0;

		//! \brief Returns a context object from its ID.
		/*! This returns the context immediately if it is currently registered, otherwise it
		    loads the context plug-in if it is not in memory but supports deferred loading.
		    \param[in] contextID The ID of the context */
		virtual IBrushPresetContext* GetContext( Class_ID contextID ) = 0;
		//! \brief Returns the number of contexts.
		/*! This includes all currently registered contexts, plus contexts in deferred plug-ins which were
		    registered previously but are not yet loaded. */
		virtual int			GetNumContexts() = 0;
		//! \brief Translates the index number of a context into the corresponding context ID
		/*! \param[in] contextIndex The index of the context
		    \return The context ID, or Class_ID(0,0) if the index is out of range */
		virtual Class_ID	GetContextID( int contextIndex ) = 0; // ID numbers are always > 0
		//! \brief Translates the ID of a context into the corresponding context index number
		/*! \param[in] contextID The ID of the context
		    \return The index of the context, or -1 if no context exists with the given ID */
		virtual int			GetContextIndex( Class_ID contextID ) = 0;
		//! \brief Notifies the manager that a context is activated
		/*! This should be called by a context when its UI is opened and ready for painting
		    \param[in] contextID The ID of the context */
		virtual int			BeginContext( Class_ID contextID ) = 0;
		//! \brief Notifies the manager that a context is deactived
		/*! This should be called by a context when its UI is closed
		    \param[in] contextID The ID of the context */
		virtual int			EndContext( Class_ID contextID ) = 0;
		//! \brief Returns TRUE if the given context is active, FALSE otherwise
		/*! \param[in] contextID The ID of the context */
		virtual BOOL		IsContextActive( Class_ID contextID ) = 0;

		//! \brief Returns a brush preset object from its ID, or NULL if no preset exists with the given ID.
		/*! \param[in] presetID The ID of the preset */
		virtual IBrushPreset* GetPreset( int presetID ) = 0;
		//! \brief Creates a new preset, and adds a corresponding button to the brush preset toolbar.
		virtual IBrushPreset* CreatePreset() = 0;
		//! \brief Deletes a preset, removing the corresponding button from the brush preset toolbar.
		virtual void		DeletePreset( IBrushPreset* preset ) = 0;
		//! \brief Returns the current number of brush presets.
		virtual int			GetNumPresets() = 0;
		//! \brief Translates the index number of a brush preset into the corresponding preset ID
		/*! \param[in] presetIndex The index of the preset
		    \return The preset ID, or zero if the index is out of range */
		virtual int			GetPresetID( int presetIndex ) = 0;
		//! \brief Translates the ID of a brush preset into the corresponding preset index number
		/*! \param[in] presetID The ID of the preset
		    \return The index of the preset, or -1 if no preset exists with the given ID */
		virtual int			GetPresetIndex( int presetID ) = 0;

		//! \brief Returns the ID of the active preset
		/*! This corresponds to the currently checked button on the brush preset toolbar, or zero if no button is checked. */
		virtual int			GetActivePreset() = 0;
		//! \brief Sets the active preset
		/*! The button on the brush preset toolbar corresponding to this preset will become checked.
		    \param[in] presetID The ID of the preset */
		virtual void		SetActivePreset( int presetID ) = 0; // Pass zero to deactivate

		//! \brief Notifies the manager that a parameter has changed within a brush preset context
		/*! Contexts should call this method whenever they are active, and any parameter changes which needs
		    to be stored into the active preset
		    \param[in] contextID The ID of the updated context */
		virtual void		OnContextUpdated( Class_ID contextID ) = 0;

		//! \brief Reads a brush preset file, including the preset values and the layout of the toolbar
		/*! \param[in] cfg The path of the file, or NULL to use the standard startup file
		    \return Non-zero if successful, otherwise zero on error */
		virtual int			ReadConfig(const MCHAR *cfg=NULL) = 0;

		//! \brief Writes a brush preset file, including the preset values and the layout of the toolbar
		/*! \param[in] cfg The path of the file, or NULL to use the standard startup file
		    \return Non-zero if successful, otherwise zero on error */
		virtual int			WriteConfig(const MCHAR *cfg=NULL) = 0;

};

//! \brief The interface ID of the brush preset manager function published interface
#define IBRUSHPRESETMGR_INTERFACE_ID Interface_ID(0x586b1d59, 0x454d0ae9)

//! \brief Helper macro returning the brush preset manager singleton object
inline IBrushPresetMgr* GetIBrushPresetMgr()
{ return (IBrushPresetMgr*)GetCOREInterface(IBRUSHPRESETMGR_INTERFACE_ID); }


text:
<readable><title>515702827_be3c6ce857</title><content>
A child in a pink hat on a pink surfboard .
A girl in pink and man in black paddle through water .
A man in a black shirt swims next to a girl on a pink surfboard .
A man swimming beside a girl on a pink body board .
Two children splash through the water , one is wearing a pink swim cap .
</content></readable>


text:
package some.other.work;

class LocalClass {
    HelloUtils utils = new HelloUtils();

    public void execute() {
        System.out.println("Inside local class of another package.");
    }

    public int getSpecialNumber() {
        utils.forceCompilerWarning();
        return utils.getSpecialNumber();
    }
}

public class HelloWorld {
    LocalClass local = new LocalClass();

    public int getSpecialNumber() {
        return local.getSpecialNumber();
    }

    public void execute() {
        local.execute();
    }
}


text:
require "rails_helper"

RSpec.describe GitHub::EventMessages::Status, type: :model do
  it "returns nil if the status is pending" do
    data = decoded_fixture_data("webhooks/status-travis-pending")

    handler = GitHub::EventMessages::Status.new(data)
    expect(handler.response).to be_nil
  end

  it "returns a Slack message for travis if the status is success" do
    data = decoded_fixture_data("webhooks/status-travis-success")

    handler = GitHub::EventMessages::Status.new(data)
    response = handler.response
    expect(response).to_not be_nil
    expect(response[:channel]).to eql("#notifications")
    expect(response[:text]).to be_nil
    attachments = response[:attachments]
    expect(attachments.first[:fallback]).to_not be_nil
    expect(attachments.first[:color]).to eql("#36a64f")
    expect(attachments.first[:text]).to eql("<https://github.com/atmos-org/speakerboxxx|speakerboxxx> build of <https://github.com/atmos-org/speakerboxxx/tree/master|master> was successful. <https://travis-ci.com/atmos-org/speakerboxxx/builds/26768873|Details>") # rubocop:disable Metrics/LineLength

    fields = attachments.first[:fields]
    expect(fields).to be_nil

    expect(attachments.first[:footer]).to eql("Travis-CI built 7dcf6ad3 for atmos") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:footer_icon]).to eql("https://cloud.githubusercontent.com/assets/483012/22075201/56ed65da-ddab-11e6-954c-2636206bf6a4.png") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:mrkdwn_in]).to eql([:text, :pretext])
  end

  it "returns a Slack message for travis if the status is failure" do
    data = decoded_fixture_data("webhooks/status-travis-failure")

    handler = GitHub::EventMessages::Status.new(data)
    response = handler.response
    expect(response).to_not be_nil
    expect(response[:channel]).to eql("#notifications")
    attachments = response[:attachments]
    expect(attachments.first[:fallback]).to_not be_nil
    expect(attachments.first[:color]).to eql("#f00")
    expect(attachments.first[:text]).to eql("<https://github.com/atmos-org/speakerboxxx|speakerboxxx> build of <https://github.com/atmos-org/speakerboxxx/tree/add-pull-requests|add-pull-requests> failed. <https://travis-ci.com/atmos-org/speakerboxxx/builds/26834904|Details>") # rubocop:disable Metrics/LineLength

    fields = attachments.first[:fields]
    expect(fields).to be_nil

    expect(attachments.first[:footer]).to eql("Travis-CI built 89bfabcc for atmos") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:footer_icon]).to eql("https://cloud.githubusercontent.com/assets/483012/22075201/56ed65da-ddab-11e6-954c-2636206bf6a4.png") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:mrkdwn_in]).to eql([:text, :pretext])
  end

  it "returns a Slack message for circleci if the status is success" do
    data = decoded_fixture_data("webhooks/status-circle-success")

    handler = GitHub::EventMessages::Status.new(data)
    response = handler.response
    expect(response).to_not be_nil
    expect(response[:channel]).to eql("#notifications")

    expect(response[:text]).to be_nil
    attachments = response[:attachments]
    expect(attachments.first[:fallback]).to_not be_nil
    expect(attachments.first[:color]).to eql("#36a64f")
    expect(attachments.first[:text]).to eql("<https://github.com/atmos-org/speakerboxxx|speakerboxxx> build of <https://github.com/atmos-org/speakerboxxx/tree/master|master> was successful. <https://circleci.com/gh/atmos-org/speakerboxxx/1|Details>") # rubocop:disable Metrics/LineLength

    fields = attachments.first[:fields]
    expect(fields).to be_nil

    expect(attachments.first[:footer]).to eql("circle-ci built a2df354c") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:footer_icon]).to eql("https://cloud.githubusercontent.com/assets/38/16295346/2b121e26-38db-11e6-9c4f-ee905519fdf3.png") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:mrkdwn_in]).to eql([:text, :pretext])
  end

  it "returns a Slack message for circle if the status is failure" do
    data = decoded_fixture_data("webhooks/status-circle-failure")

    handler = GitHub::EventMessages::Status.new(data)
    response = handler.response
    expect(response).to_not be_nil
    expect(response[:channel]).to eql("#notifications")
    expect(response[:text]).to be_nil
    attachments = response[:attachments]
    expect(attachments.first[:fallback]).to_not be_nil
    expect(attachments.first[:color]).to eql("#f00")
    expect(attachments.first[:text]).to eql("<https://github.com/atmos-org/speakerboxxx|speakerboxxx> build of <https://github.com/atmos-org/speakerboxxx/tree/master|master> failed. <https://circleci.com/gh/atmos-org/speakerboxxx/1|Details>") # rubocop:disable Metrics/LineLength

    fields = attachments.first[:fields]
    expect(fields).to be_nil

    expect(attachments.first[:footer]).to eql("circle-ci built a2df354c") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:footer_icon]).to eql("https://cloud.githubusercontent.com/assets/38/16295346/2b121e26-38db-11e6-9c4f-ee905519fdf3.png") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:mrkdwn_in]).to eql([:text, :pretext])
  end

  it "returns a Slack message for changeling if the status is successful" do
    data = decoded_fixture_data("webhooks/status-changeling-success")

    handler = GitHub::EventMessages::Status.new(data)
    response = handler.response
    expect(response).to_not be_nil
    expect(response[:channel]).to eql("#notifications")
    expect(response[:text]).to be_nil
    attachments = response[:attachments]
    expect(attachments.first[:fallback]).to_not be_nil
    expect(attachments.first[:color]).to eql("#36a64f")
    expect(attachments.first[:text]).to eql("<https://github.com/atmos-org/speakerboxxx|speakerboxxx> build of <https://github.com/atmos-org/speakerboxxx/tree/endpoint-events|endpoint-events> was successful. <https://changeling.heroku.tools/multipasses/4689e051-468a-4c09-8cdc-2958e1558f01|Details>") # rubocop:disable Metrics/LineLength

    fields = attachments.first[:fields]
    expect(fields).to be_nil

    expect(attachments.first[:footer]).to eql("Changeling: Reviewed by dmcinnes.") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:footer_icon]).to eql("https://cloud.githubusercontent.com/assets/38/16531791/ebc00ff4-3f82-11e6-919b-693a5cf9183a.png") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:mrkdwn_in]).to eql([:text, :pretext])
  end

  it "returns a Slack message for fork repos without branch references" do
    data = decoded_fixture_data("webhooks/status-changeling-success-fork")

    handler = GitHub::EventMessages::Status.new(data)
    response = handler.response
    expect(response).to_not be_nil
    expect(response[:channel]).to eql("#notifications")
    expect(response[:text]).to be_nil
    attachments = response[:attachments]
    expect(attachments.first[:fallback]).to_not be_nil
    expect(attachments.first[:color]).to eql("#36a64f")
    expect(attachments.first[:text]).to eql("<https://github.com/atmos-org/speakerboxxx|speakerboxxx> build of <https://github.com/atmos-org/speakerboxxx/tree/46afb288|46afb288> was successful. <https://changeling.heroku.tools/multipasses/4689e051-468a-4c09-8cdc-2958e1558f01|Details>") # rubocop:disable Metrics/LineLength

    fields = attachments.first[:fields]
    expect(fields).to be_nil

    expect(attachments.first[:footer]).to eql("Changeling: Reviewed by dmcinnes.") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:footer_icon]).to eql("https://cloud.githubusercontent.com/assets/38/16531791/ebc00ff4-3f82-11e6-919b-693a5cf9183a.png") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:mrkdwn_in]).to eql([:text, :pretext])
  end

  it "returns a Slack message for fork repos without branch references" do
    data = decoded_fixture_data("webhooks/status-heroku-success")

    handler = GitHub::EventMessages::Status.new(data)
    response = handler.response
    expect(response).to_not be_nil
    expect(response[:channel]).to eql("#notifications")
    expect(response[:text]).to be_nil
    attachments = response[:attachments]
    expect(attachments.first[:fallback]).to_not be_nil
    expect(attachments.first[:color]).to eql("#36a64f")
    expect(attachments.first[:text]).to eql("<https://github.com/atmos-org/speakerboxxx|speakerboxxx> build of <https://github.com/atmos-org/speakerboxxx/tree/master|master> was successful. <https://dashboard.heroku.com/pipelines/fe14109b-9876-4a51-c421-9e263bad16b3/tests/10|Details>") # rubocop:disable Metrics/LineLength

    fields = attachments.first[:fields]
    expect(fields).to be_nil

    expect(attachments.first[:footer]).to eql("Heroku-CI built 7dcf6ad3 for atmos") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:footer_icon]).to eql("https://cloud.githubusercontent.com/assets/38/16531791/ebc00ff4-3f82-11e6-919b-693a5cf9183a.png") # rubocop:disable Metrics/LineLength
    expect(attachments.first[:mrkdwn_in]).to eql([:text, :pretext])
  end
end


text:
/**
 * Module dependencies.
 */
'use strict';
var express = require('express'),
		http = require('http'),
		path = require('path'),
		settings = {
		liveReload: {
			port: 35279
		},
		webserver: {
			port: 3000
		}
	};

var app = module.exports = express();

app.configure(function () {

	app.set('port', process.env.PORT || 3000);
	app.set('views', './public');
	app.set('view engine', 'html');

	// Use index.html instead of layout.html
	app.set('view options', { layout: 'index.html' });
	app.engine('html', require('hbs').__express);
	app.use(express.favicon());
	app.use(express.bodyParser());
	app.use(express.methodOverride());
	app.use(app.router);
	app.use(express.static(path.join(__dirname, 'public')));

});

app.configure('development', function () {
	app.use(express.errorHandler());
});

// Route Responses
app.get('/', function (req, res) {
	res.render('', { title: 'KDD', dev: true });
});

//
// Manually instantiate server via `node server` command if not being called
// via Grunt.js
//
if (!module.parent) {
	http.createServer(app).listen(app.get('port'), function () {
		console.log('Express server listening on port ' + app.get('port'));
	});
}


text:
'use strict';

Object.defineProperty(exports, '__esModule', {
  value: true
});

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var _passportOauth = require('passport-oauth');

/**
 * `WechatTokenStrategy` constructor.
 *
 * The Twitter authentication strategy authenticates requests by delegating to
 * Twitter using the OAuth protocol.
 *
 * Applications must supply a `verify` callback which accepts a `token`,
 * `tokenSecret` and service-specific `profile`, and then calls the `done`
 * callback supplying a `user`, which should be set to `false` if the
 * credentials are not valid.  If an exception occured, `err` should be set.
 *
 * Options:
 *   - `consumerKey`     identifies client to Twitter
 *   - `consumerSecret`  secret used to establish ownership of the consumer key
 *
 * @param {Object} options
 * @param {Function} verify
 * @example
 * passport.use(new WechatTokenStrategy({
 *   consumerKey: '123456789',
 *   consumerSecret: 'shhh-its-a-secret'
 * }), function(token, tokenSecret, profile, done) {
 *   User.findOrCreate({twitterId: profile.id}, function(error, user) {
 *     done(error, user);
 *   });
 * });
 */

var WechatTokenStrategy = (function (_OAuth2Strategy) {
  _inherits(WechatTokenStrategy, _OAuth2Strategy);

  function WechatTokenStrategy(_options, _verify) {
    _classCallCheck(this, WechatTokenStrategy);

    var options = _options || {};
    var verify = _verify;

    options.authorizationURL = options.authorizationURL || 'https://open.weixin.qq.com/connect/oauth2/authorize';
    options.tokenURL = options.tokenURL || 'https://open.weixin.qq.com/connect/oauth2/authorize';

    options.sessionKey = options.sessionKey || 'oauth:wechat';

    _get(Object.getPrototypeOf(WechatTokenStrategy.prototype), 'constructor', this).call(this, options, verify);

    this.name = 'wechat-token';
    this._accessTokenField = options.accessTokenField || 'access_token';
    this._refreshTokenField = options.refreshTokenField || 'refresh_token';

    this._oauthTokenField = options.oauthTokenField || 'oauth_token';
    this._oauthTokenSecretField = options.oauthTokenSecretField || 'oauth_token_secret';
    this._userIdField = options.userIdField || 'openid';
    this._profileURL = options.profileURL || 'https://api.weixin.qq.com/sns/userinfo';
    this._clientSecret = options.clientSecret;
    this._enableProof = typeof options.enableProof === 'boolean' ? options.enableProof : true;
    this._passReqToCallback = options.passReqToCallback;

    // skip default user profile flow
    this._skipUserProfile = true;
  }

  /**
   * Authenticate request by delegating to Twitter using OAuth.
   * @param {Object} req
   */

  _createClass(WechatTokenStrategy, [{
    key: 'authenticate',
    value: function authenticate(req, options) {
      var _this = this;

      var accessToken = req.body && req.body[this._accessTokenField] || req.query && req.query[this._accessTokenField];
      var refreshToken = req.body && req.body[this._refreshTokenField] || req.query && req.query[this._refreshTokenField];
      var userId = req.body && req.body[this._userIdField] || req.query && req.query[this._userIdField];

      if (!accessToken || !userId) return this.fail({ message: 'You should provide ' + this._accessTokenField + ' and ' + this._userIdField });

      // Following the link back to the application is interpreted as an authentication failure
      if (req.query && req.query.denied) return this.fail();

      this.userProfile(accessToken, refreshToken, userId, function (error, profile) {
        if (error) return _this.error(error);

        var verified = function verified(error, user, info) {
          if (error) return _this.error(error);
          if (!user) return _this.fail(info);

          return _this.success(user, info);
        };

        if (_this._passReqToCallback) {
          _this._verify(req, accessToken, refreshToken, profile, verified);
        } else {
          _this._verify(accessToken, refreshToken, profile, verified);
        }
      });
    }

    /**
     * Retrieve user profile from Twitter.
     * @param {String} token
     * @param {String} tokenSecret
     * @param {Object} params
     * @param {Function} done
     */
  }, {
    key: 'userProfile',
    value: function userProfile(accessToken, refreshToken, userId, done) {
      this._oauth2.get(this._profileURL + ('?openId=' + userId), accessToken, function (error, body, res) {
        if (error) return done(new _passportOauth.InternalOAuthError('Failed to fetch user profile', error));

        console.log(error);
        console.log(body);

        try {
          var json = JSON.parse(body);

          if (!json.errcode) {
            var profile = {
              provider: 'wechat',
              id: json.unionid,
              username: json.openid,
              displayName: json.nickname,
              name: {
                familyName: '',
                givenName: '',
                middleName: ''
              },
              emails: [{ value: '' }],
              photos: [{ value: json.headimgurl }],
              _raw: body,
              _json: json
            };

            done(null, profile);
          } else {
            done(new Error(json), null);
          }
        } catch (e) {
          done(e);
        }
      });
    }
  }]);

  return WechatTokenStrategy;
})(_passportOauth.OAuth2Strategy);

exports['default'] = WechatTokenStrategy;
module.exports = exports['default'];