text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by \generate-code.bat.
//
//     Changes to this file will be lost when the code is regenerated.
//     The build server regenerates the code before each build and a pre-build
//     step will regenerate the code on each local build.
//
//     See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
//
//     Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
//     Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
//
// </auto-generated>
//------------------------------------------------------------------------------

// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.

using System;
using System.Globalization;
using System.Linq;
using System.Threading;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
using Xunit;

// Disable build warning CS1718: Comparison made to same variable; did you mean to compare something else?
#pragma warning disable 1718

// ReSharper disable once CheckNamespace
namespace UnitsNet.Tests
{
    /// <summary>
    /// Test of RatioChangeRate.
    /// </summary>
// ReSharper disable once PartialTypeWithSinglePart
    public abstract partial class RatioChangeRateTestsBase : QuantityTestsBase
    {
        protected abstract double DecimalFractionsPerSecondInOneDecimalFractionPerSecond { get; }
        protected abstract double PercentsPerSecondInOneDecimalFractionPerSecond { get; }

// ReSharper disable VirtualMemberNeverOverriden.Global
        protected virtual double DecimalFractionsPerSecondTolerance { get { return 1e-5; } }
        protected virtual double PercentsPerSecondTolerance { get { return 1e-5; } }
// ReSharper restore VirtualMemberNeverOverriden.Global

        [Fact]
        public void Ctor_WithUndefinedUnit_ThrowsArgumentException()
        {
            Assert.Throws<ArgumentException>(() => new RatioChangeRate((double)0.0, RatioChangeRateUnit.Undefined));
        }

        [Fact]
        public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
        {
            var quantity = new RatioChangeRate();
            Assert.Equal(0, quantity.Value);
            Assert.Equal(RatioChangeRateUnit.DecimalFractionPerSecond, quantity.Unit);
        }

        [Fact]
        public void Ctor_WithInfinityValue_ThrowsArgumentException()
        {
            Assert.Throws<ArgumentException>(() => new RatioChangeRate(double.PositiveInfinity, RatioChangeRateUnit.DecimalFractionPerSecond));
            Assert.Throws<ArgumentException>(() => new RatioChangeRate(double.NegativeInfinity, RatioChangeRateUnit.DecimalFractionPerSecond));
        }

        [Fact]
        public void Ctor_WithNaNValue_ThrowsArgumentException()
        {
            Assert.Throws<ArgumentException>(() => new RatioChangeRate(double.NaN, RatioChangeRateUnit.DecimalFractionPerSecond));
        }

        [Fact]
        public void Ctor_NullAsUnitSystem_ThrowsArgumentNullException()
        {
            Assert.Throws<ArgumentNullException>(() => new RatioChangeRate(value: 1, unitSystem: null));
        }

        [Fact]
        public void Ctor_SIUnitSystem_ThrowsArgumentExceptionIfNotSupported()
        {
            Func<object> TestCode = () => new RatioChangeRate(value: 1, unitSystem: UnitSystem.SI);
            if (SupportsSIUnitSystem)
            {
                var quantity = (RatioChangeRate) TestCode();
                Assert.Equal(1, quantity.Value);
            }
            else
            {
                Assert.Throws<ArgumentException>(TestCode);
            }
        }

        [Fact]
        public void RatioChangeRate_QuantityInfo_ReturnsQuantityInfoDescribingQuantity()
        {
            var quantity = new RatioChangeRate(1, RatioChangeRateUnit.DecimalFractionPerSecond);

            QuantityInfo<RatioChangeRateUnit> quantityInfo = quantity.QuantityInfo;

            Assert.Equal(RatioChangeRate.Zero, quantityInfo.Zero);
            Assert.Equal("RatioChangeRate", quantityInfo.Name);
            Assert.Equal(QuantityType.RatioChangeRate, quantityInfo.QuantityType);

            var units = EnumUtils.GetEnumValues<RatioChangeRateUnit>().Except(new[] {RatioChangeRateUnit.Undefined}).ToArray();
            var unitNames = units.Select(x => x.ToString());

            // Obsolete members
            Assert.Equal(units, quantityInfo.Units);
            Assert.Equal(unitNames, quantityInfo.UnitNames);
        }

        [Fact]
        public void DecimalFractionPerSecondToRatioChangeRateUnits()
        {
            RatioChangeRate decimalfractionpersecond = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            AssertEx.EqualTolerance(DecimalFractionsPerSecondInOneDecimalFractionPerSecond, decimalfractionpersecond.DecimalFractionsPerSecond, DecimalFractionsPerSecondTolerance);
            AssertEx.EqualTolerance(PercentsPerSecondInOneDecimalFractionPerSecond, decimalfractionpersecond.PercentsPerSecond, PercentsPerSecondTolerance);
        }

        [Fact]
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = RatioChangeRate.From(1, RatioChangeRateUnit.DecimalFractionPerSecond);
            AssertEx.EqualTolerance(1, quantity00.DecimalFractionsPerSecond, DecimalFractionsPerSecondTolerance);
            Assert.Equal(RatioChangeRateUnit.DecimalFractionPerSecond, quantity00.Unit);

            var quantity01 = RatioChangeRate.From(1, RatioChangeRateUnit.PercentPerSecond);
            AssertEx.EqualTolerance(1, quantity01.PercentsPerSecond, PercentsPerSecondTolerance);
            Assert.Equal(RatioChangeRateUnit.PercentPerSecond, quantity01.Unit);

        }

        [Fact]
        public void FromDecimalFractionsPerSecond_WithInfinityValue_ThrowsArgumentException()
        {
            Assert.Throws<ArgumentException>(() => RatioChangeRate.FromDecimalFractionsPerSecond(double.PositiveInfinity));
            Assert.Throws<ArgumentException>(() => RatioChangeRate.FromDecimalFractionsPerSecond(double.NegativeInfinity));
        }

        [Fact]
        public void FromDecimalFractionsPerSecond_WithNanValue_ThrowsArgumentException()
        {
            Assert.Throws<ArgumentException>(() => RatioChangeRate.FromDecimalFractionsPerSecond(double.NaN));
        }

        [Fact]
        public void As()
        {
            var decimalfractionpersecond = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            AssertEx.EqualTolerance(DecimalFractionsPerSecondInOneDecimalFractionPerSecond, decimalfractionpersecond.As(RatioChangeRateUnit.DecimalFractionPerSecond), DecimalFractionsPerSecondTolerance);
            AssertEx.EqualTolerance(PercentsPerSecondInOneDecimalFractionPerSecond, decimalfractionpersecond.As(RatioChangeRateUnit.PercentPerSecond), PercentsPerSecondTolerance);
        }

        [Fact]
        public void As_SIUnitSystem_ThrowsArgumentExceptionIfNotSupported()
        {
            var quantity = new RatioChangeRate(value: 1, unit: RatioChangeRate.BaseUnit);
            Func<object> AsWithSIUnitSystem = () => quantity.As(UnitSystem.SI);

            if (SupportsSIUnitSystem)
            {
                var value = (double) AsWithSIUnitSystem();
                Assert.Equal(1, value);
            }
            else
            {
                Assert.Throws<ArgumentException>(AsWithSIUnitSystem);
            }
        }

        [Fact]
        public void ToUnit()
        {
            var decimalfractionpersecond = RatioChangeRate.FromDecimalFractionsPerSecond(1);

            var decimalfractionpersecondQuantity = decimalfractionpersecond.ToUnit(RatioChangeRateUnit.DecimalFractionPerSecond);
            AssertEx.EqualTolerance(DecimalFractionsPerSecondInOneDecimalFractionPerSecond, (double)decimalfractionpersecondQuantity.Value, DecimalFractionsPerSecondTolerance);
            Assert.Equal(RatioChangeRateUnit.DecimalFractionPerSecond, decimalfractionpersecondQuantity.Unit);

            var percentpersecondQuantity = decimalfractionpersecond.ToUnit(RatioChangeRateUnit.PercentPerSecond);
            AssertEx.EqualTolerance(PercentsPerSecondInOneDecimalFractionPerSecond, (double)percentpersecondQuantity.Value, PercentsPerSecondTolerance);
            Assert.Equal(RatioChangeRateUnit.PercentPerSecond, percentpersecondQuantity.Unit);
        }

        [Fact]
        public void ToBaseUnit_ReturnsQuantityWithBaseUnit()
        {
            var quantityInBaseUnit = RatioChangeRate.FromDecimalFractionsPerSecond(1).ToBaseUnit();
            Assert.Equal(RatioChangeRate.BaseUnit, quantityInBaseUnit.Unit);
        }

        [Fact]
        public void ConversionRoundTrip()
        {
            RatioChangeRate decimalfractionpersecond = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            AssertEx.EqualTolerance(1, RatioChangeRate.FromDecimalFractionsPerSecond(decimalfractionpersecond.DecimalFractionsPerSecond).DecimalFractionsPerSecond, DecimalFractionsPerSecondTolerance);
            AssertEx.EqualTolerance(1, RatioChangeRate.FromPercentsPerSecond(decimalfractionpersecond.PercentsPerSecond).DecimalFractionsPerSecond, PercentsPerSecondTolerance);
        }

        [Fact]
        public void ArithmeticOperators()
        {
            RatioChangeRate v = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            AssertEx.EqualTolerance(-1, -v.DecimalFractionsPerSecond, DecimalFractionsPerSecondTolerance);
            AssertEx.EqualTolerance(2, (RatioChangeRate.FromDecimalFractionsPerSecond(3)-v).DecimalFractionsPerSecond, DecimalFractionsPerSecondTolerance);
            AssertEx.EqualTolerance(2, (v + v).DecimalFractionsPerSecond, DecimalFractionsPerSecondTolerance);
            AssertEx.EqualTolerance(10, (v*10).DecimalFractionsPerSecond, DecimalFractionsPerSecondTolerance);
            AssertEx.EqualTolerance(10, (10*v).DecimalFractionsPerSecond, DecimalFractionsPerSecondTolerance);
            AssertEx.EqualTolerance(2, (RatioChangeRate.FromDecimalFractionsPerSecond(10)/5).DecimalFractionsPerSecond, DecimalFractionsPerSecondTolerance);
            AssertEx.EqualTolerance(2, RatioChangeRate.FromDecimalFractionsPerSecond(10)/RatioChangeRate.FromDecimalFractionsPerSecond(5), DecimalFractionsPerSecondTolerance);
        }

        [Fact]
        public void ComparisonOperators()
        {
            RatioChangeRate oneDecimalFractionPerSecond = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            RatioChangeRate twoDecimalFractionsPerSecond = RatioChangeRate.FromDecimalFractionsPerSecond(2);

            Assert.True(oneDecimalFractionPerSecond < twoDecimalFractionsPerSecond);
            Assert.True(oneDecimalFractionPerSecond <= twoDecimalFractionsPerSecond);
            Assert.True(twoDecimalFractionsPerSecond > oneDecimalFractionPerSecond);
            Assert.True(twoDecimalFractionsPerSecond >= oneDecimalFractionPerSecond);

            Assert.False(oneDecimalFractionPerSecond > twoDecimalFractionsPerSecond);
            Assert.False(oneDecimalFractionPerSecond >= twoDecimalFractionsPerSecond);
            Assert.False(twoDecimalFractionsPerSecond < oneDecimalFractionPerSecond);
            Assert.False(twoDecimalFractionsPerSecond <= oneDecimalFractionPerSecond);
        }

        [Fact]
        public void CompareToIsImplemented()
        {
            RatioChangeRate decimalfractionpersecond = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            Assert.Equal(0, decimalfractionpersecond.CompareTo(decimalfractionpersecond));
            Assert.True(decimalfractionpersecond.CompareTo(RatioChangeRate.Zero) > 0);
            Assert.True(RatioChangeRate.Zero.CompareTo(decimalfractionpersecond) < 0);
        }

        [Fact]
        public void CompareToThrowsOnTypeMismatch()
        {
            RatioChangeRate decimalfractionpersecond = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            Assert.Throws<ArgumentException>(() => decimalfractionpersecond.CompareTo(new object()));
        }

        [Fact]
        public void CompareToThrowsOnNull()
        {
            RatioChangeRate decimalfractionpersecond = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            Assert.Throws<ArgumentNullException>(() => decimalfractionpersecond.CompareTo(null));
        }

        [Fact]
        public void EqualityOperators()
        {
            var a = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            var b = RatioChangeRate.FromDecimalFractionsPerSecond(2);

 // ReSharper disable EqualExpressionComparison

            Assert.True(a == a);
            Assert.False(a != a);

            Assert.True(a != b);
            Assert.False(a == b);

            Assert.False(a == null);
            Assert.False(null == a);

// ReSharper restore EqualExpressionComparison
        }

        [Fact]
        public void Equals_SameType_IsImplemented()
        {
            var a = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            var b = RatioChangeRate.FromDecimalFractionsPerSecond(2);

            Assert.True(a.Equals(a));
            Assert.False(a.Equals(b));
        }

        [Fact]
        public void Equals_QuantityAsObject_IsImplemented()
        {
            object a = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            object b = RatioChangeRate.FromDecimalFractionsPerSecond(2);

            Assert.True(a.Equals(a));
            Assert.False(a.Equals(b));
            Assert.False(a.Equals((object)null));
        }

        [Fact]
        public void Equals_RelativeTolerance_IsImplemented()
        {
            var v = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            Assert.True(v.Equals(RatioChangeRate.FromDecimalFractionsPerSecond(1), DecimalFractionsPerSecondTolerance, ComparisonType.Relative));
            Assert.False(v.Equals(RatioChangeRate.Zero, DecimalFractionsPerSecondTolerance, ComparisonType.Relative));
        }

        [Fact]
        public void Equals_NegativeRelativeTolerance_ThrowsArgumentOutOfRangeException()
        {
            var v = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            Assert.Throws<ArgumentOutOfRangeException>(() => v.Equals(RatioChangeRate.FromDecimalFractionsPerSecond(1), -1, ComparisonType.Relative));
        }

        [Fact]
        public void EqualsReturnsFalseOnTypeMismatch()
        {
            RatioChangeRate decimalfractionpersecond = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            Assert.False(decimalfractionpersecond.Equals(new object()));
        }

        [Fact]
        public void EqualsReturnsFalseOnNull()
        {
            RatioChangeRate decimalfractionpersecond = RatioChangeRate.FromDecimalFractionsPerSecond(1);
            Assert.False(decimalfractionpersecond.Equals(null));
        }

        [Fact]
        public void UnitsDoesNotContainUndefined()
        {
            Assert.DoesNotContain(RatioChangeRateUnit.Undefined, RatioChangeRate.Units);
        }

        [Fact]
        public void HasAtLeastOneAbbreviationSpecified()
        {
            var units = Enum.GetValues(typeof(RatioChangeRateUnit)).Cast<RatioChangeRateUnit>();
            foreach(var unit in units)
            {
                if(unit == RatioChangeRateUnit.Undefined)
                    continue;

                var defaultAbbreviation = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit);
            }
        }

        [Fact]
        public void BaseDimensionsShouldNeverBeNull()
        {
            Assert.False(RatioChangeRate.BaseDimensions is null);
        }

        [Fact]
        public void ToString_ReturnsValueAndUnitAbbreviationInCurrentCulture()
        {
            var prevCulture = Thread.CurrentThread.CurrentUICulture;
            Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
            try {
                Assert.Equal("1 /s", new RatioChangeRate(1, RatioChangeRateUnit.DecimalFractionPerSecond).ToString());
                Assert.Equal("1 %/s", new RatioChangeRate(1, RatioChangeRateUnit.PercentPerSecond).ToString());
            }
            finally
            {
                Thread.CurrentThread.CurrentUICulture = prevCulture;
            }
        }

        [Fact]
        public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCultureSinceThereAreNoMappings()
        {
            // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback.
            var swedishCulture = CultureInfo.GetCultureInfo("sv-SE");

            Assert.Equal("1 /s", new RatioChangeRate(1, RatioChangeRateUnit.DecimalFractionPerSecond).ToString(swedishCulture));
            Assert.Equal("1 %/s", new RatioChangeRate(1, RatioChangeRateUnit.PercentPerSecond).ToString(swedishCulture));
        }

        [Fact]
        public void ToString_SFormat_FormatsNumberWithGivenDigitsAfterRadixForCurrentCulture()
        {
            var oldCulture = CultureInfo.CurrentUICulture;
            try
            {
                CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
                Assert.Equal("0.1 /s", new RatioChangeRate(0.123456, RatioChangeRateUnit.DecimalFractionPerSecond).ToString("s1"));
                Assert.Equal("0.12 /s", new RatioChangeRate(0.123456, RatioChangeRateUnit.DecimalFractionPerSecond).ToString("s2"));
                Assert.Equal("0.123 /s", new RatioChangeRate(0.123456, RatioChangeRateUnit.DecimalFractionPerSecond).ToString("s3"));
                Assert.Equal("0.1235 /s", new RatioChangeRate(0.123456, RatioChangeRateUnit.DecimalFractionPerSecond).ToString("s4"));
            }
            finally
            {
                CultureInfo.CurrentUICulture = oldCulture;
            }
        }

        [Fact]
        public void ToString_SFormatAndCulture_FormatsNumberWithGivenDigitsAfterRadixForGivenCulture()
        {
            var culture = CultureInfo.InvariantCulture;
            Assert.Equal("0.1 /s", new RatioChangeRate(0.123456, RatioChangeRateUnit.DecimalFractionPerSecond).ToString("s1", culture));
            Assert.Equal("0.12 /s", new RatioChangeRate(0.123456, RatioChangeRateUnit.DecimalFractionPerSecond).ToString("s2", culture));
            Assert.Equal("0.123 /s", new RatioChangeRate(0.123456, RatioChangeRateUnit.DecimalFractionPerSecond).ToString("s3", culture));
            Assert.Equal("0.1235 /s", new RatioChangeRate(0.123456, RatioChangeRateUnit.DecimalFractionPerSecond).ToString("s4", culture));
        }

        [Fact]
        public void ToString_NullFormat_ThrowsArgumentNullException()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Throws<ArgumentNullException>(() => quantity.ToString(null, null, null));
        }

        [Fact]
        public void ToString_NullArgs_ThrowsArgumentNullException()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Throws<ArgumentNullException>(() => quantity.ToString(null, "g", null));
        }

        [Fact]
        public void ToString_NullProvider_EqualsCurrentUICulture()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal(quantity.ToString(CultureInfo.CurrentUICulture, "g"), quantity.ToString(null, "g"));
        }

        [Fact]
        public void Convert_ToBool_ThrowsInvalidCastException()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Throws<InvalidCastException>(() => Convert.ToBoolean(quantity));
        }

        [Fact]
        public void Convert_ToByte_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
           Assert.Equal((byte)quantity.Value, Convert.ToByte(quantity));
        }

        [Fact]
        public void Convert_ToChar_ThrowsInvalidCastException()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Throws<InvalidCastException>(() => Convert.ToChar(quantity));
        }

        [Fact]
        public void Convert_ToDateTime_ThrowsInvalidCastException()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Throws<InvalidCastException>(() => Convert.ToDateTime(quantity));
        }

        [Fact]
        public void Convert_ToDecimal_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal((decimal)quantity.Value, Convert.ToDecimal(quantity));
        }

        [Fact]
        public void Convert_ToDouble_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal((double)quantity.Value, Convert.ToDouble(quantity));
        }

        [Fact]
        public void Convert_ToInt16_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal((short)quantity.Value, Convert.ToInt16(quantity));
        }

        [Fact]
        public void Convert_ToInt32_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal((int)quantity.Value, Convert.ToInt32(quantity));
        }

        [Fact]
        public void Convert_ToInt64_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal((long)quantity.Value, Convert.ToInt64(quantity));
        }

        [Fact]
        public void Convert_ToSByte_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal((sbyte)quantity.Value, Convert.ToSByte(quantity));
        }

        [Fact]
        public void Convert_ToSingle_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal((float)quantity.Value, Convert.ToSingle(quantity));
        }

        [Fact]
        public void Convert_ToString_EqualsToString()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal(quantity.ToString(), Convert.ToString(quantity));
        }

        [Fact]
        public void Convert_ToUInt16_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal((ushort)quantity.Value, Convert.ToUInt16(quantity));
        }

        [Fact]
        public void Convert_ToUInt32_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal((uint)quantity.Value, Convert.ToUInt32(quantity));
        }

        [Fact]
        public void Convert_ToUInt64_EqualsValueAsSameType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal((ulong)quantity.Value, Convert.ToUInt64(quantity));
        }

        [Fact]
        public void Convert_ChangeType_SelfType_EqualsSelf()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal(quantity, Convert.ChangeType(quantity, typeof(RatioChangeRate)));
        }

        [Fact]
        public void Convert_ChangeType_UnitType_EqualsUnit()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal(quantity.Unit, Convert.ChangeType(quantity, typeof(RatioChangeRateUnit)));
        }

        [Fact]
        public void Convert_ChangeType_QuantityType_EqualsQuantityType()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal(QuantityType.RatioChangeRate, Convert.ChangeType(quantity, typeof(QuantityType)));
        }

        [Fact]
        public void Convert_ChangeType_QuantityInfo_EqualsQuantityInfo()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal(RatioChangeRate.Info, Convert.ChangeType(quantity, typeof(QuantityInfo)));
        }

        [Fact]
        public void Convert_ChangeType_BaseDimensions_EqualsBaseDimensions()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal(RatioChangeRate.BaseDimensions, Convert.ChangeType(quantity, typeof(BaseDimensions)));
        }

        [Fact]
        public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Throws<InvalidCastException>(() => Convert.ChangeType(quantity, typeof(QuantityFormatter)));
        }

        [Fact]
        public void GetHashCode_Equals()
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0);
            Assert.Equal(new {RatioChangeRate.Info.Name, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode());
        }

        [Theory]
        [InlineData(1.0)]
        [InlineData(-1.0)]
        public void NegationOperator_ReturnsQuantity_WithNegatedValue(double value)
        {
            var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(value);
            Assert.Equal(RatioChangeRate.FromDecimalFractionsPerSecond(-value), -quantity);
        }
    }
}


text:
using BEPUphysics.Entities;
using BEPUutilities;

namespace BEPUphysicsDemos
{
    public class FixedOffsetCameraControlScheme : CameraControlScheme
    {

        /// <summary>
        /// Gets or sets the offset from the position of the entity to the camera.
        /// </summary>
        public Vector3 CameraOffset { get; set; }

        /// <summary>
        /// Gets the character associated with the control scheme.
        /// </summary>
        public Entity Entity { get; private set; }

        /// <summary>
        /// Gets or sets whether or not to smooth the motion of the camera when the character moves discontinuously.
        /// </summary>
        public bool UseCameraSmoothing { get; set; }

        public FixedOffsetCameraControlScheme(Entity entity, Camera camera, DemosGame game)
            : base(camera, game)
        {
            Entity = entity;
            UseCameraSmoothing = true;
            CameraOffset = new Vector3(0, 0.7f, 0);
        }

        public override void Update(float dt)
        {
            base.Update(dt);

            ////Rotate the camera of the character based on the support velocity, if a support with velocity exists.
            ////This can be very disorienting in some cases; that's why it is off by default!
            //if (Character.SupportFinder.HasSupport)
            //{
            //    SupportData? data;
            //    if (Character.SupportFinder.HasTraction)
            //        data = Character.SupportFinder.TractionData;
            //    else
            //        data = Character.SupportFinder.SupportData;
            //    var support = data.Value.SupportObject as EntityCollidable;
            //    if (support != null && !support.Entity.IsDynamic) //Having the view turned by dynamic entities is extremely confusing for the most part.
            //    {
            //        float dot = Vector3.Dot(support.Entity.AngularVelocity, Character.Body.OrientationMatrix.Up);
            //        Camera.Yaw(dot * dt);
            //    }
            //}

            Camera.Position = Entity.Position + Matrix3x3.Transform(CameraOffset, Entity.OrientationMatrix);

        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Symfony\Component\Finder\Tests\Shell;

use Symfony\Component\Finder\Shell\Command;

/**
 * @group legacy
 */
class CommandTest extends \PHPUnit_Framework_TestCase
{
    public function testCreate()
    {
        $this->assertInstanceOf('Symfony\Component\Finder\Shell\Command', Command::create());
    }

    public function testAdd()
    {
        $cmd = Command::create()->add('--force');
        $this->assertSame('--force', $cmd->join());
    }

    public function testAddAsFirst()
    {
        $cmd = Command::create()->add('--force');

        $cmd->addAtIndex(Command::create()->add('-F'), 0);
        $this->assertSame('-F --force', $cmd->join());
    }

    public function testAddAsLast()
    {
        $cmd = Command::create()->add('--force');

        $cmd->addAtIndex(Command::create()->add('-F'), 1);
        $this->assertSame('--force -F', $cmd->join());
    }

    public function testAddInBetween()
    {
        $cmd = Command::create()->add('--force');
        $cmd->addAtIndex(Command::create()->add('-F'), 0);

        $cmd->addAtIndex(Command::create()->add('-X'), 1);
        $this->assertSame('-F -X --force', $cmd->join());
    }

    public function testCount()
    {
        $cmd = Command::create();
        $this->assertSame(0, $cmd->length());

        $cmd->add('--force');
        $this->assertSame(1, $cmd->length());

        $cmd->add('--run');
        $this->assertSame(2, $cmd->length());
    }

    public function testTop()
    {
        $cmd = Command::create()->add('--force');

        $cmd->top('--run');
        $this->assertSame('--run --force', $cmd->join());
    }

    public function testTopLabeled()
    {
        $cmd = Command::create()->add('--force');

        $cmd->top('--run');
        $cmd->ins('--something');
        $cmd->top('--something');
        $this->assertSame('--something --run --force ', $cmd->join());
    }

    public function testArg()
    {
        $cmd = Command::create()->add('--force');

        $cmd->arg('--run');
        $this->assertSame('--force '.escapeshellarg('--run'), $cmd->join());
    }

    public function testCmd()
    {
        $cmd = Command::create()->add('--force');

        $cmd->cmd('run');
        $this->assertSame('--force run', $cmd->join());
    }

    public function testInsDuplicateLabelException()
    {
        $cmd = Command::create()->add('--force');

        $cmd->ins('label');
        $this->setExpectedException('RuntimeException');
        $cmd->ins('label');
    }

    public function testEnd()
    {
        $parent = Command::create();
        $cmd = Command::create($parent);

        $this->assertSame($parent, $cmd->end());
    }

    public function testEndNoParentException()
    {
        $cmd = Command::create();

        $this->setExpectedException('RuntimeException');
        $cmd->end();
    }

    public function testGetMissingLabelException()
    {
        $cmd = Command::create();

        $this->setExpectedException('RuntimeException');
        $cmd->get('invalid');
    }

    public function testErrorHandler()
    {
        $cmd = Command::create();
        $handler = function () { return 'error-handler'; };
        $cmd->setErrorHandler($handler);

        $this->assertSame($handler, $cmd->getErrorHandler());
    }

    public function testExecute()
    {
        $cmd = Command::create();
        $cmd->add('php');
        $cmd->add('--version');
        $result = $cmd->execute();

        $this->assertInternalType('array', $result);
        $this->assertNotEmpty($result);
        $this->assertRegexp('/PHP|HipHop/', $result[0]);
    }

    public function testCastToString()
    {
        $cmd = Command::create();
        $cmd->add('--force');
        $cmd->add('--run');

        $this->assertSame('--force --run', (string) $cmd);
    }
}


text:
<?php

/* TimerBundle:Timer:editTimer.html.twig */
class __TwigTemplate_589b5283afb8275aa49d694ade924c5b extends Twig_Template
{
    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo "

    ×

Modal header

<form id=\"edit-timer\" action=\"";
        // line 5
        if (isset($context["timer"])) { $_timer_ = $context["timer"]; } else { $_timer_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("kbiernat_timer_timer_edittimer", array("id" => $this->getAttribute($_timer_, "id"))), "html", null, true);
        echo "\" method=\"post\" ";
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderEnctype($_form_);
        echo " >

        ";
        // line 7
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($_form_, "start"));
        echo "
        ";
        // line 8
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($_form_, "start"));
        echo "
        ";
        // line 9
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($_form_, "start"));
        echo "
        ";
        // line 10
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($_form_, "stop"));
        echo "
        ";
        // line 11
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($_form_, "stop"));
        echo "
        ";
        // line 12
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($_form_, "stop"));
        echo "

        Close
        <input type=\"submit\" value=\"zapisz\" class=\"btn btn-primary\" />

</form>";
    }

    public function getTemplateName()
    {
        return "TimerBundle:Timer:editTimer.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>PathAttributesImplementation (xenon-2.3.0 2.6.1 API for Xenon developers)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

nl.esciencecenter.xenon.adaptors.filesystems

Class PathAttributesImplementation

java.lang.Object

nl.esciencecenter.xenon.adaptors.filesystems.PathAttributesImplementation

All Implemented Interfaces:

PathAttributes

public class PathAttributesImplementation
extends java.lang.Object
implements PathAttributes

FileAttributes represents a set of attributes of a path.

Field Summary

Fields

Modifier and Type
Field and Description

private long
creationTime

The creation time of this file

private boolean
executable

Is the file executable ?

private java.lang.String
group

The group of this file

private boolean
hidden

Is the file hidden ?

private boolean
isDirectory

Is this a directory ?

private boolean
isOther

Is this an other type of file ?

private boolean
isRegular

Is this a regular file ?

private boolean
isSymbolicLink

Is this a symbolic link ?

private long
lastAccessTime

The last access time of this file

private long
lastModifiedTime

The last modified time of this file

private java.lang.String
owner

The owner of this file

private Path
path

The path these attributes belong to

private java.util.Set<PosixFilePermission>
permissions

The permissions of this file (POSIX only)

private boolean
readable

Is the file readable ?

private long
size

The size of this file

private boolean
writable

Is the file writable ?

Constructor Summary

Constructors

Constructor and Description

PathAttributesImplementation()

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

boolean
equals(java.lang.Object o)

long
getCreationTime()

Get the creation time for this file.

java.lang.String
getGroup()

Get the group of this file.

long
getLastAccessTime()

Get the last access time for this file.

long
getLastModifiedTime()

Get the last modified time for this file.

java.lang.String
getOwner()

Get the owner of this file.

Path
getPath()

Get the path these attributes belong to.

java.util.Set<PosixFilePermission>
getPermissions()

Get the permissions of this file.

long
getSize()

Get the size of this file in bytes.

int
hashCode()

boolean
isDirectory()

Does the path refer to a directory ?

boolean
isExecutable()

Does the path refer to an executable file ?

boolean
isHidden()

Does the path refer to an hidden file ?

boolean
isOther()

Is the path not a file, link or directory ?

boolean
isReadable()

Does the path refer to an readable file ?

boolean
isRegular()

Does the path refer to a regular file ?

boolean
isSymbolicLink()

Does the path refer to a symbolic link ?

boolean
isWritable()

Does the path refer to a writable file ?

void
setCreationTime(long creationTime)

void
setDirectory(boolean isDirectory)

void
setExecutable(boolean executable)

void
setGroup(java.lang.String group)

void
setHidden(boolean hidden)

void
setLastAccessTime(long lastAccessTime)

void
setLastModifiedTime(long lastModifiedTime)

void
setOther(boolean isOther)

void
setOwner(java.lang.String owner)

void
setPath(Path path)

void
setPermissions(java.util.Set<PosixFilePermission> permissions)

void
setReadable(boolean readable)

void
setRegular(boolean isRegular)

void
setSize(long size)

void
setSymbolicLink(boolean isSymbolicLink)

void
setWritable(boolean writable)

java.lang.String
toString()

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

path

private Path path

The path these attributes belong to

isDirectory

private boolean isDirectory

Is this a directory ?

isRegular

private boolean isRegular

Is this a regular file ?

isSymbolicLink

private boolean isSymbolicLink

Is this a symbolic link ?

isOther

private boolean isOther

Is this an other type of file ?

executable

private boolean executable

Is the file executable ?

readable

private boolean readable

Is the file readable ?

writable

private boolean writable

Is the file writable ?

hidden

private boolean hidden

Is the file hidden ?

creationTime

private long creationTime

The creation time of this file

lastAccessTime

private long lastAccessTime

The last access time of this file

lastModifiedTime

private long lastModifiedTime

The last modified time of this file

size

private long size

The size of this file

owner

private java.lang.String owner

The owner of this file

group

private java.lang.String group

The group of this file

permissions

private java.util.Set<PosixFilePermission> permissions

The permissions of this file (POSIX only)

Constructor Detail

PathAttributesImplementation

public PathAttributesImplementation()

Method Detail

getPath

public Path getPath()

Get the path these attributes belong to.

Specified by:

getPath in interface PathAttributes

Returns:

the path these attributes belong to.

setPath

public void setPath(Path path)

isDirectory

public boolean isDirectory()

Does the path refer to a directory ?

Specified by:

isDirectory in interface PathAttributes

Returns:

if the path refers to a directory.

setDirectory

public void setDirectory(boolean isDirectory)

isRegular

public boolean isRegular()

Does the path refer to a regular file ?

Specified by:

isRegular in interface PathAttributes

Returns:

if the path refers to a regular file.

setRegular

public void setRegular(boolean isRegular)

isSymbolicLink

public boolean isSymbolicLink()

Does the path refer to a symbolic link ?

Specified by:

isSymbolicLink in interface PathAttributes

Returns:

if the path refers to a symbolic link.

setSymbolicLink

public void setSymbolicLink(boolean isSymbolicLink)

isOther

public boolean isOther()

Is the path not a file, link or directory ?

Specified by:

isOther in interface PathAttributes

Returns:

if the path does not refer to a file, link or directory.

setOther

public void setOther(boolean isOther)

isExecutable

public boolean isExecutable()

Does the path refer to an executable file ?

Specified by:

isExecutable in interface PathAttributes

Returns:

if the path refers an executable file ?

setExecutable

public void setExecutable(boolean executable)

isReadable

public boolean isReadable()

Does the path refer to an readable file ?

Specified by:

isReadable in interface PathAttributes

Returns:

if the path refers an readable file ?

setReadable

public void setReadable(boolean readable)

isWritable

public boolean isWritable()

Does the path refer to a writable file ?

Specified by:

isWritable in interface PathAttributes

Returns:

if the path refers a writable file ?

setWritable

public void setWritable(boolean writable)

isHidden

public boolean isHidden()

Does the path refer to an hidden file ?

Specified by:

isHidden in interface PathAttributes

Returns:

if the path refers an hidden file ?

setHidden

public void setHidden(boolean hidden)

getCreationTime

public long getCreationTime()

Get the creation time for this file.

 If creationTime is not supported by the adaptor, getLastModifiedTime() will be returned instead.

Specified by:

getCreationTime in interface PathAttributes

Returns:

the creation time for this file.

setCreationTime

public void setCreationTime(long creationTime)

getLastAccessTime

public long getLastAccessTime()

Get the last access time for this file.

 If lastAccessTime is not supported by the adaptor, use getLastModifiedTime() will be returned instead.

Specified by:

getLastAccessTime in interface PathAttributes

Returns:

the last access time for this file.

setLastAccessTime

public void setLastAccessTime(long lastAccessTime)

getLastModifiedTime

public long getLastModifiedTime()

Get the last modified time for this file.

 If lastModifiedTime is not supported by the adaptor, 0 will be returned instead.

Specified by:

getLastModifiedTime in interface PathAttributes

Returns:

the last modified time for this file.

setLastModifiedTime

public void setLastModifiedTime(long lastModifiedTime)

getSize

public long getSize()

Get the size of this file in bytes.

 If the file is not a regular file, 0 will be returned.

Specified by:

getSize in interface PathAttributes

Returns:

the size of this file.

setSize

public void setSize(long size)

getOwner

public java.lang.String getOwner()
                          throws AttributeNotSupportedException

Get the owner of this file.

Specified by:

getOwner in interface PathAttributes

Returns:

the owner of this file.

Throws:

AttributeNotSupportedException - If the attribute is not supported by the adaptor.

setOwner

public void setOwner(java.lang.String owner)

getGroup

public java.lang.String getGroup()
                          throws AttributeNotSupportedException

Get the group of this file.

Specified by:

getGroup in interface PathAttributes

Returns:

the group of this file.

Throws:

AttributeNotSupportedException - If the attribute is not supported by the adaptor.

setGroup

public void setGroup(java.lang.String group)

getPermissions

public java.util.Set<PosixFilePermission> getPermissions()
                                                  throws AttributeNotSupportedException

Get the permissions of this file.

Specified by:

getPermissions in interface PathAttributes

Returns:

the permissions of this file.

Throws:

AttributeNotSupportedException - If the attribute is not supported by the adaptor.

setPermissions

public void setPermissions(java.util.Set<PosixFilePermission> permissions)

equals

public boolean equals(java.lang.Object o)

Overrides:

equals in class java.lang.Object

toString

public java.lang.String toString()

Overrides:

toString in class java.lang.Object

hashCode

public int hashCode()

Overrides:

hashCode in class java.lang.Object

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
#pragma once
#include <aws/sagemaker/SageMaker_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/sagemaker/model/FinalAutoMLJobObjectiveMetric.h>
#include <aws/sagemaker/model/ObjectiveStatus.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/sagemaker/model/CandidateStatus.h>
#include <aws/core/utils/DateTime.h>
#include <aws/sagemaker/model/CandidateProperties.h>
#include <aws/sagemaker/model/AutoMLCandidateStep.h>
#include <aws/sagemaker/model/AutoMLContainerDefinition.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace SageMaker
{
namespace Model
{

  /**
   *
Information about a candidate produced by an AutoML training job, including
   * its status, steps, and other properties.

See Also:
   AWS
   * API Reference

   */
  class AWS_SAGEMAKER_API AutoMLCandidate
  {
  public:
    AutoMLCandidate();
    AutoMLCandidate(Aws::Utils::Json::JsonView jsonValue);
    AutoMLCandidate& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The name of the candidate.

     */
    inline const Aws::String& GetCandidateName() const{ return m_candidateName; }

    /**
     *
The name of the candidate.

     */
    inline bool CandidateNameHasBeenSet() const { return m_candidateNameHasBeenSet; }

    /**
     *
The name of the candidate.

     */
    inline void SetCandidateName(const Aws::String& value) { m_candidateNameHasBeenSet = true; m_candidateName = value; }

    /**
     *
The name of the candidate.

     */
    inline void SetCandidateName(Aws::String&& value) { m_candidateNameHasBeenSet = true; m_candidateName = std::move(value); }

    /**
     *
The name of the candidate.

     */
    inline void SetCandidateName(const char* value) { m_candidateNameHasBeenSet = true; m_candidateName.assign(value); }

    /**
     *
The name of the candidate.

     */
    inline AutoMLCandidate& WithCandidateName(const Aws::String& value) { SetCandidateName(value); return *this;}

    /**
     *
The name of the candidate.

     */
    inline AutoMLCandidate& WithCandidateName(Aws::String&& value) { SetCandidateName(std::move(value)); return *this;}

    /**
     *
The name of the candidate.

     */
    inline AutoMLCandidate& WithCandidateName(const char* value) { SetCandidateName(value); return *this;}

    inline const FinalAutoMLJobObjectiveMetric& GetFinalAutoMLJobObjectiveMetric() const{ return m_finalAutoMLJobObjectiveMetric; }

    inline bool FinalAutoMLJobObjectiveMetricHasBeenSet() const { return m_finalAutoMLJobObjectiveMetricHasBeenSet; }

    inline void SetFinalAutoMLJobObjectiveMetric(const FinalAutoMLJobObjectiveMetric& value) { m_finalAutoMLJobObjectiveMetricHasBeenSet = true; m_finalAutoMLJobObjectiveMetric = value; }

    inline void SetFinalAutoMLJobObjectiveMetric(FinalAutoMLJobObjectiveMetric&& value) { m_finalAutoMLJobObjectiveMetricHasBeenSet = true; m_finalAutoMLJobObjectiveMetric = std::move(value); }

    inline AutoMLCandidate& WithFinalAutoMLJobObjectiveMetric(const FinalAutoMLJobObjectiveMetric& value) { SetFinalAutoMLJobObjectiveMetric(value); return *this;}

    inline AutoMLCandidate& WithFinalAutoMLJobObjectiveMetric(FinalAutoMLJobObjectiveMetric&& value) { SetFinalAutoMLJobObjectiveMetric(std::move(value)); return *this;}

    /**
     *
The objective's status.

     */
    inline const ObjectiveStatus& GetObjectiveStatus() const{ return m_objectiveStatus; }

    /**
     *
The objective's status.

     */
    inline bool ObjectiveStatusHasBeenSet() const { return m_objectiveStatusHasBeenSet; }

    /**
     *
The objective's status.

     */
    inline void SetObjectiveStatus(const ObjectiveStatus& value) { m_objectiveStatusHasBeenSet = true; m_objectiveStatus = value; }

    /**
     *
The objective's status.

     */
    inline void SetObjectiveStatus(ObjectiveStatus&& value) { m_objectiveStatusHasBeenSet = true; m_objectiveStatus = std::move(value); }

    /**
     *
The objective's status.

     */
    inline AutoMLCandidate& WithObjectiveStatus(const ObjectiveStatus& value) { SetObjectiveStatus(value); return *this;}

    /**
     *
The objective's status.

     */
    inline AutoMLCandidate& WithObjectiveStatus(ObjectiveStatus&& value) { SetObjectiveStatus(std::move(value)); return *this;}

    /**
     *
Information about the candidate's steps.

     */
    inline const Aws::Vector<AutoMLCandidateStep>& GetCandidateSteps() const{ return m_candidateSteps; }

    /**
     *
Information about the candidate's steps.

     */
    inline bool CandidateStepsHasBeenSet() const { return m_candidateStepsHasBeenSet; }

    /**
     *
Information about the candidate's steps.

     */
    inline void SetCandidateSteps(const Aws::Vector<AutoMLCandidateStep>& value) { m_candidateStepsHasBeenSet = true; m_candidateSteps = value; }

    /**
     *
Information about the candidate's steps.

     */
    inline void SetCandidateSteps(Aws::Vector<AutoMLCandidateStep>&& value) { m_candidateStepsHasBeenSet = true; m_candidateSteps = std::move(value); }

    /**
     *
Information about the candidate's steps.

     */
    inline AutoMLCandidate& WithCandidateSteps(const Aws::Vector<AutoMLCandidateStep>& value) { SetCandidateSteps(value); return *this;}

    /**
     *
Information about the candidate's steps.

     */
    inline AutoMLCandidate& WithCandidateSteps(Aws::Vector<AutoMLCandidateStep>&& value) { SetCandidateSteps(std::move(value)); return *this;}

    /**
     *
Information about the candidate's steps.

     */
    inline AutoMLCandidate& AddCandidateSteps(const AutoMLCandidateStep& value) { m_candidateStepsHasBeenSet = true; m_candidateSteps.push_back(value); return *this; }

    /**
     *
Information about the candidate's steps.

     */
    inline AutoMLCandidate& AddCandidateSteps(AutoMLCandidateStep&& value) { m_candidateStepsHasBeenSet = true; m_candidateSteps.push_back(std::move(value)); return *this; }

    /**
     *
The candidate's status.

     */
    inline const CandidateStatus& GetCandidateStatus() const{ return m_candidateStatus; }

    /**
     *
The candidate's status.

     */
    inline bool CandidateStatusHasBeenSet() const { return m_candidateStatusHasBeenSet; }

    /**
     *
The candidate's status.

     */
    inline void SetCandidateStatus(const CandidateStatus& value) { m_candidateStatusHasBeenSet = true; m_candidateStatus = value; }

    /**
     *
The candidate's status.

     */
    inline void SetCandidateStatus(CandidateStatus&& value) { m_candidateStatusHasBeenSet = true; m_candidateStatus = std::move(value); }

    /**
     *
The candidate's status.

     */
    inline AutoMLCandidate& WithCandidateStatus(const CandidateStatus& value) { SetCandidateStatus(value); return *this;}

    /**
     *
The candidate's status.

     */
    inline AutoMLCandidate& WithCandidateStatus(CandidateStatus&& value) { SetCandidateStatus(std::move(value)); return *this;}

    /**
     *
Information about the inference container definitions.

     */
    inline const Aws::Vector<AutoMLContainerDefinition>& GetInferenceContainers() const{ return m_inferenceContainers; }

    /**
     *
Information about the inference container definitions.

     */
    inline bool InferenceContainersHasBeenSet() const { return m_inferenceContainersHasBeenSet; }

    /**
     *
Information about the inference container definitions.

     */
    inline void SetInferenceContainers(const Aws::Vector<AutoMLContainerDefinition>& value) { m_inferenceContainersHasBeenSet = true; m_inferenceContainers = value; }

    /**
     *
Information about the inference container definitions.

     */
    inline void SetInferenceContainers(Aws::Vector<AutoMLContainerDefinition>&& value) { m_inferenceContainersHasBeenSet = true; m_inferenceContainers = std::move(value); }

    /**
     *
Information about the inference container definitions.

     */
    inline AutoMLCandidate& WithInferenceContainers(const Aws::Vector<AutoMLContainerDefinition>& value) { SetInferenceContainers(value); return *this;}

    /**
     *
Information about the inference container definitions.

     */
    inline AutoMLCandidate& WithInferenceContainers(Aws::Vector<AutoMLContainerDefinition>&& value) { SetInferenceContainers(std::move(value)); return *this;}

    /**
     *
Information about the inference container definitions.

     */
    inline AutoMLCandidate& AddInferenceContainers(const AutoMLContainerDefinition& value) { m_inferenceContainersHasBeenSet = true; m_inferenceContainers.push_back(value); return *this; }

    /**
     *
Information about the inference container definitions.

     */
    inline AutoMLCandidate& AddInferenceContainers(AutoMLContainerDefinition&& value) { m_inferenceContainersHasBeenSet = true; m_inferenceContainers.push_back(std::move(value)); return *this; }

    /**
     *
The creation time.

     */
    inline const Aws::Utils::DateTime& GetCreationTime() const{ return m_creationTime; }

    /**
     *
The creation time.

     */
    inline bool CreationTimeHasBeenSet() const { return m_creationTimeHasBeenSet; }

    /**
     *
The creation time.

     */
    inline void SetCreationTime(const Aws::Utils::DateTime& value) { m_creationTimeHasBeenSet = true; m_creationTime = value; }

    /**
     *
The creation time.

     */
    inline void SetCreationTime(Aws::Utils::DateTime&& value) { m_creationTimeHasBeenSet = true; m_creationTime = std::move(value); }

    /**
     *
The creation time.

     */
    inline AutoMLCandidate& WithCreationTime(const Aws::Utils::DateTime& value) { SetCreationTime(value); return *this;}

    /**
     *
The creation time.

     */
    inline AutoMLCandidate& WithCreationTime(Aws::Utils::DateTime&& value) { SetCreationTime(std::move(value)); return *this;}

    /**
     *
The end time.

     */
    inline const Aws::Utils::DateTime& GetEndTime() const{ return m_endTime; }

    /**
     *
The end time.

     */
    inline bool EndTimeHasBeenSet() const { return m_endTimeHasBeenSet; }

    /**
     *
The end time.

     */
    inline void SetEndTime(const Aws::Utils::DateTime& value) { m_endTimeHasBeenSet = true; m_endTime = value; }

    /**
     *
The end time.

     */
    inline void SetEndTime(Aws::Utils::DateTime&& value) { m_endTimeHasBeenSet = true; m_endTime = std::move(value); }

    /**
     *
The end time.

     */
    inline AutoMLCandidate& WithEndTime(const Aws::Utils::DateTime& value) { SetEndTime(value); return *this;}

    /**
     *
The end time.

     */
    inline AutoMLCandidate& WithEndTime(Aws::Utils::DateTime&& value) { SetEndTime(std::move(value)); return *this;}

    /**
     *
The last modified time.

     */
    inline const Aws::Utils::DateTime& GetLastModifiedTime() const{ return m_lastModifiedTime; }

    /**
     *
The last modified time.

     */
    inline bool LastModifiedTimeHasBeenSet() const { return m_lastModifiedTimeHasBeenSet; }

    /**
     *
The last modified time.

     */
    inline void SetLastModifiedTime(const Aws::Utils::DateTime& value) { m_lastModifiedTimeHasBeenSet = true; m_lastModifiedTime = value; }

    /**
     *
The last modified time.

     */
    inline void SetLastModifiedTime(Aws::Utils::DateTime&& value) { m_lastModifiedTimeHasBeenSet = true; m_lastModifiedTime = std::move(value); }

    /**
     *
The last modified time.

     */
    inline AutoMLCandidate& WithLastModifiedTime(const Aws::Utils::DateTime& value) { SetLastModifiedTime(value); return *this;}

    /**
     *
The last modified time.

     */
    inline AutoMLCandidate& WithLastModifiedTime(Aws::Utils::DateTime&& value) { SetLastModifiedTime(std::move(value)); return *this;}

    /**
     *
The failure reason.

     */
    inline const Aws::String& GetFailureReason() const{ return m_failureReason; }

    /**
     *
The failure reason.

     */
    inline bool FailureReasonHasBeenSet() const { return m_failureReasonHasBeenSet; }

    /**
     *
The failure reason.

     */
    inline void SetFailureReason(const Aws::String& value) { m_failureReasonHasBeenSet = true; m_failureReason = value; }

    /**
     *
The failure reason.

     */
    inline void SetFailureReason(Aws::String&& value) { m_failureReasonHasBeenSet = true; m_failureReason = std::move(value); }

    /**
     *
The failure reason.

     */
    inline void SetFailureReason(const char* value) { m_failureReasonHasBeenSet = true; m_failureReason.assign(value); }

    /**
     *
The failure reason.

     */
    inline AutoMLCandidate& WithFailureReason(const Aws::String& value) { SetFailureReason(value); return *this;}

    /**
     *
The failure reason.

     */
    inline AutoMLCandidate& WithFailureReason(Aws::String&& value) { SetFailureReason(std::move(value)); return *this;}

    /**
     *
The failure reason.

     */
    inline AutoMLCandidate& WithFailureReason(const char* value) { SetFailureReason(value); return *this;}

    /**
     *
The properties of an AutoML candidate job.

     */
    inline const CandidateProperties& GetCandidateProperties() const{ return m_candidateProperties; }

    /**
     *
The properties of an AutoML candidate job.

     */
    inline bool CandidatePropertiesHasBeenSet() const { return m_candidatePropertiesHasBeenSet; }

    /**
     *
The properties of an AutoML candidate job.

     */
    inline void SetCandidateProperties(const CandidateProperties& value) { m_candidatePropertiesHasBeenSet = true; m_candidateProperties = value; }

    /**
     *
The properties of an AutoML candidate job.

     */
    inline void SetCandidateProperties(CandidateProperties&& value) { m_candidatePropertiesHasBeenSet = true; m_candidateProperties = std::move(value); }

    /**
     *
The properties of an AutoML candidate job.

     */
    inline AutoMLCandidate& WithCandidateProperties(const CandidateProperties& value) { SetCandidateProperties(value); return *this;}

    /**
     *
The properties of an AutoML candidate job.

     */
    inline AutoMLCandidate& WithCandidateProperties(CandidateProperties&& value) { SetCandidateProperties(std::move(value)); return *this;}

  private:

    Aws::String m_candidateName;
    bool m_candidateNameHasBeenSet = false;

    FinalAutoMLJobObjectiveMetric m_finalAutoMLJobObjectiveMetric;
    bool m_finalAutoMLJobObjectiveMetricHasBeenSet = false;

    ObjectiveStatus m_objectiveStatus;
    bool m_objectiveStatusHasBeenSet = false;

    Aws::Vector<AutoMLCandidateStep> m_candidateSteps;
    bool m_candidateStepsHasBeenSet = false;

    CandidateStatus m_candidateStatus;
    bool m_candidateStatusHasBeenSet = false;

    Aws::Vector<AutoMLContainerDefinition> m_inferenceContainers;
    bool m_inferenceContainersHasBeenSet = false;

    Aws::Utils::DateTime m_creationTime;
    bool m_creationTimeHasBeenSet = false;

    Aws::Utils::DateTime m_endTime;
    bool m_endTimeHasBeenSet = false;

    Aws::Utils::DateTime m_lastModifiedTime;
    bool m_lastModifiedTimeHasBeenSet = false;

    Aws::String m_failureReason;
    bool m_failureReasonHasBeenSet = false;

    CandidateProperties m_candidateProperties;
    bool m_candidatePropertiesHasBeenSet = false;
  };

} // namespace Model
} // namespace SageMaker
} // namespace Aws


text:
/*
	JS code to include the navigation bar
*/
	$("nav").load("/js/navigation.html");


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Derby.Models
{
    public class Contestant
    {
        public int Id { get; set; }
        public int RacerId { get; set; }
        public int HeatId { get; set; }
        public int Place { get; set; }
        public int Lane { get; set; }
    }
}


text:
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Urho.Urho2D;
using Urho.Gui;
using Urho.Resources;
using Urho.IO;
using Urho.Navigation;
using Urho.Network;

namespace Urho.IO
{
	/// <summary>
	/// Stores files of a directory tree sequentially for convenient access.
	/// </summary>
	public unsafe partial class PackageFile : UrhoObject
	{
		unsafe partial void OnPackageFileCreated ();

		[Preserve]
		public PackageFile (IntPtr handle) : base (handle)
		{
			OnPackageFileCreated ();
		}

		[Preserve]
		protected PackageFile (UrhoObjectFlag emptyFlag) : base (emptyFlag)
		{
			OnPackageFileCreated ();
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern int PackageFile_GetType (IntPtr handle);

		private StringHash UrhoGetType ()
		{
			Runtime.ValidateRefCounted (this);
			return new StringHash (PackageFile_GetType (handle));
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern IntPtr PackageFile_GetTypeName (IntPtr handle);

		private string GetTypeName ()
		{
			Runtime.ValidateRefCounted (this);
			return Marshal.PtrToStringAnsi (PackageFile_GetTypeName (handle));
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern int PackageFile_GetTypeStatic ();

		private static StringHash GetTypeStatic ()
		{
			Runtime.Validate (typeof(PackageFile));
			return new StringHash (PackageFile_GetTypeStatic ());
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern IntPtr PackageFile_GetTypeNameStatic ();

		private static string GetTypeNameStatic ()
		{
			Runtime.Validate (typeof(PackageFile));
			return Marshal.PtrToStringAnsi (PackageFile_GetTypeNameStatic ());
		}

		[Preserve]
		public PackageFile () : this (Application.CurrentContext)
		{
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern IntPtr PackageFile_PackageFile (IntPtr context);

		[Preserve]
		public PackageFile (Context context) : base (UrhoObjectFlag.Empty)
		{
			Runtime.Validate (typeof(PackageFile));
			handle = PackageFile_PackageFile ((object)context == null ? IntPtr.Zero : context.Handle);
			Runtime.RegisterObject (this);
			OnPackageFileCreated ();
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern IntPtr PackageFile_PackageFile0 (IntPtr context, string fileName, uint startOffset);

		[Preserve]
		public PackageFile (Context context, string fileName, uint startOffset) : base (UrhoObjectFlag.Empty)
		{
			Runtime.Validate (typeof(PackageFile));
			handle = PackageFile_PackageFile0 ((object)context == null ? IntPtr.Zero : context.Handle, fileName, startOffset);
			Runtime.RegisterObject (this);
			OnPackageFileCreated ();
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern bool PackageFile_Open (IntPtr handle, string fileName, uint startOffset);

		/// <summary>
		/// Open the package file. Return true if successful.
		/// </summary>
		public bool Open (string fileName, uint startOffset)
		{
			Runtime.ValidateRefCounted (this);
			return PackageFile_Open (handle, fileName, startOffset);
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern bool PackageFile_Exists (IntPtr handle, string fileName);

		/// <summary>
		/// Check if a file exists within the package file. This will be case-insensitive on Windows and case-sensitive on other platforms.
		/// </summary>
		public bool Exists (string fileName)
		{
			Runtime.ValidateRefCounted (this);
			return PackageFile_Exists (handle, fileName);
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern PackageEntry* PackageFile_GetEntry (IntPtr handle, string fileName);

		/// <summary>
		/// Return the file entry corresponding to the name, or null if not found. This will be case-insensitive on Windows and case-sensitive on other platforms.
		/// </summary>
		public PackageEntry* GetEntry (string fileName)
		{
			Runtime.ValidateRefCounted (this);
			return PackageFile_GetEntry (handle, fileName);
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern IntPtr PackageFile_GetName (IntPtr handle);

		/// <summary>
		/// Return the package file name.
		/// </summary>
		private string GetName ()
		{
			Runtime.ValidateRefCounted (this);
			return Marshal.PtrToStringAnsi (PackageFile_GetName (handle));
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern int PackageFile_GetNameHash (IntPtr handle);

		/// <summary>
		/// Return hash of the package file name.
		/// </summary>
		private StringHash GetNameHash ()
		{
			Runtime.ValidateRefCounted (this);
			return new StringHash (PackageFile_GetNameHash (handle));
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern uint PackageFile_GetNumFiles (IntPtr handle);

		/// <summary>
		/// Return number of files.
		/// </summary>
		private uint GetNumFiles ()
		{
			Runtime.ValidateRefCounted (this);
			return PackageFile_GetNumFiles (handle);
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern uint PackageFile_GetTotalSize (IntPtr handle);

		/// <summary>
		/// Return total size of the package file.
		/// </summary>
		private uint GetTotalSize ()
		{
			Runtime.ValidateRefCounted (this);
			return PackageFile_GetTotalSize (handle);
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern uint PackageFile_GetTotalDataSize (IntPtr handle);

		/// <summary>
		/// Return total data size from all the file entries in the package file.
		/// </summary>
		private uint GetTotalDataSize ()
		{
			Runtime.ValidateRefCounted (this);
			return PackageFile_GetTotalDataSize (handle);
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern uint PackageFile_GetChecksum (IntPtr handle);

		/// <summary>
		/// Return checksum of the package file contents.
		/// </summary>
		private uint GetChecksum ()
		{
			Runtime.ValidateRefCounted (this);
			return PackageFile_GetChecksum (handle);
		}

		[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
		internal static extern bool PackageFile_IsCompressed (IntPtr handle);

		/// <summary>
		/// Return whether the files are compressed.
		/// </summary>
		private bool IsCompressed ()
		{
			Runtime.ValidateRefCounted (this);
			return PackageFile_IsCompressed (handle);
		}

		public override StringHash Type {
			get {
				return UrhoGetType ();
			}
		}

		public override string TypeName {
			get {
				return GetTypeName ();
			}
		}

		[Preserve]
		public static StringHash TypeStatic {
			get {
				return GetTypeStatic ();
			}
		}

		public static string TypeNameStatic {
			get {
				return GetTypeNameStatic ();
			}
		}

		/// <summary>
		/// Return the package file name.
		/// </summary>
		public string Name {
			get {
				return GetName ();
			}
		}

		/// <summary>
		/// Return hash of the package file name.
		/// </summary>
		public StringHash NameHash {
			get {
				return GetNameHash ();
			}
		}

		/// <summary>
		/// Return number of files.
		/// </summary>
		public uint NumFiles {
			get {
				return GetNumFiles ();
			}
		}

		/// <summary>
		/// Return total size of the package file.
		/// </summary>
		public uint TotalSize {
			get {
				return GetTotalSize ();
			}
		}

		/// <summary>
		/// Return total data size from all the file entries in the package file.
		/// </summary>
		public uint TotalDataSize {
			get {
				return GetTotalDataSize ();
			}
		}

		/// <summary>
		/// Return checksum of the package file contents.
		/// </summary>
		public uint Checksum {
			get {
				return GetChecksum ();
			}
		}

		/// <summary>
		/// Return whether the files are compressed.
		/// </summary>
		public bool Compressed {
			get {
				return IsCompressed ();
			}
		}
	}
}


text:
namespace ClojSharp.Core.Forms
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using ClojSharp.Core.Language;

    public class BlankP : BaseUnaryForm
    {
        public override object EvaluateForm(IContext context, IList<object> arguments)
        {
            var arg = arguments[0];

            if (arg == null)
                return true;

            if (arg is string)
                return string.IsNullOrWhiteSpace((string)arg);

            return false;
        }
    }
}


text:
package org.apache.hc.core5.http2.impl.nio;

import java.io.IOException;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ByteChannel;
import java.nio.channels.SelectionKey;

import javax.net.ssl.SSLSession;

import org.apache.hc.core5.annotation.Internal;
import org.apache.hc.core5.http.ConnectionClosedException;
import org.apache.hc.core5.http.EndpointDetails;
import org.apache.hc.core5.http.ProtocolVersion;
import org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler;
import org.apache.hc.core5.http.impl.nio.ClientHttp1StreamDuplexer;
import org.apache.hc.core5.http.impl.nio.ClientHttp1StreamDuplexerFactory;
import org.apache.hc.core5.http.impl.nio.HttpConnectionEventHandler;
import org.apache.hc.core5.http.nio.AsyncClientExchangeHandler;
import org.apache.hc.core5.http.nio.command.RequestExecutionCommand;
import org.apache.hc.core5.http2.HttpVersionPolicy;
import org.apache.hc.core5.http2.ssl.ApplicationProtocols;
import org.apache.hc.core5.io.CloseMode;
import org.apache.hc.core5.io.SocketTimeoutExceptionFactory;
import org.apache.hc.core5.reactor.Command;
import org.apache.hc.core5.reactor.IOEventHandler;
import org.apache.hc.core5.reactor.IOSession;
import org.apache.hc.core5.reactor.ProtocolIOSession;
import org.apache.hc.core5.reactor.ssl.TlsDetails;
import org.apache.hc.core5.util.Args;
import org.apache.hc.core5.util.Timeout;

/**
 * I/O event handler for events fired by {@link ProtocolIOSession} that implements
 * client side of the HTTP/2 protocol negotiation handshake
 * based on {@link HttpVersionPolicy} configuration.
 *
 * @since 5.0
 */
@Internal
public class ClientHttpProtocolNegotiator implements HttpConnectionEventHandler {

    // PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n
    final static byte[] PREFACE = new byte[] {
            0x50, 0x52, 0x49, 0x20, 0x2a, 0x20, 0x48, 0x54, 0x54, 0x50,
            0x2f, 0x32, 0x2e, 0x30, 0x0d, 0x0a, 0x0d, 0x0a, 0x53, 0x4d,
            0x0d, 0x0a, 0x0d, 0x0a};

    private final ProtocolIOSession ioSession;
    private final ClientHttp1StreamDuplexerFactory http1StreamHandlerFactory;
    private final ClientHttp2StreamMultiplexerFactory http2StreamHandlerFactory;
    private final HttpVersionPolicy versionPolicy;

    private volatile ByteBuffer preface;

    public ClientHttpProtocolNegotiator(
            final ProtocolIOSession ioSession,
            final ClientHttp1StreamDuplexerFactory http1StreamHandlerFactory,
            final ClientHttp2StreamMultiplexerFactory http2StreamHandlerFactory,
            final HttpVersionPolicy versionPolicy) {
        this.ioSession = Args.notNull(ioSession, "I/O session");
        this.http1StreamHandlerFactory = Args.notNull(http1StreamHandlerFactory, "HTTP/1.1 stream handler factory");
        this.http2StreamHandlerFactory = Args.notNull(http2StreamHandlerFactory, "HTTP/2 stream handler factory");
        this.versionPolicy = versionPolicy != null ? versionPolicy : HttpVersionPolicy.NEGOTIATE;
    }

    private void startHttp1(final IOSession session) {
        final ClientHttp1StreamDuplexer http1StreamHandler = http1StreamHandlerFactory.create(ioSession);
        final ClientHttp1IOEventHandler newHandler = new ClientHttp1IOEventHandler(http1StreamHandler);
        try {
            ioSession.upgrade(newHandler);
            newHandler.connected(session);
        } catch (final Exception ex) {
            newHandler.exception(session, ex);
            session.close(CloseMode.IMMEDIATE);
        }
    }

    private void startHttp2(final IOSession session) {
        final ClientHttp2StreamMultiplexer streamMultiplexer = http2StreamHandlerFactory.create(ioSession);
        final IOEventHandler newHandler = new ClientHttp2IOEventHandler(streamMultiplexer);
        try {
            ioSession.upgrade(newHandler);
            newHandler.connected(session);
        } catch (final Exception ex) {
            newHandler.exception(session, ex);
            session.close(CloseMode.IMMEDIATE);
        }
    }

    private void writeOutPreface(final IOSession session) throws IOException {
        if (preface.hasRemaining()) {
            final ByteChannel channel = session.channel();
            channel.write(preface);
        }
        if (!preface.hasRemaining()) {
            session.clearEvent(SelectionKey.OP_WRITE);
            startHttp2(session);
        } else {
            session.setEvent(SelectionKey.OP_WRITE);
        }
    }

    @Override
    public void connected(final IOSession session) throws IOException {
        switch (versionPolicy) {
            case NEGOTIATE:
                final TlsDetails tlsDetails = ioSession.getTlsDetails();
                if (tlsDetails != null) {
                    if (ApplicationProtocols.HTTP_2.id.equals(tlsDetails.getApplicationProtocol())) {
                        // Proceed with the H2 preface
                        preface = ByteBuffer.wrap(PREFACE);
                    }
                }
                break;
            case FORCE_HTTP_2:
                preface = ByteBuffer.wrap(PREFACE);
                break;
        }
        if (preface == null) {
            startHttp1(session);
        } else {
            writeOutPreface(session);
        }
    }

    @Override
    public void inputReady(final IOSession session) throws IOException  {
        outputReady(session);
    }

    @Override
    public void outputReady(final IOSession session) throws IOException {
        if (preface != null) {
            writeOutPreface(session);
        } else {
            session.close(CloseMode.GRACEFUL);
        }
    }

    @Override
    public void timeout(final IOSession session, final Timeout timeout) {
        exception(session, SocketTimeoutExceptionFactory.create(timeout));
    }

    @Override
    public void exception(final IOSession session, final Exception cause) {
        try {
            for (;;) {
                final Command command = ioSession.poll();
                if (command != null) {
                    if (command instanceof RequestExecutionCommand) {
                        final RequestExecutionCommand executionCommand = (RequestExecutionCommand) command;
                        final AsyncClientExchangeHandler exchangeHandler = executionCommand.getExchangeHandler();
                        exchangeHandler.failed(cause);
                        exchangeHandler.releaseResources();
                    } else {
                        command.cancel();
                    }
                } else {
                    break;
                }
            }
        } finally {
            session.close(CloseMode.IMMEDIATE);
        }
    }

    @Override
    public void disconnected(final IOSession session) {
        for (;;) {
            final Command command = ioSession.poll();
            if (command != null) {
                if (command instanceof RequestExecutionCommand) {
                    final RequestExecutionCommand executionCommand = (RequestExecutionCommand) command;
                    final AsyncClientExchangeHandler exchangeHandler = executionCommand.getExchangeHandler();
                    exchangeHandler.failed(new ConnectionClosedException());
                    exchangeHandler.releaseResources();
                } else {
                    command.cancel();
                }
            } else {
                break;
            }
        }
    }

    @Override
    public SSLSession getSSLSession() {
        final TlsDetails tlsDetails = ioSession.getTlsDetails();
        return tlsDetails != null ? tlsDetails.getSSLSession() : null;
    }

    @Override
    public EndpointDetails getEndpointDetails() {
        return null;
    }

    @Override
    public void setSocketTimeout(final Timeout timeout) {
        ioSession.setSocketTimeout(timeout);
    }

    @Override
    public Timeout getSocketTimeout() {
        return ioSession.getSocketTimeout();
    }

    @Override
    public ProtocolVersion getProtocolVersion() {
        return null;
    }

    @Override
    public SocketAddress getRemoteAddress() {
        return ioSession.getRemoteAddress();
    }

    @Override
    public SocketAddress getLocalAddress() {
        return ioSession.getLocalAddress();
    }

    @Override
    public boolean isOpen() {
        return !ioSession.isClosed();
    }

    @Override
    public void close() throws IOException {
        ioSession.close();
    }

    @Override
    public void close(final CloseMode closeMode) {
        ioSession.close(closeMode);
    }

    @Override
    public String toString() {
        return "[" +
                "versionPolicy=" + versionPolicy +
                ']';
    }

}


text:
/**
@file Actor.cpp

Contiene la implementación de la encapsulación del actor estático de física

@see Physics::CStaticActor

@author Alberto Martínez Villarán
@date Enero, 2015
*/

#include "StaticPlane.h"
#include "Server.h"
#include "Conversions.h"

#include <PxPhysicsAPI.h>

using namespace physx;

using namespace Logic;

namespace Physics
{
	CStaticPlane::CStaticPlane(const Vector3 &point, const Vector3 &normal, int group, const IPhysics *component, PxMaterial *material)
	{
		_scene = Physics::CScene::getSingletonPtr()->getScene();

		_dynamic = false;
		// Crear un plano estático
		PxPlane plane(Vector3ToPxVec3(point), Vector3ToPxVec3(normal));
		PxRigidStatic *actor = PxCreatePlane(*_server->getSdk(), plane, *material);
		// Anotar el componente lógico asociado a la entidad física
		_actor->userData = (void *) component;

		//Indicamos al actor con quien debe colisionar
		_server->setupFiltering(_actor, CollisionGroup(group));

		// Añadir el actor a la escena
		_scene->addActor(*actor);
	}
}


text:
module Pohoda
  module Parsers
    module Lst
      class ListVoucherType < Rdc::ListVersionType
        include ParserCore::BaseParser

        def voucher
          array_of_at(Vch::VoucherType, ['lst:voucher'])
        end

        def to_h
          hash = {}
          hash[:attributes] = attributes

          hash[:voucher] = voucher.map(&:to_h) if has? 'lst:voucher'

          hash
          super.merge(hash)
        end
      end
    end
  end
end


text:
package com.itelg.zkoss.helper.listbox;

import java.util.Comparator;
import java.util.List;

import org.zkoss.zk.ui.Component;
import org.zkoss.zul.ListModel;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listheader;
import org.zkoss.zul.ext.Sortable;

public class ListboxSortingHelper
{
    public static void resortListbox(Listbox listbox)
    {
        ListModel<Object> model = listbox.getModel();

        if (Sortable.class.isAssignableFrom(model.getClass()))
        {
            Sorting sorting = getSorting(listbox);

            if (sorting != null)
            {
                @SuppressWarnings("unchecked")
                Sortable<Object> sortable = (Sortable<Object>) model;
                sortable.sort(sorting.getComparator(), sorting.isAscending());
            }
        }
    }

    @SuppressWarnings("unchecked")
    private static Sorting getSorting(Listbox listbox)
    {
        List<Component> components = listbox.getListhead().getChildren();

        for (Component component : components)
        {
            if (Listheader.class.isAssignableFrom(component.getClass()))
            {
                Listheader listheader = (Listheader) component;
                String sortDirection = listheader.getSortDirection();

                if ("ascending".equals(sortDirection))
                {
                    return new Sorting(listheader.getSortAscending(), true);
                }
                else if ("descending".equals(sortDirection))
                {
                    return new Sorting(listheader.getSortDescending(), false);
                }
            }
        }

        return null;
    }

    private static class Sorting
    {
        private Comparator<Object> comparator;
        private boolean ascending;

        public Sorting(Comparator<Object> comparator, boolean ascending)
        {
            this.comparator = comparator;
            this.ascending = ascending;
        }

        public Comparator<Object> getComparator()
        {
            return comparator;
        }

        public boolean isAscending()
        {
            return ascending;
        }
    }
}


text:
package aggregated_logging

import (
	"errors"
	"fmt"
	"net/url"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/labels"
	kapi "k8s.io/kubernetes/pkg/api"
	kapisext "k8s.io/kubernetes/pkg/apis/extensions"
	kclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"

	authapi "github.com/openshift/origin/pkg/authorization/api"
	"github.com/openshift/origin/pkg/client"
	configapi "github.com/openshift/origin/pkg/cmd/server/api"
	deployapi "github.com/openshift/origin/pkg/deploy/api"
	hostdiag "github.com/openshift/origin/pkg/diagnostics/host"
	"github.com/openshift/origin/pkg/diagnostics/types"
	routesapi "github.com/openshift/origin/pkg/route/api"
)

// AggregatedLogging is a Diagnostic to check the configurations
// and general integration of the OpenShift stack
// for aggregating container logs
// https://github.com/openshift/origin-aggregated-logging
type AggregatedLogging struct {
	masterConfig     *configapi.MasterConfig
	MasterConfigFile string
	OsClient         *client.Client
	KubeClient       kclientset.Interface
	result           types.DiagnosticResult
}

const (
	AggregatedLoggingName = "AggregatedLogging"

	loggingInfraKey = "logging-infra"
	componentKey    = "component"
	providerKey     = "provider"
	openshiftValue  = "openshift"

	fluentdServiceAccountName = "aggregated-logging-fluentd"
)

var loggingSelector = labels.Set{loggingInfraKey: "support"}

//NewAggregatedLogging returns the AggregatedLogging Diagnostic
func NewAggregatedLogging(masterConfigFile string, kclient kclientset.Interface, osclient *client.Client) *AggregatedLogging {
	return &AggregatedLogging{nil, masterConfigFile, osclient, kclient, types.NewDiagnosticResult(AggregatedLoggingName)}
}

func (d *AggregatedLogging) getScc(name string) (*kapi.SecurityContextConstraints, error) {
	return d.KubeClient.Core().SecurityContextConstraints().Get(name, metav1.GetOptions{})
}

func (d *AggregatedLogging) getClusterRoleBinding(name string) (*authapi.ClusterRoleBinding, error) {
	return d.OsClient.ClusterRoleBindings().Get(name, metav1.GetOptions{})
}

func (d *AggregatedLogging) routes(project string, options metav1.ListOptions) (*routesapi.RouteList, error) {
	return d.OsClient.Routes(project).List(options)
}

func (d *AggregatedLogging) serviceAccounts(project string, options metav1.ListOptions) (*kapi.ServiceAccountList, error) {
	return d.KubeClient.Core().ServiceAccounts(project).List(options)
}

func (d *AggregatedLogging) services(project string, options metav1.ListOptions) (*kapi.ServiceList, error) {
	return d.KubeClient.Core().Services(project).List(options)
}

func (d *AggregatedLogging) endpointsForService(project string, service string) (*kapi.Endpoints, error) {
	return d.KubeClient.Core().Endpoints(project).Get(service, metav1.GetOptions{})
}

func (d *AggregatedLogging) daemonsets(project string, options metav1.ListOptions) (*kapisext.DaemonSetList, error) {
	return d.KubeClient.Extensions().DaemonSets(project).List(metav1.ListOptions{LabelSelector: loggingInfraFluentdSelector.AsSelector().String()})
}

func (d *AggregatedLogging) nodes(options metav1.ListOptions) (*kapi.NodeList, error) {
	return d.KubeClient.Core().Nodes().List(metav1.ListOptions{})
}

func (d *AggregatedLogging) pods(project string, options metav1.ListOptions) (*kapi.PodList, error) {
	return d.KubeClient.Core().Pods(project).List(options)
}
func (d *AggregatedLogging) deploymentconfigs(project string, options metav1.ListOptions) (*deployapi.DeploymentConfigList, error) {
	return d.OsClient.DeploymentConfigs(project).List(options)
}

func (d *AggregatedLogging) Info(id string, message string) {
	d.result.Info(id, message)
}

func (d *AggregatedLogging) Error(id string, err error, message string) {
	d.result.Error(id, err, message)
}

func (d *AggregatedLogging) Debug(id string, message string) {
	d.result.Debug(id, message)
}

func (d *AggregatedLogging) Warn(id string, err error, message string) {
	d.result.Warn(id, err, message)
}

func (d *AggregatedLogging) Name() string {
	return AggregatedLoggingName
}

func (d *AggregatedLogging) Description() string {
	return "Check aggregated logging integration for proper configuration"
}

func (d *AggregatedLogging) CanRun() (bool, error) {
	if len(d.MasterConfigFile) == 0 {
		return false, errors.New("No master config file was provided")
	}
	if d.OsClient == nil {
		return false, errors.New("Config must include a cluster-admin context to run this diagnostic")
	}
	if d.KubeClient == nil {
		return false, errors.New("Config must include a cluster-admin context to run this diagnostic")
	}
	var err error
	d.masterConfig, err = hostdiag.GetMasterConfig(d.result, d.MasterConfigFile)
	if err != nil {
		return false, errors.New("Master configuration is unreadable")
	}
	if d.masterConfig.AssetConfig.LoggingPublicURL == "" {
		return false, errors.New("No LoggingPublicURL is defined in the master configuration")
	}
	return true, nil
}

func (d *AggregatedLogging) Check() types.DiagnosticResult {
	project := retrieveLoggingProject(d.result, d.masterConfig, d.OsClient)
	if len(project) != 0 {
		checkServiceAccounts(d, d, project)
		checkClusterRoleBindings(d, d, project)
		checkSccs(d, d, project)
		checkDeploymentConfigs(d, d, project)
		checkDaemonSets(d, d, project)
		checkServices(d, d, project)
		checkRoutes(d, d, project)
		checkKibana(d.result, d.OsClient, d.KubeClient, project)
	}
	return d.result
}

const projectNodeSelectorWarning = `
The project '%[1]s' was found with either a missing or non-empty node selector annotation.
This could keep Fluentd from running on certain nodes and collecting logs from the entire cluster.
You can correct it by editing the project:

  $ oc edit namespace %[1]s

and updating the annotation:

  'openshift.io/node-selector' : ""

`

func retrieveLoggingProject(r types.DiagnosticResult, masterCfg *configapi.MasterConfig, osClient *client.Client) string {
	r.Debug("AGL0010", fmt.Sprintf("masterConfig.AssetConfig.LoggingPublicURL: '%s'", masterCfg.AssetConfig.LoggingPublicURL))
	projectName := ""
	if len(masterCfg.AssetConfig.LoggingPublicURL) == 0 {
		r.Debug("AGL0017", "masterConfig.AssetConfig.LoggingPublicURL is empty")
		return projectName
	}

	loggingUrl, err := url.Parse(masterCfg.AssetConfig.LoggingPublicURL)
	if err != nil {
		r.Error("AGL0011", err, fmt.Sprintf("Unable to parse the loggingPublicURL from the masterConfig '%s'", masterCfg.AssetConfig.LoggingPublicURL))
		return projectName
	}

	routeList, err := osClient.Routes(metav1.NamespaceAll).List(metav1.ListOptions{LabelSelector: loggingSelector.AsSelector().String()})
	if err != nil {
		r.Error("AGL0012", err, fmt.Sprintf("There was an error while trying to find the route associated with '%s' which is probably transient: %s", loggingUrl, err))
		return projectName
	}

	for _, route := range routeList.Items {
		r.Debug("AGL0013", fmt.Sprintf("Comparing URL to route.Spec.Host: %s", route.Spec.Host))
		if loggingUrl.Host == route.Spec.Host {
			if len(projectName) == 0 {
				projectName = route.ObjectMeta.Namespace
				r.Info("AGL0015", fmt.Sprintf("Found route '%s' matching logging URL '%s' in project: '%s'", route.ObjectMeta.Name, loggingUrl.Host, projectName))
			} else {
				r.Warn("AGL0019", nil, fmt.Sprintf("Found additional route '%s' matching logging URL '%s' in project: '%s'.  This could mean you have multiple logging deployments.", route.ObjectMeta.Name, loggingUrl.Host, projectName))
			}
		}
	}
	if len(projectName) == 0 {
		message := fmt.Sprintf("Unable to find a route matching the loggingPublicURL defined in the master config '%s'. Check that the URL is correct and aggregated logging is deployed.", loggingUrl)
		r.Error("AGL0014", errors.New(message), message)
		return ""
	}
	project, err := osClient.Projects().Get(projectName, metav1.GetOptions{})
	if err != nil {
		r.Error("AGL0018", err, fmt.Sprintf("There was an error retrieving project '%s' which is most likely a transient error: %s", projectName, err))
		return ""
	}
	nodeSelector, ok := project.ObjectMeta.Annotations["openshift.io/node-selector"]
	if !ok || len(nodeSelector) != 0 {
		r.Warn("AGL0030", nil, fmt.Sprintf(projectNodeSelectorWarning, projectName))
	}
	return projectName
}


text:
package org.crl.charts.dataids;
/**
 * Used for unification of the identifier of various charts data
 *
 */
public interface DataId {
	public Object getValue();

	public String toString();

}


text:
package org.ovirt.engine.api.utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

import org.ovirt.engine.api.model.DetailedLink;
import org.ovirt.engine.api.model.Link;
import org.ovirt.engine.api.model.Parameter;
import org.ovirt.engine.api.model.ParametersSet;
import org.ovirt.engine.api.utils.LinkHelper.LinkFlags;

public class ApiRootLinksCreator {

    public static List<String> getAllRels(String baseUri) {
        List<String> rels = new ArrayList<String>();
        for (Link link : getLinks(baseUri)) {
            rels.add(link.getRel());
        }
        return rels;
    }

    public static List<String> getGlusterRels(String baseUri) {
        List<String> rels = new ArrayList<String>();
        for (Link link : getGlusterLinks(baseUri)) {
            rels.add(link.getRel());
        }
        return rels;
    }

    public static Collection<DetailedLink> getLinks(String baseUri) {
        Collection<DetailedLink> links = new LinkedList<DetailedLink>();
        links.add(createLink("capabilities", baseUri));
        links.add(createLink("clusters", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("datacenters", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("events", LinkFlags.SEARCHABLE, getEventParams(), baseUri));
        links.add(createLink("hosts", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("networks", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("roles", baseUri));
        links.add(createLink("storagedomains", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("tags", baseUri));
        links.add(createLink("bookmarks", baseUri));
        links.add(createLink("templates", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("instancetypes", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("users", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("groups", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("domains", baseUri));
        links.add(createLink("vmpools", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("vms", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("disks", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("jobs", baseUri));
        links.add(createLink("storageconnections", baseUri));
        links.add(createLink("vnicprofiles", baseUri));
        links.add(createLink("schedulingpolicyunits", baseUri));
        links.add(createLink("schedulingpolicies", baseUri));
        links.add(createLink("permissions", baseUri));
        return links;
    }

    public static Collection<DetailedLink> getGlusterLinks(String baseUri) {
        Collection<DetailedLink> links = new LinkedList<DetailedLink>();
        links.add(createLink("capabilities", baseUri));
        links.add(createLink("clusters", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("events", LinkFlags.SEARCHABLE, getEventParams(), baseUri));
        links.add(createLink("hosts", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("networks", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("roles", baseUri));
        links.add(createLink("tags", baseUri));
        links.add(createLink("users", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("groups", LinkFlags.SEARCHABLE, baseUri));
        links.add(createLink("domains", baseUri));
        return links;
    }

    private static DetailedLink createLink(String rel, LinkFlags flags, String baseUri) {
        return LinkHelper.createLink(baseUri, rel, flags);
    }

    private static DetailedLink createLink(String rel, LinkFlags flags, ParametersSet params, String baseUri) {
        return LinkHelper.createLink(baseUri, rel, flags, params);
    }

    private static DetailedLink createLink(String rel, String baseUri) {
        return LinkHelper.createLink(baseUri, rel, LinkFlags.NONE);
    }

    private static ParametersSet getEventParams() {
        ParametersSet ps = new ParametersSet();
        Parameter param = new Parameter();
        param.setName("from");
        param.setValue("event_id");
        ps.getParameters().add(param);
        return ps;
    }

}