handled InvalidOperationException in CodeFoldingTagger

--- VS/CSHARP/asm-dude-vsix/CodeFolding/CodeFoldingTagger.cs
+++ VS/CSHARP/asm-dude-vsix/CodeFolding/CodeFoldingTagger.cs
@@ -95,6 +95,7 @@
             this._buffer.ChangedLowPriority += this.Buffer_Changed;
         }

+
         public IEnumerable<ITagSpan<IOutliningRegionTag>> GetTags(NormalizedSnapshotSpanCollection spans)
         {
             if (spans.Count == 0)
@@ -120,7 +121,28 @@
                             ITextSnapshotLine endLine = this._snapshot.GetLineFromLineNumber(region.EndLine);

                             var replacement = Get_Region_Description(startLine.GetText(), region.StartOffsetHoverText);
-                            var hover = Get_Hover_Text(region.StartLine, region.EndLine, this._snapshot);
+
+                            object hover = null;
+                            try
+                            {
+                                hover = Get_Hover_Text_TextBlock(region.StartLine, region.EndLine, this._snapshot);
+                            } catch (Exception e)
+                            {
+                                /*
+                                    System.InvalidOperationException: The calling thread must be STA, because many UI components require this.

+                                    at System.Windows.Input.InputManager..ctor()

+                                    at System.Windows.Input.InputManager.GetCurrentInputManagerImpl()

+                                    at System.Windows.Input.KeyboardNavigation..ctor()

+                                    at System.Windows.FrameworkElement.FrameworkServices..ctor()

+                                    at System.Windows.FrameworkElement.EnsureFrameworkServices()

+                                    at System.Windows.FrameworkElement..ctor()

+                                    at AsmDude.CodeFolding.CodeFoldingTagger.Get_Hover_Text(Int32 beginLineNumber, Int32 endLineNumber, ITextSnapshot snapshot) in C:\Cloud\Dropbox\sc\GitHub\asm-dude\VS\CSHARP\asm-dude-vsix\CodeFolding\CodeFoldingTagger.cs:line 162

+                                    at AsmDude.CodeFolding.CodeFoldingTagger.<GetTags>d__13.MoveNext() in C:\Cloud\Dropbox\sc\GitHub\asm-dude\VS\CSHARP\asm-dude-vsix\CodeFolding\CodeFoldingTagger.cs:line 122

+                                    at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.<GetTagsForBuffer>d__38.MoveNext()
+                                 */
+                                AsmDudeToolsStatic.Output_WARNING("CodeFoldingTagger: GetTags: exception=" + e.ToString());
+                                hover = Get_Hover_Text_String(region.StartLine, region.EndLine, this._snapshot);
+                            }

                             yield return new TagSpan<IOutliningRegionTag>(
                                 new SnapshotSpan(startLine.Start + region.StartOffset, endLine.End),
@@ -154,22 +176,27 @@
             return (description.Length > 0) ? description : "...";
         }

+        private string Get_Hover_Text_String(int beginLineNumber, int endLineNumber, ITextSnapshot snapshot)
+        {
+            StringBuilder sb = new StringBuilder();
+            int numberOfLines = Math.Min((endLineNumber + 1) - beginLineNumber, 40); // do not show more than 40 lines
+            for (int i = 0; i < numberOfLines; ++i)
+            {
+                sb.AppendLine(snapshot.GetLineFromLineNumber(beginLineNumber + i).GetText());
+            }
+            return sb.ToString().TrimEnd();
+        }
+
         /// <summary>
         /// Get the text to be displayed when hovering over a closed region
         /// </summary>
-        private TextBlock Get_Hover_Text(int beginLineNumber, int endLineNumber, ITextSnapshot snapshot)
-        {
+        private TextBlock Get_Hover_Text_TextBlock(int beginLineNumber, int endLineNumber, ITextSnapshot snapshot)
+        {
+            string hover_string = Get_Hover_Text_String(beginLineNumber, endLineNumber, snapshot);
+
+            //TODO provide syntax highlighting for the next run
             TextBlock description = new TextBlock();
-            StringBuilder str = new StringBuilder();
-
-            int numberOfLines = Math.Min((endLineNumber + 1) - beginLineNumber, 40); // do not show more than 40 lines
-            for (int i = 0; i < numberOfLines; ++i)
-            {
-                str.AppendLine(snapshot.GetLineFromLineNumber(beginLineNumber + i).GetText());
-            }
-
-            //TODO provide syntax highlighting for the next run
-            System.Windows.Documents.Run run = new System.Windows.Documents.Run(str.ToString().TrimEnd()); // TrimEnd to get rid of the last new line
+            System.Windows.Documents.Run run = new System.Windows.Documents.Run(hover_string); // TrimEnd to get rid of the last new line
             run.FontSize -= 1;
             description.Inlines.Add(run);
             return description;
@@ -188,10 +215,10 @@
         /// <summary>
         /// Return start positions of the provided line content. tup has: 1) start of the folding position; 2) start of the description position.
         /// </summary>
-        private (int, int) Is_Start_Keyword(string lineContent, int lineNumber)
+        private (int StartPosFolding, int StartPosDescription) Is_Start_Keyword(string lineContent, int lineNumber)
         {
             var tup = Is_Start_Directive_Keyword(lineContent);
-            if (tup.Item1 != -1)
+            if (tup.StartPos != -1)
             {
                 return tup;
             }
@@ -216,7 +243,7 @@
         /// <summary>
         /// Return start positions of the provided line content. tup has: 1) start of the folding position; 2) start of the description position.
         /// </summary>
-        private (int, int) Is_Start_Directive_Keyword(string lineContent)
+        private (int StartPos, int StartPosDescription) Is_Start_Directive_Keyword(string lineContent)
         {
             int i1 = lineContent.IndexOf(this.startRegionTag, StringComparison.OrdinalIgnoreCase);
             if (i1 == -1)
@@ -232,7 +259,7 @@
         /// <summary>
         /// Return start positions of the provided line content. tup has: 1) start of the folding position; 2) start of the description position.
         /// </summary>
-        private (int startPosFolding, int startPosDescription) Is_Start_Masm_Keyword(string lineContent, int lineNumber)
+        private (int StartPosFolding, int StartPosDescription) Is_Start_Masm_Keyword(string lineContent, int lineNumber)
         {
             ITextSnapshotLine line = this._buffer.CurrentSnapshot.GetLineFromLineNumber(lineNumber);
             IEnumerable<IMappingTagSpan<AsmTokenTag>> tags = this._aggregator.GetTags(line.Extent);
@@ -268,7 +295,7 @@
         /// <summary>
         /// Return start positions of the provided line content. tup has: 1) start of the folding position; 2) start of the description position.
         /// </summary>
-        private (int, int) Is_Start_Nasm_Keyword(string lineContent, int lineNumber)
+        private (int StartPos, int StartPosDescription) Is_Start_Nasm_Keyword(string lineContent, int lineNumber)
         {
             ITextSnapshotLine line = this._buffer.CurrentSnapshot.GetLineFromLineNumber(lineNumber);
             IEnumerable<IMappingTagSpan<AsmTokenTag>> tags = this._aggregator.GetTags(line.Extent);
@@ -390,14 +417,10 @@
             else
             {
                 AsmDudeToolsStatic.Output_INFO("CodeFoldingTagger:Parse_Delayed: going to execute this call.");
-                AsmDudeTools.Instance.Thread_Pool.QueueWorkItem(this.Parse2);
-            }
-        }
-        private void Parse2()
-        {
-            Parse(null);
-        }
-        private void Parse(object threadContext)
+                AsmDudeTools.Instance.Thread_Pool.QueueWorkItem(this.Parse);
+            }
+        }
+        private void Parse()
         {
             if (!this._enabled) return;

@@ -435,9 +458,9 @@
                         string lineContent = line.GetText();
                         int lineNumber = line.LineNumber;

-                        (int, int) tup = Is_Start_Keyword(lineContent, lineNumber);
-                        int regionStart = tup.Item1;
-                        int regionStartHoverText = tup.Item2;
+                        var tup = Is_Start_Keyword(lineContent, lineNumber);
+                        int regionStart = tup.StartPosFolding;
+                        int regionStartHoverText = tup.StartPosDescription;

                         if (regionStart != -1)
                         {
@@ -463,7 +486,7 @@
                                         line = enumerator.Current;
                                         string lineContent3 = line.GetText();
                                         if (AsmSourceTools.IsRemarkOnly(lineContent3) &&
-                                                (Is_Start_Directive_Keyword(lineContent3).Item1 == -1) &&
+                                                (Is_Start_Directive_Keyword(lineContent3).StartPos == -1) &&
                                                 (Is_End_Directive_Keyword(lineContent3) == -1))
                                         {
                                             lineNumber2 = line.LineNumber;


Allow infinite time but min as 0

Allow infinite time but min as 0

--- Client/Systems/VesselPositionSys/VesselPositionUpdate.cs
+++ Client/Systems/VesselPositionSys/VesselPositionUpdate.cs
@@ -61,7 +61,7 @@
         #region Interpolation fields

         public bool InterpolationFinished => Target == null || LerpPercentage >= 1;
-        public float InterpolationDuration => Mathf.Clamp((float)(Target.GameTimeStamp - GameTimeStamp), 0, (float)(SettingsSystem.ServerSettings.SecondaryVesselPositionUpdatesMsInterval * 1.5));
+        public float InterpolationDuration => Mathf.Clamp((float)(Target.GameTimeStamp - GameTimeStamp), 0, float.MaxValue);

         private float _lerpPercentage = 1;
         public float LerpPercentage


Made some methods protected.

Made some methods protected.

Making certain methods protected allows access to low level IO of redis client for fine-tuned extension of client via inheriting RedisClient class.

--- src/ServiceStack.Redis/RedisNativeClient_Utils.cs
+++ src/ServiceStack.Redis/RedisNativeClient_Utils.cs
@@ -303,7 +303,7 @@
 			return Bstream.ReadByte();
 		}

-		private void SendExpectSuccess(params byte[][] cmdWithBinaryArgs)
+		protected void SendExpectSuccess(params byte[][] cmdWithBinaryArgs)
 		{
 			if (!SendCommand(cmdWithBinaryArgs))
 				throw CreateConnectionError();
@@ -316,7 +316,7 @@
 			ExpectSuccess();
 		}

-		private int SendExpectInt(params byte[][] cmdWithBinaryArgs)
+        protected int SendExpectInt(params byte[][] cmdWithBinaryArgs)
 		{
 			if (!SendCommand(cmdWithBinaryArgs))
 				throw CreateConnectionError();
@@ -329,7 +329,7 @@
 			return ReadInt();
 		}

-		private long SendExpectLong(params byte[][] cmdWithBinaryArgs)
+        protected long SendExpectLong(params byte[][] cmdWithBinaryArgs)
 		{
 			if (!SendCommand(cmdWithBinaryArgs))
 				throw CreateConnectionError();
@@ -342,7 +342,7 @@
 			return ReadLong();
 		}

-		private byte[] SendExpectData(params byte[][] cmdWithBinaryArgs)
+        protected byte[] SendExpectData(params byte[][] cmdWithBinaryArgs)
 		{
 			if (!SendCommand(cmdWithBinaryArgs))
 				throw CreateConnectionError();
@@ -355,13 +355,13 @@
 			return ReadData();
 		}

-		private string SendExpectString(params byte[][] cmdWithBinaryArgs)
+        protected string SendExpectString(params byte[][] cmdWithBinaryArgs)
 		{
 			var bytes = SendExpectData(cmdWithBinaryArgs);
 			return bytes.FromUtf8Bytes();
 		}

-		private double SendExpectDouble(params byte[][] cmdWithBinaryArgs)
+        protected double SendExpectDouble(params byte[][] cmdWithBinaryArgs)
 		{
 		    var bytes = SendExpectData(cmdWithBinaryArgs);
 		    return bytes == null ? Double.NaN : ParseDouble(bytes);
@@ -377,7 +377,7 @@
 			return d;
 		}

-		private string SendExpectCode(params byte[][] cmdWithBinaryArgs)
+        protected string SendExpectCode(params byte[][] cmdWithBinaryArgs)
 		{
 			if (!SendCommand(cmdWithBinaryArgs))
 				throw CreateConnectionError();
@@ -391,7 +391,7 @@
 			return ExpectCode();
 		}

-		private byte[][] SendExpectMultiData(params byte[][] cmdWithBinaryArgs)
+        protected byte[][] SendExpectMultiData(params byte[][] cmdWithBinaryArgs)
 		{
 			if (!SendCommand(cmdWithBinaryArgs))
 				throw CreateConnectionError();
@@ -404,7 +404,7 @@
 			return ReadMultiData();
 		}

-        private object [] SendExpectDeeplyNestedMultiData(params byte[][] cmdWithBinaryArgs)
+        protected object[] SendExpectDeeplyNestedMultiData(params byte[][] cmdWithBinaryArgs)
         {
             if (!SendCommand(cmdWithBinaryArgs))
                 throw CreateConnectionError();


Use SKBitmap.Decode method

Use SKBitmap.Decode method

--- src/Skia/Avalonia.Skia/PlatformRenderInterface.cs
+++ src/Skia/Avalonia.Skia/PlatformRenderInterface.cs
@@ -32,21 +32,14 @@
         {
             using (var s = new SKManagedStream(stream))
             {
-                using (var codec = SKCodec.Create(s))
+                var bitmap = SKBitmap.Decode(s);
+                if (bitmap != null)
                 {
-                    var info = codec.Info;
-                    var bitmap = new SKBitmap(info.Width, info.Height, SKImageInfo.PlatformColorType, info.IsOpaque ? SKAlphaType.Opaque : SKAlphaType.Premul);
-
-                    IntPtr length;
-                    var result = codec.GetPixels(bitmap.Info, bitmap.GetPixels(out length));
-                    if (result == SKCodecResult.Success || result == SKCodecResult.IncompleteInput)
-                    {
-                        return new BitmapImpl(bitmap);
-                    }
-                    else
-                    {
-                        throw new ArgumentException("Unable to load bitmap from provided data");
-                    }
+                    return new BitmapImpl(bitmap);
+                }
+                else
+                {
+                    throw new ArgumentException("Unable to load bitmap from provided data");
                 }
             }
         }


pr comment

pr comment

--- src/StructuredLogger/Construction/Construction.cs
+++ src/StructuredLogger/Construction/Construction.cs
@@ -100,13 +100,10 @@
                         AddProperties(EnvironmentFolder, args.BuildEnvironment);
                     }

-                    if (args.BuildEnvironment?.ContainsKey("MSBUILDLOGALLENVIRONMENTVARIABLES") != true)
-                    {
-                        EnvironmentFolder.AddChild(new Note
-                        {
-                            Text = Intern(Strings.TruncatedEnvironment)
-                        });
-                    }
+                    EnvironmentFolder.AddChild(new Note
+                    {
+                        Text = Intern(Strings.TruncatedEnvironment)
+                    });

                     // realize the evaluation folder now so it is ordered before the main solution node
                     _ = EvaluationFolder;


fix bug upload

fix bug upload

--- src/TITcs.SharePoint.SSOM/SharePointRepository.cs
+++ src/TITcs.SharePoint.SSOM/SharePointRepository.cs
@@ -681,7 +681,10 @@
                     {
                         foreach (var item in fields.ItemDictionary)
                         {
-                            file.Item[item.Key] = item.Value;
+                            if (item.Key.ToLower() != "id")
+                            {
+                                file.Item[item.Key] = item.Value;
+                            }
                         }

                         file.Item.Update();


code cleanup

code cleanup

--- Assets/Scripts/Cards/NotImplemented.cs
+++ Assets/Scripts/Cards/NotImplemented.cs
@@ -1,18 +1,12 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-namespace Cards {
+namespace Cards {
     public class NotImplemented : Card {

-        // Use this for initialization
         void Start() {
             print("Not implemented card detected.");
         }

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

         }
     }
-}
+}


removed debug

removed debug

--- Assets/Scripts/Global/PrefabSpawner.cs
+++ Assets/Scripts/Global/PrefabSpawner.cs
@@ -17,13 +17,11 @@
 		if (randomStart) {
 			yield return new WaitForSeconds(Random.Range(0, 2));
 		}
-		Debug.Log("starting spawn coroutine");
 		StartCoroutine(Spawn());
 	}

 	IEnumerator Spawn() {
 		yield return new WaitForSeconds(interval);
-		Debug.Log("spawning water drop");
 		Instantiate(toSpawn, this.transform.position, Quaternion.identity);
 		StartCoroutine(Spawn());
 	}


Mark effect as opaque-only

Mark effect as opaque-only

--- Assets/Scripts/TemporalAntiAliasing.cs
+++ Assets/Scripts/TemporalAntiAliasing.cs
@@ -230,6 +230,7 @@
             GL.PopMatrix();
         }

+        [ImageEffectOpaque]
         public void OnRenderImage(RenderTexture source, RenderTexture destination)
         {
             if (camera_.orthographic)


Fixed bug in user creation

Fixed bug in user creation

--- AzureBot/Controllers/AuthController.cs
+++ AzureBot/Controllers/AuthController.cs
@@ -42,11 +42,15 @@
             var token = await _authService.GetToken(new object[] {code, state});

             // Attempt to retrieve an existing user
-            var user = UserRepository.GetInstance().GetById(state);
+            var users = UserRepository.GetInstance();
+            var user = users.GetById(state);

             // Create user if one doesn't exist
             if (user == null)
+            {
                 user = new Model.User(state);
+                users.Add(user);
+            }

             // Assign token
             user.Token = token;


fix: remove tabs

fix: remove tabs

--- src/TeixeiraSoftware/Finance/FactoryProperties.cs
+++ src/TeixeiraSoftware/Finance/FactoryProperties.cs
@@ -18,7 +18,7 @@
         {
             get
             {
-                return new Currency("AFN", "971", 2, "	Af", "Afghani");
+                return new Currency("AFN", "971", 2, "Af", "Afghani");
             }
         }

@@ -117,7 +117,7 @@
         {
             get
             {
-                return new Currency("BDT", "050", 2, "৳	", "Taka");
+                return new Currency("BDT", "050", 2, "৳", "Taka");
             }
         }

@@ -135,7 +135,7 @@
         {
             get
             {
-                return new Currency("BHD", "048", 3, "ب.د	", "Bahraini Dinar");
+                return new Currency("BHD", "048", 3, "ب.د", "Bahraini Dinar");
             }
         }

@@ -405,7 +405,7 @@
         {
             get
             {
-                return new Currency("DZD", "012", 2, "د.ج	", "Algerian Dinar");
+                return new Currency("DZD", "012", 2, "د.ج", "Algerian Dinar");
             }
         }

@@ -621,7 +621,7 @@
         {
             get
             {
-                return new Currency("IRR", "364", 2, "	﷼", "Iranian Rial");
+                return new Currency("IRR", "364", 2, "﷼", "Iranian Rial");
             }
         }

@@ -648,7 +648,7 @@
         {
             get
             {
-                return new Currency("JOD", "400", 3, "	د.ا", "Jordanian Dinar");
+                return new Currency("JOD", "400", 3, "د.ا", "Jordanian Dinar");
             }
         }

@@ -702,7 +702,7 @@
         {
             get
             {
-                return new Currency("KPW", "408", 2, "₩	", "North Korean Won");
+                return new Currency("KPW", "408", 2, "₩", "North Korean Won");
             }
         }

@@ -711,7 +711,7 @@
         {
             get
             {
-                return new Currency("KRW", "410", 0, "₩	", "Won");
+                return new Currency("KRW", "410", 0, "₩", "Won");
             }
         }

@@ -720,7 +720,7 @@
         {
             get
             {
-                return new Currency("KWD", "414", 3, "	د.ك", "Kuwaiti Dinar");
+                return new Currency("KWD", "414", 3, "د.ك", "Kuwaiti Dinar");
             }
         }

@@ -756,7 +756,7 @@
         {
             get
             {
-                return new Currency("LBP", "422", 2, "	ل.ل", "Lebanese Pound");
+                return new Currency("LBP", "422", 2, "ل.ل", "Lebanese Pound");
             }
         }

@@ -792,7 +792,7 @@
         {
             get
             {
-                return new Currency("LYD", "434", 3, "	ل.د", "Libyan Dinar");
+                return new Currency("LYD", "434", 3, "ل.د", "Libyan Dinar");
             }
         }

@@ -846,7 +846,7 @@
         {
             get
             {
-                return new Currency("MNT", "496", 2, "₮	", "Tugrik");
+                return new Currency("MNT", "496", 2, "₮", "Tugrik");
             }
         }

@@ -882,7 +882,7 @@
         {
             get
             {
-                return new Currency("MVR", "462", 2, "ރ.	", "Rufiyaa");
+                return new Currency("MVR", "462", 2, "ރ.", "Rufiyaa");
             }
         }

@@ -927,7 +927,7 @@
         {
             get
             {
-                return new Currency("MZN", "943", 2, "MTn	", "Mozambique Metical");
+                return new Currency("MZN", "943", 2, "MTn", "Mozambique Metical");
             }
         }

@@ -990,7 +990,7 @@
         {
             get
             {
-                return new Currency("OMR", "512", 3, "ر.ع.	", "Rial Omani");
+                return new Currency("OMR", "512", 3, "ر.ع.", "Rial Omani");
             }
         }

@@ -1053,7 +1053,7 @@
         {
             get
             {
-                return new Currency("PYG", "600", 0, "₲	", "Guarani");
+                return new Currency("PYG", "600", 0, "₲", "Guarani");
             }
         }

@@ -1062,7 +1062,7 @@
         {
             get
             {
-                return new Currency("QAR", "634", 2, "ر.ق	", "Qatari Rial");
+                return new Currency("QAR", "634", 2, "ر.ق", "Qatari Rial");
             }
         }

@@ -1107,7 +1107,7 @@
         {
             get
             {
-                return new Currency("SAR", "682", 2, "ر.س	", "Saudi Riyal");
+                return new Currency("SAR", "682", 2, "ر.س", "Saudi Riyal");
             }
         }

@@ -1224,7 +1224,7 @@
         {
             get
             {
-                return new Currency("SYP", "760", 2, "ل.س	", "Syrian Pound");
+                return new Currency("SYP", "760", 2, "ل.س", "Syrian Pound");
             }
         }

@@ -1242,7 +1242,7 @@
         {
             get
             {
-                return new Currency("THB", "764", 2, "฿	", "Baht");
+                return new Currency("THB", "764", 2, "฿", "Baht");
             }
         }

@@ -1269,7 +1269,7 @@
         {
             get
             {
-                return new Currency("TND", "788", 3, "د.ت	", "Tunisian Dinar");
+                return new Currency("TND", "788", 3, "د.ت", "Tunisian Dinar");
             }
         }

@@ -1287,7 +1287,7 @@
         {
             get
             {
-                return new Currency("TRY", "949", 2, "₤	", "Turkish Lira");
+                return new Currency("TRY", "949", 2, "₤", "Turkish Lira");
             }
         }

@@ -1323,7 +1323,7 @@
         {
             get
             {
-                return new Currency("UAH", "980", 2, "₴	", "Hryvnia");
+                return new Currency("UAH", "980", 2, "₴", "Hryvnia");
             }
         }

@@ -1395,7 +1395,7 @@
         {
             get
             {
-                return new Currency("VND", "704", 0, "₫	", "Dong");
+                return new Currency("VND", "704", 0, "₫", "Dong");
             }
         }

@@ -1575,7 +1575,7 @@
         {
             get
             {
-                return new Currency("YER", "886", 2, "﷼	", "Yemeni Rial");
+                return new Currency("YER", "886", 2, "﷼", "Yemeni Rial");
             }
         }


removed redundant code

removed redundant code

--- src/biz.dfch.CS.Abiquo.Client/BaseAbiquoClient.cs
+++ src/biz.dfch.CS.Abiquo.Client/BaseAbiquoClient.cs
@@ -13,14 +13,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-using biz.dfch.CS.Abiquo.Client.Authentication;
+
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Diagnostics.Contracts;
 using System.Linq;
 using System.Text;
+using biz.dfch.CS.Abiquo.Client.Authentication;
 using biz.dfch.CS.Abiquo.Client.General;
 using biz.dfch.CS.Abiquo.Client.v1;
 using biz.dfch.CS.Abiquo.Client.v1.Model;
@@ -663,7 +663,7 @@
         /// <param name="virtualMachine">the virtual machine</param>
         /// <param name="force">If true, soft limits of virtual datacenters could be surpassed</param>
         /// <returns>Task containing information about the status of the deployment</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task DeployVirtualMachine(VirtualMachine virtualMachine, bool force);
+        public abstract Task DeployVirtualMachine(VirtualMachine virtualMachine, bool force);

         /// <summary>
         /// Initiates deplyoment of a specific virtual machine
@@ -673,7 +673,7 @@
         /// <param name="virtualMachineId">Id of the virtual machine</param>
         /// <param name="force">If true, soft limits of virtual datacenters could be surpassed</param>
         /// <returns>Task containing information about the status of the deployment</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task DeployVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, bool force);
+        public abstract Task DeployVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, bool force);

         /// <summary>
         /// Deployment of a specific virtual machine
@@ -682,7 +682,7 @@
         /// <param name="force">If true, soft limits of virtual datacenters could be surpassed</param>
         /// <param name="waitForCompletion">Set to true for waiting until task got completed</param>
         /// <returns>Task containing information about the status of the deployment</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task DeployVirtualMachine(VirtualMachine virtualMachine, bool force, bool waitForCompletion);
+        public abstract Task DeployVirtualMachine(VirtualMachine virtualMachine, bool force, bool waitForCompletion);

         /// <summary>
         /// Deployment of a specific virtual machine
@@ -693,7 +693,7 @@
         /// <param name="waitForCompletion">Set to true for waiting until task got completed</param>
         /// <param name="force">If true, soft limits of virtual datacenters could be surpassed</param>
         /// <returns>Task containing information about the status of the deployment</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task DeployVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, bool force, bool waitForCompletion);
+        public abstract Task DeployVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, bool force, bool waitForCompletion);

         /// <summary>
         /// Initiates update of a specific virtual machine
@@ -701,7 +701,7 @@
         /// <param name="virtualMachine">Virtual machine configuration and machine to update</param>
         /// <param name="force">If true, update is forced</param>
         /// <returns></returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task UpdateVirtualMachine(VirtualMachine virtualMachine, bool force);
+        public abstract Task UpdateVirtualMachine(VirtualMachine virtualMachine, bool force);

         /// <summary>
         /// Initiates update of a specific virtual machine
@@ -712,7 +712,7 @@
         /// <param name="virtualMachine">Virtual machine configuration</param>
         /// <param name="force">If true, update is forced</param>
         /// <returns>Task containing information about the status of the update</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task UpdateVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, VirtualMachine virtualMachine, bool force);
+        public abstract Task UpdateVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, VirtualMachine virtualMachine, bool force);

         /// <summary>
         /// Update a specific virtual machine
@@ -721,7 +721,7 @@
         /// <param name="force">If true, update is forced</param>
         /// <param name="waitForCompletion">Set to true for waiting until task got completed</param>
         /// <returns>Task containing information about the status of the update</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task UpdateVirtualMachine(VirtualMachine virtualMachine, bool force, bool waitForCompletion);
+        public abstract Task UpdateVirtualMachine(VirtualMachine virtualMachine, bool force, bool waitForCompletion);

         /// <summary>
         /// Update a specific virtual machine
@@ -733,7 +733,7 @@
         /// <param name="force">If true, update is forced</param>
         /// <param name="waitForCompletion">Set to true for waiting until task got completed</param>
         /// <returns>Task containing information about the status of the update</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task UpdateVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, VirtualMachine virtualMachine, bool force, bool waitForCompletion);
+        public abstract Task UpdateVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, VirtualMachine virtualMachine, bool force, bool waitForCompletion);

         /// <summary>
         /// Initiates state change of a specific virtual machine
@@ -741,7 +741,7 @@
         /// <param name="virtualMachine">Target virtual machine</param>
         /// <param name="state">Target state</param>
         /// <returns></returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineStateEnum state);
+        public abstract Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineStateEnum state);

         /// <summary>
         /// Initiates state change of a specific virtual machine
@@ -749,7 +749,7 @@
         /// <param name="virtualMachine">Target virtual machine</param>
         /// <param name="state">Target state</param>
         /// <returns>Task containing information about the status of the state change</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineState state);
+        public abstract Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineState state);

         /// <summary>
         /// Initiates state change of a specific virtual machine
@@ -759,7 +759,7 @@
         /// <param name="virtualMachineId">Id of the virtual machine</param>
         /// <param name="state">Target state</param>
         /// <returns>Task containing information about the status of the state change</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task ChangeStateOfVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, VirtualMachineState state);
+        public abstract Task ChangeStateOfVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, VirtualMachineState state);

         /// <summary>
         /// VirtualMachine virtualMachine, VirtualMachineStateEnum state, bool waitForCompletion
@@ -768,7 +768,7 @@
         /// <param name="state">Target state</param>
         /// <param name="waitForCompletion">Set to true for waiting until task got completed</param>
         /// <returns>Task containing information about the status of the state change</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineStateEnum state, bool waitForCompletion);
+        public abstract Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineStateEnum state, bool waitForCompletion);

         /// <summary>
         /// Initiates state change of a specific virtual machine
@@ -777,7 +777,7 @@
         /// <param name="state">Target state</param>
         /// <param name="waitForCompletion">Set to true for waiting until task got completed</param>
         /// <returns>Task containing information about the status of the state change</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineState state, bool waitForCompletion);
+        public abstract Task ChangeStateOfVirtualMachine(VirtualMachine virtualMachine, VirtualMachineState state, bool waitForCompletion);

         /// <summary>
         /// Changes state of a specific virtual machine
@@ -788,7 +788,7 @@
         /// <param name="state">Target state</param>
         /// <param name="waitForCompletion">Set to true for waiting until task got completed</param>
         /// <returns>Task containing information about the status of the state change</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task ChangeStateOfVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, VirtualMachineState state, bool waitForCompletion);
+        public abstract Task ChangeStateOfVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, VirtualMachineState state, bool waitForCompletion);

         /// <summary>
         /// Delete a virtual machine
@@ -898,7 +898,7 @@
         /// <param name="virtualMachine">Virtual machine</param>
         /// <param name="taskId">id of the task</param>
         /// <returns>Task</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task GetTaskOfVirtualMachine(VirtualMachine virtualMachine, string taskId);
+        public abstract Task GetTaskOfVirtualMachine(VirtualMachine virtualMachine, string taskId);

         /// <summary>
         /// Retrieve a task by Id of a specific virtual machine
@@ -908,7 +908,7 @@
         /// <param name="virtualMachineId">Id of the virtual mahcine</param>
         /// <param name="taskId">Id of the task</param>
         /// <returns>Task</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task GetTaskOfVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, string taskId);
+        public abstract Task GetTaskOfVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int virtualMachineId, string taskId);

         #endregion VirtualMachines

@@ -1060,7 +1060,7 @@
         /// <param name="taskPollingWaitTimeMilliseconds">Polling wait time in milliseconds</param>
         /// <param name="taskPollingTimeoutMilliseconds">timeout in milliseconds</param>
         /// <returns>Completed Task</returns>
-        public abstract biz.dfch.CS.Abiquo.Client.v1.Model.Task WaitForTaskCompletion(biz.dfch.CS.Abiquo.Client.v1.Model.Task task, int taskPollingWaitTimeMilliseconds, int taskPollingTimeoutMilliseconds);
+        public abstract Task WaitForTaskCompletion(Task task, int taskPollingWaitTimeMilliseconds, int taskPollingTimeoutMilliseconds);

         #endregion Tasks


Consolidate parsing code

Consolidate parsing code

This has two behavioural changes:

1. Multiple banned API files may be found within the project
2. The analyzer continues even if it finds duplicate entries

Duplicate entries still cause diagnostics. They just don't halt analysis
any more.

--- src/Roslyn.Diagnostics.Analyzers/Core/SymbolIsBannedAnalyzer.cs
+++ src/Roslyn.Diagnostics.Analyzers/Core/SymbolIsBannedAnalyzer.cs
@@ -5,7 +5,6 @@
 using System.Collections.Immutable;
 using System.IO;
 using System.Linq;
-using System.Threading;
 using Analyzer.Utilities;
 using Analyzer.Utilities.Extensions;
 using Microsoft.CodeAnalysis;
@@ -55,27 +54,7 @@

         private static void OnCompilationStart(CompilationStartAnalysisContext compilationContext)
         {
-            var additionalFiles = compilationContext.Options.AdditionalFiles;
-
-            if (!TryGetApiData(additionalFiles, compilationContext.CancellationToken, out ApiData apiData))
-            {
-                return;
-            }
-
-            if (!ValidateApiFiles(apiData, out List<Diagnostic> errors))
-            {
-                compilationContext.RegisterCompilationEndAction(context =>
-                {
-                    foreach (Diagnostic cur in errors)
-                    {
-                        context.ReportDiagnostic(cur);
-                    }
-                });
-
-                return;
-            }
-
-            var bannedSymbols = ResolveBannedApis(compilationContext.Compilation, apiData, compilationContext.CancellationToken);
+            var bannedSymbols = ReadBannedApis(compilationContext);

             if (bannedSymbols.Count > 0)
             {
@@ -127,22 +106,59 @@
             }
         }

-        private static ImmutableHashSet<ISymbol> ResolveBannedApis(Compilation compilation, ApiData apiData, CancellationToken cancellationToken)
-        {
-            var bannedApisBuilder = ImmutableHashSet.CreateBuilder<ISymbol>();
-            foreach (var apiString in apiData.ApiList)
-            {
-                cancellationToken.ThrowIfCancellationRequested();
-
-                var symbols = DocumentationCommentId.GetSymbolsForDeclarationId(apiString.Text, compilation);
+        private static ImmutableHashSet<ISymbol> ReadBannedApis(CompilationStartAnalysisContext context)
+        {
+            var query =
+                from additionalFile in context.Options.AdditionalFiles
+                where StringComparer.Ordinal.Equals(Path.GetFileName(additionalFile.Path), BannedSymbolsFileName)
+                let sourceText = additionalFile.GetText(context.CancellationToken)
+                where sourceText != null
+                from line in sourceText.Lines
+                let text = line.ToString()
+                where !string.IsNullOrWhiteSpace(text)
+                select new ApiLine(text, line.Span, sourceText, additionalFile.Path);
+
+            var apiLines = query.ToList();
+
+            if (apiLines.Count == 0)
+            {
+                return ImmutableHashSet<ISymbol>.Empty;
+            }
+
+            var lineById = new Dictionary<string, ApiLine>(StringComparer.Ordinal);
+            var errors = new List<Diagnostic>();
+            var bannedSymbols = ImmutableHashSet.CreateBuilder<ISymbol>();
+
+            foreach (var line in apiLines)
+            {
+                if (lineById.TryGetValue(line.Text, out ApiLine existingLine))
+                {
+                    errors.Add(Diagnostic.Create(DuplicateBannedSymbolRule, line.Location, new[] { existingLine.Location }, line.Text));
+                    continue;
+                }
+
+                lineById.Add(line.Text, line);
+
+                var symbols = DocumentationCommentId.GetSymbolsForDeclarationId(line.Text, context.Compilation);
                 if (!symbols.IsDefaultOrEmpty)
                 {
-                    bannedApisBuilder.UnionWith(symbols);
-                }
-            }
-
-            var bannedApis = bannedApisBuilder.ToImmutable();
-            return bannedApis;
+                    bannedSymbols.UnionWith(symbols);
+                }
+            }
+
+            if (errors.Count != 0)
+            {
+                context.RegisterCompilationEndAction(
+                    endContext =>
+                    {
+                        foreach (var error in errors)
+                        {
+                            endContext.ReportDiagnostic(error);
+                        }
+                    });
+            }
+
+            return bannedSymbols.ToImmutable();
         }

         private static void AnalyzeOperation(OperationAnalysisContext oac, ImmutableHashSet<ISymbol> bannedSymbols, SymbolDisplayFormat symbolDisplayFormat)
@@ -175,102 +191,7 @@
             }
         }

-        private static ApiData ReadApiData(string path, SourceText sourceText)
-        {
-            ImmutableArray<ApiLine>.Builder apiBuilder = ImmutableArray.CreateBuilder<ApiLine>();
-
-            foreach (TextLine line in sourceText.Lines)
-            {
-                string text = line.ToString();
-                if (string.IsNullOrWhiteSpace(text))
-                {
-                    continue;
-                }
-
-                var apiLine = new ApiLine(text, line.Span, sourceText, path);
-                apiBuilder.Add(apiLine);
-            }
-
-            return new ApiData(apiBuilder.ToImmutable());
-        }
-
-        private static bool TryGetApiData(ImmutableArray<AdditionalText> additionalTexts, CancellationToken cancellationToken, out ApiData apiData)
-        {
-            if (!TryGetApiText(additionalTexts, cancellationToken, out AdditionalText apiText))
-            {
-                apiData = default(ApiData);
-                return false;
-            }
-
-            var sourceText = apiText.GetText(cancellationToken);
-            if (sourceText == null)
-            {
-                apiData = default(ApiData);
-                return false;
-            }
-
-            apiData = ReadApiData(apiText.Path, sourceText);
-            return true;
-        }
-
-        private static bool TryGetApiText(ImmutableArray<AdditionalText> additionalTexts, CancellationToken cancellationToken, out AdditionalText apiText)
-        {
-            apiText = null;
-
-            StringComparer comparer = StringComparer.Ordinal;
-            foreach (AdditionalText text in additionalTexts)
-            {
-                cancellationToken.ThrowIfCancellationRequested();
-
-                string fileName = Path.GetFileName(text.Path);
-                if (comparer.Equals(fileName, BannedSymbolsFileName))
-                {
-                    apiText = text;
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        private static bool ValidateApiFiles(ApiData apiData, out List<Diagnostic> errors)
-        {
-            errors = new List<Diagnostic>();
-            var publicApiMap = new Dictionary<string, ApiLine>(StringComparer.Ordinal);
-            ValidateApiList(publicApiMap, apiData.ApiList, errors);
-
-            return errors.Count == 0;
-        }
-
-        private static void ValidateApiList(Dictionary<string, ApiLine> publicApiMap, ImmutableArray<ApiLine> apiList, List<Diagnostic> errors)
-        {
-            foreach (ApiLine cur in apiList)
-            {
-                if (publicApiMap.TryGetValue(cur.Text, out ApiLine existingLine))
-                {
-                    LinePositionSpan existingLinePositionSpan = existingLine.SourceText.Lines.GetLinePositionSpan(existingLine.Span);
-                    Location existingLocation = Location.Create(existingLine.Path, existingLine.Span, existingLinePositionSpan);
-
-                    LinePositionSpan duplicateLinePositionSpan = cur.SourceText.Lines.GetLinePositionSpan(cur.Span);
-                    Location duplicateLocation = Location.Create(cur.Path, cur.Span, duplicateLinePositionSpan);
-                    errors.Add(Diagnostic.Create(DuplicateBannedSymbolRule, duplicateLocation, new[] { existingLocation }, cur.Text));
-                }
-                else
-                {
-                    publicApiMap.Add(cur.Text, cur);
-                }
-            }
-        }
-
-        private class ApiData
-        {
-            public ApiData(ImmutableArray<ApiLine> apiList)
-                => ApiList = apiList;
-
-            public ImmutableArray<ApiLine> ApiList { get; }
-        }
-
-        private class ApiLine
+        private sealed class ApiLine
         {
             public TextSpan Span { get; }
             public SourceText SourceText { get; }
@@ -284,6 +205,8 @@
                 SourceText = sourceText;
                 Path = path;
             }
+
+            public Location Location => Location.Create(Path, Span, SourceText.Lines.GetLinePositionSpan(Span));
         }
     }
 }


enhanced odata enum in request uri ($filter for example)

--- src/Server/Bit.OData/Implementations/DefaultODataUriResolver.cs
+++ src/Server/Bit.OData/Implementations/DefaultODataUriResolver.cs
@@ -1,8 +1,8 @@
-using Microsoft.OData.UriParser;
+using Microsoft.AspNet.OData;

 namespace Bit.OData.Implementations
 {
-    public class DefaultODataUriResolver : UnqualifiedODataUriResolver
+    public class DefaultODataUriResolver : UnqualifiedCallAndEnumPrefixFreeResolver
     {
         public override bool EnableCaseInsensitive
         {


Don't check stdout for entire string contents (#30023)

--- src/Servers/IIS/IIS/test/Common.FunctionalTests/StartupTests.cs
+++ src/Servers/IIS/IIS/test/Common.FunctionalTests/StartupTests.cs
@@ -1006,9 +1006,14 @@

             StopServer();

-            var expectedString = new string('a', 30000);
-            Assert.Contains(TestSink.Writes, context => context.Message.Contains(expectedString));
-            EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessThreadExitStdOut(deploymentResult, "12", expectedString), Logger);
+            // Logs can be split due to the ANCM logging occuring at the same time as logs from the app, so check for a portion of the
+            // string instead of the entire string. The entire string will still be present in the event log.
+            var expectedLogString = new string('a', 16);
+
+            Assert.Contains(TestSink.Writes, context => context.Message.Contains(expectedLogString));
+            var expectedEventLogString = new string('a', 30000);
+
+            EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessThreadExitStdOut(deploymentResult, "12", expectedEventLogString), Logger);
         }

         [ConditionalTheory]
@@ -1027,10 +1032,16 @@
             await AssertFailsToStart(deploymentResult);

             var contents = GetLogFileContent(deploymentResult);
-            var expectedString = new string('a', 30000);
-
-            Assert.Contains(expectedString, contents);
-            EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessThreadExitStdOut(deploymentResult, "12", expectedString), Logger);
+
+            // Logs can be split due to the ANCM logging occuring at the same time as logs from the app, so check for a portion of the
+            // string instead of the entire string. The entire string will still be present in the event log.
+            var expectedLogString = new string('a', 16);
+
+            Assert.Contains(expectedLogString, contents);
+
+            var expectedEventLogString = new string('a', 30000);
+
+            EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessThreadExitStdOut(deploymentResult, "12", expectedEventLogString), Logger);
         }

         [ConditionalFact]
@@ -1202,7 +1213,7 @@
             var deploymentParameters = Fixture.GetBaseDeploymentParameters(hostingModel);
             deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_IIS_HTTPAUTH"] = "shouldberemoved";

-            Assert.DoesNotContain("shouldberemoved", await GetStringAsync(deploymentParameters,"/GetEnvironmentVariable?name=ASPNETCORE_IIS_HTTPAUTH"));
+            Assert.DoesNotContain("shouldberemoved", await GetStringAsync(deploymentParameters, "/GetEnvironmentVariable?name=ASPNETCORE_IIS_HTTPAUTH"));
         }

         [ConditionalFact]
@@ -1314,7 +1325,8 @@
             deploymentParameters.AddHttpsToServerConfig();
             deploymentParameters.SetWindowsAuth(false);
             deploymentParameters.AddServerConfigAction(
-                (element, root) => {
+                (element, root) =>
+                {
                     element.Descendants("site").Single().Element("application").SetAttributeValue("path", "/" + appName);
                     Helpers.CreateEmptyApplication(element, root);
                 });
@@ -1332,7 +1344,8 @@
             var deploymentParameters = Fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess);

             deploymentParameters.AddServerConfigAction(
-                element => {
+                element =>
+                {
                     element.Descendants("bindings")
                         .Single()
                         .GetOrAdd("binding", "protocol", "https")
@@ -1358,7 +1371,8 @@
             deploymentParameters.ApplicationBaseUriHint = $"http://localhost:{TestPortHelper.GetNextPort()}/";

             deploymentParameters.AddServerConfigAction(
-                element => {
+                element =>
+                {
                     element.Descendants("bindings")
                         .Single()
                         .AddAndGetInnerElement("binding", "protocol", "https")
@@ -1403,7 +1417,8 @@
             var deploymentParameters = Fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess);

             deploymentParameters.AddServerConfigAction(
-                element => {
+                element =>
+                {
                     element.Descendants("bindings")
                         .Single()
                         .Add(


准备添加一个聊天的消息缓存。

准备添加一个聊天的消息缓存。

--- 软件系统服务端模版/FormServerWindow.cs
+++ 软件系统服务端模版/FormServerWindow.cs
@@ -968,6 +968,23 @@

         #endregion

+        #region 服务器临时聊天消息存储块
+
+        private SoftMsgQueue<string> Chats_Managment { get; set; }
+
+        private void ChatInitialization()
+        {
+            Chats_Managment = new SoftMsgQueue<string>()
+            {
+                MaxCache = 200,//记录200条临时消息
+                FileSavePath = Application.StartupPath + @"\chats.txt"//设置保存的路径
+            };
+            Chats_Managment.LoadByFile();//加载以前的数据
+        }
+
+
+        #endregion
+

         /*********************************************************************************************************
          *


remove selecting code that breaks navigation.

--- WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
+++ WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
@@ -62,10 +62,6 @@
 			_bottomItems.Add(addWalletPage);
 			_bottomItems.Add(settingsPage);

-			Router.CurrentViewModel
-				.OfType<NavBarItemViewModel>()
-				.Subscribe(x => SelectItem(x, walletManager));
-
 			this.WhenAnyValue(x => x.SelectedItem)
 				.OfType<NavBarItemViewModel>()
 				.Subscribe(NavigateItem);


コメント追記。

コメント追記。

--- YKToolkit.Controls/ExtendedControls/ColorMap/ColorMap.cs
+++ YKToolkit.Controls/ExtendedControls/ColorMap/ColorMap.cs
@@ -427,6 +427,9 @@
             colorMap.UpdateRendering_GraphBitmap();
         }

+        /// <summary>
+        /// 新しいインスタンスを生成します。
+        /// </summary>
         public ColorMap()
         {
             #region メインコンテナの初期化
@@ -474,7 +477,6 @@
             }

             #endregion デザインモードのときは実行しない
-

             YKToolkit.Controls.ThemeManager.Instance.ThemeChanged += OnThemeChanged;
         }


track pruning stats per block

track pruning stats per block

--- BitSharp.Core/Workers/PruningWorker.cs
+++ BitSharp.Core/Workers/PruningWorker.cs
@@ -80,14 +80,9 @@
                 return;

             var totalStopwatch = Stopwatch.StartNew();
-            var gatherIndexStopwatch = new Stopwatch();
-            var pruneIndexStopwatch = new Stopwatch();
-            var pruneBlocksStopwatch = new Stopwatch();
-            var commitStopwatch = new Stopwatch();

             var startHeight = this.prunedChain.Height;
             var stopHeight = this.prunedChain.Height;
-            var txCount = 0;

             // get the current processed chain
             var processedChain = this.coreDaemon.CurrentChain;
@@ -118,10 +113,7 @@
                 if (direction > 0)
                 {
                     // prune the block
-                    int pruneBlockTxCount;
-                    this.PruneBlock(mode, processedChain, chainedHeader, out pruneBlockTxCount, gatherIndexStopwatch, pruneIndexStopwatch, pruneBlocksStopwatch, commitStopwatch);
-                    txCount += pruneBlockTxCount;
-                    txCountMeasure.Tick(pruneBlockTxCount);
+                    this.PruneBlock(mode, processedChain, chainedHeader);

                     // track pruned block
                     this.prunedChain.AddBlock(chainedHeader);
@@ -156,30 +148,20 @@
             // log if pruning was done
             if (stopHeight > startHeight)
             {
-                var txRate = txCount / totalStopwatch.Elapsed.TotalSeconds;
-                txRateMeasure.Tick((float)txRate);
-                gatherIndexDurationMeasure.Tick(gatherIndexStopwatch.Elapsed);
-                pruneIndexDurationMeasure.Tick(pruneIndexStopwatch.Elapsed);
-                pruneBlocksDurationMeasure.Tick(pruneBlocksStopwatch.Elapsed);
-                commitDurationMeasure.Tick(commitStopwatch.Elapsed);
-                totalDurationMeasure.Tick(totalStopwatch.Elapsed);
-
                 if (isLagging || DateTime.Now - lastLogTime > TimeSpan.FromSeconds(15))
                 {
-                    this.logger.Debug(measure.GetAverage().TotalMilliseconds);
-
                     lastLogTime = DateTime.Now;
                     this.logger.Info(
 @"Pruned from block {0:#,##0} to {1:#,##0}:
-- tx count:       {2,8:#,##0}
-- tx count/block: {3,8:#,##0}
-- avg tx rate:    {4,8:#,##0}/s
-- gather index:   {5,12:#,##0.000}s
-- prune blocks:   {6,12:#,##0.000}s
-- prune index:    {7,12:#,##0.000}s
-- commit:         {8,12:#,##0.000}s
-- TOTAL:          {9,12:#,##0.000}s"
-                        .Format2(startHeight, stopHeight, txCount, txCountMeasure.GetAverage(), txRateMeasure.GetAverage(), gatherIndexDurationMeasure.GetAverage().TotalSeconds, pruneBlocksDurationMeasure.GetAverage().TotalSeconds, pruneIndexDurationMeasure.GetAverage().TotalSeconds, commitDurationMeasure.GetAverage().TotalSeconds, totalDurationMeasure.GetAverage().TotalSeconds));
+- avg tx rate:    {2,8:#,##0}/s
+- per block stats:
+- tx count:       {3,8:#,##0}
+- gather index:   {4,12:#,##0.000}s
+- prune blocks:   {5,12:#,##0.000}s
+- prune index:    {6,12:#,##0.000}s
+- commit:         {7,12:#,##0.000}s
+- TOTAL:          {8,12:#,##0.000}s"
+                        .Format2(startHeight, stopHeight, txRateMeasure.GetAverage(), txCountMeasure.GetAverage(), gatherIndexDurationMeasure.GetAverage().TotalSeconds, pruneBlocksDurationMeasure.GetAverage().TotalSeconds, pruneIndexDurationMeasure.GetAverage().TotalSeconds, commitDurationMeasure.GetAverage().TotalSeconds, totalDurationMeasure.GetAverage().TotalSeconds));
                 }

                 //TODO better way to block chain state worker when pruning is behind
@@ -195,10 +177,16 @@
             //TODO add periodic stats logging like ChainStateBuilder has
         }

-        private DurationMeasure measure = new DurationMeasure();
-        private void PruneBlock(PruningMode mode, Chain chain, ChainedHeader pruneBlock, out int txCount, Stopwatch gatherIndexStopwatch, Stopwatch pruneIndexStopwatch, Stopwatch pruneBlocksStopwatch, Stopwatch commitStopwatch)
+        private void PruneBlock(PruningMode mode, Chain chain, ChainedHeader pruneBlock)
         {
             //TODO the replay information about blocks that have been rolled back also needs to be pruned (UnmintedTx)
+
+            var txCount = 0;
+            var totalStopwatch = Stopwatch.StartNew();
+            var gatherIndexStopwatch = new Stopwatch();
+            var pruneIndexStopwatch = new Stopwatch();
+            var pruneBlocksStopwatch = new Stopwatch();
+            var commitStopwatch = new Stopwatch();

             // retrieve the spent txes for this block
             IImmutableList<UInt256> spentTxes;
@@ -345,6 +333,15 @@
                 //throw new InvalidOperationException();
                 txCount = 0;
             }
+
+            // track stats
+            txCountMeasure.Tick(txCount);
+            txRateMeasure.Tick((float)(txCount / totalStopwatch.Elapsed.TotalSeconds));
+            gatherIndexDurationMeasure.Tick(gatherIndexStopwatch.Elapsed);
+            pruneIndexDurationMeasure.Tick(pruneIndexStopwatch.Elapsed);
+            pruneBlocksDurationMeasure.Tick(pruneBlocksStopwatch.Elapsed);
+            commitDurationMeasure.Tick(commitStopwatch.Elapsed);
+            totalDurationMeasure.Tick(totalStopwatch.Elapsed);
         }
     }
 }


Addresses code review comments on HttpContent.ReadAsFormDataAsync

--- src/System.Net.Http.Formatting/HttpContentFormDataExtensions.cs
+++ src/System.Net.Http.Formatting/HttpContentFormDataExtensions.cs
@@ -38,10 +38,11 @@

         /// <summary>
         /// Returns a <see cref="Task{T}"/> that will yield a <see cref="NameValueCollection"/> instance containing the form data
-        /// from the <paramref name="content"/> instance.
+        /// parsed as HTML form URL-encoded from the <paramref name="content"/> instance.
         /// </summary>
         /// <param name="content">The content.</param>
-        /// <returns>A <see cref="Task{T}"/> which will provide the result.</returns>
+        /// <returns>A <see cref="Task{T}"/> which will provide the result. If the data can not be read
+        /// as HTML form URL-encoded data then the result is null.</returns>
         public static Task<NameValueCollection> ReadAsFormDataAsync(this HttpContent content)
         {
             if (content == null)
@@ -49,7 +50,8 @@
                 throw Error.ArgumentNull("content");
             }

-            return content.ReadAsAsync<FormDataCollection>()
+            MediaTypeFormatter[] formatters = new MediaTypeFormatter[1] { new FormUrlEncodedMediaTypeFormatter() };
+            return content.ReadAsAsync<FormDataCollection>(formatters)
                 .Then(formdata => formdata != null ? formdata.ReadAsNameValueCollection() : null);
         }
     }


Fix build break from NuGet API change

Fix build break from NuGet API change

See https://github.com/dotnet/sdk/pull/618#issuecomment-271464731 for details

--- src/Tasks/Microsoft.NET.Build.Tasks/DependencyContextBuilder.cs
+++ src/Tasks/Microsoft.NET.Build.Tasks/DependencyContextBuilder.cs
@@ -32,7 +32,7 @@
             _projectContext = projectContext;

             // This resolver is only used for building file names, so that base path is not required.
-            _versionFolderPathResolver = new VersionFolderPathResolver(path: null);
+            _versionFolderPathResolver = new VersionFolderPathResolver(rootPath: null);
         }

         public DependencyContextBuilder WithFrameworkReferences(IEnumerable<ReferenceInfo> frameworkReferences)
@@ -462,4 +462,4 @@
             return path + trailingCharacter;
         }
     }
-}+}


Add friction

Add friction

--- MadCat/NutEngine/Physics/Collider/ResolveCollision.cs
+++ MadCat/NutEngine/Physics/Collider/ResolveCollision.cs
@@ -21,8 +21,21 @@

             float j = -(1 + e) * velocityAlongNormal / (collision.A.Mass.MassInv + collision.B.Mass.MassInv);

-            collision.A.Velocity -= j * collision.Manifold.Normal * collision.A.Mass.MassInv;
-            collision.B.Velocity += j * collision.Manifold.Normal * collision.B.Mass.MassInv;
+            collision.A.ApplyImpulse(-j * collision.Manifold.Normal);
+            collision.B.ApplyImpulse(j * collision.Manifold.Normal);
+
+            var tangent = relVelocity - (collision.Manifold.Normal * Vector2.Dot(relVelocity, collision.Manifold.Normal));
+            tangent.Normalize();
+
+            float jt = -Vector2.Dot(relVelocity, tangent) / (collision.A.Mass.MassInv + collision.B.Mass.MassInv);
+
+            var staticFriction = (float)Math.Sqrt(collision.A.Material.StaticFriction * collision.B.Material.StaticFriction);
+            var dynamicFriction = (float)Math.Sqrt(collision.A.Material.DynamicFriction * collision.B.Material.DynamicFriction);
+
+            var tangentImpulse = Math.Abs(jt) < j * staticFriction ? tangent * jt : tangent * (-j) * dynamicFriction;
+
+            collision.A.ApplyImpulse(-tangentImpulse);
+            collision.B.ApplyImpulse(tangentImpulse);
         }
     }
 }


Checking if db file exists before opening it.

--- MIG.HomeAutomation/ZWave.cs
+++ MIG.HomeAutomation/ZWave.cs
@@ -1316,7 +1316,10 @@

         private List<XElement> GetDeviceInfoInDb(string filename, string manufacturerId, string version)
         {
+            var res = new List<XElement>();
             var dbFile = new FileInfo (filename);
+            if (!dbFile.Exists)
+                return res;
             XDocument db;
             using (var reader = dbFile.OpenText ())
             {
@@ -1334,7 +1337,7 @@
                 query += string.Format(" and deviceData/appVersion[@value=\"{0}\"] and deviceData/appSubVersion[@value=\"{1}\"]", vParts[0], vParts[1]);
             }
             var baseQuery = string.Format("//ZWaveDevice[ {0} ]", query);
-            var res = db.XPathSelectElements (baseQuery).ToList();
+            res = db.XPathSelectElements (baseQuery).ToList();
             MigService.Log.Debug("Found {0} elements in {1} with query {2}", res.Count, filename, baseQuery);

             if (res.Count == 0)


* Fixes #20 - На пустой БД не создается пользователь по умолчанию

--- BuildRevisionCounter/MongoDBStorage.cs
+++ BuildRevisionCounter/MongoDBStorage.cs
@@ -18,15 +18,21 @@
 		{
 			Revisions = database.GetCollection<RevisionModel>("revisions");
 			Users = database.GetCollection<UserModel>("users");
+
+			Task.Run(() => SetUp()).Wait();
 		}

 		public async Task SetUp()
 		{
+			await EnsureUsersIndex();
+			await EnsureAdminUser();
+		}
+
+		public async Task EnsureUsersIndex()
+		{
 			await Users.Indexes.CreateOneAsync(
 				Builders<UserModel>.IndexKeys.Ascending(u => u.Name),
-				new CreateIndexOptions {Unique = true});
-
-			await EnsureAdminUser();
+				new CreateIndexOptions { Unique = true,  });
 		}

 		public async Task EnsureAdminUser()


Improve Compression request handling

Improve Compression request handling

--- Bundler.AspNet/AspNetBundlerHandler.cs
+++ Bundler.AspNet/AspNetBundlerHandler.cs
@@ -1,5 +1,6 @@
 using System;
 using System.IO.Compression;
+using System.Linq;
 using System.Web;
 using Bundler.Infrastructure;
 using Bundler.Infrastructure.Server;
@@ -106,9 +107,15 @@
             if (allowedEncodings == CompressionAlgorithm.None) {
                 return;
             }
-
+
+            var supportedEncodingsRaw = context.Request.Headers["Accept-Encoding"]?.ToLower() ?? string.Empty;
+            var supportedEncodings = supportedEncodingsRaw
+                .Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries)
+                .Select(x => x.Trim())
+                .ToList();
+
             // TODO: Add weight
-            var supportedEncodings = context.Response.Headers["Accept-Encoding"]?.ToLower() ?? string.Empty;
+
             if (allowedEncodings.HasFlag(CompressionAlgorithm.Gzip) && supportedEncodings.Contains("gzip")) {
                 context.Response.Filter = new GZipStream(context.Response.Filter, _bundleContext.Configuration.Get(CompressionConfiguration.CompressionLevel));
                 context.Response.AppendHeader("Content-Encoding", "gzip");


Redraw after organizations are loaded

Redraw after organizations are loaded

--- src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PublishView.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PublishView.cs
@@ -117,6 +117,8 @@
                 owners = new[] { OwnersDefaultText, username }.Union(publishOwners).ToArray();

                 isBusy = false;
+
+                Redraw();
             }, exception =>
             {
                 isBusy = false;


constant

constant

--- src/VisualStudio/Core/Impl/CodeModel/ProjectCodeModelFactory.cs
+++ src/VisualStudio/Core/Impl/CodeModel/ProjectCodeModelFactory.cs
@@ -66,6 +66,8 @@
         private Task ProcessNextDocumentBatchAsync(
             ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
         {
+            const int MinimumDelayBetweenProcessing = 50;
+
             // Now, enqueue foreground work to actually process these documents in a serialized and incremental
             // fashion.  FireEventsForDocument will actually limit how much time it spends firing events so that it
             // doesn't saturate the UI thread.
@@ -82,12 +84,12 @@
                     // As long as we have events to fire for this document, keep yielding so we don't
                     // bog down the UI thread.
                     while (FireEventsForDocument(documentId))
-                        await Task.Delay(15).ConfigureAwait(true);
+                        await Task.Delay(MinimumDelayBetweenProcessing).ConfigureAwait(true);

                     // if we've also taken a lot of time processing documents on the UI thread, yield
                     // so we don't bog things down.
-                    if (stopwatch.Elapsed.TotalMilliseconds > 50)
-                        await Task.Delay(15).ConfigureAwait(true);
+                    if (stopwatch.Elapsed.TotalMilliseconds > MinimumDelayBetweenProcessing)
+                        await Task.Delay(MinimumDelayBetweenProcessing).ConfigureAwait(true);
                 }
             });


bug fix

bug fix

--- Mojo.2.0/Mojo/Mojo.Wpf/View/D3D11RenderingPaneHost.cs
+++ Mojo.2.0/Mojo/Mojo.Wpf/View/D3D11RenderingPaneHost.cs
@@ -64,14 +64,6 @@
             }
         }

-        protected void OnManipulationDelta( System.Windows.Input.ManipulationDeltaEventArgs e )
-        {
-            if ( ViewerContext != null )
-            {
-                ViewerContext.OnManipulationDelta( e, Width, Height );
-            }
-        }
-
         public System.Drawing.SizeF GetAutoScaleFactor()
         {
             return AutoScaleFactor;


opengl UI for Axis

opengl UI for Axis

--- CSharpGL/UILayout/GLControls/GLAxis.cs
+++ CSharpGL/UILayout/GLControls/GLAxis.cs
@@ -7,15 +7,26 @@

 namespace CSharpGL
 {
+    /// <summary>
+    /// opengl UI for Axis
+    /// </summary>
     public class GLAxis : UIRenderer
     {
-        //private PickableRenderer renderer;

+        /// <summary>
+        /// opengl UI for Axis
+        /// </summary>
+        /// <param name="anchor"></param>
+        /// <param name="margin"></param>
+        /// <param name="size"></param>
+        /// <param name="zNear"></param>
+        /// <param name="zFar"></param>
         public GLAxis(
             System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
             System.Drawing.Size size, int zNear, int zFar)
             : base(null, anchor, margin, size, zNear, zFar)
         {
+            this.Name = "GLAxis";
             var shaderCodes = new ShaderCode[2];
             shaderCodes[0] = new ShaderCode(ManifestResourceLoader.LoadTextFile(
 @"UILayout.GLControls.GLAxis.vert"), ShaderType.VertexShader);
@@ -25,7 +36,6 @@
             map.Add("in_Position", "position");
             map.Add("in_Color", "color");
             PickableRenderer renderer = (new Axis()).GetRenderer(shaderCodes, map, "position");
-            renderer.Name = "GLAxis";

             this.Renderer = renderer;
         }


Fix - Corretta errata visualizzazione anno corrente nel box delle richieste

--- src/backend/SO115App.Persistence.MongoDB/Box/GetBoxRichieste.cs
+++ src/backend/SO115App.Persistence.MongoDB/Box/GetBoxRichieste.cs
@@ -59,6 +59,7 @@
                 interventi.TotTurnoCorrente = listaSintesi.Count(x => x.IstanteRicezioneRichiesta.Year == DateTime.Now.Year);
                 interventi.TotTurnoPrecedente = 0;
                 interventi.Totale = listaSintesi.Count;
+                interventi.AnnoCorrente = DateTime.Now.Year;
             }

             return interventi;


1 test past :D

1 test past :D

--- 2015/Workshop5StringsAndGready/Source/Program.cs
+++ 2015/Workshop5StringsAndGready/Source/Program.cs
@@ -17,9 +17,9 @@
             ReadInput();
             CountPMatches();
             Console.WriteLine(pmatches);
-            Console.WriteLine(offsetsSum);

-            // Console.WriteLine(string.Join(" ", offsets));
+            // Console.WriteLine(offsetsSum);
+            Console.WriteLine(string.Join(" ", offsets));
         }

         private static void CountPMatches()
@@ -38,11 +38,10 @@
                         {
                             pmatches += 1;
                             var offset = CalculateOffset(textTokenIndex, patternFirstTokenIndex);
-
-                            // offsets.Add(offset + 1);
-                            offsetsSum += offset + 1;
-                            lastOffsetIndex = textTokenIndex - patternFirstTokenIndex + pattern.Length;
-                            startIndex = lastOffsetIndex;
+                            offsets.Add(offset + 1);
+
+                            // offsetsSum += offset + 1;
+                            startIndex = textTokenIndex - patternFirstTokenIndex + pattern.Length + 1;
                         }
                     }
                 }
@@ -50,14 +49,54 @@
             }
             else
             {
-                // big mess
+                for (int i = 0; i < text.Length; i++)
+                {
+                    if (IsPMatchNoTokens(i))
+                    {
+                        pmatches += 1;
+                        offsets.Add(i + 1);
+                    }
+                }
             }
+        }
+
+        private static bool IsPMatchNoTokens(int startIndex)
+        {
+            if (startIndex + pattern.Length > text.Length)
+            {
+                return false;
+            }
+
+            var corespondingMatches = new Dictionary<char, char>();
+            var patternIndex = -1;
+            for (int i = startIndex; i < startIndex + pattern.Length; i++)
+            {
+                patternIndex++;
+                var textChar = text[i];
+                var patternChar = pattern[patternIndex];
+                if (corespondingMatches.ContainsKey(textChar))
+                {
+                    if (corespondingMatches[textChar] == patternChar)
+                    {
+                        continue;
+                    }
+                    else
+                    {
+                        return false;
+                    }
+                }
+                else
+                {
+                    corespondingMatches.Add(textChar, patternChar);
+                }
+            }
+
+            return true;
         }

         private static int CalculateOffset(int textTokenIndex, int patternFirstTokenIndex)
         {
-            var lastTextIndex = textTokenIndex - patternFirstTokenIndex;
-            var offset = lastTextIndex - lastOffsetIndex;
+            var offset = textTokenIndex - patternFirstTokenIndex;
             return offset;
         }

@@ -100,12 +139,12 @@
                 }
                 else
                 {
-                    if (corespondingMatches.ContainsKey(patternChar))
+                    if (corespondingMatches.ContainsKey(textChar))
                     {
-                        if (corespondingMatches[patternChar] == textChar)
+                        if (corespondingMatches[textChar] == patternChar)
                         {
                             continue;
-                        }
+                        }
                         else
                         {
                             return false;
@@ -113,7 +152,7 @@
                     }
                     else
                     {
-                        corespondingMatches.Add(patternChar, textChar);
+                        corespondingMatches.Add(textChar, patternChar);
                     }
                 }
             }


Update SchemaDefaultGenerator.cs

Update SchemaDefaultGenerator.cs

--- NerdCats.JsonSchemaDefaults/SchemaDefaultGenerator.cs
+++ NerdCats.JsonSchemaDefaults/SchemaDefaultGenerator.cs
@@ -7,9 +7,6 @@

     public class SchemaDefaultGenerator
     {
-        public SchemaDefaultGenerator()
-        { }
-
         public JToken GetDefaults(JObject schema, bool validateGeneratedJson = true)
         {
             return GetDefaults(schema.ToString(), validateGeneratedJson);


Reduce delay time on regin handshake reply to speed up terrain sending. Terrain IS more important than avatar!

--- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -6481,7 +6481,7 @@
             Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply;
             if (handlerRegionHandShakeReply != null)
             {
-                Thread.Sleep(500);
+                Thread.Sleep(100);
                 handlerRegionHandShakeReply(this);
             }


Bumped to release

Bumped to release

--- Collections/Properties/AssemblyInfo.cs
+++ Collections/Properties/AssemblyInfo.cs
@@ -33,4 +33,4 @@
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0.0.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: AssemblyInformationalVersion("1.0.0-alpha3")]
+[assembly: AssemblyInformationalVersion("1.0.0")]


Release v36 (beta)

Release v36 (beta)

--- app/Version.cs
+++ app/Version.cs
@@ -7,6 +7,6 @@

 namespace DHT.Utils {
 	static class Version {
-		public const string Tag = "35.3.0.0";
+		public const string Tag = "36.0.0.0";
 	}
 }


Add back downloads count

Add back downloads count

--- CronExpressionDescriptor.Demo/Views/Default/Index.cshtml
+++ CronExpressionDescriptor.Demo/Views/Default/Index.cshtml
@@ -81,6 +81,7 @@

                         Running Cron Expression Descriptor version @Model.AssemblyVersion
+


Fix bug in SoundModule.TriggerSound() where every sound update to an avatar would base its gain calculation on the previous avatar's gain, instead of the original input gain.

This was making sound attenuate oddly when there were NPCs in the region, though it could also happen with ordinary avatars.

--- OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -119,17 +119,20 @@
             m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
             {
                 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
+
                 if (dis > 100.0) // Max audio distance
                     return;

+                float thisSpGain;
+
                 // Scale by distance
                 if (radius == 0)
-                    gain = (float)((double)gain * ((100.0 - dis) / 100.0));
+                    thisSpGain = (float)((double)gain * ((100.0 - dis) / 100.0));
                 else
-                    gain = (float)((double)gain * ((radius - dis) / radius));
+                    thisSpGain = (float)((double)gain * ((radius - dis) / radius));

                 sp.ControllingClient.SendTriggeredSound(
-                    soundId, ownerID, objectID, parentID, handle, position, (float)gain);
+                    soundId, ownerID, objectID, parentID, handle, position, thisSpGain);
             });
         }
     }


bugfix in ProfileDescription and addition of ProfileSequenceIdentifier

--- ColorManager/ICC/Subclasses/Various.cs
+++ ColorManager/ICC/Subclasses/Various.cs
@@ -463,12 +463,12 @@
         public uint DeviceModel;
         public DeviceAttribute DeviceAttributes;
         public TagSignature TechnologyInformation;
-        public readonly MultiLocalizedUnicodeTagDataEntry DeviceManufacturerInfo;
-        public readonly MultiLocalizedUnicodeTagDataEntry DeviceModelInfo;
+        public LocalizedString[] DeviceManufacturerInfo;
+        public LocalizedString[] DeviceModelInfo;

         public ProfileDescription(uint DeviceManufacturer, uint DeviceModel, DeviceAttribute DeviceAttributes,
-            TagSignature TechnologyInformation, MultiLocalizedUnicodeTagDataEntry DeviceManufacturerInfo,
-            MultiLocalizedUnicodeTagDataEntry DeviceModelInfo)
+            TagSignature TechnologyInformation, LocalizedString[] DeviceManufacturerInfo,
+            LocalizedString[] DeviceModelInfo)
         {
             if (DeviceManufacturerInfo == null) throw new ArgumentNullException(nameof(DeviceManufacturerInfo));
             if (DeviceModelInfo == null) throw new ArgumentNullException(nameof(DeviceModelInfo));
@@ -492,7 +492,7 @@
         {
             return a.DeviceManufacturer == b.DeviceManufacturer && a.DeviceModel == b.DeviceModel &&
                 a.DeviceAttributes == b.DeviceAttributes && a.TechnologyInformation == b.TechnologyInformation &&
-                a.DeviceManufacturerInfo == b.DeviceManufacturerInfo;
+                CMP.Compare(a.DeviceManufacturerInfo, b.DeviceManufacturerInfo) && CMP.Compare(a.DeviceModelInfo, b.DeviceModelInfo);
         }

         /// <summary>
@@ -529,8 +529,70 @@
                 hash *= 16777619 ^ DeviceModel.GetHashCode();
                 hash *= 16777619 ^ DeviceAttributes.GetHashCode();
                 hash *= 16777619 ^ TechnologyInformation.GetHashCode();
-                hash *= 16777619 ^ DeviceManufacturerInfo.GetHashCode();
-                hash *= 16777619 ^ DeviceModelInfo.GetHashCode();
+                hash *= 16777619 ^ CMP.GetHashCode(DeviceManufacturerInfo);
+                hash *= 16777619 ^ CMP.GetHashCode(DeviceModelInfo);
+                return hash;
+            }
+        }
+    }
+
+    public struct ProfileSequenceIdentifier
+    {
+        public ProfileID ID;
+        public LocalizedString[] Description;
+
+        public ProfileSequenceIdentifier(ProfileID ID, LocalizedString[] Description)
+        {
+            if (Description == null) throw new ArgumentNullException(nameof(Description));
+
+            this.ID = ID;
+            this.Description = Description;
+        }
+
+
+        /// <summary>
+        /// Determines whether the specified <see cref="ProfileSequenceIdentifier"/>s are equal to each other.
+        /// </summary>
+        /// <param name="a">The first <see cref="ProfileSequenceIdentifier"/></param>
+        /// <param name="b">The second <see cref="ProfileSequenceIdentifier"/></param>
+        /// <returns>True if the <see cref="ProfileSequenceIdentifier"/>s are equal; otherwise, false</returns>
+        public static bool operator ==(ProfileSequenceIdentifier a, ProfileSequenceIdentifier b)
+        {
+            return a.ID == b.ID && CMP.Compare(a.Description, b.Description);
+        }
+
+        /// <summary>
+        /// Determines whether the specified <see cref="ProfileDescription"/>s are unequal to each other.
+        /// </summary>
+        /// <param name="a">The first <see cref="ProfileDescription"/></param>
+        /// <param name="b">The second <see cref="ProfileDescription"/></param>
+        /// <returns>True if the <see cref="ProfileDescription"/>s are unequal; otherwise, false</returns>
+        public static bool operator !=(ProfileSequenceIdentifier a, ProfileSequenceIdentifier b)
+        {
+            return !(a == b);
+        }
+
+        /// <summary>
+        /// Determines whether the specified <see cref="object"/> is equal to the current <see cref="ProfileSequenceIdentifier"/>.
+        /// </summary>
+        /// <param name="obj">The <see cref="object"/> to compare with the current <see cref="ProfileSequenceIdentifier"/></param>
+        /// <returns>true if the specified <see cref="object"/> is equal to the current <see cref="ProfileSequenceIdentifier"/>; otherwise, false.</returns>
+        public override bool Equals(object obj)
+        {
+            return obj is ProfileSequenceIdentifier && this == (ProfileSequenceIdentifier)obj;
+        }
+
+        /// <summary>
+        /// Serves as a hash function for a <see cref="ProfileSequenceIdentifier"/>.
+        /// </summary>
+        /// <returns>A hash code for the current <see cref="ProfileSequenceIdentifier"/></returns>
+        public override int GetHashCode()
+        {
+            unchecked
+            {
+                int hash = (int)2166136261;
+                hash *= 16777619 ^ ID.GetHashCode();
+                hash *= 16777619 ^ CMP.GetHashCode(Description);
                 return hash;
             }
         }


* Lock parts while they're being duplicated to prevent possible race conditions with other parts changers * This shouldn't provoke any deadlocks since the callers aren't taking any other locks beforehand

--- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1392,8 +1392,14 @@
                 SetRootPartOwner(m_rootPart, cAgentID, cGroupID);
                 m_rootPart.ScheduleFullUpdate();
             }
-
-            List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values);
+
+            List<SceneObjectPart> partList;
+
+            lock (m_parts)
+            {
+                partList = new List<SceneObjectPart>(m_parts.Values);
+            }
+
             partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
                 {
                     return p1.LinkNum.CompareTo(p2.LinkNum);


~1-2% improvement by reusing a buffer instead of calling ToCharArray() every time.

--- CommonMark/Formatter/HtmlTextWriter.cs
+++ CommonMark/Formatter/HtmlTextWriter.cs
@@ -12,6 +12,7 @@
         private System.IO.TextWriter _inner;
         private char _last = '\n';
         private bool _windowsNewLine;
+        private char[] _buffer = new char[256];

         public HtmlTextWriter(System.IO.TextWriter inner)
         {
@@ -32,7 +33,11 @@
                 var lastPos = 0;
                 var lastC = this._last;
                 int pos = 0;
-                var charArray = value.ToCharArray();
+
+                if (this._buffer.Length < value.Length)
+                    this._buffer = value.ToCharArray();
+                else
+                    value.CopyTo(0, this._buffer, 0, value.Length);

                 while (-1 != (pos = value.IndexOf('\n', pos)))
                 {
@@ -40,7 +45,7 @@

                     if (lastC != '\r')
                     {
-                        this._inner.Write(charArray, lastPos, pos - lastPos);
+                        this._inner.Write(this._buffer, lastPos, pos - lastPos);
                         this._inner.Write('\r');
                         lastPos = pos;
                     }
@@ -48,7 +53,7 @@
                     pos++;
                 }

-                this._inner.Write(charArray, lastPos, value.Length - lastPos);
+                this._inner.Write(this._buffer, lastPos, value.Length - lastPos);
             }
             else
             {


* oops. Mistake with value return.

* oops. Mistake with value return.

--- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -86,6 +86,12 @@
                 p_scene = scene;
                 p_cloneAppearanceFrom = cloneAppearanceFrom;
                 p_inUse = true;
+                p_returnUuid = UUID.Zero;
+            }
+
+            while(p_returnUuid == UUID.Zero)
+            {
+                Thread.Sleep(250);
             }

             m_createMutex.ReleaseMutex();


!audit zalgo

!audit zalgo

--- CompatBot/Commands/Moderation.Audit.cs
+++ CompatBot/Commands/Moderation.Audit.cs
@@ -88,6 +88,42 @@
                 }
             }

+            [Command("zalgo"), Aliases("diacritics")]
+            [Description("Checks every member's display name for discord and rule #7 requirements")]
+            public async Task Zalgo(CommandContext ctx)
+            {
+                if (!await CheckLock.WaitAsync(0).ConfigureAwait(false))
+                {
+                    await ctx.RespondAsync("Another check is already in progress").ConfigureAwait(false);
+                    return;
+                }
+
+                try
+                {
+                    await ctx.ReactWithAsync(Config.Reactions.PleaseWait).ConfigureAwait(false);
+                    var result = new StringBuilder("List of users who do not meet Rule #7 requirements:");
+                    var headerLength = result.Length;
+                    var members = GetMembers(ctx.Client);
+                    foreach (var member in members)
+                        if (UsernameZalgoMonitor.NeedsRename(member.DisplayName))
+                            result.AppendLine($"{member.Mention} please change your nickname according to Rule #7");
+                    if (result.Length == headerLength)
+                        result.AppendLine("No naughty users 🎉");
+                    await ctx.SendAutosplitMessageAsync(result, blockStart: "", blockEnd: "").ConfigureAwait(false);
+                }
+                catch (Exception e)
+                {
+                    var msg = "Failed to check display names for zalgo for all guild members";
+                    Config.Log.Warn(e, msg);
+                    await ctx.ReactWithAsync(Config.Reactions.Failure, msg).ConfigureAwait(false);
+                }
+                finally
+                {
+                    CheckLock.Release(1);
+                    await ctx.RemoveReactionAsync(Config.Reactions.PleaseWait).ConfigureAwait(false);
+                }
+            }
+
             /*
             [Command("locales"), Aliases("locale", "languages", "language", "lang", "loc")]
             public async Task UserLocales(CommandContext ctx)


fix config check ugh

fix config check ugh

--- CompatBot/Utils/OpenSslConfigurator.cs
+++ CompatBot/Utils/OpenSslConfigurator.cs
@@ -24,11 +24,12 @@
                     using var reader = new StreamReader(stream, Encoding.UTF8, leaveOpen: true);
                     content = await reader.ReadToEndAsync().ConfigureAwait(false);
                     Config.Log.Debug("openssl.cnf content:\n" + content);
-                    if (content.Contains("CipherString"))
+                    if (content.Contains("CipherString") && content.Contains("\nopenssl_conf"))
                     {
                         Config.Log.Debug("No need to configure");
                         return;
                     }
+                    stream.Seek(0, SeekOrigin.Begin);
                 }
                 else
                     stream = File.Open(configPath, FileMode.Create, FileAccess.Write, FileShare.Read);
@@ -38,9 +39,21 @@

                     if (content.Length > 0)
                     {
-                        var idx = content.IndexOf("[");
+                        if (!content.Contains("\nopenssl_conf"))
+                        {
+                            var cutStart = content.IndexOf("openssl_conf");
+                            if (cutStart > 0)
+                            {
+                                var cutEnd = content.IndexOf("CipherString", cutStart);
+                                cutEnd = content.IndexOf('\n', cutEnd) + 1;
+                                content = content[..cutStart] + content[cutEnd..];
+                            }
+                        }
+
+                        var idx = content.IndexOf("\n[");
                         if (idx > 0)
                         {
+                            idx++;
                             await writer.WriteAsync(content[..idx]).ConfigureAwait(false);
                             content = content[idx..];
                         }


Exposed Executor interface

Exposed Executor interface

--- MinChain/Runner/Executor.cs
+++ MinChain/Runner/Executor.cs
@@ -38,16 +38,18 @@
         // constructed UTXO instance with TxID and Output index.  This is
         // possible because TransactionOutput implements comparator which use
         // TxID and output index for the comparison.
-        readonly Dictionary<TransactionOutput, TransactionOutput> utxo;
-
-        Block latest;
+        public Dictionary<TransactionOutput, TransactionOutput> Utxos { get; }
+            = new Dictionary<TransactionOutput, TransactionOutput>();
+
+        public Block Latest { get; private set; }
+
+        public event Action BlockExecuted;

         public Executor()
         {
             floatingBlocks = new Dictionary<ByteString, List<ByteString>>();
-            utxo = new Dictionary<TransactionOutput, TransactionOutput>();
-
-            latest = new Block
+
+            Latest = new Block
             {
                 Id = Genesis.EmptyHash,
                 Difficulty = Genesis.Difficulty,
@@ -55,7 +57,7 @@
                 Height = -1,
                 TotalDifficulty = 0,
             };
-            Blocks.Add(latest.Id, latest);
+            Blocks.Add(Latest.Id, Latest);
         }

         public void ProcessBlock(byte[] data, ByteString prevId)
@@ -81,7 +83,7 @@
             // If the block difficulty does not surpass the current latest,
             // skip the execution.  Once the descendant block comes later,
             // evaluate the difficulty then again.
-            if (latest.TotalDifficulty >= block.TotalDifficulty)
+            if (Latest.TotalDifficulty >= block.TotalDifficulty)
             {
                 CheckFloatingBlocks(block.Id);
                 return;
@@ -91,8 +93,8 @@
             // first revert all the applied blocks prior to the fork point in
             // past blocks, if exists.  Then apply blocks after the fork.
             var fork = BlockchainUtil.LowestCommonAncestor(
-                latest, block, Blocks);
-            var revertingChain = latest.Ancestors(Blocks)
+                Latest, block, Blocks);
+            var revertingChain = Latest.Ancestors(Blocks)
                 .TakeWhile(x => !x.Id.Equals(fork.Id))
                 .ToList();
             var applyingChain = block.Ancestors(Blocks)
@@ -158,11 +160,12 @@
                 if (!tx.ExecInfo.Coinbase)
                     InventoryManager.MemoryPool.Remove(tx.Id);

-                tx.ExecInfo.RedeemedOutputs.ForEach(x => utxo.Remove(x));
-                tx.ExecInfo.GeneratedOutputs.ForEach(x => utxo.Add(x, x));
-            }
-
-            latest = block;
+                tx.ExecInfo.RedeemedOutputs.ForEach(x => Utxos.Remove(x));
+                tx.ExecInfo.GeneratedOutputs.ForEach(x => Utxos.Add(x, x));
+            }
+
+            Latest = block;
+            BlockExecuted();
         }

         void Revert(Block block)
@@ -175,11 +178,12 @@
                 if (!tx.ExecInfo.Coinbase)
                     InventoryManager.MemoryPool.Add(tx.Id, tx.Original);

-                tx.ExecInfo.RedeemedOutputs.ForEach(x => utxo.Add(x, x));
-                tx.ExecInfo.GeneratedOutputs.ForEach(x => utxo.Remove(x));
-            }
-
-            latest = Blocks[block.PreviousHash];
+                tx.ExecInfo.RedeemedOutputs.ForEach(x => Utxos.Add(x, x));
+                tx.ExecInfo.GeneratedOutputs.ForEach(x => Utxos.Remove(x));
+            }
+
+            Latest = Blocks[block.PreviousHash];
+            BlockExecuted();
         }

         void PurgeBlock(ByteString id)
@@ -209,7 +213,7 @@
             logger.LogDebug($@"Attempt to run Block:{
                 block.Id.ToString().Substring(0, 7)}");

-            Debug.Assert(latest.Id.Equals(block.PreviousHash));
+            Debug.Assert(Latest.Id.Equals(block.PreviousHash));
             if (!block.ParsedTransactions.IsNull()) return;

             var blockTime = block.Timestamp;
@@ -229,10 +233,10 @@
             // The block's difficulty must be within the computed range.
             // The Block ID has greater difficulty than the computed difficulty.
             if (blockTime > DateTime.UtcNow ||
-                blockTime < latest.Timestamp ||
+                blockTime < Latest.Timestamp ||
                 txCount == 0 || txCount != block.TransactionIds.Count ||
                 !rootTxHash.SequenceEqual(block.TransactionRootHash) ||
-                !latest.Id.Equals(block.PreviousHash) ||
+                !Latest.Id.Equals(block.PreviousHash) ||
                 block.Difficulty >= difficulty * (1 + 1e-15) ||
                 block.Difficulty <= difficulty * (1 - 1e-15) ||
                 Hash.Difficulty(block.Id.ToByteArray()) < block.Difficulty)
@@ -253,7 +257,7 @@
             }

             // Run normal transactions.
-            ulong coinbase = BlockParameter.GetCoinbase(latest.Height + 1);
+            ulong coinbase = BlockParameter.GetCoinbase(Latest.Height + 1);
             var spent = new List<TransactionOutput>();
             for (var i = 1; i < txCount; i++)
             {
@@ -269,12 +273,12 @@
             // Run the coinbase transaction.
             Run(transactions[0], blockTime, coinbase);

-            block.Height = latest.Height + 1;
+            block.Height = Latest.Height + 1;
             block.ParsedTransactions = transactions;
-            block.TotalDifficulty = latest.TotalDifficulty + block.Difficulty;
-        }
-
-        void Run(Transaction tx,
+            block.TotalDifficulty = Latest.TotalDifficulty + block.Difficulty;
+        }
+
+        public void Run(Transaction tx,
             DateTime blockTime, ulong coinbase = 0,
             List<TransactionOutput> spentTxo = null)
         {
@@ -282,7 +286,7 @@
                 tx.Id.ToString().Substring(0, 7)}");

             // Transaction header validity check.
-            if (tx.Timestamp >= blockTime ||
+            if (tx.Timestamp > blockTime ||
                 !(coinbase == 0 ^ tx.InEntries.Count == 0))
             {
                 throw new ArgumentException();
@@ -307,7 +311,7 @@
                 };
                 var unspent =
                     !(spentTxo?.Contains(txo) ?? false) &&
-                    utxo.TryGetValue(txo, out txo);
+                    Utxos.TryGetValue(txo, out txo);

                 // Recipient address check.
                 var addr = BlockchainUtil.ToAddress(inEntry.PublicKey);


Fix Cake Completion tests

Fix Cake Completion tests

--- tests/TestUtility/OmniSharpTestHost.cs
+++ tests/TestUtility/OmniSharpTestHost.cs
@@ -145,7 +145,9 @@
                 Path.Combine(folderPath, "project.csproj"),
                 new[] { "net472" },
                 testFiles.Where(f => f.FileName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase)).ToArray(),
-                testFiles.Where(f => !f.FileName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase) && !f.FileName.EndsWith(".csx", StringComparison.OrdinalIgnoreCase)).ToArray());
+                testFiles.Where(f => !f.FileName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase)
+                    && !f.FileName.EndsWith(".csx", StringComparison.OrdinalIgnoreCase)
+                    && !f.FileName.EndsWith(".cake", StringComparison.OrdinalIgnoreCase)).ToArray());

             foreach (var csxFile in testFiles.Where(f => f.FileName.EndsWith(".csx", StringComparison.OrdinalIgnoreCase)))
             {


* Fixed cursor visibility initialization and restoring when program finishes.

--- ConsoleFramework/ConsoleApplication.cs
+++ ConsoleFramework/ConsoleApplication.cs
@@ -174,6 +174,7 @@
 			LinuxConsoleApplication.keypad (stdscr, true);
 			LinuxConsoleApplication.start_color ();

+			HideCursor ();
 			renderer.UpdateRender ();

 			termkeyHandle = LibTermKey.termkey_new (0, TermKeyFlag.TERMKEY_FLAG_SPACESYMBOL);
@@ -244,6 +245,8 @@
 			LibTermKey.close (eventfd);
 			Console.Write ("\x1B[?1002l");

+			// restore cursor visibility before exit
+			ShowCursor ();
 			LinuxConsoleApplication.endwin ();
 		}


Fixed previous bugfix ;-)

Fixed previous bugfix ;-)

--- Modules/UrlTrackerModule.cs
+++ Modules/UrlTrackerModule.cs
@@ -488,7 +488,7 @@
             if (forcedRedirects == null || !forcedRedirects.Any())
                 return;

-            foreach (UrlTrackerModel forcedRedirect in forcedRedirects.Where(x => !x.Is404 && (x.RedirectRootNodeId == rootNodeId || x.RedirectRootNodeId == -1) && (x.OldUrl.Equals(urlWithoutQueryString, StringComparison.CurrentCultureIgnoreCase) || x.OldUrl.Equals(shortestUrl, StringComparison.CurrentCultureIgnoreCase))).OrderBy(x => x.RedirectHttpCode == 410 ? 2 : 1).ThenByDescending(x => x.OldUrlQueryString))
+            foreach (UrlTrackerModel forcedRedirect in forcedRedirects.Where(x => !x.Is404 && (x.RedirectRootNodeId == rootNodeId || x.RedirectRootNodeId == -1) && (string.Equals(x.OldUrl, urlWithoutQueryString, StringComparison.CurrentCultureIgnoreCase) || string.Equals(x.OldUrl, shortestUrl, StringComparison.CurrentCultureIgnoreCase))).OrderBy(x => x.RedirectHttpCode == 410 ? 2 : 1).ThenByDescending(x => x.OldUrlQueryString))
             {
                 LoggingHelper.LogInformation("UrlTracker HttpModule | URL match found");
                 if (forcedRedirect.RedirectNodeId.HasValue && forcedRedirect.RedirectHttpCode != (int)HttpStatusCode.Gone)


Update AbstractResources.cs

Update AbstractResources.cs

--- main/Smartsheet/Api/Internal/AbstractResources.cs
+++ main/Smartsheet/Api/Internal/AbstractResources.cs
@@ -75,10 +75,10 @@
 			public static readonly ErrorCode SERVICE_UNAVAILABLE = new ErrorCode(HttpStatusCode.ServiceUnavailable, typeof(Api.ServiceUnavailableException));

 			/// <summary>
-			/// Gets an IEnumerable to iterate through the Error codes.
+			/// Gets an IEnumerable to iterate through the error codes.
 			/// </summary>
 			/// <value>
-			/// The IEnumerable to iterate through the Error codes
+			/// The IEnumerable to iterate through the error codes
 			/// </value>
 			public static IEnumerable<ErrorCode> Values
 			{


Fix for Hospital with Specialists without Consultations

--- Data/TeleConsult.Data/Repositories/HospitalRepository.cs
+++ Data/TeleConsult.Data/Repositories/HospitalRepository.cs
@@ -52,7 +52,7 @@
                 Address = h.Address,
                 Phone = h.Phone,
                 IsDeleted = h.IsDeleted,
-                Rating = h.Specialists.Any() ? h.Specialists.Select(s => s.Consultations.Where(c => c.ConsultantId == s.Id).Select(c => c.Rating).Average()).Where(c => c.HasValue).Average(c => c.Value) : 0
+                Rating = h.Specialists.Any() && h.Specialists.Any(s => s.Consultations.Any()) ? h.Specialists.Select(s => s.Consultations.Where(c => c.ConsultantId == s.Id).Select(c => c.Rating).Average()).Where(c => c.HasValue).Average(c => c.Value) : 0
             });
         }
     }