NSLayoutFormatOptions: add None (0)

NSLayoutFormatOptions: add None (0)

--- src/AppKit/Enums.cs
+++ src/AppKit/Enums.cs
@@ -1600,6 +1600,8 @@
 	}

 	public enum NSLayoutFormatOptions {
+		None = 0,
+
 		AlignAllLeft = (1 << NSLayoutAttribute.Left),
 		AlignAllRight = (1 << NSLayoutAttribute.Right),
 		AlignAllTop = (1 << NSLayoutAttribute.Top),


regenerate C# protos

regenerate C# protos

--- src/csharp/Grpc.IntegrationTesting/EchoMessages.cs
+++ src/csharp/Grpc.IntegrationTesting/EchoMessages.cs
@@ -28,7 +28,7 @@
             "DGdycGMudGVzdGluZyIyCglEZWJ1Z0luZm8SFQoNc3RhY2tfZW50cmllcxgB",
             "IAMoCRIOCgZkZXRhaWwYAiABKAkiUAoLRXJyb3JTdGF0dXMSDAoEY29kZRgB",
             "IAEoBRIVCg1lcnJvcl9tZXNzYWdlGAIgASgJEhwKFGJpbmFyeV9lcnJvcl9k",
-            "ZXRhaWxzGAMgASgJIv8DCg1SZXF1ZXN0UGFyYW1zEhUKDWVjaG9fZGVhZGxp",
+            "ZXRhaWxzGAMgASgJIqAECg1SZXF1ZXN0UGFyYW1zEhUKDWVjaG9fZGVhZGxp",
             "bmUYASABKAgSHgoWY2xpZW50X2NhbmNlbF9hZnRlcl91cxgCIAEoBRIeChZz",
             "ZXJ2ZXJfY2FuY2VsX2FmdGVyX3VzGAMgASgFEhUKDWVjaG9fbWV0YWRhdGEY",
             "BCABKAgSGgoSY2hlY2tfYXV0aF9jb250ZXh0GAUgASgIEh8KF3Jlc3BvbnNl",
@@ -39,18 +39,19 @@
             "Zy5EZWJ1Z0luZm8SEgoKc2VydmVyX2RpZRgMIAEoCBIcChRiaW5hcnlfZXJy",
             "b3JfZGV0YWlscxgNIAEoCRIxCg5leHBlY3RlZF9lcnJvchgOIAEoCzIZLmdy",
             "cGMudGVzdGluZy5FcnJvclN0YXR1cxIXCg9zZXJ2ZXJfc2xlZXBfdXMYDyAB",
-            "KAUSGwoTYmFja2VuZF9jaGFubmVsX2lkeBgQIAEoBSJKCgtFY2hvUmVxdWVz",
-            "dBIPCgdtZXNzYWdlGAEgASgJEioKBXBhcmFtGAIgASgLMhsuZ3JwYy50ZXN0",
-            "aW5nLlJlcXVlc3RQYXJhbXMiRgoOUmVzcG9uc2VQYXJhbXMSGAoQcmVxdWVz",
-            "dF9kZWFkbGluZRgBIAEoAxIMCgRob3N0GAIgASgJEgwKBHBlZXIYAyABKAki",
-            "TAoMRWNob1Jlc3BvbnNlEg8KB21lc3NhZ2UYASABKAkSKwoFcGFyYW0YAiAB",
-            "KAsyHC5ncnBjLnRlc3RpbmcuUmVzcG9uc2VQYXJhbXNiBnByb3RvMw=="));
+            "KAUSGwoTYmFja2VuZF9jaGFubmVsX2lkeBgQIAEoBRIfChdlY2hvX21ldGFk",
+            "YXRhX2luaXRpYWxseRgRIAEoCCJKCgtFY2hvUmVxdWVzdBIPCgdtZXNzYWdl",
+            "GAEgASgJEioKBXBhcmFtGAIgASgLMhsuZ3JwYy50ZXN0aW5nLlJlcXVlc3RQ",
+            "YXJhbXMiRgoOUmVzcG9uc2VQYXJhbXMSGAoQcmVxdWVzdF9kZWFkbGluZRgB",
+            "IAEoAxIMCgRob3N0GAIgASgJEgwKBHBlZXIYAyABKAkiTAoMRWNob1Jlc3Bv",
+            "bnNlEg8KB21lc3NhZ2UYASABKAkSKwoFcGFyYW0YAiABKAsyHC5ncnBjLnRl",
+            "c3RpbmcuUmVzcG9uc2VQYXJhbXNCA/gBAWIGcHJvdG8z"));
       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
           new pbr::FileDescriptor[] { },
           new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
             new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.DebugInfo), global::Grpc.Testing.DebugInfo.Parser, new[]{ "StackEntries", "Detail" }, null, null, null),
             new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ErrorStatus), global::Grpc.Testing.ErrorStatus.Parser, new[]{ "Code", "ErrorMessage", "BinaryErrorDetails" }, null, null, null),
-            new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.RequestParams), global::Grpc.Testing.RequestParams.Parser, new[]{ "EchoDeadline", "ClientCancelAfterUs", "ServerCancelAfterUs", "EchoMetadata", "CheckAuthContext", "ResponseMessageLength", "EchoPeer", "ExpectedClientIdentity", "SkipCancelledCheck", "ExpectedTransportSecurityType", "DebugInfo", "ServerDie", "BinaryErrorDetails", "ExpectedError", "ServerSleepUs", "BackendChannelIdx" }, null, null, null),
+            new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.RequestParams), global::Grpc.Testing.RequestParams.Parser, new[]{ "EchoDeadline", "ClientCancelAfterUs", "ServerCancelAfterUs", "EchoMetadata", "CheckAuthContext", "ResponseMessageLength", "EchoPeer", "ExpectedClientIdentity", "SkipCancelledCheck", "ExpectedTransportSecurityType", "DebugInfo", "ServerDie", "BinaryErrorDetails", "ExpectedError", "ServerSleepUs", "BackendChannelIdx", "EchoMetadataInitially" }, null, null, null),
             new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.EchoRequest), global::Grpc.Testing.EchoRequest.Parser, new[]{ "Message", "Param" }, null, null, null),
             new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ResponseParams), global::Grpc.Testing.ResponseParams.Parser, new[]{ "RequestDeadline", "Host", "Peer" }, null, null, null),
             new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.EchoResponse), global::Grpc.Testing.EchoResponse.Parser, new[]{ "Message", "Param" }, null, null, null)
@@ -441,6 +442,7 @@
       expectedError_ = other.expectedError_ != null ? other.expectedError_.Clone() : null;
       serverSleepUs_ = other.serverSleepUs_;
       backendChannelIdx_ = other.backendChannelIdx_;
+      echoMetadataInitially_ = other.echoMetadataInitially_;
       _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
     }

@@ -634,6 +636,17 @@
       get { return backendChannelIdx_; }
       set {
         backendChannelIdx_ = value;
+      }
+    }
+
+    /// <summary>Field number for the "echo_metadata_initially" field.</summary>
+    public const int EchoMetadataInitiallyFieldNumber = 17;
+    private bool echoMetadataInitially_;
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public bool EchoMetadataInitially {
+      get { return echoMetadataInitially_; }
+      set {
+        echoMetadataInitially_ = value;
       }
     }

@@ -666,6 +679,7 @@
       if (!object.Equals(ExpectedError, other.ExpectedError)) return false;
       if (ServerSleepUs != other.ServerSleepUs) return false;
       if (BackendChannelIdx != other.BackendChannelIdx) return false;
+      if (EchoMetadataInitially != other.EchoMetadataInitially) return false;
       return Equals(_unknownFields, other._unknownFields);
     }

@@ -688,6 +702,7 @@
       if (expectedError_ != null) hash ^= ExpectedError.GetHashCode();
       if (ServerSleepUs != 0) hash ^= ServerSleepUs.GetHashCode();
       if (BackendChannelIdx != 0) hash ^= BackendChannelIdx.GetHashCode();
+      if (EchoMetadataInitially != false) hash ^= EchoMetadataInitially.GetHashCode();
       if (_unknownFields != null) {
         hash ^= _unknownFields.GetHashCode();
       }
@@ -765,6 +780,10 @@
         output.WriteRawTag(128, 1);
         output.WriteInt32(BackendChannelIdx);
       }
+      if (EchoMetadataInitially != false) {
+        output.WriteRawTag(136, 1);
+        output.WriteBool(EchoMetadataInitially);
+      }
       if (_unknownFields != null) {
         _unknownFields.WriteTo(output);
       }
@@ -820,6 +839,9 @@
       }
       if (BackendChannelIdx != 0) {
         size += 2 + pb::CodedOutputStream.ComputeInt32Size(BackendChannelIdx);
+      }
+      if (EchoMetadataInitially != false) {
+        size += 2 + 1;
       }
       if (_unknownFields != null) {
         size += _unknownFields.CalculateSize();
@@ -885,6 +907,9 @@
       }
       if (other.BackendChannelIdx != 0) {
         BackendChannelIdx = other.BackendChannelIdx;
+      }
+      if (other.EchoMetadataInitially != false) {
+        EchoMetadataInitially = other.EchoMetadataInitially;
       }
       _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
     }
@@ -967,6 +992,10 @@
             BackendChannelIdx = input.ReadInt32();
             break;
           }
+          case 136: {
+            EchoMetadataInitially = input.ReadBool();
+            break;
+          }
         }
       }
     }


Change: Dump support for enums

Change: Dump support for enums

--- src/hw.nuget/hw.Helper.Core/Debug/Configuration.cs
+++ src/hw.nuget/hw.Helper.Core/Debug/Configuration.cs
@@ -14,12 +14,13 @@
         internal Configuration()
         {
             Handlers = new HandlerGroup();
-            Handlers.Add(typeof(IList), (type, o) => Dump(((IList) o).Cast<object>()));
+            Handlers.Add(typeof(IList), (type, o) => Dump(((IList)o).Cast<object>()));
             Handlers.Add(typeof(IDictionary), (type, o) => DumpIDictionary(o));
-            Handlers.Add(typeof(ICollection), (type, o) => Dump(((ICollection) o).Cast<object>()));
-            Handlers.Add(typeof(CodeObject), (type, o) => Dump((CodeObject) o));
-            Handlers.Add(typeof(Type), (type, o) => ((Type) o).PrettyName());
+            Handlers.Add(typeof(ICollection), (type, o) => Dump(((ICollection)o).Cast<object>()));
+            Handlers.Add(typeof(CodeObject), (type, o) => Dump((CodeObject)o));
+            Handlers.Add(typeof(Type), (type, o) => ((Type)o).PrettyName());
             Handlers.Add(typeof(string), (type, o) => ((string)o).Quote());
+            Handlers.Add(t => t.IsEnum, DumpEnum);
             Handlers.Add(t => t.IsPrimitive, (type, o) => o.ToString());
             Handlers.Add(IsOutlookClass, (type, o) => o.ToString());
         }
@@ -35,7 +36,7 @@
         static string Dump(CodeObject co)
         {
             var cse = co as CodeSnippetExpression;
-            if(cse != null)
+            if (cse != null)
                 return cse.Value;

             throw new NotImplementedException();
@@ -52,9 +53,21 @@
                         .Surround("{", "}");
         }

+        static string DumpEnum(Type type, object o)
+        {
+            var result = o
+                .ToString()
+                .Split(',')
+                .Select(item => type.PrettyName() + "." + item)
+                .Stringify(", ");
+            if (result.Contains(","))
+                return "(" + result + ")";
+            return result;
+        }
+
         static string DumpIDictionary(object o)
         {
-            var dictionary = (IDictionary) o;
+            var dictionary = (IDictionary)o;
             return dictionary
                 .Keys
                 .Cast<object>()


Wrapped events of the media element

Wrapped events of the media element

--- AngleSharp/DOM/Html/Media/HTMLMediaElement.cs
+++ AngleSharp/DOM/Html/Media/HTMLMediaElement.cs
@@ -51,33 +51,89 @@

         #region Events

-        public event EventListener Emptied;
-
-        public event EventListener LoadedMetadata;
-
-        public event EventListener LoadedData;
-
-        public event EventListener CanPlay;
-
-        public event EventListener CanPlayThrough;
-
-        public event EventListener Ended;
-
-        public event EventListener Waiting;
-
-        public event EventListener DurationChanged;
-
-        public event EventListener TimeUpdated;
-
-        public event EventListener Paused;
-
-        public event EventListener Played;
-
-        public event EventListener Playing;
-
-        public event EventListener RateChanged;
-
-        public event EventListener VolumeChanged;
+        public event EventListener Emptied
+        {
+            add { AddEventListener(EventNames.Emptied, value); }
+            remove { RemoveEventListener(EventNames.Emptied, value); }
+        }
+
+        public event EventListener LoadedMetadata
+        {
+            add { AddEventListener(EventNames.LoadedMetaData, value); }
+            remove { RemoveEventListener(EventNames.LoadedMetaData, value); }
+        }
+
+        public event EventListener LoadedData
+        {
+            add { AddEventListener(EventNames.LoadedData, value); }
+            remove { RemoveEventListener(EventNames.LoadedData, value); }
+        }
+
+        public event EventListener CanPlay
+        {
+            add { AddEventListener(EventNames.CanPlay, value); }
+            remove { RemoveEventListener(EventNames.CanPlay, value); }
+        }
+
+        public event EventListener CanPlayThrough
+        {
+            add { AddEventListener(EventNames.CanPlayThrough, value); }
+            remove { RemoveEventListener(EventNames.CanPlayThrough, value); }
+        }
+
+        public event EventListener Ended
+        {
+            add { AddEventListener(EventNames.Ended, value); }
+            remove { RemoveEventListener(EventNames.Ended, value); }
+        }
+
+        public event EventListener Waiting
+        {
+            add { AddEventListener(EventNames.Waiting, value); }
+            remove { RemoveEventListener(EventNames.Waiting, value); }
+        }
+
+        public event EventListener DurationChanged
+        {
+            add { AddEventListener(EventNames.DurationChange, value); }
+            remove { RemoveEventListener(EventNames.DurationChange, value); }
+        }
+
+        public event EventListener TimeUpdated
+        {
+            add { AddEventListener(EventNames.TimeUpdate, value); }
+            remove { RemoveEventListener(EventNames.TimeUpdate, value); }
+        }
+
+        public event EventListener Paused
+        {
+            add { AddEventListener(EventNames.Pause, value); }
+            remove { RemoveEventListener(EventNames.Pause, value); }
+        }
+
+        public event EventListener Played
+        {
+            add { AddEventListener(EventNames.Play, value); }
+            remove { RemoveEventListener(EventNames.Play, value); }
+        }
+
+        public event EventListener Playing
+        {
+            add { AddEventListener(EventNames.Playing, value); }
+            remove { RemoveEventListener(EventNames.Playing, value); }
+        }
+
+        public event EventListener RateChanged
+        {
+            add { AddEventListener(EventNames.RateChange, value); }
+            remove { RemoveEventListener(EventNames.RateChange, value); }
+        }
+
+        public event EventListener VolumeChanged
+        {
+            add { AddEventListener(EventNames.VolumeChange, value); }
+            remove { RemoveEventListener(EventNames.VolumeChange, value); }
+        }

         #endregion

@@ -175,8 +231,7 @@
                 else
                     _currentTime = value;

-                if (TimeUpdated != null)
-                    TimeUpdated(this, Event.Empty);
+                Dispatch(Event.Empty);
             }
         }


Misc for netf

Misc for netf

Doesn't make sense to check further if index points to the end of the string, this also handles previous check

--- ArchiSteamFarm/Compatibility/StaticHelpers.cs
+++ ArchiSteamFarm/Compatibility/StaticHelpers.cs
@@ -136,7 +136,7 @@
 			int startIndex = 0;

 			while (true) {
-				if (source.Length == 0) {
+				if (startIndex >= source.Length) {
 					return source;
 				}


Fixed jump tiles from stacking impulses.

If the player managed to trigger multiple rigidbody colliders
on the same update frame, they could receive between x2 and x4
the normal velocity at once.  (Usually done by rolling into a
2x1 jump tile exactly at the midpoint.)

Adds a static shared by all jump tiles, to make sure that only
the first one touched triggers on any given frame.

Change-Id: Ie0b5d3d6d147586c9f2ae993ff1733241411e49c

--- Assets/Hamster/Scripts/MapObjects/JumpTile.cs
+++ Assets/Hamster/Scripts/MapObjects/JumpTile.cs
@@ -20,15 +20,28 @@
   // When stepped on, these kick the player up into the air.
   public class JumpTile : MapObject {

+    // Static variable shared across all jumptiles, to make sure
+    // that they only get one jump impulse at once.  (Stops them
+    // from getting double- or quadruple-powered jumps, if they
+    // manage to touch more than one jump tile on the same frame.)
+    static bool triggeredThisFrame;
+
     // Velocity of the kick, in world-units/second.
     public float kJumpVelocity = 8;

+    public void Update() {
+      triggeredThisFrame = false;
+    }
+
     protected override void MapObjectActivation(Collider collider) {
-      if (collider.GetComponent<PlayerController>() != null) {
-        Rigidbody rigidbody = collider.attachedRigidbody;
-        collider.attachedRigidbody.velocity =
-            new Vector3(rigidbody.velocity.x, 0, rigidbody.velocity.z);
-        rigidbody.AddForce(new Vector3(0.0f, kJumpVelocity, 0.0f), ForceMode.Impulse);
+      if (!triggeredThisFrame) {
+        triggeredThisFrame = true;
+        if (collider.GetComponent<PlayerController>() != null) {
+          Rigidbody rigidbody = collider.attachedRigidbody;
+          collider.attachedRigidbody.velocity =
+              new Vector3(rigidbody.velocity.x, 0, rigidbody.velocity.z);
+          rigidbody.AddForce(new Vector3(0.0f, kJumpVelocity, 0.0f), ForceMode.Impulse);
+        }
       }
     }
   }


Fixed loading of SelfieStickController

Fixed loading of SelfieStickController

--- Assets/Scripts/Tools/SelfieStickController.cs
+++ Assets/Scripts/Tools/SelfieStickController.cs
@@ -19,6 +19,8 @@

 		public Sprite blankImage;

+		private bool isLoading = false;
+
 		new void Start ()
 		{
 			base.Start ();
@@ -35,7 +37,11 @@

 		public override void UseButtonDown ()
 		{
-			print (isLife ());
+			if(!isLoading)
+			{
+				print (isLife ());
+			}
+
 		}

 		string isLife ()
@@ -73,11 +79,13 @@

 		IEnumerator loadOnScreen (Sprite image)
 		{
+			isLoading = true;
 			CameraScreen.sprite = blankImage;
 			loadingScreen.SetActive (true);
 			yield return new WaitForSeconds (waitTime);
 			loadingScreen.SetActive (false);
 			CameraScreen.sprite = image;
+			isLoading = false;
 			yield return null;
 		}


add hex option for unique id

add hex option for unique id

--- src/CryptoRandom.cs
+++ src/CryptoRandom.cs
@@ -15,6 +15,13 @@
         private static readonly RandomNumberGenerator Rng = RandomNumberGenerator.Create();
         private readonly byte[] _uint32Buffer = new byte[4];

+        public enum OutputFormat
+        {
+            Base64Url,
+            Base64,
+            Hex
+        }
+
         /// <summary>
         /// Creates a random key byte array.
         /// </summary>
@@ -29,29 +36,26 @@
         }

         /// <summary>
-        /// Creates a random key as base64 URL encoded string.
-        /// </summary>
-        /// <param name="length">The length.</param>
-        /// <returns></returns>
-        public static string CreateRandomKeyString(int length)
-        {
-            var bytes = new byte[length];
-            Rng.GetBytes(bytes);
-
-            return Base64Url.Encode(bytes);
-        }
-
-        /// <summary>
         /// Creates a URL safe unique identifier.
         /// </summary>
         /// <param name="length">The length.</param>
+        /// <param name="format">The output format</param>
         /// <returns></returns>
-        public static string CreateUniqueId(int length = 32)
+        public static string CreateUniqueId(int length = 32, OutputFormat format = OutputFormat.Base64Url)
         {
-            var bytes = new byte[length];
-            Rng.GetBytes(bytes);
-
-            return Base64Url.Encode(bytes);
+            var bytes = CreateRandomKey(length);
+
+            switch (format)
+            {
+                case OutputFormat.Base64Url:
+                    return Base64Url.Encode(bytes);
+                case OutputFormat.Base64:
+                    return Convert.ToBase64String(bytes);
+                case OutputFormat.Hex:
+                    return BitConverter.ToString(bytes).Replace("-", "");
+                default:
+                    throw new ArgumentException("Invalid output format", nameof(format));
+            }
         }

         /// <summary>


more bugfixes

more bugfixes

--- src/ConveyorBelt.Tooling/Internal/TableEntityExtensions.cs
+++ src/ConveyorBelt.Tooling/Internal/TableEntityExtensions.cs
@@ -64,18 +64,24 @@

             foreach (var property in entity.Properties)
             {
+                string val;
                 switch (property.Value.PropertyType)
                 {
                     case EdmType.DateTime:
-                        result.Add(property.Key, property.Value.DateTimeOffsetValue?.ToString("s"));
+                        val = property.Value.DateTimeOffsetValue?.ToString("s");
                         break;
                     case EdmType.Boolean:
-                        result.Add(property.Key, property.Value.BooleanValue?.ToString().ToLower());
+                        val = property.Value.BooleanValue?.ToString().ToLower();
                         break;
                     default:
-                        result.Add(property.Key, property.Value.PropertyAsObject.ToString());
+                        val = property.Value.PropertyAsObject.ToString();
                         break;
                 }
+
+                if (string.IsNullOrWhiteSpace(val) || val == ",")
+                    continue;
+
+                result.Add(property.Key, val);
             }

             return result;


Implement HsvColor.ToString() and TryParse()

--- src/Avalonia.Visuals/Media/HsvColor.cs
+++ src/Avalonia.Visuals/Media/HsvColor.cs
@@ -4,6 +4,8 @@
 // Licensed to The Avalonia Project under MIT License, courtesy of The .NET Foundation.

 using System;
+using System.Globalization;
+using System.Text;
 using Avalonia.Utilities;

 namespace Avalonia.Media
@@ -153,6 +155,109 @@
         {
             // Use the by-channel conversion method directly for performance
             return HsvColor.ToRgb(H, S, V, A);
+        }
+
+        /// <inheritdoc/>
+        public override string ToString()
+        {
+            var sb = new StringBuilder();
+
+            // Use a format similar to HSL in HTML/CSS "hsla(0, 100%, 50%, 0.5)"
+            //
+            // However:
+            //   - To ensure precision is never lost, allow decimal places
+            //   - To maintain numerical consistency do not use percent
+            //
+            // Example:
+            //
+            // hsva(hue, saturation, value, alpha)
+            // hsva(230, 1.0, 0.5, 1.0)
+            //
+            //   Where:
+            //
+            //          hue : integer from 0 to 360
+            //   saturation : double from 0.0 to 1.0
+            //                (HTML uses percentages)
+            //        value : double from 0.0 to 1.0
+            //                (HTML uses percentages)
+            //        alpha : double from 0.0 to 1.0
+            //                (HTML does not use percent for alpha)
+
+            sb.Append("hsva(");
+            sb.Append(H.ToString(CultureInfo.InvariantCulture));
+            sb.Append(", ");
+            sb.Append(S.ToString(CultureInfo.InvariantCulture));
+            sb.Append(", ");
+            sb.Append(V.ToString(CultureInfo.InvariantCulture));
+            sb.Append(", ");
+            sb.Append(A.ToString(CultureInfo.InvariantCulture));
+            sb.Append(')');
+
+            return sb.ToString();
+        }
+
+        /// <summary>
+        /// Parses an HSV color string.
+        /// </summary>
+        /// <param name="s">The HSV color string to parse.</param>
+        /// <param name="hsvColor">The parsed HSV color.</param>
+        /// <returns>True if parsing was successful; otherwise, false.</returns>
+        public static bool TryParse(string s, out HsvColor hsvColor)
+        {
+            hsvColor = default;
+
+            if (s is null)
+            {
+                return false;
+            }
+
+            string workingString = s.Trim();
+
+            if (workingString.Length == 0 ||
+                workingString.IndexOf(",", StringComparison.Ordinal) < 0)
+            {
+                return false;
+            }
+
+            if (workingString.StartsWith("hsva(", StringComparison.OrdinalIgnoreCase) &&
+                workingString.EndsWith(")", StringComparison.Ordinal) &&
+                workingString.Length > 6)
+            {
+                workingString = workingString.Substring(5, workingString.Length - 6);
+            }
+
+            if (workingString.StartsWith("hsv(", StringComparison.OrdinalIgnoreCase) &&
+                workingString.EndsWith(")", StringComparison.Ordinal) &&
+                workingString.Length > 5)
+            {
+                workingString = workingString.Substring(4, workingString.Length - 5);
+            }
+
+            string[] components = workingString.Split(',');
+
+            if (components.Length == 3) // HSV
+            {
+                if (double.TryParse(components[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double hue) &&
+                    double.TryParse(components[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double saturation) &&
+                    double.TryParse(components[2], NumberStyles.Number, CultureInfo.InvariantCulture, out double value))
+                {
+                    hsvColor = new HsvColor(1.0, hue, saturation, value);
+                    return true;
+                }
+            }
+            else if (components.Length == 4) // HSVA
+            {
+                if (double.TryParse(components[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double hue) &&
+                    double.TryParse(components[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double saturation) &&
+                    double.TryParse(components[2], NumberStyles.Number, CultureInfo.InvariantCulture, out double value) &&
+                    double.TryParse(components[3], NumberStyles.Number, CultureInfo.InvariantCulture, out double alpha))
+                {
+                    hsvColor = new HsvColor(alpha, hue, saturation, value);
+                    return true;
+                }
+            }
+
+            return false;
         }

         /// <summary>


Changed maxlength of player name to 16.

Changed maxlength of player name to 16.

--- PingPong/frmSaveScore.Designer.cs
+++ PingPong/frmSaveScore.Designer.cs
@@ -105,7 +105,7 @@
             // txtNameTextBox
             //
             this.txtNameTextBox.Location = new System.Drawing.Point(108, 280);
-            this.txtNameTextBox.MaxLength = 25;
+            this.txtNameTextBox.MaxLength = 16;
             this.txtNameTextBox.Name = "txtNameTextBox";
             this.txtNameTextBox.Size = new System.Drawing.Size(164, 20);
             this.txtNameTextBox.TabIndex = 6;


BL-6377 handle upper-case file extensions in GetMediaType

--- src/BloomExe/Publish/Epub/EpubMaker.cs
+++ src/BloomExe/Publish/Epub/EpubMaker.cs
@@ -2322,7 +2322,7 @@
 				extension = Path.GetExtension(item);
 			if (!String.IsNullOrEmpty(extension))
 				extension = extension.Substring(1);	// ignore the .
-			switch (extension)
+			switch (extension.ToLowerInvariant())
 			{
 			case "xml": // Review
 			case "xhtml":


Add user id in log when log in

Add user id in log when log in

--- BTCPayServer/Controllers/AccountController.cs
+++ BTCPayServer/Controllers/AccountController.cs
@@ -160,7 +160,7 @@
                 var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: true);
                 if (result.Succeeded)
                 {
-                    _logger.LogInformation("User logged in.");
+                    _logger.LogInformation($"User '{user.Id}' logged in.");
                     return RedirectToLocal(returnUrl);
                 }
                 if (result.RequiresTwoFactor)
@@ -175,7 +175,7 @@
                 }
                 if (result.IsLockedOut)
                 {
-                    _logger.LogWarning("User account locked out.");
+                    _logger.LogWarning($"User '{user.Id}' account locked out.");
                     return RedirectToAction(nameof(Lockout));
                 }
                 else


Reordered attached properties on View so that Context is defined before Model.

--- src/Caliburn.Micro.Silverlight/View.cs
+++ src/Caliburn.Micro.Silverlight/View.cs
@@ -10,7 +10,8 @@
     /// Hosts attached properties related to view models.
     /// </summary>
     public static class View {
-        static ILog log = LogManager.GetLog(typeof(View));
+        static readonly ILog Log = LogManager.GetLog(typeof(View));
+        static readonly ContentPropertyAttribute DefaultContentProperty = new ContentPropertyAttribute("Content");

         /// <summary>
         /// The default view context.
@@ -51,6 +52,17 @@
                 );

         /// <summary>
+        /// A dependency property for assigning a context to a particular portion of the UI.
+        /// </summary>
+        public static readonly DependencyProperty ContextProperty =
+            DependencyProperty.RegisterAttached(
+                "Context",
+                typeof(object),
+                typeof(View),
+                new PropertyMetadata(OnContextChanged)
+                );
+
+        /// <summary>
         /// A dependency property for attaching a model to the UI.
         /// </summary>
         public static DependencyProperty ModelProperty =
@@ -59,17 +71,6 @@
                 typeof(object),
                 typeof(View),
                 new PropertyMetadata(OnModelChanged)
-                );
-
-        /// <summary>
-        /// A dependency property for assigning a context to a particular portion of the UI.
-        /// </summary>
-        public static readonly DependencyProperty ContextProperty =
-            DependencyProperty.RegisterAttached(
-                "Context",
-                typeof(object),
-                typeof(View),
-                new PropertyMetadata(OnContextChanged)
                 );

         /// <summary>
@@ -131,7 +132,7 @@

                 var type = view.GetType();
                 var contentProperty = type.GetAttributes<ContentPropertyAttribute>(true)
-                    .FirstOrDefault() ?? new ContentPropertyAttribute("Content");
+                    .FirstOrDefault() ?? DefaultContentProperty;

                 return (DependencyObject)type.GetProperty(contentProperty.Name)
                     .GetValue(view, null);
@@ -245,13 +246,13 @@
             try {
                 var type = targetLocation.GetType();
                 var contentProperty = type.GetAttributes<ContentPropertyAttribute>(true)
-                    .FirstOrDefault() ?? new ContentPropertyAttribute("Content");
+                    .FirstOrDefault() ?? DefaultContentProperty;

                 type.GetProperty(contentProperty.Name)
                     .SetValue(targetLocation, view, null);
             }
             catch(Exception e) {
-                log.Error(e);
+                Log.Error(e);
             }
         }
     }


Add IncludeGeo to GetEventsRequestBuilder

--- src/Cronofy/GetEventsRequestBuilder.cs
+++ src/Cronofy/GetEventsRequestBuilder.cs
@@ -50,6 +50,11 @@
         private bool? onlyManaged;

         /// <summary>
+        /// The request's include geo flag.
+        /// </summary>
+        private bool? includeGeo;
+
+        /// <summary>
         /// The request's calendar IDs.
         /// </summary>
         private IEnumerable<string> calendarIds;
@@ -239,6 +244,22 @@
         public GetEventsRequestBuilder OnlyManaged(bool onlyManaged)
         {
             this.onlyManaged = onlyManaged;
+            return this;
+        }
+
+        /// <summary>
+        /// Sets the include geo flag for the request.
+        /// </summary>
+        /// <param name="includeGeo">
+        /// A flag specifying whether latitude and longitude data should
+        /// be returned with events where available.
+        /// </param>
+        /// <returns>
+        /// A reference to the modified builder.
+        /// </returns>
+        public GetEventsRequestBuilder IncludeGeo(bool includeGeo)
+        {
+            this.includeGeo = includeGeo;
             return this;
         }

@@ -294,6 +315,7 @@
                 IncludeMoved = this.includeMoved,
                 IncludeManaged = this.includeManaged,
                 OnlyManaged = this.onlyManaged,
+                IncludeGeo = this.includeGeo,
                 CalendarIds = this.calendarIds,
             };
         }


just looks better this way

just looks better this way

git-tfs-id: [https://mikeward.visualstudio.com/DefaultCollection]$/tweetz5;C1539

--- tweetz5/tweetz5/Model/Timelines.cs
+++ tweetz5/tweetz5/Model/Timelines.cs
@@ -171,7 +171,7 @@
             {
                 var tweet = CreateTweet(tweetType, status);
                 if (tweet.IsRetweet && _friendsBlockedRetweets.Contains(tweet.UserId)) continue;
-
+
                 if (tweetType != "s") // serach results not added to tweet collection
                 {
                     var index = _tweets.IndexOf(tweet);
@@ -379,7 +379,9 @@

         private static ulong MaxSinceId(ulong currentSinceId, Status[] statuses)
         {
-            return statuses.Length > 0 ? Math.Max(currentSinceId, statuses.Max(s => ulong.Parse(s.Id))) : currentSinceId;
+            return (statuses.Length > 0)
+                ? Math.Max(currentSinceId, statuses.Max(s => ulong.Parse(s.Id)))
+                : currentSinceId;
         }

         public void HomeTimeline()


Fix bugs in CachingHttpScheduler

Fix bugs in CachingHttpScheduler

--- Akavache.Http/HttpScheduler.cs
+++ Akavache.Http/HttpScheduler.cs
@@ -12,7 +12,7 @@

 namespace Akavache.Http
 {
-    public class CachingHttpScheduler : HttpScheduler
+    public class CachingHttpScheduler : IHttpScheduler
     {
         readonly IBlobCache blobCache = null;
         readonly IHttpScheduler innerScheduler = null;
@@ -43,6 +43,8 @@
             //   to cancel / dequeue the low prio underlying one and return the high-prio
             //   one. (i.e. priority inversion)
         }
+
+        public HttpClient Client { get; set; }

         public IObservable<Tuple<HttpResponseMessage, byte[]>> Schedule(HttpRequestMessage request, int priority)
         {
@@ -93,7 +95,7 @@

         public HttpScheduler(OperationQueue opQueue = null, int priorityBase = 100, int retryCount = 3)
         {
-            this.opQueue = opQueue;
+            this.opQueue = opQueue ?? new OperationQueue();
             this.priorityBase = priorityBase;
             this.retryCount = retryCount;
         }


MarketEmulator. Cross trades. Failed -> Canceled.

--- Algo/Testing/MarketEmulator.cs
+++ Algo/Testing/MarketEmulator.cs
@@ -715,7 +715,8 @@

 			private void MatchOrder(DateTimeOffset time, ExecutionMessage order, ICollection<Message> result, bool isNewOrder)
 			{
-				string matchError = null;
+				//string matchError = null;
+				var isCrossTrade = false;

 				var executions = result == null ? null : new Dictionary<decimal, decimal>();

@@ -748,8 +749,10 @@
 						// если это пользовательская заявка и матчинг идет о заявку с таким же портфелем
 						if (executions != null && quote.PortfolioName == order.PortfolioName)
 						{
-							matchError = LocalizedStrings.Str1161Params.Put(quote.TransactionId, order.TransactionId);
+							var matchError = LocalizedStrings.Str1161Params.Put(quote.TransactionId, order.TransactionId);
 							this.AddErrorLog(matchError);
+
+							isCrossTrade = true;
 							break;
 						}

@@ -789,7 +792,7 @@
 							break;
 					}

-					if (leftBalance == 0 || matchError != null)
+					if (leftBalance == 0 || isCrossTrade)
 						break;
 				}

@@ -865,13 +868,16 @@
 					}
 				}

-				if (matchError != null)
+				if (isCrossTrade)
 				{
 					var reply = CreateReply(order, time);

-					reply.OrderState = OrderStates.Failed;
-					reply.OrderStatus = (long?)OrderStatus.RejectedBySystem;
-					reply.Error = new InvalidOperationException(matchError);
+					//reply.OrderState = OrderStates.Failed;
+					//reply.OrderStatus = (long?)OrderStatus.RejectedBySystem;
+					//reply.Error = new InvalidOperationException(matchError);
+
+					reply.OrderState = OrderStates.Done;
+					reply.OrderStatus = (long?)OrderStatus.CanceledByManager;

 					result.Add(reply);
 				}


add aad idp

add aad idp

--- src/Host/Startup.cs
+++ src/Host/Startup.cs
@@ -14,6 +14,7 @@
 using IdentityServer4;
 using IdentityServer4.Validation;
 using Serilog;
+using Microsoft.AspNetCore.Http;

 namespace Host
 {
@@ -130,6 +131,23 @@
                 }
             });

+            app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
+            {
+                SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme,
+                SignOutScheme = IdentityServerConstants.SignoutScheme,
+                DisplayName = "AAD",
+                Authority = "https://login.windows.net/4ca9cb4c-5e5f-4be9-b700-c532992a3705",
+                ClientId = "96e3c53e-01cb-4244-b658-a42164cb67a9",
+                ResponseType = "id_token",
+                Scope = { "openid profile" },
+                CallbackPath = new PathString("/signin-aad"),
+                TokenValidationParameters = new TokenValidationParameters
+                {
+                    NameClaimType = "name",
+                    RoleClaimType = "role"
+                }
+            });
+
             app.UseStaticFiles();
             app.UseMvcWithDefaultRoute();
         }


Tweak marker sizing

Tweak marker sizing

--- AnvilEditor/MainWindow.xaml.cs
+++ AnvilEditor/MainWindow.xaml.cs
@@ -878,11 +878,11 @@
         /// <summary>
         /// Returns a marker radius which is dependent on zoom level
         /// </summary>
-        internal int MarkerRadius
+        internal double MarkerRadius
         {
             get
             {
-                return Math.Min((int)(8 - 0.45 * this.imageZoom), 5);
+                return 9 - 0.55 * this.imageZoom;
             }
         }


fixed minor bug with nested lists in rendered article

--- App/Common/Platform/Article.cs
+++ App/Common/Platform/Article.cs
@@ -302,6 +302,11 @@
                         {
                             //check for list
                             case "ul": case "ol":
+                                var tmp = parts.Where(a => a.type.Contains(TextType.listItem)).ToList();
+                                if(tmp.Count == 44)
+                                {
+
+                                }
                                 if (!indents.Contains(baseElem.index))
                                 {
                                     indents.Add(baseElem.index);
@@ -311,7 +316,7 @@
                                     var ix = indents.IndexOf(baseElem.index);
                                     if (ix >= 0 && ix < indents.Count - 1)
                                     {
-                                        indents.RemoveRange(ix + 1, indents.Count - ix - 2);
+                                        indents.RemoveRange(ix + 1, indents.Count - ix - 1);
                                     }
                                     else if (ix < 0)
                                     {
@@ -353,7 +358,8 @@
                     var nline = new ArticlePart()
                     {
                         type = new List<TextType>() { TextType.mainArticle },
-                        quote = inQuote
+                        quote = inQuote,
+                        indent = part.indent
                     };
                     parts.Add(nline);
                 }
@@ -365,7 +371,7 @@
                 }

                 //finally, add part to render list
-                if(part.type.Count == 0) { part.type.Add(TextType.mainArticle); }
+                if(part.type.Count == 0 || part.type.Contains(TextType.listItem)) { part.type.Add(TextType.mainArticle); }
                 parts.Add(part);
                 lastHierarchy = elem.hierarchyIndexes;
             }
@@ -376,6 +382,8 @@
             inQuote = 0;
             hasQuote = false;

+            var listitems = parts.Where(a => a.type.Contains(TextType.listItem)).ToList();
+
             foreach(var part in parts)
             {
                 //create paragraph tag (if neccessary)
@@ -404,12 +412,8 @@
                 }

                 //escape list if neccessary
-                if (part.type.Where(a => a == TextType.listItem || a == TextType.anchorLink || a == TextType.lineBreak).Count() == 0)
+                if (part.indent == 0 && indent > 0)
                 {
-                    if(part.type.Where(a => a == TextType.mainArticle).Count() > 0)
-                    {
-                        if(part.value != "") { goto endEscape; }
-                    }
                     if (indentOpen == true)
                     {
                         html.Append("
");
@@ -421,8 +425,6 @@
                     }
                     indent = 0;
                 }
-
-                endEscape:

                 //render contents of article part
                 var endTags = "";
@@ -443,9 +445,9 @@
                     else if (part.indent < indent)
                     {
                         //end of unordered list(s)
-                        for (var x = part.indent; x > indent; x--)
-                        {
-                            html.Append("
");
+                        for (var x = indent; x > part.indent; x--)
+                        {
+                            html.Append("

");
                         }
                         indent = part.indent;
                     }


BarOpacity property converted to dependency property

--- Caliburn.Micro.BindableAppBar/CustomAppBar.cs
+++ Caliburn.Micro.BindableAppBar/CustomAppBar.cs
@@ -294,6 +294,24 @@

         #endregion

+        #region BarOpacity DependencyProperty
+
+        public double BarOpacity
+        {
+            get { return (double)GetValue(BarOpacityProperty); }
+            set { SetValue(BarOpacityProperty, value); }
+        }
+
+        public static readonly DependencyProperty BarOpacityProperty =
+            DependencyProperty.Register("BarOpacity", typeof(double), typeof(BindableAppBar), new PropertyMetadata(1.0, BarOpacityChanged));
+
+        private static void BarOpacityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            ((BindableAppBar)d).ApplicationBar.Opacity = (double)e.NewValue;
+        }
+
+        #endregion
+
         #region IsMenuEnabled DependencyProperty

         public bool IsMenuEnabled
@@ -323,11 +341,6 @@

         public double MiniSize {
             get { return ApplicationBar.MiniSize; }
-        }
-
-        public double BarOpacity {
-            get { return ApplicationBar.Opacity; }
-            set { ApplicationBar.Opacity = value; }
         }

         public Color BackgroundColor {


docs(skadilogin)

docs(skadilogin)

add xml documentation for methods

--- src/skadisteam.login/SkadiLogin.cs
+++ src/skadisteam.login/SkadiLogin.cs
@@ -11,25 +11,68 @@

 namespace skadisteam.login
 {
+    /// <summary>
+    /// Class which has the required methods to make
+    /// a login into the steamcommunity.
+    /// </summary>
     public class SkadiLogin
     {
         private RequestFactory _requestFactory;
         private SkadiLoginConfiguration _skadiLoginConfiguration;

+        /// <summary>
+        /// Standard constructor. When used this the default settings are used.
+        /// These are:
+        /// <list type="table">
+        ///     <listheader>
+        ///         <term>Property</term>
+        ///         <description>Value</description>
+        ///     </listheader>
+        ///     <item>
+        ///         <term>StopOnError</term>
+        ///         <description>true</description>
+        ///     </item>
+        ///     <item>
+        ///         <term>WaitTimeEachError</term>
+        ///         <description>5</description>
+        ///     </item>
+        /// </list>
+        /// For more information lookup: <see cref="SkadiLoginConfiguration"/>.
+        /// </summary>
         public SkadiLogin()
         {
             _requestFactory = new RequestFactory();
         }

+        /// <summary>
+        /// Constructor which takes a <see cref="SkadiLoginConfiguration"/>.
+        /// You can edit the default behaviour there.
+        /// </summary>
+        /// <param name="skadiLoginConfiguration">
+        /// Login configuration which should be used.
+        /// See: <see cref="SkadiLoginConfiguration"/>.
+        /// </param>
         public SkadiLogin(SkadiLoginConfiguration skadiLoginConfiguration)
         {
             _requestFactory = new RequestFactory();
             _skadiLoginConfiguration = skadiLoginConfiguration;
         }
-
+
+        /// <summary>
+        /// Execute the login. This will take the configuration into consideration
+        /// which can be given as parameter in the constructor.
+        /// </summary>
+        /// <param name="skadiLoginData">
+        /// Date of the steam login. See <see cref="SkadiLoginData"/>.
+        /// </param>
+        /// <returns>
+        /// It will return a response with login data.
+        /// For more information lookup <see cref="SkadiLoginResponse"/>.
+        /// </returns>
         public SkadiLoginResponse Execute(SkadiLoginData skadiLoginData)
         {
-            if (_skadiLoginConfiguration != null && !_skadiLoginConfiguration.StopOnError)
+            if (_skadiLoginConfiguration != null &&
+                !_skadiLoginConfiguration.StopOnError)
             {
                 return ExecuteUntilLogin(skadiLoginData);
             }


FIX: Fixed SteamGifts login

FIX: Fixed SteamGifts login

--- src/KryBot/Parse.cs
+++ src/KryBot/Parse.cs
@@ -398,7 +398,7 @@
         private static Log SteamGiftsGetProfile(Bot bot)
         {
             var response = Web.Get("https://www.steamgifts.com/", "", new List<Parameter>(),
-                Generate.Cookies_SteamGifts(bot), new List<HttpHeader>());
+                Generate.Cookies_SteamGifts(bot), new List<HttpHeader>(), bot.GameMiner.UserAgent);

             if (response.RestResponse.Content != "")
             {


Don't check for SupportFiles TraceEvent on PerfViewCollect.

--- src/PerfView/App.cs
+++ src/PerfView/App.cs
@@ -162,6 +162,7 @@
                 CommandLineArgs.DataFile.IndexOf('.') < 0 && CommandLineArgs.DataFile.IndexOf('\\') < 0)
                 throw new ApplicationException("Error " + CommandLineArgs.DataFile + " not a perfView command.");

+#if !PERFVIEW_COLLECT
             // Check for error where you have a TraceEvent dll in the wrong place.
             var traceEventDllPath = typeof(TraceEvent).Assembly.ManifestModule.FullyQualifiedName;
             if (!traceEventDllPath.StartsWith(SupportFiles.SupportFileDir, StringComparison.OrdinalIgnoreCase))
@@ -175,6 +176,7 @@
                             "   You cannot place a version of Microsoft.Diagnostics.Tracing.TraceEvent.dll next to PerfView.exe.");
                 }
             }
+#endif

             // The 64 bit version of some of the native DLLs we use are built against the new Win10 libraries and will
             // fail to bind if they are loaded on an older OS (it would probably work for Win8 but do we care?)
@@ -217,7 +219,7 @@
                         CommandProcessor.LogFile.WriteLine("Trying to view {0}", CommandLineArgs.DataFile);
                     else
                         CommandProcessor.LogFile.WriteLine("No command given, Trying to open viewer.");
-#endif
+#endif
                     CommandProcessor.LogFile.WriteLine("Use 'PerfView collect' or 'PerfView HeapSnapshot' to collect data.");
                     return -4;
                 }
@@ -750,7 +752,7 @@
             return ret;
         }

-        #region private
+#region private
         /// <summary>
         /// This routine gets called every time we find a PDB.  We copy any PDBs to 'localPdbDir' if it is not
         /// already there.  That way every PDB that is needed is locally available, which is a nice feature.
@@ -898,7 +900,7 @@
         private static string m_SymbolPath;
         private static string m_SourcePath;

-        #region CreateConsole
+#region CreateConsole
         [System.Runtime.InteropServices.DllImport("kernel32", SetLastError = true)]
         static extern int AllocConsole();
         [System.Runtime.InteropServices.DllImport("kernel32", SetLastError = true)]
@@ -982,7 +984,7 @@
             });

             return true;
-#endif
+#endif
         }

 #if !DOTNET_CORE


populate response body in clientbase handleexception  to allow for more flexible error handling

--- src/ServiceStack.Common/ServiceClient.Web/ServiceClientBase.cs
+++ src/ServiceStack.Common/ServiceClient.Web/ServiceClientBase.cs
@@ -409,6 +409,7 @@
                     {
                         using (var stream = errorResponse.GetResponseStream())
                         {
+                            serviceEx.ResponseBody = stream.ToUtf8String();
                             serviceEx.ResponseDto = DeserializeFromStream<TResponse>(stream);
                         }
                     }
@@ -424,6 +425,7 @@
                     {
                         StatusCode = (int)errorResponse.StatusCode,
                         StatusDescription = errorResponse.StatusDescription,
+                        ResponseBody = serviceEx.ResponseBody
                     };
                 }


Create async client methods for the PATCH verb

--- src/ServiceStack.Common/ServiceClient.Web/ServiceClientBase.cs
+++ src/ServiceStack.Common/ServiceClient.Web/ServiceClientBase.cs
@@ -855,6 +855,16 @@
             asyncClient.SendAsync(HttpMethods.Put, GetUrl(relativeOrAbsoluteUrl), request, onSuccess, onError);
         }

+        public virtual void PatchAsync<TResponse>(IReturn<TResponse> request, Action<TResponse> onSuccess, Action<TResponse, Exception> onError)
+        {
+            PatchAsync(request.ToUrl(HttpMethods.Patch, Format), request, onSuccess, onError);
+        }
+
+        public virtual void PatchAsync<TResponse>(string relativeOrAbsoluteUrl, object request, Action<TResponse> onSuccess, Action<TResponse, Exception> onError)
+        {
+            asyncClient.SendAsync(HttpMethods.Patch, GetUrl(relativeOrAbsoluteUrl), request, onSuccess, onError);
+        }
+
         public virtual void CustomMethodAsync<TResponse>(string httpVerb, IReturn<TResponse> request, Action<TResponse> onSuccess, Action<TResponse, Exception> onError)
         {
             if (!HttpMethods.HasVerb(httpVerb))


Add boolean to figure out is the uow is made with the session

--- src/Smooth.IoC.Dapper.Repository.UnitOfWork/Data/UnitOfWork.cs
+++ src/Smooth.IoC.Dapper.Repository.UnitOfWork/Data/UnitOfWork.cs
@@ -9,8 +9,13 @@
         public SqlDialect SqlDialect { get; set; }
         private readonly Guid _guid = Guid.NewGuid();

-        public UnitOfWork(IDbFactory factory, ISession session, IsolationLevel isolationLevel = IsolationLevel.Serializable) : base(factory)
+        public UnitOfWork(IDbFactory factory, ISession session,
+            IsolationLevel isolationLevel = IsolationLevel.Serializable, bool sessionOnlyForThisUnitOfWork = false) : base(factory)
         {
+            if (sessionOnlyForThisUnitOfWork)
+            {
+                Session = session;
+            }
             Transaction = session.BeginTransaction(isolationLevel);
         }


Detect integer overflow in String.Replace

Fixes #20719

--- src/System.Private.CoreLib/shared/System/Text/StringBuilder.cs
+++ src/System.Private.CoreLib/shared/System/Text/StringBuilder.cs
@@ -2088,7 +2088,10 @@
                 fixed (char* valuePtr = value)
                 {
                     // calculate the total amount of extra space or space needed for all the replacements.
-                    int delta = (value.Length - removeCount) * replacementsCount;
+                    long longDelta = (value.Length - removeCount) * (long)replacementsCount;
+                    int delta = (int)longDelta;
+                    if (delta != longDelta)
+                        throw new OutOfMemoryException();

                     StringBuilder targetChunk = sourceChunk;        // the target as we copy chars down
                     int targetIndexInChunk = replacements[0];


Moving incrementation up

Moving incrementation up

--- src/System.Security.Claims/src/System/Security/Claims/Claim.cs
+++ src/System.Security.Claims/src/System/Security/Claims/Claim.cs
@@ -125,11 +125,11 @@
             if ((mask & SerializationMask.HasProperties) == SerializationMask.HasProperties)
             {
                 int numProperties = reader.ReadInt32();
+                numPropertiesRead++;
                 for (int i = 0; i < numProperties; i++)
                 {
                     Properties.Add(reader.ReadString(), reader.ReadString());
                 }
-                numPropertiesRead++;
             }

             if ((mask & SerializationMask.UserData) == SerializationMask.UserData)


Fix content repo to respect dates if forced

--- src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
+++ src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
@@ -486,7 +486,8 @@
             }
             else
             {
-                entity.UpdateDate = DateTime.Now;
+                if (entity.IsPropertyDirty("UpdateDate") == false || entity.UpdateDate == default(DateTime))
+                    entity.UpdateDate = DateTime.Now;
             }

             //Ensure unique name on the same level


Null annotate TempPECompiler

Null annotate TempPECompiler

--- src/VisualStudio/Core/Impl/ProjectSystem/CPS/TempPECompiler.cs
+++ src/VisualStudio/Core/Impl/ProjectSystem/CPS/TempPECompiler.cs
@@ -2,14 +2,17 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.

+#nullable enable
+
 using System;
 using System.Collections.Generic;
+using System.Collections.Immutable;
 using System.ComponentModel.Composition;
 using System.IO;
 using System.Threading;
 using System.Threading.Tasks;
 using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Shared.Extensions;
 using Microsoft.VisualStudio.LanguageServices.ProjectSystem;
 using Roslyn.Utilities;

@@ -37,13 +40,13 @@
                 throw new ArgumentException(nameof(outputFileName), "Must specify an output file name.");
             }

-            var project = _workspace.CurrentSolution.GetProject(context.Id);
+            var project = _workspace.CurrentSolution.GetRequiredProject(context.Id);

             // Remove all files except the ones we care about
             var documents = project.Documents;
             foreach (var document in documents)
             {
-                if (!filesToInclude.Contains(document.FilePath))
+                if (document.FilePath != null && !filesToInclude.Contains(document.FilePath))
                 {
                     project = project.RemoveDocument(document.Id);
                 }
@@ -51,8 +54,9 @@
                 cancellationToken.ThrowIfCancellationRequested();
             }

+
             // We need to inherit most of the projects options, mainly for VB (RootNamespace, GlobalImports etc.), but we need to override about some specific things surrounding the output
-            var options = project.CompilationOptions
+            var options = project.CompilationOptions!
                     // copied from the old TempPE compiler used by legacy, for parity.
                     // See: https://github.com/dotnet/roslyn/blob/fab7134296816fc80019c60b0f5bef7400cf23ea/src/VisualStudio/CSharp/Impl/ProjectSystemShim/TempPECompilerService.cs#L58
                     .WithAssemblyIdentityComparer(DesktopAssemblyIdentityComparer.Default)
@@ -65,7 +69,7 @@
                     // Turn off any warnings as errors just in case
                     .WithGeneralDiagnosticOption(ReportDiagnostic.Suppress)
                     .WithReportSuppressedDiagnostics(false)
-                    .WithSpecificDiagnosticOptions(null)
+                    .WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty)
                     // Turn off any signing and strong naming
                     .WithDelaySign(false)
                     .WithCryptoKeyFile(null)
@@ -77,7 +81,7 @@
                 // AssemblyName should be set to the filename of the output file because multiple TempPE DLLs can be created for the same project
                 .WithAssemblyName(Path.GetFileName(outputFileName));

-            var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
+            var compilation = await project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);

             cancellationToken.ThrowIfCancellationRequested();


basic exception handling

basic exception handling

--- src/SlackHandler.cs
+++ src/SlackHandler.cs
@@ -82,8 +82,28 @@
                         return $"Not enough funds. You only have {balance} NXT.";
                     }

-                    var txId = await nxtConnector.SendMoney(account, address, amount, "withdraw requested");
-                    return $"{amount.Nxt} NXT was sent to the specified address, (https://nxtportal.org/transactions/{txId})";
+                    try
+                    {
+                        var txId = await nxtConnector.SendMoney(account, address, amount, "withdraw from slack tipbot requested");
+                        return $"{amount.Nxt} NXT was sent to the specified address, (https://nxtportal.org/transactions/{txId})";
+                    }
+                    catch (ArgumentException e)
+                    {
+                        if (e.Message.Contains("not a valid reed solomon address"))
+                        {
+                            return "Not a valid NXT address";
+                        }
+                        else
+                        {
+                            logger.LogError(0, e, e.Message);
+                            throw;
+                        }
+                    }
+                    catch (NxtException e)
+                    {
+                        logger.LogError(0, e, e.Message);
+                        throw;
+                    }
                 }
                 else
                 {


Added skew effect on blinking colon

Added skew effect on blinking colon


Make Dependencies protected again

Make Dependencies protected again

--- osu.Framework/Graphics/Drawable.cs
+++ osu.Framework/Graphics/Drawable.cs
@@ -158,8 +158,9 @@

         /// <summary>
         /// Contains all dependencies that can be injected into this Drawable using <see cref="BackgroundDependencyLoader"/>.
-        /// </summary>
-        internal DependencyContainer Dependencies { get; private set; }
+        /// Add or override dependencies by calling <see cref="DependencyContainer.Cache{T}(T, bool, bool)"/>.
+        /// </summary>
+        protected DependencyContainer Dependencies { get; private set; }

         /// <summary>
         /// Loads this drawable, including the gathering of dependencies and initialisation of required resources.


Don't use .ForEach.

Don't use .ForEach.

--- osu.Framework/Graphics/Drawable.cs
+++ osu.Framework/Graphics/Drawable.cs
@@ -725,7 +725,8 @@
             Game = root;
             clockBacking.Invalidate();

-            children.ForEach(c => c.changeRoot(root));
+            foreach (Drawable c in children)
+                c.changeRoot(root);
         }

         /// <summary>


Only invalidate for changed BypassAutoSizeAxes

--- osu.Framework/Graphics/Drawable.cs
+++ osu.Framework/Graphics/Drawable.cs
@@ -791,10 +791,10 @@
             var value = RelativePositionAxes | RelativeSizeAxes | bypassAutoSizeAdditionalAxes;
             if (bypassAutoSizeAxes != value)
             {
-                if (((Parent?.AutoSizeAxes ?? 0) & ~(bypassAutoSizeAxes & value)) != 0)
+                var changedAxes = bypassAutoSizeAxes ^ value;
+                bypassAutoSizeAxes = value;
+                if (((Parent?.AutoSizeAxes ?? 0) & changedAxes) != 0)
                     Parent?.InvalidateFromChild(Invalidation.RequiredParentSizeToFit, this);
-
-                bypassAutoSizeAxes = value;
             }
         }


Adjustments for edge cases support

Adjustments for edge cases support

--- osu.Game/Overlays/Profile/Sections/Historical/ProfileLineChart.cs
+++ osu.Game/Overlays/Profile/Sections/Historical/ProfileLineChart.cs
@@ -117,6 +117,8 @@

             var tick = getTick(getRange(max - min), 6);

+            bool tickIsDecimal = tick < 1.0;
+
             double rollingRow = 0;

             while (rollingRow <= max)
@@ -124,7 +126,7 @@
                 if (rollingRow >= min)
                 {
                     var y = -Interpolation.ValueAt(rollingRow, 0, 1f, min, max);
-                    addRowTick(y, (long)rollingRow);
+                    addRowTick(y, rollingRow, tickIsDecimal);
                 }

                 rollingRow += tick;
@@ -136,7 +138,7 @@
             columnTicksContainer.Clear();
             columnLinesContainer.Clear();

-            var totalMonths = values.Length - 1;
+            var totalMonths = values.Length;

             int monthsPerTick = 1;

@@ -149,12 +151,12 @@

             for (int i = 0; i < totalMonths; i += monthsPerTick)
             {
-                var x = (float)i / totalMonths;
+                var x = (float)i / (totalMonths - 1);
                 addColumnTick(x, values[i].Date);
             }
         }

-        private void addRowTick(float y, long value)
+        private void addRowTick(float y, double value, bool tickIsDecimal)
         {
             rowTicksContainer.Add(new TickText
             {
@@ -162,7 +164,7 @@
                 Origin = Anchor.CentreRight,
                 RelativePositionAxes = Axes.Y,
                 Margin = new MarginPadding { Right = 3 },
-                Text = value.ToString("N0"),
+                Text = tickIsDecimal ? value.ToString("F1") : value.ToString("N0"),
                 Font = OsuFont.GetFont(size: 12),
                 Y = y
             });
@@ -202,7 +204,7 @@
             });
         }

-        private long getRange(double initialRange)
+        private double getRange(double initialRange)
         {
             var exponent = Math.Floor(Math.Log10(initialRange));
             var fraction = initialRange / Math.Pow(10, exponent);
@@ -218,10 +220,10 @@
             else
                 niceFraction = 10.0;

-            return (long)(niceFraction * Math.Pow(10, exponent));
-        }
-
-        private long getTick(long range, int maxTicksCount)
+            return niceFraction * Math.Pow(10, exponent);
+        }
+
+        private double getTick(double range, int maxTicksCount)
         {
             var value = range / (maxTicksCount - 1);

@@ -239,7 +241,7 @@
             else
                 niceFraction = 10.0;

-            return (long)(niceFraction * Math.Pow(10, exponent));
+            return niceFraction * Math.Pow(10, exponent);
         }

         private class TickText : OsuSpriteText


Filter AvailableInputHandlers using SingleOrDefault

--- osu.Framework/Platform/GameHost.cs
+++ osu.Framework/Platform/GameHost.cs
@@ -587,7 +587,7 @@
                 if (useDefaults)
                 {
                     resetInputHandlers();
-                    ignoredInputHandler.Value = AvailableInputHandlers.Single(h => !h.Enabled).ToString();
+                    ignoredInputHandler.Value = AvailableInputHandlers.SingleOrDefault(h => !h.Enabled)?.ToString();
                 }
                 else
                 {


summary:     Commit new heredoc tests. date:        Sun Aug 28 18:24:11 2011 +0300 user:        Michael Tindal <babyplatypus@me.com> changeset:   160:38f6cac8278c hg2git:      Preserving hg log changeset

summary:     Commit new heredoc tests.
date:        Sun Aug 28 18:24:11 2011 +0300
user:        Michael Tindal <10080bb0256fbc0aa0b893ac770792eb01968fc9@me.com>
changeset:   160:38f6cac8278c
hg2git:      Preserving hg log changeset

--- Irony.Tests/HeredocTerminalTests.cs
+++ Irony.Tests/HeredocTerminalTests.cs
@@ -20,6 +20,35 @@
     [TestClass]
     public class HeredocTerminalTests : TerminalTestsBase {
         private TestContext testContextInstance;
+        private Parser _p;
+
+        private class HereDocTestGrammar : Grammar {
+            public HereDocTestGrammar()
+                : base(true) {
+                var heredoc = new HereDocTerminal("HereDoc", "<<", HereDocOptions.None);
+                heredoc.AddSubType("<<-", HereDocOptions.AllowIndentedEndToken);
+                var @string = new StringLiteral("string", "\"");
+                var program = new NonTerminal("program");
+                program.Rule = heredoc + @"+" + @string + this.NewLine + @"+" + @string
+                    | heredoc + @"+" + heredoc + @"+" + @string + this.NewLine
+                    | heredoc + @"+" + @string + this.NewLine
+                    | heredoc + @"+" + @string + @"+" + heredoc
+                    | heredoc + @"+" + heredoc
+                    | heredoc;
+                this.Root = program;
+                this.MarkPunctuation("+");
+            }
+        }
+
+        private string NormalizeParseTree(ParseTree tree) {
+            StringBuilder fullString = new StringBuilder();
+            foreach (ParseTreeNode node in tree.Root.ChildNodes) {
+                fullString.Append(node.Token.Value);
+            }
+            fullString = fullString.Replace("\r\n", "\\n");
+            fullString = fullString.Replace("\n", "\\n");
+            return fullString.ToString();
+        }

         /// <summary>
         ///Gets or sets the test context which provides
@@ -56,6 +85,13 @@
         //
         #endregion

+        [TestInitialize]
+        public void HereDocSetup() {
+            HereDocTestGrammar grammar = new HereDocTestGrammar();
+            _p = new Parser(grammar);
+            _p.Context.SetOption(ParseOptions.TraceParser, true);
+        }
+
         [TestMethod]
         public void TestHereDocLiteral() {
             var term = new HereDocTerminal("Heredoc","<<",HereDocOptions.None);
@@ -110,5 +146,79 @@
             Assert.IsNotNull(_token, "Failed to produce a token on valid string.");
             Assert.IsTrue(_token.IsError(), "Failed to detect error on invalid heredoc.");
         }
+
+        [TestMethod]
+        public void TestHereDocParseHereDocStringString() {
+            ParseTree tree = _p.Parse(@"<<HELLO + ""<--- this is the middle --->\n""
+This is the beginning.
+It is two lines long.
+HELLO
++ ""And now it's over!""");
+            Assert.AreEqual(@"This is the beginning.\nIt is two lines long.\n<--- this is the middle --->\nAnd now it's over!", NormalizeParseTree(tree), "Incorrectly parsed heredoc.");
+        }
+
+        [TestMethod]
+        public void TestHereDocParseHereDocStringHereDoc() {
+            ParseTree tree = _p.Parse(@"<<HELLO + ""<--- this is the middle --->\n"" + <<END
+This is the beginning.
+It is more than two lines long.
+It is three lines long.
+HELLO
+And now it's over!
+But we have three lines left.
+Now two more lines.
+Oops, last line! :(
+END");
+            Assert.AreEqual(@"This is the beginning.\nIt is more than two lines long.\nIt is three lines long.\n<--- this is the middle --->\nAnd now it's over!\nBut we have three lines left.\nNow two more lines.\nOops, last line! :(", NormalizeParseTree(tree), "Incorrectly parsed heredoc.");
+        }
+
+        [TestMethod]
+        public void TestHereDocParseHereDocHereDoc() {
+            ParseTree tree = _p.Parse(@"<<HELLO + <<END
+This is the beginning.
+How are you doing?
+HELLO
+I'm fine.
+And now it's over!
+END");
+            Assert.AreEqual(@"This is the beginning.\nHow are you doing?\nI'm fine.\nAnd now it's over!", NormalizeParseTree(tree), "Incorrectly parsed heredoc.");
+        }
+
+        [TestMethod]
+        public void TestHereDocParseHereDoc() {
+            ParseTree tree = _p.Parse(@"<<HELLO
+This is the beginning.
+I hope you enjoyed these tests.
+HELLO");
+            Assert.AreEqual(@"This is the beginning.\nI hope you enjoyed these tests.", NormalizeParseTree(tree), "Incorrectly parsed heredoc.");
+        }
+
+        [TestMethod]
+        public void TestHereDocParseHereDocHereDocString() {
+            ParseTree tree = _p.Parse(@"<<HELLO + <<MIDDLE + ""<--- And now it's over --->""
+This is the beginning.
+HELLO
+And this is the middle.
+MIDDLE");
+            Assert.AreEqual(@"This is the beginning.\nAnd this is the middle.\n<--- And now it's over --->", NormalizeParseTree(tree), "Incorrectly parsed heredoc.");
+        }
+
+        [TestMethod]
+        public void TestHereDocParseHereDocString() {
+            ParseTree tree = _p.Parse(@"<<HELLO + ""<--- this is the end --->""
+This is the beginning.
+HELLO");
+            Assert.AreEqual(@"This is the beginning.\n<--- this is the end --->", NormalizeParseTree(tree), "Incorrectly parsed heredoc.");
+        }
+
+        [TestMethod]
+        public void TestHereDocParseIndentHereDocStringHereDoc() {
+            ParseTree tree = _p.Parse(@"<<-BEGIN + ""<--- middle --->\n"" + <<-END
+This is the beginning:
+		BEGIN
+And now it is over!
+		END");
+            Assert.AreEqual(@"This is the beginning:\n<--- middle --->\nAnd now it is over!", NormalizeParseTree(tree), "Incorrectly parsed heredoc.");
+        }
     }
 }


working on AnimatedPointLayer

working on AnimatedPointLayer

--- Mapsui/Layers/AnimatedPointLayer.cs
+++ Mapsui/Layers/AnimatedPointLayer.cs
@@ -13,22 +13,31 @@
 {
     public class AnimatedPointLayer : BaseLayer
     {
+        private class AnimatedPointFeature : Feature
+        {
+            public AnimatedPointFeature(Feature feature) : base(feature)
+            {
+            }
+
+            public Point PreviousPoint { get; set; }
+            public Point CurrentPoint { get; set; }
+        }
+
         private const string PrimaryKey = "ID";
-        private readonly string _previousGeometryField = Guid.NewGuid().ToString();
-        private readonly string _currentGeometryField = Guid.NewGuid().ToString();
+        //private readonly string _previousGeometryField = Guid.NewGuid().ToString();
+        //private readonly string _currentGeometryField = Guid.NewGuid().ToString();
         private long _startTime;
         private const long AnimationDuration = 1000;
+        private List<AnimatedPointFeature> _cache;
+        private readonly IProvider _dataSource;
         private Timer _timer;
-        protected MemoryProvider Cache;
-        private IProvider _dataSource;
         private Timer _animation;
-
+
         public AnimatedPointLayer(IProvider dataSource)
         {
             _dataSource = dataSource;
             _timer = new Timer(Callback, this, 0, 2000);
             _animation = new Timer(AnimationCallback, this, 0, 9);
-
         }

         private static void Callback(object state)
@@ -47,25 +56,42 @@

         protected void DataArrived(IEnumerable<IFeature> features, object state = null)
         {
-            var previousCache = Cache;
+            var previousCache = _cache;

-            var featureList = features.ToList();
-            Cache = new MemoryProvider(featureList);
-
+            _cache = ConvertToAnimatedFeatures(previousCache, features.ToList());
+
             if (previousCache == null) return;

-            foreach (var feature in featureList)
-            {
-                var previousFeature = previousCache.Find(feature[PrimaryKey], PrimaryKey);
-                if (previousFeature != null)
-                {
-                    feature[_previousGeometryField] = previousFeature.Geometry;
-                    feature[_currentGeometryField] = feature.Geometry;
-                }
-            }
             _startTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

             OnDataChanged(new DataChangedEventArgs());
+        }
+
+        private List<AnimatedPointFeature> ConvertToAnimatedFeatures(List<AnimatedPointFeature> previousFeatures, IEnumerable<IFeature> features)
+        {
+            var animatedFeatureList = new List<AnimatedPointFeature>();
+
+            foreach (var feature in features)
+            {
+                var animatedPointFeature = new AnimatedPointFeature((Feature)feature);
+                if (previousFeatures != null)
+                {
+                    LookupPreviousState(previousFeatures, feature, animatedPointFeature);
+                }
+                animatedFeatureList.Add(animatedPointFeature);
+            }
+            return animatedFeatureList;
+        }
+
+        private static void LookupPreviousState(IEnumerable<AnimatedPointFeature> previousFeatures, IFeature feature,
+            AnimatedPointFeature animatedPointFeature)
+        {
+            var previousFeature = previousFeatures.FirstOrDefault(f => f[PrimaryKey].Equals(feature[PrimaryKey]));
+            if (previousFeature != null)
+            {
+                animatedPointFeature.PreviousPoint = previousFeature.Geometry as Point;
+                animatedPointFeature.CurrentPoint = animatedPointFeature.Geometry as Point;
+            }
         }

         public override BoundingBox Envelope
@@ -75,34 +101,37 @@

         public override IEnumerable<IFeature> GetFeaturesInView(BoundingBox extent, double resolution)
         {
-            var features = Cache.Features;
+            var progression = CalculateProgressionAnimation(_startTime);
+            if (progression < 1) InterpolateAnimatedPosition(_cache, progression);
+            return _cache;
+        }

-            var currentTime = DateTime.Now.Ticks/TimeSpan.TicksPerMillisecond;
-            var elapsedTime = currentTime - _startTime;
-            var portion = elapsedTime/(float)AnimationDuration;
-            if (portion > 1) return features;
-
+        private static void InterpolateAnimatedPosition(IEnumerable<AnimatedPointFeature> features, double progression)
+        {
             foreach (var feature in features)
             {
-                var previous = feature[_previousGeometryField] as Point;
-                var current = feature[_currentGeometryField] as Point;
-                if (previous == null || current == null) continue;
-                var x = previous.X + (current.X - previous.X) * portion;
-                var y = previous.Y + (current.Y - previous.Y) * portion;
+                if (feature.PreviousPoint == null || feature.CurrentPoint == null) continue;
+                var x = feature.PreviousPoint.X + (feature.CurrentPoint.X - feature.PreviousPoint.X) * progression;
+                var y = feature.PreviousPoint.Y + (feature.CurrentPoint.Y - feature.PreviousPoint.Y) * progression;
                 feature.Geometry = new Point(x, y);
             }
+        }

-            return features;
+        private static double CalculateProgressionAnimation(long startTime)
+        {
+            var currentTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
+            var elapsedTime = currentTime - startTime;
+            return elapsedTime / (double)AnimationDuration;
         }

         public override void AbortFetch()
         {
-
+
         }

         public override void ViewChanged(bool changeEnd, BoundingBox extent, double resolution)
         {
-
+
         }

         public override void ClearCache()


cake: add targets for building and running the unit tests

* use via:
  cake --target=BuildTests
  cake --target=RunTests

--- .build/build.cake
+++ .build/build.cake
@@ -83,12 +83,6 @@
   BuildProject("BLE.Client", "BLE.Client.macOS", Path.Combine("clients", "macOS"));
 });

-Task("Build")
-    .IsDependentOn("Clean")
-    .IsDependentOn("Restore")
-    .IsDependentOn("BuildLibs")
-    .Does(() => {});
-
 Task("Clean").Does (() =>
 {
     if (DirectoryExists (BuildTargetDir))
@@ -96,6 +90,46 @@

     CleanDirectories ("../**/bin");
     CleanDirectories ("../**/obj");
+});
+
+Task("Build")
+    .IsDependentOn("Clean")
+    .IsDependentOn("Restore")
+    .IsDependentOn("BuildLibs")
+    .Does(() => {});
+
+Task("BuildTests")
+    .Does(() =>
+{
+    var projects = GetFiles("../Source/Plugin.BLE.Tests/Plugin.BLE.Tests.csproj");
+    foreach(var project in projects)
+    {
+        DotNetBuild(
+            project.FullPath,
+            new DotNetBuildSettings()
+            {
+                Configuration = "Release",
+                NoRestore = true
+            });
+    }
+});
+
+Task("RunTests")
+    .IsDependentOn("BuildTests")
+    .Does(() =>
+{
+    var projects = GetFiles("../Source/Plugin.BLE.Tests/Plugin.BLE.Tests.csproj");
+    foreach(var project in projects)
+    {
+        DotNetTest(
+            project.FullPath,
+            new DotNetTestSettings()
+            {
+                Configuration = "Release",
+                NoBuild = true,
+                Loggers = { "console;verbosity=detailed" }
+            });
+    }
 });

 // ./build.ps1 -Target UpdateVersion -newVersion="2.0.1"


Keep command line arguments that start with a '/'

--- src/Workspaces/Core/MSBuild/MSBuild/ProjectFile/ProjectFile.cs
+++ src/Workspaces/Core/MSBuild/MSBuild/ProjectFile/ProjectFile.cs
@@ -163,7 +163,6 @@
         {
             var commandLineArgs = GetCompilerCommandLineArgs(project)
                 .Select(item => item.ItemSpec)
-                .Where(item => item.StartsWith("/"))
                 .ToImmutableArray();

             if (commandLineArgs.Length == 0)


(specs) Upgrade Scenarios

(specs) Upgrade Scenarios

- Read/Delete Shared Locked file
- Exclusively Locked file

--- src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs
+++ src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs
@@ -572,6 +572,185 @@
             }
         }

+        public class when_upgrading_an_existing_package_with_a_read_and_delete_share_locked_file : ScenariosBase
+        {
+            private PackageResult _packageResult;
+
+            private FileStream fileStream;
+
+            public override void Context()
+            {
+                base.Context();
+                var fileToOpen = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "tools", "chocolateyInstall.ps1");
+                fileStream = new FileStream(fileToOpen, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read | FileShare.Delete);
+            }
+
+            public override void AfterObservations()
+            {
+                base.AfterObservations();
+                fileStream.Close();
+            }
+
+            public override void Because()
+            {
+                Results = Service.upgrade_run(Configuration);
+                _packageResult = Results.FirstOrDefault().Value;
+            }
+
+            [Fact]
+            public void should_upgrade_where_install_location_reports()
+            {
+                Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue();
+            }
+
+            [Fact]
+            public void should_upgrade_a_package_in_the_lib_directory()
+            {
+                var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames);
+
+                Directory.Exists(packageDir).ShouldBeTrue();
+            }
+
+            [Fact]
+            public void should_not_be_able_delete_the_rollback()
+            {
+                var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames);
+
+                Directory.Exists(packageDir).ShouldBeTrue();
+            }
+
+            [Fact]
+            public void should_contain_newer_version_in_directory()
+            {
+                var shimFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "tools", "console.exe");
+
+                File.ReadAllText(shimFile).ShouldEqual("1.1.0");
+            }
+
+            [Fact]
+            public void should_contain_a_warning_message_that_it_upgraded_successfully()
+            {
+                bool upgradedSuccessMessage = false;
+                foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null())
+                {
+                    if (message.Contains("upgraded 1/1")) upgradedSuccessMessage = true;
+                }
+
+                upgradedSuccessMessage.ShouldBeTrue();
+            }
+
+            [Fact]
+            public void should_contain_a_warning_message_with_old_and_new_versions()
+            {
+                bool upgradeMessage = false;
+                foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null())
+                {
+                    if (message.Contains("You have upgradepackage v1.0.0 installed. Version 1.1.0 is available based on your source")) upgradeMessage = true;
+                }
+
+                upgradeMessage.ShouldBeTrue();
+            }
+        }
+
+        public class when_upgrading_an_existing_package_with_an_exclusively_locked_file : ScenariosBase
+        {
+            private PackageResult _packageResult;
+
+            private FileStream fileStream;
+
+            public override void Context()
+            {
+                base.Context();
+                var fileToOpen = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "tools", "chocolateyInstall.ps1");
+                fileStream = new FileStream(fileToOpen, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
+            }
+
+            public override void AfterObservations()
+            {
+                base.AfterObservations();
+                fileStream.Close();
+            }
+
+            public override void Because()
+            {
+                Results = Service.upgrade_run(Configuration);
+                _packageResult = Results.FirstOrDefault().Value;
+            }
+
+            [Fact]
+            public void should_upgrade_where_install_location_reports()
+            {
+                Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue();
+            }
+
+            [Fact]
+            public void should_upgrade_a_package_in_the_lib_directory()
+            {
+                var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames);
+
+                Directory.Exists(packageDir).ShouldBeTrue();
+            }
+
+            [Fact]
+            public void should_delete_the_rollback()
+            {
+                var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames);
+
+                Directory.Exists(packageDir).ShouldBeFalse();
+            }
+
+            [Fact]
+            public void should_contain_old_version_in_directory()
+            {
+                var shimFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "tools", "console.exe");
+
+                File.ReadAllText(shimFile).ShouldEqual("1.0.0");
+            }
+
+            [Fact]
+            public void should_contain_a_warning_message_that_it_was_not_able_to_upgrade()
+            {
+                bool upgradedSuccessMessage = false;
+                foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null())
+                {
+                    if (message.Contains("upgraded 0/1")) upgradedSuccessMessage = true;
+                }
+
+                upgradedSuccessMessage.ShouldBeTrue();
+            }
+
+            [Fact]
+            public void should_contain_a_warning_message_with_old_and_new_versions()
+            {
+                bool upgradeMessage = false;
+                foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null())
+                {
+                    if (message.Contains("You have upgradepackage v1.0.0 installed. Version 1.1.0 is available based on your source")) upgradeMessage = true;
+                }
+
+                upgradeMessage.ShouldBeTrue();
+            }
+
+            [Fact]
+            public void should_not_have_a_successful_package_result()
+            {
+                _packageResult.Success.ShouldBeFalse();
+            }
+
+            [Fact]
+            public void should_not_have_inconclusive_package_result()
+            {
+                _packageResult.Inconclusive.ShouldBeFalse();
+            }
+
+            [Fact]
+            public void should_not_have_warning_package_result()
+            {
+                _packageResult.Warning.ShouldBeFalse();
+            }
+
+        }
+
         public class when_upgrading_a_package_with_added_files : ScenariosBase
         {
             private PackageResult _packageResult;
@@ -890,5 +1069,6 @@
         //pinned package upgrade scenario
         //open a file in package folder (holding lock)
         //upgrade dependencies
+        //when upgrading a file that has locked dependency
     }
 }


Updated property selection

Updated property selection

--- Aras.ViewModel.Design/Order.cs
+++ Aras.ViewModel.Design/Order.cs
@@ -111,11 +111,13 @@
             if (this.ModelSession != null)
             {
                 this.ModelSession.ItemType("v_Order Context").AddToSelect("quantity,value,locked_by_id");
-                this.ModelSession.ItemType("Variant Context").AddToSelect("context_type,min_quantity,max_quantity,sort_order");
-                this.ModelSession.ItemType("Part").AddToSelect("item_number,locked_by_id");
+                this.ModelSession.ItemType("Variant Context").AddToSelect("context_type,min_quantity,max_quantity,sort_order,method,list,question");
+                this.ModelSession.ItemType("Part").AddToSelect("item_number,cmb_var_structure_ref,locked_by_id,name");
                 this.ModelSession.ItemType("Part Variants").AddToSelect("quantity");
                 this.ModelSession.ItemType("Part BOM").AddToSelect("quantity,locked_by_id,sort_order");
                 this.ModelSession.ItemType("User").AddToSelect("keyed_name");
+                this.ModelSession.ItemType("Method").AddToSelect("name");
+                this.ModelSession.ItemType("Part Variant Rule").AddToSelect("value");
             }

             if (this.ModelItem != null)


Fixed zip filename.

Fixed zip filename.

--- Assets/Editor/BuildPipeline.cs
+++ Assets/Editor/BuildPipeline.cs
@@ -36,7 +36,7 @@
                 targetString = "Win";
                 break;
             case BuildTarget.StandaloneWindows64:
-                targetString = "Win.x64";
+                targetString = "Win x64";
                 break;
             default:
                 break;
@@ -55,7 +55,7 @@
         using (ZipFile zip = new ZipFile())
         {
             zip.AddDirectory(path);
-            zip.Save("Build/" + releaseName + "." + targetString + ".zip");
+            zip.Save("Build/" + releaseName + " " + version + " " + targetString + ".zip");
         }
     }


Automatic Position and Addition to ArrayList

--- Assets/Scripts/EnemyManager.cs
+++ Assets/Scripts/EnemyManager.cs
@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;

 public class EnemyManager : MonoBehaviour {
@@ -6,23 +6,38 @@

 	GameObject enemy;
 	int i;
+	ArrayList enemyInfo;

-	// Use this for initialization
 	void Start () {
-		i = 1;
+		enemyInfo = new ArrayList();
 	}

-	// Update is called once per frame
+
 	void Update () {

-		Vector3 position = new Vector3(Random.Range(-5, 5), 0, Random.Range(-10, 10));
+		Vector3 position = new Vector3 (Random.Range (-15, 15), Random.Range (-5, 5), Random.Range (10, 20));
+		if (enemyInfo.Count < 10) {
+			if (enemyInfo.Count == 0) {

-		if (GameObject.FindGameObjectsWithTag ("Enemy").Length < 10) {
+				enemy = Instantiate (Resources.Load ("Prefabs/Meteor"), position, Quaternion.identity) as GameObject;
+				enemyInfo.Add((Object)enemy);
+				enemy.name = "Meteor " + enemyInfo.Count;
+			} else {
+				print (enemyInfo.Count);

-			enemy = Instantiate (Resources.Load("Prefabs/Asteroid"), position, Quaternion.identity) as GameObject;
-			enemy.name = "Asteroid " + i.ToString();
-			i++;
+				foreach (Object obj in enemyInfo) {
+					Vector3 tempPosition = position - ((GameObject)obj).transform.position;
+					if (tempPosition.sqrMagnitude > 16f) {
+						enemy = Instantiate (Resources.Load ("Prefabs/Meteor"), position, Quaternion.identity) as GameObject;
+						enemy.name = "Meteor " + enemyInfo.Count;
+						enemyInfo.Add ((Object)enemy);
+						break;
+					}
+
+				}
+			}
 		}
+	}

-	}
 }
+


Added window-of-opportunity for jumping after falling from a ledge

--- Assets/Scripts/PlayerScript.cs
+++ Assets/Scripts/PlayerScript.cs
@@ -33,6 +33,7 @@
     Animation characterAnimation;
     bool isRunning;
     NetworkPlayer? owner;
+    float sinceNotGrounded;

     // for interpolation on remote computers only
     VectorInterpolator iPosition;
@@ -160,13 +161,16 @@

         // jump and dash
         dashCooldown -= Time.deltaTime;
+        bool justJumped = false;
         if(networkView.isMine && Time.time - lastJumpInputTime <= JumpInputQueueTime)
         {
-            if(controller.isGrounded)
+            if (controller.isGrounded || sinceNotGrounded < 0.25f)
             {
                 lastJumpInputTime = -1;
+                justJumped = true;
                 fallingVelocity.y = jumpVelocity;
                 characterAnimation.Play("Jump");
+                sinceNotGrounded = 0.25f;
             }
             else if(smoothedInputVelocity != Vector3.zero && dashCooldown <= 0)
             {
@@ -180,12 +184,15 @@

         if(controller.isGrounded)
         {
+            if (!justJumped)
+                sinceNotGrounded = 0;
             // infinite friction
             if(fallingVelocity.y <= 0)
                 fallingVelocity = Vector3.up * gravity * Time.deltaTime;
         }
         else
         {
+            sinceNotGrounded += Time.deltaTime;
             // air drag / gravity
             fallingVelocity.y += gravity * Time.deltaTime;
             fallingVelocity.x *= Mathf.Pow(airVelocityDamping, Time.deltaTime);


Change port to avoid incompatibilities with WFH

--- Assets/Scripts/ServerScript.cs
+++ Assets/Scripts/ServerScript.cs
@@ -16,7 +16,7 @@
     public static ServerScript Instance { get; private set; }

     //Public
-    public const int port = 31415;
+    public const int port = 31414;
     public const string buildVersion = "15062014";
     public const string MasterServerUri = "http://ohs.padrepio.in/";


Updated AsyncInit.Silverlight/Utils.cs to throw MissingMethodException

--- AsyncInit.Silverlight/Utils.cs
+++ AsyncInit.Silverlight/Utils.cs
@@ -17,7 +17,7 @@
         {
             var ctor = typeof(T).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[0], null);
             if (ctor == null)
-                throw new MissingMemberException("No parameterless constructor defined for this object.");
+                throw new MissingMethodException("No parameterless constructor defined for this object.");
             return (T)ctor.Invoke(null);
         }
     }


Use QuoteSingleArgument for working direcotry

--- Common/Product/SharedProject/ProcessOutput.cs
+++ Common/Product/SharedProject/ProcessOutput.cs
@@ -239,8 +239,8 @@
                 Verb = "runas",
                 CreateNoWindow = true,
                 UseShellExecute = true,
-                Arguments = string.Format(@"/S /C pushd ""{0}"" & ""{1} {2} >>{3} 2>>{4}""",
-                workingDirectory,
+                Arguments = string.Format(@"/S /C pushd {0} & ""{1} {2} >>{3} 2>>{4}""",
+                QuoteSingleArgument(workingDirectory),
                 QuoteSingleArgument(filename),
                 GetArguments(arguments, quoteArgs),
                 QuoteSingleArgument(outFile),


Added params version of Except

Added params version of Except

--- ComputerAlgebra/Utils/EnumerableExtensions.cs
+++ ComputerAlgebra/Utils/EnumerableExtensions.cs
@@ -96,29 +96,9 @@
             }
         }
         [DebuggerStepThrough]
-        public static IEnumerable<T> ExceptUnique<T>(this IEnumerable<T> This, IEnumerable<T> Excepted)
-        {
-            return ExceptUnique(This, Excepted, EqualityComparer<T>.Default);
-        }
-
-        /// <summary>
-        /// Except a single element from an IEnumerable.
-        /// </summary>
-        /// <typeparam name="T"></typeparam>
-        /// <param name="This"></param>
-        /// <param name="Excepted"></param>
-        /// <param name="Comparer"></param>
-        /// <returns></returns>
-        [DebuggerStepThrough]
-        public static IEnumerable<T> Except<T>(this IEnumerable<T> This, T Excepted, IEqualityComparer<T> Comparer)
-        {
-            return This.Where(i => !Comparer.Equals(Excepted, i));
-        }
-        [DebuggerStepThrough]
-        public static IEnumerable<T> Except<T>(this IEnumerable<T> This, T Excepted)
-        {
-            return Except(This, Excepted, EqualityComparer<T>.Default);
-        }
+        public static IEnumerable<T> ExceptUnique<T>(this IEnumerable<T> This, IEnumerable<T> Excepted) { return ExceptUnique(This, Excepted, EqualityComparer<T>.Default); }
+        [DebuggerStepThrough]
+        public static IEnumerable<T> ExceptUnique<T>(this IEnumerable<T> This, params T[] Excepted) { return ExceptUnique(This, Excepted.AsEnumerable()); }
         [DebuggerStepThrough]
         public static IEnumerable<T> ExceptUnique<T>(this IEnumerable<T> This, T Excepted, IEqualityComparer<T> Comparer)
         {
@@ -131,11 +111,17 @@
                     yield return i;
             }
         }
-        [DebuggerStepThrough]
-        public static IEnumerable<T> ExceptUnique<T>(this IEnumerable<T> This, T Excepted)
-        {
-            return ExceptUnique(This, Excepted, EqualityComparer<T>.Default);
-        }
+
+        /// <summary>
+        /// Except a single element from an IEnumerable.
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="This"></param>
+        /// <param name="Excepted"></param>
+        /// <param name="Comparer"></param>
+        /// <returns></returns>
+        [DebuggerStepThrough]
+        public static IEnumerable<T> Except<T>(this IEnumerable<T> This, params T[] Excepted) { return This.Except(Excepted.AsEnumerable()); }

         /// <summary>
         /// 3 way Zip.


Fixed dynamic binding.

Fixed dynamic binding.

--- ConfigInjector/SettingsRegistrationService.cs
+++ ConfigInjector/SettingsRegistrationService.cs
@@ -65,7 +65,7 @@
         internal static IConfigurationSetting ConstructSettingObject(Type type, string settingValueString)
         {
             var settingType = type.GetProperty("Value").PropertyType;
-            var settingValue = SettingValueConverter.ParseSettingValue(settingType, settingValueString);
+            var settingValue = (dynamic)SettingValueConverter.ParseSettingValue(settingType, settingValueString);

             var setting = (IConfigurationSetting) Activator.CreateInstance(type);
             ((dynamic) setting).Value = settingValue;


Update one more blending mode change post-master merge

--- osu.Game/Skinning/LegacySkin.cs
+++ osu.Game/Skinning/LegacySkin.cs
@@ -380,7 +380,7 @@
                     new Sprite
                     {
                         Texture = skin.GetTexture("sliderb-spec"),
-                        Blending = BlendingMode.Additive,
+                        Blending = BlendingParameters.Additive,
                     },
                 };
             }


Cache a few more MethodInfos

Cache a few more MethodInfos

--- BitPacker/ExpressionHelpers.cs
+++ BitPacker/ExpressionHelpers.cs
@@ -3,6 +3,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq.Expressions;
+using System.Reflection;
 using System.Text;
 using System.Threading.Tasks;

@@ -10,6 +11,9 @@
 {
     internal static class ExpressionHelpers
     {
+        private static readonly MethodInfo moveNextMethod = typeof(IEnumerator).GetMethod("MoveNext", new Type[0]);
+        private static readonly MethodInfo stringFormatMethod = typeof(String).GetMethod("Format", new[] { typeof(string), typeof(string[]) });
+
         public static Expression ForEach(Expression collection, Type elementType, ParameterExpression loopVar, Expression loopContent)
         {
             var enumerableType = typeof(IEnumerable<>).MakeGenericType(elementType);
@@ -20,7 +24,7 @@
             var enumeratorAssign = Expression.Assign(enumeratorVar, getEnumeratorCall);

             // The MoveNext method's actually on IEnumerator, not IEnumerator<T>
-            var moveNextCall = Expression.Call(enumeratorVar, typeof(IEnumerator).GetMethod("MoveNext"));
+            var moveNextCall = Expression.Call(enumeratorVar, moveNextMethod);

             var breakLabel = Expression.Label("LoopBreak");

@@ -119,9 +123,8 @@

         public static Expression StringFormat(string format, params Expression[] args)
         {
-            var method = typeof(String).GetMethod("Format", new[] { typeof(string), typeof(string[]) });
             var objArray = Expression.NewArrayInit(typeof(object), args.Select(x => Expression.Convert(x, typeof(object))));
-            return Expression.Call(method, new Expression[] { Expression.Constant(format), objArray });
+            return Expression.Call(stringFormatMethod, new Expression[] { Expression.Constant(format), objArray });
         }
     }
 }


Renamed context to vanillaContext in VanillaStatsPoller

--- Blending/VanillaStatsPoller.cs
+++ Blending/VanillaStatsPoller.cs
@@ -8,12 +8,12 @@
 {
     public class VanillaStatsPoller : IWantToRunWhenBusStartsAndStops
     {
-        private readonly VanillaContext context;
+        private readonly VanillaContext vanillaContext;
         private readonly CancellationTokenSource tokenSource;

-        public VanillaStatsPoller(VanillaContext context)
+        public VanillaStatsPoller(VanillaContext vanillaContext)
         {
-            this.context = context;
+            this.vanillaContext = vanillaContext;

             tokenSource = new CancellationTokenSource();
         }
@@ -26,7 +26,7 @@
             SpecialConsole.WriteLine();
             while (!tokenSource.IsCancellationRequested)
             {
-                var recentlyAcquired = context.Usages.OrderByDescending(u => u.Acquired).FirstOrDefault();
+                var recentlyAcquired = vanillaContext.Usages.OrderByDescending(u => u.Acquired).FirstOrDefault();

                 SpecialConsole.WriteAt(0, 1, $"|   ['{recentlyAcquired?.LotNumber}' - Stats] Recently acquired vanilla {recentlyAcquired?.Acquired.ToString(CultureInfo.InvariantCulture) ?? "none"}".PadRight(60));
             }


No longer local only Stop logging everything

--- BolTDL/BolTDLServer/Program.cs
+++ BolTDL/BolTDLServer/Program.cs
@@ -24,7 +24,7 @@
             server.Get("/:route", (req, res) =>
             {

-                Logger.Log("User tried to access " + req.Params["route"]);
+                //Logger.Log("User tried to access " + req.Params["route"]);
                 res.SendString("Helo, 404!");
             });

@@ -105,7 +105,7 @@
             });

-            server.Start(true);
+            server.Start();
         }

         private static bool UserExists(string username)