text:
#pragma once
#include <aws/devicefarm/DeviceFarm_EXPORTS.h>
#include <aws/devicefarm/DeviceFarmRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace DeviceFarm
{
namespace Model
{

  /**
   *
Represents the request to return information about the remote access
   * session.

See Also:
   AWS
   * API Reference

   */
  class AWS_DEVICEFARM_API ListRemoteAccessSessionsRequest : public DeviceFarmRequest
  {
  public:
    ListRemoteAccessSessionsRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "ListRemoteAccessSessions"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The Amazon Resource Name (ARN) of the project about which you are requesting
     * information.

     */
    inline const Aws::String& GetArn() const{ return m_arn; }

    /**
     *
The Amazon Resource Name (ARN) of the project about which you are requesting
     * information.

     */
    inline bool ArnHasBeenSet() const { return m_arnHasBeenSet; }

    /**
     *
The Amazon Resource Name (ARN) of the project about which you are requesting
     * information.

     */
    inline void SetArn(const Aws::String& value) { m_arnHasBeenSet = true; m_arn = value; }

    /**
     *
The Amazon Resource Name (ARN) of the project about which you are requesting
     * information.

     */
    inline void SetArn(Aws::String&& value) { m_arnHasBeenSet = true; m_arn = std::move(value); }

    /**
     *
The Amazon Resource Name (ARN) of the project about which you are requesting
     * information.

     */
    inline void SetArn(const char* value) { m_arnHasBeenSet = true; m_arn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of the project about which you are requesting
     * information.

     */
    inline ListRemoteAccessSessionsRequest& WithArn(const Aws::String& value) { SetArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the project about which you are requesting
     * information.

     */
    inline ListRemoteAccessSessionsRequest& WithArn(Aws::String&& value) { SetArn(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the project about which you are requesting
     * information.

     */
    inline ListRemoteAccessSessionsRequest& WithArn(const char* value) { SetArn(value); return *this;}

    /**
     *
An identifier that was returned from the previous call to this operation,
     * which can be used to return the next set of items in the list.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
An identifier that was returned from the previous call to this operation,
     * which can be used to return the next set of items in the list.

     */
    inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }

    /**
     *
An identifier that was returned from the previous call to this operation,
     * which can be used to return the next set of items in the list.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }

    /**
     *
An identifier that was returned from the previous call to this operation,
     * which can be used to return the next set of items in the list.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }

    /**
     *
An identifier that was returned from the previous call to this operation,
     * which can be used to return the next set of items in the list.

     */
    inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }

    /**
     *
An identifier that was returned from the previous call to this operation,
     * which can be used to return the next set of items in the list.

     */
    inline ListRemoteAccessSessionsRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
An identifier that was returned from the previous call to this operation,
     * which can be used to return the next set of items in the list.

     */
    inline ListRemoteAccessSessionsRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
An identifier that was returned from the previous call to this operation,
     * which can be used to return the next set of items in the list.

     */
    inline ListRemoteAccessSessionsRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}

  private:

    Aws::String m_arn;
    bool m_arnHasBeenSet = false;

    Aws::String m_nextToken;
    bool m_nextTokenHasBeenSet = false;
  };

} // namespace Model
} // namespace DeviceFarm
} // namespace Aws


text:
from django.urls import path

from . import views

urlpatterns = [
    path('create', views.create),
    path('actual-rows', views.actual_rows),
    path('cancel-row', views.cancel_row),
    path('search', views.search),
    path('change-status', views.change_status),
    path('change-executor', views.change_executor),
    path('add-log', views.add_log),
    path('log', views.log_rows),
]

redpajama_set_name: RedPajamaGithub


text:
package Ejerciciosficheros;
import java.io.*;
public class EjerFich01
{

	public static void main(String[] args)
	{
		try(FileWriter fw = new FileWriter("C:\\ejercicio01.txt"); FileReader fr = new FileReader("C:\\ejercicio01.txt"))
		{
			fw.write("Esto es una prueba");

			fw.flush();

			int valor = fr.read();
			while(valor!=-1)
			{
                //Si el caracter es un espacio no lo escribe
                if(valor!=32)
                {
                    System.out.print((char)valor);
                }
                valor=fr.read();
            }
		}
		catch(IOException e)
		{
			System.out.println("Error E/S: "+e);
		}
	}
}

//Crea un fichero de texto con el nombre y contenido que tu quieras.
//Ahora crea una aplicación que lea este fichero de texto carácter a carácter y muestre su contenido por pantalla
//sin espacios. Por ejemplo, si un fichero tiene el siguiente texto "Esto es una prueba", deberá mostrar "Estoesunaprueba".
//Captura las excepciones que veas necesario.


text:
<?php

namespace PROCERGS\LoginCidadao\CoreBundle\Form\Type;

use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use PROCERGS\LoginCidadao\CoreBundle\Form\Type\CommonFormType;

class CategoryFormType extends CommonFormType
{

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $person = $this->getUser();

        $builder->addEventListener(FormEvents::PRE_SET_DATA,
                                   function (FormEvent $event) use($person) {
            $cat = $event->getData();
            $form = $event->getForm();
            if ($cat->getId()) {
                $name = $cat->getClient()
                    ->getName();
                $form->add('client', 'text',
                           array(
                    'required' => true,
                    'label' => 'Service',
                    'mapped' => false,
                    'read_only' => true,
                    'data' => $name,
                ));
                $form->add('mailTemplate', 'textarea',
                           array(
                    'required' => true,
                    'attr' => array('rows' => 4)
                ));
                $form->add('markdownTemplate', 'textarea',
                           array(
                    'required' => true,
                    'attr' => array('rows' => 4)
                ));
                $form->add('id', 'integer',
                           array(
                    'required' => false,
                    'read_only' => true
                ));
            } else {
                $form->add('id', 'hidden',
                           array(
                    'required' => false,
                    'read_only' => true
                ));
                $form->add('client', 'entity',
                           array(
                    'required' => true,
                    'label' => 'Service',
                    'class' => 'PROCERGSOAuthBundle:Client',
                    'choice_label' => 'name',
                    'query_builder' => function (EntityRepository $er) use($person) {
                        return $er->createQueryBuilder('c')
                                ->where(':person MEMBER OF c.owners')
                                ->setParameter('person', $person)
                                ->orderBy('c.name', 'ASC');
                    }
                ));
            }
        });
        $builder->add('name', 'text',
                      array(
            'required' => true
        ));
        $builder->add('defaultIcon', 'choice',
                      array(
            'choices' => array(
                'glyphicon glyphicon-envelope' => 'envelope',
                'glyphicon glyphicon-exclamation-sign' => 'exclamation-sign'
            ),
            'required' => true
        ));
        $builder->add('defaultTitle', 'text',
                      array(
            'required' => true
        ));
        $builder->add('defaultShortText', 'text',
                      array(
            'required' => true
        ));
        $builder->add('mailSenderAddress', 'text',
                      array(
            'required' => true
        ));
        $builder->add('emailable', 'choice',
                      array(
            'choices' => array(
                '0' => 'No',
                '1' => 'Yes'
            ),
            'required' => true
        ));
    }

    public function getName()
    {
        return 'category_form_type';
    }

}


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/wm/window_animations.h"

#include <math.h>
#include <algorithm>
#include <utility>
#include <vector>

#include "ash/public/cpp/metrics_util.h"
#include "ash/public/cpp/window_animation_types.h"
#include "ash/shelf/shelf.h"
#include "ash/shell.h"
#include "ash/wm/pip/pip_positioner.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace_controller.h"
#include "base/bind.h"
#include "base/check.h"
#include "base/i18n/rtl.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/time/time.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
#include "ui/base/class_property.h"
#include "ui/compositor/animation_throughput_reporter.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/compositor_observer.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_observer.h"
#include "ui/compositor/layer_animation_sequence.h"
#include "ui/compositor/layer_animator.h"
#include "ui/compositor/layer_tree_owner.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/gfx/geometry/transform.h"
#include "ui/gfx/interpolated_transform.h"
#include "ui/wm/core/coordinate_conversion.h"
#include "ui/wm/core/window_util.h"

namespace ash {
namespace {

const int kLayerAnimationsForMinimizeDurationMS = 200;

// Amount of time for the cross fade animation.
constexpr base::TimeDelta kCrossFadeDuration = base::Milliseconds(200);

constexpr base::TimeDelta kCrossFadeMaxDuration = base::Milliseconds(400);

// Durations for the brightness/grayscale fade animation, in milliseconds.
const int kBrightnessGrayscaleFadeDurationMs = 1000;

// Duration for fade in animation, in milliseconds.
const int kFadeInAnimationMs = 200;

// Brightness/grayscale values for hide/show window animations.
const float kWindowAnimation_HideBrightnessGrayscale = 1.f;
const float kWindowAnimation_ShowBrightnessGrayscale = 0.f;

const float kWindowAnimation_HideOpacity = 0.f;
const float kWindowAnimation_ShowOpacity = 1.f;

// Duration for gfx::Tween::ZERO animation of showing window.
constexpr base::TimeDelta kZeroAnimationMs = base::Milliseconds(300);

constexpr char kCrossFadeSmoothness[] =
    "Ash.Window.AnimationSmoothness.CrossFade";

base::TimeDelta GetCrossFadeDuration(aura::Window* window,
                                     const gfx::RectF& old_bounds,
                                     const gfx::Rect& new_bounds) {
  if (::wm::WindowAnimationsDisabled(window))
    return base::TimeDelta();

  int old_area = static_cast<int>(old_bounds.width() * old_bounds.height());
  int new_area = new_bounds.width() * new_bounds.height();
  int max_area = std::max(old_area, new_area);
  // Avoid divide by zero.
  if (max_area == 0)
    return kCrossFadeDuration;

  int delta_area = std::abs(old_area - new_area);
  // If the area didn't change, the animation is instantaneous.
  if (delta_area == 0)
    return kCrossFadeDuration;

  float factor = static_cast<float>(delta_area) / static_cast<float>(max_area);
  const auto kRange = kCrossFadeMaxDuration - kCrossFadeDuration;
  return kCrossFadeDuration + factor * kRange;
}

// Observer for a window cross-fade animation. If either the window closes or
// the layer's animation completes, it deletes the layer and removes itself as
// an observer.
class CrossFadeObserver : public aura::WindowObserver,
                          public ui::ImplicitAnimationObserver {
 public:
  // Observes |window| for destruction, but does not take ownership.
  // Takes ownership of |layer_owner| and its child layers.
  CrossFadeObserver(aura::Window* window,
                    std::unique_ptr<ui::LayerTreeOwner> layer_owner,
                    absl::optional<std::string> histogram_name)
      : window_(window),
        layer_(window->layer()),
        layer_owner_(std::move(layer_owner)) {
    window_->AddObserver(this);

    smoothness_tracker_ =
        layer_->GetCompositor()->RequestNewThroughputTracker();
    smoothness_tracker_->Start(metrics_util::ForSmoothness(base::BindRepeating(
        [](const absl::optional<std::string>& histogram_name, int smoothness) {
          if (histogram_name) {
            DCHECK(!histogram_name->empty());
            base::UmaHistogramPercentage(*histogram_name, smoothness);
          } else {
            UMA_HISTOGRAM_PERCENTAGE(kCrossFadeSmoothness, smoothness);
          }
        },
        std::move(histogram_name))));
  }
  CrossFadeObserver(const CrossFadeObserver&) = delete;
  CrossFadeObserver& operator=(const CrossFadeObserver&) = delete;
  ~CrossFadeObserver() override {
    smoothness_tracker_->Stop();
    smoothness_tracker_.reset();

    // Stop the old animator to trigger aborts or ends on any observers it may
    // have.
    layer_owner_->root()->GetAnimator()->StopAnimating();

    window_->RemoveObserver(this);
    window_ = nullptr;
    layer_ = nullptr;
  }

  // aura::WindowObserver:
  void OnWindowDestroying(aura::Window* window) override { StopAnimating(); }
  void OnWindowRemovingFromRootWindow(aura::Window* window,
                                      aura::Window* new_root) override {
    StopAnimating();
  }
  void OnWindowLayerRecreated(aura::Window* window) override {
    // If the window layer is recreated. |layer_| will hold the LayerAnimator we
    // were originally observing. Layer recreation is usually done when doing
    // another window animation, so stop this current one and trigger
    // OnImplicitAnimationsCompleted to delete ourselves.
    layer_->GetAnimator()->StopAnimating();
  }

  // ui::ImplicitAnimationObserver:
  void OnImplicitAnimationsCompleted() override { delete this; }

 protected:
  void StopAnimating() {
    // Trigger OnImplicitAnimationsCompleted() to be called and deletes us. If
    // no animation is running then do the deletion ourselves.
    DCHECK(window_);
    window_->layer()->GetAnimator()->StopAnimating();
  }

  // The window and the associated layer this observer is watching. The window
  // layer may be recreated during the course of the animation so |layer_| will
  // be different |window_->layer()| after construction.
  aura::Window* window_;
  ui::Layer* layer_;

  std::unique_ptr<ui::LayerTreeOwner> layer_owner_;

  absl::optional<ui::ThroughputTracker> smoothness_tracker_;
};

// A version of CrossFadeObserver which updates its transform to match the
// visible bounds of the window it is cross-fading. It is expected users of this
// will not perform their own transform animation on the passed LayerTreeOwner.
class CrossFadeUpdateTransformObserver
    : public CrossFadeObserver,
      public ui::CompositorAnimationObserver {
 public:
  CrossFadeUpdateTransformObserver(
      aura::Window* window,
      std::unique_ptr<ui::LayerTreeOwner> layer_owner,
      absl::optional<std::string> histogram_name)
      : CrossFadeObserver(window, std::move(layer_owner), histogram_name) {
    compositor_ = window->layer()->GetCompositor();
    compositor_->AddAnimationObserver(this);
  }
  CrossFadeUpdateTransformObserver(const CrossFadeUpdateTransformObserver&) =
      delete;
  CrossFadeUpdateTransformObserver& operator=(
      const CrossFadeUpdateTransformObserver&) = delete;
  ~CrossFadeUpdateTransformObserver() override {
    compositor_->RemoveAnimationObserver(this);
  }

  // CrossFadeObserver:
  void OnLayerAnimationStarted(ui::LayerAnimationSequence* sequence) override {
    DCHECK(!layer_owner_->root()->GetAnimator()->IsAnimatingProperty(
        ui::LayerAnimationElement::TRANSFORM));
    CrossFadeObserver::OnLayerAnimationStarted(sequence);
  }

  // ui::CompositorAnimationObserver:
  void OnAnimationStep(base::TimeTicks timestamp) override {
    // If these get shut down or destroyed we should delete ourselves.
    DCHECK(compositor_);
    DCHECK(window_);

    // Calculate the transform needed to place |layer_owner_| in the same bounds
    // plus transform as |window_|.
    gfx::RectF old_bounds(layer_owner_->root()->bounds());
    gfx::RectF new_bounds(window_->bounds());
    gfx::Transform new_transform = window_->transform();
    DCHECK(new_transform.IsScaleOrTranslation());

    // Apply the transform on the bounds to get the location of |window_|.
    // Transforms are calculated in a way where scale does not affect position,
    // so use the same logic here.
    gfx::RectF effective_bounds(new_bounds.size());
    new_transform.TransformRect(&effective_bounds);
    effective_bounds.set_x(effective_bounds.x() + new_bounds.x());
    effective_bounds.set_y(effective_bounds.y() + new_bounds.y());

    const gfx::Transform old_transform =
        gfx::TransformBetweenRects(old_bounds, effective_bounds);
    layer_owner_->root()->SetTransform(old_transform);
  }

  void OnCompositingShuttingDown(ui::Compositor* compositor) override {
    DCHECK_EQ(compositor_, compositor);
    StopAnimating();
  }

 private:
  ui::Compositor* compositor_ = nullptr;
};

// Internal implementation of a cross fade animation. If
// |animate_old_layer_transform| is true, both new and old layers will animate
// their opacities and transforms. Otherwise, the old layer will on animate its
// opacity; its transforms will be updated via an observer.
void CrossFadeAnimationInternal(
    aura::Window* window,
    std::unique_ptr<ui::LayerTreeOwner> old_layer_owner,
    bool animate_old_layer_transform,
    absl::optional<base::TimeDelta> duration,
    absl::optional<gfx::Tween::Type> tween_type,
    absl::optional<std::string> histogram_name) {
  ui::Layer* old_layer = old_layer_owner->root();
  ui::Layer* new_layer = window->layer();

  DCHECK(old_layer);
  const gfx::Rect old_bounds(old_layer_owner->root()->bounds());

  gfx::RectF old_transformed_bounds(old_bounds);
  gfx::Transform old_transform(old_layer_owner->root()->transform());
  gfx::Transform old_transform_in_root;
  old_transform_in_root.Translate(old_bounds.x(), old_bounds.y());
  old_transform_in_root.PreconcatTransform(old_transform);
  old_transform_in_root.Translate(-old_bounds.x(), -old_bounds.y());
  old_transform_in_root.TransformRect(&old_transformed_bounds);
  const gfx::Rect new_bounds(window->bounds());
  const bool old_on_top = (old_bounds.width() > new_bounds.width());

  // Ensure the higher-resolution layer is on top.
  if (old_on_top)
    old_layer->parent()->StackBelow(new_layer, old_layer);
  else
    old_layer->parent()->StackAbove(new_layer, old_layer);

  // Shorten the animation if there's not much visual movement.
  const base::TimeDelta animation_duration = duration.value_or(
      GetCrossFadeDuration(window, old_transformed_bounds, new_bounds));
  const gfx::Tween::Type animation_tween_type =
      tween_type.value_or(gfx::Tween::EASE_OUT);

  // Scale up the old layer while translating to new position.
  {
    ui::Layer* old_layer = old_layer_owner->root();
    old_layer->GetAnimator()->StopAnimating();
    old_layer->SetTransform(old_transform);
    ui::ScopedLayerAnimationSettings settings(old_layer->GetAnimator());
    settings.SetTransitionDuration(animation_duration);
    settings.SetTweenType(animation_tween_type);
    settings.DeferPaint();

    if (old_on_top) {
      // Only caching render surface when there is an opacity animation and
      // multiple layers.
      if (!old_layer->children().empty())
        settings.CacheRenderSurface();
      // The old layer is on top, and should fade out. The new layer below will
      // stay opaque to block the desktop.
      old_layer->SetOpacity(kWindowAnimation_HideOpacity);
    } else if (!animate_old_layer_transform) {
      // If |animate_old_layer_transform| and |old_on_top| are both false, then
      // the old layer will have no animations and the observer will delete
      // itself (and the old layer) right away. To make sure the old layer stays
      // behind the new layer with opacity 1.f for the duration of the
      // animation, change the tween to zero.
      settings.SetTweenType(gfx::Tween::ZERO);
      old_layer->SetOpacity(kWindowAnimation_HideOpacity);
    }

    if (animate_old_layer_transform) {
      gfx::Transform out_transform;
      float scale_x =
          new_bounds.width() / static_cast<float>(old_bounds.width());
      float scale_y =
          new_bounds.height() / static_cast<float>(old_bounds.height());
      out_transform.Translate(new_bounds.x() - old_bounds.x(),
                              new_bounds.y() - old_bounds.y());
      out_transform.Scale(scale_x, scale_y);
      old_layer->SetTransform(out_transform);
    }
    // In tests |old_layer| is deleted here, as animations have zero duration.
    old_layer = nullptr;
  }

  // Set the new layer's current transform, such that the user sees a scaled
  // version of the window with the original bounds at the original position.
  gfx::Transform in_transform;
  const float scale_x =
      old_transformed_bounds.width() / static_cast<float>(new_bounds.width());
  const float scale_y =
      old_transformed_bounds.height() / static_cast<float>(new_bounds.height());
  in_transform.Translate(old_transformed_bounds.x() - new_bounds.x(),
                         old_transformed_bounds.y() - new_bounds.y());
  in_transform.Scale(scale_x, scale_y);
  new_layer->SetTransform(in_transform);
  if (!old_on_top) {
    // The new layer is on top and should fade in.  The old layer below will
    // stay opaque and block the desktop.
    new_layer->SetOpacity(kWindowAnimation_HideOpacity);
  }
  {
    // Animation observer owns the old layer and deletes itself. It should be
    // attached to the new layer so that if the new layer animation gets
    // aborted, we can delete the old layer.
    CrossFadeObserver* observer =
        animate_old_layer_transform
            ? new CrossFadeObserver(window, std::move(old_layer_owner),
                                    histogram_name)
            : new CrossFadeUpdateTransformObserver(
                  window, std::move(old_layer_owner), histogram_name);

    // Animate the new layer to the identity transform, so the window goes to
    // its newly set bounds.
    ui::ScopedLayerAnimationSettings settings(new_layer->GetAnimator());
    settings.AddObserver(observer);
    settings.SetTransitionDuration(animation_duration);
    settings.SetTweenType(animation_tween_type);
    settings.DeferPaint();
    if (!old_on_top) {
      // Only caching render surface when there is an opacity animation and
      // multiple layers.
      if (!new_layer->children().empty())
        settings.CacheRenderSurface();
      // New layer is on top, fade it in.
      new_layer->SetOpacity(kWindowAnimation_ShowOpacity);
    }
    new_layer->SetTransform(gfx::Transform());
  }
}

}  // namespace

void SetTransformForScaleAnimation(ui::Layer* layer,
                                   LayerScaleAnimationDirection type) {
  // Scales for windows above and below the current workspace.
  constexpr float kLayerScaleAboveSize = 1.1f;
  constexpr float kLayerScaleBelowSize = .9f;

  const float scale = type == LAYER_SCALE_ANIMATION_ABOVE
                          ? kLayerScaleAboveSize
                          : kLayerScaleBelowSize;
  gfx::Transform transform;
  transform.Translate(-layer->bounds().width() * (scale - 1.0f) / 2,
                      -layer->bounds().height() * (scale - 1.0f) / 2);
  transform.Scale(scale, scale);
  layer->SetTransform(transform);
}

void AddLayerAnimationsForMinimize(aura::Window* window, bool show) {
  // Recalculate the transform at restore time since the launcher item may have
  // moved while the window was minimized.
  gfx::Rect bounds = window->bounds();
  gfx::Rect target_bounds = GetMinimizeAnimationTargetBoundsInScreen(window);
  ::wm::ConvertRectFromScreen(window->parent(), &target_bounds);

  float scale_x = static_cast<float>(target_bounds.width()) / bounds.width();
  float scale_y = static_cast<float>(target_bounds.height()) / bounds.height();

  std::unique_ptr<ui::InterpolatedTransform> scale =
      std::make_unique<ui::InterpolatedScale>(
          gfx::Point3F(1, 1, 1), gfx::Point3F(scale_x, scale_y, 1));

  std::unique_ptr<ui::InterpolatedTransform> translation =
      std::make_unique<ui::InterpolatedTranslation>(
          gfx::PointF(), gfx::PointF(target_bounds.x() - bounds.x(),
                                     target_bounds.y() - bounds.y()));

  scale->SetChild(std::move(translation));
  scale->SetReversed(show);

  base::TimeDelta duration =
      window->layer()->GetAnimator()->GetTransitionDuration();

  std::unique_ptr<ui::LayerAnimationElement> transition =
      ui::LayerAnimationElement::CreateInterpolatedTransformElement(
          std::move(scale), duration);

  transition->set_tween_type(show ? gfx::Tween::EASE_IN
                                  : gfx::Tween::EASE_IN_OUT);

  window->layer()->GetAnimator()->ScheduleAnimation(
      new ui::LayerAnimationSequence(std::move(transition)));

  // When hiding a window, turn off blending until the animation is 3 / 4 done
  // to save bandwidth and reduce jank.
  if (!show) {
    window->layer()->GetAnimator()->SchedulePauseForProperties(
        (duration * 3) / 4, ui::LayerAnimationElement::OPACITY);
  }

  // Fade in and out quickly when the window is small to reduce jank.
  float opacity = show ? 1.0f : 0.0f;
  window->layer()->GetAnimator()->ScheduleAnimation(
      new ui::LayerAnimationSequence(
          ui::LayerAnimationElement::CreateOpacityElement(opacity,
                                                          duration / 4)));

  // Reset the transform to identity when the minimize animation is completed.
  window->layer()->GetAnimator()->ScheduleAnimation(
      new ui::LayerAnimationSequence(
          ui::LayerAnimationElement::CreateTransformElement(
              gfx::Transform(), base::TimeDelta())));
}

void AnimateShowWindow_Minimize(aura::Window* window) {
  window->layer()->SetOpacity(kWindowAnimation_HideOpacity);
  ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
  base::TimeDelta duration =
      base::Milliseconds(kLayerAnimationsForMinimizeDurationMS);
  settings.SetTransitionDuration(duration);
  AddLayerAnimationsForMinimize(window, true);

  // Now that the window has been restored, we need to clear its animation style
  // to default so that normal animation applies.
  ::wm::SetWindowVisibilityAnimationType(
      window, ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT);
}

void AnimateHideWindow_Minimize(aura::Window* window) {
  // Property sets within this scope will be implicitly animated.
  ::wm::ScopedHidingAnimationSettings hiding_settings(window);
  base::TimeDelta duration =
      base::Milliseconds(kLayerAnimationsForMinimizeDurationMS);
  hiding_settings.layer_animation_settings()->SetTransitionDuration(duration);
  window->layer()->SetVisible(false);

  AddLayerAnimationsForMinimize(window, false);
}

void AnimateShowHideWindowCommon_BrightnessGrayscale(aura::Window* window,
                                                     bool show) {
  float start_value, end_value;
  if (show) {
    start_value = kWindowAnimation_HideBrightnessGrayscale;
    end_value = kWindowAnimation_ShowBrightnessGrayscale;
  } else {
    start_value = kWindowAnimation_ShowBrightnessGrayscale;
    end_value = kWindowAnimation_HideBrightnessGrayscale;
  }

  window->layer()->SetLayerBrightness(start_value);
  window->layer()->SetLayerGrayscale(start_value);
  if (show) {
    window->layer()->SetOpacity(kWindowAnimation_ShowOpacity);
    window->layer()->SetVisible(true);
  }

  base::TimeDelta duration =
      base::Milliseconds(kBrightnessGrayscaleFadeDurationMs);

  if (show) {
    ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
    window->layer()->GetAnimator()->ScheduleTogether(
        CreateBrightnessGrayscaleAnimationSequence(end_value, duration));
  } else {
    ::wm::ScopedHidingAnimationSettings hiding_settings(window);
    window->layer()->GetAnimator()->ScheduleTogether(
        CreateBrightnessGrayscaleAnimationSequence(end_value, duration));
    window->layer()->SetOpacity(kWindowAnimation_HideOpacity);
    window->layer()->SetVisible(false);
  }
}

void AnimateShowWindow_BrightnessGrayscale(aura::Window* window) {
  AnimateShowHideWindowCommon_BrightnessGrayscale(window, true);
}

// TODO(edcourtney): Consolidate with AnimateShowWindow_Fade in ui/wm/core.
void AnimateShowWindow_FadeIn(aura::Window* window) {
  window->layer()->SetOpacity(kWindowAnimation_HideOpacity);
  ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
  settings.SetTransitionDuration(base::Milliseconds(kFadeInAnimationMs));
  window->layer()->SetVisible(true);
  window->layer()->SetOpacity(kWindowAnimation_ShowOpacity);
}

void AnimateHideWindow_BrightnessGrayscale(aura::Window* window) {
  AnimateShowHideWindowCommon_BrightnessGrayscale(window, false);
}

void AnimateHideWindow_SlideOut(aura::Window* window) {
  base::TimeDelta duration =
      base::Milliseconds(PipPositioner::kPipDismissTimeMs);

  ::wm::ScopedHidingAnimationSettings settings(window);
  settings.layer_animation_settings()->SetTransitionDuration(duration);
  window->layer()->SetOpacity(kWindowAnimation_HideOpacity);
  window->layer()->SetVisible(false);

  gfx::Rect bounds = window->GetBoundsInScreen();
  display::Display display =
      display::Screen::GetScreen()->GetDisplayNearestWindow(window);
  gfx::Rect dismissed_bounds =
      PipPositioner::GetDismissedPosition(display, bounds);
  ::wm::ConvertRectFromScreen(window->parent(), &dismissed_bounds);
  window->layer()->SetBounds(dismissed_bounds);
}

void AnimateShowWindow_StepEnd(aura::Window* window) {
  window->layer()->SetOpacity(kWindowAnimation_HideOpacity);
  ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
  settings.SetTransitionDuration(kZeroAnimationMs);
  settings.SetTweenType(gfx::Tween::ZERO);
  window->layer()->SetOpacity(kWindowAnimation_ShowOpacity);
}

void AnimateHideWindow_StepEnd(aura::Window* window) {
  ::wm::ScopedHidingAnimationSettings settings(window);
  settings.layer_animation_settings()->SetTransitionDuration(kZeroAnimationMs);
  settings.layer_animation_settings()->SetTweenType(gfx::Tween::ZERO);
  window->layer()->SetVisible(false);
}

bool AnimateShowWindow(aura::Window* window) {
  if (!::wm::HasWindowVisibilityAnimationTransition(window,
                                                    ::wm::ANIMATE_SHOW)) {
    return false;
  }

  switch (::wm::GetWindowVisibilityAnimationType(window)) {
    case WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE:
      AnimateShowWindow_Minimize(window);
      return true;
    case WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE:
      AnimateShowWindow_BrightnessGrayscale(window);
      return true;
    case WINDOW_VISIBILITY_ANIMATION_TYPE_FADE_IN_SLIDE_OUT:
      AnimateShowWindow_FadeIn(window);
      return true;
    case WINDOW_VISIBILITY_ANIMATION_TYPE_STEP_END:
      AnimateShowWindow_StepEnd(window);
      return true;
    default:
      NOTREACHED();
      return false;
  }
}

bool AnimateHideWindow(aura::Window* window) {
  if (!::wm::HasWindowVisibilityAnimationTransition(window,
                                                    ::wm::ANIMATE_HIDE)) {
    return false;
  }

  switch (::wm::GetWindowVisibilityAnimationType(window)) {
    case WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE:
      AnimateHideWindow_Minimize(window);
      return true;
    case WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE:
      AnimateHideWindow_BrightnessGrayscale(window);
      return true;
    case WINDOW_VISIBILITY_ANIMATION_TYPE_FADE_IN_SLIDE_OUT:
      AnimateHideWindow_SlideOut(window);
      return true;
    case WINDOW_VISIBILITY_ANIMATION_TYPE_STEP_END:
      AnimateHideWindow_StepEnd(window);
      return true;
    default:
      NOTREACHED();
      return false;
  }
}

void CrossFadeAnimation(aura::Window* window,
                        std::unique_ptr<ui::LayerTreeOwner> old_layer_owner) {
  CrossFadeAnimationInternal(
      window, std::move(old_layer_owner), /*animate_old_layer=*/true,
      /*duration=*/absl::nullopt, /*tween_type=*/absl::nullopt,
      /*histogram_name=*/absl::nullopt);
}

void CrossFadeAnimationAnimateNewLayerOnly(aura::Window* window,
                                           const gfx::Rect& target_bounds,
                                           base::TimeDelta duration,
                                           gfx::Tween::Type tween_type,
                                           const std::string& histogram_name) {
  std::unique_ptr<ui::LayerTreeOwner> old_layer_owner =
      ::wm::RecreateLayers(window);
  window->SetBounds(target_bounds);
  CrossFadeAnimationInternal(window, std::move(old_layer_owner),
                             /*animate_old_layer=*/false, duration, tween_type,
                             histogram_name);
}

bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, bool visible) {
  if (::wm::WindowAnimationsDisabled(window))
    return false;

  // Attempt to run CoreWm supplied animation types.
  if (::wm::AnimateOnChildWindowVisibilityChanged(window, visible))
    return true;

  // Otherwise try to run an Ash-specific animation.
  if (visible)
    return AnimateShowWindow(window);
  // Don't start hiding the window again if it's already being hidden.
  return window->layer()->GetTargetOpacity() != 0.0f &&
         AnimateHideWindow(window);
}

std::vector<ui::LayerAnimationSequence*>
CreateBrightnessGrayscaleAnimationSequence(float target_value,
                                           base::TimeDelta duration) {
  gfx::Tween::Type animation_type = gfx::Tween::EASE_OUT;
  std::unique_ptr<ui::LayerAnimationSequence> brightness_sequence =
      std::make_unique<ui::LayerAnimationSequence>();
  std::unique_ptr<ui::LayerAnimationSequence> grayscale_sequence =
      std::make_unique<ui::LayerAnimationSequence>();

  std::unique_ptr<ui::LayerAnimationElement> brightness_element =
      ui::LayerAnimationElement::CreateBrightnessElement(target_value,
                                                         duration);
  brightness_element->set_tween_type(animation_type);
  brightness_sequence->AddElement(std::move(brightness_element));

  std::unique_ptr<ui::LayerAnimationElement> grayscale_element =
      ui::LayerAnimationElement::CreateGrayscaleElement(target_value, duration);
  grayscale_element->set_tween_type(animation_type);
  grayscale_sequence->AddElement(std::move(grayscale_element));

  std::vector<ui::LayerAnimationSequence*> animations;
  animations.push_back(brightness_sequence.release());
  animations.push_back(grayscale_sequence.release());

  return animations;
}

gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) {
  Shelf* shelf = Shelf::ForWindow(window);
  gfx::Rect item_rect = shelf->GetScreenBoundsOfItemIconForWindow(window);

  // The launcher item is visible and has an icon.
  if (!item_rect.IsEmpty())
    return item_rect;

  // If both the icon width and height are 0, then there is no icon in the
  // launcher for |window|. If the launcher is auto hidden, one of the height or
  // width will be 0 but the position in the launcher and the major dimension
  // are still reported correctly and the window can be animated to the launcher
  // item's light bar.
  if (item_rect.width() != 0 || item_rect.height() != 0) {
    if (shelf->GetVisibilityState() == SHELF_AUTO_HIDE) {
      gfx::Rect shelf_bounds = shelf->GetWindow()->GetBoundsInScreen();
      if (shelf->alignment() == ShelfAlignment::kLeft)
        item_rect.set_x(shelf_bounds.right());
      else if (shelf->alignment() == ShelfAlignment::kRight)
        item_rect.set_x(shelf_bounds.x());
      else
        item_rect.set_y(shelf_bounds.y());
      return item_rect;
    }
  }

  // Coming here, there is no visible icon of that shelf item and we zoom back
  // to the location of the application launcher (which is fixed as first item
  // of the shelf).
  gfx::Rect work_area =
      display::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area();
  int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x();
  switch (shelf->alignment()) {
    case ShelfAlignment::kBottom:
    case ShelfAlignment::kBottomLocked:
      return gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0);
    case ShelfAlignment::kLeft:
      return gfx::Rect(work_area.x(), work_area.y(), 0, 0);
    case ShelfAlignment::kRight:
      return gfx::Rect(work_area.right(), work_area.y(), 0, 0);
  }
  NOTREACHED();
  return gfx::Rect();
}

}  // namespace ash


text:
@interface NSColorSpace (DVTNSColorSpaceAdditions)
+ (id)dvt_LABColorSpace;
@end


text:
package com.google.cloud.backend.android;

public class DBTableConstants {

	public static final String DB_TABLE_ANGLES_EVENT = "AnglesEvent";
	public static final String DB_EVENT_ID = "EVNT_ID";
	public static final String DB_EVENT_START_DATE = "EVNT_STRT_DT";
	public static final String DB_EVENT_START_TIME = "EVNT_STRT_TIME";
	public static final String DB_EVENT_END_DATE = "EVNT_END_DT";
	public static final String DB_EVENT_END_TIME = "EVNT_END_TIME";
	public static final String DB_EVENT_DESCRIPTION = "EVNT_DESC";
	public static final String DB_EVENT_HOST_USERNAME = "EVNT_HOST_USR_NME";
	public static final String DB_EVENT_TITLE = "EVNT_TTL";

	public static final String DB_TABLE_ANGLE = "Angle";
	public static final String DB_ANGLE_IMAGE = "ANGLE_IMAGE";
	public static final String DB_ANGLE_CREATED_BY = "ANGLE_CREATED_BY";
	public static final String DB_ANGLE_CREATED_ON = "ANGLE_CREATED_ON";

	public static final String DB_USERS_USERNAME = "USR_NME";
	public static final String DB_USERS_EMAIL = "EMAIL";
	public static final String DB_USERS_PASSWORD = "USR_PW";
	public static final String DB_USERS_PHONENUMBER = "USR_PHN_NMBR";
	public static final String DB_USERS_USERSTABLENAME = "AnglesUsers";

	public static final String DB_TABLE_GUESTS = "Guests";
	public static final String DB_GUESTS_EVENT_ID = "EVENT_ID";
	public static final String DB_GUESTS_USERNAME = "USER_NAME";
	public static final String DB_GUESTS_ATTENDING_STATUS = "ATTENDING_STATUS";
}


text:
package de.htwg.risiko.util.observer;

public interface IObservable {

	void addObserver(IObserver s);

	void removeObserver(IObserver s);

	void removeAllObservers();

	void notifyObservers();

}


text:
package hu.interconnect.hr.module.reports.monthlypayrolldata;

import static hu.interconnect.util.DateUtils.getHoElsoNapja;
import static hu.interconnect.util.DateUtils.getHoUtolsoNapja;
import static hu.interconnect.util.DateUtils.getNapokSzamaEvbenEsHonapban;
import static hu.interconnect.util.DateUtils.getNullaIdopillanat;
import static hu.interconnect.util.DateUtils.napFormaz;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

import hu.interconnect.exception.ProgramozasiHiba;
import hu.interconnect.hr.backend.api.enumeration.JelenletiAdatTipus;
import hu.interconnect.hr.dao.JelenletiAdatDAO;
import hu.interconnect.hr.domain.JelenletiAdat;
import hu.interconnect.hr.domain.Szemelyitorzs;
import hu.interconnect.hr.module.reports.NullValueToEmptyStringMap;
import hu.interconnect.util.DateIterator;
import hu.interconnect.util.Localizer;

public class MonthlyPayrollDataRowFromPersonaldataCreator implements Function<Szemelyitorzs, Map<String, Object>> {

	private JelenletiAdatDAO jelenletiAdatDAO;

	private Date honap;

	public MonthlyPayrollDataRowFromPersonaldataCreator(JelenletiAdatDAO jelenletiAdatDAO, Date honap) {
		this.jelenletiAdatDAO = jelenletiAdatDAO;
		this.honap = honap;
	}

	@Override
	public Map<String, Object> apply(Szemelyitorzs szemelyitorzs) {
		NullValueToEmptyStringMap sor = new NullValueToEmptyStringMap();
		sor.put("torzsszam", szemelyitorzs.getTsz());

		sor.put("nev", szemelyitorzs.getTeljesNev());
		sor.putEmpty("jelenleti_iv_leadva");
		sor.putEmpty("km_hozzajarulas");

		List<JelenletiAdat> haviJelenletiAdatok = jelenletiAdatDAO.findBySzemelyitorzsEsHonap(szemelyitorzs.getTsz(), honap);

		Date to50 = getNullaIdopillanat();
		Date to100 = getNullaIdopillanat();
		Date m30 = getNullaIdopillanat();

		int kapottJelenletiAdatokSzama = haviJelenletiAdatok.size();
		int napokSzamaAzAdottHonapban = getNapokSzamaEvbenEsHonapban(honap);
		if (kapottJelenletiAdatokSzama != 0 && kapottJelenletiAdatokSzama != napokSzamaAzAdottHonapban) {
			throw new ProgramozasiHiba("Vagy 0 vagy pontosan annyi jelenletiAdatot varok, mint ahany nap van az adott honapban! Vártam: " + napokSzamaAzAdottHonapban + ", kaptam: " + kapottJelenletiAdatokSzama);
		}

		if (haviJelenletiAdatok.isEmpty()) {
			for (Date nap : new DateIterator(getHoElsoNapja(honap), getHoUtolsoNapja(honap))) {
				String napStr = napFormaz(nap);
				sor.put("ledolgozott_ora_" + napStr, "00:00");
			}
		} else {
			for (JelenletiAdat ja : haviJelenletiAdatok) {
				String napStr = napFormaz(ja.getDatum());
				if (ja.getTipus() == JelenletiAdatTipus.MUNKA || ja.getTipus() == JelenletiAdatTipus.SZABADNAP) {
					sor.putTime("ledolgozott_ora_" + napStr, ja.getLedolgozott() == null ? getNullaIdopillanat() : ja.getLedolgozott());
				} else {
					sor.put("ledolgozott_ora_" + napStr, Localizer.getMessage(ja.getTipus()));
				}

				if (ja.getTipus() == JelenletiAdatTipus.MUNKA) {
					to50.setTime(to50.getTime() + (ja.getTo50() != null ? (ja.getTo50().getTime() - getNullaIdopillanat().getTime()) : 0L));
					to100.setTime(to100.getTime() + (ja.getTo100() != null ? (ja.getTo100().getTime()- getNullaIdopillanat().getTime()) : 0L));
					m30.setTime(m30.getTime() + (ja.getM30() != null ? (ja.getM30().getTime()- getNullaIdopillanat().getTime()) : 0L));
				}
			}
		}

		sor.putTime("to50", to50);
		sor.putTime("to100", to100);
		sor.putTime("m30", m30);

		return sor.getMap();
	}
}


text:
"""Tests for the Zsh extended_history parser."""
import unittest

from plaso.lib import timelib
from plaso.parsers import zsh_extended_history

from tests import test_lib as shared_test_lib
from tests.parsers import test_lib

class ZshExtendedHistoryTest(test_lib.ParserTestCase):
  """Tests for the Zsh extended_history parser."""

  @shared_test_lib.skipUnlessHasTestFile([u'zsh_extended_history.txt'])
  def testParse(self):
    """Tests for the Parse method."""
    parser_object = zsh_extended_history.ZshExtendedHistoryParser()
    storage_writer = self._ParseFile(
        [u'zsh_extended_history.txt'], parser_object)

    self.assertEqual(len(storage_writer.events), 4)

    event = storage_writer.events[0]
    expected_timestamp = timelib.Timestamp.CopyFromString(
        u'2016-03-12 08:26:50')
    self.assertEqual(event.timestamp, expected_timestamp)
    self.assertEqual(event.elapsed_seconds, 0)
    self.assertEqual(event.command, u'cd plaso')

    event = storage_writer.events[2]
    expected_timestamp = timelib.Timestamp.CopyFromString(
        u'2016-03-26 11:54:53')
    expected_command = u'echo dfgdfg \\\\\n& touch /tmp/afile'
    self.assertEqual(event.timestamp, expected_timestamp)
    self.assertEqual(event.command, expected_command)

    event = storage_writer.events[3]
    expected_timestamp = timelib.Timestamp.CopyFromString(
        u'2016-03-26 11:54:57')
    self.assertEqual(event.timestamp, expected_timestamp)

  def testVerification(self):
    """Tests for the VerifyStructure method"""
    parser_object = zsh_extended_history.ZshExtendedHistoryParser()

    mediator = None
    valid_lines = u': 1457771210:0;cd plaso'
    self.assertTrue(parser_object.VerifyStructure(mediator, valid_lines))

    invalid_lines = u': 2016-03-26 11:54:53;0;cd plaso'
    self.assertFalse(parser_object.VerifyStructure(mediator, invalid_lines))

if __name__ == '__main__':
  unittest.main()


text:
<templateSet group="AndroidJava">
  <template name="avtypeadapter" value="public static TypeAdapter<$class$> typeAdapter(Gson gson) {
	return new AutoValue_$class$.GsonTypeAdapter(gson);
}" description="Create TypeAdapter for AutoValueGson" toReformat="true" toShortenFQNames="true">
    <variable name="class" expression="className()" defaultValue="" alwaysStopAt="false" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
  <template name="bbthis" value="ButterKnife.bind(this);" description="BindView annotated fields and methods in the specified Activity. The current content view is used as the view root." toReformat="true" toShortenFQNames="true">
    <context>
      <option name="JAVA_STATEMENT" value="true" />
      <option name="JAVA_EXPRESSION" value="true" />
      <option name="KOTLIN_STATEMENT" value="true" />
    </context>
  </template>
  <template name="bbview" value="ButterKnife.bind(this, $view$);" description="BindView annotated fields and methods in the specified target using the source View as the view root." toReformat="true" toShortenFQNames="true">
    <variable name="view" expression="complete()" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
      <option name="JAVA_EXPRESSION" value="true" />
    </context>
  </template>
  <template name="bfind" value="ButterKnife.findById($view$, R.id.$viewId$);" description="Simpler version of View.findViewById(int) which infers the target type." toReformat="true" toShortenFQNames="true">
    <variable name="view" expression="variableOfType("android.view.View")" defaultValue="" alwaysStopAt="true" />
    <variable name="viewId" expression="complete()" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
      <option name="JAVA_EXPRESSION" value="true" />
    </context>
  </template>
  <template name="bview" value="@BindView(R.id.$resId$) $class$ $variable$;" description="Bind a field to the view for the specified ID. The view will automatically be cast to the field type." toReformat="true" toShortenFQNames="true">
    <variable name="resId" expression="complete()" defaultValue="" alwaysStopAt="true" />
    <variable name="class" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
    <variable name="variable" expression="camelCase(resId)" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
  <template name="bviews" value="@BindViews({ R.id.$resId1$, R.id.$resId2$ }) List<$class$> $variable$;" description="Bind a field to the view for the specified ID. The view will automatically be cast to the field type." toReformat="true" toShortenFQNames="true">
    <variable name="resId1" expression="complete()" defaultValue="" alwaysStopAt="true" />
    <variable name="resId2" expression="complete()" defaultValue="" alwaysStopAt="true" />
    <variable name="class" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
    <variable name="variable" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
  <template name="onclick" value="@OnClick(R.id.$viewId$)
void on$view$Click() {
	$cursor$
}" description="Bind a method to an OnClickListener on the view for each ID specified." toReformat="true" toShortenFQNames="true">
    <variable name="viewId" expression="complete()" defaultValue="" alwaysStopAt="true" />
    <variable name="view" expression="capitalize(camelCase(viewId))" defaultValue="" alwaysStopAt="true" />
    <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
  <template name="onclickview" value="@OnClick(R.id.$viewId$)
void on$view$Click(View view) {
	$cursor$
}" description="Bind a method to an OnClickListener on the view for each ID specified." toReformat="true" toShortenFQNames="true">
    <variable name="viewId" expression="complete()" defaultValue="" alwaysStopAt="true" />
    <variable name="view" expression="capitalize(camelCase(viewId))" defaultValue="" alwaysStopAt="true" />
    <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
      <option name="KOTLIN_TOPLEVEL" value="true" />
    </context>
  </template>
  <template name="ontouch" value="@OnTouch(R.id.$viewId$)
void on$view$Touch() {
	$cursor$
}" description="Bind a method to an OnTouchListener on the view for each ID specified." toReformat="true" toShortenFQNames="true">
    <variable name="viewId" expression="complete()" defaultValue="" alwaysStopAt="true" />
    <variable name="view" expression="capitalize(camelCase(viewId))" defaultValue="" alwaysStopAt="true" />
    <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
  <template name="ontouchview" value="@OnTouch(R.id.$viewId$)
void on$view$Touch(View view) {
	$cursor$
}" description="Bind a method to an OnTouchListener on the view for each ID specified." toReformat="true" toShortenFQNames="true">
    <variable name="viewId" expression="complete()" defaultValue="" alwaysStopAt="true" />
    <variable name="view" expression="capitalize(camelCase(viewId))" defaultValue="" alwaysStopAt="true" />
    <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
  <template name="pa" value="public abstract $class$ $functionName$();" description="public abstract method" toReformat="true" toShortenFQNames="true">
    <variable name="class" expression="" defaultValue="" alwaysStopAt="true" />
    <variable name="functionName" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
  <template name="pai" value="public abstract int $functionName$();" description="public abstract integer method" toReformat="true" toShortenFQNames="true">
    <variable name="functionName" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
  <template name="pas" value="public abstract String $functionName$();" description="public abstract String method" toReformat="true" toShortenFQNames="true">
    <variable name="functionName" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
  <template name="td" value="Timber.d("$message$ " + $variable$);" description="Log a debug message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <variable name="variable" expression="variableOfType("")" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="te" value="Timber.e("$message$ " + $variable$);" description="Log an error message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <variable name="variable" expression="variableOfType("")" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="ti" value="Timber.i("$message$ " + $variable$);" description="Log an info message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <variable name="variable" expression="variableOfType("")" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="ttd" value="Timber.d($variable$, "$message$");" description="Log a debug exception and a message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="variable" expression="variableOfType("java.lang.Throwable")" defaultValue="" alwaysStopAt="false" />
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="tte" value="Timber.e($variable$, "$message$");" description="Log an error exception and a message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="variable" expression="variableOfType("java.lang.Throwable")" defaultValue="" alwaysStopAt="false" />
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="tti" value="Timber.i($variable$, "$message$");" description="Log an info exception and a message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="variable" expression="variableOfType("java.lang.Throwable")" defaultValue="" alwaysStopAt="false" />
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="ttv" value="Timber.v($variable$, "$message$");" description="Log a verbose exception and a message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="variable" expression="variableOfType("java.lang.Throwable")" defaultValue="" alwaysStopAt="false" />
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="ttw" value="Timber.w($variable$, "$message$");" description="Log a warning exception and a message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="variable" expression="variableOfType("java.lang.Throwable")" defaultValue="" alwaysStopAt="false" />
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="ttwtf" value="Timber.wtf($variable$, "$message$");" description="Log an assert exception and a message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="variable" expression="variableOfType("java.lang.Throwable")" defaultValue="" alwaysStopAt="false" />
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="tv" value="Timber.v("$message$ " + $variable$);" description="Log a verbose message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <variable name="variable" expression="variableOfType("")" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="tw" value="Timber.w("$message$ " + $variable$);" description="Log a warning message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <variable name="variable" expression="variableOfType("")" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="twtf" value="Timber.wtf("$message$ " + $variable$);" description="Log an assert message with optional format args." toReformat="true" toShortenFQNames="true">
    <variable name="message" expression="" defaultValue="" alwaysStopAt="true" />
    <variable name="variable" expression="variableOfType("")" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_STATEMENT" value="true" />
    </context>
  </template>
  <template name="sdef" value="@StringDef({ $variable$ })
@interface $name$ {}" description="Create enumerated annotation of String set" toReformat="true" toShortenFQNames="true">
    <variable name="variable" expression="" defaultValue="" alwaysStopAt="true" />
    <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
  <template name="idef" value="@IntDef({ $variable$ })
@interface $name$ {}" description="Create enumerated annotation of Integer set" toReformat="true" toShortenFQNames="true">
    <variable name="variable" expression="" defaultValue="" alwaysStopAt="true" />
    <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="JAVA_DECLARATION" value="true" />
    </context>
  </template>
</templateSet>


text:
package com.amazonaws.services.transfer.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.transfer.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * ListedProfile JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListedProfileJsonUnmarshaller implements Unmarshaller<ListedProfile, JsonUnmarshallerContext> {

    public ListedProfile unmarshall(JsonUnmarshallerContext context) throws Exception {
        ListedProfile listedProfile = new ListedProfile();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return null;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("Arn", targetDepth)) {
                    context.nextToken();
                    listedProfile.setArn(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("ProfileId", targetDepth)) {
                    context.nextToken();
                    listedProfile.setProfileId(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("As2Id", targetDepth)) {
                    context.nextToken();
                    listedProfile.setAs2Id(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("ProfileType", targetDepth)) {
                    context.nextToken();
                    listedProfile.setProfileType(context.getUnmarshaller(String.class).unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return listedProfile;
    }

    private static ListedProfileJsonUnmarshaller instance;

    public static ListedProfileJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new ListedProfileJsonUnmarshaller();
        return instance;
    }
}


text:
{% extends "base.html" %}
{% block title %}New User{% endblock %}
{% block title_path %}New User{% endblock %}
{% block content %}
<form action="/user/new" method="POST">
    <input name="username" type="text" placeholder="Username" />
    <input name="password" type="password" placeholder="Password" />
    <input type="submit" value="Create User" />
</form>
{% endblock %}


text:
<component name="libraryTable">
  <library name="SBT: org.springframework:spring-context:4.2.7.RELEASE:jar">
    <CLASSES>
      <root url="jar://$USER_HOME$/.ivy2/cache/org.springframework/spring-context/jars/spring-context-4.2.7.RELEASE.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$USER_HOME$/.ivy2/cache/org.springframework/spring-context/docs/spring-context-4.2.7.RELEASE-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$USER_HOME$/.ivy2/cache/org.springframework/spring-context/srcs/spring-context-4.2.7.RELEASE-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
Comments

{{! This is a comment with <p>some markup</p> in it }}
{{! This is a comment }} {{ this_is_not }}

Variables

<p>{{ text }}</p>
<h1>{{article.title}}</h1>
{{{ triple_stash_is_supported }}}
{{articles.[10].[#comments]}}

Strings, numbers and booleans

{{{link "See more..." story.url}}}
{{ true }}
{{ custom_helper 42 href="somepage.html" false }}

Block helpers

<div class="body">
	{{#bold}}{{body}}{{/bold}}
</div>
{{#with story}}
	<div class="intro">{{{intro}}}</div>
	<div class="body">{{{body}}}</div>
{{/with}}
<div class="{{#if test}}foo{{else}}bar{{/if}}"></div>
{{#list array}}
	{{@index}}. {{title}}
{{/list}}
{{#block-with-hyphens args=yep}}
	This should probably work...
{{/block-with-hyphens}}

Known failures

There are certain edge cases where Prism will fail.
	There are always such cases in every regex-based syntax highlighter.
	However, Prism dares to be open and honest about them.
	If a failure is listed here, it doesn't mean it will never be fixed. This is more of a "known bugs" list, just with a certain type of bug.

Handlebars tag in the middle of an HTML tag

<div{{#if test}} class="test"{{/if}}></div>


text:
package org.la4j.matrix;

import org.la4j.Matrices;
import org.la4j.iterator.MatrixIterator;
import org.la4j.iterator.VectorIterator;
import org.la4j.Matrix;
import org.la4j.matrix.sparse.CRSMatrix;
import org.la4j.operation.MatrixMatrixOperation;
import org.la4j.operation.MatrixOperation;
import org.la4j.operation.MatrixVectorOperation;
import org.la4j.Vector;

import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;

public abstract class RowMajorSparseMatrix extends SparseMatrix {

    public RowMajorSparseMatrix(int rows, int columns) {
        super(rows, columns);
    }

    public RowMajorSparseMatrix(int rows, int columns, int cardinality) {
        super(rows, columns, cardinality);
    }

    /**
     * Creates a zero {@link RowMajorSparseMatrix} of the given shape:
     * {@code rows} x {@code columns}.
     */
    public static RowMajorSparseMatrix zero(int rows, int columns) {
        return CRSMatrix.zero(rows, columns);
    }

    /**
     * Creates a zero {@link RowMajorSparseMatrix} of the given shape:
     * {@code rows} x {@code columns} with the given {@code capacity}.
     */
    public static RowMajorSparseMatrix zero(int rows, int columns, int capacity) {
        return CRSMatrix.zero(rows, columns, capacity);
    }

    /**
     * Creates a diagonal {@link RowMajorSparseMatrix} of the given {@code size} whose
     * diagonal elements are equal to {@code diagonal}.
     */
    public static RowMajorSparseMatrix diagonal(int size, double diagonal) {
        return CRSMatrix.diagonal(size, diagonal);
    }

    /**
     * Creates an identity {@link RowMajorSparseMatrix} of the given {@code size}.
     */
    public static RowMajorSparseMatrix identity(int size) {
        return CRSMatrix.identity(size);
    }

    /**
     * Creates a random {@link RowMajorSparseMatrix} of the given shape:
     * {@code rows} x {@code columns}.
     */
    public static RowMajorSparseMatrix random(int rows, int columns, double density, Random random) {
        return CRSMatrix.random(rows, columns, density, random);
    }

    /**
     * Creates a random symmetric {@link RowMajorSparseMatrix} of the given {@code size}.
     */
    public static RowMajorSparseMatrix randomSymmetric(int size, double density, Random random) {
        return CRSMatrix.randomSymmetric(size, density, random);
    }

    /**
     * Creates a new {@link RowMajorSparseMatrix} from the given 1D {@code array} with
     * compressing (copying) the underlying array.
     */
    public static RowMajorSparseMatrix from1DArray(int rows, int columns, double[] array) {
        return CRSMatrix.from1DArray(rows, columns, array);
    }

    /**
     * Creates a new {@link RowMajorSparseMatrix} from the given 2D {@code array} with
     * compressing (copying) the underlying array.
     */
    public static RowMajorSparseMatrix from2DArray(double[][] array) {
        return CRSMatrix.from2DArray(array);
    }

    /**
     * Creates a block {@link RowMajorSparseMatrix} of the given blocks {@code a},
     * {@code b}, {@code c} and {@code d}.
     */
    public static RowMajorSparseMatrix block(Matrix a, Matrix b, Matrix c, Matrix d) {
        return CRSMatrix.block(a, b, c, d);
    }

    /**
     * Parses {@link RowMajorSparseMatrix} from the given CSV string.
     *
     * @param csv the CSV string representing a matrix
     *
     * @return a parsed matrix
     */
    public static RowMajorSparseMatrix fromCSV(String csv) {
        return Matrix.fromCSV(csv).to(Matrices.SPARSE_ROW_MAJOR);
    }

    /**
     * Parses {@link RowMajorSparseMatrix} from the given Matrix Market.
     *
     * @param is the input stream in Matrix Market format
     *
     * @return a parsed matrix
     * @exception  IOException  if an I/O error occurs.
     */
    public static RowMajorSparseMatrix fromMatrixMarket(InputStream is) throws IOException {
        return Matrix.fromMatrixMarket(is).to(Matrices.SPARSE_ROW_MAJOR);
    }

    @Override
    public boolean isRowMajor() {
        return true;
    }

    @Override
    public Matrix transpose() {
        Matrix result = ColumnMajorSparseMatrix.zero(columns, rows);
        MatrixIterator it = nonZeroRowMajorIterator();

        while (it.hasNext()) {
            double x = it.next();
            int i = it.rowIndex();
            int j = it.columnIndex();
            result.set(j, i, x);
        }

        return result;
    }

    @Override
    public Matrix rotate() {
        Matrix result = ColumnMajorSparseMatrix.zero(columns, rows);

        Iterator<Integer> nzRows = iteratorOfNonZeroRows();
        List<Integer> reversedNzRows = new LinkedList<Integer>();
        while (nzRows.hasNext()) {
            reversedNzRows.add(0, nzRows.next());
        }

        for (int i: reversedNzRows) {
            VectorIterator it = nonZeroIteratorOfRow(i);
            while (it.hasNext()) {
                double x = it.next();
                int j = it.index();
                result.set(j, rows - 1 - i, x);
            }
        }

        return result;
    }

    public abstract Iterator<Integer> iteratorOfNonZeroRows();

    @Override
    public <T> T apply(MatrixOperation<T> operation) {
        operation.ensureApplicableTo(this);
        return operation.apply(this);
    }

    @Override
    public <T> T apply(MatrixMatrixOperation<T> operation, Matrix that) {
        return that.apply(operation.partiallyApply(this));
    }

    @Override
    public <T> T apply(MatrixVectorOperation<T> operation, Vector that) {
        return that.apply(operation.partiallyApply(this));
    }
}


text:
/*Sign in -- start*/
.form-signin {
	border: 1px solid #ccc;
	background-color: #fff;
	max-width: 520px;
	padding: 30px 80px 60px 80px;
	margin: 0 auto;
}
.form-signin h2{
	font-family:"Microsoft Yahei", "Trebuchet MS", Georgia,"Times New Roman",Times,sans-serif;
	text-align: center;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
	margin-bottom: 10px;
}
.form-signin .checkbox {
	font-weight: normal;
}
.form-signin .form-control {
	position: relative;
	font-size: 16px;
	height: auto;
	padding: 10px;
}
.form-signin .form-control:focus {
	z-index: 2;
}
.form-signin #userNameInput {
	margin-bottom: -1px;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}
.form-signin #pwdInput {
	margin-bottom: 10px;
	border-top-left-radius: 0;
	border-top-right-radius: 0;
}
/*Sign in -- end*/


text:
package com.indeed.util.mmap;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

/** @author jplaisance */
public interface Memory {

    public byte getByte(final long l);

    public void putByte(final long l, final byte b);

    public short getShort(final long l);

    public void putShort(final long l, final short i);

    public char getChar(final long l);

    public void putChar(final long l, final char c);

    public int getInt(final long l);

    public void putInt(final long l, final int i);

    public long getLong(final long l);

    public void putLong(final long l, final long l1);

    public float getFloat(final long l);

    public void putFloat(final long l, final float v);

    public double getDouble(final long l);

    public void putDouble(final long l, final double v);

    public void putBytes(final long l, final byte[] bytes);

    public void putBytes(final long l, final byte[] bytes, final int start, final int length);

    public void putBytes(final long l, final Memory source);

    public void putBytes(final long l, final Memory source, final long start, final long length);

    public void putBytes(final long l, final ByteBuffer source);

    public void getBytes(final long l, final byte[] bytes);

    public void getBytes(final long l, final byte[] bytes, final int start, final int length);

    public void getBytes(final long l, final Memory dest);

    public void getBytes(final long l, final Memory dest, final long start, final long length);

    public void getBytes(final long l, final ByteBuffer dest);

    public Memory slice(long startAddress, long sliceLength);

    public ByteArray byteArray(long start, long numBytes);

    public ShortArray shortArray(long start, long numShorts);

    public IntArray intArray(long start, long numInts);

    public LongArray longArray(long start, long numLongs);

    public FloatArray floatArray(long start, long numFloats);

    public DoubleArray doubleArray(long start, long numDoubles);

    public CharArray charArray(long start, long numChars);

    public long length();

    public boolean isDirect();

    public ByteOrder getOrder();
}


text:
package org.xbib.elasticsearch.action.deploy;

import org.elasticsearch.action.support.nodes.BaseNodesRequest;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.io.Streams;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.ESLoggerFactory;
import org.elasticsearch.common.settings.Settings;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;

public class DeployRequest extends BaseNodesRequest<DeployRequest> {

    private final ESLogger logger = ESLoggerFactory.getLogger(DeployRequest.class.getSimpleName());

    private String name;

    private String path;

    private BytesReference content;

    private String contentType;

    private boolean read;

    public DeployRequest() {
    }

    public DeployRequest(String... nodeIds) {
        super(nodeIds);
    }

    public DeployRequest setRead(boolean read) {
        this.read = read;
        return this;
    }

    public boolean getRead() {
        return read;
    }

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

    public String getName() {
        return name;
    }

    public DeployRequest setPath(Settings settings, String path) throws IOException {
        this.path = path;
        if (path == null || path.isEmpty()) {
            throw new IOException("path not given");
        }
        InputStream in = null;
        // local access, always allowed
        File f = new File(path);
        if (f.exists() && f.canRead()) {
            in = new FileInputStream(f);
        } else {
            // try URL
            try {
                URL url = new URL(path);
                // caution: do not download from unconfigured domains
                String[] domains = settings.getAsArray("plugins.deploy.domains");
                boolean allowed = false;
                if (domains != null) {
                    for (String domain : domains) {
                        allowed = allowed || url.getHost().endsWith(domain);
                    }
                }
                if (allowed) {
                    in = url.openStream();
                }
            } catch (MalformedURLException e) {
                //
            }
            if (in == null) {
                throw new IOException("can't read from " + path);
            }
        }
        BytesStreamOutput out = new BytesStreamOutput();
        Streams.copy(in, out);
        in.close();
        out.close();
        this.content = out.bytes();
        logger.debug("content length = {}", content.length());
        return this;
    }

    public String getPath() {
        return path;
    }

    public DeployRequest setContentType(String contentType) {
        this.contentType = contentType;
        return this;
    }

    public String getContentType() {
        return contentType;
    }

    public DeployRequest setContent(BytesReference content) {
        this.content = content;
        return this;
    }

    public BytesReference getContent() {
        return content;
    }

    @Override
    public void readFrom(StreamInput in) throws IOException {
        super.readFrom(in);
        this.read = in.readBoolean();
        this.name = in.readString();
        this.path = in.readString();
        this.content = in.readBytesReference();
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        super.writeTo(out);
        if (name == null) {
            throw new IOException("no name was given for deploy request");
        }
        if (content == null) {
            throw new IOException("no valid path was given for deploy request");
        }
        out.writeBoolean(read);
        out.writeString(name);
        out.writeString(path);
        out.writeBytesReference(content);
    }

}


text:
package midd

import (
	"fmt"
	"time"

	"github.com/dgrijalva/jwt-go"
)

// const for JWT
const (
	SigningKey = "staticsecrettest"
)

// GenerateToken and print it in the console
func GenerateToken() {
	token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
		"exp": time.Now().Add(time.Hour * 96).Unix(),
	})
	token.Header["typ"] = "JWT"

	t, _ := token.SignedString([]byte(SigningKey))
	fmt.Println(t)
}


text:
require 'rails_parser/blueprints/ruby/method_call_blueprint'

module RailsParser #:nodoc:
  module Blueprints
  end
end


text:
package com.netcracker.repositories.impl;

import com.netcracker.entities.Comment;
import com.netcracker.exception.DuplicateEntityException;
import com.netcracker.exception.NoSuchEntityException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Date;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

/**
 *  Test for {@link com.netcracker.repositories.impl.UserRepositoryImpl}
 *
 *  Add a VM Options before start test:
 * -Duser.language=en
 * -Duser.region=us
 */

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:/data-context.xml"})
public class CommentRepositoryTest {

    @Autowired
    CommentRepositoryImpl commentRepository;
    Comment comment = new Comment();

    @Test
    public void addCommentTest(){
        /*comment.setUserId(1);
        comment.setLabelId(1);
        comment.setCommentDate(new Date());
        comment.setCommentText("TEST");

        long countOfCommentTableRows = commentRepository.getColumnCount();
        comment = commentRepository.add(comment);

        assertThat(commentRepository.getColumnCount(), is(countOfCommentTableRows + 1));*/
    }

    @Test
    public void updateCommentTest(){
        /*comment.setCommentText("NEWTEST");

        assertThat(commentRepository.update(comment), is(comment));*/
    }

    @Test
    public void getByIdCommentTest(){
        //assertThat(commentRepository.getById(comment.getId()), is(comment));
    }

    @Test
    public void deleteCommentTest(){
        /*long countOfCommentTableRows = commentRepository.getColumnCount();
        commentRepository.remove(comment);

        assertThat(commentRepository.getColumnCount(), is(countOfCommentTableRows - 1));*/
    }

    /*@Test(expected = DuplicateEntityException.class)
    public void addDuplicateCommentThrowsException(){

    }

    @Test(expected = NoSuchEntityException.class)
    public void updateNonExistingCommentThrowsException(){

    }

    @Test(expected = NoSuchEntityException.class)
    public void getNonExistingCommentThrowsException(){

    }

    @Test(expected = NoSuchEntityException.class)
    public void deleteNonExistingCommentThrowsException(){

    }*/
}


text:
{
  return "undefined" == typeof e;
}


text:
package es.devera.maven.plugins.docker;

import com.kpelykh.docker.client.DockerException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;

/**
 * Enables maven to create a container in Docker.
 * @author Eduardo de Vera
 */
@Mojo(name = DockerCreateMojo.MOJO_NAME)
public class DockerCreateMojo extends DockerMojo {

    static final String MOJO_NAME = "createContainer";

    public void execute() throws MojoExecutionException, MojoFailureException {
        try {
            createContainer();
        } catch (DockerException e) {
            throw new MojoExecutionException(
                    String.format("Error while trying to remove container %s", getContainerId()), e);
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Syst. mycol. (Lundae) 1: 29 (1821)

#### Original name
Agaricus vagans Fr.

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualScriptResourcePath" inherits="VisualScriptNode" category="Core" version="3.1">
	<brief_description>
	</brief_description>
	<description>
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
	</methods>
	<members>
		<member name="path" type="String" setter="set_resource_path" getter="get_resource_path">
		</member>
	</members>
	<constants>
	</constants>
</class>


text:
import React from 'react';
import ReactDOM from 'react-dom';
import Tabs from './Tabs';
import Tab from './Tab';

it('renders without crashing', () => {
  const div = document.createElement('div');
  ReactDOM.render(
    <Tabs>
      <Tab />
    </Tabs>,
    div
  );
});


text:
package com.intellij.ide;

import com.intellij.openapi.actionSystem.DataContext;
import javax.annotation.Nonnull;

public interface PasteProvider {
  void performPaste(@Nonnull DataContext dataContext);

  /**
   * Should perform fast and memory cheap negation. May return incorrect true.
   * See #12326
   */
  boolean isPastePossible(@Nonnull DataContext dataContext);
  boolean isPasteEnabled(@Nonnull DataContext dataContext);
}


text:
require 'spec_helper'

describe 'gws_portal_user_portal', type: :feature, dbscope: :example do
  let(:site) { gws_site }
  let(:user) { create :gws_user }
  let(:index_path) { gws_portal_user_path(site: site, user: user) }
  let(:portal) { user.find_portal_setting(cur_user: user, cur_site: site).tap(&:save) }
  let(:default_portlets) { SS.config.gws['portal']['user_portlets'] }

  context 'without permission' do
    before do
      login_gws_user

      # remove permissions
      role = gws_user.gws_roles.first
      permissions = role.permissions.reject { |name| name =~ /_other_gws_portal_/ }
      role.update(permissions: permissions)
    end

    it '#index 403' do
      visit index_path
      expect(current_path).to eq index_path

      # not have permissions
      expect(page).to have_no_css('.nav-management-menu a')

      visit gws_portal_user_portlets_path(site: site, user: user)
      expect(page).to have_css('#addon-basic .addon-head', text: I18n.t("ss.rescues.default.head"))

      visit gws_portal_user_settings_path(site: site, user: user)
      expect(page).to have_css('#addon-basic .addon-head', text: I18n.t("ss.rescues.default.head"))
    end
  end

  context 'with auth' do
    before { login_gws_user }

    it '#index' do
      visit index_path
      default_portlets.each do |data|
        expect(page).to have_css(".portlet-model-#{data['model']}")
      end
      expect(Gws::Portal::UserPortlet.all.size).to eq(0)

      first('.current-navi a.management').click
      expect(current_path).to eq gws_portal_user_layouts_path(site: site, user: user)
      expect(Gws::Portal::UserPortlet.all.size).to eq(default_portlets.size)

      # setting
      first('#navi a', text: I18n.t('gws/portal.links.settings')).click
      expect(current_path).to eq gws_portal_user_settings_path(site: site, user: user)

      first('#menu a', text: I18n.t('ss.links.edit')).click
      expect(current_path).to eq edit_gws_portal_user_settings_path(site: site, user: user)

      click_button I18n.t('ss.buttons.save')
      expect(current_path).to eq gws_portal_user_settings_path(site: site, user: user)

      # layout
      first('#navi a', text: I18n.t('gws/portal.links.arrange_portlets')).click
      click_button I18n.t('ss.buttons.reset')
      click_button I18n.t('gws/portal.buttons.save_layouts')

      # portlets
      first('#navi a', text: I18n.t('gws/portal.links.manage_portlets')).click
      expect(current_path).to eq gws_portal_user_portlets_path(site: site, user: user)

      first('.list-items a', text: default_portlets.first['name']).click
      first('#menu a', text: I18n.t('ss.links.edit')).click
      click_button I18n.t('ss.buttons.save')

      first('#menu a', text: I18n.t('ss.links.delete')).click
      click_button I18n.t('ss.buttons.delete')
      expect(Gws::Portal::UserPortlet.all.size).not_to eq(default_portlets.size)

      first('a', text: I18n.t('ss.links.initialize')).click
      click_button I18n.t('ss.buttons.initialize')
      expect(Gws::Portal::UserPortlet.all.size).to eq(default_portlets.size)
    end
  end

  context 'with sns mode: only allowed use_gws_portal_user_settings permission' do
    let(:role) { create(:gws_role_portal_user_use, permissions: %w(use_gws_board read_private_gws_board_posts)) }
    let!(:user) { create(:gws_user, group_ids: [ site.id ], gws_role_ids: [ role.id ]) }

    before do
      portal = user.find_portal_setting(cur_user: user, cur_site: site)
      portal.save!
      portal.save_default_portlets([{ "model" => "board" }])

      login_user user
    end

    it do
      visit gws_portal_path(site: site)
      within ".main-navi" do
        expect(page).to have_css("a.icon-portal[href='/.g#{site.id}']", text: I18n.t('modules.gws/portal'))
        expect(page).to have_no_css("a.icon-portal", text: I18n.t('gws/portal.self_portal'))
        expect(page).to have_no_css("a.icon-portal", text: I18n.t('gws/portal.tabs.root_portal'))
      end
      expect(page).to have_css(".gws-portlets .portlet-model-board", text: I18n.t("gws/portal.portlets.board.name"))

      visit gws_portal_user_path(site: site, user: user)
      within ".main-navi" do
        expect(page).to have_css("a.icon-portal[href='/.g#{site.id}']", text: I18n.t('modules.gws/portal'))
        expect(page).to have_no_css("a.icon-portal", text: I18n.t('gws/portal.self_portal'))
        expect(page).to have_no_css("a.icon-portal", text: I18n.t('gws/portal.tabs.root_portal'))
      end
      expect(page).to have_css(".gws-portlets .portlet-model-board", text: I18n.t("gws/portal.portlets.board.name"))
    end
  end
end


text:
from flask import Flask, render_template, request
import config
import random, string, json, redis
import eventlet
import eventlet.wsgi
import socketio

app = Flask(__name__)
app.config['SECRET_KEY'] = config.key
rds = redis.Redis(host='localhost', port=6379, db=0, password=None)
socket_app = socketio.Server()

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/download', methods=['GET', 'POST'])
def download():
    url = request.form.get('url', '')
    print(url)
    key = ''.join([random.choice(string.ascii_letters + string.digits) for _ in range(16)])

    nums = rds.publish('download_job', json.dumps({'url': url, 'key': key}))

    return render_template('download.html')

@socket_app.on('my event')
def event(sid, environ):
    print('received sid:{} emviron:{} '.format(sid, environ))
    if 'key' not in environ:
        socket_app.emit(environ['key'], {'message': '错误'})
        return
    socket_app.emit(environ['key'], {'message': '等待'})

@app.route('/callback', methods=['GET', 'POST'])
def callback():
    data = request._get_body_string().decode()
    print(data)
    data = json.loads(data)
    key = data.get('key', '')
    file_name = data.get('filename', '')
    print(key, file_name)
    url = 'http://oi9gn1ckm.bkt.clouddn.com/{}'.format(file_name)
    print(url)
    socket_app.emit(key, {'url': url})

if __name__ == '__main__':
    # app.run(port=63730)

    new_app = socketio.Middleware(socket_app, app)
    eventlet.wsgi.server(eventlet.listen(('', 8000)), new_app)


text:
define(function (require) {
  var http = require('plugins/http'),
      app = require('durandal/app'),
      ko = require('knockout');

  return {
     username: ko.observable(),
     password: ko.observable(),
     loginUser: function() {
        return http.jsonp('http://halifaxamalgam.com/api/php_scripts/login.php', {username: this.username(), password: this.password()}, 'jsoncallback').then(function(response) {
          console.log(response);
          if(response > 0){
            location.href="#incidents";
          }
          else
            app.showMessage("Opps! Login Error, please try again.");
       });
     }
   };
});


text:
import { first } from 'vs/base/common/async';
import { onUnexpectedExternalError } from 'vs/base/common/errors';
import { registerDefaultLanguageCommand } from 'vs/editor/browser/editorExtensions';
import { Position } from 'vs/editor/common/core/position';
import { ITextModel } from 'vs/editor/common/model';
import * as modes from 'vs/editor/common/modes';
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { CancellationToken } from 'vs/base/common/cancellation';

export const Context = {
	Visible: new RawContextKey<boolean>('parameterHintsVisible', false),
	MultipleSignatures: new RawContextKey<boolean>('parameterHintsMultipleSignatures', false),
};

export function provideSignatureHelp(model: ITextModel, position: Position, context: modes.SignatureHelpContext, token: CancellationToken): Promise<modes.SignatureHelp> {

	const supports = modes.SignatureHelpProviderRegistry.ordered(model);

	return first(supports.map(support => () => {
		return Promise.resolve(support.provideSignatureHelp(model, position, token, context)).catch(onUnexpectedExternalError);
	}));
}

registerDefaultLanguageCommand('_executeSignatureHelpProvider', (model, position) =>
	provideSignatureHelp(model, position, { triggerReason: modes.SignatureHelpTriggerReason.Invoke }, CancellationToken.None));


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>OCS 2018/1/31 Meeting</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

Oakton CS Club Jan. 31, 2018 Meeting

    We briefly introduced
    the Swift programming language, and how you can learn it. You should definitely try it out before Apple annouces
    this year's WWDC Scholarship (which give you a chance to talk to Apple CEO and etc.) We'll definitely be talking about
    machine learning and artificial intelligence in the next meeting. Also,
    sign up for HackTJ if you haven't done so.


text:
#ifndef __TBA_CLR_EXECUTER_COMPILER_PRECOMPILEDREPOSITORY_H
#define __TBA_CLR_EXECUTER_COMPILER_PRECOMPILEDREPOSITORY_H

/*
 * PrecompiledRepository.h
 *
 * Contain a list of all functions that already been compiled
 *
 * Elad Raz
 * 2012
 */
#include "xStl/types.h"
#include "xStl/os/lockable.h"
#include "xStl/os/os.h"
#include "xStl/data/sarray.h"
#include "xStl/data/string.h"
#include "xStl/data/serializedObject.h"
#include "xStl/stream/basicIO.h"
#include "runnable/Apartment.h"
#include "runnable/GlobalContext.h"

#include "dismount/assembler/SecondPassBinary.h"

class PrecompiledRepository : public cSerializedObject {
public:
    /*
     * Constructor.
     */
    PrecompiledRepository(const ApartmentPtr& mainApartment);

    /*
     * From a signature and apartment name return a secondpass binary.
     * If there is a function in the repository. Update it's time and return the content of the binary
     * If there is no function return empty reference object
     *
     * NOTE: This is a thread safe function
     */
    SecondPassBinaryPtr getPrecompiledMethod(const cString& apartmentName, const cBuffer& signature) const;

    /*
     * Add a new precompiled header to the repository
     *
     * NOTE: This is a thread safe function
     */
    void appendPrecompiledMethod(const cString& apartmentName, const cBuffer& signature,
                                 const SecondPassBinaryPtr& compiledFunction);

    // See cSerializedObject::isValid
    virtual bool isValid() const;
    // See cSerializedObject::deserialize
    virtual void deserialize(basicInput& inputStream);
    // See cSerializedObject::serialize
    virtual void serialize(basicOutput& outputStream) const;

private:
    // Deny copy-constructor
    PrecompiledRepository(const PrecompiledRepository& other);

    // The lockable object
    mutable cXstlLockable m_lock;
    // Main apartment pointer
    mutable ApartmentPtr m_mainApartment;

    struct MethodSignature
    {
        // Last function update time. Use for aging.
        mutable cOSDef::systemTime time;
        // And data
        SecondPassBinaryPtr binary;
    };

    // Per apartment, signatures of methods
    typedef cHash<cBuffer, MethodSignature> ApartmentPrecompiledMethods;
    struct ApartmentSignature
    {
        ApartmentPrecompiledMethods hash;
        uint apartmentHelperNumber;
    };

    // Main header file
    cHash<cString, ApartmentSignature> m_apartments;

    // PrecompiledRepository file header
    static const char gRepositoryHeader[];
};

#endif // __TBA_CLR_EXECUTER_COMPILER_PRECOMPILEDREPOSITORY_H