using DocumentFormat.OpenXml;

namespace ClosedXML.Utils
{
    internal static class OpenXmlHelper
    {
        public static BooleanValue GetBooleanValue(bool value, bool defaultValue)
        {
            return value == defaultValue ? null : new BooleanValue(value);
        }

        public static bool GetBooleanValueAsBool(BooleanValue value, bool defaultValue)
        {
            return value.HasValue ? value.Value : defaultValue;
        }
    }
}

using DocumentFormat.OpenXml;

namespace ClosedXML.Utils
{
    internal static class OpenXmlHelper
    {
        public static BooleanValue GetBooleanValue(bool value, bool defaultValue)
        {
            return value == defaultValue ? null : new BooleanValue(value);
        }

        public static bool GetBooleanValueAsBool(BooleanValue value, bool defaultValue)
        {
            return (value?.HasValue ?? false) ? value.Value : defaultValue;
        }
    }
}

Fix converter for possible null values.

Fix converter for possible null values.


using UIKit;

namespace CSharpMath.Ios.Example {
  public class IosMathViewController : UIViewController {
    public override void ViewDidLoad() {
      View.BackgroundColor = UIColor.White;
      var latexView = IosMathLabels.MathView(Rendering.Tests.MathData.ColorBox, 50);  // WJWJWJ latex here
      latexView.ContentInsets = new UIEdgeInsets(10, 10, 10, 10);
      var size = latexView.SizeThatFits(new CoreGraphics.CGSize(370, 280));
      latexView.Frame = new CoreGraphics.CGRect(0, 40, size.Width, size.Height);
      View.Add(latexView);
    }
  }
}

using UIKit;

namespace CSharpMath.Ios.Example {
  public class IosMathViewController : UIViewController {
    public override void ViewDidLoad() {
      View.BackgroundColor = UIColor.White;
      var latexView = IosMathLabels.MathView(Rendering.Tests.MathData.IntegralColorBoxCorrect, 50);  // WJWJWJ latex here
      latexView.ContentInsets = new UIEdgeInsets(10, 10, 10, 10);
      var size = latexView.SizeThatFits(new CoreGraphics.CGSize(370, 280));
      latexView.Frame = new CoreGraphics.CGRect(0, 40, size.Width, size.Height);
      View.Add(latexView);
    }
  }
}

Use an actual available choice for LaTeX


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

namespace Sketchball.Elements
{
    public class Ball : PinballElement, IPhysics
    {

        private Vector2 v;
        private Vector2 v0;
        long t = 0;

        public Vector2 Velocity
        {
            get
            {
                return v;
            }
            set
            {
                v0 = value;
                t = 0;
                v = v0;
            }
        }

        public Ball()
        {
            Velocity = new Vector2();
            Mass = 0.2f;
            Width = 60;
            Height = 60;
        }

        public override void Draw(System.Drawing.Graphics g)
        {
            //g.FillEllipse(Brushes.Peru, 0, 0, Width, Height);
            g.DrawImage(Properties.Resources.BallWithAlpha, 0, 0, Width, Height);
        }

        public override void Update(long delta)
        {
            t += delta;
            base.Update(delta);
            v = v0 + (t / 1000f) * World.Acceleration;
            Location += v * (delta / 1000f);
        }

        public float Mass
        {
            get;
            set;
        }
    }
}

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

namespace Sketchball.Elements
{
    public class Ball : PinballElement, IPhysics
    {
        public Vector2 Velocity
        {
            get;
            set;
        }

        public Ball()
        {
            Velocity = new Vector2();
            Mass = 0.2f;
            Width = 60;
            Height = 60;
        }

        public override void Draw(System.Drawing.Graphics g)
        {
            //g.FillEllipse(Brushes.Peru, 0, 0, Width, Height);
            g.DrawImage(Properties.Resources.BallWithAlpha, 0, 0, Width, Height);
        }

        public override void Update(long delta)
        {
            base.Update(delta);
            Velocity += World.Acceleration * (delta / 1000f);
            Location += Velocity * (delta / 1000f);
        }

        public float Mass
        {
            get;
            set;
        }
    }
}

Move away from v0 approach.

Move away from v0 approach.


using System;
using Mono.Addins;
using Mono.Addins.Description;

[assembly:Addin ("TypeScript",
	Namespace = "MonoDevelop",
	Version = "0.6",
	Category = "Web Development")]

[assembly:AddinName ("TypeScript")]
[assembly:AddinDescription ("Adds TypeScript support. Updated to use TypeScript 1.4")]

[assembly:AddinDependency ("Core", "5.0")]
[assembly:AddinDependency ("Ide", "5.0")]
[assembly:AddinDependency ("SourceEditor2", "5.0")]
[assembly:AddinDependency ("Refactoring", "5.0")]

using System;
using Mono.Addins;
using Mono.Addins.Description;

[assembly:Addin ("TypeScript",
	Namespace = "MonoDevelop",
	Version = "0.6",
	Category = "Web Development")]

[assembly:AddinName ("TypeScript")]
[assembly:AddinDescription ("Adds TypeScript support. Updated to use TypeScript 1.5.3")]

[assembly:AddinDependency ("Core", "5.0")]
[assembly:AddinDependency ("Ide", "5.0")]
[assembly:AddinDependency ("SourceEditor2", "5.0")]
[assembly:AddinDependency ("Refactoring", "5.0")]

Update addin info showing that addin uses TypeScript 1.5.3


using System;
using Microsoft.Deployment.WindowsInstaller;

namespace Wix.CustomActions
{
    using System.IO;
    using System.Diagnostics;

    public class CustomActions
    {
        [CustomAction]
        public static ActionResult CloseIt(Session session)
        {
            try
            {

                Debugger.Launch();

                const string fileFullPath = @"c:\KensCustomAction.txt";

                if (!File.Exists(fileFullPath))
                    File.Create(fileFullPath);

                File.AppendAllText(fileFullPath, string.Format("{0}Yes, we have a hit at {1}", Environment.NewLine, DateTime.Now));

                session.Log("Close DotTray!");
            }
            catch (Exception ex)
            {
                session.Log("ERROR in custom action CloseIt {0}", ex.ToString());
                return ActionResult.Failure;
            }

            return ActionResult.Success;
        }
    }
}

using Microsoft.Deployment.WindowsInstaller;
using System;
using System.IO;

namespace Wix.CustomActions
{
    public class CustomActions
    {
        [CustomAction]
        public static ActionResult CloseIt(Session session)
        {
            try
            {
                string fileFullPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "CustomAction.txt");

                if (!File.Exists(fileFullPath))
                    File.Create(fileFullPath);

                File.AppendAllText(fileFullPath, string.Format("{0}Yes, we have a hit at {1}", Environment.NewLine, DateTime.Now));

                session.Log("Close DotTray!");
            }
            catch (Exception ex)
            {
                session.Log("ERROR in custom action CloseIt {0}", ex.ToString());
                return ActionResult.Failure;
            }

            return ActionResult.Success;
        }
    }
}

Make the custom action not have to use Debugger.Launch to prove that it works.


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

using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Beatmaps.ControlPoints;

namespace osu.Game.Screens.Edit.Timing
{
    internal class DifficultySection : Section<DifficultyControlPoint>
    {
        private SliderWithTextBoxInput<double> multiplierSlider;

        [BackgroundDependencyLoader]
        private void load()
        {
            Flow.AddRange(new[]
            {
                multiplierSlider = new SliderWithTextBoxInput<double>("Speed Multiplier")
                {
                    Current = new DifficultyControlPoint().SpeedMultiplierBindable
                }
            });
        }

        protected override void OnControlPointChanged(ValueChangedEvent<DifficultyControlPoint> point)
        {
            if (point.NewValue != null)
            {
                multiplierSlider.Current = point.NewValue.SpeedMultiplierBindable;
            }
        }

        protected override DifficultyControlPoint CreatePoint()
        {
            var reference = Beatmap.Value.Beatmap.ControlPointInfo.DifficultyPointAt(SelectedGroup.Value.Time);

            return new DifficultyControlPoint
            {
                SpeedMultiplier = reference.SpeedMultiplier,
            };
        }
    }
}

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

using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Beatmaps.ControlPoints;

namespace osu.Game.Screens.Edit.Timing
{
    internal class DifficultySection : Section<DifficultyControlPoint>
    {
        private SliderWithTextBoxInput<double> multiplierSlider;

        [BackgroundDependencyLoader]
        private void load()
        {
            Flow.AddRange(new[]
            {
                multiplierSlider = new SliderWithTextBoxInput<double>("Speed Multiplier")
                {
                    Current = new DifficultyControlPoint().SpeedMultiplierBindable
                }
            });
        }

        protected override void OnControlPointChanged(ValueChangedEvent<DifficultyControlPoint> point)
        {
            if (point.NewValue != null)
            {
                multiplierSlider.Current = point.NewValue.SpeedMultiplierBindable;
                multiplierSlider.Current.BindValueChanged(_ => ChangeHandler?.SaveState());
            }
        }

        protected override DifficultyControlPoint CreatePoint()
        {
            var reference = Beatmap.Value.Beatmap.ControlPointInfo.DifficultyPointAt(SelectedGroup.Value.Time);

            return new DifficultyControlPoint
            {
                SpeedMultiplier = reference.SpeedMultiplier,
            };
        }
    }
}

Add change handling for difficulty section


namespace NEventStore
{
    using FluentAssertions;
    using NEventStore.Persistence.AcceptanceTests;
    using NEventStore.Persistence.AcceptanceTests.BDD;
    using System;
    using Xunit;

    public class DefaultSerializationWireupTests
    {
        public class when_building_an_event_store_without_an_explicit_serializer : SpecificationBase
        {
            private Wireup _wireup;
            private Exception _exception;
            private IStoreEvents _eventStore;
            protected override void Context()
            {
                _wireup = Wireup.Init()
                    .UsingSqlPersistence("fakeConnectionString")
                        .WithDialect(new Persistence.Sql.SqlDialects.MsSqlDialect());
            }

            protected override void Because()
            {
                _exception = Catch.Exception(() => { _eventStore = _wireup.Build(); });
            }

            protected override void Cleanup()
            {
                _eventStore.Dispose();
            }

            [Fact]
            public void should_not_throw_an_argument_null_exception()
            {
                _exception.GetType().Should().NotBe(typeof(ArgumentNullException));
            }
        }
    }
}

namespace NEventStore
{
    using FluentAssertions;
    using NEventStore.Persistence.AcceptanceTests;
    using NEventStore.Persistence.AcceptanceTests.BDD;
    using System;
    using Xunit;

    public class DefaultSerializationWireupTests
    {
        public class when_building_an_event_store_without_an_explicit_serializer : SpecificationBase
        {
            private Wireup _wireup;
            private Exception _exception;
            private IStoreEvents _eventStore;
            protected override void Context()
            {
                _wireup = Wireup.Init()
                    .UsingSqlPersistence("fakeConnectionString")
                        .WithDialect(new Persistence.Sql.SqlDialects.MsSqlDialect());
            }

            protected override void Because()
            {
                _exception = Catch.Exception(() => { _eventStore = _wireup.Build(); });
            }

            protected override void Cleanup()
            {
                _eventStore.Dispose();
            }

            [Fact]
            public void should_not_throw_an_argument_null_exception()
            {
                if (_exception != null)
                {
                    _exception.GetType().Should().NotBe<ArgumentNullException>();
                }
            }
        }
    }
}

Fix assertion, need to check if it's not null first.


namespace SnappyMap.CommandLine
{
    using System.Collections.Generic;

    using global::CommandLine;
    using global::CommandLine.Text;

    public class Options
    {
        [Option('s', "size", DefaultValue = "8x8", HelpText = "Set the size of the output map.")]
        public string Size { get; set; }

        [Option('l', "library", DefaultValue = "library", HelpText = "Set the directory to search for tilesets in.")]
        public string LibraryPath { get; set; }

        [Option('c', "config", DefaultValue = "config.xml", HelpText = "Set the path to the section config file.")]
        public string ConfigFile { get; set; }

        [ValueList(typeof(List<string>), MaximumElements = 2)]
        public IList<string> Items { get; set; }

        [HelpOption]
        public string GetUsage()
        {
            var help = new HelpText
                {
                    Heading = new HeadingInfo("Snappy Map", "alpha"),
                    Copyright = new CopyrightInfo("Armoured Fish", 2014),
                    AddDashesToOption = true,
                    AdditionalNewLineAfterOption = true,
                };

            help.AddPreOptionsLine(string.Format("Usage: {0} [-s NxM] [-l <library_path>] [-c <config_file>] <input_file> [output_file]", "SnappyMap"));
            help.AddOptions(this);
            return help;
        }
    }
}

namespace SnappyMap.CommandLine
{
    using System.Collections.Generic;

    using global::CommandLine;
    using global::CommandLine.Text;

    public class Options
    {
        [Option('s', "size", DefaultValue = "8x8", HelpText = "Set the size of the output map.")]
        public string Size { get; set; }

        [Option('t', "tileset-dir", DefaultValue = "tilesets", HelpText = "Set the directory to search for tilesets in.")]
        public string LibraryPath { get; set; }

        [Option('c', "config", DefaultValue = "config.xml", HelpText = "Set the path to the section config file.")]
        public string ConfigFile { get; set; }

        [ValueList(typeof(List<string>), MaximumElements = 2)]
        public IList<string> Items { get; set; }

        [HelpOption]
        public string GetUsage()
        {
            var help = new HelpText
                {
                    Heading = new HeadingInfo("Snappy Map", "alpha"),
                    Copyright = new CopyrightInfo("Armoured Fish", 2014),
                    AddDashesToOption = true,
                    AdditionalNewLineAfterOption = true,
                };

            help.AddPreOptionsLine(string.Format("Usage: {0} [-s NxM] [-l <library_path>] [-c <config_file>] <input_file> [output_file]", "SnappyMap"));
            help.AddOptions(this);
            return help;
        }
    }
}

Change library command line option

Change library command line option


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

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

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fe4a2ebf-8685-4948-87f4-56fe7d986c5a")]

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

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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Sieve.NET.Core")]
[assembly: AssemblyDescription("An expression-based filtering library for .NET")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sieve.NET.Core")]
[assembly: AssemblyCopyright("Copyright ©  2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

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

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fe4a2ebf-8685-4948-87f4-56fe7d986c5a")]

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

Update assembly to version 0.

Update assembly to version 0.


using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using TodoPad.Models;
using TodoPad.Task_Parser;

namespace TodoPad.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void DocumentBoxTextChanged(object sender, TextChangedEventArgs e)
        {
            RichTextBox textBox = (RichTextBox)sender;

            // Remove this handler so we don't trigger it when formatting.
            textBox.TextChanged -= DocumentBoxTextChanged;

            Paragraph currentParagraph = textBox.Document.Blocks.FirstBlock as Paragraph;
            while (currentParagraph != null)
            {
                // Get the text on this row.
                TextPointer start = currentParagraph.ContentStart;
                TextPointer end = currentParagraph.ContentEnd;
                TextRange currentTextRange = new TextRange(start, end);

                // Parse the row.
                Row currentRow = new Row(currentTextRange.Text);

                // Format the displayed text.
                TaskParser.FormatTextRange(currentTextRange, currentRow);

                currentParagraph = currentParagraph.NextBlock as Paragraph;
            }

            // Restore this handler.
            textBox.TextChanged += DocumentBoxTextChanged;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using TodoPad.Models;
using TodoPad.Task_Parser;

namespace TodoPad.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void DocumentBoxTextChanged(object sender, TextChangedEventArgs e)
        {
            RichTextBox textBox = (RichTextBox)sender;

            // Remove this handler so we don't trigger it when formatting.
            textBox.TextChanged -= DocumentBoxTextChanged;

            // Get the line that was changed.
            foreach (TextChange currentChange in e.Changes)
            {
                TextPointer offSet = textBox.Document.ContentStart.GetPositionAtOffset(currentChange.Offset, LogicalDirection.Forward);

                if (offSet != null)
                {
                    Paragraph currentParagraph = offSet.Paragraph;

                    if (offSet.Parent == textBox.Document)
                    {
                        // Format the entire document.
                        currentParagraph = textBox.Document.Blocks.FirstBlock as Paragraph;

                        while (currentParagraph != null)
                        {
                            FormatParagraph(currentParagraph);
                            currentParagraph = currentParagraph.NextBlock as Paragraph;
                        }
                    }
                    else if (currentParagraph != null)
                    {
                        FormatParagraph(currentParagraph);
                    }
                }
            }

            // Restore this handler.
            textBox.TextChanged += DocumentBoxTextChanged;
        }

        private static void FormatParagraph(Paragraph currentParagraph)
        {
            // Get the text on this row.
            TextPointer start = currentParagraph.ContentStart;
            TextPointer end = currentParagraph.ContentEnd;
            TextRange currentTextRange = new TextRange(start, end);

            // Parse the row.
            Row currentRow = new Row(currentTextRange.Text);

            // Format the displayed text.
            TaskParser.FormatTextRange(currentTextRange, currentRow);
        }
    }
}

Change parsing to only trigger on changed lines.


using System.Linq;
using NUnit.Framework;
using Xamarin.UITest;

namespace MvvmLightBindings.UITest
{
    [TestFixture(Platform.Android)]
    [TestFixture(Platform.iOS)]
    public class Tests
    {
        IApp app;
        Platform platform;

        public Tests(Platform platform)
        {
            this.platform = platform;
        }

        [SetUp]
        public void BeforeEachTest()
        {
            app = AppInitializer.StartApp(platform);
        }

        [Test]
        public void AppLaunches()
        {
            app.Repl();
        }

        [Test]
        public void EnterAndSubmitText_ItAppearsInTheSubmittedTextLabel()
        {
            app.EnterText(q => q.Marked("InputMessageEntry"), "Hello from Xamarin Test Cloud");
            app.Screenshot("Has entered text");
            app.Tap(q => q.Marked("SubmitMessageButton"));
            app.Screenshot("Has taped the submit button.");
            Assert.IsFalse(string.IsNullOrEmpty(app.Query(q => q.Marked("SubmittedMessageLabel")).First().Text));
        }
    }
}

using System.Linq;
using NUnit.Framework;
using Xamarin.UITest;

namespace MvvmLightBindings.UITest
{
    [TestFixture(Platform.Android)]
    [TestFixture(Platform.iOS)]
    public class Tests
    {
        IApp app;
        Platform platform;

        public Tests(Platform platform)
        {
            this.platform = platform;
        }

        [SetUp]
        public void BeforeEachTest()
        {
            app = AppInitializer.StartApp(platform);
        }

        [Test]
        [Ignore]
        public void AppLaunches()
        {
            app.Repl();
        }

        [Test]
        [Category("all")]
        public void EnterAndSubmitText_ItAppearsInTheSubmittedTextLabel()
        {
            app.EnterText(q => q.Marked("InputMessageEntry"), "Hello from Xamarin Test Cloud");
            app.Screenshot("Has entered text");
            app.Tap(q => q.Marked("SubmitMessageButton"));
            app.Screenshot("Has taped the submit button.");
            Assert.IsFalse(string.IsNullOrEmpty(app.Query(q => q.Marked("SubmittedMessageLabel")).First().Text));
        }
    }
}

Add category to test run

Add category to test run


using System;
namespace SPAD.neXt.Interfaces.SimConnect
{

    public interface IDataItemAttributeBase
    {
        int ItemIndex
        {
            get;
            set;
        }
        int ItemSize
        {
            get;
            set;
        }
        float ItemEpsilon
        {
            get;
            set;
        }
        int ItemOffset { get; set; }
    }
    public interface IDataItemBoundBase
    {
         string DatumName { get; }
         string UnitsName { get; }
         string ID { get; }
    }
}

using System;
namespace SPAD.neXt.Interfaces.SimConnect
{

    public interface IDataItemAttributeBase
    {
        int ItemIndex
        {
            get;
            set;
        }
        int ItemSize
        {
            get;
            set;
        }
        float ItemEpsilon
        {
            get;
            set;
        }
        int ItemOffset { get; set; }
        bool IsFixedSize { get; set; }
    }
    public interface IDataItemBoundBase
    {
         string DatumName { get; }
         string UnitsName { get; }
         string ID { get; }
    }
}

Add support for fixed structures

Add support for fixed structures


using System;
using Digipost.Api.Client.Domain.Enums;

namespace Digipost.Api.Client.Domain.Identify
{
    public class IdentificationById : IIdentification
    {
        public IdentificationById(IdentificationType identificationType, string value)
        {
            IdentificationType = identificationType;
            Value = value;
        }

        public IdentificationType IdentificationType { get; private set; }

        public object Data
        {
            get { return IdentificationType; }
        }

        [Obsolete("Use IdentificationType instead. Will be removed in future versions" )]
        public IdentificationChoiceType IdentificationChoiceType {
            get
            {
                return ParseIdentificationChoiceToIdentificationChoiceType();
            }
        }

        internal IdentificationChoiceType ParseIdentificationChoiceToIdentificationChoiceType()
        {
            if (IdentificationType == IdentificationType.OrganizationNumber)
            {
                return IdentificationChoiceType.OrganisationNumber;
            }

            return (IdentificationChoiceType)
                Enum.Parse(typeof (IdentificationChoiceType), IdentificationType.ToString(), true);
        }

        public string Value { get; set; }
    }
}

using System;
using Digipost.Api.Client.Domain.Enums;

namespace Digipost.Api.Client.Domain.Identify
{
    public class IdentificationById : IIdentification
    {
        public IdentificationById(IdentificationType identificationType, string value)
        {
            IdentificationType = identificationType;
            Value = value;
        }

        public IdentificationType IdentificationType { get; private set; }

        public object Data
        {
            get { return IdentificationType; }
        }

        [Obsolete("Use IdentificationType instead. Will be removed in future versions" )]
        public IdentificationChoiceType IdentificationChoiceType {
            get
            {
                return ParseIdentificationChoiceToIdentificationChoiceType();
            }
        }

        internal IdentificationChoiceType ParseIdentificationChoiceToIdentificationChoiceType()
        {
            if (IdentificationType == IdentificationType.OrganizationNumber)
            {
                return IdentificationChoiceType.OrganisationNumber;
            }

            return (IdentificationChoiceType)
                Enum.Parse(typeof (IdentificationChoiceType), IdentificationType.ToString(), ignoreCase: true);
        }

        public string Value { get; set; }
    }
}

Add descriptor to IgnoreCase for parsing of enum


@model SendLogInLinkModel
@{
    ViewBag.Title = "Send Log In Link";
}

Welcome to Secret Santa!

            @using (Html.BeginForm("LogIn", "Account", FormMethod.Post, new { role = "form", @class = "form-horizontal" }))
            {
                <fieldset>
                    <legend>@ViewBag.Title</legend>

                        If you misplaced your log-in email, you can use this form to have another
                        log-in link sent to you.

                        @Html.LabelFor(m => m.Email, new { @class = "control-label col-sm-4" })

                            @Html.EditorFor(m => m.Email)
                            @Html.ValidationMessageFor(m => m.Email)

                            <button type="submit" class="btn btn-default">Send Log-In Link</button>

                </fieldset>
            }

@model SendLogInLinkModel
@{
    ViewBag.Title = "Send Log In Link";
}

Welcome to Secret Santa!

            @using (Html.BeginForm("SendLogInLink", "Account", FormMethod.Post, new { role = "form", @class = "form-horizontal" }))
            {
                <fieldset>
                    <legend>@ViewBag.Title</legend>

                        If you misplaced your log-in email, you can use this form to have another
                        log-in link sent to you.

                        @Html.LabelFor(m => m.Email, new { @class = "control-label col-sm-4" })

                            @Html.EditorFor(m => m.Email)
                            @Html.ValidationMessageFor(m => m.Email)

                            <button type="submit" class="btn btn-default">Send Log-In Link</button>

                </fieldset>
            }

Correct action for send log in link form


using System;
using FluentAssertions;
using NUnit.Framework;
using Withings.NET.Client;

namespace Withings.Specifications
{
    [TestFixture]
    public class DateTimeExtensionsTests
    {
        [Test]
        public void DoubleFromUnixTimeTest()
        {
            ((double)1491934309).FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void LongFromUnixTimeTest()
        {
            ((long)1491934309).FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void IntFromUnixTimeTest()
        {
            1491934309.FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void DateTimeToUnixTimeTest()
        {
            DateTime.Parse("04/11/2017").Should().Equals(1491934309);
        }
    }
}

using System;
using FluentAssertions;
using NUnit.Framework;
using Withings.NET.Client;

namespace Withings.Specifications
{
    [TestFixture]
    public class DateTimeExtensionsTests
    {
        [Test]
        public void DoubleFromUnixTimeTest()
        {
            ((double)1491934309).FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void LongFromUnixTimeTest()
        {
            ((long)1491934309).FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void IntFromUnixTimeTest()
        {
            1491934309.FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void DateTimeToUnixTimeTest()
        {
            DateTime.Parse("04/11/2017").ToUnixTime().Should().Equals(1491934309);
        }
    }
}

Add Tests For DateTime Extensions

Add Tests For DateTime Extensions


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

using System;
using System.Threading;
using NUnit.Framework;
using osu.Framework.Platform;

namespace osu.Framework.Tests.Platform
{
    [TestFixture]
    public class HeadlessGameHostTest
    {
        private class Foobar
        {
            public string Bar;
        }

        [Test]
        public void TestIpc()
        {
            using (var server = new HeadlessGameHost(@"server", true))
            using (var client = new HeadlessGameHost(@"client", true))
            {
                Assert.IsTrue(server.IsPrimaryInstance, @"Server wasn't able to bind");
                Assert.IsFalse(client.IsPrimaryInstance, @"Client was able to bind when it shouldn't have been able to");

                var serverChannel = new IpcChannel<Foobar>(server);
                var clientChannel = new IpcChannel<Foobar>(client);

                Action waitAction = () =>
                {
                    bool received = false;
                    serverChannel.MessageReceived += message =>
                    {
                        Assert.AreEqual("example", message.Bar);
                        received = true;
                    };

                    clientChannel.SendMessageAsync(new Foobar { Bar = "example" }).Wait();

                    while (!received)
                        Thread.Sleep(1);
                };

                Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(10000),
                    @"Message was not received in a timely fashion");
            }
        }
    }
}

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

using System;
using System.Threading;
using System.Threading.Tasks;
using NUnit.Framework;
using osu.Framework.Platform;

namespace osu.Framework.Tests.Platform
{
    [TestFixture]
    public class HeadlessGameHostTest
    {
        private class Foobar
        {
            public string Bar;
        }

        [Test]
        public void TestIpc()
        {
            using (var server = new HeadlessGameHost(@"server", true))
            using (var client = new HeadlessGameHost(@"client", true))
            {
                Assert.IsTrue(server.IsPrimaryInstance, @"Server wasn't able to bind");
                Assert.IsFalse(client.IsPrimaryInstance, @"Client was able to bind when it shouldn't have been able to");

                var serverChannel = new IpcChannel<Foobar>(server);
                var clientChannel = new IpcChannel<Foobar>(client);

                Action waitAction = () =>
                {
                    bool received = false;
                    serverChannel.MessageReceived += message =>
                    {
                        Assert.AreEqual("example", message.Bar);
                        received = true;
                    };

                    clientChannel.SendMessageAsync(new Foobar { Bar = "example" }).Wait();

                    while (!received)
                        Thread.Sleep(1);
                };

                Assert.IsTrue(Task.Run(waitAction).Wait(10000), @"Message was not received in a timely fashion");
            }
        }
    }
}

Fix usage of deprecated Action.BeginInvoke()


// 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.Screens;
using osu.Game.Screens.Menu;

namespace osu.Game.Tests.Visual.Menus
{
    [TestFixture]
    public class TestSceneIntroWelcome : IntroTestScene
    {
        protected override IScreen CreateScreen() => new IntroWelcome();

        public TestSceneIntroWelcome()
        {
            AddAssert("check if menu music loops", () =>
            {
                var menu = IntroStack?.CurrentScreen as MainMenu;

                if (menu == null)
                    return false;

                return menu.Track.Looping;
            });
        }
    }
}

// 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.Audio.Track;
using osu.Framework.Screens;
using osu.Game.Screens.Menu;

namespace osu.Game.Tests.Visual.Menus
{
    [TestFixture]
    public class TestSceneIntroWelcome : IntroTestScene
    {
        protected override IScreen CreateScreen() => new IntroWelcome();

        public TestSceneIntroWelcome()
        {
            AddUntilStep("wait for load", () => getTrack() != null);

            AddAssert("check if menu music loops", () => getTrack().Looping);
        }

        private Track getTrack() => (IntroStack?.CurrentScreen as MainMenu)?.Track;
    }
}

Fix "welcome" intro test failure due to no wait logic


using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Permissions;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("MongoDBDriver")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: CLSCompliantAttribute(true)]

[assembly: InternalsVisibleTo("MongoDB.Driver.Tests")]

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Bson")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Bson")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Permissions;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("MongoDBDriver")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: CLSCompliantAttribute(true)]

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Bson")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Bson")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]

Revert last commit since it is currently not possible.


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

namespace SGEnviro.Utilities
{
    public class NumberParseException : Exception
    {
        public NumberParseException(string message) { }
    }

    public class Parsing
    {
        public static void ParseFloatOrThrowException(string value, out float destination, string message)
        {
            if (!float.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out destination))
            {
                throw new Exception(message);
            }
        }
    }
}

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

namespace SGEnviro.Utilities
{
    public class NumberParseException : Exception
    {
        public NumberParseException(string message) { }
    }

    public class Parsing
    {
        public static void ParseFloatOrThrowException(string value, out float destination, string message)
        {
            if (!float.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out destination))
            {
                throw new NumberParseException(message);
            }
        }

        public static void ParseIntOrThrowException(string value, out int destination, string message)
        {
            if (!int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out destination))
            {
                throw new NumberParseException(message);
            }
        }
    }
}

Add method to parse ints and throw exception on failure.


using System;
using System.Collections.Generic;

namespace WendySharp
{
    class Parrot : Command
    {
        public Parrot()
        {
            Match = new List<string>
            {
                "parrot"
            };
            Usage = "<text>";
            ArgumentMatch = "(?<text>.+)$";
            HelpText = "Echo a message back to the channel.";
        }

        public override void OnCommand(CommandArguments command)
        {
            var text = command.Arguments.Groups["text"].Value;

            Log.WriteInfo("Parrot", "'{0}' said to '{1}': {2}", command.Event.Sender, command.Event.Recipient, text);

            Bootstrap.Client.Client.Message(command.Event.Recipient, string.Format("\u200B{0}", text));
        }
    }
}

using System;
using System.Collections.Generic;

namespace WendySharp
{
    class Parrot : Command
    {
        public Parrot()
        {
            Match = new List<string>
            {
                "parrot"
            };
            Usage = "<text>";
            ArgumentMatch = "(?<text>.+)$";
            HelpText = "Echo a message back to the channel.";
        }

        public override void OnCommand(CommandArguments command)
        {
            var text = command.Arguments.Groups["text"].Value;

            if (text.Length > 140)
            {
                command.Reply("That message is too long to be parroted.");
                return;
            }

            Log.WriteInfo("Parrot", "'{0}' said to '{1}': {2}", command.Event.Sender, command.Event.Recipient, text);

            Bootstrap.Client.Client.Message(command.Event.Recipient, string.Format("\u200B{0}", text));
        }
    }
}

Add max length to parrot

Add max length to parrot


using Ninject;
using Ninject.Modules;
using Ninject.Web.Common;

using Raven.Client;
using Raven.Client.Embedded;

namespace CGO.Web.NinjectModules
{
    public class RavenModule : NinjectModule
    {
        public override void Load()
        {
            Kernel.Bind<IDocumentStore>().ToMethod(_ => InitialiseDocumentStore()).InSingletonScope();
            Kernel.Bind<IDocumentSession>().ToMethod(_ => Kernel.Get<IDocumentStore>().OpenSession()).InRequestScope();
        }

        private static IDocumentStore InitialiseDocumentStore()
        {
            var documentStore = new EmbeddableDocumentStore
            {
                DataDirectory = "CGO.raven",
                UseEmbeddedHttpServer = true,
                Configuration = { Port = 28645 }
            };

            documentStore.Initialize();
            documentStore.InitializeProfiling();

            return documentStore;
        }
    }
}

using Ninject;
using Ninject.Modules;
using Ninject.Web.Common;

using Raven.Client;
using Raven.Client.Embedded;

namespace CGO.Web.NinjectModules
{
    public class RavenModule : NinjectModule
    {
        public override void Load()
        {
            Kernel.Bind<IDocumentStore>().ToMethod(_ => InitialiseDocumentStore()).InSingletonScope();
            Kernel.Bind<IDocumentSession>().ToMethod(_ => Kernel.Get<IDocumentStore>().OpenSession()).InRequestScope();
        }

        private static IDocumentStore InitialiseDocumentStore()
        {
            var documentStore = new EmbeddableDocumentStore
            {
                DataDirectory = "CGO.raven",
                Configuration = { Port = 28645 }
            };

            documentStore.Initialize();
            documentStore.InitializeProfiling();

            return documentStore;
        }
    }
}

Disable Raven's Embedded HTTP server

Disable Raven's Embedded HTTP server

I'm not really making use of this, and it's preventing successful
deployment in Azure.


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

using osu.Framework.Statistics;
using System;
using System.Collections.Generic;
using osu.Framework.Audio;

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

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

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

        private void onNewFrame()
        {
            lock (managers)
            foreach (var m in managers)
                m.Update();
        }

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

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

        protected override void PerformExit()
        {
            base.PerformExit();
            ManagedBass.Bass.Free();
        }
    }
}

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

using osu.Framework.Statistics;
using System;
using System.Collections.Generic;
using osu.Framework.Audio;

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

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

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

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

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

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

        protected override void PerformExit()
        {
            base.PerformExit();
            ManagedBass.Bass.Free();
        }
    }
}

Use for loop to avoid nested unregister case


using System.Collections.Generic;

namespace BmpListener.Serialization.Models
{
    public class UpdateModel
    {
        public PeerHeaderModel Peer { get; set; }
        public string Origin { get; set; }
        public IList<int> AsPath { get; set; }
        public IList<AnnounceModel> Announce { get; set; }
        public IList<WithdrawModel> Withdraw { get; set; }
    }
}

using System.Collections.Generic;

namespace BmpListener.Serialization.Models
{
    public class UpdateModel
    {
        public int BmpMsgLength { get; set; }
        public int BgpMsgLength { get; set; }
        public PeerHeaderModel Peer { get; set; }
        public string Origin { get; set; }
        public IList<int> AsPath { get; set; }
        public IList<AnnounceModel> Announce { get; set; }
        public IList<WithdrawModel> Withdraw { get; set; }
    }
}

Add BGP and BMP message lengths to JSON

Add BGP and BMP message lengths to JSON


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

namespace Raven.Contrib.AspNet.Demo.Extensions
{
    public static class UriExtensions
    {
        public static Uri AddQueryParameter(this Uri uri, KeyValuePair<string, string> pair)
        {
            return uri.AddQueryParameter(pair.Key, pair.Value);
        }

        public static Uri AddQueryParameter(this Uri uri, string key, string value)
        {
            var builder = new UriBuilder(uri);

            string encodedKey   = Uri.EscapeDataString(key);
            string encodedValue = Uri.EscapeDataString(value);
            string queryString  = String.Format("{0}={1}", encodedKey, encodedValue);

            builder.Query += String.IsNullOrEmpty(builder.Query) ? queryString : "&" + queryString;

            return builder.Uri;
        }
    }
}

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

namespace Raven.Contrib.AspNet.Demo.Extensions
{
    public static class UriExtensions
    {
        public static Uri AddQueryParameter(this Uri uri, KeyValuePair<string, string> pair)
        {
            return uri.AddQueryParameter(pair.Key, pair.Value);
        }

        public static Uri AddQueryParameter(this Uri uri, string key, string value)
        {
            var builder = new UriBuilder(uri);

            string encodedKey   = Uri.EscapeDataString(key);
            string encodedValue = Uri.EscapeDataString(value);
            string queryString  = String.Format("{0}={1}", encodedKey, encodedValue);

            builder.Query = String.IsNullOrEmpty(builder.Query) ? queryString : builder.Query.Substring(1) + "&" + queryString;

            return builder.Uri;
        }
    }
}

Fix "double question mark" bug in UriBuilder

I ran into this bug when calling AddQueryParameter multiple times.

I found the solution here: http://www.andornot.com/blog/post/The-Uri-gotcha-that-gotchad-me-good.aspx


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

namespace QuantConnect.Algorithm.CSharp.Benchmarks
{
    public class EmptyMinute400EquityAlgorithm : QCAlgorithm
    {
        public override void Initialize()
        {
            SetStartDate(2015, 09, 28);
            SetEndDate(2015, 10, 28);
            foreach (var symbol in Symbols.Equity.All.Take(400))
            {
                AddSecurity(SecurityType.Equity, symbol);
            }
        }

        public override void OnData(Slice slice)
        {
        }
    }
}

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

namespace QuantConnect.Algorithm.CSharp.Benchmarks
{
    public class EmptyMinute400EquityAlgorithm : QCAlgorithm
    {
        public override void Initialize()
        {
            SetStartDate(2015, 09, 28);
            SetEndDate(2015, 11, 13);
            foreach (var symbol in Symbols.Equity.All.Take(400))
            {
                AddSecurity(SecurityType.Equity, symbol);
            }
        }

        public override void OnData(Slice slice)
        {
        }
    }
}

Increase length of benchmark algorithm

Increase length of benchmark algorithm


<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="text"><?cs var:title ?></title>
	<subtitle type="text"><?cs var:title ?></subtitle>
	<id><?cs var:url ?>/</id>
	<link rel="self" href="<?cs var:url ?><?cs var:CGI.RequestURI ?>" />
	<link rel="alternate" type="text/html" href="<?cs var:url ?>" />
	<updated><?cs var:gendate ?></updated>
	<author><name><?cs var:author ?></name></author>
	<generator uri="<?cs var:CBlog.url ?>" version="<?cs var:CBlog.version ?>"><?cs var:CBlog.version ?></generator>
	<?cs each:post = Posts ?>
	<entry>
		<title type="text"><?cs var:post.title ?></title>
		<author><name>Bapt</name></author>
		<content type="html"><?cs var:html_escape(post.html) ?></content>
		<?cs each:tag = post.tags ?><category term="<?cs var:tag.name ?>" /><?cs /each ?>
		<id><?cs var:url ?>post/<?cs var:post.filename ?></id>
		<link rel="alternate" href="<?cs var:url ?>/post/<?cs var:post.filename ?>" />
		<updated><?cs var:post.date ?></updated>
		<published><?cs var:post.date ?></published>
	</entry>
	<?cs /each ?>
</feed>

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="text"><?cs var:title ?></title>
	<subtitle type="text"><?cs var:title ?></subtitle>
	<id><?cs var:url ?>/</id>
	<link rel="self" href="<?cs var:url ?><?cs var:CGI.RequestURI ?>" />
	<link rel="alternate" type="text/html" href="<?cs var:url ?>" />
	<updated><?cs var:gendate ?></updated>
	<author><name><?cs var:author ?></name></author>
	<generator uri="<?cs var:CBlog.url ?>" version="<?cs var:CBlog.version ?>"><?cs var:CBlog.version ?></generator>
	<?cs each:post = Posts ?>
	<entry>
		<title type="text"><?cs var:post.title ?></title>
		<author><name><?cs var:author ?></name></author>
		<content type="html"><?cs var:html_escape(post.html) ?></content>
		<?cs each:tag = post.tags ?><category term="<?cs var:tag.name ?>" /><?cs /each ?>
		<id><?cs var:url ?>post/<?cs var:post.filename ?></id>
		<link rel="alternate" href="<?cs var:url ?>/post/<?cs var:post.filename ?>" />
		<updated><?cs var:post.date ?></updated>
		<published><?cs var:post.date ?></published>
	</entry>
	<?cs /each ?>
</feed>

Use new author var for posts too

Use new author var for posts too


using System;
using Prism.Mvvm;
using Prism.Navigation;
using Reactive.Bindings;

namespace BlueMonkey.ViewModels
{
    /// <summary>
    /// ViewModel for MainPage.
    /// </summary>
    public class MainPageViewModel : BindableBase
    {
        /// <summary>
        /// NavigationService
        /// </summary>
        private readonly INavigationService _navigationService;

        /// <summary>
        /// Command of navigate next pages.
        /// </summary>
        public ReactiveCommand<string> NavigateCommand { get; }

        /// <summary>
        /// Initialize instance.
        /// </summary>
        /// <param name="navigationService"></param>
        public MainPageViewModel(INavigationService navigationService)
        {
            _navigationService = navigationService;

            NavigateCommand = new ReactiveCommand<string>();
            NavigateCommand.Subscribe(Navigate);
        }

        /// <summary>
        /// Navigate next page.
        /// </summary>
        /// <param name="uri"></param>
        private void Navigate(string uri)
        {
            _navigationService.NavigateAsync(uri);
        }
    }
}

using System;
using Prism.Mvvm;
using Prism.Navigation;
using Prism.Services;
using Reactive.Bindings;

namespace BlueMonkey.ViewModels
{
    /// <summary>
    /// ViewModel for MainPage.
    /// </summary>
    public class MainPageViewModel : BindableBase
    {
        /// <summary>
        /// NavigationService
        /// </summary>
        private readonly INavigationService _navigationService;

		/// <summary>
		/// The page dialog service.
		/// </summary>
		private readonly IPageDialogService _pageDialogService;

        /// <summary>
        /// Command of navigate next pages.
        /// </summary>
        public ReactiveCommand<string> NavigateCommand { get; }

        /// <summary>
        /// Initialize instance.
        /// </summary>
        /// <param name="navigationService"></param>
		/// <param name="pageDialogService"></param>
        public MainPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService)
        {
            _navigationService = navigationService;
			_pageDialogService = pageDialogService;

            NavigateCommand = new ReactiveCommand<string>();
            NavigateCommand.Subscribe(Navigate);
        }

        /// <summary>
        /// Navigate next page.
        /// </summary>
        /// <param name="uri"></param>
		private async void Navigate(string uri)
        {
			if (Secrets.ServerUri.Contains("your"))
			{
				await _pageDialogService.DisplayAlertAsync(
					"Invalid Server Uri",
					"You should write actual ServerUri and ConnectionString to Secrets.cs",
					"Close");
				return;
			}

            await _navigationService.NavigateAsync(uri);
        }
    }
}

Change to show alert if Secrets.cs is not edited


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

using Realms;
using System.IO;

namespace Tasky.Shared
{
    /// <summary>
    /// TaskDatabase uses ADO.NET to create the [Items] table and create,read,update,delete data
    /// </summary>
    public class TodoDatabase
    {
        private Realm realm;

        public TodoDatabase ()
        {
            realm = Realm.GetInstance();
        }

        public TodoItem CreateTodoItem()
        {
            var result = realm.CreateObject<TodoItem>();
            result.ID = Guid.NewGuid().ToString();
            return result;
        }

        public Transaction BeginTransaction()
        {
            return realm.BeginWrite();
        }

        public IEnumerable<TodoItem> GetItems ()
        {
            return realm.All<TodoItem>().ToList();
        }

        public TodoItem GetItem (string id)
        {
            return realm.All<TodoItem>().single(i => i.ID == id);
        }

        public void SaveItem (TodoItem item)
        {
            // Nothing to see here...
        }

        public string DeleteItem(string id)
        {
            realm.Remove(GetItem(id));
            return id;
        }
    }
}

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

using Realms;
using System.IO;

namespace Tasky.Shared
{
    /// <summary>
    /// TaskDatabase uses ADO.NET to create the [Items] table and create,read,update,delete data
    /// </summary>
    public class TodoDatabase
    {
        private Realm realm;

        public TodoDatabase ()
        {
            realm = Realm.GetInstance();
        }

        public TodoItem CreateTodoItem()
        {
            var result = realm.CreateObject<TodoItem>();
            result.ID = Guid.NewGuid().ToString();
            return result;
        }

        public Transaction BeginTransaction()
        {
            return realm.BeginWrite();
        }

        public IEnumerable<TodoItem> GetItems ()
        {
            return realm.All<TodoItem>().ToList();
        }

        public TodoItem GetItem (string id)
        {
            return realm.All<TodoItem>().Single(i => i.ID == id);
        }

        public void SaveItem (TodoItem item)
        {
            // Nothing to see here...
        }

        public string DeleteItem(string id)
        {
            realm.Remove(GetItem(id));
            return id;
        }
    }
}

Fix typo in Tasky GetItem

Fix typo in Tasky GetItem


//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool
//     Changes to this file will be lost if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public abstract class Component
{
	private Vector2D position
	{
		get;
		set;
	}

}

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool
//     Changes to this file will be lost if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public abstract class Component
{
	private Vector position
	{
		get;
		set;
	}

}

Use newly created vector object

Use newly created vector object


using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace ZendeskApi_v2.Models.Targets
{
    public class BaseTarget
    {
        [JsonProperty("id")]
        public long? Id { get; set; }

        [JsonProperty("title")]
        public string Title { get; set; }

        [JsonProperty("type")]
        public virtual string Type { get; }

        [JsonProperty("active")]
        public bool Active { get; set; }

        [JsonProperty("created_at")]
        [JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTimeOffset? CreatedAt { get; set; }
    }
}

using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace ZendeskApi_v2.Models.Targets
{
    public class BaseTarget
    {
        [JsonProperty("id")]
        public long? Id { get; set; }

        [JsonProperty("title")]
        public string Title { get; set; }

        [JsonProperty("type")]
        public virtual string Type { get; private set; }

        [JsonProperty("active")]
        public bool Active { get; set; }

        [JsonProperty("created_at")]
        [JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTimeOffset? CreatedAt { get; set; }
    }
}

Test fix for appveyor CS0840

Test fix for appveyor CS0840


using System;
using System.Drawing;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
using NLog;
using Radish.Support;
using System.IO;

namespace Radish
{
	public partial class AppDelegate : NSApplicationDelegate
	{
		private static Logger logger = LogManager.GetCurrentClassLogger();
		MainWindowController controller;

		public AppDelegate()
		{
		}

		public override void FinishedLaunching(NSObject notification)
		{
            var urlList = new NSFileManager().GetUrls(NSSearchPathDirectory.LibraryDirectory, NSSearchPathDomain.User);
            Preferences.Load(Path.Combine(
                urlList[0].Path,
                "Preferences",
                "com.rangic.Radish.json"));

            if (controller == null)
			{
				controller = new MainWindowController();
				controller.Window.MakeKeyAndOrderFront(this);
			}
		}

		public override bool OpenFile(NSApplication sender, string filename)
		{
			logger.Info("OpenFile '{0}'", filename);

			if (controller == null)
			{
				controller = new MainWindowController();
				controller.Window.MakeKeyAndOrderFront(this);
			}

			return controller.OpenFolderOrFile(filename);
		}
	}
}

using System;
using System.Drawing;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
using NLog;
using Radish.Support;
using System.IO;

namespace Radish
{
	public partial class AppDelegate : NSApplicationDelegate
	{
		private static Logger logger = LogManager.GetCurrentClassLogger();
		private MainWindowController controller;
        private string filename;

		public AppDelegate()
		{
		}

		public override void FinishedLaunching(NSObject notification)
		{
            var urlList = new NSFileManager().GetUrls(NSSearchPathDirectory.LibraryDirectory, NSSearchPathDomain.User);
            Preferences.Load(Path.Combine(
                urlList[0].Path,
                "Preferences",
                "com.rangic.Radish.json"));

			controller = new MainWindowController();
			controller.Window.MakeKeyAndOrderFront(this);

            if (filename != null)
            {
                controller.OpenFolderOrFile(filename);
            }
		}

		public override bool OpenFile(NSApplication sender, string filename)
		{
            if (controller == null)
            {
                this.filename = filename;
    			logger.Info("OpenFile '{0}'", filename);
                return true;
            }

            return controller.OpenFolderOrFile(filename);
		}
	}
}

Fix issue of file opened via Finder doesn't always display.


using System.Xml.Serialization;

namespace DevelopmentInProgress.DipState
{
    public enum DipStateActionType
    {
        [XmlEnum("1")]
        Entry,

        [XmlEnum("2")]
        Exit
    }
}

using System.Xml.Serialization;

namespace DevelopmentInProgress.DipState
{
    public enum DipStateActionType
    {
        [XmlEnum("1")]
        Status,

        [XmlEnum("2")]
        Entry,

        [XmlEnum("3")]
        Exit
    }
}

Add action type for status

Add action type for status

Add action type for status


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Moq;
using NuGet.Common;
using NuGet.Extensions.Nuspec;
using NUnit.Framework;

namespace NuGet.Extensions.Tests.Nuspec
{
    [TestFixture]
    public class NuspecBuilderTests
    {
        [Test]
        public void AssemblyNameReplacesNullDescription()
        {
            var console = new Mock<IConsole>();
            const string anyAssemblyName = "any.assembly.name";
            var nullDataSource = new Mock<INuspecDataSource>().Object;

            var nuspecBuilder = new NuspecBuilder(anyAssemblyName);
            nuspecBuilder.SetMetadata(nullDataSource, new List<ManifestDependency>());
            nuspecBuilder.Save(console.Object);

            var nuspecContents = File.ReadAllText(nuspecBuilder.FilePath);
            Assert.That(nuspecContents, Contains.Substring("<description>" + anyAssemblyName + "</description>"));
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Moq;
using NuGet.Common;
using NuGet.Extensions.Nuspec;
using NuGet.Extensions.Tests.MSBuild;
using NUnit.Framework;

namespace NuGet.Extensions.Tests.Nuspec
{
    [TestFixture]
    public class NuspecBuilderTests
    {
        [Test]
        public void AssemblyNameReplacesNullDescription()
        {
            var console = new Mock<IConsole>();
            const string anyAssemblyName = "any.assembly.name";
            var nullDataSource = new Mock<INuspecDataSource>().Object;

            var nuspecBuilder = new NuspecBuilder(anyAssemblyName);
            nuspecBuilder.SetMetadata(nullDataSource, new List<ManifestDependency>());
            nuspecBuilder.Save(console.Object);

            var nuspecContents = File.ReadAllText(nuspecBuilder.FilePath);
            Assert.That(nuspecContents, Contains.Substring("<description>" + anyAssemblyName + "</description>"));
            ConsoleMock.AssertConsoleHasNoErrorsOrWarnings(console);
        }

        [TestCase("net40")]
        [TestCase("net35")]
        [TestCase("notARealTargetFramework", Description = "Characterisation: There is no validation on the target framework")]
        public void TargetFrameworkAppearsVerbatimInOutput(string targetFramework)
        {
            var console = new Mock<IConsole>();

            var nuspecBuilder = new NuspecBuilder("anyAssemblyName");
            var anyDependencies = new List<ManifestDependency>{new ManifestDependency {Id="anyDependency", Version = "0.0.0.0"}};
            nuspecBuilder.SetDependencies(anyDependencies, targetFramework);
            nuspecBuilder.Save(console.Object);

            var nuspecContents = File.ReadAllText(nuspecBuilder.FilePath);
            var expectedAssemblyGroupStartTag = string.Format("<group targetFramework=\"{0}\">", targetFramework);
            Assert.That(nuspecContents, Contains.Substring(expectedAssemblyGroupStartTag));
            ConsoleMock.AssertConsoleHasNoErrorsOrWarnings(console);
        }
    }
}

Test target framework written as expected (characterise current lack of validation)


using System;
using System.Linq;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;

namespace Telegram.Bot.Tests.Integ.Framework
{
    internal static class Extensions
    {
        public static User GetUser(this Update update)
        {
            switch (update.Type)
            {
                case UpdateType.Message:
                    return update.Message.From;
                case UpdateType.InlineQuery:
                    return update.InlineQuery.From;
                case UpdateType.CallbackQuery:
                    return update.CallbackQuery.From;
                case UpdateType.PreCheckoutQuery:
                    return update.PreCheckoutQuery.From;
                case UpdateType.ShippingQuery:
                    return update.ShippingQuery.From;
                case UpdateType.ChosenInlineResult:
                    return update.ChosenInlineResult.From;
                default:
                    throw new ArgumentException("Unsupported update type {0}.", update.Type.ToString());
            }
        }

        public static string GetTesterMentions(this UpdateReceiver updateReceiver)
        {
            return string.Join(", ",
                updateReceiver.AllowedUsernames.Select(username => '@' + username)
            );
        }
    }
}

using System;
using System.Linq;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;

namespace Telegram.Bot.Tests.Integ.Framework
{
    internal static class Extensions
    {
        public static User GetUser(this Update update)
        {
            switch (update.Type)
            {
                case UpdateType.Message:
                    return update.Message.From;
                case UpdateType.InlineQuery:
                    return update.InlineQuery.From;
                case UpdateType.CallbackQuery:
                    return update.CallbackQuery.From;
                case UpdateType.PreCheckoutQuery:
                    return update.PreCheckoutQuery.From;
                case UpdateType.ShippingQuery:
                    return update.ShippingQuery.From;
                case UpdateType.ChosenInlineResult:
                    return update.ChosenInlineResult.From;
                default:
                    throw new ArgumentException("Unsupported update type {0}.", update.Type.ToString());
            }
        }

        public static string GetTesterMentions(this UpdateReceiver updateReceiver)
        {
            return string.Join(", ",
                updateReceiver.AllowedUsernames.Select(username => $"@{username}".Replace("_", "\\_"))
            );
        }
    }
}

Fix bug in fixture with unescaped underscore in username


using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Networking;
public static class UnityUtils
{
    public static bool IsAnyKeyUp(KeyCode[] keys)
    {
        foreach (KeyCode key in keys)
        {
            if (Input.GetKeyUp(key))
                return true;
        }
        return false;
    }

    public static bool IsAnyKeyDown(KeyCode[] keys)
    {
        foreach (KeyCode key in keys)
        {
            if (Input.GetKeyDown(key))
                return true;
        }
        return false;
    }

    public static bool IsAnyKey(KeyCode[] keys)
    {
        foreach (KeyCode key in keys)
        {
            if (Input.GetKey(key))
                return true;
        }
        return false;
    }

    public static bool IsHeadless()
    {
        return SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null;
    }

    public static bool TryGetByNetId<T>(NetworkInstanceId targetNetId, out T output) where T : Component
    {
        output = null;
        GameObject foundObject = ClientScene.FindLocalObject(targetNetId);
        if (foundObject == null)
            return false;

        output = foundObject.GetComponent<T>();
        if (output == null)
            return false;

        return true;
    }
}

using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Networking;
public static class UnityUtils
{
    public static bool IsAnyKeyUp(KeyCode[] keys)
    {
        foreach (KeyCode key in keys)
        {
            if (Input.GetKeyUp(key))
                return true;
        }
        return false;
    }

    public static bool IsAnyKeyDown(KeyCode[] keys)
    {
        foreach (KeyCode key in keys)
        {
            if (Input.GetKeyDown(key))
                return true;
        }
        return false;
    }

    public static bool IsAnyKey(KeyCode[] keys)
    {
        foreach (KeyCode key in keys)
        {
            if (Input.GetKey(key))
                return true;
        }
        return false;
    }

    public static bool IsHeadless()
    {
        return SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null;
    }

    public static bool TryGetGameObjectByNetId(NetworkInstanceId targetNetId, out GameObject output)
    {
        output = null;
        if (NetworkServer.active)
            output = NetworkServer.FindLocalObject(targetNetId);
        else
            output = ClientScene.FindLocalObject(targetNetId);

        if (output == null)
            return false;

        return true;
    }

    public static bool TryGetComponentByNetId<T>(NetworkInstanceId targetNetId, out T output) where T : Component
    {
        output = null;

        GameObject foundObject = null;
        if (TryGetGameObjectByNetId(targetNetId, out foundObject))
        {
            output = foundObject.GetComponent<T>();
            if (output == null)
                return false;

            return true;
        }
        return false;
    }
}

Improve network game object detection codes


using System;
using System.Diagnostics;
using System.Threading;
using System.Web.Routing;
using SignalR.Hosting.AspNet.Routing;
using SignalR.Samples.App_Start;
using SignalR.Samples.Hubs.DemoHub;

[assembly: WebActivator.PreApplicationStartMethod(typeof(Startup), "Start")]

namespace SignalR.Samples.App_Start
{
    public class Startup
    {
        public static void Start()
        {
            ThreadPool.QueueUserWorkItem(_ =>
            {
                var connection = Global.Connections.GetConnection<Streaming.Streaming>();
                var demoClients = Global.Connections.GetClients<DemoHub>();

                while (true)
                {
                    try
                    {
                        connection.Broadcast(DateTime.Now.ToString());
                        demoClients.fromArbitraryCode(DateTime.Now.ToString());
                    }
                    catch (Exception ex)
                    {
                        Trace.TraceError("SignalR error thrown in Streaming broadcast: {0}", ex);
                    }
                    Thread.Sleep(2000);
                }
            });

            RouteTable.Routes.MapConnection<Raw.Raw>("raw", "raw/{*operation}");
            RouteTable.Routes.MapConnection<Streaming.Streaming>("streaming", "streaming/{*operation}");
        }
    }
}

using System;
using System.Diagnostics;
using System.Threading;
using System.Web.Routing;
using SignalR.Hosting.AspNet.Routing;
using SignalR.Samples.App_Start;
using SignalR.Samples.Hubs.DemoHub;

[assembly: WebActivator.PostApplicationStartMethod(typeof(Startup), "Start")]

namespace SignalR.Samples.App_Start
{
    public class Startup
    {
        public static void Start()
        {
            ThreadPool.QueueUserWorkItem(_ =>
            {
                var connection = Global.Connections.GetConnection<Streaming.Streaming>();
                var demoClients = Global.Connections.GetClients<DemoHub>();

                while (true)
                {
                    try
                    {
                        connection.Broadcast(DateTime.Now.ToString());
                        demoClients.fromArbitraryCode(DateTime.Now.ToString());
                    }
                    catch (Exception ex)
                    {
                        Trace.TraceError("SignalR error thrown in Streaming broadcast: {0}", ex);
                    }
                    Thread.Sleep(2000);
                }
            });

            RouteTable.Routes.MapConnection<Raw.Raw>("raw", "raw/{*operation}");
            RouteTable.Routes.MapConnection<Streaming.Streaming>("streaming", "streaming/{*operation}");
        }
    }
}

Change samples to use PostApplicationStart instead of pre.


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

namespace JLChnToZ.LuckyPlayer {
    public class DestinyTuner<T> {
        static DestinyTuner<T> defaultInstance;
        public static DestinyTuner<T> Default {
            get {
                if(defaultInstance == null)
                    defaultInstance = new DestinyTuner<T>();
                return defaultInstance;
            }
        }

        double fineTuneOnSuccess;
        public double FineTuneOnSuccess {
            get { return fineTuneOnSuccess; }
            set {
                if(value < 0 || value > 1)
                    throw new ArgumentOutOfRangeException("Value must be between 0 and 1");
                fineTuneOnSuccess = value;
            }
        }

        public DestinyTuner() {
            fineTuneOnSuccess = -0.0001;
        }

        public DestinyTuner(double fineTuneOnSuccess) {
            FineTuneOnSuccess = fineTuneOnSuccess;
        }

        protected internal virtual void TuneDestinyOnSuccess(LuckyController<T> luckyControl) {
            luckyControl.fineTune *= 1 + fineTuneOnSuccess;
        }
    }
}

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

namespace JLChnToZ.LuckyPlayer {
    public class DestinyTuner<T> {
        static DestinyTuner<T> defaultInstance;
        public static DestinyTuner<T> Default {
            get {
                if(defaultInstance == null)
                    defaultInstance = new DestinyTuner<T>();
                return defaultInstance;
            }
        }

        double fineTuneOnSuccess;
        public double FineTuneOnSuccess {
            get { return fineTuneOnSuccess; }
            set { fineTuneOnSuccess = value; }
        }

        public DestinyTuner() {
            fineTuneOnSuccess = -0.0001;
        }

        public DestinyTuner(double fineTuneOnSuccess) {
            FineTuneOnSuccess = fineTuneOnSuccess;
        }

        protected internal virtual void TuneDestinyOnSuccess(LuckyController<T> luckyControl) {
            luckyControl.fineTune *= 1 + fineTuneOnSuccess;
        }
    }
}

Remove range constraint in destiny tuner


using System;
using System.Collections.Generic;
using UnityEngine;
using CNTK;
using UnityEngine.Events;
using System.Threading;
using UnityEngine.Assertions;
namespace UnityCNTK
{
    /// <summary>
    /// the non-generic base class for all model
    /// only meant to be used for model management and GUI scripting, not in-game
    /// </summary>
    public class _Model : MonoBehaviour{
        public UnityEvent OnModelLoaded;
        public string relativeModelPath;
        public Function function;
        private bool _isReady = false;

        public bool isReady { get; protected set; }
        /// <summary>
        /// Load the model automatically on start
        /// </summary>
        public bool LoadOnStart = true;
        protected Thread thread;

        public virtual void LoadModel()
        {
            Assert.IsNotNull(relativeModelPath);
            var absolutePath = System.IO.Path.Combine(Environment.CurrentDirectory, relativeModelPath);
            Thread loadThread = new Thread(() =>
            {
                Debug.Log("Started thread");
                try
                {
                    function = Function.Load(absolutePath, CNTKManager.device);
                }
                catch (Exception e)
                {
                    Debug.LogError(e);
                }
                if (OnModelLoaded != null)
                    OnModelLoaded.Invoke();
                isReady = true;
                Debug.Log("Model Loaded");
            });
            loadThread.Start();
        }
        public void UnloadModel()
        {
            if (function != null)
            {
                function.Dispose();
            }
        }

    }
}

using System;
using System.Collections.Generic;
using UnityEngine;
using CNTK;
using UnityEngine.Events;
using System.Threading;
using UnityEngine.Assertions;
namespace UnityCNTK
{
    /// <summary>
    /// the non-generic base class for all model
    /// only meant to be used for model management and GUI scripting, not in-game
    /// </summary>
    public class _Model : MonoBehaviour{
        public UnityEvent OnModelLoaded;
        public TextAsset rawModel;
        public Function function;
        private bool _isReady = false;
        public bool isReady { get; protected set; }
        /// <summary>
        /// Load the model automatically on start
        /// </summary>
        public bool LoadOnStart = true;
        protected Thread thread;

        public virtual void LoadModel()
        {
            Assert.IsNotNull(rawModel);

                Debug.Log("Started thread");
                try
                {
                    function = Function.Load(rawModel.bytes, CNTKManager.device);
                }
                catch (Exception e)
                {
                    Debug.LogError(e);
                }
                if (OnModelLoaded != null)
                    OnModelLoaded.Invoke();
                isReady = true;
                Debug.Log("Model Loaded : " +rawModel.name);
        }
        public void UnloadModel()
        {
            if (function != null)
            {
                function.Dispose();
            }
        }

    }
}

Make model to text asset so it can be loaded just like everything else


public class BuildConfig
{
    private const string Version = "0.3.0";

    public readonly string SrcDir = "./src/";
    public readonly string OutDir = "./build/";

    public string Target { get; private set; }
    public string SemVer { get; private set; }
    public string BuildProfile { get; private set; }
    public bool IsTeamCityBuild { get; private set; }

    public static BuildConfig Create(
        ICakeContext context,
        BuildSystem buildSystem)
    {
        if (context == null)
            throw new ArgumentNullException("context");

        var target = context.Argument("target", "Default");
        var branch = context.Argument("branch", string.Empty);
        var branchIsRelease = branch.ToLower() == "release";
        var buildRevision = context.Argument("buildrevision", "0");

        return new BuildConfig
        {
            Target = target,
            SemVer = Version + (branchIsRelease ? string.Empty : "-b" + buildRevision),
            BuildProfile = context.Argument("configuration", "Release"),
            IsTeamCityBuild = buildSystem.TeamCity.IsRunningOnTeamCity
        };
    }
}

public class BuildConfig
{
    private const string Version = "0.4.0";
    private const bool IsPreRelease = true;

    public readonly string SrcDir = "./src/";
    public readonly string OutDir = "./build/";

    public string Target { get; private set; }
    public string SemVer { get; private set; }
    public string BuildProfile { get; private set; }
    public bool IsTeamCityBuild { get; private set; }

    public static BuildConfig Create(
        ICakeContext context,
        BuildSystem buildSystem)
    {
        if (context == null)
            throw new ArgumentNullException("context");

        var target = context.Argument("target", "Default");
        var buildRevision = context.Argument("buildrevision", "0");

        return new BuildConfig
        {
            Target = target,
            SemVer = Version + (IsPreRelease ? buildRevision : "-b" + buildRevision),
            BuildProfile = context.Argument("configuration", "Release"),
            IsTeamCityBuild = buildSystem.TeamCity.IsRunningOnTeamCity
        };
    }
}

Build script, no dep on branch for now

Build script, no dep on branch for now


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

using osu.Framework.Audio.Track;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Osu.Skinning.Default
{
    public class KiaiFlash : BeatSyncedContainer
    {
        private const double fade_length = 80;

        private const float flash_opacity = 0.25f;

        public KiaiFlash()
        {
            EarlyActivationMilliseconds = 80;
            Blending = BlendingParameters.Additive;

            Child = new Box
            {
                RelativeSizeAxes = Axes.Both,
                Colour = Color4.White,
                Alpha = 0f,
            };
        }

        protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
        {
            if (!effectPoint.KiaiMode)
                return;

            Child
                .FadeTo(flash_opacity, EarlyActivationMilliseconds, Easing.OutQuint)
                .Then()
                .FadeOut(timingPoint.BeatLength - fade_length, Easing.OutSine);
        }
    }
}

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

using System;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Osu.Skinning.Default
{
    public class KiaiFlash : BeatSyncedContainer
    {
        private const double fade_length = 80;

        private const float flash_opacity = 0.25f;

        public KiaiFlash()
        {
            EarlyActivationMilliseconds = 80;
            Blending = BlendingParameters.Additive;

            Child = new Box
            {
                RelativeSizeAxes = Axes.Both,
                Colour = Color4.White,
                Alpha = 0f,
            };
        }

        protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
        {
            if (!effectPoint.KiaiMode)
                return;

            Child
                .FadeTo(flash_opacity, EarlyActivationMilliseconds, Easing.OutQuint)
                .Then()
                .FadeOut(Math.Max(0, timingPoint.BeatLength - fade_length), Easing.OutSine);
        }
    }
}

Fix crash on super high bpm kiai sections


using System.Collections.Generic;
using System.Net.Mail;

namespace StressMeasurementSystem.Models
{
    public class Patient
    {
        #region Structs

        public struct Name
        {
            public string Prefix { get; set; }
            public string First { get; set; }
            public string Middle { get; set; }
            public string Last { get; set; }
            public string Suffix { get; set; }
        }

        public struct Organization
        {
            public string Company { get; set; }
            public string JobTitle { get; set; }
        }

        public struct PhoneNumber
        {
            public enum Type {Mobile, Home, Work, Main, WorkFax, HomeFax, Pager, Other}

            public string Number { get; set; }
            public Type T { get; set; }
        }

        public struct Email
        {
            public enum Type {Home, Work, Other}

            public MailAddress Address { get; set; }
            public Type T { get; set; }
        }

        #endregion

        #region Fields

        private Name _name;
        private uint _age;
        private Organization _organization;
        private List<PhoneNumber> _phoneNumbers;
        private List<Email> _emails;

        #endregion

        #region Constructors

        public Patient(Name name, uint age, Organization organization,
            List<PhoneNumber> phoneNumbers, List<Email> emails)
        {
            _name = name;
            _age = age;
            _organization = organization;
            _phoneNumbers = phoneNumbers;
            _emails = emails;
        }

        #endregion
    }
}

using System.Collections.Generic;
using System.Net.Mail;

namespace StressMeasurementSystem.Models
{
    public class Patient
    {
        #region Structs

        public struct Name
        {
            public string Prefix { get; set; }
            public string First { get; set; }
            public string Middle { get; set; }
            public string Last { get; set; }
            public string Suffix { get; set; }
        }

        public struct Organization
        {
            public string Company { get; set; }
            public string JobTitle { get; set; }
        }

        public struct PhoneNumber
        {
            public enum Type { Mobile, Home, Work, Main, WorkFax, HomeFax, Pager, Other }

            public string Number { get; set; }
            public Type T { get; set; }
        }

        public struct Email
        {
            public enum Type { Home, Work, Other }

            public MailAddress Address { get; set; }
            public Type T { get; set; }
        }

        #endregion

        #region Fields

        private Name _name;
        private uint _age;
        private Organization _organization;
        private List<PhoneNumber> _phoneNumbers;
        private List<Email> _emails;

        #endregion

        #region Constructors

        public Patient(Name name, uint age, Organization organization,
            List<PhoneNumber> phoneNumbers, List<Email> emails)
        {
            _name = name;
            _age = age;
            _organization = organization;
            _phoneNumbers = phoneNumbers;
            _emails = emails;
        }

        #endregion
    }
}

Add whitespace to type enum definitions

Add whitespace to type enum definitions


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

using System;

namespace osu.Framework.Graphics.Transformations
{
    public interface ITransform
    {
        double Duration { get; }
        bool IsAlive { get; }

        double StartTime { get; set; }
        double EndTime { get; set; }

        void Apply(Drawable d);

        ITransform Clone();
        ITransform CloneReverse();

        void Reverse();
        void Loop(double delay, int loopCount = 0);
    }
}

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

using System;

namespace osu.Framework.Graphics.Transformations
{
    public interface ITransform
    {
        double Duration { get; }
        bool IsAlive { get; }

        double StartTime { get; set; }
        double EndTime { get; set; }

        void Apply(Drawable d);

        ITransform Clone();
        ITransform CloneReverse();

        void Reverse();
        void Loop(double delay, int loopCount = -1);
    }
}

Fix incorrect default value in interface.


namespace CommonDomain.Core
{
	using System.Globalization;

	internal static class ExtensionMethods
	{
		public static string FormatWith(this string format, params object[] args)
		{
			return string.Format(CultureInfo.InvariantCulture, format ?? string.Empty, args);
		}

		public static void ThrowHandlerNotFound(this IAggregate aggregate, object eventMessage)
		{
			string exceptionMessage =
				"Aggregate of type '{0}' raised an event of type '{1}' but not handler could be found to handle the message."
					.FormatWith(aggregate.GetType().Name, eventMessage.GetType().Name);

			throw new HandlerForDomainEventNotFoundException(exceptionMessage);
		}
	}
}

namespace CommonDomain.Core
{
	using System.Globalization;

	internal static class ExtensionMethods
	{
		public static string FormatWith(this string format, params object[] args)
		{
			return string.Format(CultureInfo.InvariantCulture, format ?? string.Empty, args);
		}

		public static void ThrowHandlerNotFound(this IAggregate aggregate, object eventMessage)
		{
			string exceptionMessage =
				"Aggregate of type '{0}' raised an event of type '{1}' but no handler could be found to handle the message."
					.FormatWith(aggregate.GetType().Name, eventMessage.GetType().Name);

			throw new HandlerForDomainEventNotFoundException(exceptionMessage);
		}
	}
}

Fix typo in exception message

Fix typo in exception message


using System;
using System.IO;
using System.Linq;
using System.Reflection;

namespace PCSBingMapKeyManager
{
    class Program
    {
        private const string NewKeySwitch = "/a:";

        static void Main(string[] args)
        {
            if (args.Length > 1 || args.Any() && !args[0].StartsWith(NewKeySwitch))
            {
                Usage();
                return;
            }

            var manager = new BingMapKeyManager();

            if (!args.Any())
            {
                var key = manager.GetAsync().Result;
                if (string.IsNullOrEmpty(key))
                {
                    Console.WriteLine("No bing map key set");
                }
                else
                {
                    Console.WriteLine($"Bing map key = {key}");
                }

                Console.WriteLine($"\nHint: Use {NewKeySwitch}<key> to set or update the key");
            }
            else
            {
                var key = args[0].Substring(NewKeySwitch.Length);
                if (manager.SetAsync(key).Result)
                {
                    Console.WriteLine($"Bing map key set as '{key}'");
                }
            }
        }

        private static void Usage()
        {
            var entry = Path.GetFileName(Assembly.GetEntryAssembly().CodeBase);
            Console.WriteLine($"Usage: {entry} [{NewKeySwitch}<new key>]");
        }
    }
}

using System;
using System.IO;
using System.Linq;
using System.Reflection;

namespace PCSBingMapKeyManager
{
    class Program
    {
        private const string NewKeySwitch = "/newkey:";

        static void Main(string[] args)
        {
            if (args.Length > 1 || args.Any() && !args[0].StartsWith(NewKeySwitch))
            {
                Usage();
                return;
            }

            var manager = new BingMapKeyManager();

            if (!args.Any())
            {
                var key = manager.GetAsync().Result;
                if (string.IsNullOrEmpty(key))
                {
                    Console.WriteLine("No bing map key set");
                }
                else
                {
                    Console.WriteLine($"Bing map key = {key}");
                }

                Console.WriteLine($"\nHint: Use {NewKeySwitch}<key> to set or update the key");
            }
            else
            {
                var key = args[0].Substring(NewKeySwitch.Length);
                if (manager.SetAsync(key).Result)
                {
                    Console.WriteLine($"Bing map key set as '{key}'");
                }
            }
        }

        private static void Usage()
        {
            var entry = Path.GetFileName(Assembly.GetEntryAssembly().CodeBase);
            Console.WriteLine($"Usage: {entry} [{NewKeySwitch}<new key>]");
        }
    }
}

Change the switch to set/update key to "/newkey:"


using NMaier.sdlna.Server;

namespace NMaier.sdlna.FileMediaServer.Comparers
{
  class TitleComparer : IItemComparer
  {

    public virtual string Description
    {
      get { return "Sort alphabetically"; }
    }

    public virtual string Name
    {
      get { return "title"; }
    }

    public virtual int Compare(IMediaItem x, IMediaItem y)
    {
      return x.Title.ToLower().CompareTo(y.Title.ToLower());
    }
  }
}

using System;
using System.Collections;
using NMaier.sdlna.Server;
using NMaier.sdlna.Util;

namespace NMaier.sdlna.FileMediaServer.Comparers
{
  class TitleComparer : IItemComparer, IComparer
  {
    private static StringComparer comp = new NaturalStringComparer();
    public virtual string Description
    {
      get { return "Sort alphabetically"; }
    }

    public virtual string Name
    {
      get { return "title"; }
    }

    public virtual int Compare(IMediaItem x, IMediaItem y)
    {
      return comp.Compare(x.Title, y.Title);
    }
    public int Compare(object x, object y)
    {
      return comp.Compare(x, y);
    }
  }
}

Use NaturalStringComparer to compare titles