// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using UnityEditor;
using UnityEngine;

namespace Microsoft.MixedReality.Toolkit.Audio.Editor
{
    [CustomEditor(typeof(TextToSpeech))]
    public class TextToSpeechInspector : UnityEditor.Editor
    {
        private SerializedProperty voiceProperty;

        private void OnEnable()
        {
            voiceProperty = serializedObject.FindProperty("voice");
        }

        public override void OnInspectorGUI()
        {
            if (voiceProperty.enumValueIndex == (int)TextToSpeechVoice.Other)
            {
                DrawDefaultInspector();
                EditorGUILayout.HelpBox("Use the links below to find more available voices (for non en-US languages):", MessageType.Info);
                using (new EditorGUILayout.HorizontalScope())
                {
                    if (GUILayout.Button("Voices for HoloLens 2", EditorStyles.miniButton))
                    {
                        Application.OpenURL("https://docs.microsoft.com/hololens/hololens2-language-support");
                    }
                    if (GUILayout.Button("Voices for desktop Windows", EditorStyles.miniButton))
                    {
                        Application.OpenURL("https://support.microsoft.com/windows/appendix-a-supported-languages-and-voices-4486e345-7730-53da-fcfe-55cc64300f01#WindowsVersion=Windows_11");
                    }
                }
            }
            else
            {
                DrawPropertiesExcluding(serializedObject, "customVoice");
            }
            serializedObject.ApplyModifiedProperties();
        }
    }
}

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using UnityEditor;
using UnityEngine;

namespace Microsoft.MixedReality.Toolkit.Audio.Editor
{
    [CustomEditor(typeof(TextToSpeech))]
    public class TextToSpeechInspector : UnityEditor.Editor
    {
        private SerializedProperty voiceProperty;

        private void OnEnable()
        {
            voiceProperty = serializedObject.FindProperty("voice");
        }

        public override void OnInspectorGUI()
        {
            if (voiceProperty.intValue == (int)TextToSpeechVoice.Other)
            {
                DrawDefaultInspector();
                EditorGUILayout.HelpBox("Use the links below to find more available voices (for non en-US languages):", MessageType.Info);
                using (new EditorGUILayout.HorizontalScope())
                {
                    if (GUILayout.Button("Voices for HoloLens 2", EditorStyles.miniButton))
                    {
                        Application.OpenURL("https://docs.microsoft.com/hololens/hololens2-language-support");
                    }
                    if (GUILayout.Button("Voices for desktop Windows", EditorStyles.miniButton))
                    {
                        Application.OpenURL("https://support.microsoft.com/windows/appendix-a-supported-languages-and-voices-4486e345-7730-53da-fcfe-55cc64300f01#WindowsVersion=Windows_11");
                    }
                }
            }
            else
            {
                DrawPropertiesExcluding(serializedObject, "customVoice");
            }
            serializedObject.ApplyModifiedProperties();
        }
    }
}

Use intValue instead of enumValueIndex

Use intValue instead of enumValueIndex

Co-Authored-By: Kurtis <0f4329280cfdc62414626664b70b9a99adb2a291@users.noreply.github.com>


// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Xunit;

namespace System.Net.NetworkInformation.Tests
{
    public class NetworkChangeTest
    {
        [Fact]
        public void NetworkAddressChanged_AddRemove_Success()
        {
            NetworkAddressChangedEventHandler handler = NetworkChange_NetworkAddressChanged;
            NetworkChange.NetworkAddressChanged += handler;
            NetworkChange.NetworkAddressChanged -= handler;
        }

        [Fact]
        public void NetworkAddressChanged_JustRemove_Success()
        {
            NetworkAddressChangedEventHandler handler = NetworkChange_NetworkAddressChanged;
            NetworkChange.NetworkAddressChanged -= handler;
        }

        private void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }
    }
}

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Xunit;

namespace System.Net.NetworkInformation.Tests
{
    public class NetworkChangeTest
    {
        [Fact]
        [ActiveIssue(8066, PlatformID.OSX)]
        public void NetworkAddressChanged_AddRemove_Success()
        {
            NetworkAddressChangedEventHandler handler = NetworkChange_NetworkAddressChanged;
            NetworkChange.NetworkAddressChanged += handler;
            NetworkChange.NetworkAddressChanged -= handler;
        }

        [Fact]
        public void NetworkAddressChanged_JustRemove_Success()
        {
            NetworkAddressChangedEventHandler handler = NetworkChange_NetworkAddressChanged;
            NetworkChange.NetworkAddressChanged -= handler;
        }

        private void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }
    }
}

Disable hanging OSX NetworkInformation test


using Newtonsoft.Json;
using Xunit;

namespace Rollbar.Test {
    public class RollbarClientFixture {
        private readonly RollbarClient _rollbarClient;

        public RollbarClientFixture() {
            this._rollbarClient= new RollbarClient();
        }

        [Fact]
        public void Client_rendered_as_dict_when_empty() {
            Assert.Equal("{}", JsonConvert.SerializeObject(_rollbarClient));
        }
    }
}

using Newtonsoft.Json;
using Xunit;

namespace Rollbar.Test {
    public class RollbarClientFixture {
        private readonly RollbarClient _rollbarClient;

        public RollbarClientFixture() {
            this._rollbarClient= new RollbarClient();
        }

        [Fact]
        public void Client_rendered_as_dict_when_empty() {
            Assert.Equal("{}", JsonConvert.SerializeObject(_rollbarClient));
        }

        [Fact]
        public void Client_renders_arbitrary_keys_correctly() {
            _rollbarClient["test-key"] = "test-value";
            Assert.Equal("{\"test-key\":\"test-value\"}", JsonConvert.SerializeObject(_rollbarClient));
        }

        [Fact]
        public void Client_renders_javascript_entry_correctly() {
            _rollbarClient.Javascript = new RollbarJavascriptClient();
            Assert.Equal("{\"javascript\":{}}", JsonConvert.SerializeObject(_rollbarClient));
        }
    }
}

Add other rollbar client tests

Add other rollbar client tests


using System;
using System.Linq;
using Newtonsoft.Json;

namespace BmpListener.Bgp
{
    public abstract class BgpMessage
    {
        protected BgpMessage(ref ArraySegment<byte> data)
        {
            var bgpHeader = new BgpHeader(data);
            Type = bgpHeader.Type;
            var offset = data.Offset + 19;
            Length = (int) bgpHeader.Length;
            data = new ArraySegment<byte>(data.Array, offset, Length - 19);
        }

        public int Length { get; }
        [JsonIgnore]
        public MessageType Type { get; }

        public abstract void DecodeFromBytes(ArraySegment<byte> data);

        public static BgpMessage GetBgpMessage(ArraySegment<byte> data)
        {
            var msgType = (MessageType) data.ElementAt(18);
            switch (msgType)
            {
                case MessageType.Open:
                    return new BgpOpenMessage(data);
                case MessageType.Update:
                    return new BgpUpdateMessage(data);
                case MessageType.Notification:
                    return new BgpNotification(data);
                case MessageType.Keepalive:
                    throw new NotImplementedException();
                case MessageType.RouteRefresh:
                    throw new NotImplementedException();
                default:
                    throw new NotImplementedException();
            }
        }
    }
}

using System;
using System.Linq;
using Newtonsoft.Json;

namespace BmpListener.Bgp
{
    public abstract class BgpMessage
    {
        protected BgpMessage(ref ArraySegment<byte> data)
        {
            var bgpHeader = new BgpHeader(data);
            Type = bgpHeader.Type;
            var offset = data.Offset + 19;
            Length = (int) bgpHeader.Length;
            data = new ArraySegment<byte>(data.Array, offset, Length - 19);
        }

        [JsonIgnore]
        public int Length { get; }
        [JsonIgnore]
        public MessageType Type { get; }

        public abstract void DecodeFromBytes(ArraySegment<byte> data);

        public static BgpMessage GetBgpMessage(ArraySegment<byte> data)
        {
            var msgType = (MessageType) data.ElementAt(18);
            switch (msgType)
            {
                case MessageType.Open:
                    return new BgpOpenMessage(data);
                case MessageType.Update:
                    return new BgpUpdateMessage(data);
                case MessageType.Notification:
                    return new BgpNotification(data);
                case MessageType.Keepalive:
                    throw new NotImplementedException();
                case MessageType.RouteRefresh:
                    throw new NotImplementedException();
                default:
                    throw new NotImplementedException();
            }
        }
    }
}

Remove length object from all JSON messages


// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using System;

namespace osu.Framework.Graphics.Containers
{
    /// <summary>
    /// An element which starts hidden and can be toggled to visible.
    /// </summary>
    public abstract class OverlayContainer : Container, IStateful<Visibility>
    {

        protected override void LoadComplete()
        {
            if (state == Visibility.Hidden)
            {
                PopOut();
                Flush(true);
            }

            base.LoadComplete();
        }
        private Visibility state;
        public Visibility State
        {
            get { return state; }
            set
            {
                if (value == state) return;
                state = value;

                switch (value)
                {
                    case Visibility.Hidden:
                        PopOut();
                        break;
                    case Visibility.Visible:
                        PopIn();
                        break;
                }

                StateChanged?.Invoke();
            }
        }

        public event Action StateChanged;

        protected abstract void PopIn();

        protected abstract void PopOut();

        public override void Hide() => State = Visibility.Hidden;

        public override void Show() => State = Visibility.Visible;

        public void ToggleVisibility() => State = (State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible);
    }

    public enum Visibility
    {
        Hidden,
        Visible
    }
}

// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using System;

namespace osu.Framework.Graphics.Containers
{
    /// <summary>
    /// An element which starts hidden and can be toggled to visible.
    /// </summary>
    public abstract class OverlayContainer : Container, IStateful<Visibility>
    {

        protected override void LoadComplete()
        {
            if (state == Visibility.Hidden)
            {
                PopOut();
                Flush(true);
            }

            base.LoadComplete();
        }
        private Visibility state;
        public Visibility State
        {
            get { return state; }
            set
            {
                if (value == state) return;
                state = value;

                switch (value)
                {
                    case Visibility.Hidden:
                        PopOut();
                        break;
                    case Visibility.Visible:
                        PopIn();
                        break;
                }

                StateChanged?.Invoke(this, state);
            }
        }

        public event Action<OverlayContainer, Visibility> StateChanged;

        protected abstract void PopIn();

        protected abstract void PopOut();

        public override void Hide() => State = Visibility.Hidden;

        public override void Show() => State = Visibility.Visible;

        public void ToggleVisibility() => State = (State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible);
    }

    public enum Visibility
    {
        Hidden,
        Visible
    }
}

Make StateChanged action more verbose in its arguments.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MailTest
{
    public partial class LogOut : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MailTest
{
    public partial class LogOut : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Modifying file to check fork update
        }
    }
}

Test for checking Fork update

Test for checking Fork update


// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

namespace osu.Framework.Configuration
{
    public class BindableBool : Bindable<bool>
    {
        public BindableBool(bool value = false)
            : base(value)
        {
        }

        public static implicit operator bool(BindableBool value) => value != null && value.Value;

        public override string ToString() => Value.ToString();

        public override bool Parse(object s)
        {
            string str = s as string;
            if (str == null) return false;

            Value = str == @"1" || str == @"true";
            return true;
        }

        public void Toggle() => Value = !Value;
    }
}

// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

namespace osu.Framework.Configuration
{
    public class BindableBool : Bindable<bool>
    {
        public BindableBool(bool value = false)
            : base(value)
        {
        }

        public static implicit operator bool(BindableBool value) => value != null && value.Value;

        public override string ToString() => Value.ToString();

        public override bool Parse(object s)
        {
            string str = s as string;
            if (str == null) return false;

            Value = str == @"1" || str.Equals(@"true", System.StringComparison.OrdinalIgnoreCase);
            return true;
        }

        public void Toggle() => Value = !Value;
    }
}

Fix bools not being parsed correctly from config (case sensitivity).


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Platform;
using osuTK.Graphics;

namespace osu.Framework.Tests.Visual.Platform
{
    public class TestSceneActiveState : FrameworkTestScene
    {
        private IBindable<bool> isActive;
        private Box isActiveBox;

        [BackgroundDependencyLoader]
        private void load(GameHost host)
        {
            isActive = host.IsActive.GetBoundCopy();
        }

        protected override void LoadComplete()
        {
            base.LoadComplete();

            Children = new Drawable[]
            {
                isActiveBox = new Box
                {
                    Colour = Color4.Black,
                    RelativeSizeAxes = Axes.Both,
                },
            };

            isActive.BindValueChanged(active => isActiveBox.Colour = active.NewValue ? Color4.Green : Color4.Red);
        }
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Platform;
using osuTK.Graphics;

namespace osu.Framework.Tests.Visual.Platform
{
    public class TestSceneActiveState : FrameworkTestScene
    {
        private IBindable<bool> isActive;
        private IBindable<bool> cursorInWindow;

        private Box isActiveBox;
        private Box cursorInWindowBox;

        [BackgroundDependencyLoader]
        private void load(GameHost host)
        {
            isActive = host.IsActive.GetBoundCopy();
            cursorInWindow = host.Window.CursorInWindow.GetBoundCopy();
        }

        protected override void LoadComplete()
        {
            base.LoadComplete();

            Children = new Drawable[]
            {
                isActiveBox = new Box
                {
                    Colour = Color4.Black,
                    Width = 0.5f,
                    RelativeSizeAxes = Axes.Both,
                },
                cursorInWindowBox = new Box
                {
                    Colour = Color4.Black,
                    RelativeSizeAxes = Axes.Both,
                    Width = 0.5f,
                    Anchor = Anchor.TopRight,
                    Origin = Anchor.TopRight,
                },
            };

            isActive.BindValueChanged(active => isActiveBox.Colour = active.NewValue ? Color4.Green : Color4.Red, true);
            cursorInWindow.BindValueChanged(active => cursorInWindowBox.Colour = active.NewValue ? Color4.Green : Color4.Red, true);
        }
    }
}

Update TestCaseActiveState to cover Window.CursorInWindow state


// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using System;
using System.Linq;
using osu.Framework.IO.Stores;

namespace osu.Framework.Audio.Track
{
    public class TrackManager : AudioCollectionManager<AudioTrack>
    {
        IResourceStore<byte[]> store;

        AudioTrack exclusiveTrack;

        public TrackManager(IResourceStore<byte[]> store)
        {
            this.store = store;
        }

        public AudioTrack Get(string name)
        {
            AudioTrackBass track = new AudioTrackBass(store.GetStream(name));
            AddItem(track);
            return track;
        }

        public void SetExclusive(AudioTrack track)
        {
            if (exclusiveTrack == track) return;

            Items.ForEach(i => i.Stop());

            exclusiveTrack?.Dispose();
            exclusiveTrack = track;

            AddItem(track);
        }

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

            if (exclusiveTrack?.HasCompleted != false)
                findExclusiveTrack();
        }

        private void findExclusiveTrack()
        {
            exclusiveTrack = Items.FirstOrDefault();
        }
    }
}

// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using System;
using System.Linq;
using osu.Framework.IO.Stores;

namespace osu.Framework.Audio.Track
{
    public class TrackManager : AudioCollectionManager<AudioTrack>
    {
        IResourceStore<byte[]> store;

        AudioTrack exclusiveTrack;

        public TrackManager(IResourceStore<byte[]> store)
        {
            this.store = store;
        }

        public AudioTrack Get(string name)
        {
            AudioTrackBass track = new AudioTrackBass(store.GetStream(name));
            AddItem(track);
            return track;
        }

        /// <summary>
        /// Specify an AudioTrack which should get exclusive playback over everything else.
        /// Will pause all other tracks and throw away any existing exclusive track.
        /// </summary>
        public void SetExclusive(AudioTrack track)
        {
            if (exclusiveTrack == track) return;

            Items.ForEach(i => i.Stop());

            exclusiveTrack?.Dispose();
            exclusiveTrack = track;

            AddItem(track);
        }

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

            if (exclusiveTrack?.HasCompleted != false)
                findExclusiveTrack();
        }

        private void findExclusiveTrack()
        {
            exclusiveTrack = Items.FirstOrDefault();
        }
    }
}

Add comment about Exclusive tracks.

Add comment about Exclusive tracks.


using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Arango.Test
{
    [TestClass]
    public class CollectionTests
    {
        [TestMethod]
        public void TestMethod1()
        {
        }
    }
}

using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Arango.Client;

namespace Arango.Test
{
    [TestClass]
    public class CollectionTests
    {
        private ArangoDatabase _database;

        public CollectionTests()
        {
            string alias = "test";
            string[] connectionString = File.ReadAllText(@"..\..\..\..\..\ConnectionString.txt").Split(';');

            ArangoNode node = new ArangoNode(
                connectionString[0],
                int.Parse(connectionString[1]),
                connectionString[2],
                connectionString[3],
                alias
            );
            ArangoClient.Nodes.Add(node);

            _database = new ArangoDatabase(alias);
        }

        [TestMethod]
        public void CreateCollectionAndDeleteItByID()
        {
            ArangoCollection testCollection = new ArangoCollection();
            testCollection.Name = "tempUnitTestCollection001xyz";
            testCollection.Type = ArangoCollectionType.Document;
            testCollection.WaitForSync = false;
            testCollection.JournalSize = 1024 * 1024; // 1 MB

            ArangoCollection newCollection = _database.CreateCollection(testCollection.Name, testCollection.Type, testCollection.WaitForSync, testCollection.JournalSize);

            Assert.AreEqual(testCollection.Name, newCollection.Name);
            Assert.AreEqual(testCollection.Type, newCollection.Type);
            Assert.AreEqual(testCollection.WaitForSync, newCollection.WaitForSync);
            Assert.AreEqual(testCollection.JournalSize, newCollection.JournalSize);

            bool isDeleted = _database.DeleteCollection(newCollection.ID);

            Assert.IsTrue(isDeleted);
        }

        [TestMethod]
        public void CreateCollectionAndDeleteItByName()
        {
            ArangoCollection testCollection = new ArangoCollection();
            testCollection.Name = "tempUnitTestCollection002xyz";
            testCollection.Type = ArangoCollectionType.Document;
            testCollection.WaitForSync = false;
            testCollection.JournalSize = 1024 * 1024; // 1 MB

            ArangoCollection newCollection = _database.CreateCollection(testCollection.Name, testCollection.Type, testCollection.WaitForSync, testCollection.JournalSize);

            Assert.AreEqual(testCollection.Name, newCollection.Name);
            Assert.AreEqual(testCollection.Type, newCollection.Type);
            Assert.AreEqual(testCollection.WaitForSync, newCollection.WaitForSync);
            Assert.AreEqual(testCollection.JournalSize, newCollection.JournalSize);

            bool isDeleted = _database.DeleteCollection(newCollection.Name);

            Assert.IsTrue(isDeleted);
        }
    }
}

Make tests for delete collection methods.


using System;
using System.Linq;
using Sitecore.Data.Managers;
using Sitecore.Globalization;

namespace Unicorn.Data
{
	public static class SourceItemExtensions
	{
		/// <summary>
		/// Helper method to get a specific version from a source item, if it exists
		/// </summary>
		/// <returns>Null if the version does not exist or the version if it exists</returns>
		public static ItemVersion GetVersion(this ISourceItem sourceItem, string language, int versionNumber)
		{
			if (language.Equals(Language.Invariant.Name)) language = LanguageManager.DefaultLanguage.Name;

			return sourceItem.Versions.FirstOrDefault(x => x.Language.Equals(language, StringComparison.OrdinalIgnoreCase) && x.VersionNumber == versionNumber);
		}
	}
}

using System;
using System.Linq;

namespace Unicorn.Data
{
	public static class SourceItemExtensions
	{
		/// <summary>
		/// Helper method to get a specific version from a source item, if it exists
		/// </summary>
		/// <returns>Null if the version does not exist or the version if it exists</returns>
		public static ItemVersion GetVersion(this ISourceItem sourceItem, string language, int versionNumber)
		{
			return sourceItem.Versions.FirstOrDefault(x => x.Language.Equals(language, StringComparison.OrdinalIgnoreCase) && x.VersionNumber == versionNumber);
		}
	}
}

Fix error when items had invariant language versions (versions compared could be incorrectly the default language instead of the invariant language)


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace Samesound
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace Samesound
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
        }
    }
}

Add DetailedErrorPolicy in global configuration


using System.Runtime.CompilerServices;
using System.Reflection;

[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Management")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Utility")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Security")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Linux.Host")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Linux.UnitTests")]
[assembly:AssemblyFileVersionAttribute("3.0.0.0")]
[assembly:AssemblyVersion("3.0.0.0")]

namespace System.Management.Automation
{
    internal class NTVerpVars
    {
        internal const int PRODUCTMAJORVERSION = 10;
        internal const int PRODUCTMINORVERSION = 0;
        internal const int PRODUCTBUILD        = 10032;
        internal const int PRODUCTBUILD_QFE    = 0;
        internal const int PACKAGEBUILD_QFE    = 814;
    }
}

using System.Runtime.CompilerServices;
using System.Reflection;

[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Management")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Utility")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Security")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Linux.Host")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Linux.UnitTests")]
[assembly:AssemblyFileVersionAttribute("0.0.0.0")]
[assembly:AssemblyVersion("0.0.0.0")]

namespace System.Management.Automation
{
    internal class NTVerpVars
    {
        internal const int PRODUCTMAJORVERSION = 10;
        internal const int PRODUCTMINORVERSION = 0;
        internal const int PRODUCTBUILD        = 10032;
        internal const int PRODUCTBUILD_QFE    = 0;
        internal const int PACKAGEBUILD_QFE    = 814;
    }
}

Build SMA with version 0.0.0.0

Build SMA with version 0.0.0.0

Because the monad code expects this version on Linux for all PowerShell
assemblies. This should be changed back once they all build with 3.0.0.0.


using Newtonsoft.Json;

namespace Nest
{
	public interface IEmptyResponse : IResponse
	{
	}

	[JsonObject]
	//TODO Only used by clearscroll, does it really not return anything useful?
	public class EmptyResponse : BaseResponse, IEmptyResponse
	{
	}
}

using Newtonsoft.Json;

namespace Nest
{
	public interface IEmptyResponse : IResponse
	{
	}

	[JsonObject]
	public class EmptyResponse : BaseResponse, IEmptyResponse
	{
	}
}

Clear scroll does indeed return an empty response


using System.Collections.Generic;
using System.IO;
using System.Linq;
using ICSharpCode.SharpZipLib.Tar;

namespace AppHarbor
{
	public static class CompressionExtensions
	{
		public static void ToTar(this DirectoryInfo sourceDirectory, Stream output, string[] excludedDirectoryNames)
		{
			var archive = TarArchive.CreateOutputTarArchive(output);

			archive.RootPath = sourceDirectory.FullName.Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/');

			var entries = GetFiles(sourceDirectory, excludedDirectoryNames)
				.Select(x => TarEntry.CreateEntryFromFile(x.FullName));

			foreach (var entry in entries)
			{
				archive.WriteEntry(entry, true);
			}

			archive.Close();
		}

		private static IEnumerable<FileInfo> GetFiles(DirectoryInfo directory, string[] excludedDirectories)
		{
			IEnumerable<FileInfo> files = directory.GetFiles("*", SearchOption.TopDirectoryOnly);
			foreach (var nestedDirectory in directory.GetDirectories())
			{
				if (excludedDirectories.Contains(nestedDirectory.Name))
				{
					continue;
				}
				files = files.Concat(GetFiles(nestedDirectory, excludedDirectories));
			}

			return files;
		}
	}
}

using System.Collections.Generic;
using System.IO;
using System.Linq;
using ICSharpCode.SharpZipLib.Tar;

namespace AppHarbor
{
	public static class CompressionExtensions
	{
		public static void ToTar(this DirectoryInfo sourceDirectory, Stream output, string[] excludedDirectoryNames)
		{
			var archive = TarArchive.CreateOutputTarArchive(output);

			archive.RootPath = sourceDirectory.FullName.Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/');

			var entries = GetFiles(sourceDirectory, excludedDirectoryNames)
				.Select(x => TarEntry.CreateEntryFromFile(x.FullName));

			foreach (var entry in entries)
			{
				archive.WriteEntry(entry, true);
			}

			archive.Close();
		}

		private static IEnumerable<FileInfo> GetFiles(DirectoryInfo directory, string[] excludedDirectories)
		{
			return directory.GetFiles("*", SearchOption.TopDirectoryOnly)
				.Concat(directory.GetDirectories()
				.Where(x => excludedDirectories.Contains(x.Name))
				.SelectMany(x => GetFiles(x, excludedDirectories)));
		}
	}
}

Refactor to use linq expression

Refactor to use linq expression


using Discord;
using Discord.Commands;
using System;

namespace CoinBot.Discord.Commands
{
	public abstract class CommandBase : ModuleBase
	{
		protected static void AddAuthor(EmbedBuilder builder)
		{
			builder.WithAuthor(new EmbedAuthorBuilder
			{
				Name = "FunFair CoinBot - right click above to block",
				Url = "https://funfair.io",
				IconUrl = "https://files.coinmarketcap.com/static/img/coins/32x32/funfair.png"
			});
		}

		protected static void AddFooter(EmbedBuilder builder, DateTime? dateTime = null)
		{
			if (dateTime.HasValue)
			{
				builder.Timestamp = dateTime;
				builder.Footer = new EmbedFooterBuilder
				{
					Text = "Prices updated"
				};
			}
		}
	}
}

using Discord;
using Discord.Commands;
using System;

namespace CoinBot.Discord.Commands
{
	public abstract class CommandBase : ModuleBase
	{
		protected static void AddAuthor(EmbedBuilder builder)
		{
			builder.WithAuthor(new EmbedAuthorBuilder
			{
				Name = "FunFair CoinBot - right click above to block",
				Url = "https://funfair.io",
				IconUrl = "https://s2.coinmarketcap.com/static/img/coins/32x32/1757.png"
            });
		}

		protected static void AddFooter(EmbedBuilder builder, DateTime? dateTime = null)
		{
			if (dateTime.HasValue)
			{
				builder.Timestamp = dateTime;
				builder.Footer = new EmbedFooterBuilder
				{
					Text = "Prices updated"
				};
			}
		}
	}
}

Update Fun token image URL.

Update Fun token image URL.


using System.Collections.Generic;
using System.Collections.ObjectModel;
using GalaSoft.MvvmLight;

namespace DesktopWidgets.WindowViewModels
{
    public class SelectItemViewModel : ViewModelBase
    {
        private object _selectedItem;

        public SelectItemViewModel(IEnumerable<object> items)
        {
            ItemsList = new ObservableCollection<object>(items);
        }

        public ObservableCollection<object> ItemsList { get; set; }

        public object SelectedItem
        {
            get { return _selectedItem; }
            set
            {
                if (_selectedItem != value)
                {
                    _selectedItem = value;
                    RaisePropertyChanged();
                }
            }
        }
    }
}

using System.Collections.Generic;
using System.Collections.ObjectModel;
using GalaSoft.MvvmLight;

namespace DesktopWidgets.WindowViewModels
{
    public class SelectItemViewModel : ViewModelBase
    {
        private object _selectedItem;

        public SelectItemViewModel(IEnumerable<object> items)
        {
            ItemsList = new ObservableCollection<object>(items);

            if (ItemsList.Count > 0)
            {
                SelectedItem = ItemsList[0];
            }
        }

        public ObservableCollection<object> ItemsList { get; set; }

        public object SelectedItem
        {
            get { return _selectedItem; }
            set
            {
                if (_selectedItem != value)
                {
                    _selectedItem = value;
                    RaisePropertyChanged();
                }
            }
        }
    }
}

Select first item by default in "Select Item" window


using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.XR.Management;
using UnityEngine;
using UnityEngine.XR.Management;

namespace SuperSystems.UnityBuild
{
    public class XRPluginManagement : BuildAction, IPreBuildAction, IPreBuildPerPlatformAction
    {
        [Header("XR Settings")]
        [Tooltip("XR plugin loaders to use for this build")] public List<XRLoader> XRPlugins = new List<XRLoader>();
        [Tooltip("Whether or not to use automatic initialization of XR plugin loaders on startup")] public bool InitializeXROnStartup = true;

        public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
        {
            XRGeneralSettings generalSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(platform.targetGroup);
            XRManagerSettings settingsManager = generalSettings.Manager;
            List<XRLoader> previousLoaders = settingsManager.loaders;

            generalSettings.InitManagerOnStart = InitializeXROnStartup;

            settingsManager.loaders = XRPlugins;
        }
    }
}

using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.XR.Management;
using UnityEngine;
using UnityEngine.XR.Management;

namespace SuperSystems.UnityBuild
{
    public class XRPluginManagement : BuildAction, IPreBuildPerPlatformAction, IPostBuildPerPlatformAction
    {
        [Header("XR Settings")]
        [Tooltip("XR plugin loaders to use for this build")] public List<XRLoader> XRPlugins = new List<XRLoader>();
        [Tooltip("Whether or not to use automatic initialization of XR plugin loaders on startup")] public bool InitializeXROnStartup = true;

        public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
        {
            XRGeneralSettings generalSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(platform.targetGroup);
            XRManagerSettings settingsManager = generalSettings.Manager;

            generalSettings.InitManagerOnStart = InitializeXROnStartup;

            settingsManager.loaders = XRPlugins;
        }
    }
}

Allow XR Plug-in Management settings to be configured post-build


using System;
using System.Web;
using System.Web.Mvc;
using Serilog;

namespace Commencement.Mvc
{
    public class FilterConfig
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleAndLogErrorAttribute());
        }
    }

    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method,
    Inherited = true, AllowMultiple = true)]
    public class HandleAndLogErrorAttribute : HandleErrorAttribute
    {
        public override void OnException(ExceptionContext filterContext)
        {
            // log exception here via stackify
            //Log.Error(filterContext.Exception.Message, filterContext.Exception);
            Log.Error(filterContext.Exception, filterContext.Exception.Message);
            base.OnException(filterContext);
        }
    }
}

using System;
using System.Web;
using System.Web.Mvc;
using Serilog;

namespace Commencement.Mvc
{
    public class FilterConfig
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleAndLogErrorAttribute());
        }
    }

    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method,
    Inherited = true, AllowMultiple = true)]
    public class HandleAndLogErrorAttribute : HandleErrorAttribute
    {
        public override void OnException(ExceptionContext filterContext)
        {
            // log exception here via stackify
            Log.Error(filterContext.Exception, filterContext.Exception.Message);
            base.OnException(filterContext);
        }
    }
}

Kill commented out code so Scott isn't sad


using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using SurveyMonkey.Containers;
using SurveyMonkey.RequestSettings;

namespace SurveyMonkey
{
    public partial class SurveyMonkeyApi
    {
        public List<Response> GetResponseOverviews(int id)
        {
            string endPoint = String.Format("https://api.surveymonkey.net/v3/surveys/{0}/responses", id);
            var verb = Verb.GET;
            JToken result = MakeApiRequest(endPoint, verb, new RequestData());
            var responses = result["data"].ToObject<List<Response>>();
            return responses;
        }

        public List<Response> GetResponseDetails(int id)
        {
            string endPoint = String.Format("https://api.surveymonkey.net/v3/surveys/{0}/responses/bulk", id);
            var verb = Verb.GET;
            JToken result = MakeApiRequest(endPoint, verb, new RequestData());
            var responses = result["data"].ToObject<List<Response>>();
            return responses;
        }
    }
}

using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using SurveyMonkey.Containers;
using SurveyMonkey.RequestSettings;

namespace SurveyMonkey
{
    public partial class SurveyMonkeyApi
    {
        private enum SurveyOrCollector
        {
            Survey,
            Collector
        }

        public List<Response> GetSurveyResponseOverviews(int id)
        {
            return GetResponsesRequest(id, false, SurveyOrCollector.Survey);
        }

        public List<Response> GetSurveyResponseDetails(int id)
        {
            return GetResponsesRequest(id, true, SurveyOrCollector.Survey);
        }

        public List<Response> GetCollectorResponseOverviews(int id)
        {
            return GetResponsesRequest(id, false, SurveyOrCollector.Collector);
        }

        public List<Response> GetCollectorResponseDetails(int id)
        {
            return GetResponsesRequest(id, true, SurveyOrCollector.Collector);
        }

        private List<Response> GetResponsesRequest(int id, bool details, SurveyOrCollector source)
        {
            var bulk = details ? "/bulk" : String.Empty;
            string endPoint = String.Format("https://api.surveymonkey.net/v3/{0}s/{1}/responses{2}", source.ToString().ToLower(), id, bulk);
            var verb = Verb.GET;
            JToken result = MakeApiRequest(endPoint, verb, new RequestData());
            var responses = result["data"].ToObject<List<Response>>();
            return responses;
        }
    }
}

Support responses for collectors, and commonise


using Medallion.Threading.Postgres;
using Microsoft.Data.SqlClient;
using Npgsql;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Medallion.Threading.Tests.Tests.Postgres
{
    public class PostgresDistributedLockTest
    {
        [Test]
        public async Task TestInt64AndInt32PairKeyNamespacesAreDifferent()
        {
            var connectionString = TestingPostgresDistributedLockEngine.GetConnectionString();
            var key1 = new PostgresAdvisoryLockKey(0);
            var key2 = new PostgresAdvisoryLockKey(0, 0);
            var @lock1 = new PostgresDistributedLock(key1, connectionString);
            var @lock2 = new PostgresDistributedLock(key2, connectionString);

            using var handle1 = await lock1.TryAcquireAsync();
            Assert.IsNotNull(handle1);

            using var handle2 = await lock2.TryAcquireAsync();
            Assert.IsNotNull(handle2);
        }

        // todo idle pruning interval?
    }
}

using Medallion.Threading.Postgres;
using Microsoft.Data.SqlClient;
using Npgsql;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Medallion.Threading.Tests.Tests.Postgres
{
    public class PostgresDistributedLockTest
    {
        [Test]
        public async Task TestInt64AndInt32PairKeyNamespacesAreDifferent()
        {
            var connectionString = TestingPostgresDistributedLockEngine.GetConnectionString();
            var key1 = new PostgresAdvisoryLockKey(0);
            var key2 = new PostgresAdvisoryLockKey(0, 0);
            var @lock1 = new PostgresDistributedLock(key1, connectionString);
            var @lock2 = new PostgresDistributedLock(key2, connectionString);

            using var handle1 = await lock1.TryAcquireAsync();
            Assert.IsNotNull(handle1);

            using var handle2 = await lock2.TryAcquireAsync();
            Assert.IsNotNull(handle2);
        }

        // todo probably just always needs keepalive
        [Test]
        public async Task TestIdleConnectionPruning()
        {
            var connectionString = new NpgsqlConnectionStringBuilder(TestingPostgresDistributedLockEngine.GetConnectionString())
            {
                ConnectionIdleLifetime = 1,
                ConnectionPruningInterval = 1,
                MaxPoolSize = 1,
                Timeout = 2,
            }.ConnectionString;

            var @lock = new PostgresDistributedLock(new PostgresAdvisoryLockKey("IdeConPru"), connectionString);
            using var handle1 = await @lock.AcquireAsync();

            await Task.Delay(TimeSpan.FromSeconds(.5));

            using var handle2 = await @lock.TryAcquireAsync(TimeSpan.FromSeconds(5));
            Assert.IsNotNull(handle2);
        }

        // todo idle pruning interval?
    }
}

Add connection pruning test (currently just fails)


using System;
using System.IO;

namespace NSync.Client
{
    public class UpdateManager
    {
        Func<string, Stream> openPath;
        Func<string, IObservable<string>> downloadUrl;

        public UpdateManager(string url,
            Func<string, Stream> openPathMock = null,
            Func<string, IObservable<string>> downloadUrlMock = null)
        {
            openPath = openPathMock;
            downloadUrl = downloadUrlMock;
        }

        public IObservable<UpdateInfo> CheckForUpdate()
        {
            throw new NotImplementedException();
        }
    }

    public class UpdateInfo
    {
        public string Version { get; protected set; }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using NSync.Core;

namespace NSync.Client
{
    public class UpdateManager
    {
        Func<string, Stream> openPath;
        Func<string, IObservable<string>> downloadUrl;
        string updateUrl;

        public UpdateManager(string url,
            Func<string, Stream> openPathMock = null,
            Func<string, IObservable<string>> downloadUrlMock = null)
        {
            updateUrl = url;
            openPath = openPathMock;
            downloadUrl = downloadUrlMock;
        }

        public IObservable<UpdateInfo> CheckForUpdate()
        {
            IEnumerable<ReleaseEntry> localReleases;

            using (var sr = new StreamReader(openPath(Path.Combine("packages", "RELEASES")))) {
                localReleases = ReleaseEntry.ParseReleaseFile(sr.ReadToEnd());
            }

            var ret = downloadUrl(updateUrl)
                .Select(ReleaseEntry.ParseReleaseFile)
                .Select(releases => determineUpdateInfo(localReleases, releases))
                .Multicast(new AsyncSubject<UpdateInfo>());

            ret.Connect();
            return ret;
        }

        UpdateInfo determineUpdateInfo(IEnumerable<ReleaseEntry> localReleases, IEnumerable<ReleaseEntry> remoteReleases)
        {
            if (localReleases.Count() == remoteReleases.Count()) {
                return null;
            }
        }
    }

    public class UpdateInfo
    {
        public string Version { get; protected set; }
    }
}

Write the top-level function for checking for updates


using System;

#pragma warning disable 1591

namespace E247.Fun
{
    public struct Unit : IEquatable<Unit>
    {
        public static readonly Unit Value = new Unit();

        public override int GetHashCode() =>
            0;

        public override bool Equals(object obj) =>
            obj is Unit;

        public override string ToString() =>
            "()";

        public bool Equals(Unit other) =>
            true;

        public static bool operator ==(Unit lhs, Unit rhs) =>
            true;

        public static bool operator !=(Unit lhs, Unit rhs) =>
            false;

        // with using static E247.Juke.Model.Entities.Unit, allows using unit instead of the ugly Unit.Value
        // ReSharper disable once InconsistentNaming
        public static Unit unit =>
            Value;

        // with using static E247.Juke.Model.Entities.Unit, allows using ignore(anything) to have anything return unit
        // ReSharper disable once InconsistentNaming
        public static Unit ignore<T>(T anything) =>
            unit;
    }
}

using System;

#pragma warning disable 1591

namespace E247.Fun
{
    public struct Unit : IEquatable<Unit>
    {
        public static readonly Unit Value = new Unit();

        public override int GetHashCode() =>
            0;

        public override bool Equals(object obj) =>
            obj is Unit;

        public override string ToString() =>
            "()";

        public bool Equals(Unit other) =>
            true;

        public static bool operator ==(Unit lhs, Unit rhs) =>
            true;

        public static bool operator !=(Unit lhs, Unit rhs) =>
            false;

        // with using static E247.Fun.Unit, allows using unit instead of the ugly Unit.Value
        // ReSharper disable once InconsistentNaming
        public static Unit unit =>
            Value;

        // with using static E247.Fun.Unit, allows using ignore(anything) to have anything return unit
        // ReSharper disable once InconsistentNaming
        public static Unit ignore<T>(T anything) =>
            unit;
    }
}

Update namespace reference in unit comments


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Diagnostics.CodeAnalysis;

namespace osu.Framework.Extensions.ObjectExtensions
{
    /// <summary>
    /// Extensions that apply to all objects.
    /// </summary>
    public static class ObjectExtensions
    {
        /// <summary>
        /// Coerces a nullable object as non-nullable. This is an alternative to the C# 8 null-forgiving operator "<c>!</c>".
        /// </summary>
        /// <remarks>
        /// This should only be used when an assertion or other handling is not a reasonable alternative.
        /// </remarks>
        /// <param name="obj">The nullable object.</param>
        /// <typeparam name="T">The type of the object.</typeparam>
        /// <returns>The non-nullable object corresponding to <paramref name="obj"/>.</returns>
        [return: NotNullIfNotNull("obj")]
        public static T AsNonNull<T>(this T? obj) => obj!;

        /// <summary>
        /// If the given object is null.
        /// </summary>
        public static bool IsNull<T>([NotNullWhen(false)] this T obj) => ReferenceEquals(obj, null);

        /// <summary>
        /// <c>true</c> if the given object is not null, <c>false</c> otherwise.
        /// </summary>
        public static bool IsNotNull<T>([NotNullWhen(true)] this T obj) => !ReferenceEquals(obj, null);
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Diagnostics.CodeAnalysis;

namespace osu.Framework.Extensions.ObjectExtensions
{
    /// <summary>
    /// Extensions that apply to all objects.
    /// </summary>
    public static class ObjectExtensions
    {
        /// <summary>
        /// Coerces a nullable object as non-nullable. This is an alternative to the C# 8 null-forgiving operator "<c>!</c>".
        /// </summary>
        /// <remarks>
        /// This should only be used when an assertion or other handling is not a reasonable alternative.
        /// </remarks>
        /// <param name="obj">The nullable object.</param>
        /// <typeparam name="T">The type of the object.</typeparam>
        /// <returns>The non-nullable object corresponding to <paramref name="obj"/>.</returns>
        [return: NotNull]
        public static T AsNonNull<T>(this T? obj) => obj!;

        /// <summary>
        /// If the given object is null.
        /// </summary>
        public static bool IsNull<T>([NotNullWhen(false)] this T obj) => ReferenceEquals(obj, null);

        /// <summary>
        /// <c>true</c> if the given object is not null, <c>false</c> otherwise.
        /// </summary>
        public static bool IsNotNull<T>([NotNullWhen(true)] this T obj) => !ReferenceEquals(obj, null);
    }
}

Change AsNonNull to NotNull return

Change AsNonNull to NotNull return


using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace SFA.DAS.EmployerUsers.Api.Controllers
{

    [RoutePrefix("api/status")]
    public class StatusController : ApiController
    {
        [HttpGet, Route("")]
        public IHttpActionResult Index()
        {
            return Ok();
        }

        [Route("{random}"), HttpGet]
        public IHttpActionResult Show(string random)
        {
            return Ok(random);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace SFA.DAS.EmployerUsers.Api.Controllers
{

    [RoutePrefix("api/status")]
    public class StatusController : ApiController
    {
        [Route("")]
        public IHttpActionResult Index()
        {
            // Do some Infrastructre work here to smoke out any issues.
            return Ok();
        }

    }
}

Simplify status convention based on conversation with Mr David Goodyear


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Tournament.Screens.TeamWin;

namespace osu.Game.Tournament.Tests.Screens
{
    public class TestSceneTeamWinScreen : TournamentTestScene
    {
        [Test]
        public void TestBasic()
        {
            var match = Ladder.CurrentMatch.Value;

            match.Round.Value = Ladder.Rounds.FirstOrDefault(g => g.Name.Value == "Finals");
            match.Completed.Value = true;

            Add(new TeamWinScreen
            {
                FillMode = FillMode.Fit,
                FillAspectRatio = 16 / 9f
            });
        }
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Tournament.Screens.TeamWin;

namespace osu.Game.Tournament.Tests.Screens
{
    public class TestSceneTeamWinScreen : TournamentTestScene
    {
        [Test]
        public void TestBasic()
        {
            AddStep("set up match", () =>
            {
                var match = Ladder.CurrentMatch.Value;

                match.Round.Value = Ladder.Rounds.FirstOrDefault(g => g.Name.Value == "Finals");
                match.Completed.Value = true;
            });

            AddStep("create screen", () => Add(new TeamWinScreen
            {
                FillMode = FillMode.Fit,
                FillAspectRatio = 16 / 9f
            }));
        }
    }
}

Fix test failing after BDL -> `[Test]` change


using Portal.CMS.Entities.Entities.Settings;
using System.Collections.Generic;
using System.Linq;

namespace Portal.CMS.Entities.Seed
{
    public static class SettingSeed
    {
        public static void Seed(PortalEntityModel context)
        {
            var settingList = context.Settings.ToList();

            var newSettings = new List<Setting>();

            if (!settingList.Any(x => x.SettingName == "Website Name"))
                newSettings.Add(new Setting { SettingName = "Website Name", SettingValue = "Portal CMS" });

            if (!settingList.Any(x => x.SettingName == "Description Meta Tag"))
                newSettings.Add(new Setting { SettingName = "Description Meta Tag", SettingValue = "Portal CMS is a fully featured content management system with a powerful integrated page builder." });

            if (!settingList.Any(x => x.SettingName == "Google Analytics Tracking ID"))
                newSettings.Add(new Setting { SettingName = "Google Analytics Tracking ID", SettingValue = "" });

            if (newSettings.Any())
                context.Settings.AddRange(newSettings);
        }
    }
}

using Portal.CMS.Entities.Entities.Settings;
using System.Collections.Generic;
using System.Linq;

namespace Portal.CMS.Entities.Seed
{
    public static class SettingSeed
    {
        public static void Seed(PortalEntityModel context)
        {
            var settingList = context.Settings.ToList();

            var newSettings = new List<Setting>();

            if (!settingList.Any(x => x.SettingName == "Website Name"))
                newSettings.Add(new Setting { SettingName = "Website Name", SettingValue = "Portal CMS" });

            if (!settingList.Any(x => x.SettingName == "Description Meta Tag"))
                newSettings.Add(new Setting { SettingName = "Description Meta Tag", SettingValue = "Portal CMS is a fully featured content management system with a powerful integrated page builder." });

            if (!settingList.Any(x => x.SettingName == "Google Analytics Tracking ID"))
                newSettings.Add(new Setting { SettingName = "Google Analytics Tracking ID", SettingValue = "" });

            if (!settingList.Any(x => x.SettingName == "Email From Address"))
                newSettings.Add(new Setting { SettingName = "Email From Address", SettingValue = "" });

            if (!settingList.Any(x => x.SettingName == "SendGrid UserName"))
                newSettings.Add(new Setting { SettingName = "SendGrid UserName", SettingValue = "" });

            if (!settingList.Any(x => x.SettingName == "SendGrid Password"))
                newSettings.Add(new Setting { SettingName = "SendGrid Password", SettingValue = "" });

            if (newSettings.Any())
                context.Settings.AddRange(newSettings);
        }
    }
}

Add Email Setting Seed Items

Add Email Setting Seed Items


using WebApiToTypeScript.Enums;
using WebApiToTypeScript.Interfaces;
using WebApiToTypeScript.Types;

namespace WebApiToTypeScript
{
    public abstract class ServiceAware
    {
        protected string IHaveQueryParams = WebApiToTypeScript.IHaveQueryParams;
        protected string IEndpoint = WebApiToTypeScript.IEndpoint;

        protected TypeService TypeService
            => WebApiToTypeScript.TypeService;

        protected EnumsService EnumsService
            => WebApiToTypeScript.EnumsService;

        protected InterfaceService InterfaceService
            => WebApiToTypeScript.InterfaceService;

        public Config.Config Config
            => WebApiToTypeScript.Config;
    }
}

using WebApiToTypeScript.Enums;
using WebApiToTypeScript.Interfaces;
using WebApiToTypeScript.Types;

namespace WebApiToTypeScript
{
    public abstract class ServiceAware
    {
        protected string IHaveQueryParams = WebApiToTypeScript.IHaveQueryParams;
        protected string IEndpoint = WebApiToTypeScript.IEndpoint;

        protected TypeService TypeService
            => WebApiToTypeScript.TypeService;

        protected EnumsService EnumsService
            => WebApiToTypeScript.EnumsService;

        protected InterfaceService InterfaceService
            => WebApiToTypeScript.InterfaceService;

        public Config.Config Config
            => WebApiToTypeScript.Config;

        public void LogMessage(string message)
            => WebApiToTypeScript.LogMessages.Add(message);
    }
}

Add logging capability to serviceaware

Add logging capability to serviceaware


using System.Net;
using System.Threading.Tasks;
using FlatBuffers;
using InWorldz.Arbiter.Serialization;
using InWorldz.Chrysalis.Util;

namespace InWorldz.Chrysalis.Controllers
{
    /// <summary>
    /// Handles incoming requests related to geometry
    /// </summary>
    internal class GeometryController
    {
        public GeometryController(HttpFrontend frontEnd)
        {
            frontEnd.AddHandler("POST", "/geometry/h2b", ConvertHalcyonGeomToBabylon);
        }

        private async Task ConvertHalcyonGeomToBabylon(HttpListenerContext context, HttpListenerRequest request)
        {
            //halcyon gemoetry is coming in as a primitive flatbuffer object
            //as binary in the body. deserialize and convert using the prim exporter
            ByteBuffer body = await StreamUtil.ReadStreamFullyAsync(request.InputStream);
            var prim = HalcyonPrimitive.GetRootAsHalcyonPrimitive(body);

        }
    }
}

using System.Net;
using System.Threading.Tasks;
using FlatBuffers;
using InWorldz.Arbiter.Serialization;
using InWorldz.Chrysalis.Util;

namespace InWorldz.Chrysalis.Controllers
{
    /// <summary>
    /// Handles incoming requests related to geometry
    /// </summary>
    internal class GeometryController
    {
        public GeometryController(HttpFrontend frontEnd)
        {
            frontEnd.AddHandler("POST", "/geometry/hp2b", ConvertHalcyonPrimToBabylon);
            frontEnd.AddHandler("POST", "/geometry/hg2b", ConvertHalcyonGroupToBabylon);
        }

        private async Task ConvertHalcyonPrimToBabylon(HttpListenerContext context, HttpListenerRequest request)
        {
            //halcyon gemoetry is coming in as a primitive flatbuffer object
            //as binary in the body. deserialize and convert using the prim exporter
            ByteBuffer body = await StreamUtil.ReadStreamFullyAsync(request.InputStream);
            var prim = HalcyonPrimitive.GetRootAsHalcyonPrimitive(body);

        }

        private async Task ConvertHalcyonGroupToBabylon(HttpListenerContext context, HttpListenerRequest request)
        {
            //halcyon gemoetry is coming in as a primitive flatbuffer object
            //as binary in the body. deserialize and convert using the prim exporter
            ByteBuffer body = await StreamUtil.ReadStreamFullyAsync(request.InputStream);
            var prim = HalcyonPrimitive.GetRootAsHalcyonPrimitive(body);

        }
    }
}

Add groups to the serialization

Add groups to the serialization


using System;
using ModestTree;

namespace Zenject
{
    [NoReflectionBaking]
    public class InstantiateCallbackConditionCopyNonLazyBinder : ConditionCopyNonLazyBinder
    {
        public InstantiateCallbackConditionCopyNonLazyBinder(BindInfo bindInfo)
            : base(bindInfo)
        {
        }

        public ConditionCopyNonLazyBinder OnInstantiated(
            Action<InjectContext, object> callback)
        {
            BindInfo.InstantiatedCallback = callback;
            return this;
        }

        public ConditionCopyNonLazyBinder OnInstantiated<T>(
            Action<InjectContext, T> callback)
        {
            // Can't do this here because of factory bindings
            //Assert.That(BindInfo.ContractTypes.All(x => x.DerivesFromOrEqual<T>()));

            BindInfo.InstantiatedCallback = (ctx, obj) =>
            {
                Assert.That(obj == null || obj is T,
                    "Invalid generic argument to OnInstantiated! {0} must be type {1}", obj.GetType(), typeof(T));

                callback(ctx, (T)obj);
            };
            return this;
        }
    }
}

using System;
using ModestTree;

namespace Zenject
{
    [NoReflectionBaking]
    public class InstantiateCallbackConditionCopyNonLazyBinder : ConditionCopyNonLazyBinder
    {
        public InstantiateCallbackConditionCopyNonLazyBinder(BindInfo bindInfo)
            : base(bindInfo)
        {
        }

        public ConditionCopyNonLazyBinder OnInstantiated(
            Action<InjectContext, object> callback)
        {
            BindInfo.InstantiatedCallback = callback;
            return this;
        }

        public ConditionCopyNonLazyBinder OnInstantiated<T>(
            Action<InjectContext, T> callback)
        {
            // Can't do this here because of factory bindings
            //Assert.That(BindInfo.ContractTypes.All(x => x.DerivesFromOrEqual<T>()));

            BindInfo.InstantiatedCallback = (ctx, obj) =>
            {
                if (obj is ValidationMarker)
                {
                    Assert.That(ctx.Container.IsValidating);

                    ValidationMarker marker = obj as ValidationMarker;

                    Assert.That(marker.MarkedType.DerivesFromOrEqual<T>(),
                        "Invalid generic argument to OnInstantiated! {0} must be type {1}", marker.MarkedType, typeof(T));
                }
                else
                {
                    Assert.That(obj == null || obj is T,
                        "Invalid generic argument to OnInstantiated! {0} must be type {1}", obj.GetType(), typeof(T));

                    callback(ctx, (T)obj);
                }
            };
            return this;
        }
    }
}

Fix assert hit during OnInstantiated validation


using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;

namespace DotNetKit.Windows.Documents
{
    /// <summary>
    /// Provides functions.
    /// </summary>
    public struct FixedDocumentCreator
    {
        /// <summary>
        /// Converts data contexts to a <see cref="FixedDocument"/>.
        /// </summary>
        public FixedDocument FromDataContexts(IEnumerable contents, Size pageSize)
        {
            var isLandscape = pageSize.Width > pageSize.Height;
            var mediaSize = isLandscape ? new Size(pageSize.Height, pageSize.Width) : pageSize;

            var document = new FixedDocument();

            foreach (var content in contents)
            {
                var presenter =
                    new ContentPresenter()
                    {
                        Content = content,
                        Width = pageSize.Width,
                        Height = pageSize.Height,
                    };

                if (isLandscape)
                {
                    presenter.LayoutTransform = new RotateTransform(90.0);
                }

                var page =
                    new FixedPage()
                    {
                        Width = mediaSize.Width,
                        Height = mediaSize.Height,
                    };
                page.Children.Add(presenter);

                page.Measure(mediaSize);
                page.Arrange(new Rect(new Point(0, 0), mediaSize));
                page.UpdateLayout();

                var pageContent = new PageContent() { Child = page };
                document.Pages.Add(pageContent);
            }

            return document;
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;

namespace DotNetKit.Windows.Documents
{
    /// <summary>
    /// Provides functions.
    /// </summary>
    public struct FixedDocumentCreator
    {
        /// <summary>
        /// Converts data contexts to a <see cref="FixedDocument"/>.
        /// </summary>
        public FixedDocument FromDataContexts(IEnumerable contents, Size pageSize)
        {
            var isLandscape = pageSize.Width > pageSize.Height;
            var mediaSize = isLandscape ? new Size(pageSize.Height, pageSize.Width) : pageSize;

            var document = new FixedDocument();

            foreach (var content in contents)
            {
                var presenter =
                    new ContentPresenter()
                    {
                        Content = content,
                        Width = pageSize.Width,
                        Height = pageSize.Height,
                    };

                if (isLandscape)
                {
                    presenter.LayoutTransform = new RotateTransform(90.0);
                }

                var page =
                    new FixedPage()
                    {
                        Width = mediaSize.Width,
                        Height = mediaSize.Height,
                    };
                page.Children.Add(presenter);

                var pageContent = new PageContent() { Child = page };
                document.Pages.Add(pageContent);
            }

            return document;
        }
    }
}

Remove a redundant UpdateLayout invocation


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Taiko.Mods
{
    public class TaikoModEasy : ModEasy
    {
        public override string Description => @"Beats move slower, less accuracy required!";
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Taiko.Mods
{
    public class TaikoModEasy : ModEasy
    {
        public override string Description => @"Beats move slower, and less accuracy required!";
    }
}

Reword taiko easy mod description to fit others better

Co-authored-by: Joseph Madamba <deb5e3a2371a81eb362def5dfce4787ebd8ff67d@outlook.com>


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace osu.Game.Skinning
{
    public enum GlobalSkinConfiguration
    {
        AnimationFramerate
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace osu.Game.Skinning
{
    public enum GlobalSkinConfiguration
    {
        AnimationFramerate,
        LayeredHitSounds,
    }
}

Add LayeredHitSamples skin config lookup


using GitHub.Api;
using GitHub.Models;
using GitHub.Services;
using Microsoft.TeamFoundation.Controls;
using System.ComponentModel.Composition;

namespace GitHub.VisualStudio.TeamExplorer.Connect
{
    [TeamExplorerSection(GitHubConnectSection1Id, TeamExplorerPageIds.Connect, 11)]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public class GitHubConnectSection1 : GitHubConnectSection
    {
        public const string GitHubConnectSection1Id = "519B47D3-F2A9-4E19-8491-8C9FA25ABE91";

        [ImportingConstructor]
        public GitHubConnectSection1(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder, IConnectionManager manager)
            : base(apiFactory, holder, manager, 1)
        {
        }
    }
}

using GitHub.Api;
using GitHub.Models;
using GitHub.Services;
using Microsoft.TeamFoundation.Controls;
using System.ComponentModel.Composition;

namespace GitHub.VisualStudio.TeamExplorer.Connect
{
    [TeamExplorerSection(GitHubConnectSection1Id, TeamExplorerPageIds.Connect, 10)]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public class GitHubConnectSection1 : GitHubConnectSection
    {
        public const string GitHubConnectSection1Id = "519B47D3-F2A9-4E19-8491-8C9FA25ABE91";

        [ImportingConstructor]
        public GitHubConnectSection1(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder, IConnectionManager manager)
            : base(apiFactory, holder, manager, 1)
        {
        }
    }
}

Fix the order of the connect section

Fix the order of the connect section

Make sure the second connection shows up above the hosted service
providers section.


using System;
using AnlabMvc.Models.Roles;
using AnlabMvc.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace AnlabMvc.Controllers
{
    [Authorize(Roles = RoleCodes.Admin)]
    public class SystemController : ApplicationController
    {
        private readonly IDbInitializationService _dbInitializationService;

        public SystemController(IDbInitializationService dbInitializationService)
        {
            _dbInitializationService = dbInitializationService;
        }

#if DEBUG
        public async Task<IActionResult> ResetDb()
        {
            await _dbInitializationService.RecreateAndInitialize();
            return RedirectToAction("LogoutDirect", "Account");
        }
#else
        public Task<IActionResult> ResetDb()
        {
            throw new NotImplementedException("WHAT!!! Don't reset DB in Release!");
        }
#endif

    }
}

using System;
using AnlabMvc.Models.Roles;
using AnlabMvc.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace AnlabMvc.Controllers
{
    [Authorize(Roles = RoleCodes.Admin)]
    public class SystemController : ApplicationController
    {
        private readonly IDbInitializationService _dbInitializationService;

        public SystemController(IDbInitializationService dbInitializationService)
        {
            _dbInitializationService = dbInitializationService;
        }

#if DEBUG
        public Task<IActionResult> ResetDb()
        {
            throw new NotImplementedException("Only enable this when working against a local database.");
            // await _dbInitializationService.RecreateAndInitialize();
            // return RedirectToAction("LogoutDirect", "Account");
        }
#else
        public Task<IActionResult> ResetDb()
        {
            throw new NotImplementedException("WHAT!!! Don't reset DB in Release!");
        }
#endif

    }
}

Make it harder to accidentally reset prod database


using System.Web.Mvc;

namespace RestfulRouting
{
    public static class HtmlHelperExtensions
    {
        public static MvcHtmlString PutOverrideTag(this HtmlHelper html)
        {
            return MvcHtmlString.Create("<input type=\"hidden\" name=\"_method\" value=\"put\" />");
        }

        public static MvcHtmlString DeleteOverrideTag(this HtmlHelper html)
        {
            return MvcHtmlString.Create("<input type=\"hidden\" name=\"_method\" value=\"delete\" />");
        }
    }
}

using System.Web.Mvc;
using System.Web.Mvc.Html;

namespace RestfulRouting
{
    public static class HtmlHelperExtensions
    {
        public static MvcHtmlString PutOverrideTag(this HtmlHelper html)
        {
            return html.Hidden("_method", "put");
        }

        public static MvcHtmlString DeleteOverrideTag(this HtmlHelper html)
        {
            return html.Hidden("_method", "delete");
        }
    }
}

Use HTML helper extension method for outputting an <input type="hidden"/> element


using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SQL Notebook")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SQL Notebook")]
[assembly: AssemblyCopyright("Copyright © 2016 Brian Luft")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4766090d-0e56-4a24-bde7-3f9fb8d37c80")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]

// this is Application.ProductVersion
[assembly: AssemblyFileVersion("0.7.0")]

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SQL Notebook")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SQL Notebook")]
[assembly: AssemblyCopyright("Copyright © 2016 Brian Luft")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4766090d-0e56-4a24-bde7-3f9fb8d37c80")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]

// this is Application.ProductVersion
[assembly: AssemblyFileVersion("0.6.0")]

Downgrade version to 0.6.0 again -- only update version upon actual release


using UnityEngine;

public class PaddleController : MonoBehaviour {
    [SerializeField]
    private float _speed;

    [SerializeField]
    private Planet _planet;

    [SerializeField]
    private float _orbitAngle;

    [SerializeField]
    private float _orbitDistance;

    public enum MoveDirection {
        Left = -1,
        None = 0,
        Right = 1,
    }

    public float Speed {
        get { return _speed; }
        set { _speed = value; }
    }

    public MoveDirection Direction {
        get; set;
    }

    public Planet Planet {
        get { return _planet; }
        set { _planet = value; }
    }

    public float OrbitAngle {
        get { return _orbitAngle; }
        private set { _orbitAngle = value; }
    }

    public float OrbitDistance {
        get { return _orbitDistance; }
        set { _orbitDistance = value; }
    }

    private void FixedUpdate() {

        int direction = (int) Direction;
        float anglePerSecond = Speed / Planet.Permieter * direction;
        float deltaAngle = Time.fixedDeltaTime * anglePerSecond;

        OrbitAngle += deltaAngle;

        Vector3 targetPosition, targetFacing;
        Planet.SampleOrbit2D( OrbitAngle, OrbitDistance,
                              out targetPosition, out targetFacing );

        transform.forward = targetFacing;
        transform.position = targetPosition;
    }
}

using UnityEngine;

public class PaddleController : MonoBehaviour {
    [SerializeField]
    private float _speed;

    [SerializeField]
    private Planet _planet;

    [SerializeField]
    private float _orbitAngle;

    [SerializeField]
    private float _orbitDistance;

    [SerializeField, Range( -1, 1 )]
    private float _direction = 0;

    public float Speed {
        get { return _speed; }
        set { _speed = value; }
    }

    public float Direction {
        get { return _direction; }
        set { _direction = Mathf.Clamp( value, -1, 1 ) };
    }

    public Planet Planet {
        get { return _planet; }
        set { _planet = value; }
    }

    public float OrbitAngle {
        get { return _orbitAngle; }
        private set { _orbitAngle = value; }
    }

    public float OrbitDistance {
        get { return _orbitDistance; }
        set { _orbitDistance = value; }
    }

    private void FixedUpdate() {

        float anglePerSecond = Speed / Planet.Permieter * Direction;
        float deltaAngle = Time.fixedDeltaTime * anglePerSecond;

        OrbitAngle += deltaAngle;

        Vector3 targetPosition, targetFacing;
        Planet.SampleOrbit2D( OrbitAngle, OrbitDistance,
                              out targetPosition, out targetFacing );

        transform.forward = targetFacing;
        transform.position = targetPosition;
    }
}

Change Paddle direction to a float.

Change Paddle direction to a float.


//    Copyright 2015 SnapMD, Inc.
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//        http://www.apache.org/licenses/LICENSE-2.0
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.

using System.Net;
using SnapMD.ConnectedCare.Sdk.Wrappers;

namespace SnapMD.ConnectedCare.Sdk
{
    public class EncountersApi : ApiCall
    {
        public EncountersApi(string baseUrl, string bearerToken, string developerId, string apiKey)
            : base(baseUrl, new WebClientWrapper(new WebClient()), bearerToken, developerId, apiKey)
        {
        }

        public void UpdateIntakeQuestionnaire(int consultationId, object intakeData)
        {
            var url = string.Format("v2/patients/consultations/{0}/intake", consultationId);
            var result = Put(url, intakeData);
        }
    }
}

//    Copyright 2015 SnapMD, Inc.
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//        http://www.apache.org/licenses/LICENSE-2.0
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.

using System.Net;
using SnapMD.ConnectedCare.ApiModels;
using SnapMD.ConnectedCare.Sdk.Models;
using SnapMD.ConnectedCare.Sdk.Wrappers;

namespace SnapMD.ConnectedCare.Sdk
{
    public class EncountersApi : ApiCall
    {
        public EncountersApi(string baseUrl, string bearerToken, string developerId, string apiKey)
            : base(baseUrl, new WebClientWrapper(new WebClient()), bearerToken, developerId, apiKey)
        {
        }

        public void UpdateIntakeQuestionnaire(int consultationId, object intakeData)
        {
            var url = string.Format("v2/patients/consultations/{0}/intake", consultationId);
            var result = Put(url, intakeData);
        }

        /// <summary>
        /// Gets a list of running consultations for the user whether the user is a clinician or a patient.
        /// There should be 0 or 1 results, but if there are more, this information can be used for
        /// debugging.
        /// </summary>
        /// <returns></returns>
        public ApiResponseV2<PatientConsultationInfo> GetUsersActiveConsultations()
        {
            const string url = "v2/consultations/running";
            var result = MakeCall<ApiResponseV2<PatientConsultationInfo>>(url);
            return result;
        }
    }
}

Add API to get a user's active consultations.


using System.IO;
using OmniSharp.Solution;

namespace OmniSharp.Build
{
    public class BuildCommandBuilder
    {
        private readonly ISolution _solution;

        public BuildCommandBuilder(ISolution solution)
        {
            _solution = solution;
        }

        public string Executable
        {
            get
            {
                return PlatformService.IsUnix
                    ? "xbuild"
                    : Path.Combine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(),
                    "Msbuild.exe");
            }
        }

        public string Arguments
        {
            get { return (PlatformService.IsUnix ? "" : "/m ") + "/nologo /v:q /property:GenerateFullPaths=true \"" + _solution.FileName + "\""; }
        }

        public BuildTargetResponse BuildCommand(BuildTargetRequest req)
        {
            return new BuildTargetResponse { Command = this.Executable.ApplyPathReplacementsForClient() + " " + this.Arguments + " /target:" + req.Type.ToString() };
        }
    }
}

using System.IO;
using OmniSharp.Solution;

namespace OmniSharp.Build
{
    public class BuildCommandBuilder
    {
        private readonly ISolution _solution;
        private readonly OmniSharpConfiguration _config;

        public BuildCommandBuilder(
            ISolution solution,
            OmniSharpConfiguration config)
        {
            _solution = solution;
            _config = config;
        }

        public string Executable
        {
            get
            {
                return PlatformService.IsUnix
                    ? "xbuild"
                    : Path.Combine(
                        _config.MSBuildPath ?? System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(),
                        "Msbuild.exe");
            }
        }

        public string Arguments
        {
            get { return (PlatformService.IsUnix ? "" : "/m ") + "/nologo /v:q /property:GenerateFullPaths=true \"" + _solution.FileName + "\""; }
        }

        public BuildTargetResponse BuildCommand(BuildTargetRequest req)
        {
            return new BuildTargetResponse { Command = this.Executable.ApplyPathReplacementsForClient() + " " + this.Arguments + " /target:" + req.Type.ToString() };
        }
    }
}

Use msbuild path from config.json if present

Otherwise use runtime directory.


using System;
using SQLite;

namespace Toggl.Phoebe.Data.DataObjects
{
    [Table ("Project")]
    public class ProjectData : CommonData
    {
        public ProjectData ()
        {
        }

        public ProjectData (ProjectData other) : base (other)
        {
            Name = other.Name;
            Color = other.Color;
            IsActive = other.IsActive;
            IsBillable = other.IsBillable;
            IsPrivate = other.IsBillable;
            IsTemplate = other.IsTemplate;
            UseTasksEstimate = other.UseTasksEstimate;
            WorkspaceId = other.WorkspaceId;
            ClientId = other.ClientId;
        }

        public string Name { get; set; }

        public int Color { get; set; }

        public bool IsActive { get; set; }

        public bool IsBillable { get; set; }

        public bool IsPrivate { get; set; }

        public bool IsTemplate { get; set; }

        public bool UseTasksEstimate { get; set; }

        [ForeignRelation (typeof(WorkspaceData))]
        public Guid WorkspaceId { get; set; }

        [ForeignRelation (typeof(ClientData))]
        public Guid? ClientId { get; set; }
    }
}

using System;
using SQLite;

namespace Toggl.Phoebe.Data.DataObjects
{
    [Table ("Project")]
    public class ProjectData : CommonData
    {
        public ProjectData ()
        {
        }

        public ProjectData (ProjectData other) : base (other)
        {
            Name = other.Name;
            Color = other.Color;
            IsActive = other.IsActive;
            IsBillable = other.IsBillable;
            IsPrivate = other.IsPrivate;
            IsTemplate = other.IsTemplate;
            UseTasksEstimate = other.UseTasksEstimate;
            WorkspaceId = other.WorkspaceId;
            ClientId = other.ClientId;
        }

        public string Name { get; set; }

        public int Color { get; set; }

        public bool IsActive { get; set; }

        public bool IsBillable { get; set; }

        public bool IsPrivate { get; set; }

        public bool IsTemplate { get; set; }

        public bool UseTasksEstimate { get; set; }

        [ForeignRelation (typeof(WorkspaceData))]
        public Guid WorkspaceId { get; set; }

        [ForeignRelation (typeof(ClientData))]
        public Guid? ClientId { get; set; }
    }
}

Fix typo in data object cloning.

Fix typo in data object cloning.


using RedFolder.Models;
using RedFolder.ViewModels;
using SendGrid;
using SendGrid.Helpers.Mail;
using System.Net;
using System.Threading.Tasks;
using System.Web;

namespace RedFolder.Services
{
    public class SendGridEmail : IEmail
    {
        private const string CONTACT_THANK_YOU_TEMPLATE = "d-b7898a39f2c441d6812a466fe02b9ab4";

        private readonly SendGridConfiguration _configuration;

        public SendGridEmail(SendGridConfiguration configuration)
        {
            _configuration = configuration;
        }

        public async Task<bool> SendContactThankYou(ContactForm contactForm)
        {
            try
            {
                var client = new SendGridClient(_configuration.ApiKey);
                var from = new EmailAddress(contactForm.EmailAddress);
                var to = new EmailAddress(_configuration.From);

                var msg = MailHelper.CreateSingleTemplateEmail(from, to, CONTACT_THANK_YOU_TEMPLATE, new
                {
                    name = HttpUtility.HtmlEncode(contactForm.Name),
                    howcanihelp = HttpUtility.HtmlEncode(contactForm.HowCanIHelp)
                });

                if (!contactForm.EmailAddress.ToLower().Equals(_configuration.From.ToLower()))
                {
                    msg.AddBcc(new EmailAddress(_configuration.From));
                }

                var response = await client.SendEmailAsync(msg);

                return response?.StatusCode == HttpStatusCode.Accepted;
            }
            catch { }

            return false;
        }
    }
}

using RedFolder.Models;
using RedFolder.ViewModels;
using SendGrid;
using SendGrid.Helpers.Mail;
using System.Net;
using System.Threading.Tasks;
using System.Web;

namespace RedFolder.Services
{
    public class SendGridEmail : IEmail
    {
        private const string CONTACT_THANK_YOU_TEMPLATE = "d-b7898a39f2c441d6812a466fe02b9ab4";

        private readonly SendGridConfiguration _configuration;

        public SendGridEmail(SendGridConfiguration configuration)
        {
            _configuration = configuration;
        }

        public async Task<bool> SendContactThankYou(ContactForm contactForm)
        {
            try
            {
                var client = new SendGridClient(_configuration.ApiKey);
                var from = new EmailAddress(_configuration.From);
                var to = new EmailAddress(contactForm.EmailAddress);

                var msg = MailHelper.CreateSingleTemplateEmail(from, to, CONTACT_THANK_YOU_TEMPLATE, new
                {
                    name = HttpUtility.HtmlEncode(contactForm.Name),
                    howcanihelp = HttpUtility.HtmlEncode(contactForm.HowCanIHelp)
                });

                if (!contactForm.EmailAddress.ToLower().Equals(_configuration.From.ToLower()))
                {
                    msg.AddBcc(new EmailAddress(_configuration.From));
                }

                var response = await client.SendEmailAsync(msg);

                return response?.StatusCode == HttpStatusCode.Accepted;
            }
            catch { }

            return false;
        }
    }
}

Fix for getting the email addresses the wrong way round


namespace Acme.Helpers
{
    /// <summary>
    /// Horizontal alignment options.
    /// </summary>
    public enum HorizontalAlignment { Left, Right, }
    public enum PagerVerticalAlignment { Top, Bottom, Both }
}

namespace Acme.Helpers
{
    /// <summary>
    /// Horizontal alignment options.
    /// </summary>
    public enum HorizontalAlignment { Left, Right, }
}

Refactor pagination to a common base class


using System;
using System.Collections.Generic;
using System.Web;
using Nancy;
using Nancy.ErrorHandling;

namespace NancyBenchmark
{
    public class Global : HttpApplication
    {
        protected void Application_Start()
        {

        }
    }
}

using System;
using System.Collections.Generic;
using System.Web;
using Nancy;
using Nancy.ErrorHandling;
using System.Threading;

namespace NancyBenchmark
{
    public class Global : HttpApplication
    {
        protected void Application_Start()
        {
            var threads = 40 * Environment.ProcessorCount;
            ThreadPool.SetMaxThreads(threads, threads);
            ThreadPool.SetMinThreads(threads, threads);
        }
    }
}

Set improved ThreadPool values for nancy


// Copyright (c) 2018 Sarin Na Wangkanai, All Rights Reserved.
// The Apache v2. See License.txt in the project root for license information.

namespace Wangkanai.Detection
{
    public enum DeviceType
    {
        Desktop,
        Tablet,
        Mobile
    }
}

// Copyright (c) 2018 Sarin Na Wangkanai, All Rights Reserved.
// The Apache v2. See License.txt in the project root for license information.

namespace Wangkanai.Detection
{
    public enum DeviceType
    {
        Desktop,
        Tablet,
        Mobile,
        Tv,
        Console,
        Car
    }
}

Add new type of devices

Add new type of devices


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using Android.App;
using osu.Game;
using osu.Game.Updater;

namespace osu.Android
{
    public class OsuGameAndroid : OsuGame
    {
        public override Version AssemblyVersion
        {
            get
            {
                var packageInfo = Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0);

                try
                {
                    string versionName = packageInfo.VersionCode.ToString();
                    // undo play store version garbling
                    return new Version(int.Parse(versionName.Substring(0, 4)), int.Parse(versionName.Substring(4, 4)), int.Parse(versionName.Substring(8, 1)));
                }
                catch
                {
                }

                return new Version(packageInfo.VersionName);
            }
        }

        protected override UpdateManager CreateUpdateManager() => new SimpleUpdateManager();
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using Android.App;
using osu.Game;
using osu.Game.Updater;

namespace osu.Android
{
    public class OsuGameAndroid : OsuGame
    {
        public override Version AssemblyVersion
        {
            get
            {
                var packageInfo = Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0);

                try
                {
                    // todo: needs checking before play store redeploy.
                    string versionName = packageInfo.VersionName;
                    // undo play store version garbling
                    return new Version(int.Parse(versionName.Substring(0, 4)), int.Parse(versionName.Substring(4, 4)), int.Parse(versionName.Substring(8, 1)));
                }
                catch
                {
                }

                return new Version(packageInfo.VersionName);
            }
        }

        protected override UpdateManager CreateUpdateManager() => new SimpleUpdateManager();
    }
}

Fix android usage of obsoleted VersionCode


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace osu.Game.Utils
{
    public static class FormatUtils
    {
        /// <summary>
        /// Turns the provided accuracy into a percentage with 2 decimal places.
        /// Omits all decimal places when <paramref name="accuracy"/> equals 1d.
        /// </summary>
        /// <param name="accuracy">The accuracy to be formatted</param>
        /// <returns>formatted accuracy in percentage</returns>
        public static string FormatAccuracy(this double accuracy) => accuracy == 1 ? "100%" : $"{accuracy:0.00%}";

        /// <summary>
        /// Turns the provided accuracy into a percentage with 2 decimal places.
        /// Omits all decimal places when <paramref name="accuracy"/> equals 100m.
        /// </summary>
        /// <param name="accuracy">The accuracy to be formatted</param>
        /// <returns>formatted accuracy in percentage</returns>
        public static string FormatAccuracy(this decimal accuracy) => accuracy == 100 ? "100%" : $"{accuracy:0.00}%";
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace osu.Game.Utils
{
    public static class FormatUtils
    {
        /// <summary>
        /// Turns the provided accuracy into a percentage with 2 decimal places.
        /// </summary>
        /// <param name="accuracy">The accuracy to be formatted</param>
        /// <returns>formatted accuracy in percentage</returns>
        public static string FormatAccuracy(this double accuracy) => $"{accuracy:0.00%}";

        /// <summary>
        /// Turns the provided accuracy into a percentage with 2 decimal places.
        /// </summary>
        /// <param name="accuracy">The accuracy to be formatted</param>
        /// <returns>formatted accuracy in percentage</returns>
        public static string FormatAccuracy(this decimal accuracy) => $"{accuracy:0.00}%";
    }
}

Make accuracy formatting more consistent