text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;
using Xunit;

namespace System.Linq.Expressions.Tests
{
    public class ReadOnlyCollectionBuilderTests
    {
        [Fact]
        public void ReadOnlyCollectionBuilder_Ctor_Default()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>();

            Assert.Equal(0, rocb.Capacity);

            AssertEmpty(rocb);
        }

        [Theory]
        [InlineData(-2)]
        [InlineData(-1)]
        public void ReadOnlyCollectionBuilder_Ctor_Capacity_ArgumentChecking(int capacity)
        {
            AssertExtensions.Throws<ArgumentOutOfRangeException>("capacity", () => new ReadOnlyCollectionBuilder<int>(capacity));
        }

        [Theory]
        [InlineData(0)]
        [InlineData(1)]
        [InlineData(2)]
        public void ReadOnlyCollectionBuilder_Ctor_Capacity(int capacity)
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(capacity);

            Assert.Equal(capacity, rocb.Capacity);

            AssertEmpty(rocb);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Ctor_Collection_ArgumentChecking()
        {
            AssertExtensions.Throws<ArgumentNullException>("collection", () => new ReadOnlyCollectionBuilder<int>(null));
        }

        [Theory]
        [MemberData(nameof(InitialCollections))]
        public void ReadOnlyCollectionBuilder_Ctor_Collection(IEnumerable<int> collection)
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(collection);

            Assert.Equal(collection.Count(), rocb.Count);
            Assert.True(collection.SequenceEqual(rocb));

            int[] array = rocb.ToArray();

            Assert.Equal(collection.Count(), array.Length);
            Assert.True(collection.SequenceEqual(array));

            ReadOnlyCollection<int> roc = rocb.ToReadOnlyCollection();

            Assert.Equal(collection.Count(), roc.Count);
            Assert.True(collection.SequenceEqual(roc));

            AssertEmpty(rocb); // ToReadOnlyCollection behavior is to empty the builder
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Capacity1()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>();

            Assert.Equal(0, rocb.Capacity);
            Assert.Equal(0, rocb.Count);

            Assert.Throws<ArgumentOutOfRangeException>(() => rocb.Capacity = -1);

            rocb.Capacity = 0;

            Assert.Equal(0, rocb.Capacity);
            Assert.Equal(0, rocb.Count);

            rocb.Capacity = 1;

            Assert.Equal(1, rocb.Capacity);
            Assert.Equal(0, rocb.Count);

            rocb.Capacity = 2;

            Assert.Equal(2, rocb.Capacity);
            Assert.Equal(0, rocb.Count);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Capacity2()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1 });

            Assert.Equal(1, rocb.Capacity);
            Assert.Equal(1, rocb.Count);

            AssertExtensions.Throws<ArgumentOutOfRangeException>("value", () => { rocb.Capacity = 0; });
            AssertExtensions.Throws<ArgumentOutOfRangeException>("value", () => { rocb.Capacity = -1; });

            rocb.Capacity = 1;

            Assert.Equal(1, rocb.Capacity);
            Assert.Equal(1, rocb.Count);

            rocb.Capacity = 2;

            Assert.Equal(2, rocb.Capacity);
            Assert.Equal(1, rocb.Count);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Capacity3()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1 });

            Assert.Equal(1, rocb.Capacity);
            Assert.Equal(1, rocb.Count);

            rocb.RemoveAt(0);

            Assert.Equal(1, rocb.Capacity);
            Assert.Equal(0, rocb.Count);

            rocb.Capacity = 0;

            Assert.Equal(0, rocb.Capacity);
            Assert.Equal(0, rocb.Count);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_IList_IsReadOnly()
        {
            IList rocb = new ReadOnlyCollectionBuilder<int>();

            Assert.False(rocb.IsReadOnly);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_ICollectionOfT_IsReadOnly()
        {
            ICollection<int> rocb = new ReadOnlyCollectionBuilder<int>();

            Assert.False(rocb.IsReadOnly);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_IList_IsFixedSize()
        {
            IList rocb = new ReadOnlyCollectionBuilder<int>();

            Assert.False(rocb.IsFixedSize);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_IList_IsSynchronized()
        {
            ICollection rocb = new ReadOnlyCollectionBuilder<int>();

            Assert.False(rocb.IsSynchronized);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_ICollection_SyncRoot()
        {
            ICollection rocb = new ReadOnlyCollectionBuilder<int>();

            object root1 = rocb.SyncRoot;
            Assert.NotNull(root1);

            object root2 = rocb.SyncRoot;
            Assert.Same(root1, root2);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_IndexOf()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 2, 3 });

            Assert.Equal(4, rocb.Count);

            Assert.Equal(0, rocb.IndexOf(1));
            Assert.Equal(1, rocb.IndexOf(2));
            Assert.Equal(3, rocb.IndexOf(3));

            Assert.InRange(rocb.IndexOf(0), int.MinValue, -1);
            Assert.InRange(rocb.IndexOf(4), int.MinValue, -1);

            rocb.Capacity = 5;

            Assert.Equal(4, rocb.Count);
            Assert.InRange(rocb.IndexOf(0), int.MinValue, -1); // No default values leak in through underlying array

            Assert.True(rocb.Remove(3));

            Assert.Equal(3, rocb.Count);
            Assert.InRange(rocb.IndexOf(0), int.MinValue, -1); // No default values leak in through underlying array
            Assert.InRange(rocb.IndexOf(3), int.MinValue, -1);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_IList_IndexOf()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 2, 3 });
            IList list = rocb;

            Assert.Equal(4, list.Count);

            Assert.Equal(0, list.IndexOf(1));
            Assert.Equal(1, list.IndexOf(2));
            Assert.Equal(3, list.IndexOf(3));

            Assert.InRange(list.IndexOf(0), int.MinValue, -1);
            Assert.InRange(list.IndexOf(4), int.MinValue, -1);

            rocb.Capacity = 5;

            Assert.Equal(4, list.Count);
            Assert.InRange(list.IndexOf(0), int.MinValue, -1); // No default values leak in through underlying array

            list.Remove(3);

            Assert.Equal(3, list.Count);
            Assert.InRange(list.IndexOf(0), int.MinValue, -1); // No default values leak in through underlying array
            Assert.InRange(list.IndexOf(3), int.MinValue, -1);

            Assert.InRange(list.IndexOf("bar"), int.MinValue, -1);
            Assert.InRange(list.IndexOf(null), int.MinValue, -1);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Insert()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>();

            Assert.Equal(0, rocb.Count);

            Assert.Throws<ArgumentOutOfRangeException>(() => rocb.Insert(-1, 1));
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb.Insert(1, 1));

            rocb.Insert(0, 1);

            Assert.True(new[] { 1 }.SequenceEqual(rocb));

            rocb.Insert(0, 2);

            Assert.True(new[] { 2, 1 }.SequenceEqual(rocb));

            rocb.Insert(0, 3);

            Assert.True(new[] { 3, 2, 1 }.SequenceEqual(rocb));

            rocb.Insert(1, 4);

            Assert.True(new[] { 3, 4, 2, 1 }.SequenceEqual(rocb));

            rocb.Insert(4, 5);

            Assert.True(new[] { 3, 4, 2, 1, 5 }.SequenceEqual(rocb));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_IList_Insert()
        {
            IList rocb = new ReadOnlyCollectionBuilder<int>();

            Assert.Equal(0, rocb.Count);

            Assert.Throws<ArgumentOutOfRangeException>(() => rocb.Insert(-1, 1));
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb.Insert(1, 1));

            AssertExtensions.Throws<ArgumentException>("value", () => rocb.Insert(1, "bar"));
            AssertExtensions.Throws<ArgumentException>("value", () => rocb.Insert(1, null));

            rocb.Insert(0, 1);

            Assert.True(new[] { 1 }.SequenceEqual(rocb.Cast<int>()));

            rocb.Insert(0, 2);

            Assert.True(new[] { 2, 1 }.SequenceEqual(rocb.Cast<int>()));

            rocb.Insert(0, 3);

            Assert.True(new[] { 3, 2, 1 }.SequenceEqual(rocb.Cast<int>()));

            rocb.Insert(1, 4);

            Assert.True(new[] { 3, 4, 2, 1 }.SequenceEqual(rocb.Cast<int>()));

            rocb.Insert(4, 5);

            Assert.True(new[] { 3, 4, 2, 1, 5 }.SequenceEqual(rocb.Cast<int>()));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_RemoveAt()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3, 4 });

            Assert.True(new[] { 1, 2, 3, 4 }.SequenceEqual(rocb));

            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb.RemoveAt(-1));
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb.RemoveAt(4));

            rocb.RemoveAt(0);

            Assert.True(new[] { 2, 3, 4 }.SequenceEqual(rocb));
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb.RemoveAt(3));

            rocb.RemoveAt(1);

            Assert.True(new[] { 2, 4 }.SequenceEqual(rocb));
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb.RemoveAt(2));

            rocb.RemoveAt(1);

            Assert.True(new[] { 2 }.SequenceEqual(rocb));
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb.RemoveAt(1));

            rocb.RemoveAt(0);

            Assert.Equal(0, rocb.Count);
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb.RemoveAt(0));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Remove()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 2, 4 });

            Assert.True(new[] { 1, 2, 2, 4 }.SequenceEqual(rocb));

            Assert.False(rocb.Remove(0));

            Assert.True(new[] { 1, 2, 2, 4 }.SequenceEqual(rocb));

            Assert.True(rocb.Remove(2));

            Assert.True(new[] { 1, 2, 4 }.SequenceEqual(rocb));

            Assert.True(rocb.Remove(1));

            Assert.True(new[] { 2, 4 }.SequenceEqual(rocb));

            Assert.True(rocb.Remove(4));

            Assert.True(new[] { 2 }.SequenceEqual(rocb));

            Assert.True(rocb.Remove(2));

            Assert.Equal(0, rocb.Count);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_IList_Remove()
        {
            IList rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 2, 4 });

            Assert.True(new[] { 1, 2, 2, 4 }.SequenceEqual(rocb.Cast<int>()));

            rocb.Remove(0);
            rocb.Remove("bar");
            rocb.Remove(null);

            Assert.True(new[] { 1, 2, 2, 4 }.SequenceEqual(rocb.Cast<int>()));

            rocb.Remove(2);

            Assert.True(new[] { 1, 2, 4 }.SequenceEqual(rocb.Cast<int>()));

            rocb.Remove(1);

            Assert.True(new[] { 2, 4 }.SequenceEqual(rocb.Cast<int>()));

            rocb.Remove(4);

            Assert.True(new[] { 2 }.SequenceEqual(rocb.Cast<int>()));

            rocb.Remove(2);

            Assert.Equal(0, rocb.Count);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Indexer_Get()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3, 4 });

            // CONSIDER: Throw ArgumentOutOfRangeException instead, see https://github.com/dotnet/corefx/issues/14059
            Assert.Throws<IndexOutOfRangeException>(() => rocb[-1]);
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb[4]);

            Assert.Equal(1, rocb[0]);
            Assert.Equal(2, rocb[1]);
            Assert.Equal(3, rocb[2]);
            Assert.Equal(4, rocb[3]);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Indexer_IList_Get()
        {
            IList rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3, 4 });

            // CONSIDER: Throw ArgumentOutOfRangeException instead, see https://github.com/dotnet/corefx/issues/14059
            Assert.Throws<IndexOutOfRangeException>(() => rocb[-1]);
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb[4]);

            Assert.Equal(1, rocb[0]);
            Assert.Equal(2, rocb[1]);
            Assert.Equal(3, rocb[2]);
            Assert.Equal(4, rocb[3]);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Indexer_Set()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3, 4 });

            // CONSIDER: Throw ArgumentOutOfRangeException instead, see https://github.com/dotnet/corefx/issues/14059
            Assert.Throws<IndexOutOfRangeException>(() => rocb[-1] = -1);
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb[4] = -1);

            rocb[0] = -1;
            Assert.Equal(-1, rocb[0]);

            rocb[1] = -2;
            Assert.Equal(-2, rocb[1]);

            rocb[2] = -3;
            Assert.Equal(-3, rocb[2]);

            rocb[3] = -4;
            Assert.Equal(-4, rocb[3]);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Indexer_IList_Set()
        {
            IList rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3, 4 });

            // CONSIDER: Throw ArgumentOutOfRangeException instead, see https://github.com/dotnet/corefx/issues/14059
            Assert.Throws<IndexOutOfRangeException>(() => rocb[-1] = -1);
            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb[4] = -1);

            AssertExtensions.Throws<ArgumentException>("value", () => rocb[0] = "bar");
            AssertExtensions.Throws<ArgumentException>("value", () => rocb[0] = null);

            rocb[0] = -1;
            Assert.Equal(-1, rocb[0]);

            rocb[1] = -2;
            Assert.Equal(-2, rocb[1]);

            rocb[2] = -3;
            Assert.Equal(-3, rocb[2]);

            rocb[3] = -4;
            Assert.Equal(-4, rocb[3]);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Add()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>();

            for (int i = 1; i <= 10; i++)
            {
                rocb.Add(i);

                Assert.True(Enumerable.Range(1, i).SequenceEqual(rocb));
            }
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_IList_Add()
        {
            IList rocb = new ReadOnlyCollectionBuilder<int>();

            for (int i = 1; i <= 10; i++)
            {
                rocb.Add(i);

                Assert.True(Enumerable.Range(1, i).SequenceEqual(rocb.Cast<int>()));
            }

            AssertExtensions.Throws<ArgumentException>("value", () => rocb.Add(null));
            AssertExtensions.Throws<ArgumentException>("value", () => rocb.Add("foo"));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Clear1()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            rocb.Clear();

            Assert.Equal(0, rocb.Count);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Clear2()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>();

            rocb.Clear();

            Assert.Equal(0, rocb.Count);
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Contains1()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 2, 3 });

            Assert.True(rocb.Contains(1));
            Assert.True(rocb.Contains(2));
            Assert.True(rocb.Contains(3));

            Assert.False(rocb.Contains(-1));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Contains2()
        {
            var rocb = new ReadOnlyCollectionBuilder<string>(new[] { "bar", "foo", "qux" });

            Assert.True(rocb.Contains("bar"));
            Assert.True(rocb.Contains("foo"));
            Assert.True(rocb.Contains("qux"));

            Assert.False(rocb.Contains(null));
            Assert.False(rocb.Contains("baz"));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Contains3()
        {
            var rocb = new ReadOnlyCollectionBuilder<string>(new[] { "bar", "foo", "qux", null });

            Assert.True(rocb.Contains("bar"));
            Assert.True(rocb.Contains("foo"));
            Assert.True(rocb.Contains("qux"));
            Assert.True(rocb.Contains(null));

            Assert.False(rocb.Contains("baz"));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_IList_Contains1()
        {
            IList rocb = new ReadOnlyCollectionBuilder<string>(new[] { "bar", "foo", "qux", null });

            Assert.True(rocb.Contains("bar"));
            Assert.True(rocb.Contains("foo"));
            Assert.True(rocb.Contains("qux"));
            Assert.True(rocb.Contains(null));

            Assert.False(rocb.Contains("baz"));
            Assert.False(rocb.Contains(42));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_IList_Contains2()
        {
            IList rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            Assert.True(rocb.Contains(1));
            Assert.True(rocb.Contains(2));
            Assert.True(rocb.Contains(3));

            Assert.False(rocb.Contains("baz"));
            Assert.False(rocb.Contains(0));
            Assert.False(rocb.Contains(null));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Reverse()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            rocb.Reverse();

            Assert.True(new[] { 3, 2, 1 }.SequenceEqual(rocb));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Reverse_Range_ArgumentChecking()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            AssertExtensions.Throws<ArgumentOutOfRangeException>("index", () => rocb.Reverse(-1, 1));
            AssertExtensions.Throws<ArgumentOutOfRangeException>("count", () => rocb.Reverse(1, -1));

            // CONSIDER: Throw ArgumentException just like List<T> does, see https://github.com/dotnet/corefx/issues/14059
            // AssertExtensions.Throws<ArgumentException>(null, () => rocb.Reverse(3, 1));
            // AssertExtensions.Throws<ArgumentException>(null, () => rocb.Reverse(1, 3));
            // AssertExtensions.Throws<ArgumentException>(null, () => rocb.Reverse(2, 2));
            // AssertExtensions.Throws<ArgumentException>(null, () => rocb.Reverse(3, 1));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_Reverse_Range()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3, 4, 5 });

            rocb.Reverse(1, 3);

            Assert.True(new[] { 1, 4, 3, 2, 5 }.SequenceEqual(rocb));
        }

        [Theory]
        [MemberData(nameof(Lengths))]
        public void ReadOnlyCollectionBuilder_ToArray(int length)
        {
            var rocb = new ReadOnlyCollectionBuilder<int>();

            for (int i = 0; i < length; i++)
            {
                rocb.Add(i);
            }

            int[] array = rocb.ToArray();

            Assert.True(Enumerable.Range(0, length).SequenceEqual(array));
        }

        [Theory]
        [MemberData(nameof(Lengths))]
        public void ReadOnlyCollectionBuilder_ToReadOnlyCollection(int length)
        {
            var rocb = new ReadOnlyCollectionBuilder<int>();

            for (int i = 0; i < length; i++)
            {
                rocb.Add(i);
            }

            ReadOnlyCollection<int> collection = rocb.ToReadOnlyCollection();

            Assert.Equal(length, collection.Count);

            Assert.True(Enumerable.Range(0, length).SequenceEqual(collection));

            AssertEmpty(rocb);
        }

        [Theory]
        [MemberData(nameof(Lengths))]
        public void ReadOnlyCollectionBuilder_GetEnumerator(int length)
        {
            var rocb = new ReadOnlyCollectionBuilder<int>();

            for (int i = 0; i < length; i++)
            {
                rocb.Add(i);
            }

            for (int j = 0; j < 2; j++)
            {
                IEnumerator<int> enumerator = rocb.GetEnumerator();

                // NB: Current property on generic enumerator doesn't throw; this is consistent with List<T>.

                for (int i = 0; i < length; i++)
                {
                    Assert.True(enumerator.MoveNext());
                    Assert.Equal(i, enumerator.Current);
                    Assert.Equal(i, ((IEnumerator)enumerator).Current);

                    enumerator.Dispose(); // NB: Similar to List<T>, calling Dispose does not have an effect here
                }

                Assert.False(enumerator.MoveNext());
                Assert.False(enumerator.MoveNext());

                // NB: Current property on generic enumerator doesn't throw; this is consistent with List<T>.

                enumerator.Reset();
            }
        }

        [Theory]
        [MemberData(nameof(Lengths))]
        public void ReadOnlyCollectionBuilder_IEnumerable_GetEnumerator(int length)
        {
            var rocb = new ReadOnlyCollectionBuilder<int>();

            for (int i = 0; i < length; i++)
            {
                rocb.Add(i);
            }

            for (int j = 0; j < 2; j++)
            {
                IEnumerator enumerator = ((IEnumerable)rocb).GetEnumerator();

                Assert.Throws<InvalidOperationException>(() => enumerator.Current);

                for (int i = 0; i < length; i++)
                {
                    Assert.True(enumerator.MoveNext());
                    Assert.Equal(i, enumerator.Current);
                    Assert.Equal(i, ((IEnumerator)enumerator).Current);

                    ((IDisposable)enumerator).Dispose(); // NB: Similar to List<T>, calling Dispose does not have an effect here
                }

                Assert.False(enumerator.MoveNext());
                Assert.False(enumerator.MoveNext());

                Assert.Throws<InvalidOperationException>(() => enumerator.Current);

                enumerator.Reset();
            }
        }

        [Theory]
        [MemberData(nameof(Versioning))]
        public void ReadOnlyCollectionBuilder_IEnumeratorOfT_Versioning_MoveNext(int index, Action<ReadOnlyCollectionBuilder<int>> edit)
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            IEnumerator<int> enumerator = rocb.GetEnumerator();

            Assert.True(enumerator.MoveNext());

            edit(rocb);

            Assert.Throws<InvalidOperationException>(() => enumerator.MoveNext());
        }

        [Theory]
        [MemberData(nameof(Versioning))]
        public void ReadOnlyCollectionBuilder_IEnumeratorOfT_Versioning_Reset(int index, Action<ReadOnlyCollectionBuilder<int>> edit)
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            IEnumerator<int> enumerator = rocb.GetEnumerator();

            Assert.True(enumerator.MoveNext());

            edit(rocb);

            Assert.Throws<InvalidOperationException>(() => enumerator.Reset());
        }

        [Theory]
        [MemberData(nameof(Versioning))]
        public void ReadOnlyCollectionBuilder_IEnumerator_Versioning_MoveNext(int index, Action<ReadOnlyCollectionBuilder<int>> edit)
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            IEnumerator enumerator = ((IEnumerable)rocb).GetEnumerator();

            Assert.True(enumerator.MoveNext());

            edit(rocb);

            Assert.Throws<InvalidOperationException>(() => enumerator.MoveNext());
        }

        [Theory]
        [MemberData(nameof(Versioning))]
        public void ReadOnlyCollectionBuilder_IEnumerator_Versioning_Reset(int index, Action<ReadOnlyCollectionBuilder<int>> edit)
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            IEnumerator enumerator = ((IEnumerable)rocb).GetEnumerator();

            Assert.True(enumerator.MoveNext());

            edit(rocb);

            Assert.Throws<InvalidOperationException>(() => enumerator.Reset());
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_CopyTo_ArgumentChecking()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            Assert.Throws<ArgumentNullException>(() => rocb.CopyTo(null, 0));
            Assert.Throws<ArgumentOutOfRangeException>(() => rocb.CopyTo(new int[3], -1));
            AssertExtensions.Throws<ArgumentException>("destinationArray", () => rocb.CopyTo(new int[3], 3)); // NB: Consistent with List<T> behavior
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_CopyTo1()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            var array = new int[3];

            rocb.CopyTo(array, 0);

            Assert.True(new[] { 1, 2, 3 }.SequenceEqual(array));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_CopyTo2()
        {
            var rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            var array = new int[5] { 1, 2, 3, 4, 5 };

            rocb.CopyTo(array, 1);

            Assert.True(new[] { 1, 1, 2, 3, 5 }.SequenceEqual(array));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_ICollection_CopyTo_ArgumentChecking()
        {
            ICollection rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            Assert.Throws<ArgumentNullException>(() => rocb.CopyTo(null, 0));
            Assert.Throws<ArgumentOutOfRangeException>(() => rocb.CopyTo(new int[3], -1));
            AssertExtensions.Throws<ArgumentException>("destinationArray", () => rocb.CopyTo(new int[3], 3)); // NB: Consistent with List<T> behavior
            AssertExtensions.Throws<ArgumentException>(null, () => rocb.CopyTo(new int[3, 3], 0));

            // CONSIDER: Throw ArgumentException instead to be consistent with List<T>, see https://github.com/dotnet/corefx/issues/14059
            Assert.Throws<ArrayTypeMismatchException>(() => rocb.CopyTo(new string[3], 0));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_ICollection_CopyTo1()
        {
            ICollection rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            var array = new int[3];

            rocb.CopyTo(array, 0);

            Assert.True(new[] { 1, 2, 3 }.SequenceEqual(array));
        }

        [Fact]
        public void ReadOnlyCollectionBuilder_ICollection_CopyTo2()
        {
            ICollection rocb = new ReadOnlyCollectionBuilder<int>(new[] { 1, 2, 3 });

            var array = new int[5] { 1, 2, 3, 4, 5 };

            rocb.CopyTo(array, 1);

            Assert.True(new[] { 1, 1, 2, 3, 5 }.SequenceEqual(array));
        }

        private static void AssertEmpty<T>(ReadOnlyCollectionBuilder<T> rocb)
        {
            Assert.Equal(0, rocb.Count);

            Assert.False(rocb.Contains(default(T)));
            Assert.False(rocb.Remove(default(T)));
            Assert.InRange(rocb.IndexOf(default(T)), int.MinValue, -1);

            IEnumerator<T> e = rocb.GetEnumerator();
            Assert.False(e.MoveNext());
        }

        private static IEnumerable<object[]> InitialCollections() =>
            new IEnumerable<int>[]
            {
                new int[0],
                new int[] { 1 },
                new int[] { 1, 2 },
                new int[] { 1, 2, 3 },
                new int[] { 1, 2, 3, 4 },
                new int[] { 1, 2, 3, 4, 5 },

                new List<int>(),
                new List<int>() { 1 },
                new List<int>() { 1, 2 },
                new List<int>() { 1, 2, 3 },
                new List<int>() { 1, 2, 3, 4 },
                new List<int>() { 1, 2, 3, 4, 5 },

                Enumerable.Empty<int>(),
                Enumerable.Range(1, 1),
                Enumerable.Range(1, 2),
                Enumerable.Range(1, 3),
                Enumerable.Range(1, 4),
                Enumerable.Range(1, 5),
            }.Select(x => new object[] { x });

        private static IEnumerable<object[]> Lengths() => Enumerable.Range(0, 10).Select(i => new object[] { i });

        private static IEnumerable<object[]> Versioning() =>
            new Action<ReadOnlyCollectionBuilder<int>>[]
            {
                e => e.Add(1),
                e => ((IList)e).Add(1),
                e => e[0] = 1,
                e => ((IList)e)[0] = 1,
                e => e.Insert(0, 1),
                e => ((IList)e).Insert(0, 1),
                e => e.Remove(1),
                e => ((IList)e).Remove(1),
                e => e.RemoveAt(0),
                e => e.Reverse(),
            }.Select((x, i) => new object[] { i, x });
    }
}


text:
Fan Types - Why choose an Axial fan
star_borderFollow article
FanManDan 15 Dec 2017
7star_border 4question_answer 5thumb_up
Your next article
Dave from DesignSpark
How do you feel about this article? Help us to provide better content for you.
Thank you! Your feedback has been received.
There was a problem submitting your feedback, please try again later.
Too hard A little too hard Perfect A little too easy Too easy
Too long A little too long Perfect A little too short Too short
Send Feedback chevron_right
When we have defined the volume flow rate that we require, whether this is to provide fresh air or process cooling, we need to combine this with the resistance to flow that the fan will encounter in the application. The volume flow rate, (in m3/hr) and the pressure (in Pascals - Pa), are combined to become the duty point against which the fan must operate. It is important that we select a fan whose performance characteristic meets the required duty point on or near the point of peak efficiency. Using the fan at its peak efficiency minimises the power consumption and noise emitted from the fan whilst delivering the required performance.
How does an axial fan work?
An axial fan blade works on the same principle as how an aircraft wing generates lift. The wing of an aircraft has an aerofoil shape which as it is propelled forwards the air is diverted above and below the wing. The air above the wing has farther to travel than the air under the wing which results in a difference in air velocity above and below the wing. The higher velocity air stream above the wing has a higher dynamic force which results in a lower static pressure. Below the wing, the air is moving slower which means it has a lower dynamic force and higher static pressure. The difference in higher pressure below the wing and lower pressure above it generates lift.
Aircraft Fan
In the case of a fan we use an impeller blade like an aerofoil however instead of generating lift we keep the fan blades rotating in a stable axis and this creates airflow. This follows Newton's third law of motion that for each action there is an equal and opposite reaction. The air above the aerofoil is drawn into the fan by the reduction in static pressure and pushed out through the fan creating a positive pressure area.
To direct the airflow and obtain optimum performance, we use a mounting plate with a bell-mouth shaped inlet cone to create a smooth laminar flow into the suction side of the fan. The fan is held centrally in the mounting plate by the mounting guard which maintains a small tip clearance between the fan and bell-mouth.
There are other methods of mounting an axial fan including placing it in a plain diaphragm hole or in a short radius, however, these mounting methods compromise performance. Using a full bell-mouth mounting plate will ensure that optimum performance from the fan will be achieved.
Reduction in the effective diameter using alternative mounting methods
Fan characteristic
The optimum operating area on an axial fan characteristic is below what is called the stall dip. An axial fan works best when a relatively high-volume flow is required against a relatively low system pressure. The graph below illustrates the optimum working area…
The volume flow is plotted along the X-axis and the system pressure is plotted on the Y-axis. When there is no pressure in the system, (the fan is blowing freely), an axial fan will produce the greatest volume flow. As a resistance to flow is applied to the suction or exhaust side of the fan the volume flow rate will drop. The peak efficiency is at a point called the knee of the fan characteristic curve. At this point, the ratio of the output power of the fan (Volume flow x Pressure development) and the electrical power input is at its greatest and the sound pressure being produced by the fan will be at its quietest.
Above the optimum range of operation, the flow across the upper and lower sides of the impeller blades becomes turbulent and the impeller starts to go into an aerodynamic stall.
At this point, the fan will start to vibrate and create lots of noise. Operating at this point can potentially cause the motor driving the fan to overheat as the turbulent forces on the impeller blade disrupt the motor operating efficiency.
Mounting considerations – clearances
When installing an axial fan, it is important to consider several factors relating to how it is mounted to the application. Ideally, when we choose an axial fan we could allow for lots of room on both the suction side and exhaust side of the fan to promote an even airflow into the fan and a controlled dispersal of the air on the exhaust side of the fan. Unfortunately, this may not always be possible to achieve and a compromise must be reached.
As a rule of thumb, the clearance (x) on the suction side and the exhaust side of the fan before an obstruction is reached should be at least 1/3rd of the diameter of the fan.
X >= diameter D x 0.33
e.g. For an axial fan of 450mm diameter, there should be at least 150mm of clearance between the fan and an obstruction to flow (Coil, Filter, wall etc…)
Mounting considerations – position of the fan in the system
The position of an axial fan in the application will affect its operating conditions. In the example below the choice for cooling an enclosure containing electronics dissipating a heat load is shown…
As mentioned above, the components of an axial fan are designed to promote a smooth laminar flow of air on to the impeller blade. A laminar flow will maximise the efficiency of imparting a force on the air to move it from the suction to the exhaust side of the impeller blade. On the exhaust side of the impeller blade, the flow will become random and turbulent if flow straightening devices are not used.
Placing the fan at the inlet and blowing into the enclosure is one option to consider. We can use the turbulent exhaust of the fan to spread the air around the enclosure. This will ensure that all surfaces of the components within the enclosure will encounter some of the cool supply air. Being turbulent the random air path will create more pressure in the system as the air makes its way towards the exhaust. More pressure in the system will create more noise from the fan and require more power to deliver the required airflow.
On the other hand, we could place the fan at the exhaust which will change the system characteristic. The air will follow the path of least resistance which means that some of the components will experience less cooling. The pressure in the system will be lower resulting in quieter operation and lower power consumption. The fan will see a higher operation temperature as the air passing over the motor will have an increased temperature caused by the dissipation of heat from the components inside the enclosure.
Summary – why choose an axial fan?
When a relatively high-volume flow is required in a low-pressure system and axial fan should be considered. The fan should be selected within its optimum range either at the point of peak efficiency or below. The point of peak efficiency is an area known as the knee of the fan characteristic curve where it is also is operating at its quietest. Operating in what is known as the stall dip and at system pressures above this point must be avoided. The turbulence and the aerodynamic efficiency of the impeller blade in the stall dip and above creates noise and may cause the motor to overload.
Air on the inlet side of the impeller should be kept as smooth and laminar as possible to maximise the efficiency of the impeller blade. Using a full bell-mouth mounting plate and eliminating flow disturbances before the air is drawn through the fan will reduce noise and keep the power consumption at the duty point to a minimum.
Fan Types - Why choose an axial fan article
PDF, 438.9 kB
thumb_upLike star_borderFollow article
FanManDan star_borderFollow
My background is in Mechanical & Production Engineering however working for ebm-papst that has expanded into electro-mechanical, some electronic and acoustic engineering. When it comes to acquiring and passing on knowledge, I try to keep it as simple and as least painful as possible. I am happy to receive feedback and if there are any questions that arise from anything that gets published. If I don't know the answer to your question immediately, I am sure that I know someone that can help.

redpajama_set_name: RedPajamaCommonCrawl


text:
Home Video Spotlight Mar 12-18: Disney Classics, Life of Pi, Hitchcock and more
Posted bymoviejunkieto March 16, 2013 March 16, 2013 Posted inHome Video ReviewsTags:Alfred Hitchcock, Blu-ray Disc, Brother Bear, Catherine Zeta-Jones, Disney, Gerard Butler, Helen Mirren, Hitchcock, Hunchback of Notre Dame, Irrfan Khan, Jessica Biel, Judy Greer, Life of Pi, Mulan, Playing for Keeps, Scarlett Johansson, Uma Thurman
Blu-Ray and DVD releases for the week of Mar 12 – 18
Here's a rundown of this week's highlighted releases with links to full reviews on all of them.
Disney Dual Pack Blu-rays
Disney released three dual pack Blu-rays for three of its animated films this week with Mulan 1 and 2, the Hunchback of Notre Dame 1 and 2 and Brother Bear 1 and 2. These are the first time these films have been released on Blu-ray as a dual pack with their direct to video sequels included.
Mulan 1 & 2
Disney's classic tale of the Chinese fable that sees young Mulan secretly take her father's place when he is conscripted to the Emperor's army comes to Blu-ray with a beautiful looking transfer. Mulan 2 takes Mulan and her now fiance Shang on a secret mission from the Emperor himself delivering his princess daughters to arranged marriage designed to strengthen China.
Mulan is one of Disney's classic tales from Disney's very fertile mid 1990s which also produced another one of the packs released this week and other classics like The Lion King and Beauty and the Beast. The film looks glorious on Blu-ray and makes some of the more special scenes pop even more. Mulan 2 is actually one of the better direct to video sequels, even without the return of Eddie Murphy, as the animation is still solid and the story, while goofy, still retains some fun. The Blu-Ray pack is a must buy.
FULL REVIEW AVAILABLE HERE
Hunchback of Notre Dame 1 & 2
Disney's interpretation of the classic Victor Hugo tale of the deformed orphan Quasimodo also comes from the 1990's era of Disney animation but is usually criminally overlooked and features one of the more dastardly Disney villains in Quasimodo's master Frollo. Hunchback 2 tries to bring in a love interest for Quasi in the form of circus girl Madeline and also introduces her scheming and thieving boss to the mix.
The original Hunchback is a very underrated achievement with some gorgeous animation and a loveable hero at its core. Often lost in the crowd of the titles mentioned earlier, Hunchback is a title that deserves a lot more credit and spotlight. Hunchback 2 however should be forgotten. The step down in animation is terrible, even our main character Quasimodo looks different between the two films, and its story is pretty lame. The Blu-ray pack is a recommend based on the strength of it first film alone.
Brother Bear 1 & 2
Brother Bear was released during the leaner years of Disney's animation in the early 2000s when Pixar had really taken over. In fact the film about a young man being transformed into a bear to learn a lesson was bumped from the traditional Disney summer slot for Finding Nemo that year. Brother Bear 2 also tries to find our protagonist in a love story situation, this time even throwing the supporting characters in to situations of their own to boot.
Brother Bear is one of the lesser of the Disney animated films, and Pixar has since done a similar tale in Brave that has a much better story and moral attached to it. Brother Bear 2 unfortunately does not fare any better, having to replace the non-returning Joaquin Phoenix with Patrick Dempsey as the lead Kenai and working in non-credible ending, even for a film involving such mystical elements. The Blu-ray pack is a non-recommend.
Life of Pi Blu-ray
The Oscar winning Life of Pi makes it Blu-ray debut with an impressive looking pack. The tale of PI, the sole human survivor of a shipwreck, lost at sea with only the company of a 450lb Bengal Tiger named Richard Parker has been captivating audiences and readers ever since the book debut back in 2001. Many felt the book to be un-filmable until director Ang Lee came along and delivered his award winning adaptation this year.
The film looks amazing and Lee's determination to make the scenes look like living pieces of art really comes through on the home screen. The performance from Irrfan Khan as the older Pi is brilliant; it's the true heart of the film and totally engaging. The effects work here is some of the best put to film last year and why Lee won the best director Oscar become crystal clear when you realize just how well these elements come together and that it was all shot in front of a blue screen. Lee's imagination is on full display and the audience is the benefactor. Life of Pi on Blu-ray is a must own.
FULL BLU-RAY REVIEW AVAILABLE HERE – THEATRICAL REVIEW HERE
Hitchcock Blu-ray
Hitchcock also hits Blu-ray this week. The tale of the filming of Alfred Hitchcock's Psycho and the relationship between Hitchcock and his wife Alma was met with a mixed reaction last year upon its release. Focusing more on a lighthearted treatment of the story than a hard hitting, 100% accurate biopic, the film is much more about the relationship between Hitchcock and his beleaguered spouse and features a strong turn from Helen Mirren in the role of Alma.
Hopkins does a decent turn as Hitchcock, not completely morphing in to the character but assuming the tone and essence of the man pretty robustly. The film does play better on the smaller screen that it did in the theater, but still has its issues and Hitchcock aficionados are likely to have strong feelings about the films outcome. The film itself looks excellent on Blu-ray and the disc is packed with special features galore. Hitchcock on Blu-ray is a recommend.
Playing for Keeps DVD
The newest Gerard Butler rom/com Playing for Keeps is out this week on DVD and Blu-ray. The film about and former soccer star who has blown his relationship with his son and former flame trying to make amends features an all-star cast. Of course Butler's George can't simply sweep into town and save the day by coaching his son's soccer team and has to contend with a group of lonely, aroused and attractive soccer mom's determined to get a piece of George for themselves.
Playing for Keeps is sadly bland and unoriginal and quite frankly we've seen this before from Butler far too many times. The film is not terrible; it's just very average. Jessica Biel and Judy Greer managed decent performances while the rest of the cast seems content to toe the line and phone it in. The DVD is also without any additional features; just the film itself is included. Playing for keeps is a mild non-recommend.
Disney's 'Hunchback' hits Blu-ray with new dual pack set (moviejunkieto.com)
Disney's 'Mulan 1&2′ hits Blu-ray with a new dual pack set (moviejunkieto.com)
Chasing Mavericks Blu-ray Review (Kirk Haviland)
Spring Breakers Review (Paolo Kagaoan)


We've been creating websites for schools, kindergartens and childcare facilities since 2006.
Of course, if you'd like a cost estimation specific to your project, please don't hesitate to contact us for an obligation-free quote. We provide detailed quotations outlining all tasks to be performed, pricing and approximate timelines.


Beartooth – If losing cellphone connection is a concern, then take a look at Beartooth. This new case offers a peer-to-peer software that uses radio frequency even when Wi-Fi or cellular service is unavailable. You can't stream Netflix or Youtube, but it'll be strong enough to send the occasional text and can make phone calls. The Beartooth case also comes with its own battery to ensure it doesn't bleed your phone dry. It's the ideal case for those who enjoy the outdoors.
adidas Consortium x Pharrell Williams – Run–DMC made the adidas tracksuit a thing in the eighties, and Pharrell is bringing the allure of the classic back for his exclusive Consortium collection. The nylon sport jacket dominated hip-hop and b-boy culture for over three decades, and returns with a huge update. Instead of the satin nylon, the jacket adidas Consortium uses supple leather. Pharrel elects to use upscale Nappa leather to keep the silhouette fit and slimming, while three white stripes run down along the arms. The jacket is an ode to an era, and is available at select stores now.
Outlier Wool Liberated Pea Coat – The pea coat is a beast when it comes to keeping the cold away, but if you ever had one on, you'll know how incredibly difficult it is to move. Good pea coats use heavy wool to help insulate the heat, but Outlier has a different plan with their Liberated Pea Coat. Their take on the navy classic is to maintain the classic shape and utility, but add accessibility throughout the jacket. Instead of thick worsted wool, Outlier uses a wool softshell that is treated to be wind and water resistant. By using an updated textile the jacket is able to keep the cold away, and still has enough flexibility for runs and bike rides.
New Balance 998 Horween – New Balance is set to release the most expensive shoes the American company has ever made. The classic look of the 998 has always been complimented by nubuck, suede, or nylon, but this time New Balance pairs it with the opulence of Horween leather. The respected tannery will be supplying premium leather to New Balance for this $400 runner. With sneakers becoming a status symbol, it makes sense to use premium materials, but on the other hand, when does premium cross the line and become ridiculous?
Grovemade iPhone 6 Case – With Apple selling more than 10 million iPhone 6s over the weekend, you can bet there are a lot of people scrambling to protect their new investment. Grovemade is a little outfit in beautiful Portland that makes each of their cases by hand. The new cases for the iPhone 6 are made from beautiful walnut and maple wood sourced all throughout Oregon. They may not be as slim as some brands, but the look and feel of natural wood is something to marvel.


For many years this bike was left dormant and looking in a sorry state, I completely stripped this old 74 Honda and Custom worked on the frame to give it the opportunity to remove parts of the chassis if you need to get to the motor.
This bike is kind of a 1970's Street Muscle Machine for the want of a better description and I am so happy I went the way of a Metalflake Silver frame and a Candy Pearl bodywork design, this screams mid 70's and the ole 750 sounds tough as old boots.
I have custom welded the gas tank and now it uses a screw in Harley cap and is smoothed over and the seat is one of the most comfortable I have made, using memory foam and expensive Quality Leather, I hand bent the handlebars and triple chromed them and the stance is bang on and really nice to ride around on , and Love this bike and am so happy at the end result.
Obviously, originally belonging to the infamous Vesco Family and now they have a 428 MPG record with their Streamliner, they have shown interest in the machine once more and love the way it has turned out.
The 4 into 2 into 1 Stainless Exhaust system Growls nicely and suits the bike as the headers hug the inline four motor, it now has that old school Gold tint to the headers now she has been fired and it is a tough looking Motorcycle which ever way you look at it.
From every angle you can see detail and I am happy that I put a lot of hard work in detailing this inline Four, these sure are good solid bikes to use as a Platform for any guise of style.
The Original Lester Spoked Rims I removed from a CR750 Race bike that was being parted out and glad I got to use them, as I have had these in storage for about 15 years and nice to re-use parts from back in the day.
Here are just a couple of lists of some of the things I have done to this motorcycle.
This entry was posted in Blog and tagged brat, cafe racer, candy paint, cb750, cb750k, custom, custom bike, Honda, honda four, inline four, Lester rims, metalflake, Vesco.


AWESOME AND USEFUL SUZUKI CARRY VAN! IT HAS A 550CC 3 CYLINDER ENGINE AND 5-SPEED MANUAL TRANSMISSION. THE ENGINE RUNS WELL AND THE TRANSMISSION SHIFTS WELL. ODOMETER SHOWS 22,844 KM OR 14,000 MILES. IT HAS A LARGE CARGO AREA BEHIND THE BACK SEATS, AND THE BACK SEATS ALSO FOLD DOWN TO MAKE AN INCREDIBLY LARGE, FLAT CARGO AREA. IT IS IN STOCK AND CAN BE SEEN AND SOLD TODAY.


text:
May's Real Estate Numbers, Crunched: Manhattan Apartment Vacancy Rates Down, Manhattan Rental Prices Up, Renter's Market... Fading
First things first: there are still plenty of good deals out there on Manhattan rental apartments, and even a healthy number of no-fee rental listings in Manhattan. But as the economy continues its slow bounce-back and the Manhattan real estate market follows suit, it looks more and more like the long renter's market for NYC apartments is drawing to a close. The Real Deal's report on May's Manhattan apartment rental statistics bears this out: citywide apartment vacancy is down to under one percent again, and finding a West Village rental (a .33% vacancy rate) or a rental apartment in Chelsea (.52% vacancy rate) is as hard as it has been in years. But, thankfully, at least for those looking for Manhattan rental apartments, May's stats are not all bad news.
Chelsea Rentals
Midtown East Rentals
West Village Rentals
Lowering The Volume: Why Are Manhattan Rental Apartments So Hard To Find This Summer?
Prices on Manhattan rental apartments are down, which is good news for -- obviousness alert -- people looking for Manhattan rental apartments. But like all good news in NYC real estate, there's a catch, here. While it's easier to find a Manhattan rental listing at the price you want, it's getting harder to find a Manhattan rental listing period. Even during the summer, which is traditionally the prime time to find a Manhattan rental apartment, NYC apartment inventory is low and the market is, while still comparatively cheap, also surprisingly tight. The Apple Peeled takes a look at this curious and seemingly contradictory real estate trend and tries to make some sense of it.
Manhattan Real Estate Trends
Manhattan Rentals
The Recovery Continues, Part 23: Atlantic Development Announces Two New Luxury Rental Buildings in East Village and Chelsea
The ongoing economic recovery is good news both for Manhattan real estate developers and everyone who, you know, participates in the economy. That seems obvious, but it's worth mentioning mostly because all the recovery-related news here at the Luxury Rentals Manhattan job could easily be mistaken for a bummer by people searching for Manhattan rental apartments. Here there's news that NYC dwellers can no longer expect generous concessions on their Manhattan rental apartments. There there's news that Manhattan no-fee rental listings are not-so-gradually becoming an endangered species. Yes, it's good that the economy is apparently bouncing back. But where's the benefit for those looking for a Manhattan rental apartment? Well, it's coming, through what looks like a bumper crop of new construction luxury rental buildings that should arrive over the next year or two.
2 Cooper
Atlantic Development
Chelsea Apartments
East Village Apartments
New Construction Rental Buildings
Better To Rent Than To Buy? Most People Say Yes
The very fact that a second "Sex and the City" movie exists is proof that the lessons of the sharp economic downturn -- both in Manhattan real estate and, um, everything else -- haven't totally sunken in with everybody out there. But while it's usually not a good idea to look to NYC real estate for signs of rational, level-headed thought, a recent poll by the National Apartment Association indicates that perhaps those looking for Manhattan rental apartments have internalized the lessons of the economic demi-disaster better than, say, whoever green-lit "Sex and the City 2: The Grievous Miscalculation." The NAA poll finds that 76 percent of people prefer to rent apartments, as opposed to owning them. That's a five percent increase since 2008, and it is, in its way, kind of heartening.
From "No Fee" To "No, Fee": WSJ Reports That Landlords Less Willing To Pay Broker's Fees On Manhattan Rental Apartments
We obviously spend a great deal of time surveying the market for Manhattan rental apartments here at the Luxury Rentals Manhattan blog -- the fact that this is the Luxury Rentals Manhattan blog might've been some indication of this. But while there's plenty of good news for NYC dwellers looking for a luxury rental in Manhattan, and we do our best to report it, the one topic we've kept coming back to over recent weeks and months is the decline (or not-decline) of the renter's market in Manhattan real estate. For the time being, we'd describe the renter's market as, if you'll pardon the real estate jargon, "still kind of happening, for the most part." But while prices are still fairly low on Manhattan rental listings, the perks that defined the renter's market at its peak -- from landlords paying fees to highly negotiable listing prices on rental apartments -- seem to be fading into the past. In the Wall Street Journal, Dawn Potapka delivers an obituary for the days of landlords gladly paying fees on Manhattan apartments. Let us bow our heads:
1 Union Square South
Ogden Properties
Pan Am Equities
The Sierra
Tribeca Green
The Last Concession? Post Reports Concessions In Decline At New York City Rentals
Fri, 05/21/2010 - 3:45pm
We've been writing about the renter's market in Manhattan rentals here at Luxury Rentals Manhattan for months now, but much of what we've been writing about the renter's market has been about its imminent end. Is it here yet? How about now? Maybe while we were at lunch? The answer to those (incessant) questions remains more or less the same: the market for rental apartments in Manhattan is still tilted towards renters, but it appears to be in the midst of a return to the mean. Which in turn means, as the New York Post reports today, that it's increasingly tough for NYC dwellers to get the sort of concessions on Manhattan rentals that they routinely received during the heyday of the renter's market. Using Clinton luxury rental success story 505 West 37th as a test case, the Post's Katherine Dykstra reports that while concessions are down, the market is not totally back to its boom-era levels.
Tear Down That Wall? The Quest To Open Gramercy Park To NYC Dwellers Continues
There are a great many reasons to look for a luxury rental in Gramercy Park -- greater Gramercy is a beautiful neighborhood with plenty of nice restaurants, some charmingly low-key nightspots and several really nice rental apartment listings. But as much as we at Luxury Rentals Manhattan love us some Lex Lofts or Park 23, there's one thing that a rental apartment in Gramercy will never boast: access to the actual Gramercy Park. Keys to Gramercy Park are among the most elusive prizes in Manhattan real estate, and even people who own their apartments on Gramercy Park are denied keys. If you don't own one of the 39 town houses surrounding Gramercy Park, the best you can hope for is to look through the high, wrought-iron fence surrounding Gramercy Park's eponymous green space. But will it always be thus?
Lex Lofts
Luxury Rentals in Gramercy
Emerald Green Offshoots: Developers Behind Garment District Green Rental Emerald Green Planning 39th Street Spin-Off
There's no sense in trying to hide it: we at Luxury Rentals Manhattan love the Garment District's Emerald Green. The LEED-certified green rental building is not only one of the more intriguing new green rental listings in Manhattan, but Emerald Green's location -- 320 West 38th Street, if you're curious -- in a neighborhood otherwise fairly short on luxury rental listings (green or otherwise) makes it an especially intriguing development. More intriguing is the news that Glenwood, the heavy-hitter Manhattan real estate developers behind Emerald Green, are planning an Emerald Green sequel in the same neighborhood, at 330 West 39th Street. Even if Emerald Green weren't such a favorite of ours here at Luxury Rentals Manhattan, this would be an interesting development.
Glenwood Management


MS British Royal Marines (?) in white helmets lined up 4 or 5 rows deep along street. MS huge gun on display, many civilians crowding round it. Pan to large building; possibly British embassy ?
Various shots more Royal Marines (?) at another location reviewed by Italian officers (dark shots). MS group of sailors is white uniforms coming on ship (look to be some Indians among them).
U.S. navy cadets in training, drilling and in classroom.
The funeral of those lost on the L.55 takes place, many people turn out to mourn.
Cuts (rushes, out takes) for THE NAVYS CUP FINAL (aka THE NAVY'S CUP FINAL) in G 1556.
Sailors go through training to become members of the Submarine Corps.
Naval cadets and Wrens' marching band drilling on parade ground.
Royal Navy fire fighters training - using breathing apparatus and fire proof suits.
Merchant seamen spending their leave in London.
Shots of the ship 'San Fraterno'.


text:
Q: If an input is focused, then how to change the properties of a different class in the Sass? I try to change the color of one class at the same time when input is focused, but nothing changes
Code:

  <input />

Sass selector:
.wrapper {
  input:focus & + .icon {
    color: black;
  }
}

Sass doesn't change anything, but clear css is working.
Here is an example: http://jsfiddle.net/Tyriar/Y83q6/2/
Does anyone know what should I change?

A: You need 2 things:

*

*Remove & from this par of code input:focus & + .icon;

*Move

 under input. "+" it combines two sequences of simple selectors having the same parent and the second one must come IMMEDIATELY after the first.

redpajama_set_name: RedPajamaStackExchange


Futureheads have partnered with a start-up who operate in the advertising space and are looking to hire a Senior Software Developer to join their team on a 3-month rolling contract. Their overall mission is to make advertising something that people want to see. Currently, they allow clients to be able to receive, transform, track and optimise leads from social channels, but their aim is to consolidate them all together to create one, all inclusive, platform.
They currently work on behalf of Google, Facebook, and LinkedIn which means they have a significant advantage within the marketing space that allows them to gain information that may not have been accessible beforehand.
We are looking for someone who has strong technical skills in Ruby or Elixir (both would be fantastic), but if not, a desire to learn the other is requested. We would also like this person to be a good mentor to more junior developers. High standard of quality and security in software is very important as day to day activity may involve sensitive and personal information.
If you'd like to apply for this role, or find out more, please contact Rohan quoting reference J14074, including your latest CV or portfolio.


Thank you for subscribing to our blog!
Are you applying best practices in your pricing?
Service design has emerged as a core business discipline. It helps customers get full value from offers and organizations to realign around providing that value. Pricing and value are central to service design. How do service design and pricing interact? We begin to explore these ideas here.
Willingness to pay is very sensitive to framing effects. One of the most important framing effects is the pricing metric. B2B SaaS companies can realize orders of magnitude changes in willingness to pay by changing their pricing metric. Pricing metrics can also be a powerful way to differentiate.
Pricing is a critical part of business success and it cannot be left to chance. What role should the CEO play in pricing? It comes down to setting strategy, ensuring alignment, monitoring execution, and taking leadership on pricing ethics and fairness.
Revenue recognition seems to be a dull and technical topic, only of interest to accountants and CFOs. This is a dangerous way to think. Revenue recognition principles can shape the design of your services and constrains how you price.
Pricing Disruptive Innovations - market-following or value-based pricing?
Our recent research on how people price innovations found different pricing methods for sustaining versus disruptive innovators. Sustaining innovators tend to use value-based pricing. Disruptive innovators are more likely to price relative to the market alternative. We explore why this might be using the Clayton Christensen model of disruptive innovation.
What is value management? (And why you should care). A document from back in November 2012 that sets out the basic approach to value management, and how it integrates innovation, marketing, sales and of course pricing. A new version of this document is in development.


text:
package com.puresoltechnologies.maven.plugins.license;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.regex.Pattern;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.License;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;

import com.puresoltechnologies.maven.plugins.license.internal.ArtifactUtilities;
import com.puresoltechnologies.maven.plugins.license.internal.DependencyTree;
import com.puresoltechnologies.maven.plugins.license.internal.IOUtilities;
import com.puresoltechnologies.maven.plugins.license.parameter.ArtifactInformation;
import com.puresoltechnologies.maven.plugins.license.parameter.KnownLicense;
import com.puresoltechnologies.maven.plugins.license.parameter.ValidationResult;

/**
 * This class is a Maven Mojo to check the validity of licenses specified in the
 * dependencies of a maven module.
 *
 * Used to configure injection of Plexus components by
 * MavenPluginManager.getConfiguredMojo(...) and special Maven objects as well:
 *
 * mojoExecution org.apache.maven.plugin.MojoExecution project
 * org.apache.maven.project.MavenProject session
 * org.apache.maven.execution.MavenSession settings
 * org.apache.maven.settings.Settings plugin (Maven-3 only)
 * org.apache.maven.plugin.descriptor.PluginDescriptor
 *
 * @author Rick-Rainer Ludwig
 */
@Mojo(//
        name = "verify", //
        requiresDirectInvocation = false, //
        requiresProject = true, //
        requiresReports = false, //
        requiresOnline = false, //
        inheritByDefault = true, //
        threadSafe = true, //
        requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME, //
        requiresDependencyCollection = ResolutionScope.COMPILE_PLUS_RUNTIME//
)
public class ValidatorMojo extends AbstractValidationMojo {

    private static final String TEST_SCOPE_NAME = "test";

    @Parameter(alias = "knownLicenses", required = true)
    private Set<KnownLicense> knownLicenses;

    @Parameter(alias = "outputDirectory", required = false, defaultValue = "${project.build.directory}/licenses")
    private File outputDirectory;

    /**
     * This parameter contains whether this Mojo shall fail fast (with first
     * occurrence of an invalid license) or should do all the work first before
     * failing. Default value is false.
     */
    @Parameter(alias = "failFast", required = false, defaultValue = "false")
    private boolean failFast;

    /**
     * This parameter contains whether or not the dependency should be checked
     * recursively or not. Default is true.
     */
    @Parameter(alias = "recursive", required = false, defaultValue = "true")
    private boolean recursive;

    /**
     * Specifies whether or not the dependencies in test scope should be skipped.
     * Default is false.
     */
    @Parameter(alias = "skipTestScope", required = false, defaultValue = "true")
    private boolean skipTestScope;

    /**
     * Specifies whether or not the dependencies in provided scope should be
     * skipped. Default is false.
     */
    @Parameter(alias = "skipProvidedScope", required = false, defaultValue = "true")
    private boolean skipProvidedScope;

    /**
     * Specified whether or not to skip archetypes with optional flag.
     */
    @Parameter(alias = "skipOptionals", required = false, defaultValue = "true")
    private boolean skipOptionals;

    /**
     * Specified whether or not to skip the whole plugin execution.
     */
    @Parameter(alias = "skip", required = false, defaultValue = "false")
    private boolean skip;

    @Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        storeSettings();
        if (!skip) {
            DependencyTree dependencyTree = loadArtifacts(recursive, skipTestScope, skipProvidedScope, skipOptionals);
            validateArtifacts(dependencyTree);
        }
    }

    private void storeSettings() throws MojoExecutionException {
        File file = IOUtilities.createNewSettingsFile(getLog(), outputDirectory);
        try (FileOutputStream fileOutputStream = new FileOutputStream(file);
                OutputStreamWriter propertiesWriter = new OutputStreamWriter(fileOutputStream,
                        Charset.defaultCharset())) {
            Properties properties = new Properties();
            properties.setProperty("recursive", Boolean.toString(recursive));
            properties.setProperty("skipTestScope", Boolean.toString(skipTestScope));
            properties.setProperty("skipProvidedScope", Boolean.toString(skipProvidedScope));
            properties.setProperty("skipOptionals", Boolean.toString(skipOptionals));
            properties.setProperty("skip", Boolean.toString(skip));
            properties.store(propertiesWriter, "license-maven-plugin settings.");
        } catch (IOException e) {
            throw new MojoExecutionException("Could not write settings.properties.", e);
        }
    }

    /**
     * This method checks a set of artifacts for validity.
     *
     * @param dependencies is a {@link Set} of {@link Artifact} which is to be
     *                     checked for validity.
     * @throws MojoExecutionException is throw if the execution was faulty.
     * @throws MojoFailureException   is thrown if an invalid license is found.
     */
    private void validateArtifacts(DependencyTree dependencyTree) throws MojoExecutionException, MojoFailureException {
        File licenseResultsFile = IOUtilities.createNewResultsFile(getLog(), outputDirectory);
        try (FileOutputStream outputStream = new FileOutputStream(licenseResultsFile);
                OutputStreamWriter writer = new OutputStreamWriter(outputStream, Charset.defaultCharset())) {
            boolean valid = true;
            List<String> checkedArtifact = new ArrayList<>();
            for (DependencyTree dependency : dependencyTree) {
                Artifact artifact = dependency.getArtifact();
                if (artifact == getMavenProject().getArtifact()) {
                    // skip self, it is not needed to be evaluated
                    continue;
                }
                String artifactIdentifier = ArtifactUtilities.toString(artifact);
                if (checkedArtifact.contains(artifactIdentifier)) {
                    continue;
                }
                checkedArtifact.add(artifactIdentifier);
                if (!isArtifactValid(dependency, writer)) {
                    if (failFast) {
                        throw new MojoFailureException("Invalid license(s) was/were found!");
                    }
                    valid = false;
                }
            }
            if (!valid) {
                throw new MojoFailureException("Invalid license(s) was/were found!");
            }
        } catch (IOException e) {
            throw new MojoExecutionException("Could not write validation result to '" + licenseResultsFile + "'.", e);
        }
    }

    /**
     * This method checks the validity of a single artifact.
     *
     * @param artifact is the {@link Artifact} to be checked for validity.
     * @return true is returned if the license is valid.
     *         false is returned otherwise.
     * @throws MojoFailureException   is thrown if {@link #failFast} is set to
     *                                true and the license is invalid
     *                                to enforce the fail fast behavior requested.
     * @throws MojoExecutionException is thrown in case of a faulty Maven run.
     */
    private boolean isArtifactValid(DependencyTree dependency, OutputStreamWriter writer)
            throws MojoFailureException, MojoExecutionException {
        Artifact artifact = dependency.getArtifact();
        ArtifactInformation artifactInformation = new ArtifactInformation(artifact);

        if (skipTestScope) {
            String scope = artifact.getScope();
            if ((scope != null) && (TEST_SCOPE_NAME.equals(scope.toLowerCase()))) {
                ValidationResult result = new ValidationResult(artifactInformation, null, null, null, "test scope",
                        true);
                logArtifactResult(result, writer);
                return true;
            }
        }

        List<License> licenses = dependency.getLicenses();
        if (licenses.size() == 0) {
            KnownLicense knownLicense = findKnownLicense(artifactInformation);
            if (knownLicense != null) {
                ValidationResult result = new ValidationResult(artifactInformation, knownLicense, null, null,
                        "no license found, but dependency is approved", true);
                logArtifactResult(result, writer);
                return true;
            } else {
                ValidationResult result = new ValidationResult(artifactInformation, null, null, null,
                        "no license found and artifact is not approved", false);
                logArtifactResult(result, writer);
                return false;
            }
        }
        boolean valid = true;
        for (License license : licenses) {
            String licenseName = license.getName();
            URL licenseURL;
            try {
                licenseURL = new URL(license.getUrl());
            } catch (MalformedURLException e) {
                licenseURL = null;
            }
            KnownLicense knownLicense = findKnownLicense(artifactInformation);
            if (knownLicense != null) {
                ValidationResult result = new ValidationResult(artifactInformation, knownLicense, licenseName,
                        licenseURL, "license is approved by artifact", true);
                logArtifactResult(result, writer);
            } else {
                knownLicense = findKnownLicense(artifactInformation, license);
                if (knownLicense != null) {
                    ValidationResult result = new ValidationResult(artifactInformation, knownLicense, licenseName,
                            licenseURL, "license is approved", true);
                    logArtifactResult(result, writer);
                } else {
                    ValidationResult result = new ValidationResult(artifactInformation, null, licenseName, licenseURL,
                            "license is not approved", false);
                    logArtifactResult(result, writer);
                    valid = false;
                }
            }
        }
        return valid;
    }

    /**
     * This method returns the normalized name of the license.
     *
     * @param artifactInformation
     *
     * @param license             is the {@link License} object which is to be
     *                            looked up.
     * @return A {@link KnownLicense} is returned containing the known license.
     * @throws MojoFailureException is thrown if the normalized name cannot be
     *                              looked up due to missing configuration.
     */
    private KnownLicense findKnownLicense(ArtifactInformation artifactInformation, License license)
            throws MojoFailureException {
        for (KnownLicense knownLicense : knownLicenses) {
            if (knownLicense.getName().equals(license.getName())) {
                return knownLicense;
            }
            for (String alias : knownLicense.getAliases()) {
                if ((alias == null) || (alias.isEmpty())) {
                    throw new MojoFailureException("An alias was found without identifier.");
                }
                if (alias.equals(license.getName())) {
                    return knownLicense;
                }
            }
        }
        return null;
    }

    private KnownLicense findKnownLicense(ArtifactInformation artifactInformation) throws MojoFailureException {
        for (KnownLicense knownLicense : knownLicenses) {
            for (String approvedDependency : knownLicense.getApprovedDependencies()) {
                if ((approvedDependency == null) || (approvedDependency.isEmpty())) {
                    throw new MojoFailureException("An approved dependency was found without identifier.");
                }
                if (Pattern.matches(approvedDependency, artifactInformation.getIdentifier())) {
                    return knownLicense;
                }
            }
        }
        return null;
    }

    /**
     * This method is used to log results with Maven log {@link Log}.
     *
     * @param artifact                 is the {@link Artifact} which was checked for
     *                                 validity.
     * @param validationResult         is the {@link ValidationResult} of the check.
     * @param licenseOrApprovalMessage is the message to be printed containing the
     *                                 license or the appoval message.
     * @param knownLicense
     * @throws MojoExecutionException
     * @throws IOException
     * @throws MojoFailureException
     */
    private void logArtifactResult(ValidationResult validationResult, OutputStreamWriter writer)
            throws MojoExecutionException, MojoFailureException {
        StringBuffer buffer = new StringBuffer();
        buffer.append("License ");
        String originalLicenseName = validationResult.getOriginalLicenseName();
        if (originalLicenseName != null) {
            buffer.append("'");
            buffer.append(originalLicenseName);
            buffer.append("' ");
            URL originalLicenseURL = validationResult.getOriginalLicenseURL();
            if (originalLicenseURL != null) {
                buffer.append("(");
                buffer.append(originalLicenseURL.toString());
                buffer.append(") ");
            }
        }
        buffer.append("checked for artifact '");
        ArtifactInformation artifactInformation = validationResult.getArtifactInformation();
        buffer.append(artifactInformation.getIdentifier());
        buffer.append("': \n     >> ");
        if (validationResult.isValid()) {
            buffer.append("valid as '");
            KnownLicense license = validationResult.getLicense();
            buffer.append(license.getName());
            buffer.append("' (");
            buffer.append(validationResult.getComment());
            buffer.append(")");
            getLog().info(buffer.toString());
        } else {
            buffer.append("invalid (");
            buffer.append(validationResult.getComment());
            buffer.append(")");
            getLog().error(buffer.toString());
        }
        IOUtilities.writeResult(writer, validationResult);
    }
}

redpajama_set_name: RedPajamaGithub


You are cordially invited in a two-day-conference 21-22 August, 2019 (Tentative Dates) on "Paradigms of Marginality in Literature" in Madurai Kamaraj University, Tamil Nadu. Please email us at editor@expressionjournal.com. Get your book published in 15 days from Delhi based reputed publishers. We invite only original and unpublished papers for any call for submission. You can get Turnitin report of your thesis or write up from us.
The Expression, a not-for-profit, International Bi-monthly Refereed Multidisciplinary e-Journal with International Standard Serial Number (ISSN: 2395-4132), welcomes the submission of manuscripts which meet the general criteria of outstanding significance, exceptional excellence and refined novelty. It provides rapid publication with current Impact Factor 3.9 and open access facility of all its contents to the wide range of people across the globe. The journal welcomes the submission of all manuscripts that meet the quality parameters of international standard for our regular issues. All the submissions must be original, scholarly and unpublished. The journal encourages interpretative criticism, fresh insights and creative writing skills to its readers and writers also. Research articles from all areas of English Literature, English Language Teaching, Short-Essays, Book-Reviews, Interviews, Poems, Short-Stories, Translated Works and Monologues etc. are entertained in this journal. Hence it is multidisciplinary journal, it invites papers from a wide range of subjects such as Education, Economics, Computer Science, Geography, Physical Education and Accountancy etc. All faculty members, students, scholars, independent researchers, poets and short-story writers from all over the world are invited to send their submissions. We try to follow a strict double-blind review of the manuscripts and we neither divulge the identity of the reviewer nor the author. Our effort is to give an opportunity to research scholars and experts equally to publish their works on this international platform. Only quality submissions free from plagiarism are being invited. So, it is must for our esteemed contributors to ensure Zero Plagiarism otherwise concerned person will be blocked forever for this journal if found any plagiarized material at any stage. On receiving large number of manuscripts, decision of peer review committee, in accordance with editor-in-chief, will be final and binding. It is hoped that this journal will prove a milestone in shaping the career of young authors and giving a new flavour to the interests of the experts also. It will stimulate the young minds and cudgel the brains of the erudite people as well by its innovative thoughts, critical insights and creative flavour.
It is an open-access, double blind peer reviewed International Journal.
We have reviewers' team from various universities or colleges from private or government sector.
You can download any article from the website free of cost.
Expression Journal is published bimonthly with six issues per year.
The Expression Journal makes every possible effort to ensure the accuracy of all the contents however it is not responsible for any discrepancies inadvertently occurred while editing manuscript. The journal retains copyright and makes no representations or warranties whatsoever with respect of the views, opinions or originality etc. of the published manuscripts. Editor or any other member of this journal will not be responsible for any claim in this regard. It is only the author's responsibility of the originality of the submitted work. It is automatically acknowledgment that the contributor has read our guidelines before submitting any manuscript by email or online submission. The accountability of the subject matter articulated in this journal is entirely of the concerned author and the concerned author is solely responsible for copyright or legal etc. any issue if claimed in future and onus is solely responsible for any penalty, loss or legal action.


The global agriculture insurance market size is expected to grow at a CAGR of 2.8% by 2022 driven by increasing government support in the form of subsidies. Increasing natural calamities destroying farmlands and consequently hampering the agriculture output, as well as the income of farmers across the world, has resulted in driving the awareness regarding the benefits offered by agriculture reinsurance.
Perpetual demand for food from the ever-rising population of the world has put a lot of pressure on increasing agriculture yields. Factors such as seasonality and other uncontrollable environment issues in tandem with downward pressure on food prices result in low-profit margins for the farmers. Agriculture insurance has been developed as a safety net by a council of leading governing bodies across to world to protect farmers and combat food security concerns for the burgeoning population of the world.
Agriculture is one of the main contributors to GDP of several economies across the world including India, China, and the U.S. These countries, whose main source of economy is agriculture, are facing myriad risks in production due to which agro insurance has emerged as a risk management tool for farmers, agricultural producers, and other stakeholders. Agri insurance includes crop insurance as well as it covers aquaculture, livestock, bloodstock, forestry, and greenhouse.
From a regional perspective, North America has been dominating the global agriculture insurance market as government and agencies are trying to reducing agricultural risk in a comprehensive manner. This helps generate a suitable framework for expanding and diversifying the insurance market with optimum crop insurance benefits. Asia Pacific and Europe were the other two main farm insurance marketplaces across the globe.
In terms of insurance type, crop/MPCI insurance contributed to the highest premium within the global agriculture insurance market. This was followed by crop/hail and livestock. Multi-peril crop insurance (MPCI) protects farmers against loss of crop yield by insuring a specific percentage of the previously produced crop.
Crop/hail insurance and livestock insurance are the other forms of agriculture insurance schemes that are likely to witness an uptake over the next few years. Crop insurance schemes are likely to witness tremendous penetration due to the numerous initiatives implemented by numerous governments to protect their farmers.
People's Insurance Company (Group) of China Ltd. (PICC), Rural Community Insurance Agency, Inc. (RCIS), QBE Insurance Group Limited, Chubb Corporation, American Financial Group, Inc., XL Group Ltd., and Tokio Marine Holdings, Inc. are some of the leading crop insurance companies with a presence across the world.
The competitive landscape of the global agricultural insurance industry is highly fragmented owing to the presence of several local players. Typically, a majority of players cater to their local market and penetrate into international markets by partnering with a local insurance provider. For instance, in September 2017, LiNiu Technology Group and People's Insurance Company of China Ltd (PICC) signed a strategic agreement to offer insurance services for the agriculture sector, by proving tailored insurance benefit plans.
We have been already working on banking and financial sector which includes different types of insurance solutions provided by various banks and financial institutions. However, we found that agriculture insurance is gaining tremendous importance due to the growing demand for agricultural production.
Significant driving and restraining factors have been discussed in the global agriculture insurance market study. Additionally, the report discusses the opportunities available for the market in the future.


text:
Courtesy of the Musical Wonder House, Wiscasset, Maine
A music box is a mechanical musical instrument that is sounded when tuned metal prongs, or teeth, mounted in a line on a flat comb are made to vibrate by contact with a revolving cylinder or disk that is driven by a clockwork mechanism. As the cylinder or disk revolves, small pins or other projections mounted on its surface pluck the pointed ends of the metal teeth, causing them to vibrate and produce musical notes. The sequence of notes produced is determined by the arrangement of projections on the cylinder. The deeper the teeth are cut into the comb or flat plate, the lower their pitch when plucked. A watch spring and clockwork move the cylinder, and a fly regulator governs the rate.
The music box was a popular household instrument from about 1810 until the early 20th century, when the player piano and the phonograph rendered it obsolete. The device was probably invented about 1770 in Switzerland. The earliest music boxes were small enough to be enclosed in a pocket watch, but they were gradually built in larger sizes and housed in rectangular wooden boxes. A typical large music box had a comb of 96 steel teeth plucked by pins on a brass cylinder 13 inches (330 millimeters) long, and the cylinder could be changed to allow different musical selections. Changing and storing the cylinders proved cumbersome, however, and so in the 1890s they were replaced by a large-diameter metal disk (shaped and revolved somewhat like a phonograph record) with projections or slots on its surface to pluck the teeth. The disks, which reached 2.5 feet (75 centimeters) in diameter, could be easily changed, and disk music boxes had displaced cylinder models in popularity by 1900. By 1910, however, music boxes had been largely replaced by the phonograph. The music box is one of several idiophones (instruments whose sounding parts are resonant solids) that are plucked rather than vibrated by percussion.


text:
YouTube Kids, Gasol brothers get healthy together
The app has partnered with NBA stars Pau and Marc Gasol to encourage kids to make healthy choices in light of World Day of Physical Activity.
Following themed campaigns around science and reading, YouTube Kids has its sights set on encouraging kids to make healthy choices. The app has partnered with the Gasol Foundation to launch the video playlist Make it Healthy, Make it Fun in honor of today's World Day of Physical Activity.
The Gasol Foundation—run by NBA stars and brothers Pau and Marc Gasol—has programs in the US and Spain. Its main goals are to raise awareness about the importance of physical activity and to advocate for the benefits of a healthy lifestyle.
The Make It Healthy, Make It Fun playlist includes 20 videos—available in both English and Spanish—that feature cartoons and include information on fun exercises and nutritional recipes. And throughout the content, the brothers share their personal thoughts about health and wellness.
The initiative comes as childhood obesity rates continue to rise. According to the US Center for Disease Control and Prevention (CDC), the percentage of childhood obesity in the US has more than tripled since the 1970s. Today, more than one in five kids ages six to 19 is considered obese.
Research from the World Health Organization's Commission on Ending Childhood Obesity found that 42 million infants and young children around the world were overweight or obese in 2013. If current trends continue, the commission predicted that 70 million young children will be overweight or obese by 2025.
Last year, YouTube Kids launched several similar campaigns with playlists designed to spark curiosity in science and innovation (the #TodayILearned campaign) as well as in reading (the #readalong campaign).
Gasol Foundation, YouTube, YouTube Kids
Google launching YouTube Kids app
A short-form revolution?
A new reading movement for YouTube Kids
Digital discovery channels


text:
Priyanka Gandhi amuses audience in Assam by plucking tea leaves with tea workers
LatestNationalTOP STORIES
By PNI Admin	 Last updated Mar 3, 2021
From Bhupen Goswami
GUWAHATI : Continuous efforts are being made by the Congress to reach out to different sections and woo them in the Assam assembly elections. Congress general secretary Priyanka Gandhi is on a state visit. On Monday, she had darshan at kamakhya Temple and met party workers in Lakhimpur district. Later the Congress leader arrived at the Sadhuru tea plantation in Vishwanath District on Tuesday. In the garden, Priyanka was seen in working dress like other employees of the tea garden. They pluck tea leaves with their hands and put them in the basket. Wearing a saree, the 49-year-old had a basket on her back balanced by one hand on her head. She also wore an apron as she took on the task of plucking tea leaves.
"The life of tea garden workers is full of truth and simplicity and their labor is valuable to the country. Today I understood his work, felt the difficulties of his families and their lives well," Gandhi tweeted with pictures of himself interacting with tea workers. I will not forget the love he has received from him," he added. Earlier in the day, he received a warm welcome at the tea plantation, photos of which were shared by The Congress on its official Twitter handle.
This time the electoral fight in the state is between BJP and Congress-AIUDF combine. The Congress is trying to reach out to all sections in the electoral state. He is working under a strategy for this. Electoral analysts believe that Priyanka's Kamakhya temple is an attempt to attract Hindu voters. Priyanka is trying to connect youth and women with a coalition of seven Congress-led parties from her two-day visit. Priyanka had two meetings in the state on Monday. His first meeting was held with the youth in Lakhimpur while the second programme was with the tea plantation workers and women help groups at Gohpur. The BJP is also looking at these two groups. Speaking at the BJP government in Lakhimpur, the Congress leader said, "You are the biggest force of the state. I have come here to start a programme for all the people. The demonstration will now be in every district and block of the state. You need to know your leader. If you do not know the truth, you will not be able to secure your future.
Priyanka Gandhi questions PM Modi! What happened promise to give 2.5 million jobs? He said the BJP government had promised to provide 25 lakh jobs here but in five years they did not even give 80,000 jobs. Addressing the women in Gohpur, Priyanka appealed to her to vote for the Congress alliance. He said, "When the elections come to a close, they are distributing the scooty… are helping self help groups. What were they doing for the last five years? Your life is very difficult. You don't have to keep quiet. Crimes against women have increased in the state. The Government has done nothing to stop the crime. In Assam, the Congress has announced 5 guarantees for the state if the Congress will form in power. Congress general secretary Priyanka Gandhi addresses mega rally at Tezpur in Assam. Priyanka Gandhi said that Assam is your mother and you are fighting to save your identity and existence.
The BJP government did not fulfil the promises made to you and also attacked your identity. We are not giving promises to you. These 5 guarantees are to improve your future. 1-We will enact a law which does not apply to the CAA here. For the housewives of Assam, rs. 2000 per month will be given a housewife honour amount. 200 units of electricity will be free which will save Rs. 1400 per month. We will give a remuneration of Rs.365 per day to the tea plantation workers. We will give 5 lakh jobs to the youth. A sea of people turned out for Priyanka Gandhi's mega campaign rally in Tezpur. All top leaders of Assam Congress joined Priyanka Gandhi at the rally. BPF chief Hagram Mohileri, whose party had recently joined the grand alliance after snapping up ties with the BJP, was also present at the massive rally. However, Assam assembly elections will be held in three phases. In the first phase, 47 seats in 12 districts will go to polls on 27th March. In the second phase, 39 seats in 13 districts will go to polls on April 1 while 40 assembly constituencies in 12 districts will go to polls on April 6. Counting of votes will be held on May 2
PNI Admin
"From Corona Epidemic to Arogya Revolution: On the Path of the Vedas"
Filing of nominations begins for 1st phase of Assembly Elections in Assam and West Bengal
'Azadi Ke Amrit Mahotsav' Launch: PM recalls sacrifices made by women…
Centre asks States, UTs to scale up testing to check Covid-19 spread
Azadi ka Amrit Mahotsav: Flypast over Rajpath with 75 aircraft from Armed Forces
Republic Day Celebrations to begin every year from 23rd January instead of 24


text:
<?php
/**
 * Author: Pavel Naumenko
 */

namespace app\modules\store\controllers;

use app\models\Payment;
use app\models\PaymentLog;
use app\modules\store\models\StoreOrder;
use frontend\components\UnusedParamsFilter;
use frontend\controllers\FrontController;
use yii\web\HttpException;

/**
 * Class PaymentController
 *
 * @package frontend\modules\store\controllers
 */
class PaymentController extends FrontController
{
    /**
     * @inheritdoc
     */
    public $enableCsrfValidation = false;

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'paramsFilter' => [
                'class' => UnusedParamsFilter::className(),
                'actions' => [
                    'pay' => ['orderId'],
                ]
            ],
        ];
    }

    /**
     * @param $orderId
     *
     * @return string
     * @throws HttpException
     */
    public function actionPay($orderId)
    {
        $this->layout = false;

        $order = StoreOrder::find()
            ->andWhere('id = :id', [':id' => $orderId])
            ->andWhere(['status' => \common\models\StoreOrder::STATUS_NEW])
            ->one();

        if (!$order) {
            throw new HttpException(404, \Yii::t('frontend', 'Order not found'));
        }

        $payment = Payment::createPayment($order);

        if (!$payment) {
            throw new HttpException(404, \Yii::t('frontend', 'Unreachable payment'));
        }

        return $this->render('pay', ['form' => $payment->getPaymentForm(['orderId' => $payment->order_id])]);
    }

    /**
     * @return string
     */
    public function actionValidate()
    {
        $validPaymentId = Payment::validatePayment(\Yii::$app->request->post());

        if ($validPaymentId) {
            /**
             * @var Payment $payment
             */
            $payment = Payment::find()->andWhere(
                'id = :id AND status = :st',
                [
                    ':st' => Payment::STATUS_WAIT_FOR_CONFIRM,
                    ':id' => (int)$validPaymentId
                ]
            )->one();
            if ($payment) {
                if (!$payment->makePaymentPaid()) {
                    PaymentLog::add('Не получилось изменить статус платежа '.$payment->id);
                    return false;
                }

                return true;
            } else {
                PaymentLog::add('Не найден платеж #' . $validPaymentId . ' для подтверждения.');

                return false;
            }
        }
    }

    /**
     * @return string
     */
    public function actionSuccessPayment()
    {
        //$this->layout = '//simple';

        return $this->render('success');
    }

    /**
     * @return string
     */
    public function actionFailedPayment()
    {
        //$this->layout = '//simple';

        return $this->render('fail');
    }
}