Scaled pickup strength and grace

Scaled pickup strength and grace

--- ViveGrip/Scripts/Grabber.cs
+++ ViveGrip/Scripts/Grabber.cs
@@ -67,37 +67,12 @@
   void Connect(ConfigurableJoint joint, Rigidbody desiredObject) {
     joint.connectedBody = desiredObject;
     joint.connectedBody.useGravity = false;
-
-
-    // Vector3 debugVector = LocalAnchorPositionFor(joint);
-    // debugVector.Normalize();
-    // float debugScalar = WorldAnchorPositionFor(joint).z - joint.connectedBody.transform.position.z;
-    // Vector3 localDifference = -debugVector * debugScalar;
-    // joint.targetPosition = localDifference;
-    //---
-    // Vector3 debugScalars = WorldAnchorPositionFor(joint) - joint.connectedBody.transform.position;
-    // debugScalars.Normalize();
-    // // Vector3 localDifference = -Vector3.Scale(debugVector, debugScalars);
-    // joint.targetPosition = debugScalars;//localDifference;
-    // ---
-    // joint.targetPosition = Vector3.zero;//WorldAnchorPositionFor(joint) - joint.connectedBody.transform.position;
-    // Vector3 debugScalars = (LocalAnchorPositionFor(joint) - transform.position) - joint.connectedBody.transform.position;
-
-
     Vector3 moveMe = joint.connectedAnchor - desiredObject.transform.position;
-    //joint.anchor += WorldAnchorPositionFor(joint) - joint.connectedBody.transform.position;
-    //LocalAnchorPositionFor(joint) - transform.TransformVector(joint.connectedBody.transform.position);
-    // Debug.Log(jointObject.transform.position + " // " + transform.TransformVector(moveMe));
-    //Debug.Log(transform.position + " + " + moveMe);
     Debug.DrawLine(joint.connectedAnchor, desiredObject.transform.position, Color.red, 20, false);
     Vector3 realAnchor = transform.position + transform.TransformVector(defaultAnchor);
     Debug.DrawLine(realAnchor, desiredObject.transform.position, Color.yellow, 20, false);
     jointObject.transform.position += realAnchor - desiredObject.transform.position;
-    //jointObject.transform.position += moveMe;
-    //Debug.Log(jointObject.transform.position);
-    Debug.Log("Connected to " + desiredObject.gameObject.name);
-    // Debug.Log(LocalAnchorPositionFor(joint) + " l//w " + WorldAnchorPositionFor(joint) + " <-- " + transform.TransformVector(joint.connectedBody.transform.position) + " l//w " + joint.connectedBody.transform.position);
-    // Debug.Log(joint.targetPosition);
+    SetJointDrive(joint, joint.connectedBody.mass); // TODO: simplify but stay safe?
   }

   void Disconnect(ConfigurableJoint joint) {
@@ -105,11 +80,9 @@
     Debug.Log(joint.connectedBody);
     joint.connectedBody.useGravity = true;
     joint.connectedBody = null;
-    joint.targetPosition = Vector3.zero; // TODO: needed?
     joint.anchor = defaultAnchor;
     anchored = false;
     jointObject.transform.position = transform.position;
-    Debug.Log("Disconnected");
   }

   Vector3 WorldAnchorPositionFor(ConfigurableJoint joint) {
@@ -126,10 +99,6 @@
     jointObject.transform.localPosition = Vector3.zero;
     jointObject.transform.localScale = Vector3.one;
     ConfigurableJoint joint = jointObject.AddComponent<ConfigurableJoint>();
-
-    // ConfigurableJoint joint = gameObject.AddComponent<ConfigurableJoint>();
-    // GetComponent<Rigidbody>().useGravity = false;
-    // GetComponent<Rigidbody>().isKinematic = true;
     jointObject.GetComponent<Rigidbody>().useGravity = false;
     jointObject.GetComponent<Rigidbody>().isKinematic = true;
     joint.xMotion = ConfigurableJointMotion.Limited;
@@ -145,9 +114,12 @@
     jointLimit.limit = 10;
     joint.linearLimit = jointLimit;

-    float quiteStrong = 50000f; // TODO: the higher the better but Mathf.Infinity breaks it...
-    // TODO: scale this to mass? 500*mass
-    float somewhatSignificant = 1f;
+    return joint;
+  }
+
+  void SetJointDrive(ConfigurableJoint joint, float mass) {
+    float quiteStrong = 3000f * mass; // TODO: the higher the better but Mathf.Infinity breaks it...
+    float somewhatSignificant = 10f * mass;
     JointDrive jointDrive = joint.xDrive;
     jointDrive.positionSpring = quiteStrong;
     jointDrive.positionDamper = somewhatSignificant;
@@ -160,8 +132,6 @@
     jointDrive.positionSpring = quiteStrong;
     jointDrive.positionDamper = somewhatSignificant;
     joint.zDrive = jointDrive;
-
-    return joint;
   }

   GameObject InstantiateGrabberObjectOn(ConfigurableJoint joint) {


Use a longer reflector name

Use a longer reflector name

--- Enigma/Enigma/MachineSetup.xaml.cs
+++ Enigma/Enigma/MachineSetup.xaml.cs
@@ -76,7 +76,7 @@
             this.RingSettings = new int[4] { 0, 0, 0, 0 };
             this.RotorPositions = new int[4] { 0, 0, 0, 0 };
             this.PlugboardSettings = new string[10] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty };
-            this.ReflectorData = new ReflectorData("B", "YRUHQSLDPXNGOKMIEBFZCWVJAT");
+            this.ReflectorData = new ReflectorData("Reflector B", "YRUHQSLDPXNGOKMIEBFZCWVJAT");
             this.RotorData = new RotorData[4]
             {
                 new RotorData("Beta", "LEYJVCNIXWPBQMDRTAKZGFUHOS", string.Empty),


Ajout de commantaires

Ajout de commantaires

--- Enigmas/CliqueRapideEnigmaPanel.cs
+++ Enigmas/CliqueRapideEnigmaPanel.cs
@@ -6,6 +6,7 @@
 {
     class CliqueRapideEnigmaPanel : EnigmaPanel
     {
+        //Déclaration des objets et des variables
         private Button btnACliquer = new Button();
         private Timer timer = new Timer();
         private Label lblNbClique = new Label();
@@ -102,6 +103,8 @@
         {
             iComptClique++;
             lblNbClique.Text = "Nombre de clique : " + Convert.ToString(iComptClique);
+
+            //Affichage du message en fonction des nombres de clique
             if(bVert == true)
             {
                 timer.Stop();
@@ -125,11 +128,14 @@
                 {
                     MessageBox.Show("Bravo vous avez enfin gagné !\nDésolé mais vous n'êtes pas très bon...\n\nLa réponse est : Flash", "Bravo !", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
+
+                //Affiche la reponse et bloque le bouton
                 btnACliquer.Enabled = false;
                 btnACliquer.Text = "La réponse est : Flash";
             }
             else
             {
+                //remise a zero du temp lorsque l'utilisateur appuie sur le bouton rouge
                 iComptSec = 0;
             }
         }


Give some more sensible default column widths

Fixes #91

--- Espera/Espera.View/ViewSettings.cs
+++ Espera/Espera.View/ViewSettings.cs
@@ -42,19 +42,19 @@

         public int LocalDurationColumnWidth
         {
-            get { return this.GetOrCreate(100); }
+            get { return this.GetOrCreate(75); }
             set { this.SetOrCreate(value); }
         }

         public int LocalGenreColumnWidth
         {
-            get { return this.GetOrCreate(100); }
+            get { return this.GetOrCreate(200); }
             set { this.SetOrCreate(value); }
         }

         public int LocalTitleColumnWidth
         {
-            get { return this.GetOrCreate(100); }
+            get { return this.GetOrCreate(400); }
             set { this.SetOrCreate(value); }
         }

@@ -72,25 +72,25 @@

         public int YoutubeDurationColumnWidth
         {
-            get { return this.GetOrCreate(100); }
+            get { return this.GetOrCreate(75); }
             set { this.SetOrCreate(value); }
         }

         public int YoutubeLinkColumnWidth
         {
-            get { return this.GetOrCreate(100); }
+            get { return this.GetOrCreate(200); }
             set { this.SetOrCreate(value); }
         }

         public int YoutubeRatingColumnWidth
         {
-            get { return this.GetOrCreate(100); }
+            get { return this.GetOrCreate(75); }
             set { this.SetOrCreate(value); }
         }

         public int YoutubeTitleColumnWidth
         {
-            get { return this.GetOrCreate(100); }
+            get { return this.GetOrCreate(200); }
             set { this.SetOrCreate(value); }
         }


change build errors to show up at the end rather than at the top. (#31214)

--- src/VisualStudio/Core/Def/Implementation/TableDataSource/VisualStudioBaseDiagnosticListTable.LiveTableDataSource.cs
+++ src/VisualStudio/Core/Def/Implementation/TableDataSource/VisualStudioBaseDiagnosticListTable.LiveTableDataSource.cs
@@ -391,8 +391,23 @@
                     switch (value)
                     {
                         case WellKnownDiagnosticTags.Build:
-                            // any error from build is highest priority
-                            return ErrorRank.Lexical;
+                            // any error from build gets lowest priority
+                            // see https://github.com/dotnet/roslyn/issues/28807
+                            //
+                            // this is only used when intellisense (live) errors are involved.
+                            // with "build only" filter on, we use order of errors came in from build for ordering
+                            // and doesn't use ErrorRank for ordering (by giving same rank for all errors)
+                            //
+                            // when live errors are involved, by default, error list will use the following to sort errors
+                            // error rank > project rank > project name > file name > line > column
+                            // which will basically make syntax errors show up before declaration error and method body semantic errors
+                            // among same type of errors, leaf project's error will show up first and then projects that depends on the leaf projects
+                            //
+                            // any build errors mixed with live errors will show up at the end. when live errors are on, some of errors
+                            // still left as build errors such as errors produced after CompilationStages.Compile or ones listed here
+                            // http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp/Compilation/CSharpCompilerDiagnosticAnalyzer.cs,23 or similar ones for VB
+                            // and etc.
+                            return ErrorRank.PostBuild;
                         case nameof(ErrorRank.Lexical):
                             return ErrorRank.Lexical;
                         case nameof(ErrorRank.Syntactic):


ProjectX:
Fixes to UTCNameMangler for 1K/pntestcl

1K tests are special when it comes to symbol linkage. External symbols are resolved by names instead of by ordinals. The change fixes two issues for 1K

1. Do not allow comma in symbol names. For MD arrays, “[md<rank>]” is used instead.

2. Do not prepend a module prefix to symbol names when building pntestcl since the prefix is unknown when building an app against pntestcl.

[tfs-changeset: 1691787]

--- src/ILCompiler.Compiler/src/Compiler/UtcNameMangler.cs
+++ src/ILCompiler.Compiler/src/Compiler/UtcNameMangler.cs
@@ -44,13 +44,15 @@

         private bool HasImport { get; set; }
         private bool HasExport { get; set; }
-
-        public UTCNameMangler(bool hasImport, bool hasExport, ImportExportOrdinals ordinals, TypeSystemContext context, List<EcmaModule> inputModules) : base(new UtcNodeMangler())
+        private bool BuildingClassLib { get; }
+
+        public UTCNameMangler(bool hasImport, bool hasExport, ImportExportOrdinals ordinals, TypeSystemContext context, List<EcmaModule> inputModules, bool buildingClassLib) : base(new UtcNodeMangler())
         {
             // Do not support both imports and exports for one module
             Debug.Assert(!hasImport || !hasExport);
             HasImport = hasImport;
             HasExport = hasExport;
+            BuildingClassLib = buildingClassLib;

             if (hasImport)
             {
@@ -185,7 +187,7 @@

                 if (sb != null)
                 {
-                    if (c == '[' || c == ']' || c == ',' || c == '&' || c == '*' || c == '$' || c == '<' || c == '>')
+                    if (c == '[' || c == ']' || c == '&' || c == '*' || c == '$' || c == '<' || c == '>')
                     {
                         sb.Append(c);
                         continue;
@@ -298,9 +300,14 @@

         private string ComputeMangledModuleName(EcmaAssembly module)
         {
-            int index;
-            if (_inputModuleIndices.TryGetValue(module, out index))
-                return "$" + index;
+            // Do not prepend the module prefix when building pntestcl because the prefix is unknown
+            // when building an app against pntestcl.
+            if (!BuildingClassLib)
+            {
+                int index;
+                if (_inputModuleIndices.TryGetValue(module, out index))
+                    return "$" + index;
+            }

             return SanitizeName(module.GetName().Name);
         }
@@ -373,7 +380,7 @@

                     if (type.IsMdArray)
                     {
-                        mangledName += "[" + new string(',', ((ArrayType)type).Rank) + "]";
+                        mangledName += "[md" + ((ArrayType)type).Rank.ToString() + "]";
                     }
                     else
                     {


Add a comment explaining the limitation of the ruleset detection (#589)

--- src/Integration/MefServices/ProjectsRuleSetProvider.cs
+++ src/Integration/MefServices/ProjectsRuleSetProvider.cs
@@ -184,6 +184,10 @@
                     p.FullName.Equals(fileChangeTracker.FilePath, StringComparison.OrdinalIgnoreCase));
                 if (project != null)
                 {
+                    // TODO: We only try to access the global CodeAnalysisRuleSet not a configuration specific. When we will handle
+                    // this we should be careful to subscribe to configuration change in the IDE to re-build the cache.
+                    // Note that handling the configuration specific will still not handle all cases where we could see/find a
+                    // ruleset (for example we could have a condition on some file existing...)
                     var projectRuleSetPath = projectSystemHelper.GetProjectProperty(project, Constants.CodeAnalysisRuleSetPropertyKey);
                     var projectDirectoryFullPath = new FileInfo(project.FullName).Directory.FullName;
                     var projectRuleSetFullPath = GetFullPath(projectRuleSetPath, projectDirectoryFullPath);


fix 2D demo (thanks Tan Meng Hui)

fix 2D demo (thanks Tan Meng Hui)

--- Examples/Classify2DDemo/Program.cs
+++ Examples/Classify2DDemo/Program.cs
@@ -56,7 +56,7 @@
             } while (!Console.KeyAvailable);

             // Testing
-            var netx = new Volume(1, 1, 1);
+            var netx = new Volume(1, 1, 2);
             for (var ix = 0; ix < n; ix++)
             {
                 netx.Weights = data[ix];
@@ -68,7 +68,7 @@

         private static void Classify2DUpdate(int n, List<double[]> data, TrainerBase trainer, List<int> labels)
         {
-            var netx = new Volume(1, 1, 1);
+            var netx = new Volume(1, 1, 2);
             var avloss = 0.0;

             for (var iters = 0; iters < 50; iters++)


Remove MIT license header

Remove MIT license header

--- WinFormTemplate/FormMain.cs
+++ WinFormTemplate/FormMain.cs
@@ -1,22 +1,3 @@
-/*
-The MIT License(MIT)
-Copyright(c) 2015 Freddy Juhel
-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
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
 #define DEBUG
 using System;
 using System.Collections.Generic;


Added missing guard clause to SimpleQueryParser.DefaultOperator.

--- src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs
+++ src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs
@@ -721,8 +721,18 @@
         /// </summary>
         public virtual BooleanClause.Occur DefaultOperator
         {
-            get { return defaultOperator; }
-            set { defaultOperator = value; }
+            get
+            {
+                return defaultOperator;
+            }
+            set
+            {
+                if (value != BooleanClause.Occur.SHOULD && value != BooleanClause.Occur.MUST)
+                {
+                    throw new ArgumentException("invalid operator: only SHOULD or MUST are allowed");
+                }
+                defaultOperator = value;
+            }
         }


typo: continous -> continuous

typo: continous -> continuous

--- src/Markdig/Extensions/Mathematics/MathInlineParser.cs
+++ src/Markdig/Extensions/Mathematics/MathInlineParser.cs
@@ -1,5 +1,5 @@
 // Copyright (c) Alexandre Mutel. All rights reserved.
-// This file is licensed under the BSD-Clause 2 license.
+// This file is licensed under the BSD-Clause 2 license.
 // See the license.txt file in the project root for more information.

 using Markdig.Helpers;
@@ -57,7 +57,7 @@
             bool openNextIsDigit = c.IsDigit();
             pc.CheckUnicodeCategory(out openPrevIsWhiteSpace, out openPrevIsPunctuation);
             c.CheckUnicodeCategory(out openNextIsWhiteSpace, out openNextIsPunctuation);
-
+
             // Check that opening $/$$ is correct, using the different heuristics than for emphasis delimiters
             // If a $/$$ is not preceded by a whitespace or punctuation, or followed by a digit
             // this is a not a math block
@@ -91,7 +91,7 @@
                 // Don't process sticks if we have a '\' as a previous char
                 if (pc != '\\' )
                 {
-                    // Record continous whitespaces at the end
+                    // Record continuous whitespaces at the end
                     if (c.IsSpaceOrTab())
                     {
                         if (lastWhiteSpace < 0)
@@ -146,7 +146,7 @@
                 c.CheckUnicodeCategory(out closeNextIsWhiteSpace, out closeNextIsPunctuation);

                 // A closing $/$$ should be followed by at least a punctuation or a whitespace
-                // and if the character after an openning $/$$ was a whitespace, it should be
+                // and if the character after an openning $/$$ was a whitespace, it should be
                 // a whitespace as well for the character preceding the closing of $/$$
                 if ((!closeNextIsPunctuation && !closeNextIsWhiteSpace) || (openNextIsWhiteSpace != closePrevIsWhiteSpace))
                 {


fix: do not overwrite store when serving a request from it #55

--- src/Marvin.Cache.Headers/HttpCacheHeadersMiddleware.cs
+++ src/Marvin.Cache.Headers/HttpCacheHeadersMiddleware.cs
@@ -456,9 +456,6 @@
                 headers[HeaderNames.ETag] = savedResponse.ETag.ToString();
             }

-            // store (overwrite)
-            await _store.SetAsync(storeKey, new ValidationValue(eTag, lastModified));
-
             var logInformation = string.Empty;
             if (eTag != null)
             {


Fix: Activation of GatewatProviders

Fix: Activation of GatewatProviders

--- src/Merchello.Core/Gateways/GatewayProviderResolver.cs
+++ src/Merchello.Core/Gateways/GatewayProviderResolver.cs
@@ -74,10 +74,22 @@
         {
             get
             {
-                var factory = new Persistence.Factories.GatewayProviderSettingsFactory();
-                return InstanceTypes.Select(type => factory.BuildEntity(type, GetGatewayProviderType(type)))
-                    .Select(CreateInstance).Where(attempt => attempt.Success)
-                    .Select(x => x.Result).ToList();
+				var factory = new Persistence.Factories.GatewayProviderSettingsFactory();
+				var allResolved = new List<GatewayProviderBase>();
+
+				allResolved.AddRange(GetActivatedProviders());
+
+				var inactive = InstanceTypes.Select(type => factory.BuildEntity(type, GetGatewayProviderType(type))).Where(a => !allResolved.Any(b => b.Key == a.Key)).Select(CreateInstance).Where(attempt => attempt.Success)
+					.Select(x => x.Result);
+
+				allResolved.AddRange(inactive);
+
+				return allResolved;
+
+
+                //return InstanceTypes.Select(type => factory.BuildEntity(type, GetGatewayProviderType(type)))
+                //    .Select(CreateInstance).Where(attempt => attempt.Success)
+                //    .Select(x => x.Result).ToList();
             }
         }


Tidied up the Write() overloads

Tidied up the Write() overloads

svn path=/trunk/bitsharp/; revision=94634

--- src/MonoTorrent/MonoTorrent.Client/Messages/Message.cs
+++ src/MonoTorrent/MonoTorrent.Client/Messages/Message.cs
@@ -57,10 +57,10 @@
             return 1;
         }

-        static protected int Write(byte[] buffer, int offset, byte[] value)
+        static protected int Write(byte[] buffer, int offset, byte[] value, int valueOffset, int count)
         {
-            Buffer.BlockCopy(value, 0, buffer, offset, value.Length);
-            return value.Length;
+            Buffer.BlockCopy(value, valueOffset, buffer, offset, count);
+            return count;
         }

         static protected int Write(byte[] buffer, int offset, ushort value)
@@ -68,18 +68,18 @@
             return Write(buffer, offset, (short)value);
         }

+        private static int Write(byte[] buffer, int offset, byte[] value)
+        {
+            return Write(buffer, offset, value, 0, value.Length);
+        }
         static protected int Write(byte[] buffer, int offset, short value)
         {
-            byte[] temp = BitConverter.GetBytes(IPAddress.HostToNetworkOrder(value));
-            Buffer.BlockCopy(temp, 0, buffer, offset, temp.Length);
-            return temp.Length;
+            return Write(buffer, offset, BitConverter.GetBytes(IPAddress.HostToNetworkOrder(value)));
         }

         static protected int Write(byte[] buffer, int offset, int value)
         {
-            byte[] temp = BitConverter.GetBytes(IPAddress.HostToNetworkOrder(value));
-            Buffer.BlockCopy(temp, 0, buffer, offset, temp.Length);
-            return temp.Length;
+            return Write(buffer, offset, BitConverter.GetBytes(IPAddress.HostToNetworkOrder(value)));
         }

         static protected int Write(byte[] buffer, int offset, uint value)
@@ -89,9 +89,7 @@

         static protected int Write(byte[] buffer, int offset, long value)
         {
-            byte[] temp = BitConverter.GetBytes(IPAddress.HostToNetworkOrder(value));
-            Buffer.BlockCopy(temp, 0, buffer, offset, temp.Length);
-            return temp.Length;
+            return Write(buffer, offset, BitConverter.GetBytes(IPAddress.HostToNetworkOrder(value)));
         }

         static protected int Write(byte[] buffer, int offset, ulong value)


#900 Switching to Liquid's standard Ruby-like filter naming convertions

--- src/Nancy.ViewEngines.DotLiquid/DotLiquidViewEngine.cs
+++ src/Nancy.ViewEngines.DotLiquid/DotLiquidViewEngine.cs
@@ -52,7 +52,7 @@
         public void Initialize(ViewEngineStartupContext viewEngineStartupContext)
         {
             Template.FileSystem = this.fileSystemFactory.GetFileSystem(viewEngineStartupContext, this.Extensions);
-            Template.NamingConvention = new CSharpNamingConvention();
+            Template.NamingConvention = new RubyNamingConvention();
         }

         /// <summary>


use LoadFrom instead of LoadFile

use LoadFrom instead of LoadFile

--- src/OmniSharp.Abstractions/Services/IAssemblyLoader.cs
+++ src/OmniSharp.Abstractions/Services/IAssemblyLoader.cs
@@ -44,7 +44,7 @@
         {
             if (File.Exists(assemblyName))
             {
-                return Assembly.LoadFile(assemblyName);
+                return Assembly.LoadFrom(assemblyName);
             }
             else
             {


Fix Triangulator test

Fix Triangulator test

--- src/OpenSage.Game.Tests/Utilities/TriangulatorTests.cs
+++ src/OpenSage.Game.Tests/Utilities/TriangulatorTests.cs
@@ -17,16 +17,27 @@
                 new Vector2(1536, 968)
             };

-            Assert.True(Triangulator.Process(polygonPoints, out var trianglePoints));
+            Triangulator.Triangulate(
+                polygonPoints,
+                WindingOrder.CounterClockwise,
+                out var trianglePoints,
+                out var triangleIndices);

-            Assert.Equal(6, trianglePoints.Count);
+            Assert.Equal(4, trianglePoints.Length);

-            Assert.Equal(new Vector2(1536, 968), trianglePoints[0]);
-            Assert.Equal(new Vector2(-22, 577), trianglePoints[1]);
-            Assert.Equal(new Vector2(-20, -694), trianglePoints[2]);
-            Assert.Equal(new Vector2(-20, -694), trianglePoints[3]);
-            Assert.Equal(new Vector2(1513, -696), trianglePoints[4]);
-            Assert.Equal(new Vector2(1536, 968), trianglePoints[5]);
+            Assert.Equal(new Vector2(-22, 577), trianglePoints[0]);
+            Assert.Equal(new Vector2(-20, -694), trianglePoints[1]);
+            Assert.Equal(new Vector2(1513, -696), trianglePoints[2]);
+            Assert.Equal(new Vector2(1536, 968), trianglePoints[3]);
+
+            Assert.Equal(6, triangleIndices.Length);
+
+            Assert.Equal(0, triangleIndices[0]);
+            Assert.Equal(1, triangleIndices[1]);
+            Assert.Equal(3, triangleIndices[2]);
+            Assert.Equal(1, triangleIndices[3]);
+            Assert.Equal(2, triangleIndices[4]);
+            Assert.Equal(3, triangleIndices[5]);
         }
     }
 }


generators fix, using IVariableReference

--- src/Peachpie.CodeAnalysis/CodeGen/VariableReference.cs
+++ src/Peachpie.CodeAnalysis/CodeGen/VariableReference.cs
@@ -1013,7 +1013,10 @@

         public override void EmitInit(CodeGenerator cg)
         {
-            //
+            if (cg.InitializedLocals)
+            {
+                return;
+            }

             var srcparam = Symbol as SourceParameterSymbol;
             if (srcparam == null)


Useful comment

Useful comment

--- Facepunch.Steamworks/Client/App.cs
+++ Facepunch.Steamworks/Client/App.cs
@@ -57,8 +57,8 @@
         }

         /// <summary>
-        /// Returns true if this user is subscribed to the specific appid
-        /// ie. If the user owns this game specified.
+        /// Checks if the active user is subscribed to a specified AppId.
+        /// Only use this if you need to check ownership of another game related to yours, a demo for example.
         /// </summary>
         public bool IsSubscribed(uint appId)
         {


Remove uint from InitFilterText call FilterText now returns the filtered string instead of the number of filtered characters

--- Facepunch.Steamworks/SteamUtils.cs
+++ Facepunch.Steamworks/SteamUtils.cs
@@ -266,15 +266,16 @@
 		/// Initializes text filtering, loading dictionaries for the language the game is running in.
 		/// Users can customize the text filter behavior in their Steam Account preferences
 		/// </summary>
-		public static bool InitFilterText( uint unFilterOptions ) => Internal.InitFilterText( unFilterOptions );
+		public static bool InitFilterText() => Internal.InitFilterText( 0 );

 		/// <summary>
 		/// Filters the provided input message and places the filtered result into pchOutFilteredText,
 		/// using legally required filtering and additional filtering based on the context and user settings.
 		/// </summary>
-		public int FilterText( TextFilteringContext eContext, SteamId sourceSteamID, string pchInputMessage, out string pchOutFilteredText )
-		{
-			return Internal.FilterText( eContext, sourceSteamID, pchInputMessage, out pchOutFilteredText );
+		public string FilterText( TextFilteringContext context, SteamId sourceSteamID, string inputMessage )
+		{
+			Internal.FilterText( context, sourceSteamID, inputMessage, out var filteredString );
+			return filteredString;
 		}
 	}
 }


Remove dead synchronous code.

Remove dead synchronous code.

--- src/SJP.Schematic.Sqlite/SqliteDatabaseViewProvider.cs
+++ src/SJP.Schematic.Sqlite/SqliteDatabaseViewProvider.cs
@@ -259,17 +259,6 @@
             return result.AsReadOnly();
         }

-        protected virtual string GetTypeofColumn(Identifier viewName, Identifier columnName)
-        {
-            if (viewName == null)
-                throw new ArgumentNullException(nameof(viewName));
-            if (columnName == null)
-                throw new ArgumentNullException(nameof(columnName));
-
-            var sql = GetTypeofQuery(viewName, columnName.LocalName);
-            return Connection.ExecuteScalar<string>(sql);
-        }
-
         protected virtual Task<string> GetTypeofColumnAsync(Identifier viewName, Identifier columnName, CancellationToken cancellationToken)
         {
             if (viewName == null)


Removed class inherit

Removed class inherit

--- Fatec.Treinamento.Model/Assunto.cs
+++ Fatec.Treinamento.Model/Assunto.cs
@@ -7,7 +7,7 @@

 namespace Fatec.Treinamento.Model
 {
-    public class Assunto : AssuntoCursoUsuario
+    public class Assunto
     {
         public int Id { get; set; }
         public string Nome { get; set; }


Make JsonSerializerSettings static

Make JsonSerializerSettings static

--- src/ServiceBusExplorer/Helpers/JsonSerializerHelper.cs
+++ src/ServiceBusExplorer/Helpers/JsonSerializerHelper.cs
@@ -32,6 +32,8 @@
 {
     public static class JsonSerializerHelper
     {
+        static readonly JsonSerializerSettings serializerSettings = new JsonSerializerSettings { DateParseHandling = DateParseHandling.None };
+
         /// <summary>
         /// Indent the supplied json string
         /// </summary>
@@ -41,9 +43,8 @@
         {
             try
             {
-                var settings = new JsonSerializerSettings { DateParseHandling = DateParseHandling.None };
                 return JsonConvert
-                    .SerializeObject(JsonConvert.DeserializeObject(json.Replace("$type", "%%$type%%"), settings), Formatting.Indented)
+                    .SerializeObject(JsonConvert.DeserializeObject(json.Replace("$type", "%%$type%%"), serializerSettings), Formatting.Indented)
                     .Replace("%%$type%%", "$type");
             }
             catch (Exception)


Bugfix: recurse

Bugfix: recurse

--- Fhir.Publication/Framework/Work.cs
+++ Fhir.Publication/Framework/Work.cs
@@ -46,6 +46,7 @@
             work.context = context;
             work.ToExt = toExt;
             work.Action = action;
+            work.Recurse = recurse;

             return work;
         }


Disable all PEVerification until #6190 is resolved

--- src/Test/Utilities/Desktop/HostedRuntimeEnvironment.cs
+++ src/Test/Utilities/Desktop/HostedRuntimeEnvironment.cs
@@ -799,7 +799,9 @@
             // for ARM testing at present.
             StringBuilder errors = new StringBuilder();
             List<string> allOutput = new List<string>();
-#if !(ARM)
+
+// Disable all PEVerification due to https://github.com/dotnet/roslyn/issues/6190
+#if false

             foreach (var name in modulesToVerify)
             {


Fix message template to not mix string interpolating and formatting.

--- src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs
+++ src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs
@@ -717,7 +717,7 @@
                     previousNode = null; // there is no previous sibling
                 }

-                _logger.Debug<ContentStore>($"Set {thisNode.Id} with parent {thisNode.ParentContentId}");
+                _logger.Debug<ContentStore>("Set {Id} with parent {ParentContentId}", thisNode.Id, thisNode.ParentContentId);
                 SetValueLocked(_contentNodes, thisNode.Id, thisNode);

                 // if we are initializing from the database source ensure the local db is updated


version

version

--- Forum3/Views/Shared/_Footer.cshtml
+++ Forum3/Views/Shared/_Footer.cshtml
@@ -3,7 +3,7 @@
 }

-
Theme 12 | Code 3.0.1

+
Theme 12 | Code 3.0.2

Bringing disorder to chaos for @siteAge years.


Use a pool that doesn't leak memory in highly concurrent scenarios.

--- src/Workspaces/Core/Portable/Utilities/EditDistance.cs
+++ src/Workspaces/Core/Portable/Utilities/EditDistance.cs
@@ -110,7 +110,7 @@
         }

         private const int MaxMatrixPoolDimension = 64;
-        private static readonly ObjectPool<int[,]> s_matrixPool = new ObjectPool<int[,]>(() => InitializeMatrix(new int[64, 64]));
+        private static readonly SimplePool<int[,]> s_matrixPool = new SimplePool<int[,]>(() => InitializeMatrix(new int[64, 64]));

         private static int[,] GetMatrix(int width, int height)
         {
@@ -182,7 +182,7 @@
                 : GetEditDistanceWorker(target, source, threshold);
         }

-        private static ObjectPool<Dictionary<char, int>> s_dictionaryPool = new ObjectPool<Dictionary<char, int>>(() => new Dictionary<char, int>());
+        private static SimplePool<Dictionary<char, int>> s_dictionaryPool = new SimplePool<Dictionary<char, int>>(() => new Dictionary<char, int>());

         private static int GetEditDistanceWorker(ArraySlice<char> source, ArraySlice<char> target, int threshold)
         {
@@ -624,6 +624,65 @@
         }
     }

+    internal class SimplePool<T> where T : class
+    {
+        private readonly object _gate = new object();
+        private readonly List<T> _values = new List<T>();
+        private readonly Func<T> _allocate;
+
+        public SimplePool(Func<T> allocate)
+        {
+            _allocate = allocate;
+        }
+
+        public T Allocate()
+        {
+            lock (_gate)
+            {
+                for (int i = 0, n = _values.Count; i < n; i++)
+                {
+                    var matrix = _values[i];
+                    if (matrix != null)
+                    {
+                        _values[i] = null;
+                        return matrix;
+                    }
+                }
+
+                return _allocate();
+            }
+        }
+
+        public void Free(T value)
+        {
+            lock (_gate)
+            {
+                for (int i = 0, n = _values.Count; i < n; i++)
+                {
+                    if (_values[i] == null)
+                    {
+                        _values[i] = value;
+                        return;
+                    }
+                }
+
+                _values.Add(value);
+            }
+        }
+    }
+
+    internal static class SimplePoolExtensions
+    {
+        public static Dictionary<TKey, TValue> AllocateAndClear<TKey, TValue>(
+            this SimplePool<Dictionary<TKey, TValue>> pool)
+        {
+            var map = pool.Allocate();
+            map.Clear();
+
+            return map;
+        }
+    }
+
     internal static class ArrayPool<T>
     {
         private const int MaxPooledArraySize = 256;
@@ -631,7 +690,7 @@
         // Keep around a few arrays of size 256 that we can use for operations without
         // causing lots of garbage to be created.  If we do compare items larger than
         // that, then we will just allocate and release those arrays on demand.
-        private static ObjectPool<T[]> s_pool = new ObjectPool<T[]>(() => new T[MaxPooledArraySize]);
+        private static SimplePool<T[]> s_pool = new SimplePool<T[]>(() => new T[MaxPooledArraySize]);

         public static T[] GetArray(int size)
         {


Fix OnMainThread error in build

Fix OnMainThread error in build


Completed World Rule Givens

Completed World Rule Givens

World Rule "givens" completed. CreateNeighborList method extracted to
create a list of a specified number of neighbors for a given cell.

--- GameOfLifeTests/WorldRulesSteps.cs
+++ GameOfLifeTests/WorldRulesSteps.cs
@@ -13,51 +13,45 @@
       [Given(@"a world with a live cell")]
       public void GivenAWorldWithALiveCell()
       {
-         _world = new World(new[] {new Cell(1, 1, true)});
+         _world = new World(new[] { new Cell(1, 1, true) });
       }

       [Given(@"the cell has less than (.*) live neighbors")]
-      public void GivenTheCellHasLessThanLiveNeighbors(int liveNeighborUpperBound)
+      public void GivenTheCellHasLessThanLiveNeighbors(int liveNeighborExclusiveUpperBound)
       {
          var cell = _world.Cells.Single();
-
-         var neighbors = new List<Cell>(liveNeighborUpperBound);
-
-         for (int y = cell.Y - 1; y <= cell.Y + 1; ++y)
-         {
-            for (int x = cell.X - 1, ndx = 0;
-               x <= cell.X + 1 && ndx < liveNeighborUpperBound;
-               ++x, ++ndx)
-            {
-               neighbors.Add(new Cell(x, y, true));
-            }
-         }
-
+         var neighbors = CreateNeighborList(cell, liveNeighborExclusiveUpperBound - 1);
          _world = _world.WithCells(neighbors);
       }

       [Given(@"the cell has (.*) live neighbors")]
       public void GivenTheCellHasLiveNeighbors(int numberOfLiveNeighbors)
       {
-         ScenarioContext.Current.Pending();
+         var cell = _world.Cells.Single();
+         var neighbors = CreateNeighborList(cell, numberOfLiveNeighbors);
+         _world = _world.WithCells(neighbors);
       }

       [Given(@"the cell has greater than (.*) live neighbors")]
-      public void GivenTheCellHasGreaterThanLiveNeighbors(int liveNeighborLowerBound)
+      public void GivenTheCellHasGreaterThanLiveNeighbors(int liveNeighborExclusiveLowerBound)
       {
-         ScenarioContext.Current.Pending();
+         var cell = _world.Cells.Single();
+         var neighbors = CreateNeighborList(cell, liveNeighborExclusiveLowerBound + 1);
+         _world = _world.WithCells(neighbors);
       }

       [Given(@"a world with a dead cell")]
       public void GivenAWorldWithADeadCell()
       {
-         ScenarioContext.Current.Pending();
+         _world = new World(new [] { new Cell(1, 1, false) });
       }

       [Given(@"the dead cell does not have exactly (.*) live neighbors")]
       public void GivenTheDeadCellDoesNotHaveExactlyLiveNeighbors(int numberOfLiveNeighbors)
       {
-         ScenarioContext.Current.Pending();
+         var cell = _world.Cells.Single();
+         var neighbors = CreateNeighborList(cell, numberOfLiveNeighbors + 1);
+         _world = _world.WithCells(neighbors);
       }

       [When(@"I get the next generation of the world")]
@@ -77,5 +71,22 @@
       {
          ScenarioContext.Current.Pending();
       }
+
+      private static List<Cell> CreateNeighborList(Cell cell, int numberOfNeighbors)
+      {
+         var neighbors = new List<Cell>(numberOfNeighbors);
+
+         for (int y = cell.Y - 1; y <= cell.Y + 1; ++y)
+         {
+            for (int x = cell.X - 1, ndx = 0;
+               x <= cell.X + 1 && ndx < numberOfNeighbors;
+               ++x, ++ndx)
+            {
+               neighbors.Add(new Cell(x, y, true));
+            }
+         }
+
+         return neighbors;
+      }
    }
 }


Assembler: Alphabetically organize instructions

--- GekkoAssembler.Common/Assembler.cs
+++ GekkoAssembler.Common/Assembler.cs
@@ -683,38 +683,20 @@

         private GekkoInstruction ParseInstruction(string line, int instructionPointer)
         {
-            if (line.StartsWith("blr"))
-                return ParseInstructionBLR(line, instructionPointer);
-            if (line.StartsWith("b "))
-                return ParseInstructionB(line, instructionPointer);
-            if (line.StartsWith("bl "))
-                return ParseInstructionBL(line, instructionPointer);
-            if (line.StartsWith("ba "))
-                return ParseInstructionBA(line, instructionPointer);
-            if (line.StartsWith("bla "))
-                return ParseInstructionBLA(line, instructionPointer);
             if (line.StartsWith("addi "))
                 return ParseInstructionADDI(line, instructionPointer);
             if (line.StartsWith("addis "))
                 return ParseInstructionADDIS(line, instructionPointer);
-            if (line.StartsWith("mulli "))
-                return ParseInstructionMULLI(line, instructionPointer);
-            if (line.StartsWith("stw "))
-                return ParseInstructionSTW(line, instructionPointer);
-            if (line.StartsWith("stwu "))
-                return ParseInstructionSTWU(line, instructionPointer);
-            if (line.StartsWith("lwz "))
-                return ParseInstructionLWZ(line, instructionPointer);
-            if (line.StartsWith("lhz "))
-                return ParseInstructionLHZ(line, instructionPointer);
-            if (line.StartsWith("lbz "))
-                return ParseInstructionLBZ(line, instructionPointer);
-            if (line.StartsWith("lis "))
-                return ParseInstructionLIS(line, instructionPointer);
-            if (line.StartsWith("lfs "))
-                return ParseInstructionLFS(line, instructionPointer);
-            if (line.StartsWith("ori "))
-                return ParseInstructionORI(line, instructionPointer);
+            if (line.StartsWith("b "))
+                return ParseInstructionB(line, instructionPointer);
+            if (line.StartsWith("ba "))
+                return ParseInstructionBA(line, instructionPointer);
+            if (line.StartsWith("bl "))
+                return ParseInstructionBL(line, instructionPointer);
+            if (line.StartsWith("bla "))
+                return ParseInstructionBLA(line, instructionPointer);
+            if (line.StartsWith("blr"))
+                return ParseInstructionBLR(line, instructionPointer);
             if (line.StartsWith("crand "))
                 return ParseInstructionCRAND(line, instructionPointer);
             if (line.StartsWith("crandc "))
@@ -739,14 +721,18 @@
                 return ParseInstructionCRSET(line, instructionPointer);
             if (line.StartsWith("crxor "))
                 return ParseInstructionCRXOR(line, instructionPointer);
-            if (line.StartsWith("sub "))
-                return ParseInstructionSUB(line, instructionPointer);
-            if (line.StartsWith("subf "))
-                return ParseInstructionSUBF(line, instructionPointer);
-            if (line.StartsWith("mullw "))
-                return ParseInstructionMULLW(line, instructionPointer);
             if (line.StartsWith("divw "))
                 return ParseInstructionDIVW(line, instructionPointer);
+            if (line.StartsWith("lbz "))
+                return ParseInstructionLBZ(line, instructionPointer);
+            if (line.StartsWith("lfs "))
+                return ParseInstructionLFS(line, instructionPointer);
+            if (line.StartsWith("lhz "))
+                return ParseInstructionLHZ(line, instructionPointer);
+            if (line.StartsWith("lis "))
+                return ParseInstructionLIS(line, instructionPointer);
+            if (line.StartsWith("lwz "))
+                return ParseInstructionLWZ(line, instructionPointer);
             if (line.StartsWith("mflr "))
                 return ParseInstructionMFLR(line, instructionPointer);
             if (line.StartsWith("mfspr "))
@@ -755,30 +741,273 @@
                 return ParseInstructionMTLR(line, instructionPointer);
             if (line.StartsWith("mtspr "))
                 return ParseInstructionMTSPR(line, instructionPointer);
+            if (line.StartsWith("mulli "))
+                return ParseInstructionMULLI(line, instructionPointer);
+            if (line.StartsWith("mullw "))
+                return ParseInstructionMULLW(line, instructionPointer);
             if (line.StartsWith("nop"))
                 return ParseInstructionNOP(line, instructionPointer);
+            if (line.StartsWith("ori "))
+                return ParseInstructionORI(line, instructionPointer);
+            if (line.StartsWith("stw "))
+                return ParseInstructionSTW(line, instructionPointer);
+            if (line.StartsWith("stwu "))
+                return ParseInstructionSTWU(line, instructionPointer);
+            if (line.StartsWith("sub "))
+                return ParseInstructionSUB(line, instructionPointer);
+            if (line.StartsWith("subf "))
+                return ParseInstructionSUBF(line, instructionPointer);

             throw new ArgumentException($"The specified instruction { line } is not supported.");
         }

         #region Gekko Instructions

-        private GekkoInstruction ParseInstructionSUB(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "sub");
+        private GekkoInstruction ParseInstructionADDI(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "addi");
+            var rd = ParseRegister(parameters[0]);
+            var ra = ParseRegister(parameters[1]);
+            var simm = ParseIntegerLiteral(parameters[2]);
+            return new AddImmediateInstruction(instructionPointer, rd, ra, simm);
+        }
+
+        private GekkoInstruction ParseInstructionADDIS(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "addis");
+            var rd = ParseRegister(parameters[0]);
+            var ra = ParseRegister(parameters[1]);
+            var simm = ParseIntegerLiteral(parameters[2]);
+            return new AddImmediateShiftedInstruction(instructionPointer, rd, ra, simm);
+        }
+
+        private GekkoInstruction ParseInstructionB(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "b");
+            var targetAddress = ParseIntegerLiteral(parameters[0]);
+            return new BranchInstruction(instructionPointer, targetAddress, false, false);
+        }
+
+        private GekkoInstruction ParseInstructionBA(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "ba");
+            var targetAddress = ParseIntegerLiteral(parameters[0]);
+            return new BranchInstruction(instructionPointer, targetAddress, true, false);
+        }
+
+        private GekkoInstruction ParseInstructionBL(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "bl");
+            var targetAddress = ParseIntegerLiteral(parameters[0]);
+            return new BranchInstruction(instructionPointer, targetAddress, false, true);
+        }
+
+        private GekkoInstruction ParseInstructionBLA(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "bla");
+            var targetAddress = ParseIntegerLiteral(parameters[0]);
+            return new BranchInstruction(instructionPointer, targetAddress, true, true);
+        }
+
+        private GekkoInstruction ParseInstructionBLR(string line, int instructionPointer)
+        {
+            return new BranchToLinkRegisterInstruction(instructionPointer);
+        }
+
+        private GekkoInstruction ParseInstructionCRAND(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "crand");
+            var crbd = ParseConditionRegister(parameters[0]);
+            var crba = ParseConditionRegister(parameters[1]);
+            var crbb = ParseConditionRegister(parameters[2]);
+            return new ConditionRegisterANDInstruction(instructionPointer, crbd, crba, crbb);
+        }
+
+        private GekkoInstruction ParseInstructionCRANDC(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "crandc");
+            var crbd = ParseConditionRegister(parameters[0]);
+            var crba = ParseConditionRegister(parameters[1]);
+            var crbb = ParseConditionRegister(parameters[2]);
+            return new ConditionRegisterANDComplementInstruction(instructionPointer, crbd, crba, crbb);
+        }
+
+        private GekkoInstruction ParseInstructionCRCLR(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "crclr");
+            var crbd = ParseConditionRegister(parameters[0]);
+            return new ConditionRegisterClearInstruction(instructionPointer, crbd);
+        }
+
+        private GekkoInstruction ParseInstructionCREQV(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "creqv");
+            var crbd = ParseConditionRegister(parameters[0]);
+            var crba = ParseConditionRegister(parameters[1]);
+            var crbb = ParseConditionRegister(parameters[2]);
+            return new ConditionRegisterEquivalentInstruction(instructionPointer, crbd, crba, crbb);
+        }
+
+        // Simplified mnemonic of CROR
+        private GekkoInstruction ParseInstructionCRMOVE(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "crmove");
+            var crbd = ParseConditionRegister(parameters[0]);
+            var crba = ParseConditionRegister(parameters[1]);
+            return new ConditionRegisterORInstruction(instructionPointer, crbd, crba, crba);
+        }
+
+        private GekkoInstruction ParseInstructionCRNAND(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "crnand");
+            var crbd = ParseConditionRegister(parameters[0]);
+            var crba = ParseConditionRegister(parameters[1]);
+            var crbb = ParseConditionRegister(parameters[2]);
+            return new ConditionRegisterNANDInstruction(instructionPointer, crbd, crba, crbb);
+        }
+
+        private GekkoInstruction ParseInstructionCRNOR(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "crnor");
+            var crbd = ParseConditionRegister(parameters[0]);
+            var crba = ParseConditionRegister(parameters[1]);
+            var crbb = ParseConditionRegister(parameters[2]);
+            return new ConditionRegisterNORInstruction(instructionPointer, crbd, crba, crbb);
+        }
+
+        // Simplified mnemonic of CRNOR
+        private GekkoInstruction ParseInstructionCRNOT(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "crnot");
+            var crbd = ParseConditionRegister(parameters[0]);
+            var crba = ParseConditionRegister(parameters[1]);
+            return new ConditionRegisterNORInstruction(instructionPointer, crbd, crba, crba);
+        }
+
+        private GekkoInstruction ParseInstructionCROR(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "cror");
+            var crbd = ParseConditionRegister(parameters[0]);
+            var crba = ParseConditionRegister(parameters[1]);
+            var crbb = ParseConditionRegister(parameters[2]);
+            return new ConditionRegisterORInstruction(instructionPointer, crbd, crba, crbb);
+        }
+
+        private GekkoInstruction ParseInstructionCRORC(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "crorc");
+            var crbd = ParseConditionRegister(parameters[0]);
+            var crba = ParseConditionRegister(parameters[1]);
+            var crbb = ParseConditionRegister(parameters[2]);
+            return new ConditionRegisterORComplementInstruction(instructionPointer, crbd, crba, crbb);
+        }
+
+        private GekkoInstruction ParseInstructionCRSET(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "crset");
+            var crbd = ParseConditionRegister(parameters[0]);
+            return new ConditionRegisterSetInstruction(instructionPointer, crbd);
+        }
+
+        private GekkoInstruction ParseInstructionCRXOR(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "crxor");
+            var crbd = ParseConditionRegister(parameters[0]);
+            var crba = ParseConditionRegister(parameters[1]);
+            var crbb = ParseConditionRegister(parameters[2]);
+            return new ConditionRegisterXORInstruction(instructionPointer, crbd, crba, crbb);
+        }
+
+        private GekkoInstruction ParseInstructionDIVW(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "divw");
             var rd = ParseRegister(parameters[0]);
             var ra = ParseRegister(parameters[1]);
             var rb = ParseRegister(parameters[2]);
-            return new SubtractFromInstruction(instructionPointer, rd, rb, ra, false, false);
-        }
-
-        private GekkoInstruction ParseInstructionSUBF(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "subf");
+            return new DivideWordInstruction(instructionPointer, rd, ra, rb, false, false);
+        }
+
+        private GekkoInstruction ParseInstructionLBZ(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "lbz");
+            var rd = ParseRegister(parameters[0]);
+            var offset = ParseIntegerLiteral(parameters[1]);
+            var ra = ParseRegister(parameters[2]);
+            return new LoadByteAndZeroInstruction(instructionPointer, rd, ra, offset);
+        }
+
+        private GekkoInstruction ParseInstructionLFS(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "lfs");
+            var rd = ParseRegister(parameters[0]);
+            var offset = ParseIntegerLiteral(parameters[1]);
+            var ra = ParseRegister(parameters[2]);
+            return new LoadFloatingPointSingleInstruction(instructionPointer, rd, ra, offset);
+        }
+
+        private GekkoInstruction ParseInstructionLHZ(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "lhz");
+            var rd = ParseRegister(parameters[0]);
+            var offset = ParseIntegerLiteral(parameters[1]);
+            var ra = ParseRegister(parameters[2]);
+            return new LoadHalfWordAndZeroInstruction(instructionPointer, rd, ra, offset);
+        }
+
+        private GekkoInstruction ParseInstructionLIS(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "lis");
+            var rd = ParseRegister(parameters[0]);
+            var simm = ParseIntegerLiteral(parameters[1]);
+            return new LoadImmediateShiftedInstruction(instructionPointer, rd, simm);
+        }
+
+        private GekkoInstruction ParseInstructionLWZ(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "lwz");
+            var rd = ParseRegister(parameters[0]);
+            var offset = ParseIntegerLiteral(parameters[1]);
+            var ra = ParseRegister(parameters[2]);
+            return new LoadWordAndZeroInstruction(instructionPointer, rd, ra, offset);
+        }
+
+        private GekkoInstruction ParseInstructionMFLR(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "mflr");
+            var rd = ParseRegister(parameters[0]);
+            return new MoveFromLinkRegisterInstruction(instructionPointer, rd);
+        }
+
+        private GekkoInstruction ParseInstructionMFSPR(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "mfspr");
+            var rd = ParseRegister(parameters[0]);
+            var spr = ParseIntegerLiteral(parameters[1]);
+            return new MoveFromSpecialPurposeRegisterInstruction(instructionPointer, rd, spr);
+        }
+
+        private GekkoInstruction ParseInstructionMTLR(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "mtlr");
+            var rs = ParseRegister(parameters[0]);
+            return new MoveToLinkRegisterInstruction(instructionPointer, rs);
+        }
+
+        private GekkoInstruction ParseInstructionMTSPR(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "mtspr");
+            var spr = ParseIntegerLiteral(parameters[0]);
+            var rs = ParseRegister(parameters[1]);
+            return new MoveToSpecialPurposeRegisterInstruction(instructionPointer, spr, rs);
+        }
+
+        private GekkoInstruction ParseInstructionMULLI(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "mulli");
             var rd = ParseRegister(parameters[0]);
             var ra = ParseRegister(parameters[1]);
-            var rb = ParseRegister(parameters[2]);
-            return new SubtractFromInstruction(instructionPointer, rd, ra, rb, false, false);
+            var simm = ParseIntegerLiteral(parameters[2]);
+            return new MultiplyLowImmediateInstruction(instructionPointer, rd, ra, simm);
         }

         private GekkoInstruction ParseInstructionMULLW(string line, int instructionPointer)
@@ -790,13 +1019,27 @@
             return new MultiplyLowWordInstruction(instructionPointer, rd, ra, rb, false, false);
         }

-        private GekkoInstruction ParseInstructionDIVW(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "divw");
-            var rd = ParseRegister(parameters[0]);
-            var ra = ParseRegister(parameters[1]);
-            var rb = ParseRegister(parameters[2]);
-            return new DivideWordInstruction(instructionPointer, rd, ra, rb, false, false);
+        private GekkoInstruction ParseInstructionNOP(string line, int instructionPointer)
+        {
+            return new NoOperationInstruction(instructionPointer);
+        }
+
+        private GekkoInstruction ParseInstructionORI(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "ori");
+            var ra = ParseRegister(parameters[0]);
+            var rs = ParseRegister(parameters[1]);
+            var uimm = ParseIntegerLiteral(parameters[2]);
+            return new OrImmediateInstruction(instructionPointer, ra, rs, uimm);
+        }
+
+        private GekkoInstruction ParseInstructionSTW(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "stw");
+            var rs = ParseRegister(parameters[0]);
+            var offset = ParseIntegerLiteral(parameters[1]);
+            var ra = ParseRegister(parameters[2]);
+            return new StoreWordInstruction(instructionPointer, rs, offset, ra);
         }

         private GekkoInstruction ParseInstructionSTWU(string line, int instructionPointer)
@@ -808,265 +1051,22 @@
             return new StoreWordWithUpdateInstruction(instructionPointer, rs, offset, ra);
         }

-        private GekkoInstruction ParseInstructionSTW(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "stw");
-            var rs = ParseRegister(parameters[0]);
-            var offset = ParseIntegerLiteral(parameters[1]);
-            var ra = ParseRegister(parameters[2]);
-            return new StoreWordInstruction(instructionPointer, rs, offset, ra);
-        }
-
-        private GekkoInstruction ParseInstructionMFLR(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "mflr");
-            var rd = ParseRegister(parameters[0]);
-            return new MoveFromLinkRegisterInstruction(instructionPointer, rd);
-        }
-
-        private GekkoInstruction ParseInstructionMFSPR(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "mfspr");
-            var rd = ParseRegister(parameters[0]);
-            var spr = ParseIntegerLiteral(parameters[1]);
-            return new MoveFromSpecialPurposeRegisterInstruction(instructionPointer, rd, spr);
-        }
-
-        private GekkoInstruction ParseInstructionMTLR(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "mtlr");
-            var rs = ParseRegister(parameters[0]);
-            return new MoveToLinkRegisterInstruction(instructionPointer, rs);
-        }
-
-        private GekkoInstruction ParseInstructionMTSPR(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "mtspr");
-            var spr = ParseIntegerLiteral(parameters[0]);
-            var rs = ParseRegister(parameters[1]);
-            return new MoveToSpecialPurposeRegisterInstruction(instructionPointer, spr, rs);
-        }
-
-        private GekkoInstruction ParseInstructionLWZ(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "lwz");
-            var rd = ParseRegister(parameters[0]);
-            var offset = ParseIntegerLiteral(parameters[1]);
-            var ra = ParseRegister(parameters[2]);
-            return new LoadWordAndZeroInstruction(instructionPointer, rd, ra, offset);
-        }
-
-        private GekkoInstruction ParseInstructionLHZ(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "lhz");
-            var rd = ParseRegister(parameters[0]);
-            var offset = ParseIntegerLiteral(parameters[1]);
-            var ra = ParseRegister(parameters[2]);
-            return new LoadHalfWordAndZeroInstruction(instructionPointer, rd, ra, offset);
-        }
-
-        private GekkoInstruction ParseInstructionLBZ(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "lbz");
-            var rd = ParseRegister(parameters[0]);
-            var offset = ParseIntegerLiteral(parameters[1]);
-            var ra = ParseRegister(parameters[2]);
-            return new LoadByteAndZeroInstruction(instructionPointer, rd, ra, offset);
-        }
-
-        private GekkoInstruction ParseInstructionLFS(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "lfs");
-            var rd = ParseRegister(parameters[0]);
-            var offset = ParseIntegerLiteral(parameters[1]);
-            var ra = ParseRegister(parameters[2]);
-            return new LoadFloatingPointSingleInstruction(instructionPointer, rd, ra, offset);
-        }
-
-        private GekkoInstruction ParseInstructionBLA(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "bla");
-            var targetAddress = ParseIntegerLiteral(parameters[0]);
-            return new BranchInstruction(instructionPointer, targetAddress, true, true);
-        }
-
-        private GekkoInstruction ParseInstructionBA(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "ba");
-            var targetAddress = ParseIntegerLiteral(parameters[0]);
-            return new BranchInstruction(instructionPointer, targetAddress, true, false);
-        }
-
-        private GekkoInstruction ParseInstructionBL(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "bl");
-            var targetAddress = ParseIntegerLiteral(parameters[0]);
-            return new BranchInstruction(instructionPointer, targetAddress, false, true);
-        }
-
-        private GekkoInstruction ParseInstructionB(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "b");
-            var targetAddress = ParseIntegerLiteral(parameters[0]);
-            return new BranchInstruction(instructionPointer, targetAddress, false, false);
-        }
-
-        private GekkoInstruction ParseInstructionCRAND(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "crand");
-            var crbd = ParseConditionRegister(parameters[0]);
-            var crba = ParseConditionRegister(parameters[1]);
-            var crbb = ParseConditionRegister(parameters[2]);
-            return new ConditionRegisterANDInstruction(instructionPointer, crbd, crba, crbb);
-        }
-
-        private GekkoInstruction ParseInstructionCRANDC(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "crandc");
-            var crbd = ParseConditionRegister(parameters[0]);
-            var crba = ParseConditionRegister(parameters[1]);
-            var crbb = ParseConditionRegister(parameters[2]);
-            return new ConditionRegisterANDComplementInstruction(instructionPointer, crbd, crba, crbb);
-        }
-
-        private GekkoInstruction ParseInstructionCRCLR(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "crclr");
-            var crbd = ParseConditionRegister(parameters[0]);
-            return new ConditionRegisterClearInstruction(instructionPointer, crbd);
-        }
-
-        private GekkoInstruction ParseInstructionCREQV(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "creqv");
-            var crbd = ParseConditionRegister(parameters[0]);
-            var crba = ParseConditionRegister(parameters[1]);
-            var crbb = ParseConditionRegister(parameters[2]);
-            return new ConditionRegisterEquivalentInstruction(instructionPointer, crbd, crba, crbb);
-        }
-
-        // Simplified mnemonic of CROR
-        private GekkoInstruction ParseInstructionCRMOVE(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "crmove");
-            var crbd = ParseConditionRegister(parameters[0]);
-            var crba = ParseConditionRegister(parameters[1]);
-            return new ConditionRegisterORInstruction(instructionPointer, crbd, crba, crba);
-        }
-
-        private GekkoInstruction ParseInstructionCRNAND(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "crnand");
-            var crbd = ParseConditionRegister(parameters[0]);
-            var crba = ParseConditionRegister(parameters[1]);
-            var crbb = ParseConditionRegister(parameters[2]);
-            return new ConditionRegisterNANDInstruction(instructionPointer, crbd, crba, crbb);
-        }
-
-        private GekkoInstruction ParseInstructionCRNOR(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "crnor");
-            var crbd = ParseConditionRegister(parameters[0]);
-            var crba = ParseConditionRegister(parameters[1]);
-            var crbb = ParseConditionRegister(parameters[2]);
-            return new ConditionRegisterNORInstruction(instructionPointer, crbd, crba, crbb);
-        }
-
-        // Simplified mnemonic of CRNOR
-        private GekkoInstruction ParseInstructionCRNOT(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "crnot");
-            var crbd = ParseConditionRegister(parameters[0]);
-            var crba = ParseConditionRegister(parameters[1]);
-            return new ConditionRegisterNORInstruction(instructionPointer, crbd, crba, crba);
-        }
-
-        private GekkoInstruction ParseInstructionCROR(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "cror");
-            var crbd = ParseConditionRegister(parameters[0]);
-            var crba = ParseConditionRegister(parameters[1]);
-            var crbb = ParseConditionRegister(parameters[2]);
-            return new ConditionRegisterORInstruction(instructionPointer, crbd, crba, crbb);
-        }
-
-        private GekkoInstruction ParseInstructionCRORC(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "crorc");
-            var crbd = ParseConditionRegister(parameters[0]);
-            var crba = ParseConditionRegister(parameters[1]);
-            var crbb = ParseConditionRegister(parameters[2]);
-            return new ConditionRegisterORComplementInstruction(instructionPointer, crbd, crba, crbb);
-        }
-
-        private GekkoInstruction ParseInstructionCRSET(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "crset");
-            var crbd = ParseConditionRegister(parameters[0]);
-            return new ConditionRegisterSetInstruction(instructionPointer, crbd);
-        }
-
-        private GekkoInstruction ParseInstructionCRXOR(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "crxor");
-            var crbd = ParseConditionRegister(parameters[0]);
-            var crba = ParseConditionRegister(parameters[1]);
-            var crbb = ParseConditionRegister(parameters[2]);
-            return new ConditionRegisterXORInstruction(instructionPointer, crbd, crba, crbb);
-        }
-
-        private GekkoInstruction ParseInstructionMULLI(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "mulli");
+        private GekkoInstruction ParseInstructionSUB(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "sub");
             var rd = ParseRegister(parameters[0]);
             var ra = ParseRegister(parameters[1]);
-            var simm = ParseIntegerLiteral(parameters[2]);
-            return new MultiplyLowImmediateInstruction(instructionPointer, rd, ra, simm);
-        }
-
-        private GekkoInstruction ParseInstructionADDI(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "addi");
+            var rb = ParseRegister(parameters[2]);
+            return new SubtractFromInstruction(instructionPointer, rd, rb, ra, false, false);
+        }
+
+        private GekkoInstruction ParseInstructionSUBF(string line, int instructionPointer)
+        {
+            var parameters = ParseParameters(line, "subf");
             var rd = ParseRegister(parameters[0]);
             var ra = ParseRegister(parameters[1]);
-            var simm = ParseIntegerLiteral(parameters[2]);
-            return new AddImmediateInstruction(instructionPointer, rd, ra, simm);
-        }
-
-        private GekkoInstruction ParseInstructionLIS(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "lis");
-            var rd = ParseRegister(parameters[0]);
-            var simm = ParseIntegerLiteral(parameters[1]);
-            return new LoadImmediateShiftedInstruction(instructionPointer, rd, simm);
-        }
-
-        private GekkoInstruction ParseInstructionADDIS(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "addis");
-            var rd = ParseRegister(parameters[0]);
-            var ra = ParseRegister(parameters[1]);
-            var simm = ParseIntegerLiteral(parameters[2]);
-            return new AddImmediateShiftedInstruction(instructionPointer, rd, ra, simm);
-        }
-
-        private GekkoInstruction ParseInstructionORI(string line, int instructionPointer)
-        {
-            var parameters = ParseParameters(line, "ori");
-            var ra = ParseRegister(parameters[0]);
-            var rs = ParseRegister(parameters[1]);
-            var uimm = ParseIntegerLiteral(parameters[2]);
-            return new OrImmediateInstruction(instructionPointer, ra, rs, uimm);
-        }
-
-        private GekkoInstruction ParseInstructionNOP(string line, int instructionPointer)
-        {
-            return new NoOperationInstruction(instructionPointer);
-        }
-
-        private GekkoInstruction ParseInstructionBLR(string line, int instructionPointer)
-        {
-            return new BranchToLinkRegisterInstruction(instructionPointer);
+            var rb = ParseRegister(parameters[2]);
+            return new SubtractFromInstruction(instructionPointer, rd, ra, rb, false, false);
         }

         #endregion


Version 0.107

Version 0.107

--- GitMind/Properties/AssemblyInfo.cs
+++ GitMind/Properties/AssemblyInfo.cs
@@ -50,7 +50,7 @@
 //
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("0.106.*")]
+[assembly: AssemblyVersion("0.107.*")]

 [assembly: InternalsVisibleTo("GitMindTest")]


Add quadratic solver to MathUtility

Add quadratic solver to MathUtility

--- GoldenAnvil.Utility/MathUtility.cs
+++ GoldenAnvil.Utility/MathUtility.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;

 namespace GoldenAnvil.Utility
 {
@@ -12,5 +13,24 @@
 		public static double DegreesToRadians(double degrees) => degrees * Math.PI / 180.0;

 		public static double Clamp(double value, double min, double max) => Math.Max(Math.Min(value, max), min);
+
+		public static IReadOnlyList<double> SolveQuadratic(double a, double b, double c)
+		{
+			var values = new List<double>();
+
+			var discriminant = (b * b) - (4 * a * c);
+			if (discriminant == 0.0)
+			{
+				values.Add(-b / (2 * a));
+			}
+			else if (discriminant > 0)
+			{
+				var sqrtOfDiscriminant = Math.Sqrt(discriminant);
+				values.Add((-b + sqrtOfDiscriminant) / (2 * a));
+				values.Add((-b - sqrtOfDiscriminant) / (2 * a));
+			}
+
+			return values;
+		}
 	}
 }


Ignore scopes in ChannelPool

Ignore scopes in ChannelPool

Without this, the change in ClientBuilderBase to use self-signed
JWTs is irrelevant in most cases.

Note that ChannelPool's public members are only the constructor and
shutdown method - users can't call GetChannel themselves, so it's
okay to change what that does somewhat.

--- Google.Api.Gax.Grpc/ChannelPool.cs
+++ Google.Api.Gax.Grpc/ChannelPool.cs
@@ -23,8 +23,6 @@
     /// </summary>
     public sealed class ChannelPool
     {
-        private readonly IEnumerable<string> _scopes;
-
         /// <summary>
         /// Lazily-created task to retrieve the default application channel credentials. Once completed, this
         /// task can be used whenever channel credentials are required. The returned task always runs in the
@@ -32,6 +30,9 @@
         /// The same channel credentials are used by all pools. The field is initialized in the constructor, as it uses
         /// _scopes, and you can't refer to an instance field within an instance field initializer.
         /// </summary>
+        /// <remarks>
+        /// The name here indicates that the credentials are scoped if they need to be - which currently, they never are.
+        /// </remarks>
         private readonly Lazy<Task<ChannelCredentials>> _lazyScopedDefaultChannelCredentials;

         // TODO: See if we could use ConcurrentDictionary instead of locking. I suspect the issue would be making an atomic
@@ -43,24 +44,26 @@
         /// Creates a channel pool which will apply the specified scopes to the default application credentials
         /// if they require any.
         /// </summary>
-        /// <param name="scopes">The scopes to apply. Must not be null, and must not contain null references. May be empty.</param>
+        /// <remarks>
+        /// As of version 3.3.0 of this library, the scopes are not used by this class; self-signed JWTs are created
+        /// instead of scoped access tokens. However, the same validation is performed on <paramref name="scopes"/>
+        /// as in previous versions. Future versions of the library may apply the scopes if they are needed for specific
+        /// scenarios.
+        /// </remarks>
+        /// <param name="scopes">The scopes to apply, where they are required.
+        /// Must not be null, and must not contain null references. May be empty.</param>
         public ChannelPool(IEnumerable<string> scopes)
         {
-            // Always take a copy of the provided scopes, then check the copy doesn't contain any nulls.
-            _scopes = GaxPreconditions.CheckNotNull(scopes, nameof(scopes)).ToList();
-            GaxPreconditions.CheckArgument(!_scopes.Any(x => x == null), nameof(scopes), "Scopes must not contain any null references");
-            // In theory, we don't actually need to store the scopes as field in this class. We could capture a local variable here.
-            // However, it won't be any more efficient, and having the scopes easily available when debugging could be handy.
+            // We validate the scopes parameter, even though we don't actually use it any more. This means we
+            // can start using them again later if necessary, without breaking clients.
+            GaxPreconditions.CheckNotNull(scopes, nameof(scopes));
+            GaxPreconditions.CheckArgument(!scopes.Any(x => x == null), nameof(scopes), "Scopes must not contain any null references");
             _lazyScopedDefaultChannelCredentials = new Lazy<Task<ChannelCredentials>>(() => Task.Run(CreateChannelCredentialsUncached));
         }

         private async Task<ChannelCredentials> CreateChannelCredentialsUncached()
         {
             var appDefaultCredentials = await GoogleCredential.GetApplicationDefaultAsync().ConfigureAwait(false);
-            if (appDefaultCredentials.IsCreateScopedRequired)
-            {
-                appDefaultCredentials = appDefaultCredentials.CreateScoped(_scopes);
-            }
             return appDefaultCredentials.ToChannelCredentials();
         }


Fix RingBondOffsetComparator.

Fix RingBondOffsetComparator.


Rearranged some code in SongManager to avoid dead locks.

--- src/Neptunium/Core/Media/Songs/NepAppSongManager.cs
+++ src/Neptunium/Core/Media/Songs/NepAppSongManager.cs
@@ -166,20 +166,6 @@
                     HandleStationSongMetadata(songMetadata, currentStream, CurrentStation);
                 }
             }
-            catch (Exception ex)
-            {
-                if (!Debugger.IsAttached)
-                {
-                    Dictionary<string, string> properties = new Dictionary<string, string>();
-                    properties.Add("Song-Metadata", songMetadata?.ToString());
-                    properties.Add("Current-Station", currentStream?.ParentStation);
-                    Microsoft.HockeyApp.HockeyClient.Current.TrackException(ex, properties);
-                }
-                else
-                {
-                    Debugger.Break();
-                }
-            }
             finally
             {
                 metadataLock.Release();
@@ -218,6 +204,11 @@

             PreSongChanged?.Invoke(this, new NepAppSongChangedEventArgs(songMetadata));

+            await HandleStationSongMetadataStage2Async(songMetadata);
+        }
+
+        private async System.Threading.Tasks.Task HandleStationSongMetadataStage2Async(SongMetadata songMetadata)
+        {
             ExtendedSongMetadata newMetadata = new ExtendedSongMetadata(songMetadata);

             bool hasMoreMetadata = await NepApp.MetadataManager.FindAdditionalMetadataAsync(newMetadata);
@@ -266,7 +257,7 @@
             });

             CurrentProgram = currentProgram;
-            SetCurrentMetadataToUnknown(currentProgram.Name);
+            SetCurrentMetadataToUnknownInternal(currentProgram.Name);
         }

         private SongMetadata GetUnknownSongMetadata(StationItem stationPlaying = null, string radioProgram = null)
@@ -284,9 +275,15 @@
             return unknown;
         }

-        internal async void SetCurrentMetadataToUnknown(string program = null)
+        public async void SetCurrentMetadataToUnknown(string program = null)
         {
             await metadataLock.WaitAsync();
+            SetCurrentMetadataToUnknownInternal();
+            metadataLock.Release();
+        }
+
+        private void SetCurrentMetadataToUnknownInternal(string program = null)
+        {
             //todo make a readonly field
             SongMetadata unknown = GetUnknownSongMetadata();

@@ -297,7 +294,6 @@
             PreSongChanged?.Invoke(this, new NepAppSongChangedEventArgs(unknown));

             ArtworkProcessor.UpdateArtworkMetadata();
-            metadataLock.Release();
         }

         internal void ResetMetadata()


UI Framework: Fixed bug where headers did not change when back and forward buttons clicked.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C71320


(maint) formatting

(maint) formatting

--- src/chocolatey/infrastructure.app/nuget/NugetCommon.cs
+++ src/chocolatey/infrastructure.app/nuget/NugetCommon.cs
@@ -80,7 +80,7 @@

             //todo well that didn't work on failing repos... grrr
             var repository = new AggregateRepository(repositories) {IgnoreFailingRepositories = true};
-            //,ResolveDependenciesVertically = true};
+            //repository.ResolveDependenciesVertically = true;
             if (configuration.Debug)
             {
                 repository.Logger = nugetLogger;


code cleanup

code cleanup

--- src/Selenium.WebDriver.Extensions/JQuerySelector.cs
+++ src/Selenium.WebDriver.Extensions/JQuerySelector.cs
@@ -23,7 +23,7 @@
         /// constructor as it is resolved by reflection.
         /// </remarks>
         public JQuerySelector(string selector)
-            : this(selector, null, "jQuery", "")
+            : this(selector, null, "jQuery", string.Empty)
         {
         }

@@ -31,7 +31,7 @@
         /// <param name="selector">A string containing a selector expression.</param>
         /// <param name="context">A DOM Element, Document, or jQuery to use as context.</param>
         public JQuerySelector(string selector, JQuerySelector context)
-            : this(selector, context, "jQuery", "")
+            : this(selector, context, "jQuery", string.Empty)
         {
         }

@@ -40,7 +40,7 @@
         /// <param name="context">A DOM Element, Document, or jQuery to use as context.</param>
         /// <param name="variable">A variable that has been assigned to jQuery.</param>
         public JQuerySelector(string selector, JQuerySelector context, string variable)
-            : this(selector, context, variable, "")
+            : this(selector, context, variable, string.Empty)
         {
         }

@@ -48,7 +48,7 @@
         /// <param name="selector">A string containing a selector expression.</param>
         /// <param name="variable">A variable that has been assigned to jQuery.</param>
         public JQuerySelector(string selector, string variable)
-            : this(selector, null, variable, "")
+            : this(selector, null, variable, string.Empty)
         {
         }


https magnacare link

https magnacare link

--- HRI/Views/ProviderDirectory.cshtml
+++ HRI/Views/ProviderDirectory.cshtml
@@ -18,7 +18,7 @@

-
+


Fix for unknown genericity of com.sun.star.reflection.XIdlClass

--- idlbuilder/DoxygenIDLBuilder.cs
+++ idlbuilder/DoxygenIDLBuilder.cs
@@ -191,10 +191,13 @@
             {
                 var xidlClassName = "com.sun.star.reflection.XIdlClass";

-                //add generic parameter with default to XIdlClass
-                var xidlClass = ret.FindTypeDescription(xidlClassName).description as TSInterfaceDescription;
+                //recreate XIdClass with generic parameter
+                var reflection = ret.GetNamespace("com.sun.star.reflection");
+                var xidlClass = reflection.Interfaces[xidlClassName];
+                reflection.Interfaces.Remove(xidlClassName);
                 var placeholder = new TSPlaceholder() { Name = "T" };
                 xidlClass.GenericParameters.Add(placeholder);
+                reflection.Interfaces[xidlClassName + "<>"] = xidlClass;

                 //modify createObject to take a tuple type of T
                 var outParam = new TSTupleType();


Removed the unnecessary writeline calls

Removed the unnecessary writeline calls

--- Deflector/Deflector/MethodCallInterceptionEmitter.cs
+++ Deflector/Deflector/MethodCallInterceptionEmitter.cs
@@ -225,8 +225,6 @@
                 if (parameterType.IsValueType || parameterType is GenericParameter)
                     il.Emit(OpCodes.Box, parameterType);

-
-                il.EmitWriteLineIfNull("Current Arguments is null!", _currentArguments);
                 il.Emit(OpCodes.Stloc, _currentArgument);
                 il.Emit(OpCodes.Ldloc, _currentArguments);
                 il.Emit(OpCodes.Ldloc, _currentArgument);


fixed build script

fixed build script

--- BuildScript.cs
+++ BuildScript.cs
@@ -60,7 +60,7 @@
         context.CreateTarget("rebuild.server")
             .SetAsDefault()
             ////.DependsOn(compile, flubuTests, merge, nuget)
-            .DependsOn("compile", "test", "merge", "nuget.publish", "package.SystemTests");
+            .DependsOn("compile", "test", "merge", "nuget.publish", "package.FlubuRunner");
     }

     private static void TargetPackageFlubuRunner(ITaskContext context)


Fixed test, added explanations

Fixed test, added explanations

Fixed test that was failing and added some comments in the test to give
some explanations of our expectations

--- InfluxClient.Tests/ManagerTests.cs
+++ InfluxClient.Tests/ManagerTests.cs
@@ -229,9 +229,10 @@
             Assert.AreEqual(200, (int)retval.StatusCode);
             Assert.IsTrue(retval.Headers.Contains("X-Influxdb-Version"));

-            Assert.IsNotNull(data);
-            Assert.IsTrue(data.Length > 0);
-            Assert.IsTrue(data.Length < 20);
+            Assert.IsNotNull(data); // We shouldn't have null
+            Assert.IsTrue(data.Length > 0); // We should have something
+            Assert.IsTrue(data.Length < 40); // Just not much
+            Assert.IsFalse(data.Contains("error")); //  This shouldn't result in an error
         }

         [TestMethod]


Corrected spelling mistake.

Corrected spelling mistake.

--- Infrastructure/Host/Web/Startup.cs
+++ Infrastructure/Host/Web/Startup.cs
@@ -46,7 +46,7 @@
                 var rootSourcePath = Path.GetFullPath(Path.Combine(_env.ContentRootPath, "../../.."));
                 services.UseCustomFileSystemRazorViews(rootSourcePath);

-                // add adctivator so we can track views have been setup correctly during development
+                // add activator so we can track views have been setup correctly during development
                 services.AddSingleton<IRazorPageActivator, CustomRazorPageActivator>();
             }
             else


actually fixed merge conflict

actually fixed merge conflict

--- src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Mapping/AddCohortCommandToDraftApprenticeshipDetailsMapperTests.cs
+++ src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Mapping/AddCohortCommandToDraftApprenticeshipDetailsMapperTests.cs
@@ -30,6 +30,15 @@
             Assert.AreEqual(fixture.Command.OriginatorReference, draftApprenticeshipDetails.Reference);
             Assert.AreEqual(fixture.TrainingProgramme, draftApprenticeshipDetails.TrainingProgramme);
         }
+
+        [Test]
+        public async Task WhenMapping_ThenShouldSetReservationId()
+        {
+            var fixture = new AddCohortCommandToDraftApprenticeshipDetailsMapperTestsFixture();
+            var draftApprenticeshipDetails = await fixture.Map();
+
+            Assert.AreEqual(true ? fixture.Command.ReservationId : null, draftApprenticeshipDetails.ReservationId);
+        }
     }

     public class AddCohortCommandToDraftApprenticeshipDetailsMapperTestsFixture
@@ -52,10 +61,11 @@

             TrainingProgrammeLookup.Setup(l => l.GetTrainingProgramme(Command.CourseCode)).ReturnsAsync(TrainingProgramme);
         }
-
         public Task<DraftApprenticeshipDetails> Map()
         {
             return Mapper.Map(Command);
         }
+
+
     }
 }


Parse user protocols for application rule collections

--- src/ResourceManager/Network/Commands.Network/AzureFirewall/ApplicationRule/NewAzureFirewallApplicationRuleCommand.cs
+++ src/ResourceManager/Network/Commands.Network/AzureFirewall/ApplicationRule/NewAzureFirewallApplicationRuleCommand.cs
@@ -16,6 +16,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Management.Automation;
+using System.Text.RegularExpressions;
 using Microsoft.Azure.Commands.Network.Models;
 using MNM = Microsoft.Azure.Management.Network.Models;

@@ -62,33 +63,7 @@
                 throw new ArgumentException("At least one application rule target URL should be specified!");
             }

-            // User can pass "http" or "HTTP" protocol instead of "Http"
-            var protocolsAsWeExpectThem = this.Protocol.Select(userProtocolText =>
-            {
-                string expectedProtocolText = null;
-                uint port;
-
-                if (MNM.AzureFirewallApplicationRuleProtocolType.Http.Equals(userProtocolText, StringComparison.InvariantCultureIgnoreCase))
-                {
-                    expectedProtocolText = MNM.AzureFirewallApplicationRuleProtocolType.Http;
-                    port = 80;
-                }
-                else if (MNM.AzureFirewallApplicationRuleProtocolType.Https.Equals(userProtocolText, StringComparison.InvariantCultureIgnoreCase))
-                {
-                    expectedProtocolText = MNM.AzureFirewallApplicationRuleProtocolType.Https;
-                    port = 443;
-                }
-                else
-                {
-                    throw new ArgumentException($"Unsupported protocol {userProtocolText}.");
-                }
-
-                return new PSAzureFirewallApplicationRuleProtocol
-                {
-                    ProtocolType = expectedProtocolText,
-                    Port = port
-                };
-            }).ToList();
+            var protocolsAsWeExpectThem = MapUserProtocolsToFirewallProtocols(Protocol);

             var applicationRule = new PSAzureFirewallApplicationRule
             {
@@ -99,5 +74,59 @@
             };
             WriteObject(applicationRule);
         }
+
+        private List<PSAzureFirewallApplicationRuleProtocol> MapUserProtocolsToFirewallProtocols(List<string> userProtocols)
+        {
+            var protocolRegEx = new Regex("^[hH][tT][tT][pP][sS]?(:[1-9][0-9]*)?$");
+
+            var supportedProtocolsAndTheirDefaultPorts = new List<PSAzureFirewallApplicationRuleProtocol>
+            {
+                new PSAzureFirewallApplicationRuleProtocol { ProtocolType = MNM.AzureFirewallApplicationRuleProtocolType.Http, Port = 80 },
+                new PSAzureFirewallApplicationRuleProtocol { ProtocolType = MNM.AzureFirewallApplicationRuleProtocolType.Https, Port = 443 }
+            };
+
+            // User can pass "http", "HTtP" or "hTTp:8080"
+            var protocolsAsWeExpectThem = this.Protocol.Select(userText =>
+            {
+                //The actual validation is performed in NRP. Here we are just trying to map user info to our model
+                if (!protocolRegEx.IsMatch(userText))
+                {
+                    throw new ArgumentException($"Invalid protocol {userText}");
+                }
+
+                var userParts = userText.Split(':');
+                var userProtocolText = userParts[0];
+                var userPortText = userParts.Length == 2 ? userParts[1] : null;
+
+                PSAzureFirewallApplicationRuleProtocol supportedProtocol;
+                try
+                {
+                    supportedProtocol = supportedProtocolsAndTheirDefaultPorts.Single(protocol => protocol.ProtocolType.Equals(userProtocolText, StringComparison.InvariantCultureIgnoreCase));
+                }
+                catch
+                {
+                    throw new ArgumentException($"Unsupported protocol {userProtocolText}. Supported protocols are {string.Join(", ", supportedProtocolsAndTheirDefaultPorts.Select(proto => proto.ProtocolType))}", nameof(Protocol));
+                }
+
+                uint port;
+                if(userPortText == null)
+                {
+                    // Use default port for this protocol
+                    port = supportedProtocol.Port;
+                }
+                else if (!uint.TryParse(userPortText, out port))
+                {
+                    throw new ArgumentException($"Invalid protocol {userText}", nameof(Protocol));
+                }
+
+                return new PSAzureFirewallApplicationRuleProtocol
+                {
+                    ProtocolType = supportedProtocol.ProtocolType,
+                    Port = port
+                };
+            }).ToList();
+
+            return protocolsAsWeExpectThem;
+        }
     }
 }


add checking for duplicate property names

--- Signum.Engine.Extensions/Dynamic/DynamicTypeLogic.cs
+++ Signum.Engine.Extensions/Dynamic/DynamicTypeLogic.cs
@@ -77,7 +77,8 @@

                 new ConstructFrom<DynamicTypeEntity>(DynamicTypeOperation.Clone)
                 {
-                    Construct = (e, _) => {
+                    Construct = (e, _) =>
+                    {

                         var def = e.GetDefinition();
                         var result = new DynamicTypeEntity { TypeName = null, BaseType = e.BaseType };
@@ -90,7 +91,16 @@
                 {
                     CanBeNew = true,
                     CanBeModified = true,
-                    Execute = (e, _) => {
+                    Execute = (e, _) =>
+                    {
+                        var newDef = e.GetDefinition();
+                        var duplicatePropertyNames = newDef.Properties
+                                .GroupToDictionary(a => a.Name.ToLower())
+                                .Where(a => a.Value.Count() > 1)
+                                .ToList();
+
+                        if (duplicatePropertyNames.Any())
+                            throw new InvalidOperationException(ValidationMessage._0HasSomeRepeatedElements1.NiceToString(e.TypeName, duplicatePropertyNames.Select(a => a.Key.FirstUpper()).Comma(", ")));

                         if (!e.IsNew)
                         {
@@ -98,11 +108,9 @@
                             if (e.TypeName != old.TypeName)
                                 DynamicSqlMigrationLogic.AddDynamicRename(TypeNameKey, old.TypeName, e.TypeName);

-
                             if (e.BaseType == DynamicBaseType.ModelEntity)
                                 return;

-                            var newDef = e.GetDefinition();
                             var oldDef = old.GetDefinition();
                             var newName = GetTableName(e, newDef);
                             var oldName = GetTableName(old, oldDef);
@@ -175,7 +183,8 @@
             }
         }

-        public static void WriteDynamicStarter(StringBuilder sb, int indent) {
+        public static void WriteDynamicStarter(StringBuilder sb, int indent)
+        {

             var types = GetTypes();
             foreach (var item in types)
@@ -193,19 +202,19 @@

             var result = new List<CodeFile>();

-            var entities =  types.Select(dt =>
-            {
-                var def = dt.GetDefinition();
-
-                var dcg = new DynamicTypeCodeGenerator(DynamicCode.CodeGenEntitiesNamespace, dt.TypeName, dt.BaseType, def, DynamicCode.Namespaces);
-
-                var content = dcg.GetFileCode();
-                return new CodeFile
-                {
-                    FileName = dt.TypeName + ".cs",
-                    FileContent = content
-                };
-            }).ToList();
+            var entities = types.Select(dt =>
+           {
+               var def = dt.GetDefinition();
+
+               var dcg = new DynamicTypeCodeGenerator(DynamicCode.CodeGenEntitiesNamespace, dt.TypeName, dt.BaseType, def, DynamicCode.Namespaces);
+
+               var content = dcg.GetFileCode();
+               return new CodeFile
+               {
+                   FileName = dt.TypeName + ".cs",
+                   FileContent = content
+               };
+           }).ToList();
             result.AddRange(entities);

             var logics = types.Select(dt =>
@@ -374,7 +383,7 @@
         {
             if (Def.ToStringExpression == null)
                 return null;
-
+
             StringBuilder sb = new StringBuilder();
             sb.AppendLine($"static Expression<Func<{this.GetTypeNameWithSuffix()}, string>> ToStringExpression = e => {Def.ToStringExpression};");
             sb.AppendLine("[ExpressionField(\"ToStringExpression\")]");
@@ -388,7 +397,7 @@
         public virtual string GetTypeNameWithSuffix()
         {
             return this.TypeName + (this.BaseType == DynamicBaseType.MixinEntity ? "Mixin" :
-                this.BaseType == DynamicBaseType.EmbeddedEntity ? "Embedded":
+                this.BaseType == DynamicBaseType.EmbeddedEntity ? "Embedded" :
                 this.BaseType == DynamicBaseType.ModelEntity ? "Model" : "Entity");
         }

@@ -525,7 +534,7 @@
                     property.Scale != null ? "Scale = " + Literal(property.Scale) : null,
                     property.ColumnType.HasText() ?  "SqlDbType = " + Literal(Enum.TryParse(property.ColumnType, out SqlDbType dbType) ? dbType : SqlDbType.Udt) : null,
                     property.ColumnType.HasText() && !Enum.TryParse<SqlDbType>(property.ColumnType, out var _) ?  "UserDefinedTypeName = " + Literal(property.ColumnType) : null,
-
+
                 }.NotNull().ToString(", ");

                 atts.Add($"SqlDbType({props})");
@@ -541,13 +550,15 @@
                 case Entities.Dynamic.UniqueIndex.YesAllowNull: atts.Add("UniqueIndex(AllowMultipleNulls = true)"); break;
             }

-            if (property.IsMList != null) {
+            if (property.IsMList != null)
+            {

                 var mlist = property.IsMList;
                 if (mlist.PreserveOrder)
                     atts.Add("PreserveOrder" + (mlist.OrderName.HasText() ? "(" + Literal(mlist.OrderName) + ")" : ""));

-                if (mlist.TableName.HasText()) {
+                if (mlist.TableName.HasText())
+                {
                     var parts = ParseTableName(mlist.TableName);
                     atts.Add("TableName(" + parts + ")");
                 }
@@ -584,14 +595,14 @@

             string result = SimplifyType(property.Type);

-
-
+
+
             if (property.IsNullable != Entities.Dynamic.IsNullable.No && IsValueType(property))
                 result = result + "?";

             if (property.IsLite)
                 result = "Lite<" + result + ">";
-
+
             if (property.IsMList != null)
                 result = "MList<" + result + ">";


confiugação do certificado digital

confiugação do certificado digital


Solved "4. Supermarket Database"

Solved "4. Supermarket Database"