using System;
using System.Collections.Generic;
using Magecrawl.Utilities;

namespace Magecrawl.GameEngine.Actors
{
    internal class SprinterMonster : Monster
    {
        public SprinterMonster(string name, Point p, int maxHP, int vision, DiceRoll damage, double defense, double evade, double ctIncreaseModifer, double ctMoveCost, double ctActCost, double ctAttackCost)
            : base(name, p, maxHP, vision, damage, defense, evade, ctIncreaseModifer, ctMoveCost, ctActCost, ctAttackCost)
        {
        }

        public override void Action(CoreGameEngine engine)
        {
            if (IsPlayerVisible(engine) && GetPathToPlayer(engine).Count == 2)
            {
                UpdateKnownPlayerLocation(engine);
                if (engine.UseSkill(this, SkillType.Rush, engine.Player.Position))
                    return;
            }

            DefaultAction(engine);
        }
    }
}

using System;
using System.Collections.Generic;
using Magecrawl.Utilities;

namespace Magecrawl.GameEngine.Actors
{
    internal class SprinterMonster : Monster
    {
        public SprinterMonster(string name, Point p, int maxHP, int vision, DiceRoll damage, double defense, double evade, double ctIncreaseModifer, double ctMoveCost, double ctActCost, double ctAttackCost)
            : base(name, p, maxHP, vision, damage, defense, evade, ctIncreaseModifer, ctMoveCost, ctActCost, ctAttackCost)
        {
        }

        public override void Action(CoreGameEngine engine)
        {
            if (IsPlayerVisible(engine))
            {
                UpdateKnownPlayerLocation(engine);
                List<Point> pathToPlayer = GetPathToPlayer(engine);
                if (pathToPlayer != null && pathToPlayer.Count == 2)
                {
                    if (engine.UseSkill(this, SkillType.Rush, engine.Player.Position))
                        return;
                }
            }

            DefaultAction(engine);
        }
    }
}

Fix similar "can see but can't path" crash on sprinters.


using System;
using Hellang.Authentication.JwtBearer.Google;
using Microsoft.AspNetCore.Authentication.JwtBearer;

// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection
{
    public static class JwtBearerOptionsExtensions
    {
        public static JwtBearerOptions UseGoogle(this JwtBearerOptions options, string clientId)
        {
            return options.UseGoogle(clientId, null);
        }

        public static JwtBearerOptions UseGoogle(this JwtBearerOptions options, string clientId, string hostedDomain)
        {
            if (clientId == null)
            {
                throw new ArgumentNullException(nameof(clientId));
            }

            if (clientId.Length == 0)
            {
                throw new ArgumentException("ClientId cannot be empty.", nameof(clientId));
            }

            options.Audience = clientId;
            options.Authority = "https://accounts.google.com";
            options.SecurityTokenValidators.Clear();
            options.SecurityTokenValidators.Add(new GoogleJwtSecurityTokenHandler());
            options.TokenValidationParameters = new GoogleTokenValidationParameters
            {
                ValidateIssuer = true,
                ValidateAudience = true,
                ValidateLifetime = true,
                ValidateIssuerSigningKey = true,

                NameClaimType = GoogleClaimTypes.Name,
                AuthenticationType = JwtBearerDefaults.AuthenticationScheme,

                HostedDomain = hostedDomain,
                ValidIssuers = new[] { options.Authority, "accounts.google.com" },
            };

            return options;
        }
    }
}

using System;
using Hellang.Authentication.JwtBearer.Google;
using Microsoft.AspNetCore.Authentication.JwtBearer;

// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection
{
    public static class JwtBearerOptionsExtensions
    {
        public static JwtBearerOptions UseGoogle(this JwtBearerOptions options, string clientId)
        {
            return options.UseGoogle(clientId, null);
        }

        public static JwtBearerOptions UseGoogle(this JwtBearerOptions options, string clientId, string hostedDomain)
        {
            if (clientId == null)
            {
                throw new ArgumentNullException(nameof(clientId));
            }

            if (clientId.Length == 0)
            {
                throw new ArgumentException("ClientId cannot be empty.", nameof(clientId));
            }

            options.Audience = clientId;
            options.Authority = "https://accounts.google.com";

            options.SecurityTokenValidators.Clear();
            options.SecurityTokenValidators.Add(new GoogleJwtSecurityTokenHandler());

            options.TokenValidationParameters = new GoogleTokenValidationParameters
            {
                ValidateIssuer = true,
                ValidateAudience = true,
                ValidateLifetime = true,
                ValidateIssuerSigningKey = true,

                NameClaimType = GoogleClaimTypes.Name,
                AuthenticationType = "Google." + JwtBearerDefaults.AuthenticationScheme,

                HostedDomain = hostedDomain,
                ValidIssuers = new[] { options.Authority, "accounts.google.com" },
            };

            return options;
        }
    }
}

Use a different authentication type

Use a different authentication type


using System.Collections.Generic;

namespace CertiPay.Payroll.Common
{
    /// <summary>
    /// Identifies the method to calculate the result
    /// </summary>
    public enum CalculationType
    {
        /// <summary>
        /// Deduction is taken as a percentage of the gross pay
        /// </summary>
        PercentOfGrossPay = 1,

        /// <summary>
        /// Deduction is taken as a percentage of the net pay
        /// </summary>
        PercentOfNetPay = 2,

        /// <summary>
        /// Deduction is taken as a flat, fixed amount
        /// </summary>
        FixedAmount = 3,

        /// <summary>
        /// Deduction is taken as a fixed amount per hour of work
        /// </summary>
        FixedHourlyAmount = 4
    }

    public static class CalculationTypes
    {
        public static IEnumerable<CalculationType> Values()
        {
            yield return CalculationType.PercentOfGrossPay;
            yield return CalculationType.PercentOfNetPay;
            yield return CalculationType.FixedAmount;
            yield return CalculationType.FixedHourlyAmount;
        }
    }
}

using System.Collections.Generic;

namespace CertiPay.Payroll.Common
{
    /// <summary>
    /// Identifies the method to calculate the result
    /// </summary>
    public enum CalculationType
    {
        // TODO: We might implement some other calculation methods as needed?
        // Percent of Special Earnings: Select to calculate the deduction as a percent of a special accumulator, such as 401(k).

        /// <summary>
        /// Deduction is taken as a percentage of the gross pay
        /// </summary>
        PercentOfGrossPay = 1,

        /// <summary>
        /// Deduction is taken as a percentage of the net pay
        /// </summary>
        PercentOfNetPay = 2,

        /// <summary>
        /// Deduction is taken as a flat, fixed amount
        /// </summary>
        FixedAmount = 3,

        /// <summary>
        /// Deduction is taken as a fixed amount per hour of work
        /// </summary>
        FixedHourlyAmount = 4
    }

    public static class CalculationTypes
    {
        public static IEnumerable<CalculationType> Values()
        {
            yield return CalculationType.PercentOfGrossPay;
            yield return CalculationType.PercentOfNetPay;
            yield return CalculationType.FixedAmount;
            yield return CalculationType.FixedHourlyAmount;
        }
    }
}

Add comment about other calculation methods


using System;
using AlgorithmsAndDataStructures.LinkedList;

namespace AlgorithmsAndDataStructures
{
    class Program
    {
        static void Main(string[] args)
        {
            // AT FIRST USE THE .NET FRAMEWORK LINKEDLIST CLASS
            System.Collections.Generic.LinkedList<int> list = new System.Collections.Generic.LinkedList<int>();
            list.AddLast(3);
            list.AddLast(5);
            list.AddLast(7);

            foreach (var value in list)
            {
                Console.WriteLine(value);
            }

            // +-----+------+
            // |  3  | null +
            // +-----+------+
            Node first = new Node {Value = 3};

            // +-----+------+
            // |  5  | null +
            // +-----+------+
            Node middle = new Node() {Value = 5};

            // +-----+------+    +-----+------+
            // |  3  |  *---+--->|  5  | null +
            // +-----+------+    +-----+------+
            first.Next = middle;

            // +-----+------+    +-----+------+   +-----+------+
            // |  3  |  *---+--->|  5  | null +   |  7  | null +
            // +-----+------+    +-----+------+   +-----+------+
            Node last = new Node{Value = 7};

            // +-----+------+    +-----+------+   +-----+------+
            // |  3  |  *---+--->|  5  |  *---+-->|  7  | null +
            // +-----+------+    +-----+------+   +-----+------+
             middle.Next = last;
            PrintList(first);
        }

        private static void PrintList(Node firstNode)
        {
            while (firstNode != null)
            {
                Console.WriteLine(firstNode.Value);
                firstNode = firstNode.Next;
            }
        }
    }
}

Add the usage of the .net linked list as an example for comparison in the outcomes


@model IEnumerable<ABCP>

ABCP @Html.ActionLink("Add New", "New", "ABCP", null, new { @class = "btn btn-default" })

        @foreach (var model in Model)
        {

                @Html.DisplayFor(_ => model.Soldier)
                @Html.DisplayFor(_ => model.Date)

                    @if (model.IsPassing)
                    {
                        Failure
                    }

                @Html.ActionLink("Details", "Details", new { model.Id })

        }

@model IEnumerable<ABCP>

ABCP @Html.ActionLink("Add New", "New", "ABCP", null, new { @class = "btn btn-default" })

        @foreach (var model in Model)
        {

                @Html.DisplayFor(_ => model.Soldier)
                @Html.DisplayFor(_ => model.Date)

                    @if (model.IsPassing)
                    {
                        Failure
                    }

                    @if (model.RequiresTape && !model.Measurements.Any())
                    {

                            Requires Measurement

                    }

                @Html.ActionLink("Details", "Details", new { model.Id })

        }

Add icon for needs measure

Add icon for needs measure


using Newtonsoft.Json;
using ReactiveUI;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using WalletWasabi.Gui.ViewModels.Validation;
using WalletWasabi.Models;

namespace WalletWasabi.Gui.ViewModels
{
	public class ViewModelBase : ReactiveObject, INotifyDataErrorInfo
	{
		private List<(string propertyName, MethodInfo mInfo)> ValidationMethodCache;
		public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;

		public ViewModelBase()
		{
			var vmc = Validator.PropertiesWithValidation(this).ToList();

			if (vmc.Count == 0) return;

			ValidationMethodCache = vmc;
		}

		public bool HasErrors => Validator.ValidateAllProperties(this, ValidationMethodCache).HasErrors;

		public IEnumerable GetErrors(string propertyName)
		{
			var error = Validator.ValidateProperty(this, propertyName, ValidationMethodCache);

			if (!error.HasErrors) return null;

			// HACK: Need to serialize this in order to pass through IndeiValidationPlugin on Avalonia 0.8.2.
			//		 Should be removed when Avalonia has the hotfix update.
			return new List<string>() { JsonConvert.SerializeObject(error) };
		}

		protected void NotifyErrorsChanged(string propertyName)
		{
			ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
		}
	}
}

using Newtonsoft.Json;
using ReactiveUI;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using WalletWasabi.Gui.ViewModels.Validation;
using WalletWasabi.Models;

namespace WalletWasabi.Gui.ViewModels
{
	public class ViewModelBase : ReactiveObject, INotifyDataErrorInfo
	{
		private List<(string propertyName, MethodInfo mInfo)> ValidationMethodCache;
		public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;

		public ViewModelBase()
		{
			var vmc = Validator.PropertiesWithValidation(this).ToList();

			if (vmc.Count == 0) return;

			ValidationMethodCache = vmc;
		}

		public bool HasErrors => Validator.ValidateAllProperties(this, ValidationMethodCache).HasErrors;

		public IEnumerable GetErrors(string propertyName)
		{
			var error = Validator.ValidateProperty(this, propertyName, ValidationMethodCache);

			// HACK: Need to serialize this in order to pass through IndeiValidationPlugin on Avalonia 0.8.2.
			//		 Should be removed when Avalonia has the hotfix update.
			if (error.HasErrors)
				yield return JsonConvert.SerializeObject(error);
		}

		protected void NotifyErrorsChanged(string propertyName)
		{
			ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
		}
	}
}

Use yield return instead of allocating new list.


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using osu_StreamCompanion.Code.Core;
using osu_StreamCompanion.Code.Misc;

namespace osu_StreamCompanion.Code.Modules.MapDataGetters.TcpSocket
{
    public partial class TcpSocketSettings : UserControl
    {
        private readonly Settings _settings;
        private readonly SettingNames _names = SettingNames.Instance;

        public TcpSocketSettings(Settings settings)
        {
            _settings = settings;
            InitializeComponent();
            checkBox_EnableTcpOutput.Checked = _settings.Get<bool>(_names.tcpSocketEnabled);

            checkBox_EnableTcpOutput.CheckedChanged += checkBox_EnableTcpOutput_CheckedChanged;

        }

        private void checkBox_EnableTcpOutput_CheckedChanged(object sender, EventArgs e)
        {
            _settings.Add(_names.tcpSocketEnabled.Name, checkBox_EnableTcpOutput.Checked);
        }
    }
}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using osu_StreamCompanion.Code.Core;
using osu_StreamCompanion.Code.Misc;

namespace osu_StreamCompanion.Code.Modules.MapDataGetters.TcpSocket
{
    public partial class TcpSocketSettings : UserControl
    {
        private readonly Settings _settings;
        private readonly SettingNames _names = SettingNames.Instance;

        public TcpSocketSettings(Settings settings)
        {
            _settings = settings;
            InitializeComponent();
            checkBox_EnableTcpOutput.Checked = _settings.Get<bool>(_names.tcpSocketEnabled);

            checkBox_EnableTcpOutput.CheckedChanged += checkBox_EnableTcpOutput_CheckedChanged;

        }

        private void checkBox_EnableTcpOutput_CheckedChanged(object sender, EventArgs e)
        {
            _settings.Add(_names.tcpSocketEnabled.Name, checkBox_EnableTcpOutput.Checked, true);
        }
    }
}

Fix checkbox change not raising settings update


using System.Reflection;

using Oxide.Core;
using Oxide.Core.Plugins;
using Oxide.Game.HideHoldOut.Libraries;

namespace Oxide.Plugins
{
    public abstract class HideHoldOutPlugin : CSharpPlugin
    {
        protected Command cmd;
        protected HideHoldOut h2o;

        public override void SetPluginInfo(string name, string path)
        {
            base.SetPluginInfo(name, path);

            cmd = Interface.Oxide.GetLibrary<Command>();
            h2o = Interface.Oxide.GetLibrary<HideHoldOut>("H2o");
        }

        public override void HandleAddedToManager(PluginManager manager)
        {
            foreach (var method in GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance))
            {
                var attributes = method.GetCustomAttributes(typeof(ConsoleCommandAttribute), true);
                if (attributes.Length > 0)
                {
                    var attribute = attributes[0] as ConsoleCommandAttribute;
                    cmd.AddConsoleCommand(attribute?.Command, this, method.Name);
                    continue;
                }

                attributes = method.GetCustomAttributes(typeof(ChatCommandAttribute), true);
                if (attributes.Length > 0)
                {
                    var attribute = attributes[0] as ChatCommandAttribute;
                    cmd.AddChatCommand(attribute?.Command, this, method.Name);
                }
            }
            base.HandleAddedToManager(manager);
        }
    }
}

Fix not compiling, missing import

[HideHoldOut] Fix not compiling, missing import


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

namespace Tailor
{
    public class Options
    {
        [Option('a', "appDir", DefaultValue = "app", HelpText = "Directory app is placed in")]
        public string AppDir { get; set; }

        [Option('d', "outputDroplet", DefaultValue = "app", HelpText = "the output droplet")]
        public string OutputDroplet { get; set; }

        [Option('m', "outputMetadata", DefaultValue = "app", HelpText = "Directory to the output metadata json file")]
        public string OutputMetadata { get; set; }

        [HelpOption]
        public string GetUsage()
        {
            return HelpText.AutoBuild(this,
              (HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
        }
    }
}

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

namespace Tailor
{
    public class Options
    {
        [Option('a', "appDir", Required = true, HelpText = "Directory app is placed in")]
        public string AppDir { get; set; }

        [Option('d', "outputDroplet", Required = true, HelpText = "the output droplet")]
        public string OutputDroplet { get; set; }

        [Option('m', "outputMetadata", Required = true, HelpText = "Directory to the output metadata json file")]
        public string OutputMetadata { get; set; }

        [HelpOption]
        public string GetUsage()
        {
            return HelpText.AutoBuild(this,
              (HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
        }
    }
}

Make Params required (not default)

Make Params required (not default)


namespace TraktApiSharp.Objects.Get.Users
{
    using Newtonsoft.Json;
    using System;

    public class TraktUser
    {
        [JsonProperty(PropertyName = "username")]
        public string Username { get; set; }

        [JsonProperty(PropertyName = "private")]
        public bool? Private { get; set; }

        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        [JsonProperty(PropertyName = "vip")]
        public bool? VIP { get; set; }

        [JsonProperty(PropertyName = "vip_ep")]
        public bool? VIP_EP { get; set; }

        [JsonProperty(PropertyName = "joined_at")]
        public DateTime? JoinedAt { get; set; }

        [JsonProperty(PropertyName = "location")]
        public string Location { get; set; }

        [JsonProperty(PropertyName = "about")]
        public string About { get; set; }

        [JsonProperty(PropertyName = "gender")]
        public string Gender { get; set; }

        [JsonProperty(PropertyName = "age")]
        public int? Age { get; set; }

        [JsonProperty(PropertyName = "images")]
        public TraktUserImages Images { get; set; }
    }
}

namespace TraktApiSharp.Objects.Get.Users
{
    using Newtonsoft.Json;
    using System;

    /// A Trakt user.
    public class TraktUser
    {
        /// Gets or sets the user's username.
        [JsonProperty(PropertyName = "username")]
        public string Username { get; set; }

        /// Gets or sets the user's privacy status.
        [JsonProperty(PropertyName = "private")]
        public bool? Private { get; set; }

        /// Gets or sets the user's name.
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        /// Gets or sets the user's VIP status.
        [JsonProperty(PropertyName = "vip")]
        public bool? VIP { get; set; }

        /// Gets or sets the user's VIP EP status.
        [JsonProperty(PropertyName = "vip_ep")]
        public bool? VIP_EP { get; set; }

        /// Gets or sets the UTC datetime when the user joined Trakt.
        [JsonProperty(PropertyName = "joined_at")]
        public DateTime? JoinedAt { get; set; }

        /// Gets or sets the user's location.
        [JsonProperty(PropertyName = "location")]
        public string Location { get; set; }

        /// Gets or sets the user's about information.
        [JsonProperty(PropertyName = "about")]
        public string About { get; set; }

        /// Gets or sets the user's gender.
        [JsonProperty(PropertyName = "gender")]
        public string Gender { get; set; }

        /// Gets or sets the user's age.
        [JsonProperty(PropertyName = "age")]
        public int? Age { get; set; }

        /// Gets or sets the collection of images for the user.
        [JsonProperty(PropertyName = "images")]
        public TraktUserImages Images { get; set; }
    }
}

Add get best id method for user.

Add get best id method for user.


using System;
using System.Collections.Generic;
using System.Linq;

namespace Ocelog
{
    public enum LogLevel
    {
        Info,
        Warn,
        Error
    }

    public class LogEvent
    {
        private List<string> _tags = new List<string>();
        private List<object> _fields= new List<object>();
        private object _content;

        public object Content
        {
            get { return _content; }
            set
            {
                EnsureValidType(value, nameof(value));
                _content = value;
            }
        }

        public LogLevel Level { get; set; }
        public CallerInfo CallerInfo { get; set; }
        public DateTime Timestamp { get; set; }
        public IEnumerable<string> Tags { get { return _tags; } }
        public IEnumerable<object> AdditionalFields { get { return _fields; } }

        public void AddTag(string tag)
        {
            _tags.Add(tag);
        }

        public void AddField(object additionalFields)
        {
            EnsureValidType(additionalFields, nameof(additionalFields));

            _fields.Add(additionalFields);
        }

        private void EnsureValidType(object value, string nameof)
        {
            if (value.GetType().IsPrimitive)
                throw new InvalidLogMessageTypeException(nameof, $"{nameof} cannot be a primitive type.");
            if (value is string)
                throw new InvalidLogMessageTypeException(nameof, $"{nameof} cannot be a string.");
        }
    }
}

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;

namespace Ocelog
{
    public enum LogLevel
    {
        Info,
        Warn,
        Error
    }

    public class LogEvent
    {
        private ConcurrentQueue<string> _tags = new ConcurrentQueue<string>();
        private ConcurrentQueue<object> _fields= new ConcurrentQueue<object>();
        private object _content;

        public object Content
        {
            get { return _content; }
            set
            {
                EnsureValidType(value, nameof(value));
                _content = value;
            }
        }

        public LogLevel Level { get; set; }
        public CallerInfo CallerInfo { get; set; }
        public DateTime Timestamp { get; set; }
        public IEnumerable<string> Tags { get { return _tags; } }
        public IEnumerable<object> AdditionalFields { get { return _fields; } }

        public void AddTag(string tag)
        {
            _tags.Enqueue(tag);
        }

        public void AddField(object additionalFields)
        {
            EnsureValidType(additionalFields, nameof(additionalFields));

            _fields.Enqueue(additionalFields);
        }

        private void EnsureValidType(object value, string nameof)
        {
            if (value.GetType().IsPrimitive)
                throw new InvalidLogMessageTypeException(nameof, $"{nameof} cannot be a primitive type.");
            if (value is string)
                throw new InvalidLogMessageTypeException(nameof, $"{nameof} cannot be a string.");
        }
    }
}

Make tags and fields more thread safe.

Make tags and fields more thread safe.


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

namespace osu.Game.Screens.Edit.Setup
{
    public abstract class RulesetSetupSection : SetupSection
    {
        public sealed override LocalisableString Title => $"{rulesetInfo.Name}-specific";

        private readonly RulesetInfo rulesetInfo;

        protected RulesetSetupSection(RulesetInfo rulesetInfo)
        {
            this.rulesetInfo = rulesetInfo;
        }
    }
}

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

namespace osu.Game.Screens.Edit.Setup
{
    public abstract class RulesetSetupSection : SetupSection
    {
        public sealed override LocalisableString Title => $"Ruleset ({rulesetInfo.Name})";

        private readonly RulesetInfo rulesetInfo;

        protected RulesetSetupSection(RulesetInfo rulesetInfo)
        {
            this.rulesetInfo = rulesetInfo;
        }
    }
}

Change section title to read better

Change section title to read better


using System;
using Xunit;

namespace ControlFlow.Test
{
    public class TryTest
    {
        [Fact]
        public void Fail()
        {
            throw new Exception();
        }
    }
}

using System;
using Xunit;

namespace ControlFlow.Test
{
    public class TryTest
    {
        [Fact]
        public void Pass()
        {
        }
    }
}

Switch failing test to passing tests (AppVeyor now successfully running xunit tests and failing the build on failing test)


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

namespace Bugsnag.Common
{
    public class StacktraceLineParser
    {
        public string ParseFile(string line)
        {
            throw new NotImplementedException();
        }

        public string ParseMethodName(string line)
        {
            throw new NotImplementedException();
        }

        public int? ParseLineNumber(string line)
        {
            throw new NotImplementedException();
        }
    }
}

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

namespace Bugsnag.Common
{
    public class StacktraceLineParser
    {
        Regex _fileRegex = new Regex("\\) [^ ]+ (.+):");
        public string ParseFile(string line)
        {
            var match = _fileRegex.Match(line);

            if (match.Groups.Count < 2) { return ""; }

            return match.Groups[1].Value;
        }

        Regex _methodNameRegex = new Regex("^ *[^ ]+ (.+\\))");
        public string ParseMethodName(string line)
        {
            var match = _methodNameRegex.Match(line);

            if (match.Groups.Count < 2) { return line; }

            return match.Groups[1].Value;
        }

        Regex _lineNumberRegex = new Regex(":.+ ([0-9]+)$");
        public int? ParseLineNumber(string line)
        {
            var match = _lineNumberRegex.Match(line);

            if (match.Groups.Count < 2) { return null; }

            if (int.TryParse(match.Groups[1].Value, out var lineNumber))
            {
                return lineNumber;
            }
            else
            {
                return null;
            }
        }
    }
}

Implement parser to get tests passing

fix: Implement parser to get tests passing


using System;
using System.Collections.Generic;
using Xamarin;

namespace Espera.Core.Analytics
{
    internal class XamarinAnalyticsEndpoint : IAnalyticsEndpoint
    {
        private bool isInitialized;

        public void Dispose()
        {
            // Xamarin Insights can only be terminated if it has been started before, otherwise it
            // throws an exception
            if (this.isInitialized)
            {
                Insights.Terminate();
                this.isInitialized = false;
            }
        }

        public void Identify(string id, IDictionary<string, string> traits = null)
        {
            Insights.Identify(id, traits);
        }

        public void Initialize()
        {
            Insights.Initialize("ed4fea5ffb4fa2a1d36acfeb3df4203153d92acf", AppInfo.Version.ToString(), "Espera", AppInfo.BlobCachePath);
        }

        public void ReportBug(string message)
        {
            var exception = new Exception(message);

            Insights.Report(exception);
        }

        public void ReportFatalException(Exception exception)
        {
            Insights.Report(exception, ReportSeverity.Error);
        }

        public void ReportNonFatalException(Exception exception)
        {
            Insights.Report(exception);
        }

        public void Track(string key, IDictionary<string, string> traits = null)
        {
            Insights.Track(key, traits);
        }

        public void UpdateEmail(string email)
        {
            throw new NotImplementedException();
        }
    }
}

using System;
using System.Collections.Generic;
using Xamarin;

namespace Espera.Core.Analytics
{
    internal class XamarinAnalyticsEndpoint : IAnalyticsEndpoint
    {
        private bool isInitialized;

        public void Dispose()
        {
            // Xamarin Insights can only be terminated if it has been started before, otherwise it
            // throws an exception
            if (this.isInitialized)
            {
                Insights.Terminate();
                this.isInitialized = false;
            }
        }

        public void Identify(string id, IDictionary<string, string> traits = null)
        {
            Insights.Identify(id, traits);
        }

        public void Initialize()
        {
            Insights.Initialize("ed4fea5ffb4fa2a1d36acfeb3df4203153d92acf", AppInfo.Version.ToString(), "Espera", AppInfo.BlobCachePath);

            this.isInitialized = true;
        }

        public void ReportBug(string message)
        {
            var exception = new Exception(message);

            Insights.Report(exception);
        }

        public void ReportFatalException(Exception exception)
        {
            Insights.Report(exception, ReportSeverity.Error);
        }

        public void ReportNonFatalException(Exception exception)
        {
            Insights.Report(exception);
        }

        public void Track(string key, IDictionary<string, string> traits = null)
        {
            Insights.Track(key, traits);
        }

        public void UpdateEmail(string email)
        {
            throw new NotImplementedException();
        }
    }
}

Set "isInitialized" to true, or we don't terminate the analytics


using PrepareLanding.Presets;

namespace PrepareLanding.GameData
{
    public class GameData
    {
        /// <summary>
        ///     Holds definitions (see <see cref="Verse.Def"/>) from game.
        /// </summary>
        public DefData DefData { get; }

        /// <summary>
        ///     Data specific to a single generated world.
        /// </summary>
        public WorldData WorldData { get; }

        /// <summary>
        ///     User choices on the GUI are kept in this instance.
        /// </summary>
        public UserData UserData { get; }

        /// <summary>
        ///     User choices on the GUI God Mode tab are kept in this instance.
        /// </summary>
        public GodModeData GodModeData { get; }

        /// <summary>
        ///     Used to load / save filters and options.
        /// </summary>
        public PresetManager PresetManager { get; }

        public GameData(FilterOptions filterOptions)
        {
            // Definitions (Def) from game. Won't change on a single game; might change between games by using other mods.
            DefData = new DefData(filterOptions);

            // holds user choices from the "god mode" tab.
            GodModeData = new GodModeData(DefData);

            // holds user filter choices on the GUI.
            UserData = new UserData(filterOptions);

            // data specific to a single generated world.
            WorldData = new WorldData(DefData);

            // Preset manager (load and save presets).
            PresetManager = new PresetManager(this);
        }
    }
}

using PrepareLanding.Presets;

namespace PrepareLanding.GameData
{
    public class GameData
    {
        /// <summary>
        ///     Holds definitions (see <see cref="Verse.Def"/>) from game.
        /// </summary>
        public DefData DefData { get; }

        /// <summary>
        ///     Data specific to a single generated world.
        /// </summary>
        public WorldData WorldData { get; }

        /// <summary>
        ///     User choices on the GUI are kept in this instance.
        /// </summary>
        public UserData UserData { get; }

        /// <summary>
        ///     User choices on the GUI God Mode tab are kept in this instance.
        /// </summary>
        public GodModeData GodModeData { get; }

        /// <summary>
        ///     Used to load / save filters and options.
        /// </summary>
        public PresetManager PresetManager { get; internal set; }

        public GameData(FilterOptions filterOptions)
        {
            // Definitions (Def) from game. Won't change on a single game; might change between games by using other mods.
            DefData = new DefData(filterOptions);

            // holds user choices from the "god mode" tab.
            GodModeData = new GodModeData(DefData);

            // holds user filter choices on the GUI.
            UserData = new UserData(filterOptions);

            // data specific to a single generated world.
            WorldData = new WorldData(DefData);

            // Preset manager (load and save presets).
            //PresetManager = new PresetManager(this);
        }
    }
}

Move the preset manager ctor instanciation to PrepareLanding.


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("icu.net")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("SIL International")]
[assembly: AssemblyProduct("icu.net")]
[assembly: AssemblyCopyright("Copyright © SIL International 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

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

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3439151b-347b-4321-9f2f-d5fa28b46477")]

// 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 Revision and Build Numbers
// by using the '*' as shown below:
// (These numbers match the ICU version number we're building against.)
[assembly: AssemblyVersion("4.2.1.0")]
[assembly: AssemblyFileVersion("5.0.0.2")]

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("icu.net")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("SIL International")]
[assembly: AssemblyProduct("icu.net")]
[assembly: AssemblyCopyright("Copyright © SIL International 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

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

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3439151b-347b-4321-9f2f-d5fa28b46477")]

// 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 Revision and Build Numbers
// by using the '*' as shown below:
// (The AssemblyVersion needs to match the version that Palaso builds against.)
// (The AssemblyFileVersion matches the ICU version number we're building against.)
[assembly: AssemblyVersion("4.2.1.0")]
[assembly: AssemblyFileVersion("5.0.0.2")]

Add an explanatory comment about why the AssemblyVersion and AssemblyFileVersion are different.


using System;
using TechTalk.SpecFlow;
using Xunit;

namespace Web.UI.Tests
{
    [Binding]
    public class SimpleSteps
    {
        private static int MarblesCount;

        [Given(@"I have (.*) marbles")]
        public void GivenIHaveMarbles(int count)
        {
            MarblesCount = count;
        }

        [When(@"I give away (.*) marbles")]
        public void WhenIGiveAwayMarbles(int count)
        {
            MarblesCount = Math.Max(0, MarblesCount - count);
        }

        [Then(@"I should have (.*) marbles")]
        public void ThenIShouldHaveMarbles(int count)
        {
            Assert.Equal(count, MarblesCount);
        }
    }
}

using System;
using TechTalk.SpecFlow;
using Xunit;

namespace Web.UI.Tests
{
    [Binding]
    public class SimpleSteps
    {
        private static int MarblesCount;

        [Given(@"I have (.*) marbles")]
        public void GivenIHaveMarbles(int count)
        {
            MarblesCount = count;
        }

        [When(@"I give away (.*) marbles")]
        public void WhenIGiveAwayMarbles(int count)
        {
            if (count > MarblesCount)
                throw new ArgumentOutOfRangeException("count must be less than to equal to MarblesCount.");

            MarblesCount = MarblesCount - count;
        }

        [Then(@"I should have (.*) marbles")]
        public void ThenIShouldHaveMarbles(int count)
        {
            Assert.Equal(count, MarblesCount);
        }
    }
}

Throw for negative count of marbles condition


// 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 NUnit.Framework;
using osu.Framework.Graphics.Containers;
using osu.Game.Screens.OnlinePlay;

namespace osu.Game.Tests.Visual.Multiplayer
{
    public class TestSceneFreeModSelectScreen : MultiplayerTestScene
    {
        [Test]
        public void TestFreeModSelect()
        {
            FreeModSelectScreen freeModSelectScreen = null;

            AddStep("create free mod select screen", () => Child = freeModSelectScreen = new FreeModSelectScreen
            {
                State = { Value = Visibility.Visible }
            });
            AddToggleStep("toggle visibility", visible =>
            {
                if (freeModSelectScreen != null)
                    freeModSelectScreen.State.Value = visible ? Visibility.Visible : Visibility.Hidden;
            });
        }
    }
}

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

using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Game.Overlays.Mods;
using osu.Game.Screens.OnlinePlay;

namespace osu.Game.Tests.Visual.Multiplayer
{
    public class TestSceneFreeModSelectScreen : MultiplayerTestScene
    {
        [Test]
        public void TestFreeModSelect()
        {
            FreeModSelectScreen freeModSelectScreen = null;

            AddStep("create free mod select screen", () => Child = freeModSelectScreen = new FreeModSelectScreen
            {
                State = { Value = Visibility.Visible }
            });

            AddAssert("all visible mods are playable",
                () => this.ChildrenOfType<ModPanel>()
                          .Where(panel => panel.IsPresent)
                          .All(panel => panel.Mod.HasImplementation && panel.Mod.UserPlayable));

            AddToggleStep("toggle visibility", visible =>
            {
                if (freeModSelectScreen != null)
                    freeModSelectScreen.State.Value = visible ? Visibility.Visible : Visibility.Hidden;
            });
        }
    }
}

Add assertion covering free mod selection mod validity filter


using System;
using Abc.Zebus.Util;

namespace Abc.Zebus.Transport
{
    public class ZmqSocketOptions
    {
        public ZmqSocketOptions()
        {
            ReadTimeout = 300.Milliseconds();
            SendHighWaterMark = 20000;
            SendTimeout = 100.Milliseconds();
            SendRetriesBeforeSwitchingToClosedState = 2;
            ClosedStateDurationAfterSendFailure = 15.Seconds();
            ClosedStateDurationAfterConnectFailure = 2.Minutes();
            ReceiveHighWaterMark = 20000;
        }

        public TimeSpan ReadTimeout { set; get; }
        public int SendHighWaterMark { get; set; }
        public TimeSpan SendTimeout { get; set; }
        public int SendRetriesBeforeSwitchingToClosedState { get; set; }
        public TimeSpan ClosedStateDurationAfterSendFailure { get; set; }
        public TimeSpan ClosedStateDurationAfterConnectFailure { get; set; }
        public int ReceiveHighWaterMark { get; set; }
    }
}

using System;
using Abc.Zebus.Util;

namespace Abc.Zebus.Transport
{
    public class ZmqSocketOptions
    {
        public ZmqSocketOptions()
        {
            ReadTimeout = 300.Milliseconds();
            SendHighWaterMark = 20000;
            SendTimeout = 100.Milliseconds();
            SendRetriesBeforeSwitchingToClosedState = 2;
            ClosedStateDurationAfterSendFailure = 15.Seconds();
            ClosedStateDurationAfterConnectFailure = 2.Minutes();
            ReceiveHighWaterMark = 40000;
        }

        public TimeSpan ReadTimeout { set; get; }
        public int SendHighWaterMark { get; set; }
        public TimeSpan SendTimeout { get; set; }
        public int SendRetriesBeforeSwitchingToClosedState { get; set; }
        public TimeSpan ClosedStateDurationAfterSendFailure { get; set; }
        public TimeSpan ClosedStateDurationAfterConnectFailure { get; set; }
        public int ReceiveHighWaterMark { get; set; }
    }
}

Increase default receive high-water mark


using Xunit;
using Xunit.Extensions;

namespace DotNext.RockAndRoll.UnitTests
{
    public class MusicianTestCase
    {
        [Theory]
        [InlineData("foo", "bar", "foo bar")]
        [InlineData("bar", "baz", "bar baz")]
        [InlineData("baz", "qux", "baz qux")]
        public void FullName_Always_ShouldReturnConcatenationOfNames(
            string firstName,
            string lastName,
            string expected)
        {
            var sut = new Musician(firstName, lastName);
            Assert.Equal(expected, sut.FullName);
        }
    }
}

using Xunit;
using Xunit.Extensions;

namespace DotNext.RockAndRoll.UnitTests
{
    public class MusicianTestCase
    {
        [Theory]
        [InlineData("foo", "bar")]
        [InlineData("bar", "baz")]
        [InlineData("baz", "qux")]
        public void FullName_Always_ShouldReturnConcatenationOfNames(
            string firstName,
            string lastName)
        {
            var sut = new Musician(firstName, lastName);
            Assert.Equal(firstName + " " + lastName, sut.FullName);
        }
    }
}

Add some robustness to FullName test

Add some robustness to FullName test


// -----------------------------------------------------------------------
// <copyright file="Configuration.cs" company="">
// Copyright 2014 Alexander Soffronow Pagonidis
// </copyright>
// -----------------------------------------------------------------------

using System.Data.Entity.Migrations;
using System.Linq;
using MySql.Data.Entity;
using QDMS;

namespace EntityData.Migrations
{
    public class MyDbContextConfiguration : DbMigrationsConfiguration<MyDBContext>
    {
        public MyDbContextConfiguration()
        {
            AutomaticMigrationsEnabled = true;

            SetSqlGenerator("MySql.Data.MySqlClient", new MySqlMigrationSqlGenerator());
            //SetSqlGenerator("System.Data.SqlClient", new SqlServerMigrationSqlGenerator());
            //TODO solution?
        }

        protected override void Seed(MyDBContext context)
        {
            base.Seed(context);
        }
    }
}

// -----------------------------------------------------------------------
// <copyright file="Configuration.cs" company="">
// Copyright 2014 Alexander Soffronow Pagonidis
// </copyright>
// -----------------------------------------------------------------------

using System.Data.Entity.Migrations;
using System.Linq;
using MySql.Data.Entity;
using QDMS;

namespace EntityData.Migrations
{
    public class MyDbContextConfiguration : DbMigrationsConfiguration<MyDBContext>
    {
        public MyDbContextConfiguration()
        {
            AutomaticMigrationsEnabled = true;
            AutomaticMigrationDataLossAllowed = true;

            SetSqlGenerator("MySql.Data.MySqlClient", new MySqlMigrationSqlGenerator());
            //SetSqlGenerator("System.Data.SqlClient", new SqlServerMigrationSqlGenerator());
            //TODO solution?
        }

        protected override void Seed(MyDBContext context)
        {
            base.Seed(context);
        }
    }
}

Allow automatic migration with data loss for the metadata db.


using Calendar_Converter.ViewModel;
using MVVMObjectLibrary;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace ITATools.ViewModel
{
    public class MainWindowViewModel : ViewModelBase
    {

        #region Member Variables
        private ObservableCollection<ViewModelBase> _currentViewModel;
        private ViewModelBase _mainView;
        #endregion

        #region Default Constructor
        public MainWindowViewModel()
        {
            _mainView = new Calendar_Converter.ViewModel.MainWindowViewModel();
            _currentViewModel = new ObservableCollection<ViewModelBase>();
            _currentViewModel.Add(_mainView);
        }
        #endregion

        #region Event Handlers

        #endregion

        #region Properties
        /// <summary>
        /// The CurrentViewModel Property provides the data for the MainWindow that allows the various User Controls to
        /// be populated, and displayed.
        /// </summary>
        public ObservableCollection<ViewModelBase> CurrentViewModel
        {
            get { return _currentViewModel; }
        }

        #endregion

        #region Member Methods

        /// <summary>
        /// OnDispose Overrides the default OnDispose, and causes the collections
        /// instantiated to be cleared.
        /// </summary>
        protected override void OnDispose()
        {
            this.CurrentViewModel.Clear();
        }
        #endregion

    }
}

using Calendar_Converter.ViewModel;
using MVVMObjectLibrary;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace ITATools.ViewModel
{
    public class MainWindowViewModel : ViewModelBase
    {

        #region Member Variables
        private ObservableCollection<ViewModelBase> _currentViewModel;
        private ViewModelBase _mainView;
        #endregion

        #region Default Constructor
        public MainWindowViewModel()
        {
            _mainView = new MainViewViewModel();
            _currentViewModel = new ObservableCollection<ViewModelBase>();
            _currentViewModel.Add(_mainView);
        }
        #endregion

        #region Event Handlers

        #endregion

        #region Properties
        /// <summary>
        /// The CurrentViewModel Property provides the data for the MainWindow that allows the various User Controls to
        /// be populated, and displayed.
        /// </summary>
        public ObservableCollection<ViewModelBase> CurrentViewModel
        {
            get { return _currentViewModel; }
        }

        #endregion

        #region Member Methods

        /// <summary>
        /// OnDispose Overrides the default OnDispose, and causes the collections
        /// instantiated to be cleared.
        /// </summary>
        protected override void OnDispose()
        {
            this.CurrentViewModel.Clear();
        }
        #endregion

    }
}

Revert "Making Adjustments for implementation"

This reverts commit 3248bea193474b14277fe439233f4cb898ea8286.


// Copyright © Dominic Beger 2017

using System;

namespace nUpdate.UpdateEventArgs
{
    /// <summary>
    ///     Provides data for the <see cref="UpdateManager.UpdateSearchFinished" />-event.
    /// </summary>
    public class UpdateSearchFinishedEventArgs : EventArgs
    {
        /// <summary>
        ///     Initializes a new instance of the <see cref="UpdateSearchFinishedEventArgs" />-class.
        /// </summary>
        /// <param name="updatesAvailable">A value which indicates whether a new update is available or not.</param>
        internal UpdateSearchFinishedEventArgs(bool updatesAvailable)
        {
            UpdatesAvailable = updatesAvailable;
        }

        /// <summary>
        ///     Gets a value indicating whether new updates are available, or not.
        /// </summary>
        public bool UpdatesAvailable { get; }
    }
}

// Copyright © Dominic Beger 2017

using System;
using nUpdate.Updating;

namespace nUpdate.UpdateEventArgs
{
    /// <summary>
    ///     Provides data for the <see cref="UpdateManager.UpdateSearchFinished" />-event.
    /// </summary>
    public class UpdateSearchFinishedEventArgs : EventArgs
    {
        /// <summary>
        ///     Initializes a new instance of the <see cref="UpdateSearchFinishedEventArgs" />-class.
        /// </summary>
        /// <param name="updatesAvailable">A value which indicates whether a new update is available or not.</param>
        internal UpdateSearchFinishedEventArgs(bool updatesAvailable)
        {
            UpdatesAvailable = updatesAvailable;
        }

        /// <summary>
        ///     Gets a value indicating whether new updates are available, or not.
        /// </summary>
        public bool UpdatesAvailable { get; }
    }
}

Fix unresolved reference to UpdaetManager in the documentation


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

using UnityEngine;

namespace HoloToolkit.Unity
{
    /// <summary>
    /// The purpose of this class is to provide a cached reference to the main camera. Calling Camera.main
    /// executes a FindByTag on the scene, which will get worse and worse with more tagged objects.
    /// </summary>
    public static class CameraCache
    {
        private static Camera cachedCamera;

        /// <summary>
        /// Returns a cached reference to the main camera and uses Camera.main if it hasn't been cached yet.
        /// </summary>
        public static Camera Main
        {
            get
            {
                if (cachedCamera == null)
                {
                    return Refresh(Camera.main);
                }
                return cachedCamera;
            }
        }

        /// <summary>
        /// Set the cached camera to a new reference and return it
        /// </summary>
        /// <param name="newMain">New main camera to cache</param>
        public static Camera Refresh(Camera newMain)
        {
            return cachedCamera = newMain;
        }
    }
}

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

using UnityEngine;

namespace HoloToolkit.Unity
{
    /// <summary>
    /// The purpose of this class is to provide a cached reference to the main camera. Calling Camera.main
    /// executes a FindByTag on the scene, which will get worse and worse with more tagged objects.
    /// </summary>
    public static class CameraCache
    {
        private static Camera cachedCamera;

        /// <summary>
        /// Returns a cached reference to the main camera and uses Camera.main if it hasn't been cached yet.
        /// </summary>
        public static Camera Main
        {
            get
            {
                // ReSharper disable once ConvertIfStatementToReturnStatement
                if (cachedCamera == null)
                {
                    return Refresh(Camera.main);
                }
                return cachedCamera;
            }
        }

        /// <summary>
        /// Set the cached camera to a new reference and return it
        /// </summary>
        /// <param name="newMain">New main camera to cache</param>
        public static Camera Refresh(Camera newMain)
        {
            return cachedCamera = newMain;
        }
    }
}

Disable resharper suggestions for return


using System;
using System.ComponentModel;
using DesktopWidgets.WidgetBase.Settings;

namespace DesktopWidgets.Widgets.PictureSlideshow
{
    public class Settings : WidgetSettingsBase
    {
        public Settings()
        {
            Style.Width = 384;
            Style.Height = 216;
        }

        [Category("General")]
        [DisplayName("Image Folder Path")]
        public string RootPath { get; set; }

        [Category("General")]
        [DisplayName("Maximum File Size (bytes)")]
        public double FileFilterSize { get; set; } = 1048576;

        [Category("General")]
        [DisplayName("Next Image Interval")]
        public TimeSpan ChangeInterval { get; set; } = TimeSpan.FromSeconds(15);

        [Category("General")]
        [DisplayName("Shuffle")]
        public bool Shuffle { get; set; } = true;

        [Category("General")]
        [DisplayName("Recursive")]
        public bool Recursive { get; set; } = false;

        [Category("General")]
        [DisplayName("Current Image Path")]
        public string ImageUrl { get; set; }

        [Category("General")]
        [DisplayName("Allow Dropping Images")]
        public bool AllowDropFiles { get; set; } = true;

        [Category("General")]
        [DisplayName("Freeze")]
        public bool Freeze { get; set; }
    }
}

using System;
using System.ComponentModel;
using DesktopWidgets.WidgetBase.Settings;

namespace DesktopWidgets.Widgets.PictureSlideshow
{
    public class Settings : WidgetSettingsBase
    {
        public Settings()
        {
            Style.Width = 384;
            Style.Height = 216;
        }

        [Category("General")]
        [DisplayName("Image Folder Path")]
        public string RootPath { get; set; }

        [Category("General")]
        [DisplayName("Maximum File Size (bytes)")]
        public double FileFilterSize { get; set; } = 5242880;

        [Category("General")]
        [DisplayName("Next Image Interval")]
        public TimeSpan ChangeInterval { get; set; } = TimeSpan.FromSeconds(15);

        [Category("General")]
        [DisplayName("Shuffle")]
        public bool Shuffle { get; set; } = true;

        [Category("General")]
        [DisplayName("Recursive")]
        public bool Recursive { get; set; } = false;

        [Category("General")]
        [DisplayName("Current Image Path")]
        public string ImageUrl { get; set; }

        [Category("General")]
        [DisplayName("Allow Dropping Images")]
        public bool AllowDropFiles { get; set; } = true;

        [Category("General")]
        [DisplayName("Freeze")]
        public bool Freeze { get; set; }
    }
}

Change "Slideshow" "Max File Size" option default value


using System;
using NHibernate.Type;

namespace NHibernate.Engine {
	/// <summary>
	/// Defines operations common to "compiled" mappings (ie. <c>SessionFactory</c>) and
	/// "uncompiled" mappings (ie <c>Configuration</c> that are used by implementors of <c>IType</c>
	/// </summary>
	public interface Mapping {
		IType GetIdentifierType(System.Type persistentType);
	}
}

using System;
using NHibernate.Type;

namespace NHibernate.Engine {
	/// <summary>
	/// Defines operations common to "compiled" mappings (ie. <c>SessionFactory</c>) and
	/// "uncompiled" mappings (ie <c>Configuration</c> that are used by implementors of <c>IType</c>
	/// </summary>
	public interface IMapping {
		IType GetIdentifierType(System.Type persistentType);
	}
}

Correct class name. Was Mapping

Correct class name. Was Mapping

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@29


    <form action="/subscribe?EmailAlertsTopicId=@ViewData["SignUpAlertsTopicIdTopicId"]" method="POST">
        Sign up to receive our news and email alerts in your inbox
        <input type="email" name="emailAddress" id="emailAddress" placeholder="Enter your email address">
        <button type="submit">Subscribe</button>
    </form>

    <form action="/subscribe?EmailAlertsTopicId=@ViewData["SignUpAlertsTopicIdTopicId"]" method="POST">
        Sign up to receive our news and email alerts in your inbox
        <input type="email" name="emailAddress" id="emailAddress" placeholder="Enter your email address">
        <button class="button-primary-white" type="submit">Subscribe</button>
    </form>

feature(SignUpAlert): Add button-primary-white class to button


using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Net;

namespace MultiMiner.Coinchoose.Api
{
    public static class ApiContext
    {
        public static List<CoinInformation> GetCoinInformation()
        {
            WebClient client = new WebClient();
            string jsonString = client.DownloadString("http://www.coinchoose.com/api.php");
            JArray jsonArray = JArray.Parse(jsonString);

            List<CoinInformation> result = new List<CoinInformation>();

            foreach (JToken jToken in jsonArray)
            {
                CoinInformation coinInformation = new CoinInformation();

                coinInformation.PopulateFromJson(jToken);

                result.Add(coinInformation);
            }

            return result;
        }
    }
}

using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Net;

namespace MultiMiner.Coinchoose.Api
{
    public static class ApiContext
    {
        public static List<CoinInformation> GetCoinInformation()
        {
            WebClient client = new WebClient();
            const string userAgent = "MultiMiner/V1";
            client.Headers.Add("user-agent", userAgent);

            string jsonString = client.DownloadString("http://www.coinchoose.com/api.php");
            JArray jsonArray = JArray.Parse(jsonString);

            List<CoinInformation> result = new List<CoinInformation>();

            foreach (JToken jToken in jsonArray)
            {
                CoinInformation coinInformation = new CoinInformation();
                coinInformation.PopulateFromJson(jToken);
                result.Add(coinInformation);
            }

            return result;
        }
    }
}

Add a specific user-agent to CoinChoose.com requests


using System;
using System.Collections.Generic;
using Xunit;
using Xunit.Extensions;

namespace AppHarbor.Tests
{
	public class TypeNameMatcherTest
	{
		interface IFoo
		{
		}

		class Foo : IFoo { }

		[Fact]
		public void ShouldThrowIfInitializedWithUnnasignableType()
		{
			var exception = Assert.Throws<ArgumentException>(() => new TypeNameMatcher<IFoo>(new List<Type> { typeof(string) }));
		}

		[Theory]
		[InlineData("Foo", typeof(Foo))]
		[InlineData("foo", typeof(Foo))]
		public void ShouldGetTypeStartingWithCommandName(string commandName, Type fooType)
		{
			var matcher = new TypeNameMatcher<IFoo>(new Type[] { fooType });
			Assert.Equal(fooType, matcher.GetMatchedType(commandName));
		}

		[Theory]
		[InlineData("Bar", typeof(Foo))]
		public void ShouldThrowWhenNoTypesMatches(string commandName, Type fooType)
		{
			var matcher = new TypeNameMatcher<IFoo>(new Type[] { fooType });
			Assert.Throws<ArgumentException>(() => matcher.GetMatchedType(commandName));
		}
	}
}

using System;
using System.Collections.Generic;
using Xunit;
using Xunit.Extensions;

namespace AppHarbor.Tests
{
	public class TypeNameMatcherTest
	{
		interface IFoo
		{
		}

		class Foo : IFoo { }

		private static Type FooType = typeof(Foo);

		[Fact]
		public void ShouldThrowIfInitializedWithUnnasignableType()
		{
			var exception = Assert.Throws<ArgumentException>(() => new TypeNameMatcher<IFoo>(new List<Type> { typeof(string) }));
		}

		[Theory]
		[InlineData("Foo")]
		[InlineData("foo")]
		public void ShouldGetTypeStartingWithCommandName(string commandName)
		{
			var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooType });
			Assert.Equal(FooType, matcher.GetMatchedType(commandName));
		}

		[Theory]
		[InlineData("Bar")]
		public void ShouldThrowWhenNoTypesMatches(string commandName)
		{
			var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooType });
			Assert.Throws<ArgumentException>(() => matcher.GetMatchedType(commandName));
		}
	}
}

Move foo type to static member

Move foo type to static member


@using Kendo.Mvc.UI
@using VotingSystem.Web.ViewModels.Polls
@model List<PublicActivePollsViewModel>
@{
    ViewBag.Title = "All Public Polls";
}

@ViewBag.Title

@(Html.Kendo().Grid(Model)
    .Name("pollGrid")
    .Columns(col =>
        {
            col.Bound(poll => poll.Id).Hidden();
            col.Bound(poll => poll.Title).ClientTemplate("#= Title #");
            col.Bound(poll => poll.Description);
            col.Bound(poll => poll.Author);
            col.Bound(poll => poll.StartDate);
            col.Bound(poll => poll.EndDate);

        })
        .Sortable()
        .Pageable()
        .Filterable())

@using Kendo.Mvc.UI
@using VotingSystem.Web.ViewModels.Polls
@model List<PublicActivePollsViewModel>
@{
    ViewBag.Title = "All Public Polls";
}

@ViewBag.Title

@(Html.Kendo().Grid(Model)
    .Name("pollGrid")
    .Columns(col =>
        {
            col.Bound(poll => poll.Id).Hidden();
            col.Bound(p => p.Title).Template(@<text>
                @item.Title
            </text>);
            col.Bound(poll => poll.Title);
            col.Bound(poll => poll.Description);
            col.Bound(poll => poll.Author);
            col.Bound(poll => poll.StartDate);
            col.Bound(poll => poll.EndDate);

        })
                            .Sortable()
                            .Pageable()
                            .Filterable())

Add link to kendo grid title

Add link to kendo grid title


using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;

namespace TheCollection.Business.Tea
{
    [JsonConverter(typeof(SearchableConverter))]
    public class Bag
    {
        [Key]
        [JsonProperty(PropertyName = "id")]
        public string Id { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "mainid")]
        public int MainID { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "brand")]
        public RefValue Brand { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "serie")]
        public string Serie { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "flavour")]
        public string Flavour { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "hallmark")]
        public string Hallmark { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "bagtype")]
        public RefValue BagType { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "country")]
        public RefValue Country { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "serialnumber")]
        public string SerialNumber { get; set; }

        [JsonProperty(PropertyName = "insertdate")]
        public string InsertDate { get; set; }

        [JsonProperty(PropertyName = "imageid")]
        public string ImageId { get; set; }
    }
}

using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;

namespace TheCollection.Business.Tea
{
    [JsonConverter(typeof(SearchableConverter))]
    public class Bag
    {
        [Key]
        [JsonProperty(PropertyName = "id")]
        public string Id { get; set; }

        [JsonProperty(PropertyName = "userid")]
        public string UserId { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "mainid")]
        public int MainID { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "brand")]
        public RefValue Brand { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "serie")]
        public string Serie { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "flavour")]
        public string Flavour { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "hallmark")]
        public string Hallmark { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "bagtype")]
        public RefValue BagType { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "country")]
        public RefValue Country { get; set; }

        [Searchable]
        [JsonProperty(PropertyName = "serialnumber")]
        public string SerialNumber { get; set; }

        [JsonProperty(PropertyName = "insertdate")]
        public string InsertDate { get; set; }

        [JsonProperty(PropertyName = "imageid")]
        public string ImageId { get; set; }
    }
}

Add owner user id for bags

Add owner user id for bags


using System;
using System.Threading;
namespace Lurchsoft.ParallelWorkshop.Ex05DatedSerial.PossibleSolution
{
    public class LazyDatedSerial
    {
        private Lazy<ThreadSafeSerial> serial = new Lazy<ThreadSafeSerial>(LazyThreadSafetyMode.ExecutionAndPublication);

        public string GetNextSerial()
        {
            return serial.Value.GetNextSerial();
        }

        private class ThreadSafeSerial
        {
            private readonly string prefix;
            private int serial;

            public ThreadSafeSerial(string prefix)
            {
                this.prefix = prefix;
            }

            public string GetNextSerial()
            {
                int thisSerial = Interlocked.Increment(ref serial);
                return string.Format("{0}-{1}", prefix, thisSerial);
            }
        }
    }
}

using System;
using System.Threading;
namespace Lurchsoft.ParallelWorkshop.Ex05DatedSerial.PossibleSolution
{
    public class LazyDatedSerial
    {
        private Lazy<ThreadSafeSerial> serial = new Lazy<ThreadSafeSerial>
            (() => new ThreadSafeSerial(DateTime.Now.ToShortDateString()), LazyThreadSafetyMode.ExecutionAndPublication);

        public string GetNextSerial()
        {
            return serial.Value.GetNextSerial();
        }

        private class ThreadSafeSerial
        {
            private readonly string prefix;
            private int serial;

            public ThreadSafeSerial(string prefix)
            {
                this.prefix = prefix;
            }

            public string GetNextSerial()
            {
                int thisSerial = Interlocked.Increment(ref serial);
                return string.Format("{0}-{1}", prefix, thisSerial);
            }
        }
    }
}

Fix the solution for Ex05

Fix the solution for Ex05


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

using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace Google.Cloud.Spanner.Data
{
    internal static class TypeUtil
    {
        public static bool DictionaryEquals(IDictionary d1, IDictionary d2)
        {
            if (d1 == null && d2 == null)
            {
                return true;
            }

            if (d1 == null || d2 == null)
            {
                return false;
            }

            return d1.Count == d2.Count
                && d1.Keys.Cast<object>().All(key => d2.Contains(key) && Equals(d2[key], d1[key]));
        }

        public static bool DictionaryEquals<TK, TV>(IDictionary<TK, TV> d1, IDictionary<TK, TV> d2)
        {
            if (d1 == null && d2 == null)
            {
                return true;
            }

            if (d1 == null || d2 == null)
            {
                return false;
            }

            return d1.Count == d2.Count
                && d1.Keys.All(key => d2.ContainsKey(key) && Equals(d2[key], d1[key]));
        }
    }
}

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

using System.Collections;
using System.Linq;

namespace Google.Cloud.Spanner.Data
{
    internal static class TypeUtil
    {
        public static bool DictionaryEquals(IDictionary d1, IDictionary d2)
        {
            if (d1 == null && d2 == null)
            {
                return true;
            }

            if (d1 == null || d2 == null)
            {
                return false;
            }

            return d1.Count == d2.Count
                && d1.Keys.Cast<object>().All(key => d2.Contains(key) && Equals(d2[key], d1[key]));
        }
    }
}

Remove now-redundant code previously used for dictionary support


using System.IO;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace ContosoUniversity
{
    public class Program
    {
        public static void Main(string[] args)
        {
            BuildWebHost(args).Run();
        }

        public static IWebHost BuildWebHost(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .ConfigureAppConfiguration(ConfigConfiguration)
                .ConfigureLogging(ConfigureLogger)
                .UseStartup<Startup>()
                .Build();

        // refs:
        // https://wildermuth.com/2017/07/06/Program-cs-in-ASP-NET-Core-2-0
        public static void ConfigConfiguration(WebHostBuilderContext context, IConfigurationBuilder config)
        {
            config.SetBasePath(Directory.GetCurrentDirectory());

            if (context.HostingEnvironment.IsDevelopment())
            {
                config.AddJsonFile($"sampleData.json", optional: true, reloadOnChange: false);
                config.AddUserSecrets<Startup>();
            }

            config.AddEnvironmentVariables();
        }

        static void ConfigureLogger(WebHostBuilderContext ctx, ILoggingBuilder logging)
        {
            logging.AddConfiguration(ctx.Configuration.GetSection("Logging"));
            logging.AddConsole();
            logging.AddDebug();
        }
    }
}

using System.IO;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace ContosoUniversity
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();
        }

        // netcoreapp2.1 code-based idiom to support integration test infrastructor
        // https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-3.1
        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .ConfigureAppConfiguration(ConfigConfiguration)
                .ConfigureLogging(ConfigureLogger)
                .UseStartup<Startup>();

        // refs:
        // https://wildermuth.com/2017/07/06/Program-cs-in-ASP-NET-Core-2-0
        public static void ConfigConfiguration(WebHostBuilderContext context, IConfigurationBuilder config)
        {
            config.SetBasePath(Directory.GetCurrentDirectory());

            if (context.HostingEnvironment.IsDevelopment())
            {
                config.AddJsonFile($"sampleData.json", optional: true, reloadOnChange: false);
                config.AddUserSecrets<Startup>();
            }

            config.AddEnvironmentVariables();
        }

        static void ConfigureLogger(WebHostBuilderContext ctx, ILoggingBuilder logging)
        {
            logging.AddConfiguration(ctx.Configuration.GetSection("Logging"));
            logging.AddConsole();
            logging.AddDebug();
        }
    }
}

Replace BuildWebHost => CreatewebHostBuilder to support integration testing


using System.Collections.Generic;
using System.Linq;
using Mirage.Urbanization.ZoneStatisticsQuerying;
using System.Collections.Immutable;

namespace Mirage.Urbanization.Simulation.Persistence
{
    public class PersistedCityStatisticsCollection
    {
        private ImmutableQueue<PersistedCityStatisticsWithFinancialData> _persistedCityStatistics = ImmutableQueue<PersistedCityStatisticsWithFinancialData>.Empty;

        private PersistedCityStatisticsWithFinancialData _mostRecentStatistics;

        public void Add(PersistedCityStatisticsWithFinancialData statistics)
        {
            _persistedCityStatistics = _persistedCityStatistics.Enqueue(statistics);
            if (_persistedCityStatistics.Count() > 20800)
                _persistedCityStatistics = _persistedCityStatistics.Dequeue();

            _mostRecentStatistics = statistics;
        }

        public QueryResult<PersistedCityStatisticsWithFinancialData> GetMostRecentPersistedCityStatistics()
        {
            return QueryResult<PersistedCityStatisticsWithFinancialData>.Create(_mostRecentStatistics);
        }

        public IEnumerable<PersistedCityStatisticsWithFinancialData> GetAll()
        {
            return _persistedCityStatistics;
        }
    }
}

using System.Collections.Generic;
using System.Linq;
using Mirage.Urbanization.ZoneStatisticsQuerying;
using System.Collections.Immutable;

namespace Mirage.Urbanization.Simulation.Persistence
{
    public class PersistedCityStatisticsCollection
    {
        private ImmutableQueue<PersistedCityStatisticsWithFinancialData> _persistedCityStatistics = ImmutableQueue<PersistedCityStatisticsWithFinancialData>.Empty;

        private PersistedCityStatisticsWithFinancialData _mostRecentStatistics;

        public void Add(PersistedCityStatisticsWithFinancialData statistics)
        {
            _persistedCityStatistics = _persistedCityStatistics.Enqueue(statistics);
            if (_persistedCityStatistics.Count() > 5200)
                _persistedCityStatistics = _persistedCityStatistics.Dequeue();

            _mostRecentStatistics = statistics;
        }

        public QueryResult<PersistedCityStatisticsWithFinancialData> GetMostRecentPersistedCityStatistics()
        {
            return QueryResult<PersistedCityStatisticsWithFinancialData>.Create(_mostRecentStatistics);
        }

        public IEnumerable<PersistedCityStatisticsWithFinancialData> GetAll()
        {
            return _persistedCityStatistics;
        }
    }
}

Reduce the amount of 'PersistedCityStatistics'


using System;
using System.IO;
using System.Net;

namespace SimpleWAWS.Authentication
{
    public static class AuthUtilities
    {
        public static string GetContentFromUrl(string url)
        {
            var request = (HttpWebRequest)WebRequest.Create(url);
            using (var response = request.GetResponse())
            {
                using (var reader = new StreamReader(response.GetResponseStream()))
                {
                    return reader.ReadToEnd();
                }
            }
        }
        public static string GetContentFromGitHubUrl(string url, string method = "GET", bool jsonAccept = false, bool addGitHubHeaders = false, string AuthorizationHeader = "")
        {
            var request = (HttpWebRequest)WebRequest.Create(url);
            request.Method = method;
            request.UserAgent = "x-ms-try-appservice";
            if (jsonAccept)
            {
                request.Accept = "application/json";
            }
            if (addGitHubHeaders)
            {
                request.Accept = "application/vnd.github.v3+json";
            }
            if (!String.IsNullOrEmpty(AuthorizationHeader))
            {
                request.Headers.Add("Authorization", AuthorizationHeader);
            }
            using (var response = request.GetResponse())
            {
                using (var reader = new StreamReader(response.GetResponseStream()))
                {
                    return reader.ReadToEnd();
                }
            }
        }
    }
}

using System;
using System.IO;
using System.Net;

namespace SimpleWAWS.Authentication
{
    public static class AuthUtilities
    {
        public static string GetContentFromUrl(string url, string method="GET", bool jsonAccept = false, bool addGitHubHeaders = false, string AuthorizationHeader ="")
        {
            var request = (HttpWebRequest)WebRequest.Create(url);
            request.Method = method;
            request.UserAgent = "Anything";
            if (jsonAccept)
                request.Accept = "application/json";
            if (addGitHubHeaders)
                request.Accept = "application/vnd.github.v3+json";
            if (!String.IsNullOrEmpty(AuthorizationHeader))
            {
                request.Headers.Add("Authorization", AuthorizationHeader);
            }
            using (var response = request.GetResponse())
            {
                using (var reader = new StreamReader(response.GetResponseStream()))
                {
                    return reader.ReadToEnd();
                }
            }
        }
        public static string GetContentFromGitHubUrl(string url, string method = "GET", bool jsonAccept = false, bool addGitHubHeaders = false, string AuthorizationHeader = "")
        {
            var request = (HttpWebRequest)WebRequest.Create(url);
            request.Method = method;
            request.UserAgent = "x-ms-try-appservice";
            if (jsonAccept)
            {
                request.Accept = "application/json";
            }
            if (addGitHubHeaders)
            {
                request.Accept = "application/vnd.github.v3+json";
            }
            if (!String.IsNullOrEmpty(AuthorizationHeader))
            {
                request.Headers.Add("Authorization", AuthorizationHeader);
            }
            using (var response = request.GetResponse())
            {
                using (var reader = new StreamReader(response.GetResponseStream()))
                {
                    return reader.ReadToEnd();
                }
            }
        }
    }
}

Add GitHub auth. Hide option in UI

Add GitHub auth. Hide option in UI


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("dcm")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("dcm")]
[assembly: AssemblyCopyright("Copyright ©  2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

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

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ca199dd4-2017-4ee7-808c-3747101e04b1")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.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("Digital Color Meter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Digital Color Meter")]
[assembly: AssemblyCopyright("Copyright © 2014 Stian Hanger")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

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

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ca199dd4-2017-4ee7-808c-3747101e04b1")]

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

Add application title and copyright.

Add application title and copyright.


using UnityEngine;
using System.Collections;

public class SpawnController : MonoBehaviour {

	public GameObject enemiesFolder;
	public GameObject originalEnemy;
	public int enemiesToSpawn;
    private int enemiesSpawned;

	void Start () {
        enemiesSpawned = 0;
        InvokeRepeating("SpawnEnemy", 0, 2f);
	}

    void SpawnEnemy() {
       if(enemiesSpawned < enemiesToSpawn) {
			GameObject anEnemy = Instantiate (originalEnemy);
			anEnemy.transform.position = new Vector3 (this.transform.position.x, this.transform.position.y + 0.1f, this.transform.position.z);
			anEnemy.transform.SetParent (enemiesFolder.transform);
			enemiesSpawned += 1;
		}
    }
}

using UnityEngine;
using System.Collections;

public class SpawnController : MonoBehaviour {

	public GameObject enemiesFolder;
	public GameObject originalEnemy;
	public int enemiesToSpawn;
	public float spawnInterval;

    private int enemiesSpawned;

	void Start () {
        enemiesSpawned = 0;
		InvokeRepeating("SpawnEnemy", 0, spawnInterval);
	}

    void SpawnEnemy() {
       if(enemiesSpawned < enemiesToSpawn) {
			GameObject anEnemy = Instantiate (originalEnemy);
			anEnemy.transform.position = new Vector3 (this.transform.position.x, this.transform.position.y + 0.1f, this.transform.position.z);
			anEnemy.transform.SetParent (enemiesFolder.transform);
			enemiesSpawned += 1;
		}
    }
}

Allow to set spawn interval public

Allow to set spawn interval public


//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34003
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

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

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.1.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-10-23 22:48")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
[assembly: AssemblyDescription("Autofac.Web 3.1.0")]

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18051
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

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

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.1.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-12-03 10:23")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
[assembly: AssemblyDescription("Autofac.Web 3.1.0")]

Split WCF functionality out of Autofac.Extras.Multitenant into a separate assembly/package, Autofac.Extras.Multitenant.Wcf. Both packages are versioned 3.1.0.


using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Shippo {
    [JsonObject (MemberSerialization.OptIn)]
    public class Batch : ShippoId {
        [JsonProperty (PropertyName = "object_status")]
        public string ObjectStatus { get; set; }

        [JsonProperty (PropertyName = "object_created")]
        public string ObjectCreated { get; set; }

        [JsonProperty (PropertyName = "object_updated")]
        public string ObjectUpdated { get; set; }

        [JsonProperty (PropertyName = "object_owner")]
        public string ObjectOwner { get; set; }

        [JsonProperty (PropertyName = "default_carrier_account")]
        public string DefaultCarrierAccount { get; set; }

        [JsonProperty (PropertyName = "default_servicelevel_token")]
        public string DefaultServicelevelToken { get; set; }

        [JsonProperty (PropertyName = "label_filetype")]
        public string LabelFiletype { get; set; }

        [JsonProperty (PropertyName = "metadata")]
        public string Metadata { get; set; }

        [JsonProperty (PropertyName = "batch_shipments")]
        public BatchShipments BatchShipments { get; set; }

        [JsonProperty (PropertyName = "label_url")]
        public List<String> LabelUrl { get; set; }

        [JsonProperty (PropertyName = "object_results")]
        public ObjectResults ObjectResults { get; set; }
    }
}

using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Shippo {
    [JsonObject (MemberSerialization.OptIn)]
    public class Batch : ShippoId {
        [JsonProperty (PropertyName = "object_status")]
        public string ObjectStatus { get; set; }

        [JsonProperty (PropertyName = "object_created")]
        public DateTime ObjectCreated { get; set; }

        [JsonProperty (PropertyName = "object_updated")]
        public DateTime ObjectUpdated { get; set; }

        [JsonProperty (PropertyName = "object_owner")]
        public string ObjectOwner { get; set; }

        [JsonProperty (PropertyName = "default_carrier_account")]
        public string DefaultCarrierAccount { get; set; }

        [JsonProperty (PropertyName = "default_servicelevel_token")]
        public string DefaultServicelevelToken { get; set; }

        [JsonProperty (PropertyName = "label_filetype")]
        public string LabelFiletype { get; set; }

        [JsonProperty (PropertyName = "metadata")]
        public string Metadata { get; set; }

        [JsonProperty (PropertyName = "batch_shipments")]
        public BatchShipments BatchShipments { get; set; }

        [JsonProperty (PropertyName = "label_url")]
        public List<String> LabelUrl { get; set; }

        [JsonProperty (PropertyName = "object_results")]
        public ObjectResults ObjectResults { get; set; }
    }
}

Change ObjectCreated and ObjectUpdated to DateTime


using UnityEditor;
using UnityEditor.Build;
#if UNITY_2018_1_OR_NEWER
using UnityEditor.Build.Reporting;
#endif
using UnityEngine;

using System.Collections.Generic;

class TeakPreProcessDefiner :
#if UNITY_2018_1_OR_NEWER
    IPreprocessBuildWithReport
#else
    IPreprocessBuild
#endif
{
    public int callbackOrder { get { return 0; } }
    public static readonly string[] TeakDefines = new string[] {
        "TEAK_2_0_OR_NEWER",
        "TEAK_2_1_OR_NEWER"
    };

#if UNITY_2018_1_OR_NEWER
    public void OnPreprocessBuild(BuildReport report) {
        SetTeakPreprocesorDefines(report.summary.platformGroup);
    }
#else

    public void OnPreprocessBuild(BuildTarget target, string path) {
        SetTeakPreprocesorDefines(BuildPipeline.GetBuildTargetGroup(target));
    }
#endif

    private void SetTeakPreprocesorDefines(BuildTargetGroup targetGroup) {
        string[] existingDefines = PlayerSettings.GetScriptingDefineSymbolsForGroup(targetGroup).Split(';');

        HashSet<string> updatedDefines = new HashSet<string>(existingDefines);
        updatedDefines.UnionWith(TeakDefines);

        string[] defines = new string[updatedDefines.Count];
        updatedDefines.CopyTo(defines);
        PlayerSettings.SetScriptingDefineSymbolsForGroup(targetGroup, string.Join(";", defines));
    }
}

using UnityEditor;
using UnityEditor.Build;
#if UNITY_2018_1_OR_NEWER
using UnityEditor.Build.Reporting;
#endif
using UnityEngine;

using System.Collections.Generic;

class TeakPreProcessDefiner :
#if UNITY_2018_1_OR_NEWER
    IPreprocessBuildWithReport
#else
    IPreprocessBuild
#endif
{
    public int callbackOrder { get { return 0; } }
    public static readonly string[] TeakDefines = new string[] {
        "TEAK_2_0_OR_NEWER",
        "TEAK_2_1_OR_NEWER"
    };

#if UNITY_2018_1_OR_NEWER
    public void OnPreprocessBuild(BuildReport report) {
        SetTeakPreprocesorDefines(report.summary.platformGroup);
    }
#else

    public void OnPreprocessBuild(BuildTarget target, string path) {
        SetTeakPreprocesorDefines(BuildPipeline.GetBuildTargetGroup(target));
    }
#endif

    private void SetTeakPreprocesorDefines(BuildTargetGroup targetGroup) {
        string[] existingDefines = PlayerSettings.GetScriptingDefineSymbolsForGroup(targetGroup).Split(';');

        HashSet<string> updatedDefines = new HashSet<string>(existingDefines);
        updatedDefines.RemoveWhere(define => define.StartsWith("TEAK_") && define.EndsWith("_OR_NEWER"));
        updatedDefines.UnionWith(TeakDefines);

        string[] defines = new string[updatedDefines.Count];
        updatedDefines.CopyTo(defines);
        PlayerSettings.SetScriptingDefineSymbolsForGroup(targetGroup, string.Join(";", defines));
    }
}

Remove TEAK_X_Y_OR_NEWER before adding them again so that in the case of SDK rollback defines are not left in


using System;
using System.IO;

namespace Kfstorm.BingWallpaper
{
    public static class Constants
    {
        public static string DataPath
        {
            get
            {
                string path = Path.Combine(Environment.GetFolderPath(
                    Environment.SpecialFolder.ApplicationData), @"K.F.Storm\BingWallpaper");
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                return path;
            }
        }

        public static string LogFile
        {
            get { return "log.log"; }
        }

        public static string StateFile
        {
            get { return "state.xml"; }
        }

        public static string JpgFile
        {
            get { return "image.jpg"; }
        }

        public static string BmpFile
        {
            get { return "image.bmp"; }
        }

        public static string WallpaperInfoUrl
        {
            get { return string.Format("http://www.bing.com/hpimagearchive.aspx?format=xml&idx={0}&n={1}&mkt={2}", PictureIndex, PictureCount, Market); }
        }

        public static int PictureCount
        {
            get { return 1; }
        }

        public static int PictureIndex
        {
            get { return 0; }
        }

        public static string Market
        {
            get { return "zh-cn"; }
        }

        public static string PictureUrlFormat
        {
            get { return "http://www.bing.com{0}_1920x1080.jpg"; }
        }

        public static TimeZoneInfo TimeZone
        {
            get { return TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); }
        }
    }
}

using System;
using System.IO;

namespace Kfstorm.BingWallpaper
{
    public static class Constants
    {
        public static string DataPath
        {
            get
            {
                string path = Path.Combine(Environment.GetFolderPath(
                    Environment.SpecialFolder.ApplicationData), @"K.F.Storm\BingWallpaper");
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                return path;
            }
        }

        public static string LogFile
        {
            get { return "log.log"; }
        }

        public static string StateFile
        {
            get { return "state.xml"; }
        }

        public static string JpgFile
        {
            get { return "image.jpg"; }
        }

        public static string BmpFile
        {
            get { return "image.bmp"; }
        }

        public static string WallpaperInfoUrl
        {
            get { return string.Format("http://www.bing.com/hpimagearchive.aspx?format=xml&idx={0}&n={1}&mkt={2}", PictureIndex, PictureCount, Market); }
        }

        public static int PictureCount
        {
            get { return 1; }
        }

        public static int PictureIndex
        {
            get { return 0; }
        }

        public static string Market
        {
            get { return "zh-cn"; }
        }

        public static string PictureUrlFormat
        {
            get { return "http://www.bing.com{0}_UHD.jpg"; }
        }

        public static TimeZoneInfo TimeZone
        {
            get { return TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); }
        }
    }
}

Update image resolution to UHD

Update image resolution to UHD