text:
#include "Tabular.h"
#include <KrisLibrary/math/random.h>
#include <KrisLibrary/math3d/random.h>
#include <sstream>
using namespace std;

Tabular1DSet::Tabular1DSet(const std::vector<bool>& valid,Real a,Real b)
:BoxSet(a,b,1),Table1D<bool>(valid,a,b),calculatedValidIndices(false)
{}

Tabular1DSet::Tabular1DSet(int n,Real a,Real b)
:BoxSet(a,b,1),Table1D<bool>(n,a,b),calculatedValidIndices(false)
{}

bool Tabular1DSet::Contains(const Config& x) { return Lookup(x); }

bool Tabular1DSet::Project(Config& x)
{
  if(Contains(x)) return true;
  int i = Index(x);
  for(int d=1;d<(int)values.size();d++) {
    if(i-d >= 0 && values[i-d]) {
      x[0] = Cell(i-d).second;
      return true;
    }
    if(i+d < (int)values.size() && values[i+d]) {
      x[0] = Cell(i+d).first;
      return true;
    }
  }
  return false;
}

void Tabular1DSet::Sample(Config& x)
{
  if(!calculatedValidIndices) {
    for(size_t i=0;i<values.size();i++)
      if(values[i])
        validIndices.push_back(int(i));
    calculatedValidIndices = true;
  }
  if(validIndices.empty()) {
    x.resize(1,0.0);
    return;
  }
  int i = validIndices[RandInt(validIndices.size())];
  pair<Real,Real> c = Cell(i);
  x.resize(1);
  x[0] = Rand(c.first,c.second);
}

Tabular2DSet::Tabular2DSet(const Array2D<bool>& valid,const Vector2& bmin,const Vector2& bmax)
:BoxSet(Vector(2,bmin),Vector(2,bmax)),calculatedValidIndices(false)
{
  value = valid;
  bb.bmin = bmin;
  bb.bmax = bmax;
}

Tabular2DSet::Tabular2DSet(int m,int n,const Vector2& bmin,const Vector2& bmax)
:BoxSet(Vector(2,bmin),Vector(2,bmax)),calculatedValidIndices(false)
{
  value.resize(m,n,false);
  bb.bmin = bmin;
  bb.bmax = bmax;
}

bool Tabular2DSet::Contains(const Config& x)
{
  return GetValue(Vector2(x[0],x[1]));
}

bool Tabular2DSet::Project(Config& x)
{
  return BoxSet::Project(x) && Contains(x);
}

void Tabular2DSet::Sample(Config& x)
{
  if(!calculatedValidIndices) {
    for(int i=0;i<value.m;i++)
      for(int j=0;j<value.n;j++)
        if(value(i,j)) validIndices.push_back(IntPair(i,j));
    calculatedValidIndices = true;
  }
  if(validIndices.empty()) {
    x.resize(2,0.0);
    return;
  }
  IntPair i = validIndices[RandInt(validIndices.size())];
  AABB2D bb;
  GetCell(i,bb);
  Vector2 temp;
  SampleAABB(bb.bmin,bb.bmax,temp);
  x.resize(2);
  temp.get(x);
}

Tabular3DSet::Tabular3DSet(const Array3D<bool>& valid,const Vector3& bmin,const Vector3& bmax)
:BoxSet(Vector(3,bmin),Vector(3,bmax)),calculatedValidIndices(false)
{
  value = valid;
  bb.bmin = bmin;
  bb.bmax = bmax;
}

Tabular3DSet::Tabular3DSet(int m,int n,int p,const Vector3& bmin,const Vector3& bmax)
:BoxSet(Vector(3,bmin),Vector(3,bmax)),calculatedValidIndices(false)
{
  value.resize(m,n,p,false);
  bb.bmin = bmin;
  bb.bmax = bmax;
}
bool Tabular3DSet::Contains(const Config& x)
{
  return GetValue(Vector3(x[0],x[1],x[2]));
}

bool Tabular3DSet::Project(Config& x)
{
  return BoxSet::Project(x);
}

void Tabular3DSet::Sample(Config& x)
{
  if(!calculatedValidIndices) {
    for(int i=0;i<value.m;i++)
      for(int j=0;j<value.n;j++)
        for(int k=0;k<value.p;k++)
          if(value(i,j,k)) validIndices.push_back(IntTriple(i,j,k));
    calculatedValidIndices = true;
  }
  if(validIndices.empty()) {
    x.resize(3,0.0);
    return;
  }
  IntTriple i = validIndices[RandInt(validIndices.size())];
  AABB3D bb;
  GetCell(i,bb);
  Vector3 temp;
  SampleAABB(bb.bmin,bb.bmax,temp);
  x.resize(3);
  temp.get(x);
}

/** @ingroup Planning
 * @brief A 1D level set f(x) <= threshold.
 *
 * Values of f are linearly interpolated on the grid [a,b].  These are
 * interpreted as being located at the grid cell *centers*, not
 * the vertices.
 */
Tabular1DLevelSet::Tabular1DLevelSet(const std::vector<Real>& f,Real a,Real b,Real _threshold)
:BoxSet(a,b,1),Table1D<Real>(f,a,b),threshold(_threshold)
{}

bool Tabular1DLevelSet::Contains(const Config& x)
{
  return Lookup(x) <= threshold;
}

bool Tabular1DLevelSet::Project(Config& x)
{
  return BoxSet::Project(x) && Contains(x);
}

Tabular2DLevelSet::Tabular2DLevelSet(const Array2D<Real>& f,const Vector2& bmin,const Vector2& bmax,Real _threshold)
:BoxSet(Vector(2,bmin),Vector(2,bmax))
{
  agrid.value = f;
  agrid.bb.bmin = bmin;
  agrid.bb.bmax = bmax;
}

bool Tabular2DLevelSet::Contains(const Config& x)
{
  return agrid.BilinearInterpolate(Vector2(x)) <= threshold;
}

bool Tabular2DLevelSet::Project(Config& x)
{
  return BoxSet::Project(x) && Contains(x);
}

Tabular3DLevelSet::Tabular3DLevelSet(const Array3D<Real>& f,const Vector3& bmin,const Vector3& bmax,Real _threshold)
:BoxSet(Vector(3,bmin),Vector(3,bmax)),threshold(_threshold)
{
  vgrid.value = f;
  vgrid.bb.bmin = bmin;
  vgrid.bb.bmax = bmax;
}

bool Tabular3DLevelSet::Contains(const Config& x)
{
  return vgrid.TrilinearInterpolate(Vector3(x)) <= threshold;
}

bool Tabular3DLevelSet::Project(Config& x)
{
  return BoxSet::Project(x) && Contains(x);
}

Tabular1DObjective::Tabular1DObjective(const std::vector<Real>& _differentialCosts,const std::vector<Real>& _terminalCosts,
    Real a,Real b,
    int _dim)
:differentialCosts(_differentialCosts,a,b),terminalCosts(_terminalCosts,a,b),dim(_dim)
{}

std::string Tabular1DObjective::Description()
{
  stringstream ss;
  ss<<"tabular1d ["<<differentialCosts.a<<","<<differentialCosts.b<<"] on dimension "<<dim;
  return ss.str();
}

Real Tabular1DObjective::IncrementalCost(const Interpolator* path)
{
  if(differentialCosts.values.empty()) return 0;
  Config x;
  path->Eval(0.5,x);
  return differentialCosts.Lookup(x[dim])*path->Length();
}

Real Tabular1DObjective::TerminalCost(const Vector& qend)
{
  if(terminalCosts.values.empty()) return 0;
  return terminalCosts.Lookup(qend[dim]);
}

Tabular2DObjective::Tabular2DObjective(const Array2D<Real>& _differentialCosts,const Array2D<Real>& _terminalCosts,
    const Vector2& bmin,const Vector2& bmax,
    int _dim0,int _dim1)
:dim0(_dim0),dim1(_dim1)
{
  differentialCosts.value = _differentialCosts;
  differentialCosts.bb.bmin = bmin;
  differentialCosts.bb.bmax = bmax;
  terminalCosts.value = _terminalCosts;
  terminalCosts.bb.bmin = bmin;
  terminalCosts.bb.bmax = bmax;
}

std::string Tabular2DObjective::Description()
{
  stringstream ss;
  ss<<"tabular2d ["<<differentialCosts.bb.bmin<<","<<differentialCosts.bb.bmin<<"] on dimensions ("<<dim0<<","<<dim1<<")";
  return ss.str();
}

Real Tabular2DObjective::IncrementalCost(const Interpolator* path)
{
  if(differentialCosts.value.empty()) return 0;
  Config x;
  path->Eval(0.5,x);
  return differentialCosts.BilinearInterpolate(Vector2(x[dim0],x[dim1]))*path->Length();
}

Real Tabular2DObjective::TerminalCost(const Vector& qend)
{
  if(terminalCosts.value.empty()) return 0;
  return terminalCosts.BilinearInterpolate(Vector2(qend[dim0],qend[dim1]));
}

Tabular3DObjective::Tabular3DObjective(const Array3D<Real>& _differentialCosts,const Array3D<Real>& _terminalCosts,
    const Vector3& bmin,const Vector3& bmax,
    int _dim0,int _dim1,int _dim2)
:dim0(_dim0),dim1(_dim1),dim2(_dim2)
{
  differentialCosts.value = _differentialCosts;
  differentialCosts.bb.bmin = bmin;
  differentialCosts.bb.bmax = bmax;
  terminalCosts.value = _terminalCosts;
  terminalCosts.bb.bmin = bmin;
  terminalCosts.bb.bmax = bmax;
}

std::string Tabular3DObjective::Description()
{
  stringstream ss;
  ss<<"tabular3d ["<<differentialCosts.bb.bmin<<","<<differentialCosts.bb.bmax<<"] on dimensions ("<<dim0<<","<<dim1<<","<<dim2<<")";
  return ss.str();
}

Real Tabular3DObjective::IncrementalCost(const Interpolator* path)
{
  if(differentialCosts.value.empty()) return 0;
  Config x;
  path->Eval(0.5,x);
  return differentialCosts.TrilinearInterpolate(Vector3(x[dim0],x[dim1],x[dim2]))*path->Length();
}

Real Tabular3DObjective::TerminalCost(const Vector& qend)
{
  if(terminalCosts.value.empty()) return 0;
  return terminalCosts.TrilinearInterpolate(Vector3(qend[dim0],qend[dim1],qend[dim2]));
}


text:
@interface PageContentViewController : UIViewController <SignUpViewControllerDelegate, NSFetchedResultsControllerDelegate>
@property (weak, nonatomic) IBOutlet UIImageView *backgroundImageView;
@property (weak, nonatomic) IBOutlet UILabel *instructionLabel;
//@property (weak, nonatomic) IBOutlet UIButton *signUpButton;
@property (nonatomic) NSUInteger pageIndex;
@property (nonatomic) NSString *titleText;
@property (nonatomic, strong) NSString *imageFile;

@end

redpajama_set_name: RedPajamaGithub


text:
package org.assertj.core.description;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;

/**
 * Tests for <code>{@link EmptyTextDescription#emptyText()}</code>.
 *
 * @author Yvonne Wang
 */
public class EmptyTextDescription_emptyText_Test {

  @Test
  public void should_return_singleton_instance() {
    Description description = EmptyTextDescription.emptyText();
    for (int i = 0; i < 6; i++)
      assertThat(EmptyTextDescription.emptyText()).isSameAs(description);
  }

  @Test
  public void should_have_empty_text_as_value() {
    assertThat(EmptyTextDescription.emptyText().value()).isEmpty();
  }
}


text:
cask 'scap-workbench' do
  version '1.1.2'
  sha256 '8b3a5faf1fadacba9d789a782d3c74fdd79e7cb2f0d0c9dbbbda75a66a89294f'

  # github.com/OpenSCAP/scap-workbench was verified as official when first introduced to the cask
  url "https://github.com/OpenSCAP/scap-workbench/releases/download/#{version}/scap-workbench-#{version}.dmg"
  appcast 'https://github.com/OpenSCAP/scap-workbench/releases.atom',
          checkpoint: 'ab89a9ccba6ec34333295ced1186bdc091e16e35543eedb7473cae1e3d6de772'
  name 'scap-workbench'
  homepage 'https://www.open-scap.org/tools/scap-workbench/'

  app 'scap-workbench.app'
end


text:
 function getAvailableScreenResolution(){
	if(screen.availWidth && screen.availHeight) {
		return [screen.availWidth, screen.availHeight].join(",");
	}
	return "unknown";
}

fp.availableScreenResolution = getAvailableScreenResolution();


text:
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
#define EIGEN_USE_GPU
#include "tensorflow/core/kernels/image/non_max_suppression_op.h"

#include <limits>

#include "absl/strings/str_cat.h"
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/numeric_types.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/tensor_types.h"
#include "tensorflow/core/kernels/gpu_prim.h"
#include "tensorflow/core/util/gpu_kernel_helper.h"
#include "tensorflow/core/util/gpu_launch_config.h"
#include "tensorflow/stream_executor/stream_executor.h"

struct
#if GOOGLE_CUDA
    __align__(16)
#endif
        Box {
  float x1, y1, x2, y2;
};

namespace tensorflow {
typedef Eigen::GpuDevice GPUDevice;
typedef Eigen::ThreadPoolDevice CPUDevice;

// This is the width of the bitmask for masking boxes for each thread.
// This needs to be a multiple of 2(a POD width usually) so that division and
// modulo can be implemented as bit operations during host selection.
constexpr int kNmsBoxesPerThread = 8 * sizeof(int);
// Helper to calculate modulo mask and shift bits.
// For kNmsBoxesPerThread=32 ModuloMask will be 31, i.e 0x1F thus
// i % 32 == i & 31. Similarly ShiftBits will be 5 so that
// i / 32 == i >> 5. Using these bit operations should reduce the stall on host
// thread.
constexpr int NumBits(int n) { return (n == 0) ? 0 : NumBits(n >> 1) + 1; }
constexpr int kNmsBoxesPerThreadModuloMask = kNmsBoxesPerThread - 1;
constexpr int kNmsBoxesPerThreadShiftBits =
    NumBits(kNmsBoxesPerThreadModuloMask);

constexpr int kNmsBlockDim = 16;
constexpr int kNmsBlockDimMax = 128;
constexpr int kNmsChunkSize = 2000;

template <typename T>
__device__ EIGEN_STRONG_INLINE void Swap(T& a, T& b) {
  T c(a);
  a = b;
  b = c;
}

// Check whether two boxes have an IoU greater than threshold.
template <typename T>
__device__ EIGEN_STRONG_INLINE bool OverThreshold(const Box* a, const Box* b,
                                                  const float a_area,
                                                  const T iou_threshold) {
  const float b_area = (b->x2 - b->x1) * (b->y2 - b->y1);
  if (a_area == 0.0f || b_area == 0.0f) return false;
  const float xx1 = fmaxf(a->x1, b->x1);
  const float yy1 = fmaxf(a->y1, b->y1);
  const float xx2 = fminf(a->x2, b->x2);
  const float yy2 = fminf(a->y2, b->y2);

  // fdimf computes the positive difference between xx2+1 and xx1.
  const float w = fdimf(xx2, xx1);
  const float h = fdimf(yy2, yy1);
  const float intersection = w * h;

  // Testing for aa/bb > t
  // eq with aa > bb*t (b is !=0)
  // avoiding divisions.
  const float aa = intersection;
  const float bb = a_area + b_area - intersection;
  const float bt = bb * iou_threshold;
  return aa >= bt;
}

template <bool flip_box>
__device__ EIGEN_STRONG_INLINE void Flipped(Box& box);

template <>
__device__ EIGEN_STRONG_INLINE void Flipped<false>(Box& box) {}

template <>
__device__ EIGEN_STRONG_INLINE void Flipped<true>(Box& box) {
  if (box.x1 > box.x2) Swap(box.x1, box.x2);
  if (box.y1 > box.y2) Swap(box.y1, box.y2);
}
template <typename T>
__device__ EIGEN_STRONG_INLINE bool CheckBit(T* bit_mask, int bit) {
  constexpr int kShiftLen = NumBits(8 * sizeof(T)) - 1;
  constexpr int kRemainderMask = 8 * sizeof(T) - 1;
  int bin = bit >> kShiftLen;
  return (bit_mask[bin] >> (bit & kRemainderMask)) & 1;
}

// Produce a global bitmask (result_mask) of selected boxes from bitmask
// generated by NMSKernel Abort early if max_boxes boxes are selected. Bitmask
// is num_boxes*bit_mask_len bits indicating whether to keep or remove a box.
__global__ void NMSReduce(const int* bitmask, const int bit_mask_len,
                          const int num_boxes, const int max_boxes,
                          char* result_mask) {
  extern __shared__ int local[];
  // set global mask to accept all boxes
  for (int box : GpuGridRangeX(bit_mask_len)) {
    local[box] = 0xFFFFFFFF;
  }
  __syncthreads();
  int accepted_boxes = 0;
  for (int box = 0; box < num_boxes - 1; ++box) {
    // if current box is masked by an earlier box, skip it.
    if (!CheckBit(local, box)) {
      continue;
    }
    accepted_boxes += 1;
    int offset = box * bit_mask_len;
    // update global mask with current box's mask
    for (int b : GpuGridRangeX(bit_mask_len)) {
      local[b] &= ~bitmask[offset + b];
    }
    __syncthreads();
    if (accepted_boxes > max_boxes) break;
  }
  // copy global mask to result_max char array. char array is needed for
  // cub::DeviceSelect later.
  for (int box : GpuGridRangeX(num_boxes)) {
    result_mask[box] = CheckBit(local, box);
  }
}

// For each box, compute a bitmask of boxes which has an overlap with given box
// above threshold.
//
// Starting from highes scoring box, mark any box which has IoU>threshold with
// given box. Each thread processes a kNmsBoxesPerThread boxes per stride, and
// each box has bitmask of overlaps of length bit_mask_len.
//
// If flip_box is true boxes may have x1>x2 and or y1>y2. If so change the
// coordinates such that for all boxes x1<x2 and y1<y2. Else boxes should have
// x1<x2 and y1<y2.
template <bool flip_box>
__launch_bounds__(kNmsBlockDim* kNmsBlockDim, 4) __global__
    void NMSKernel(const Box* d_desc_sorted_boxes, const int num_boxes,
                   const float iou_threshold, const int bit_mask_len,
                   int* d_delete_mask) {
  // Storing boxes used by this CUDA block in the shared memory.
  __shared__ Box shared_i_boxes[kNmsBlockDim];
  // Same thing with areas
  __shared__ float shared_i_areas[kNmsBlockDim];
  // The condition of the for loop is common to all threads in the block.
  // This is necessary to be able to call __syncthreads() inside of the loop.
  for (int i_block_offset = blockIdx.x * blockDim.x; i_block_offset < num_boxes;
       i_block_offset += blockDim.x * gridDim.x) {
    const int i = i_block_offset + threadIdx.x;
    if (i < num_boxes) {
      // One 1D line load the boxes for x-dimension.
      if (threadIdx.y == 0) {
        Box box = d_desc_sorted_boxes[i];
        Flipped<flip_box>(box);
        shared_i_boxes[threadIdx.x] = box;
        shared_i_areas[threadIdx.x] = (box.x2 - box.x1) * (box.y2 - box.y1);
      }
    }
    __syncthreads();
    for (int j_thread_offset =
             kNmsBoxesPerThread * (blockIdx.y * blockDim.y + threadIdx.y);
         j_thread_offset < num_boxes;
         j_thread_offset += kNmsBoxesPerThread * blockDim.y * gridDim.y) {
      // Note : We can do everything using multiplication,
      // and use fp16 - we are comparing against a low precision
      // threshold.
      int above_threshold = 0;
      // Make sure that threads are within valid domain.
      bool valid = false;
      // Loop over the next kNmsBoxesPerThread boxes and set corresponding bit
      // if it is overlapping with current box
      for (int ib = 0; ib < kNmsBoxesPerThread; ++ib) {
        // This thread will compare Box i and Box j.
        const int j = j_thread_offset + ib;
        if (i >= j || i >= num_boxes || j >= num_boxes) continue;
        valid = true;
        Box j_box = d_desc_sorted_boxes[j];
        const Box i_box = shared_i_boxes[threadIdx.x];
        Flipped<flip_box>(j_box);
        if (OverThreshold<float>(&i_box, &j_box, shared_i_areas[threadIdx.x],
                                 iou_threshold)) {
          // we have score[j] <= score[i].
          above_threshold |= (1U << ib);
        }
      }
      if (valid) {
        d_delete_mask[i * bit_mask_len + j_thread_offset / kNmsBoxesPerThread] =
            above_threshold;
      }
    }
    __syncthreads();  // making sure everyone is done reading shared memory.
  }
}
// Variadic template helpers for Index selecting multiple arrays at the same
// time
template <typename Index>
__device__ EIGEN_STRONG_INLINE void SelectHelper(const Index i_selected,
                                                 const Index i_original) {}

template <typename Index, typename T, typename... Args>
__device__ EIGEN_STRONG_INLINE void SelectHelper(const Index i_selected,
                                                 const Index i_original,
                                                 const T* original, T* selected,
                                                 Args... args) {
  selected[i_selected] = original[i_original];
  SelectHelper(i_selected, i_original, args...);
}

// Helper template to select elements from original arrays using the index
// mapping and store into selected array. Each array sharing same mapping need
// to be passed as pairs of pointers to original and selected arrays. For
// selecting 2 arrays call would be
// IndexMultiSelect(num_elements, indices, original1 ,selected1, original2,
// selected2).
template <typename Index, typename T, typename... Args>
__global__ void IndexMultiSelect(const int num_elements, const Index* indices,
                                 const T* original, T* selected, Args... args) {
  for (const int idx : GpuGridRangeX(num_elements)) {
    SelectHelper(idx, indices[idx], original, selected, args...);
  }
}

template <typename T>
__global__ void Iota(const int num_elements, const T offset, T* to_fill) {
  for (int idx : GpuGridRangeX(num_elements)) {
    to_fill[idx] = static_cast<T>(idx) + offset;
  }
}

Status NmsGpu(const float* d_sorted_boxes_float_ptr, const int num_boxes,
              const float iou_threshold, int* d_selected_indices, int* h_nkeep,
              OpKernelContext* context, const int max_boxes, bool flip_boxes) {
  // Making sure we respect the __align(16)__
  // we promised to the compiler.
  auto iptr = reinterpret_cast<std::uintptr_t>(d_sorted_boxes_float_ptr);
  if ((iptr & 15) != 0) {
    return errors::InvalidArgument("Boxes should be aligned to 16 Bytes.");
  }
  // allocate bitmask arrays on host and on device
  Tensor h_num_selected, d_nms_mask;
  const int bit_mask_len =
      (num_boxes + kNmsBoxesPerThread - 1) / kNmsBoxesPerThread;

  int64 max_nms_mask_size = num_boxes * bit_mask_len;
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_INT32, TensorShape({max_nms_mask_size}), &d_nms_mask));
  // reset data sensitive tensors
  auto device = context->eigen_gpu_device();
  auto config = GetGpuLaunchConfig(d_nms_mask.NumElements(), device);
  TF_CHECK_OK(GpuLaunchKernel(SetZero<int>, config.block_count,
                              config.thread_per_block, 0, device.stream(),
                              config.virtual_thread_count,
                              d_nms_mask.flat<int32>().data()));

  AllocatorAttributes alloc_attr;
  alloc_attr.set_on_host(true);
  alloc_attr.set_gpu_compatible(true);
  // Size of this buffer can be reduced to kNmsChunkSize*bit_mask_len*2 and
  // using it as a ring buffer. However savings should be a few MB .
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_INT32, TensorShape({1}), &h_num_selected, alloc_attr));

  int* d_delete_mask = d_nms_mask.flat<int>().data();
  int* h_selected_count = h_num_selected.flat<int>().data();
  const Box* d_sorted_boxes =
      reinterpret_cast<const Box*>(d_sorted_boxes_float_ptr);
  dim3 block_dim, thread_block;
  int num_blocks = (num_boxes + kNmsBlockDim - 1) / kNmsBlockDim;
  num_blocks = std::max(std::min(num_blocks, kNmsBlockDimMax), 1);
  block_dim.x = num_blocks;
  block_dim.y = num_blocks;
  block_dim.z = 1;
  thread_block.x = kNmsBlockDim;
  thread_block.y = kNmsBlockDim;
  thread_block.z = 1;
  if (flip_boxes) {
    TF_CHECK_OK(GpuLaunchKernel(NMSKernel<true>, block_dim, thread_block, 0,
                                device.stream(), d_sorted_boxes, num_boxes,
                                iou_threshold, bit_mask_len, d_delete_mask));
  } else {
    TF_CHECK_OK(GpuLaunchKernel(NMSKernel<false>, block_dim, thread_block, 0,
                                device.stream(), d_sorted_boxes, num_boxes,
                                iou_threshold, bit_mask_len, d_delete_mask));
  }
  TF_RETURN_IF_CUDA_ERROR(cudaGetLastError());
  // Overlapping CPU computes and D2H memcpy
  // both take about the same time

  config = GetGpuLaunchConfig(num_boxes, device);
  Tensor selected_boxes;
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_INT8, TensorShape({num_boxes}), &selected_boxes));
  Tensor d_indices;
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_INT32, TensorShape({num_boxes}), &d_indices));
  TF_CHECK_OK(GpuLaunchKernel(Iota<int>, config.block_count,
                              config.thread_per_block, 0, device.stream(),
                              config.virtual_thread_count, 0,
                              d_indices.flat<int>().data()));

  char* selected = (char*)(selected_boxes.flat<int8>().data());
  TF_CHECK_OK(GpuLaunchKernel(NMSReduce, 1, 1024, bit_mask_len * sizeof(int),
                              device.stream(), d_delete_mask, bit_mask_len,
                              num_boxes, max_boxes, selected));
  TF_RETURN_IF_CUDA_ERROR(cudaGetLastError());
  // do Cub::deviceSelect::flagged
  size_t flagged_buffer_size = 0;
  gpuprim::DeviceSelect::Flagged(static_cast<void*>(nullptr),  // temp_storage
                                 flagged_buffer_size,
                                 static_cast<int*>(nullptr),   // input
                                 static_cast<char*>(nullptr),  // selection flag
                                 static_cast<int*>(nullptr),   // selected items
                                 static_cast<int*>(nullptr),   // num_selected
                                 num_boxes, device.stream());
  Tensor cub_scratch;
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_INT8, TensorShape({(int64)flagged_buffer_size}),
      &cub_scratch));
  Tensor d_num_selected;
  TF_RETURN_IF_ERROR(context->allocate_temp(DataType::DT_INT32,
                                            TensorShape({1}), &d_num_selected));

  gpuprim::DeviceSelect::Flagged(
      (void*)cub_scratch.flat<int8>().data(),  // temp_storage
      flagged_buffer_size,
      d_indices.flat<int>().data(),  // input
      selected,                      // selection flag
      d_selected_indices,            // selected items
      d_num_selected.flat<int>().data(), num_boxes, device.stream());
  gpuEvent_t copy_done;
  TF_RETURN_IF_CUDA_ERROR(
      gpuEventCreateWithFlags(&copy_done, gpuEventDisableTiming));
  device.memcpyDeviceToHost(h_selected_count, d_num_selected.flat<int>().data(),
                            sizeof(int));
  TF_RETURN_IF_CUDA_ERROR(gpuEventRecord(copy_done, device.stream()));
  TF_RETURN_IF_CUDA_ERROR(gpuEventSynchronize(copy_done));
  *h_nkeep = *h_selected_count;
  gpuEventDestroy(copy_done);
  return Status::OK();
}

struct GreaterThanCubOp {
  float threshold_;
  __host__ __device__ __forceinline__ GreaterThanCubOp(float threshold)
      : threshold_(threshold) {}
  __host__ __device__ __forceinline__ bool operator()(const float& val) const {
    return (val > threshold_);
  }
};
// Use DeviceSelect::If to count number of elements.
// TODO(sami) Not really a good way. Perhaps consider using thrust?
template <typename Op>
Status CountIf(OpKernelContext* context, const float* dev_array, const Op& op,
               int num_elements, int* result) {
  Tensor scratch_output;
  Tensor workspace;
  Tensor element_count;
  size_t workspace_size = 0;
  auto cuda_stream = tensorflow::GetGpuStream(context);
  auto device = context->eigen_gpu_device();
  gpuprim::DeviceSelect::If(nullptr, workspace_size,
                            static_cast<float*>(nullptr),
                            static_cast<float*>(nullptr),
                            static_cast<int*>(nullptr), num_elements, op);

  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_FLOAT, TensorShape({num_elements}), &scratch_output));
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_INT8, TensorShape({(int64)workspace_size}), &workspace));
  TF_RETURN_IF_ERROR(context->allocate_temp(DataType::DT_INT32,
                                            TensorShape({1}), &element_count));
  gpuEvent_t copy_done;
  TF_RETURN_IF_CUDA_ERROR(
      gpuEventCreateWithFlags(&copy_done, gpuEventDisableTiming));
  TF_RETURN_IF_CUDA_ERROR(gpuprim::DeviceSelect::If(
      workspace.flat<int8>().data(), workspace_size, dev_array,
      scratch_output.flat<float>().data(), element_count.flat<int32>().data(),
      num_elements, op, cuda_stream));
  device.memcpyDeviceToHost(result, element_count.flat<int32>().data(),
                            sizeof(int));
  TF_RETURN_IF_CUDA_ERROR(gpuEventRecord(copy_done, device.stream()));
  TF_RETURN_IF_CUDA_ERROR(gpuEventSynchronize(copy_done));
  return Status::OK();
}

Status DoNMS(OpKernelContext* context, const Tensor& boxes,
             const Tensor& scores, const int64_t max_output_size,
             const float iou_threshold_val, const float score_threshold,
             bool pad_to_max_output, int* num_saved_outputs) {
  int num_boxes = boxes.dim_size(0);
  size_t cub_sort_temp_storage_bytes = 0;
  auto cuda_stream = GetGpuStream(context);
  auto device = context->eigen_gpu_device();
  // Calling cub with nullptrs as inputs will make it return
  // workspace size needed for the operation instead of doing the operation.
  // In this specific instance, cub_sort_temp_storage_bytes will contain the
  // necessary workspace size for sorting after the call.
  if (num_boxes == 0) {
    Tensor* output_indices = nullptr;
    TF_RETURN_IF_ERROR(
        context->allocate_output(0, TensorShape({0}), &output_indices));
    return Status::OK();
  }

  cudaError_t cuda_ret = gpuprim::DeviceRadixSort::SortPairsDescending(
      nullptr, cub_sort_temp_storage_bytes,
      static_cast<float*>(nullptr),  // scores
      static_cast<float*>(nullptr),  // sorted scores
      static_cast<int*>(nullptr),    // input indices
      static_cast<int*>(nullptr),    // sorted indices
      num_boxes,                     // num items
      0, 8 * sizeof(float),          // sort all bits
      cuda_stream);
  TF_RETURN_IF_CUDA_ERROR(cuda_ret);
  TF_RETURN_IF_CUDA_ERROR(cudaGetLastError());

  Tensor d_cub_sort_buffer;
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_INT8, TensorShape({(int64)cub_sort_temp_storage_bytes}),
      &d_cub_sort_buffer));
  Tensor d_indices;
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_INT32, TensorShape({num_boxes}), &d_indices));
  Tensor d_sorted_indices;
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_INT32, TensorShape({num_boxes}), &d_sorted_indices));
  Tensor d_selected_indices;
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_INT32, TensorShape({num_boxes}), &d_selected_indices));
  Tensor d_sorted_scores;
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_FLOAT, TensorShape({num_boxes}), &d_sorted_scores));
  Tensor d_sorted_boxes;
  TF_RETURN_IF_ERROR(context->allocate_temp(
      DataType::DT_FLOAT, TensorShape({num_boxes, 4}), &d_sorted_boxes));

  // this will return sorted scores and their indices
  auto config = GetGpuLaunchConfig(num_boxes, device);
  // initialize box and score indices
  TF_CHECK_OK(GpuLaunchKernel(Iota<int>, config.block_count,
                              config.thread_per_block, 0, device.stream(),
                              config.virtual_thread_count, 0,
                              d_indices.flat<int>().data()));
  TF_RETURN_IF_CUDA_ERROR(cudaGetLastError());
  cuda_ret = gpuprim::DeviceRadixSort::SortPairsDescending(
      d_cub_sort_buffer.flat<int8>().data(), cub_sort_temp_storage_bytes,
      scores.flat<float>().data(), d_sorted_scores.flat<float>().data(),
      d_indices.flat<int>().data(), d_sorted_indices.flat<int>().data(),
      num_boxes, 0,
      8 * sizeof(float),  // sort all bits
      cuda_stream);
  TF_RETURN_IF_CUDA_ERROR(cuda_ret);

  // get pointers for easy access
  const float4* original_boxes =
      reinterpret_cast<const float4*>(boxes.flat<float>().data());
  float4* sorted_boxes =
      reinterpret_cast<float4*>(d_sorted_boxes.flat<float>().data());
  const int* sorted_indices = d_sorted_indices.flat<int>().data();
  // sort boxes using indices
  TF_CHECK_OK(GpuLaunchKernel(IndexMultiSelect<int, float4>, config.block_count,
                              config.thread_per_block, 0, device.stream(),
                              config.virtual_thread_count, sorted_indices,
                              original_boxes, sorted_boxes));
  int limited_num_boxes = num_boxes;
  // filter boxes by scores if nms v3
  if (score_threshold > std::numeric_limits<float>::lowest()) {
    GreaterThanCubOp score_limit(score_threshold);
    TF_RETURN_IF_ERROR(CountIf(context, d_sorted_scores.flat<float>().data(),
                               score_limit, num_boxes, &limited_num_boxes));
    if (limited_num_boxes == 0) {
      Tensor* output_indices = nullptr;
      VLOG(1) << "Number of boxes above score threshold " << score_threshold
              << " is 0";
      int len_output = pad_to_max_output ? max_output_size : 0;
      *num_saved_outputs = 0;
      TF_RETURN_IF_ERROR(context->allocate_output(0, TensorShape({len_output}),
                                                  &output_indices));
      return Status::OK();
    } else {
      VLOG(2) << "Number of boxes above threshold=" << score_threshold << " is "
              << limited_num_boxes;
    }
  }
  int num_to_keep = 0;
  // There is no guarantee that boxes are given in the for x1<x2 and/or y1<y2,
  // flip boxes if necessary!
  const bool flip_boxes = true;
  auto status = NmsGpu(d_sorted_boxes.flat<float>().data(), limited_num_boxes,
                       iou_threshold_val, d_selected_indices.flat<int>().data(),
                       &num_to_keep, context, max_output_size, flip_boxes);
  TF_RETURN_IF_CUDA_ERROR(cudaGetLastError());
  if (!status.ok()) {
    context->SetStatus(status);
    return status;
  }
  Tensor* output_indices = nullptr;
  int num_outputs = std::min(num_to_keep, (int)max_output_size);  // no padding!
  if (pad_to_max_output && num_outputs != max_output_size) {
    TF_RETURN_IF_ERROR(context->allocate_output(
        0, TensorShape({max_output_size}), &output_indices));
    config = GetGpuLaunchConfig(max_output_size, device);
    TF_CHECK_OK(GpuLaunchKernel(SetZero<int>, config.block_count,
                                config.thread_per_block, 0, device.stream(),
                                config.virtual_thread_count,
                                output_indices->flat<int>().data()));

  } else {
    TF_RETURN_IF_ERROR(context->allocate_output(0, TensorShape({num_outputs}),
                                                &output_indices));
  }
  if (num_outputs == 0) {
    *num_saved_outputs = num_outputs;
    return Status::OK();
  }
  config = GetGpuLaunchConfig(num_outputs, device);
  TF_CHECK_OK(GpuLaunchKernel(
      IndexMultiSelect<int, int>, config.block_count, config.thread_per_block,
      0, device.stream(), config.virtual_thread_count,
      d_selected_indices.flat<int>().data(), sorted_indices,
      (*output_indices).flat<int>().data()));
  TF_RETURN_IF_CUDA_ERROR(cudaGetLastError());
  *num_saved_outputs = num_outputs;
  return Status::OK();
}

Status CheckValidInputs(const Tensor& boxes, const Tensor& scores,
                        const Tensor& max_output_size,
                        const Tensor& iou_threshold) {
  if (!TensorShapeUtils::IsScalar(max_output_size.shape())) {
    return errors::InvalidArgument("max_output_size must be 0-D, got shape ",
                                   max_output_size.shape().DebugString(),
                                   " (Shape must be rank 0 but is ", "rank ",
                                   max_output_size.dims(), ")");
  }
  if (!TensorShapeUtils::IsScalar(iou_threshold.shape())) {
    return errors::InvalidArgument("iou_threshold must be 0-D, got shape ",
                                   iou_threshold.shape().DebugString(),
                                   " (Shape must be rank 0 but is rank ",
                                   iou_threshold.dims(), ")");
  }
  const float iou_threshold_val = iou_threshold.scalar<float>()();
  if (iou_threshold_val < 0 || iou_threshold_val > 1) {
    return errors::InvalidArgument("iou_threshold must be in [0, 1]");
  }
  if (boxes.dims() != 2) {
    return errors::InvalidArgument(
        "boxes must be a rank 2 tensor! (Shape must "
        "be rank 2 but is rank ",
        boxes.dims(), ")");
  }
  int num_boxes = boxes.dim_size(0);
  if (boxes.dim_size(1) != 4) {
    return errors::InvalidArgument(
        "boxes must be Nx4 (Dimension must be 4 but"
        " is ",
        boxes.dim_size(1), ")");
  }
  if (scores.dims() != 1) {
    return errors::InvalidArgument(
        "scores must be a vector! (Shape must be "
        "rank 1 but is rank ",
        scores.dims(), ")");
  }
  if (scores.dim_size(0) != num_boxes) {
    return errors::InvalidArgument(
        "scores has incompatible shape "        // message must be exactly this
        "(Dimensions must be equal, but are ",  // otherwise tests fail!
        num_boxes, " and ", scores.dim_size(0), ")");
  }
  return Status::OK();
}
class NonMaxSuppressionV2GPUOp : public OpKernel {
 public:
  explicit NonMaxSuppressionV2GPUOp(OpKernelConstruction* context)
      : OpKernel(context) {}

  void Compute(OpKernelContext* context) override {
    // boxes: [num_boxes, 4]
    const Tensor& boxes = context->input(0);
    // scores: [num_boxes]
    const Tensor& scores = context->input(1);
    // max_output_size: scalar
    const Tensor& max_output_size = context->input(2);
    // iou_threshold: scalar
    const Tensor& iou_threshold = context->input(3);
    auto valid =
        CheckValidInputs(boxes, scores, max_output_size, iou_threshold);
    if (!valid.ok()) {
      context->SetStatus(valid);
      return;
    }
    int num_boxes = boxes.dim_size(0);
    if (num_boxes == 0) {
      Tensor* output_indices = nullptr;
      OP_REQUIRES_OK(context, context->allocate_output(0, TensorShape({0}),
                                                       &output_indices));
      return;
    }
    const float iou_threshold_val = iou_threshold.scalar<float>()();
    const int64_t output_size = max_output_size.scalar<int>()();

    OP_REQUIRES_OK(
        context,
        DoNMS(context, boxes, scores, output_size, iou_threshold_val,
              /*score_threshold is float lowest if score threshold is disabled*/
              std::numeric_limits<float>::lowest(),
              /*pad_to_max_output*/ false, &num_boxes));
  }
};

class NonMaxSuppressionV3GPUOp : public OpKernel {
 public:
  explicit NonMaxSuppressionV3GPUOp(OpKernelConstruction* context)
      : OpKernel(context) {}

  void Compute(OpKernelContext* context) override {
    // boxes: [num_boxes, 4]
    const Tensor& boxes = context->input(0);
    // scores: [num_boxes]
    const Tensor& scores = context->input(1);
    // max_output_size: scalar
    const Tensor& max_output_size = context->input(2);
    // iou_threshold: scalar
    const Tensor& iou_threshold = context->input(3);
    auto valid =
        CheckValidInputs(boxes, scores, max_output_size, iou_threshold);
    if (!valid.ok()) {
      context->SetStatus(valid);
      return;
    }

    const Tensor& score_threshold = context->input(4);
    OP_REQUIRES(
        context, TensorShapeUtils::IsScalar(score_threshold.shape()),
        errors::InvalidArgument("score_threshold must be 0-D, got shape ",
                                score_threshold.shape().DebugString()));
    const float score_threshold_val = score_threshold.scalar<float>()();
    int num_boxes = boxes.dim_size(0);
    if (num_boxes == 0) {
      Tensor* output_indices = nullptr;
      OP_REQUIRES_OK(context, context->allocate_output(0, TensorShape({0}),
                                                       &output_indices));
      return;
    }
    const float iou_threshold_val = iou_threshold.scalar<float>()();
    const int64_t output_size = max_output_size.scalar<int>()();
    OP_REQUIRES_OK(context, DoNMS(context, boxes, scores, output_size,
                                  iou_threshold_val, score_threshold_val,
                                  /*pad_to_max_output*/ false, &num_boxes));
  }
};

class NonMaxSuppressionV4GPUOp : public OpKernel {
 public:
  explicit NonMaxSuppressionV4GPUOp(OpKernelConstruction* context)
      : OpKernel(context) {
    OP_REQUIRES_OK(context, context->GetAttr("pad_to_max_output_size",
                                             &pad_to_max_output_size_));
  }

  void Compute(OpKernelContext* context) override {
    // boxes: [num_boxes, 4]
    const Tensor& boxes = context->input(0);
    // scores: [num_boxes]
    const Tensor& scores = context->input(1);
    // max_output_size: scalar
    const Tensor& max_output_size = context->input(2);
    // iou_threshold: scalar
    const Tensor& iou_threshold = context->input(3);
    auto valid =
        CheckValidInputs(boxes, scores, max_output_size, iou_threshold);
    if (!valid.ok()) {
      context->SetStatus(valid);
      return;
    }

    const Tensor& score_threshold = context->input(4);
    OP_REQUIRES(
        context, TensorShapeUtils::IsScalar(score_threshold.shape()),
        errors::InvalidArgument("score_threshold must be 0-D, got shape ",
                                score_threshold.shape().DebugString()));
    const float score_threshold_val = score_threshold.scalar<float>()();

    Tensor* num_outputs_t = nullptr;
    OP_REQUIRES_OK(context,
                   context->allocate_output(1, tensorflow::TensorShape({}),
                                            &num_outputs_t));
    auto device = context->eigen_gpu_device();
    int num_boxes = boxes.dim_size(0);
    if (num_boxes == 0) {
      Tensor* output_indices = nullptr;
      OP_REQUIRES_OK(context, context->allocate_output(0, TensorShape({}),
                                                       &output_indices));
      device.memcpy((num_outputs_t->flat<int>().data()), &num_boxes,
                    sizeof(int));
      return;
    }

    const float iou_threshold_val = iou_threshold.scalar<float>()();
    const int64_t output_size = max_output_size.scalar<int>()();
    int num_outputs = 0;
    OP_REQUIRES_OK(context, DoNMS(context, boxes, scores, output_size,
                                  iou_threshold_val, score_threshold_val,
                                  pad_to_max_output_size_, &num_outputs));
    device.memcpyHostToDevice((num_outputs_t->flat<int>().data()), &num_outputs,
                              sizeof(int));
    return;
  }

 private:
  bool pad_to_max_output_size_;
};

REGISTER_KERNEL_BUILDER(Name("NonMaxSuppressionV2")
                            .TypeConstraint<float>("T")
                            .Device(DEVICE_GPU)
                            .HostMemory("iou_threshold")
                            .HostMemory("max_output_size"),
                        NonMaxSuppressionV2GPUOp);

REGISTER_KERNEL_BUILDER(Name("NonMaxSuppressionV3")
                            .TypeConstraint<float>("T")
                            .Device(DEVICE_GPU)
                            .HostMemory("iou_threshold")
                            .HostMemory("max_output_size")
                            .HostMemory("score_threshold"),
                        NonMaxSuppressionV3GPUOp);

REGISTER_KERNEL_BUILDER(Name("NonMaxSuppressionV4")
                            .TypeConstraint<float>("T")
                            .Device(DEVICE_GPU)
                            .HostMemory("iou_threshold")
                            .HostMemory("max_output_size")
                            .HostMemory("score_threshold"),
                        NonMaxSuppressionV4GPUOp);

}  // namespace tensorflow
#endif


text:
package org.apache.harmony.test.func.reg.vm.btest1485;

import java.util.logging.Logger;

import org.apache.harmony.test.share.reg.RegressionTest;

public class Btest1485 extends RegressionTest {

    public static native void ntest();

    static {
        try {
            System.loadLibrary("Btest1485");
        } catch (Exception e) {
            System.err.println("Can not load library!");
            e.printStackTrace();
        }
      }
    public static void main(String[] args) {
        System.exit(new Btest1485().test(Logger.global, args));
    }

    public int test(Logger logger, String[] args) {
        try {
            ntest();
        } catch (Throwable t) {
            System.err.println("FAILED, native uncaught the exception:");
            t.printStackTrace();
            return fail();
        }
        return pass();
    }

}

class Test1485 {
    static {
        if (true) {
            throw new RuntimeException("e");
        }
    }
    public static void ntest() {
        System.err.println("Test2.ntest()");
    }
}


text:
set :deploy_to, "/var/www/pes/"

###these settings deploy from moira's repo to moira as host
set :repository, "https://209.20.90.14/django/trunk/"
set :user, "buzzbot"
#set :host, "buzzbot@209.20.90.14"  #"moira"
set :host, "pat@0.0.0.0" #local
set :scm, :subversion

set :deploy_via, :checkout

role :app, host
role :web, host
role :db,  host, :primary => true

# Workaround for Capistrano bug when using SVN
set :synchronous_connect, true


text:
import { ErrorBase } from "./base/ErrorBase";

/**
 * An error thrown if there is more than one module with the same ID.
 *
 * @export
 * @class DuplicateModuleIdError
 * @extends {ErrorBase}
 */
export class DuplicateModuleIdError extends ErrorBase {
   constructor(moduleId: string, directoryName: string) {
      super("There is more than one module with ID '" + moduleId + "' in directory '" +
         directoryName + "'");
      this.resetPrototype(DuplicateModuleIdError);
   }
}


text:
from office365.delta_collection import DeltaCollection
from office365.directory.object import DirectoryObject
from office365.entity_collection import EntityCollection
from office365.runtime.client_result import ClientResult
from office365.runtime.http.http_method import HttpMethod
from office365.runtime.queries.service_operation import ServiceOperationQuery

class DirectoryObjectCollection(DeltaCollection):
    """DirectoryObject's collection"""

    def __init__(self, context, resource_path=None):
        super(DirectoryObjectCollection, self).__init__(context, DirectoryObject, resource_path)

    def get_by_ids(self, ids):
        """
        Returns the directory objects specified in a list of IDs.

        :type ids: list[str]
        """
        return_type = ClientResult(self.context)
        params = {
            "ids": ids
        }
        qry = ServiceOperationQuery(self, "getByIds", params, None, None, return_type)
        self.context.add_query(qry)
        return return_type

    def add(self, user_id):
        """
        Add a user to the group.

        :type user_id: str
        """
        payload = {
            "@odata.id": "https://graph.microsoft.com/v1.0/users/{0}".format(user_id)
        }
        qry = ServiceOperationQuery(self, "$ref", None, payload)
        self.context.add_query(qry)
        return self

    def get_available_extension_properties(self, is_synced_from_on_premises=None):
        """
        Return all or a filtered list of the directory extension properties that have been registered in a directory.
        The following entities support extension properties: user, group, organization, device, application,
        and servicePrincipal.
        """
        from office365.directory.extensions.extension_property import ExtensionProperty
        return_type = EntityCollection(self.context, ExtensionProperty, self.context.directory_objects.resource_path)
        payload = {
            "isSyncedFromOnPremises": is_synced_from_on_premises
        }
        qry = ServiceOperationQuery(self, "getAvailableExtensionProperties", None, payload, None, return_type)
        self.context.add_query(qry)
        return return_type

    def remove(self, user_id):
        """Remove a user from the group.

        :type user_id: str
        """

        qry = ServiceOperationQuery(self, "{0}/$ref".format(user_id))
        self.context.add_query(qry)

        def _construct_remove_user_request(request):
            """
            :type request: RequestOptions
            """
            request.method = HttpMethod.Delete
        self.context.before_execute(_construct_remove_user_request)
        return self

    def validate_properties(self, entity_type=None, display_name=None, mail_nickname=None, on_behalf_of_userid=None):
        """
        Validate that a Microsoft 365 group's display name or mail nickname complies with naming policies.
        Clients can use this API to determine whether a display name or mail nickname is valid before trying to
        create a Microsoft 365 group. To validate the properties of an existing group, use the group:
        validateProperties function.

        :param str entity_type: Group is the only supported entity type.
        :param str display_name: The display name of the group to validate. The property is not individually required.
             However, at least one property (displayName or mailNickname) is required.
        :param str mail_nickname: The mail nickname of the group to validate.
             The property is not individually required. However, at least one property (displayName or mailNickname)
             is required.
        :param str on_behalf_of_userid: The ID of the user to impersonate when calling the API. The validation results
            are for the onBehalfOfUserId's attributes and roles.
        """
        payload = {
            "entityType": entity_type,
            "displayName": display_name,
            "mailNickname": mail_nickname,
            "onBehalfOfUserId": on_behalf_of_userid
        }
        qry = ServiceOperationQuery(self, "validateProperties", None, payload)
        self.context.add_query(qry)
        return self


text:
class cErrorReport
{
	cErrorReport();
	~cErrorReport();
public:
	static cErrorReport& GetInstance();

	void PrintWSAGetLastMessage(const char* message);

};

#endif


text:
a {
  -webkit-text-emphasis-position: over;
          text-emphasis-position: over left;
}

em {
  -webkit-text-emphasis-position: under;
          text-emphasis-position: under right;
}

.reverse {
  -webkit-text-emphasis-position: over;
          text-emphasis-position: left over;
}

.wrong {
  -webkit-text-emphasis-position: over;
          text-emphasis-position: over;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape
  xmlns:android="http://schemas.android.com/apk/res/android">
    <corners android:radius="3.0dip" />
    <solid android:color="#ffffffff" />
    <stroke android:width="0.5dip" android:color="#ffaaaaaa" />
</shape>


text:
import {HandlebarsView} from '../../tungstenjs-carbide/src/views/handlebars-view';

export class TodoItemView extends HandlebarsView {
	static get template() {
		console.log('TodoItemView.template()');

		return `
			{{#each this}}

					<input class="toggle" type="checkbox" {{#if isCompleted}}checked="true"{{/if}} />
					{{title}}
					<button class="destroy"></button>

				<input class="edit" value="{{title}}" />

			{{/each}}
		`;
	}
}


text:
package us.repasky.microblog.services;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.provisioning.UserDetailsManager;
import org.springframework.stereotype.Service;

import us.repasky.microblog.domain.BlogUser;
import us.repasky.microblog.domain.Follower;
import us.repasky.microblog.domain.FollowerKey;
import us.repasky.microblog.domain.Post;
import us.repasky.microblog.dto.UserPostDto;
import us.repasky.microblog.repositories.BlogUserRepository;
import us.repasky.microblog.repositories.FollowerRepository;
import us.repasky.microblog.repositories.PostRepository;

/**
 * This implementation uses the UserDetailsManager from Spring Security, as well
 * as a Repository from Spring Data JPA.
 *
 * @author Drew Repasky
 */
@Service
public class UserServiceImpl implements UserService {
	private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
	private static final int POSTS_PER_PAGE = 15;

	@Autowired
	private UserDetailsManager userDetailsManager;

	@Autowired
	private PasswordEncoder passwordEncoder;

	@Autowired
	private BlogUserRepository blogUserRepository;

	@Autowired
	private PostRepository postRepository;

	@Autowired
	private FollowerRepository followerRepository;

	// These are the same for every user we create
	private static final boolean ENABLED = true;
	private static final boolean ACCOUNT_NOT_EXPIRED = true;
	private static final boolean CREDENTIALS_NOT_EXPIRED = true;
	private static final boolean ACCOUNT_NOT_LOCKED = true;
	private static final List<SimpleGrantedAuthority> AUTHORITIES = Arrays.asList(new SimpleGrantedAuthority("user"));

	/**
	 * Hash the plain text password and create a new UserDetails instance that can be persisted.
	 */
	private UserDetails initializeUser(String username, String plainTextPassword) {
		String password = passwordEncoder.encode(plainTextPassword);
		return new User(username, password, ENABLED, ACCOUNT_NOT_EXPIRED, CREDENTIALS_NOT_EXPIRED, ACCOUNT_NOT_LOCKED, AUTHORITIES);
	}

	public boolean userExists(String username) {
		return userDetailsManager.userExists(username);
	}

	/**
	 * This will try to save a new user, and returns an error message if the
	 * save failed. This does not check for duplicate usernames before saving.
	 */
	public String registerUser(String username, String plainTextPassword) {
		String errorMessage = "";
		try {
			userDetailsManager.createUser(initializeUser(username, plainTextPassword));
		} catch(DataIntegrityViolationException ex) {
			logger.error("DataIntegrityViolationException when saving user " + username + ".", ex);
			errorMessage = "Could not register user \"" + username + "\".  The user may already exist.";
		} catch(RuntimeException ex) {
			logger.error("RuntimeException when saving user " + username + ".", ex);
			errorMessage = "Could not register user \"" + username + "\".  An unexpected problem occurred when trying to save the data.";
		}
		return errorMessage;
	}

	public List<String> searchForUsers(String username) {
		List<String> usernames = new ArrayList<String>();
		List<BlogUser> blogUsers = blogUserRepository.findByUsernameLike(username);
		for(BlogUser blogUser : blogUsers) {
			usernames.add(blogUser.getUsername());
		}
		return usernames;
	}

	private BlogUser findBlogUserByUsername(String username) {
		BlogUser blogUser = null;
		try {
			blogUser = blogUserRepository.findByUsername(username);
		} catch(RuntimeException ex) {
			logger.error("RuntimeException when finding user " + username + ".", ex);
		}
		return blogUser;
	}

	public String createPost(String username, Post post) {

		BlogUser blogUser = findBlogUserByUsername(username);
		String errorMessage = "";

		if(blogUser != null) {
			post.setBlogUser(blogUser);
			post.setCreatedDate(new Date());

			try {
				postRepository.save(post);
			} catch(DataIntegrityViolationException ex) {
				logger.error("DataIntegrityViolationException when saving post for user " + username + ".", ex);
				errorMessage = "Could not save post for user \"" + username + "\".";
			} catch(RuntimeException ex) {
				logger.error("RuntimeException when saving post for user " + username + ".", ex);
				errorMessage = "Could not save post for user \"" + username + "\".  An unexpected problem occurred when trying to save the data.";
			}
		} else {
			errorMessage = "Could not save post because the user \"" + username + "\" could not be found.";
		}

		return errorMessage;
	}

	public List<UserPostDto> getFollowersPostsForUser(String username, Date createdAfter) {
		List<String> following = getFollowingList(username);
		// get posts for yourself as well
		following.add(username);

		List<Post> posts = null;
		try {
			posts = postRepository.findByUsernameIn(following, createdAfter);
		} catch(RuntimeException ex) {
			logger.error("RuntimeException when getting posts for these users: " + StringUtils.join(following, ", ") + ".", ex);
		}
		return UserPostDto.createUserPosts(posts);
	}

	public Page<Post> getAllPostsForUsers(List<String> usernames, int pageNumber) {
		Page<Post> posts = null;
		try {
			posts = postRepository.findByUsernameIn(usernames, new PageRequest(pageNumber, POSTS_PER_PAGE));
		} catch(RuntimeException ex) {
			logger.error("RuntimeException when getting posts for these users (paged): " + StringUtils.join(usernames, ", ") + ".", ex);
		}
		return posts;
	}

	public Page<Post> getAllFollowersPostsForUser(String username, int pageNumber) {
		List<String> following = getFollowingList(username);
		// get posts for yourself as well
		following.add(username);
		return getAllPostsForUsers(following, pageNumber);
	}

	public String addFollower(String targetUsername, String followerUsername) {
		String errorMessage = "";
		BlogUser targetBlogUser = findBlogUserByUsername(targetUsername);
		BlogUser followerBlogUser = findBlogUserByUsername(followerUsername);
		Follower follower = new Follower();
		FollowerKey followerKey = new FollowerKey();
		followerKey.setTarget(targetBlogUser);
		followerKey.setFollower(followerBlogUser);
		follower.setFollowerKey(followerKey);

		try {
			followerRepository.save(follower);
		} catch(RuntimeException ex) {
			logger.error("RuntimeException when the user \"" + followerUsername + "\" tried to follow \"" + targetUsername + "\".", ex);
			errorMessage = "The user \"" + followerUsername + "\" could not follow \"" + targetUsername + "\".  An unexpected problem occurred when trying to save the data.";
		}
		return errorMessage;
	}

	public String removeFollower(String targetUsername, String followerUsername) {
		String errorMessage = "";
		BlogUser targetBlogUser = findBlogUserByUsername(targetUsername);
		BlogUser followerBlogUser = findBlogUserByUsername(followerUsername);
		Follower follower = new Follower();
		FollowerKey followerKey = new FollowerKey();
		followerKey.setTarget(targetBlogUser);
		followerKey.setFollower(followerBlogUser);
		follower.setFollowerKey(followerKey);

		try {
			followerRepository.delete(follower);
		} catch(RuntimeException ex) {
			logger.error("RuntimeException when the user \"" + followerUsername + "\" tried to unfollow \"" + targetUsername + "\".", ex);
			errorMessage = "The user \"" + followerUsername + "\" could not unfollow \"" + targetUsername + "\".  An unexpected problem occurred when trying to delete the data.";
		}
		return errorMessage;
	}

	public List<String> getFollowingList(String username) {
		List<String> followingList = null;

		try {
			followingList = followerRepository.findByFollowerUsername(username);
		} catch(RuntimeException ex) {
			logger.error("RuntimeException when finding list of this users followers: " + username + ".", ex);
		}
		return followingList;
	}
}


text:
package org.redisson.config;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.net.URL;
import java.util.concurrent.ExecutorService;

import org.redisson.client.codec.Codec;
import org.redisson.codec.DefaultReferenceCodecProvider;
import org.redisson.codec.JsonJacksonCodec;
import org.redisson.codec.ReferenceCodecProvider;
import org.redisson.connection.ConnectionManager;
import org.redisson.connection.DnsAddressResolverGroupFactory;
import org.redisson.connection.AddressResolverGroupFactory;
import org.redisson.connection.ReplicatedConnectionManager;
import org.redisson.misc.URIBuilder;

import io.netty.channel.EventLoopGroup;

/**
 * Redisson configuration
 *
 * @author Nikita Koksharov
 *
 */
public class Config {

    private SentinelServersConfig sentinelServersConfig;

    private MasterSlaveServersConfig masterSlaveServersConfig;

    private SingleServerConfig singleServerConfig;

    private ClusterServersConfig clusterServersConfig;

    private ElasticacheServersConfig elasticacheServersConfig;

    private ReplicatedServersConfig replicatedServersConfig;

    private  ConnectionManager connectionManager;

    /**
     * Threads amount shared between all redis node clients
     */
    private int threads = 0; // 0 = current_processors_amount * 2

    private int nettyThreads = 0; // 0 = current_processors_amount * 2

    /**
     * Redis key/value codec. JsonJacksonCodec used by default
     */
    private Codec codec;

    /**
     * For codec registry and look up. DefaultCodecProvider used by default
     */
    private ReferenceCodecProvider referenceCodecProvider = new DefaultReferenceCodecProvider();

    private ExecutorService executor;

    /**
     * Config option for enabling Redisson Reference feature.
     * Default value is TRUE
     */
    private boolean referenceEnabled = true;

    private TransportMode transportMode = TransportMode.NIO;

    private EventLoopGroup eventLoopGroup;

    private long lockWatchdogTimeout = 30 * 1000;

    private boolean keepPubSubOrder = true;

    /**
     * AddressResolverGroupFactory switch between default and round robin
     */
    private AddressResolverGroupFactory addressResolverGroupFactory = new DnsAddressResolverGroupFactory();

    public Config() {
    }

    static {
        URIBuilder.patchUriObject();
    }

    public Config(Config oldConf) {
        setUseLinuxNativeEpoll(oldConf.isUseLinuxNativeEpoll());
        setExecutor(oldConf.getExecutor());

        if (oldConf.getCodec() == null) {
            // use it by default
            oldConf.setCodec(new JsonJacksonCodec());
        }

        setKeepPubSubOrder(oldConf.isKeepPubSubOrder());
        setLockWatchdogTimeout(oldConf.getLockWatchdogTimeout());
        setNettyThreads(oldConf.getNettyThreads());
        setThreads(oldConf.getThreads());
        setCodec(oldConf.getCodec());
        setReferenceCodecProvider(oldConf.getReferenceCodecProvider());
        setReferenceEnabled(oldConf.isReferenceEnabled());
        setEventLoopGroup(oldConf.getEventLoopGroup());
        setTransportMode(oldConf.getTransportMode());
        setAddressResolverGroupFactory(oldConf.getAddressResolverGroupFactory());

        if (oldConf.getSingleServerConfig() != null) {
            setSingleServerConfig(new SingleServerConfig(oldConf.getSingleServerConfig()));
        }
        if (oldConf.getMasterSlaveServersConfig() != null) {
            setMasterSlaveServersConfig(new MasterSlaveServersConfig(oldConf.getMasterSlaveServersConfig()));
        }
        if (oldConf.getSentinelServersConfig() != null) {
            setSentinelServersConfig(new SentinelServersConfig(oldConf.getSentinelServersConfig()));
        }
        if (oldConf.getClusterServersConfig() != null) {
            setClusterServersConfig(new ClusterServersConfig(oldConf.getClusterServersConfig()));
        }
        if (oldConf.getElasticacheServersConfig() != null) {
            setElasticacheServersConfig(new ElasticacheServersConfig(oldConf.getElasticacheServersConfig()));
        }
        if (oldConf.getReplicatedServersConfig() != null) {
            setReplicatedServersConfig(new ReplicatedServersConfig(oldConf.getReplicatedServersConfig()));
        }
        if (oldConf.getConnectionManager() != null) {
        	useCustomServers(oldConf.getConnectionManager());
        }

    }

    /**
     * Redis key/value codec. Default is json-codec
     *
     * @see org.redisson.client.codec.Codec
     *
     * @param codec object
     * @return config
     */
    public Config setCodec(Codec codec) {
        this.codec = codec;
        return this;
    }

    public Codec getCodec() {
        return codec;
    }

    /**
     * Reference objects codec provider used for codec registry and look up.
     * org.redisson.codec.DefaultReferenceCodecProvider used by default.
     *
     * @param codecProvider object
     * @return config
     * @see org.redisson.codec.ReferenceCodecProvider
     */
    public Config setReferenceCodecProvider(ReferenceCodecProvider codecProvider) {
        this.referenceCodecProvider = codecProvider;
        return this;
    }

    /**
     * Returns the CodecProvider instance
     *
     * @return CodecProvider
     */
    public ReferenceCodecProvider getReferenceCodecProvider() {
        return referenceCodecProvider;
    }

    /**
     * Config option indicate whether Redisson Reference feature is enabled.
     *

     * Default value is true
     *
     * @return true if Redisson Reference feature enabled
     */
    public boolean isReferenceEnabled() {
        return referenceEnabled;
    }

    /**
     * Config option for enabling Redisson Reference feature
     *

     * Default value is true
     *
     * @param redissonReferenceEnabled flag
     */
    public void setReferenceEnabled(boolean redissonReferenceEnabled) {
        this.referenceEnabled = redissonReferenceEnabled;
    }

    /**
     * Init cluster servers configuration
     *
     * @return config
     */
    public ClusterServersConfig useClusterServers() {
        return useClusterServers(new ClusterServersConfig());
    }

    ClusterServersConfig useClusterServers(ClusterServersConfig config) {
        checkMasterSlaveServersConfig();
        checkSentinelServersConfig();
        checkSingleServerConfig();
        checkElasticacheServersConfig();
        checkReplicatedServersConfig();

        if (clusterServersConfig == null) {
            clusterServersConfig = config;
        }
        return clusterServersConfig;
    }

    ClusterServersConfig getClusterServersConfig() {
        return clusterServersConfig;
    }

    void setClusterServersConfig(ClusterServersConfig clusterServersConfig) {
        this.clusterServersConfig = clusterServersConfig;
    }

    /**
     *
     * Use {@link #useReplicatedServers()}
     *
     * @return config object
     */
    @Deprecated
    public ElasticacheServersConfig useElasticacheServers() {
        return useElasticacheServers(new ElasticacheServersConfig());
    }

    ElasticacheServersConfig useElasticacheServers(ElasticacheServersConfig config) {
        checkClusterServersConfig();
        checkMasterSlaveServersConfig();
        checkSentinelServersConfig();
        checkSingleServerConfig();

        if (elasticacheServersConfig == null) {
            elasticacheServersConfig = new ElasticacheServersConfig();
        }
        return elasticacheServersConfig;
    }

    ElasticacheServersConfig getElasticacheServersConfig() {
        return elasticacheServersConfig;
    }

    void setElasticacheServersConfig(ElasticacheServersConfig elasticacheServersConfig) {
        this.elasticacheServersConfig = elasticacheServersConfig;
    }

    /**
     * Init Replicated servers configuration.
     * Most used with Azure Redis Cache or AWS Elasticache
     *
     * @return ReplicatedServersConfig
     */
    public ReplicatedServersConfig useReplicatedServers() {
        return useReplicatedServers(new ReplicatedServersConfig());
    }

    ReplicatedServersConfig useReplicatedServers(ReplicatedServersConfig config) {
        checkClusterServersConfig();
        checkMasterSlaveServersConfig();
        checkSentinelServersConfig();
        checkSingleServerConfig();
        checkElasticacheServersConfig();

        if (replicatedServersConfig == null) {
            replicatedServersConfig = new ReplicatedServersConfig();
        }
        return replicatedServersConfig;
    }

    ReplicatedServersConfig getReplicatedServersConfig() {
        return replicatedServersConfig;
    }

    void setReplicatedServersConfig(ReplicatedServersConfig replicatedServersConfig) {
        this.replicatedServersConfig = replicatedServersConfig;
    }

    /**
	 * Returns the connection manager if supplied via
	 * {@link #useCustomServers(ConnectionManager)}
	 *
	 * @return ConnectionManager
	 */
    ConnectionManager getConnectionManager() {
        return connectionManager;
    }

    /**
	 * This is an extension point to supply custom connection manager.
	 *
	 * @see ReplicatedConnectionManager on how to implement a connection
	 *      manager.
	 * @param connectionManager for supply
	 */
    public void useCustomServers(ConnectionManager connectionManager) {
        this.connectionManager = connectionManager;
    }

    /**
     * Init single server configuration.
     *
     * @return SingleServerConfig
     */
    public SingleServerConfig useSingleServer() {
        return useSingleServer(new SingleServerConfig());
    }

    SingleServerConfig useSingleServer(SingleServerConfig config) {
        checkClusterServersConfig();
        checkMasterSlaveServersConfig();
        checkSentinelServersConfig();
        checkElasticacheServersConfig();
        checkReplicatedServersConfig();

        if (singleServerConfig == null) {
            singleServerConfig = config;
        }
        return singleServerConfig;
    }

    SingleServerConfig getSingleServerConfig() {
        return singleServerConfig;
    }

    void setSingleServerConfig(SingleServerConfig singleConnectionConfig) {
        this.singleServerConfig = singleConnectionConfig;
    }

    /**
     * Init sentinel servers configuration.
     *
     * @return SentinelServersConfig
     */
    public SentinelServersConfig useSentinelServers() {
        return useSentinelServers(new SentinelServersConfig());
    }

    SentinelServersConfig useSentinelServers(SentinelServersConfig sentinelServersConfig) {
        checkClusterServersConfig();
        checkSingleServerConfig();
        checkMasterSlaveServersConfig();
        checkElasticacheServersConfig();
        checkReplicatedServersConfig();

        if (this.sentinelServersConfig == null) {
            this.sentinelServersConfig = sentinelServersConfig;
        }
        return this.sentinelServersConfig;
    }

    SentinelServersConfig getSentinelServersConfig() {
        return sentinelServersConfig;
    }

    void setSentinelServersConfig(SentinelServersConfig sentinelConnectionConfig) {
        this.sentinelServersConfig = sentinelConnectionConfig;
    }

    /**
     * Init master/slave servers configuration.
     *
     * @return MasterSlaveServersConfig
     */
    public MasterSlaveServersConfig useMasterSlaveServers() {
        return useMasterSlaveServers(new MasterSlaveServersConfig());
    }

    MasterSlaveServersConfig useMasterSlaveServers(MasterSlaveServersConfig config) {
        checkClusterServersConfig();
        checkSingleServerConfig();
        checkSentinelServersConfig();
        checkElasticacheServersConfig();
        checkReplicatedServersConfig();

        if (masterSlaveServersConfig == null) {
            masterSlaveServersConfig = config;
        }
        return masterSlaveServersConfig;
    }

    MasterSlaveServersConfig getMasterSlaveServersConfig() {
        return masterSlaveServersConfig;
    }

    void setMasterSlaveServersConfig(MasterSlaveServersConfig masterSlaveConnectionConfig) {
        this.masterSlaveServersConfig = masterSlaveConnectionConfig;
    }

    public boolean isClusterConfig() {
        return clusterServersConfig != null;
    }

    public boolean isSentinelConfig() {
        return sentinelServersConfig != null;
    }

    public int getThreads() {
        return threads;
    }

    /**
     * Threads amount shared across all listeners of RTopic object,
     * invocation handlers of RRemoteService object
     * and RExecutorService tasks.
     *

     * Default is 0.
     *

     * 0 means current_processors_amount * 2
     *
     * @param threads amount
     * @return config
     */
    public Config setThreads(int threads) {
        this.threads = threads;
        return this;
    }

    private void checkClusterServersConfig() {
        if (clusterServersConfig != null) {
            throw new IllegalStateException("cluster servers config already used!");
        }
    }

    private void checkSentinelServersConfig() {
        if (sentinelServersConfig != null) {
            throw new IllegalStateException("sentinel servers config already used!");
        }
    }

    private void checkMasterSlaveServersConfig() {
        if (masterSlaveServersConfig != null) {
            throw new IllegalStateException("master/slave servers already used!");
        }
    }

    private void checkSingleServerConfig() {
        if (singleServerConfig != null) {
            throw new IllegalStateException("single server config already used!");
        }
    }

    private void checkElasticacheServersConfig() {
        if (elasticacheServersConfig != null) {
            throw new IllegalStateException("elasticache replication group servers config already used!");
        }
    }

    private void checkReplicatedServersConfig() {
        if (replicatedServersConfig != null) {
            throw new IllegalStateException("Replication servers config already used!");
        }
    }

    /**
     * Transport mode
     *

     * Default is {@link TransportMode#NIO}
     *
     * @param transportMode param
     * @return config
     */
    public Config setTransportMode(TransportMode transportMode) {
        this.transportMode = transportMode;
        return this;
    }
    public TransportMode getTransportMode() {
        return transportMode;
    }

    /**
     * Use {@link #setTransportMode(TransportMode)}
     */
    @Deprecated
    public Config setUseLinuxNativeEpoll(boolean useLinuxNativeEpoll) {
        if (useLinuxNativeEpoll) {
            setTransportMode(TransportMode.EPOLL);
        }
        return this;
    }

    public boolean isUseLinuxNativeEpoll() {
        return getTransportMode() == TransportMode.EPOLL;
    }

    /**
     * Threads amount shared between all redis clients used by Redisson.
     *

     * Default is 0.
     *

     * 0 means current_processors_amount * 2
     *
     * @param nettyThreads amount
     * @return config
     */
    public Config setNettyThreads(int nettyThreads) {
        this.nettyThreads = nettyThreads;
        return this;
    }

    public int getNettyThreads() {
        return nettyThreads;
    }

    /**
     * Use external ExecutorService. ExecutorService processes
     * all listeners of RTopic,
     * RRemoteService invocation handlers
     * and RExecutorService tasks.
     *

     * The caller is responsible for closing the ExecutorService.
     *
     * @param executor object
     * @return config
     */
    public Config setExecutor(ExecutorService executor) {
        this.executor = executor;
        return this;
    }

    public ExecutorService getExecutor() {
        return executor;
    }

    /**
     * Use external EventLoopGroup. EventLoopGroup processes all
     * Netty connection tied to Redis servers. Each EventLoopGroup creates
     * own threads and each Redisson client creates own EventLoopGroup by default.
     * So if there are multiple Redisson instances in same JVM
     * it would be useful to share one EventLoopGroup among them.
     *

     * Only {@link io.netty.channel.epoll.EpollEventLoopGroup},
     * {@link io.netty.channel.kqueue.KQueueEventLoopGroup}
     * {@link io.netty.channel.nio.NioEventLoopGroup} can be used.
     *

     * The caller is responsible for closing the EventLoopGroup.
     *
     * @param eventLoopGroup object
     * @return config
     */
    public Config setEventLoopGroup(EventLoopGroup eventLoopGroup) {
        this.eventLoopGroup = eventLoopGroup;
        return this;
    }

    public EventLoopGroup getEventLoopGroup() {
        return eventLoopGroup;
    }

    /**
     * This parameter is only used if lock has been acquired without leaseTimeout parameter definition.
     * Lock will be expired after lockWatchdogTimeout if watchdog
     * didn't extend it to next lockWatchdogTimeout time interval.
     *

     * This prevents against infinity locked locks due to Redisson client crush or
     * any other reason when lock can't be released in proper way.
     *
     * @param lockWatchdogTimeout timeout in milliseconds
     * @return config
     */
    public Config setLockWatchdogTimeout(long lockWatchdogTimeout) {
        this.lockWatchdogTimeout = lockWatchdogTimeout;
        return this;
    }
    public long getLockWatchdogTimeout() {
        return lockWatchdogTimeout;
    }

    /**
     * Defines whether keep PubSub messages handling in arrival order
     * or handle messages concurrently.
     *

     * This setting applied only for PubSub messages per channel.
     *

     * Default is true.
     *
     * @param keepPubSubOrder - true if order required, false otherwise.
     * @return config
     */
    public Config setKeepPubSubOrder(boolean keepPubSubOrder) {
        this.keepPubSubOrder = keepPubSubOrder;
        return this;
    }
    public boolean isKeepPubSubOrder() {
        return keepPubSubOrder;
    }

    /**
     * Used to switch between {@link io.netty.resolver.dns.DnsAddressResolverGroup} implementations.
     * Switch to round robin {@link io.netty.resolver.dns.RoundRobinDnsAddressResolverGroup} when you need to optimize the url resolving.
     *
     * @param addressResolverGroupFactory
     * @return config
     */
    public Config setAddressResolverGroupFactory(AddressResolverGroupFactory addressResolverGroupFactory) {
        this.addressResolverGroupFactory = addressResolverGroupFactory;
        return this;
    }
    public AddressResolverGroupFactory getAddressResolverGroupFactory() {
        return addressResolverGroupFactory;
    }

    /**
     * Read config object stored in JSON format from String
     *
     * @param content of config
     * @return config
     * @throws IOException error
     */
    public static Config fromJSON(String content) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromJSON(content, Config.class);
    }

    /**
     * Read config object stored in JSON format from InputStream
     *
     * @param inputStream object
     * @return config
     * @throws IOException error
     */
    public static Config fromJSON(InputStream inputStream) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromJSON(inputStream, Config.class);
    }

    /**
     * Read config object stored in JSON format from File
     *
     * @param file object
     * @param classLoader class loader
     * @return config
     * @throws IOException error
     */
    public static Config fromJSON(File file, ClassLoader classLoader) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromJSON(file, Config.class, classLoader);
    }

    /**
     * Read config object stored in JSON format from File
     *
     * @param file object
     * @return config
     * @throws IOException error
     */
    public static Config fromJSON(File file) throws IOException {
        return fromJSON(file, null);
    }

    /**
     * Read config object stored in JSON format from URL
     *
     * @param url object
     * @return config
     * @throws IOException error
     */
    public static Config fromJSON(URL url) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromJSON(url, Config.class);
    }

    /**
     * Read config object stored in JSON format from Reader
     *
     * @param reader object
     * @return config
     * @throws IOException error
     */
    public static Config fromJSON(Reader reader) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromJSON(reader, Config.class);
    }

    /**
     * Convert current configuration to JSON format
     *
     * @return config in json format
     * @throws IOException error
     */
    public String toJSON() throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.toJSON(this);
    }

    /**
     * Read config object stored in YAML format from String
     *
     * @param content of config
     * @return config
     * @throws IOException error
     */
    public static Config fromYAML(String content) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromYAML(content, Config.class);
    }

    /**
     * Read config object stored in YAML format from InputStream
     *
     * @param inputStream object
     * @return config
     * @throws IOException error
     */
    public static Config fromYAML(InputStream inputStream) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromYAML(inputStream, Config.class);
    }

    /**
     * Read config object stored in YAML format from File
     *
     * @param file object
     * @return config
     * @throws IOException error
     */
    public static Config fromYAML(File file) throws IOException {
        return fromYAML(file, null);
    }

    public static Config fromYAML(File file, ClassLoader classLoader) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromYAML(file, Config.class, classLoader);
    }

    /**
     * Read config object stored in YAML format from URL
     *
     * @param url object
     * @return config
     * @throws IOException error
     */
    public static Config fromYAML(URL url) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromYAML(url, Config.class);
    }

    /**
     * Read config object stored in YAML format from Reader
     *
     * @param reader object
     * @return config
     * @throws IOException error
     */
    public static Config fromYAML(Reader reader) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromYAML(reader, Config.class);
    }

    /**
     * Convert current configuration to YAML format
     *
     * @return config in yaml format
     * @throws IOException error
     */
    public String toYAML() throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.toYAML(this);
    }

}


text:
var express  = require('express');
var app      = express();

var dbClient    = require('./lib/db');
var transClient = require('./lib/transferJSON');

var eventsData = require('./data/eventsData');
var timelineData = require('./data/timelineData');
var tagsData = require('./data/tagsData');

var v = '1.0';
var beta = '1.0b';

transClient.init(dbClient);

app.all('/*', function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Methods", "GET");
    next();
});

app.get('/api/' + beta + '/events', function (req, res) {
    res.send(eventsData);
});

app.get('/api/' + v + '/events', function (req, res) {
    res.send(dbClient.getEventsData());
});

app.get('/api/' + beta + '/timeline', function (req, res) {
    res.send(timelineData);
});

app.get('/api/' + v + '/timeline', function (req, res) {
    res.send(dbClient.getTimelineData());
});

app.get('/api/' + beta + '/tags', function (req, res) {
    res.send(tagsData);
});

app.get('/api/' + v + '/tags', function (req, res) {
    res.send(dbClient.getTagsData());
});

var port = Number(process.env.PORT || 5000);
app.listen(port);


text:
set -e

VERSION=${TRAVIS_TAG}
OS=${TRAVIS_OS_NAME/osx/darwin}
ARCH=amd64

BINARY_NAME=rubberdoc
BINARY_DST=$(eval echo \${GOPATH\})/bin/

PACKAGE_NAME=${BINARY_NAME}-${VERSION}.${OS}-${ARCH}.tar.gz
PACKAGE_DST=.

function packaging() {
    echo "Generating ${PACKAGE_NAME} for OS: ${OS} ARCH: ${ARCH}"

    # Building the binary
    GOOS=${OS} GOARCH=${ARCH} make build && \
    # Copying the binary to the current working dir
    cp ${BINARY_DST}${BINARY_NAME} . && \
    # Build the package for the built binary
    tar -czf ${PACKAGE_DST}/${PACKAGE_NAME} ${BINARY_NAME} && \
    # Creating the checksum for the package
    shasum -a 256 -b ${PACKAGE_DST}/${PACKAGE_NAME}

    # Removing the copied binary since it was left on the original location
    rm -f ${BINARY_NAME}
}

# Run packaging procedure
if [ "$1" != "" ] && [ -d $1 ]; then
    PACKAGE_DST=$1
else
    echo -e "The destination $1 is not valid. The default ${PACKAGE_DST} will be taken instead."
fi

packaging


text:
function DecalEditorGui::createAction(%this, %class, %desc) {
	pushInstantGroup();
	%action = new UndoScriptAction() {
		class = %class;
		superClass = BaseDecalEdAction;
		actionName = %desc;
		tree = DecalEditorTreeView;
	};
	popInstantGroup();
	return %action;
}

function DecalEditorGui::doAction(%this, %action) {
	if (%action.doit())
		%action.addToManager(Editor.getUndoManager());
}

function BaseDecalEdAction::redo(%this) {
	// Default redo action is the same as the doit action
	%this.doit();
}

function BaseDecalEdAction::undo(%this) {
}

function ActionEditNodeDetails::doit(%this) {
	%count = getWordCount(%this.newTransformData);

	if(%this.instanceId !$= "" && %count == 7) {
		%newPos = getWords(%this.newTransformData,0,2);
		%newTangent = getWords(%this.newTransformData,3,5);
		%newSize = getWord(%this.newTransformData,6);
		DecalEditorGui.editDecalDetails( %this.instanceId, %newPos,%newTangent,%newSize );
		//DecalEditorGui.editDecalDetails( %this.instanceId, %this.newTransformData );
		DecalEditorGui.syncNodeDetails();
		DecalEditorGui.selectDecal( %this.instanceId );
		return true;
	}

	return false;
}

function ActionEditNodeDetails::undo(%this) {
	%count = getWordCount(%this.oldTransformData);

	if(%this.instanceId !$= "" && %count == 7) {
		%oldPos = getWords(%this.oldTransformData,0,2);
		%oldTangent = getWords(%this.oldTransformData,3,5);
		%oldSize = getWord(%this.oldTransformData,6);
		DecalEditorGui.editDecalDetails( %this.instanceId, %oldPos,%oldTangent,%oldSize );
		DecalEditorGui.syncNodeDetails();
		DecalEditorGui.selectDecal( %this.instanceId );
	}
}


text:
namespace content {

class NavigationControllerBrowserTest : public ContentBrowserTest {
 protected:
  void SetUpOnMainThread() override {
    host_resolver()->AddRule("*", "127.0.0.1");
    ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
  }
};

IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, LoadDataWithBaseURL) {
  const GURL base_url("http://baseurl");
  const GURL history_url("http://historyurl");
  const std::string data = "foo";

  const NavigationController& controller =
      shell()->web_contents()->GetController();
  // Load data. Blocks until it is done.
  content::LoadDataWithBaseURL(shell(), history_url, data, base_url);

  // We should use history_url instead of the base_url as the original url of
  // this navigation entry, because base_url is only used for resolving relative
  // paths in the data, or enforcing same origin policy.
  EXPECT_EQ(controller.GetVisibleEntry()->GetOriginalRequestURL(), history_url);
}

// The renderer uses the position in the history list as a clue to whether a
// navigation is stale. In the case where the entry limit is reached and the
// history list is pruned, make sure that there is no mismatch that would cause
// it to start incorrectly rejecting navigations as stale. See
// http://crbug.com/89798.
IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
                       DontIgnoreBackAfterNavEntryLimit) {
  NavigationController& controller =
      shell()->web_contents()->GetController();

  const int kMaxEntryCount =
      static_cast<int>(NavigationControllerImpl::max_entry_count());

  // Load up to the max count, all entries should be there.
  for (int url_index = 0; url_index < kMaxEntryCount; ++url_index) {
    GURL url(base::StringPrintf("data:text/html,page%d", url_index));
    EXPECT_TRUE(NavigateToURL(shell(), url));
  }

  EXPECT_EQ(controller.GetEntryCount(), kMaxEntryCount);

  // Navigate twice more more.
  for (int url_index = kMaxEntryCount;
       url_index < kMaxEntryCount + 2; ++url_index) {
    GURL url(base::StringPrintf("data:text/html,page%d", url_index));
    EXPECT_TRUE(NavigateToURL(shell(), url));
  }

  // We expect page0 and page1 to be gone.
  EXPECT_EQ(kMaxEntryCount, controller.GetEntryCount());
  EXPECT_EQ(GURL("data:text/html,page2"),
            controller.GetEntryAtIndex(0)->GetURL());

  // Now try to go back. This should not hang.
  ASSERT_TRUE(controller.CanGoBack());
  controller.GoBack();
  EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));

  // This should have successfully gone back.
  EXPECT_EQ(GURL(base::StringPrintf("data:text/html,page%d", kMaxEntryCount)),
            controller.GetLastCommittedEntry()->GetURL());
}

namespace {

int RendererHistoryLength(Shell* shell) {
  int value = 0;
  EXPECT_TRUE(ExecuteScriptAndExtractInt(
      shell->web_contents(),
      "domAutomationController.send(history.length)",
      &value));
  return value;
}

// Similar to the ones from content_browser_test_utils.
bool NavigateToURLAndReplace(Shell* shell, const GURL& url) {
  WebContents* web_contents = shell->web_contents();
  WaitForLoadStop(web_contents);
  TestNavigationObserver same_tab_observer(web_contents, 1);
  NavigationController::LoadURLParams params(url);
  params.should_replace_current_entry = true;
  web_contents->GetController().LoadURLWithParams(params);
  web_contents->Focus();
  same_tab_observer.Wait();
  if (!IsLastCommittedEntryOfPageType(web_contents, PAGE_TYPE_NORMAL))
    return false;
  return web_contents->GetLastCommittedURL() == url;
}

}  // namespace

// When loading a new page to replace an old page in the history list, make sure
// that the browser and renderer agree, and that both get it right.
IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
                       CorrectLengthWithCurrentItemReplacement) {
  NavigationController& controller =
      shell()->web_contents()->GetController();

  EXPECT_TRUE(NavigateToURL(shell(), GURL("data:text/html,page1")));
  EXPECT_EQ(1, controller.GetEntryCount());
  EXPECT_EQ(1, RendererHistoryLength(shell()));

  EXPECT_TRUE(NavigateToURLAndReplace(shell(), GURL("data:text/html,page2")));
  EXPECT_EQ(1, controller.GetEntryCount());
  EXPECT_EQ(1, RendererHistoryLength(shell()));

  // Note that there's no way to access the renderer's notion of the history
  // offset via JavaScript. Checking just the history length, though, is enough;
  // if the replacement failed, there would be a new history entry and thus an
  // incorrect length.
}

// When spawning a new page from a WebUI page, make sure that the browser and
// renderer agree about the length of the history list, and that both get it
// right.
IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
                       CorrectLengthWithNewTabNavigatingFromWebUI) {
  GURL web_ui_page(std::string(kChromeUIScheme) + "://" +
                   std::string(kChromeUIGpuHost));
  EXPECT_TRUE(NavigateToURL(shell(), web_ui_page));
  EXPECT_EQ(BINDINGS_POLICY_WEB_UI,
      shell()->web_contents()->GetRenderViewHost()->GetEnabledBindings());

  ShellAddedObserver observer;
  std::string page_url = embedded_test_server()->GetURL(
      "/navigation_controller/simple_page_1.html").spec();
  EXPECT_TRUE(ExecuteScript(shell()->web_contents(),
                            "window.open('" + page_url + "', '_blank')"));
  Shell* shell2 = observer.GetShell();
  WaitForLoadStop(shell2->web_contents());

  EXPECT_EQ(1, shell2->web_contents()->GetController().GetEntryCount());
  EXPECT_EQ(1, RendererHistoryLength(shell2));

  // Again, as above, there's no way to access the renderer's notion of the
  // history offset via JavaScript. Checking just the history length, again,
  // will have to suffice.
}

namespace {

struct FrameNavigateParamsCapturer : public WebContentsObserver {
 public:
  // Observes navigation for the specified |node|.
  explicit FrameNavigateParamsCapturer(FrameTreeNode* node)
      : WebContentsObserver(
            node->current_frame_host()->delegate()->GetAsWebContents()),
        frame_tree_node_id_(node->frame_tree_node_id()),
        message_loop_runner_(new MessageLoopRunner) {}

  void Wait() {
    message_loop_runner_->Run();
  }

  const FrameNavigateParams& params() const {
    return params_;
  }

  const LoadCommittedDetails& details() const {
    return details_;
  }

 private:
  void DidNavigateAnyFrame(RenderFrameHost* render_frame_host,
                           const LoadCommittedDetails& details,
                           const FrameNavigateParams& params) override {
    RenderFrameHostImpl* rfh =
        static_cast<RenderFrameHostImpl*>(render_frame_host);
    if (rfh->frame_tree_node()->frame_tree_node_id() != frame_tree_node_id_)
      return;

    params_ = params;
    details_ = details;
    message_loop_runner_->Quit();
  }

  // The id of the FrameTreeNode whose navigations to observe.
  int frame_tree_node_id_;

  // The params of the last navigation.
  FrameNavigateParams params_;

  // The details of the last navigation.
  LoadCommittedDetails details_;

  // The MessageLoopRunner used to spin the message loop.
  scoped_refptr<MessageLoopRunner> message_loop_runner_;
};

struct LoadCommittedCapturer : public WebContentsObserver {
 public:
  // Observes the load commit for the specified |node|.
  explicit LoadCommittedCapturer(FrameTreeNode* node)
      : WebContentsObserver(
            node->current_frame_host()->delegate()->GetAsWebContents()),
        frame_tree_node_id_(node->frame_tree_node_id()),
        message_loop_runner_(new MessageLoopRunner) {}

  // Observes the load commit for the next created frame in the specified
  // |web_contents|.
  explicit LoadCommittedCapturer(WebContents* web_contents)
      : WebContentsObserver(web_contents),
        frame_tree_node_id_(0),
        message_loop_runner_(new MessageLoopRunner) {}

  void Wait() {
    message_loop_runner_->Run();
  }

  ui::PageTransition transition_type() const {
    return transition_type_;
  }

 private:
  void RenderFrameCreated(RenderFrameHost* render_frame_host) override {
    // If this object was created with a specified tree frame node, there
    // shouldn't be any frames being created.
    DCHECK_EQ(0, frame_tree_node_id_);
    RenderFrameHostImpl* rfh =
        static_cast<RenderFrameHostImpl*>(render_frame_host);
    frame_tree_node_id_ = rfh->frame_tree_node()->frame_tree_node_id();
  }

  void DidCommitProvisionalLoadForFrame(
      RenderFrameHost* render_frame_host,
      const GURL& url,
      ui::PageTransition transition_type) override {
    DCHECK_NE(0, frame_tree_node_id_);
    RenderFrameHostImpl* rfh =
        static_cast<RenderFrameHostImpl*>(render_frame_host);
    if (rfh->frame_tree_node()->frame_tree_node_id() != frame_tree_node_id_)
      return;

    transition_type_ = transition_type;
    message_loop_runner_->Quit();
  }

  // The id of the FrameTreeNode whose navigations to observe.
  int frame_tree_node_id_;

  // The transition_type of the last navigation.
  ui::PageTransition transition_type_;

  // The MessageLoopRunner used to spin the message loop.
  scoped_refptr<MessageLoopRunner> message_loop_runner_;
};

}  // namespace

// Verify that the distinction between manual and auto subframes is properly set
// for subframe navigations. TODO(avi): It's rather bogus that the same info is
// in two different enums; http://crbug.com/453555.
IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
                       ManualAndAutoSubframeNavigationClassification) {
  GURL main_url(embedded_test_server()->GetURL(
      "/navigation_controller/page_with_iframe.html"));
  NavigateToURL(shell(), main_url);

  // It is safe to obtain the root frame tree node here, as it doesn't change.
  FrameTreeNode* root =
      static_cast<WebContentsImpl*>(shell()->web_contents())->
          GetFrameTree()->root();

  ASSERT_EQ(1U, root->child_count());
  ASSERT_NE(nullptr, root->child_at(0));

  {
    // Navigate the iframe to a new URL; expect a manual subframe transition.
    FrameNavigateParamsCapturer capturer(root->child_at(0));
    GURL frame_url(embedded_test_server()->GetURL(
        "/navigation_controller/simple_page_1.html"));
    NavigateFrameToURL(root->child_at(0), frame_url);
    capturer.Wait();
    EXPECT_EQ(ui::PAGE_TRANSITION_MANUAL_SUBFRAME,
              capturer.params().transition);
    EXPECT_EQ(NAVIGATION_TYPE_NEW_SUBFRAME, capturer.details().type);
  }

  {
    // Do a history navigation; expect an auto subframe transition.
    FrameNavigateParamsCapturer capturer(root->child_at(0));
    shell()->web_contents()->GetController().GoBack();
    capturer.Wait();
    EXPECT_EQ(ui::PAGE_TRANSITION_AUTO_SUBFRAME, capturer.params().transition);
    EXPECT_EQ(NAVIGATION_TYPE_AUTO_SUBFRAME, capturer.details().type);
  }

  {
    // Do a history navigation; expect an auto subframe transition.
    FrameNavigateParamsCapturer capturer(root->child_at(0));
    shell()->web_contents()->GetController().GoForward();
    capturer.Wait();
    EXPECT_EQ(ui::PAGE_TRANSITION_AUTO_SUBFRAME, capturer.params().transition);
    EXPECT_EQ(NAVIGATION_TYPE_AUTO_SUBFRAME, capturer.details().type);
  }

  {
    // Navigate the iframe to a new URL; expect a manual subframe transition.
    FrameNavigateParamsCapturer capturer(root->child_at(0));
    GURL frame_url(embedded_test_server()->GetURL(
        "/navigation_controller/simple_page_2.html"));
    NavigateFrameToURL(root->child_at(0), frame_url);
    capturer.Wait();
    EXPECT_EQ(ui::PAGE_TRANSITION_MANUAL_SUBFRAME,
              capturer.params().transition);
    EXPECT_EQ(NAVIGATION_TYPE_NEW_SUBFRAME, capturer.details().type);
  }

  {
    // Use location.assign(); expect a manual subframe transition.
    FrameNavigateParamsCapturer capturer(root->child_at(0));
    GURL frame_url(embedded_test_server()->GetURL(
        "/navigation_controller/simple_page_1.html"));
    std::string script = "location.assign('" + frame_url.spec() + "')";
    EXPECT_TRUE(content::ExecuteScript(root->child_at(0)->current_frame_host(),
                                       script));
    capturer.Wait();
    EXPECT_EQ(ui::PAGE_TRANSITION_MANUAL_SUBFRAME,
              capturer.params().transition);
    EXPECT_EQ(NAVIGATION_TYPE_NEW_SUBFRAME, capturer.details().type);
  }

  {
    // Use location.replace(); expect an auto subframe transition. (Replacements
    // aren't "navigation" so we only see the frame load committing.)
    LoadCommittedCapturer capturer(root->child_at(0));
    GURL frame_url(embedded_test_server()->GetURL(
        "/navigation_controller/simple_page_2.html"));
    std::string script = "location.replace('" + frame_url.spec() + "')";
    EXPECT_TRUE(content::ExecuteScript(root->child_at(0)->current_frame_host(),
                                       script));
    capturer.Wait();
    EXPECT_EQ(ui::PAGE_TRANSITION_AUTO_SUBFRAME, capturer.transition_type());
  }

  {
    // Reload the subframe; expect an auto subframe transition. (Reloads aren't
    // "navigation" so we only see the frame load committing.)
    LoadCommittedCapturer capturer(root->child_at(0));
    EXPECT_TRUE(content::ExecuteScript(root->child_at(0)->current_frame_host(),
                                       "location.reload()"));
    capturer.Wait();
    EXPECT_EQ(ui::PAGE_TRANSITION_AUTO_SUBFRAME, capturer.transition_type());
  }

  {
    // Create an iframe; expect an auto subframe transition. (Initial frame
    // creation isn't "navigation" so we only see the frame load committing.)
    LoadCommittedCapturer capturer(shell()->web_contents());
    GURL frame_url(embedded_test_server()->GetURL(
        "/navigation_controller/simple_page_1.html"));
    std::string script = "var iframe = document.createElement('iframe');"
                         "iframe.src = '" + frame_url.spec() + "';"
                         "document.body.appendChild(iframe);";
    EXPECT_TRUE(content::ExecuteScript(root->current_frame_host(), script));
    capturer.Wait();
    EXPECT_EQ(ui::PAGE_TRANSITION_AUTO_SUBFRAME, capturer.transition_type());
  }
}

}  // namespace content


text:
package org.radeox.regex;

/*
 * The result when a Matcher object finds matches in some input
 * Implementation for regex package in JDK 1.4
 *
 * @author stephan
 * @team sonicteam
 * @version $Id: JdkMatchResult.java,v 1.1 2004/04/16 07:37:52 stephan Exp $
 */

public class JdkMatchResult extends MatchResult {
  private java.util.regex.Matcher matcher;

  public JdkMatchResult(java.util.regex.Matcher matcher) {
    this.matcher = matcher;
  }

  public JdkMatchResult(Matcher matcher) {
    this.matcher = ((JdkMatcher) matcher).getMatcher();
  }

  public int groups() {
    return matcher.groupCount();
  }

  public String group(int i) {
    return matcher.group(i);
  }

  public int beginOffset(int i) {
    return matcher.start(i);
  }

  public int endOffset(int i) {
    return matcher.end(i);
  }
}


text:
Scuzzy Works Theme for Brackets
=====================================