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

namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
    public class DrawableSpinnerTick : DrawableOsuHitObject
    {
        public override bool DisplayResult => false;

        protected DrawableSpinner DrawableSpinner => (DrawableSpinner)ParentHitObject;

        public DrawableSpinnerTick()
            : base(null)
        {
        }

        public DrawableSpinnerTick(SpinnerTick spinnerTick)
            : base(spinnerTick)
        {
        }

        protected override double MaximumJudgementOffset => DrawableSpinner.HitObject.Duration;

        /// <summary>
        /// Apply a judgement result.
        /// </summary>
        /// <param name="hit">Whether this tick was reached.</param>
        internal void TriggerResult(bool hit) => ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult);
    }
}

// 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.Graphics;

namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
    public class DrawableSpinnerTick : DrawableOsuHitObject
    {
        public override bool DisplayResult => false;

        protected DrawableSpinner DrawableSpinner => (DrawableSpinner)ParentHitObject;

        public DrawableSpinnerTick()
            : this(null)
        {
        }

        public DrawableSpinnerTick(SpinnerTick spinnerTick)
            : base(spinnerTick)
        {
            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;
        }

        protected override double MaximumJudgementOffset => DrawableSpinner.HitObject.Duration;

        /// <summary>
        /// Apply a judgement result.
        /// </summary>
        /// <param name="hit">Whether this tick was reached.</param>
        internal void TriggerResult(bool hit) => ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult);
    }
}

Fix spinenr tick samples not positioned at centre

Causing samples to be played at left ear rather than centre.


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace BlueprintBaseName._1
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                });
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace BlueprintBaseName._1
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                });
    }
}

Fix compile error in .NET Core 3.1 version of ASP.NET Core Web App blueprint


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

namespace NBi.GenbiL
{
    class GenerationState
    {
        public DataTable TestCases { get; set; }
        public IEnumerable<string> Variables { get; set; }
        public string Template { get; set; }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using NBi.Service;

namespace NBi.GenbiL
{
    public class GenerationState
    {
        public TestCasesManager TestCases { get; private set; }
        public TemplateManager Template { get; private set; }
        public SettingsManager Settings { get; private set; }
        public TestListManager List { get; private set; }
        public TestSuiteManager Suite { get; private set; }

        public GenerationState()
        {
            TestCases = new TestCasesManager();
            Template = new TemplateManager();
            Settings = new SettingsManager();
            List = new TestListManager();
            Suite = new TestSuiteManager();
        }
    }
}

Define a state that is modified by the actions


// 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 osu.Framework.Development;
using osu.Framework.Extensions.TypeExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Lists;

namespace osu.Framework.Logging
{
    internal static class LoadingComponentsLogger
    {
        private static readonly WeakList<Drawable> loading_components = new WeakList<Drawable>();

        public static void Add(Drawable component)
        {
            if (!DebugUtils.IsDebugBuild) return;

            lock (loading_components)
                loading_components.Add(component);
        }

        public static void Remove(Drawable component)
        {
            if (!DebugUtils.IsDebugBuild) return;

            lock (loading_components)
                loading_components.Remove(component);
        }

        public static void LogAndFlush()
        {
            if (!DebugUtils.IsDebugBuild) return;

            lock (loading_components)
            {
                Logger.Log($"⏳ Currently loading components ({loading_components.Count()})");

                foreach (var c in loading_components)
                    Logger.Log($"- {c.GetType().ReadableName(),-16} LoadState:{c.LoadState,-5} Thread:{c.LoadThread.Name}");

                loading_components.Clear();

                Logger.Log("🧵 Task schedulers");

                Logger.Log(CompositeDrawable.SCHEDULER_STANDARD.GetStatusString());
                Logger.Log(CompositeDrawable.SCHEDULER_LONG_LOAD.GetStatusString());
            }
        }
    }
}

// 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 osu.Framework.Development;
using osu.Framework.Extensions.TypeExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Lists;

namespace osu.Framework.Logging
{
    internal static class LoadingComponentsLogger
    {
        private static readonly WeakList<Drawable> loading_components = new WeakList<Drawable>();

        public static void Add(Drawable component)
        {
            if (!DebugUtils.IsDebugBuild) return;

            lock (loading_components)
                loading_components.Add(component);
        }

        public static void Remove(Drawable component)
        {
            if (!DebugUtils.IsDebugBuild) return;

            lock (loading_components)
                loading_components.Remove(component);
        }

        public static void LogAndFlush()
        {
            if (!DebugUtils.IsDebugBuild) return;

            lock (loading_components)
            {
                Logger.Log($"⏳ Currently loading components ({loading_components.Count()})");

                foreach (var c in loading_components)
                {
                    Logger.Log($"- {c.GetType().ReadableName(),-16} LoadState:{c.LoadState,-5} Thread:{c.LoadThread?.Name ?? "none"}");
                }

                loading_components.Clear();

                Logger.Log("🧵 Task schedulers");

                Logger.Log(CompositeDrawable.SCHEDULER_STANDARD.GetStatusString());
                Logger.Log(CompositeDrawable.SCHEDULER_LONG_LOAD.GetStatusString());
            }
        }
    }
}

Fix potentially null reference if drawable was not assigned a `LoadThread` yet


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

using System;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi;

namespace osu.Game.Screens.Select
{
    public class MatchSongSelect : SongSelect, IMultiplayerScreen
    {
        public Action<PlaylistItem> Selected;

        public string ShortTitle => "song selection";

        protected override bool OnStart()
        {
            var item = new PlaylistItem
            {
                Beatmap = Beatmap.Value.BeatmapInfo,
                Ruleset = Ruleset.Value,
            };

            item.RequiredMods.AddRange(SelectedMods.Value);

            Selected?.Invoke(item);

            if (IsCurrentScreen)
                Exit();

            return true;
        }
    }
}

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

using System;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi;

namespace osu.Game.Screens.Select
{
    public class MatchSongSelect : SongSelect, IMultiplayerScreen
    {
        public Action<PlaylistItem> Selected;

        public string ShortTitle => "song selection";

        protected override bool OnStart()
        {
            var item = new PlaylistItem
            {
                Beatmap = Beatmap.Value.BeatmapInfo,
                Ruleset = Ruleset.Value,
                RulesetID = Ruleset.Value.ID ?? 0
            };

            item.RequiredMods.AddRange(SelectedMods.Value);

            Selected?.Invoke(item);

            if (IsCurrentScreen)
                Exit();

            return true;
        }
    }
}

Fix incorrect ruleset being sent to API

Fix incorrect ruleset being sent to API


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

namespace Booma.Proxy
{
	/// <summary>
	/// Payload sent when a client is begining a warp to a new area.
	/// Contains client ID information and information about the warp itself.
	/// </summary>
	[WireDataContract]
	[SubCommand60(SubCommand60OperationCode.GameStartWarpToArea)]
	public sealed class Sub60StartNewWarpCommand : BaseSubCommand60, IMessageContextIdentifiable
	{
		//TODO: Is this client id?
		[WireMember(1)]
		public byte Identifier { get; }

		[WireMember(2)]
		public byte Unused1 { get; }

		/// <summary>
		/// The zone ID that the user is teleporting to.
		/// </summary>
		[WireMember(3)]
		public short ZoneId { get; }

		//Unused2 was padding, not sent in the payload.

		public Sub60StartNewWarpCommand()
		{
			//Calc static 32bit size
			CommandSize = 8 / 4;
		}
	}
}

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

namespace Booma.Proxy
{
	/// <summary>
	/// Payload sent when a client is begining a warp to a new area.
	/// Contains client ID information and information about the warp itself.
	/// </summary>
	[WireDataContract]
	[SubCommand60(SubCommand60OperationCode.GameStartWarpToArea)]
	public sealed class Sub60StartNewWarpCommand : BaseSubCommand60, IMessageContextIdentifiable
	{
		//TODO: Is this client id?
		[WireMember(1)]
		public byte Identifier { get; }

		[WireMember(2)]
		public byte Unused1 { get; }

		/// <summary>
		/// The zone ID that the user is teleporting to.
		/// </summary>
		[WireMember(3)]
		public short ZoneId { get; }

		//TODO: What is this?
		[WireMember(4)]
		public short Unused2 { get; }

		public Sub60StartNewWarpCommand()
		{
			//Calc static 32bit size
			CommandSize = 8 / 4;
		}
	}
}

Revert "Cleaned up 0x60 0x21 warp packet model"

This reverts commit d10e1a0bc424923674067ae9080e6954c1de9403.


using System;
using System.Windows.Forms;
using osu_StreamCompanion.Code.Core;
using osu_StreamCompanion.Code.Helpers;

namespace osu_StreamCompanion.Code.Modules.ModParser
{
    public partial class ModParserSettings : UserControl
    {
        private Settings _settings;
        private bool init = true;
        public ModParserSettings(Settings settings)
        {
            _settings = settings;
            _settings.SettingUpdated+= SettingUpdated;
            this.Enabled = _settings.Get("EnableMemoryScanner", true);
            InitializeComponent();
            textBox_Mods.Text = _settings.Get("NoModsDisplayText", "None");
            radioButton_longMods.Checked = _settings.Get("UseLongMods", false);
            radioButton_shortMods.Checked = !radioButton_longMods.Checked;
            init = false;
        }

        private void SettingUpdated(object sender, SettingUpdated settingUpdated)
        {
            this.BeginInvoke((MethodInvoker) (() =>
            {
                if (settingUpdated.Name == "EnableMemoryScanner")
                    this.Enabled = _settings.Get("EnableMemoryScanner", true);
            }));
        }

        private void textBox_Mods_TextChanged(object sender, EventArgs e)
        {
            if (init) return;
            _settings.Add("NoModsDisplayText", textBox_Mods.Text);
        }

        private void radioButton_longMods_CheckedChanged(object sender, EventArgs e)
        {
            if (init) return;
            if (((RadioButton)sender).Checked)
            {
                _settings.Add("UseLongMods", radioButton_longMods.Checked);
            }
        }
    }
}

using System;
using System.Windows.Forms;
using osu_StreamCompanion.Code.Core;
using osu_StreamCompanion.Code.Helpers;

namespace osu_StreamCompanion.Code.Modules.ModParser
{
    public partial class ModParserSettings : UserControl
    {
        private Settings _settings;
        private bool init = true;
        public ModParserSettings(Settings settings)
        {
            _settings = settings;
            _settings.SettingUpdated += SettingUpdated;
            this.Enabled = _settings.Get("EnableMemoryScanner", true);
            InitializeComponent();
            textBox_Mods.Text = _settings.Get("NoModsDisplayText", "None");
            radioButton_longMods.Checked = _settings.Get("UseLongMods", false);
            radioButton_shortMods.Checked = !radioButton_longMods.Checked;
            init = false;
        }

        private void SettingUpdated(object sender, SettingUpdated settingUpdated)
        {
            if (this.IsHandleCreated)
                this.BeginInvoke((MethodInvoker)(() =>
           {
               if (settingUpdated.Name == "EnableMemoryScanner")
                   this.Enabled = _settings.Get("EnableMemoryScanner", true);
           }));
        }

        private void textBox_Mods_TextChanged(object sender, EventArgs e)
        {
            if (init) return;
            _settings.Add("NoModsDisplayText", textBox_Mods.Text);
        }

        private void radioButton_longMods_CheckedChanged(object sender, EventArgs e)
        {
            if (init) return;
            if (((RadioButton)sender).Checked)
            {
                _settings.Add("UseLongMods", radioButton_longMods.Checked);
            }
        }
    }
}

Make sure that beginInvoke target exists


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Anagrams.Models;

namespace Anagrams
{
	// Note: For instructions on enabling IIS6 or IIS7 classic mode,
	// visit http://go.microsoft.com/?LinkId=9394801

	public class MvcApplication : System.Web.HttpApplication
	{
		public static void RegisterGlobalFilters(GlobalFilterCollection filters)
		{
			filters.Add(new HandleErrorAttribute());
		}

		public static void RegisterRoutes(RouteCollection routes)
		{
			routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

			routes.MapRoute(
				"Default", // Route name
				"{controller}/{action}/{id}", // URL with parameters
				new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
			);

		}

		protected void Application_Start()
		{
			AreaRegistration.RegisterAllAreas();
			DictionaryCache.Reader = new DictionaryReader();
			RegisterGlobalFilters(GlobalFilters.Filters);
			RegisterRoutes(RouteTable.Routes);
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Anagrams.Models;

namespace Anagrams
{
	// Note: For instructions on enabling IIS6 or IIS7 classic mode,
	// visit http://go.microsoft.com/?LinkId=9394801

	public class MvcApplication : System.Web.HttpApplication
	{
		public static void RegisterGlobalFilters(GlobalFilterCollection filters)
		{
			filters.Add(new HandleErrorAttribute());
		}

		public static void RegisterRoutes(RouteCollection routes)
		{
			routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

			routes.MapRoute(
				"Default", // Route name
				"{controller}/{action}/{id}", // URL with parameters
				new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
			);

		}

		protected void Application_Start()
		{
			AreaRegistration.RegisterAllAreas();
			DictionaryCache.Reader = new DictionaryReader();
			RegisterGlobalFilters(GlobalFilters.Filters);
			RegisterRoutes(RouteTable.Routes);
			DictionaryCache.SetPath(HttpContext.Current.Server.MapPath(@"Content/wordlist.txt"));
		}
	}
}

Use API to override the location of the dictionary file in the dictionary cache from our Web applicatoin


using Avalonia.Data.Converters;
using Avalonia.Media;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using WalletWasabi.Gui.Controls.WalletExplorer;
using WalletWasabi.Gui.Models;
using WalletWasabi.Models.ChaumianCoinJoin;

namespace WalletWasabi.Gui.Converters
{
	public class CoinStatusForegroundConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			if (value is SmartCoinStatus status)
			{
				switch (status)
				{
					case SmartCoinStatus.MixingOutputRegistration:
					case SmartCoinStatus.MixingSigning:
					case SmartCoinStatus.MixingInputRegistration:
					case SmartCoinStatus.MixingOnWaitingList:
					case SmartCoinStatus.MixingWaitingForConfirmation: return Brushes.Black;
					default: return Brushes.White;
				}
			}
			throw new InvalidOperationException();
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotSupportedException();
		}
	}
}

using Avalonia.Data.Converters;
using Avalonia.Media;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using WalletWasabi.Gui.Controls.WalletExplorer;
using WalletWasabi.Gui.Models;
using WalletWasabi.Models.ChaumianCoinJoin;

namespace WalletWasabi.Gui.Converters
{
	public class CoinStatusForegroundConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			if (value is SmartCoinStatus status)
			{
				switch (status)
				{
					case SmartCoinStatus.MixingInputRegistration:
					case SmartCoinStatus.MixingOnWaitingList:
					case SmartCoinStatus.MixingWaitingForConfirmation: return Brushes.Black;
					default: return Brushes.White;
				}
			}
			throw new InvalidOperationException();
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotSupportedException();
		}
	}
}

Make round states foreground white

[skip ci] Make round states foreground white


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

namespace Mond.Libraries.Async
{
    internal class Scheduler : TaskScheduler
    {
        private List<Task> _tasks;

        public Scheduler()
        {
            _tasks = new List<Task>();
        }

        public void Run()
        {
            int count;

            lock (_tasks)
            {
                count = _tasks.Count;
            }

            if (count == 0)
                return;

            while (--count >= 0)
            {
                Task task;

                lock (_tasks)
                {
                    if (_tasks.Count == 0)
                        return;

                    task = _tasks[0];
                    _tasks.RemoveAt(0);
                }

                if (!TryExecuteTask(task))
                    _tasks.Add(task);
            }
        }

        protected override IEnumerable<Task> GetScheduledTasks()
        {
            lock (_tasks)
            {
                return _tasks.ToArray();
            }
        }

        protected override void QueueTask(Task task)
        {
            lock (_tasks)
            {
                _tasks.Add(task);
            }
        }

        protected override bool TryDequeue(Task task)
        {
            lock (_tasks)
            {
                return _tasks.Remove(task);
            }
        }

        protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
        {
            return false;
        }
    }
}

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

namespace Mond.Libraries.Async
{
    internal class Scheduler : TaskScheduler
    {
        private List<Task> _tasks;

        public Scheduler()
        {
            _tasks = new List<Task>();
        }

        public void Run()
        {
            int count;

            lock (_tasks)
            {
                count = _tasks.Count;
            }

            if (count == 0)
                return;

            while (--count >= 0)
            {
                Task task;

                lock (_tasks)
                {
                    if (_tasks.Count == 0)
                        return;

                    task = _tasks[0];
                    _tasks.RemoveAt(0);
                }

                if (TryExecuteTask(task))
                    continue;

                lock (_tasks)
                {
                    _tasks.Add(task);
                }
            }
        }

        protected override IEnumerable<Task> GetScheduledTasks()
        {
            lock (_tasks)
            {
                return _tasks.ToArray();
            }
        }

        protected override void QueueTask(Task task)
        {
            lock (_tasks)
            {
                _tasks.Add(task);
            }
        }

        protected override bool TryDequeue(Task task)
        {
            lock (_tasks)
            {
                return _tasks.Remove(task);
            }
        }

        protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
        {
            if (taskWasPreviouslyQueued)
            {
                if (TryDequeue(task))
                    return TryExecuteTask(task);

                return false;
            }

            return TryExecuteTask(task);
        }
    }
}

Fix async deadlock on Mono

Fix async deadlock on Mono


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("FreenetTray")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FreenetTray")]
[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("220ea49e-e109-4bb4-86c6-ef477f1584e7")]

// 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;
using System.Resources;

// 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("FreenetTray")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FreenetTray")]
[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("220ea49e-e109-4bb4-86c6-ef477f1584e7")]

// 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")]
[assembly: NeutralResourcesLanguageAttribute("en")]

Set neutral language to English

Set neutral language to English


using RimWorld;
using UnityEngine;

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

namespace MTW_AncestorSpirits
{
    public static class AncestorUtils
    {
        public static int DaysToTicks(float days)
        {
            return Mathf.RoundToInt(days * GenDate.TicksPerDay);
        }

        public static int HoursToTicks(float hours)
        {
            return Mathf.RoundToInt(hours * GenDate.TicksPerHour);
        }
    }
}

using Verse;
using RimWorld;
using UnityEngine;

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

namespace MTW_AncestorSpirits
{
    public static class AncestorUtils
    {
        public static int DaysToTicks(float days)
        {
            return Mathf.RoundToInt(days * GenDate.TicksPerDay);
        }

        public static int HoursToTicks(float hours)
        {
            return Mathf.RoundToInt(hours * GenDate.TicksPerHour);
        }

        public static long EstStartOfSeasonAt(long ticks)
        {
            var currentDayTicks = (int)(GenDate.CurrentDayPercent * GenDate.TicksPerDay);
            var dayOfSeason = GenDate.DayOfSeasonZeroBasedAt(ticks);
            var currentSeasonDayTicks = DaysToTicks(dayOfSeason);

            return ticks - currentDayTicks - currentSeasonDayTicks;
        }
    }
}

Add function to get start of season

Add function to get start of season


namespace Hypermedia.Client.Reader.ProblemJson
{
    using System;
    using System.Net.Http;

    using global::Hypermedia.Client.Exceptions;
    using global::Hypermedia.Client.Resolver;

    using Newtonsoft.Json;

    public static class ProblemJsonReader
    {
        public static bool TryReadProblemJson(HttpResponseMessage result, out ProblemDescription problemDescription)
        {
            problemDescription = null;
            if (result.Content == null)
            {
                return false;
            }

            try
            {
                var content = result.Content.ReadAsStringAsync().Result;
                problemDescription = JsonConvert.DeserializeObject<ProblemDescription>(content); // TODO inject deserializer
            }
            catch (Exception)
            {
                return false;
            }
            return true;
        }
    }
}

namespace Hypermedia.Client.Reader.ProblemJson
{
    using System;
    using System.Net.Http;

    using global::Hypermedia.Client.Exceptions;
    using global::Hypermedia.Client.Resolver;

    using Newtonsoft.Json;

    public static class ProblemJsonReader
    {
        public static bool TryReadProblemJson(HttpResponseMessage result, out ProblemDescription problemDescription)
        {
            problemDescription = null;
            if (result.Content == null)
            {
                return false;
            }

            try
            {
                var content = result.Content.ReadAsStringAsync().Result;
                problemDescription = JsonConvert.DeserializeObject<ProblemDescription>(content); // TODO inject deserializer
            }
            catch (Exception)
            {
                return false;
            }
            return problemDescription != null;
        }
    }
}

Fix TryReadProblemJson: ensure problem json could be read and an object was created


//
//  Program.cs
//
//  Author:
//       Benito Palacios Sánchez (aka pleonex) <benito356@gmail.com>
//
//  Copyright (c) 2015 Benito Palacios Sánchez (c) 2015
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
using System;
using Xwt;
using Deblocus.Views;

namespace Deblocus
{
    public static class Program
    {
        [STAThread]
        public static void Main()
        {
            Application.Initialize(ToolkitType.Gtk);

            var mainWindow = new MainWindow();
            mainWindow.Show();
            Application.Run();

            mainWindow.Dispose();
            Application.Dispose();
        }
    }
}

//
//  Program.cs
//
//  Author:
//       Benito Palacios Sánchez (aka pleonex) <benito356@gmail.com>
//
//  Copyright (c) 2015 Benito Palacios Sánchez (c) 2015
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
using System;
using Xwt;
using Deblocus.Views;

namespace Deblocus
{
    public static class Program
    {
        [STAThread]
        public static void Main()
        {
            Application.Initialize(ToolkitType.Gtk);
            Application.UnhandledException += ApplicationException;

            var mainWindow = new MainWindow();
            mainWindow.Show();
            Application.Run();

            mainWindow.Dispose();
            Application.Dispose();
        }

        private static void ApplicationException (object sender, ExceptionEventArgs e)
        {
            MessageDialog.ShowError("Unknown error. Please contact with the developer.\n" +
                e.ErrorException);
        }
    }
}

Add error message on exception

Add error message on exception


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("Recurly Client Library")]
[assembly: AssemblyDescription("Recurly makes subscription billing easy for .NET developers.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Recurly, Inc.")]
[assembly: AssemblyProduct("Recurly")]
[assembly: AssemblyCopyright("")]
[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("25932cc0-45c7-4db4-b8d5-dd172555522c")]

// 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.4.2.2")]
[assembly: AssemblyFileVersion("1.4.2.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("Recurly Client Library")]
[assembly: AssemblyDescription("Recurly makes subscription billing easy for .NET developers.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Recurly, Inc.")]
[assembly: AssemblyProduct("Recurly")]
[assembly: AssemblyCopyright("")]
[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("25932cc0-45c7-4db4-b8d5-dd172555522c")]

// 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.4.2.3")]
[assembly: AssemblyFileVersion("1.4.2.3")]

Increase client version to 1.4.2.3

Increase client version to 1.4.2.3


using System.Diagnostics;
using Sitecore.Configuration;
using Sitecore.DataBlaster.Load.Sql;

namespace Sitecore.DataBlaster.Load.Processors
{
    public class SyncHistoryTable : ISyncInTransaction
    {
        public void Process(BulkLoadContext loadContext, BulkLoadSqlContext sqlContext)
        {
            if (!loadContext.UpdateHistory.GetValueOrDefault()) return;
            if (loadContext.ItemChanges.Count == 0) return;

            // In Sitecore 9, history engine is disabled by default
            if (!HistoryEngineEnabled(loadContext))
            {
                loadContext.Log.Warn($"Skipped updating history because history engine is not enabled");
                return;
            }

            var stopwatch = Stopwatch.StartNew();

            var sql = sqlContext.GetEmbeddedSql(loadContext, "Sql.09.UpdateHistory.sql");
            sqlContext.ExecuteSql(sql,
                commandProcessor: cmd => cmd.Parameters.AddWithValue("@UserName", Sitecore.Context.User.Name));

            loadContext.Log.Info($"Updated history: {(int) stopwatch.Elapsed.TotalSeconds}s");
        }

        private bool HistoryEngineEnabled(BulkLoadContext context)
        {
            var db = Factory.GetDatabase(context.Database, true);
            return db.Engines.HistoryEngine.Storage != null;
        }
    }
}

using System.Diagnostics;
using Sitecore.Configuration;
using Sitecore.DataBlaster.Load.Sql;

namespace Sitecore.DataBlaster.Load.Processors
{
    public class SyncHistoryTable : ISyncInTransaction
    {
        public void Process(BulkLoadContext loadContext, BulkLoadSqlContext sqlContext)
        {
            if (!loadContext.UpdateHistory.GetValueOrDefault()) return;
            if (loadContext.ItemChanges.Count == 0) return;

            // In Sitecore 9, history engine is disabled by default
            if (!HistoryEngineEnabled(loadContext))
            {
                loadContext.Log.Info($"Skipped updating history because history engine is not enabled.");
                return;
            }

            var stopwatch = Stopwatch.StartNew();

            var sql = sqlContext.GetEmbeddedSql(loadContext, "Sql.09.UpdateHistory.sql");
            sqlContext.ExecuteSql(sql,
                commandProcessor: cmd => cmd.Parameters.AddWithValue("@UserName", Sitecore.Context.User.Name));

            loadContext.Log.Info($"Updated history: {(int) stopwatch.Elapsed.TotalSeconds}s");
        }

        private bool HistoryEngineEnabled(BulkLoadContext context)
        {
            var db = Factory.GetDatabase(context.Database, true);
            return db.Engines.HistoryEngine.Storage != null;
        }
    }
}

Change log lvl for history engine disable logging


using System.Collections.Generic;
using System.Drawing;
using System.IO;

namespace GUI.Utils
{
    internal static class Settings
    {
        public static List<string> GameSearchPaths { get; } = new List<string>();

        public static Color BackgroundColor { get; set; } = Color.Black;

        public static void Load()
        {
            // TODO: Be dumb about it for now.
            if (!File.Exists("gamepaths.txt"))
            {
                return;
            }

            GameSearchPaths.AddRange(File.ReadAllLines("gamepaths.txt"));
        }

        public static void Save()
        {
            File.WriteAllLines("gamepaths.txt", GameSearchPaths);
        }
    }
}

using System.Collections.Generic;
using System.Drawing;
using System.IO;

namespace GUI.Utils
{
    internal static class Settings
    {
        public static List<string> GameSearchPaths { get; } = new List<string>();

        public static Color BackgroundColor { get; set; }

        public static void Load()
        {
            BackgroundColor = Color.FromArgb(60, 60, 60);

            // TODO: Be dumb about it for now.
            if (!File.Exists("gamepaths.txt"))
            {
                return;
            }

            GameSearchPaths.AddRange(File.ReadAllLines("gamepaths.txt"));
        }

        public static void Save()
        {
            File.WriteAllLines("gamepaths.txt", GameSearchPaths);
        }
    }
}

Change default background color to be more grey


using System.Collections.Generic;
using System;

namespace MicroORM.Entity
{
    internal sealed class EntityInfo
    {
        internal EntityInfo()
        {
            this.EntityState = EntityState.None;
            this.EntityHashSet = new Dictionary<string, string>();
            this.LastCallTime = DateTime.Now;
        }

        internal bool CanBeRemoved { get { return DateTime.Now.Subtract(this.LastCallTime) > TimeSpan.FromMinutes(2); } }
        internal EntityState EntityState { get; set; }
        internal Dictionary<string, string> EntityHashSet { get; set; }
        internal DateTime LastCallTime { get; set; }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using MicroORM.Materialization;
using MicroORM.Reflection;
using MicroORM.Mapping;

namespace MicroORM.Entity
{
    internal sealed class EntityInfo
    {
        internal EntityInfo()
        {
            this.EntityState = EntityState.None;
            this.ValueSnapshot = new Dictionary<string, int>();
            this.ChangesSnapshot = new Dictionary<string, int>();
            this.LastCallTime = DateTime.Now;
        }

        internal bool CanBeRemoved { get { return DateTime.Now.Subtract(this.LastCallTime) > TimeSpan.FromMinutes(2); } }
        internal EntityState EntityState { get; set; }
        internal Dictionary<string, int> ValueSnapshot { get; set; }
        internal Dictionary<string, int> ChangesSnapshot { get; set; }
        internal DateTime LastCallTime { get; set; }

        internal void ClearChanges()
        {
            this.ChangesSnapshot.Clear();
        }

        internal void MergeChanges()
        {
            foreach (var change in this.ChangesSnapshot)
            {
                this.ValueSnapshot[change.Key] = change.Value;
            }
            ClearChanges();
        }

        internal void ComputeSnapshot<TEntity>(TEntity entity)
        {
            this.ValueSnapshot = EntityHashSetManager.ComputeEntityHashSet(entity);
        }

        internal KeyValuePair<string, object>[] ComputeUpdateValues<TEntity>(TEntity entity)
        {
            Dictionary<string, int> entityHashSet = EntityHashSetManager.ComputeEntityHashSet(entity);
            KeyValuePair<string, object>[] entityValues = RemoveUnusedPropertyValues<TEntity>(entity);

            Dictionary<string, object> valuesToUpdate = new Dictionary<string, object>();
            foreach (var kvp in entityHashSet)
            {
                var oldHash = this.ValueSnapshot[kvp.Key];
                if (oldHash.Equals(kvp.Value) == false)
                {
                    valuesToUpdate.Add(kvp.Key, entityValues.FirstOrDefault(kvp1 => kvp1.Key == kvp.Key).Value);
                    this.ChangesSnapshot.Add(kvp.Key, kvp.Value);
                }
            }

            return valuesToUpdate.ToArray();
        }

        private KeyValuePair<string, object>[] RemoveUnusedPropertyValues<TEntity>(TEntity entity)
        {
            KeyValuePair<string, object>[] entityValues = ParameterTypeDescriptor.ToKeyValuePairs(new object[] { entity });

            TableInfo tableInfo = TableInfo<TEntity>.GetTableInfo;
            return entityValues.Where(kvp => tableInfo.DbTable.DbColumns.Any(column => column.Name == kvp.Key)).ToArray();
        }
    }
}

Rollback functionality and hash computing

Added the functionality to compute the hash by himself and save or
rollback changes made to entity.


using System;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;

namespace Sawczyn.EFDesigner.EFModel
{
   internal static class Messages
   {
      private static readonly string MessagePaneTitle = "Entity Framework Designer";

      private static IVsOutputWindow _outputWindow;
      private static IVsOutputWindow OutputWindow => _outputWindow ?? (_outputWindow = Package.GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow);

      private static IVsOutputWindowPane _outputWindowPane;
      private static IVsOutputWindowPane OutputWindowPane
      {
         get
         {
            if (_outputWindowPane == null)
            {
               Guid paneGuid = new Guid(Constants.EFDesignerOutputPane);
               OutputWindow?.GetPane(ref paneGuid, out _outputWindowPane);

               if (_outputWindowPane == null)
               {
                  OutputWindow?.CreatePane(ref paneGuid, MessagePaneTitle, 1, 1);
                  OutputWindow?.GetPane(ref paneGuid, out _outputWindowPane);
               }
            }

            return _outputWindowPane;
         }
      }

      public static void AddError(string message)
      {
         OutputWindowPane?.OutputString($"Error: {message}");
         OutputWindowPane?.Activate();
      }

      public static void AddWarning(string message)
      {
         OutputWindowPane?.OutputString($"Warning: {message}");
         OutputWindowPane?.Activate();
      }

      public static void AddMessage(string message)
      {
         OutputWindowPane?.OutputString(message);
         OutputWindowPane?.Activate();
      }
   }
}

using System;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;

namespace Sawczyn.EFDesigner.EFModel
{
   internal static class Messages
   {
      private static readonly string MessagePaneTitle = "Entity Framework Designer";

      private static IVsOutputWindow _outputWindow;
      private static IVsOutputWindow OutputWindow => _outputWindow ?? (_outputWindow = Package.GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow);

      private static IVsOutputWindowPane _outputWindowPane;
      private static IVsOutputWindowPane OutputWindowPane
      {
         get
         {
            if (_outputWindowPane == null)
            {
               Guid paneGuid = new Guid(Constants.EFDesignerOutputPane);
               OutputWindow?.GetPane(ref paneGuid, out _outputWindowPane);

               if (_outputWindowPane == null)
               {
                  OutputWindow?.CreatePane(ref paneGuid, MessagePaneTitle, 1, 1);
                  OutputWindow?.GetPane(ref paneGuid, out _outputWindowPane);
               }
            }

            return _outputWindowPane;
         }
      }

      public static void AddError(string message)
      {
         AddMessage(message, "Error");
      }

      public static void AddWarning(string message)
      {
         AddMessage(message, "Warning");
      }

      public static void AddMessage(string message, string prefix = null)
      {
         OutputWindowPane?.OutputString($"{(string.IsNullOrWhiteSpace(prefix) ? "" : prefix + ": ")}{message}{(message.EndsWith("\n") ? "" : "\n")}");
         OutputWindowPane?.Activate();
      }
   }
}

Format for output window message changed


using System;
using System.Web;
using System.Web.Mvc;
using Orchard.DisplayManagement;
using Orchard.DisplayManagement.Descriptors;
using Orchard.Localization;
using Orchard.Mvc.Html;

namespace Orchard.Core.Common {
    public class Shapes : IShapeTableProvider {
        public Shapes() {
            T = NullLocalizer.Instance;
        }

        public Localizer T { get; set; }

        public void Discover(ShapeTableBuilder builder) {
            builder.Describe("Body_Editor")
                .OnDisplaying(displaying => {
                    string flavor = displaying.Shape.EditorFlavor;
                    displaying.ShapeMetadata.Alternates.Add("Body_Editor__" + flavor);
                });
        }

        [Shape]
        public IHtmlString PublishedState(dynamic Display, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc) {
            if (!publisheddateTimeUtc.HasValue) {
                return T("Draft");
            }

            return Display.DateTime(DateTimeUtc: createdDateTimeUtc);
        }

        [Shape]
        public IHtmlString PublishedWhen(dynamic Display, DateTime? dateTimeUtc) {
            if (dateTimeUtc == null)
                return T("as a Draft");

            return Display.DateTimeRelative(DateTimeUtc: dateTimeUtc);
        }
    }
}

using System;
using System.Web;
using System.Web.Mvc;
using Orchard.DisplayManagement;
using Orchard.DisplayManagement.Descriptors;
using Orchard.Localization;
using Orchard.Mvc.Html;

namespace Orchard.Core.Common {
    public class Shapes : IShapeTableProvider {
        public Shapes() {
            T = NullLocalizer.Instance;
        }

        public Localizer T { get; set; }

        public void Discover(ShapeTableBuilder builder) {
            builder.Describe("Body_Editor")
                .OnDisplaying(displaying => {
                    string flavor = displaying.Shape.EditorFlavor;
                    displaying.ShapeMetadata.Alternates.Add("Body_Editor__" + flavor);
                });
        }

        [Shape]
        public IHtmlString PublishedState(dynamic Display, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc, LocalizedString customDateFormat) {
            if (!publisheddateTimeUtc.HasValue) {
                return T("Draft");
            }

            return Display.DateTime(DateTimeUtc: createdDateTimeUtc, CustomFormat: customDateFormat);
        }

        [Shape]
        public IHtmlString PublishedWhen(dynamic Display, DateTime? dateTimeUtc) {
            if (dateTimeUtc == null)
                return T("as a Draft");

            return Display.DateTimeRelative(DateTimeUtc: dateTimeUtc);
        }
    }
}

Allow custom date format when displaying published state

Wen overriding the Parts.Common.Metadata.cshtml in a theme, this will allow for changing the date format used to display the date.


using Arduino;
using ArduinoWindowsRemoteControl.Repositories;
using Core.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArduinoWindowsRemoteControl.Services
{
    /// <summary>
    /// Service that returns parsers for different remote input devices
    /// </summary>
    public class RemoteCommandParserService
    {
        #region Private Fields

        private DictionaryRepository _dictionaryRepository;

        #endregion

        #region Constructor

        public RemoteCommandParserService()
        {
            _dictionaryRepository = new DictionaryRepository();
        }

        #endregion

        #region Public Methods

        public ArduinoRemoteCommandParser LoadArduinoCommandParser(string filename)
        {
            var dictionary = _dictionaryRepository.Load<int, RemoteCommand>(filename);

            return new ArduinoRemoteCommandParser(dictionary);
        }

        public void SaveArduinoCommandParser(ArduinoRemoteCommandParser commandParser, string filename)
        {

        }

        #endregion
    }
}

using Arduino;
using ArduinoWindowsRemoteControl.Repositories;
using Core.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArduinoWindowsRemoteControl.Services
{
    /// <summary>
    /// Service that returns parsers for different remote input devices
    /// </summary>
    public class RemoteCommandParserService
    {
        #region Private Fields

        private DictionaryRepository _dictionaryRepository;

        #endregion

        #region Constructor

        public RemoteCommandParserService()
        {
            _dictionaryRepository = new DictionaryRepository();
        }

        #endregion

        #region Public Methods

        public ArduinoRemoteCommandParser LoadArduinoCommandParser(string filename)
        {
            var dictionary = _dictionaryRepository.Load<int, RemoteCommand>(filename);

            return new ArduinoRemoteCommandParser(dictionary);
        }

        public void SaveArduinoCommandParser(ArduinoRemoteCommandParser commandParser, string filename)
        {
            _dictionaryRepository.Save(commandParser.CommandsMapping, filename);
        }

        #endregion
    }
}

Add ability to save commands mapping

Add ability to save commands mapping


// 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.Bindables;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;

namespace osu.Game.Rulesets.Osu.Objects
{
    /// <summary>
    /// Note that this should not be used for timing correctness.
    /// See <see cref="SliderEventType.LegacyLastTick"/> usage in <see cref="Slider"/> for more information.
    /// </summary>
    public class SliderTailCircle : SliderCircle
    {
        private readonly IBindable<int> pathVersion = new Bindable<int>();

        public SliderTailCircle(Slider slider)
        {
            pathVersion.BindTo(slider.Path.Version);
            pathVersion.BindValueChanged(_ => Position = slider.EndPosition);
        }

        protected override HitWindows CreateHitWindows() => HitWindows.Empty;

        public override Judgement CreateJudgement() => new SliderRepeat.SliderRepeatJudgement();
    }
}

// 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.Bindables;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Judgements;
using osu.Game.Rulesets.Scoring;

namespace osu.Game.Rulesets.Osu.Objects
{
    /// <summary>
    /// Note that this should not be used for timing correctness.
    /// See <see cref="SliderEventType.LegacyLastTick"/> usage in <see cref="Slider"/> for more information.
    /// </summary>
    public class SliderTailCircle : SliderCircle
    {
        private readonly IBindable<int> pathVersion = new Bindable<int>();

        public SliderTailCircle(Slider slider)
        {
            pathVersion.BindTo(slider.Path.Version);
            pathVersion.BindValueChanged(_ => Position = slider.EndPosition);
        }

        protected override HitWindows CreateHitWindows() => HitWindows.Empty;

        public override Judgement CreateJudgement() => new SliderTailJudgement();

        public class SliderTailJudgement : OsuJudgement
        {
            protected override int NumericResultFor(HitResult result) => 0;

            public override bool AffectsCombo => false;
        }
    }
}

Remove slider tail circle judgement requirements


// 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.Statistics;
using System;
using System.Collections.Generic;
using osu.Framework.Audio;

namespace osu.Framework.Threading
{
    public class AudioThread : GameThread
    {
        public AudioThread()
            : base(name: "Audio")
        {
            OnNewFrame = onNewFrame;
        }

        internal override IEnumerable<StatisticsCounterType> StatisticsCounters => new[]
        {
            StatisticsCounterType.TasksRun,
            StatisticsCounterType.Tracks,
            StatisticsCounterType.Samples,
            StatisticsCounterType.SChannels,
            StatisticsCounterType.Components,
        };

        private readonly List<AudioManager> managers = new List<AudioManager>();

        private void onNewFrame()
        {
            lock (managers)
            {
                for (var i = 0; i < managers.Count; i++)
                {
                    var m = managers[i];
                    m.Update();
                }
            }
        }

        public void RegisterManager(AudioManager manager)
        {
            lock (managers)
            {
                if (managers.Contains(manager))
                    throw new InvalidOperationException($"{manager} was already registered");

                managers.Add(manager);
            }
        }

        public void UnregisterManager(AudioManager manager)
        {
            lock (managers)
                managers.Remove(manager);
        }

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

            lock (managers)
            {
                // AudioManager's disposal triggers an un-registration
                while (managers.Count > 0)
                    managers[0].Dispose();
            }

            ManagedBass.Bass.Free();
        }
    }
}

// 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.Statistics;
using System;
using System.Collections.Generic;
using osu.Framework.Audio;

namespace osu.Framework.Threading
{
    public class AudioThread : GameThread
    {
        public AudioThread()
            : base(name: "Audio")
        {
            OnNewFrame = onNewFrame;
        }

        internal override IEnumerable<StatisticsCounterType> StatisticsCounters => new[]
        {
            StatisticsCounterType.TasksRun,
            StatisticsCounterType.Tracks,
            StatisticsCounterType.Samples,
            StatisticsCounterType.SChannels,
            StatisticsCounterType.Components,
        };

        private readonly List<AudioManager> managers = new List<AudioManager>();

        private void onNewFrame()
        {
            lock (managers)
            {
                for (var i = 0; i < managers.Count; i++)
                {
                    var m = managers[i];
                    m.Update();
                }
            }
        }

        public void RegisterManager(AudioManager manager)
        {
            lock (managers)
            {
                if (managers.Contains(manager))
                    throw new InvalidOperationException($"{manager} was already registered");

                managers.Add(manager);
            }
        }

        public void UnregisterManager(AudioManager manager)
        {
            lock (managers)
                managers.Remove(manager);
        }

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

            lock (managers)
            {
                foreach (var manager in managers)
                    manager.Dispose();
                managers.Clear();
            }

            ManagedBass.Bass.Free();
        }
    }
}

Fix audio thread not exiting correctly

Fix audio thread not exiting correctly


// <copyright file="RavenDBViewModelHelper.cs" company="Cognisant">
// Copyright (c) Cognisant. All rights reserved.
// </copyright>

namespace CR.ViewModels.Persistence.RavenDB
{
    /// <summary>
    /// Helper class used for code shared between <see cref="RavenDBViewModelReader"/> and <see cref="RavenDBViewModelWriter"/>.
    /// </summary>
    // ReSharper disable once InconsistentNaming
    internal static class RavenDBViewModelHelper
    {
        /// <summary>
        /// Helper method used to generate the ID of the RavenDB document that a view model of type TEntity with specified key should be stored.
        /// </summary>
        /// <typeparam name="TEntity">The type of the View Model.</typeparam>
        /// <param name="key">The key of the view model.</param>
        /// <returns>The ID of the RavenDB document.</returns>
        internal static string MakeId<TEntity>(string key) => $"{typeof(TEntity).FullName}/{key}";
    }
}

// <copyright file="RavenDBViewModelHelper.cs" company="Cognisant">
// Copyright (c) Cognisant. All rights reserved.
// </copyright>

namespace CR.ViewModels.Persistence.RavenDB
{
    /// <summary>
    /// Helper class used for code shared between <see cref="RavenDBViewModelReader"/> and <see cref="RavenDBViewModelWriter"/>.
    /// </summary>
    // ReSharper disable once InconsistentNaming
    internal static class RavenDBViewModelHelper
    {
        /// <summary>
        /// Helper method used to generate the ID of the RavenDB document that a view model of type TEntity with specified key should be stored.
        /// </summary>
        /// <typeparam name="TEntity">The type of the View Model.</typeparam>
        /// <param name="key">The key of the view model.</param>
        /// <returns>The ID of the RavenDB document.</returns>
        // ReSharper disable once InconsistentNaming
        internal static string MakeID<TEntity>(string key) => $"{typeof(TEntity).FullName}/{key}";
    }
}

Add missing changes for last commit

Add missing changes for last commit


@using CkanDotNet.Web.Models.Helpers

Comments

    Please enable JavaScript to view the comments powered by Disqus.

Add support for dynamic resizing of iframe when disqus forum loads


/*
 * Copyright (C) 2011 uhttpsharp project - http://github.com/raistlinthewiz/uhttpsharp
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

using System;
using uhttpsharp.Embedded;

namespace uhttpsharpdemo
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpServer.Instance.StartUp();
            Console.ReadLine();
        }
    }
}

/*
 * Copyright (C) 2011 uhttpsharp project - http://github.com/raistlinthewiz/uhttpsharp
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

using System;
using uhttpsharp.Embedded;

namespace uhttpsharpdemo
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpServer.Instance.Port = 8000;
            HttpServer.Instance.StartUp();
            Console.ReadLine();
        }
    }
}

Change the port to 8000 so we can run as non-admin.


namespace ExcelX.AddIn.Command
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using ExcelX.AddIn.Config;
    using Excel = Microsoft.Office.Interop.Excel;

    /// <summary>
    /// 「方眼紙」コマンド
    /// </summary>
    public class MakeGridCommand : ICommand
    {
        /// <summary>
        /// コマンドを実行します。
        /// </summary>
        public void Execute()
        {
            // グリッドサイズはピクセル指定
            var size = ConfigDocument.Current.Edit.Grid.Size;

            // ワークシートを取得
            var application = Globals.ThisAddIn.Application;
            Excel.Workbook book = application.ActiveWorkbook;
            Excel.Worksheet sheet = book.ActiveSheet;

            // すべてのセルサイズを同一に設定
            Excel.Range all = sheet.Cells;
            all.ColumnWidth = size * 0.118;
            all.RowHeight = size * 0.75;
        }
    }
}

namespace ExcelX.AddIn.Command
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using ExcelX.AddIn.Config;
    using Excel = Microsoft.Office.Interop.Excel;

    /// <summary>
    /// 「方眼紙」コマンド
    /// </summary>
    public class MakeGridCommand : ICommand
    {
        /// <summary>
        /// コマンドを実行します。
        /// </summary>
        public void Execute()
        {
            // グリッドサイズはピクセル指定
            var size = ConfigDocument.Current.Edit.Grid.Size;

            // ワークシートを取得
            var application = Globals.ThisAddIn.Application;
            Excel.Workbook book = application.ActiveWorkbook;
            Excel.Worksheet sheet = book.ActiveSheet;

            // 環境値の取得
            var cell = sheet.Range["A1"];
            double x1 = 10, x2 = 20, y1, y2, a, b;

            cell.ColumnWidth = x1;
            y1 = cell.Width;

            cell.ColumnWidth = x2;
            y2 = cell.Width;

            a = (y2 - y1) / (x2 - x1);
            b = y2 - (y2 - y1) / (x2 - x1) * x2;

            // すべてのセルサイズを同一に設定
            Excel.Range all = sheet.Cells;
            all.ColumnWidth = (size * 0.75 - b) / a;
            all.RowHeight = size * 0.75;
        }
    }
}

Fix dependency of environment gap

Fix dependency of environment gap


using System.Text.RegularExpressions;

namespace Sep.Git.Tfs
{
    public static class GitTfsConstants
    {
        public static readonly Regex Sha1 = new Regex("[a-f\\d]{40}", RegexOptions.IgnoreCase);
        public static readonly Regex Sha1Short = new Regex("[a-f\\d]{4,40}", RegexOptions.IgnoreCase);
        public static readonly Regex CommitRegex = new Regex("^commit (" + Sha1 + ")\\s*$");

        public const string DefaultRepositoryId = "default";

        // e.g. git-tfs-id: [http://team:8080/]$/sandbox;C123
        public const string TfsCommitInfoFormat = "git-tfs-id: [{0}]{1};C{2}";
        public static readonly Regex TfsCommitInfoRegex =
                new Regex("^\\s*" +
                          "git-tfs-id:\\s+" +
                          "\\[(?<url>.+)\\]" +
                          "(?<repository>.+);" +
                          "C(?<changeset>\\d+)" +
                          "\\s*$");
    }
}

using System.Text.RegularExpressions;

namespace Sep.Git.Tfs
{
    public static class GitTfsConstants
    {
        public static readonly Regex Sha1 = new Regex("[a-f\\d]{40}", RegexOptions.IgnoreCase);
        public static readonly Regex Sha1Short = new Regex("[a-f\\d]{4,40}", RegexOptions.IgnoreCase);
        public static readonly Regex CommitRegex = new Regex("^commit (" + Sha1 + ")\\s*$");

        public const string DefaultRepositoryId = "default";

        public const string GitTfsPrefix = "git-tfs";
        // e.g. git-tfs-id: [http://team:8080/]$/sandbox;C123
        public const string TfsCommitInfoFormat = "git-tfs-id: [{0}]{1};C{2}";
        public static readonly Regex TfsCommitInfoRegex =
                new Regex("^\\s*" +
                          GitTfsPrefix +
                          "-id:\\s+" +
                          "\\[(?<url>.+)\\]" +
                          "(?<repository>.+);" +
                          "C(?<changeset>\\d+)" +
                          "\\s*$");
    }
}

Create a prefix for Git-Tfs metadata

Create a prefix for Git-Tfs metadata


using VkNet.Utils;

namespace VkNet.Model
{
    /// <summary>
    /// Информация об аудиоальбоме.
    /// </summary>
    /// <remarks>
    /// Страница документации ВКонтакте <see href="http://vk.com/dev/audio.getAlbums"/>.
    /// </remarks>
    public class AudioAlbum
    {
        /// <summary>
        /// Идентификатор владельца альбома.
        /// </summary>
        public long? OwnerId { get; set; }

        /// <summary>
        /// Идентификатор альбома.
        /// </summary>
        public long? AlbumId { get; set; }

        /// <summary>
        /// Название альбома.
        /// </summary>
        public string Title { get; set; }

		#region Методы
		/// <summary>
		/// Разобрать из json.
		/// </summary>
		/// <param name="response">Ответ сервера.</param>
		/// <returns></returns>
		internal static AudioAlbum FromJson(VkResponse response)
		{
			var album = new AudioAlbum
			{
				OwnerId = response["owner_id"],
				AlbumId = response["id"],
				Title = response["title"]
			};

			return album;
		}

		#endregion
	}
}

using VkNet.Utils;

namespace VkNet.Model
{
    /// <summary>
    /// Информация об аудиоальбоме.
    /// </summary>
    /// <remarks>
    /// Страница документации ВКонтакте <see href="http://vk.com/dev/audio.getAlbums"/>.
    /// </remarks>
    public class AudioAlbum
    {
        /// <summary>
        /// Идентификатор владельца альбома.
        /// </summary>
        public long? OwnerId { get; set; }

        /// <summary>
        /// Идентификатор альбома.
        /// </summary>
        public long? AlbumId { get; set; }

        /// <summary>
        /// Название альбома.
        /// </summary>
        public string Title { get; set; }

		#region Методы
		/// <summary>
		/// Разобрать из json.
		/// </summary>
		/// <param name="response">Ответ сервера.</param>
		/// <returns></returns>
		internal static AudioAlbum FromJson(VkResponse response)
		{
			var album = new AudioAlbum
			{
				OwnerId = response["owner_id"],
				AlbumId = response["album_id"] ?? response["id"],
				Title = response["title"]
			};

			return album;
		}

		#endregion
	}
}

Add support for older versions API

Add support for older versions API


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

using NQuery.Syntax;

namespace NQuery.Authoring.Completion.Providers
{
    internal sealed class TypeCompletionProvider : ICompletionProvider
    {
        public IEnumerable<CompletionItem> GetItems(SemanticModel semanticModel, int position)
        {
            var syntaxTree = semanticModel.Compilation.SyntaxTree;
            var token = syntaxTree.Root.FindTokenOnLeft(position);
            var castExpression = token.Parent.AncestorsAndSelf()
                                             .OfType<CastExpressionSyntax>()
                                             .FirstOrDefault(c => c.AsKeyword.Span.End <= position);

            if (castExpression == null)
                return Enumerable.Empty<CompletionItem>();

            return from typeName in SyntaxFacts.GetTypeNames()
                   select GetCompletionItem(typeName);
        }

        private static CompletionItem GetCompletionItem(string typeName)
        {
            return new CompletionItem(typeName, typeName, typeName, NQueryGlyph.Type);
        }
    }
}

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

using NQuery.Syntax;

namespace NQuery.Authoring.Completion.Providers
{
    internal sealed class TypeCompletionProvider : ICompletionProvider
    {
        public IEnumerable<CompletionItem> GetItems(SemanticModel semanticModel, int position)
        {
            var syntaxTree = semanticModel.Compilation.SyntaxTree;
            var token = syntaxTree.Root.FindTokenOnLeft(position);
            var castExpression = token.Parent.AncestorsAndSelf()
                                             .OfType<CastExpressionSyntax>()
                                             .FirstOrDefault(c => !c.AsKeyword.IsMissing && c.AsKeyword.Span.End <= position);

            if (castExpression == null)
                return Enumerable.Empty<CompletionItem>();

            return from typeName in SyntaxFacts.GetTypeNames()
                   select GetCompletionItem(typeName);
        }

        private static CompletionItem GetCompletionItem(string typeName)
        {
            return new CompletionItem(typeName, typeName, typeName, NQueryGlyph.Type);
        }
    }
}

Fix handling of CAST in type completion provider

When we are in a CAST expression, we shouldn't return types unless the
position is after the AS keyword. This implies that the AS keyword must
exist.


using Microsoft.Office365.ReportingWebServiceClient.Utils;
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

namespace Microsoft.Office365.ReportingWebServiceClient
{
    /// <summary>
    ///  This is representing an object of the RWS Report returned
    /// </summary>
    public class ReportObject
    {
        protected Dictionary<string, string> properties = new Dictionary<string, string>();

        public DateTime Date
        {
            get;
            set;
        }

        public virtual void LoadFromXml(XmlNode node)
        {
            properties = new Dictionary<string, string>();
            foreach (XmlNode p in node)
            {
                string key = p.Name.Replace("d:", "");
                properties[key] = p.InnerText.ToString();
            }

            this.Date = StringUtil.TryParseDateTime(TryGetValue("Date"), DateTime.MinValue);
        }

        public string ConvertToXml()
        {
            string retval = null;
            StringBuilder sb = new StringBuilder();
            using (XmlWriter writer = XmlWriter.Create(sb, new XmlWriterSettings() { OmitXmlDeclaration = true }))
            {
                new XmlSerializer(this.GetType()).Serialize(writer, this);
            }
            retval = sb.ToString();

            return retval;
        }

        protected string TryGetValue(string key)
        {
            if (properties.ContainsKey(key))
            {
                return properties[key];
            }

            return null;
        }
    }
}

using Microsoft.Office365.ReportingWebServiceClient.Utils;
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

namespace Microsoft.Office365.ReportingWebServiceClient
{
    /// <summary>
    ///  This is representing an object of the RWS Report returned
    /// </summary>
    public class ReportObject
    {
        protected Dictionary<string, string> properties = new Dictionary<string, string>();

        // This is a Date property
        public DateTime Date
        {
            get;
            set;
        }

        public virtual void LoadFromXml(XmlNode node)
        {
            properties = new Dictionary<string, string>();
            foreach (XmlNode p in node)
            {
                string key = p.Name.Replace("d:", "");
                properties[key] = p.InnerText.ToString();
            }

            this.Date = StringUtil.TryParseDateTime(TryGetValue("Date"), DateTime.MinValue);
        }

        public string ConvertToXml()
        {
            string retval = null;
            StringBuilder sb = new StringBuilder();
            using (XmlWriter writer = XmlWriter.Create(sb, new XmlWriterSettings() { OmitXmlDeclaration = true }))
            {
                new XmlSerializer(this.GetType()).Serialize(writer, this);
            }
            retval = sb.ToString();

            return retval;
        }

        protected string TryGetValue(string key)
        {
            if (properties.ContainsKey(key))
            {
                return properties[key];
            }

            return null;
        }
    }
}

Test Commit for a GitHub from VS2015

Test Commit for a GitHub from VS2015


using System;
using System.Collections.Generic;
using System.Text;

namespace Csla.Test.LazyLoad
{
  [Serializable]
  public class AParent : Csla.BusinessBase<AParent>
  {
    private Guid _id;
    public Guid Id
    {
      get { return _id; }
      set
      {
        _id = value;
        PropertyHasChanged();
      }
    }

    private AChildList _children;
    public AChildList ChildList
    {
      get
      {
        if (_children == null)
        {
          _children = new AChildList();
          for (int count = 0; count < EditLevel; count++)
            ((Csla.Core.IUndoableObject)_children).CopyState(EditLevel);
        }
        return _children;
      }
    }

    public AChildList GetChildList()
    {
      return _children;
    }

    public int EditLevel
    {
      get { return base.EditLevel; }
    }

    protected override object GetIdValue()
    {
      return _id;
    }

    public AParent()
    {
      _id = Guid.NewGuid();
    }
  }
}

using System;
using System.Collections.Generic;
using System.Text;

namespace Csla.Test.LazyLoad
{
  [Serializable]
  public class AParent : Csla.BusinessBase<AParent>
  {
    private Guid _id;
    public Guid Id
    {
      get { return _id; }
      set
      {
        _id = value;
        PropertyHasChanged();
      }
    }

    private static PropertyInfo<AChildList> ChildListProperty =
      RegisterProperty<AChildList>(typeof(AParent), new PropertyInfo<AChildList>("ChildList", "Child list"));
    public AChildList ChildList
    {
      get
      {
        if (!FieldManager.FieldExists(ChildListProperty))
          LoadProperty<AChildList>(ChildListProperty, new AChildList());
        return GetProperty<AChildList>(ChildListProperty);
      }
    }

    //private AChildList _children;
    //public AChildList ChildList
    //{
    //  get
    //  {
    //    if (_children == null)
    //    {
    //      _children = new AChildList();
    //      for (int count = 0; count < EditLevel; count++)
    //        ((Csla.Core.IUndoableObject)_children).CopyState(EditLevel);
    //    }
    //    return _children;
    //  }
    //}

    public AChildList GetChildList()
    {
      if (FieldManager.FieldExists(ChildListProperty))
        return ReadProperty<AChildList>(ChildListProperty);
      else
        return null;
      //return _children;
    }

    public int EditLevel
    {
      get { return base.EditLevel; }
    }

    protected override object GetIdValue()
    {
      return _id;
    }

    public AParent()
    {
      _id = Guid.NewGuid();
    }
  }
}

Fix bug with n-level undo of child objects.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace ExoWeb.Templates.MicrosoftAjax
{
	/// <summary>
	/// Microsoft AJAX specific implementation of <see cref="ExoWeb.Templates.Page"/> that supports
	/// parsing and loading templates using the Microsoft AJAX syntax.
	/// </summary>
	internal class AjaxPage : Page
	{
		internal AjaxPage()
		{
			IsIE = HttpContext.Current != null && HttpContext.Current.Request.Browser.IsBrowser("IE");
		}

		int nextControlId;
		internal string NextControlId
		{
			get
			{
				return "exo" + nextControlId++;
			}
		}

		internal bool IsIE { get; private set; }

		public override ITemplate Parse(string name, string template)
		{
			return Template.Parse(name, template);
		}

		public override IEnumerable<ITemplate> ParseTemplates(string source, string template)
		{
			return Block.Parse(source, template).OfType<ITemplate>();
		}

		public override IEnumerable<ITemplate> LoadTemplates(string path)
		{
			return Template.Load(path).Cast<ITemplate>();
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace ExoWeb.Templates.MicrosoftAjax
{
	/// <summary>
	/// Microsoft AJAX specific implementation of <see cref="ExoWeb.Templates.Page"/> that supports
	/// parsing and loading templates using the Microsoft AJAX syntax.
	/// </summary>
	internal class AjaxPage : Page
	{
		internal AjaxPage()
		{
			IsIE = HttpContext.Current != null &&
			       (HttpContext.Current.Request.Browser.IsBrowser("IE") ||
			        (!string.IsNullOrEmpty(HttpContext.Current.Request.UserAgent) && HttpContext.Current.Request.UserAgent.Contains("Trident")));
		}

		int nextControlId;
		internal string NextControlId
		{
			get
			{
				return "exo" + nextControlId++;
			}
		}

		internal bool IsIE { get; private set; }

		public override ITemplate Parse(string name, string template)
		{
			return Template.Parse(name, template);
		}

		public override IEnumerable<ITemplate> ParseTemplates(string source, string template)
		{
			return Block.Parse(source, template).OfType<ITemplate>();
		}

		public override IEnumerable<ITemplate> LoadTemplates(string path)
		{
			return Template.Load(path).Cast<ITemplate>();
		}
	}
}

Check the user-agent string for "Trident" in order to identify IE11 as an IE browser. This is only needed for a workaround for comments within select elements in IE below version 10 and should be abandoned when possible.


using System;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.HttpSys;
using Microsoft.Extensions.Configuration;

namespace MusicStore
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            var config = new ConfigurationBuilder()
                .AddCommandLine(args)
                .AddEnvironmentVariables(prefix: "ASPNETCORE_")
                .Build();

            var builder = new WebHostBuilder()
                .UseConfiguration(config)
                .UseIISIntegration()
                .UseStartup("MusicStore");

            if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.HttpSys", System.StringComparison.Ordinal))
            {
                var environment = builder.GetSetting("environment") ??
                    Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");

                if (string.Equals(environment, "NtlmAuthentication", System.StringComparison.Ordinal))
                {
                    // Set up NTLM authentication for WebListener like below.
                    // For IIS and IISExpress: Use inetmgr to setup NTLM authentication on the application vDir or
                    // modify the applicationHost.config to enable NTLM.
                    builder.UseHttpSys(options =>
                    {
                        options.Authentication.Schemes = AuthenticationSchemes.NTLM;
                        options.Authentication.AllowAnonymous = false;
                    });
                }
                else
                {
                    builder.UseHttpSys();
                }
            }
            else
            {
                builder.UseKestrel();
            }

            var host = builder.Build();

            host.Run();
        }
    }
}

using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.HttpSys;
using Microsoft.Extensions.Configuration;

namespace MusicStore
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            var config = new ConfigurationBuilder()
                .AddCommandLine(args)
                .AddEnvironmentVariables(prefix: "ASPNETCORE_")
                .Build();

            var builder = new WebHostBuilder()
                .UseContentRoot(Directory.GetCurrentDirectory())
                .UseConfiguration(config)
                .UseIISIntegration()
                .UseStartup("MusicStore");

            if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.HttpSys", System.StringComparison.Ordinal))
            {
                var environment = builder.GetSetting("environment") ??
                    Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");

                if (string.Equals(environment, "NtlmAuthentication", System.StringComparison.Ordinal))
                {
                    // Set up NTLM authentication for WebListener like below.
                    // For IIS and IISExpress: Use inetmgr to setup NTLM authentication on the application vDir or
                    // modify the applicationHost.config to enable NTLM.
                    builder.UseHttpSys(options =>
                    {
                        options.Authentication.Schemes = AuthenticationSchemes.NTLM;
                        options.Authentication.AllowAnonymous = false;
                    });
                }
                else
                {
                    builder.UseHttpSys();
                }
            }
            else
            {
                builder.UseKestrel();
            }

            var host = builder.Build();

            host.Run();
        }
    }
}

Add missing call to set content root on WebHostBuilder


namespace Alexa.NET.Request.Type
{
    public class DefaultRequestTypeConverter : IRequestTypeConverter
    {
        public bool CanConvert(string requestType)
        {
            return requestType == "IntentRequest" || requestType == "LaunchRequest" || requestType == "SessionEndedRequest";
        }

        public Request Convert(string requestType)
        {
            switch (requestType)
            {
                case "IntentRequest":
                    return new IntentRequest();
                case "LaunchRequest":
                    return new LaunchRequest();
                case "SessionEndedRequest":
                    return new SessionEndedRequest();
                case "System.ExceptionEncountered":
                    return new SystemExceptionRequest();
            }
            return null;
        }
    }
}

namespace Alexa.NET.Request.Type
{
    public class DefaultRequestTypeConverter : IRequestTypeConverter
    {
        public bool CanConvert(string requestType)
        {
            return requestType == "IntentRequest" || requestType == "LaunchRequest" || requestType == "SessionEndedRequest" || requestType == "System.ExceptionEncountered";
        }

        public Request Convert(string requestType)
        {
            switch (requestType)
            {
                case "IntentRequest":
                    return new IntentRequest();
                case "LaunchRequest":
                    return new LaunchRequest();
                case "SessionEndedRequest":
                    return new SessionEndedRequest();
                case "System.ExceptionEncountered":
                    return new SystemExceptionRequest();
            }
            return null;
        }
    }
}

Update default converter to handle exception type


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

namespace Treehopper.Demos.SoftPwm
{
    class Program
    {
        static void Main(string[] args)
        {
            Run();
        }
        static TreehopperUsb board;
        static async void Run()
        {
            int pinNumber = 10;
            Console.Write("Looking for board...");
            board = await ConnectionService.Instance.GetFirstDeviceAsync();
            Console.WriteLine("Board found.");
            Console.WriteLine(String.Format("Connecting to {0} and starting SoftPwm on Pin{1}", board, pinNumber));
            await board.ConnectAsync();
            board[pinNumber].SoftPwm.Enabled = true;
            int step = 10;
            int rate = 25;
            while (true)
            {
                for (int i = 0; i < 256; i = i + step)
                {
                    board[pinNumber].SoftPwm.DutyCycle = i / 255.0;
                    await Task.Delay(rate);
                }
                for (int i = 255; i > 0; i = i - step)
                {
                    board[pinNumber].SoftPwm.DutyCycle = i / 255.0;
                    await Task.Delay(rate);
                }
            }
        }
    }
}

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

namespace Treehopper.Demos.SoftPwm
{
    class Program
    {
        static void Main(string[] args)
        {
            Run();
        }
        static TreehopperUsb board;
        static async void Run()
        {
            Console.Write("Looking for board...");
            board = await ConnectionService.Instance.GetFirstDeviceAsync();
            Console.WriteLine("Board found.");
            await board.ConnectAsync();
            var pin = board[1];

            pin.SoftPwm.Enabled = true;
            pin.SoftPwm.DutyCycle = 0.8;
            int step = 10;
            int rate = 25;
            while (true)
            {
                for (int i = 0; i < 256; i = i + step)
                {
                    pin.SoftPwm.DutyCycle = i / 255.0;
                    await Task.Delay(rate);
                }
                for (int i = 255; i > 0; i = i - step)
                {
                    pin.SoftPwm.DutyCycle = i / 255.0;
                    await Task.Delay(rate);
                }
            }
        }
    }
}

Use Pins, not ints. We ain't Arduino!

Use Pins, not ints. We ain't Arduino!


using ServiceStack.ServiceHost;
using Rainy.Db;
using ServiceStack.OrmLite;
using System;
using ServiceStack.Common.Web;

namespace Rainy.WebService.Admin
{
	[Route("/api/admin/status/","GET, OPTIONS",
	       Summary = "Get status information about the server.")]
	[AdminPasswordRequired]
	public class StatusRequest : IReturn<Status>
	{
	}

	public class StatusService : ServiceBase {

		public StatusService (IDbConnectionFactory fac) : base (fac)
		{
		}

		public Status Get (StatusRequest req)
		{
			var s = new Status ();
			s.Uptime = MainClass.Uptime;
			s.NumberOfRequests = MainClass.ServedRequests;

			// determine number of users
			using (var conn = connFactory.OpenDbConnection ()) {
				s.NumberOfUser = conn.Scalar<int>("SELECT COUNT(*) FROM DBUser");
				s.TotalNumberOfNotes = conn.Scalar<int>("SELECT COUNT(*) FROM DBNote");

				if (s.NumberOfUser > 0)
					s.AverageNotesPerUser = (float)s.TotalNumberOfNotes / (float)s.NumberOfUser;
			};
			return s;
		}
	}

	public class Status
	{
		public DateTime Uptime { get; set; }
		public int NumberOfUser { get; set; }
		public long NumberOfRequests { get; set; }
		public int TotalNumberOfNotes { get; set; }
		public float AverageNotesPerUser { get; set; }
	}
}

using ServiceStack.ServiceHost;
using Rainy.Db;
using ServiceStack.OrmLite;
using System;
using ServiceStack.Common.Web;
using Tomboy.Db;

namespace Rainy.WebService.Admin
{
	[Route("/api/admin/status/","GET, OPTIONS",
	       Summary = "Get status information about the server.")]
	[AdminPasswordRequired]
	public class StatusRequest : IReturn<Status>
	{
	}

	public class StatusService : ServiceBase {

		public StatusService (IDbConnectionFactory fac) : base (fac)
		{
		}

		public Status Get (StatusRequest req)
		{
			var s = new Status ();
			s.Uptime = MainClass.Uptime;
			s.NumberOfRequests = MainClass.ServedRequests;

			// determine number of users
			using (var conn = connFactory.OpenDbConnection ()) {
				s.NumberOfUser = (int)conn.Count<DBUser> ();
				s.TotalNumberOfNotes = (int)conn.Count<DBNote> ();

				if (s.NumberOfUser > 0)
					s.AverageNotesPerUser = (float)s.TotalNumberOfNotes / (float)s.NumberOfUser;
			};
			return s;
		}
	}

	public class Status
	{
		public DateTime Uptime { get; set; }
		public int NumberOfUser { get; set; }
		public long NumberOfRequests { get; set; }
		public int TotalNumberOfNotes { get; set; }
		public float AverageNotesPerUser { get; set; }
	}
}

Use ORM instead of open-coded SQL

Use ORM instead of open-coded SQL


using System;
using System.Net;
using System.Net.Sockets;

namespace Abc.Zebus.Util
{
    internal static class TcpUtil
    {
        public static int GetRandomUnusedPort()
        {
            var listener = new TcpListener(IPAddress.Any, 0);
            listener.Start();
            var port = ((IPEndPoint)listener.LocalEndpoint).Port;
            listener.Stop();
            return port;
        }

        public static bool IsPortUnused(int port)
        {
            var listener = new TcpListener(IPAddress.Any, port);
            try
            {
                listener.Start();
            }
            catch (Exception)
            {
                return false;
            }
            listener.Stop();
            return true;
        }
    }
}

using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;

namespace Abc.Zebus.Util
{
    internal static class TcpUtil
    {
        public static int GetRandomUnusedPort()
        {
            var listener = new TcpListener(IPAddress.Any, 0);
            listener.Start();
            var port = ((IPEndPoint)listener.LocalEndpoint).Port;
            listener.Stop();
            return port;
        }

        public static bool IsPortUnused(int port)
        {
            var ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties();
            var activeTcpListeners = ipGlobalProperties.GetActiveTcpListeners();
            return activeTcpListeners.All(endpoint => endpoint.Port != port);
        }
    }
}

Change IsPortUnused() implementation because of SO_REUSEPORT on Linux


using CommentEverythingCryptography.Encryption;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Twilio;

namespace CEComms.Communications.Twilio.User {
    public class Usage {
        public double GetUsageThisMonth() {
            IEncryptionProvider decryptor = EncryptionProviderFactory.CreateInstance(EncryptionProviderFactory.CryptographyMethod.AES);
            TwilioRestClient twilio = new TwilioRestClient(decryptor.Decrypt(UserProfile.ACCOUNT_SID_CIPHER), decryptor.Decrypt(UserProfile.AUTH_TOKEN_CIPHER));

            UsageResult totalPrice = twilio.ListUsage("totalprice", "ThisMonth");
            UsageRecord record = totalPrice.UsageRecords[0];
            return record.Usage;
        }

        public double GetSMSCountToday() {
            IEncryptionProvider decryptor = EncryptionProviderFactory.CreateInstance(EncryptionProviderFactory.CryptographyMethod.AES);
            TwilioRestClient twilio = new TwilioRestClient(decryptor.Decrypt(UserProfile.ACCOUNT_SID_CIPHER), decryptor.Decrypt(UserProfile.AUTH_TOKEN_CIPHER));

            UsageResult totalSent = twilio.ListUsage("sms", "Today");
            UsageRecord record = totalSent.UsageRecords[0];
            return record.Usage;
        }
    }
}

using CommentEverythingCryptography.Encryption;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Twilio;

namespace CEComms.Communications.Twilio.User {
    public class Usage {
        public decimal GetUsageThisMonth() {
            IEncryptionProvider decryptor = EncryptionProviderFactory.CreateInstance(EncryptionProviderFactory.CryptographyMethod.AES);
            TwilioRestClient twilio = new TwilioRestClient(decryptor.Decrypt(UserProfile.ACCOUNT_SID_CIPHER), decryptor.Decrypt(UserProfile.AUTH_TOKEN_CIPHER));

            UsageResult totalPrice = twilio.ListUsage("totalprice", "ThisMonth");
            UsageRecord record = totalPrice.UsageRecords[0];
            return (decimal) record.Usage;
        }

        public int GetSMSCountToday() {
            IEncryptionProvider decryptor = EncryptionProviderFactory.CreateInstance(EncryptionProviderFactory.CryptographyMethod.AES);
            TwilioRestClient twilio = new TwilioRestClient(decryptor.Decrypt(UserProfile.ACCOUNT_SID_CIPHER), decryptor.Decrypt(UserProfile.AUTH_TOKEN_CIPHER));

            UsageResult totalSent = twilio.ListUsage("sms", "Today");
            UsageRecord record = totalSent.UsageRecords[0];
            return (int) Math.Round(record.Usage);
        }
    }
}

Return int or decimal for usage stats

Return int or decimal for usage stats


using System;
using System.Collections.Generic;
using System.Text;

namespace osu.Game.Rulesets.Mods
{
    public interface IApplicableToAudio : IApplicableToTrack, IApplicableToSample
    {
    }
}

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

namespace osu.Game.Rulesets.Mods
{
    public interface IApplicableToAudio : IApplicableToTrack, IApplicableToSample
    {
    }
}

Add missing license header and remove unused usings


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

namespace Glimpse
{
    public class ReflectionDiscoverableCollection<T> : List<T>, IDiscoverableCollection<T>
    {
        private readonly ITypeService _typeService;

        public ReflectionDiscoverableCollection(ITypeService typeService)
        {
            _typeService = typeService;
            CoreLibarary = "Glimpse";
        }

        public string CoreLibarary { get; set; }

        public void Discover()
        {
            var instances = _typeService.Resolve<T>(CoreLibarary);

            AddRange(instances);
        }
    }
}

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

namespace Glimpse
{
    public class ReflectionDiscoverableCollection<T> : List<T>, IDiscoverableCollection<T>
    {
        private readonly ITypeService _typeService;

        public ReflectionDiscoverableCollection(ITypeService typeService)
        {
            _typeService = typeService;
            CoreLibarary = "Glimpse.Common";
        }

        public string CoreLibarary { get; set; }

        public void Discover()
        {
            var instances = _typeService.Resolve<T>(CoreLibarary);

            AddRange(instances);
        }
    }
}

Update root lib to Glimpse.Common

Update root lib to Glimpse.Common