text:
const MOVE_THRESHOLD = 5.0;
const CROSS_OUT_REVERSES = 6;
const FLICK_THRESHOLD = 0.5;
const CIRCLE_RADIANS = 2 * Math.PI;

/**
 * Construct a new vector at the specified x and y.
 * @param x the vector's x coordinate.
 * @param y the vector's y coordinate.
 * @constructor
 */
function Vec2(x, y) {
    this.x = x;
    this.y = y;

    /**
     * Add this vector to another vector and return the result.
     * @param that the other vector.
     * @returns {Vec2} the sum of this vector and the other vector.
     */
    this.add = function (that) {
        return new Vec2(this.x + that.x, this.y + that.y);
    };

    /**
     * Subtract another vector from this vector and return the result.
     * @param that the other vector.
     * @returns {Vec2} the difference between this vector and the other vector.
     */
    this.sub = function (that) {
        return new Vec2(this.x - that.x, this.y - that.y);
    };

    /**
     * Compute the length of this vector.
     * @returns {number} the vector's length.
     */
    this.len = function () {
        return Math.sqrt(x * x + y * y);
    };

    /**
     * Compute the dot product of this vector and another vector.
     * @param that the other vector.
     * @returns {number} the dot product.
     */
    this.dot = function (that) {
        return this.x * that.x + this.y * that.y;
    };

    /**
     * Compute the cross product of this vector and another vector.
     * @param that the other vector.
     * @returns {number} the cross product.
     */
    this.crs = function (that) {
        return this.x * that.y - that.x * this.y;
    };

    /**
     * Compute the angle between this vector and another vector.
     * @param dot a precomputed dot product.
     * @param crs a precomputed cross product.
     * @param that the other vector.
     * @returns {number} the angle between this vector and the other vector.
     */
    this.angle = function (dot, crs, that) {
        var lengthV1 = this.len();
        var lengthV2 = that.len();
        var theta = Math.asin(crs / (lengthV1 * lengthV2));
        if (dot < 0) {
            if (crs >= 0) {
                theta = Math.PI - theta;
            } else {
                theta = -Math.PI - theta;
            }
        }
        return theta;
    };
}

/**
 * Construct a new box containing the specified points.
 * @param points the points.
 * @constructor
 */
function Box(points) {
    var minX = Number.MAX_VALUE;
    var minY = Number.MAX_VALUE;
    var maxX = Number.MIN_VALUE;
    var maxY = Number.MIN_VALUE;

    points.forEach(function (point) {
        console.log(point.x);

        minX = Math.min(minX, point.x);
        minY = Math.min(minY, point.y);
        maxX = Math.max(maxX, point.x);
        maxY = Math.max(maxY, point.y);
    });

    this.upperLeft = new Vec2(minX, minY);
    this.lowerRight = new Vec2(maxX, maxY);
    this.width = this.lowerRight.x - this.upperLeft.x;
    this.height = this.lowerRight.y - this.upperLeft.y;
    this.isNarrow =
        this.width <= this.height * 0.2 ||
        this.height <= this.width * 0.2;
    this.isShort = this.height <= this.width * 0.5;
}

/**
 * The "enum" of gesture types. Immutable.
 */
const GestureType = Object.freeze({
    SWIPE_UP: "Swipe Up",
    SWIPE_DOWN: "Swipe Down",
    SWIPE_LEFT: "Swipe Left",
    SWIPE_RIGHT: "Swipe Right",

    FLICK_UP: "Flick Up",
    FLICK_DOWN: "Flick Down",
    FLICK_LEFT: "Flick Left",
    FLICK_RIGHT: "Flick Right",

    SPIRAL_CLOCKWISE: "Spiral Clockwise",
    SPIRAL_COUNTERCLOCKWISE: "Spiral Counterclockwise",

    RUB_OUT: "Rub Out",

    CLICK: "Click",
    DOUBLE_CLICK: "Double-Click",

    UNKNOWN: "Unknown"
});

function GestureParser(listener) {
    this.onTouchDown = function (event) {
        this.gesturePoints = [];
        this.history = [];
        this.downX = this.lastMoveX = event.x;
        this.downY = this.lastMoveY = event.y;
        this.gestureStartTime = new Date().getTime();
    };

    this.onTouchMoved = function (event) {
        if (this.hasOwnProperty("gesturePoints")) {
            var lastX = this.lastMoveX;
            var lastY = this.lastMoveY;
            var self = this;
            this.history.forEach(function (point) {
                if (history.hasOwnProperty(point) && point.sub(new Vec2(lastX, lastY)).len() > MOVE_THRESHOLD) {
                    self.gesturePoints.push(point);
                    lastX = point.x;
                    lastY = point.y;
                }
            });

            var eventPosition = new Vec2(event.x, event.y);
            if (eventPosition.len() > MOVE_THRESHOLD) {
                this.gesturePoints.push(eventPosition);
                lastX = event.x;
                lastY = event.y;
            }
            this.lastMoveX = lastX;
            this.lastMoveY = lastY;

            this.history.push(eventPosition);
        }
    };

    this.onTouchUp = function (ignored) {
        if (this.hasOwnProperty("gesturePoints")) {
            var type = this.classify(new Date().getTime());
            listener.onGesture(type, this.gesturePoints);
        }
    };

    /**
     * Calculate this gesture's velocity.
     * @param upTime the mouse-up time in milliseconds.
     * @returns {number} this gesture's velocity.
     */
    this.velocity = function (upTime) {
        var distanceX = 0;
        var distanceY = 0;
        var lastX = this.downX;
        var lastY = this.downY;
        this.gesturePoints.forEach(function (point) {
            distanceX += Math.abs(point.x - lastX);
            distanceY += Math.abs(point.y - lastY);
            lastX = point.x;
            lastY = point.y;
        });

        var distance = Math.sqrt((distanceX * distanceX) + (distanceY * distanceY));
        return distance / (upTime - this.gestureStartTime);
    };

    /**
     * Analyze the gesture's points. Must be called before {@link classify}.
     * @returns {Vec2} the gesture's last point.
     */
    this.analyzePoints = function () {
        var i = this.gesturePoints.concat();
        var firstPoint = i.shift();
        var secondPoint = i.shift();
        var vector0 = secondPoint.sub(firstPoint);
        var lastPoint = i.shift();
        var vector1 = lastPoint.sub(secondPoint);

        var dotProduct = vector0.dot(vector1);
        var crsProduct = vector0.crs(vector1);
        var angle = vector0.angle(dotProduct, crsProduct, vector1);

        this.dotProductReverses = 0;
        this.sumOfAngles = angle;
        this.numVectors = 2;

        var dotWasPositive = dotProduct > 0;

        while (i.length > 0) {
            var vector = i.shift();

            vector0 = vector1;
            vector1 = vector.sub(lastPoint);
            lastPoint = vector;

            this.numVectors++;
            dotProduct = vector0.dot(vector1);
            crsProduct = vector0.crs(vector1);
            angle = vector0.angle(dotProduct, crsProduct, vector1);

            if (!isNaN(angle)) {
                this.sumOfAngles += angle;
            }

            if (dotProduct > 0) {
                if (!dotWasPositive) {
                    this.dotProductReverses++;
                    dotWasPositive = true;
                }
            } else if (dotProduct < 0) {
                if (dotWasPositive) {
                    this.dotProductReverses++;
                    dotWasPositive = false;
                }
            }
        }

        this.directionClockwise = this.sumOfAngles > 0;
        return lastPoint;
    };

    /**
     * Classify the gesture's type.
     * @param upTime the mouse-up time in milliseconds.
     * @returns {*} the gesture's type.
     */
    this.classify = function (upTime) {
        if (this.gesturePoints.length < 3) {
            return GestureType.CLICK;
        }

        var box = new Box(this.gesturePoints);
        var lastPoint = this.analyzePoints();

        if (this.dotProductReverses >= CROSS_OUT_REVERSES) {
            return GestureType.RUB_OUT;
        } else if (Math.abs(this.sumOfAngles) >= CIRCLE_RADIANS * 0.75) {
            if (this.directionClockwise) {
                return GestureType.SPIRAL_CLOCKWISE;
            } else {
                return GestureType.SPIRAL_COUNTERCLOCKWISE;
            }
        }

        var narrow = box.isNarrow;
        if (narrow) {
            var v = this.velocity(upTime);
            var firstPoint = this.gesturePoints[0];
            if (v <= FLICK_THRESHOLD) {
                if (box.isShort) {
                    if (firstPoint.x < lastPoint.x) {
                        return GestureType.SWIPE_RIGHT;
                    } else {
                        return GestureType.SWIPE_LEFT;
                    }
                } else {
                    if (firstPoint.y < lastPoint.y) {
                        return GestureType.SWIPE_DOWN;
                    } else {
                        return GestureType.SWIPE_UP;
                    }
                }
            } else {
                if (box.isShort) {
                    if (firstPoint.x < lastPoint.x) {
                        return GestureType.FLICK_RIGHT;
                    } else {
                        return GestureType.FLICK_LEFT;
                    }
                } else {
                    if (firstPoint.y < lastPoint.y) {
                        return GestureType.FLICK_DOWN;
                    } else {
                        return GestureType.FLICK_UP;
                    }
                }
            }
        }

        return GestureType.UNKNOWN;
    }
}


text:
package Paws::IAM::DeleteSigningCertificate;
  use Moose;
  has CertificateId => (is => 'ro', isa => 'Str', required => 1);
  has UserName => (is => 'ro', isa => 'Str');

  use MooseX::ClassAttribute;

  class_has _api_call => (isa => 'Str', is => 'ro', default => 'DeleteSigningCertificate');
  class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::API::Response');
  class_has _result_key => (isa => 'Str', is => 'ro');
1;

### main pod documentation begin ###

=head1 NAME

Paws::IAM::DeleteSigningCertificate - Arguments for method DeleteSigningCertificate on Paws::IAM

=head1 DESCRIPTION

This class represents the parameters used for calling the method DeleteSigningCertificate on the
AWS Identity and Access Management service. Use the attributes of this class
as arguments to method DeleteSigningCertificate.

You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to DeleteSigningCertificate.

As an example:

  $service_obj->DeleteSigningCertificate(Att1 => $value1, Att2 => $value2, ...);

Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.

=head1 ATTRIBUTES

=head2 B<REQUIRED> CertificateId => Str

The ID of the signing certificate to delete.

The format of this parameter, as described by its regex pattern, is a
string of characters that can be upper- or lower-cased letters or
digits.

=head2 UserName => Str

The name of the user the signing certificate belongs to.

This parameter allows (per its regex pattern) a string of characters
consisting of upper and lowercase alphanumeric characters with no
spaces. You can also include any of the following characters: =,.@-

=head1 SEE ALSO

This class forms part of L<Paws>, documenting arguments for method DeleteSigningCertificate in L<Paws::IAM>

=head1 BUGS and CONTRIBUTIONS

The source code is located here: https://github.com/pplu/aws-sdk-perl

Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues

=cut

redpajama_set_name: RedPajamaGithub


text:
import pytest

from mock import patch

from polyaxon.cli.config import config
from tests.test_cli.utils import BaseCommandTestCase

@pytest.mark.cli_mark
class TestCliConfig(BaseCommandTestCase):
    @patch("polyaxon.managers.client.ClientConfigManager.is_initialized")
    def test_config_list_checks_initialized(self, is_initialized):
        is_initialized.return_value = False
        self.runner.invoke(config, ["show"])
        assert is_initialized.call_count == 1

    @patch("polyaxon.managers.client.ClientConfigManager.is_initialized")
    @patch("polyaxon.managers.client.ClientConfigManager.CONFIG")
    def test_config_list_gets_default_config(self, default_config, is_initialized):
        is_initialized.return_value = False
        self.runner.invoke(config, ["show"])
        assert default_config.call_count == 1

    @patch("polyaxon.managers.client.ClientConfigManager.is_initialized")
    @patch("polyaxon.managers.client.ClientConfigManager.get_config")
    def test_config_list_gets_file_config(self, get_config, is_initialized):
        is_initialized.return_value = True
        self.runner.invoke(config, ["show"])
        assert get_config.call_count == 1


text:
namespace pipelines.Pipelines
{
    using System.Collections.Generic;
    using System.Diagnostics;

    public class LimitByWorkingSetSize : IOperation<Process>
    {
        public IEnumerable<Process> Execute(IEnumerable<Process> input)
        {
            int maxSizeBytes = 50 * 1024 * 1024;
            foreach (Process process in input)
            {
                if (process.WorkingSet64 > maxSizeBytes)
                    yield return process;
            }
        }
    }
}


text:
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Web.UI;

namespace Inthros.AspNet.Views
{
    public class DoWhileView : ActivityView, IActivityViewContainer
    {
        public DoWhileView(string activityId)
            : base(activityId)
        {
            this.Body = EmptyActivityView.Instance;
        }

        public ActivityView Body { get; private set; }

        public string Condition { get; set; }

        protected override string CssClass
        {
            get
            {
                return "ww-dowhile";
            }
        }

        protected override void RenderContents(HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Label);
            writer.Write("Body");
            writer.RenderEndTag();

            writer.AddAttribute("class", "body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            this.Body.Render(writer);
            writer.RenderEndTag();

            writer.RenderBeginTag(HtmlTextWriterTag.Label);
            writer.Write("Condition");
            writer.RenderEndTag();

            writer.AddAttribute("class", "condition ww-code");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.WriteEncodedText(this.Condition);
            writer.RenderEndTag();
        }

        void IActivityViewContainer.Add(ActivityView view, string scope)
        {
            this.Body = view;
        }

        IReadOnlyCollection<ActivityView> IActivityViewContainer.ActivityViews
        {
            get { return new ReadOnlyCollection<ActivityView>(new[] { this.Body }); }
        }
    }
}


text: Segregate even and odd nodes in a Linked List


text: basic and useful functions


text:
var config = require('../../config'),
    _      = require('lodash');

function getContextObject(data, context) {
    var blog = config.theme,
        contextObject;

    context = _.includes(context, 'page') || _.includes(context, 'amp')|| _.includes(context, 'mip') ? 'post' : context;
    contextObject = data[context] || blog;
    return contextObject;
}

module.exports = getContextObject;


text:
package org.apache.sysml.runtime.instructions.mr;

import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.DMLUnsupportedOperationException;
import org.apache.sysml.runtime.instructions.InstructionUtils;
import org.apache.sysml.runtime.matrix.data.MatrixBlock;
import org.apache.sysml.runtime.matrix.data.MatrixValue;
import org.apache.sysml.runtime.matrix.mapred.CachedValueMap;
import org.apache.sysml.runtime.matrix.mapred.IndexedMatrixValue;
import org.apache.sysml.runtime.matrix.operators.Operator;

public class AppendRInstruction extends AppendInstruction
{
	public AppendRInstruction(Operator op, byte in1, byte in2, byte out, boolean cbind, String istr)
	{
		super(op, in1, in2, out, cbind, istr);
	}

	public static AppendRInstruction parseInstruction ( String str )
		throws DMLRuntimeException
	{
		String[] parts = InstructionUtils.getInstructionParts ( str );
		InstructionUtils.checkNumFields(parts, 4);

		byte in1 = Byte.parseByte(parts[1]);
		byte in2 = Byte.parseByte(parts[2]);
		byte out = Byte.parseByte(parts[3]);
		boolean cbind = Boolean.parseBoolean(parts[4]);

		return new AppendRInstruction(null, in1, in2, out, cbind, str);
	}

	@Override
	public void processInstruction(Class<? extends MatrixValue> valueClass,
			CachedValueMap cachedValues, IndexedMatrixValue tempValue, IndexedMatrixValue zeroInput, int brlen, int bclen)
			throws DMLUnsupportedOperationException, DMLRuntimeException
	{
		//get both inputs
		IndexedMatrixValue left = cachedValues.getFirst(input1);
		IndexedMatrixValue right = cachedValues.getFirst(input2);

		//check non-existing block
		if( left == null || right == null )
			throw new DMLRuntimeException("Missing append input: isNull(left): " + (left==null) + ", isNull(right): " + (right==null));

		//core append operation
		MatrixBlock mbLeft = (MatrixBlock)left.getValue();
		MatrixBlock mbRight = (MatrixBlock)right.getValue();

		MatrixBlock ret = mbLeft.appendOperations(mbRight, new MatrixBlock(), _cbind);

		//put result into cache
		cachedValues.add(output, new IndexedMatrixValue(left.getIndexes(), ret));
	}
}


text:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">

	<Script file="textentry.lua"/>

	<EditBox name="DetailsFrameworkEditBoxTemplate2" virtual="true">
		<Size x="232" y="20"/>

		<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
			<EdgeSize>
				<AbsValue val="10"/>
			</EdgeSize>
			<TileSize>
				<AbsValue val="16"/>
			</TileSize>
			<BackgroundInsets>
				<AbsInset left="1" right="1" top="0" bottom="1"/>
			</BackgroundInsets>
		</Backdrop>

		<Layers>

			<Layer level="OVERLAY">
				<!-- box description -->
				<FontString name="$parent_Desc" text="" parentKey="label" inherits="GameFontHighlightSmall" justifyH="LEFT" nonspacewrap="false">
					<Color r = "0.8" g = "0.8" b = "0.8" a = "1"/>
					<Anchors>
						<Anchor point="RIGHT" relativeTo="$parent" relativePoint="LEFT" x="-2" y="0" />
					</Anchors>
				</FontString>

			</Layer>

		</Layers>

	</EditBox>

	<ScrollFrame name="DetailsFrameworkEditBoxMultiLineTemplate" inherits="UIPanelScrollFrameTemplate" virtual="true">
		<Size x="232" y="20"/>
		<ScrollChild>
			<EditBox name="$parentEditBox" multiLine="true" letters="255" autoFocus="false" countInvisibleLetters="true" parentKey="editbox">
				<Size x="232" y="20"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" />
					<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT" />
					<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT" />
					<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT" />
				</Anchors>
				<Scripts>
					<OnTextChanged>
						<!-- ScrollingEdit_OnTextChanged (self, self:GetParent()); -->
					</OnTextChanged>
					<OnCursorChanged function="ScrollingEdit_OnCursorChanged"/>
					<OnUpdate>
						<!-- ScrollingEdit_OnUpdate (self, elapsed, self:GetParent());-->
					</OnUpdate>
					<OnEscapePressed function="EditBox_ClearFocus"/>
				</Scripts>
				<FontString inherits="GameFontHighlightSmall"/>
			</EditBox>
		</ScrollChild>
	</ScrollFrame>
</Ui>


text:
void AnimationCurve::evaluate(float time, float* dst, EvaluateType type) const
{
    auto componentSize = _componentSize;
    if (_count == 1 || time <= _keytime[0])
    {
        memcpy(dst, _value, _componentSizeByte);
        return;
    }
    else if (time >= _keytime[_count - 1])
    {
        memcpy(dst, &_value[(_count - 1) * componentSize], _componentSizeByte);
        return;
    }

    unsigned int index = determineIndex(time);

    float scale = (_keytime[index + 1] - _keytime[index]);
    float t = (time - _keytime[index]) / scale;

    float* fromValue = &_value[index * componentSize];
    float* toValue = fromValue + componentSize;

    switch (type) {
        case EvaluateType::INT_LINEAR:
        {
            for (auto i = 0; i < componentSize; i++) {
                dst[i] = fromValue[i] + (toValue[i] - fromValue[i]) * t;
            }
        }
        break;
        case EvaluateType::INT_NEAR:
        {
            float* src = std::abs(t) > 0.5f ? toValue : fromValue;
            memcpy(dst, src, _componentSizeByte);
        }
        break;
        case EvaluateType::INT_QUAT_SLERP:
        {
            // Evaluate.
            Quaternion quat;
            if (t >= 0)
                Quaternion::slerp(Quaternion(fromValue), Quaternion(toValue), t, &quat);
            else
                Quaternion::slerp(Quaternion(toValue), Quaternion(fromValue), t, &quat);

            dst[0] = quat.x, dst[1] = quat.y, dst[2] = quat.z, dst[3] = quat.w;
        }
        break;
        case EvaluateType::INT_USER_FUNCTION:
        {
            if (_evaluateFun)
                _evaluateFun(time, dst);
        }
        break;

        default:
            break;
    }
}

void AnimationCurve::setEvaluateFun(std::function<void(float time, float* dst)> fun)
{
    _evaluateFun = fun;
}

//create animation curve

AnimationCurve* AnimationCurve::create(float* keytime, float* value, int count, int componentSize)
{
    int floatSize = sizeof(float);
    AnimationCurve* curve = new (std::nothrow) AnimationCurve(componentSize);
    curve->_keytime = new float[count];
    memcpy(curve->_keytime, keytime, count * floatSize);

    int compoentSizeByte = componentSize * floatSize;
    int totalByte = count * compoentSizeByte;
    curve->_value = new float[totalByte / floatSize];
    memcpy(curve->_value, value, totalByte);

    curve->_count = count;
    curve->_componentSizeByte = compoentSizeByte;

    return curve;
}

float AnimationCurve::getStartTime() const
{
    return _keytime[0];
}

float AnimationCurve::getEndTime() const
{
    return _keytime[_count - 1];
}

AnimationCurve::AnimationCurve(int componentSize)
: _value(nullptr)
, _keytime(nullptr)
, _count(0)
, _componentSizeByte(0)
, _componentSize(componentSize)
, _evaluateFun(nullptr)
{

}

AnimationCurve::~AnimationCurve()
{
    if (nullptr != _keytime)
    {
        delete [] _keytime;
    }
    if (nullptr != _value)
    {
        delete [] _value;
    }
}

int AnimationCurve::determineIndex(float time) const
{
    unsigned int min = 0;
    unsigned int max = _count - 1;
    unsigned int mid = 0;

    do
    {
        mid = (min + max) >> 1;

        if (time >= _keytime[mid] && time <= _keytime[mid + 1])
            return mid;
        else if (time < _keytime[mid])
            max = mid - 1;
        else
            min = mid + 1;
    } while (min <= max);

    // We should never hit this!
    return -1;
}


text:
void helper () {
  puts("helper");
}


text:
import pstats
import cProfile
import unittest
from django.test.simple import DjangoTestSuiteRunner

class ProfilingTestRunner(DjangoTestSuiteRunner):
    def run_suite(self, suite, **kwargs):
        stream = open('profiled_tests.txt', 'w')

        runner = unittest.TextTestRunner(verbosity=self.verbosity, failfast=self.failfast).run

        profile = cProfile.Profile()
        profile.runctx('result = run_tests(suite)', {
            'run_tests': runner,
            'suite': suite,
        }, locals())
        profile.create_stats()
        stats = pstats.Stats(profile, stream=stream)

        stats.sort_stats('time')
        stats.print_stats()
        return locals()['result']


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Hendersonia viticola S. Ahmad

### Remarks
null


text:
<?php

namespace Admin\AdminBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Solicitud
 *
 * @ORM\Table(name="solicitud")
 * @ORM\HasLifecycleCallbacks
 * @ORM\Entity
 */
class Solicitud {

    /**
     * @var integer
     *
     * @ORM\Column(name="id_Solicitud", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $idSolicitud;

    /**
     * @var string
     *
     * @ORM\Column(name="Nombre", type="string", length=100, nullable=false)
     */
    private $nombre;

    /**
     * @var string
     *
     * @ORM\Column(name="Observaciones", type="text", length=65535, nullable=true)
     */
    private $observaciones;

    /**
     * @var string
     *
     * @ORM\Column(name="Estado", type="string", length=100, nullable=false)
     */
    private $estado;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="Fechainicio", type="date", nullable=true)
     */
    private $fechainicio;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="Fechafin", type="date", nullable=true)
     */
    private $fechafin;

    /**
     * @var string $image
     * @Assert\File( maxSize = "1024k",
     * mimeTypesMessage = "Carge una imagen valida")
     * @ORM\Column(name="image", type="string", length=255,nullable=true)
     */
    public $image;

    /**
     * @var string $file
     * @Assert\File( maxSize = "5120k",
     * mimeTypesMessage = "Carge una imagen valida")
     * @ORM\Column(name="File", type="string", length=255,nullable=true)
     */
    private $File;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="Fecha", type="datetime", nullable=false)
     */
    private $fecha;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="FechaUpdate", type="datetime", nullable=true)
     */
    private $fechaupdate;

    /**
     * Get idSolicitud
     *
     * @return integer
     */
    public function getIdSolicitud() {
        return $this->idSolicitud;
    }

    /**
     * Set nombre
     *
     * @param string $nombre
     *
     * @return Solicitud
     */
    public function setNombre($nombre) {
        $this->nombre = $nombre;

        return $this;
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getNombre() {
        return $this->nombre;
    }

    /**
     * Set observaciones
     *
     * @param string $observaciones
     *
     * @return Solicitud
     */
    public function setObservaciones($observaciones) {
        $this->observaciones = $observaciones;

        return $this;
    }

    /**
     * Get observaciones
     *
     * @return string
     */
    public function getObservaciones() {
        return $this->observaciones;
    }

    /**
     * Set fecha
     *
     * @param \DateTime $fecha
     *
     * @return Solicitud
     */
    public function setFecha($fecha) {
        $this->fecha = $fecha;

        return $this;
    }

    /**
     * Get fecha
     *
     * @return \DateTime
     */
    public function getFecha() {
        return $this->fecha;
    }

    /**
     * Set fechaupdate
     *
     * @param \DateTime $fechaupdate
     *
     * @return Solicitud
     */
    public function setFechaupdate($fechaupdate) {
        $this->fechaupdate = $fechaupdate;

        return $this;
    }

    /**
     * Get fechaupdate
     *
     * @return \DateTime
     */
    public function getFechaupdate() {
        return $this->fechaupdate;
    }

    public function __toString() {
        return (string) $this->idSolicitud;
    }

    /**
     * Set estado
     *
     * @param string $estado
     *
     * @return Solicitud
     */
    public function setEstado($estado) {
        $this->estado = $estado;

        return $this;
    }

    /**
     * Get estado
     *
     * @return string
     */
    public function getEstado() {
        return $this->estado;
    }

    /**
     * Set fechainicio
     *
     * @param \DateTime $fechainicio
     *
     * @return Solicitud
     */
    public function setFechainicio($fechainicio) {
        $this->fechainicio = $fechainicio;

        return $this;
    }

    /**
     * Get fechainicio
     *
     * @return \DateTime
     */
    public function getFechainicio() {
        return $this->fechainicio;
    }

    /**
     * Set fechafin
     *
     * @param \DateTime $fechafin
     *
     * @return Solicitud
     */
    public function setFechafin($fechafin) {
        $this->fechafin = $fechafin;

        return $this;
    }

    /**
     * Get fechafin
     *
     * @return \DateTime
     */
    public function getFechafin() {
        return $this->fechafin;
    }

    /**
     * Set image
     *
     * @param string $image
     *
     * @return Solicitud
     */
    public function setImage($image) {
        $this->image = $image;

        return $this;
    }

    /**
     * Get image
     *
     * @return string
     */
    public function getImage() {
        return $this->image;
    }

    /**
     * Set file
     *
     * @param string $file
     *
     * @return Solicitud
     */
    public function setFile($file) {
        $this->File = $file;

        return $this;
    }

    /**
     * Get file
     *
     * @return string
     */
    public function getFile() {
        return $this->File;
    }

    public function getFullImagePath() {
        return null === $this->image ? null : $this->getUploadRootDir() . $this->image;
        //retorna la imagen para mostrar en web
    }

    public function getFullFilePath() {
        return null === $this->File ? null : $this->getUploadRootDir() . $this->File;
        //retorna la imagen para mostrar en web
    }

    protected function getUploadRootDir() {
        //ruta del dicrectorio donde se van a guardar los archivos

        return $this->getTmpUploadRootDir() . "/../" . $this->idSolicitud . "/";
    }

    protected function getTmpUploadRootDir() {
        //la ruta del directorio absoluta donde se deben guardar los documentos cargados
        return __DIR__ . '/../../../../web/upload/solicitud/tmp/';
    }

    /**
     * @ORM\PrePersist()
     * @ORM\PreUpdate()
     */
    public function uploadImage() {
        //validamos si es una actualizacion o una nueva
        //si las fechas son diferentes es actualizacion de lo contrario es nuevo

        if ($this->fechaupdate != $this->fecha) {
            if ($this->image != null && $this->aux == null) {
                ///asignamos los nombres nuevos
                $tempImageName = time() . '_1.' . pathinfo((string) $this->image->getClientOriginalName(), PATHINFO_EXTENSION);
                //borramos imagenes viejas
                $dir = $this->getUploadRootDir();
                /// guardamos en el servidor los archivos
                $this->setImageName($this->image->getClientOriginalName());
                $this->image->move($this->getUploadRootDir(), $tempImageName);

                //grabamos los nombres de archivo en el servidor
                $this->setImage($tempImageName);
            } else {
                $this->setImage($this->aux);
            }
            if ($this->File != null && $this->aux1 == null) {
                ///asignamos los nombres nuevos
                $tempImageName1 = time() . '_2.' . pathinfo((string) $this->File->getClientOriginalName(), PATHINFO_EXTENSION);

                //borramos imagenes viejas
                $dir = $this->getUploadRootDir();

                /// guardamos en el servidor los archivos
                $this->setFileName($this->File->getClientOriginalName());
                $this->File->move($this->getUploadRootDir(), $tempImageName1);

                //grabamos los nombres de archivo en el servidor
                $this->setFile($tempImageName1);
            } else {
                $this->setFile($this->aux1);
            }
        } else {
            if ($this->image != null) {
                $tempImageName = time() . '_1.' . pathinfo((string) $this->image->getClientOriginalName(), PATHINFO_EXTENSION);
                if (!$this->idSolicitud) {
                    $this->setImageName($this->image->getClientOriginalName());
                    $this->image->move($this->getTmpUploadRootDir(), $this->image->getClientOriginalName());
                } else {
                    $this->image->move($this->getUploadRootDir(), $tempImageName);
                    unlink($this->getUploadRootDir() . $tempImageName);
                }
                $this->setImage($tempImageName);
            }
            if ($this->File != null) {
                $tempImageName1 = time() . '_2.' . pathinfo((string) $this->File->getClientOriginalName(), PATHINFO_EXTENSION);
                if (!$this->idSolicitud) {
                    $this->setFileName($this->File->getClientOriginalName());
                    $this->File->move($this->getTmpUploadRootDir(), $this->File->getClientOriginalName());
                } else {
                    $this->File->move($this->getUploadRootDir(), $tempImageName1);
                    unlink($this->getUploadRootDir() . $tempImageName1);
                }

                $this->setFile($tempImageName1);
            } else {
                //$this->File->move($this->getUploadRootDir(), $tempImageName1);
                // unlink($this->getUploadRootDir() . $tempImageName1);
                // $this->setFile($tempImageName1);
            }
        }
    }

    /**
     * @ORM\PostPersist()
     */
    public function moveImage() {
        if ($this->image != null) {
            if (!is_dir($this->getUploadRootDir())) {
                mkdir($this->getUploadRootDir(), 0777, true);
            }
            copy($this->getTmpUploadRootDir() . $this->getImageName(), $this->getFullImagePath());
            unlink($this->getTmpUploadRootDir() . $this->getImageName());
        }
        if ($this->File != null) {
            if (!is_dir($this->getUploadRootDir())) {
                mkdir($this->getUploadRootDir(), 0777, true);
            }
            copy($this->getTmpUploadRootDir() . $this->getFileName(), $this->getFullFilePath());
            unlink($this->getTmpUploadRootDir() . $this->getFileName());
        }
    }

    private $aux;
    private $aux1;

    /**
     *
     * @ORM\PreRemove()
     */
    public function removeImage() {
        if ($this->image != null) {
            unlink($this->getFullImagePath());

        }
        if ($this->File != null) {
             unlink($this->getFullFilePath());
        }
        if($this->image != null or $this->File != null){
        rmdir($this->getUploadRootDir());
        }

    }
    private $imagename;
    private $Filename;

    /**
     * Set image
     *
     * @param string $imagename
     * @return Hojadevida
     */
    public function setImageName($imagename) {
        $this->imagename = $imagename;

        return $this;
    }

    /**
     * Set image
     *
     * @param string $imagename
     * @return Hojadevida
     */
    public function setFileName($imagename) {
        $this->Filename = $imagename;

        return $this;
    }

    /**
     * Get image
     *
     * @return string
     */
    public function getImageName() {
        return $this->imagename;
    }

    /**
     * Get image
     *
     * @return string
     */
    public function getFileName() {
        return $this->Filename;
    }

    /**
     * Set nombre
     *
     * @param string $Aux
     *
     * @return Solicitud
     */
    public function setAux($aux) {
        $this->aux = $aux;

        return $this;
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getAux() {
        return $this->aux;
    }

    /**
     * Set nombre
     *
     * @param string $aux1
     *
     * @return Hojadevida
     */
    public function setAux1($aux1) {
        $this->aux1 = $aux1;

        return $this;
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getAux1() {
        return $this->aux1;
    }

}


text:
@interface GlanceController()

@end

@implementation GlanceController
@synthesize myUrl,BGLabel,arrowImg,delta,raw,lastReading,battery,lastReadingText,units,range,arrow;

- (void)awakeWithContext:(id)context {
    [super awakeWithContext:context];

    arrow = @"";
    // Configure interface objects here.
}

- (void)willActivate {
    // This method is called when watch view controller is about to be visible to user
    [super willActivate];

    [BGLabel setTextColor:[UIColor colorWithRed:153.0/255.0 green:153.0/255.0 blue:153.0/255.0 alpha:1.0]];
    [lastReading setText:@"?"];

    if ([arrow isEqualToString:@"DoubleUp"])
    {
        [arrowImg setImageNamed:@"arrow_doubleUp_gray"];
    }
    else if ([arrow isEqualToString:@"SingleUp"])
    {
        [arrowImg setImageNamed:@"arrow_singleUp_gray"];
    }
    else if ([arrow isEqualToString:@"FortyFiveUp"])
    {
        [arrowImg setImageNamed:@"arrow_diagUp_gray"];
    }
    else if ([arrow isEqualToString:@"Flat"])
    {
        [arrowImg setImageNamed:@"arrow_over_gray"];
    }
    else if ([arrow isEqualToString:@"FortyFiveDown"])
    {
        [arrowImg setImageNamed:@"arrow_diagDown_gray"];
    }
    else if ([arrow isEqualToString:@"SingleDown"])
    {
        [arrowImg setImageNamed:@"arrow_singleDown_gray"];
    }
    else if ([arrow isEqualToString:@"DoubleDown"])
    {
        [arrowImg setImageNamed:@"arrow_doubleDown_gray"];
    }
    else
    {
        [arrowImg setHidden:true];
    }

    NSUserDefaults *mySharedDefaults = [[NSUserDefaults alloc] initWithSuiteName: @"group.com.dc.Nightscout.watch"];

    units = [[mySharedDefaults objectForKey:@"NIGHTSCOUT_UNITS"] intValue];
    myUrl = [mySharedDefaults objectForKey:@"NIGHTSCOUTURL"];
    range = [[mySharedDefaults objectForKey:@"NIGHTSCOUT_RANGE"] intValue];

    [self performSelectorInBackground:@selector(setup) withObject:nil];

}

-(void)setupDisplay:(NSDictionary *)jsonDict
{
    NSArray *bgsArray = [jsonDict objectForKey:@"bgs"];

    if ([bgsArray count] > 0)
    {
        NSDictionary *myDict = [bgsArray objectAtIndex:0];

        NSString *sgv = [myDict objectForKey:@"sgv"];
        [BGLabel setText:[NSString stringWithFormat:@"%@", sgv]];

        arrow = [myDict objectForKey:@"direction"];

        int sgvInt = [sgv intValue];

        BOOL mgdl = true;

        if (units == 1)
        {
            mgdl = false;
        }

        int yellowRange = 200;
        int greenRange = 100;

        if (range == 1)
        {
            yellowRange = 180;
            greenRange = 80;
        }

        if (!mgdl)
        {
            yellowRange *= .0555;
            greenRange *= .0555;
        }

        if (sgvInt > yellowRange)       //yellow
        {
            [BGLabel setTextColor:[UIColor colorWithRed:247.0/255.0 green:172.0/255.0 blue:11.0/255.0 alpha:1.0]];

        }
        else if (sgvInt >= greenRange)  //green
        {
            [BGLabel setTextColor:[UIColor colorWithRed:51.0/255.0 green:189.0/255.0 blue:71.0/255.0 alpha:1.0]];
        }
        else // red
        {
            [BGLabel setTextColor:[UIColor colorWithRed:247.0/255.0 green:72.0/255.0 blue:11.0/255.0 alpha:1.0]];
        }

        [arrowImg setHidden:false];

        if ([arrow isEqualToString:@"NOT COMPUTABLE"])
        {
            [arrowImg setHidden:true];
        }
        else if ([arrow isEqualToString:@"NONE"])
        {
            [arrowImg setHidden:true];

        }
        else if ([arrow isEqualToString:@"DoubleUp"])
        {
            if (sgvInt > yellowRange)       //yellow
            {
                [arrowImg setImageNamed:@"arrow_doubleUp_yellow"];

            }
            else if (sgvInt >= greenRange)  //green
            {
                [arrowImg setImageNamed:@"arrow_doubleUp_green"];
            }
            else // red
            {
                [arrowImg setImageNamed:@"arrow_doubleUp_red"];
            }
        }
        else if ([arrow isEqualToString:@"SingleUp"])
        {
            if (sgvInt > yellowRange)       //yellow
            {
                [arrowImg setImageNamed:@"arrow_singleUp_yellow"];

            }
            else if (sgvInt >= greenRange)  //green
            {
                [arrowImg setImageNamed:@"arrow_singleUp_green"];
            }
            else // red
            {
                [arrowImg setImageNamed:@"arrow_singleUp_red"];
            }
        }
        else if ([arrow isEqualToString:@"FortyFiveUp"])
        {
            if (sgvInt > yellowRange)       //yellow
            {
                [arrowImg setImageNamed:@"arrow_diagUp_yellow"];

            }
            else if (sgvInt >= greenRange)  //green
            {
                [arrowImg setImageNamed:@"arrow_diagUp_green"];
            }
            else // red
            {
                [arrowImg setImageNamed:@"arrow_diagUp_red"];
            }
        }
        else if ([arrow isEqualToString:@"Flat"])
        {
            if (sgvInt > yellowRange)       //yellow
            {
                [arrowImg setImageNamed:@"arrow_over_yellow"];

            }
            else if (sgvInt >= greenRange)  //green
            {
                [arrowImg setImageNamed:@"arrow_over_green"];
            }
            else // red
            {
                [arrowImg setImageNamed:@"arrow_over_red"];
            }
        }
        else if ([arrow isEqualToString:@"FortyFiveDown"])
        {
            if (sgvInt > yellowRange)       //yellow
            {
                [arrowImg setImageNamed:@"arrow_diagDown_yellow"];

            }
            else if (sgvInt >= greenRange)  //green
            {
                [arrowImg setImageNamed:@"arrow_diagDown_green"];
            }
            else // red
            {
                [arrowImg setImageNamed:@"arrow_diagDown_red"];
            }
        }
        else if ([arrow isEqualToString:@"SingleDown"])
        {
            if (sgvInt > yellowRange)       //yellow
            {
                [arrowImg setImageNamed:@"arrow_singleDown_yellow"];

            }
            else if (sgvInt >= greenRange)  //green
            {
                [arrowImg setImageNamed:@"arrow_singleDown_green"];
            }
            else // red
            {
                [arrowImg setImageNamed:@"arrow_singleDown_red"];
            }
        }
        else if ([arrow isEqualToString:@"DoubleDown"])
        {
            if (sgvInt > yellowRange)       //yellow
            {
                [arrowImg setImageNamed:@"arrow_doubleDown_yellow"];

            }
            else if (sgvInt >= greenRange)  //green
            {
                [arrowImg setImageNamed:@"arrow_doubleDown_green"];
            }
            else // red
            {
                [arrowImg setImageNamed:@"arrow_doubleDown_red"];
            }
        }
        else if ([arrow isEqualToString:@"RATE OUT OF RANGE"])
        {
            [arrowImg setHidden:true];
        }

        NSString *batteryText = [myDict objectForKey:@"battery"];
        [battery setText:[NSString stringWithFormat:@"%@%%",batteryText]];

        NSString *deltaText = [myDict objectForKey:@"bgdelta"];

        int deltaInt = [deltaText intValue];

        if (deltaInt > 0)
        {
            if (mgdl)
            {
                [delta setText:[NSString stringWithFormat:@"+%@ mg/dl",deltaText]];
            }
            else
            {
                [delta setText:[NSString stringWithFormat:@"+%@ mmol",deltaText]];
            }

        }
        else
        {
            if (mgdl)
            {
                [delta setText:[NSString stringWithFormat:@"%@ mg/dl",deltaText]];
            }
            else
            {
                [delta setText:[NSString stringWithFormat:@"%@ mmol",deltaText]];
            }

        }

        NSString *unfiltered = [myDict objectForKey:@"unfiltered"];

        int unfilteredInt = [unfiltered intValue];

        NSString *filtered = [myDict objectForKey:@"filtered"];

        int filteredInt = [filtered intValue];

        NSArray *calsArray = [jsonDict objectForKey:@"cals"];

        if ([calsArray count] > 0)
        {
            NSDictionary *myDict2 = [calsArray objectAtIndex:0];

            NSString *intercept = [myDict2 objectForKey:@"intercept"];

            double interceptDouble = [intercept doubleValue];

            NSString *scale = [myDict2 objectForKey:@"scale"];

            double scaleDouble = [scale doubleValue];

            NSString *slope = [myDict2 objectForKey:@"slope"];

            double slopeDouble = [slope doubleValue];

            double currentCalcRaw = 0.0;
            double currentRatio = 0.0;
            double currentConvBG = sgvInt;

            BOOL specialVal = false;

            if (sgvInt < 30)
            {
                specialVal = true;
            }

            if (mgdl)
            {
                if (sgvInt < 30)
                {
                    specialVal = true;
                }
            }
            else
            {
                if (sgvInt < 1.7)
                {
                    specialVal = true;
                }
                currentConvBG = (int)((sgvInt * 18.018)+0.5);
            }

            if (specialVal) {
                currentCalcRaw = (scaleDouble * (unfilteredInt - interceptDouble) / slopeDouble);
            }
            else {
                currentRatio = (scaleDouble * (filteredInt - interceptDouble) / slopeDouble / currentConvBG);
                currentCalcRaw = (scaleDouble * (unfilteredInt - interceptDouble) / slopeDouble / currentRatio);
            }

            int formatRaw = 0;

            if (mgdl)
            {
                formatRaw = (int)(currentCalcRaw + 0.5);
            }
            else
            {
                formatRaw = (int)(currentCalcRaw*0.0555 + 0.5);
            }

            [raw setText:[NSString stringWithFormat:@"%d",formatRaw]];

        }
        else
        {
            [raw setText:[NSString stringWithFormat:@"?"]];
        }

        NSString *datetime = [myDict objectForKey:@"datetime"];

        long dateInt = [datetime longLongValue];

        NSDate *date = [NSDate dateWithTimeIntervalSince1970:dateInt/1000];

        int seconds = [date timeIntervalSinceNow];

        int minutes = seconds / -60;

        [lastReading setText:[NSString stringWithFormat:@"%dm",minutes]];

        if (minutes>5)
        {
            [lastReading setTextColor:[UIColor colorWithRed:247.0/255.0 green:72.0/255.0 blue:11.0/255.0 alpha:1.0]];
            [lastReadingText setTextColor:[UIColor colorWithRed:247.0/255.0 green:72.0/255.0 blue:11.0/255.0 alpha:1.0]];
            [BGLabel setTextColor:[UIColor colorWithRed:153.0/255.0 green:153.0/255.0 blue:153.0/255.0 alpha:1.0]];

            if ([arrow isEqualToString:@"DoubleUp"])
            {
                [arrowImg setImageNamed:@"arrow_doubleUp_gray"];
            }
            else if ([arrow isEqualToString:@"SingleUp"])
            {
                [arrowImg setImageNamed:@"arrow_singleUp_gray"];
            }
            else if ([arrow isEqualToString:@"FortyFiveUp"])
            {
                [arrowImg setImageNamed:@"arrow_diagUp_gray"];
            }
            else if ([arrow isEqualToString:@"Flat"])
            {
                [arrowImg setImageNamed:@"arrow_over_gray"];
            }
            else if ([arrow isEqualToString:@"FortyFiveDown"])
            {
                [arrowImg setImageNamed:@"arrow_diagDown_gray"];
            }
            else if ([arrow isEqualToString:@"SingleDown"])
            {
                [arrowImg setImageNamed:@"arrow_singleDown_gray"];
            }
            else if ([arrow isEqualToString:@"DoubleDown"])
            {
                [arrowImg setImageNamed:@"arrow_doubleDown_gray"];
            }

        }
        else
        {
            [lastReading setTextColor:[UIColor whiteColor]];
            [lastReadingText setTextColor:[UIColor colorWithRed:153.0/255.0 green:153.0/255.0 blue:153.0/255.0 alpha:1.0]];
        }

    }

}

-(void) setup
{
    NSString *thisUrl = [myUrl stringByAppendingString:@"/pebble"];

    NSURL *nightScoutUrl = [NSURL URLWithString:thisUrl];

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:nightScoutUrl
                                                           cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
                                                       timeoutInterval:60];
    [request setHTTPMethod:@"GET"];

    NSURLResponse * response = nil;
    NSError * error = nil;
    NSData * data = [NSURLConnection sendSynchronousRequest:request
                                          returningResponse:&response
                                                      error:&error];

    if (error == nil)
    {

        NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];

        [self performSelectorOnMainThread:@selector(setupDisplay:) withObject:jsonDict waitUntilDone:false];

    }

}

- (void)didDeactivate {
    // This method is called when watch view controller is no longer visible
    [super didDeactivate];

}

@end


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Stud. Mycol. 31: 183 (1989)

#### Original name
null

### Remarks
null


text:
$script:dscModuleName = 'xWebAdministration'
$script:dscResourceName = 'MSFT_xIISLogging'

try
{
    Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop'
}
catch [System.IO.FileNotFoundException]
{
    throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -Tasks build" first.'
}

$script:testEnvironment = Initialize-TestEnvironment `
    -DSCModuleName $script:dscModuleName `
    -DSCResourceName $script:dscResourceName `
    -ResourceType 'Mof' `
    -TestType 'Integration'

Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') -Force

$tempName = "$($script:dscResourceName)_" + (Get-Date).ToString("yyyyMMdd_HHmmss")

try
{
    $configFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1"
    . $configFile

    $null = Backup-WebConfiguration -Name $tempName

    Describe "$($script:dscResourceName)_Rollover" {
        #region DEFAULT TESTS
        It 'Should compile without throwing' {
            {
                Invoke-Expression -Command "$($script:dscResourceName)_Rollover -OutputPath `$TestDrive"
                Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force
            } | Should not throw
        }

        It 'should be able to call Get-DscConfiguration without throwing' {
            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw
        }
        #endregion

        It 'Changing Logging Rollover Settings ' -test {

            Invoke-Expression -Command "$($script:dscResourceName)_Rollover -OutputPath `$TestDrive"
            Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force

            $currentLogSettings = Get-WebConfiguration -filter '/system.applicationHost/sites/siteDefaults/Logfile'

            $currentLogSettings.directory | Should Be 'C:\IISLogFiles'
            $currentLogSettings.logExtFileFlags | Should Be 'Date,Time,ClientIP,UserName,ServerIP'
            $currentLogSettings.logformat | Should Be 'W3C'
            $currentLogSettings.logTargetW3C | Should Be 'File,ETW'
            $currentLogSettings.period | Should Be 'Hourly'
            $currentLogSettings.localTimeRollover | Should Be 'True'
            $currentLogSettings.customFields.Collection[0].LogFieldName | Should Be 'ClientEncoding'
            $currentLogSettings.customFields.Collection[0].SourceName | Should Be 'Accept-Encoding'
            $currentLogSettings.customFields.Collection[0].SourceType | Should Be 'RequestHeader'
            $currentLogSettings.customFields.Collection[1].LogFieldName | Should Be 'X-Powered-By'
            $currentLogSettings.customFields.Collection[1].SourceName | Should Be 'ASP.NET'
            $currentLogSettings.customFields.Collection[1].SourceType | Should Be 'ResponseHeader'
       }
    }

    Describe "$($script:dscResourceName)_Truncate" {
        #region DEFAULT TESTS
        It 'Should compile without throwing' {
            {
                Invoke-Expression -Command "$($script:dscResourceName)_Truncate -OutputPath `$TestDrive"
                Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force
            } | Should not throw
        }

        It 'should be able to call Get-DscConfiguration without throwing' {
            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw
        }
        #endregion
        It 'Changing Logging Truncate Settings ' -test {

            Invoke-Expression -Command "$($script:dscResourceName)_Truncate -OutputPath `$TestDrive"
            Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force

            $currentLogSettings = Get-WebConfiguration -filter '/system.applicationHost/sites/siteDefaults/Logfile'

            $currentLogSettings.directory | Should Be 'C:\IISLogFiles'
            $currentLogSettings.logExtFileFlags | Should Be 'Date,Time,ClientIP,UserName,ServerIP'
            $currentLogSettings.logformat | Should Be 'W3C'
            $currentLogSettings.logTargetW3C | Should Be 'File,ETW'
            $currentLogSettings.TruncateSize | Should Be '2097152'
            $currentLogSettings.localTimeRollover | Should Be 'True'
            $currentLogSettings.customFields.Collection[0].LogFieldName | Should Be 'ClientEncoding'
            $currentLogSettings.customFields.Collection[0].SourceName | Should Be 'Accept-Encoding'
            $currentLogSettings.customFields.Collection[0].SourceType | Should Be 'RequestHeader'
            $currentLogSettings.customFields.Collection[1].LogFieldName | Should Be 'X-Powered-By'
            $currentLogSettings.customFields.Collection[1].SourceName | Should Be 'ASP.NET'
            $currentLogSettings.customFields.Collection[1].SourceType | Should Be 'ResponseHeader'
        }
    }

    Describe "$($script:dscResourceName)_LogFlags" {
        #region DEFAULT TESTS
        It 'Should compile without throwing' {
            {
                Invoke-Expression -Command "$($script:dscResourceName)_LogFlags -OutputPath `$TestDrive"
                Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force
            } | Should not throw
        }

        It 'should be able to call Get-DscConfiguration without throwing' {
            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw
        }
        #endregion
        It 'Changing enabled LogFlags ' -test {

            Invoke-Expression -Command "$($script:dscResourceName)_LogFlags -OutputPath `$TestDrive"
            Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force

            $currentLogSettings = Get-WebConfiguration -filter '/system.applicationHost/sites/siteDefaults/Logfile'

            $currentLogSettings.directory | Should Be 'C:\IISLogFiles'
            $currentLogSettings.logExtFileFlags | Should Be 'Date,Time,ClientIP,ServerIP,UserAgent'
            $currentLogSettings.logformat | Should Be 'W3C'
            $currentLogSettings.logTargetW3C | Should Be 'File,ETW'
            $currentLogSettings.TruncateSize | Should Be '2097152'
            $currentLogSettings.localTimeRollover | Should Be 'True'
            $currentLogSettings.customFields.Collection[0].LogFieldName | Should Be 'ClientEncoding'
            $currentLogSettings.customFields.Collection[0].SourceName | Should Be 'Accept-Encoding'
            $currentLogSettings.customFields.Collection[0].SourceType | Should Be 'RequestHeader'
            $currentLogSettings.customFields.Collection[1].LogFieldName | Should Be 'X-Powered-By'
            $currentLogSettings.customFields.Collection[1].SourceName | Should Be 'ASP.NET'
            $currentLogSettings.customFields.Collection[1].SourceType | Should Be 'ResponseHeader'
        }
    }
}
finally
{
    Restore-WebConfigurationWrapper -Name $tempName -Verbose

    Remove-WebConfigurationBackup -Name $tempName -Verbose

    Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}


text:
package com.siyeh.ig.performance;

import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;

/**
 * @author Bas Leijdekkers
 */
public class CollectionsMustHaveInitialCapacityInspectionTest extends LightInspectionTestCase {
  @Override
  protected InspectionProfileEntry getInspection() {
    return new CollectionsMustHaveInitialCapacityInspection();
  }

  @Override
  protected String[] getEnvironmentClasses() {
    return new String[] {
      "package java.util.concurrent;" +
      "public class ConcurrentHashMap {}",
      "package java.util;" +
      "public class WeakHashMap {" +
      "  public WeakHashMap() {}" +
      "  public WeakHashMap(int c) {}" +
      "}",
      "package java.util;" +
      "public class HashSet {" +
      "  public HashSet() {}" +
      "  public HashSet(int c) {}" +
      "}",
      "package java.util;" +
      "public class BitSet {" +
      "  public BitSet() {}" +
      "  public BitSet(int c) {}" +
      "}",
      "package java.util;" +
      "public class Vector {" +
      "  public Vector() {}" +
      "  public Vector(int c) {}" +
      "}"
    };
  }

  public void testSimple() {
    doStatementTest("new /*'new java.util.concurrent.ConcurrentHashMap()' without initial capacity*/java.util.concurrent.ConcurrentHashMap/**/();");
  }

  public void testMore() {
    doTest("import java.util.*;" +
           "class X {" +
           "  void m() {" +
           "    new /*'new HashMap<String, String>()' without initial capacity*/HashMap<String, String>/**/();" +
           "    new HashMap<String, String>(3);" +
           "    new /*'new HashMap()' without initial capacity*/HashMap/**/();" +
           "    new HashMap(3);" +
           "    new /*'new WeakHashMap()' without initial capacity*/WeakHashMap/**/();" +
           "    new WeakHashMap(3);" +
           "    new /*'new HashSet()' without initial capacity*/HashSet/**/();" +
           "    new HashSet(3);" +
           "    new /*'new Hashtable()' without initial capacity*/Hashtable/**/();" +
           "    new Hashtable(3);" +
           "    new /*'new BitSet()' without initial capacity*/BitSet/**/();" +
           "    new BitSet(3);" +
           "    new /*'new Vector()' without initial capacity*/Vector/**/();" +
           "    new Vector(3);" +
           "    new /*'new ArrayList()' without initial capacity*/ArrayList/**/();" +
           "    new ArrayList(3);" +
           "  }" +
           "}");
  }
}


text:
package cat.calidos.morfeu.webapp.ui;

import static com.codeborne.selenide.Condition.visible;
import static com.codeborne.selenide.Selenide.$;

/**
* @author daniel giribet
*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public class UIDocument {

public UIDocument() {}

//public void shouldAppear() {
//	$("#document-info").should(appear);
//}

public void shouldBeVisible() {
	$("#document-info").shouldBe(visible);
}

public static void shouldNotBeVisible() {
	$("#document-info").shouldNotBe(visible);
}

public String title() {
	return $("#document-name").getText();

}

public String desc() {
	return $("#document-desc").getText();
}

public boolean isValid() {
	return $("#document-valid").getText().equals("VALID");
}

public UIModel model() {
	return new UIModel();
}

public UIContent content() {
	return new UIContent();
}

public UISnippetsArea snippets() {

	$("#snippets-tab").click();
	// let the snippets load (asynchronously)
	try {
		Thread.sleep(1000);
	} catch (InterruptedException e) {}

	return new UISnippetsArea();

}

public UIDocument clickSave() {

	$("#document-save").click();

	return this;

}

}


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 */
class Place
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\Column(type="string")
     */
    private $name;

    /**
     * @ORM\OneToMany(targetEntity="Accommodation", mappedBy="place")
     */
    private $accommodations;

    public function getId()
    {
        return $this->id;
    }

    public function getName()
    {
        return $this->name;
    }

    public function getAccommodations()
    {
        return $this->accommodations;
    }
}


text:
package eu.modernmt.decoder.neural.queue;

import java.io.File;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

public class HandlerBlockingQueue {

    private final Handler[] items;
    private int takeIndex;
    private int putIndex;
    private int count;

    private final ReentrantLock lock;
    private final Condition notEmpty;
    private final Condition notFull;

    public HandlerBlockingQueue(int capacity, boolean fair) {
        if (capacity <= 0)
            throw new IllegalArgumentException();

        items = new Handler[capacity];
        lock = new ReentrantLock(fair);
        notEmpty = lock.newCondition();
        notFull = lock.newCondition();
    }

    /**
     * Inserts the specified element at the tail of this queue if it is
     * possible to do so immediately without exceeding the queue's capacity,
     * returning {@code true} upon success and {@code false} if this queue
     * is full.
     *
     * @throws NullPointerException if the specified element is null
     */
    public boolean offer(Handler e) {
        Objects.requireNonNull(e);
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            if (count == items.length)
                return false;
            else {
                enqueue(e);
                return true;
            }
        } finally {
            lock.unlock();
        }
    }

    /**
     * Retrieves and removes the head of this queue, waiting if necessary
     * until an element becomes available.
     *
     * @param checkpoint preferred most-recently used checkpoint
     * @return the selected instance or the head of this queue if there is no Handler with preferred checkpoint
     * @throws InterruptedException if interrupted while waiting
     */
    public Handler take(File checkpoint) throws InterruptedException {
        final ReentrantLock lock = this.lock;
        lock.lockInterruptibly();
        try {
            while (count == 0)
                notEmpty.await();

            Handler result = checkpoint == null ? null : select(checkpoint);
            return result == null ? dequeue() : result;
        } finally {
            lock.unlock();
        }
    }

    /**
     * Retrieves and removes the head of this queue,
     * or returns {@code null} if this queue is empty.
     *
     * @return the head of this queue, or {@code null} if this queue is empty
     */
    public Handler poll() {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            return (count == 0) ? null : dequeue();
        } finally {
            lock.unlock();
        }
    }

    /**
     * Retrieves and removes the head of this queue, waiting up to the
     * specified wait time if necessary for an element to become available.
     *
     * @param checkpoint preferred most-recently used checkpoint
     * @param timeout    how long to wait before giving up, in units of
     *                   {@code unit}
     * @param unit       a {@code TimeUnit} determining how to interpret the
     *                   {@code timeout} parameter
     * @return the selected instance or the head of this queue if there is no Handler with preferred checkpoint,
     * or {@code null} if the specified waiting time elapses before an element is available
     * @throws InterruptedException if interrupted while waiting
     */
    public Handler poll(File checkpoint, long timeout, TimeUnit unit) throws InterruptedException {
        long nanos = unit.toNanos(timeout);
        final ReentrantLock lock = this.lock;
        lock.lockInterruptibly();
        try {
            while (count == 0) {
                if (nanos <= 0L)
                    return null;
                nanos = notEmpty.awaitNanos(nanos);
            }

            Handler result = checkpoint == null ? null : select(checkpoint);
            return result == null ? dequeue() : result;
        } finally {
            lock.unlock();
        }
    }

    // Internal helper methods

    private void enqueue(Handler e) {
        final Object[] items = this.items;
        items[putIndex] = e;
        if (++putIndex == items.length) putIndex = 0;
        count++;
        notEmpty.signal();
    }

    private Handler dequeue() {
        final Handler[] items = this.items;

        Handler e = items[takeIndex];
        items[takeIndex] = null;
        if (++takeIndex == items.length) takeIndex = 0;
        count--;
        notFull.signal();
        return e;
    }

    private Handler select(File checkpoint) {
        if (count > 0) {
            final Handler[] items = this.items;
            for (int i = takeIndex, end = putIndex,
                 to = (i < end) ? end : items.length;
                    ; i = 0, to = end) {
                for (; i < to; i++)
                    if (checkpoint.equals(items[i].getLastCheckpoint())) {
                        Handler result = items[i];
                        removeAt(i);
                        return result;
                    }
                if (to == end) break;
            }
        }

        return null;
    }

    private void removeAt(final int removeIndex) {
        final Object[] items = this.items;
        if (removeIndex == takeIndex) {
            // removing front item; just advance
            items[takeIndex] = null;
            if (++takeIndex == items.length) takeIndex = 0;
            count--;
        } else {
            // an "interior" remove

            // slide over all others up through putIndex.
            for (int i = removeIndex, putIndex = this.putIndex; ; ) {
                int pred = i;
                if (++i == items.length) i = 0;
                if (i == putIndex) {
                    items[pred] = null;
                    this.putIndex = pred;
                    break;
                }
                items[pred] = items[i];
            }
            count--;
        }
        notFull.signal();
    }

}


text:
            Institutes Added - Report for {{user.basic.name}} {{addedInstitutes.length}}

                See report for user:

                <md-select ng-model="filteredUser"  placeholder="Select EB Team Member" class="font12 width100 margin0 padding0">

                    <md-option ng-value="user" ng-repeat="user in listedUsers track by $index" ng-click="updateAddedInstitutes(user)" class="text-primary font11">
                      {{user.basic.name}}
                    </md-option>
                </md-select>

            <md-button class="md-next md-small font10" ng-click="showSummaryDialog()" ng-if="summaryStrings && summaryStrings.length > 0">
                Summary by Date
            </md-button>

                S. No.

                Institute

                Logo

                Address

                City

                State

                Pincode

                Added By

                Created on

                #Exams

                #Phone | Mobiles

                #Email | Websites

                {{$index+1}}

                    {{institute.name}}

                {{institute.address}}

                {{institute.city}}

                {{institute.state}}

                {{institute.pincode}}

                {{institute._createdBy.basic.name}}

                {{institute._created | date: "dd-MMM-yy HH:mm"}}

                {{institute.exams.length}}

                {{institute.phone.length}} | {{institute.mobile.length}}

                {{institute.email.length}} | {{institute.website.length}}

        You do not have access to view this information. Login above to try again.

      <md-dialog>

                    Changes Saved!

      </md-dialog>

      <md-dialog class="blog-dialog whiteBackground">

                Summary

                    {{summary}}

      </md-dialog>


text:
require "watirspec_helper"

describe "Dels" do

  before :each do
    browser.goto(WatirSpec.url_for("non_control_elements.html"))
  end

  describe "with selectors" do
    it "returns the matching elements" do
      expect(browser.dels(class: "lead").to_a).to eq [browser.del(class: "lead")]
    end
  end

  describe "#length" do
    it "returns the number of dels" do
      expect(browser.dels.length).to eq 5
    end
  end

  describe "#[]" do
    it "returns the del at the given index" do
      expect(browser.dels[0].id).to eq "lead"
    end
  end

  describe "#each" do
    it "iterates through dels correctly" do
      count = 0

      browser.dels.each_with_index do |s, index|
        expect(s.id).to eq browser.del(index: index).id
        count += 1
      end

      expect(count).to be > 0
    end
  end

end


text:
//
//  ChartSeriesHideOrShowVC.h
//  AAChartKitDemo
//
//  Created by AnAn on 2018/11/30.
//  Copyright © 2018 An An. All rights reserved.
//*************** ............ SOURCE CODE ............ ***************
//***.............................................................  ***
//*** iOS     :https://github.com/AAChartModel/AAChartKit           ***
//*** iOS     :https://github.com/AAChartModel/AAChartKit-Swift     ***
//*** Android :https://github.com/AAChartModel/AAChartCore          ***
//*** Android :https://github.com/AAChartModel/AAChartCore-Kotlin   ***
//***...............................................................***
//*************** ............ SOURCE CODE ............ ***************

/*

 * -------------------------------------------------------------------------------
 *
 * 🌕 🌖 🌗 🌘  ❀❀❀   WARM TIPS!!!   ❀❀❀ 🌑 🌒 🌓 🌔
 *
 * Please contact me on GitHub,if there are any problems encountered in use.
 * GitHub Issues : https://github.com/AAChartModel/AAChartKit/issues
 * -------------------------------------------------------------------------------
 * And if you want to contribute for this project, please contact me as well
 * GitHub        : https://github.com/AAChartModel
 * StackOverflow : https://stackoverflow.com/users/12302132/codeforu
 * JianShu       : https://www.jianshu.com/u/f1e6753d4254
 * SegmentFault  : https://segmentfault.com/u/huanghunbieguan
 *
 * -------------------------------------------------------------------------------

 */

#import <UIKit/UIKit.h>
#import "AAChartKit.h"

@interface HideOrShowChartSeriesVC : UIViewController
@property (nonatomic, assign) NSInteger chartTypeIndex;
@end


text:
#include <verve/verve.h>
#include <fstream>
#include <time.h>

/// A simple classical conditioning test of the critic's ability to predict
/// rewards.
void testRewardPredictionLearning()
{
	const verve::real timeStepSize = (verve::real)0.01;
	verve::real currentTime = 0;
	const verve::real maxTime = 1000;

	/// Output data for this many seconds of the end of the simulation.
	const verve::real printAmount = (verve::real)10;

	// # of stimulus-reward sequences per sec.
	const verve::real stimulusRewardFrequency = (verve::real)1.0;
	const verve::real stepsPerSecond = 1/timeStepSize;
	//verve::real stimulusRewardChance = 0;
	bool inSequence = false;
	verve::real stimulusTime = 1/stimulusRewardFrequency;
	verve::real rewardTime = 0;
	verve::real stimulusLength = (verve::real)0.05;
	verve::real rewardLength = (verve::real)0.05;
	verve::real endStimulusTime = 0;
	verve::real endRewardTime = 0;
	const verve::real interStimulusInterval = (verve::real)0.0;

	// create an RLAgent
	verve::RLAgent* agent = verve::createRLAgent(1, 1);
	agent->setStepSize(timeStepSize);
	agent->applyUniformNoise((verve::real)0.1);

	// setup the output file
	std::ofstream file("./results/reward_prediction.dat", std::ios::out);

	verve::real stimulus = 0;
	verve::real reinforcement = 0;
	//verve::real inputs[1] = 0;
	//const verve::real* outputs = agent->getOutputs();

	while (currentTime < maxTime)
	{
		// reset the stimulus and reinforcement signals
		//if (!inSequence)
		//{
		//	stimulus = 0;
		//}
		stimulus = 0;
		reinforcement = 0;

		//// make stimulus-reward sequences more frequent at first to train the agent
		//if (currentTime < (verve::real)0.5 * maxTime)
		//{
		//	stimulusRewardChance = (stimulusRewardFrequency / stepsPerSecond) * 5;
		//}
		//else
		//{
		//	stimulusRewardChance = stimulusRewardFrequency / stepsPerSecond;
		//}

		// check if we should initiate a stimulus-reward sequence
		//if (!inSequence && verve::globals::randomr(0, 1) < stimulusRewardChance)
		if (!inSequence && currentTime > stimulusTime)
		{
			inSequence = true;

			// setup the time that the stimulus should be given
			stimulusTime = currentTime + 1/stimulusRewardFrequency +
				verve::globals::randomRealUniform(0, 1);
			// setup the time that the reward should be given
			rewardTime = currentTime + stimulusLength + interStimulusInterval;

			// give the agent the stimulus
			endStimulusTime = currentTime + stimulusLength;
		}

		// check if we should be applying the stimulus
		if (currentTime < endStimulusTime)
		//if (currentTime < rewardTime)
		{
			//stimulus += (verve::real)0.04;
			stimulus = 1;
		}

		// check if it's time to give the reward and end the sequence
		if (inSequence && currentTime > rewardTime)
		{
			inSequence = false;
			endRewardTime = currentTime + rewardLength;
		}

		// check if we should be applying the reward
		if (currentTime < endRewardTime)
		{
			reinforcement = (verve::real)0.5;
		}

		agent->reinforce(reinforcement);
		agent->setInput(0, stimulus);
		agent->step();

		if (maxTime - currentTime < printAmount)
		{
			// print stats
			file << currentTime << " " << stimulus << " " << reinforcement << " "
				<< ((verve::RLAgent*)agent)->getTDError() << " "
				<<  ((verve::RLAgent*)agent)->getCurrentValueEstimation()<< std::endl;
		}

		currentTime += timeStepSize;

		//if (reinforcement > 0 && currentTime >= endRewardTime)
		//{
		//	// we just finished the reward
		//	agent->resetDynamics();
		//}
	}

	agent->destroy();
	file.close();
}

int main(int argc, char **argv)
{
	std::cout << "===============================================================" << std::endl;
	std::cout << "Verve temporal_difference test" << std::endl;
	std::cout << "This will test the temporal difference reinforcement learning " << std::endl;
	std::cout << "algorithm.  An agent's value estimations and temporal " << std::endl;
	std::cout << "difference prediction errors will be tested in a classical " << std::endl;
	std::cout << "conditioning method using a simple stimulus/reward sequence." << std::endl;
	std::cout << "Output data will be saved to files." << std::endl;
	std::cout << "===============================================================" << std::endl;

	//srand((unsigned int)time(NULL));
	srand(1);

	testRewardPredictionLearning();

	//// testing different decay methods
	//std::ofstream file("../../../../test.dat", std::ios::out);
	//verve::real stepSize = 0.001;
	//verve::real currentTime = 0;
	//verve::real maxTime = 1;
	//verve::real a = 1;
	//verve::real b = 1;
	//while (currentTime <= maxTime)
	//{
	//	a *= verve::globals::calcDecayConstant((verve::real)0.1, 0.01, stepSize);
	//	b *= verve::globals::calcDecayConstant((verve::real)0.001, 0.0001, stepSize);
	//	file << currentTime << " " << a << " " << b << std::endl;
	//	currentTime += stepSize;
	//}
	//file.close();

	return 0;
}


text:
package test.uniquesuite;

import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;

public class BaseBefore {
  public static int m_beforeCount = 0;
  public static int m_afterCount = 0;

  @BeforeSuite
  public void incrementBefore() {
    m_beforeCount++;
  }

  @AfterSuite
  public void incrementAfter() {
    m_afterCount++;
  }
}


text:
package com.hp.ov.sdk.dto.networking.logicalinterconnects;

public enum Command {

    Activate,
    None,
    Stage,
    Update

}


text:
interface I
{
    int this[int[] p] { set; }
}

class Base : I
{
    // Produces CS0466:
    int I.this[params int[] p] { set { } }
}

///
/// Changed in VS 2008 SP1
/// Can be compiled in: C# 2, 3 (no SP1)
///
/// #2 in https://msdn.microsoft.com/en-us/library/cc713578.aspx
/// Compiler now produces error CS0466 for indexers and properties in addition to methods.
///
/// <remarks>
/// For methods, All versions of C# compilers produce CS0466, which meets the specification. This breaking change for indexers is a bug fix.
/// <![CDATA[
/// interface I
/// {
///     void F(int[] p);
/// }
///
/// class Base : I
/// {
///     // Produces CS0466:
///     void I.F(params int[] p) { }
/// }
/// ]]>
///
/// FYI, it is legal if the indexer is implicitly implemented:
/// <![CDATA[
/// interface I
/// {
///     int this[int[] p] { set; }
/// }
///
/// class Base : I
/// {
///     public int this[params int[] p] { set { } }
/// }
/// ]]>
/// </remarks>
class ParamsOverride { static void Main() { } }


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Sydowia 33: 6 (1980)

#### Original name
Cunninghamella echinulata var. indica Baijal & B.S. Mehrotra

### Remarks
null


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Module: Roomer::VERSION

    — Documentation by YARD 0.7.2

</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />

    Index (V) »
    Roomer
     »
    VERSION

(no frames)

    Class List

    Method List

    File List

Module: Roomer::VERSION

Defined in:

lib/roomer/version.rb

Overview

:nodoc:

Constant Summary

MAJOR =

0

MINOR =

0

TINY =

1

PRE =

nil

STRING =

[MAJOR, MINOR, TINY, PRE].compact.join('.')

SUMMARY =

"roomer #{STRING}"

  Generated on Fri Aug 12 10:39:12 2011 by
  yard
  0.7.2 (ruby-1.8.7).


text:
package se.lnu.http;

import static org.junit.Assert.*;

import org.junit.Test;

import se.lnu.http.exceptions.MalformedRequestException;

public class HTTPRequestParserTest {

	@Test
	public void testParseRequest() throws MalformedRequestException {
		String ok = "GET / HTTP/1.1\r\n";
			   ok += "Host: localhost:8080\r\n";
			   ok += "Connection: keep-alive\r\n";
			   ok += "Cache-Control: max-age=0\r\n";
			   ok += "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n";
			   ok += "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36\r\n";
			   ok += "Accept-Encoding: gzip,deflate,sdch\r\n";
			   ok += "Accept-Language: sv-SE,sv;q=0.8,en-US;q=0.6,en;q=0.4\"\r\n\r\n";

		HTTPRequest actual = HTTPRequestParser.parseRequest(ok);

		assertEquals("/", actual.getURL());
	}

	@Test(expected=MalformedRequestException.class)
	public void testMalformedRequestEmpty() throws MalformedRequestException {
		String ok = "";

		HTTPRequestParser.parseRequest(ok);

	}

	@Test(expected=MalformedRequestException.class)
	public void testMalformedRequest() throws MalformedRequestException {
		String ok = "/ HTTP/1.1\r\n";
		ok += "Host: localhost:8080\r\n";
		ok += "Connection: keep-alive\r\n";

		HTTPRequestParser.parseRequest(ok);

	}

	@Test(expected=MalformedRequestException.class)
	public void testMalformedRequestNoHost() throws MalformedRequestException {
		String ok = "GET / HTTP/1.1\r\n";
		ok += "Connection: keep-alive\r\n";

		HTTPRequestParser.parseRequest(ok);

	}

	@Test(expected=MalformedRequestException.class)
	public void testMalformedRequest2() throws MalformedRequestException {
		String ok = "";

		HTTPRequestParser.parseRequest(ok);

	}

}


text:
package com.pearson.statsagg.webui;

import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.pearson.statsagg.alerts.EmailThread;
import com.pearson.statsagg.database_objects.alerts.Alert;
import com.pearson.statsagg.database_objects.metric_group.MetricGroup;
import com.pearson.statsagg.database_objects.metric_group.MetricGroupsDao;
import com.pearson.statsagg.globals.ApplicationConfiguration;
import com.pearson.statsagg.utilities.StackTrace;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author Jeffrey Schmidt
 */
@WebServlet(name = "AlertPreview", urlPatterns = {"/AlertPreview"})
public class AlertPreview extends HttpServlet {

    private static final Logger logger = LoggerFactory.getLogger(AlertPreview.class.getName());

    public static final String PAGE_NAME = "Alert Preview";

    /**
     * Handles the HTTP GET method.
     *
     * @param request servlet request
     * @param response servlet response
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) {
        processGetRequest(request, response);
    }

    /**
     * Handles the HTTP POST method.
     *
     * @param request servlet request
     * @param response servlet response
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) {
        processGetRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return PAGE_NAME;
    }

    protected void processGetRequest(HttpServletRequest request, HttpServletResponse response) {

        if ((request == null) || (response == null)) {
            return;
        }

        response.setContentType("text/html");
        PrintWriter out = null;

        Alert alert = CreateAlert.getAlertFromAlertParameters(request);
        String alertBody = getExampleEmailAlert(request.getParameter("WarningLevel"), alert, request.getParameter("MetricGroupName"));

        try {
            StringBuilder htmlBuilder = new StringBuilder();

            StatsAggHtmlFramework statsAggHtmlFramework = new StatsAggHtmlFramework();
            String htmlHeader = statsAggHtmlFramework.createHtmlHeader("StatsAgg - " + PAGE_NAME, "");

            String htmlBody =
            "" +
            "
\n" +
            "    \n" +
            "
\n" +
            "
" +
            alertBody +
            "
\n" +
            "
\n" +
            "
\n" +
            "";

            htmlBuilder.append("<!DOCTYPE html>\n\n").append(htmlHeader).append(htmlBody).append("");

            Document htmlDocument = Jsoup.parse(htmlBuilder.toString());
            String htmlFormatted  = htmlDocument.toString();
            out = response.getWriter();
            out.println(htmlFormatted);
        }
        catch (Exception e) {
            logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));
        }
        finally {
            if (out != null) {
                out.close();
            }
        }

    }

    /*
    For this method to return a valid result, warningLevel must be equalsIgnoreCase to either 'caution' or 'danger'
    */
    private String getExampleEmailAlert(String warningLevel, Alert alert, String metricGroupName) {

        if ((alert == null) || (warningLevel == null) || (!warningLevel.equalsIgnoreCase("caution") && !warningLevel.equalsIgnoreCase("danger"))) {
            return "Unable to preview alert";
        }

        if (metricGroupName == null) metricGroupName = "";

        Calendar currentCalendar = Calendar.getInstance();
        currentCalendar.add(Calendar.HOUR, -50);
        currentCalendar.add(Calendar.MINUTE, -25);
        currentCalendar.add(Calendar.SECOND, -31);

        alert.setId(99999);
        alert.setMetricGroupId(77777);
        alert.setCautionNotificationGroupId(77777);
        alert.setDangerNotificationGroupId(77777);
        alert.setCautionFirstActiveAt(new Timestamp(currentCalendar.getTimeInMillis()));
        alert.setDangerFirstActiveAt(new Timestamp(currentCalendar.getTimeInMillis()));

        MetricGroupsDao metricGroupsDao = new MetricGroupsDao();
        MetricGroup metricGroup = metricGroupsDao.getMetricGroupByName(metricGroupName);
        if (metricGroup != null) metricGroup = new MetricGroup(88888, metricGroup.getName(), metricGroup.getUppercaseName(), metricGroup.getDescription());
        else metricGroup = new MetricGroup(88888, metricGroupName, metricGroupName.toUpperCase(), "");

        List<String> metricKeys = new ArrayList<>();
        metricKeys.add("preview.metric1");
        metricKeys.add("preview.metric2");
        metricKeys.add("preview.metric3");

        Map<String,BigDecimal> alertMetricValues = generateFakeMetricValues(warningLevel, alert);

        if (warningLevel.equalsIgnoreCase("caution")) {
            boolean isAlertValidAndEnabled = alert.isCautionAlertCriteriaValid() && (alert.isCautionEnabled() != null) && alert.isCautionEnabled();

            if (isAlertValidAndEnabled) {
                EmailThread emailThread = new EmailThread(alert, EmailThread.WARNING_LEVEL_CAUTION, metricKeys, alertMetricValues, new ConcurrentHashMap<String,String>(),
                        false, true, ApplicationConfiguration.getAlertStatsAggLocation());
                emailThread.buildAlertEmail(2, metricGroup);
                return emailThread.getBody();
            }
            else {
                return "This alert's caution criteria is not valid";
            }
        }

        if (warningLevel.equalsIgnoreCase("danger")) {
            boolean isAlertValidAndEnabled = alert.isDangerAlertCriteriaValid() && (alert.isDangerEnabled() != null) && alert.isDangerEnabled();

            if (isAlertValidAndEnabled) {
                EmailThread emailThread = new EmailThread(alert, EmailThread.WARNING_LEVEL_DANGER, metricKeys, alertMetricValues, new ConcurrentHashMap<String,String>(),
                        false, true, ApplicationConfiguration.getAlertStatsAggLocation());
                emailThread.buildAlertEmail(2, metricGroup);
                return emailThread.getBody();
            }
            else {
                return "This alert's danger criteria is not valid";
            }
        }

        return "Unable to preview alert";
    }

    private Map generateFakeMetricValues(String warningLevel, Alert alert) {

        if ((warningLevel == null) || (alert == null)) {
            return new HashMap<>();
        }

        Map<String,BigDecimal> alertMetricValues = new HashMap<>();

        if (warningLevel.equalsIgnoreCase("caution") && (alert.getCautionOperator() != null) && (alert.getCautionThreshold() != null) &&
                 (alert.getAlertType() != null) && (alert.getAlertType() == Alert.TYPE_THRESHOLD)) {
            if ((Objects.equals(alert.getCautionOperator(), Alert.OPERATOR_GREATER_EQUALS)) || (Objects.equals(alert.getCautionOperator(), Alert.OPERATOR_GREATER))) {
                alertMetricValues.put("preview.metric1" + "-" + alert.getId(), alert.getCautionThreshold().add(BigDecimal.ONE));
                alertMetricValues.put("preview.metric2" + "-" + alert.getId(), alert.getCautionThreshold().add(BigDecimal.TEN));
            }

            if ((Objects.equals(alert.getCautionOperator(), Alert.OPERATOR_LESS_EQUALS)) || (Objects.equals(alert.getCautionOperator(), Alert.OPERATOR_LESS))) {
                alertMetricValues.put("preview.metric1" + "-" + alert.getId(), alert.getCautionThreshold().subtract(BigDecimal.ONE));
                alertMetricValues.put("preview.metric2" + "-" + alert.getId(), alert.getCautionThreshold().subtract(BigDecimal.TEN));
            }

            if (Objects.equals(alert.getCautionOperator(), Alert.OPERATOR_EQUALS)) {
                alertMetricValues.put("preview.metric1" + "-" + alert.getId(), alert.getCautionThreshold());
                alertMetricValues.put("preview.metric2" + "-" + alert.getId(), alert.getCautionThreshold());
            }
        }

        if (warningLevel.equalsIgnoreCase("danger") && (alert.getDangerOperator() != null) && (alert.getDangerThreshold() != null) &&
                (alert.getAlertType() != null) && (alert.getAlertType() == Alert.TYPE_THRESHOLD)) {
            if ((Objects.equals(alert.getDangerOperator(), Alert.OPERATOR_GREATER_EQUALS)) || (Objects.equals(alert.getDangerOperator(), Alert.OPERATOR_GREATER))) {
                alertMetricValues.put("preview.metric1" + "-" + alert.getId(), alert.getDangerThreshold().add(BigDecimal.ONE));
                alertMetricValues.put("preview.metric2" + "-" + alert.getId(), alert.getDangerThreshold().add(BigDecimal.TEN));
            }

            if ((Objects.equals(alert.getDangerOperator(), Alert.OPERATOR_LESS_EQUALS)) || (Objects.equals(alert.getDangerOperator(), Alert.OPERATOR_LESS))) {
                alertMetricValues.put("preview.metric1" + "-" + alert.getId(), alert.getDangerThreshold().subtract(BigDecimal.ONE));
                alertMetricValues.put("preview.metric2" + "-" + alert.getId(), alert.getDangerThreshold().subtract(BigDecimal.TEN));
            }

            if (Objects.equals(alert.getDangerOperator(), Alert.OPERATOR_EQUALS)) {
                alertMetricValues.put("preview.metric1" + "-" + alert.getId(), alert.getDangerThreshold());
                alertMetricValues.put("preview.metric2" + "-" + alert.getId(), alert.getDangerThreshold());
            }
        }

        return alertMetricValues;
    }

}


text:
const jwt = require('jsonwebtoken');
const env = require('../shared/environment');

module.exports = (data) => {
  const response = data || {};

  const authResponse = (req, res, next) => {
    if (req.user === undefined) {
      res.json(response);
      return;
    }

    const payload = { id: req.user._id };

    const token = jwt.sign(
      payload,
      env.get('JWT_SECRET'),
      {
        expiresIn: '2h'
      }
    );

    response.authResponse = {};
    response.authResponse.token = token;
    response.authResponse.user = {
      id: req.user._id,
      avatarUrl: req.user.avatarUrl,
      facebookId: req.user.facebookId,
      firstName: req.user.firstName,
      lastName: req.user.lastName,
      emailAddress: req.user.emailAddress,
      emailAddressVerified: req.user.emailAddressVerified
    };

    res.json(response);
  };

  return authResponse;
};


text:
@interface DGChartView : UIView
@property (nonatomic, assign)int me;
@property (nonatomic, assign)int fAll;

- (void)setInfo;
@end


text:
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>NoLockFactory Class</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            Apache Lucene.Net 2.4.0 Class Library API

NoLockFactory Class

 Use this {@link LockFactory} to disable locking entirely. This LockFactory is used when you call {@link FSDirectory#setDisableLocks}. Only one instance of this lock is created. You should call {@link #GetNoLockFactory()} to get the instance.

For a list of all members of this type, see NoLockFactory Members.

        System.Object

   Lucene.Net.Store.LockFactory
      Lucene.Net.Store.NoLockFactory

public class NoLockFactory : LockFactory

Thread Safety

Public static (Shared in Visual Basic) members of this type are
				safe for multithreaded operations. Instance members are not guaranteed to be
				thread-safe.

Requirements

        Namespace:
        Lucene.Net.Store

        Assembly: Lucene.Net (in Lucene.Net.dll)

See Also

        NoLockFactory Members | Lucene.Net.Store Namespace |

      <object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;">
        <param name="Keyword" value="NoLockFactory class, about NoLockFactory class">
        </param>
      </object>

Generated from assembly Lucene.Net [2.4.0.2]


text:
package net.sf.mmm.client.ui.impl.gwt.widget.field;

import net.sf.mmm.client.ui.api.UiContext;
import net.sf.mmm.client.ui.api.widget.field.UiWidgetIntegerField;
import net.sf.mmm.client.ui.base.widget.factory.AbstractUiSingleWidgetFactoryNative;
import net.sf.mmm.client.ui.base.widget.field.AbstractUiWidgetIntegerField;
import net.sf.mmm.client.ui.base.widget.field.adapter.UiWidgetAdapterIntegerField;
import net.sf.mmm.client.ui.impl.gwt.widget.field.adapter.UiWidgetAdapterGwtIntegerField;

/**
 * This is the implementation of {@link UiWidgetIntegerField} using GWT based on
 * {@link UiWidgetAdapterGwtIntegerField}.
 *
 * @author Joerg Hohwiller (hohwille at users.sourceforge.net)
 * @since 1.0.0
 */
public class UiWidgetIntegerFieldGwt extends AbstractUiWidgetIntegerField<UiWidgetAdapterIntegerField> {

  /**
   * The constructor.
   *
   * @param context is the {@link #getContext() context}.
   * @param widgetAdapter is the {@link #getWidgetAdapter() widget adapter}. Typically null for
   *        lazy initialization.
   */
  public UiWidgetIntegerFieldGwt(UiContext context, UiWidgetAdapterGwtIntegerField widgetAdapter) {

    super(context, widgetAdapter);
  }

  /**
   * {@inheritDoc}
   */
  @Override
  protected UiWidgetAdapterGwtIntegerField createWidgetAdapter() {

    return new UiWidgetAdapterGwtIntegerField();
  }

  /**
   * This inner class is the {@link AbstractUiSingleWidgetFactoryNative factory} for this widget.
   */
  public static class Factory extends AbstractUiSingleWidgetFactoryNative<UiWidgetIntegerField> {

    /**
     * The constructor.
     */
    public Factory() {

      super(UiWidgetIntegerField.class);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public UiWidgetIntegerField create(UiContext context) {

      return new UiWidgetIntegerFieldGwt(context, null);
    }

  }

}