text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using Microsoft.Build.Framework;
using Microsoft.Build.Shared;
using Microsoft.Build.UnitTests;
using Microsoft.Build.UnitTests.Shared;
using Microsoft.Build.Utilities;
#if NETFRAMEWORK
using Microsoft.IO;
#else
using System.IO;
#endif
using Shouldly;
using Xunit;

#nullable disable

namespace Microsoft.Build.Tasks.UnitTests
{
    public class RoslynCodeTaskFactory_Tests
    {
        private const string TaskName = "MyInlineTask";

        [Fact]
        public void InlineTaskWithAssemblyPlatformAgnostic()
        {
            using (TestEnvironment env = TestEnvironment.Create())
            {
                TransientTestFolder folder = env.CreateFolder(createFolder: true);
                string location = Assembly.GetExecutingAssembly().Location;
                TransientTestFile inlineTask = env.CreateFile(folder, "5106.proj", @$"
<Project>

  <UsingTask TaskName=""MyInlineTask"" TaskFactory=""RoslynCodeTaskFactory"" AssemblyFile=""$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll"">
    <Task>
      <Reference Include=""" + Path.Combine(Path.GetDirectoryName(location), "..", "..", "..", "Samples", "Dependency",
#if DEBUG
      "Debug"
#else
      "Release"
#endif
      , "net472", "Dependency.dll") + @""" />
      <Using Namespace=""Dependency"" />

<![CDATA[
Log.LogError(Alpha.GetString());
]]>

    </Task>
  </UsingTask>

<Target Name=""ToRun"">
  <MyInlineTask/>
</Target>

</Project>
");
                string output = RunnerUtilities.ExecMSBuild(inlineTask.Path, out bool success);
                success.ShouldBeTrue(output);
                output.ShouldContain("Alpha.GetString");
            }
        }

        [Fact]
        [SkipOnPlatform(TestPlatforms.AnyUnix, ".NETFramework 4.0 isn't on unix machines.")]
        public void InlineTaskWithAssembly()
        {
            using (TestEnvironment env = TestEnvironment.Create())
            {
                TransientTestFolder folder = env.CreateFolder(createFolder: true);
                TransientTestFile assemblyProj = env.CreateFile(folder, "5106.csproj", @$"
                    <Project DefaultTargets=""Build"">
                        <PropertyGroup>
                            <TargetFrameworkVersion>{MSBuildConstants.StandardTestTargetFrameworkVersion}</TargetFrameworkVersion>
                            <OutputType>Library</OutputType>
                        </PropertyGroup>
                        <ItemGroup>
                            <Reference Include=""System""/>
                            <Compile Include=""Class1.cs""/>
                        </ItemGroup>
                        <Import Project=""$(MSBuildBinPath)\Microsoft.CSharp.targets"" />
                    </Project>
");
                TransientTestFile csFile = env.CreateFile(folder, "Class1.cs", @"
using System;

namespace _5106 {
    public class Class1 {
        public static string ToPrint() {
            return ""Hello!"";
        }
    }
}
");
                string output = RunnerUtilities.ExecMSBuild(assemblyProj.Path + $" /p:OutDir={Path.Combine(folder.Path, "subFolder")} /restore", out bool success);
                success.ShouldBeTrue(output);

                TransientTestFile inlineTask = env.CreateFile(folder, "5106.proj", @$"
<Project>

  <UsingTask TaskName=""MyInlineTask"" TaskFactory=""RoslynCodeTaskFactory"" AssemblyFile=""$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll"">
    <Task>
      <Reference Include=""{Path.Combine(folder.Path, "subFolder", "5106.dll")}"" />
      <Reference Include=""netstandard"" />
      <Using Namespace=""_5106"" />

<![CDATA[
Log.LogError(Class1.ToPrint());
]]>

    </Task>
  </UsingTask>

<Target Name=""ToRun"">
  <MyInlineTask/>
</Target>

</Project>
");
                output = RunnerUtilities.ExecMSBuild(inlineTask.Path, out success);
                success.ShouldBeTrue();
                output.ShouldContain("Hello!");
            }
        }

        [Fact]
        public void RoslynCodeTaskFactory_ReuseCompilation()
        {
            string text1 = $@"
<Project>

  <UsingTask
    TaskName=""Custom1""
    TaskFactory=""RoslynCodeTaskFactory""
    AssemblyFile=""$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll"" >
    <ParameterGroup>
      <SayHi ParameterType=""System.String"" Required=""true"" />
    </ParameterGroup>
    <Task>
      <Reference Include=""{typeof(Enumerable).Assembly.Location}"" />

        Log.LogMessage(SayHi);

    </Task>
  </UsingTask>

    <Target Name=""Build"">
        <MSBuild Projects=""p2.proj"" Targets=""Build"" />
        <Custom1 SayHi=""hello1"" />
        <Custom1 SayHi=""hello2"" />
    </Target>

</Project>";

            var text2 = $@"
<Project>

  <UsingTask
    TaskName=""Custom1""
    TaskFactory=""RoslynCodeTaskFactory""
    AssemblyFile=""$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll"" >
    <ParameterGroup>
      <SayHi ParameterType=""System.String"" Required=""true"" />
    </ParameterGroup>
    <Task>
      <Reference Include=""{typeof(Enumerable).Assembly.Location}"" />

        Log.LogMessage(SayHi);

    </Task>
  </UsingTask>

    <Target Name=""Build"">
        <Custom1 SayHi=""hello1"" />
        <Custom1 SayHi=""hello2"" />
    </Target>

</Project>";

            using var env = TestEnvironment.Create();

            var p2 = env.CreateTestProjectWithFiles("p2.proj", text2);
            text1 = text1.Replace("p2.proj", p2.ProjectFile);
            var p1 = env.CreateTestProjectWithFiles("p1.proj", text1);

            var logger = p1.BuildProjectExpectSuccess();
            var messages = logger
                .BuildMessageEvents
                .Where(m => m.Message == "Compiling task source code")
                .ToArray();

            // with broken cache we get two Compiling messages
            // as we fail to reuse the first assembly
            messages.Length.ShouldBe(1);
        }

        [Fact]
        public void VisualBasicFragment()
        {
            const string fragment = "Dim x = 0";
            string expectedSourceCode = $@"'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool." +
#if NETFRAMEWORK
@"
'     Runtime Version:4.0.30319.42000" +
#endif
@$"
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports Microsoft.Build.Framework
Imports Microsoft.Build.Utilities
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.IO
Imports System.Linq
Imports System.Text

Namespace InlineCode

    Public Class {TaskName}
        Inherits Microsoft.Build.Utilities.Task

        Private _Success As Boolean = true

        Public Overridable Property Success() As Boolean
            Get
                Return _Success
            End Get
            Set
                _Success = value
            End Set
        End Property

        Public Overrides Function Execute() As Boolean
{fragment}
            Return Success
        End Function
    End Class
End Namespace
";

            TryLoadTaskBodyAndExpectSuccess(
                taskBody: $"{fragment}",
                expectedCodeLanguage: "VB",
                expectedSourceCode: expectedSourceCode,
                expectedCodeType: RoslynCodeTaskFactoryCodeType.Fragment);
        }

        [Fact]
        public void VisualBasicFragmentWithProperties()
        {
            ICollection<TaskPropertyInfo> parameters = new List<TaskPropertyInfo>
            {
                new TaskPropertyInfo("Parameter1", typeof(string), output: false, required: true),
                new TaskPropertyInfo("Parameter2", typeof(string), output: true, required: false),
                new TaskPropertyInfo("Parameter3", typeof(string), output: true, required: true),
                new TaskPropertyInfo("Parameter4", typeof(ITaskItem), output: false, required: false),
                new TaskPropertyInfo("Parameter5", typeof(ITaskItem[]), output: false, required: false),
            };

            const string fragment = @"Dim x = 0";

            string expectedSourceCode = $@"'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
" +
#if NETFRAMEWORK
@"'     Runtime Version:4.0.30319.42000
" +
#endif
@$"'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports Microsoft.Build.Framework
Imports Microsoft.Build.Utilities
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.IO
Imports System.Linq
Imports System.Text

Namespace InlineCode

    Public Class {TaskName}
        Inherits Microsoft.Build.Utilities.Task

        Private _Parameter1 As String

        Public Overridable Property Parameter1() As String
            Get
                Return _Parameter1
            End Get
            Set
                _Parameter1 = value
            End Set
        End Property

        Private _Parameter2 As String

        Public Overridable Property Parameter2() As String
            Get
                Return _Parameter2
            End Get
            Set
                _Parameter2 = value
            End Set
        End Property

        Private _Parameter3 As String

        Public Overridable Property Parameter3() As String
            Get
                Return _Parameter3
            End Get
            Set
                _Parameter3 = value
            End Set
        End Property

        Private _Parameter4 As Microsoft.Build.Framework.ITaskItem

        Public Overridable Property Parameter4() As Microsoft.Build.Framework.ITaskItem
            Get
                Return _Parameter4
            End Get
            Set
                _Parameter4 = value
            End Set
        End Property

        Private _Parameter5() As Microsoft.Build.Framework.ITaskItem

        Public Overridable Property Parameter5() As Microsoft.Build.Framework.ITaskItem()
            Get
                Return _Parameter5
            End Get
            Set
                _Parameter5 = value
            End Set
        End Property

        Private _Success As Boolean = true

        Public Overridable Property Success() As Boolean
            Get
                Return _Success
            End Get
            Set
                _Success = value
            End Set
        End Property

        Public Overrides Function Execute() As Boolean
{fragment}
            Return Success
        End Function
    End Class
End Namespace
";

            TryLoadTaskBodyAndExpectSuccess(
                taskBody: $"{fragment}",
                expectedCodeLanguage: "VB",
                expectedSourceCode: expectedSourceCode,
                expectedCodeType: RoslynCodeTaskFactoryCodeType.Fragment,
                parameters: parameters);
        }

        [Fact]
        public void VisualBasicMethod()
        {
            const string method = @"Public Overrides Function Execute() As Boolean
            Dim x = 0
            Return True
        End Function";

            string expectedSourceCode = $@"'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
" +
#if NETFRAMEWORK
@"'     Runtime Version:4.0.30319.42000
" +
#endif
@$"'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports Microsoft.Build.Framework
Imports Microsoft.Build.Utilities
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.IO
Imports System.Linq
Imports System.Text

Namespace InlineCode

    Public Class {TaskName}
        Inherits Microsoft.Build.Utilities.Task

{method}
    End Class
End Namespace
";
            TryLoadTaskBodyAndExpectSuccess(
                taskBody: $"{method}",
                expectedCodeLanguage: "VB",
                expectedSourceCode: expectedSourceCode,
                expectedCodeType: RoslynCodeTaskFactoryCodeType.Method);
        }

        [Fact]
        public void CodeLanguageFromTaskBody()
        {
            TryLoadTaskBodyAndExpectSuccess("code", expectedCodeLanguage: "CS");
            TryLoadTaskBodyAndExpectSuccess("code", expectedCodeLanguage: "CS");
            TryLoadTaskBodyAndExpectSuccess("code", expectedCodeLanguage: "CS");
            TryLoadTaskBodyAndExpectSuccess("code", expectedCodeLanguage: "CS");

            TryLoadTaskBodyAndExpectSuccess("code", expectedCodeLanguage: "VB");
            TryLoadTaskBodyAndExpectSuccess("code", expectedCodeLanguage: "VB");
            TryLoadTaskBodyAndExpectSuccess("code", expectedCodeLanguage: "VB");
            TryLoadTaskBodyAndExpectSuccess("code", expectedCodeLanguage: "VB");
        }

        [Fact]
        public void CodeTypeFromTaskBody()
        {
            foreach (RoslynCodeTaskFactoryCodeType codeType in Enum.GetValues(typeof(RoslynCodeTaskFactoryCodeType)).Cast<RoslynCodeTaskFactoryCodeType>())
            {
                TryLoadTaskBodyAndExpectSuccess($"code", expectedCodeType: codeType);
            }

            using (TestEnvironment testEnvironment = TestEnvironment.Create())
            {
                TransientTestFile file = testEnvironment.CreateFile(fileName: "236D48CE30064161B31B55DBF088C8B2", contents: "6159BD98607A460AA4F11D2FA92E5436");

                // When Source is provided and Type is not provided, Type is expected to default to Type="Class".
                TryLoadTaskBodyAndExpectSuccess($"", expectedCodeType: RoslynCodeTaskFactoryCodeType.Class);

                foreach (RoslynCodeTaskFactoryCodeType codeType in Enum.GetValues(typeof(RoslynCodeTaskFactoryCodeType)).Cast<RoslynCodeTaskFactoryCodeType>())
                {
                    TryLoadTaskBodyAndExpectSuccess($"code", expectedCodeType: codeType);
                }
            }
        }

        [Fact]
        public void CSharpFragment()
        {
            const string fragment = "int x = 0;";
            string expectedSourceCode = $@"//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
" +
#if NETFRAMEWORK
@"//     Runtime Version:4.0.30319.42000
" +
#endif
$@"//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace InlineCode {{
    using Microsoft.Build.Framework;
    using Microsoft.Build.Utilities;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;

    public class {TaskName} : Microsoft.Build.Utilities.Task {{

        private bool _Success = true;

        public virtual bool Success {{
            get {{
                return _Success;
            }}
            set {{
                _Success = value;
            }}
        }}

        public override bool Execute() {{
{fragment}
            return Success;
        }}
    }}
}}
";
            TryLoadTaskBodyAndExpectSuccess(taskBody: $"{fragment}", expectedSourceCode: expectedSourceCode);
        }

        [Fact]
        public void CSharpFragmentWithProperties()
        {
            ICollection<TaskPropertyInfo> parameters = new List<TaskPropertyInfo>
            {
                new TaskPropertyInfo("Parameter1", typeof(string), output: false, required: true),
                new TaskPropertyInfo("Parameter2", typeof(string), output: true, required: false),
                new TaskPropertyInfo("Parameter3", typeof(string), output: true, required: true),
                new TaskPropertyInfo("Parameter4", typeof(ITaskItem), output: false, required: false),
                new TaskPropertyInfo("Parameter5", typeof(ITaskItem[]), output: false, required: false),
            };

            const string fragment = @"int x = 0;";

            string expectedSourceCode = $@"//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
" +
#if NETFRAMEWORK
@"//     Runtime Version:4.0.30319.42000
" +
#endif
$@"//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace InlineCode {{
    using Microsoft.Build.Framework;
    using Microsoft.Build.Utilities;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;

    public class {TaskName} : Microsoft.Build.Utilities.Task {{

        private string _Parameter1;

        public virtual string Parameter1 {{
            get {{
                return _Parameter1;
            }}
            set {{
                _Parameter1 = value;
            }}
        }}

        private string _Parameter2;

        public virtual string Parameter2 {{
            get {{
                return _Parameter2;
            }}
            set {{
                _Parameter2 = value;
            }}
        }}

        private string _Parameter3;

        public virtual string Parameter3 {{
            get {{
                return _Parameter3;
            }}
            set {{
                _Parameter3 = value;
            }}
        }}

        private Microsoft.Build.Framework.ITaskItem _Parameter4;

        public virtual Microsoft.Build.Framework.ITaskItem Parameter4 {{
            get {{
                return _Parameter4;
            }}
            set {{
                _Parameter4 = value;
            }}
        }}

        private Microsoft.Build.Framework.ITaskItem[] _Parameter5;

        public virtual Microsoft.Build.Framework.ITaskItem[] Parameter5 {{
            get {{
                return _Parameter5;
            }}
            set {{
                _Parameter5 = value;
            }}
        }}

        private bool _Success = true;

        public virtual bool Success {{
            get {{
                return _Success;
            }}
            set {{
                _Success = value;
            }}
        }}

        public override bool Execute() {{
{fragment}
            return Success;
        }}
    }}
}}
";

            TryLoadTaskBodyAndExpectSuccess(
                taskBody: $"{fragment}",
                expectedSourceCode: expectedSourceCode,
                expectedCodeType: RoslynCodeTaskFactoryCodeType.Fragment,
                parameters: parameters);
        }

        [Fact]
        public void CSharpMethod()
        {
            const string method = @"public override bool Execute() { int x = 0; return true; }";

            string expectedSourceCode = $@"//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
" +
#if NETFRAMEWORK
@"//     Runtime Version:4.0.30319.42000
" +
#endif
@$"//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace InlineCode {{
    using Microsoft.Build.Framework;
    using Microsoft.Build.Utilities;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;

    public class MyInlineTask : Microsoft.Build.Utilities.Task {{

{method}
    }}
}}
";
            TryLoadTaskBodyAndExpectSuccess(
                taskBody: $"{method}",
                expectedSourceCode: expectedSourceCode,
                expectedCodeType: RoslynCodeTaskFactoryCodeType.Method);
        }

        [Fact]
        public void CSharpFragmentSourceCodeFromFile()
        {
            const string sourceCodeFileContents = "int x = 0;";
            const string expectedSourceCode = @"//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
" +
#if NETFRAMEWORK
@"//     Runtime Version:4.0.30319.42000
" +
#endif
                                              $@"//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace InlineCode {{
    using Microsoft.Build.Framework;
    using Microsoft.Build.Utilities;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;

    public class {TaskName} : Microsoft.Build.Utilities.Task {{

        private bool _Success = true;

        public virtual bool Success {{
            get {{
                return _Success;
            }}
            set {{
                _Success = value;
            }}
        }}

        public override bool Execute() {{
{sourceCodeFileContents}
            return Success;
        }}
    }}
}}
";
            using (TestEnvironment testEnvironment = TestEnvironment.Create())
            {
                TransientTestFile file = testEnvironment.CreateFile(fileName: "CSharpFragmentSourceCodeFromFile.tmp", contents: sourceCodeFileContents);

                TryLoadTaskBodyAndExpectSuccess(
                    $"",
                    expectedSourceCode: expectedSourceCode,
                    expectedCodeType: RoslynCodeTaskFactoryCodeType.Fragment);
            }
        }

        [Fact]
        public void CSharpMethodSourceCodeFromFile()
        {
            const string sourceCodeFileContents = @"public override bool Execute() { int x = 0; return true; }";
            const string expectedSourceCode = @"//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
" +
#if NETFRAMEWORK
@"//     Runtime Version:4.0.30319.42000
" +
#endif
                                              @$"//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace InlineCode {{
    using Microsoft.Build.Framework;
    using Microsoft.Build.Utilities;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;

    public class MyInlineTask : Microsoft.Build.Utilities.Task {{

{sourceCodeFileContents}
    }}
}}
";
            using (TestEnvironment testEnvironment = TestEnvironment.Create())
            {
                TransientTestFile file = testEnvironment.CreateFile(fileName: "CSharpMethodSourceCodeFromFile.tmp", contents: sourceCodeFileContents);

                TryLoadTaskBodyAndExpectSuccess(
                    $"",
                    expectedSourceCode: expectedSourceCode,
                    expectedCodeType: RoslynCodeTaskFactoryCodeType.Method);
            }
        }

        [Fact]
        public void EmptyCodeElement()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "",
                expectedErrorMessage: "You must specify source code within the Code element or a path to a file containing source code.");
        }

        [Fact]
        public void EmptyIncludeAttributeOnReferenceElement()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "<Reference Include=\"\" />",
                expectedErrorMessage: "The \"Include\" attribute of the <Reference> element has been set but is empty. If the \"Include\" attribute is set it must not be empty.");
        }

        [Fact]
        public void EmptyLanguageAttributeOnCodeElement()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "",
                expectedErrorMessage: "The \"Language\" attribute of the  element has been set but is empty. If the \"Language\" attribute is set it must not be empty.");
        }

        [Fact]
        public void EmptyNamespaceAttributeOnUsingElement()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "<Using Namespace=\"\" />",
                expectedErrorMessage: "The \"Namespace\" attribute of the <Using> element has been set but is empty. If the \"Namespace\" attribute is set it must not be empty.");
        }

        [Fact]
        public void EmptySourceAttributeOnCodeElement()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "",
                expectedErrorMessage: "The \"Source\" attribute of the  element has been set but is empty. If the \"Source\" attribute is set it must not be empty.");
        }

        [Fact]
        public void EmptyTypeAttributeOnCodeElement()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "",
                expectedErrorMessage: "The \"Type\" attribute of the  element has been set but is empty. If the \"Type\" attribute is set it must not be empty.");
        }

        [Fact]
        public void IgnoreTaskCommentsAndWhiteSpace()
        {
            TryLoadTaskBodyAndExpectSuccess("code");
            TryLoadTaskBodyAndExpectSuccess("                code");
        }

        [Fact]
        public void InvalidCodeElementAttribute()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "",
                expectedErrorMessage: "The attribute \"Invalid\" is not valid for the  element.  Valid attributes are \"Language\", \"Source\", and \"Type\".");
        }

        [Fact]
        public void InvalidCodeLanguage()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "",
                expectedErrorMessage: "The specified code language \"Invalid\" is invalid.  The supported code languages are \"CS, VB\".");
        }

        [Fact]
        public void InvalidCodeType()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "",
                expectedErrorMessage: "The specified code type \"Invalid\" is invalid.  The supported code types are \"Fragment, Method, Class\".");
        }

        [Fact]
        public void InvalidTaskChildElement()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "<Invalid />",
                expectedErrorMessage: "The element <Invalid> is not a valid child of the <Task> element.  Valid child elements are , <Reference>, and <Using>.");

            TryLoadTaskBodyAndExpectFailure(
                taskBody: "invalidcode",
                expectedErrorMessage: "The element <Text> is not a valid child of the <Task> element.  Valid child elements are , <Reference>, and <Using>.");
        }

        [Fact]
        public void InvalidTaskXml()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "<invalid xml",
                expectedErrorMessage: "The specified task XML is invalid.  '<' is an unexpected token. The expected token is '='. Line 1, position 19.");
        }

        [Fact]
        public void MissingCodeElement()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "",
                expectedErrorMessage: $"The  element is missing for the \"{TaskName}\" task. This element is required.");
        }

        [Fact]
        public void MultipleCodeNodes()
        {
            TryLoadTaskBodyAndExpectFailure(
                taskBody: "<![CDATA[]]>",
                expectedErrorMessage: "Only one  element can be specified.");
        }

        [Fact]
        public void NamespacesFromTaskBody()
        {
            const string taskBody = @"
                <Using Namespace=""namespace.A"" />
                <Using Namespace=""   namespace.B   "" />
                <Using Namespace=""namespace.C""></Using>
                code";

            TryLoadTaskBodyAndExpectSuccess(
                taskBody,
                expectedNamespaces: new HashSet<string>
                {
                    "namespace.A",
                    "namespace.B",
                    "namespace.C",
                });
        }

        [Fact]
        public void ReferencesFromTaskBody()
        {
            const string taskBody = @"
                <Reference Include=""AssemblyA"" />
                <Reference Include=""   AssemblyB   "" />
                <Reference Include=""AssemblyC""></Reference>
                <Reference Include=""C:\Program Files(x86)\Common Files\Microsoft\AssemblyD.dll"" />
                code";

            TryLoadTaskBodyAndExpectSuccess(
                taskBody,
                expectedReferences: new HashSet<string>
                {
                    "AssemblyA",
                    "AssemblyB",
                    "AssemblyC",
                    @"C:\Program Files(x86)\Common Files\Microsoft\AssemblyD.dll"
                });
        }

        [Fact]
        public void SourceCodeFromFile()
        {
            const string sourceCodeFileContents = @"
1F214E27A13F432B9397F1733BC55929
9111DC29B0064E6994A68CFE465404D4";

            using (TestEnvironment testEnvironment = TestEnvironment.Create())
            {
                TransientTestFile file = testEnvironment.CreateFile(fileName: "CB3096DA4A454768AA9C0C4D422FC188.tmp", contents: sourceCodeFileContents);

                TryLoadTaskBodyAndExpectSuccess(
                    $"",
                    expectedSourceCode: sourceCodeFileContents,
                    expectedCodeType: RoslynCodeTaskFactoryCodeType.Class);
            }
        }

        private void TryLoadTaskBodyAndExpectFailure(string taskBody, string expectedErrorMessage)
        {
            if (expectedErrorMessage == null)
            {
                throw new ArgumentNullException(nameof(expectedErrorMessage));
            }

            MockEngine buildEngine = new MockEngine();

            TaskLoggingHelper log = new TaskLoggingHelper(buildEngine, TaskName)
            {
                TaskResources = Shared.AssemblyResources.PrimaryResources
            };

            bool success = RoslynCodeTaskFactory.TryLoadTaskBody(log, TaskName, taskBody, new List<TaskPropertyInfo>(), out RoslynCodeTaskFactoryTaskInfo _);

            success.ShouldBeFalse();

            buildEngine.Errors.ShouldBe(1);

            buildEngine.Log.ShouldContain(expectedErrorMessage, () => buildEngine.Log);
        }

        private void TryLoadTaskBodyAndExpectSuccess(
            string taskBody,
            ICollection<TaskPropertyInfo> parameters = null,
            ISet<string> expectedReferences = null,
            ISet<string> expectedNamespaces = null,
            string expectedCodeLanguage = null,
            RoslynCodeTaskFactoryCodeType? expectedCodeType = null,
            string expectedSourceCode = null,
            IReadOnlyList<string> expectedWarningMessages = null)
        {
            MockEngine buildEngine = new MockEngine();

            TaskLoggingHelper log = new TaskLoggingHelper(buildEngine, TaskName)
            {
                TaskResources = Shared.AssemblyResources.PrimaryResources
            };

            bool success = RoslynCodeTaskFactory.TryLoadTaskBody(log, TaskName, taskBody, parameters ?? new List<TaskPropertyInfo>(), out RoslynCodeTaskFactoryTaskInfo taskInfo);

            buildEngine.Errors.ShouldBe(0, buildEngine.Log);

            if (expectedWarningMessages == null)
            {
                buildEngine.Warnings.ShouldBe(0);
            }
            else
            {
                string output = buildEngine.Log;

                foreach (string expectedWarningMessage in expectedWarningMessages)
                {
                    output.ShouldContain(expectedWarningMessage, () => output);
                }
            }

            success.ShouldBeTrue();

            if (expectedReferences != null)
            {
                taskInfo.References.ShouldBe(expectedReferences);
            }

            if (expectedNamespaces != null)
            {
                taskInfo.Namespaces.ShouldBe(expectedNamespaces);
            }

            if (expectedCodeLanguage != null)
            {
                taskInfo.CodeLanguage.ShouldBe(expectedCodeLanguage);
            }

            if (expectedCodeType != null)
            {
                taskInfo.CodeType.ShouldBe(expectedCodeType.Value);
            }

            if (expectedSourceCode != null)
            {
                NormalizeRuntime(taskInfo.SourceCode)
                    .ShouldBe(NormalizeRuntime(expectedSourceCode), StringCompareShould.IgnoreLineEndings);
            }
        }

        private static readonly Regex RuntimeVersionLine = new Regex("Runtime Version:.*");

        private static string NormalizeRuntime(string input)
        {
            return RuntimeVersionLine.Replace(input, "Runtime Version:SOMETHING");
        }
    }
}


text:
Myron Wasylyk
Myron Wasylyk is senior vice president and managing director of The PBN Company, a public relations firm headquartered in Washington, DC that has extensive interests in Ukraine.
The company handles public relations for Victor Yushchenko, the western-leaning candidate in Ukraine's disputed presidential elections in 2004. Wasylyk has been quoted in the press as a spokesman for Yushchenko [1].
2 Quotes by Wasylyk about the Ukrainian election crisis of 2004
3 SourceWatch resources
The profile of Myron Wasylyk on PBN's website [2] offers the following brief biography:
1984: Graduated from Kent State University in Ohio.
Before 1997: worked for the US Departments of State and the Interior, the Republican National Committee, Burson-Marsteller, and Gavin Anderson & Company.
1997: joined PBN as a Senior Project Manager for the Ukraine Market Reform Education Program managed by the firm on behalf of the US Agency for International Development and the Cabinet of Ministers of Ukraine.
1998: "opened The PBN Company's representative office in Kyiv, where he currently oversees a staff of 16 professionals and numerous special consultants working in Ukraine and Moldova. He manages client services, strategic planning and government relations and works extensively with Ukraine's presidential, governmental and legislative leaders."
The profile also states that Wasylyk is involved in the following public roles:
"involved in a number of civic, not-for-profit and non-governmental organizations."
Chairman of the Board of the American Chamber of Commerce in Ukraine (AmCham).
The Ukraine Representative of the Coalition for Intellectual Property (CIPR).
A member of the Supervisory Board of the Eurasian Foundation in Ukraine.
A member of the Supervisory Board of the International Center for Policy Studies (ICPS).
Quotes by Wasylyk about the Ukrainian election crisis of 2004
November 25, The Washington Times: "'Moscow knowingly engaged its advisers in the Ukrainian election and were cognizant of the potential conflicts that could occur on the ground if massive election fraud occurred,' said Myron Wasylyk, an international adviser with experience working in Moscow, Kiev and Washington." [3]
November 26, The Moscow Times: "Myron Wasylyk, a spokesman for Yushchenko's political bloc, confirmed Thursday that the opposition candidate received the tapes from law enforcement officials." [4]
December 2, Bloomberg: "Yushchenko rejects starting the election from scratch and wants a rerun of the second round, said Myron Wasylyk, an aide to Yushchenko." [5]
December 2, BBC News: "'Viktor Yushchenko does not want to win another election,' said opposition spokesman Myron Wasylyk. He added that Mr Kuchma's team had made indirect approaches to discuss a possible immunity deal, but had been rebuffed. 'To do a deal you need two sides,' he said. 'Yushchenko will not cut a deal.'" [6]
December 3, Reuters: "'It's a great result. It opens up the way to a resolution of the political crisis,' said opposition analyst Myron Wasylyk." [7]
SourceWatch resources
Tak! Yushchenko (Tak! Ющенко)
The PBN Company
Viktor Yushchenko (Віктор Ющенко)
'Meet our staff' - profile of Myron Wasylyk on PBN's website. Undated, accessed December 5, 2004.
Natalia Feduschak, "Disputed vote pushes Ukraine toward strife", The Washington Times, November 25, 2004.
Simon Saradzhyan, "Alleged Tapes of Vote-Rigging", The Moscow Times, November 26, 2004.
Halia Pavliva and Julian Nundy, "Ukraine Deputies Debate PM; Court to Rule on Election", Bloomberg, December 2, 2004.
Stephen Mulvey, "Kuchma scrambles to secure future", BBC News, December 2, 2004.
Richard Balmforth, "Kiev Parties as Court Orders Re-Run of Rigged Poll", Reuters, December 3, 2004.
Retrieved from "https://www.sourcewatch.org/index.php?title=Myron_Wasylyk&oldid=142793"

redpajama_set_name: RedPajamaCommonCrawl


When the search for his missing wife takes him to a remote town, Michael finds himself in a living nightmare.
115 backers pledged $6,500 to help bring this project to life.
Michael, a young professor of Modern Folklore, is searching for his missing wife, Clara. A private detective points him to an abandoned town called Fair Plains. Michael arrives, and chases visions of Clara while escaping monsters from urban legends, like the murderous Hookman and the nightmarish Expressionless, while the town itself seems to bend time and space, preventing his escape. After escaping the mad wrath of Bloody Mary herself, he finds himself ready to flee, he makes a horrifying discovery.
UTV Films is Northern Arizona University's student-run film production studio. Beginning with the short film production of 'A Grim Tale' in Spring 2014, UTV Films began applying the Hollywood professional filmmaking model to student film production. Since then, UTV Films has produced four high quality student films and has even won awards at local film festivals. At UTV Films, students apply what they learn in the classroom to a hands on movie production process from writing to budgeting to scheduling to production and finally to distribution to the big screen and television. 'This is Where You Die' will be the result of a collaboration of all ninety students in UTV Films working together, each with a specifically assigned role, to create a short film that is of professional quality and can be submitted to film festivals, as well as included on their reel when they graduate.
UTV Films is the only opportunity at NAU for students to learn this kind of film production process hands on. The skills students will learn from participating in this production will make them much more marketable when they seek jobs in Hollywood.
The UTV Films staff is already well into preproduction for 'This is Where You Die'. The appointed UTV Films management staff is performing the production roles such as creating budgets and schedules using professional, industry-standard software, storyboarding scenes, and designing sets and costumes. The script for the film has undergone numerous revisions and is now polished and ready to shoot.
Production is scheduled to take place during the month of February and March.
UTV Films is an educational organization, which subsists on funds raised through small fundraisers and class fees. In order to produce a top-notch film, we will need to purchase props, set dressings, costumes, and other equipment that we currently do not have the funds for. Our costs to complete the project are drastically reduced by the fact that our crew does not require compensation, since every student in UTV Films receives school credit for their work in the class.
As with any film production of this scope and in this environment, it is inevitable that we will run into some small problems along the way. However, since this film is a class requirement, it will be completed regardless of any setbacks we encounter. We are dedicated to completing this film no matter what it takes and making it the best display of our combined talents that we possibly can.
Thanks for your support! Every dollar counts, and everyone here at UTV Films appreciates your contribution!
As a special thank you for your support, you will receive a shout out on our Facebook page!
Backers who select this reward will receive a link to download a copy of the film when it is complete!
Backers who select this reward will receive a link to download a digital copy of the film, as well as a copy of a teaser poster!
Backers who select this reward will receive a link to download a digital copy of the film, a teaser poster and theatrical poster!
Backers who select this reward will receive a link to download a digital copy of the film, a teaser poster, a theatrical poster, and a DVD copy of the film with special features!
Backers who select this reward will receive a link to download a digital copy of the film, a teaser poster, a theatrical poster, a DVD copy of the film with special features, and a special thank you in the film's credits!
Backers who select this reward will receive a link to download a digital copy of the film, a teaser poster, a theatrical poster, a DVD copy of the film with special features, and an associate producer credit in the film!
Backers who select this reward will receive a link to download a digital copy of the film, a teaser poster, a theatrical poster, a DVD copy of the film with special features, and an executive producer credit in the film!


Vaillancourt sits up front at Wings over Wheels.
I rose early that morning, right around dawn. Not because of the impending rays of the new morning sun, or the 58-degree air that had seeped through my open bedroom window, or those damned chirping birds, but because I was nervous. Nervous because I had a date.
A date with the Yankee Lady.
I was told to report to the airfield at 0900 to take my seat on this vintage World War II bomber, undoubtedly like thousands of members of America's Greatest Generation – you know, the one that endured a global depression only to be enveloped in global warfare? They flew more than a million missions in B-17 Flying Fortresses like the one I was about to board. I bet they were nervous, too.
Sure, we wouldn't be bombing anything, nor would we face anti-aircraft artillery, malicious Messerschmitts, or zealous Zeroes. We probably wouldn't be blown out of the sky, or auger in, or join the caterpillar club, but I was still nervous, because "vintage" is not usually what travelers yearn for in selecting their means of conveyance.
But this particular 68 year-old aircraft – owned by the Yankee Air Force, a museum organization based in Michigan – never did see combat; it was completed in mid-1945 and delivered to the United States Army Air Force as World War II finally drew to a close, and then leased to the Coast Guard. All of her weapons of war were stripped from her as her mission transitioned from that of mayhem to that of mercy.
During the 1960s, the heavily-modified taildragger bounced around doing yeoman's work, fighting fires and dusting crops before being cast in the 1969 epic film "Tora, Tora, Tora." In 1986, it was purchased by the YAF for $250,000 and remained grounded for almost a decade as the museum began restoration that included removing a side cargo door and replacing every single inch of wiring.
"It's completely restored to original condition," said Norm Ellickson, crew chief and flight engineer of the Yankee Lady. "It's probably 98 percent authentic, except today we have modern radios and GPS."
Today, this aircraft – silver and sleek and clunky and classy and almost deco in its proportions and lines – was parked on the tarmac outside North Coast Air's hangar at the northwestern end of Erie International Airport/Tom Ridge Field, the honored guest at "Wings over Wheels: Celebrating Erie's Runway to the Future," an air show/car show/ribbon-cutting ceremony for the newly-completed Runway 6-24 extension project.
I climbed aboard through the tiny hatch near the tail, and was immediately shocked at just how small it was inside; barely tall enough for 6-odd foot of man to stand up in – and nowhere near as wide – the fuselage was packed cheek-to-jowl with levers, cables, chairs, gauges, placards, radios the size of small cabinets, and, machine guns. Huge, belt-fed machine guns – up front, out back, up top, down below, and on each side.
The entire aircraft is unpressurized and unheated; horrifyingly, in the center of the its body rests a small gangway, no more than six inches wide and resembling a steel I-beam. This small gangway is all that connects aft with fore, and when the bomb bay doors beneath it open, all that prevents the crew from being sucked out to a frigid, hypoxic, splattery death is a series of hardly-comforting rope handrails located about knee-height on each side of the gangway. It is from this loud, windy, surreal spot that America's arsenals of democracy dispensed their load, 4,800 pounds at a time, over France, Germany, and parts of the Pacific.
I took my seat right up front – in the nose turret – and buckled in just as the engines began to crank: inboard starboard, outboard starboard, inboard port, outboard port.
We taxied from the ramp with the awkward gait of a taildragger – aircraft with a tail wheel (as opposed to a nose wheel) are notoriously difficult to deal with on the ground, as testified to by the shrieking of the massive brakes on the main landing gear.
Finally, we approached that final left turn that would place us on the active runway – coincidentally, Runway 6, Erie's runway to the future that was, in this case, my runway to the past.
All of a sudden, the four Wright R-1820-97 nine-cylinder turbocharged radial engines growled and hummed and seemed to shake the very foundation of reality from its celestial moorings. These things were loud as hell and immediately provoked the "flight" response of both passengers and airframe itself – every fiber of my being screamed in agony as every nerve in my body prepared every muscle in my body to take any possible means of egress. It was difficult to suppress, but there wasn't much choice. As we – 11 passengers and three crew – proceeded on our takeoff roll, pointed East-North East, propelled towards rotational velocity by almost 5,000 horsepower, all 56,000 pounds of the Yankee Lady shuddered and groaned.
We headed east, and from my cramped, tiny perch in the plexiglass globe attached to the nose of the aircraft, I watched downtown slip beneath my feet, flanked by the peninsula on my left.
reflecting back from the warm, grey concrete, the wind noise picked up as we approached 200 miles per hour.
We headed east, and from my cramped, tiny perch in the plexiglass globe attached to the nose of the aircraft, I watched downtown slip beneath my feet, flanked by the peninsula on my left. It's a beautiful downtown when you're only 3,000 feet above it; or, you could argue that it's a beautiful downtown once you're 3,000 feet above it, removed from the vacant storefronts, boarded-up houses, and panhandlers.
But as we approached the verdant, rolling grape fields east of town, we made a sweeping left turn, out over the lake. Now, to my left, far off in the distance to the south, a few small hills became visible, inking out a dark green contrast to the severe clear of the blue skies above and framing this entire valley-like plain that is the Erie region.
This perspective was both frightening and enlightening; focusing only on the downtown area often blinds us to the fact that we are part of a larger region, a larger world, just over those hills. We exist, as a community, in communion with all that – all of it, from here to Harrisburg to Hamburg to Hanoi. Our prosperity, no longer negotiated at the barrel of a gun, is linked.
We again made a wide circle around the city, headed out over the bay, and prepared to make that series of left turns that would align us with that runway to the past/future. I could see our home field, a flat oasis amidst a sea of trees, buildings, and cars hustling and bustling on a sunny summer Saturday, and I was grateful for it. Almost 80,000 of the brave men who crewed B-17s during World War II never got to see their home field once they'd left it.
But those who did, those who came back and built this country with their hands and made it great – they didn't have time to be nervous about strengthening their communities anymore. They took the perspective they gained thousands of feet above the graveyards they were made to create and built all those runways to futures past.
As we floated just feet above that runway for what seemed like an eternity, the ferocity of the engines quelled, the wind noise dying down, all was peaceful, quiet, even Zen-like.
Then the wheels hit reality with an audible squeal.
Back, on Earth, in Erie, the aircraft came to a complete stop. I crawled out that same tiny hatch and put my boots on that runway to the future. At nearly 70 years old, the Yankee Lady was no precocious schoolgirl, but rather a teacher – a teacher of lessons learned from the past, and applied to the future. And in today's nervous business climate, let's hope Erie's leaders, too, can find their perspective before our runway to the future becomes our bridge to nowhere.
For more information on "Wings over Wheels," visit ErieAirShow.com. Sunday's hours are from 10 a.m. to 4 p.m.


Vinfication: Short maceration of the grapes, pressing and a fermentation at a cool temperature around 15°c.
Tasting notes: Light color; aromas of red fruit and citrus, crispy taste and a great very long final.
Food pairing: Salade Niçoise, paella, grilled chicken, even fish, bouillabaise and asian food.


The verdict on the Britcom.
The verdict on Dreamworks' latest sequel.
The verdict on the crime comedy sequel.
The verdict on the sci-fi blockbuster starring Tom Cruise.
The verdict on the French romantic-drama.
The verdict on biographical drama starring Daniel Radcliffe.
The verdict on the computer-animated adventure based on the classic children's series.
The verdict on the latest instalment of the X-men franchise.
The verdict on Gareth Edwards' reboot of the monster classic.
The verdict on doppelganger thriller starring Jake Gyllenhaal.


text:
Ten Jinn
Progressive rock band, Ten Jinn, was formed in the beginning of 1991 by John Paul Strauss and Jimmy Borel. Their first CD, Wildman (produced by brothers Ken and Ivor Francis) was recorded during the next couple of years and, after a good deal of delay punctuated by the band doing a good deal of live performance, the record was finally released in 1996. The years between 1993 and 1996 saw a lot of musicians come and go from the band, but by the time they were invited to perform at the "kick-off" party at Baja Prog in Mexicali, Mexico in 1998, the line up consisted of John Paul Strauss on lead vocals and keyboards, Mark Wickliffe on drums and backing vocals, Bob Niemeyer on keyboards and backing vocals, Mike Matier on guitar and guitar-synthesizer, Matt Overholtzer on bass and Chapman Stick, and Stan Whitaker in the second guitar spot as a guest performer.
Partially as a result of the performance at Baja Prog 1998, Stan Whitaker discovered that not only had the fan base for his 1970s progressive rock band, Happy The Man, not diminished, but had in fact grown and flourished in the underground prog-rock scene. This prompted Stan to get HTM boys back together for a new release. Meanwhile, Ten Jinn, off the heady experience of rave reviews for their Baja Prog debut performance, redoubled their efforts and recorded the band's second CD, As on a Darkling Plain, which was picked up for distribution in America by InsideOut Records and, in Europe, by Sweden Rock Records.
The year 1999 saw a further rise in the band's popularity with performances once again at Baja Prog, this time on the big stage at Teatro Del Estato. The second CD, which had been out just a few months prior, was receiving great reviews, and with a strong live show, as well, the band was invited to be one of the headliners at Prog Day, later that year in North Carolina. The years 1999 and 2000 saw Ten Jinn gigging constantly up and down the West Coast from San Diego to Los Angeles to San Francisco. However, Stan Whitaker was soon to leave the band permanently, and move back to Maryland, where he continued to work bandmates from Happy The Man on a new CD, as well as with his new band, Oblivion Sun.
In 2001 the boys were back in the studio again, recording tracks for their third release, Alone, at Ken Francis' studio, Babaji's Cave, when Strauss decided to move to Sweden, where the second CD seemed to be doing rather better than it had been in the States, as well as for personal reasons. It was at this time, Strauss teamed up with Ken Skoglund, who took over Stan Whitaker's guitar duties, and with the CD partially in-the-bag by the LA crew, the recording, mix, and mastering was completed at Skoglund's Studio, "Sound Control Sweden," located in Skutskär, Sweden, just North of Stockholm. Alone was released on Sweden Rock Records in 2003 and once again, John was out gigging with another line-up, this time with a group of Swedish musicians, which included Skoglund as the main guitarist.
Strauss returned to the States a few years later in 2004 and, once again took a break from live-performance, to get an M.M. (Master's of Music) degree in theory and composition. The culmination of this was a symphonic poem Sisyphus (composed for piano and string orchestra). Shortly after receiving his Master's degree, Strauss did a several-year homesteading stint after which he returned to music and reworked Sisyphus, which the band recorded for Ten Jinn's fourth release. Appearing on this record are band members John Strauss, Mark Wickliffe, Mike Matier, and Ken Skoglund, along with several guest musicians. Available only as a download as of January 2017, Sisyphus marked the band's first release in 13 years; however, now under the auspices of Melodic Revolution Records CDs will also be available in May 2018.
John Paul Strauss: Lead and backing vocals, Keyboards
Mark Wickliffe: Drums, Bass & backing vocals
Ken Skoglund: Guitars & backing vocals
Mike Matier: Guitars
| Website | Facebook | Twitter |
Ziggy Blackstar (a tribute to David Bowie (2018) Melodic Revolution Records CD & Digital
Sisyphus (2018) Melodic Revolution Records CD & Digital
Alone (2003) Sweden Rock Records / Musea CD & Digital
As On A Darkling Plan (1999) Wildman Records CD & Digital
Wildman (1997) Wildman Records CD & Digital
Ziggy Blackstar (A Tribute To David Bowie) by Ten Jinn
Sisyphus by Ten Jinn
← Terry Newman Project Sunshine & Bullets →


text:
import itertools

import numpy
import six
import binascii
import time
import os

from chainer.links import NStepLSTM
import chainer.functions as F

from chainer import cuda
from chainer.functions.activation import lstm
from chainer.functions.array import concat
from chainer.functions.array import reshape
from chainer.functions.array import split_axis
from chainer.functions.array import stack
from chainer.functions.connection import linear
from chainer.functions.noise import dropout
from chainer.functions.connection.n_step_lstm import NStepLSTM as NStepLSTMFunction

if cuda.cudnn_enabled:
    cudnn = cuda.cudnn
    libcudnn = cuda.cudnn.cudnn
    _cudnn_version = libcudnn.getVersion()

class DropoutRandomStates(object):

    def __init__(self, seed):
        self._states = None

        if seed is None:
            try:
                seed_str = binascii.hexlify(os.urandom(8))
                seed = numpy.uint64(int(seed_str, 16))
            except NotImplementedError:
                seed = numpy.uint64(time.clock() * 1000000)
        else:
            seed = numpy.uint64(seed)

        self._seed = seed

    def create_dropout_states(self, dropout):
        handle = cudnn.get_handle()
        if self._states is None:
            self._states = cudnn.DropoutStates(handle, self._seed)
        # TODO(unno): Make a method to set dropout instead of calling API
        cudnn.set_dropout_descriptor(self._states._desc, handle, dropout)

        return self._states

_random_states = {}

def get_random_state():
    global _random_states
    dev = cuda.Device()
    rs = _random_states.get(dev.id, None)
    if rs is None:
        rs = DropoutRandomStates(os.getenv('CHAINER_SEED'))
        _random_states[dev.id] = rs
    return rs

class PointerArray(object):

    def __init__(self, lst, back_pointer):
        self._value = numpy.array(lst, dtype=numpy.intp)
        # Store back_pointer to prevent the GC removes the original variable
        self._back_pointer = back_pointer

    @property
    def data(self):
        return self._value.ctypes.data

def _split(inputs, pos):
    return inputs[:pos], inputs[pos:]

def _stack_weight(ws):
    # TODO(unno): Input of the current LSTM implementaiton is shuffled
    w = stack.stack(ws, axis=1)
    shape = w.shape
    return reshape.reshape(w, (shape[0] * shape[1],) + shape[2:])

class FixedLengthNStepLSTM(NStepLSTM):

    def __call__(self, hx, cx, xs, train=True):
        # xs: (length, batch, dim)

        ws = [[w.w0, w.w1, w.w2, w.w3, w.w4, w.w5, w.w6, w.w7] for w in self]
        bs = [[w.b0, w.b1, w.b2, w.b3, w.b4, w.b5, w.b6, w.b7] for w in self]

        hy, cy, ys = fixed_length_n_step_lstm(
            self.n_layers, self.dropout, hx, cx, ws, bs, xs,
            train=train)

        return hy, cy, ys

def _make_tensor_descriptor_array(xs, length):
    """Make an array of pointers denoting pointers of tensor descriptors.

    """
    descs = []
    batch_size = xs.shape[0] // length
    for i in range(length):
        x = xs[i*batch_size:(i+1)*batch_size]
        if x.ndim < 3:
            shape = x.shape + (1,) * (3 - x.ndim)
            x = x.reshape(shape)
        desc = cudnn.create_tensor_nd_descriptor(x)
        descs.append(desc)
    return PointerArray([d.value for d in descs], descs)

class FixedLengthNStepLSTMFunction(NStepLSTMFunction):

    def check_type_forward(self, in_types):
        pass

    def forward(self, inputs):
        (hx, cx), inputs = _split(inputs, 2)
        ws, inputs = _split(inputs, self.n_layers * 8)
        bs, inputs = _split(inputs, self.n_layers * 8)
        xs = inputs[0]

        hx = cuda.cupy.ascontiguousarray(hx)
        cx = cuda.cupy.ascontiguousarray(cx)
        xs = cuda.cupy.ascontiguousarray(xs)

        #x_desc = cudnn.create_tensor_nd_descriptor(x_list[0][..., None])
        x_desc = cudnn.create_tensor_nd_descriptor(cuda.cupy.copy(xs[0][..., None]))
        # NOTE: copy is necessary here, since xs in the original NStepLSTM implementation is a different array from xs_list[0]

        length = xs.shape[0]
        n_units = hx.shape[2]

        #xs = cuda.cupy.concatenate(x_list, axis=0)
        xs = xs.reshape(-1, xs.shape[2])    # (length * batch_size, dim)
        #ys = cuda.cupy.empty((len(xs), n_units), dtype=xs.dtype)
        ys = cuda.cupy.empty((xs.shape[0], n_units), dtype=xs.dtype)

        handle = cudnn.get_handle()
        self.handle = handle

        rnn_desc = cudnn.create_rnn_descriptor(
            n_units, self.n_layers, self.states.desc,
            libcudnn.CUDNN_LINEAR_INPUT, libcudnn.CUDNN_UNIDIRECTIONAL,
            libcudnn.CUDNN_LSTM, libcudnn.CUDNN_DATA_FLOAT)
        self.rnn_desc = rnn_desc

        #c_x_descs = _make_tensor_descriptor_array(x_list)
        c_x_descs = _make_tensor_descriptor_array(xs, length)
        hx_desc = cudnn.create_tensor_nd_descriptor(hx)
        cx_desc = cudnn.create_tensor_nd_descriptor(cx)

        weights_size = libcudnn.getRNNParamsSize(
            handle, rnn_desc.value, x_desc.value, libcudnn.CUDNN_DATA_FLOAT)
        w = cuda.cupy.empty((weights_size // 4, 1, 1), dtype=numpy.float32)
        w_desc = cudnn.create_filter_descriptor(w)

        for layer in six.moves.range(self.n_layers):
            for lin_layer_id in six.moves.range(8):
                mat = cudnn.get_rnn_lin_layer_matrix_params(
                    handle, rnn_desc, layer, x_desc, w_desc, w,
                    lin_layer_id)
                m = mat.reshape(mat.size)
                m[...] = ws[layer * 8 + lin_layer_id].ravel()
                bias = cudnn.get_rnn_lin_layer_bias_params(
                    handle, rnn_desc, layer, x_desc, w_desc, w,
                    lin_layer_id)
                b = bias.reshape(bias.size)
                b[...] = bs[layer * 8 + lin_layer_id]
        self.w = w
        self.w_desc = w_desc

        #sections = numpy.cumsum([len(x) for x in x_list[:-1]])
        #y_list = cuda.cupy.split(ys, sections)

        #c_y_descs = _make_tensor_descriptor_array(y_list)
        c_y_descs = _make_tensor_descriptor_array(ys, length)
        hy = cuda.cupy.empty_like(hx)
        cy = cuda.cupy.empty_like(cx)
        hy_desc = cudnn.create_tensor_nd_descriptor(hy)
        cy_desc = cudnn.create_tensor_nd_descriptor(cy)

        work_size = libcudnn.getRNNWorkspaceSize(
            handle, rnn_desc.value, length, c_x_descs.data)
        workspace = cuda.cupy.empty((work_size,), dtype='b')
        self.workspace = workspace

        if not self.train:
            libcudnn.RNNForwardInference(
                handle, rnn_desc.value, length,
                c_x_descs.data, xs.data.ptr, hx_desc.value, hx.data.ptr,
                cx_desc.value, cx.data.ptr, w_desc.value, w.data.ptr,
                c_y_descs.data, ys.data.ptr, hy_desc.value, hy.data.ptr,
                cy_desc.value, cy.data.ptr, workspace.data.ptr, work_size)

        else:
            reserve_size = libcudnn.getRNNTrainingReserveSize(
                handle, rnn_desc.value, length, c_x_descs.data)
            self.reserve_space = cuda.cupy.empty((reserve_size,), dtype='b')
            libcudnn.RNNForwardTraining(
                handle, rnn_desc.value, length,
                c_x_descs.data, xs.data.ptr, hx_desc.value, hx.data.ptr,
                cx_desc.value, cx.data.ptr, w_desc.value, w.data.ptr,
                c_y_descs.data, ys.data.ptr, hy_desc.value, hy.data.ptr,
                cy_desc.value, cy.data.ptr,
                workspace.data.ptr, work_size,
                self.reserve_space.data.ptr, reserve_size)

        self.c_y_descs = c_y_descs
        self.ys = ys
        self.c_x_descs = c_x_descs

        #return tuple([hy, cy] + y_list)
        return hy, cy, ys   # NOTE: ys has shape (-1, n_units)

    def backward(self, inputs, grads):
        (hx, cx), inputs = _split(inputs, 2)
        ws, inputs = _split(inputs, self.n_layers * 8)
        bs, inputs = _split(inputs, self.n_layers * 8)
        #x_list = inputs
        xs = inputs[0]

        hx = cuda.cupy.ascontiguousarray(hx)
        cx = cuda.cupy.ascontiguousarray(cx)
        xs = cuda.cupy.ascontiguousarray(xs)

        #dhy, dcy = grads[:2]
        #dy_list = list(grads[2:])
        dhy, dcy, dys = grads
        dys = cuda.cupy.ascontiguousarray(dys)
        if dhy is None:
            dhy = cuda.cupy.zeros_like(hx)
        if dcy is None:
            dcy = cuda.cupy.zeros_like(cx)
        #for i in six.moves.range(len(dys)):
        #    if dy_list[i] is None:
        #        dy_list[i] = cuda.cupy.zeros_like(x_list[i])

        #xs = cuda.cupy.concatenate(x_list, axis=0)
        length = xs.shape[0]
        batch_size = xs.shape[1]
        xs = xs.reshape(-1, xs.shape[2])
        #length = len(x_list)

        dhx = cuda.cupy.empty_like(hx)
        dcx = cuda.cupy.empty_like(cx)

        hx_desc = cudnn.create_tensor_nd_descriptor(hx)
        cx_desc = cudnn.create_tensor_nd_descriptor(cx)
        dhy_desc = cudnn.create_tensor_nd_descriptor(dhy)
        dcy_desc = cudnn.create_tensor_nd_descriptor(dcy)

        #c_dy_descs = _make_tensor_descriptor_array(dy_list)
        c_dy_descs = _make_tensor_descriptor_array(dys, length)
        #dys = cuda.cupy.concatenate(dy_list, axis=0)

        rnn_desc = self.rnn_desc
        handle = self.handle
        work_size = libcudnn.getRNNWorkspaceSize(
            handle, rnn_desc.value, length, self.c_x_descs.data)
        workspace = cuda.cupy.empty((work_size,), dtype='b')

        dhx_desc = cudnn.create_tensor_nd_descriptor(dhx)
        dcx_desc = cudnn.create_tensor_nd_descriptor(dcx)

        dxs = cuda.cupy.empty_like(xs)
        #sections = numpy.cumsum([len(x) for x in x_list[:-1]])
        #dx_list = cuda.cupy.split(dxs, sections, 0)
        #c_dx_descs = _make_tensor_descriptor_array(dx_list)
        c_dx_descs = _make_tensor_descriptor_array(dxs, length)

        libcudnn.RNNBackwardData(
            handle, rnn_desc.value, length,
            self.c_y_descs.data, self.ys.data.ptr,
            c_dy_descs.data, dys.data.ptr, dhy_desc.value, dhy.data.ptr,
            dcy_desc.value, dcy.data.ptr, self.w_desc.value, self.w.data.ptr,
            hx_desc.value, hx.data.ptr, cx_desc.value, cx.data.ptr,
            c_dx_descs.data, dxs.data.ptr, dhx_desc.value, dhx.data.ptr,
            dcx_desc.value, dcx.data.ptr, workspace.data.ptr, work_size,
            self.reserve_space.data.ptr, self.reserve_space.size)

        dw = cuda.cupy.zeros_like(self.w)
        dw_desc = cudnn.create_tensor_nd_descriptor(dw)
        libcudnn.RNNBackwardWeights(
            handle, rnn_desc.value, length,
            self.c_x_descs.data, xs.data.ptr,
            hx_desc.value, hx.data.ptr, self.c_y_descs.data, self.ys.data.ptr,
            workspace.data.ptr, work_size, dw_desc.value, dw.data.ptr,
            self.reserve_space.data.ptr, self.reserve_space.size)

        #dx = dx_list[0]
        dx = dxs[:batch_size]
        dx = dx.reshape(dx.shape + (1,))
        dx_desc = cudnn.create_tensor_nd_descriptor(dx)
        dws = [cuda.cupy.empty_like(w) for w in ws]
        dbs = [cuda.cupy.empty_like(b) for b in bs]
        for layer in six.moves.range(self.n_layers):
            for lin_layer_id in six.moves.range(8):
                mat = cudnn.get_rnn_lin_layer_matrix_params(
                    handle, rnn_desc, layer, dx_desc, dw_desc, dw,
                    lin_layer_id)
                v = dws[layer * 8 + lin_layer_id]
                v = v.reshape(v.size)
                v[:] = mat.ravel()
                bias = cudnn.get_rnn_lin_layer_bias_params(
                    handle, rnn_desc, layer, dx_desc, dw_desc, dw,
                    lin_layer_id)
                v = dbs[layer * 8 + lin_layer_id]
                v = v.reshape(v.size)
                v[:] = bias.ravel()

        dxs = dxs.reshape((length, batch_size, xs.shape[1]))

        #return tuple([dhx, dcx] + dws + dbs + dx_list)
        return tuple([dhx, dcx] + dws + dbs + [dxs])

def fixed_length_n_step_lstm(
        n_layers, dropout_ratio, hx, cx, ws, bs, xs, train=True,
        ):

    xp = cuda.get_array_module(hx, hx.data)

    if xp is not numpy and cuda.cudnn_enabled and _cudnn_version >= 5000:
        states = get_random_state().create_dropout_states(dropout_ratio)
        # flatten all input variables
        inputs = tuple(itertools.chain(
            (hx, cx),
            itertools.chain.from_iterable(ws),
            itertools.chain.from_iterable(bs),
            (xs,)))
        rnn = FixedLengthNStepLSTMFunction(n_layers, states, train=train)
        ret = rnn(*inputs)
        hy, cy, ys = ret
        _, batch_size, dim = hy.shape
        ys_reshape = F.reshape(ys, (-1, batch_size, dim))   # (length, batch, dim)
        return hy, cy, ys_reshape

    else:
        hx = split_axis.split_axis(hx, n_layers, axis=0, force_tuple=True)
        hx = [reshape.reshape(h, h.shape[1:]) for h in hx]
        cx = split_axis.split_axis(cx, n_layers, axis=0, force_tuple=True)
        cx = [reshape.reshape(c, c.shape[1:]) for c in cx]

        xws = [_stack_weight([w[2], w[0], w[1], w[3]]) for w in ws]
        hws = [_stack_weight([w[6], w[4], w[5], w[7]]) for w in ws]
        xbs = [_stack_weight([b[2], b[0], b[1], b[3]]) for b in bs]
        hbs = [_stack_weight([b[6], b[4], b[5], b[7]]) for b in bs]

        ys = []
        for x in xs:
            batch = x.shape[0]
            h_next = []
            c_next = []
            for layer in six.moves.range(n_layers):
                h = hx[layer]
                c = cx[layer]
                if h.shape[0] > batch:
                    h, h_rest = split_axis.split_axis(h, [batch], axis=0)
                    c, c_rest = split_axis.split_axis(c, [batch], axis=0)
                else:
                    h_rest = None

                x = dropout.dropout(x, ratio=dropout_ratio)
                h = dropout.dropout(h, ratio=dropout_ratio)
                lstm_in = linear.linear(x, xws[layer], xbs[layer]) + \
                          linear.linear(h, hws[layer], hbs[layer])

                c_bar, h_bar = lstm.lstm(c, lstm_in)
                if h_rest is not None:
                    h = concat.concat([h_bar, h_rest], axis=0)
                    c = concat.concat([c_bar, c_rest], axis=0)
                else:
                    h = h_bar
                    c = c_bar
                h_next.append(h)
                c_next.append(c)
                x = h_bar
            hx = h_next
            cx = c_next
            ys.append(x)

        hy = stack.stack(hx)
        cy = stack.stack(cx)
        #return hy, cy, tuple(ys)
        ys_concat = F.concat(ys, axis=0)
        ys_reshape = F.reshape(ys_concat, (-1, ys[0].shape[0], ys[0].shape[1]))     # (length, batch, dim)

        return hy, cy, ys_reshape

redpajama_set_name: RedPajamaGithub


Applying The Veneer. Applying the veneer is a simple but time consuming. I will give you as many pointers ?nternet site can to aid you in this method. You will have to cut the veneer to fit it to your display case face frame and storage end panels. This is fairly straightforward, measure the pieces you will need and cut them to match. One of the best ways to cut veneer is to use a good sharp utility utensil and a metal smooth edge. You will want to use a sacrificial sheet of plywood or perhaps mdf under your cutting. The moment cutting for the face framework pieces of your cabinets often try to be as accurate as possible so you do not have to lean the veneer when it is put on the cabinets, its fine if it's a 1/32 inch over and you have use a block out plane or a sanding engine block to fine tune it, any more than that you will have to try to cut it clear away and that can cause problems, so dependability is important here. Once you have every one of the cabinet face frames and ends covered you can move on to installing your new cabinet garage doors.
Veterinariancolleges - 27 tip jars that are too clever to resist buzzfeed. 27 tip jars that are too clever to resist make it rain posted on june 29, 2014, 16:44 gmt arianna rebolini buzzfeed staff this jar that's trying to have a good time. 27 tip jars that are too clever to resist me!!! funny. Insanely clever tip jars that will have you dropping in some change this post contains 25 creative and funny ways to ask for tips these ways besides being funny, they are truly creative and impressing clever tip jar idea for a face painter or balloon artist, etc might change the wording to fit your needs. 27 tip jars that are too clever to resist you need to. 27 tip jars that are too clever to resist read it 27 tip jars that are too clever to resist clever tip jars that raise a smile and some cash photos clever tip jars that raise a smile and some cash photos. 27 tip jars that are too clever to resist face art. This helpful offer 27 tip jars that are too clever to resist kim pierce art ideas i think they're trying to hint at something here funny tip jars, funny tips, funny quotes, funny images, funny pictures, funniest pictures, bartender, sushi ideas, el humor deanna michelle. 233 best tip jars images tip jars, funny tip jars, bartender. This helpful offer 27 tip jars that are too clever to resist see more funny tip jars just for laughs the funny funny test funny happy barista funny signs alzheimer's walk salon business 21 incredibly effective tip jars take a tip from me # 1 21 incredibly effective tip jars haha. Tip jar ideas, 22 of them, you're welcome the. In some parts of the world tipping is essential for the livelihood of hospitality staff, in other parts of the world, well, tips happen in all cases there's no excuse for missing the opportunity to make your customers smile, and if you're going to have a dish, vase or mug on the counter half filled with coins you might as well have fun with it. This deep cut funny. This realization 27 tip jars that are too clever to resist read it this deep cut this realization 27 tip jars that are too clever to resist. Creative tip jars that are too clever to resist youtube. Asking for a tip is never fun but if you ever find yourself in a position where you have no choice then maybe you can learn a thing or two from this list here we have the most creative tip jars. 28 tip jar decorating ideas design gallery. Browse photos of tip jar decorating ideas, glass jar decorating ideas, mason jar decorating ideas, candy jar decorating ideas, mason jar christmas decorating ideas, country mason jar decorating ideas, ways to decorate a jar, ball jar decorating ideas, mason jar decorating crafts, fall decorating with mason jars, apothecary jars decorating ideas, pinterest jar ideas, decorating mason jars for. ???? ??? 25 ????????? ????? ??? tip jars ??? pinterest. This jar that's trying to have a good time 27 tip jars that are too clever to resist cecilia antunano ideas para r gee this impossible decision.


text:
AdventHealth opens new training facility
EVOLVE Digital
AdventHealth has opened a high-tech facility to provide nurses with the highest level of training, using leading-edge simulation technology, according to a media release.
Located on the AdventHealth Palm Coast campus, the regional simulation center is the largest in AdventHealth's Central Florida footprint, which extends from Flagler County to Osceola County, south of Orlando. The center will provide realistic training for nurses of all skill levels, using interactive realistic manikins that can simulate a range of health conditions and scenarios. Trainers, working from a central command center, can make the manikins "speak" and introduce new challenges that nurses then must respond to.
"We want our team members to be able to deal with any clinical situation after having experienced different scenarios multiple times in a safe, simulated environment," said Lee Wright, manager of the sim center, in the release.
For front-line caregivers, the sim center offers an opportunity to refine their skills while learning new ones.
Training will even extend beyond clinical care, including teaching nurses how to interact with patients and deal with family members who may become difficult as they navigate their loved ones' health challenges.
The center will also help develop the next generation of health care workers, serving as a training site for nursing students from the University of North Florida and Jacksonville University.
"We know how important it is to maintain and grow a strong health care workforce," said AdventHealth Palm Coast CEO Dr. Ron Jimenez, in the release. "We're proud to have this facility right in Palm Coast, where we can train present and future nurses to serve all of North Florida."


ABC has picked up "Sundays with Alec Baldwin," a new one-hour talk show hosted by Oscar nominee and Emmy(R) and Golden Globe(R) Award-winning actor Alec Baldwin, featuring one-on-one conversations with some of the most interesting people from American pop culture. From ABC and Baldwin's El Dorado Pictures, a sneak peek will air SUNDAY, MARCH 4 (11:35 p.m. EST/10:00 p.m. PST), following the 90th Oscars, on The ABC Television Network.
"Alec's intellect, wit and wealth of life experience afford him a voice and perspective we haven't seen before in this format," said Channing Dungey, president, ABC Entertainment. "When we shot the pilot, we knew immediately we had something special that we couldn't wait to share. We are excited to be working on a series that showcases Alec as one of today's most compelling conversationalists and highlights the type of intimate discussions that he has captured on his podcast for years."
This first look features two intimate and engaging conversations with award-winning comedic icons. First, a candid and entertaining discussion with long-time friend Jerry Seinfeld on the state of comedy in the current social and political climate, and his life before and after "Seinfeld." Next up is Kate McKinnon, someone Baldwin says is one of the most talented people with whom he has ever worked. They discuss "Saturday Night Live," her early childhood performances that borrowed from scandalous headlines and the cast of characters that have made her a household name.
Baldwin hosts and executive produces "Match Game," now in season three on The ABC Television Network. Additionally, Baldwin's company, El Dorado Pictures, has a two-year first-look deal with ABC Studios. Since 1980, Baldwin has appeared in numerous productions on stage, in films and on television. He has received a Tony(R) nomination ("A Streetcar Named Desire," 1992), an Oscar nomination ("The Cooler," 2004), and has won three Emmy Awards, three Golden Globes and seven consecutive Screen Actors Guild Awards as Best Actor in a Comedy Series for his role on NBC's "30 Rock." In 2017, Baldwin won his third Emmy for Outstanding Actor in a Comedy Series for "Saturday Night Live" and was nominated for Outstanding Host for ABC's "Match Game." His films include "The Hunt for Red October," "Glengarry Glen Ross," "Malice," "The Edge," "It's Complicated," "Blue Jasmine," "Still Alice" and "Mission Impossible: Rogue Nation," among many others. Baldwin's latest book "You Can't Spell America Without Me" was published in November 2017.
"Sundays with Alec Baldwin" is produced for ABC by El Dorado Pictures. Jason Schrift ("Jimmy Kimmel Live!") serves as executive producer.
ABC Entertainment airs compelling programming across all day parts, with new shows including fall's No. 1 new drama, "The Good Doctor"; as well as "Kevin (Probably) Saves the World" and "The Mayor"; and current hits such as groundbreaking dramas "Designated Survivor," "Quantico," "Scandal" "How to Get Away with Murder," "Grey's Anatomy," "Marvel's Agents of S.H.I.E.L.D." and "Once Upon a Time." The ABC Television Network is also home to the Emmy(R) Award-winning "Modern Family" and trailblazing comedy favorites "black-ish," "American Housewife," "Fresh Off the Boat," "The Goldbergs," "The Middle" and "Speechless"; hit game shows "$100,000 Pyramid," "Celebrity Family Feud," "Match Game" and "To Tell the Truth"; reality phenomenon "Shark Tank," iconic "The Bachelor" franchise, long-running hits "Dancing with the Stars" and "America's Funniest Home Videos," and the return of "American Idol"; "General Hospital," which has aired for over 50 years on the network, along with daytime talk show "The Chew"; and late-night talk show "Jimmy Kimmel Live!" The network also boasts some of television's most prestigious awards shows, including "The Oscars," "The CMA Awards" and "The American Music Awards."


text:
PA: Court Hears Trump's Election Irregularity Claim
Home US NEWS
by John Lesnar
in US NEWS
A Pennsylvania court on Tuesday heard arguments in a lawsuit filed by President Donald Trump's campaign headquarters on November 9 to prevent the state electoral administration from declaring Democrat Joe Biden the winner of the election.
A few hours before the start of the hearing, Trump's headquarters asked to allow Trump's personal lawyer Rudy Giuliani to appear in court. Trump tweeted on Saturday that Giuliani has led a new legal team to continue the legal battle.
On Monday, three lawyers representing the Trump campaign announced their rejection, saying that the headquarters had agreed to do so. Judge Matthew Brann allowed two of the three lawyers to withdraw from the case.
Legal scholars believe that the lawsuits are unlikely to change the outcome of the elections. A senior lawyer from Biden's team called the lawsuits "theatricality."
The campaign headquarters and Trump supporters have filed lawsuits in several states, trying to challenge the election result.
Taking the lead in Pennsylvania, Biden received more than 270 electoral votes to win. Biden has 306 electoral votes, and Trump has 232, according to Edison Research's tally published Friday.
The Pennsylvania lawsuit revolves around allegations that voters were improperly allowed to correct ballots that were invalidated for technical reasons.
Trump's headquarters says that in districts that sympathize with Democrats, mailed ballots with defects were illegally identified before election day so voters can correct mistakes.
The Pennsylvania government asked the court to dismiss the claim, saying that all counties were allowed to inform voters about errors in their ballots, although it was not required.
The state electoral authorities also emphasize that there are very few ballots in question. In Pennsylvania, Biden is forecast to be ahead of Trump by more than 70,000 votes, with a score of 49.9 percent to 48.8 percent.
State Secretary Katie Primer is due to officially announce the election results on November 23rd, so Judge Brann will have to make a decision soon.
John Lesnar


KR1DAY M0RN1NG, SEnT.MBKR 9, l4i.
p! rrfli irnn,Z.ymnri 'jyer; Stockbridge, Fair! W.
I stiwk, Androw Tr.vr.y, 6 democrats, 13 fcds.
Pmiliiiiiy, Williain P, Nnycs; Shrewsbury I), T.
il.iriliin; U I's'.liavcn, J, lireen.
ryj Middlehury, Jospph Wiirner; .Monkton, Ii.
Vi'rgi'nn'iw, E. I). Woodbrige; Wcyhiidge, P.
ner; Mniohftidil, . Ilollister; l'iiyston, . C.
Griirt;.i; ttetcx,l, Ilolden; Montpelier, A.
l.nwl; Norlhlifld, N. Morsoj Plainrield, M. M.
I'uiR; l!nliury, .1. SpnUlag', If'iiitsfiold, II.
.Iniif; M'airi'ii, A. Cuhman; IFaterbury, .
Pvvgl ii); n'orccstcr, M. I'olsom, ub.
i i'i; Williamstown, II llow.
Belvidere, Jci'l'u Shitttuck; Cainbiidge, J. ?
O.'McFiirland, gain; H'olcutt, i.'. Lndd, gain.
h; Williston, .V. Parker, gain; Sbelhurii, R.
Jerico, '.. Dlissj Colchciter; J. S. Webstcr.
Iiv; Gluer, Siinlhi Grcosboio, .V. W.
M'lrrill; Groton, J. Welch; Hardwick, J. .
bnm; Newark, A. Stodd.inli Peachain, F,. C.
1'iiiifax, .1. S, Grovc. gain; Bakersfield, J. '.
lians, ('. Stilphin; Swanton, J. Barney.
Cl.irk; Hronklin, . U'hilntij; Dover, W.
Wilmington, nnnc; Windham, II. Ilarris.
Jutitn at tlic resillt of tho election in Iiiii tnwn.
Usnd up! nll itjcd up! Th.it, with llw "155"
i glory enouh for one ilay!
und snnii'timca thev would'nt rot tlieir skins!
You hued 'cin nut nratly boy, teazlesnnd nll.
ttwl n pull alloqelher." Mercury.
F.Jg-g-1 aclly! A veiy fino " pull altogclher!"
thciii if they have inndo nnything.
deadly and di'termincd one that was evcr fuught.
sor county havo ilmie up thn business.
their strenglh to do it nnd havo bcen defeated!
tci to be, nevcr stood so wull ns at this momcnt.
selvcs on tho rcsult. The demncrncv ofiho rnun.
beaten. They inlended to crmli "I.ncofocoisni"
l -r..i.. i- . . .. .
togetlier and bo ofgood chcer.
D K 31 O C U A C Y.
tho tariffqucstion, if we are in favor of a tariff.
last ho was heard to utter: 'what docs it sigmfiy."
"Slares cannol breath in England."Vtob.
Frsemen r laiod for light. U. f. Gax.
banks had nuspcnded payment (led off by the U.
Stntcs Bank,) in tho monlh of Ocloberprccccding.
14th of Februaiv. 1812. Thev W.wn ii ni,o.
npnilnro nfii n.trliitn rC I l.n... n .n.nl...l r.t.
Price, Hnndy, nnd Lewis, to coinpose said coin.
VouchiTMifR. Price, L. Lewis, and G.
$131,175. llow it was cxpciidcd, now liere np.
exaiiiination of llundv, thu commitli.'u say.
he did nut pretcnd to deny Ihat ho knew or bcliev.
be presuincd that they did.
iiionths since and was hcyond the rcachof proccss.
nnil was wnotiy unquestioned as to my opmions.
"JTi'(iou( a tihy or iHttifort,"
wholly unqueUioneJ," will lic readily helievcd.
sulf, lo carry out its protisions in good fuith."
ihere cxisled n prospect, in lhe eicnt of Gen.
ercd n whig party mcasure.
it is mitonous tn tliu country that, us lar as pleilg.
paily bound to its maiiitciiiinco bv evcry possibli!
clcrks in Washington, fills shurt ofthat sum.
have gro.vu too slrong for them.
ed. Not so, they have only got out their men.
For Iht Spirit oflht Jft.
does come within tlieir jurisdictinn.
we should suffer no man or rombination of men.
That the present listing law in snme parts is de.
to tho subject thnt many olhcri mtght.
crous, more vain. inoro fooliih. nnd more eiirav.
at a cot ol $600.
Tis a vcry fit subject for Harry lo itudy."
onlviret the "ron.t bicf." Tho "twn dnllnr. .
by eore, to mike room for huogry whigs."


text:
Tuesdays With Jerry: An Old Man, A Young Man, And A College Hockey Dynasty's Greatest Lessons (Part 1)
By Brian F. Apr 16, 2012, 8:00am EDT
Share All sharing options for: Tuesdays With Jerry: An Old Man, A Young Man, And A College Hockey Dynasty's Greatest Lessons (Part 1)
Apr 7, 2012; Tampa, FL, USA; The Boston College Eagles celebrate after defeating the Ferris State Bulldogs 4-1 in the finals of the 2012 Frozen Four at Tampa Bay Times Forum. Mandatory Credit: Douglas Jones-US PRESSWIRE
It's been a little over a week now since Jerry York and the Boston College men's hockey team brought home the school's fifth National Championship and third in the last five years. It's been a truly remarkable run for the program. I sincerely hope Frank Spaziani, Steve Donahue and Gene DeFilippo are paying close attention to the college hockey dynasty that York has built on the Heights. Both the football and men's basketball programs can learn a thing or two from Coach York.
This is part one of a five-part series examining five key takeaways that Boston College football and basketball can take from the Eagles National Championship men's hockey program. Leave your own thoughts in the comments section.
Follow A Blueprint
Shortly after BC knocked off Ferris State to win the National Championship, several news outlets wrote stories about the Boston College hockey blueprint. After York had won his first National Championship in 1984 at Bowling Green, legendary coach Bob Johnson gave York some advice that has remained central to his Championship BC teams:
"He said, 'Jerry, I'm going to tell you one thing: that when you win a national championship, now you have a blueprint as to how to win more of them,' " York recounted after winning his fifth national championship as a coach. "He said, 'It's incredibly important that once you win one, that you sit down and go back over what type of student-athletes did you have at that particular time, what were your practice plans like, what were your goals like. But look at everything they did during the course of the year and that's your blueprint, and that will enable you to win more national championships.' "
"And at that time, I thought, Oh, geez, I won one. But he's absolutely correct because until you win one, you don't really understand how you have to win them - what type of player you have to recruit, the practice schedule, just the whole emphasis on building through the tournament. And he was absolutely correct there."
I'd say that same blueprint has worked out pretty well for York in Chestnut Hill.
Now while Spaz and Donahue probably aren't going to win a National Championship here at BC, that doesn't mean they weren't a part of programs that enjoyed significant success in the past. Spaz has the 2007 and 2008 ACC Atlantic Division Champion years to draw on, while Donahue recently enjoyed significant success at Cornell.
For football, Spaz should think back to those 2007-08 teams -- the types of players that Jagodzinski and O'Brien recruited, the defensive and (particularly) offensive identities of the team, the types of plays that were most successful. Frankly it's been very difficult for BC football to establish an offensive identity with five OCs in five seasons, but maybe Spaz and Flip are (finally) onto something after bringing in a Steve Logan clone to run the offense. We can only hope.
Basketball is a bit different as Donahue's experiences at Cornell and in the Ivy League probably don't translate 1:1 with his stint on the Heights. But I think there are some commonalities that Donahue can draw from as he tries to rebuild the Eagles basketball program. Everything from the types of players he recruited to the practice schedule to the recruiting pitch to scheduling philosophy.


Sir Alfred has a terrible secret. A secret that should never ever be kept. But who will poor little Sir Alfred tell? Who can he trust? Remember, some secrets should never ever be kept.
This book was written to provide children with essential skills in self-protection, and to encourage them to always speak up. We recommend that children be read this story by a parent or caregiver.


text:
Cultural Studies and Curriculum
Language Ideologies and Curriculum Studies: An Empirical Approach to 'Worthwhile" Questions
Aria Razfar
For four decades critical modes of curriculum inquiry have inspired and informed new theoretical directions toward thinking about 'worthwhile' questions, Ideology and their relevance toward understanding social inequities and the educational disparity between dominant and non-dominant populations. However, in recent years, the viability and relevance of these modes of inquiry have been questioned on the basis of language accessibility and other 'practical' considerations which threaten to make curriculum inquiry as a field 'moribund.' In this conceptual paper, I argue for a grounded approach to the 'worthwhile' questions and in particular the notion of Ideology in curriculum inquiry. More specifically, I propose the language ideologies (LI) approach as a way to foreground many of the 'worthwhile' questions surrounding Ideology in an empirical, hence more 'practical' manner through the prism of 'language' and its extension: discourse and narrative analysis. Using the discourse analytic approach afforded by LI, I illustrate my case with multiple vignettes from studies of classroom discourse, interviews with teachers about contested language issues (i.e. bilingual education & African American Vernacular), and historical debates surrounding the status of languages other than 'Standard' English in the United States.
Aria Razfar is an Assistant Professor of Literacy, Language, & Culture at the University of Illinois at Chicago. His research focuses on English language learning across the life-span and multiple contexts of development. He draws on sociocultural and critical theories of language and learning. He has published extensively on the topic of language ideologies and its implications on learning, instruction, and policy. His most recent work on the topic appears in the journals of Anthropology & Education Quarterly, Critical Inquiry in Language Studies, Human Development, and Linguistics & Education. He is director of Transforming Literacy, Science, & Math through Action Research (LSciMAct), funded by the U.S. Department of Education. He can be reached at arazfar@uic.edu.


SCRANTON, Pa. -- Members of the Lackawanna College Police Academy tell us cadets learn about what to do about suspicious packages in the mail and those cadets are encouraged to share what they learn with the public.
Cadets at the Lackawanna College Police Academy honored the flag before beginning the day's lesson on Friday.
"The public and business people and organizations have a right to know so they can be prepared and when I talk about what we teach in the academy, what we are teaching in the academy is to help educate the public," said academy director John Chilleri.
John Chilleri sat down with Newswatch 16 to let us know what to watch out for when faced with a potentially suspicious package.
"Is there any type of odor? Any staining on the package that appears to be from the outside in or any staining at all?"
Chilleri also mentioned many indicators the United States Postal Service outlines on this poster, like an unknown or blank return address, misspelled words or sloppy writing, unofficial stamping, damage on the package, or an excessive amount of postage.
"Would not be in their best interest to show up at the post office to get this thing weighed, so they're going to guestimate or take a chance that it's going to make it to the location," Chilleri explained.
Folks Newswatch 16 spoke with as the Scranton Post Office say this recent incident has prompted them to take a closer look at their mail.
"It makes you wonder and I think it would make you, well, I don't want to say paranoid, but I think it would make you more aware," said Scranton resident Carol Jones.
Many are happy the protocols the post office has in place has kept the packages from reaching their intended locations.
"The postal inspectors do a bang-up job, wonderful. Thank God we have them," John Kane said.
Even though many packages that come through the post office are identified, the director of the police academy still says to watch out for packages that may have been made to look like they went through a distribution center or that have no official stamping on them at all. If you have a package like that, you should call law enforcement immediately.
And when the b*mb squad shows up, make sure the guy with the protective suit carries it out to the disposal unit, not the guy in shirt sleeves.


The Zavala Flag - The purported first official flag of the Republic of Texas, reportedly designed by Lorenzo de Zavala. This DeZavala hat is historic. A legendary TX masterpiece. This unique hat will make you the envy of every Texan.
This cap is curated on a Richardson 6 panel trucker hat. Structured crown with a cotton twill and mesh back. To keep it real, you will be strapping this bad boy on your noggin by a snap closure.


text:
Inside his Los Angeles studio, Mark Bradford talks mythology, the civil rights movement and the urban jungle in his latest paintings, ahead of his exhibition 'Cerberus' at Hauser & Wirth London, 2 October – 21 December 2019. Fundamental to Bradford's work is a process of layering. Just as the very fabric of each painting is formed from strata of pigmented paper which are scored, lacerated and stripped away, Bradford collides a multiplicity of references in his new works.
For the title of the exhibition, Bradford engages the many headed dog guarding the entryway to Hades, Cerberus. This mythological creature is a particularly resonant metaphor for Bradford, who has always been fascinated by interstitial spaces and figures. A consistent source of inspiration for the artist, mythology is a space in-between fact and fiction, history and imagination.
Another point of departure in developing the new works is the riots in Los Angeles known as the Watts Rebellion, which flared up in August 1965 and raged over six days. Bradford has long been interested in the ways in which populations, and particularly marginalized communities, are contained through the infrastructures of the urban environment. Developed using map-like grid motifs, 'hot spots' embedded into the surface of the artist's paintings evoke the reports on the riots commissioned by the California Governor's office in 1965, entitled 'Violence in the City – An End or a Beginning?'
Still from Mark Bradford's 'Dancing in the Street' (2019) © Mark Bradford
The video installation 'Dancing in the Street' (2019) features the iconic song penned by a trio of songwriters including Marvin Gaye, recorded by Martha and the Vandellas in 1964. This film takes the context of the civil rights movement at the time the hit song was released, layering the black-and-white footage of the band's live performance onto landmarks of the industrial area of South Los Angeles where Bradford's studio is located. As Bradford explains, 'I'm taking a very old recording and projecting it onto buildings that in 1965 would have been burned down. It's like recalling the spirit of that place, and at the same time inserting another history on top of it.'
Mark Bradford, Frostbite, 2019 © Mark Bradford. Photo: Joshua White
Rooted in Bradford's visceral approach to his materials, new works featured in the exhibition display a fluidity of form and composition. The resulting surfaces are alive with webs, intersecting networks and liquid reflections as the topological grids of the city increasingly dissolve in his abstract compositions. Bradford describes, 'It felt like the urban grid gave way to almost an urban jungle. The land took back the city. Half-temple. Half-nature-reclaiming-it. Half-civilization.'
Extending across the entirety of the gallery's spaces, 'Cerberus' is Mark Bradford's first exhibition at Hauser & Wirth in London, 2 October – 21 December 2019.
Keith Tyson: The sum of all possible paths
Drawing on a wide range of influences ranging from mathematics and science through to poetry and mythology, Keith...
10 Questions with Curator Daniel Hug on Moholy-Nagy
On the end of an unrelated archival film reel, the British Film Institute recently discovered a lost optical sound...
Achille Mauri on Fabio Mauri and the Post-War Italian Avant-Garde
At home in Milan, Achille Mauri, brother of Fabio Mauri, traces the cultural scenes of post-war Rome and Milan, a...
Lorna Simpson: In The Studio
Lorna Simpson talks to Frieze about her life and work in her Brooklyn studio. Simpson came to prominence in the...
Akris collaboration with Geta Brătescu
The Spring/Summer 2019 collection by Swiss fashion house Akris is a unique collaboration between Akris creative...
In 2017, Mark Bradford represented the United States at the 57th Venice Biennale with 'Tomorrow Is Another Day', an...