text:
using Xunit;

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.extensionmethod004.extensionmethod004
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.extensionmethod004.extensionmethod004;

    static // <Title>Extension method that extends dynamic</Title>
           // <Description>
           // </Description>
           // <RelatedBugs></RelatedBugs>
           //<Expects Status=success></Expects>
           //
public class MyClass
    {
        public static dynamic Foo(this int x)
        {
            return x;
        }
    }

    public class Test
    {
        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            int x = 3;
            dynamic d = x.Foo();
            try
            {
                d.AnotherFoo(); //This will throw at runtime
            }
            catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException e)
            {
                if (ErrorVerifier.Verify(ErrorMessageId.NoSuchMember, e.Message, "int", "AnotherFoo"))
                    return 0;
            }

            return 1;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.extensionmethod005.extensionmethod005
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.extensionmethod005.extensionmethod005;

    static // <Title>Extension method that extends dynamic</Title>
           // <Description>
           // </Description>
           // <RelatedBugs></RelatedBugs>
           //<Expects Status=success></Expects>
           //
public class MyClass
    {
        public static dynamic Foo(this int x, dynamic d)
        {
            return d;
        }
    }

    public class Test
    {
        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            var x = 3;
            dynamic d = x.Foo(4);
            try
            {
                //This should not compile if the return type of Foo is not dynamic
                d.Bar();
            }
            catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException e)
            {
                if (ErrorVerifier.Verify(ErrorMessageId.NoSuchMember, e.Message, "int", "Bar"))
                    return 0;
            }

            return 1;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.extensionmethod006.extensionmethod006
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.extensionmethod006.extensionmethod006;

    static // <Title>Extension method that extends dynamic</Title>
           // <Description>
           // </Description>
           // <RelatedBugs></RelatedBugs>
           //<Expects Status=success></Expects>
           //
public class MyClass
    {
        public static string Foo(this object x, dynamic d)
        {
            return d.ToString();
        }
    }

    public class Test
    {
        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            object x = "foo";
            dynamic d = x.Foo(4);
            if ((string)d != "4")
                return 1;
            try
            {
                d.Bar();
            }
            catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException e)
            {
                if (ErrorVerifier.Verify(ErrorMessageId.NoSuchMember, e.Message, "string", "Bar"))
                    return 0;
            }

            return 1;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.extensionmethod008.extensionmethod008
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.extensionmethod008.extensionmethod008;
    // <Title>Extension method that extends dynamic</Title>
    // <Description>
    // </Description>
    // <RelatedBugs></RelatedBugs>
    //<Expects Status=success></Expects>
    //
    using System;

    public class Test
    {
        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod());
        }

        public static int MainMethod()
        {
            Test t = new Test();
            dynamic d = 10;
            int result = t.Method(d);
            return result;
        }

        public int Method(int value)
        {
            return 0;
        }
    }

    public static class Extension
    {
        public static int Method(this Test t, int value)
        {
            return 1;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method001.method001
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method001.method001;

    public class Test
    {
        private static bool s_ok = false;
        private class MyClass
        {
            public void Foo(dynamic d)
            {
                string s = (string)d.ToString();
                if (s == "3")
                    Test.s_ok = true;
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass mc = new MyClass();
            mc.Foo(3);
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method002.method002
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method002.method002;

    public class Test
    {
        private static bool s_ok = false;
        private class MyClass
        {
            public void Foo(out object d)
            {
                d = 3;
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass mc = new MyClass();
            dynamic x;
            mc.Foo(out x);
            if ((int)x == 3)
                Test.s_ok = true;
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method003.method003
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method003.method003;

    public class Test
    {
        private static bool s_ok = false;
        private class MyClass
        {
            public void Foo(dynamic d)
            {
                if ((string)d.ToString() == "3")
                    Test.s_ok = true;
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass mc = new MyClass();
            mc.Foo(3);
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method004.method004
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method004.method004;

    public class Test
    {
        private static bool s_ok = false;
        private class MyClass
        {
            public void Foo(ref dynamic d)
            {
                d = 4;
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass mc = new MyClass();
            dynamic o = 3;
            mc.Foo(ref o);
            if ((string)o.ToString() == "4")
                Test.s_ok = true;
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method005.method005
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method005.method005;

    public class Test
    {
        private static bool s_ok = false;
        public class MyClass
        {
            public void Foo(params dynamic[] d)
            {
                if (d.Length == 3)
                    Test.s_ok = true;
                if ((string)d[0].ToString() != "3")
                    Test.s_ok = false;
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass mc = new MyClass();
            dynamic o = 3;
            mc.Foo(o, 1, null);
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method007.method007
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method007.method007;

    public class Test
    {
        private static bool s_ok = false;
        public class MyClass
        {
            public void Foo(dynamic d, dynamic d2)
            {
                if ((string)d.ToString() == "3" && (string)d2.ToString() == "5")
                    Test.s_ok = true;
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass mc = new MyClass();
            dynamic o = 3;
            dynamic d = 5;
            mc.Foo(o, d);
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method008.method008
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method008.method008;

    public class Test
    {
        private static bool s_ok = false;
        public class MyClass
        {
            public void Foo(dynamic d, int d2)
            {
                if ((string)d.ToString() == "3" && d2 == 5)
                    Test.s_ok = true;
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass mc = new MyClass();
            dynamic o = 3;
            mc.Foo(o, 5);
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method009.method009
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method009.method009;

    public class Test
    {
        private static bool s_ok = false;
        public class MyClass
        {
            public void Foo(dynamic d, dynamic d2, dynamic d3)
            {
                if ((string)d.ToString() == "3" && (string)d2.ToString() == "3" && (string)d3.ToString() == "3")
                    Test.s_ok = true;
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass mc = new MyClass();
            dynamic o = 3;
            mc.Foo(o, o, o);
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method010.method010
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method010.method010;

    public class Test
    {
        private static bool s_ok = false;
        public class MyClass
        {
            public MyClass(params dynamic[] d)
            {
                if (d.Length == 3)
                    Test.s_ok = true;
                if ((string)d[0].ToString() != "3")
                    Test.s_ok = false;
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            dynamic o = 3;
            MyClass mc = new MyClass(o, 1, null);
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method011.method011
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method011.method011;

    public class Test
    {
        private static bool s_ok = false;
        private class MyClass
        {
            public static void Foo(dynamic d)
            {
                string s = (string)d.ToString();
                if (s == "3")
                    Test.s_ok = true;
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass.Foo(3);
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method012.method012
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method012.method012;

    public class Test
    {
        private static bool s_ok = false;
        private class MyClass
        {
            public void Foo<T>(ref dynamic d)
            {
                d = default(T);
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass mc = new MyClass();
            dynamic o = 3;
            mc.Foo<int>(ref o);
            if ((string)o.ToString() == "0")
                Test.s_ok = true;
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method013.method013
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method013.method013;

    public class Test
    {
        private static bool s_ok = false;
        public class MyClass
        {
            public void Foo<T>(T d)
            {
                d = default(T);
            }
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            MyClass mc = new MyClass();
            dynamic o = 3;
            mc.Foo<dynamic>(o);
            if ((string)o.ToString() == "3")
                Test.s_ok = true;
            if (!Test.s_ok)
                return 1;
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method015.method015
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method015.method015;
    // <Title> Having dynamic as a parameter</Title>
    // <Description>
    // </Description>
    // <RelatedBugs></RelatedBugs>
    //<Expects Status=success></Expects>
    //
    using System;

    public class Program
    {
        public static int Status;
        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod());
        }

        public static int MainMethod()
        {
            var x = new C<int>();
            dynamic d = 3;
            x.M(d);
            if (Program.Status == 1)
                return 0;
            return 1;
        }
    }

    public class C<T>
    {
        public void M(T t)
        {
            Program.Status = 1;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method016.method016
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method016.method016;
    // <Title> Having more than 10 parameters but less than 32 should not crash the binder </Title>
    // <Description>
    // </Description>
    // <RelatedBugs></RelatedBugs>
    //<Expects Status=success></Expects>
    //
    using System;

    public class Program
    {
        public void Foo(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, int param11)
        {
            Program.Status = 1;
        }

        public static int Status;
        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod());
        }

        public static int MainMethod()
        {
            dynamic d = new Program();
            int x = 1;
            d.Foo(x, x, x, x, x, x, x, x, x, x, x);
            if (Program.Status == 1)
                return 0;
            return 1;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method017.method017
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method017.method017;
    // <Title> Having more than 10 parameters but less than 32 should not crash the binder </Title>
    // <Description>
    // </Description>
    // <RelatedBugs></RelatedBugs>
    //<Expects Status=success></Expects>
    //
    using System;

    public class Program
    {
        public void Foo(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14, int param15, int param16, int param17, int param18, int param19, int param20, int param21, int param22, int param23, int param24, int param25, int param26, int param27, int param28, int param29, int param30, int param31)
        {
            Program.Status = 1;
        }

        public static int Status;

        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod());
        }

        public static int MainMethod()
        {
            dynamic d = new Program();
            int x = 1;
            d.Foo(x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x);
            if (Program.Status == 1)
                return 0;
            return 1;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method018.method018
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method018.method018;
    // <Title> Having more than 10 parameters but less than 32 should not crash the binder </Title>
    // <Description>
    // </Description>
    // <RelatedBugs></RelatedBugs>
    //<Expects Status=success></Expects>
    //
    using System;

    public class Program
    {
        public void Foo(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14, int param15, int param16, int param17, int param18, int param19, int param20, int param21, int param22, int param23, int param24, int param25, int param26, int param27, int param28, int param29, int param30, int param31, int param32)
        {
            Program.Status = 1;
        }

        public static int Status;

        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod());
        }

        public static int MainMethod()
        {
            dynamic d = new Program();
            int x = 1;
            d.Foo(x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x);
            return 0;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method019.method019
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.method019.method019;

    public class Test
    {
        private static bool s_ok = false;
        public void Bar()
        {
            Test.s_ok = false;
        }

        private static void Foo(dynamic d)
        {
            d.Bar();
            Test.s_ok = true;
        }

        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            Foo(new Test());
            if (Test.s_ok)
                return 0;
            return 1;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.genericbaseclass001.genericbaseclass001
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.genericbaseclass001.genericbaseclass001;

    // <Title> Having dynamic as a type parameter in base class</Title>
    // <Description></Description>
    // <RelatedBugs></RelatedBugs>
    // <Expects Status=success></Expects>
    //
    public class Base<T>
    {
        public int M()
        {
            return 100;
        }
    }

    public class Derived<V> : Base<dynamic>
    {
    }

    public class Base2
    {
        virtual internal int M()
        {
            return 101;
        }
    }

    public class Derived2 : Base2<dynamic, V>
    {
        internal int P
        {
            get
            {
                return 111;
            }
        }

        internal override int M()
        {
            return base.M() + 1;
        }
    }

    public class Test
    {
        [Fact]
        public static void DynamicCSharpRunTest()
        {
            Assert.Equal(0, MainMethod(null));
        }

        public static int MainMethod(string[] args)
        {
            var v1 = new Derived<string>();
            bool ret = (100 == v1.M());
            var v2 = new Derived2<bool, bool>();
            ret &= (111 == v2.P);
            var v3 = new Derived2<object, decimal>();
            ret &= (102 == v3.M());
            return ret ? 0 : 1;
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.genericbaseclass002.genericbaseclass002
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.genericbaseclass002.genericbaseclass002;
    // <Title> Having dynamic as a type parameter in base class</Title>
    // <Description></Description>
    // <RelatedBugs></RelatedBugs>
    // <Expects Status=success></Expects>
    //
    using System;

    namespace NS
    {
        public class MyClass1<T>
        {
        }

        public class MyClass2 : MyClass1
        {
            public int this[int n]
            {
                get
                {
                    return ++n;
                }
            }
        }

        public class MyClass3<T> : MyClass2<dynamic>
        {
        }

        public class MyClass4<V> : MyClass3<V>
        {
        }

        public class Test
        {
            [Fact]
            public static void DynamicCSharpRunTest()
            {
                Assert.Equal(0, MainMethod(null));
            }

            public static int MainMethod(string[] args)
            {
                var v = new MyClass4<string>();
                bool ret = (100 == v[99]);
                var v2 = new MyClass3<dynamic>();
                ret &= (-99 == v2[-100]);
                return ret ? 0 : 1;
            }
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.genericbaseclass003.genericbaseclass003
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.genericbaseclass003.genericbaseclass003;
    // <Title> Having dynamic as a type parameter in base class</Title>
    // <Description></Description>
    // <RelatedBugs></RelatedBugs>
    // <Expects Status=success></Expects>
    //
    using System;

    namespace NS
    {
        public class MyClass1<T>
        {
        }

        public class MyClass11 : MyClass1<dynamic>
        {
            internal int M(int x, int y)
            {
                return x + y;
            }
        }

        public class MyClass12 : MyClass1<dynamic>
        {
            internal int M(int x, int y)
            {
                return x - y;
            }
        }

        public class Test
        {
            [Fact]
            public static void DynamicCSharpRunTest()
            {
                Assert.Equal(0, MainMethod(null));
            }

            public static int MainMethod(string[] args)
            {
                var v1 = new MyClass11<object, object>();
                bool ret = (300 == v1.M(100, 200));
                var v2 = new MyClass12<dynamic, float>();
                ret &= (-100 == v2.M(100, 200));
                return ret ? 0 : 1;
            }
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.genericbaseclass004.genericbaseclass004
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.genericbaseclass004.genericbaseclass004;
    // <Title> Having dynamic as a type parameter in base class</Title>
    // <Description>ICE</Description>
    // <RelatedBugs></RelatedBugs>
    // <Expects Status=success></Expects>
    //
    using System;

    namespace NS
    {
        public interface I1
        {
        }

        public interface I2<T> : I1
        {
        }

        public interface I3
        {
        }

        public class MyClass1<T> : I1, I2<T>
        {
            internal virtual int P
            {
                get
                {
                    return 123;
                }
            }
        }

        public class MyClass2 : MyClass1<dynamic>, I1, I2<V>
        {
        }

        public class MyClass3<X, Y, Z> : MyClass2<X, dynamic>, I3<X, Z>
        {
            internal new int P
            {
                get
                {
                    return base.P;
                }
            }
        }

        public class MyClass4 : MyClass1<dynamic>, I2<V>
        {
            internal override int P
            {
                get
                {
                    return 456;
                }
            }
        }

        public class Test
        {
            [Fact]
            public static void DynamicCSharpRunTest()
            {
                Assert.Equal(0, MainMethod(null));
            }

            public static int MainMethod(string[] args)
            {
                var v1 = new MyClass3<byte, dynamic, char>();
                bool ret = (123 == v1.P);
                var v2 = new MyClass4<dynamic, dynamic>();
                ret = (456 == v2.P);
                return ret ? 0 : 1;
            }
        }
    }
    //
}

namespace ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.genericbaseclass005.genericbaseclass005
{
    using ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.formalParameter.Methods.genericbaseclass005.genericbaseclass005;
    // <Title> Having dynamic as a type parameter in base class</Title>
    // <Description></Description>
    // <RelatedBugs></RelatedBugs>
    // <Expects Status=success></Expects>
    //
    using System;

    namespace NS
    {
        public interface I1
        {
        }

        public interface I2
        {
        }

        public interface I3<T> : I1, I2
        {
        }

        public interface I4 : I3
        {
        }

        public class MyClass1<T> : I1, I2 // where T : new()
        {
            public MyClass1()
            {
            }
        }

        public class MyClass2 : I1, I3 where U : class
        {
        }

        public class MyClass3<X, Y, Z> : MyClass2<X, dynamic>, I4<X, Z> where X : MyClass1<int> where Z : struct
        {
            internal int P
            {
                get
                {
                    return 123;
                }
            }
        }

        public class MyClass4 : MyClass1<dynamic>, I3<V> where U : new() where V : new()
        {
            internal int P
            {
                get
                {
                    return 456;
                }
            }
        }

        public class Test
        {
            [Fact]
            public static void DynamicCSharpRunTest()
            {
                Assert.Equal(0, MainMethod(null));
            }

            public static int MainMethod(string[] args)
            {
                var v1 = new MyClass3<MyClass1<int>, byte, char>();
                bool ret = (123 == v1.P);
                var v2 = new MyClass4<int, uint>();
                ret = (456 == v2.P);
                return ret ? 0 : 1;
            }
        }
    }
    //
}


text:
This package contains interfaces for various kinds of definitions
found in AS and MXML files.

A definition is anything in source code that can be referred to by name:
a package, namespace, class, interface, function, getter, setter,
parameter, variable, constant, event, style, or effect.

A key part of semantic analysis and code generation consists of
determining what each identifier node in an AST refers by resolving
it to a definition. This process is called name resolution
For example, when you write

for (var i:int = 0; i < n; i++)
{
    trace(i);
}

the first i produces a variable definition named "i".
The second, third, and fourth i get resolved to this definition.

Most definitions live within scopes. A scope can loosely be thought
of as representing either an entire file (for a file scope)
or a block of code delimited by curly braces (for a package scope,
class scope, interface scope, function/getter/setter scope,
catch scope, or with scope).
Curly braces within some statements, such as those of a for loop,
do not produce produce scopes, due to the "hoisting" rules of ActionScript.

In addition to being contained in a scope, some definitions contain an inner scope.
Therefore a file scope is the root of a hierarchical data structure
containing scopes and definitions.
(Think of it as the symbol table for the file.)
Definitions which are visible to other files are copied into a
project scope for cross-file name resolution.

For AS files, the abstract syntax tree is built first and the file scope
is built second. The definitions within the file scope are constructed from
definition nodes (that is, nodes implementing IDefinitionNode)
in the AST.
For MXML files, a DOM-like representation known as MXMLData
is built first, the file scope is built second, and the abstract syntax tree
is built third.
The definitions within the file scope are constructed from the MXML tags
of the MXMLData.

After being produced, scopes and definitions that are visible to other files
are always resident in memory, so that the other files can perform name resolution.
(In fact, they persist even after all other files have performed
named resolution, in order to support subsequent incremental compilation.)
Scopes and definitions that are internal to a particular file need
to exist only when the AST for that file is in memory.

The most important interface in this package is IDefinition
which is the base interface for all definitions.
Each specific type of definition has its own sub-interface:

		package
		IPackageDefinition

		namespace
		INamespaceDefinition

		class
		IClassDefinition

		interface
		IInterfaceDefinition

		function
		IFunctionDefinition

		getter
		IGetterDefinition

		setter
		ISetterDefinition

		parameter
		IParameterDefinition

		variable
		IVariableDefinition

		constant
		IConstantDefinition

		event
		IEventDefinition

		style
		IStyleDefinition

		effect
		IEffectDefinition

All definitions have

a source location;

an optional ASDoc comment;

an optional list of metadata annotations;

a namespace reference indicating its visibility,
such as public;

a set of flags indicating modifiers such as static
or override;

a base, or unqualified, name;

a type reference (which may be null
for some types of definitions.

Specific types of definitions of course store additional information.
For example, a class definition stores a reference to the class it extends
and references to the interfaces that it implements.

Definitions refer to other definitions indirectly, by name,
using an IReference. See the references
subpackage for an explanation of this design.

redpajama_set_name: RedPajamaGithub


text:
/**
 *
 */
package stack;

import peersim.core.Node;
import peersim.core.Protocol;
import peersim.edsim.EDProtocol;
import peersim.edsim.EDSimulator;
import stack.Message;;

/**
 * @author guthemberg
 *
 */
public class Net implements EDProtocol, Protocol {

	int app_protocol;
	long bwd=0L;
	long ts=0L;
	/**
	 *
	 */
	public Net(String prefix) {
	}

	public Object clone() {
        Net local = null;
        try {
        	local= (Net) super.clone();
        } catch (CloneNotSupportedException e) {
        	System.err.println("Unexpected error in:"+this.toString());
        }
    	return local;
    }

	public void send(Node src,Node dst, int network, Message msg){
	   long duration = ((msg.getLength()* this.ts)/(this.bwd));
	   EDSimulator.add(duration, msg, dst, network);
	}

	/* (non-Javadoc)
	 * @see peersim.edsim.EDProtocol#processEvent(peersim.core.Node, int, java.lang.Object)
	 */
	@Override
	public void processEvent(Node dst_node, int pid, Object msg) {
		Message message = (Message)msg;
		App app = (App)(dst_node).getProtocol(this.app_protocol);
		app.receiveData(message);
	}

	public void bootstrap(int application,long bwd, long ts){
		this.app_protocol=application;
		this.bwd=bwd;
		this.ts=ts;
	}

}


text:
# Shoestring

[![Filament Group](http://filamentgroup.com/images/fg-logo-positive-sm-crop.png) ](http://www.filamentgroup.com/)

A lightweight, simple DOM utility made to run on a tight budget.

Shoestring is part of the [Southstreet workflow](https://github.com/filamentgroup/southstreet) at Filament Group.

You can find more details in the [API documentation](http://filamentgroup.github.io/shoestring/dist/docs/).

[![Build Status](https://travis-ci.org/filamentgroup/shoestring.svg?branch=master)](https://travis-ci.org/filamentgroup/shoestring) [![devDependency Status](https://david-dm.org/filamentgroup/shoestring/dev-status.svg)](https://david-dm.org/filamentgroup/shoestring#info=devDependencies)

## Philosophy

Shoestring is a lightweight, modular DOM framework intended for developers who need their code to download and run as fast as possible. It is intended to be "just enough" of a tool to efficently write maintainable cross-browser JavaScript. The API is modeled after jQuery but we intentionally implement a tiny subset of the API to cover only the methods we commonly need in our projects.  Each feature is built as an optional extension to a minimal core so each can be removed from the production build (dependencies between extensions are rare). The selector engine delegates to modern browsers' native `document.querySelectorAll`, which means it requires browsers that support that feature, such as IE8. For projects that require deeper compatibility or a richer set of features, it is simple to swap in jQuery instead. As a rule, anything that works with Shoestring should work with jQuery, but not the converse.

Our goal is to strike a good balance of code weight, runtime speed, browser support, and developer convenience.

## Features

Shoestring's API is inspired by jQuery.

Technically, shoestring.js is a very small, extendable core function. That core function doesn't come with much more than a means of finding and/or generating HTML elements, a DOM-ready handler, and a few essential element-traversal methods like `each`, `find`, `children`. Using its `shoestring.fn` API, its core is easy to extend further, and many extensions are available for you to include in your build – the default build includes all extensions, but it's still very small (~3kb compressed).

If you are concerned about compatibility issues/pitfalls consider using the development build releases (`-dev` in the [releases](https://github.com/filamentgroup/shoestring/releases)). We've endeavored to throw exceptions where a particular invocation pattern or feature isn't supported as a means to document the disparity. We recommend that you use the development version in development and the regular non-`-dev` version in production.

There are three sets of extensions to the Shoestring core: DOM manipulation, events, and ajax.

### DOM

If you've used jQuery, the structure and behavior of the DOM manipulation methods will be immediately familiar:

```javascript
shoestring( ".foo" ).addClass( "bar" ).attr( "data-baz", "bak" );
```

That is, construct a sequence of elements from the DOM and invoke each method on all the elements of the sequence in turn. You can find a full list of the supported DOM methods and their arguments in the [API docs](http://filamentgroup.github.io/shoestring/dist/docs/) under the `dom/*` subdirectory.

### Events

Shoestring supports most of the jQuery events API including: custom events that bubble, event namespaces, a normalized event object, event arguments, DOM Ready, a `.one` method, comprehensive `.unbind`, etc. The major difference here is that Shoestring does not support the event delegation helpers built into jQuery, like `.delegate` or `.on` with a selector argument.

```javascript
shoestring( ".foo" ).bind( "click", function( event ) { ... });
```

Or with a custom event triggered on a child element:

```javascript
shoestring( ".foo" ).bind( "bar", function( event, arg ) {
  ...
  if(arg == 1) { ... }
  ...
});

// ...

shoestring( ".foo" ).children().first().trigger( "bar", 1 );
```

You can find a full list of the supported event methods and their arguments in the [API docs](http://filamentgroup.github.io/shoestring/dist/docs/) under the `events/*` subdirectory.

### Ajax

Shoestring supports a full `shoestring.ajax` method as well as some shorthand helpers like `shoestring.get` and `shoestring.post`.

```javascript
shoestring.ajax( "/foo", {
  success: function(){ ... },
  method: "GET",
  ...
});
```

Which could also be accomplished using `shoestring.get`

```javascript
shoestring.get( "/foo", function(){ ... });
```

You can find a full list of the supported ajax methods and their arguments in the [API docs](http://filamentgroup.github.io/shoestring/dist/docs/) under the `ajax/*` subdirectory.

## Extensions

Extending Shoestring is done in nearly the same fashion as jQuery. There is an object on which you can define properties using functions and those functions will have access to the Shoestring DOM element sequence during invocation using `this`. As an example the `remove` method:

```javascript
/**
 * Remove the current set of elements from the DOM.
 *
 * @return shoestring
 * @this shoestring
 */
shoestring.fn.remove = function(){
  return this.each(function(){
    if( this.parentNode ) {
      this.parentNode.removeChild( this );
    }
  });
};
```

It uses the `each` method to handle the DOM elements in the current sequence in turn.

**NOTE** these definitions must be made before a Shoestring object that depends on them is constructed. This is in contrast with jQuery where each object has access to new methods through the prototype chain.

### Modules

Each extension to Shoestring included in the repository is defined as an AMD module, but only for build purposes. We don't support, or plan to support, loading the library as modules in the browser.

```javascript
//>>excludeStart("exclude", pragmas.exclude);
define([ "shoestring", "dom/remove" ], function(){
//>>excludeEnd("exclude");

shoestring.fn.foo = function(){ ... };

//>>excludeStart("exclude", pragmas.exclude);
});
//>>excludeEnd("exclude");
```

Note that the AMD wrapper is removed during the process of the build and that the dependencies are defined from the `src` subdirectory. More on custom builds below.

### Dependencies

Browsing the modules in Shoestring you'll notice that very few have explicit dependencies in their module definitions. This is by design. We are interested in being able to select the minimum number of methods necessary for a given project to reduce load and parse times.

## Builds

Shoestring releases include two different builds, one for development and one for production. The development build is larger. It is intended to help with jQuery compatibility issues and includes other development utilities like the method tracker. The production build is meant to be shipped in production and does not include the extra dev-time helpers.

### Custom

This repository supports custom builds through creating a meta-module in the `build/custom/` directory and running the default Grunt task. To get started building a custom production build, do the following:

1. make sure the project dependencies are installed with `npm install`
2. copy `build/development.js` to `build/custom/foo.js`
3. run `grunt` or `node node_modules/.bin/grunt`
4. use `dist/foo.js`

### Tracker

Included in the development build is a method tracker. It works by proxying all calls to `shoestring.fn` methods through a corresponding method that records the invocation in local storage. **NOTE** this does not include methods defined on `shoestring`. Then the methods being used across pages by your application can be inspected.

```javascript
JSON.parse( window.localStorage.getItem(shoestring.trackedMethodsKey) );
```

If the method tracker is included during a significant portion of development this list can be used to remove unused functions from your Shoestring build with a custom meta-module.

## Contributing

Please see the [contribution guidelines](CONTRIBUTING.md).


text:
package org.maera.plugin.webresource;

import com.google.common.collect.Iterables;
import org.apache.commons.lang.StringUtils;
import org.maera.plugin.ModuleDescriptor;
import org.maera.plugin.Plugin;
import org.maera.plugin.PluginAccessor;
import org.maera.plugin.Resources;
import org.maera.plugin.Resources.TypeFilter;
import org.maera.plugin.elements.ResourceDescriptor;
import org.maera.plugin.elements.ResourceLocation;
import org.maera.plugin.servlet.*;
import org.maera.plugin.util.PluginUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;

import static com.google.common.collect.Iterables.filter;
import static org.maera.plugin.util.EfficientStringUtils.endsWith;

/**
 * Default implementation of {@link PluginResourceLocator}.
 *
 * @since 2.2
 */
public class PluginResourceLocatorImpl implements PluginResourceLocator {
    private static final Logger log = LoggerFactory.getLogger(PluginResourceLocatorImpl.class);

    public static final String PLUGIN_WEBRESOURCE_BATCHING_OFF = "plugin.webresource.batching.off";

    private static final String DOWNLOAD_TYPE = "download";

    final private PluginAccessor pluginAccessor;
    final private ServletContextFactory servletContextFactory;
    final private ResourceDependencyResolver dependencyResolver;

    private static final String RESOURCE_SOURCE_PARAM = "source";
    private static final String RESOURCE_BATCH_PARAM = "batch";

    public PluginResourceLocatorImpl(final WebResourceIntegration webResourceIntegration, final ServletContextFactory servletContextFactory) {
        this(webResourceIntegration, servletContextFactory, new DefaultResourceDependencyResolver(webResourceIntegration, new DefaultResourceBatchingConfiguration()));
    }

    public PluginResourceLocatorImpl(final WebResourceIntegration webResourceIntegration, final ServletContextFactory servletContextFactory,
                                     final ResourceBatchingConfiguration resourceBatchingConfiguration) {
        this(webResourceIntegration, servletContextFactory, new DefaultResourceDependencyResolver(webResourceIntegration, resourceBatchingConfiguration));
    }

    private PluginResourceLocatorImpl(final WebResourceIntegration webResourceIntegration, final ServletContextFactory servletContextFactory,
                                      final ResourceDependencyResolver dependencyResolver) {
        this.pluginAccessor = webResourceIntegration.getPluginAccessor();
        this.servletContextFactory = servletContextFactory;
        this.dependencyResolver = dependencyResolver;
    }

    public boolean matches(final String url) {
        return SuperBatchPluginResource.matches(url) || SuperBatchSubResource.matches(url) || SinglePluginResource.matches(url) || BatchPluginResource.matches(url);
    }

    public DownloadableResource getDownloadableResource(final String url, final Map<String, String> queryParams) {
        try {
            if (SuperBatchPluginResource.matches(url)) {
                return locateSuperBatchPluginResource(SuperBatchPluginResource.parse(url, queryParams));
            }
            if (SuperBatchSubResource.matches(url)) {
                return locateSuperBatchSubPluginResource(SuperBatchSubResource.parse(url, queryParams));
            }
            if (BatchPluginResource.matches(url)) {
                return locateBatchPluginResource(BatchPluginResource.parse(url, queryParams));
            }
            if (SinglePluginResource.matches(url)) {
                final SinglePluginResource resource = SinglePluginResource.parse(url);
                return locatePluginResource(resource.getModuleCompleteKey(), resource.getResourceName());
            }
        }
        catch (final UrlParseException e) {
            log.error("Unable to parse URL: " + url, e);
        }
        // TODO: It would be better to use Exceptions rather than returning
        // nulls to indicate an error.
        return null;
    }

    private DownloadableResource locateSuperBatchPluginResource(final SuperBatchPluginResource batchResource) {
        if (log.isDebugEnabled()) {
            log.debug(batchResource.toString());
        }

        for (final String moduleKey : dependencyResolver.getSuperBatchDependencies()) {
            final ModuleDescriptor<?> moduleDescriptor = pluginAccessor.getEnabledPluginModule(moduleKey);
            if (moduleDescriptor == null) {
                log.info("Resource batching configuration refers to plugin that does not exist: " + moduleKey);
            } else {
                if (log.isDebugEnabled()) {
                    log.debug("searching resources in: " + moduleKey);
                }

                for (final ResourceDescriptor resourceDescriptor : filter(moduleDescriptor.getResourceDescriptors(), new Resources.TypeFilter(DOWNLOAD_TYPE))) {
                    if (isResourceInBatch(resourceDescriptor, batchResource)) {
                        batchResource.add(locatePluginResource(moduleDescriptor.getCompleteKey(), resourceDescriptor.getName()));
                    }
                }
            }
        }
        return batchResource;
    }

    private DownloadableResource locateSuperBatchSubPluginResource(final SuperBatchSubResource superBatchSubResource) {
        for (final String moduleKey : dependencyResolver.getSuperBatchDependencies()) {
            final DownloadableResource pluginResource = locatePluginResource(moduleKey, superBatchSubResource.getResourceName());
            if (pluginResource != null) {
                return pluginResource;
            }
        }
        log.warn("Could not locate resource in superbatch: " + superBatchSubResource.getResourceName());
        return superBatchSubResource;
    }

    private DownloadableResource locateBatchPluginResource(final BatchPluginResource batchResource) {
        final ModuleDescriptor<?> moduleDescriptor = pluginAccessor.getEnabledPluginModule(batchResource.getModuleCompleteKey());
        for (final ResourceDescriptor resourceDescriptor : Iterables.filter(moduleDescriptor.getResourceDescriptors(), new TypeFilter(DOWNLOAD_TYPE))) {
            if (isResourceInBatch(resourceDescriptor, batchResource)) {
                batchResource.add(locatePluginResource(moduleDescriptor.getCompleteKey(), resourceDescriptor.getName()));
            }
        }

        // if batch is empty, check if we can locate a plugin resource
        if (batchResource.isEmpty()) {
            final DownloadableResource resource = locatePluginResource(batchResource.getModuleCompleteKey(), batchResource.getResourceName());
            if (resource != null) {
                return resource;
            }
        }

        return batchResource;
    }

    private boolean isResourceInBatch(final ResourceDescriptor resourceDescriptor, final BatchResource batchResource) {
        if (!descriptorTypeMatchesResourceType(resourceDescriptor, batchResource.getType())) {
            return false;
        }

        if (skipBatch(resourceDescriptor)) {
            return false;
        }

        for (final String param : BATCH_PARAMS) {
            final String batchValue = batchResource.getParams().get(param);
            final String resourceValue = resourceDescriptor.getParameter(param);

            if ((batchValue == null) && (resourceValue != null)) {
                return false;
            }

            if ((batchValue != null) && !batchValue.equals(resourceValue)) {
                return false;
            }
        }

        return true;
    }

    private boolean descriptorTypeMatchesResourceType(final ResourceDescriptor resourceDescriptor, final String type) {
        return endsWith(resourceDescriptor.getName(), ".", type);
    }

    private DownloadableResource locatePluginResource(final String moduleCompleteKey, final String resourceName) {
        DownloadableResource resource;

        // resource from the module
        if (moduleCompleteKey.indexOf(":") > -1) {
            final ModuleDescriptor<?> moduleDescriptor = pluginAccessor.getEnabledPluginModule(moduleCompleteKey);
            if (moduleDescriptor != null) {
                resource = getResourceFromModule(moduleDescriptor, resourceName, "");
            } else {
                log.info("Module not found: " + moduleCompleteKey);
                return null;
            }
        } else
        // resource from plugin
        {
            resource = getResourceFromPlugin(pluginAccessor.getPlugin(moduleCompleteKey), resourceName, "");
        }

        if (resource == null) {
            resource = getResourceFromPlugin(getPlugin(moduleCompleteKey), resourceName, "");
        }

        if (resource == null) {
            log.info("Unable to find resource for plugin: " + moduleCompleteKey + " and path: " + resourceName);
            return null;
        }

        return resource;
    }

    private Plugin getPlugin(final String moduleKey) {
        if ((moduleKey.indexOf(':') < 0) || (moduleKey.indexOf(':') == moduleKey.length() - 1)) {
            return null;
        }

        return pluginAccessor.getPlugin(moduleKey.substring(0, moduleKey.indexOf(':')));
    }

    private DownloadableResource getResourceFromModule(final ModuleDescriptor<?> moduleDescriptor, final String resourcePath, final String filePath) {
        final Plugin plugin = pluginAccessor.getPlugin(moduleDescriptor.getPluginKey());
        final ResourceLocation resourceLocation = moduleDescriptor.getResourceLocation(DOWNLOAD_TYPE, resourcePath);

        if (resourceLocation != null) {
            boolean disableMinification = false;
            // I think it should always be a WebResourceModuleDescriptor, but
            // not sure...
            if (moduleDescriptor instanceof WebResourceModuleDescriptor) {
                disableMinification = ((WebResourceModuleDescriptor) moduleDescriptor).isDisableMinification();
            }
            return getDownloadablePluginResource(plugin, resourceLocation, moduleDescriptor, filePath, disableMinification);
        }

        final String[] nextParts = splitLastPathPart(resourcePath);
        if (nextParts == null) {
            return null;
        }

        return getResourceFromModule(moduleDescriptor, nextParts[0], nextParts[1] + filePath);
    }

    private DownloadableResource getResourceFromPlugin(final Plugin plugin, final String resourcePath, final String filePath) {
        if (plugin == null) {
            return null;
        }

        final ResourceLocation resourceLocation = plugin.getResourceLocation(DOWNLOAD_TYPE, resourcePath);
        if (resourceLocation != null) {
            return getDownloadablePluginResource(plugin, resourceLocation, null, filePath, false);
        }

        final String[] nextParts = splitLastPathPart(resourcePath);
        if (nextParts == null) {
            return null;
        }

        return getResourceFromPlugin(plugin, nextParts[0], nextParts[1] + filePath);
    }

    // pacakge protected so we can test it

    String[] splitLastPathPart(final String resourcePath) {
        int indexOfSlash = resourcePath.lastIndexOf('/');
        if (resourcePath.endsWith("/")) // skip over the trailing slash
        {
            indexOfSlash = resourcePath.lastIndexOf('/', indexOfSlash - 1);
        }

        if (indexOfSlash < 0) {
            return null;
        }

        return new String[]{resourcePath.substring(0, indexOfSlash + 1), resourcePath.substring(indexOfSlash + 1)};
    }

    private DownloadableResource getDownloadablePluginResource(final Plugin plugin, final ResourceLocation resourceLocation,
                                                               ModuleDescriptor descriptor, final String filePath,
                                                               final boolean disableMinification) {
        final String sourceParam = resourceLocation.getParameter(RESOURCE_SOURCE_PARAM);

        // serve by forwarding the request to the location - batching not
        // supported
        if ("webContext".equalsIgnoreCase(sourceParam)) {
            return new ForwardableResource(resourceLocation);
        }

        DownloadableResource actualResource = null;
        // serve static resources from the web application - batching supported
        if ("webContextStatic".equalsIgnoreCase(sourceParam)) {
            actualResource = new DownloadableWebResource(plugin, resourceLocation, filePath, servletContextFactory.getServletContext(), disableMinification);
        } else {
            actualResource = new DownloadableClasspathResource(plugin, resourceLocation, filePath);
        }

        DownloadableResource result = actualResource;
        // web resources are able to be transformed during delivery
        if (descriptor instanceof WebResourceModuleDescriptor) {
            DownloadableResource lastResource = actualResource;
            WebResourceModuleDescriptor desc = (WebResourceModuleDescriptor) descriptor;
            for (WebResourceTransformation list : desc.getTransformations()) {
                if (list.matches(resourceLocation)) {
                    lastResource = list.transformDownloadableResource(pluginAccessor, actualResource, resourceLocation, filePath);
                }
            }
            result = lastResource;
        }
        return result;
    }

    public List<PluginResource> getPluginResources(final String moduleCompleteKey) {
        final ModuleDescriptor<?> moduleDescriptor = pluginAccessor.getEnabledPluginModule(moduleCompleteKey);
        if ((moduleDescriptor == null) || !(moduleDescriptor instanceof WebResourceModuleDescriptor)) {
            log.error("Error loading resource \"" + moduleCompleteKey + "\". Resource is not a Web Resource Module");
            return Collections.emptyList();
        }

        final boolean singleMode = isBatchingOff();
        final List<PluginResource> resources = new ArrayList<PluginResource>();

        for (final ResourceDescriptor resourceDescriptor : moduleDescriptor.getResourceDescriptors()) {
            if (singleMode || skipBatch(resourceDescriptor)) {
                final boolean cache = !"false".equalsIgnoreCase(resourceDescriptor.getParameter("cache"));
                resources.add(new SinglePluginResource(resourceDescriptor.getName(), moduleDescriptor.getCompleteKey(), cache, resourceDescriptor.getParameters()));
            } else {
                final BatchPluginResource batchResource = createBatchResource(moduleDescriptor.getCompleteKey(), resourceDescriptor);
                if (!resources.contains(batchResource)) {
                    resources.add(batchResource);
                }
            }
        }
        return resources;
    }

    /**
     * @return True if either it is explicitly turned off or in dev mode
     */
    Boolean isBatchingOff() {
        String explicitSetting = System.getProperty(PLUGIN_WEBRESOURCE_BATCHING_OFF);
        if (explicitSetting != null) {
            return Boolean.parseBoolean(explicitSetting);
        } else {
            return Boolean.parseBoolean(System.getProperty(PluginUtils.MAERA_DEV_MODE));
        }

    }

    private boolean skipBatch(final ResourceDescriptor resourceDescriptor) {
        // you can't batch forwarded requests
        return "false".equalsIgnoreCase(resourceDescriptor.getParameter(RESOURCE_BATCH_PARAM))
                || "webContext".equalsIgnoreCase(resourceDescriptor.getParameter(RESOURCE_SOURCE_PARAM));
    }

    private BatchPluginResource createBatchResource(final String moduleCompleteKey, final ResourceDescriptor resourceDescriptor) {
        final String name = resourceDescriptor.getName();
        final String type = name.substring(name.lastIndexOf(".") + 1);
        final Map<String, String> params = new TreeMap<String, String>();
        for (final String param : BATCH_PARAMS) {
            final String value = resourceDescriptor.getParameter(param);
            if (StringUtils.isNotEmpty(value)) {
                params.put(param, value);
            }
        }

        return new BatchPluginResource(moduleCompleteKey, type, params);
    }

    public String getResourceUrl(final String moduleCompleteKey, final String resourceName) {
        return new SinglePluginResource(resourceName, moduleCompleteKey, false).getUrl();
    }
}


text:
/*******************************************************************************
  USART Peripheral Library Template Implementation

  File Name:
    usart_TransmitterIdleIsLow_pic32.h

  Summary:
    USART PLIB Template Implementation

  Description:
    This header file contains template implementations
    For Feature : TransmitterIdleIsLow
    and its Variant : pic32
    For following APIs :
        PLIB_USART_ExistsTransmitterIdleIsLow
        PLIB_USART_TransmitterIdleIsLowDisable
        PLIB_USART_TransmitterIdleIsLowEnable

*******************************************************************************/

//DOM-IGNORE-BEGIN
/*******************************************************************************
Copyright (c) 2012 released Microchip Technology Inc.  All rights reserved.

Microchip licenses to you the right to use, modify, copy and distribute
Software only when embedded on a Microchip microcontroller or digital signal
controller that is integrated into your product or third party product
(pursuant to the sublicense terms in the accompanying license agreement).

You should refer to the license agreement accompanying this Software for
additional information regarding your rights and obligations.

SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
*******************************************************************************/

//DOM-IGNORE-END

#ifndef _USART_TRANSMITTERIDLEISLOW_PIC32_H
#define _USART_TRANSMITTERIDLEISLOW_PIC32_H

#include "usart_registers.h"

//******************************************************************************
/* Function :  USART_ExistsTransmitterIdleIsLow_pic32

  Summary:
    Implements pic32 variant of PLIB_USART_ExistsTransmitterIdleIsLow

  Description:
    This template implements the pic32 variant of the PLIB_USART_ExistsTransmitterIdleIsLow function.
*/

#define PLIB_USART_ExistsTransmitterIdleIsLow PLIB_USART_ExistsTransmitterIdleIsLow
PLIB_TEMPLATE bool USART_ExistsTransmitterIdleIsLow_pic32( USART_MODULE_ID index )
{
    return true;
}

//******************************************************************************
/* Function :  USART_TransmitterIdleIsLowDisable_pic32

  Summary:
    Implements pic32 variant of PLIB_USART_TransmitterIdleIsLowDisable

  Description:
    This template implements the pic32 variant of the PLIB_USART_TransmitterIdleIsLowDisable function.
*/

PLIB_TEMPLATE void USART_TransmitterIdleIsLowDisable_pic32( USART_MODULE_ID index )
{
    usart_registers_t volatile * usart = ((usart_registers_t *)(index));

    if (1 == usart->UxMODE.IREN)
    {
        usart->UxSTASET = UxSTA_UTXINV_MASK;
    }
    else
    {
        usart->UxSTACLR = UxSTA_UTXINV_MASK;
    }
}

//******************************************************************************
/* Function :  USART_TransmitterIdleIsLowEnable_pic32

  Summary:
    Implements pic32 variant of PLIB_USART_TransmitterIdleIsLowEnable

  Description:
    This template implements the pic32 variant of the PLIB_USART_TransmitterIdleIsLowEnable function.
*/

PLIB_TEMPLATE void USART_TransmitterIdleIsLowEnable_pic32( USART_MODULE_ID index )
{
    usart_registers_t * usart = ((usart_registers_t *)(index));

    if (1 == usart->UxMODE.IREN)
    {
        usart->UxSTACLR = UxSTA_UTXINV_MASK;
    }
    else
    {
        usart->UxSTASET = UxSTA_UTXINV_MASK;
    }
}

#endif /*_USART_TRANSMITTERIDLEISLOW_PIC32_H*/

/******************************************************************************
 End of File
*/


text:
package org.gradle.internal.fingerprint.impl;

import com.google.common.base.Function;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import org.gradle.api.tasks.FileNormalizer;
import org.gradle.internal.fingerprint.FileCollectionFingerprinter;
import org.gradle.internal.fingerprint.FileCollectionFingerprinterRegistry;

import java.util.Collection;
import java.util.Map;

public class DefaultFileCollectionFingerprinterRegistry implements FileCollectionFingerprinterRegistry {
    private final Map<Class<? extends FileNormalizer>, FileCollectionFingerprinter> fingerprinters;

    public DefaultFileCollectionFingerprinterRegistry(Collection<FileCollectionFingerprinter> fingerprinters) {
        this.fingerprinters = ImmutableMap.copyOf(Maps.uniqueIndex(fingerprinters, new Function<FileCollectionFingerprinter, Class<? extends FileNormalizer>>() {
            @Override
            public Class<? extends FileNormalizer> apply(FileCollectionFingerprinter fingerprinter) {
                return fingerprinter.getRegisteredType();
            }
        }));
    }

    @Override
    public FileCollectionFingerprinter getFingerprinter(Class<? extends FileNormalizer> type) {
        FileCollectionFingerprinter fingerprinter = fingerprinters.get(type);
        if (fingerprinter == null) {
            throw new IllegalStateException(String.format("No fingerprinter registered with type '%s'", type.getName()));
        }
        return fingerprinter;
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package td.adventure.actor;

/**
 *
 * @author Jacob Aimino
 */
public class Player extends Actor{

    public Player(String name) {
        super(name);
    }

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

}


text:
package org.xbib.catalog.entities.mab;

import org.xbib.catalog.entities.CatalogEntity;
import org.xbib.catalog.entities.CatalogEntityWorker;
import org.xbib.catalog.entities.CatalogEntityWorkerState;
import org.xbib.content.rdf.Resource;
import org.xbib.content.resource.IRI;
import org.xbib.marc.MarcField;

import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 *
 */
public class Shelfmark extends CatalogEntity {

    private String prefix = "";

    public Shelfmark(Map<String, Object> params) {
        super(params);
        // override by "identifier"
        if (params.containsKey("identifier")) {
            this.prefix = params.get("identifier").toString();
        }
    }

    @Override
    public CatalogEntity transform(CatalogEntityWorker worker, MarcField field) throws IOException {
        worker.append(worker.getWorkerState().getNextItemResource(), field, this);
        return null;
    }

    @Override
    public List<String> transform(CatalogEntityWorker worker,
                                  String predicate, Resource resource, String property, String value) {
        CatalogEntityWorkerState state = worker.getWorkerState();
        if ("Shelfmark".equals(predicate) && prefix != null && !prefix.isEmpty()) {
            resource.add("identifier", prefix);
            // create synthetic local record identifier
            state.setUID(IRI.builder()
                    .curie("uid:" + state.getISIL() + "/" + value)
                    .build());
        }
        return Collections.singletonList(value);
    }
}


text:
package pt.simdea.gmlrva.lib.threading;

import android.support.annotation.UiThread;
import android.support.v7.util.DiffUtil;

import java.util.List;

import lombok.AllArgsConstructor;
import pt.simdea.gmlrva.lib.GenericMultipleLayoutAdapter;
import pt.simdea.gmlrva.lib.IGenericRecyclerViewLayout;

/**
 * Class meant to act as the {@link DiffUtil} calculations result dispatcher to the UIThread.
 *
 * Created by Paulo Ribeiro on 10/5/2017.
 * Simdea © All Rights Reserved.
 * paulo.ribeiro@simdea.pt
 */
@AllArgsConstructor
final class UpdateUiDiffUtilResult implements Runnable {

    private final List<? extends IGenericRecyclerViewLayout> mNewDataSet;
    private final DiffUtil.DiffResult mDiffResult;
    private final GenericMultipleLayoutAdapter mAdapter;

    /** {@inheritDoc} */
    @UiThread
    @Override
    public void run() {
        mAdapter.applyDiffResult(mNewDataSet, mDiffResult);
    }

}


text:
package com.adenki.smpp.util;

import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import com.adenki.smpp.Session;
import com.adenki.smpp.SessionType;
import com.adenki.smpp.event.SMPPEvent;
import com.adenki.smpp.event.SessionObserver;
import com.adenki.smpp.message.Bind;
import com.adenki.smpp.message.BindReceiver;
import com.adenki.smpp.message.BindResp;
import com.adenki.smpp.message.BindTransceiver;
import com.adenki.smpp.message.BindTransmitter;
import com.adenki.smpp.message.SMPPPacket;
import com.adenki.smpp.message.Unbind;
import com.adenki.smpp.message.UnbindResp;
import com.adenki.smpp.net.ReadTimeoutException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Connection observer which mimics synchronous communications. This observer
 * provides methods which block the caller until the desired response packet
 * is available to be returned.
 * @version $Id$
 */
public class SyncWrapper implements SessionObserver {
    private static final Logger LOG = LoggerFactory.getLogger(SyncWrapper.class);

    private Session connection;
    private final Map<Number, SMPPPacket> responses = new LinkedHashMap<Number, SMPPPacket>();
    private final List<SMPPPacket> packetQueue = new ArrayList<SMPPPacket>();
    private long packetTimeout;

    private ConnectionCaller bindCaller = new ConnectionCaller() {
        public void execute(Session connection, SMPPPacket packet) throws IOException {
            connection.bind((Bind) packet);
        }
    };
    private ConnectionCaller packetCaller = new ConnectionCaller() {
        public void execute(Session connection, SMPPPacket packet) throws IOException {
            connection.send(packet);
        }
    };

    public SyncWrapper(Session connection) {
        this.connection = connection;
    }

    /**
     * Bind to the SMSC.
     * @param type The type of connection to bind as (transmitter, receiver
     * or transceiver).
     * @param systemID The system ID of this connection.
     * @param password The password of this connection.
     * @param systemType The system Type for this connection.
     * @return The bind response packet received from the SMSC.
     * @throws IOException If an error occurs when trying to send the
     * bind request packet to the SMSC.
     * @throws ReadTimeoutException If the bind timeout
     * expires before the response is received from the SMSC.
     */
    public BindResp bind(SessionType type,
            String systemID,
            String password,
            String systemType) throws IOException {
        return bind(type, systemID, password, systemType, 0, 0, null);
    }

    /**
     * Bind to the SMSC.
     * @param type The type of connection to bind as (transmitter, receiver
     * or transceiver).
     * @param systemID The system ID of this connection.
     * @param password The password of this connection.
     * @param systemType The system Type for this connection.
     * @param typeOfNumber TON to bind as.
     * @param numberPlanIndicator NPI to bind as.
     * @param addressRange Address range to bind as.
     * @return The bind response packet received from the SMSC.
     * @throws IOException If an error occurs when trying to send the
     * bind request packet to the SMSC.
     * @throws ReadTimeoutException If the bind timeout
     * expires before the response is received from the SMSC.
     */
    public BindResp bind(SessionType type,
            String systemID,
            String password,
            String systemType,
            int typeOfNumber,
            int numberPlanIndicator,
            String addressRange) throws IOException {
        Bind bindRequest;
        if (type == SessionType.TRANSMITTER) {
            bindRequest = new BindTransmitter();
        } else if (type == SessionType.RECEIVER) {
            bindRequest = new BindReceiver();
        } else {
            bindRequest = new BindTransceiver();
        }
        bindRequest.setVersion(connection.getVersion());
        bindRequest.setSystemId(systemID);
        bindRequest.setPassword(password);
        bindRequest.setSystemType(systemType);
        bindRequest.setAddressTon(typeOfNumber);
        bindRequest.setAddressNpi(numberPlanIndicator);
        bindRequest.setAddressRange(addressRange);
        return bind(bindRequest);
    }

    /**
     * Bind to the SMSC.
     * @param bindRequest The bind request packet to send.
     * @return The bind response packet received from the SMSC.
     * @throws IOException If an error occurs when trying to send the bind
     * packet to the SMSC.
     * @throws ReadTimeoutException If the bind timeout
     * expires before the response is received from the SMSC.
     */
    public BindResp bind(Bind bindRequest) throws IOException {
        long timeout = getBindTimeout();
        BindResp bindResp = (BindResp) sendAndWait(
                bindRequest, bindCaller, timeout);
        if (bindResp == null) {
            throw new ReadTimeoutException();
        } else {
            return bindResp;
        }
    }

    /**
     * Unbind from the SMSC and wait for the unbind response packet.
     * @return The unbind response packet received from the SMSC.
     * @throws IOException If an error occurs when trying to send the unbind
     * packet to the SMSC.
     * @throws ReadTimeoutException If the packetTimeout
     * expires before the response is received from the SMSC.
     */
    public UnbindResp unbind() throws IOException {
        UnbindResp unbindResp = (UnbindResp) sendAndWait(
                new Unbind(), packetCaller, packetTimeout);
        if (unbindResp == null) {
            throw new ReadTimeoutException();
        } else {
            return unbindResp;
        }
    }

    /**
     * Send a packet to the SMSC and wait for its response.
     * @param packet The request packet to send to the SMSC.
     * @return The response packet received from the SMSC. This may be
     * null if the call timed out waiting on the packet, or if
     * the thread was instructed to give up the wait.
     * @throws IOException If there was a problem writing to, or reading
     * from, the connection.
     * @throws ReadTimeoutException If the packetTimeout
     * expires before the response is received from the SMSC.
     */
    public SMPPPacket send(SMPPPacket packet) throws IOException {
        SMPPPacket response = sendAndWait(packet, packetCaller, packetTimeout);
        if (response == null) {
            throw new ReadTimeoutException();
        } else {
            return response;
        }
    }

    public void packetReceived(Session source, SMPPPacket packet) {
        if (packet.isResponse()) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Response received: {}", packet);
            }
            synchronized (responses) {
                responses.put(packet.getSequenceNum(), packet);
                responses.notifyAll();
            }
        } else {
            addToQueue(packet);
        }
    }

    public void update(Session source, SMPPEvent event) {
        // TODO: need to handle SMPPEvent
        LOG.warn("SyncWrapper ignoring an SMPP event.");
    }

    /**
     * Check if there are any packets available to be read.
     * @return true if {@link #readNextPacket} will return a
     * packet without blocking, false if it would block waiting
     * on a packet.
     */
    public boolean isPacketAvailable() {
        return packetQueue.size() > 0;
    }

    /**
     * Read the next packet from the connection.
     * @param block true to block waiting on the next packet
     * to arrive, false to return whether or not a packet was
     * available. Note that calling this method will not return a response
     * packet to the calling thread if there is already another thread blocked
     * waiting on that response. That is, if thread 1 called sendPacket
     *  and is waiting on a response and then thread 2 calls this method,
     * when the response packet arrives, thread 1 will be given the response
     * and thread 2 will continue to block in this method until the next
     * packet arrives. However, if thread 1 stops waiting for some reason
     * (for example, it times out waiting for its response), then thread 2
     * will receive the response packet.
     * @return The next packet from the SMSC, or null if no
     * packet was available and the caller requested non-blocking operation.
     * @throws IOException If there was a problem communicating with the
     * connection.
     */
    public SMPPPacket readNextPacket(boolean block) throws IOException {
        SMPPPacket packet = null;
        try {
            synchronized (packetQueue) {
                if (packetQueue.size() < 1 && block) {
                    packetQueue.wait();
                } else {
                    packet = packetQueue.remove(0);
                }
            }
        } catch (InterruptedException x) {
            LOG.info("Thread interrupted while blocked waiting on a packet.");
        }
        return packet;
    }

    /**
     * Get the current packet timeout setting.
     * @return The packet timeout setting.
     * @see #setPacketTimeout(long)
     */
    public long getPacketTimeout() {
        return packetTimeout;
    }

    /**
     * Set the timeout, in milliseconds, to block waiting for a packet. The
     * default is 0, meaning wait forever for the packet.
     * @param packetTimeout The number of milliseconds to wait on the packet.
     */
    public void setPacketTimeout(long packetTimeout) {
        this.packetTimeout = packetTimeout;
    }

    private void addToQueue(SMPPPacket packet) {
        synchronized (packetQueue) {
            packetQueue.add(packet);
            packetQueue.notify();
        }
    }

    private long getBindTimeout() {
        APIConfig config = APIConfigFactory.getConfig();
        return config.getLong(APIConfig.BIND_TIMEOUT, 0L);
    }

    private SMPPPacket sendAndWait(
            SMPPPacket packet,
            ConnectionCaller caller,
            long timeout) throws IOException {
        caller.execute(connection, packet);
        SMPPPacket response = null;
        try {
            long waitFinish = System.currentTimeMillis() + timeout;
            synchronized (responses) {
                response = responses.get(packet.getSequenceNum());
                while (response == null) {
                    if (System.currentTimeMillis() > waitFinish) {
                        throw new ReadTimeoutException(
                                packet.getClass().getSimpleName()
                                        + " response with sequence "
                                        + packet.getSequenceNum()
                                        + " not received within timeout.");
                    }
                    responses.wait(timeout);
                    response = responses.get(packet.getSequenceNum());
                }
            }
        } catch (InterruptedException x) {
            LOG.debug("Thread interrupted while waiting on response packet {}.",
                    packet.getSequenceNum());
        }
        return response;
    }

    private interface ConnectionCaller {
        void execute(Session connection, SMPPPacket packet) throws IOException;
    }
}


text:
Since 3.1 the library uses a default HttpInterceptor that takes care about transmitting the access_token to the resource server and about error handling for security related errors (HTTP status codes 401 and 403) received from the resource server. To put in on, just set ``sendAccessToken`` to ``true`` and set ``allowedUrls`` to an array with prefixes for the respective urls. Use lower case for the prefixes:

```TypeScript
OAuthModule.forRoot({
    resourceServer: {
        allowedUrls: ['http://www.angular.at/api'],
        sendAccessToken: true
    }
})
```

You can provide an error handler for the urls white listed here by provding a service for the token ``OAuthResourceServerErrorHandler``.

To implement such a service, implement the abstract class ``OAuthResourceServerErrorHandler``. The following example shows the default implemantion that just passes the cought error through:

```TypeScript
export class OAuthNoopResourceServerErrorHandler implements OAuthResourceServerErrorHandler {

    handleError(err: HttpResponse<any>): Observable<any> {
        return _throw(err);
    }

}
```

## Custom Interceptors

Feel free to write custom interceptors but keep in mind that injecting the ``OAuthService`` into them creates a circular dependency which leads to an error. The easiest way to prevent this is to use the OAuthStorage directly which also provides the access_token:

```TypeScript
import { Injectable, Inject, Optional } from '@angular/core';
import { OAuthService, OAuthStorage } from 'angular-oauth2-oidc';
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse, HttpErrorResponse } from '@angular/common/http';
import {Observable} from 'rxjs/Observable';
import { OAuthResourceServerErrorHandler } from "./resource-server-error-handler";
import { OAuthModuleConfig } from "../oauth-module.config";

import 'rxjs/add/operator/catch';

@Injectable()
export class DefaultOAuthInterceptor implements HttpInterceptor {

    constructor(
        private authStorage: OAuthStorage,
        private errorHandler: OAuthResourceServerErrorHandler,
        @Optional() private moduleConfig: OAuthModuleConfig
    ) {
    }

    private checkUrl(url: string): boolean {
        let found = this.moduleConfig.resourceServer.allowedUrls.find(u => url.startsWith(u));
        return !!found;
    }

    public intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {

        let url = req.url.toLowerCase();

        if (!this.moduleConfig) return next.handle(req);
        if (!this.moduleConfig.resourceServer) return next.handle(req);
        if (!this.moduleConfig.resourceServer.allowedUrls) return next.handle(req);
        if (!this.checkUrl(url)) return next.handle(req);

        let sendAccessToken = this.moduleConfig.resourceServer.sendAccessToken;

        if (sendAccessToken) {

            let token = this.authStorage.getItem('access_token');
            let header = 'Bearer ' + token;

            let headers = req.headers
                                .set('Authorization', header);

            req = req.clone({ headers });
        }

        return next.handle(req).catch(err => this.errorHandler.handleError(err));

    }

}
```


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tekihub.kameleon"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission
        android:name="android.permission.PACKAGE_USAGE_STATS"
        tools:ignore="ProtectedPermissions"/>

    <application
        android:name=".MainApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".main.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <activity android:name=".main.WelcomeActivity"/>

        <!-- Services -->
        <service android:name=".KameleonService"/>

        <!-- Receivers -->
        <receiver
            android:name=".receivers.BootCompleteReceiver"
            android:enabled="true"
            android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
            </intent-filter>
        </receiver>

    </application>

</manifest>


text:
using QuantConnect.Data.UniverseSelection;

namespace QuantConnect.Algorithm.Framework
{
    /// <summary>
    /// Types implementing this interface will be called when the algorithm's set of securities changes
    /// </summary>
    public interface INotifiedSecurityChanges
    {
        /// <summary>
        /// Event fired each time the we add/remove securities from the data feed
        /// </summary>
        /// <param name="algorithm">The algorithm instance that experienced the change in securities</param>
        /// <param name="changes">The security additions and removals from the algorithm</param>
        void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes);
    }
}


text:
<?php

// HTNowy3Bundle:News:index.html.twig
return array (
);


text:
<?php

class common_pagetemplate_test extends DokuWikiTest {

    function test_none(){
        global $conf;
        $conf['sepchar'] = '-';
        $data = array(
            'id' => 'page-id-long',
            'tpl' => '"@PAGE@" "@!PAGE@" "@!!PAGE@" "@!PAGE!@"',
        );
        $this->assertEquals(parsePageTemplate($data), '"page id long" "Page id long" "Page Id Long" "PAGE ID LONG"');
    }
}
//Setup VIM: ex: et ts=4 :


text:
package com.gs.reladomo.serial.gson;

import com.google.gson.Gson;
import com.google.gson.TypeAdapter;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.gs.fw.common.mithra.util.serializer.Serialized;
import com.gs.fw.common.mithra.util.serializer.SerializedList;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class GsonWrappedTypeAdaptorFactory implements TypeAdapterFactory
{
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken)
    {
        if (Serialized.class.equals(typeToken.getRawType()))
        {
            Type type = typeToken.getType();
            if (type instanceof ParameterizedType)
            {
                Type[] typeArguments = ((ParameterizedType) type).getActualTypeArguments();
                return new GsonWrappedTypedAdapter((Class) typeArguments[0]);
            }
            return new GsonWrappedTypedAdapter(null);
        }
        if (SerializedList.class.equals(typeToken.getRawType()))
        {
            Type type = typeToken.getType();
            if (type instanceof ParameterizedType)
            {
                Type[] typeArguments = ((ParameterizedType) type).getActualTypeArguments();
                return new GsonWrappedListTypedAdapter((Class) typeArguments[0]);
            }
            return new GsonWrappedListTypedAdapter(null);
        }
        return null;
    }
}


text:
package com.xinran.fasthttp.mvp;

/**
 * Created by qixinh on 16/6/15.
 */
public interface QxBasePresenter<K> {
    void attachAct(K act);
    void detachAct();

}


text:
package jeffaschenk.commons.standards.statecodes;

import jeffaschenk.commons.standards.CountryCode;

/**
 * Official ISO-3166 State/Province Codes
 * <p/>
 * Country: Angola
 *
 * @author jeffaschenk@gmail.com
 *         Date: May 19, 2010
 *         Time: 12:12:11 PM
 */
@SuppressWarnings("unused")
public enum StateCodes_AO {
    /**
     * State Code Enumerator
     */
    AO_BGO("Bengo","AO-BGO","Province","12390", CountryCode.ANGOLA),
    AO_BGU("Benguela","AO-BGU","Province","12391",CountryCode.ANGOLA),
    AO_BIE("Bi\u0233","AO-BIE","Province","12395",CountryCode.ANGOLA),
    AO_CAB("Cabinda","AO-CAB","Province","12392",CountryCode.ANGOLA),
    AO_CCU("Cuando-Cubango","AO-CCU","Province","12394",CountryCode.ANGOLA),
    AO_CNO("Cuanza Norte","AO-CNO","Province","12388",CountryCode.ANGOLA),
    AO_CUS("Cuanza Sul","AO-CUS","Province","12397",CountryCode.ANGOLA),
    AO_CNN("Cunene","AO-CNN","Province","12389",CountryCode.ANGOLA),
    AO_HUA("Huambo","AO-HUA","Province","12393",CountryCode.ANGOLA),
    AO_HUI("Hu\u0237la","AO-HUI","Province","12396",CountryCode.ANGOLA),
    AO_LUA("Luanda","AO-LUA","Province","12387",CountryCode.ANGOLA),
    AO_LNO("Lunda Norte","AO-LNO","Province","12398",CountryCode.ANGOLA),
    AO_LSU("Lunda Sul","AO-LSU","Province","12386",CountryCode.ANGOLA),
    AO_MAL("Malange","AO-MAL","Province","12399",CountryCode.ANGOLA),
    AO_MOX("Moxico","AO-MOX","Province","12401",CountryCode.ANGOLA),
    AO_NAM("Namibe","AO-NAM","Province","12402",CountryCode.ANGOLA),
    AO_UIG("U\u0237ge","AO-UIG","Province","12400",CountryCode.ANGOLA),
    AO_ZAI("Zaire","AO-ZAI","Province","12385",CountryCode.ANGOLA);

    // *************************************
    // Common Enum Structure for all
    // States of the World
    private final String stateProvinceName;

    private final String stateCode;

    private final String stateProvinceType;

    private final String stateNumericCode;

    private final CountryCode countryCode;

    StateCodes_AO(String stateProvinceName, String stateCode, String stateProvinceType, String stateNumericCode, CountryCode countryCode) {
        this.stateProvinceName = stateProvinceName;
        this.stateCode = stateCode;
        this.stateProvinceType = stateProvinceType;
        this.stateNumericCode = stateNumericCode;
        this.countryCode = countryCode;
    }

    public String stateProvinceName() {
        return this.stateProvinceName;
    }

    public String stateCode() {
        return this.stateCode;
    }

    public String stateProvinceType() {
        return this.stateProvinceType;
    }

    public String stateNumericCode() {
        return this.stateNumericCode;
    }

    public CountryCode countryCode() {
        return this.countryCode;
    }

}


text: basic password generator, in progress


text:
<title>IM_COMPASS(3) manual page</title>

Table of Contents

Name

im_compass, im_rank_image, im_maxvalue, im_lindetect, im_gradient -
extract features from an image with a rotating input mask

Synopsis

#include
<vips/vips.h>

 int im_rank_image(in, out, n, index)

IMAGE **in;

IMAGE *out;

int n;

int index;

 int im_maxvalue(in, out, n)

IMAGE **in;

IMAGE *out;

int n;

 int im_compass(in, out, mask)

IMAGE *in, *out;

INTMASK *mask;

 int im_lindetect(in, out, mask)

IMAGE *in, *out;

INTMASK *mask;

 int im_gradient(in, out, mask)

IMAGE *in, *out;

INTMASK *mask;

Description

im_rank_image() sorts the input images pixel-wise,
then outputs an image in which each pixel is selected from the sorted list
by the  index parameter. For example, if index is zero, then each output
pixel will be the minimum of all the corresponding input pixels.  It works
for any uncoded, non-complex image type. All input images must match in size,
format, and number of bands.

 These functions convolve the image pointed
by the image descriptor in with the mask pointed by mask and put the result
in the image pointed by out.

 The mask structure INTMASK is returned by
the function im_read_imask(3)
, for integer mask only.  Input should be unsigned
char; processing is carried out using look-up tables. The output is integer.
 coefficients.  The size of the output image and the number of channels
are the same as the corresponding of the input.

 If the sizes of the mask
are xm and ym and the sizes of the image are xs and ys, then there is a
black border at the output image as follows:

 The top ym/2 lines black,
bottom ys-ym/2-ym lines black; each of the remaining lines has the initial
xm/2 pels blank, and the final xs-xm/2-xm pels black (division over 2 is
integer division). The output at each point is divided by scale and then
the offset is added. Both offset and scale are held in mask.

 im_maxvalue()
is a convenience function: it is simply:

   im_rank_image( in, out, n,
n - 1 )

 im_compass() convolves each point of the input byte image pointed by
in with 8 masks.  The first mask is the entered mask and the seven remaining
masks are produced by successive rotations of the entered mask by 45 degrees.
 The maximum output of all masks at each point is written to the output
integer IMAGE descriptor. The function expects as input a square mask of
odd size.

 im_lindetect() convolves each point of the input byte image pointed
by in with 4 masks.  The first mask is the entered mask and the three remaining
masks are produced by successive rotations of the entered mask by 45 degrees.
 The maximum output of all masks at each point is written to the output
integer IMAGE descriptor. The function expects as input a square mask of
odd size.

 im_gradient() convolves each point of the input byte image pointed
by in with 2 masks; the entered mask and with a 90 degrees rotation of
the  entered mask.  If g1, g2 are the result of each convolution then for
each point abs(g1) + abs(g2) is written to the output integer IMAGE descriptor.
The function expects as input a square mask of any size.

Return Value

All
functions returns 0 on success and -1 on error.

See Also

im_readmask(3)
, im_conv(3)
.

Copyright

N. Dessipris

Author

N. Dessipris - 02/05/1991

Table of Contents

Name

Synopsis

Description

Return Value

SeeAlso

Copyright

Author


text:
package org.javia.arity;

class IsComplexException extends Exception {
}


text:
/**
 *
 */
package me.learn.personal.month3;

/**
 * Title 557 :
 *
 * Given a string, you need to reverse the order of characters in each word
 * within a sentence while still preserving whitespace and initial word order.
 *
 * Example 1:
 *
 * Input: "Let's take LeetCode contest" Output: "s'teL ekat edoCteeL tsetnoc"
 *
 * Note: In the string, each word is separated by single space and there will
 * not be any extra space in the string.
 *
 * @author bramanarayan
 * @date Jul 19, 2020
 */
public class ReverseWordsInStringThree {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ReverseWordsInStringThree solution = new ReverseWordsInStringThree();
		System.out.println(solution.reverseWords("let's take LeetCode contest"));
	}

	public String reverseWords(String s) {
		String[] t = s.split("\\s+");
		StringBuilder sb = new StringBuilder();
		for(String temp : t) {
			StringBuilder tempSB = new StringBuilder();
			sb.append(tempSB.append(temp).reverse());
			sb.append(" ");
		}
		return sb.toString().trim();
	}

}


text:
package rappsilber.utils;

/**
 * A object can add another object of the same type to its self.
 * Idea is, that links and protein interactions can be defined via different peptides.
 * So if we have already the PPI defined we just add the new sources and scores to it.
 */
public interface SelfAdd<T> {

    void add(T o);

}


text:
#pragma once

// Abstract superclass for all GLBlaat resources.
class GLResource
{
public:
	virtual ~GLResource() {}
protected:
	GLResource() {} // can not instantiate abstract class
};


text:
/* IMPORTANT:  use unique CSS class name to avoid confliction with other extensions or applications. */

/* For example, adding the extension id as prefix of CSS class name. */

.sap_viz_ext_timelinelegend_chart {
	font-family: Arial, sans-serif;
	font-size: 12px;
}

.sap_viz_ext_timelinelegend_axis path, .sap_viz_ext_timelinelegend_axis line {
	fill: none;
	stroke: #000;
	shape-rendering: crispEdges;
}
.sap_viz_ext_timelinelegend_axis_hint path, .sap_viz_ext_timelinelegend_axis_hint line {
	fill: none;
	stroke: #ccc;
	shape-rendering: crispEdges;
}

.sap_viz_ext_timelinelegend_chart .sap_viz_ext_timelinelegend_dateoverview_bg{
	fill: #ddd;
}

.sap_viz_ext_timelinelegend_chart .sap_viz_ext_timelinelegend_dateoverview .sap_viz_ext_timelinelegend_dateoverview_grid path,
.sap_viz_ext_timelinelegend_chart .sap_viz_ext_timelinelegend_dateoverview .sap_viz_ext_timelinelegend_dateoverview_grid .tick line{
	stroke: #fff;
	stroke-width: 1px;
	fill: none;
}

.sap_viz_ext_timelinelegend_chart .sap_viz_ext_timelinelegend_dateoverview .sap_viz_ext_timelinelegend_dateoverview_axis path,
.sap_viz_ext_timelinelegend_chart .sap_viz_ext_timelinelegend_dateoverview .sap_viz_ext_timelinelegend_dateoverview_axis .tick line{
	stroke-width: 1px;
	stroke: #222;
	fill: none;
}

.sap_viz_ext_timelinelegend_chart .sap_viz_ext_timelinelegend_dateoverview_brush .extent {
  stroke: #000;
  fill-opacity: .125;
  shape-rendering: crispEdges;
}

.sap_viz_ext_scrollgantt-container{
	overflow-y: auto;
	overflow-x: hidden;
	border-radius: 4px;
}

foreignobject.sap_viz_ext_timelinelegend_forobj{
	width: 100%;
    height: 100%;
}

.sap_viz_ext_timelinelegend_dateoverview_background{
	fill: #ddd;
}

.sap_viz_ext_timelinelegend_bar {
	fill: #33b5e5;
}
.sap_viz_ext_timelinelegend_rect{
    stroke-width = 1;
    stroke = #fff;
}
.sap_viz_ext_timelinelegend_tootip{
	font-size: .9em;
    opacity : 0;
}
.sap_viz_ext_timelinelegend_tootip rect.timelinelegend_tootip_label {
    fill: #444;
    rx: 3;
    ry: 3;
}
.sap_viz_ext_timelinelegend_tootip g.timelinelegend_tootip_label_detail text{
    fill: #fff;
    font-size: 1.1em;
}
/*.sap_viz_ext_timelinelegend_bar-failed {*/
/*	fill: #CC0000;*/
/*}*/

/*.sap_viz_ext_timelinelegend_bar-running {*/
/*	fill: #669900;*/
/*}*/

/*.sap_viz_ext_timelinelegend_bar-succeeded {*/
/*	fill: #33b5e5;*/
/*}*/

/*.sap_viz_ext_timelinelegend_bar-killed {*/
/*	fill: #ffbb33;*/
/*}*/


text:
package mesosphere.marathon
package metrics

import com.google.inject.matcher.{AbstractMatcher, Matchers}
import com.google.inject.AbstractModule
import mesosphere.UnitTest
import mesosphere.marathon.metrics.current.{DropwizardMetrics, UnitOfMeasurement}
import org.aopalliance.intercept.{MethodInterceptor, MethodInvocation}

class FooBar {
  def dummy(): Unit = {}
}

class MetricsTest extends UnitTest {

  class TestModule extends AbstractModule {
    class DummyBehavior extends MethodInterceptor {
      override def invoke(invocation: MethodInvocation): AnyRef = {
        invocation.proceed()
      }
    }

    object MarathonMatcher extends AbstractMatcher[Class[_]] {
      override def matches(t: Class[_]): Boolean = t == classOf[FooBar]
    }

    override def configure(): Unit = {
      bindInterceptor(Matchers.any(), Matchers.any(), new DummyBehavior())
    }
  }

  "DropwizardMetrics.constructName" should {
    "not append a unit of measurement suffix, when none is given" in {
      val name =
        DropwizardMetrics.constructName("marathon", "metric", "counter", UnitOfMeasurement.None)
      name shouldBe "marathon.metric.counter"
    }

    "append the memory unit of measurement suffix, when it is given" in {
      val name =
        DropwizardMetrics.constructName("marathon", "metric", "counter", UnitOfMeasurement.Memory)
      name shouldBe "marathon.metric.counter.bytes"
    }

    "append the time unit of measurement suffix, when it is given" in {
      val name =
        DropwizardMetrics.constructName("marathon", "metric", "counter", UnitOfMeasurement.Time)
      name shouldBe "marathon.metric.counter.seconds"
    }

    "throw an exception if metric name components contain a disallowed character" in {
      assertThrows[IllegalArgumentException] {
        DropwizardMetrics.constructName("marathon#", "metric", "counter", UnitOfMeasurement.None)
      }
      assertThrows[IllegalArgumentException] {
        DropwizardMetrics.constructName("marathon", "metric$", "counter", UnitOfMeasurement.None)
      }
      assertThrows[IllegalArgumentException] {
        DropwizardMetrics.constructName("marathon", "metric", "counter%", UnitOfMeasurement.None)
      }
    }

  }

}