#region -- License Terms --
//
// MessagePack for CLI
//
// Copyright (C) 2010 FUJIWARA, Yusuke
//
//    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.
//
#endregion -- License Terms --

using System;

namespace MsgPack.Serialization
{
	/// <summary>
	///		Define options of <see cref="SerializationMethodGeneratorManager"/>
	/// </summary>
	public enum SerializationMethodGeneratorOption
	{
#if !SILVERLIGHT
		/// <summary>
		///		The generated method IL can be dumped to the current directory.
		/// </summary>
		CanDump,

		/// <summary>
		///		The entire generated method can be collected by GC when it is no longer used.
		/// </summary>
		CanCollect,
#endif

		/// <summary>
		///		Prefer performance. This options is default.
		/// </summary>
		Fast
	}
}

#region -- License Terms --
//
// MessagePack for CLI
//
// Copyright (C) 2010 FUJIWARA, Yusuke
//
//    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.
//
#endregion -- License Terms --

using System;
using System.ComponentModel;

namespace MsgPack.Serialization
{
	/// <summary>
	///		Define options of <see cref="SerializationMethodGeneratorManager"/>
	/// </summary>
	public enum SerializationMethodGeneratorOption
	{
#if !SILVERLIGHT
		/// <summary>
		///		The generated method IL can be dumped to the current directory.
		///		It is intended for the runtime, you cannot use this option.
		/// </summary>
		[EditorBrowsable( EditorBrowsableState.Never )]
		CanDump,

		/// <summary>
		///		The entire generated method can be collected by GC when it is no longer used.
		/// </summary>
		CanCollect,
#endif

		/// <summary>
		///		Prefer performance. This options is default.
		/// </summary>
		Fast
	}
}

Add comments for internal API.

Add comments for internal API.


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

// 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("Eco")]
[assembly: AssemblyDescription("Yet another configuration library for .NET")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Eco")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// SettingsComVisible 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("bfdd8cf1-3e3b-4120-8d3a-68bd506ec4b3")]

// 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.*")]

[assembly:SettingsAssembly("Eco.Elements")]

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

// 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("Eco")]
[assembly: AssemblyDescription("Yet another configuration library for .NET")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Eco")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// SettingsComVisible 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("bfdd8cf1-3e3b-4120-8d3a-68bd506ec4b3")]

// 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.*")]

[assembly:SettingsAssembly("Eco")]

Move all Eco setting types to the Eco namespace


namespace Stripe
{
    using Newtonsoft.Json;
    using Stripe.Infrastructure;

    public class ChargePaymentMethodDetailsCardThreeDSecure : StripeEntity
    {
        [JsonProperty("succeeded")]
        public bool Succeeded { get; set; }

        [JsonProperty("version")]
        public string Version { get; set; }
    }
}

namespace Stripe
{
    using Newtonsoft.Json;
    using Stripe.Infrastructure;

    public class ChargePaymentMethodDetailsCardThreeDSecure : StripeEntity
    {
        /// <summary>
        /// Whether or not authentication was performed. 3D Secure will succeed without
        /// authentication when the card is not enrolled.
        /// </summary>
        [JsonProperty("authenticated")]
        public bool Authenticated { get; set; }

        /// <summary>
        /// Whether or not 3D Secure succeeded.
        /// </summary>
        [JsonProperty("succeeded")]
        public bool Succeeded { get; set; }

        /// <summary>
        /// The version of 3D Secure that was used for this payment.
        /// </summary>
        [JsonProperty("version")]
        public string Version { get; set; }
    }
}

Add support for Authenticated on 3DS Charges


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

[assembly: AssemblyProduct("Hangfire")]
[assembly: AssemblyCopyright("Copyright © 2013-2015 Sergey Odinokov, Adam Barclay")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]

// Don't edit manually! Use `build.bat version` command instead!
[assembly: AssemblyVersion("0.1.0")]

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

[assembly: AssemblyProduct("Hangfire")]
[assembly: AssemblyCopyright("Copyright © 2013-2017 Sergey Odinokov, Adam Barclay")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]

// Don't edit manually! Use `build.bat version` command instead!
[assembly: AssemblyVersion("0.1.0")]

Update assembly copyright notice to 2017


using UnityEngine;
using System.Collections;
using Matcha.Game.Tweens;

public class InteractiveEntity : MonoBehaviour
{
    public enum EntityType { none, prize, weapon };
    public EntityType entityType;

    [HideInInspector]
    public bool alreadyCollided = false;
    public bool disableIfOffScreen = true;
    public int worth;

    void OnBecameInvisible()
    {
        if(disableIfOffScreen)
            gameObject.SetActive(false);
    }

    void OnBecameVisible()
    {
        if(disableIfOffScreen)
            gameObject.SetActive(true);
    }

    public void React()
    {
        alreadyCollided = true;

        switch (entityType)
        {
        case EntityType.none:
            break;

        case EntityType.prize:
                MTween.PickupPrize(gameObject);
            break;

        case EntityType.weapon:
                MTween.PickupWeapon(gameObject);
            break;
        }
    }

    public void SelfDestruct(int inSeconds)
    {
        Destroy(gameObject, inSeconds);
    }
}

using UnityEngine;
using System;
using System.Collections;
using Matcha.Game.Tweens;

public class InteractiveEntity : MonoBehaviour
{
    public enum EntityType { none, prize, weapon };
    public EntityType entityType;

    [HideInInspector]
    public bool alreadyCollided = false;
    public bool disableIfOffScreen = true;
    public int worth;

    void Start()
    {
        switch (entityType)
        {
        case EntityType.none:
            break;

        case EntityType.prize:
                // still buggy
                // needs to be more succint
                transform.position = new Vector3(transform.position.x, (float)(Math.Ceiling(transform.position.y) - .623f), transform.position.z);
            break;

        case EntityType.weapon:

            break;
        }
    }

    void OnBecameInvisible()
    {
        if(disableIfOffScreen)
            gameObject.SetActive(false);
    }

    void OnBecameVisible()
    {
        if(disableIfOffScreen)
            gameObject.SetActive(true);
    }

    public void React()
    {
        alreadyCollided = true;

        switch (entityType)
        {
        case EntityType.none:
            break;

        case EntityType.prize:
                MTween.PickupPrize(gameObject);
            break;

        case EntityType.weapon:
                MTween.PickupWeapon(gameObject);
            break;
        }
    }

    public void SelfDestruct(int inSeconds)
    {
        Destroy(gameObject, inSeconds);
    }
}

Add automatic placement for Prizes.

Add automatic placement for Prizes.


// 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 osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;

namespace osu.Game.Beatmaps
{
    public class BeatmapStatistic
    {
        [Obsolete("Use CreateIcon instead")] // can be removed 20210203
        public IconUsage Icon = FontAwesome.Regular.QuestionCircle;

        /// <summary>
        /// A function to create the icon for display purposes.
        /// </summary>
        public Func<Drawable> CreateIcon;

        public string Content;
        public string Name;

        public BeatmapStatistic()
        {
#pragma warning disable 618
            CreateIcon = () => new SpriteIcon { Icon = Icon };
#pragma warning restore 618
        }
    }
}

// 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 osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osuTK;

namespace osu.Game.Beatmaps
{
    public class BeatmapStatistic
    {
        [Obsolete("Use CreateIcon instead")] // can be removed 20210203
        public IconUsage Icon = FontAwesome.Regular.QuestionCircle;

        /// <summary>
        /// A function to create the icon for display purposes.
        /// </summary>
        public Func<Drawable> CreateIcon;

        public string Content;
        public string Name;

        public BeatmapStatistic()
        {
#pragma warning disable 618
            CreateIcon = () => new SpriteIcon { Icon = Icon, Scale = new Vector2(0.6f) };
#pragma warning restore 618
        }
    }
}

Add scale to allow legacy icons to display correctly sized


using System;
using Client.Common;
using Client.Game;
using UnityEngine;

namespace Client.Controllers
{
    // Create a ball. Once there is a Goal, create a new
    // ball at the given time frame.
    public class BallController : MonoBehaviour
    {
        [SerializeField]
        [Tooltip("The soccer ball prefab")]
        private GameObject prefabBall;

        private GameObject currentBall;

        // --- Messages ---
        private void Start()
        {
            if(prefabBall == null)
            {
                throw new Exception("Prefab should not be null!");
            }

            CreateBall();

            var p1Goal = Goals.FindPlayerOneGoal().GetComponent<TriggerObservable>();
            var p2Goal = Goals.FindPlayerTwoGoal().GetComponent<TriggerObservable>();

            p1Goal.TriggerEnter += OnGoal;
            p2Goal.TriggerEnter += OnGoal;
        }

        // --- Functions ---

        // Create a ball. Removes the old one if there is one.
        private void CreateBall()
        {
            if(currentBall != null)
            {
                Destroy(currentBall);
            }
            currentBall = Instantiate(prefabBall);
            currentBall.name = Ball.Name;
        }

        private void OnGoal(Collider _)
        {
            Invoke("CreateBall", 5);
        }

    }
}

using System;
using Client.Common;
using Client.Game;
using UnityEngine;

namespace Client.Controllers
{
    // Create a ball. Once there is a Goal, create a new
    // ball at the given time frame.
    public class BallController : MonoBehaviour
    {
        [SerializeField]
        [Tooltip("The soccer ball prefab")]
        private GameObject prefabBall;

        private GameObject currentBall;
        // property to ensure we don't try and create a ball while
        // creating a ball
        private bool isGoal;

        // --- Messages ---
        private void Start()
        {
            if(prefabBall == null)
            {
                throw new Exception("Prefab should not be null!");
            }

            isGoal = false;
            var p1Goal = Goals.FindPlayerOneGoal().GetComponent<TriggerObservable>();
            var p2Goal = Goals.FindPlayerTwoGoal().GetComponent<TriggerObservable>();

            p1Goal.TriggerEnter += OnGoal;
            p2Goal.TriggerEnter += OnGoal;

            CreateBall();
        }

        // --- Functions ---

        // Create a ball. Removes the old one if there is one.
        private void OnGoal(Collider _)
        {
            if(!isGoal)
            {
                isGoal = true;
                Invoke("CreateBall", 5);
            }
        }

        private void CreateBall()
        {
            if(currentBall != null)
            {
                Destroy(currentBall);
            }
            currentBall = Instantiate(prefabBall);
            currentBall.name = Ball.Name;
            isGoal = false;
        }
    }
}

Make sure a ball can't happen while a goal has already happened!


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExoMail.Smtp.Extensions
{
    public static class StringExtensions
    {
        public static Stream ToStream(this string str)
        {
            return new MemoryStream(Encoding.ASCII.GetBytes(str));
        }

        public static string WordWrap(this string str, int cols)
        {
            return WordWrap(str, cols, string.Empty);
        }

        public static string WordWrap(this string str, int cols, string indent)
        {
            string[] words = str.Split(' ');
            var sb = new StringBuilder();
            int colIndex = 0;
            string space = string.Empty;

            for (int i = 0; i < words.Count(); i++)
            {
                space = i == words.Count() ? string.Empty : " ";
                colIndex += words[i].Length + space.Length;

                if (colIndex <= cols)
                {
                    sb.Append(string.Format("{0}{1}", words[i], space));
                }
                else
                {
                    colIndex = 0;
                    sb.Append(string.Format("\r\n{0}{1}{2}", indent, words[i], space));
                }
            }
            return sb.ToString();
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExoMail.Smtp.Extensions
{
    public static class StringExtensions
    {
        public static Stream ToStream(this string str)
        {
            return new MemoryStream(Encoding.ASCII.GetBytes(str));
        }

        public static string WordWrap(this string str, int cols)
        {
            return WordWrap(str, cols, string.Empty);
        }

        public static string WordWrap(this string str, int cols, string indent)
        {
            string[] words = str.Split(' ');
            var sb = new StringBuilder();
            int colIndex = 0;
            string space = string.Empty;
            string newLine = "\r\n";

            for (int i = 0; i < words.Count(); i++)
            {
                space = i == (words.Count() - 1) ? newLine : " ";
                colIndex += words[i].Length + space.Length + newLine.Length;

                if (colIndex <= cols)
                {
                    sb.AppendFormat("{0}{1}", words[i], space);
                }
                else
                {
                    colIndex = 0;
                    sb.AppendFormat("\r\n{0}{1}{2}", indent, words[i], space);
                }

                if (words[i].Contains(';'))
                {
                    colIndex = 0;
                    sb.Append(newLine);
                    sb.Append(indent);
                }
            }
            return sb.ToString();
        }
    }
}

Fix issues with wordwrap string extension method


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("Tralus.Shell.WorkflowService")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Tralus.Shell.WorkflowService")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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)]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
[assembly: AssemblyVersion("1.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("Tralus.Shell.WorkflowService")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Tralus.Shell.WorkflowService")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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)]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Set AssemblyVersion and AssemblyFileVersion to 1.0.0.0


using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using TravelAgency.Data;
using TravelAgency.Data.Migrations;
using TravelAgency.MongoDbExtractor;

namespace TravelAgency.Client
{
    public class Startup
    {
        public static void Main()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<TravelAgencyDbContext, Configuration>());

            var travelAgencyDbContext = new TravelAgencyDbContext();
            var mongoExtractor = new MongoDbDataExtractor();
            var dataImporter = new TravelAgenciesDataImporter(travelAgencyDbContext, mongoExtractor);

            dataImporter.ImportData();
            try
            {
                travelAgencyDbContext.SaveChanges();

            }
            catch (System.Data.Entity.Validation.DbEntityValidationException ex)
            {

                throw;
            }

            //// Just for test - to see if something has been written to the Database
            // Console.WriteLine(db.Destinations.Count());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using TravelAgency.Data;
using TravelAgency.Data.Migrations;
using TravelAgency.MongoDbExtractor;

namespace TravelAgency.Client
{
    public class Startup
    {
        public static void Main()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<TravelAgencyDbContext, Configuration>());

            using (var travelAgencyDbContext = new TravelAgencyDbContext())
            {
                var mongoExtractor = new MongoDbDataExtractor();
                var dataImporter = new TravelAgenciesDataImporter(travelAgencyDbContext, mongoExtractor);

                dataImporter.ImportData();
                travelAgencyDbContext.SaveChanges();
            }

            //// Just for test - to see if something has been written to the Database
            // Console.WriteLine(db.Destinations.Count());
        }
    }
}

Add using for db context

Add using for db context


using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using JetBrains.Annotations;

namespace Itg.ZabbixAgent.Core
{
    internal class ZabbixProtocol
    {
        private static readonly byte[] headerBytes = Encoding.ASCII.GetBytes(ZabbixConstants.HeaderString);

        private static readonly byte[] zero = new byte[ 0 ];

        /// <summary>
        /// Write a string to the stream prefixed with it's size and the Zabbix protocol header.
        /// </summary>
        public static void WriteWithHeader([NotNull] Stream stream, [NotNull] string valueString, [CanBeNull] string errorString)
        {
            // ReSharper disable once ConditionIsAlwaysTrueOrFalse
            Debug.Assert(stream != null);
            // ReSharper disable once ConditionIsAlwaysTrueOrFalse
            Debug.Assert(valueString != null);

            // <HEADER>
            stream.Write(headerBytes, 0, headerBytes.Length);

            // <DATALEN>
            var valueStringBytes = Encoding.UTF8.GetBytes(valueString);
            var sizeBytes = BitConverter.GetBytes((long)valueStringBytes.Length);
            stream.Write(sizeBytes, 0, sizeBytes.Length);

            // <DATA>
            stream.Write(valueStringBytes, 0, valueStringBytes.Length);

            if (errorString != null)
            {
                // \0
                stream.Write(zero, 0, 1);

                // <ERROR>
                var errorStringBytes = Encoding.UTF8.GetBytes(errorString);
                stream.Write(errorStringBytes, 0, errorStringBytes.Length);
            }
        }
    }
}

using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using JetBrains.Annotations;

namespace Itg.ZabbixAgent.Core
{
    internal class ZabbixProtocol
    {
        private static readonly byte[] headerBytes = Encoding.ASCII.GetBytes(ZabbixConstants.HeaderString);

        private static readonly byte[] zero = { 0 };

        /// <summary>
        /// Write a string to the stream prefixed with it's size and the Zabbix protocol header.
        /// </summary>
        public static void WriteWithHeader([NotNull] Stream stream, [NotNull] string valueString, [CanBeNull] string errorString)
        {
            // ReSharper disable once ConditionIsAlwaysTrueOrFalse
            Debug.Assert(stream != null);
            // ReSharper disable once ConditionIsAlwaysTrueOrFalse
            Debug.Assert(valueString != null);

            // <HEADER>
            stream.Write(headerBytes, 0, headerBytes.Length);

            // <DATALEN>
            var valueStringBytes = Encoding.UTF8.GetBytes(valueString);
            var sizeBytes = BitConverter.GetBytes((long)valueStringBytes.Length);
            stream.Write(sizeBytes, 0, sizeBytes.Length);

            // <DATA>
            stream.Write(valueStringBytes, 0, valueStringBytes.Length);

            if (errorString != null)
            {
                // \0
                stream.Write(zero, 0, 1);

                // <ERROR>
                var errorStringBytes = Encoding.UTF8.GetBytes(errorString);
                stream.Write(errorStringBytes, 0, errorStringBytes.Length);
            }
        }
    }
}

Fix a bug in zabbix protocol with errors


// 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.Graphics;
using osu.Game.Tournament.Components;

namespace osu.Game.Tournament.Screens.Showcase
{
    public class ShowcaseScreen : BeatmapInfoScreen
    {
        [BackgroundDependencyLoader]
        private void load()
        {
            AddRangeInternal(new Drawable[] {
                new TournamentLogo(),
                new TourneyVideo("showcase")
                {
                    Loop = true,
                    RelativeSizeAxes = Axes.Both,
                }
            });
        }
    }
}

// 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.Graphics;
using osu.Game.Tournament.Components;
using osu.Framework.Graphics.Shapes;
using osuTK.Graphics;

namespace osu.Game.Tournament.Screens.Showcase
{
    public class ShowcaseScreen : BeatmapInfoScreen, IProvideVideo
    {
        private Box chroma;
        [BackgroundDependencyLoader]
        private void load()
        {
            AddRangeInternal(new Drawable[] {
                new TournamentLogo(),
                new TourneyVideo("showcase")
                {
                    Loop = true,
                    RelativeSizeAxes = Axes.Both,
                },
                chroma = new Box
                        {
                            // chroma key area for stable gameplay
                            Name = "chroma",
                            Anchor = Anchor.TopCentre,
                            Origin = Anchor.TopCentre,
                            Height = 695,
                            Width = 1366,
                            Colour = new Color4(0, 255, 0, 255),
                }
            });
        }
    }
}

Add Chroma keying to the background of the showcase video.


// 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.Beatmaps;
using osu.Game.Rulesets;

namespace osu.Game.Scoring.Legacy
{
    /// <summary>
    /// A <see cref="LegacyScoreDecoder"/> which retrieves the applicable <see cref="Beatmap"/> and <see cref="Ruleset"/>
    /// for the score from the database.
    /// </summary>
    public class DatabasedLegacyScoreDecoder : LegacyScoreDecoder
    {
        private readonly RulesetStore rulesets;
        private readonly BeatmapManager beatmaps;

        public DatabasedLegacyScoreDecoder(RulesetStore rulesets, BeatmapManager beatmaps)
        {
            this.rulesets = rulesets;
            this.beatmaps = beatmaps;
        }

        protected override Ruleset GetRuleset(int rulesetId) => rulesets.GetRuleset(rulesetId).CreateInstance();
        protected override WorkingBeatmap GetBeatmap(string md5Hash) => beatmaps.GetWorkingBeatmap(beatmaps.QueryBeatmap(b => !b.BeatmapSet.DeletePending && b.MD5Hash == md5Hash));
    }
}

// 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.Beatmaps;
using osu.Game.Rulesets;

namespace osu.Game.Scoring.Legacy
{
    /// <summary>
    /// A <see cref="LegacyScoreDecoder"/> which retrieves the applicable <see cref="Beatmap"/> and <see cref="Ruleset"/>
    /// for the score from the database.
    /// </summary>
    public class DatabasedLegacyScoreDecoder : LegacyScoreDecoder
    {
        private readonly IRulesetStore rulesets;
        private readonly BeatmapManager beatmaps;

        public DatabasedLegacyScoreDecoder(IRulesetStore rulesets, BeatmapManager beatmaps)
        {
            this.rulesets = rulesets;
            this.beatmaps = beatmaps;
        }

        protected override Ruleset GetRuleset(int rulesetId) => rulesets.GetRuleset(rulesetId).CreateInstance();
        protected override WorkingBeatmap GetBeatmap(string md5Hash) => beatmaps.GetWorkingBeatmap(beatmaps.QueryBeatmap(b => !b.BeatmapSet.DeletePending && b.MD5Hash == md5Hash));
    }
}

Update usages to consume `IRulesetStore`


using System;
using System.Web;

namespace RollbarSharp
{
  public class RollbarHttpModule : IHttpModule
  {
    public void Init(HttpApplication context)
    {
      context.Error += SendError;
    }

    public void Dispose()
    {
    }

    private void SendError(object sender, EventArgs e)
    {
      var application = (HttpApplication)sender;
      new RollbarClient().SendException(application.Server.GetLastError().GetBaseException());
    }

  }
}

using System;
using System.Web;

namespace RollbarSharp
{
    public class RollbarHttpModule : IHttpModule
    {
        public void Init(HttpApplication context)
        {
            context.Error += SendError;
        }

        public void Dispose()
        {
        }

        private static void SendError(object sender, EventArgs e)
        {
            var application = (HttpApplication) sender;
            new RollbarClient().SendException(application.Server.GetLastError().GetBaseException());
        }

    }
}

Update spacing for project consistency

Update spacing for project consistency


namespace ClojSharp.Core.Tests
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using ClojSharp.Core.Forms;
    using ClojSharp.Core.Language;
    using ClojSharp.Core.SpecialForms;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    [DeploymentItem("Src", "Src")]
    public class CoreTests
    {
        private Machine machine;

        [TestInitialize]
        public void Setup()
        {
            this.machine = new Machine();
            this.machine.EvaluateFile("Src\\core.clj");
        }

        [TestMethod]
        public void MachineHasMacros()
        {
            this.IsMacro("defmacro");
            this.IsMacro("defn");
        }

        private void IsMacro(string name)
        {
            var result = this.machine.RootContext.GetValue(name);
            Assert.IsNotNull(result, name);
            Assert.IsInstanceOfType(result, typeof(IForm), name);
            Assert.IsInstanceOfType(result, typeof(Macro), name);
        }
    }
}

namespace ClojSharp.Core.Tests
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using ClojSharp.Core.Compiler;
    using ClojSharp.Core.Forms;
    using ClojSharp.Core.Language;
    using ClojSharp.Core.SpecialForms;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    [DeploymentItem("Src", "Src")]
    public class CoreTests
    {
        private Machine machine;

        [TestInitialize]
        public void Setup()
        {
            this.machine = new Machine();
            this.machine.EvaluateFile("Src\\core.clj");
        }

        [TestMethod]
        public void MachineHasMacros()
        {
            this.IsMacro("defmacro");
            this.IsMacro("defn");
        }

        [TestMethod]
        public void DefineAndEvaluateFunction()
        {
            this.Evaluate("(defn incr [x] (+ x 1))");
            Assert.AreEqual(2, this.Evaluate("(incr 1)"));
        }

        private void IsMacro(string name)
        {
            var result = this.machine.RootContext.GetValue(name);
            Assert.IsNotNull(result, name);
            Assert.IsInstanceOfType(result, typeof(IForm), name);
            Assert.IsInstanceOfType(result, typeof(Macro), name);
        }

        private object Evaluate(string text)
        {
            return this.Evaluate(text, this.machine.RootContext);
        }

        private object Evaluate(string text, IContext context)
        {
            Parser parser = new Parser(text);
            var expr = parser.ParseExpression();
            Assert.IsNull(parser.ParseExpression());
            return Machine.Evaluate(expr, context);
        }
    }
}

Define and evaluate function, using defn defined in core.clj


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Web;
using System.Web.UI;
using System.Web.WebPages;
using DotNetNuke.Web.Client;
using DotNetNuke.Web.Client.ClientResourceManagement;

namespace Satrabel.OpenContent.Components
{
    public abstract class OpenContentWebPage<TModel> : DotNetNuke.Web.Razor.DotNetNukeWebPage<TModel>
    {
        int JSOrder = (int)FileOrder.Js.DefaultPriority;
        int CSSOrder = (int)FileOrder.Css.ModuleCss;

        public void RegisterStyleSheet(string filePath)
        {
            if (!filePath.StartsWith("http") && !filePath.StartsWith("/"))
                filePath = this.VirtualPath + filePath;

            ClientResourceManager.RegisterStyleSheet((Page)HttpContext.Current.CurrentHandler, filePath, CSSOrder);
            CSSOrder++;
        }

        public void RegisterScript(string filePath)
        {
            if (!filePath.StartsWith("http") && !filePath.StartsWith("/"))
                filePath = this.VirtualPath + filePath;

            ClientResourceManager.RegisterScript((Page)HttpContext.Current.CurrentHandler, filePath, JSOrder);
            JSOrder++;
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Web;
using System.Web.UI;
using System.Web.WebPages;
using DotNetNuke.Web.Client;
using DotNetNuke.Web.Client.ClientResourceManagement;

namespace Satrabel.OpenContent.Components
{
    public abstract class OpenContentWebPage<TModel> : DotNetNuke.Web.Razor.DotNetNukeWebPage<TModel>
    {
        int JSOrder = (int)FileOrder.Js.DefaultPriority;
        int CSSOrder = (int)FileOrder.Css.ModuleCss;

        public void RegisterStyleSheet(string filePath)
        {
            if (!filePath.StartsWith("http") && !filePath.Contains("/"))
            {
                filePath = VirtualPath + filePath;
            }
            if (!filePath.StartsWith("http"))
            {
                var file = new FileUri(filePath);
                filePath = file.UrlFilePath;
            }

            ClientResourceManager.RegisterStyleSheet((Page)HttpContext.Current.CurrentHandler, filePath, CSSOrder);
            CSSOrder++;
        }

        public void RegisterScript(string filePath)
        {
            if (!filePath.StartsWith("http") && !filePath.Contains("/"))
            {
                filePath = VirtualPath + filePath;
            }
            if (!filePath.StartsWith("http"))
            {
                var file = new FileUri(filePath);
                filePath = file.UrlFilePath;
            }

            ClientResourceManager.RegisterScript((Page)HttpContext.Current.CurrentHandler, filePath, JSOrder);
            JSOrder++;
        }

    }
}

Fix issue where RegisterScript did not load file in a IIS Virtual App environment


// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Generic;
using Microsoft.AspNet.Http.Authentication;

namespace Microsoft.AspNet.IISPlatformHandler
{
    public class IISPlatformHandlerOptions
    {
        /// <summary>
        /// If true the authentication middleware alter the request user coming in and respond to generic challenges.
        /// If false the authentication middleware will only provide identity and respond to challenges when explicitly indicated
        /// by the AuthenticationScheme.
        /// </summary>
        public bool AutomaticAuthentication { get; set; } = true;

        /// <summary>
        /// If true authentication middleware will try to authenticate using platform handler windows authentication
        /// If false authentication middleware won't be added
        /// </summary>
        public bool FlowWindowsAuthentication { get; set; } = true;

        /// <summary>
        /// Additional information about the authentication type which is made available to the application.
        /// </summary>
        public IList<AuthenticationDescription> AuthenticationDescriptions { get; } = new List<AuthenticationDescription>()
        {
            new AuthenticationDescription()
            {
                AuthenticationScheme = IISPlatformHandlerDefaults.Negotiate,
                DisplayName = IISPlatformHandlerDefaults.Negotiate
            },
            new AuthenticationDescription()
            {
                AuthenticationScheme = IISPlatformHandlerDefaults.Ntlm,
                DisplayName = IISPlatformHandlerDefaults.Ntlm
            }
        };
    }
}

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Generic;
using Microsoft.AspNet.Http.Authentication;

namespace Microsoft.AspNet.IISPlatformHandler
{
    public class IISPlatformHandlerOptions
    {
        /// <summary>
        /// If true the authentication middleware alter the request user coming in and respond to generic challenges.
        /// If false the authentication middleware will only provide identity and respond to challenges when explicitly indicated
        /// by the AuthenticationScheme.
        /// </summary>
        public bool AutomaticAuthentication { get; set; } = true;

        /// <summary>
        /// If true authentication middleware will try to authenticate using platform handler windows authentication
        /// If false authentication middleware won't be added
        /// </summary>
        public bool FlowWindowsAuthentication { get; set; } = true;

        /// <summary>
        /// Additional information about the authentication type which is made available to the application.
        /// </summary>
        public IList<AuthenticationDescription> AuthenticationDescriptions { get; } = new List<AuthenticationDescription>()
        {
            new AuthenticationDescription()
            {
                AuthenticationScheme = IISPlatformHandlerDefaults.Negotiate
            },
            new AuthenticationDescription()
            {
                AuthenticationScheme = IISPlatformHandlerDefaults.Ntlm
            }
        };
    }
}

Remove display name for Negotiate and Ntlm


namespace Curse.NET.Model
{
	public class CreateInviteResponse
	{
		public string InviteCode { get; set; }
		public int CreatorID { get; set; }
		public string CreatorName { get; set; }
		public string GroupID { get; set; }
		public Group Group { get; set; }
		public string ChannelID { get; set; }
		public Channel Channel { get; set; }
		public long DateCreated { get; set; }
		public long DateExpires { get; set; }
		public int MaxUses { get; set; }
		public int TimesUsed { get; set; }
		public bool IsRedeemable { get; set; }
		public string InviteUrl { get; set; }
		public string AdminDescription { get; set; }
	}
}

using System;
using Newtonsoft.Json;

namespace Curse.NET.Model
{
	public class CreateInviteResponse
	{
		public string InviteCode { get; set; }
		public int CreatorID { get; set; }
		public string CreatorName { get; set; }
		public string GroupID { get; set; }
		public Group Group { get; set; }
		public string ChannelID { get; set; }
		public Channel Channel { get; set; }
		[JsonConverter(typeof(MillisecondEpochConverter))]
		public DateTime DateCreated { get; set; }
		[JsonConverter(typeof(MillisecondEpochConverter))]
		public DateTime DateExpires { get; set; }
		public int MaxUses { get; set; }
		public int TimesUsed { get; set; }
		public bool IsRedeemable { get; set; }
		public string InviteUrl { get; set; }
		public string AdminDescription { get; set; }
	}
}

Add JSON Converter to date fields

Add JSON Converter to date fields


using Microsoft.AspNetCore.Mvc;
using Promact.Trappist.DomainModel.Models.Question;
using Promact.Trappist.Repository.Questions;
using System;

namespace Promact.Trappist.Core.Controllers
{
    [Route("api/question")]
    public class QuestionsController : Controller
    {
        private readonly IQuestionRepository _questionsRepository;

        public QuestionsController(IQuestionRepository questionsRepository)
        {
            _questionsRepository = questionsRepository;
        }

        [HttpGet]
        /// <summary>
        /// Gets all questions
        /// </summary>
        /// <returns>Questions list</returns>
        public IActionResult GetQuestions()
        {
            var questions = _questionsRepository.GetAllQuestions();
            return Json(questions);
        }
    }
}

using Microsoft.AspNetCore.Mvc;
using Promact.Trappist.DomainModel.Models.Question;
using Promact.Trappist.Repository.Questions;
using System;

namespace Promact.Trappist.Core.Controllers
{
    [Route("api/question")]
    public class QuestionsController : Controller
    {
        private readonly IQuestionRepository _questionsRepository;
        public QuestionsController(IQuestionRepository questionsRepository)
        {
            _questionsRepository = questionsRepository;
        }

        [HttpGet]
        /// <summary>
        /// Gets all questions
        /// </summary>
        /// <returns>Questions list</returns>
        public IActionResult GetQuestions()
        {
            var questions = _questionsRepository.GetAllQuestions();
            return Json(questions);
        }
        [HttpPost]
        /// <summary>
        ///
        /// </summary>
        /// <param name="singleMultipleAnswerQuestion"></param>
        /// <returns></returns>
        public IActionResult AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion)
        {
            _questionsRepository.AddSingleMultipleAnswerQuestion(singleMultipleAnswerQuestion);
            return Ok();
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="singleMultipleAnswerQuestion"></param>
        /// <returns></returns>
        public IActionResult AddSingleMultipleAnswerQuestionOption(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption)
        {
            _questionsRepository.AddSingleMultipleAnswerQuestionOption(singleMultipleAnswerQuestionOption);
            return Ok();
        }
    }
}

Create server side API for single multiple answer question


namespace StraightSql.Test
{
	using System;
	using System.Threading.Tasks;
	using Xunit;

	public class DatabaseAbstractionTest
	{
		[Fact]
		public async Task DatabaseAbstractionTestAsync()
		{
			var queryDispatcher = new QueryDispatcher(new ConnectionFactory(ConnectionString.Default));
			var database = new Database(queryDispatcher, TestReaderCollection.Default);

			var setupQueries = new String[]
			{
				"DROP TABLE IF EXISTS database_abstraction_test;",
				"CREATE TABLE database_abstraction_test (id INT NOT NULL, value TEXT NOT NULL);",
				"INSERT INTO database_abstraction_test VALUES (1, 'James');",
				"INSERT INTO database_abstraction_test VALUES (2, 'Madison');",
				"INSERT INTO database_abstraction_test VALUES (3, 'University');"
			};

			foreach (var setupQuery in setupQueries)
				await queryDispatcher.ExecuteAsync(new Query(setupQuery));

			var item =
				await database
					.CreateQuery(@"
						SELECT id, value
						FROM contextualized_query_builder_query_test
						WHERE value = :value;")
					.SetParameter("value", "Hopkins")
					.FirstAsync<TestItem>();

			Assert.NotNull(item);
			Assert.Equal(item.Id, 3);
			Assert.Equal(item.Value, "Hopkins");
		}
	}
}

namespace StraightSql.Test
{
	using System;
	using System.Threading.Tasks;
	using Xunit;

	public class DatabaseAbstractionTest
	{
		[Fact]
		public async Task DatabaseAbstractionTestAsync()
		{
			var queryDispatcher = new QueryDispatcher(new ConnectionFactory(ConnectionString.Default));
			var database = new Database(queryDispatcher, TestReaderCollection.Default);

			var setupQueries = new String[]
			{
				"DROP TABLE IF EXISTS database_abstraction_test;",
				"CREATE TABLE database_abstraction_test (id INT NOT NULL, value TEXT NOT NULL);",
				"INSERT INTO database_abstraction_test VALUES (1, 'James');",
				"INSERT INTO database_abstraction_test VALUES (2, 'Madison');",
				"INSERT INTO database_abstraction_test VALUES (3, 'University');"
			};

			foreach (var setupQuery in setupQueries)
				await queryDispatcher.ExecuteAsync(new Query(setupQuery));

			var item =
				await database
					.CreateQuery(@"
						SELECT id, value
						FROM database_abstraction_test
						WHERE id = :id;")
					.SetParameter("id", 1)
					.FirstAsync<TestItem>();

			Assert.NotNull(item);
			Assert.Equal(item.Id, 1);
			Assert.Equal(item.Value, "James");
		}
	}
}

Fix database abstraction test to use correct table name, etc.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;

namespace aspnet_start
{
    public class Startup
    {
        public static IWebHost WebHost = null;

        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime lifetime)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            lifetime.ApplicationStarted.Register(OnAppStarted);

            app.Run(async (context) =>
            {
                await context.Response.WriteAsync("Hello World!");
            });
        }

        private void OnAppStarted()
        {
            Program._startupTimer.Stop();
            Log($"Startup elapsed ms: {Program._startupTimer.ElapsedMilliseconds} ms");
            WebHost.StopAsync(TimeSpan.FromSeconds(1));
        }

        private void Log(string s)
        {
            string time = DateTime.UtcNow.ToString();
            Console.WriteLine($"[{time}] {s}");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;

namespace aspnet_start
{
    public class Startup
    {
        public static IWebHost WebHost = null;

        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime lifetime)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            lifetime.ApplicationStarted.Register(OnAppStarted);

            app.Run(async (context) =>
            {
                await context.Response.WriteAsync("Hello World!");
            });
        }

        private void OnAppStarted()
        {
            Program._startupTimer.Stop();
            Log($"Startup elapsed ms: {Program._startupTimer.Elapsed.TotalMilliseconds} ms");
            WebHost.StopAsync(TimeSpan.FromSeconds(1));
        }

        private void Log(string s)
        {
            string time = DateTime.UtcNow.ToString();
            Console.WriteLine($"[{time}] {s}");
        }
    }
}

Add more precision to aspnet_start reported times.


using System;
using System.Runtime.InteropServices;

namespace TimeToMain
{
    public static class Program
    {
        [DllImport("libnative.so")]
        private static extern void write_marker(string name);

        public static void Main(string[] args)
        {
            write_marker("/function/main");
        }
    }
}

using System;
using System.Runtime.InteropServices;

namespace TimeToMain
{
    public static class Program
    {
        [DllImport("libnative.so")]
        private static extern void write_marker(string name);

        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            write_marker("/function/main");
        }
    }
}

Convert source to Hello World.

Convert source to Hello World.


using System;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;

namespace Our.Umbraco.OpeningHours.Converters
{
    [PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
    public class OpeningHoursValueConverter : PropertyValueConverterBase
    {
        public override bool IsConverter(PublishedPropertyType propertyType)
        {
            return propertyType.PropertyEditorAlias.InvariantEquals("OpeningHours");
        }

        public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
        {
            try
            {
                return Model.OpeningHours.Deserialize(source as string);
            }
            catch (Exception e)
            {
                LogHelper.Error<OpeningHoursValueConverter>("Error converting value", e);
            }

            // Create default model
            return new Model.OpeningHours();
        }
    }
}

using System;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Our.Umbraco.OpeningHours.Model;

namespace Our.Umbraco.OpeningHours.Converters
{
    [PropertyValueType(typeof(OpeningHours))]
    [PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
    public class OpeningHoursValueConverter : PropertyValueConverterBase
    {
        public override bool IsConverter(PublishedPropertyType propertyType)
        {
            return propertyType.PropertyEditorAlias.InvariantEquals("OpeningHours");
        }

        public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
        {
            try
            {
                return Model.OpeningHours.Deserialize(source as string);
            }
            catch (Exception e)
            {
                LogHelper.Error<OpeningHoursValueConverter>("Error converting value", e);
            }

            // Create default model
            return new Model.OpeningHours();
        }
    }
}

Allow Models Builder to have correct type

Without the added attribute the ModelsBuilder just creates a property of type 'object'


using NakedObjects;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace AdventureWorksModel
{
    public partial class PersonPhone {
        #region Injected Services
        public IDomainObjectContainer Container { set; protected get; }
        #endregion

        #region Title

        public override string ToString() {
            var t = Container.NewTitleBuilder();
            t.Append(PhoneNumberType).Append(":", PhoneNumber);
            return t.ToString();
        }

        #endregion
        [NakedObjectsIgnore]
        public virtual int BusinessEntityID { get; set; }
        public virtual string PhoneNumber { get; set; }
        [NakedObjectsIgnore]
        public virtual int PhoneNumberTypeID { get; set; }

        [ConcurrencyCheck]
        public virtual DateTime ModifiedDate { get; set; }

        [NakedObjectsIgnore]
        public virtual Person Person { get; set; }
        public virtual PhoneNumberType PhoneNumberType { get; set; }
    }
}

using NakedObjects;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace AdventureWorksModel
{
    public partial class PersonPhone {
        #region Injected Services
        public IDomainObjectContainer Container { set; protected get; }
        #endregion
        #region Lifecycle methods
        public void Persisting()
        {
            ModifiedDate = DateTime.Now;
        }
        #endregion
        #region Title

        public override string ToString() {
            var t = Container.NewTitleBuilder();
            t.Append(PhoneNumberType).Append(":", PhoneNumber);
            return t.ToString();
        }

        #endregion

        [NakedObjectsIgnore]
        public virtual int BusinessEntityID { get; set; }
        public virtual string PhoneNumber { get; set; }
        [NakedObjectsIgnore]
        public virtual int PhoneNumberTypeID { get; set; }

        [ConcurrencyCheck]
        public virtual DateTime ModifiedDate { get; set; }

        [NakedObjectsIgnore]
        public virtual Person Person { get; set; }
        public virtual PhoneNumberType PhoneNumberType { get; set; }
    }
}

Fix AW error - creating new phone number


// 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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Skinning;
using osuTK;

namespace osu.Game.Rulesets.Catch.UI
{
    public class CatcherSprite : CompositeDrawable
    {
        public CatcherSprite()
        {
            Size = new Vector2(CatcherArea.CATCHER_SIZE);

            // Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
            OriginPosition = new Vector2(-0.02f, 0.06f) * CatcherArea.CATCHER_SIZE;
        }

        [BackgroundDependencyLoader]
        private void load()
        {
            InternalChild = new SkinnableSprite("Gameplay/catch/fruit-catcher-idle")
            {
                RelativeSizeAxes = Axes.Both,
                Anchor = Anchor.TopCentre,
                Origin = Anchor.TopCentre,
            };
        }
    }
}

// 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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Skinning;
using osuTK;

namespace osu.Game.Rulesets.Catch.UI
{
    public class CatcherSprite : CompositeDrawable
    {
        public CatcherSprite()
        {
            Size = new Vector2(CatcherArea.CATCHER_SIZE);

            // Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
            OriginPosition = new Vector2(-0.02f, 0.06f) * CatcherArea.CATCHER_SIZE;
        }

        [BackgroundDependencyLoader]
        private void load()
        {
            InternalChild = new SkinnableSprite("Gameplay/catch/fruit-catcher-idle", confineMode: ConfineMode.ScaleDownToFit)
            {
                RelativeSizeAxes = Axes.Both,
                Anchor = Anchor.TopCentre,
                Origin = Anchor.TopCentre,
            };
        }
    }
}

Fix osu!catch catcher not scaling down correctly


using System;
using System.Collections.Generic;

namespace EasyNetQ.Management.Client.Model
{
    public class ExchangeInfo
    {
        public string Type { get; private set; }
        public bool AutoDelete { get; private set; }
        public bool Durable { get; private set; }
        public bool Internal { get; private set; }
        public Arguments Arguments { get; private set; }

        private readonly string name;

        private readonly ISet<string> exchangeTypes = new HashSet<string>
        {
            "direct", "topic", "fanout", "headers"
        };

        public ExchangeInfo(string name, string type) : this(name, type, false, true, false, new Arguments())
        {
        }

        public ExchangeInfo(string name, string type, bool autoDelete, bool durable, bool @internal, Arguments arguments)
        {
            if(string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }
            if(type == null)
            {
                throw new ArgumentNullException("type");
            }
            if (!exchangeTypes.Contains(type))
            {
                throw new EasyNetQManagementException("Unknown exchange type '{0}', expected one of {1}",
                    type,
                    string.Join(", ", exchangeTypes));
            }

            this.name = name;
            Type = type;
            AutoDelete = autoDelete;
            Durable = durable;
            Internal = @internal;
            Arguments = arguments;
        }

        public string GetName()
        {
            return name;
        }
    }
}

using System;
using System.Collections.Generic;

namespace EasyNetQ.Management.Client.Model
{
    public class ExchangeInfo
    {
        public string Type { get; private set; }
        public bool AutoDelete { get; private set; }
        public bool Durable { get; private set; }
        public bool Internal { get; private set; }
        public Arguments Arguments { get; private set; }

        private readonly string name;

        private readonly ISet<string> exchangeTypes = new HashSet<string>
        {
            "direct", "topic", "fanout", "headers", "x-delayed-message"
        };

        public ExchangeInfo(string name, string type) : this(name, type, false, true, false, new Arguments())
        {
        }

        public ExchangeInfo(string name, string type, bool autoDelete, bool durable, bool @internal, Arguments arguments)
        {
            if(string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }
            if(type == null)
            {
                throw new ArgumentNullException("type");
            }
            if (!exchangeTypes.Contains(type))
            {
                throw new EasyNetQManagementException("Unknown exchange type '{0}', expected one of {1}",
                    type,
                    string.Join(", ", exchangeTypes));
            }

            this.name = name;
            Type = type;
            AutoDelete = autoDelete;
            Durable = durable;
            Internal = @internal;
            Arguments = arguments;
        }

        public string GetName()
        {
            return name;
        }
    }
}

Add "x-delayed-message" as valid exchange type


using UnityEditor;
using UnityEngine;

namespace GitHub.Unity
{
    public class PublishWindow : EditorWindow
    {
        private const string PublishTitle = "Publish this repository to GitHub";
        private string repoName = "";
        private string repoDescription = "";
        private int selectedOrg = 0;
        private bool togglePrivate = false;

        private string[] orgs = { "donokuda", "github", "donokudallc", "another-org" };

        static void Init()
        {
            PublishWindow window = (PublishWindow)EditorWindow.GetWindow(typeof(PublishWindow));
            window.Show();
        }

        void OnGUI()
        {
            GUILayout.Label(PublishTitle, EditorStyles.boldLabel);

            GUILayout.Space(5);

            repoName = EditorGUILayout.TextField("Name", repoName);
            repoDescription = EditorGUILayout.TextField("Description", repoDescription);

            GUILayout.BeginHorizontal();
            {
                GUILayout.FlexibleSpace();
                togglePrivate = GUILayout.Toggle(togglePrivate, "Keep my code private");
            }
            GUILayout.EndHorizontal();
            selectedOrg = EditorGUILayout.Popup("Organization", 0, orgs);

            GUILayout.Space(5);

            GUILayout.BeginHorizontal();
            {
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Create"))
                {
                    Debug.Log("CREATING A REPO HAPPENS HERE!");
                    this.Close();
                }
            }
            GUILayout.EndHorizontal();
        }
    }
}

using UnityEditor;
using UnityEngine;

namespace GitHub.Unity
{
    public class PublishWindow : EditorWindow
    {
        private const string PublishTitle = "Publish this repository to GitHub";
        private string repoName = "";
        private string repoDescription = "";
        private int selectedOrg = 0;
        private bool togglePrivate = false;

        // TODO: Replace me since this is just to test rendering errors
        private bool error = true;

        private string[] orgs = { "donokuda", "github", "donokudallc", "another-org" };

        static void Init()
        {
            PublishWindow window = (PublishWindow)EditorWindow.GetWindow(typeof(PublishWindow));
            window.Show();
        }

        void OnGUI()
        {
            GUILayout.Label(PublishTitle, EditorStyles.boldLabel);

            GUILayout.Space(5);

            repoName = EditorGUILayout.TextField("Name", repoName);
            repoDescription = EditorGUILayout.TextField("Description", repoDescription);

            GUILayout.BeginHorizontal();
            {
                GUILayout.FlexibleSpace();
                togglePrivate = GUILayout.Toggle(togglePrivate, "Keep my code private");
            }
            GUILayout.EndHorizontal();
            selectedOrg = EditorGUILayout.Popup("Organization", 0, orgs);

            GUILayout.Space(5);

            if (error)
                GUILayout.Label("There was an error", Styles.ErrorLabel);

            GUILayout.BeginHorizontal();
            {
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Create"))
                {
                    Debug.Log("CREATING A REPO HAPPENS HERE!");
                    this.Close();
                }
            }
            GUILayout.EndHorizontal();
        }
    }
}

Add an area for errors

Add an area for errors


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Microsoft Azure Consumption Management Library")]
[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Consumption.")]

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Azure .NET SDK")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Microsoft Azure Consumption Management Library")]
[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Consumption.")]

[assembly: AssemblyVersion("3.0.1.0")]
[assembly: AssemblyFileVersion("3.0.1.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Azure .NET SDK")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]

Bump up new version for assemblyinfor file


#region

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

#endregion

namespace DesktopWidgets.Classes
{
    internal static class AssemblyInfo
    {
        public static Version Version { get; } = Assembly.GetExecutingAssembly().GetName().Version;
        public static string Copyright { get; } = GetAssemblyAttribute<AssemblyCopyrightAttribute>(a => a.Copyright);
        public static string Title { get; } = GetAssemblyAttribute<AssemblyTitleAttribute>(a => a.Title);

        public static string Description { get; } =
            GetAssemblyAttribute<AssemblyDescriptionAttribute>(a => a.Description);

        public static string Guid { get; } = GetAssemblyAttribute<GuidAttribute>(a => a.Value);

        private static string GetAssemblyAttribute<T>(Func<T, string> value)
            where T : Attribute
        {
            var attribute = (T) Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof (T));
            return value.Invoke(attribute);
        }
    }
}

#region

using System;
using System.Deployment.Application;
using System.Reflection;
using System.Runtime.InteropServices;

#endregion

namespace DesktopWidgets.Classes
{
    internal static class AssemblyInfo
    {
        public static Version Version { get; } = (ApplicationDeployment.IsNetworkDeployed
            ? ApplicationDeployment.CurrentDeployment.CurrentVersion
            : Assembly.GetExecutingAssembly().GetName().Version);

        public static string Copyright { get; } = GetAssemblyAttribute<AssemblyCopyrightAttribute>(a => a.Copyright);
        public static string Title { get; } = GetAssemblyAttribute<AssemblyTitleAttribute>(a => a.Title);

        public static string Description { get; } =
            GetAssemblyAttribute<AssemblyDescriptionAttribute>(a => a.Description);

        public static string Guid { get; } = GetAssemblyAttribute<GuidAttribute>(a => a.Value);

        private static string GetAssemblyAttribute<T>(Func<T, string> value)
            where T : Attribute
        {
            var attribute = (T) Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof (T));
            return value.Invoke(attribute);
        }
    }
}

Fix incorrect version number displayed when deployed


using System.Collections.Generic;
using Promact.Trappist.DomainModel.Models.Question;
using System.Linq;
using Promact.Trappist.DomainModel.DbContext;

namespace Promact.Trappist.Repository.Questions
{
    public class QuestionRepository : IQuestionRespository
    {
        private readonly TrappistDbContext _dbContext;
        public QuestionRepository(TrappistDbContext dbContext)
        {
            _dbContext = dbContext;
        }

        /// <summary>
        /// Get all questions
        /// </summary>
        /// <returns>Question list</returns>
        public List<SingleMultipleAnswerQuestion> GetAllQuestions()
        {
            var question = _dbContext.SingleMultipleAnswerQuestion.ToList();
            return question;
        }
        /// <summary>
        /// Add single multiple answer question into model
        /// </summary>
        /// <param name="singleMultipleAnswerQuestion"></param>
        /// <param name="singleMultipleAnswerQuestionOption"></param>
        public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption[] singleMultipleAnswerQuestionOption)
        {
            _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion);
            foreach(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOptionElement in singleMultipleAnswerQuestionOption)
            {
                singleMultipleAnswerQuestionOptionElement.SingleMultipleAnswerQuestionID = singleMultipleAnswerQuestion.Id;
                _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOptionElement);
            }
            _dbContext.SaveChanges();
        }

    }
}

Update server side API for single multiple answer question


// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

namespace Microsoft.CodeAnalysis.Editor
{
    internal struct CodeDefinitionWindowLocation
        {
            public string DisplayName { get; }
            public string FilePath { get; }
            public int Line { get; }
            public int Character { get; }

            public CodeDefinitionWindowLocation(string displayName, string filePath, int line, int character)
            {
                DisplayName = displayName;
                FilePath = filePath;
                Line = line;
                Character = character;
            }
        }
}

// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.Editor
{
    internal struct CodeDefinitionWindowLocation
    {
        public string DisplayName { get; }
        public string FilePath { get; }
        public int Line { get; }
        public int Character { get; }

        public CodeDefinitionWindowLocation(string displayName, string filePath, int line, int character)
        {
            DisplayName = displayName;
            FilePath = filePath;
            Line = line;
            Character = character;
        }

        public CodeDefinitionWindowLocation(string displayName, string filePath, LinePositionSpan position)
            : this (displayName, filePath, position.Start.Line, position.Start.Character)
        {
        }

        public CodeDefinitionWindowLocation(string displayName, FileLinePositionSpan position)
            : this (displayName, position.Path, position.Span)
        {
        }
    }
}

Fix formatting and add some constructor overloads


using Newtonsoft.Json;

namespace Tweetinvi.Models.V2
{
    public class UrlV2
    {
        /// <summary>
        /// The URL as displayed in the Twitter client.
        /// </summary>
        [JsonProperty("display_url")] public string DisplayUrl { get; set; }

        /// <summary>
        /// The end position (zero-based) of the recognized URL within the Tweet.
        /// </summary>
        [JsonProperty("end")] public int End { get; set; }

        /// <summary>
        /// The fully resolved URL.
        /// </summary>
        [JsonProperty("expanded_url")] public string ExpandedUrl { get; set; }

        /// <summary>
        /// The start position (zero-based) of the recognized URL within the Tweet.
        /// </summary>
        [JsonProperty("start")] public int Start { get; set; }

        /// <summary>
        /// The URL in the format tweeted by the user.
        /// </summary>
        [JsonProperty("url")] public string Url { get; set; }

        /// <summary>
        /// The full destination URL.
        /// </summary>
        [JsonProperty("unwound_url")] public string UnwoundUrl { get; set; }
    }

    public class UrlsV2
    {
        /// <summary>
        /// Contains details about text recognized as a URL.
        /// </summary>
        [JsonProperty("urls")] public UrlV2[] Urls { get; set; }
    }
}

using Newtonsoft.Json;

namespace Tweetinvi.Models.V2
{
    public class UrlV2
    {
        /// <summary>
        /// The URL as displayed in the Twitter client.
        /// </summary>
        [JsonProperty("display_url")] public string DisplayUrl { get; set; }

        /// <summary>
        /// The end position (zero-based) of the recognized URL within the Tweet.
        /// </summary>
        [JsonProperty("end")] public int End { get; set; }

        /// <summary>
        /// The fully resolved URL.
        /// </summary>
        [JsonProperty("expanded_url")] public string ExpandedUrl { get; set; }

        /// <summary>
        /// The start position (zero-based) of the recognized URL within the Tweet.
        /// </summary>
        [JsonProperty("start")] public int Start { get; set; }

        /// <summary>
        /// The URL in the format tweeted by the user.
        /// </summary>
        [JsonProperty("url")] public string Url { get; set; }

        /// <summary>
        /// The full destination URL.
        /// </summary>
        [JsonProperty("unwound_url")] public string UnwoundUrl { get; set; }

        /// <summary>
        /// Title of the URL
        /// </summary>
        [JsonProperty("title")] public string Title { get; set; }

        /// <summary>
        /// Description of the URL
        /// </summary>
        [JsonProperty("description")] public string Description { get; set; }

    }

    public class UrlsV2
    {
        /// <summary>
        /// Contains details about text recognized as a URL.
        /// </summary>
        [JsonProperty("urls")] public UrlV2[] Urls { get; set; }
    }
}

Add more properties found in Twitter V2 Url

Title + Description


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodePlayground
{
    class Program
    {
        static void Main(string[] args)
        {
            // This doesn't change (yet):
            foreach (var item in GeneratedStrings())
                Console.WriteLine(item);
        }

        // Core syntax for an enumerable:
        private static IEnumerable<string> GeneratedStrings()
        {
            yield return "one";
            yield return "two";
            yield return "three";
        }
    }

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodePlayground
{
    class Program
    {
        static void Main(string[] args)
        {
            // This doesn't change (yet):
            foreach (var item in GeneratedStrings())
                Console.WriteLine(item);
        }

        // Core syntax for an enumerable:
        private static IEnumerable<string> GeneratedStrings()
        {
            var i = 0;
            while (i++ < 100)
                yield return i.ToString();
        }
    }

}

Use my enumerable in a loop

Use my enumerable in a loop


//------------------------------------------------------------------------------
// Revenge Of The Cats: Ethernet
// Copyright (C) 2008, mEthLab Interactive
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// Revenge Of The Cats - shell.cs
// Code for Revenge Of The Cats' Shell
//------------------------------------------------------------------------------

if(isObject(DefaultCursor))
{
    DefaultCursor.delete();

    new GuiCursor(DefaultCursor)
    {
	   hotSpot = "1 1";
	   bitmapName = "./pixmaps/mg_arrow2";
    };
}

function addWindow(%control)
{
	if(Canvas.getContent() == Shell.getId())
		Shell.add(%control);
	else
		ShellDlg.add(%control);

	%control.onAddedAsWindow();
	Canvas.repaint();
}

function removeWindow(%control)
{
	%control.getParent().remove(%control);
	%control.onRemovedAsWindow();
	Canvas.repaint();
}

function ShellRoot::onMouseDown(%this,%modifier,%coord,%clickCount)
{
	//
	// display the root menu...
	//

	if( Shell.isMember(RootMenu) )
		removeWindow(RootMenu);
	else
	{
		RootMenu.position = %coord;
		//addWindow(RootMenu);
		//Canvas.repaint();
	}
}

function ShellRoot::onMouseEnter(%this,%modifier,%coord,%clickCount)
{
 //
}

//------------------------------------------------------------------------------
// Revenge Of The Cats: Ethernet
// Copyright (C) 2008, mEthLab Interactive
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// Revenge Of The Cats - shell.cs
// Code for Revenge Of The Cats' Shell
//------------------------------------------------------------------------------

if(isObject(DefaultCursor))
{
    DefaultCursor.delete();

    new GuiCursor(DefaultCursor)
    {
	   hotSpot = "1 1";
	   bitmapName = "./pixmaps/mg_arrow2";
    };
}

function addWindow(%control)
{
	%parent = Shell;
	if(Canvas.getContent() != Shell.getId())
		%parent = ShellDlg;

	%parent.add(%control);
	%parent.pushToBack(%control);
	%control.onAddedAsWindow();
	Canvas.repaint();
}

function removeWindow(%control)
{
	%control.getParent().remove(%control);
	%control.onRemovedAsWindow();
	Canvas.repaint();
}

function ShellRoot::onMouseDown(%this,%modifier,%coord,%clickCount)
{
	//
	// display the root menu...
	//

	if( Shell.isMember(RootMenu) )
		removeWindow(RootMenu);
	else
	{
		RootMenu.position = %coord;
		//addWindow(RootMenu);
		//Canvas.repaint();
	}
}

function ShellRoot::onMouseEnter(%this,%modifier,%coord,%clickCount)
{
 //
}

Make sure window is visible.

addWindow(): Make sure window is visible.


using FireworksNet.Algorithm;
using FireworksNet.Algorithm.Implementation;
using FireworksNet.Problems;
using FireworksNet.StopConditions;
using System;
using Xunit;
namespace FireworksNet.Tests.Algorithm
{
    public class ParallelFireworkAlgorithmTests : AlgorithmTestDataSource
    {

    }
}

using FireworksNet.Algorithm;
using FireworksNet.Algorithm.Implementation;
using FireworksNet.Problems;
using FireworksNet.StopConditions;
using System;
using Xunit;
namespace FireworksNet.Tests.Algorithm
{
    public class ParallelFireworkAlgorithmTests : AlgorithmTestDataSource
    {
        [Theory]
        [MemberData("DataForTestingCreationOfParallelFireworkAlgorithm")]
        public void CreationParallelFireworkAlgorithm_PassEachParameterAsNullAndOtherIsCorrect_ArgumentNullExceptionThrown(
            Problem problem, IStopCondition stopCondition, ParallelFireworksAlgorithmSettings settings, string expectedParamName)
        {
            ArgumentException exception = Assert.Throws<ArgumentNullException>(() => new ParallelFireworksAlgorithm(problem, stopCondition, settings));

            Assert.Equal(expectedParamName, exception.ParamName);
        }

    }
}

Add basic test for ParallelFireworkAlgorithm.


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

using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Osu.Judgements;
using osu.Game.Modes.Osu.Objects;
using osu.Game.Modes.Scoring;
using osu.Game.Modes.UI;

namespace osu.Game.Modes.Osu.Scoring
{
    internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject, OsuJudgement>
    {
        public OsuScoreProcessor()
        {
        }

        public OsuScoreProcessor(HitRenderer<OsuHitObject, OsuJudgement> hitRenderer)
            : base(hitRenderer)
        {
        }

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

            Health.Value = 1;
            Accuracy.Value = 1;
        }

        protected override void OnNewJudgement(OsuJudgement judgement)
        {
            int score = 0;
            int maxScore = 0;

            foreach (var j in Judgements)
            {
                score += j.ScoreValue;
                maxScore += j.MaxScoreValue;
            }

            TotalScore.Value = score;
            Accuracy.Value = (double)score / maxScore;
        }
    }
}

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

using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Osu.Judgements;
using osu.Game.Modes.Osu.Objects;
using osu.Game.Modes.Scoring;
using osu.Game.Modes.UI;

namespace osu.Game.Modes.Osu.Scoring
{
    internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject, OsuJudgement>
    {
        public OsuScoreProcessor()
        {
        }

        public OsuScoreProcessor(HitRenderer<OsuHitObject, OsuJudgement> hitRenderer)
            : base(hitRenderer)
        {
        }

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

            Health.Value = 1;
            Accuracy.Value = 1;
        }

        protected override void OnNewJudgement(OsuJudgement judgement)
        {
            if (judgement != null)
            {
                switch (judgement.Result)
                {
                    case HitResult.Hit:
                        Health.Value += 0.1f;
                        break;
                    case HitResult.Miss:
                        Health.Value -= 0.2f;
                        break;
                }
            }

            int score = 0;
            int maxScore = 0;

            foreach (var j in Judgements)
            {
                score += j.ScoreValue;
                maxScore += j.MaxScoreValue;
            }

            TotalScore.Value = score;
            Accuracy.Value = (double)score / maxScore;
        }
    }
}

Fix health not being calculated in osu! mode (regression).


namespace Gigobyte.Daterpillar.Management
{
    public interface ISchemaComparer : System.IDisposable
    {
        SchemaDiscrepancy Compare(ISchemaAggregator source, ISchemaAggregator target);
    }
}

using Gigobyte.Daterpillar.Transformation;

namespace Gigobyte.Daterpillar.Management
{
    public interface ISchemaComparer : System.IDisposable
    {
        SchemaDiscrepancy Compare(Schema source, Schema target);

        SchemaDiscrepancy Compare(ISchemaAggregator source, ISchemaAggregator target);
    }
}

Add new overload to Compare method

Add new overload to Compare method


namespace Gu.Analyzers.Test.GU0006UseNameofTests
{
    using System.Threading.Tasks;
    using NUnit.Framework;

    internal class HappyPath : HappyPathVerifier<GU0006UseNameof>
    {
        [Test]
        public async Task WhenThrowingArgumentException()
        {
            var testCode = @"
    using System;

    public class Foo
    {
        public void Meh(object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }
        }
    }";
            await this.VerifyHappyPathAsync(testCode)
                      .ConfigureAwait(false);
        }

        [Test]
        public async Task ArgumentOutOfRangeException()
        {
            var testCode = @"
    using System;

    public class Foo
    {
        public void Meh(StringComparison value)
        {
            switch (value)
            {
                default:
                    throw new ArgumentOutOfRangeException(nameof(value), value, null);
            }
        }
    }";
            await this.VerifyHappyPathAsync(testCode)
                      .ConfigureAwait(false);
        }
    }
}

namespace Gu.Analyzers.Test.GU0006UseNameofTests
{
    using System.Threading.Tasks;
    using NUnit.Framework;

    internal class HappyPath : HappyPathVerifier<GU0006UseNameof>
    {
        [Test]
        public async Task WhenThrowingArgumentException()
        {
            var testCode = @"
    using System;

    public class Foo
    {
        public void Meh(object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }
        }
    }";
            await this.VerifyHappyPathAsync(testCode)
                      .ConfigureAwait(false);
        }

        [Test]
        public async Task ArgumentOutOfRangeException()
        {
            var testCode = @"
    using System;

    public class Foo
    {
        public void Meh(StringComparison value)
        {
            switch (value)
            {
                default:
                    throw new ArgumentOutOfRangeException(nameof(value), value, null);
            }
        }
    }";
            await this.VerifyHappyPathAsync(testCode)
                      .ConfigureAwait(false);
        }

        [Test]
        public async Task IgnoresDebuggerDisplay()
        {
            var testCode = @"
    [System.Diagnostics.DebuggerDisplay(""{Name}"")]
    public class Foo
    {
        public string Name { get; }
    }";
            await this.VerifyHappyPathAsync(testCode)
                      .ConfigureAwait(false);
        }
    }
}

Test that nameof nag is ignored in

Test that nameof nag is ignored in [DebuggerDisplay]


using System;

namespace BenchmarkDotNet.Diagnostics
{
    [Obsolete("The \"GCDiagnoser\" has been renamed, please use the \"MemoryDiagnoser\" instead (it has the same functionality)", true)]
    public class GCDiagnoser
    {
    }
}

using System;
using System.Collections.Generic;
using System.Diagnostics;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Loggers;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;

namespace BenchmarkDotNet.Diagnostics.Windows
{
    [Obsolete(message)]
    public class GCDiagnoser : IDiagnoser, IColumnProvider
    {
        const string message = "The \"GCDiagnoser\" has been renamed, please us the \"MemoryDiagnoser\" instead (it has the same functionality)";

        public IEnumerable<IColumn> GetColumns
        {
            get { throw new InvalidOperationException(message); }
        }

        public void AfterBenchmarkHasRun(Benchmark benchmark, Process process)
        {
            throw new InvalidOperationException(message);
        }

        public void DisplayResults(ILogger logger)
        {
            throw new InvalidOperationException(message);
        }

        public void ProcessStarted(Process process)
        {
            throw new InvalidOperationException(message);
        }

        public void ProcessStopped(Process process)
        {
            throw new InvalidOperationException(message);
        }

        public void Start(Benchmark benchmark)
        {
            throw new InvalidOperationException(message);
        }

        public void Stop(Benchmark benchmark, BenchmarkReport report)
        {
            throw new InvalidOperationException(message);
        }
    }
}

Revert "give compilation error instead of warning or exception at runtime"

This reverts commit 4e96e65cc3405f0f9cae2c649f9ef14472c3b557.


using System.ComponentModel.Composition.Hosting;
using Raven.Client;
using Raven.Client.Indexes;

namespace Snittlistan.Infrastructure.Indexes
{
	public static class IndexCreator
	{
		public static void CreateIndexes(IDocumentStore store)
		{
			var typeCatalog = new TypeCatalog(typeof(Matches_PlayerStats), typeof(Match_ByDate));
			IndexCreation.CreateIndexes(new CompositionContainer(typeCatalog), store);
		}
	}
}

using System.ComponentModel.Composition.Hosting;
using System.Linq;
using System.Reflection;
using Raven.Client;
using Raven.Client.Indexes;

namespace Snittlistan.Infrastructure.Indexes
{
	public static class IndexCreator
	{
		public static void CreateIndexes(IDocumentStore store)
		{
			var indexes = from type in Assembly.GetExecutingAssembly().GetTypes()
						  where
							  type.IsSubclassOf(typeof(AbstractIndexCreationTask))
						  select type;

			var typeCatalog = new TypeCatalog(indexes.ToArray());
			IndexCreation.CreateIndexes(new CompositionContainer(typeCatalog), store);
		}
	}
}

Install all indexes by scanning assembly


namespace PersonPrisoner
{
    class Program
    {
        static void Main(string[] args)
        {
            Person person = new Prisoner();
            person.WalkEast(5);
        }
    }
}

namespace PersonPrisoner
{
    class Program
    {
        static void Main(string[] args)
        {
            Person person = new Prisoner();
            person.WalkEast(5);
        }
    }

    #region Explanation
// At a first glance, it would be pretty obvious to make the prisoner derive from person class.
// Just as obviously, this leads us into trouble, since a prisoner is not free to move an arbitrary distance
// in any direction, yet the contract of the Person class states that a Person can.

//So, in fact, the class Person could better be named FreePerson. If that were the case, then the idea that
//class Prisoner extends FreePerson is clearly wrong.

//By analogy, then, a Square is not an Rectangle, because it lacks the same degrees of freedom as an Rectangle.
//This strongly suggests that inheritance should never be used when the sub-class restricts the freedom
//implicit in the base class. It should only be used when the sub-class adds extra detail to the concept
//represented by the base class, for example, 'Monkey' is-an 'Animal'.
    #endregion
}

Add explanatory text comment for person-prisoner example


using Tgstation.Server.Api.Models;

namespace Tgstation.Server.Host.Models
{
	/// <inheritdoc />
	public sealed class ChatChannel : Api.Models.ChatChannel
	{
		/// <summary>
		/// The row Id
		/// </summary>
		public long Id { get; set; }

		/// <summary>
		/// The <see cref="Api.Models.Internal.ChatBot.Id"/>
		/// </summary>
		public long ChatSettingsId { get; set; }

		/// <summary>
		/// The <see cref="Models.ChatBot"/>
		/// </summary>
		public ChatBot ChatSettings { get; set; }

		/// <summary>
		/// Convert the <see cref="ChatChannel"/> to it's API form
		/// </summary>
		/// <returns>A new <see cref="Api.Models.ChatChannel"/></returns>
		public Api.Models.ChatChannel ToApi() => new Api.Models.ChatChannel
		{
			DiscordChannelId = DiscordChannelId,
			IsAdminChannel = IsAdminChannel,
			IsWatchdogChannel = IsWatchdogChannel,
			IrcChannel = IrcChannel
		};
	}
}

using Tgstation.Server.Api.Models;

namespace Tgstation.Server.Host.Models
{
	/// <inheritdoc />
	public sealed class ChatChannel : Api.Models.ChatChannel
	{
		/// <summary>
		/// The row Id
		/// </summary>
		public long Id { get; set; }

		/// <summary>
		/// The <see cref="Api.Models.Internal.ChatBot.Id"/>
		/// </summary>
		public long ChatSettingsId { get; set; }

		/// <summary>
		/// The <see cref="Models.ChatBot"/>
		/// </summary>
		public ChatBot ChatSettings { get; set; }

		/// <summary>
		/// Convert the <see cref="ChatChannel"/> to it's API form
		/// </summary>
		/// <returns>A new <see cref="Api.Models.ChatChannel"/></returns>
		public Api.Models.ChatChannel ToApi() => new Api.Models.ChatChannel
		{
			DiscordChannelId = DiscordChannelId,
			IsAdminChannel = IsAdminChannel,
			IsWatchdogChannel = IsWatchdogChannel,
			IsUpdatesChannel = IsUpdatesChannel,
			IrcChannel = IrcChannel
		};
	}
}

Fix IsUpdatesChannel missing from ToApi()


using System;
using Castle.DynamicProxy;
using Dargon.Services.PortableObjects;
using Dargon.Services.Utilities;

namespace Dargon.Services.Client {
   public class ServiceInvocationInterceptor : IInterceptor {
      private readonly IServiceContext serviceContext;

      public ServiceInvocationInterceptor(IServiceContext serviceContext) {
         this.serviceContext = serviceContext;
      }

      public void Intercept(IInvocation invocation) {
         var methodName = invocation.Method.Name;
         var methodArguments = invocation.Arguments;
         invocation.ReturnValue = serviceContext.Invoke(methodName, methodArguments);
      }
   }
}

using System;
using Castle.DynamicProxy;
using Dargon.Services.PortableObjects;
using Dargon.Services.Utilities;

namespace Dargon.Services.Client {
   public class ServiceInvocationInterceptor : IInterceptor {
      private readonly IServiceContext serviceContext;

      public ServiceInvocationInterceptor(IServiceContext serviceContext) {
         this.serviceContext = serviceContext;
      }

      public void Intercept(IInvocation invocation) {
         var methodName = invocation.Method.Name;
         var methodArguments = invocation.Arguments;
         var result = serviceContext.Invoke(methodName, methodArguments);
         var exception = result as Exception;
         if (exception != null) {
            throw exception;
         } else {
            invocation.ReturnValue = result;;
         }
      }
   }
}

Client: Throw exceptions returned by service context.


using System;

namespace AppHarbor.Commands
{
	public class CreateCommand : ICommand
	{
		private readonly AppHarborApi _appHarborApi;

		public CreateCommand(AppHarborApi appHarborApi)
		{
			_appHarborApi = appHarborApi;
		}

		public void Execute(string[] arguments)
		{
			throw new NotImplementedException();
		}
	}
}

using System;

namespace AppHarbor.Commands
{
	public class CreateCommand : ICommand
	{
		private readonly AppHarborApi _appHarborApi;

		public CreateCommand(AppHarborApi appHarborApi)
		{
			_appHarborApi = appHarborApi;
		}

		public void Execute(string[] arguments)
		{
			var result = _appHarborApi.CreateApplication(arguments[0], arguments[1]);
			throw new NotImplementedException();
		}
	}
}

Create application when executing create command


namespace Vlc.DotNet.Core
{
    public interface IAudioManagement
    {
        IAudioOutputsManagement Outputs { get; }
    }
}

namespace Vlc.DotNet.Core
{
    public interface IAudioManagement
    {
        IAudioOutputsManagement Outputs { get; }

        bool IsMute { get; set; }

        void ToggleMute();

        int Volume { get; set; }

        ITracksManagement Tracks { get; }

        int Channel { get; set; }

        long Delay { get; set; }
    }
}

Add Audio properties to IAudiomanagement


using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using JetBrains.Annotations;
using JetBrains.Metadata.Utils;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.Psi.Impl.Reflection2.ExternalAnnotations;
using JetBrains.Util;

namespace AgentHeisenbug.Annotations {
#if DEBUG
    [PsiComponent]
    public class HeisenbugDebugExternalAnnotationFileProvider : IExternalAnnotationsFileProvider {
        [NotNull] private readonly FileSystemPath _path;

        public HeisenbugDebugExternalAnnotationFileProvider() {
            _path = FileSystemPath.Parse(Assembly.GetExecutingAssembly().Location)
                                  .Combine("../../../#annotations");
        }

        public IEnumerable<FileSystemPath> GetAnnotationsFiles(AssemblyNameInfo assemblyName = null, FileSystemPath assemblyLocation = null) {
            if (assemblyName == null)
                return Enumerable.Empty<FileSystemPath>();

            var directoryForAssembly = _path.Combine(assemblyName.Name);
            if (!directoryForAssembly.ExistsDirectory)
                return Enumerable.Empty<FileSystemPath>();

            return directoryForAssembly.GetDirectoryEntries("*.xml", true);
        }
    }
#endif
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using JetBrains.Annotations;
using JetBrains.Metadata.Utils;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.Psi.Impl.Reflection2.ExternalAnnotations;
using JetBrains.Util;

namespace AgentHeisenbug.Annotations {
#if DEBUG
    [PsiComponent]
    public class HeisenbugDebugExternalAnnotationFileProvider : IExternalAnnotationsFileProvider {
        [NotNull] private readonly FileSystemPath _path;

        public HeisenbugDebugExternalAnnotationFileProvider() {
            _path = FileSystemPath.Parse(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).NotNull())
                                  .Combine("../../../#annotations");
        }

        public IEnumerable<FileSystemPath> GetAnnotationsFiles(AssemblyNameInfo assemblyName = null, FileSystemPath assemblyLocation = null) {
            if (assemblyName == null)
                return Enumerable.Empty<FileSystemPath>();

            var directoryForAssembly = _path.Combine(assemblyName.Name);
            if (!directoryForAssembly.ExistsDirectory)
                return Enumerable.Empty<FileSystemPath>();

            return directoryForAssembly.GetDirectoryEntries("*.xml", true);
        }
    }
#endif
}

Fix to the last commit.

Fix to the last commit.