text:
"""Helper functions for visualizing things."""

from internal import stepfun
import jax.numpy as jnp
from matplotlib import cm

def weighted_percentile(x, w, ps, assume_sorted=False):
  """Compute the weighted percentile(s) of a single vector."""
  x = x.reshape([-1])
  w = w.reshape([-1])
  if not assume_sorted:
    sortidx = jnp.argsort(x)
    x, w = x[sortidx], w[sortidx]
  acc_w = jnp.cumsum(w)
  return jnp.interp(jnp.array(ps) * (acc_w[-1] / 100), acc_w, x)

def sinebow(h):
  """A cyclic and uniform colormap, see http://basecase.org/env/on-rainbows."""
  f = lambda x: jnp.sin(jnp.pi * x)**2
  return jnp.stack([f(3 / 6 - h), f(5 / 6 - h), f(7 / 6 - h)], -1)

def matte(vis, acc, dark=0.8, light=1.0, width=8):
  """Set non-accumulated pixels to a Photoshop-esque checker pattern."""
  bg_mask = jnp.logical_xor(
      (jnp.arange(acc.shape[0]) % (2 * width) // width)[:, None],
      (jnp.arange(acc.shape[1]) % (2 * width) // width)[None, :])
  bg = jnp.where(bg_mask, light, dark)
  return vis * acc[:, :, None] + (bg * (1 - acc))[:, :, None]

def visualize_cmap(value,
                   weight,
                   colormap,
                   lo=None,
                   hi=None,
                   percentile=99.,
                   curve_fn=lambda x: x,
                   modulus=None,
                   matte_background=True):
  """Visualize a 1D image and a 1D weighting according to some colormap.

  Args:
    value: A 1D image.
    weight: A weight map, in [0, 1].
    colormap: A colormap function.
    lo: The lower bound to use when rendering, if None then use a percentile.
    hi: The upper bound to use when rendering, if None then use a percentile.
    percentile: What percentile of the value map to crop to when automatically
      generating `lo` and `hi`. Depends on `weight` as well as `value'.
    curve_fn: A curve function that gets applied to `value`, `lo`, and `hi`
      before the rest of visualization. Good choices: x, 1/(x+eps), log(x+eps).
    modulus: If not None, mod the normalized value by `modulus`. Use (0, 1]. If
      `modulus` is not None, `lo`, `hi` and `percentile` will have no effect.
    matte_background: If True, matte the image over a checkerboard.

  Returns:
    A colormap rendering.
  """
  # Identify the values that bound the middle of `value' according to `weight`.
  lo_auto, hi_auto = weighted_percentile(
      value, weight, [50 - percentile / 2, 50 + percentile / 2])

  # If `lo` or `hi` are None, use the automatically-computed bounds above.
  eps = jnp.finfo(jnp.float32).eps
  lo = lo or (lo_auto - eps)
  hi = hi or (hi_auto + eps)

  # Curve all values.
  value, lo, hi = [curve_fn(x) for x in [value, lo, hi]]

  # Wrap the values around if requested.
  if modulus:
    value = jnp.mod(value, modulus) / modulus
  else:
    # Otherwise, just scale to [0, 1].
    value = jnp.nan_to_num(
        jnp.clip((value - jnp.minimum(lo, hi)) / jnp.abs(hi - lo), 0, 1))

  if colormap:
    colorized = colormap(value)[:, :, :3]
  else:
    if len(value.shape) != 3:
      raise ValueError(f'value must have 3 dims but has {len(value.shape)}')
    if value.shape[-1] != 3:
      raise ValueError(
          f'value must have 3 channels but has {len(value.shape[-1])}')
    colorized = value

  return matte(colorized, weight) if matte_background else colorized

def visualize_coord_mod(coords, acc):
  """Visualize the coordinate of each point within its "cell"."""
  return matte(((coords + 1) % 2) / 2, acc)

def visualize_rays(dist,
                   dist_range,
                   weights,
                   rgbs,
                   accumulate=False,
                   renormalize=False,
                   resolution=2048,
                   bg_color=0.8):
  """Visualize a bundle of rays."""
  dist_vis = jnp.linspace(*dist_range, resolution + 1)
  vis_rgb, vis_alpha = [], []
  for ds, ws, rs in zip(dist, weights, rgbs):
    vis_rs, vis_ws = [], []
    for d, w, r in zip(ds, ws, rs):
      if accumulate:
        # Produce the accumulated color and weight at each point along the ray.
        w_csum = jnp.cumsum(w, axis=0)
        rw_csum = jnp.cumsum((r * w[:, None]), axis=0)
        eps = jnp.finfo(jnp.float32).eps
        r, w = (rw_csum + eps) / (w_csum[:, None] + 2 * eps), w_csum
      vis_rs.append(stepfun.resample(dist_vis, d, r.T, use_avg=True).T)
      vis_ws.append(stepfun.resample(dist_vis, d, w.T, use_avg=True).T)
    vis_rgb.append(jnp.stack(vis_rs))
    vis_alpha.append(jnp.stack(vis_ws))
  vis_rgb = jnp.stack(vis_rgb, axis=1)
  vis_alpha = jnp.stack(vis_alpha, axis=1)

  if renormalize:
    # Scale the alphas so that the largest value is 1, for visualization.
    vis_alpha /= jnp.maximum(jnp.finfo(jnp.float32).eps, jnp.max(vis_alpha))

  if resolution > vis_rgb.shape[0]:
    rep = resolution // (vis_rgb.shape[0] * vis_rgb.shape[1] + 1)
    stride = rep * vis_rgb.shape[1]

    vis_rgb = jnp.tile(vis_rgb, (1, 1, rep, 1)).reshape((-1,) + vis_rgb.shape[2:])
    vis_alpha = jnp.tile(vis_alpha, (1, 1, rep)).reshape((-1,) + vis_alpha.shape[2:])

    # Add a strip of background pixels after each set of levels of rays.
    vis_rgb = vis_rgb.reshape((-1, stride) + vis_rgb.shape[1:])
    vis_alpha = vis_alpha.reshape((-1, stride) + vis_alpha.shape[1:])
    vis_rgb = jnp.concatenate([vis_rgb, jnp.zeros_like(vis_rgb[:, :1])],
                              axis=1).reshape((-1,) + vis_rgb.shape[2:])
    vis_alpha = jnp.concatenate(
        [vis_alpha, jnp.zeros_like(vis_alpha[:, :1])],
        axis=1).reshape((-1,) + vis_alpha.shape[2:])

  # Matte the RGB image over the background.
  vis = vis_rgb * vis_alpha[..., None] + (bg_color * (1 - vis_alpha))[..., None]

  # Remove the final row of background pixels.
  vis = vis[:-1]
  vis_alpha = vis_alpha[:-1]
  return vis, vis_alpha

def visualize_suite(rendering, rays):
  """A wrapper around other visualizations for easy integration."""

  depth_curve_fn = lambda x: -jnp.log(x + jnp.finfo(jnp.float32).eps)

  rgb = rendering['rgb']
  acc = rendering['acc']

  distance_mean = rendering['distance_mean']
  distance_median = rendering['distance_median']
  distance_p5 = rendering['distance_percentile_5']
  distance_p95 = rendering['distance_percentile_95']
  acc = jnp.where(jnp.isnan(distance_mean), jnp.zeros_like(acc), acc)

  # The xyz coordinates where rays terminate.
  coords = rays.origins + rays.directions * distance_mean[:, :, None]

  vis_depth_mean, vis_depth_median = [
      visualize_cmap(x, acc, cm.get_cmap('turbo'), curve_fn=depth_curve_fn)
      for x in [distance_mean, distance_median]
  ]

  # Render three depth percentiles directly to RGB channels, where the spacing
  # determines the color. delta == big change, epsilon = small change.
  #   Gray: A strong discontinuitiy, [x-epsilon, x, x+epsilon]
  #   Purple: A thin but even density, [x-delta, x, x+delta]
  #   Red: A thin density, then a thick density, [x-delta, x, x+epsilon]
  #   Blue: A thick density, then a thin density, [x-epsilon, x, x+delta]
  vis_depth_triplet = visualize_cmap(
      jnp.stack(
          [2 * distance_median - distance_p5, distance_median, distance_p95],
          axis=-1),
      acc,
      None,
      curve_fn=lambda x: jnp.log(x + jnp.finfo(jnp.float32).eps))

  dist = rendering['ray_sdist']
  dist_range = (0, 1)
  weights = rendering['ray_weights']
  rgbs = [jnp.clip(r, 0, 1) for r in rendering['ray_rgbs']]

  vis_ray_colors, _ = visualize_rays(dist, dist_range, weights, rgbs)

  sqrt_weights = [jnp.sqrt(w) for w in weights]
  sqrt_ray_weights, ray_alpha = visualize_rays(
      dist,
      dist_range,
      [jnp.ones_like(lw) for lw in sqrt_weights],
      [lw[..., None] for lw in sqrt_weights],
      bg_color=0,
  )
  sqrt_ray_weights = sqrt_ray_weights[..., 0]

  null_color = jnp.array([1., 0., 0.])
  vis_ray_weights = jnp.where(
      ray_alpha[:, :, None] == 0,
      null_color[None, None],
      visualize_cmap(
          sqrt_ray_weights,
          jnp.ones_like(sqrt_ray_weights),
          cm.get_cmap('gray'),
          lo=0,
          hi=1,
          matte_background=False,
      ),
  )

  vis = {
      'color': rgb,
      'acc': acc,
      'color_matte': matte(rgb, acc),
      'depth_mean': vis_depth_mean,
      'depth_median': vis_depth_median,
      'depth_triplet': vis_depth_triplet,
      'coords_mod': visualize_coord_mod(coords, acc),
      'ray_colors': vis_ray_colors,
      'ray_weights': vis_ray_weights,
  }

  if 'rgb_cc' in rendering:
    vis['color_corrected'] = rendering['rgb_cc']

  # Render every item named "normals*".
  for key, val in rendering.items():
    if key.startswith('normals'):
      vis[key] = matte(val / 2. + 0.5, acc)

  if 'roughness' in rendering:
    vis['roughness'] = matte(jnp.tanh(rendering['roughness']), acc)

  return vis


text:
package com.github.izmailoff.marshalling.box

import akka.actor.ActorSystem
import com.github.izmailoff.logging.AkkaLoggingHelper
import net.liftweb.common.{Box, Full}
import net.liftweb.json.JsonDSL._
import net.liftweb.json._
import org.specs2.mutable.Specification
import spray.http.{ContentTypes, HttpEntity}
import spray.httpx.marshalling._

class BoxMarshallingSpec
  extends Specification
  with BoxMarshalling
  with AkkaLoggingHelper {

  implicit val globalSystem = ActorSystem()

  "The Box Marshaller" should {
    "properly marshall an empty box instance to JSON" in {
      val expectedResponse = pretty(render(("status" -> "SUCCESSFUL")))
      marshal[Box[_]](Full(())) === Right(HttpEntity(ContentTypes.`application/json`, expectedResponse))
    }

    "properly marshall a full box instance to JSON" in {
      val expectedResponse = pretty(render(("status" -> "SUCCESSFUL") ~ ("value" -> "123")))
      marshal[Box[_]](Full(123)) === Right(HttpEntity(ContentTypes.`application/json`, expectedResponse))
    }

    // TODO: add tests for all cases here
  }

}

redpajama_set_name: RedPajamaGithub


text:
import React from 'react';
import styled, { css } from 'styled-components';
import { compute, ifDefined } from '../../utils/hedron';
import * as PR from './propReceivers';
import {
  Page as HedronPage,
  Row as HedronRow,
  Column as HedronColumn
} from 'hedron';
import theme from './theme';
const { sizes, color } = theme;

/*
 * Media Queries
 * xs: < 450
 * sm: < 692
 * md: < 991
 * lg: 992 and beyound
 */

// const media = {
//   tablet: (...args) => css`
//     @media (min-width: 420px) {
//       ${ css(...args) }
//     }
//   `
// }

// Iterate through the sizes and create a media template
export const media = Object.keys(sizes).reduce((acc, label) => {
	acc[label] = (...args) => css`
		@media (max-width: ${sizes[label] / 16}em) {
			${css(...args)}
		}
	`
	return acc
}, {})

/*
 * Grid
 */
export const Page = styled(HedronPage)`
  ${props =>
    props.fluid
      ? 'width: 100%;'
      : `
    margin: 0 auto;
    max-width: 100%;
    ${props.width
      ? `width: ${props.width};`
      : `width: ${sizes.max};`
    }
    `
  }
`;

export const RowHedron = styled(HedronRow)`
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  ${ifDefined('alignContent', 'align-content')}
  ${ifDefined('alignItems', 'align-items')}
  ${ifDefined('alignSelf', 'align-self')}
  ${ifDefined('justifyContent', 'justify-content')}
  ${ifDefined('order')}
`;

export const gutter = props => css`
  padding-right: 40px;
  padding-left: 40px;
  ${media.sm`
    padding-right: 15px;
    padding-left: 15px;
  `}
`;

export const Row = styled(({
  gutter,
  gutterWhite,
  height,
  borderBottom, borderTop, borderLeft, borderRight,
  outline,
  ...rest
  }) => <RowHedron {...rest}/> )`

  ${props => props.gutter && gutter };
  ${props => css` background-color: ${props.gutterWhite ? color.white : color.lightGray}`};
  ${PR.heightProps};
  ${PR.borderProps};
  ${PR.outlineProps};
`;

export const Column = styled(({
  outline, ...rest
  }) => <HedronColumn {...rest}/>)`
  display: block;
  ${props => props.debug
    ? `background-color: rgba(50, 50, 255, .1);
  outline: 1px solid #fff;`
    : ''
  }
  box-sizing: border-box;
  padding: 0;
  width: 100%;
  ${compute('xs')}
  ${compute('sm')}
  ${compute('md')}
  ${compute('lg')}
  ${PR.outlineProps}
`;


text:
#ifndef itkCudaMemoryProbe_h
#define itkCudaMemoryProbe_h

#include "itkResourceProbe.h"
#include "itkIntTypes.h"
#include "itkCudaWin32Header.h"

namespace itk
{
/** \class CudaMemoryProbe
 *
 *  \brief Computes the Cuda memory allocated between two points in code.
 *
 *   This class allows the user to trace the Cuda memory charge between the
 *   execution of two pieces of code. It can be started and stopped in order to
 *   evaluate the execution over multiple passes. The values of memory are
 *   taken from cudaMemGetInfo.
 *
 * \ingroup ITKCudaCommon
 */
class ITKCudaCommon_EXPORT CudaMemoryProbe : public ResourceProbe<OffsetValueType, double>
{
public:
  CudaMemoryProbe();
  ~CudaMemoryProbe() override;

  /** Type for measuring memory. */
  using CudaMemoryLoadType = OffsetValueType;

  /** Type for measuring the average memory. */
  using MeanCudaMemoryLoadType = double;

protected:
  CudaMemoryLoadType
  GetInstantValue() const override;
};
} // end namespace itk

#endif // itkCudaMemoryProbe_h


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Encryptor.cs" company="Naos Project">
//    Copyright (c) Naos Project 2019. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Naos.Database.SqlServer.Domain
{
    using System.Diagnostics.CodeAnalysis;

    /// <summary>
    /// Specifies the encryptor to use when encrypting backups.
    /// </summary>
    [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Encryptor", Justification = "Spelling/name is correct.")]
    public enum Encryptor
    {
        /// <summary>
        /// No encryptor.
        /// </summary>
        None,

        /// <summary>
        /// Backup using a server certificate.
        /// </summary>
        ServerCertificate,

        /// <summary>
        /// Backup using an asymmetric key.
        /// </summary>
        ServerAsymmetricKey,
    }
}


text:
  Эта опция контролирует количество одновременных сборок, которые может производить Hudson.
  Таким образом, значение определяет результирующую нагрузку на сервер, которую может
  вызвать. Для начала установите это значение равным количеству процессоров в вашей системе.

  Увеличивая это значение далее, вы можете заметить увеличение продолжительности каждой
  сборки, однако результирующая пропускная способность увеличитcя, так как это позволит
  процессору выполнять одну из сборок в то время как другая сборка ожидает
  окончания операции ввода-вывода.

  Используя Hudson в режиме мастер/рабочий, установка значения в 0 запретит мастеру
  выполнять сборки самостоятельно.


text:
#ifndef ROS_TRIGGER_H_
#define ROS_TRIGGER_H_

#include <industrial_extrinsic_cal/trigger.h>
#include <ros/console.h>
#include <actionlib/client/simple_action_client.h>
#include <industrial_extrinsic_cal/trigger.h>
#include <industrial_extrinsic_cal/manual_triggerAction.h>
#include <industrial_extrinsic_cal/robot_joint_values_triggerAction.h>
#include <industrial_extrinsic_cal/robot_pose_triggerAction.h>
#include <industrial_extrinsic_cal/camera_observer_trigger.h>

namespace industrial_extrinsic_cal
{
class ROSParamTrigger : public Trigger
{
public:
  /*! \brief Constructor,
   * @param parameter_name, name of trigger
   */
  ROSParamTrigger(const std::string& parameter_name)
  {
    parameter_name_ = parameter_name;
    nh_.setParam(parameter_name_.c_str(), false);
  };
  /*! \brief Destructor
   */
  ~ROSParamTrigger(){};
  /*! \brief Initiates and waits for trigger to finish
   */
  bool waitForTrigger()
  {
    ROS_INFO("ROSParamTrigger:  waiting for %s to be true", parameter_name_.c_str());
    bool pval = false;
    while (!pval)
    {
      nh_.getParam(parameter_name_.c_str(), pval);
    }
    nh_.setParam(parameter_name_.c_str(), false);
    return (true);
  };

private:
  ros::NodeHandle nh_;
  std::string parameter_name_;
};

typedef actionlib::SimpleActionClient<industrial_extrinsic_cal::manual_triggerAction> ManualClient;

class ROSActionServerTrigger : public Trigger
{
public:
  /*! \brief Constructor,
   * @param server_name, name of tigger service
   * @param action_message message to display
   */
  ROSActionServerTrigger(const std::string& server_name, const std::string& action_message)
  {
    server_name_ = server_name;
    action_message_ = action_message;
    client_ = new ManualClient(server_name_.c_str(), true);
  };

  /*! \brief Destructor
   */
  ~ROSActionServerTrigger(){};

  /*! \brief Initiates and waits for trigger to finish
   */
  bool waitForTrigger()
  {
    ROS_INFO("ROSActionServerTrigger: waiting for trigger server %s to complete ", server_name_.c_str());
    client_->waitForServer();
    industrial_extrinsic_cal::manual_triggerGoal goal;
    goal.display_message = action_message_;
    client_->sendGoal(goal);
    do
    {
      client_->waitForResult(ros::Duration(5.0));
      ROS_INFO("Current State: %s", client_->getState().toString().c_str());
    } while (client_->getState() != actionlib::SimpleClientGoalState::SUCCEEDED &&
             client_->getState() != actionlib::SimpleClientGoalState::ABORTED);
    return (true); /**< TODO implement a timeout, cancels action and with returns false*/
  };

private:
  ManualClient* client_;
  ros::NodeHandle nh_;         /**< node handle */
  std::string server_name_;    /**< name of server */
  std::string action_message_; /**< message sent to action server, often displayed by that server */
};

typedef actionlib::SimpleActionClient<industrial_extrinsic_cal::robot_joint_values_triggerAction>
    RobotJointValuesClient;

class ROSRobotJointValuesActionServerTrigger : public Trigger
{
public:
  /*! \brief Constructor,
   *  @param server name , name of server
   *  @param joint_values, vector of joint values describing the pose of the robot for the trigger
   */
  ROSRobotJointValuesActionServerTrigger(const std::string& server_name, const std::vector<double>& joint_values)
  {
    server_name_ = server_name;
    joint_values_.clear();
    for (int i = 0; i < (int)joint_values.size(); i++)
    {
      joint_values_.push_back(joint_values[i]);
    }
    client_ = new RobotJointValuesClient(server_name_.c_str(), true);
  };

  /*! \brief Destructor
   */
  ~ROSRobotJointValuesActionServerTrigger()
  {
    delete (client_);
  };

  /*! \brief Initiates and waits for trigger to finish
   */
  bool waitForTrigger()
  {
    ROS_INFO("ROSRobotJointValuesActionServerTrigger: waiting for trigger server %s to complete ",
             server_name_.c_str());
    client_->waitForServer();
    industrial_extrinsic_cal::robot_joint_values_triggerGoal goal;
    goal.joint_values.clear();
    for (int i = 0; i < (int)joint_values_.size(); i++)
    {
      goal.joint_values.push_back(joint_values_[i]);
    }
    ROS_INFO("SENDING GOAL");
    client_->sendGoal(goal);
    do
    {
      client_->waitForResult(ros::Duration(5.0));
      ROS_INFO("Current State: %s", client_->getState().toString().c_str());
    } while (client_->getState() != actionlib::SimpleClientGoalState::SUCCEEDED &&
             client_->getState() != actionlib::SimpleClientGoalState::ABORTED);
    return (true); /**< TODO implement a timeout, cancels action and with returns false*/
  };

private:
  RobotJointValuesClient* client_;
  ros::NodeHandle nh_;               /**< node handle */
  std::string server_name_;          /**< name of server */
  std::vector<double> joint_values_; /**< joint values */
};

typedef actionlib::SimpleActionClient<industrial_extrinsic_cal::robot_pose_triggerAction> Robot_Pose_Client;

class ROSRobotPoseActionServerTrigger : public Trigger
{
public:
  /*! \brief Constructor,
   *   @param server_name name of the service
   *   @param pose the pose of the robot for the trigger
   */
  ROSRobotPoseActionServerTrigger(const std::string& server_name, const Pose6d pose)
  {
    server_name_ = server_name;
    joint_values_.clear();
    pose_.position.x = pose.x;
    pose_.position.y = pose.y;
    pose_.position.z = pose.z;
    double qx, qy, qz, qw;
    pose.getQuaternion(qx, qy, qz, qw);
    pose_.orientation.x = qx;
    pose_.orientation.y = qy;
    pose_.orientation.z = qz;
    pose_.orientation.w = qw;
    client_ = new Robot_Pose_Client(server_name_.c_str(), true);
  };

  /*! \brief Destructor
   */
  ~ROSRobotPoseActionServerTrigger(){};

  /*! \brief Initiates and waits for trigger to finish
   */
  bool waitForTrigger()
  {
    ROS_INFO("ROSRobotPoseActionServerTrigger: waiting for trigger server %s to complete ", server_name_.c_str());
    client_->waitForServer();
    industrial_extrinsic_cal::robot_pose_triggerGoal goal;
    goal.pose = pose_;
    client_->sendGoal(goal);
    do
    {
      client_->waitForResult(ros::Duration(5.0));
      ROS_INFO("Current State: %s", client_->getState().toString().c_str());
    } while (client_->getState() != actionlib::SimpleClientGoalState::SUCCEEDED &&
             client_->getState() != actionlib::SimpleClientGoalState::ABORTED);
    return (true); /**< TODO implement a timeout, cancels action and with returns false*/
  };

private:
  Robot_Pose_Client* client_;
  ros::NodeHandle nh_;               /**< node handle */
  std::string server_name_;          /**< name of server */
  geometry_msgs::Pose pose_;         /**< pose of robot */
  std::vector<double> joint_values_; /**< joint values */
};

class ROSCameraObserverTrigger : public Trigger
{
public:
  /*! \brief Constructor,
   *   @param service_name name of service
   *    @param instructions a message for the user
   *    @param image_topic the image to use and display to user to accept the trigger
   *    @param roi the region of interest in the image displayed to the user
   */
  ROSCameraObserverTrigger(const std::string& service_name, const std::string& instructions,
                           const std::string& image_topic, const Roi& roi)
  {
    nh_ = new ros::NodeHandle;
    service_name_ = service_name;
    instructions_ = instructions;
    image_topic_ = image_topic;
    client_ = nh_->serviceClient<industrial_extrinsic_cal::camera_observer_trigger>(service_name_.c_str());
    roi_ = roi;
  };

  /*! \brief Destructor
   */
  ~ROSCameraObserverTrigger(){};

  /*! \brief Initiates and waits for trigger to finish
   */
  bool waitForTrigger()
  {
    industrial_extrinsic_cal::camera_observer_trigger::Request request;
    industrial_extrinsic_cal::camera_observer_trigger::Response response;

    ROS_INFO("ROSRobotPoseActionServerTrigger: waiting for trigger server %s to complete ", service_name_.c_str());
    request.image_topic = image_topic_;
    request.instructions = instructions_;
    request.roi_min_x = roi_.x_min;
    request.roi_max_x = roi_.x_max;
    request.roi_min_y = roi_.y_min;
    request.roi_max_y = roi_.y_max;

    if (!client_.call(request, response))
    {
      ROS_ERROR("Trigger failed");
    }
    return (true); /**< TODO implement a timeout, cancels action and with returns false*/
  };

private:
  ros::ServiceClient client_;         /**< the client to call supplying this trigger */
  ros::NodeHandle* nh_;               /**< node handle */
  std::string service_name_;          /**< name of server */
  std::string instructions_;          /**< instructions to display to user */
  std::string image_topic_;           /**< image from this ros topic used to find target within the given roi */
  industrial_extrinsic_cal::Roi roi_; /**< region to find the target */
};

}  // end of namespace

#endif


text:
import React, { Component } from 'react';
import { reduxForm, propTypes } from 'redux-form';
import loginValidation from './loginValidation';
import { Button } from 'react-bootstrap';
@reduxForm({
  form: 'login',
  fields: ['email', 'password'],
  validate: loginValidation
})
export default class LoginForm extends Component {
  static propTypes = {
    ...propTypes
  }

  state = {
    showPassword: false
  }

  handleCheckbox = () => {
    this.setState({
      showPassword: !this.state.showPassword
    });
  }

  render() {
    const {
      handleCheckbox,
      props: {
        fields: {
          password: {
            onBlur,
            onChange,
            onDragStart,
            onDrop,
            onFocus,
            onUpdate,
            error: passwordError,
            touched,
            name
          }
        },
        handleSubmit,
        error
      },
      state: {
        showPassword,
      },
    } = this;

    return (
      <form className="form-horizontal" onSubmit={handleSubmit}>
        <div className={`form-group ${error && touched ? 'has-error' : ''}`}>

            <input
              type={showPassword ? 'text' : 'password'}
              className="form-control"
              name={name}
              onBlur={onBlur}
              onChange={onChange}
              onDragStart={onDragStart}
              onDrop={onDrop}
              onFocus={onFocus}
              onUpdate={onUpdate}
            />
            {passwordError && touched &&
{passwordError}
}

              (Password is the same as before)

          <input
            type="checkbox"
            checked={showPassword}
            onChange={handleCheckbox}
            style={{
              marginRight: 10
            }}
          />

        Show password

        {error &&
{error}
}

          <Button
            block
            type="submit"
            bsSize="large"
            bsStyle="success"
          >
            {' '}Go
          </Button>

      </form>
    );
  }
}


text:
Additional header content

A Specialization of WriterModelBase class.
 Which acts as the base class for different writers.
 Represents an exporter based on a custom writer.

## Inheritance Hierarchy
System.Object
  iTin.Export.Model.BaseModel(WriterModelBase)
    iTin.Export.Model.WriterModelBase
      iTin.Export.Model.WriterModel
        iTin.Export.Model.TemplateWriterModel

**Namespace:** iTin.Export.Model
**Assembly:** iTin.Export.Core (in iTin.Export.Core.dll) Version: 2.0.0.0 (2.0.0.0)

## Syntax

**C#**

``` C#
[SerializableAttribute]
public class WriterModel : WriterModelBase
```

**VB**

``` VB
<SerializableAttribute>
Public Class WriterModel
	Inherits WriterModelBase
```

The WriterModel type exposes the following members.

## Constructors

	Name	Description

![Public method](media/pubmethod.gif "Public method")	WriterModel
Initializes a new instance of the WriterModel class

Back to Top

## Properties

	Name	Description

![Public property](media/pubproperty.gif "Public property")	Filter
Gets or sets a referenceto set of properties that allow you to specify a writer.
 (Inherited from WriterModelBase.)

![Public property](media/pubproperty.gif "Public property")	Name
Gets or sets the name of the writer.

![Public property](media/pubproperty.gif "Public property")	Properties
Gets or sets a reference to user-defined property list for this element.
 (Inherited from BaseModel(T).)

Back to Top

## Methods

	Name	Description

![Public method](media/pubmethod.gif "Public method")	Equals	 (Inherited from Object.)

![Protected method](media/protmethod.gif "Protected method")	Finalize	 (Inherited from Object.)

![Public method](media/pubmethod.gif "Public method")	GetHashCode	 (Inherited from Object.)

![Protected method](media/protmethod.gif "Protected method")	GetStaticBindingValue
Gets the static binding value by reflection.
 (Inherited from BaseModel(T).)

![Public method](media/pubmethod.gif "Public method")	GetType	 (Inherited from Object.)

![Protected method](media/protmethod.gif "Protected method")	MemberwiseClone	 (Inherited from Object.)

![Public method](media/pubmethod.gif "Public method")	SaveToFile(String)
Saves to file.
 (Inherited from BaseModel(T).)

![Public method](media/pubmethod.gif "Public method")	SaveToFile(String, Exception)
Serializes current BaseModel object into file
 (Inherited from BaseModel(T).)

![Public method](media/pubmethod.gif "Public method")	Serialize
Serializes current BaseModel object into an Xml document.
 (Inherited from BaseModel(T).)

![Public method](media/pubmethod.gif "Public method")	ToString
Returns a string that represents the current object.
 (Inherited from BaseModel(T).)

Back to Top

## Remarks

The following table shows different data fields.

Class	Description

TemplateWriterModel	Represents a template writer used by a exporter.

Belongs to: `Exporter`. For more information, please see ExporterModel.
**ITEE Object Element Usage**

``` XML
<Writer>
  <Filter/>
</Writer>
```

Attributes

Attribute	Optional	Description

Name	No	Name of the writer. Select from the list or create your own and use it.

Elements

Element	Description

Filter	Reference to set of properties that allow you to specify a writer.

## See Also

#### Reference
iTin.Export.Model Namespace


text:
package com.facebook.buck.android;

import static org.junit.Assert.assertTrue;

import com.facebook.buck.core.model.BuildTargetFactory;
import com.facebook.buck.core.model.impl.BuildTargetPaths;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.io.filesystem.TestProjectFilesystems;
import com.facebook.buck.jvm.java.testutil.AbiCompilationModeTest;
import com.facebook.buck.testutil.ProcessResult;
import com.facebook.buck.testutil.TemporaryPaths;
import com.facebook.buck.testutil.integration.ProjectWorkspace;
import com.facebook.buck.testutil.integration.TestDataHelper;
import com.facebook.buck.testutil.integration.ZipInspector;
import com.google.common.base.Joiner;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

public class AndroidBinaryAssetsIntegrationTest extends AbiCompilationModeTest {

  @Rule public TemporaryPaths tmpFolder = new TemporaryPaths();

  private ProjectWorkspace workspace;

  private ProjectFilesystem filesystem;

  private static final String SIMPLE_TARGET = "//apps/multidex:app";

  @Before
  public void setUp() throws InterruptedException, IOException {
    AssumeAndroidPlatform.assumeSdkIsAvailable();
    AssumeAndroidPlatform.assumeNdkIsAvailable();
    workspace =
        TestDataHelper.createProjectWorkspaceForScenario(
            new AndroidBinaryAssetsIntegrationTest(), "android_project", tmpFolder);
    workspace.setUp();
    setWorkspaceCompilationMode(workspace);
    filesystem = TestProjectFilesystems.createProjectFilesystem(workspace.getDestPath());
  }

  @Test
  public void testAppHasAssets() throws IOException {
    Path apkPath = workspace.buildAndReturnOutput(SIMPLE_TARGET);

    ZipInspector zipInspector = new ZipInspector(workspace.getPath(apkPath));
    zipInspector.assertFileExists("assets/asset_file.txt");
    zipInspector.assertFileExists("assets/hilarity.txt");
    zipInspector.assertFileContents(
        "assets/hilarity.txt",
        workspace.getFileContents("res/com/sample/base/buck-assets/hilarity.txt"));

    // Test that after changing an asset, the new asset is in the apk.
    String newContents = "some new contents";
    workspace.writeContentsToPath(newContents, "res/com/sample/base/buck-assets/hilarity.txt");
    workspace.buildAndReturnOutput(SIMPLE_TARGET);
    zipInspector = new ZipInspector(workspace.getPath(apkPath));
    zipInspector.assertFileContents("assets/hilarity.txt", newContents);
  }

  @Test
  public void testAppAssetsAreCompressed() throws IOException {
    // Small files don't get compressed. Make something a bit bigger.
    String largeContents =
        Joiner.on("\n").join(Collections.nCopies(100, "A boring line of content."));
    workspace.writeContentsToPath(largeContents, "res/com/sample/base/buck-assets/hilarity.txt");

    Path apkPath = workspace.buildAndReturnOutput(SIMPLE_TARGET);
    ZipInspector zipInspector = new ZipInspector(workspace.getPath(apkPath));
    zipInspector.assertFileExists("assets/asset_file.txt");
    zipInspector.assertFileExists("assets/hilarity.txt");
    zipInspector.assertFileContents(
        "assets/hilarity.txt",
        workspace.getFileContents("res/com/sample/base/buck-assets/hilarity.txt"));
    zipInspector.assertFileIsCompressed("assets/hilarity.txt");
  }

  @Test
  public void testAppUncompressableAssetsAreNotCompressed() throws IOException {
    // Small files don't get compressed. Make something a bit bigger.
    String largeContents =
        Joiner.on("\n").join(Collections.nCopies(100, "A boring line of content."));
    workspace.writeContentsToPath(largeContents, "res/com/sample/base/buck-assets/movie.mp4");

    Path apkPath = workspace.buildAndReturnOutput(SIMPLE_TARGET);
    ZipInspector zipInspector = new ZipInspector(workspace.getPath(apkPath));
    zipInspector.assertFileExists("assets/asset_file.txt");
    zipInspector.assertFileExists("assets/movie.mp4");
    zipInspector.assertFileContents(
        "assets/movie.mp4", workspace.getFileContents("res/com/sample/base/buck-assets/movie.mp4"));
    zipInspector.assertFileIsNotCompressed("assets/movie.mp4");
  }

  @Test
  public void testGzAssetsAreRejected() throws IOException {
    workspace.writeContentsToPath("some contents", "res/com/sample/base/buck-assets/zipped.gz");

    ProcessResult result = workspace.runBuckBuild(SIMPLE_TARGET);
    result.assertFailure();
    assertTrue(result.getStderr().contains("zipped.gz"));
  }

  @Test
  public void testCompressAssetLibs() throws IOException {
    String target = "//apps/sample:app_compress_lib_asset";
    workspace.runBuckCommand("build", target).assertSuccess();
    ZipInspector zipInspector =
        new ZipInspector(
            workspace.getPath(
                BuildTargetPaths.getGenPath(
                    filesystem, BuildTargetFactory.newInstance(target), "%s.apk")));
    zipInspector.assertFileExists("assets/lib/libs.xzs");
    zipInspector.assertFileExists("assets/lib/metadata.txt");
    zipInspector.assertFileDoesNotExist("assets/lib/x86/libnative_cxx_libasset.so");
    zipInspector.assertFileDoesNotExist("lib/x86/libnative_cxx_libasset.so");
    zipInspector.assertFileExists("lib/x86/libnative_cxx_foo1.so");
    zipInspector.assertFileExists("lib/x86/libnative_cxx_foo2.so");
    zipInspector.assertFileDoesNotExist("assets/lib/x86/libnative_cxx_foo1.so");
    zipInspector.assertFileDoesNotExist("assets/lib/x86/libnative_cxx_foo2.so");
  }
}


text:
( function() {

	var TodoApp = React.createClass( {displayName: "TodoApp",
		getInitialState: function() {

			// Load todo list from localStorage
			// else use default
			return {
				"todos": localStorage.todos ?
				JSON.parse( localStorage.todos ) :
				[
					{
						"name": "Today",
						"color": "rgba(255,255,255,0.1)",
						"list": [
							{ "todo": "todo1", "done": false },
							{ "todo": "todo2", "done": false }
						]
					},
					{
						"name": "Monday",
						"color": "rgba(255,255,255,0.1)",
						"list": [
							{ "todo": "todo1", "done": false },
							{ "todo": "todo2", "done": false }
						]
					},
					{
						"name": "Tuesday",
						"color": "rgba(255,255,255,0.1)",
						"list": [
							{ "todo": "todo1", "done": false },
							{ "todo": "todo2", "done": false }
						]
					},
					{
						"name": "Wednesday",
						"color": "rgba(255,255,255,0.1)",
						"list": [
							{ "todo": "todo1", "done": false },
							{ "todo": "todo2", "done": false }
						]
					},
					{
						"name": "Thursday",
						"color": "rgba(255,255,255,0.1)",
						"list": [
							{ "todo": "todo1", "done": false },
							{ "todo": "todo2", "done": false }
						]
					},
					{
						"name": "Friday",
						"color": "rgba(255,255,255,0.1)",
						"list": [
							{ "todo": "todo1", "done": false },
							{ "todo": "todo2", "done": false }
						]
					},
					{
						"name": "Saturday",
						"color": "rgba(255,255,255,0.1)",
						"list": [
							{ "todo": "todo1", "done": false },
							{ "todo": "todo2", "done": false }
						]
					},
					{
						"name": "Sunday",
						"color": "rgba(255,255,255,0.1)",
						"list": [
							{ "todo": "todo1", "done": false },
							{ "todo": "todo2", "done": false }
						]
					}
				]
			};

		},
		handleSaveToStorage: function( e ) {

			// to local storage
			var todos = JSON.stringify( this.state.todos );

			localStorage.setItem( "todos", todos );

		},
		handleSaveAsFile: function( e ) {

			// as file
			var todos = JSON.stringify( this.state.todos );
			var blob = new Blob(
				[ todos ],
				{ "type": "text/plain;charset=utf-8" }
			);

			// Uses FileSaver.js
			// https://github.com/eligrey/FileSaver.js
			saveAs( blob, "todos.txt" );

		},
		handleLoadFromFile: function( e ) {

			var fileInput = e.target.files[ 0 ];
			var textType = /text.*/;
			var todos = "";

			if ( fileInput.type.match( textType ) ) {

				var reader = new FileReader();

				reader.onload = function( e ) {

					todos = JSON.parse( reader.result );

					this.setState( { "todos": todos } );

				}.bind( this );

				reader.readAsText( fileInput );

			} else {

				alert( "File not supported!" );

			}

		},
		handleNewTodoBox: function( todoLabel ) {

			var newTodos = this.state.todos.concat( [
				{
					name: todoLabel,
					color: "rgba(255,255,255,0.1)",
					list: [
						{ "todo": "todo1", "done": false },
						{ "todo": "todo2", "done": false }
					]
				}
			] );

			this.setState( { "todos": newTodos } );

		},
		handleRemoveTodoBox: function( todoLabel ) {

			var newTodos = this.state.todos.slice();
			var indexOfTodoToRemove = null;

			newTodos.forEach( function( todoInfo, i ) {

				if ( todoInfo.name === todoLabel ) {

					indexOfTodoToRemove = i;

				}

			} );

			newTodos.splice( indexOfTodoToRemove, 1 );

			this.setState( { "todos": newTodos } );

		},
		handleNewTodoItem: function( todoLabel, todo ) {

			var newTodos = this.state.todos.slice();

			newTodos.forEach( function( todoInfo ) {

				if ( todoInfo.name === todoLabel ) {

					todoInfo.list = todoInfo.list.concat( [
						{ "todo": todo, "done": false }
					] );

				}

			} );

			this.setState( { "todos": newTodos } );

		},
		handleRemoveTodoItem: function( todoLabel, todo ) {

			var newTodos = this.state.todos.slice();

			newTodos.forEach( function( todoInfo ) {

				if ( todoInfo.name === todoLabel ) {

					var newListForTodo = todoInfo.list.slice();
					var indexOfTodoItemToRemove = null;

					newListForTodo.forEach( function( todoItem, i ) {

						if ( todoItem.todo === todo.todo ) {

							indexOfTodoItemToRemove = i;

						}

					} );

					newListForTodo.splice( indexOfTodoItemToRemove, 1 );

					todoInfo.list = newListForTodo;

				}

			} );

			this.setState( { "todos": newTodos } );

		},
		handleColorChange: function( name, color ) {

			var newTodos = this.state.todos.slice();

			newTodos.forEach( function( todo ) {

				if ( todo.name === name ) {

					todo.color = "#" + color;

				}

			} );

			this.setState( { "todos": newTodos } );

		},
		render: function() {

			return (
				React.createElement("div", null,
					React.createElement(TodoMenu, {onSaveToStorage:  this.handleSaveToStorage,
						onSaveAsFile:  this.handleSaveAsFile,
						onLoadFromFile:  this.handleLoadFromFile,
						onNewTodoBox:  this.handleNewTodoBox}),
					React.createElement(TodoBoxes, {todos:  this.state.todos,
						onRemoveTodoBox:  this.handleRemoveTodoBox,
						onNewTodoItem:  this.handleNewTodoItem,
						onRemoveTodoItem:  this.handleRemoveTodoItem,
						handleColorChange:  this.handleColorChange})
				)
			);

		}
	} );

	var TodoMenu = React.createClass( {displayName: "TodoMenu",
		onSaveToStorage: function( e ) {

			this.props.onSaveToStorage( e );

		},
		onSaveAsFile: function( e ) {

			this.props.onSaveAsFile( e );

		},
		onLoadFromFile: function( e ) {

			this.props.onLoadFromFile( e );

		},
		onNewTodoBox: function( e ) {

			e.preventDefault();

			var todoLabelInput = this.refs.todoLabel.getDOMNode();
			var todoLabel = todoLabelInput.value.trim();

			this.props.onNewTodoBox( todoLabel );

			todoLabelInput.value = "";

		},
		render: function() {

			return (
				React.createElement("div", {className: "todo-menu-container pure-form"},
					React.createElement("label", {for: "load-file-input"},
						React.createElement("i", {className: "fa fa-upload"}),
						React.createElement("input", {type: "file",
							id: "load-file-input",
							className: "pure-button pure-button-primary",
							onChange:  this.onLoadFromFile,
							ref: "loadTodoFileInput"})
					),
					React.createElement("button", {id: "save-storage-button",
						className: "pure-button pure-button-primary",
						onClick:  this.onSaveToStorage},
						React.createElement("i", {className: "fa fa-floppy-o"}),
						"> Local Storage"
					),
					React.createElement("button", {id: "save-file-button",
						className: "pure-button pure-button-primary",
						onClick:  this.onSaveAsFile},
						React.createElement("i", {className: "fa fa-floppy-o"}),
						"> File"
					),
					React.createElement("form", {id: "add-todo-box-form",
						onSubmit:  this.onNewTodoBox},
						React.createElement("input", {type: "text", ref: "todoLabel",
							placeholder: "Add new todo list"})
					)
				)
			);

		}
	} );

	var TodoBoxes = React.createClass( {displayName: "TodoBoxes",
		render: function() {

			var onRemoveTodoBox = this.props.onRemoveTodoBox;
			var onNewTodoItem = this.props.onNewTodoItem;
			var onRemoveTodoItem = this.props.onRemoveTodoItem;
			var handleColorChange = this.props.handleColorChange;
			var todoBoxes = this.props.todos.map(
				function( todo ) {
					return (
						React.createElement(TodoBox, {
							todo: todo,
							onRemoveTodoBox: onRemoveTodoBox,
							onNewTodoItem: onNewTodoItem,
							onRemoveTodoItem: onRemoveTodoItem,
							handleColorChange: handleColorChange })
					);
				}
			);

			return (
				React.createElement("div", {className: "todo-list-container pure-g"},
					todoBoxes
				)
			);

		}
	} );

	var TodoBox = React.createClass( {displayName: "TodoBox",
		getInitialState: function() {

			return {
				showControls: false
			};

		},
		getMinHeight: function( list ) {

			return 70 + ( list.length * 25 );

		},
		handleUpdateTodoBoxSize: function() {

			var todoBoxDiv = this.refs.todoBox.getDOMNode();
			var todoList = this.props.todo.list;

			$( todoBoxDiv ).resizable( "option", "minHeight",
				this.getMinHeight( todoList ) );

		},
		showControls: function() {

			this.setState( { "showControls": true } );

		},
		hideControls: function() {

			this.setState( { "showControls": false } );

		},
		render: function() {

			var todoData = this.props.todo;
			var todoBoxStyle = {
				"background-color": todoData.color
			};

			return (
				React.createElement("div", {ref: "todoBox",
					style: todoBoxStyle,
					className: "todo-box pure-u-1-3",
					onMouseEnter:  this.showControls,
					onMouseLeave:  this.hideControls},
					React.createElement(TodoForm, {name:  todoData.name,
						showControls:  this.state.showControls,
						onRemoveTodoBox:  this.props.onRemoveTodoBox,
						onNewTodoItem:  this.props.onNewTodoItem,
						updateTodoBoxSize:  this.handleUpdateTodoBoxSize,
						handleColorChange:  this.props.handleColorChange}),
					React.createElement(TodoList, {name:  todoData.name,
						list:  todoData.list,
						onRemoveTodoItem:  this.props.onRemoveTodoItem})
				)
			);

		},
		componentDidMount: function() {

			var todoBoxDiv = this.refs.todoBox.getDOMNode();

			$( todoBoxDiv ).resizable( {
				minHeight: this.getMinHeight( this.props.todo.list )
			} );

		}
	} );

	var TodoForm = React.createClass( {displayName: "TodoForm",
		getInitialState: function() {

			return {
				showControls: false
			};

		},
		onRemoveTodoBox: function() {

			var props = this.props;
			var todoLabel = props.name;

			props.onRemoveTodoBox( todoLabel );

		},
		handleSubmit: function( e ) {

			e.preventDefault();

			var todoLabel = this.props.name;
			var newTodo = this.refs.newTodo.getDOMNode().value.trim();

			this.props.onNewTodoItem( todoLabel, newTodo );
			this.props.updateTodoBoxSize();

			this.refs.newTodo.getDOMNode().value = "";

		},
		showControls: function() {

			this.setState( { "showControls": true } );

		},
		hideControls: function() {

			this.setState( { "showControls": false } );

		},
		render: function() {

			var removeButtonClass = this.state.showControls ?
				"fa fa-minus-square" : "hide";
			var formClass = this.props.showControls ?
				"todo-item-add-form pure-form" : "hide";

			return (
				React.createElement("div", {className: "todo-label",
					onMouseEnter:  this.showControls,
					onMouseLeave:  this.hideControls},
					React.createElement("i", {className: removeButtonClass,
						onClick:  this.onRemoveTodoBox}
					),
					 this.props.name,
					React.createElement("input", {className: "color colorPicker",
						ref: "colorPicker"}),
					React.createElement("form", {className: formClass,
						onSubmit:  this.handleSubmit},
						React.createElement("input", {type: "text", ref: "newTodo",
							className: "todo-add-input pure-input-1",
							placeholder: "add new item"})
					)
				)
			);

		},
		componentDidMount: function() {

			var colorPickerInput = this.refs.colorPicker.getDOMNode();

			colorPickerInput.onchange = this.handleColorChange;

		},
		handleColorChange: function( e ) {

			this.props.handleColorChange( this.props.name, e.target.value );

		}
	} );

	var TodoList = React.createClass( {displayName: "TodoList",
		render: function() {

			var todoLabel = this.props.name;
			var onRemoveTodoItem = this.props.onRemoveTodoItem;
			var todos = this.props.list.map(
				function( todo ) {
					return (
						React.createElement("li", null,
							React.createElement(TodoItem, {name: todoLabel,
								todo: todo,
								onRemoveTodoItem: onRemoveTodoItem })
						)
					);
				}
			);

			return (
				React.createElement("div", {className: "todo-list"},
					React.createElement("ul", null,
						todos
					)
				)
			);

		}
	} );

	var TodoItem = React.createClass( {displayName: "TodoItem",
		getInitialState: function() {

			return {
				isDone: this.props.todo.done,
				showRemoveButton: false
			};

		},
		onChange: function( e ) {

			this.setState( {
				isDone: !this.state.isDone
			} );

		},
		handleRemoveTodoItem: function( e ) {

			e.preventDefault();

			var todoLabel = this.props.name;
			var todo = this.props.todo;

			this.props.onRemoveTodoItem( todoLabel, todo );

		},
		showRemoveButton: function() {

			this.setState( { "showRemoveButton": true } );

		},
		hideRemoveButton: function() {

			this.setState( { "showRemoveButton": false } );

		},
		render: function() {

			var todoInfo = this.props.todo;
			var removeButtonClass = this.state.showRemoveButton ?
				"todo-item-remove-button" : "hide";

			return (
				React.createElement("div", {className: "todo-item",
					onMouseEnter:  this.showRemoveButton,
					onMouseLeave:  this.hideRemoveButton},
					React.createElement("input", {type: "checkbox",
						checked:  this.state.isDone,
						onChange:  this.onChange}),
					React.createElement("div", {className: "todo-item-info"},
						 todoInfo.todo
					),
					React.createElement("button", {id: "todo-item-remove-button",
						className: removeButtonClass,
						onClick:  this.handleRemoveTodoItem},
						React.createElement("i", {className: "fa fa-minus-square"})
					)
				)
			);

		}
	} );

	React.render(
		React.createElement(TodoApp, null),
		document.getElementById( "app" )
	);

} )( );


text:
/*
 * Author: eranr
 */
package com.ibm.storlet.test;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import com.ibm.storlet.common.IStorlet;
import com.ibm.storlet.common.StorletException;
import com.ibm.storlet.common.StorletInputStream;
import com.ibm.storlet.common.StorletLogger;
import com.ibm.storlet.common.StorletOutputStream;
import com.ibm.storlet.common.StorletObjectOutputStream;

public class test1 implements IStorlet{
	/***
	 * Storlet invoke method.
	 * @throws InterruptedException
	 */
	@Override
	public void invoke(ArrayList<StorletInputStream>  inputStreams,
	                   ArrayList<StorletOutputStream> outputStreams,
			           Map<String, String>            params,
			           StorletLogger                  logger)
			                                          throws StorletException
    {
		try{
			logger.emitLog("In test invoke!");
			logger.emitLog("Iterating over params");
			for (Map.Entry<String,String> entry : params.entrySet())
			{
				String key = entry.getKey();
				String value = entry.getValue();
				logger.emitLog(key+ ":"+value);
			}
            StorletInputStream sins = inputStreams.get(0);
            HashMap<String, String> md = sins.getMetadata();
			StorletObjectOutputStream outStream = (StorletObjectOutputStream)
			                                      outputStreams.get(0);
			outStream.setMetadata( md );
			OutputStream stream = outStream.getStream();
			logger.emitLog("About to get param op");
			String op = params.get("op");
			if (op == null) {
				logger.emitLog("No op raising...");
				throw new StorletException("no op in params");
			}
			logger.emitLog("Got op " + op);
			if (op.equals("print")) {
				logger.emitLog("op = print");
				String key;
				String value;
				String s;
				for (Map.Entry<String,String> entry : params.entrySet()) {
					key = entry.getKey();
					stream.write(key.getBytes());
					s = "    ";
					stream.write(s.getBytes());
					value = entry.getValue();
					stream.write(value.getBytes());
					s="\n";
					stream.write(s.getBytes());
				}
				stream.close();
				return;
			}

			if (op.equals("crash")) {
				InputStream a = null;
				a.close();
				return;
			}

			if (op.equals("hold")) {
				Thread.sleep(100000);
			}
			outStream.getStream().close();

		} catch (IOException e) {
			logger.emitLog(e.getMessage());
			throw new StorletException(e.getMessage());
		} catch (InterruptedException e) {
			logger.emitLog(e.getMessage());
			throw new StorletException(e.getMessage());
		}
	}
}


text:
require 'rails_helper'

RSpec.describe Review, type: :model do
  let(:review) { Review.new }
  describe "attributes" do
    it "has a rating" do
      expect(review.has_attribute?(:rating)).to be true
    end

    it "has text" do
      expect(review.has_attribute?(:text)).to be true
    end

    it "has a user id" do
      expect(review.has_attribute?(:user_id)).to be true
    end

    it "has a movie id" do
      expect(review.has_attribute?(:movie_id)).to be true
    end

    it "has timestamps" do
      expect(review.has_attribute?(:created_at) && review.has_attribute?(:updated_at)).to be true
    end
  end

  describe "validations" do
    it "is invalid with no rating" do
      user = User.new
      movie = Movie.new
      review.text = 'some text'
      review.user = user
      review.movie = movie
      review.valid?
      expect(review.errors).not_to be_empty
    end

    it "is invalid with a rating that is less than 1" do
      user = User.new
      movie = Movie.new
      review.rating = 0
      review.text = 'some text'
      review.user = user
      review.movie = movie
      review.valid?
      expect(review.errors).not_to be_empty
    end

    it "is invalid with a rating that is greater than 4" do
      user = User.new
      movie = Movie.new
      review.rating = 10
      review.text = 'some text'
      review.user = user
      review.movie = movie
      review.valid?
      expect(review.errors).not_to be_empty
    end

    it "is invalid without text" do
      user = User.new
      movie = Movie.new
      review.rating = 3
      review.user = user
      review.movie = movie
      review.valid?
      expect(review.errors).not_to be_empty
    end

    it "is invalid without a user" do
      movie = Movie.new
      review.rating = 3
      review.text = 'some text'
      review.movie = movie
      review.valid?
      expect(review.errors).not_to be_empty
    end

    it "is invalid without a movie" do
      user = User.new
      review.text = 'some text'
      review.rating = 3
      review.user = user
      review.valid?
      expect(review.errors).not_to be_empty
    end

    it "is valid with a review 1-4, a user and a movie" do
      user = User.new
      movie = Movie.new
      review.rating = 3
      review.text = 'some text'
      review.user = user
      review.movie = movie
      review.valid?
      expect(review.errors).to be_empty
    end
  end

  describe "associations" do
    it "belongs to a user" do
      user = User.new
      review.user = user
      expect(review.user).to eq user
    end

    it "belongs to a movie" do
      movie = Movie.new
      review.movie = movie
      expect(review.movie).to eq movie
    end

    it "has many comments" do
      comment = Comment.new
      comment2 = Comment.new
      review.comments << comment
      review.comments << comment2
      expect(review.comments).to match_array [comment, comment2]
    end
  end
end


text:
namespace Linterhub.Core.Utils
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Reflection;
    using Newtonsoft.Json;

    /// <summary>
    /// Represents custom contract resolver with ability to skip some objects during json serialization.
    /// </summary>
    public class ShouldSerializeConverter : JsonConverter
    {
        /// <summary>
        /// Gets the list of custom filters using during the serialization.
        /// </summary>
        protected IEnumerable<Predicate<object>> Filters { get; }

        /// <summary>
        /// Gets the list of supported types.
        /// </summary>
        protected IEnumerable<Type> Types { get; }

        /// <summary>
        /// Initializes a new instance of <seealso cref="ShouldSerializeConverter"/> class.
        /// </summary>
        /// <param name="supportedCollections">The supported filterable objects.</param>
        /// <param name="filters">The custom value filters.</param>
        public ShouldSerializeConverter(IEnumerable<Type> supportedTypes, IEnumerable<string> filters = null)
        {
            Types = supportedTypes;
            Filters = ParseFilters(filters ?? new List<string>());
        }

        private IEnumerable<Predicate<object>> ParseFilters(IEnumerable<string> filters)
        {
            // Only equeals operator is supported right now
            // TODO: Move to separate class and add more filters
            var result = new List<Predicate<object>>();
            foreach (var filter in filters)
            {
                var parts = filter.Split('=');
                var name = parts[0];
                var value = parts[1];
                Predicate<object> filterPredicate = x =>
                {
                    var propertyValue = x.GetPropertyValue(name);
                    var collection = propertyValue as IEnumerable<object>;
                    return
                        propertyValue == null ||
                        (collection == null && propertyValue.ToString().ToLower() == value.ToLower()) ||
                        (collection != null && collection.Any(z => z.ToString().ToLower() == value.ToLower()));
                };
                result.Add(filterPredicate);
            }

            return result;
        }

        /// <summary>
        /// Determines whether this instance can convert the specified object type.
        /// </summary>
        /// <param name="objectType">Type of the object.</param>
        /// <returns>true if this instance can convert the specified object type; otherwise, false.</returns>
        public override bool CanConvert(Type objectType)
        {
            return Types.Any(x => x.IsAssignableFrom(objectType));
        }

        /// <summary>
        /// Writes the JSON representation of the object.
        /// </summary>
        /// <param name="writer">The <seealso cref="JsonWriter"/> to write to.</param>
        /// <param name="value">The value.</param>
        /// <param name="serializer">The calling serializer.</param>
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            if (value is IEnumerable<object>)
            {
                // The collection of elements should be serialized one by one in order to avoid circular dependencies.
                var collection = (IEnumerable<object>)value;
                collection = collection.Where(x => Filters.All(y => y(x))).ToArray();
                writer.WriteStartArray();
                foreach (var item in collection)
                {
                    serializer.Serialize(writer, item);
                }
                writer.WriteEndArray();
            }
            else
            {
                if (Filters.All(x => x(value)))
                {
                    serializer.Serialize(writer, value);
                }
            }
        }

        /// <summary>
        /// Gets a value indicating whether this converter can read.
        /// </summary>
        public override bool CanRead
        {
            get { return false; }
        }

        /// <summary>
        /// Reads the JSON representation of the object.
        /// </summary>
        /// <param name="reader">The <seealso cref="JsonReader"/> to read from.</param>
        /// <param name="objectType">Type of the object.</param>
        /// <param name="existingValue">The existing value of object being read.</param>
        /// <param name="serializer">The calling serializer.</param>
        /// <returns>The object value.</returns>
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            throw new NotImplementedException();
        }
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="description" content="Materialize is a Material Design Admin Template,It's modern, responsive and based on Material Design by Google. ">
    <meta name="keywords" content="materialize, admin template, dashboard template, flat admin template, responsive admin template,">
    <title>E-Sports Scenario</title>

    <link rel="icon" href="/images/favicon/favicon-32x32.png" sizes="32x32">

    <link rel="apple-touch-icon-precomposed" href="/images/favicon/apple-touch-icon-152x152.png">

    <meta name="msapplication-TileColor" content="#00bcd4">
    <meta name="msapplication-TileImage" content="images/favicon/mstile-144x144.png">

    <link href="/framework/public/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection">
    <link href="/framework/public/css/style.css" type="text/css" rel="stylesheet" media="screen,projection">

    <link href="/framework/public/css/style-fullscreen.css" type="text/css" rel="stylesheet" media="screen,projection">

    <link href="/framework/public/css/custom-style.css" type="text/css" rel="stylesheet" media="screen,projection">

    <link href="/framework/public/css/style-fullscreen.css" type="text/css" rel="stylesheet" media="screen,projection">

    <link href="/framework/public/js/plugins/jvectormap/jquery-jvectormap.css" type="text/css" rel="stylesheet" media="screen,projection">
    <link href="/framework/public/js/plugins/perfect-scrollbar/perfect-scrollbar.css" type="text/css" rel="stylesheet" media="screen,projection">
    <link href="/framework/public/js/plugins/chartist-js/chartist.css" type="text/css" rel="stylesheet" media="screen,projection">

 Materialize

 Profile

 Settings

 Help

 Lock

 Logout

                            John Doe

Administrator

 Dashboard

 Mailbox 4

 Calender

 CSS

Typography

Icons

Shadow

Media

Sass

 UI Elements

Buttons

Badges

Cards

Collections

Accordian

Tabs

Navbar

Pagination

Preloader

Modals

Media

Toasts

Tooltip

Waves

 Widgets

 Tables

Basic Tables

Data Tables

 Forms

Form Elements

Form Layouts

 Pages

Contact Page

ToDos

Blog Type 1

Blog Type 2

404

500

Blank

 eCommers

Products Page

Pricing Table

Invoice

 Medias

Gallery Page

Image Hover Effects

 User

User Profile

Login

Register

Forgot Password

Lock Screen

Session Timeout

 Charts

Chart JS

Chartist

Morris Charts

xCharts

Flot Charts

Sparkline Charts

MORE

 Grid

 Color

 Helpers

 Changelogs

Daily Sales

            @yield('conteudo')

                    Copyright 2015 Mr Articuno All rights reserved.
                     Design by Mr Articuno


text:
using namespace LegionRuntime::HighLevel;

class LeafSolveTask : public IndexLauncher {
public:
  struct TaskArgs {
    int nrow;
    int nRhs;
    int rank;
    int nPart;
  };
  LeafSolveTask(Domain domain,
		TaskArgument global_arg,
		ArgumentMap arg_map,
		MappingTagID tag = 0,
		Predicate pred = Predicate::TRUE_PRED,
		bool must = false,
		MapperID id = 0);

  static int TASKID;

  static void register_tasks(void);

public:
  static void
  cpu_task(const Task *task,
	   const std::vector<PhysicalRegion> &regions,
	   Context ctx, HighLevelRuntime *runtime);
};

#endif


text:
package com.kagmole.workshops.basicchat.webservice.shared.constraints;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
@Constraint(validatedBy = LocalPastValidator.class)
public @interface LocalPast {

	String message() default "Must belong to the past.";

	Class<?>[] groups() default {};

	Class<? extends Payload>[] payload() default {};
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Mofichan.Core.BehaviourOutputs;
using Mofichan.Core.BotState;
using Mofichan.Core.Interfaces;

namespace Mofichan.Core.Visitor
{
    /// <summary>
    /// An implementation of <see cref="IBehaviourVisitorFactory"/>.
    /// </summary>
    public class BehaviourVisitorFactory : IBehaviourVisitorFactory
    {
        private readonly BotContext botContext;
        private readonly Func<IResponseBodyBuilder> messageBuilderFactory;
        private readonly IList<IBehaviourVisitor> visitors;

        private MessageContext lastMessage;

        /// <summary>
        /// Initializes a new instance of the <see cref="BehaviourVisitorFactory"/> class.
        /// </summary>
        /// <param name="botContext">The bot context.</param>
        /// <param name="messageBuilderFactory">The message builder factory.</param>
        public BehaviourVisitorFactory(BotContext botContext, Func<IResponseBodyBuilder> messageBuilderFactory)
        {
            this.botContext = botContext;
            this.messageBuilderFactory = messageBuilderFactory;
            this.visitors = new List<IBehaviourVisitor>();
            this.lastMessage = new MessageContext();
        }

        /// <summary>
        /// Gets the responses.
        /// </summary>
        /// <value>
        /// The responses.
        /// </value>
        public IEnumerable<Response> Responses
        {
            get
            {
                return this.visitors.SelectMany(it => it.Responses);
            }
        }

        /// <summary>
        /// Gets the autonomous outputs.
        /// </summary>
        /// <value>
        /// The autonomous outputs.
        /// </value>
        public IEnumerable<SimpleOutput> AutononousOutputs
        {
            get
            {
                return this.visitors.SelectMany(it => it.AutonomousOutputs);
            }
        }

        /// <summary>
        /// Creates an <see cref="OnMessageVisitor" /> that carries the message that responses should be
        /// collected for.
        /// </summary>
        /// <param name="message">The received message, which responses should be registered for.</param>
        /// <returns>
        /// A new <c>OnMessageVisitor</c>.
        /// </returns>
        public OnMessageVisitor CreateMessageVisitor(MessageContext message)
        {
            var visitor = new OnMessageVisitor(message, this.botContext, this.messageBuilderFactory);
            this.visitors.Add(visitor);
            this.lastMessage = message;

            return visitor;
        }

        /// <summary>
        /// Creates an <see cref="OnPulseVisitor" />.
        /// </summary>
        /// <returns>
        /// A new <c>OnPulseVisitor</c>.
        /// </returns>
        public OnPulseVisitor CreatePulseVisitor()
        {
            var visitor = new OnPulseVisitor(new[] { this.lastMessage }, this.botContext, this.messageBuilderFactory);
            this.visitors.Add(visitor);

            return visitor;
        }
    }
}


text:
<template name="emojiPreview">

</template>


text:
'------------------------------------------------------------------------------
' <generado automáticamente>
'     Este código fue generado por una herramienta.
'
'     Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
'     se vuelve a generar el código.
' </generado automáticamente>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On

Partial Public Class FrmAsignarHorario

    '''
    '''Control form1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents form1 As Global.System.Web.UI.HtmlControls.HtmlForm

    '''
    '''Control lblNombre.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents lblNombre As Global.System.Web.UI.WebControls.Label

    '''
    '''Control lblArea.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents lblArea As Global.System.Web.UI.WebControls.Label

    '''
    '''Control lblCargo.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents lblCargo As Global.System.Web.UI.WebControls.Label

    '''
    '''Control ScriptManager1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents ScriptManager1 As Global.System.Web.UI.ScriptManager

    '''
    '''Control ddlHorario.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents ddlHorario As Global.System.Web.UI.WebControls.DropDownList

    '''
    '''Control odsHorario.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents odsHorario As Global.System.Web.UI.WebControls.ObjectDataSource

    '''
    '''Control rdpIniHorario.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents rdpIniHorario As Global.Telerik.Web.UI.RadDatePicker

    '''
    '''Control Panel1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents Panel1 As Global.System.Web.UI.WebControls.Panel

    '''
    '''Control txtFechaIni.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents txtFechaIni As Global.System.Web.UI.WebControls.TextBox

    '''
    '''Control txtFechaFin.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents txtFechaFin As Global.System.Web.UI.WebControls.TextBox

    '''
    '''Control ImageButton2.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents ImageButton2 As Global.System.Web.UI.WebControls.ImageButton

    '''
    '''Control GridView1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents GridView1 As Global.System.Web.UI.WebControls.GridView

    '''
    '''Control ODSHorariosAsignados.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents ODSHorariosAsignados As Global.System.Web.UI.WebControls.ObjectDataSource
End Class


text:
package savvytodo.model.task;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.time.LocalDateTime;

import org.junit.Test;

import savvytodo.commons.util.DateTimeUtil;

//@@author A0140016B
public class DateTimeTest {
    @Test
    public void isValidEvent() {
        LocalDateTime startDate = DateTimeUtil.setLocalTime(LocalDateTime.now(), DateTimeUtil.FIRST_HOUR_OF_DAY,
                DateTimeUtil.FIRST_MINUTE_OF_DAY, DateTimeUtil.FIRST_SECOND_OF_DAY);
        LocalDateTime endDate = DateTimeUtil.setLocalTime(LocalDateTime.now(), DateTimeUtil.LAST_HOUR_OF_DAY,
                DateTimeUtil.LAST_MINUTE_OF_DAY, DateTimeUtil.LAST_SECOND_OF_DAY);

        assertTrue(DateTime.isValidEvent(startDate, endDate));
    }

    @Test
    public void isInvalidEvent() {
        LocalDateTime startDate = DateTimeUtil.setLocalTime(LocalDateTime.now(), DateTimeUtil.FIRST_HOUR_OF_DAY,
                DateTimeUtil.FIRST_MINUTE_OF_DAY, DateTimeUtil.FIRST_SECOND_OF_DAY);
        LocalDateTime endDate = DateTimeUtil.setLocalTime(LocalDateTime.now(), DateTimeUtil.LAST_HOUR_OF_DAY,
                DateTimeUtil.LAST_MINUTE_OF_DAY, DateTimeUtil.LAST_SECOND_OF_DAY);

        assertFalse(DateTime.isValidEvent(endDate, startDate));
        assertFalse(DateTime.isValidEvent(startDate, startDate));
    }
}


text:
namespace System.Reflection.Metadata
{
    [Flags]
    internal enum MethodSemanticsAttributes
    {
        /// <summary>
        /// Used to read the value of the property.
        /// CLS-compliant setters are named with set_ prefix.
        /// </summary>
        Setter = 0x0001,

        /// <summary>
        /// Used to modify the value of the property.
        /// CLS-compliant getters are named with get_ prefix.
        /// </summary>
        Getter = 0x0002,

        /// <summary>
        /// Other method for property (not getter or setter) or event (not adder, remover, or raiser).
        /// </summary>
        Other = 0x0004,

        /// <summary>
        /// Used to add a handler for an event.
        /// Corresponds to the AddOn flag in the Ecma 335 CLI specification.
        /// CLS-compliant adders are named with add_ prefix.
        /// </summary>
        Adder = 0x0008,

        /// <summary>
        /// Used to remove a handler for an event.
        /// Correpsonds to th RemoveOn flag in the Ecma 335 CLI specification.
        /// CLS-compliant removers are named with remove_ prefix.
        /// </summary>
        Remover = 0x0010,

        /// <summary>
        /// Used to indicate that an event has occurred.
        /// Corresponds to the Fire flag in the Ecma 335 CLI specification.
        /// CLS-compliant raisers are named with raise_ prefix.
        /// </summary>
        Raiser = 0x0020,
    }

    /// <summary>
    /// Specifies the security actions that can be performed using declarative security.
    /// </summary>
    enum DeclarativeSecurityAction : short
    {
        /// <summary>
        /// No declarative security action.
        /// </summary>
        None = 0x0000,

        /// <summary>
        /// Check that all callers in the call chain have been granted specified permission,
        /// </summary>
        Demand = 0x0002,

        /// <summary>
        /// The calling code can access the resource identified by the current permission object, even if callers higher in the stack have not been granted permission to access the resource.
        /// </summary>
        Assert = 0x0003,

        /// <summary>
        /// Without further checks refuse Demand for the specified permission.
        /// </summary>
        Deny = 0x0004,

        /// <summary>
        /// Without further checks, refuse Demand for all permissions other than those specified.
        /// </summary>
        PermitOnly = 0x0005,

        /// <summary>
        /// Check that the immediate caller has been granted the specified permission;
        /// </summary>
        LinkDemand = 0x0006,

        /// <summary>
        /// The derived class inheriting the class or overriding a method is required to have been granted the specified permission.
        /// </summary>
        InheritanceDemand = 0x0007,

        /// <summary>
        /// The request for the minimum permissions required for code to run. This action can only be used within the scope of the assembly.
        /// </summary>
        RequestMinimum = 0x0008,

        /// <summary>
        /// The request for additional permissions that are optional (not required to run). This request implicitly refuses all other permissions not specifically requested. This action can only be used within the scope of the assembly.
        /// </summary>
        RequestOptional = 0x0009,

        /// <summary>
        /// The request that permissions that might be misused will not be granted to the calling code. This action can only be used within the scope of the assembly.
        /// </summary>
        RequestRefuse = 0x000A,
        // Wait for an actual need before exposing these. They all have ilasm keywords, but some are missing from the CLI spec and
        // and none are defined in System.Security.Permissions.SecurityAction.
        //Request = 0x0001,
        //PrejitGrant = 0x000B,
        //PrejitDeny = 0x000C,
        //NonCasDemand = 0x000D,
        //NonCasLinkDemand = 0x000E,
        //NonCasInheritanceDemand = 0x000F,
    }

    [Flags]
    enum MethodImportAttributes : short
    {
        None = 0x0,
        ExactSpelling = 0x0001,
        BestFitMappingDisable = 0x0020,
        BestFitMappingEnable = 0x0010,
        BestFitMappingMask = 0x0030,
        CharSetAnsi = 0x0002,
        CharSetUnicode = 0x0004,
        CharSetAuto = 0x0006,
        CharSetMask = 0x0006,
        ThrowOnUnmappableCharEnable = 0x1000,
        ThrowOnUnmappableCharDisable = 0x2000,
        ThrowOnUnmappableCharMask = 0x3000,
        SetLastError = 0x0040,
        CallingConventionWinApi = 0x0100,
        CallingConventionCDecl = 0x0200,
        CallingConventionStdCall = 0x0300,
        CallingConventionThisCall = 0x0400,
        CallingConventionFastCall = 0x0500,
        CallingConventionMask = 0x0700,
    }

    [Flags]
    enum ManifestResourceAttributes
    {
        /// <summary>
        /// The Resource is exported from the Assembly
        /// </summary>
        Public = 0x00000001,

        /// <summary>
        /// The Resource is exported from the Assembly
        /// </summary>
        Private = 0x00000002,

        /// <summary>
        /// Masks just the visibility-related attributes.
        /// </summary>
        VisibilityMask = 0x00000007, // Although it is odd that there is a 3rd bit with no corresponding flag, it is defined this way by the CLI spec.
    }

    /// <summary>
    /// Specifies all the hash algorithms used for hashing assembly files and for generating the strong name.
    /// </summary>
    enum AssemblyHashAlgorithm
    {
        /// <summary>
        /// A mask indicating that there is no hash algorithm. If you specify None for a multi-module assembly, the common language runtime defaults to the SHA1 algorithm, since multi-module assemblies need to generate a hash.
        /// </summary>
        None = 0,

        /// <summary>
        /// Retrieves the MD5 message-digest algorithm. MD5 was developed by Rivest in 1991. It is basically MD4 with safety-belts and while it is slightly slower than MD4, it helps provide more security. The algorithm consists of four distinct rounds, which has a slightly different design from that of MD4. Message-digest size, as well as padding requirements, remain the same.
        /// </summary>
        MD5 = 0x8003,

        /// <summary>
        /// Retrieves a revision of the Secure Hash Algorithm that corrects an unpublished flaw in SHA.
        /// </summary>
        Sha1 = 0x8004,

        /// <summary>
        /// Retrieves a version of the Secure Hash Algorithm with a hash size of 256 bits.
        /// </summary>
        Sha256 = 0x800c,

        /// <summary>
        /// Retrieves a version of the Secure Hash Algorithm with a hash size of 384 bits.
        /// </summary>
        Sha384 = 0x800d,

        /// <summary>
        /// Retrieves a version of the Secure Hash Algorithm with a hash size of 384 bits.
        /// </summary>
        Sha512 = 0x800e
    }

    [Flags]
    enum AssemblyFlags
    {
        /// <summary>
        /// The assembly reference holds the full (unhashed) public key.
        /// Not applicable on assembly definition.
        /// </summary>
        PublicKey = 0x00000001,

        /// <summary>
        /// The implementation of the referenced assembly used at runtime is not expected to match the version seen at compile time.
        /// </summary>
        Retargetable = 0x00000100,

        /// <summary>
        /// The assembly contains Windows Runtime code.
        /// </summary>
        WindowsRuntime = 0x00000200,

        /// <summary>
        /// Content type mask. Masked bits correspond to values of <see cref="System.Reflection.AssemblyContentType"/>.
        /// </summary>
        ContentTypeMask = 0x00000e00,

        /// <summary>
        /// Specifies that just-in-time (JIT) compiler optimization is disabled for the assembly.
        /// </summary>
        DisableJitCompileOptimizer = 0x4000,

        /// <summary>
        /// Specifies that just-in-time (JIT) compiler tracking is enabled for the assembly.
        /// </summary>
        EnableJitCompileTracking = 0x8000,
    }

    internal static class TypeAttributesExtensions
    {
        // This flag will be added to the BCL (Bug #1041207), but we still
        // need to define a copy here for downlevel portability.
        private const TypeAttributes Forwarder = (TypeAttributes)0x00200000;

        // This mask is the fastest way to check if a type is nested from its flags,
        // but it should not be added to the BCL enum as its semantics can be misleading.
        // Consider, for example, that (NestedFamANDAssem & NestedMask) == NestedFamORAssem.
        // Only comparison of the masked value to 0 is meaningful, which is different from
        // the other masks in the enum.
        private const TypeAttributes NestedMask = (TypeAttributes)0x00000006;

        public static bool IsForwarder(this TypeAttributes flags)
        {
            return (flags & Forwarder) != 0;
        }

        public static bool IsNested(this TypeAttributes flags)
        {
            return (flags & NestedMask) != 0;
        }
    }
}


text:
package org.springframework.boot.autoconfigure.webservices;

import org.junit.Test;

import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

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

/**
 * Tests for {@link OnWsdlLocationsCondition}.
 *
 * @author Eneias Silva
 * @author Stephane Nicoll
 */
public class OnWsdlLocationsConditionTests {

	private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
			.withUserConfiguration(TestConfig.class);

	@Test
	public void wsdlLocationsNotDefined() {
		this.contextRunner.run((context) -> assertThat(context).doesNotHaveBean("foo"));
	}

	@Test
	public void wsdlLocationsDefinedAsCommaSeparated() {
		this.contextRunner.withPropertyValues("spring.webservices.wsdl-locations=value1")
				.run((context) -> assertThat(context).hasBean("foo"));
	}

	@Test
	public void wsdlLocationsDefinedAsList() {
		this.contextRunner
				.withPropertyValues("spring.webservices.wsdl-locations[0]=value1")
				.run((context) -> assertThat(context).hasBean("foo"));
	}

	@Configuration
	@Conditional(OnWsdlLocationsCondition.class)
	protected static class TestConfig {

		@Bean
		public String foo() {
			return "foo";
		}

	}

}


text:
/**
*============================================================================
*  The Ohio State University Research Foundation, Emory University,
*  the University of Minnesota Supercomputing Institute
*
*  Distributed under the OSI-approved BSD 3-Clause License.
*  See http://ncip.github.com/cagrid-grid-incubation/LICENSE.txt for details.
*============================================================================
**/
/**
*============================================================================
*============================================================================
**/
package org.cagrid.redcap.test.system;

import org.junit.Test;
import gov.nih.nci.cagrid.testing.system.haste.Story;
import org.cagrid.redcap.test.system.RedcapDataServiceTest;
import gov.nih.nci.cagrid.testing.system.deployment.ServiceContainerFactory;
import gov.nih.nci.cagrid.testing.system.deployment.ServiceContainerType;

public class RCDSTestsStoryBook {

	@Test
    public void rcdsTests() throws Throwable {
		Story s1 = new RedcapDataServiceTest(ServiceContainerFactory
	            .createContainer(ServiceContainerType.SECURE_TOMCAT_CONTAINER));
		s1.runBare();
   }
}


text:
package com.easyguide.presentation.home;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;

import com.easyguide.BaseActivity;
import com.easyguide.BaseFragment;
import com.easyguide.R;
import com.easyguide.presentation.home.history.HistoryFragment;
import com.easyguide.presentation.home.main.MainFragment;
import com.easyguide.presentation.home.profile.ProfileFragment;
import com.easyguide.ui.adapter.HomeAdapter;

import butterknife.BindView;
import butterknife.ButterKnife;

public class HomeActivity extends BaseActivity implements TabLayout.OnTabSelectedListener {

    @BindView(R.id.toolbar)
    Toolbar toolbar;

    @BindView(R.id.tablayout_home)
    TabLayout tabLayout;

    @BindView(R.id.viewpager_home)
    ViewPager viewPagerHome;

    private BaseFragment[] tabsContent;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        ButterKnife.bind(this);
        setSupportActionBar(toolbar);
        setupTabLayout();
        setupViewPager();
    }

    @Override
    public void onTabSelected(TabLayout.Tab tab) {
        viewPagerHome.setCurrentItem(tab.getPosition());
    }

    @Override
    public void onTabUnselected(TabLayout.Tab tab) {}

    @Override
    public void onTabReselected(TabLayout.Tab tab) {}

    private void setupTabLayout() {
        tabsContent = new BaseFragment[] {
                new ProfileFragment(),
                new MainFragment(),
                new HistoryFragment()
        };
        // Add fragments to tab layout
        for(BaseFragment fragment : tabsContent) {
            tabLayout.addTab(tabLayout.newTab().setText(getString(fragment.getFragmentTitleResourceId())));
        }
        tabLayout.addOnTabSelectedListener(this);
    }

    private void setupViewPager() {
        viewPagerHome.setAdapter(new HomeAdapter(getSupportFragmentManager(), tabsContent));
        viewPagerHome.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
        viewPagerHome.setCurrentItem(1);
    }
}


text:
require_relative '../../test_helper'

# Test AutomationObject::BluePrint::HashAdapter
class TestBluePrintHashAdapter < Minitest::Test
  def setup
    AutomationObject::BluePrint.adapter = :hash
    AutomationObject::BluePrint::HashAdapter::Top.skip_validations = true

    @hash_adapter = AutomationObject::BluePrint::HashAdapter.build
  end

  def teardown
    AutomationObject::BluePrint.adapter = :hash
    AutomationObject::BluePrint::HashAdapter::Top.skip_validations = false
  end

  def test_new
    assert_instance_of AutomationObject::BluePrint::Composite::Top, @hash_adapter
  end
end


text:
package main

import (
	"io"
	"net/http"
	_ "net/http/pprof" //nolint:gosec
	"os"

	"github.com/go-kit/log/level"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promhttp"
	"github.com/prometheus/common/promlog"
	"github.com/prometheus/common/promlog/flag"
	"github.com/prometheus/common/version"
	"gopkg.in/alecthomas/kingpin.v2"

	"github.com/timonwong/uwsgi_exporter/exporter"
)

var (
	listenAddress = kingpin.Flag("web.listen-address", "Address on which to expose metrics and web interfaces.").Default(":9117").String()
	metricsPath   = kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String()
	statsURI      = kingpin.Flag("stats.uri", "URI for accessing uwsgi stats.").Default("").String()
	statsTimeout  = kingpin.Flag("stats.timeout", "Timeout for trying to get stats from uwsgi.").Default("5s").Duration()
	collectCores  = kingpin.Flag("collect.cores", "Collect cores information per uwsgi worker.").Default("false").Bool()
)

func init() {
	prometheus.MustRegister(version.NewCollector("uwsgi_exporter"))
}

func main() {
	promlogConfig := &promlog.Config{}
	flag.AddFlags(kingpin.CommandLine, promlogConfig)

	kingpin.Version(version.Print("uwsgi_exporter"))
	kingpin.HelpFlag.Short('h')
	kingpin.Parse()

	logger := promlog.New(promlogConfig)
	level.Info(logger).Log("msg", "Starting uwsgi_exporter", "version", version.Info())
	level.Info(logger).Log("msg", "Build context", "build", version.BuildContext())

	uwsgiExporter, err := exporter.NewExporter(logger, *statsURI, *statsTimeout, *collectCores)
	if err != nil {
		level.Error(logger).Log("msg", "Failed to start logger", "error", err)
		os.Exit(1)
	}

	prometheus.MustRegister(uwsgiExporter)

	http.Handle(*metricsPath, promhttp.Handler()) // nolint: staticcheck
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		io.WriteString(w, `
			<title>uWSGI Exporter</title>

uWSGI Exporter

<a href="`+*metricsPath+`">Metrics

Build

`+version.Info()+` `+version.BuildContext()+`

			`)
	})
	http.HandleFunc("/-/healthy", func(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(200)
		io.WriteString(w, "ok")
	})

	level.Info(logger).Log("msg", "Listening on", "addr", *listenAddress)
	err = http.ListenAndServe(*listenAddress, nil)
	if err != nil {
		level.Error(logger).Log("msg", "Failed to listen address", "error", err)
		os.Exit(1)
	}
}


text:
cask :v1 => 'pomotodo' do
  version :latest
  sha256 :no_check

  # hackplan.com is the official download host per the vendor homepage
  url 'http://air.hackplan.com/v1/p/com.pomotodo.PomotodoMac/download'
  name 'Pomodoro'
  appcast 'http://air.hackplan.com/projects/5455f382437315386000d4d5/versions/latest.xml',
          :sha256 => '6babb8c063ac36c7769d50564f143eafe510d6e07a3ed6ea4375f8433e27ae28'
  homepage 'https://pomotodo.com'
  license :unknown    # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder

  app 'Pomotodo.app'
end