updated utilities

updated utilities

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

-//using System;
-//using System.Diagnostics.CodeAnalysis;
-//using System.Globalization;
-//using System.IO;
-//using System.Runtime.Serialization;
-//using System.Security.Cryptography;
-//// using Microsoft.Azure.Commands.RecoveryServices.SiteRecovery;
-//using Microsoft.Azure.Portal.RecoveryServices.Models.Common;
-
-using Microsoft.Azure.Portal.RecoveryServices.Models.Common;
 using System;
 using System.Diagnostics.CodeAnalysis;
 using System.IO;
 using System.Runtime.Serialization;
 using System.Security.Cryptography;
+using Microsoft.Azure.Portal.RecoveryServices.Models.Common;

 namespace Microsoft.Azure.Commands.RecoveryServices
 {
@@ -148,46 +139,31 @@
             return Convert.ToBase64String(key);
         }

-//        /// <summary>
-//        /// Method to generate the cloud service name
-//        /// </summary>
-//        /// <param name="region">region name</param>
-//        /// <returns>cloud service name as string</returns>
-//        public static string GenerateCloudServiceName(string region)
-//        {
-//            return string.Format(
-//                CultureInfo.InvariantCulture,
-//                "{0}{1}{2}",
-//                Constants.CloudServiceNameExtensionPrefix,
-//                region.Replace(' ', '-'),
-//                Constants.CloudServiceNameExtensionSuffix);
-//        }
+        /// <summary>
+        /// Returns the cloud id given a container id.
+        /// </summary>
+        /// <param name="protectionContainerId">Protection Container Id</param>
+        /// <param name="cloudId">Cloud Id object</param>
+        public static void GetCloudIdFromContainerId(string protectionContainerId, out string cloudId)
+        {
+            // The first part before '_' is server id. Rest will be cloud id.
+            var index = protectionContainerId.IndexOf('_');

-//        /// <summary>
-//        /// Returns the cloud id given a container id.
-//        /// </summary>
-//        /// <param name="protectionContainerId">Protection Container Id</param>
-//        /// <param name="cloudId">Cloud Id object</param>
-//        public static void GetCloudIdFromContainerId(string protectionContainerId, out string cloudId)
-//        {
-//            // The first part before '_' is server id. Rest will be cloud id.
-//            var index = protectionContainerId.IndexOf('_');
-
-//            if (index != -1)
-//            {
-//                try
-//                {
-//                    cloudId = protectionContainerId.Substring(index + 1, protectionContainerId.Length - index - 1);
-//                }
-//                catch
-//                {
-//                    cloudId = null;
-//                }
-//            }
-//            else
-//            {
-//                cloudId = null;
-//            }
-//        }
+            if (index != -1)
+            {
+                try
+                {
+                    cloudId = protectionContainerId.Substring(index + 1, protectionContainerId.Length - index - 1);
+                }
+                catch
+                {
+                    cloudId = null;
+                }
+            }
+            else
+            {
+                cloudId = null;
+            }
+        }
     }
 }


Fix bug with test cases not working with different timezone

Historical availability on Commuter Parking Service returns a date with a specified timezone. Its unit test now handle if the machine running the test has a different timezone than W. Europe Standard Time.

--- src/Stranne.VasttrafikNET.Tests/JsonParsing/HistoricalAvailabilityJsonTest.cs
+++ src/Stranne.VasttrafikNET.Tests/JsonParsing/HistoricalAvailabilityJsonTest.cs
@@ -13,15 +13,15 @@
         public static TheoryData TestParameters => new TheoryData<string, object>
         {
             { "", 5 },
-            { "[0].DateTime", TimeZoneInfo.ConvertTime(new DateTime(2016, 8, 1, 8, 0, 0), TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time")) },
+            { "[0].DateTime", TimeZoneInfo.ConvertTime(new DateTime(2016, 8, 1, 8, 0, 0), TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time"), TimeZoneInfo.Local) },
             { "[0].FreeSpaces",79 },
-            { "[1].DateTime", TimeZoneInfo.ConvertTime(new DateTime(2016, 8, 1, 8, 15, 0), TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time")) },
+            { "[1].DateTime", TimeZoneInfo.ConvertTime(new DateTime(2016, 8, 1, 8, 15, 0), TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time"), TimeZoneInfo.Local) },
             { "[1].FreeSpaces", 78 },
-            { "[2].DateTime", TimeZoneInfo.ConvertTime(new DateTime(2016, 8, 1, 8, 30, 0), TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time")) },
+            { "[2].DateTime", TimeZoneInfo.ConvertTime(new DateTime(2016, 8, 1, 8, 30, 0), TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time"), TimeZoneInfo.Local) },
             { "[2].FreeSpaces", 71 },
-            { "[3].DateTime", TimeZoneInfo.ConvertTime(new DateTime(2016, 8, 1, 8, 45, 0), TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time")) },
+            { "[3].DateTime", TimeZoneInfo.ConvertTime(new DateTime(2016, 8, 1, 8, 45, 0), TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time"), TimeZoneInfo.Local) },
             { "[3].FreeSpaces", 70 },
-            { "[4].DateTime", TimeZoneInfo.ConvertTime(new DateTime(2016, 8, 1, 9, 0, 0), TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time")) },
+            { "[4].DateTime", TimeZoneInfo.ConvertTime(new DateTime(2016, 8, 1, 9, 0, 0), TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time"), TimeZoneInfo.Local) },
             { "[4].FreeSpaces", 67 }
         };


Adding platform detection to workaround a Win7 certificate behavior difference.

--- src/System.Net.Security/tests/FunctionalTests/SslStreamCredentialCacheTest.cs
+++ src/System.Net.Security/tests/FunctionalTests/SslStreamCredentialCacheTest.cs
@@ -16,7 +16,6 @@

     public class SslStreamCredentialCacheTest
     {
-        [ActiveIssue(19699, TestPlatforms.Windows)]
         [Fact]
         public async Task SslStream_SameCertUsedForClientAndServer_Ok()
         {
@@ -42,8 +41,20 @@

                 await Task.WhenAll(tasks).TimeoutAfter(15 * 1000);

-                Assert.True(client.IsMutuallyAuthenticated);
-                Assert.True(server.IsMutuallyAuthenticated);
+                if (!PlatformDetection.IsWindows7 ||
+                    Capability.IsTrustedRootCertificateInstalled())
+                {
+                    // https://technet.microsoft.com/en-us/library/hh831771.aspx#BKMK_Changes2012R2
+                    // Starting with Windows 8, the "Management of trusted issuers for client authentication" has changed:
+                    // The behavior to send the Trusted Issuers List by default is off.
+                    //
+                    // In Windows 7 the Trusted Issuers List is sent within the Server Hello TLS record. This list is built
+                    // by the server using certificates from the Trusted Root Authorities certificate store.
+                    // The client side will use the Trusted Issuers List, if not empty, to filter proposed certificates.
+
+                    Assert.True(client.IsMutuallyAuthenticated);
+                    Assert.True(server.IsMutuallyAuthenticated);
+                }
             }
         }


Remove _ptrSocketAddressBuffer field

Remove _ptrSocketAddressBuffer field

--- src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs
+++ src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs
@@ -36,7 +36,6 @@
         // Internal SocketAddress buffer
         private GCHandle _socketAddressGCHandle;
         private Internals.SocketAddress _pinnedSocketAddress;
-        private IntPtr _ptrSocketAddressBuffer;
         private IntPtr _ptrSocketAddressBufferSize;

         // SendPacketsElements property variables.
@@ -224,7 +223,7 @@

                 bool success = socket.ConnectEx(
                     handle,
-                    _ptrSocketAddressBuffer,
+                    PtrSocketAddressBuffer,
                     _socketAddress.Size,
                     _ptrSingleBuffer,
                     Count,
@@ -366,7 +365,7 @@
                         1,
                         out bytesTransferred,
                         ref flags,
-                        _ptrSocketAddressBuffer,
+                        PtrSocketAddressBuffer,
                         _ptrSocketAddressBufferSize,
                         overlapped,
                         IntPtr.Zero);
@@ -379,7 +378,7 @@
                         _bufferListInternal.Count,
                         out bytesTransferred,
                         ref flags,
-                        _ptrSocketAddressBuffer,
+                        PtrSocketAddressBuffer,
                         _ptrSocketAddressBufferSize,
                         overlapped,
                         IntPtr.Zero);
@@ -473,7 +472,7 @@
             unsafe
             {
                 Interop.Winsock.WSAMsg* pMessage = (Interop.Winsock.WSAMsg*)PtrWSAMessageBuffer;
-                pMessage->socketAddress = _ptrSocketAddressBuffer;
+                pMessage->socketAddress = PtrSocketAddressBuffer;
                 pMessage->addressLength = (uint)_socketAddress.Size;
                 fixed (void* ptrWSARecvMsgWSABufferArray = &wsaRecvMsgWSABufferArray[0])
                 {
@@ -759,7 +758,7 @@
                         1,
                         out bytesTransferred,
                         _socketFlags,
-                        _ptrSocketAddressBuffer,
+                        PtrSocketAddressBuffer,
                         _socketAddress.Size,
                         overlapped,
                         IntPtr.Zero);
@@ -772,7 +771,7 @@
                         _bufferListInternal.Count,
                         out bytesTransferred,
                         _socketFlags,
-                        _ptrSocketAddressBuffer,
+                        PtrSocketAddressBuffer,
                         _socketAddress.Size,
                         overlapped,
                         IntPtr.Zero);
@@ -903,9 +902,24 @@
             // Pin down the new one.
             _socketAddressGCHandle = GCHandle.Alloc(_socketAddress.Buffer, GCHandleType.Pinned);
             _socketAddress.CopyAddressSizeIntoBuffer();
-            _ptrSocketAddressBuffer = Marshal.UnsafeAddrOfPinnedArrayElement(_socketAddress.Buffer, 0);
             _ptrSocketAddressBufferSize = Marshal.UnsafeAddrOfPinnedArrayElement(_socketAddress.Buffer, _socketAddress.GetAddressSizeOffset());
             _pinnedSocketAddress = _socketAddress;
+        }
+
+        private unsafe IntPtr PtrSocketAddressBuffer
+        {
+            get
+            {
+                Debug.Assert(_pinnedSocketAddress != null);
+                Debug.Assert(_pinnedSocketAddress.Buffer != null);
+                Debug.Assert(_pinnedSocketAddress.Buffer.Length > 0);
+                Debug.Assert(_socketAddressGCHandle.IsAllocated);
+                Debug.Assert(_socketAddressGCHandle.Target == _pinnedSocketAddress.Buffer);
+                fixed (void* ptrSocketAddressBuffer = &_pinnedSocketAddress.Buffer[0])
+                {
+                    return (IntPtr)ptrSocketAddressBuffer;
+                }
+            }
         }

         // Cleans up any existing Overlapped object and related state variables.


Added comment author when visualizing comment. #5

--- src/Web/Bloggable.Web/Views/Comments/DisplayTemplates/CommentViewModel.cshtml
+++ src/Web/Bloggable.Web/Views/Comments/DisplayTemplates/CommentViewModel.cshtml
@@ -8,6 +8,8 @@

+            @* TODO: Add link to user's profile page. *@
+            @Model.Author on
             @Model.CreatedOn.ToString("HH:mm:ss dd/MM/yyyy")

         @Model.Content


Changing MobileTable script connection name to 'connection'

--- src/WebJobs.Extensions.MobileApps/Bindings/MobileAppsScriptBindingProvider.cs
+++ src/WebJobs.Extensions.MobileApps/Bindings/MobileAppsScriptBindingProvider.cs
@@ -16,7 +16,7 @@
     public class MobileAppsScriptBindingProvider : ScriptBindingProvider
     {
         /// <inheritdoc/>
-        public MobileAppsScriptBindingProvider(JobHostConfiguration config, JObject hostMetadata, TraceWriter traceWriter)
+        public MobileAppsScriptBindingProvider(JobHostConfiguration config, JObject hostMetadata, TraceWriter traceWriter)
             : base(config, hostMetadata, traceWriter)
         {
         }
@@ -74,7 +74,7 @@
                     {
                         TableName = Context.GetMetadataValue<string>("tableName"),
                         Id = Context.GetMetadataValue<string>("id"),
-                        MobileAppUriSetting = Context.GetMetadataValue<string>("mobileAppUri"),
+                        MobileAppUriSetting = Context.GetMetadataValue<string>("connection"),
                         ApiKeySetting = Context.GetMetadataValue<string>("apiKey")
                     }
                 };


Actively fail (with non-zero exit code) if invalid options given rather than just show help.

--- Ensconce/Program.cs
+++ Ensconce/Program.cs
@@ -57,7 +57,7 @@

         private static void MainLogic(string[] args)
         {
-            if (SetUpAndParseOptions(args)) return;
+            SetUpAndParseOptions(args);

             if (readFromStdIn)
             {
@@ -144,7 +144,7 @@
             }
         }

-        private static bool SetUpAndParseOptions(string[] args)
+        private static void SetUpAndParseOptions(string[] args)
         {
             var showHelp = false;
             var p = new OptionSet
@@ -158,7 +158,7 @@
                                 },
                             {
                                 "fixedPath=",
-                                "NOTE! Ignored if env:/FixedStructure is false. Override path to structure.xml relative to executable (default=\"structure.xml\")",
+                                @"NOTE! Ignored if env:/FixedStructure is false. Override path to structure.xml relative to executable (default=""structure.xml"")",
                                 s => fixedPath = string.IsNullOrEmpty(s) ? fixedPath : s
                                 },
                             {
@@ -217,21 +217,12 @@
                                },
                         };

-            try
-            {
-                p.Parse(args);
-            }
-            catch (OptionException e)
-            {
-                Console.WriteLine("Error: " + e.Message);
-                Console.WriteLine("Try running again with the '--help' option.");
-                return true;
-            }
+            p.Parse(args);

             if (showHelp || !(updateConfig || copyTo || finalisePath || readFromStdIn || !string.IsNullOrEmpty(templateFilters) || !string.IsNullOrEmpty(databaseName) || !string.IsNullOrEmpty(connectionString)))
             {
                 ShowHelp(p);
-                return true;
+                if (!showHelp) throw new OptionException("Invalid combination of options given, showing help.", "help");
             }

             if (RawToDirectories.Count > 0)
@@ -243,42 +234,33 @@
             {
                 if (DeployTo.Count == 0)
                 {
-                    Console.WriteLine(
-                        "Error: You must specify at least one deployTo directory to use the copyTo or replace options.");
-                    return true;
+                    throw new OptionException("Error: You must specify at least one deployTo directory to use the copyTo or replace options.", "deployTo");
                 }
                 if (!Directory.Exists(deployFrom))
                 {
-                    Console.WriteLine(
-                        "Error: You must specify a existing from directory to use the copyTo or replace options.");
-                    return true;
+                    throw new OptionException(
+                        "Error: You must specify a existing from directory to use the copyTo or replace options.", "deployFrom");
                 }
                 if (copyTo && replace)
                 {
-                    Console.WriteLine("Error: You cannot specify both the replace and copyTo options.");
-                    return true;
+                    throw new OptionException("Error: You cannot specify both the replace and copyTo options.", "deployTo and deployFrom");
                 }
             }

             if (!string.IsNullOrEmpty(templateFilters) && !Directory.Exists(deployFrom))
             {
-                Console.WriteLine("Error: You cannot use filterTemplate without a valid from directory.");
-                return true;
+                throw new OptionException("Error: You cannot use filterTemplate without a valid from directory.", "deployFrom");
             }

             if ((!string.IsNullOrEmpty(databaseName)||!string.IsNullOrEmpty(connectionString)) && !Directory.Exists(deployFrom))
             {
-                Console.WriteLine("Error: You cannot use databaseName without a valid from directory.");
-                return true;
+                throw new OptionException("Error: You cannot use databaseName without a valid from directory.", "deployFrom");
             }

             if ((!string.IsNullOrEmpty(databaseName) || !string.IsNullOrEmpty(connectionString)) && !File.Exists(Path.Combine(deployFrom, "_BuildInfo.txt")))
             {
-                Console.WriteLine("Error: You cannot deploy database without a valid version file. File must be named _BuildInfo.txt");
-                return true;
-            }
-
-            return false;
+                throw new FileNotFoundException("Error: You cannot deploy database without a valid version file. File must be named _BuildInfo.txt", "databaseName");
+            }
         }

         private static void ProcessRawDirectories(IEnumerable<string> rawNames, List<string> processedNameList)


the kostbIl v2

the kostbIl v2

--- Eval/EvalProgram.cs
+++ Eval/EvalProgram.cs
@@ -2,6 +2,7 @@
 using System.Data;
 using System.Globalization;
 using System.Linq.Expressions;
+using System.Text;
 using Microsoft.JScript;
 using Microsoft.JScript.Vsa;
 using NUnit.Framework;
@@ -29,11 +30,8 @@
         static string EvalExpression(string exprStr)
         {
             var engine = VsaEngine.CreateEngine();
-            var res = Eval.JScriptEvaluate(exprStr, engine).ToString().Replace(",", ".");
-            if (res == "бесконечность")
-                res = "Infinity";
-            return res == "∞" ? "Infinity" : res;
-
+            var res = Eval.JScriptEvaluate(exprStr, engine).ToString().Replace(",", ".").Replace("бесконечность", "Infinity");
+            return res;
         }
         static void Main(string[] args)
         {


Modified a few for Example2

Modified a few for Example2

--- Example2/Program.cs
+++ Example2/Program.cs
@@ -37,9 +37,11 @@
       wssv.AuthenticationSchemes = AuthenticationSchemes.Basic;
       wssv.Realm = "WebSocket Test";
       wssv.UserCredentialsFinder = id => {
-        var expected = "nobita";
-        return id.Name == expected
-               ? new NetworkCredential (expected, "password", "gunfighter")
+        var name = id.Name;
+
+        // Return user name, password, and roles.
+        return name == "nobita"
+               ? new NetworkCredential (name, "password", "gunfighter")
                : null; // If the user credentials aren't found.
       };
        */


Удалил проверку сертификатов

Удалил проверку сертификатов

--- Finanbot/Program.cs
+++ Finanbot/Program.cs
@@ -32,6 +32,7 @@
                 Log.Error("File {0} not found", path);
                 return;
             }
+            System.Net.ServicePointManager.ServerCertificateValidationCallback += (o, certificate, chain, errors) => true;
             Config = new IniDataParser().Parse(File.ReadAllText(path, Encoding.UTF8));

             Log.Trace("Started with config: {0}", path);


Improved rectangle drawing speed

Improved rectangle drawing speed

--- monogame/Graphics/MonoGameShapeRenderer.cs
+++ monogame/Graphics/MonoGameShapeRenderer.cs
@@ -26,6 +26,7 @@
         private Vector2 _rotationCenter, _translation, _scale;
         private Color _tint;
         private readonly SpriteBatch _spriteBatch;
+        private static Rectangle rect = new Rectangle();

         public MonoGameShapeRenderer(GraphicsDevice graphicsDevice, uint colorARGB8888, SpriteBatch spriteBatch, Vector2 rotationCenter, Vector2 translation, Vector2 scale, Color tint)
         {
@@ -139,18 +140,23 @@
         public void drawRect(int x, int y, int width, int height)
         {
             var texture = newTexture2D(width, height);
-            var textureData = new uint[width * height];
-            for (int i = 0; i < width; i++)
+            var textureData = new uint[Math.Max(width, height)];
+            for (int i = 0; i < textureData.Length; i++)
             {
                 textureData[i] = _color;
-                textureData[textureData.Length - 1 - i] = _color;
-            }
-            for (int i = 1; i < height; i++)
-            {
-                textureData[width * i] = _color;
-                textureData[textureData.Length - 1 - width * i] = _color;
-            }
-            texture.SetData(textureData);
+            }
+            rect.Height = 1;
+            rect.Width = width - 1;
+            texture.SetData(0, rect, textureData, 0, width - 1);
+            rect.Y = height - 1;
+            texture.SetData(0, rect, textureData, 0, width - 1);
+            rect.Height = height - 1;
+            rect.Width = 1;
+            rect.Y = 0;
+            texture.SetData(0, rect, textureData, 0, height - 1);
+            rect.X = width - 1;
+            texture.SetData(0, rect, textureData, 0, height - 1);
+            rect.X = 0;
             draw(texture, new Vector2(x, y));
         }


Fixed Issue 171.

Fixed Issue 171.

--- Hardware/HDD/HDD.cs
+++ Hardware/HDD/HDD.cs
@@ -16,7 +16,7 @@

   The Initial Developer of the Original Code is
   Michael Möller <m.moeller@gmx.ch>.
-  Portions created by the Initial Developer are Copyright (C) 2009-2010
+  Portions created by the Initial Developer are Copyright (C) 2009-2011
   the Initial Developer. All Rights Reserved.

   Contributor(s): Paul Werelds
@@ -162,6 +162,9 @@
       visitor.VisitHardware(this);
     }

-    public void Traverse(IVisitor visitor) { }
+    public void Traverse(IVisitor visitor) {
+      foreach (ISensor sensor in Sensors)
+        sensor.Accept(visitor);
+    }
   }
 }


Moved registration to view’s parent window to fix losing focus

--- osu.Framework.iOS/Input/IOSMouseHandler.cs
+++ osu.Framework.iOS/Input/IOSMouseHandler.cs
@@ -26,7 +26,7 @@
                 return;

             this.view = view;
-            view.AddInteraction(pointerInteraction = new UIPointerInteraction(mouseDelegate = new IOSMouseDelegate()));
+            view.Window.AddInteraction(pointerInteraction = new UIPointerInteraction(mouseDelegate = new IOSMouseDelegate()));
             mouseDelegate.LocationUpdated += locationUpdated;
         }


When popping a masking info revert to previous scissor rectangle instead of using the full masking rectangle of the masking info.

Previously, when pushing masking infos, the scissor rectangles would get intersected by default.
Popping a masking info, however, did not revert to the previous intersected state, but simply to the
masking rectangle of the previous masking info, disregarding any intersections that might have
happened previously. This commit adds correct reverting behavior.

--- osu.Framework/Graphics/OpenGL/GLWrapper.cs
+++ osu.Framework/Graphics/OpenGL/GLWrapper.cs
@@ -90,6 +90,9 @@
             viewportStack.Clear();
             orthoStack.Clear();
             maskingStack.Clear();
+            scissorRectStack.Clear();
+
+            scissorRectStack.Push(new Rectangle(0, 0, (int)size.X, (int)size.Y));

             Viewport = Rectangle.Empty;
             Ortho = Rectangle.Empty;
@@ -329,10 +332,9 @@
         /// <param name="ortho">The orthographic projection rectangle.</param>
         public static void PushOrtho(RectangleF ortho)
         {
+            FlushCurrentBatch();
+
             orthoStack.Push(ortho);
-
-            FlushCurrentBatch();
-
             if (Ortho == ortho)
                 return;
             Ortho = ortho;
@@ -366,13 +368,14 @@
         }

         private static Stack<MaskingInfo> maskingStack = new Stack<MaskingInfo>();
-        private static Rectangle currentScissorRect;
+        private static Stack<Rectangle> scissorRectStack = new Stack<Rectangle>();

         public static void UpdateScissorToCurrentViewportAndOrtho()
         {
-            RectangleF actualRect = Viewport;
-
-            Vector2 offset = actualRect.TopLeft - Ortho.TopLeft;
+            RectangleF viewportRect = Viewport;
+            Vector2 offset = viewportRect.TopLeft - Ortho.TopLeft;
+
+            Rectangle currentScissorRect = scissorRectStack.Peek();

             Rectangle scissorRect = new Rectangle(
                 currentScissorRect.X + (int)Math.Floor(offset.X),
@@ -389,7 +392,7 @@
             GL.Scissor(scissorRect.X, scissorRect.Y, scissorRect.Width, scissorRect.Height);
         }

-        private static void setMaskingInfo(MaskingInfo maskingInfo, bool overwritePreviousScissor)
+        private static void setMaskingInfo(MaskingInfo maskingInfo, bool isPushing, bool overwritePreviousScissor)
         {
             FlushCurrentBatch();

@@ -429,10 +432,24 @@
                 actualRect.Height = -actualRect.Height;
             }

-            if (overwritePreviousScissor)
-                currentScissorRect = actualRect;
+            if (isPushing)
+            {
+                Rectangle currentScissorRect;
+                if (overwritePreviousScissor)
+                    currentScissorRect = actualRect;
+                else
+                {
+                    currentScissorRect = scissorRectStack.Peek();
+                    currentScissorRect.Intersect(actualRect);
+                }
+
+                scissorRectStack.Push(currentScissorRect);
+            }
             else
-                currentScissorRect.Intersect(actualRect);
+            {
+                Debug.Assert(scissorRectStack.Count > 1);
+                scissorRectStack.Pop();
+            }

             UpdateScissorToCurrentViewportAndOrtho();
         }
@@ -456,7 +473,7 @@
                 return;

             CurrentMaskingInfo = maskingInfo;
-            setMaskingInfo(CurrentMaskingInfo, overwritePreviousScissor);
+            setMaskingInfo(CurrentMaskingInfo, true, overwritePreviousScissor);
         }

         /// <summary>
@@ -473,7 +490,7 @@
                 return;

             CurrentMaskingInfo = maskingInfo;
-            setMaskingInfo(CurrentMaskingInfo, true);
+            setMaskingInfo(CurrentMaskingInfo, false, true);
         }

         /// <summary>


Revert `IUniform` accessibility change

Revert `IUniform` accessibility change

--- osu.Framework/Graphics/Shaders/IUniform.cs
+++ osu.Framework/Graphics/Shaders/IUniform.cs
@@ -8,7 +8,7 @@
     /// <summary>
     /// Represents an updateable shader uniform.
     /// </summary>
-    public interface IUniform
+    internal interface IUniform
     {
         /// <summary>
         /// The shader which this uniform was declared in.


Create separate automapper configurations to reduce cyclic detach overhead

This optimises the `BeatmapSetInfo` detach operation by avoiding
detaching `BeatmapSetInfo.Beatmaps[].BeatmapSetInfo` a second time over.

--- osu.Game/Database/RealmObjectExtensions.cs
+++ osu.Game/Database/RealmObjectExtensions.cs
@@ -74,12 +74,54 @@

         private static readonly IMapper mapper = new MapperConfiguration(c =>
         {
+            applyCommonConfiguration(c);
+
+            // This can be further optimised to reduce cyclic retrievals, similar to the optimised set mapper below.
+            // Only hasn't been done yet as we detach at the point of BeatmapInfo less often.
+            c.CreateMap<BeatmapInfo, BeatmapInfo>()
+             .MaxDepth(2)
+             .AfterMap((s, d) =>
+             {
+                 for (int i = 0; i < d.BeatmapSet?.Beatmaps.Count; i++)
+                 {
+                     if (d.BeatmapSet.Beatmaps[i].Equals(d))
+                     {
+                         d.BeatmapSet.Beatmaps[i] = d;
+                         break;
+                     }
+                 }
+             });
+        }).CreateMapper();
+
+        /// <summary>
+        /// A slightly optimised mapper that avoids double-fetches in cyclic reference.
+        /// </summary>
+        private static readonly IMapper beatmap_set_mapper = new MapperConfiguration(c =>
+        {
+            applyCommonConfiguration(c);
+
+            c.CreateMap<BeatmapInfo, BeatmapInfo>()
+             .MaxDepth(1)
+             .ForMember(b => b.BeatmapSet, cc => cc.Ignore());
+        }).CreateMapper();
+
+        private static void applyCommonConfiguration(IMapperConfigurationExpression c)
+        {
             c.ShouldMapField = fi => false;

             // This is specifically to avoid mapping explicit interface implementations.
             // If we want to limit this further, we can avoid mapping properties with no setter that are not IList<>.
             // Takes a bit of effort to determine whether this is the case though, see https://stackoverflow.com/questions/951536/how-do-i-tell-whether-a-type-implements-ilist
             c.ShouldMapProperty = pi => pi.GetMethod?.IsPublic == true;
+
+            c.Internal().ForAllMaps((typeMap, expression) =>
+            {
+                expression.ForAllMembers(m =>
+                {
+                    if (m.DestinationMember.Has<IgnoredAttribute>() || m.DestinationMember.Has<BacklinkAttribute>() || m.DestinationMember.Has<IgnoreDataMemberAttribute>())
+                        m.Ignore();
+                });
+            });

             c.CreateMap<RealmKeyBinding, RealmKeyBinding>();
             c.CreateMap<BeatmapMetadata, BeatmapMetadata>();
@@ -89,19 +131,6 @@
             c.CreateMap<RealmUser, RealmUser>();
             c.CreateMap<RealmFile, RealmFile>();
             c.CreateMap<RealmNamedFileUsage, RealmNamedFileUsage>();
-            c.CreateMap<BeatmapInfo, BeatmapInfo>()
-             .MaxDepth(2)
-             .AfterMap((s, d) =>
-             {
-                 for (int i = 0; i < d.BeatmapSet?.Beatmaps.Count; i++)
-                 {
-                     if (d.BeatmapSet.Beatmaps[i].Equals(d))
-                     {
-                         d.BeatmapSet.Beatmaps[i] = d;
-                         break;
-                     }
-                 }
-             });
             c.CreateMap<BeatmapSetInfo, BeatmapSetInfo>()
              .MaxDepth(2)
              .AfterMap((s, d) =>
@@ -109,16 +138,7 @@
                  foreach (var beatmap in d.Beatmaps)
                      beatmap.BeatmapSet = d;
              });
-
-            c.Internal().ForAllMaps((typeMap, expression) =>
-            {
-                expression.ForAllMembers(m =>
-                {
-                    if (m.DestinationMember.Has<IgnoredAttribute>() || m.DestinationMember.Has<BacklinkAttribute>() || m.DestinationMember.Has<IgnoreDataMemberAttribute>())
-                        m.Ignore();
-                });
-            });
-        }).CreateMapper();
+        }

         /// <summary>
         /// Create a detached copy of the each item in the collection.
@@ -152,6 +172,9 @@
         {
             if (!item.IsManaged)
                 return item;
+
+            if (item is BeatmapSetInfo)
+                return beatmap_set_mapper.Map<T>(item);

             return mapper.Map<T>(item);
         }


Fix code quality inspection about ambiguous equality

--- osu.Game/Overlays/Mods/ModPresetTooltip.cs
+++ osu.Game/Overlays/Mods/ModPresetTooltip.cs
@@ -50,7 +50,7 @@

         public void SetContent(ModPreset preset)
         {
-            if (preset == lastPreset)
+            if (ReferenceEquals(preset, lastPreset))
                 return;

             lastPreset = preset;


Fix BeatmapCarousel's flush not correctly applying selection changes

They may have been delayed until the next Update, which is too late in this case.

--- osu.Game/Screens/Select/BeatmapCarousel.cs
+++ osu.Game/Screens/Select/BeatmapCarousel.cs
@@ -328,7 +328,10 @@
         public void FlushPendingFilterOperations()
         {
             if (FilterTask?.Completed == false)
+            {
                 applyActiveCriteria(false, false);
+                Update();
+            }
         }

         public void Filter(FilterCriteria newCriteria, bool debounce = true)


Expose `LegacySkinTransformer`'s underlying skin for pattern-matching

--- osu.Game/Skinning/LegacySkinTransformer.cs
+++ osu.Game/Skinning/LegacySkinTransformer.cs
@@ -23,7 +23,7 @@
         /// The <see cref="ISkin"/> which is being transformed.
         /// </summary>
         [NotNull]
-        protected internal ISkin Skin { get; }
+        public ISkin Skin { get; }

         protected LegacySkinTransformer([NotNull] ISkin skin)
         {


Add missing content for the Nubbin

Add missing content for the Nubbin

--- EndlessClient/Rendering/Chat/ChatBubbleTextureProvider.cs
+++ EndlessClient/Rendering/Chat/ChatBubbleTextureProvider.cs
@@ -34,6 +34,7 @@
             _chatBubbleTextures.Add(ChatBubbleTexture.BottomLeft, Content.Load<Texture2D>("ChatBubble\\RL"));
             _chatBubbleTextures.Add(ChatBubbleTexture.BottomMiddle, Content.Load<Texture2D>("ChatBubble\\RM"));
             _chatBubbleTextures.Add(ChatBubbleTexture.BottomRight, Content.Load<Texture2D>("ChatBubble\\RR"));
+            _chatBubbleTextures.Add(ChatBubbleTexture.Nubbin, Content.Load<Texture2D>("ChatBubble\\NUB"));
         }

         private ContentManager Content => _contentManagerProvider.Content;


http -> https

http -> https

--- FTAnalyzer.Windows/Forms/Controls/ToolStripMapSelector.cs
+++ FTAnalyzer.Windows/Forms/Controls/ToolStripMapSelector.cs
@@ -96,19 +96,19 @@
             switch (type)
             {
                 case LinkLabelType.GOOGLE:
-                    link.LinkData = "http://www.google.com/intl/en_ALL/help/terms_maps.html";
+                    link.LinkData = "https://www.google.com/intl/en_ALL/help/terms_maps.html";
                     copyrightLabel.Text = "© Google - Terms of Use";
                     break;
                 case LinkLabelType.BING:
-                    link.LinkData = "http://www.microsoft.com/maps/product/terms.html";
+                    link.LinkData = "https://www.microsoft.com/maps/product/terms.html";
                     copyrightLabel.Text = "© Bing Maps";
                     break;
                 case LinkLabelType.OSM:
-                    link.LinkData = "http://www.openstreetmap.org/copyright";
+                    link.LinkData = "https://www.openstreetmap.org/copyright";
                     copyrightLabel.Text = "© OpenStreetMap";
                     break;
                 case LinkLabelType.NLS:
-                    link.LinkData = "http://maps.nls.uk/projects/api/index.html#licence";
+                    link.LinkData = "https://maps.nls.uk/projects/api/index.html#licence";
                     copyrightLabel.Text = "© NLS";
                     break;
             }


Make adjustments respect the current selection.

--- Pinta.Core/Classes/Layer.cs
+++ Pinta.Core/Classes/Layer.cs
@@ -164,27 +164,53 @@
 				ColorBgra.Black,
 				ColorBgra.White);

-			ColorBgra *dstPtr = (ColorBgra*)Surface.DataPtr;
+			ImageSurface dest = Surface.Clone ();
+
+			ColorBgra* dstPtr = (ColorBgra*)dest.DataPtr;
 			int len = Surface.Data.Length / 4;

-			op.Apply (dstPtr, len);
+			op.Apply (dstPtr, len);
+
+			using (Context g = new Context (Surface)) {
+				g.AppendPath (PintaCore.Layers.SelectionPath);
+				g.Clip ();
+
+				g.SetSource (dest);
+				g.Paint ();
+			}
+
+			(dest as IDisposable).Dispose ();
 		}

 		public unsafe void Invert ()
 		{
-			ColorBgra *dstPtr = (ColorBgra*)Surface.DataPtr;
+			ImageSurface dest = Surface.Clone ();
+
+			ColorBgra* dstPtr = (ColorBgra*)dest.DataPtr;
 			int len = Surface.Data.Length / 4;

 			for (int i = 0; i < len; i++) {
 				if (dstPtr->A != 0)
 				*dstPtr = (ColorBgra.FromBgra((byte)(255 - dstPtr->B), (byte)(255 - dstPtr->G), (byte)(255 - dstPtr->R), dstPtr->A));
 				dstPtr++;
-			}
+			}
+
+			using (Context g = new Context (Surface)) {
+				g.AppendPath (PintaCore.Layers.SelectionPath);
+				g.Clip ();
+
+				g.SetSource (dest);
+				g.Paint ();
+			}
+
+			(dest as IDisposable).Dispose ();
 		}

 		public unsafe void Desaturate ()
 		{
-			ColorBgra *dstPtr = (ColorBgra*)Surface.DataPtr;
+			ImageSurface dest = Surface.Clone ();
+
+			ColorBgra* dstPtr = (ColorBgra*)dest.DataPtr;
 			int len = Surface.Data.Length / 4;

 			for (int i = 0; i < len; i++) {
@@ -194,7 +220,17 @@
 				dstPtr->G = ib;
 				dstPtr->B = ib;
 				dstPtr++;
-			}
+			}
+
+			using (Context g = new Context (Surface)) {
+				g.AppendPath (PintaCore.Layers.SelectionPath);
+				g.Clip ();
+
+				g.SetSource (dest);
+				g.Paint ();
+			}
+
+			(dest as IDisposable).Dispose ();
 		}
 	}
 }


added documentation

added documentation

--- DataGen/ExtensionMethods.cs
+++ DataGen/ExtensionMethods.cs
@@ -4,6 +4,14 @@

 namespace DataGen {
     public static class ExtensionMethods {
+        /// <summary>
+        ///     Will add elements to list in pattern by func
+        /// </summary>
+        /// <param name="list">the list to obtain the sequence</param>
+        /// <param name="ammount">the ammount of elements</param>
+        /// <param name="func">will return the element with created by arguments</param>
+        /// <param name="sequenceValue">The start value of the sequence</param>
+        /// <returns></returns>
         public static IEnumerable<TSource> Sequence<TSource>(this IList<TSource> list, int ammount,
             Func<TSource, int, TSource> func, TSource sequenceValue = default(TSource)) {
             foreach (var i in Range(1, ammount))
@@ -11,6 +19,9 @@
             return list;
         }

+        /// <summary>
+        ///     Will perform a foreach loop
+        /// </summary>
         public static void ForEach<TSource>(this IEnumerable<TSource> enumerable, Action<TSource> func) {
             foreach (var source in enumerable)
                 func(source);


Add G30 support to emulator for leveling/probe wizards

- Issue MatterHackers/MCCentral#3441
Emulator hangs during probing

--- PrinterEmulator/Emulator.cs
+++ PrinterEmulator/Emulator.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2015, Lars Brubaker
+// Copyright (c) 2018, Lars Brubaker, John Lewin
 // All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
@@ -61,12 +61,13 @@

 			responses = new Dictionary<string, Func<string, string>>()
 			{
-				{ "A", Echo },
-				{ "G0", SetPosition },
-				{ "G1", SetPosition },
-				{ "G28", HomePosition },
-				{ "G4", Wait },
-				{ "G92", ResetPosition },
+				{ "A",    Echo },
+				{ "G0",   SetPosition },
+				{ "G1",   SetPosition },
+				{ "G28",  HomePosition },
+				{ "G30",  SimulateProbe },
+				{ "G4",   Wait },
+				{ "G92",  ResetPosition },
 				{ "M104", SetExtruderTemperature },
 				{ "M105", ReturnTemp },
 				{ "M106", SetFan },
@@ -76,10 +77,10 @@
 				{ "M115", ReportMarlinFirmware },
 				{ "M140", SetBedTemperature },
 				{ "M190", SetBedTemperature },
-				{ "M20", ListSdCard },
-				{ "M21", InitSdCard },
-				{ "N", ParseChecksumLine },
-				{ "T", SetExtruderIndex },
+				{ "M20",  ListSdCard },
+				{ "M21",  InitSdCard },
+				{ "N",    ParseChecksumLine },
+				{ "T",    SetExtruderIndex },
 			};
 		}

@@ -286,6 +287,15 @@
 			YPosition = 0;
 			ZPosition = 0;
 			return "ok\n";
+		}
+
+		private Random rand = new Random();
+
+		private string SimulateProbe(string command)
+		{
+			Thread.Sleep(500);
+			return "Bed Position X: 0 Y: 0 Z: { rand.NextDouble() }\n"
+				 + "ok\n";
 		}

 		private string InitSdCard(string arg)


(PSD): interpret multi-channel images as Bgr32.

--- ArcFormats/ImagePSD.cs
+++ ArcFormats/ImagePSD.cs
@@ -111,6 +111,8 @@
                     Format = PixelFormats.Bgr24;
                 else if (4 == m_info.Channels)
                     Format = PixelFormats.Bgra32;
+                else if (m_info.Channels > 4)
+                    Format = PixelFormats.Bgr32;
                 else
                     throw new NotSupportedException();
                 break;


Version bump to 3.2.0.11 [TGSDeploy]

Version bump to 3.2.0.11 [TGSDeploy]

--- AssemblyInfo.global.cs
+++ AssemblyInfo.global.cs
@@ -3,8 +3,8 @@

 //You cannot one definition the version number
 //Believe me, I've tried, the compiler hates it so much
-[assembly: AssemblyVersion("3.2.0.10")]
-[assembly: AssemblyFileVersion("3.2.0.10")]
-[assembly: AssemblyInformationalVersion("3.2.0.10")]
+[assembly: AssemblyVersion("3.2.0.11")]
+[assembly: AssemblyFileVersion("3.2.0.11")]
+[assembly: AssemblyInformationalVersion("3.2.0.11")]

 [assembly: InternalsVisibleTo("TGS.Tests")]


debug deck

debug deck

--- Assets/Scripts/Deck.cs
+++ Assets/Scripts/Deck.cs
@@ -38,8 +38,6 @@
 	    fun.Add(new Fonction(5 ,Functions.arctan       ,"arc-tangeante"));
 	    fun.Add(new Fonction(5 ,Functions.tanh         ,"tangente hyperbolique"));
 	    fun.Add(new Fonction(5 ,Functions.arctanh      ,"arc-tangeante hyperbolique"));
-        Fonction p = this.PickFonction();
-        Console.WriteLine(p.weight);
 	}
     // ---------------------------------------------------------------
     // METHODES


Removing debug statement

Removing debug statement

--- Assets/Scripts/Ship.cs
+++ Assets/Scripts/Ship.cs
@@ -47,8 +47,6 @@

                 float totalTorque = Mathf.Clamp(headingCorrection, -maxTorque, maxTorque);
                 rigidBody.AddTorque(totalTorque);
-
-                Debug.Log("Torque: " + totalTorque);
             }
         }
     }


Fix issue with skidmarks.

Fix issue with skidmarks.

--- Assets/Scripts/Tire.cs
+++ Assets/Scripts/Tire.cs
@@ -19,6 +19,10 @@
 		if (active && !TrailActive) {
 			// These should be pooled and re-used
 			Skidmark = GameObject.Instantiate (Resources.Load ("Skidmark") as GameObject);
+
+			//Fix issue where skidmarks draw at 0,0,0 at slow speeds
+			Skidmark.GetComponent<TrailRenderer>().Clear();
+
 			Skidmark.GetComponent<TrailRenderer> ().time = TrailDuration;
 			Skidmark.GetComponent<TrailRenderer> ().sortingOrder = 0;
 			Skidmark.transform.parent = this.transform;


Update doc comments + some exception messages. Make change suggested by CodeMaid.

--- JungleBus/Configuration/ReceiveConfigurationExtensions.cs
+++ JungleBus/Configuration/ReceiveConfigurationExtensions.cs
@@ -2,17 +2,17 @@
 //     The MIT License (MIT)
 //
 // Copyright(c) 2016 Ryan Fleming
-//
+//
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // in the Software without restriction, including without limitation the rights
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
-//
+//
 // The above copyright notice and this permission notice shall be included in all
 // copies or substantial portions of the Software.
-//
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -63,10 +63,7 @@
                 throw new JungleBusConfigurationException("configuration", "Configuration cannot be null");
             }

-            if (configuration.Receive == null)
-            {
-                configuration.Receive = new ReceiveConfiguration();
-            }
+            configuration.Receive = configuration.Receive ?? new ReceiveConfiguration();

             if (!string.IsNullOrWhiteSpace(configuration.BusName))
             {
@@ -113,26 +110,26 @@
         }

         /// <summary>
-        /// Configure the polling wait time for receive bus
-        /// </summary>
-        /// <param name="configuration">Configuration to modify</param>
-        /// <param name="instances">Number of seconds to the long polling to wait</param>
+        /// Configure the number of polling instances to run for receive bus
+        /// </summary>
+        /// <param name="configuration">Configuration to modify</param>
+        /// <param name="instances">Number of polling instances to run</param>
         /// <returns>Modified configuration</returns>
         public static IConfigureEventReceiving SetNumberOfPollingInstances(this IConfigureEventReceiving configuration, int instances)
         {
             if (instances < 0)
             {
-                throw new JungleBusConfigurationException("instances", "Time in seconds must be between 0 and 14");
-            }
-
-            if (configuration == null)
-            {
-                throw new JungleBusConfigurationException("configuration", "Configuration cannot be null");
-            }
-
-            if (configuration.Receive == null)
-            {
-                throw new JungleBusConfigurationException("configuration", "Input queue needs to be configured before setting the wait timeout");
+                throw new JungleBusConfigurationException("instances", "Number of instances must be zero or greater");
+            }
+
+            if (configuration == null)
+            {
+                throw new JungleBusConfigurationException("configuration", "Configuration cannot be null");
+            }
+
+            if (configuration.Receive == null)
+            {
+                throw new JungleBusConfigurationException("configuration", "Input queue needs to be configured before setting the number of polling instances");
             }

             configuration.Receive.NumberOfPollingInstances = instances;
@@ -201,7 +198,7 @@

             if (configuration.Receive == null)
             {
-                throw new JungleBusConfigurationException("Receive", "Input queue needs to be configured before setting event handlers");
+                throw new JungleBusConfigurationException("Receive", "Input queue needs to be configured before setting event fault handlers");
             }

             configuration.Receive.FaultHandlers = ScanForTypes(eventFaultHandlers, typeof(IHandleMessageFaults<>), configuration.ObjectBuilder);
@@ -238,4 +235,4 @@
             return results;
         }
     }
-}
+}


Exposed the currentRecordingTime in the XamarinBindings

--- XamarinBindings/SCAudioVideoRecorderBindings/ApiDefinition.cs
+++ XamarinBindings/SCAudioVideoRecorderBindings/ApiDefinition.cs
@@ -189,6 +189,9 @@
 		[Export("playbackStartTime")]
 		CMTime PlaybackStartTime { get; set; }

+		[Export("currentRecordingTime")]
+		CMTime CurrentRecordingTime { get; set; }
+
 		[Export("recordingRate")]
 		float RecordingRate { get; set; }
     }


Fix controllo cambio orario stati partenza

--- src/backend/SO115App.Models/Servizi/CQRS/Commands/GestioneSoccorso/GestionePartenza/AggiornaStatoMezzo/AggiornaStatoMezzoCommandHandler.cs
+++ src/backend/SO115App.Models/Servizi/CQRS/Commands/GestioneSoccorso/GestionePartenza/AggiornaStatoMezzo/AggiornaStatoMezzoCommandHandler.cs
@@ -78,10 +78,14 @@
                 {
                     case Costanti.MezzoInViaggio:

+                        var IstantePrecedente = richiesta.ListaEventi.ToList().FirstOrDefault(e => e is UscitaPartenza arrivo && arrivo.CodicePartenza == command.CodicePartenza)?.Istante;
                         var IstanteSuccessivo = richiesta.ListaEventi.ToList().FirstOrDefault(e => e is ArrivoSulPosto arrivo && arrivo.CodicePartenza == command.CodicePartenza)?.Istante;

+                        if (IstantePrecedente > istante)
+                            throw new System.Exception("L'orario inserito non può essere superiore all'orario di uscita del mezzo.");
+
                         if (IstanteSuccessivo < istante)
-                            throw new System.Exception(orarioErrato);
+                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario di arrivo sul posto del mezzo.");

                         new AggiornamentoOrarioStato(richiesta, command.IdMezzo, istante, command.IdUtente, "AggiornamentoOrarioStato", partenza.CodicePartenza)
                         {
@@ -156,27 +160,25 @@
                 if (richiesta.ListaEventi.ToList().Find(e => e is PartenzaInRientro rientro && rientro.CodicePartenza == command.CodicePartenza) != null)
                     IstanteInRientro = richiesta.ListaEventi.ToList().Find(e => e is PartenzaInRientro rientro && rientro.CodicePartenza == command.CodicePartenza).Istante;

-
                 if (statoAttuale.Equals("In Viaggio"))
                 {
                     if (command.StatoMezzo.Equals("Sul Posto"))
                     {
                         if (IstanteInViaggio > istante)
-                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario di uscita del mezzo.");
+                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario del mezzo in viaggio.");
                     }

                     if (command.StatoMezzo.Equals("In Rientro"))
                     {
                         if (IstanteInViaggio > istante)
-                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario di uscita del mezzo.");
+                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario del mezzo in viaggio.");
                     }

                     if (command.StatoMezzo.Equals("Rientrato"))
                     {
                         if (IstanteInViaggio > istante)
-                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario di uscita del mezzo.");
-                    }
-
+                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario del mezzo in viaggioo.");
+                    }

                     statoMezzoReale = command.StatoMezzo;
                     richiesta.CambiaStatoPartenza(partenza.Partenza, new CambioStatoMezzo()
@@ -185,14 +187,13 @@
                         Istante = istante,
                         Stato = statoMezzoReale
                     }, _sendNewItemSTATRI, _checkCongruita, command.IdUtente);
-
                 }
                 else if (statoAttuale.Equals("Sul Posto"))
-                {
+                {
                     if (command.StatoMezzo.Equals("In Rientro"))
                     {
-                        if(IstanteInViaggio > istante)
-                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario di uscita del mezzo.");
+                        if (IstanteInViaggio > istante)
+                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario del mezzo in viaggio.");

                         if (IstanteSulPosto > istante)
                             throw new System.Exception("L'orario inserito non può essere inferiore all'orario di arrivo sul posto del mezzo.");
@@ -204,13 +205,12 @@
                             Istante = istante,
                             Stato = statoMezzoReale
                         }, _sendNewItemSTATRI, _checkCongruita, command.IdUtente);
-
                     }

                     if (command.StatoMezzo.Equals("Rientrato"))
                     {
                         if (IstanteInViaggio > istante)
-                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario di uscita del mezzo.");
+                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario del mezzo in viaggio.");

                         if (IstanteSulPosto > istante)
                             throw new System.Exception("L'orario inserito non può essere inferiore all'orario di arrivo sul posto.");
@@ -223,8 +223,6 @@
                             Stato = statoMezzoReale
                         }, _sendNewItemSTATRI, _checkCongruita, command.IdUtente);
                     }
-
-
                 }
                 else if (statoAttuale.Equals("In Rientro"))
                 {
@@ -233,8 +231,8 @@
                         if (IstanteInRientro < istante)
                             throw new System.Exception("L'orario inserito non può essere superiore all'orario in rientro del mezzo.");

-                        if(IstanteInViaggio > istante)
-                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario di uscita del mezzo.");
+                        if (IstanteInViaggio > istante)
+                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario del mezzo in viaggio.");

                         statoMezzoReale = statoAttuale;

@@ -242,16 +240,15 @@
                     }

                     if (command.StatoMezzo.Equals("Rientrato"))
-                    {
-                        if (IstanteInViaggio > istante)
-                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario di uscita del mezzo.");
+                    {
+                        if (IstanteInViaggio > istante)
+                            throw new System.Exception("L'orario inserito non può essere inferiore all'orario del mezzo in viaggio.");

                         if (IstanteSulPosto > istante)
                             throw new System.Exception("L'orario inserito non può essere inferiore all'orario sul posto del mezzo.");

                         if (IstanteInRientro > istante)
                             throw new System.Exception("L'orario inserito non può essere inferiore all'orario in rientro del mezzo.");
-

                         statoMezzoReale = command.StatoMezzo;
                         richiesta.CambiaStatoPartenza(partenza.Partenza, new CambioStatoMezzo()


Simplify

Simplify

--- MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs
+++ MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs
@@ -211,8 +211,6 @@
 						{
 							Scene.SelectedItem = (IObject3D)treeView.SelectedNode.Tag;
 						}
-
-						// selectedObjectPanel.SetActiveItem((IObject3D)treeView.SelectedNode.Tag);
 					}
 				}
 			};
@@ -1814,25 +1812,20 @@
 		private void Scene_SelectionChanged(object sender, EventArgs e)
 		{
 			var selectedItem = Scene.SelectedItem;
-			if (selectedItem == null)
-			{
-
+
+			// Change tree selection to current node
+			if (selectedItem != null
+				&& keyValues.TryGetValue(selectedItem, out TreeNode treeNode))
+			{
+				treeView.SelectedNode = treeNode;
+			}
+				else
+			{
 				// Clear the TreeView and release node references when no item is selected
-				selectedObjectPanel.SetActiveItem(null);
 				treeView.SelectedNode = null;
-
-				return;
-			}
-			else
-			{
-				// Change tree selection to current node
-				if (keyValues.TryGetValue(selectedItem, out TreeNode treeNode))
-				{
-					treeView.SelectedNode = treeNode;
-				}
-
-				selectedObjectPanel.SetActiveItem(selectedItem);
-			}
+			}
+
+			selectedObjectPanel.SetActiveItem(selectedItem);

 			if (deferEditorTillMouseUp)
 			{


CLSCompliant

CLSCompliant

--- Meowtrix.UniversalClassLibrary/Properties/AssemblyInfo.cs
+++ Meowtrix.UniversalClassLibrary/Properties/AssemblyInfo.cs
@@ -1,4 +1,5 @@
-using System.Reflection;
+using System;
+using System.Reflection;

 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
@@ -11,3 +12,4 @@
 [assembly: AssemblyCopyright("Copyright (C)  2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
+[assembly: CLSCompliant(true)]


Removed unneeded comment.

Removed unneeded comment.

--- Models/Models.Tests/Evolution/ModelChangeRecorderTests.cs
+++ Models/Models.Tests/Evolution/ModelChangeRecorderTests.cs
@@ -93,8 +93,7 @@
             rec.Start(railway);

             parent.ConnectsTo.Clear();
-
-            //var expected = new ListDeletionBase<>(parent.AbsoluteUri, "ConnectsTo", 0, int.MaxValue); //TODO reset-event
+
             var expected = new CollectionResetAssociation<ITrackElement>(parent.AbsoluteUri, "ConnectsTo", new List<Uri>());
             var actual = rec.GetModelChanges().Changes[0];
             Assert.AreEqual(expected, actual);


Updated from master.

Updated from master.

--- Mono.Debugger.Soft/Mono.Debugger.Soft/MethodBodyMirror.cs
+++ Mono.Debugger.Soft/Mono.Debugger.Soft/MethodBodyMirror.cs
@@ -105,28 +105,23 @@
 						instr.Operand = br.ReadByte ();
 					break;
 				case OperandType.ShortInlineVar :
-					br.ReadByte ();
-					//instr.Operand = GetVariable (body, br.ReadByte ());
+					instr.Operand = br.ReadByte ();
 					break;
 				case OperandType.ShortInlineArg :
-					br.ReadByte ();
-					//instr.Operand = GetParameter (body, br.ReadByte ());
+					instr.Operand = br.ReadByte ();
 					break;
 				case OperandType.InlineSig :
 					br.ReadInt32 ();
 					//instr.Operand = GetCallSiteAt (br.ReadInt32 (), context);
 					break;
 				case OperandType.InlineI :
-					br.ReadInt32 ();
-					//instr.Operand = br.ReadInt32 ();
+					instr.Operand = br.ReadInt32 ();
 					break;
 				case OperandType.InlineVar :
-					br.ReadInt16 ();
-					//instr.Operand = GetVariable (body, br.ReadInt16 ());
+					instr.Operand = br.ReadInt16 ();
 					break;
 				case OperandType.InlineArg :
-					br.ReadInt16 ();
-					//instr.Operand = GetParameter (body, br.ReadInt16 ());
+					instr.Operand = br.ReadInt16 ();
 					break;
 				case OperandType.InlineI8 :
 					instr.Operand = br.ReadInt64 ();


Updated another functional test. [27]

Updated another functional test. [27]

--- NWebsecTestSites/NWebsec.Tests.Functional/MvcTestsBase.cs
+++ NWebsecTestSites/NWebsec.Tests.Functional/MvcTestsBase.cs
@@ -46,9 +46,8 @@
             var response = await httpClient.GetAsync(testUri);

             Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode, reqFailed + testUri);
-            var serverHeader = response.Headers.Server.Single().Product.ToString();
+            Assert.IsEmpty(response.Headers.Where(x => x.Key.Equals("Server", StringComparison.InvariantCultureIgnoreCase)), testUri.ToString());
             Assert.IsEmpty(response.Headers.Where(x => x.Key.Equals("X-AspNetMvc-Version", StringComparison.InvariantCultureIgnoreCase)), testUri.ToString());
-            Assert.AreEqual("Webserver/1.0", serverHeader, testUri.ToString());
         }

         [Test]


increase version

increase version

--- Nager.AmazonProductAdvertising/Properties/AssemblyInfo.cs
+++ Nager.AmazonProductAdvertising/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.17.0")]
-[assembly: AssemblyFileVersion("1.0.17.0")]
+[assembly: AssemblyVersion("1.0.18.0")]
+[assembly: AssemblyFileVersion("1.0.18.0")]


test: add test parameter

test: add test parameter

--- test/DlibDotNet.Tests/Array2D/Array2DTest.cs
+++ test/DlibDotNet.Tests/Array2D/Array2DTest.cs
@@ -18,6 +18,10 @@
                 new { Type = ImageTypes.RgbAlphaPixel, ExpectResult = true},
                 new { Type = ImageTypes.UInt8,         ExpectResult = true},
                 new { Type = ImageTypes.UInt16,        ExpectResult = true},
+                new { Type = ImageTypes.UInt32,        ExpectResult = true},
+                new { Type = ImageTypes.Int8,          ExpectResult = true},
+                new { Type = ImageTypes.Int16,         ExpectResult = true},
+                new { Type = ImageTypes.Int32,         ExpectResult = true},
                 new { Type = ImageTypes.HsiPixel,      ExpectResult = true},
                 new { Type = ImageTypes.Float,         ExpectResult = true},
                 new { Type = ImageTypes.Double,        ExpectResult = true}
@@ -49,6 +53,10 @@
                 new { Type = ImageTypes.RgbAlphaPixel, ExpectResult = true},
                 new { Type = ImageTypes.UInt8,         ExpectResult = true},
                 new { Type = ImageTypes.UInt16,        ExpectResult = true},
+                new { Type = ImageTypes.UInt32,        ExpectResult = true},
+                new { Type = ImageTypes.Int8,          ExpectResult = true},
+                new { Type = ImageTypes.Int16,         ExpectResult = true},
+                new { Type = ImageTypes.Int32,         ExpectResult = true},
                 new { Type = ImageTypes.HsiPixel,      ExpectResult = true},
                 new { Type = ImageTypes.Float,         ExpectResult = true},
                 new { Type = ImageTypes.Double,        ExpectResult = true}


Fixed crash on dynamic channel delete

Fixed crash on dynamic channel delete

--- DiscordBotNew/DiscordBot.cs
+++ DiscordBotNew/DiscordBot.cs
@@ -147,6 +147,16 @@
                 foreach (var item in descriptions)
                 {
                     var channel = (ITextChannel)Client.GetChannel(item.Key);
+                    if (channel == null)
+                    {
+                        var channelDescriptions = ChannelDescriptions.GetSetting("descriptions", out Dictionary<ulong, string> d)
+                            ? descriptions
+                            : new Dictionary<ulong, string>();
+                        d.Remove(item.Key);
+                        ChannelDescriptions.AddSetting("descriptions", d);
+                        ChannelDescriptions.SaveSettings();
+                        continue;
+                    }
                     string topic = item.Value;
                     string newDesc = await descriptionCommandRegex.ReplaceAsync(
                                      topic,


removed lines setting null values

removed lines setting null values

--- Acrolinx.Demo.Sidebar/SimpleSample.Designer.cs
+++ Acrolinx.Demo.Sidebar/SimpleSample.Designer.cs
@@ -80,13 +80,11 @@
             //
             // acrolinxSidebar
             //
-            this.acrolinxSidebar.ClientSignature = null;
             this.acrolinxSidebar.Dock = System.Windows.Forms.DockStyle.Right;
             this.acrolinxSidebar.Location = new System.Drawing.Point(576, 0);
             this.acrolinxSidebar.MaximumSize = new System.Drawing.Size(300, 0);
             this.acrolinxSidebar.MinimumSize = new System.Drawing.Size(300, 0);
             this.acrolinxSidebar.Name = "acrolinxSidebar";
-            this.acrolinxSidebar.SidebarSourceLocation = null;
             this.acrolinxSidebar.Size = new System.Drawing.Size(300, 441);
             this.acrolinxSidebar.TabIndex = 0;
             this.acrolinxSidebar.InitFinished += new Acrolinx.Sdk.Sidebar.SidebarInitFinishedEventHandler(this.acrolinxSidebar_InitFinished);


oh my GOD, is that a.. a minimap?

oh my GOD, is that a.. a minimap?

--- Alcove/Assets/GameplayScene/GameplayManager.cs
+++ Alcove/Assets/GameplayScene/GameplayManager.cs
@@ -7,12 +7,13 @@
 	public GameObject playerPrefab;

 	private GameSession gameSession;
+	private GameObject minimap;
 	private Player[] players;

 	public void Start() {

 		// Obtain a reference to the main game session script.
-		GameObject gameSessionGameObject = GameObject.Find ("GameSession") as GameObject;
+		GameObject gameSessionGameObject = GameObject.Find("GameSession") as GameObject;
 		if(gameSessionGameObject) {
 			gameSession = gameSessionGameObject.GetComponent<GameSession> ();
 		}
@@ -31,6 +32,22 @@
 			player.camera.rect = new Rect(i * viewportXSpace, 0, viewportXSpace, 1);
 			players[i] = player;
 		}
+
+		float xPosition = (players[0].transform.position.x + players[1].transform.position.x) / 2;
+		CreateMinimapObject(xPosition);
+	}
+
+	void CreateMinimapObject(float xFocalPosition) {
+		minimap = new GameObject();
+		Camera minimapCamera = minimap.AddComponent<Camera>();
+
+		float widthFraction = 0.1f;
+		float heightFraction = 0.3f;
+		minimapCamera.isOrthoGraphic = true;
+		minimapCamera.rect = new Rect(0.5f - widthFraction/2, 0.5f - heightFraction/2, widthFraction, heightFraction);
+		minimapCamera.backgroundColor = new Color(0.3f, 0.3f, 0.3f, 0.6f);
+		minimapCamera.orthographicSize = 16.0f;
+		minimap.camera.transform.position = new Vector3(xFocalPosition, 0.0f, -5.0f);
 	}

 	public void LateUpdate() {


add a new interface to BinStruct

add a new interface to BinStruct

--- Bend/Util/BinStruct.cs
+++ Bend/Util/BinStruct.cs
@@ -35,6 +35,12 @@
                         throw new Exception("unimplemented");
                     }
                 }
+            }
+
+            public static void writeStruct<E>(E obj, out byte[] outbuf) where E : struct {
+                MemoryStream ms = new MemoryStream();
+                writeStruct(obj, ms);
+                outbuf = ms.ToArray();
             }

             // http://mmarinov.blogspot.com/2007/01/reflection-modify-value-types-by.html


Remove unused usings

Remove unused usings

--- tests/OmniSharp.Cake.Tests/CodeCheckFacts.cs
+++ tests/OmniSharp.Cake.Tests/CodeCheckFacts.cs
@@ -1,12 +1,8 @@
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
+using System.IO;
 using System.Threading.Tasks;
 using Microsoft.Extensions.Logging;
 using OmniSharp.Cake.Services.RequestHandlers.Diagnostics;
 using OmniSharp.Models;
-using OmniSharp.Models.AutoComplete;
 using OmniSharp.Models.CodeCheck;
 using OmniSharp.Models.UpdateBuffer;
 using TestUtility;


Adding daylight url,secrets needed for automation

--- test/Microsoft.WindowsAzure.MobileServices.iOS.Test/UI/LoginViewController.cs
+++ test/Microsoft.WindowsAzure.MobileServices.iOS.Test/UI/LoginViewController.cs
@@ -1,4 +1,5 @@
 using Microsoft.WindowsAzure.MobileServices;
+using Microsoft.WindowsAzure.MobileServices.TestFramework;
 using MonoTouch.Dialog;
 using Foundation;
 using UIKit;
@@ -15,20 +16,42 @@
             string mobileServiceUri = defaults.StringForKey(MobileServiceUriKey);
             string mobileServiceKey = defaults.StringForKey(MobileServiceKeyKey);
             string tags = defaults.StringForKey(TagsKey);
+            string daylightUri = defaults.StringForKey(DaylightUriKey);
+            string daylightProject = defaults.StringForKey(DaylightProjectKey);
+            string clientId = defaults.StringForKey(ClientIdKey);
+            string clientSecret = defaults.StringForKey(ClientSecretKey);
+            string runId = defaults.StringForKey(RunIdKey);
+            string runtimeVersion = defaults.StringForKey(RuntimeVersionKey);

             this.uriEntry = new EntryElement(null, "Mobile Service URI", mobileServiceUri);
             this.keyEntry = new EntryElement(null, "Mobile Service Key", mobileServiceKey);
             this.tagsEntry = new EntryElement(null, "Tags", tags);

+            this.daylightUriEntry = new EntryElement(null, "Daylight URI", daylightUri);
+            this.daylightProjectEntry = new EntryElement(null, "Daylight Project", daylightProject);
+            this.clientIdEntry = new EntryElement(null, "Client ID", clientId);
+            this.clientSecretEntry = new EntryElement(null, "Client Secret", clientSecret);
+            this.runIdEntry = new EntryElement(null, "Run Id", runId);
+            this.runtimeVersionEntry = new EntryElement(null, "Runtime version", runtimeVersion);
+
             Root = new RootElement("C# Client Library Tests") {
-                new Section ("Login") {
+                new Section("Login") {
                     this.uriEntry,
                     this.keyEntry,
                     this.tagsEntry
                 },

+                new Section("Report Results"){
+                    this.daylightUriEntry,
+                    this.daylightProjectEntry,
+                    this.clientIdEntry,
+                    this.clientSecretEntry,
+                    this.runIdEntry,
+                    this.runtimeVersionEntry
+                },
+
                 new Section {
-                    new StringElement ("Run Tests", RunTests)
+                    new StringElement ("Run Tests", RunTests)
                 },

                 new Section{
@@ -43,10 +66,22 @@
         private const string MobileServiceUriKey = "MobileServiceUri";
         private const string MobileServiceKeyKey = "MobileServiceKey";
         private const string TagsKey = "Tags";
+        private const string DaylightUriKey = "DaylightUri";
+        private const string DaylightProjectKey = "DaylightProject";
+        private const string ClientIdKey = "ClientId";
+        private const string ClientSecretKey = "ClientSecret";
+        private const string RunIdKey = "RunId";
+        private const string RuntimeVersionKey = "RuntimeVersion";

         private readonly EntryElement uriEntry;
         private readonly EntryElement keyEntry;
         private readonly EntryElement tagsEntry;
+        private readonly EntryElement daylightUriEntry;
+        private readonly EntryElement daylightProjectEntry;
+        private readonly EntryElement clientIdEntry;
+        private readonly EntryElement clientSecretEntry;
+        private readonly EntryElement runIdEntry;
+        private readonly EntryElement runtimeVersionEntry;

         private void RunTests()
         {
@@ -54,10 +89,31 @@
             defaults.SetString(this.uriEntry.Value, MobileServiceUriKey);
             defaults.SetString(this.keyEntry.Value, MobileServiceKeyKey);
             defaults.SetString(this.tagsEntry.Value, TagsKey);
+            defaults.SetString(this.daylightUriEntry.Value, DaylightUriKey);
+            defaults.SetString(this.daylightProjectEntry.Value, DaylightProjectKey);
+            defaults.SetString(this.clientIdEntry.Value, ClientIdKey);
+            defaults.SetString(this.clientSecretEntry.Value, ClientSecretKey);
+            defaults.SetString(this.runIdEntry.Value, RunIdKey);
+            defaults.SetString(this.runtimeVersionEntry.Value, RuntimeVersionKey);

-            AppDelegate.Harness.Settings.Custom["MobileServiceRuntimeUrl"] = this.uriEntry.Value;
-            AppDelegate.Harness.Settings.Custom["MobileServiceRuntimeKey"] = this.keyEntry.Value;
-            AppDelegate.Harness.Settings.TagExpression = this.tagsEntry.Value;
+            AppDelegate.Harness.SetAutoConfig(new TestConfig()
+            {
+                MobileServiceRuntimeUrl = this.uriEntry.Value,
+                MobileServiceRuntimeKey = this.keyEntry.Value,
+                TagExpression = this.tagsEntry.Value,
+                MasterRunId = this.runIdEntry.Value,
+                DayLightUrl = this.daylightUriEntry.Value,
+                DaylightProject = this.daylightProjectEntry.Value,
+                CliendId = this.clientIdEntry.Value,
+                ClientSecret = this.clientSecretEntry.Value,
+                RuntimeVersion = this.runtimeVersionEntry.Value,
+            });
+            AppDelegate.Harness.Settings.ManualMode =
+                string.IsNullOrWhiteSpace(this.daylightUriEntry.Value) ||
+                string.IsNullOrWhiteSpace(this.daylightProjectEntry.Value) ||
+                string.IsNullOrWhiteSpace(this.clientIdEntry.Value) ||
+                string.IsNullOrWhiteSpace(this.clientSecretEntry.Value) ||
+                string.IsNullOrWhiteSpace(this.runtimeVersionEntry.Value);

             if (!string.IsNullOrEmpty(AppDelegate.Harness.Settings.TagExpression))
             {
@@ -74,7 +130,7 @@
         private async void Login(MobileServiceAuthenticationProvider provider)
         {
             var client = new MobileServiceClient(this.uriEntry.Value, this.keyEntry.Value);
-            var user = await client.LoginAsync(this,provider);
+            var user = await client.LoginAsync(this, provider);
             var alert = new UIAlertView("Welcome", "Your userId is: " + user.UserId, null, "OK");
             alert.Show();
         }


Stop displaying "Sending windowslig profile to client" when WL is disabled or there is no valid WL for that region.

--- OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
+++ OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
@@ -181,7 +181,8 @@
         }
         private void EventManager_OnMakeRootAgent(ScenePresence presence)
         {
-            m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client");
+            if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid)
+                m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client");
             SendProfileToClient(presence);
         }
         private void EventManager_OnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID pUUID)


Remove unused code

Remove unused code

--- Operations.Classification.WpfUi.Tests/Accounts/Wrapper.cs
+++ Operations.Classification.WpfUi.Tests/Accounts/Wrapper.cs
@@ -1,5 +1,10 @@
 namespace Operations.Classification.WpfUi.Tests.Accounts
 {
+    /// <summary>
+    /// this wrapper is used as a trick to fool the test explorer.
+    /// Without this mecanism, some tests could be written with the autofixture style
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
     public class Wrapper<T>
     {
         public T Value { get; }
@@ -13,12 +18,7 @@
         {
             return typeof(T).ToString();
         }
-
-        public static implicit operator Wrapper<T>(T val)
-        {
-            return new Wrapper<T>(val);
-        }
-
+
         public static implicit operator T(Wrapper<T> wrapper)
         {
             return wrapper.Value;


Update Mission Achievement to only use achievements that cannot be manually set.

--- Orlandia2015/Controllers/MissionAchievementsController.cs
+++ Orlandia2015/Controllers/MissionAchievementsController.cs
@@ -40,7 +40,7 @@
         // GET: MissionAchievements/Create
         public ActionResult Create()
         {
-            ViewBag.uAchievementID = new SelectList(db.Achievements, "uAchievementID", "sName");
+            ViewBag.uAchievementID = new SelectList(db.Achievements.Where(a => a.bCanBeManuallySet == false).OrderBy(a => a.iSortOrder), "uAchievementID", "sName");
             return View();
         }


Mergiato

Mergiato

--- Overnet.SitoAcademy/Overnet.SitoAcademy/HomeController.cs
+++ Overnet.SitoAcademy/Overnet.SitoAcademy/HomeController.cs
@@ -15,8 +15,11 @@
             model.Saluto = ConfigurationManager.AppSettings["saluto"];
             model.Data = DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss");

+            model.Studenti.Add("Giovanni Improta");
             model.Studenti.Add("Mauro Sanna");
             model.Studenti.Add("Marcantonio Cilia");
+            model.Studenti.Add("Alexandru Polevoi");
+            model.Studenti.Add("Florio Pasquale");

             return View(model);
         }


Ver bump

Ver bump

--- Owin.Security.Providers.NoAuth/Properties/AssemblyInfo.cs
+++ Owin.Security.Providers.NoAuth/Properties/AssemblyInfo.cs
@@ -24,7 +24,7 @@

 [assembly: AssemblyVersion(AssemblyMeta.Version)]
 [assembly: AssemblyFileVersion(AssemblyMeta.Version)]
-[assembly: AssemblyInformationalVersion(AssemblyMeta.Version + "-beta6")]
+[assembly: AssemblyInformationalVersion(AssemblyMeta.Version + "-beta7")]

 internal static class AssemblyMeta
 {


New extension methods added: Clone, Diff, SerializeObject, DeserializeObject

--- Ekin.Clarizen/Extensions.cs
+++ Ekin.Clarizen/Extensions.cs
@@ -4,6 +4,8 @@
 using System.Net;
 using System.Reflection;
 using System.Web;
+using Newtonsoft.Json;
+using System.IO;

 namespace Ekin.Clarizen
 {
@@ -68,6 +70,30 @@
             return true;
         }

+        public static List<Variance> Diff<T>(this T val1, T val2, bool IncludeIdField = false, bool IncludeJsonIgnoreAttributes = false)
+        {
+            List<Variance> variances = new List<Variance>();
+            PropertyInfo[] propInfos = val1.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
+            if (propInfos.Length > 0)
+            {
+                foreach (PropertyInfo propInfo in propInfos)
+                {
+                    Variance v = new Variance();
+                    v.Prop = propInfo.Name;
+                    v.valA = propInfo.GetValue(val1);
+                    v.valB = propInfo.GetValue(val2);
+                    if ((object.ReferenceEquals(v.valA, null) ^ object.ReferenceEquals(v.valB, null)) ||
+                        ((IncludeJsonIgnoreAttributes || propInfo.GetCustomAttribute(typeof(Newtonsoft.Json.JsonIgnoreAttribute)) != null) &&
+                        (IncludeIdField || propInfo.Name.ToLower() != "id") &&
+                        v.valA != null && !v.valA.Equals(v.valB)))
+                    {
+                        variances.Add(v);
+                    }
+                }
+            }
+            return variances;
+        }
+
         public static string GetFormattedErrorMessage(this object Error) {
             if (Error is WebException)
             {
@@ -94,5 +120,80 @@
             }
             return 0;
         }
+        /// <summary>
+        /// Serializes an object.
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="serializableObject"></param>
+        /// <param name="fileName"></param>
+        public static bool SerializeObject<T>(T serializableObject, string fileName)
+        {
+            if (serializableObject == null) { return false; }
+
+            try
+            {
+                string output = JsonConvert.SerializeObject(serializableObject, Newtonsoft.Json.Formatting.Indented, new JsonSerializerSettings()
+                {
+                    ReferenceLoopHandling = ReferenceLoopHandling.Ignore
+                });
+                File.WriteAllText(fileName, output);
+                return true;
+            }
+            catch (Exception ex)
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Deserializes an xml file into an object list
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="fileName"></param>
+        /// <returns></returns>
+        public static T DeSerializeObject<T>(string fileName)
+        {
+            if (string.IsNullOrEmpty(fileName)) { return default(T); }
+
+            try
+            {
+                string input = File.ReadAllText(fileName);
+                return JsonConvert.DeserializeObject<T>(input);
+            }
+            catch (Exception ex)
+            {
+                return default(T);
+            }
+        }
+
+        /// <summary>
+        /// Perform a deep Copy of the object, using Json as a serialisation method. NOTE: Private members are not cloned using this method.
+        /// </summary>
+        /// <typeparam name="T">The type of object being copied.</typeparam>
+        /// <param name="source">The object instance to copy.</param>
+        /// <returns>The copied object.</returns>
+        public static T Clone<T>(this T source)
+        {
+            // Don't serialize a null object, simply return the default for that object
+            if (Object.ReferenceEquals(source, null))
+            {
+                return default(T);
+            }
+
+            // initialize inner objects individually
+            // for example in default constructor some list property initialized with some values,
+            // but in 'source' these items are cleaned -
+            // without ObjectCreationHandling.Replace default constructor values will be added to result
+            var deserializeSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace };
+
+            return JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject(source), deserializeSettings);
+        }
+    }
+
+    public class Variance
+    {
+        public string Prop { get; set; }
+        public object valA { get; set; }
+        public object valB { get; set; }
     }
 }


Fix: ignore viewport when checking for UI object collisions

--- Engine/Objects/AGSObject.cs
+++ Engine/Objects/AGSObject.cs
@@ -9,6 +9,7 @@
 	public class AGSObject : IObject
 	{
 		private IAnimationContainer _animation;
+		private readonly IGameState _state;

 		/// <summary>
 		/// Initializes a new instance of the <see cref="Engine.AGSObject"/> class.
@@ -23,6 +24,8 @@
 				TypedParameter defaults = new TypedParameter (typeof(IInteractions), gameEvents.DefaultInteractions);
 				TypedParameter objParam = new TypedParameter (typeof(IObject), this);
 				Interactions = resolver.Container.Resolve<IInteractions>(defaults, objParam);
+
+				_state = resolver.Container.Resolve<IGameState>();
 			}

 			Enabled = true;
@@ -175,6 +178,12 @@
 				return false;
 			IArea pixelPerfect = PixelPerfectHitTestArea;

+			if (IgnoreViewport && _state != null) //todo: account for viewport scaling as well
+			{
+				x -= _state.Player.Character.Room.Viewport.X;
+				y -= _state.Player.Character.Room.Viewport.Y;
+			}
+
 			if (pixelPerfect == null || !pixelPerfect.Enabled)
 			{
 				if (boundingBox.Contains(new AGSPoint (x, y)))


another bugfix

another bugfix

--- EngineLayer/ProteinGroup.cs
+++ EngineLayer/ProteinGroup.cs
@@ -107,8 +107,9 @@
             sb.Append(string.Join(" | ", new List<string>(Proteins.Select(p => p.Accession))));
             sb.Append("\t");

+            // genes
             var genes = new List<string>(Proteins.Select(p => p.GeneNames.Select(x => x.Item2).FirstOrDefault()));
-            //sb.Append(string.Join(" | ", genes));
+            sb.Append(string.Join(" | ", genes));
             sb.Append("\t");

             // list of protein names


=_= fix a silly bug... but,,, how could such a bug exist for so long a time!!!


escape symbols in XML

escape symbols in XML

--- CJTSD/CJTSD.cs
+++ CJTSD/CJTSD.cs
@@ -12,7 +12,7 @@
     /// </code>
     /// To consume a CJTSD object:
     /// <code>
-    ///     JsonConvert.DeserializeObject<CJTSD>(jsonString).ToList()
+    ///     JsonConvert.DeserializeObject<CJTSD>(jsonString).ToList()
     /// </code>
     /// </summary>
     public class CJTSD : PlainCJTSD


Changed permissions to internal. Fixes #1255

--- core/Piranha.WebApi/Module.cs
+++ core/Piranha.WebApi/Module.cs
@@ -20,10 +20,10 @@
     {
         private readonly List<PermissionItem> _permissions = new List<PermissionItem>
         {
-            new PermissionItem { Name = Permissions.Media, Title = "Media Api" },
-            new PermissionItem { Name = Permissions.Pages, Title = "Page Api" },
-            new PermissionItem { Name = Permissions.Posts, Title = "Post Api" },
-            new PermissionItem { Name = Permissions.Sitemap, Title = "Sitemap Api" }
+            new PermissionItem { Name = Permissions.Media, Title = "Media Api", IsInternal = true },
+            new PermissionItem { Name = Permissions.Pages, Title = "Page Api", IsInternal = true },
+            new PermissionItem { Name = Permissions.Posts, Title = "Post Api", IsInternal = true },
+            new PermissionItem { Name = Permissions.Sitemap, Title = "Sitemap Api", IsInternal = true }
         };

         /// <summary>


Include isasync

Include isasync

--- AngleSharp/Html/LinkRels/ImportLinkRelation.cs
+++ AngleSharp/Html/LinkRels/ImportLinkRelation.cs
@@ -5,6 +5,7 @@
     using AngleSharp.Extensions;
     using AngleSharp.Network;
     using AngleSharp.Parser.Html;
+    using System;
     using System.Threading;
     using System.Threading.Tasks;

@@ -40,6 +41,7 @@
         {
             var link = Link;
             var request = link.CreateRequestFor(Url);
+            var isasync = link.HasAttribute(AttributeNames.Async);

             using (var response = await loader.FetchAsync(request, cancel).ConfigureAwait(false))
             {


fix a bug - getcontainerurl()

fix a bug - getcontainerurl()

--- BlobStorage/Program.cs
+++ BlobStorage/Program.cs
@@ -53,7 +53,7 @@
         // 的方式针对存储服务来使用。
         //
         // 使用Azure存储模拟器来运行这个示例  (默认选项)
-        //      1. 点击开始按钮或者是键盘的Windows键，然后输入“Azure Storage Emulator”来寻找Azure存储模拟器，然后点击运行。
+        //      1. 点击开始按钮或者是键盘的Windows键，然后输入“Azure Storage Emulator”来寻找Azure存储模拟器，之后点击运行。
         //      2. 设置断点，然后使用F10按钮运行这个示例.
         //
         // 使用Azure存储服务来运行这个示例
@@ -94,7 +94,7 @@
             // 如何配置 Azure 存储空间连接字符串 - https://www.azure.cn/documentation/articles/storage-configure-connection-string/
             CloudStorageAccount storageAccount = CreateStorageAccountFromConnectionString(CloudConfigurationManager.GetSetting("StorageConnectionString"));

-            // 创建一个客户端的blob来和blob服务交互。
+            // 创建一个blobClient来和blob服务交互。
             CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

             // 创建一个容器来组织存储账号下的blobs。
@@ -154,9 +154,7 @@
         private static async Task BasicStorageBlockBlobOperationsWithAccountSASAsync()
         {
             const string imageToUpload = "HelloWorld.png";
-            string blockBlobContainerName = "demoblockblobcontainer-" + Guid.NewGuid();
-            Console.WriteLine("请输入存储账号名：");
-            string accountName=Console.ReadLine();
+            string blockBlobContainerName = "demoblockblobcontainer-" + Guid.NewGuid();

             // 调用GetAccountSASToken 来获得基于存储账号、存储密匙的sasToken
             string sasToken = GetAccountSASToken();
@@ -176,12 +174,8 @@
             // 通过传递存储账号和容器名来获得容器的Uri
             Uri ContainerUri = GetContainerSASUri(blockBlobContainerName);

-            // 通过使用Uri和sasToken来创建CloudBlobContainer
-            CloudStorageAccount accountWithSAS = new CloudStorageAccount(accountSAS, accountName, "core.chinacloudapi.cn", true);
-            CloudBlobClient blobClient = accountWithSAS.CreateCloudBlobClient();
-            CloudBlobContainer container = blobClient.GetContainerReference(blockBlobContainerName);
-
-           // CloudBlobContainer container = new CloudBlobContainer(ContainerUri, accountSAS);
+            // 通过使用Uri和sasToken来创建CloudBlobContainer
+            CloudBlobContainer container = new CloudBlobContainer(ContainerUri, accountSAS);
             try
             {
                 await container.CreateIfNotExistsAsync();
@@ -303,7 +297,7 @@
             // 如何配置 Azure 存储空间连接字符串 - https://www.azure.cn/documentation/articles/storage-configure-connection-string/
             CloudStorageAccount storageAccount = CreateStorageAccountFromConnectionString(CloudConfigurationManager.GetSetting("StorageConnectionString"));

-            return new Uri(storageAccount.BlobStorageUri.PrimaryUri.OriginalString + "/" + containerName);
+            return new Uri(storageAccount.BlobStorageUri.PrimaryUri.OriginalString + containerName);
         }

         /// <summary>
@@ -342,7 +336,7 @@
         /// 验证App.Config文件中的连接字符串，当使用者没有更新有效的值时抛出错误提示
         /// </summary>
         /// <param name="storageConnectionString">连接字符串</param>
-        /// <returns>CloudStorageAccount object</returns>
+        /// <returns>CloudStorageAccount 对象</returns>
         private static CloudStorageAccount CreateStorageAccountFromConnectionString(string storageConnectionString)
         {
             CloudStorageAccount storageAccount;


Languages always save by iso-name

Languages always save by iso-name

--- uSync8.BackOffice/SyncHandlers/Handlers/LanguageHandler.cs
+++ uSync8.BackOffice/SyncHandlers/Handlers/LanguageHandler.cs
@@ -41,7 +41,14 @@
         protected override ILanguage GetFromService(int id)
             => localizationService.GetLanguageById(id);

+
         // language guids are not consistant (at least in alpha)
+        // so we don't save by Guid we save by ISO name everytime.
+        protected override string GetPath(string folder, ILanguage item, bool GuidNames, bool isFlat)
+        {
+            return $"{folder}/{this.GetItemPath(item, GuidNames, isFlat)}.config";
+        }
+
         protected override string GetItemPath(ILanguage item, bool useGuid, bool isFlat)
             => item.IsoCode.ToSafeFileName();


Don't leak textures

Don't leak textures

--- Assets/RagePixel2/Editor/RagePixelResources.cs
+++ Assets/RagePixel2/Editor/RagePixelResources.cs
@@ -62,6 +62,7 @@
 		private static Texture2D Base64ToTexture (string base64)
 		{
 			Texture2D t = new Texture2D(1,1);
+			t.hideFlags = HideFlags.HideAndDontSave;
 			t.LoadImage(System.Convert.FromBase64String(base64));
 			return t;
 		}


Speed up the BeatNumberRenderer

Speed up the BeatNumberRenderer

--- Assets/Scripts/GLDrawing/BeatNumberRenderer.cs
+++ Assets/Scripts/GLDrawing/BeatNumberRenderer.cs
@@ -15,15 +15,20 @@
         List<Text> textPool = new List<Text>();

         static int size;
-        static int currentIndex = 0;
+        static int prevActiveCount = 0;
+        static int currentActiveCount = 0;

         static public void Render(Vector3 pos, int number)
         {
-            if (currentIndex < size)
+            if (currentActiveCount < size)
             {
-                Instance.textPool[currentIndex].gameObject.SetActive(true);
-                Instance.rectTransformPool[currentIndex].position = pos;
-                Instance.textPool[currentIndex].text = number.ToString();
+                if (currentActiveCount >= prevActiveCount)
+                {
+                    Instance.textPool[currentActiveCount].gameObject.SetActive(true);
+                }
+
+                Instance.rectTransformPool[currentActiveCount].position = pos;
+                Instance.textPool[currentActiveCount].text = number.ToString();
             }
             else
             {
@@ -34,31 +39,35 @@
                 size++;
             }

-            currentIndex++;
+            currentActiveCount++;
         }

         static public void Begin()
         {
-            foreach (var go in Instance.textPool.Take(currentIndex).Select(text => text.gameObject))
-            {
-                go.SetActive(false);
-            }
-
-            currentIndex = 0;
+            prevActiveCount = currentActiveCount;
+            currentActiveCount = 0;
         }

         static public void End()
         {
-            if (currentIndex * 2 < size)
+            if (currentActiveCount < prevActiveCount)
             {
-                foreach (var text in Instance.textPool.Skip(currentIndex + 1))
+                for (int i = currentActiveCount; i < prevActiveCount; i++)
+                {
+                    Instance.textPool[i].gameObject.SetActive(false);
+                }
+            }
+
+            if (currentActiveCount * 2 < size)
+            {
+                foreach (var text in Instance.textPool.Skip(currentActiveCount + 1))
                 {
                     DestroyObject(text.gameObject);
                 }

-                Instance.rectTransformPool.RemoveRange(currentIndex, size - currentIndex);
-                Instance.textPool.RemoveRange(currentIndex, size - currentIndex);
-                size = currentIndex;
+                Instance.rectTransformPool.RemoveRange(currentActiveCount, size - currentActiveCount);
+                Instance.textPool.RemoveRange(currentActiveCount, size - currentActiveCount);
+                size = currentActiveCount;
             }
         }
     }


Added Tip field in accordance to the prefab change in commit f660d01

--- Assets/Scripts/View/ActionGrid/HotkeyButton.cs
+++ Assets/Scripts/View/ActionGrid/HotkeyButton.cs
@@ -1,6 +1,7 @@
 using Scripts.Model.Interfaces;
 using Scripts.Presenter;
 using Scripts.View.ObjectPool;
+using Scripts.View.Tooltip;
 using UnityEngine;
 using UnityEngine.UI;

@@ -11,17 +12,16 @@
     /// the mouse and the keyboard
     /// </summary>
     public class HotkeyButton : PooledBehaviour {
-        private Color ACTIVE_COLOR = Color.white;
+        private static Color ACTIVE_COLOR = Color.white;

-        /// <summary>
-        /// Collider we use to detect when the mouse is over the button
-        /// For tooltip changing
-        /// </summary>
         [SerializeField]
-        private BoxCollider2D bc;
+        private Tip tip;

         [SerializeField]
         private Button button;
+
+        [SerializeField]
+        private Image icon;

         private KeyCode hotkey;

@@ -45,12 +45,13 @@
         [SerializeField]
         private Text text;

-        private string tooltipText;
-
         public IButtonable Buttonable {
             set {
                 text.text = value.ButtonText;
-                tooltipText = value.TooltipText;
+                icon.sprite = value.Sprite;
+                tip.Sprite = value.Sprite;
+                tip.Title = value.ButtonText;
+                tip.Body = value.TooltipText;
                 button.onClick.RemoveAllListeners();
                 button.onClick.AddListener(() => {
                     if (value.IsInvokable) {
@@ -87,6 +88,7 @@

         private void ActiveAppearance() {
             button.image.color = ACTIVE_COLOR;
+            icon.color = ACTIVE_COLOR;
             text.color = INACTIVE_COLOR;
             hotkeyText.color = INACTIVE_COLOR;
         }
@@ -98,12 +100,16 @@

         private void DisabledAppearance() {
             text.text = "";
+            tip.enabled = false;
+            icon.color = Color.clear;
             button.image.color = Color.clear;
             hotkeyText.color = Color.clear;
         }

         private void InactiveAppearance() {
             button.image.color = INACTIVE_COLOR;
+            tip.enabled = true;
+            icon.color = ACTIVE_COLOR;
             text.color = ACTIVE_COLOR;
             hotkeyText.color = ACTIVE_COLOR;
         }


Fix typo

Fix typo

--- BTCPayServer/Views/Wallets/WalletRescan.cshtml
+++ BTCPayServer/Views/Wallets/WalletRescan.cshtml
@@ -33,7 +33,7 @@
             }
             else
             {
-
 This full node do not support rescan of the UTXO set

+
 This full node does not support rescan of the UTXO set

             }


- Certain operations now throw BookNotFound exceptions when a book not in the library is used as     a parameter

--- Bookling/Bookling.Controller/LibraryManager.cs
+++ Bookling/Bookling.Controller/LibraryManager.cs
@@ -209,7 +209,9 @@
 					command.Parameters.AddWithValue (":genre", book.Genre);
 					command.Parameters.AddWithValue (":year", book.YearPublished);
 					command.Parameters.AddWithValue (":path", book.FilePath);
-					command.ExecuteNonQuery ();
+					if (command.ExecuteNonQuery () == 0) {
+						throw new BookNotFoundException ();
+					}
 				}
 			} catch (SqliteException e) {
 				throw new SqliteException (e.Message);
@@ -222,8 +224,9 @@
 				using (SqliteCommand command = new SqliteCommand (Connection)) {
 					command.CommandText = "DELETE FROM Books WHERE BookID = :id;";
 					command.Parameters.AddWithValue (":id", bookID);
-					command.ExecuteNonQuery ();
-
+					if (command.ExecuteNonQuery () == 0) {
+						throw new BookNotFoundException ();
+					}
 				}
 			} catch (SqliteException e) {
 				throw new SqliteException (e.Message);
@@ -248,7 +251,9 @@
 					command.Parameters.AddWithValue (":year", book.YearPublished);
 					command.Parameters.AddWithValue (":path", book.FilePath);
 					command.Parameters.AddWithValue (":id", bookID);
-					command.ExecuteNonQuery ();
+					if (command.ExecuteNonQuery () == 0) {
+						throw new BookNotFoundException ();
+					}
 				}
 			} catch (SqliteException e) {
 				throw new SqliteException (e.Message);