using System.Collections.Generic;
using System.Linq;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using MongoDB.Bson;

namespace TIMEmSYSTEM.SemanticLogging.Mongo
{
    internal static class EventEntryExtensions
    {
        internal static BsonDocument AsBsonDocument(this EventEntry eventEntry)
        {
            var payload = eventEntry.Schema.Payload.Zip(eventEntry.Payload,
                (key, value) => new KeyValuePair<string, object>(key, value)).ToDictionary(x => x.Key, y => y.Value);
            var dictionary = new Dictionary<string, object>
            {
                {"event", eventEntry.EventId},
                {"message", eventEntry.FormattedMessage},
                {"timestamp", eventEntry.Timestamp.LocalDateTime},
                {"provider", eventEntry.ProviderId},
                {"activity", eventEntry.ActivityId},
                {"process", eventEntry.ProcessId},
                {"thread", eventEntry.ThreadId},
                {"level", (int) eventEntry.Schema.Level},
                {"task", (int) eventEntry.Schema.Task},
                {"ocode", (int) eventEntry.Schema.Opcode},
                {"keywords", (long) eventEntry.Schema.Keywords},
                {"payload", new BsonDocument(payload)}
            };
            return new BsonDocument(dictionary);
        }

        internal static BsonDocument[] AsBsonDocuments(this IEnumerable<EventEntry> eventEntries)
        {
            return eventEntries.Select(AsBsonDocument).ToArray();
        }
    }
}

using System.Collections.Generic;
using System.Linq;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using MongoDB.Bson;

namespace TIMEmSYSTEM.SemanticLogging.Mongo
{
    internal static class EventEntryExtensions
    {
        internal static BsonDocument AsBsonDocument(this EventEntry eventEntry)
        {
            var payload = eventEntry.Schema.Payload.Zip(eventEntry.Payload,
                (key, value) => new KeyValuePair<string, object>(key, value)).ToDictionary(x => x.Key, y => y.Value);
            var dictionary = new Dictionary<string, object>
            {
                {"event", eventEntry.EventId},
                {"message", eventEntry.FormattedMessage},
                {"timestamp", eventEntry.Timestamp.LocalDateTime},
                {"provider", eventEntry.ProviderId},
                {"activity", eventEntry.ActivityId},
                {"process", eventEntry.ProcessId},
                {"thread", eventEntry.ThreadId},
                {"level", (int) eventEntry.Schema.Level},
                {"keywords", (long) eventEntry.Schema.Keywords},
                {"payload", new BsonDocument(payload)}
            };
            return new BsonDocument(dictionary);
        }

        internal static BsonDocument[] AsBsonDocuments(this IEnumerable<EventEntry> eventEntries)
        {
            return eventEntries.Select(AsBsonDocument).ToArray();
        }
    }
}

Remove OpCode and Task from mapping

Remove OpCode and Task from mapping


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

namespace IdunnSql.Console
{
    [Verb("execute", HelpText = "Execute the permission checks defined in a file")]
    public class ExecuteOptions
    {
        [Option('s', "source", Required = true,
        HelpText = "Name of the file containing information about the permissions to check")]
        public string Source { get; set; }

        [Option('p', "principal", Required = false,
        HelpText = "Name of the principal to impersonate.")]
        public string Principal { get; set; }
    }
}

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

namespace IdunnSql.Console
{
    [Verb("execute", HelpText = "Execute the permission checks defined in a file")]
    public class ExecuteOptions
    {
        [Option('s', "source", Required = true,
        HelpText = "Name of the file containing information about the permissions to check")]
        public string Source { get; set; }

        [Option('p', "principal", Required = false,
        HelpText = "Name of the principal to impersonate.")]
        public string Principal { get; set; }

        [Option('o', "output", Required = false,
        HelpText = "Name of the file to redirect the output of the console.")]
        public string Output { get; set; }
    }
}

Add new option to redirect to output from command line


using System;
using System.IO;
using NuGet;

namespace NugetPackageTrimmer
{
	class Program
	{
		static void Main(string[] args)
		{
			var repoUrl = args.Length > 2 ? args[1] : "https://packages.nuget.org/api/v2";

			Console.WriteLine($"Checking if packages in [{args[0]}] exist in {repoUrl} and deleting any that dont need deploying...");

			var repo = PackageRepositoryFactory.Default.CreateRepository(repoUrl);

			foreach (var nupkg in Directory.EnumerateFiles(args[0], "*.nupkg"))
			{
				Console.WriteLine($"Checking nuget package : {nupkg}");
				var package = new ZipPackage(nupkg);

				if (repo.Exists(package))
				{
					Console.WriteLine("That package already exists, deleting...");
					File.Delete(nupkg);
				}
				else
				{
					Console.WriteLine("That package isnt in nuget yet, skipping...");
				}
			}
		}
	}
}

using System;
using System.Globalization;
using System.IO;
using NuGet;

namespace NugetPackageTrimmer
{
	class Program
	{
		static void Main(string[] args)
		{
			var repoUrl = args.Length > 3 ? args[2] : "https://packages.nuget.org/api/v2";

			Console.WriteLine($"Checking if packages in [{args[0]}] exist in {repoUrl} and deleting any that dont need deploying...");

			var repo = PackageRepositoryFactory.Default.CreateRepository(repoUrl);

			var packageServer = new PackageServer(repoUrl, "NuGet Command Line");
			packageServer.SendingRequest += (sender, e) =>
			{
				Console.WriteLine(String.Format(CultureInfo.CurrentCulture, "{0} {1}", e.Request.Method, e.Request.RequestUri));
			};

			foreach (var nupkg in Directory.EnumerateFiles(args[0], "*.nupkg"))
			{
				Console.WriteLine($"Checking nuget package : {nupkg}");
				var package = new OptimizedZipPackage(nupkg);

				if (repo.Exists(package))
				{
					Console.WriteLine("That package already exists, skipping...");
					File.Delete(nupkg);
				}
				else
				{
					Console.WriteLine("That package isnt in nuget yet, pushing...");
					// Push the package to the server
					var sourceUri = new Uri(repoUrl);

					packageServer.PushPackage(
						args[1],
						package,
						new FileInfo(nupkg).Length,
						Convert.ToInt32(new TimeSpan(0, 0, 1, 0, 0).TotalMilliseconds),
						false);
					Console.WriteLine("Pushed");
				}
			}
		}
	}
}

Deploy as well as trim

Deploy as well as trim


using Oxide.Core;

using UnityEngine;

namespace Oxide.Unity
{
    /// <summary>
    /// The main MonoBehaviour which calls OxideMod.OnFrame
    /// </summary>
    public class UnityScript : MonoBehaviour
    {
        public static GameObject Instance { get; private set; }

        public static void Create()
        {
            Instance = new GameObject("Oxide.Ext.Unity");
            Object.DontDestroyOnLoad(Instance);
            Instance.AddComponent<UnityScript>();
        }

        private OxideMod oxideMod;

        void Awake()
        {
            oxideMod = Interface.GetMod();
            Application.logMessageReceived += HandleException;
        }

        void Update()
        {
            oxideMod.OnFrame(Time.deltaTime);
        }

        void OnDestroy()
        {
            if (oxideMod.IsShuttingDown) return;
            oxideMod.LogWarning("The Oxide Unity Script was destroyed (creating a new instance)");
            oxideMod.NextTick(Create);
        }

        void HandleException(string message, string stack_trace, LogType type)
        {
            if (type == LogType.Exception && stack_trace.Contains("Oxide"))
                RemoteLogger.Exception(message, stack_trace);
        }
    }
}

using Oxide.Core;

using UnityEngine;

namespace Oxide.Unity
{
    /// <summary>
    /// The main MonoBehaviour which calls OxideMod.OnFrame
    /// </summary>
    public class UnityScript : MonoBehaviour
    {
        public static GameObject Instance { get; private set; }

        public static void Create()
        {
            Instance = new GameObject("Oxide.Ext.Unity");
            Object.DontDestroyOnLoad(Instance);
            Instance.AddComponent<UnityScript>();
        }

        private OxideMod oxideMod;

        void Awake()
        {
            oxideMod = Interface.GetMod();
            Application.RegisterLogCallback(HandleException);
        }

        void Update()
        {
            oxideMod.OnFrame(Time.deltaTime);
        }

        void OnDestroy()
        {
            if (oxideMod.IsShuttingDown) return;
            oxideMod.LogWarning("The Oxide Unity Script was destroyed (creating a new instance)");
            oxideMod.NextTick(Create);
        }

        void HandleException(string message, string stack_trace, LogType type)
        {
            if (type == LogType.Exception && stack_trace.Contains("Oxide"))
                RemoteLogger.Exception(message, stack_trace);
        }
    }
}

Use deprecated method for older Unity support


using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;

namespace BatteryCommander.Web.Migrations
{
    public partial class CanLogin : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<bool>(
                name: "CanLogin",
                table: "Soldiers",
                nullable: false,
                defaultValue: false);

            migrationBuilder.Sql("UPDATE dbo.Soldiers SET CanLogin = 1 WHERE CivilianEmail IS NOT NULL");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CanLogin",
                table: "Soldiers");
        }
    }
}

using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;

namespace BatteryCommander.Web.Migrations
{
    public partial class CanLogin : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<bool>(
                name: "CanLogin",
                table: "Soldiers",
                nullable: false,
                defaultValue: false);

            migrationBuilder.Sql("UPDATE Soldiers SET CanLogin = 1 WHERE CivilianEmail IS NOT NULL");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CanLogin",
                table: "Soldiers");
        }
    }
}

Tweak raw sql data update

Tweak raw sql data update


using System.Reflection;

[assembly: AssemblyVersion("3.1.0.0")]
[assembly: AssemblyFileVersion("3.1.0.0")]
//// [assembly: AssemblyInformationalVersion("3.1.0.0 Release")]

using System.Reflection;

[assembly: AssemblyVersion("5.0.0.0")]
[assembly: AssemblyFileVersion("5.0.0.0")]
//// [assembly: AssemblyInformationalVersion("3.1.0.0 Release")]

Set assembly version to 5.0.0.0

Set assembly version to 5.0.0.0


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CSharpViaTest.Collections.Annotations;
using CSharpViaTest.Collections.Helpers;
using Xunit;

namespace CSharpViaTest.Collections._30_MapReducePractices
{
    [SuperEasy]
    public class CountNumberOfWordsInMultipleTextFiles
    {
        #region Please modifies the code to pass the test

        // You can add additional functions for readability and performance considerations.

        static int CountNumberOfWords(IEnumerable<Stream> streams)
        {
            throw new NotImplementedException();
        }

        #endregion

        [Fact]
        public void should_count_number_of_words()
        {
            const int fileCount = 5;
            const int wordsInEachFile = 10;

            Stream[] streams = Enumerable
                .Repeat(0, fileCount)
                .Select(_ => TextStreamFactory.Create(wordsInEachFile))
                .ToArray();

            int count = CountNumberOfWords(streams);

            Assert.Equal(fileCount * wordsInEachFile, count);

            foreach (Stream stream in streams) { stream.Dispose(); }
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CSharpViaTest.Collections.Annotations;
using CSharpViaTest.Collections.Helpers;
using Xunit;

namespace CSharpViaTest.Collections._30_MapReducePractices
{
    [Medium]
    public class CountNumberOfWordsInMultipleTextFiles
    {
        #region Please modifies the code to pass the test

        // You can add additional functions for readability and performance considerations.

        static int CountNumberOfWords(IEnumerable<Stream> streams)
        {
            throw new NotImplementedException();
        }

        #endregion

        [Fact]
        public void should_count_number_of_words()
        {
            const int fileCount = 5;
            const int wordsInEachFile = 10;

            Stream[] streams = Enumerable
                .Repeat(0, fileCount)
                .Select(_ => TextStreamFactory.Create(wordsInEachFile))
                .ToArray();

            int count = CountNumberOfWords(streams);

            Assert.Equal(fileCount * wordsInEachFile, count);

            foreach (Stream stream in streams) { stream.Dispose(); }
        }
    }
}

Change count word to medium level.

[liuxia] Change count word to medium level.


using System;

namespace IvionWebSoft
{
    public abstract class WebResource
    {
        public Uri Location { get; private set; }
        public bool Success { get; private set; }
        public Exception Exception { get; private set; }

        public WebResource(Uri uri)
        {
            if (uri == null)
                throw new ArgumentNullException("uri");

            Location = uri;
            Success = true;
            Exception = null;
        }

        public WebResource(Exception ex) : this(null, ex) {}

        public WebResource(Uri uri, Exception ex)
        {
            if (ex == null)
                throw new ArgumentNullException("ex");

            Location = uri;
            Success = false;
            Exception = ex;
        }

        public WebResource(WebResource resource)
        {
            if (resource == null)
                throw new ArgumentNullException("resource");

            Location = resource.Location;
            Success = resource.Success;
            Exception = resource.Exception;
        }
    }
}

using System;
using System.Net;

namespace IvionWebSoft
{
    public abstract class WebResource
    {
        public Uri Location { get; private set; }
        public bool Success { get; private set; }
        public Exception Exception { get; private set; }

        public WebResource(Uri uri)
        {
            if (uri == null)
                throw new ArgumentNullException("uri");

            Location = uri;
            Success = true;
            Exception = null;
        }

        public WebResource(Exception ex) : this(null, ex) {}

        public WebResource(Uri uri, Exception ex)
        {
            if (ex == null)
                throw new ArgumentNullException("ex");

            Location = uri;
            Success = false;
            Exception = ex;
        }

        public WebResource(WebResource resource)
        {
            if (resource == null)
                throw new ArgumentNullException("resource");

            Location = resource.Location;
            Success = resource.Success;
            Exception = resource.Exception;
        }

        public bool TryGetHttpError(out HttpStatusCode error)
        {
            var webEx = Exception as WebException;
            if (webEx != null && webEx.Status == WebExceptionStatus.ProtocolError)
            {
                var resp = webEx.Response as HttpWebResponse;
                if (resp != null)
                {
                    error = resp.StatusCode;
                    return true;
                }
            }

            error = default(HttpStatusCode);
            return false;
        }

        public bool HttpErrorIs(HttpStatusCode error)
        {
            HttpStatusCode status;
            if (TryGetHttpError(out status))
                return status == error;

            return false;
        }
    }
}

Add way to get HTTP error code

IvionWebSoft: Add way to get HTTP error code

Extend WebResource base class so that all subclasses (and their users)
have a way to get at the potential HTTP error code.


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

namespace SettingsAPISample.Models
{
    public class ARMListEntry<T> where T : INamedObject
    {
        public static ARMListEntry<T> Create(IEnumerable<T> objects, HttpRequestMessage request)
        {
            return new ARMListEntry<T>
            {
                Value = CreateList(objects, request)
            };
        }

        private static IEnumerable<ARMEntry<T>> CreateList(IEnumerable<T> objects, HttpRequestMessage request)
        {
            foreach (var entry in objects)
            {
                yield return ARMEntry<T>.Create(entry, request, isChild: true);
            }
        }

        public IEnumerable<ARMEntry<T>> Value { get; set; }
    }
}

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

namespace SettingsAPISample.Models
{
    public class ARMListEntry<T> where T : INamedObject
    {
        public static ARMListEntry<T> Create(IEnumerable<T> objects, HttpRequestMessage request)
        {
            return new ARMListEntry<T>
            {
                Value = objects.Select(entry => ARMEntry<T>.Create(entry, request, isChild: true))
            };
        }
        public IEnumerable<ARMEntry<T>> Value { get; set; }
    }
}

Use linq to simplify enumeration

Use linq to simplify enumeration


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("ElmahExtensions")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomErrorSignal")]
[assembly: AssemblyCopyright("Copyright ©  2013")]
[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("5ffd977a-b2cf-4f08-a7f9-c5fc0fd3e5c1")]

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

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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ElmahExtensions")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomErrorSignal")]
[assembly: AssemblyCopyright("Copyright ©  2013")]
[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("5ffd977a-b2cf-4f08-a7f9-c5fc0fd3e5c1")]

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

Align with Nuget Package Version 1.0.7

Align with Nuget Package Version 1.0.7


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

using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Screens.Ranking.Expanded;

namespace osu.Game.Tests.Visual.Ranking
{
    public class TestSceneStarRatingDisplay : OsuTestScene
    {
        [SetUp]
        public void SetUp() => Schedule(() =>
        {
            StarRatingDisplay changingStarRating;

            Child = new FillFlowContainer
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Children = new Drawable[]
                {
                    new StarRatingDisplay(new StarDifficulty(1.23, 0)),
                    new StarRatingDisplay(new StarDifficulty(2.34, 0)),
                    new StarRatingDisplay(new StarDifficulty(3.45, 0)),
                    new StarRatingDisplay(new StarDifficulty(4.56, 0)),
                    new StarRatingDisplay(new StarDifficulty(5.67, 0)),
                    new StarRatingDisplay(new StarDifficulty(6.78, 0)),
                    new StarRatingDisplay(new StarDifficulty(10.11, 0)),
                    changingStarRating = new StarRatingDisplay(),
                }
            };

            Scheduler.AddDelayed(() =>
            {
                changingStarRating.Current.Value = new StarDifficulty(RNG.NextDouble(0, 10), RNG.Next());
            }, 500, true);
        });
    }
}

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

using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Screens.Ranking.Expanded;

namespace osu.Game.Tests.Visual.Ranking
{
    public class TestSceneStarRatingDisplay : OsuTestScene
    {
        [Test]
        public void TestDisplay()
        {
            StarRatingDisplay changingStarRating = null;

            AddStep("load displays", () => Child = new FillFlowContainer
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Children = new Drawable[]
                {
                    new StarRatingDisplay(new StarDifficulty(1.23, 0)),
                    new StarRatingDisplay(new StarDifficulty(2.34, 0)),
                    new StarRatingDisplay(new StarDifficulty(3.45, 0)),
                    new StarRatingDisplay(new StarDifficulty(4.56, 0)),
                    new StarRatingDisplay(new StarDifficulty(5.67, 0)),
                    new StarRatingDisplay(new StarDifficulty(6.78, 0)),
                    new StarRatingDisplay(new StarDifficulty(10.11, 0)),
                    changingStarRating = new StarRatingDisplay(),
                }
            });

            AddRepeatStep("change bottom rating", () =>
            {
                changingStarRating.Current.Value = new StarDifficulty(RNG.NextDouble(0, 10), RNG.Next());
            }, 10);
        }
    }
}

Use regular test steps rather than one-time set up and scheduling


//-----------------------------------------------------------------------
// <copyright file="HttpVerb.cs" company="Bremus Solutions">
//     Copyright (c) Bremus Solutions. All rights reserved.
// </copyright>
// <author>Timm Bremus</author>
// <license>
//      Licensed to the Apache Software Foundation(ASF) under one
//      or more contributor license agreements.See the NOTICE file
//      distributed with this work for additional information
//      regarding copyright ownership.The ASF licenses this file
//      to you under the Apache License, Version 2.0 (the
//      "License"); you may not use this file except in compliance
//      with the License.  You may obtain a copy of the License at
//
//        http://www.apache.org/licenses/LICENSE-2.0
//
//      Unless required by applicable law or agreed to in writing,
//      software distributed under the License is distributed on an
//      "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
//      KIND, either express or implied.  See the License for the
//      specific language governing permissions and limitations
//      under the License.
// </license>
//-----------------------------------------------------------------------
namespace BSolutions.Brecons.Core.Enumerations
{
    using BSolutions.Brecons.Core.Attributes.Enumerations;

    public enum HttpVerb
    {
        [EnumInfo("get")]
        Get,

        [EnumInfo("Post")]
        Post,

        [EnumInfo("Put")]
        Put,

        [EnumInfo("Delete")]
        Delete
    }
}

//-----------------------------------------------------------------------
// <copyright file="HttpVerb.cs" company="Bremus Solutions">
//     Copyright (c) Bremus Solutions. All rights reserved.
// </copyright>
// <author>Timm Bremus</author>
// <license>
//      Licensed to the Apache Software Foundation(ASF) under one
//      or more contributor license agreements.See the NOTICE file
//      distributed with this work for additional information
//      regarding copyright ownership.The ASF licenses this file
//      to you under the Apache License, Version 2.0 (the
//      "License"); you may not use this file except in compliance
//      with the License.  You may obtain a copy of the License at
//
//        http://www.apache.org/licenses/LICENSE-2.0
//
//      Unless required by applicable law or agreed to in writing,
//      software distributed under the License is distributed on an
//      "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
//      KIND, either express or implied.  See the License for the
//      specific language governing permissions and limitations
//      under the License.
// </license>
//-----------------------------------------------------------------------
namespace BSolutions.Brecons.Core.Enumerations
{
    using BSolutions.Brecons.Core.Attributes.Enumerations;

    public enum HttpVerb
    {
        [EnumInfo("GET")]
        Get,

        [EnumInfo("POST")]
        Post,

        [EnumInfo("PUT")]
        Put,

        [EnumInfo("DELETE")]
        Delete
    }
}

Correct names for http verbs

Correct names for http verbs


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

namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
{
    public class Scope
    {
        /// <summary>
        /// Gets or sets the name of the scope (as such 'Arguments', 'Locals')
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the variables of this scope can be retrieved by passing the
        /// value of variablesReference to the VariablesRequest.
        /// </summary>
        public int VariablesReference { get; set; }

        /// <summary>
        /// Gets or sets a boolean value indicating if number of variables in
        /// this scope is large or expensive to retrieve.
        /// </summary>
        public bool Expensive { get; set; }

        public static Scope Create(VariableScope scope)
        {
            return new Scope {
                Name = scope.Name,
                VariablesReference = scope.Id,
                // Temporary fix for #95 to get debug hover tips to work well at least for the local scope.
                Expensive = (scope.Name != VariableContainerDetails.LocalScopeName)
            };
        }
    }
}

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

namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
{
    public class Scope
    {
        /// <summary>
        /// Gets or sets the name of the scope (as such 'Arguments', 'Locals')
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the variables of this scope can be retrieved by passing the
        /// value of variablesReference to the VariablesRequest.
        /// </summary>
        public int VariablesReference { get; set; }

        /// <summary>
        /// Gets or sets a boolean value indicating if number of variables in
        /// this scope is large or expensive to retrieve.
        /// </summary>
        public bool Expensive { get; set; }

        public static Scope Create(VariableScope scope)
        {
            return new Scope {
                Name = scope.Name,
                VariablesReference = scope.Id,
                // Temporary fix for #95 to get debug hover tips to work well at least for the local scope.
                Expensive = ((scope.Name != VariableContainerDetails.LocalScopeName) &&
                             (scope.Name != VariableContainerDetails.AutoVariablesName))
            };
        }
    }
}

Mark the "Auto" variable scope as not expensive

This change causes the "Auto" variable scope to be marked as not
'expensive' in the VS Code debug protocol so that it is always expanded by
default in VS Code's debug client UI.


using System.Collections.Generic;

namespace NetIRC.Messages
{
    public class NoticeMessage : IRCMessage, IServerMessage, IClientMessage
    {
        public string From { get; }
        public string Target { get; }
        public string Message { get; }

        public NoticeMessage(ParsedIRCMessage parsedMessage)
        {
            From = parsedMessage.Prefix.From;
            Target = parsedMessage.Parameters[0];
            Message = parsedMessage.Trailing;
        }

        public NoticeMessage(string target, string text)
        {
            Target = target;
            Message = text;
        }

        public IEnumerable<string> Tokens => new[] { "NOTICE", Target, Message };
    }
}

using System.Collections.Generic;

namespace NetIRC.Messages
{
    public class NoticeMessage : IRCMessage, IServerMessage, IClientMessage
    {
        public string From { get; }
        public string Target { get; }
        public string Message { get; }

        public NoticeMessage(ParsedIRCMessage parsedMessage)
        {
            From = parsedMessage.Prefix.From;
            Target = parsedMessage.Parameters[0];
            Message = parsedMessage.Trailing;
        }

        public NoticeMessage(string target, string text)
        {
            Target = target;
            Message = text;
        }

        public bool IsChannelMessage => Target[0] == '#';

        public IEnumerable<string> Tokens => new[] { "NOTICE", Target, Message };
    }
}

Add property to identity a Channel Notice


using UnityEngine;
using System.Collections;
using ATP.AnimationPathTools;

[ExecuteInEditMode]
public class AnimationPathCurvesDebug : MonoBehaviour {

    private AnimationPathAnimator animator;
    [Header("Rotation curves")]
    public AnimationCurve curveX;
    public AnimationCurve curveY;
    public AnimationCurve curveZ;

    [Header("Ease curve")]
    public AnimationCurve easeCurve;

    // Use this for initialization
    void Awake() {
    }

    void OnEnable() {
        animator = GetComponent<AnimationPathAnimator>();

        curveX = animator.RotationCurves[0];
        curveY = animator.RotationCurves[1];
        curveZ = animator.RotationCurves[2];
        easeCurve = animator.EaseCurve;
    }

    void Start() {

    }

    // Update is called once per frame
    void Update() {
    }
}

using UnityEngine;
using System.Collections;
using ATP.AnimationPathTools;

[ExecuteInEditMode]
public class AnimationPathCurvesDebug : MonoBehaviour {

    private AnimationPathAnimator animator;
    private AnimationPath animationPath;

    [Header("Animation Path")]
    public AnimationCurve pathCurveX;
    public AnimationCurve pathCurveY;
    public AnimationCurve pathCurveZ;

    [Header("Rotation curves")]
    public AnimationCurve rotationCurveX;
    public AnimationCurve rotationCurveY;
    public AnimationCurve rotationCurveZ;

    [Header("Ease curve")]
    public AnimationCurve easeCurve;

    // Use this for initialization
    void Awake() {
    }

    void OnEnable() {
        animator = GetComponent<AnimationPathAnimator>();
        animationPath = GetComponent<AnimationPath>();

        rotationCurveX = animator.RotationCurves[0];
        rotationCurveY = animator.RotationCurves[1];
        rotationCurveZ = animator.RotationCurves[2];

        pathCurveX = animationPath.AnimationCurves[0];
        pathCurveY = animationPath.AnimationCurves[1];
        pathCurveZ = animationPath.AnimationCurves[2];

        easeCurve = animator.EaseCurve;
    }

    void Start() {

    }

    // Update is called once per frame
    void Update() {
    }
}

Add animation path curves to the debug component


// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details

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

//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bus IPC protocol library and CLR binding")]
[assembly: AssemblyCopyright ("Copyright (C) Alp Toker")]
[assembly: AssemblyCompany ("NDesk")]

[assembly: InternalsVisibleTo ("NDesk.DBus.GLib, PublicKey=0024000004800000440000000602000000240000525341318001000011000000ffbfaa640454654de78297fde2d22dd4bc4b0476fa892c3f8575ad4f048ce0721ce4109f542936083bc4dd83be5f7f97")]
//[assembly: InternalsVisibleTo ("dbus-monitor")]
//[assembly: InternalsVisibleTo ("dbus-daemon")]

// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details

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

//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bus IPC protocol library and CLR binding")]
[assembly: AssemblyCopyright ("Copyright (C) Alp Toker")]
[assembly: AssemblyCompany ("NDesk")]

[assembly: InternalsVisibleTo ("dbus-monitor, PublicKey=0024000004800000440000000602000000240000525341318001000011000000ffbfaa640454654de78297fde2d22dd4bc4b0476fa892c3f8575ad4f048ce0721ce4109f542936083bc4dd83be5f7f97")]
[assembly: InternalsVisibleTo ("NDesk.DBus.GLib, PublicKey=0024000004800000440000000602000000240000525341318001000011000000ffbfaa640454654de78297fde2d22dd4bc4b0476fa892c3f8575ad4f048ce0721ce4109f542936083bc4dd83be5f7f97")]

Make the monitor tool build again

Make the monitor tool build again


using Orchard.Localization;
using Orchard.UI.Navigation;
using OShop.Permissions;

namespace OShop.PayPal.Navigation {
    public class AdminMenu : INavigationProvider {
        public Localizer T { get; set; }

        public AdminMenu() {
            T = NullLocalizer.Instance;
        }

        public string MenuName { get { return "admin"; } }

        public void GetNavigation(NavigationBuilder builder) {
            builder
                .AddImageSet("oshop")
                .Add(menu => menu
                    .Caption(T("OShop"))
                    .Add(subMenu => subMenu
                        .Caption(T("Settings"))
                        .Add(tab => tab
                            .Caption(T("PayPal"))
                            .Position("7")
                            .Action("Settings", "Admin", new { area = "OShop.PayPal" })
                            .Permission(OShopPermissions.ManageShopSettings)
                            .LocalNav()
                        )
                    )
                );
        }
    }
}

using Orchard.Localization;
using Orchard.UI.Navigation;
using OShop.Permissions;

namespace OShop.PayPal.Navigation {
    public class AdminMenu : INavigationProvider {
        public Localizer T { get; set; }

        public AdminMenu() {
            T = NullLocalizer.Instance;
        }

        public string MenuName { get { return "admin"; } }

        public void GetNavigation(NavigationBuilder builder) {
            builder
                .AddImageSet("oshop")
                .Add(menu => menu
                    .Caption(T("OShop"))
                    .Add(subMenu => subMenu
                        .Caption(T("Settings"))
                        .Add(tab => tab
                            .Caption(T("PayPal"))
                            .Position("7.1")
                            .Action("Settings", "Admin", new { area = "OShop.PayPal" })
                            .Permission(OShopPermissions.ManageShopSettings)
                            .LocalNav()
                        )
                    )
                );
        }
    }
}

Move Settings tab just after OfflinePayment settings


using ImageSharp;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;

namespace CollAction.ValidationAttributes
{
    public class MaxImageDimensionsAttribute : ValidationAttribute
    {
        private readonly int _maxWidth;
        private readonly int _maxHeight;

        public MaxImageDimensionsAttribute(int width, int height)
        {
            _maxWidth = width;
            _maxHeight = height;
        }

        public override bool IsValid(object value)
        {
            if (value == null) return true;
            using (Stream imageStream = (value as IFormFile).OpenReadStream())
            {
                using (MemoryStream ms = new MemoryStream())
                {
                    imageStream.CopyTo(ms);
                    using (Image image = Image.Load(ms.ToArray()))
                    {
                        return image.Width <= _maxWidth && image.Height <= _maxHeight;
                    }
                }
            }
        }

        public override string FormatErrorMessage(string name)
        {
            return string.Format("Only images with dimensions of or smaller than {0}x{1}px are accepted.", _maxWidth, _maxHeight);
        }
    }
}

using ImageSharp;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;

namespace CollAction.ValidationAttributes
{
    public class MaxImageDimensionsAttribute : ValidationAttribute
    {
        private readonly int _maxWidth;
        private readonly int _maxHeight;

        public MaxImageDimensionsAttribute(int width, int height)
        {
            _maxWidth = width;
            _maxHeight = height;
        }

        public override bool IsValid(object value)
        {
            if (value == null) return true;
            using (Stream imageStream = (value as IFormFile).OpenReadStream())
            {
                using (MemoryStream ms = new MemoryStream())
                {
                    imageStream.CopyTo(ms);
                    try
                    {
                        using (Image image = Image.Load(ms.ToArray()))
                        {
                            return image.Width <= _maxWidth && image.Height <= _maxHeight;
                        }
                    }
                    catch (NotSupportedException)
                    {
                        return false;
                    }
                }
            }
        }

        public override string FormatErrorMessage(string name)
        {
            return string.Format("Only images with dimensions of or smaller than {0}x{1}px are accepted.", _maxWidth, _maxHeight);
        }
    }
}

Check if image is supported before uploading in the validation tag


using System;
using System.Threading;
using System.Threading.Tasks;

namespace UKahoot {
	class MainClass {
		public static string[] Hosts = {
			"tokenserver.ukahoot.it"
		};
		public static int Port = 5556;
		public static TokenServer ts;
		public static void Main(string[] args) {
			ts = new TokenServer(Hosts, Port);
			ts.Init();

			Console.WriteLine("Token server started.");
			Console.WriteLine("Port: " + Port);
			Console.WriteLine("Hosts: " + Hosts.Length);
			Console.WriteLine("Press any key to terminate the server.");
			Console.ReadKey();
			return;
		}
	}
}

using System;
using System.Threading;
using System.Threading.Tasks;

namespace UKahoot {
	class MainClass {
		public static string[] Hosts = {
			"tokenserver.ukahoot.it",
			"http://tokenserver.ukahoot.it",
			"https://tokenserver.ukahoot.it",
			"http://www.tokenserver.ukahoot.it",
			"https://www.tokenserver.ukahoot.it"
		};
		public static int Port = 5556;
		public static TokenServer ts;
		public static void Main(string[] args) {
			ts = new TokenServer(Hosts, Port);
			ts.Init();

			Console.WriteLine("Token server started.");
			Console.WriteLine("Port: " + Port);
			Console.WriteLine("Hosts: " + Hosts.Length);
			Console.WriteLine("Press any key to terminate the server.");
			Console.ReadKey();
			return;
		}
	}
}

Add more hosts to tokenserver

Add more hosts to tokenserver


using ICities;

namespace FogOptions
{
    public class LoadingExtension : LoadingExtensionBase
    {
        public override void OnLevelLoaded(LoadMode mode)
        {
            base.OnLevelLoaded(mode);
            if (mode == LoadMode.LoadMap || mode == LoadMode.NewMap)
            {
                return;
            }
            FogController.Initialize();
        }

        public override void OnLevelUnloading()
        {
            base.OnLevelUnloading();
            FogController.Dispose();
        }
    }
}

using ICities;

namespace FogOptions
{
    public class LoadingExtension : LoadingExtensionBase
    {
        public override void OnLevelLoaded(LoadMode mode)
        {
            base.OnLevelLoaded(mode);
            FogController.Initialize();
        }

        public override void OnLevelUnloading()
        {
            base.OnLevelUnloading();
            FogController.Dispose();
        }
    }
}

Disable fog and clouds in all game modes


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

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

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-02-22 14:39")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]

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

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

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-02-28 02:03")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]

Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.


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

namespace RandomWalkConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var unfinished = Enumerable.Range(0, 1000)
                .Select(_ => Walk2())
                .Aggregate(0, (u, t) => u + (t.HasValue ? 0 : 1));
            Console.WriteLine(unfinished);
        }

        static readonly Random random = new Random();
        static readonly Int32Vector3[] Directions2 = new[] { Int32Vector3.XBasis, Int32Vector3.YBasis, -Int32Vector3.XBasis, -Int32Vector3.YBasis };

        static int? Walk2()
        {
            var current = Int32Vector3.Zero;

            for (var i = 1; i <= 1000000; i++)
            {
                current += Directions2[random.Next(0, Directions2.Length)];

                if (current == Int32Vector3.Zero) return i;
            }

            Console.WriteLine(current);
            return null;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using static System.Console;
using static System.Math;

namespace RandomWalkConsole
{
    class Program
    {
        const int Trials = 1 * 1000;
        const int MaxSteps = 100 * 1000 * 1000;
        const int MaxDistance = 10 * 1000;

        static void Main(string[] args)
        {
            var returned = Enumerable.Range(0, Trials)
                .Select(_ => Walk(Directions2))
                .Aggregate(0, (u, t) => u + (t.HasValue ? 1 : 0));
            WriteLine($"Returned Rate: {(double)returned / Trials}");
        }

        static readonly Random random = new Random();
        static readonly Int32Vector3[] Directions2 = new[] { Int32Vector3.XBasis, Int32Vector3.YBasis, -Int32Vector3.XBasis, -Int32Vector3.YBasis };
        static readonly Int32Vector3[] Directions3 = new[] { Int32Vector3.XBasis, Int32Vector3.YBasis, Int32Vector3.ZBasis, -Int32Vector3.XBasis, -Int32Vector3.YBasis, -Int32Vector3.ZBasis };

        static int? Walk(Int32Vector3[] directions)
        {
            var current = Int32Vector3.Zero;

            for (var i = 1; i <= MaxSteps; i++)
            {
                current += directions[random.Next(0, directions.Length)];

                if (current == Int32Vector3.Zero)
                {
                    WriteLine($"{i:N0}");
                    return i;
                }
                else if (Abs(current.X) >= MaxDistance || Abs(current.Y) >= MaxDistance || Abs(current.Z) >= MaxDistance)
                {
                    WriteLine(current);
                    return null;
                }
            }

            WriteLine(current);
            return null;
        }
    }
}

Implement random walk for 3D

Implement random walk for 3D


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

using System;

namespace osu.Game.Modes.Objects.Types
{
    [Flags]
    public enum HitObjectType
    {
        Circle = 1 << 0,
        Slider = 1 << 1,
        NewCombo = 1 << 2,
        Spinner = 1 << 3,
        ColourHax = 122,
        Hold = 1 << 7,
        SliderTick = 1 << 8,
    }
}

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

using System;

namespace osu.Game.Modes.Objects.Types
{
    [Flags]
    public enum HitObjectType
    {
        Circle = 1 << 0,
        Slider = 1 << 1,
        NewCombo = 1 << 2,
        Spinner = 1 << 3,
        ColourHax = 112,
        Hold = 1 << 7
    }
}

Fix incorrect hit object type.

Fix incorrect hit object type.


using NUnit.Framework;
using FluentMigrator.Infrastructure;

namespace FluentMigrator.Tests.Unit
{
    using System.Collections.ObjectModel;
    using System.Linq;
    using FluentMigrator.Expressions;
    using Moq;

    [TestFixture]
    public class AutoReversingMigrationTests
    {
        private Mock<IMigrationContext> context;

        [SetUp]
        public void SetUp()
        {
            context = new Mock<IMigrationContext>();
            context.SetupAllProperties();
        }

        [Test]
        public void CreateTableUpAutoReversingMigrationGivesDeleteTableDown()
        {
            var autoReversibleMigration = new TestAutoReversingMigrationCreateTable();
            context.Object.Expressions = new Collection<IMigrationExpression>();
            autoReversibleMigration.GetDownExpressions(context.Object);

            Assert.True(context.Object.Expressions.Any(me => me is DeleteTableExpression && ((DeleteTableExpression)me).TableName == "Foo"));
        }

    }

    internal class TestAutoReversingMigrationCreateTable : AutoReversingMigration
    {
        public override void Up()
        {
            Create.Table("Foo");
        }
    }
}

using NUnit.Framework;
using FluentMigrator.Infrastructure;

namespace FluentMigrator.Tests.Unit
{
    using System.Collections.ObjectModel;
    using System.Linq;
    using FluentMigrator.Expressions;
    using Moq;

    [TestFixture]
    public class AutoReversingMigrationTests
    {
        private Mock<IMigrationContext> context;

        [SetUp]
        public void SetUp()
        {
            context = new Mock<IMigrationContext>();
            context.SetupAllProperties();
        }

        [Test]
        public void CreateTableUpAutoReversingMigrationGivesDeleteTableDown()
        {
            var autoReversibleMigration = new TestAutoReversingMigrationCreateTable();
            context.Object.Expressions = new Collection<IMigrationExpression>();
            autoReversibleMigration.GetDownExpressions(context.Object);

            Assert.True(context.Object.Expressions.Any(me => me is DeleteTableExpression && ((DeleteTableExpression)me).TableName == "Foo"));
        }

        [Test]
        public void DownMigrationsAreInReverseOrderOfUpMigrations()
        {
            var autoReversibleMigration = new TestAutoReversingMigrationCreateTable();
            context.Object.Expressions = new Collection<IMigrationExpression>();
            autoReversibleMigration.GetDownExpressions(context.Object);

            Assert.IsAssignableFrom(typeof(RenameTableExpression), context.Object.Expressions.ToList()[0]);
            Assert.IsAssignableFrom(typeof(DeleteTableExpression), context.Object.Expressions.ToList()[1]);
        }

    }

    internal class TestAutoReversingMigrationCreateTable : AutoReversingMigration
    {
        public override void Up()
        {
            Create.Table("Foo");
            Rename.Table("Foo").InSchema("FooSchema").To("Bar");
        }
    }
}

Add a test to confirm down migrations are run in reverse order of up migrations


using LibPixelPet;
using System;

namespace PixelPet.CLI.Commands {
	internal class PadPalettesCmd : CliCommand {
		public PadPalettesCmd()
			: base("Pad-Palettes",
				new Parameter(true, new ParameterValue("width", "0"))
			) { }

		public override void Run(Workbench workbench, ILogger logger) {
			int width = FindUnnamedParameter(0).Values[0].ToInt32();

			if (width < 1) {
				logger?.Log("Invalid palette width.", LogLevel.Error);
				return;
			}

			int addedColors = 0;
			foreach (PaletteEntry pe in workbench.PaletteSet) {
				while (pe.Palette.Count % width != 0) {
					pe.Palette.Add(0);
					addedColors++;
				}
			}

			logger?.Log("Padded palettes to width " + width + " (added " + addedColors + " colors).", LogLevel.Information);
		}
	}
}

using LibPixelPet;
using System;

namespace PixelPet.CLI.Commands {
	internal class PadPalettesCmd : CliCommand {
		public PadPalettesCmd()
			: base("Pad-Palettes",
				new Parameter(true, new ParameterValue("width", "0"))
			) { }

		public override void Run(Workbench workbench, ILogger logger) {
			int width = FindUnnamedParameter(0).Values[0].ToInt32();

			if (width < 1) {
				logger?.Log("Invalid palette width.", LogLevel.Error);
				return;
			}

			if (workbench.PaletteSet.Count == 0) {
				logger?.Log("No palettes to pad. Creating 1 palette based on current bitmap format.", LogLevel.Information);
				Palette pal = new Palette(workbench.BitmapFormat, -1);
				workbench.PaletteSet.Add(pal);
			}

			int addedColors = 0;
			foreach (PaletteEntry pe in workbench.PaletteSet) {
				while (pe.Palette.Count < width) {
					pe.Palette.Add(0);
					addedColors++;
				}
			}

			logger?.Log("Padded palettes to width " + width + " (added " + addedColors + " colors).", LogLevel.Information);
		}
	}
}

Change Pad-Palettes behavior to be more like the old version.


/////////////////////////////////////////////////////////////////
// Created by : Caesar Moussalli                               //
// TimeStamp  : 31-1-2016                                      //
// Content    : Associate Repositories to the Unit of Work     //
// Notes      : Send DB context to repositories to reduce DB   //
//              connectivity sessions count                    //
/////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DynThings.Data.Models;

namespace DynThings.Data.Repositories
{
    public static class UnitOfWork
    {
        #region Repositories
        public static LocationViewsRepository repoLocationViews = new LocationViewsRepository();
        public static LocationsRepository repoLocations = new LocationsRepository();
        public static EndpointsRepository repoEndpoints = new EndpointsRepository();
        public static EndpointIOsRepository repoEndpointIOs = new EndpointIOsRepository();
        public static EndPointTypesRepository repoEndpointTypes = new EndPointTypesRepository();
        public static DevicesRepositories repoDevices = new DevicesRepositories();

        #endregion

        #region Enums
        public enum RepositoryMethodResultType
        {
            Ok = 1,
            Failed = 2
        }

        #endregion
    }
}

/////////////////////////////////////////////////////////////////
// Created by : Caesar Moussalli                               //
// TimeStamp  : 31-1-2016                                      //
// Content    : Associate Repositories to the Unit of Work     //
// Notes      : Send DB context to repositories to reduce DB   //
//              connectivity sessions count                    //
/////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DynThings.Data.Models;

namespace DynThings.Data.Repositories
{
    public static class UnitOfWork
    {
        #region Repositories
        public static LocationViewsRepository repoLocationViews = new LocationViewsRepository();
        public static LocationViewTypesRepository repoLocationViewTypes = new LocationViewTypesRepository();
        public static LocationsRepository repoLocations = new LocationsRepository();
        public static EndpointsRepository repoEndpoints = new EndpointsRepository();
        public static EndpointIOsRepository repoEndpointIOs = new EndpointIOsRepository();
        public static EndPointTypesRepository repoEndpointTypes = new EndPointTypesRepository();
        public static DevicesRepositories repoDevices = new DevicesRepositories();

        #endregion

        #region Enums
        public enum RepositoryMethodResultType
        {
            Ok = 1,
            Failed = 2
        }

        #endregion
    }
}

Add LocationViewTypes repo to unit of work


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

namespace WalletWasabi.Helpers
{
	public static class PasswordConsole
	{
		/// <summary>
		/// Gets the console password.
		/// </summary>
		public static string ReadPassword()
		{
			var sb = new StringBuilder();
			while (true)
			{
				ConsoleKeyInfo cki = Console.ReadKey(true);
				if (cki.Key == ConsoleKey.Enter)
				{
					Console.WriteLine();
					break;
				}

				if (cki.Key == ConsoleKey.Backspace)
				{
					if (sb.Length > 0)
					{
						Console.Write("\b \b");
						sb.Length--;
					}

					continue;
				}

				Console.Write('*');
				sb.Append(cki.KeyChar);
			}

			return sb.ToString();
		}
	}
}

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

namespace WalletWasabi.Helpers
{
	public static class PasswordConsole
	{
		/// <summary>
		/// Gets the console password.
		/// </summary>
		public static string ReadPassword()
		{
			try
			{
				var sb = new StringBuilder();
				while (true)
				{
					ConsoleKeyInfo cki = Console.ReadKey(true);
					if (cki.Key == ConsoleKey.Enter)
					{
						Console.WriteLine();
						break;
					}

					if (cki.Key == ConsoleKey.Backspace)
					{
						if (sb.Length > 0)
						{
							Console.Write("\b \b");
							sb.Length--;
						}

						continue;
					}

					Console.Write('*');
					sb.Append(cki.KeyChar);
				}

				return sb.ToString();
			}
			catch (InvalidOperationException)
			{
				return Console.ReadLine();
			}
		}
	}
}

Make sure daemon password console works on Windows 7


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using Extensions.String;

namespace Microsoft.PowerShell.Commands.Utility
{
    [Cmdlet("Write", "Host")]
    public sealed class WriteHostCommand : ConsoleColorCmdlet
    {
        [Parameter(Position = 0, ValueFromRemainingArguments = true, ValueFromPipeline = true)]
        public PSObject Object { get; set; }

        [Parameter]
        public SwitchParameter NoNewline { get; set; }

        [Parameter]
        public Object Separator { get; set; }

        protected override void ProcessRecord()
        {
            Action<ConsoleColor, ConsoleColor, string> writeAction;

            if (NoNewline) writeAction = Host.UI.Write;
            else writeAction = Host.UI.WriteLine;

            if (Object == null)
            {
                writeAction(ForegroundColor, BackgroundColor, "");
            }
            else if (Object.BaseObject is Enumerable)
            {
                throw new NotImplementedException();
            }
            else
            {
                writeAction(ForegroundColor, BackgroundColor, Object.ToString());
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using Extensions.String;
using System.Collections;

namespace Microsoft.PowerShell.Commands.Utility
{
    [Cmdlet("Write", "Host")]
    public sealed class WriteHostCommand : ConsoleColorCmdlet
    {
        [Parameter(Position = 0, ValueFromRemainingArguments = true, ValueFromPipeline = true)]
        public PSObject Object { get; set; }

        [Parameter]
        public SwitchParameter NoNewline { get; set; }

        [Parameter]
        public Object Separator { get; set; }

        protected override void ProcessRecord()
        {
            Action<ConsoleColor, ConsoleColor, string> writeAction;

            if (NoNewline) writeAction = Host.UI.Write;
            else writeAction = Host.UI.WriteLine;

            if (Object == null)
            {
                writeAction(ForegroundColor, BackgroundColor, "");
            }
            else
            {
                writeAction(ForegroundColor, BackgroundColor, Object.ToString());
            }
        }
    }
}

Remove never-run code in WriteHost.

Remove never-run code in WriteHost.

This code triggers a compile warning (which is treated as an error) when using MonoDevelop.

The condition is bogus - an object can never satisfy `is Enumerable` because `Enumerable` is a `static class`. So it will always be false. I probably intended to write `is IEnumerable` here, but that causes tests to fail. So, yanking this broken code.

I am also opening Issue #20 to make sure we come back and think about this carefully at some point.


namespace TraktApiSharp.Requests.WithoutOAuth.Movies.Common
{
    using Base.Get;
    using Enums;
    using Objects.Basic;
    using Objects.Get.Movies.Common;
    using System.Collections.Generic;

    internal class TraktMoviesMostCollectedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostCollectedMovie>, TraktMostCollectedMovie>
    {
        internal TraktMoviesMostCollectedRequest(TraktClient client) : base(client) { Period = TraktPeriod.Weekly; }

        internal TraktPeriod? Period { get; set; }

        protected override IDictionary<string, object> GetUriPathParameters()
        {
            var uriParams = base.GetUriPathParameters();

            if (Period.HasValue && Period.Value != TraktPeriod.Unspecified)
                uriParams.Add("period", Period.Value.AsString());

            return uriParams;
        }

        protected override string UriTemplate => "movies/collected{/period}{?extended,page,limit}";

        protected override TraktAuthorizationRequirement AuthorizationRequirement => TraktAuthorizationRequirement.NotRequired;

        protected override bool SupportsPagination => true;

        protected override bool IsListResult => true;
    }
}

namespace TraktApiSharp.Requests.WithoutOAuth.Movies.Common
{
    using Base;
    using Base.Get;
    using Enums;
    using Objects.Basic;
    using Objects.Get.Movies.Common;
    using System.Collections.Generic;

    internal class TraktMoviesMostCollectedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostCollectedMovie>, TraktMostCollectedMovie>
    {
        internal TraktMoviesMostCollectedRequest(TraktClient client) : base(client) { Period = TraktPeriod.Weekly; }

        internal TraktPeriod? Period { get; set; }

        protected override IDictionary<string, object> GetUriPathParameters()
        {
            var uriParams = base.GetUriPathParameters();

            if (Period.HasValue && Period.Value != TraktPeriod.Unspecified)
                uriParams.Add("period", Period.Value.AsString());

            return uriParams;
        }

        protected override string UriTemplate => "movies/collected{/period}{?extended,page,limit,query,years,genres,languages,countries,runtimes,ratings,certifications}";

        protected override TraktAuthorizationRequirement AuthorizationRequirement => TraktAuthorizationRequirement.NotRequired;

        internal TraktMovieFilter Filter { get; set; }

        protected override bool SupportsPagination => true;

        protected override bool IsListResult => true;
    }
}

Add filter property to most collected movies request.


using System;
using OpenMetaverse;

namespace OpenMetaverse.TestClient
{
    public class WearCommand : Command
    {
        public WearCommand(TestClient testClient)
        {
            Client = testClient;
            Name = "wear";
            Description = "Wear an outfit folder from inventory. Usage: wear [outfit name] [nobake]";
            Category = CommandCategory.Appearance;
        }

        public override string Execute(string[] args, UUID fromAgentID)
        {
            if (args.Length < 1)
                return "Usage: wear [outfit name] eg: 'wear /My Outfit/Dance Party";

            string target = String.Empty;

            bool bake = true;

            for (int ct = 0; ct < args.Length; ct++)
            {
                if (args[ct].Equals("nobake"))
                    bake = false;
                else
                    target = target + args[ct] + " ";
            }

            target = target.TrimEnd();

            //Client.Appearance.WearOutfit(target.Split('/'), bake);

            return "FIXME: Implement this";
        }
    }
}

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

namespace OpenMetaverse.TestClient
{
    public class WearCommand : Command
    {
        public WearCommand(TestClient testClient)
        {
            Client = testClient;
            Name = "wear";
            Description = "Wear an outfit folder from inventory. Usage: wear [outfit name]";
            Category = CommandCategory.Appearance;
        }

        public override string Execute(string[] args, UUID fromAgentID)
        {
            if (args.Length < 1)
                return "Usage: wear [outfit name] eg: 'wear Clothing/My Outfit";

            string target = String.Empty;

            for (int ct = 0; ct < args.Length; ct++)
            {
                target += args[ct] + " ";
            }

            target = target.TrimEnd();

            UUID folder = Client.Inventory.FindObjectByPath(Client.Inventory.Store.RootFolder.UUID, Client.Self.AgentID, target, 20 * 1000);

            if (folder == UUID.Zero)
            {
                return "Outfit path " + target + " not found";
            }

            List<InventoryBase> contents =  Client.Inventory.FolderContents(folder, Client.Self.AgentID, true, true, InventorySortOrder.ByName, 20 * 1000);
            List<InventoryItem> items = new List<InventoryItem>();

            if (contents == null)
            {
                return "Failed to get contents of " + target;
            }

            foreach (InventoryBase item in contents)
            {
                if (item is InventoryItem)
                    items.Add((InventoryItem)item);
            }

            Client.Appearance.ReplaceOutfit(items);

            return "Starting to change outfit to " + target;

        }
    }
}

Update wear command to work with the new appearance maanger.

git-svn-id: e915c4f8b2ea2a6e63cbe989b51c0994a698cc26@3158 52acb1d6-8a22-11de-b505-999d5b087335


@model string[]
@Html.DropDownList("[]", new SelectListItem[0])

<script type="text/javascript">
    $(function () {
        $.ajax({
            url: '@Url.Action("Rooms", "Select")',
            method: 'post',
            success: function(data) {
                $("#@Html.IdForModel()__")
                    .select2({
                        data: data
                    }).val("@((Model ?? new string[0]).FirstOrDefault())").trigger('change');
            }
        });
    });
</script>

@model string[]
@Html.DropDownList("[]", new SelectListItem[0], new { multiple="multiple" })

<script type="text/javascript">
    $(function () {
        $.ajax({
            url: '@Url.Action("Rooms", "Select")',
            method: 'post',
            success: function(data) {
                $("#@Html.IdForModel()__")
                    .select2({
                        data: data
                    }).val("@((Model ?? new string[0]).FirstOrDefault())").trigger('change');
            }
        });
    });
</script>

Make rooms multi-select for devices (and clearable)


using System;

namespace Glimpse
{
    public class BaseMessage : IMessage
    {
        public BaseMessage()
        {
            Id = new Guid();
            Time = new DateTime();
        }

        public Guid Id { get; }

        public DateTime Time { get; }
    }
}

using System;

namespace Glimpse
{
    public class BaseMessage : IMessage
    {
        public BaseMessage()
        {
            Id = Guid.NewGuid();
            Time =  DateTime.Now;
        }

        public Guid Id { get; }

        public DateTime Time { get; }
    }
}

Add correct guid/date generation for messages


using System;
using System.Net.Http;

namespace Glimpse.Agent
{
    public class RemoteHttpMessagePublisher : IMessagePublisher, IDisposable
    {
        private readonly HttpClient _httpClient;
        private readonly HttpClientHandler _httpHandler;

        public RemoteHttpMessagePublisher()
        {
            _httpHandler = new HttpClientHandler();
            _httpClient = new HttpClient(_httpHandler);
        }

        public void PublishMessage(IMessage message)
        {
            var content = new StringContent("Hello");

            // TODO: Try shifting to async and await
            // TODO: Find out what happened to System.Net.Http.Formmating - PostAsJsonAsync

            _httpClient.PostAsJsonAsync("http://localhost:15999/Glimpse/Agent", message)
                .ContinueWith(requestTask =>
                    {
                        // Get HTTP response from completed task.
                        HttpResponseMessage response = requestTask.Result;

                        // Check that response was successful or throw exception
                        response.EnsureSuccessStatusCode();

                        // Read response asynchronously as JsonValue and write out top facts for each country
                        var result = response.Content.ReadAsStringAsync().Result;
                    });
        }

        public void Dispose()
        {
            _httpClient.Dispose();
            _httpHandler.Dispose();
        }
    }
}

using System;
using System.Net.Http;

namespace Glimpse.Agent
{
    public class RemoteHttpMessagePublisher : IMessagePublisher, IDisposable
    {
        private readonly HttpClient _httpClient;
        private readonly HttpClientHandler _httpHandler;

        public RemoteHttpMessagePublisher()
        {
            _httpHandler = new HttpClientHandler();
            _httpClient = new HttpClient(_httpHandler);
        }

        public void PublishMessage(IMessage message)
        {
            // TODO: Try shifting to async and await
            // TODO: Needs error handelling
            // TODO: Find out what happened to System.Net.Http.Formmating - PostAsJsonAsync

            _httpClient.PostAsJsonAsync("http://localhost:15999/Glimpse/Agent", message)
                .ContinueWith(requestTask =>
                    {
                        // Get HTTP response from completed task.
                        HttpResponseMessage response = requestTask.Result;

                        // Check that response was successful or throw exception
                        response.EnsureSuccessStatusCode();

                        // Read response asynchronously as JsonValue and write out top facts for each country
                        var result = response.Content.ReadAsStringAsync().Result;
                    });
        }

        public void Dispose()
        {
            _httpClient.Dispose();
            _httpHandler.Dispose();
        }
    }
}

Remove unused code & add comment

Remove unused code & add comment


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Windows.Devices.Geolocation;
using AirQualityInfo.DataClient.Models;
using AirQualityInfo.DataClient.Services;

namespace AirQualityInfo.WP.Services
{
    // http://msdn.microsoft.com/en-us/library/windows/apps/hh465148.aspx
    public class LocationService : ILocationService
    {
        public async Task<LocationResult> GetCurrentPosition()
        {
            try
            {
                var geolocator = new Geolocator()
                {
                    DesiredAccuracyInMeters = 50
                };

                Geoposition pos = await geolocator.GetGeopositionAsync(
                    maximumAge: TimeSpan.FromMinutes(1),
                    timeout: TimeSpan.FromSeconds(10)
                    );

                return new LocationResult(new GeoCoordinate(pos.Coordinate.Latitude, pos.Coordinate.Longitude));
            }
            catch (UnauthorizedAccessException)
            {
                return new LocationResult("Die aktuelle Position ist zur Berechnung der Distanz zur Messstation notwendig, Zugriff wurde verweigert.");
            }
            catch (Exception)
            {
            }

            return new LocationResult("Aktuelle Position konnte nicht ermittelt werden");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Windows.Devices.Geolocation;
using AirQualityInfo.DataClient.Models;
using AirQualityInfo.DataClient.Services;

namespace AirQualityInfo.WP.Services
{
    // http://msdn.microsoft.com/en-us/library/windows/apps/hh465148.aspx
    public class LocationService : ILocationService
    {
        public async Task<LocationResult> GetCurrentPosition()
        {
            try
            {
                var geolocator = new Geolocator()
                {
                    DesiredAccuracyInMeters = 500
                };

                Geoposition pos = await geolocator.GetGeopositionAsync(
                    maximumAge: TimeSpan.FromMinutes(5),
                    timeout: TimeSpan.FromSeconds(10)
                    );

                return new LocationResult(new GeoCoordinate(pos.Coordinate.Latitude, pos.Coordinate.Longitude));
            }
            catch (UnauthorizedAccessException)
            {
                return new LocationResult("Die aktuelle Position ist zur Berechnung der Distanz zur Messstation notwendig, Zugriff wurde verweigert.");
            }
            catch (Exception)
            {
            }

            return new LocationResult("Aktuelle Position konnte nicht ermittelt werden");
        }
    }
}

Set Geolocator to accuracy of 500m, 5min age and 10 second timeout


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

#nullable disable

using System.Collections.Generic;
using System.Linq;
using osu.Framework.IO.Stores;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.IO;

namespace osu.Game.Database
{
    public class LegacyBeatmapImporter : LegacyModelImporter<BeatmapSetInfo>
    {
        protected override string ImportFromStablePath => ".";

        protected override Storage PrepareStableStorage(StableStorage stableStorage) => stableStorage.GetSongStorage();

        protected override IEnumerable<string> GetStableImportPaths(Storage storage)
        {
            foreach (string directory in storage.GetDirectories(string.Empty))
            {
                var directoryStorage = storage.GetStorageForDirectory(directory);

                if (!directoryStorage.GetFiles(string.Empty).ExcludeSystemFileNames().Any())
                {
                    // if a directory doesn't contain files, attempt looking for beatmaps inside of that directory.
                    // this is a special behaviour in stable for beatmaps only, see https://github.com/ppy/osu/issues/18615.
                    foreach (string subDirectory in GetStableImportPaths(directoryStorage))
                        yield return subDirectory;
                }
                else
                    yield return storage.GetFullPath(directory);
            }
        }

        public LegacyBeatmapImporter(IModelImporter<BeatmapSetInfo> importer)
            : base(importer)
        {
        }
    }
}

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

#nullable disable

using System.Collections.Generic;
using System.Linq;
using osu.Framework.IO.Stores;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.IO;

namespace osu.Game.Database
{
    public class LegacyBeatmapImporter : LegacyModelImporter<BeatmapSetInfo>
    {
        protected override string ImportFromStablePath => ".";

        protected override Storage PrepareStableStorage(StableStorage stableStorage) => stableStorage.GetSongStorage();

        protected override IEnumerable<string> GetStableImportPaths(Storage storage)
        {
            // make sure the directory exists
            if (!storage.ExistsDirectory(string.Empty))
                yield break;

            foreach (string directory in storage.GetDirectories(string.Empty))
            {
                var directoryStorage = storage.GetStorageForDirectory(directory);

                if (!directoryStorage.GetFiles(string.Empty).ExcludeSystemFileNames().Any())
                {
                    // if a directory doesn't contain files, attempt looking for beatmaps inside of that directory.
                    // this is a special behaviour in stable for beatmaps only, see https://github.com/ppy/osu/issues/18615.
                    foreach (string subDirectory in GetStableImportPaths(directoryStorage))
                        yield return subDirectory;
                }
                else
                    yield return storage.GetFullPath(directory);
            }
        }

        public LegacyBeatmapImporter(IModelImporter<BeatmapSetInfo> importer)
            : base(importer)
        {
        }
    }
}

Fix crash with legacy import from incomplete installs


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

// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

using System;
using System.Linq;

namespace Microsoft.WindowsAzure.Management.Compute.Models
{
    /// <summary>
    /// Known values for Destination Virtual Network.
    /// </summary>
    public static partial class DestinationVirtualNetwork
    {
        public const string Default = "Default";

        public const string New = "New";

        public const string Existing = "Existing";
    }
}

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

// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

using System;
using System.Linq;

namespace Microsoft.WindowsAzure.Management.Compute.Models
{
    /// <summary>
    /// Known values for Destination Virtual Network.
    /// </summary>
    public static partial class DestinationVirtualNetwork
    {
        public const string New = "New";

        public const string Existing = "Existing";
    }
}

Remove "Default" from Destination VNet for migration


using System;

namespace Hangman {
  public class Hangman {
    public static void Main(string[] args) {
      // Table table = new Table(2, 3);
      // string output = table.Draw();

      // Console.WriteLine(output);
    }
  }
}

using System;

namespace Hangman {
  public class Hangman {
    public static void Main(string[] args) {
      Game game = new Game();
      Console.WriteLine("Made a new Game object");

      // Table table = new Table(2, 3);
      // string output = table.Draw();

      // Console.WriteLine(output);
    }
  }
}

Create an instance of Game

Create an instance of Game


using System.Reflection;

namespace EvilDICOM.Core.Helpers
{
    public static class Constants
    {
        public static string EVIL_DICOM_IMP_UID = "1.2.598.0.1.2851334.2.1865.1";
        public static string EVIL_DICOM_IMP_VERSION = Assembly.GetCallingAssembly().GetName().Version.ToString();
        //APPLICATION CONTEXT
        public static string DEFAULT_APPLICATION_CONTEXT = "1.2.840.10008.3.1.1.1";
    }
}

using System.Reflection;

namespace EvilDICOM.Core.Helpers
{
    public static class Constants
    {
        public static string EVIL_DICOM_IMP_UID = "1.2.598.0.1.2851334.2.1865.1";
        public static string EVIL_DICOM_IMP_VERSION = new AssemblyName(Assembly.GetCallingAssembly().FullName).Version.ToString();
        //APPLICATION CONTEXT
        public static string DEFAULT_APPLICATION_CONTEXT = "1.2.840.10008.3.1.1.1";
    }
}

Use AssemblyName to portably obtain version number


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

using osu.Framework.Graphics.Cursor;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;

namespace osu.Game.Rulesets.Osu.Edit
{
    public class OsuEditRulesetContainer : OsuRulesetContainer
    {
        public OsuEditRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
            : base(ruleset, beatmap, isForCurrentRuleset)
        {
        }

        protected override Playfield CreatePlayfield() => new OsuEditPlayfield();

        protected override CursorContainer CreateCursor() => null;
    }
}

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

using osu.Framework.Graphics.Cursor;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
using OpenTK;

namespace osu.Game.Rulesets.Osu.Edit
{
    public class OsuEditRulesetContainer : OsuRulesetContainer
    {
        public OsuEditRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
            : base(ruleset, beatmap, isForCurrentRuleset)
        {
        }

        protected override Playfield CreatePlayfield() => new OsuEditPlayfield();

        protected override Vector2 GetAspectAdjustedSize()
        {
            var aspectSize = DrawSize.X * 0.75f < DrawSize.Y ? new Vector2(DrawSize.X, DrawSize.X * 0.75f) : new Vector2(DrawSize.Y * 4f / 3f, DrawSize.Y);
            return new Vector2(aspectSize.X / DrawSize.X, aspectSize.Y / DrawSize.Y);
        }

        protected override CursorContainer CreateCursor() => null;
    }
}

Remove 0.75 scale from osu! playfield in the editor


using System.Diagnostics;
using System.IO;
using System.Reflection;

namespace DanTup.TestAdapters.Xml
{
	public class XmlExternalTestExecutor : ExternalTestExecutor
	{
		static readonly string extensionFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
		public override string ExtensionFolder { get { return extensionFolder; } }

		static readonly string luaExecutable = Path.Combine(extensionFolder, "lua52.exe");
		static readonly string testFrameworkFile = Path.Combine(extensionFolder, "TestFramework.lua");

		protected override ProcessStartInfo CreateProcessStartInfo(string source, string args)
		{
			args = string.Format("\"{0}\" \"{1}\" {2}", testFrameworkFile.Replace("\"", "\\\""), source.Replace("\"", "\\\""), args);

			return new ProcessStartInfo(luaExecutable, args)
			{
				WorkingDirectory = Path.GetDirectoryName(source),
				UseShellExecute = false,
				RedirectStandardOutput = true,
				RedirectStandardError = true
			};
		}
	}
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;

namespace DanTup.TestAdapters.Xml
{
	public class XmlExternalTestExecutor : ExternalTestExecutor
	{
		static readonly string extensionFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
		public override string ExtensionFolder { get { return extensionFolder; } }

		/// <summary>
		/// Reads the results XML file directly.
		/// </summary>
		public override IEnumerable<GenericTest> GetTestCases(string source, Action<string> logger)
		{
			return ParseTestOutput(File.ReadAllText(source));
		}

		/// <summary>
		/// Reads the results XML file directly.
		/// </summary>
		public override IEnumerable<GenericTest> GetTestResults(string source, Action<string> logger)
		{
			return ParseTestOutput(File.ReadAllText(source));
		}
	}
}

Implement a simple executor that just reads the file directly


using Discord;
using Discord.Commands;
using NadekoBot.Extensions;
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;

namespace NadekoBot.Modules.Searches
{
    public partial class Searches
    {
        [Group]
        public class InspiroCommands : NadekoSubmodule
        {
            private const string _xkcdUrl = "https://xkcd.com";
            private readonly IHttpClientFactory _httpFactory;

            public InspiroCommands(IHttpClientFactory factory)
            {
                _httpFactory = factory;
            }

            [NadekoCommand, Usage, Description, Aliases]
            [Priority(0)]
            public async Task Inspiro()
            {
                using (var http = _httpFactory.CreateClient())
                {
                    var response = await http.GetStringAsync("http://inspirobot.me/api?generate=true").ConfigureAwait(false);
                    if (response == null || string.IsNullOrWhiteSpace(response))
                        return;

                    await ctx.Channel.EmbedAsync(new EmbedBuilder()
                        .WithOkColor()
                        .WithImageUrl(response)
                        .WithDescription(response.Replace(@"https://generated.inspirobot.me/", @"http://inspirobot.me/share?iuid=")));
                }
            }
        }
    }
}

using Discord;
using Discord.Commands;
using NadekoBot.Extensions;
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;

namespace NadekoBot.Modules.Searches
{
    public partial class Searches
    {
        [Group]
        public class InspiroCommands : NadekoSubmodule
        {
            private readonly IHttpClientFactory _httpFactory;

            public InspiroCommands(IHttpClientFactory factory)
            {
                _httpFactory = factory;
            }

            [NadekoCommand, Usage, Description, Aliases]
            [Priority(0)]
            public async Task Inspiro()
            {
                using (ctx.Channel.EnterTypingState())
                {
                    using (var http = _httpFactory.CreateClient())
                    {
                        var response = await http.GetStringAsync("http://inspirobot.me/api?generate=true").ConfigureAwait(false);
                        if (response == null || string.IsNullOrWhiteSpace(response))
                            return;

                        await ctx.Channel.EmbedAsync(new EmbedBuilder()
                            .WithOkColor()
                            .WithImageUrl(response)
                            .WithDescription(response.Replace(@"https://generated.inspirobot.me/", @"http://inspirobot.me/share?iuid=")));
                    }
                }
            }
        }
    }
}

Add typing state to inspiro command

Add typing state to inspiro command


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

// 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("Eto.Platform.Wpf")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Picoe")]
[assembly: AssemblyProduct("Eto.Platform.Wpf")]
[assembly: AssemblyCopyright("Copyright © Curtis Wensley 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

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

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("256ea788-fb5e-46b1-a4f3-acad21c1fbbf")]

// 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: ThemeInfo (
	ResourceDictionaryLocation.SourceAssembly,
	ResourceDictionaryLocation.SourceAssembly
)]

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

[assembly: AssemblyTitle("Eto.Platform.Wpf")]
[assembly: AssemblyDescription("")]

[assembly: ThemeInfo (
	ResourceDictionaryLocation.SourceAssembly,
	ResourceDictionaryLocation.SourceAssembly
)]

Remove extraneous info in assembly info

Wpf: Remove extraneous info in assembly info


using System.Linq;
using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData;
using Orchard.Localization;
using Orchard.UI.Navigation;

namespace Orchard.Core.Contents {
    public class AdminMenu : INavigationProvider {
        private readonly IContentDefinitionManager _contentDefinitionManager;
        private readonly IContentManager _contentManager;

        public AdminMenu(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) {
            _contentDefinitionManager = contentDefinitionManager;
            _contentManager = contentManager;
        }

        public Localizer T { get; set; }
        public string MenuName { get { return "admin"; } }

        public void GetNavigation(NavigationBuilder builder) {
            var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name);

            builder.Add(T("Content"), "1", menu => {
                menu.Add(T("Manage Content"), "1.2", item => item.Action("List", "Admin", new {area = "Orchard.ContentTypes"}));
                //foreach (var contentTypeDefinition in contentTypeDefinitions) {
                //    var ci = _contentManager.New(contentTypeDefinition.Name);
                //    var cim = _contentManager.GetItemMetadata(ci);
                //    var createRouteValues = cim.CreateRouteValues;
                //    if (createRouteValues.Any())
                //        menu.Add(T("Create New {0}", contentTypeDefinition.DisplayName), "1.3", item => item.Action(cim.CreateRouteValues["Action"] as string, cim.CreateRouteValues["Controller"] as string, cim.CreateRouteValues));
                //}
                                           });
        }
    }
}

using System.Linq;
using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData;
using Orchard.Localization;
using Orchard.UI.Navigation;

namespace Orchard.Core.Contents {
    public class AdminMenu : INavigationProvider {
        private readonly IContentDefinitionManager _contentDefinitionManager;
        private readonly IContentManager _contentManager;

        public AdminMenu(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) {
            _contentDefinitionManager = contentDefinitionManager;
            _contentManager = contentManager;
        }

        public Localizer T { get; set; }
        public string MenuName { get { return "admin"; } }

        public void GetNavigation(NavigationBuilder builder) {
            //var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name);

            //builder.Add(T("Content"), "1", menu => {
            //    menu.Add(T("Manage Content"), "1.2", item => item.Action("List", "Admin", new {area = "Orchard.ContentTypes"}));
                //foreach (var contentTypeDefinition in contentTypeDefinitions) {
                //    var ci = _contentManager.New(contentTypeDefinition.Name);
                //    var cim = _contentManager.GetItemMetadata(ci);
                //    var createRouteValues = cim.CreateRouteValues;
                //    if (createRouteValues.Any())
                //        menu.Add(T("Create New {0}", contentTypeDefinition.DisplayName), "1.3", item => item.Action(cim.CreateRouteValues["Action"] as string, cim.CreateRouteValues["Controller"] as string, cim.CreateRouteValues));
                //}
                                           //});
        }
    }
}

Hide the Manage Content admin menu item

Hide the Manage Content admin menu item

--HG--
branch : dev


using SFA.DAS.EAS.Domain.Interfaces;
using SFA.DAS.TokenService.Api.Client;

namespace SFA.DAS.EAS.Domain.Configuration
{
    public class TokenServiceApiClientConfiguration : ITokenServiceApiClientConfiguration, IConfiguration
    {
        public string ApiBaseUrl { get; set; }
        public string ClientId { get; set; }
        public string ClientSecret { get; set; }
        public string IdentifierUri { get; set; }
        public string Tenant { get; set; }
        public string DatabaseConnectionString { get; set; }
        public string ServiceBusConnectionString { get; set; }
    }
}

using System.Security.Cryptography.X509Certificates;
using Microsoft.Azure;
using SFA.DAS.EAS.Domain.Interfaces;
using SFA.DAS.TokenService.Api.Client;

namespace SFA.DAS.EAS.Domain.Configuration
{
    public class TokenServiceApiClientConfiguration : ITokenServiceApiClientConfiguration, IConfiguration
    {
        public string ApiBaseUrl { get; set; }
        public string ClientId { get; set; }
        public string ClientSecret { get; set; }
        public string IdentifierUri { get; set; }
        public string Tenant { get; set; }
        public X509Certificate TokenCertificate {
            get
            {
                var store = new X509Store(StoreLocation.LocalMachine);
                store.Open(OpenFlags.ReadOnly);
                try
                {
                    var thumbprint = CloudConfigurationManager.GetSetting("TokenServiceCertificateThumbprint");

                    if (string.IsNullOrEmpty(thumbprint))
                    {
                        return null;
                    }

                    var certificates = store.Certificates.Find(X509FindType.FindByThumbprint, thumbprint, false);

                    return certificates[0];
                }
                finally
                {
                    store.Close();
                }
            }
            set { }
        }
        public string DatabaseConnectionString { get; set; }
        public string ServiceBusConnectionString { get; set; }
    }
}

Add load of certificate for token service


using BatteryCommander.Web.Models;
using BatteryCommander.Web.Models.Reports;
using BatteryCommander.Web.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace BatteryCommander.Web.Controllers
{
    [Authorize, ApiExplorerSettings(IgnoreApi = true)]
    public class ReportsController : Controller
    {
        private readonly Database db;

        public ReportsController(Database db)
        {
            this.db = db;
        }

        // Generate HTML/PDF version
        // Email to configurable address on request / on schedule

        // GREEN 3 -- Sensitive Items

        // CONVOY MANIFEST?

        // TAN 1 -- Comstat

        // YELLOW 1 -- LOGSTAT

        public async Task<IActionResult> Red1(SoldierService.Query query)
        {
            var model = new Red1_Perstat
            {
                Soldiers = await SoldierService.Filter(db, query)
            };

            return Json(model);
        }

        public async Task<IActionResult> SadPerstat(SoldierService.Query query)
        {
            var model = new StateActiveDuty_Perstat
            {
                Soldiers = await SoldierService.Filter(db, query)
            };

            return Json(model);
        }

        public async Task<IActionResult> DscaReady()
        {
            var soldiers = await SoldierService.Filter(db, new SoldierService.Query
            {
                IWQ = true,
                DSCA = true
            });

            return View(soldiers);
        }
    }
}

using BatteryCommander.Web.Models;
using BatteryCommander.Web.Models.Reports;
using BatteryCommander.Web.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace BatteryCommander.Web.Controllers
{
    [Authorize, ApiExplorerSettings(IgnoreApi = true)]
    public class ReportsController : Controller
    {
        private readonly Database db;

        public ReportsController(Database db)
        {
            this.db = db;
        }

        // TAN 1 -- Comstat

        // YELLOW 1 -- LOGSTAT

        public async Task<IActionResult> SadPerstat(SoldierService.Query query)
        {
            var model = new StateActiveDuty_Perstat
            {
                Soldiers = await SoldierService.Filter(db, query)
            };

            return Json(model);
        }

        public async Task<IActionResult> DscaReady()
        {
            var soldiers = await SoldierService.Filter(db, new SoldierService.Query
            {
                IWQ = true,
                DSCA = true
            });

            return View(soldiers);
        }
    }
}

Remove old red 1 reference

Remove old red 1 reference