issue 62 don't send content when verb is HEAD or there is no content

--- Ior/Core/IorClient.cs
+++ Ior/Core/IorClient.cs
@@ -91,7 +91,7 @@
                 request.Headers.Authorization = new AuthenticationHeaderValue("Basic", userInfoBase64Text);
             }

-            if (requestModel.Method != HttpMethod.Get) {
+            if (requestModel.Method != HttpMethod.Get && requestModel.Method != HttpMethod.Head && !requestModel.Body.IsBlank()) {
                 //default content-type: http://mattryall.net/blog/2008/03/default-content-type
                 string textCt;
                 requestModel.ContentHeaders.TryGetValue("Content-Type", out textCt);


better display of open file in form title

--- Ior/Forms/MainForm.cs
+++ Ior/Forms/MainForm.cs
@@ -300,17 +300,13 @@
             }
         }

-        private static string getFileDirectoryName(string fileName) {
-            return fileName.IsBlank() ? "" : new FileInfo(fileName).DirectoryName;
-        }
-
         private void save(string fileName) {
             if (fileName == null) {
                 requestSaveFileDialog.FileName = FilePathFormatter.Format(lastOpenedRequestFilePath, FilePathFormat.Short);
                 setUpFileDialogs();
                 if (requestSaveFileDialog.ShowDialog() == DialogResult.OK) {
                     fileName = requestSaveFileDialog.FileName;
-                    Settings.Default.SaveRequestFileDialogFolder = getFileDirectoryName(fileName);
+                    Settings.Default.SaveRequestFileDialogFolder = FilePathFormatter.Format(fileName, FilePathFormat.FullDir);
                 } else {
                     return;
                 }
@@ -329,7 +325,7 @@
         private void updateLastOpenedRequestFile(string fileName) {
             this.lastOpenedRequestFilePath = fileName;
             this.isLastOpenedRequestFileDirty = false;
-            this.Text = fileName + " - I'm Only Resting";
+            this.Text = FilePathFormatter.Format(fileName, FilePathFormat.ShortFileFullDir) + " - I'm Only Resting";
         }

         private void saveToolStripMenuItem_Click(object sender, EventArgs e) {
@@ -346,7 +342,7 @@
             if (requestOpenFileDialog.ShowDialog() == DialogResult.OK) {
                 var fileName = requestOpenFileDialog.FileName;
                 openRequestFile(fileName);
-                Settings.Default.SaveRequestFileDialogFolder = getFileDirectoryName(fileName);
+                Settings.Default.SaveRequestFileDialogFolder = FilePathFormatter.Format(fileName, FilePathFormat.FullDir);
             }
         }


Use AccentMimimalOverlay on ExploreItem hover

--- MatterControlLib/PartPreviewWindow/StartPage/ExploreItem.cs
+++ MatterControlLib/PartPreviewWindow/StartPage/ExploreItem.cs
@@ -36,6 +36,7 @@
 	public class ExploreItem : FlowLayoutWidget
 	{
 		private FeedItemData item;
+		private ThemeConfig theme;
 		private ImageBuffer image;

 		public static int IconSize => (int)(40 * GuiWidget.DeviceScale);
@@ -51,6 +52,7 @@
 			//this.Border = spacing;
 			this.Padding = ItemSpacing;
 			this.item = item;
+			this.theme = theme;

 			image = new ImageBuffer(IconSize, IconSize);

@@ -125,8 +127,18 @@
 			this.Cursor = Cursors.Hand;
 		}

+		public override Color BackgroundColor
+		{
+			get => (mouseInBounds) ? theme.AccentMimimalOverlay : base.BackgroundColor;
+			set => base.BackgroundColor = value;
+		}
+
+		private bool mouseInBounds = false;
+
 		public override void OnMouseEnterBounds(MouseEventArgs mouseEvent)
 		{
+			mouseInBounds = true;
+
 			if (hoverImage != null)
 			{
 				imageWidget.Image = hoverImage;
@@ -139,6 +151,8 @@

 		public override void OnMouseLeaveBounds(MouseEventArgs mouseEvent)
 		{
+			mouseInBounds = false;
+
 			imageWidget.Image = image;
 			base.OnMouseLeaveBounds(mouseEvent);


select simple when not set

select simple when not set

--- MatterControlLib/SlicerConfiguration/SliceSettingsWidget.cs
+++ MatterControlLib/SlicerConfiguration/SliceSettingsWidget.cs
@@ -382,7 +382,11 @@
 				}

 				var menuItem = popupMenu.CreateBoolMenuItem("Simple".Localize(),
-					() => UserSettings.Instance.get(UserSettingsKey.SliceSettingsViewDetail) == "Simple",
+					() =>
+					{
+						var value = UserSettings.Instance.get(UserSettingsKey.SliceSettingsViewDetail);
+						return string.IsNullOrEmpty(value) || value == "Simple";
+					},
 					(value) => SetDetail("Simple", value));
 				menuItem.ToolTipText = "Show only the most important settings";


Update SearchesService.cs

Update SearchesService.cs

--- NadekoBot.Core/Modules/Searches/Services/SearchesService.cs
+++ NadekoBot.Core/Modules/Searches/Services/SearchesService.cs
@@ -201,7 +201,7 @@
                     WrapTextWidth = 190,
                 },
                 text,
-                _fonts.NotoSans.CreateFont(20),
+                _fonts.NotoSans.CreateFont(20, FontStyle.Bold),
                 Rgba32.Black,
                 new PointF(25, 225)));


update UnityModel.Generated

update UnityModel.Generated

--- resharper/src/resharper-unity/Unity3dRider/Assets/Plugins/Editor/JetBrains/UnityModel.Generated.cs
+++ resharper/src/resharper-unity/Unity3dRider/Assets/Plugins/Editor/JetBrains/UnityModel.Generated.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Linq;
 using System.Collections.Generic;
+using System.Runtime.InteropServices;
 using JetBrains.Application;
 using JetBrains.Annotations;

@@ -26,9 +27,12 @@

   public class UnityModel : RdBindableBase {
     //fields
+    //public fields
     [NotNull] public IRdProperty<bool> HostConnected { get { return _HostConnected; }}
+    [NotNull] public IRdProperty<bool> Play { get { return _Play; }}
+
+    //private fields
     [NotNull] private readonly RdProperty<bool> _HostConnected;
-    [NotNull] public IRdProperty<bool> Play { get { return _Play; }}
     [NotNull] private readonly RdProperty<bool> _Play;

     //primary constructor
@@ -42,8 +46,8 @@

       _HostConnected = hostConnected;
       _Play = play;
-      hostConnected.OptimizeNested = true;
-      play.OptimizeNested = true;
+      _HostConnected.OptimizeNested = true;
+      _Play.OptimizeNested = true;
     }
     //secondary constructor
     //statics


re-add the sleep lost in the revert.

re-add the sleep lost in the revert.

--- OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -31,6 +31,7 @@
 using System.Collections.Generic;
 using System.Collections;
 using System.Reflection;
+using System.Threading;
 using OpenMetaverse;
 using log4net;
 using OpenSim.Framework;
@@ -200,6 +201,7 @@
                     if ((int)InventoryType.LSL == item.InvType)
                     {
                         CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
+                        Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug
                     }
                 }
             }


Add DynamicInvokeUnwrap

Add DynamicInvokeUnwrap

--- source/Nuke.Common/Utilities/ReflectionUtility.Invocation.cs
+++ source/Nuke.Common/Utilities/ReflectionUtility.Invocation.cs
@@ -116,5 +116,29 @@
         {
             return (T) type.InvokeMember(memberName, target, bindingFlags, args);
         }
+
+        public static void DynamicInvokeUnwrap(this Delegate @delegate, params object[] args)
+        {
+            try
+            {
+                @delegate.DynamicInvoke(args);
+            }
+            catch (Exception exception)
+            {
+                throw exception.Unwrap();
+            }
+        }
+
+        public static T DynamicInvokeUnwrap<T>(this Delegate @delegate, params object[] args)
+        {
+            try
+            {
+                return (T)@delegate.DynamicInvoke(args);
+            }
+            catch (Exception exception)
+            {
+                throw exception.Unwrap();
+            }
+        }
     }
 }


Fix a few bugs in AgentInfoConnector with grid mode.

--- OpenSim/Services/Connectors/AgentInfo/AgentInfoConnector.cs
+++ OpenSim/Services/Connectors/AgentInfo/AgentInfoConnector.cs
@@ -58,9 +58,14 @@
                 request["userID"] = userID;
                 request["Method"] = "GetUserInfo";
                 OSDMap result = WebUtils.PostToService(url, request);
-                UserInfo info = new UserInfo();
-                info.FromOSD((OSDMap)result["Result"]);
-                return info;
+                OSD r = OSDParser.DeserializeJson(result["_RawResult"]);
+                if (r is OSDMap)
+                {
+                    OSDMap innerresult = (OSDMap)r;
+                    UserInfo info = new UserInfo();
+                    info.FromOSD((OSDMap)innerresult["Result"]);
+                    return info;
+                }
             }
             return null;
         }
@@ -79,15 +84,20 @@
                 request["userIDs"] = requestArray;
                 request["Method"] = "GetUserInfos";
                 OSDMap result = WebUtils.PostToService(url, request);
-                OSDArray resultArray = (OSDArray)result["Result"];
-                List<UserInfo> retVal = new List<UserInfo>();
-                foreach (OSD o in resultArray)
+                OSD r = OSDParser.DeserializeJson(result["_RawResult"]);
+                if (r is OSDMap)
                 {
-                    UserInfo info = new UserInfo();
-                    info.FromOSD((OSDMap)o);
-                    retVal.Add(info);
+                    OSDMap innerresult = (OSDMap)r;
+                    OSDArray resultArray = (OSDArray)innerresult["Result"];
+                    List<UserInfo> retVal = new List<UserInfo>();
+                    foreach (OSD o in resultArray)
+                    {
+                        UserInfo info = new UserInfo();
+                        info.FromOSD((OSDMap)o);
+                        retVal.Add(info);
+                    }
+                    return retVal.ToArray();
                 }
-                return retVal.ToArray();
             }
             return null;
         }
@@ -106,13 +116,18 @@
                 request["userIDs"] = requestArray;
                 request["Method"] = "GetAgentsLocations";
                 OSDMap result = WebUtils.PostToService(url, request);
-                OSDArray resultArray = (OSDArray)result["Result"];
-                List<string> retVal = new List<string>();
-                foreach (OSD o in resultArray)
+                OSD r = OSDParser.DeserializeJson(result["_RawResult"]);
+                if (r is OSDMap)
                 {
-                    retVal.Add(o.AsString());
+                    OSDMap innerresult = (OSDMap)r;
+                    OSDArray resultArray = (OSDArray)innerresult["Result"];
+                    List<string> retVal = new List<string>();
+                    foreach (OSD o in resultArray)
+                    {
+                        retVal.Add(o.AsString());
+                    }
+                    return retVal.ToArray();
                 }
-                return retVal.ToArray();
             }
             return null;
         }


Update

Update

--- PayUCardInfo/PayUCardInfo/Controllers/CardInfoController.cs
+++ PayUCardInfo/PayUCardInfo/Controllers/CardInfoController.cs
@@ -27,11 +27,16 @@
             string URL = "https://secure.payu.com.tr/api/card-info/v1/";
             /// PayU tarafından size özel sağlanan kodunuz.
             string merchant = "";
+            /// PayU tarafından size özel sağlanan gizli kodunuz.
             string secretkey = "";
+            /// Unix zaman damgamız
             string timestamp = ConvertToUnixTime(DateTime.Now.AddHours(-3)).ToString();
+            /// PayU tarafından sizlere sağlanan gizli kodunuz ile oluşturacağınız imzanız.
             string signature = BitConverter.ToString(hmacSHA256(merchant + timestamp, secretkey)).Replace("-", "").ToLower();

+            /// Http Request işleminiz.
             var _Request = _Client.DownloadString(URL + _CardNum + "?merchant=" + merchant + "&timestamp=" + timestamp + "&signature=" + signature);
+            /// Sonuç
             _BinData.root = JsonConvert.DeserializeObject<BINDataResponseV1.ROOT>(_Request);

             return Json(new { _BinData = _BinData }, JsonRequestBehavior.AllowGet);


DirectWrite : Refactored : Rename

DirectWrite : Refactored : Rename

--- samples/DirectWrite/HelloWorld/MainForm.Designer.cs
+++ samples/DirectWrite/HelloWorld/MainForm.Designer.cs
@@ -28,30 +28,30 @@
 		/// </summary>
 		private void InitializeComponent()
 		{
-			this.tabControl1 = new System.Windows.Forms.TabControl();
+			this.TabControl = new System.Windows.Forms.TabControl();
 			this.simpleTextTabPage = new System.Windows.Forms.TabPage();
+			this.multiformattedTextTabPage = new System.Windows.Forms.TabPage();
+			this.customTextRendererTabPage = new System.Windows.Forms.TabPage();
 			this.SimpleTextRenderPanel = new HelloWorld.RenderPanel();
-			this.multiformattedTextTabPage = new System.Windows.Forms.TabPage();
 			this.MultiformattedTextRenderPanel = new HelloWorld.RenderPanel();
-			this.customTextRendererTabPage = new System.Windows.Forms.TabPage();
 			this.CustomTextRenderPanel = new HelloWorld.RenderPanel();
-			this.tabControl1.SuspendLayout();
+			this.TabControl.SuspendLayout();
 			this.simpleTextTabPage.SuspendLayout();
 			this.multiformattedTextTabPage.SuspendLayout();
 			this.customTextRendererTabPage.SuspendLayout();
 			this.SuspendLayout();
 			//
-			// tabControl1
+			// TabControl
 			//
-			this.tabControl1.Controls.Add(this.simpleTextTabPage);
-			this.tabControl1.Controls.Add(this.multiformattedTextTabPage);
-			this.tabControl1.Controls.Add(this.customTextRendererTabPage);
-			this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.tabControl1.Location = new System.Drawing.Point(0, 0);
-			this.tabControl1.Name = "tabControl1";
-			this.tabControl1.SelectedIndex = 0;
-			this.tabControl1.Size = new System.Drawing.Size(629, 449);
-			this.tabControl1.TabIndex = 0;
+			this.TabControl.Controls.Add(this.simpleTextTabPage);
+			this.TabControl.Controls.Add(this.multiformattedTextTabPage);
+			this.TabControl.Controls.Add(this.customTextRendererTabPage);
+			this.TabControl.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.TabControl.Location = new System.Drawing.Point(0, 0);
+			this.TabControl.Name = "TabControl";
+			this.TabControl.SelectedIndex = 0;
+			this.TabControl.Size = new System.Drawing.Size(629, 449);
+			this.TabControl.TabIndex = 0;
 			//
 			// simpleTextTabPage
 			//
@@ -64,15 +64,6 @@
 			this.simpleTextTabPage.Text = "Simple Text";
 			this.simpleTextTabPage.UseVisualStyleBackColor = true;
 			//
-			// SimpleTextRenderPanel
-			//
-			this.SimpleTextRenderPanel.BackColor = System.Drawing.Color.White;
-			this.SimpleTextRenderPanel.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.SimpleTextRenderPanel.Location = new System.Drawing.Point(3, 3);
-			this.SimpleTextRenderPanel.Name = "SimpleTextRenderPanel";
-			this.SimpleTextRenderPanel.Size = new System.Drawing.Size(615, 417);
-			this.SimpleTextRenderPanel.TabIndex = 0;
-			//
 			// multiformattedTextTabPage
 			//
 			this.multiformattedTextTabPage.Controls.Add(this.MultiformattedTextRenderPanel);
@@ -84,14 +75,6 @@
 			this.multiformattedTextTabPage.Text = "Multiformatted Text";
 			this.multiformattedTextTabPage.UseVisualStyleBackColor = true;
 			//
-			// MultiformattedTextRenderPanel
-			//
-			this.MultiformattedTextRenderPanel.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.MultiformattedTextRenderPanel.Location = new System.Drawing.Point(3, 3);
-			this.MultiformattedTextRenderPanel.Name = "MultiformattedTextRenderPanel";
-			this.MultiformattedTextRenderPanel.Size = new System.Drawing.Size(615, 417);
-			this.MultiformattedTextRenderPanel.TabIndex = 0;
-			//
 			// customTextRendererTabPage
 			//
 			this.customTextRendererTabPage.Controls.Add(this.CustomTextRenderPanel);
@@ -101,6 +84,23 @@
 			this.customTextRendererTabPage.TabIndex = 2;
 			this.customTextRendererTabPage.Text = "Custom Text Renderer";
 			this.customTextRendererTabPage.UseVisualStyleBackColor = true;
+			//
+			// SimpleTextRenderPanel
+			//
+			this.SimpleTextRenderPanel.BackColor = System.Drawing.Color.White;
+			this.SimpleTextRenderPanel.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.SimpleTextRenderPanel.Location = new System.Drawing.Point(3, 3);
+			this.SimpleTextRenderPanel.Name = "SimpleTextRenderPanel";
+			this.SimpleTextRenderPanel.Size = new System.Drawing.Size(615, 417);
+			this.SimpleTextRenderPanel.TabIndex = 0;
+			//
+			// MultiformattedTextRenderPanel
+			//
+			this.MultiformattedTextRenderPanel.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.MultiformattedTextRenderPanel.Location = new System.Drawing.Point(3, 3);
+			this.MultiformattedTextRenderPanel.Name = "MultiformattedTextRenderPanel";
+			this.MultiformattedTextRenderPanel.Size = new System.Drawing.Size(615, 417);
+			this.MultiformattedTextRenderPanel.TabIndex = 0;
 			//
 			// CustomTextRenderPanel
 			//
@@ -115,10 +115,10 @@
 			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
 			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
 			this.ClientSize = new System.Drawing.Size(629, 449);
-			this.Controls.Add(this.tabControl1);
+			this.Controls.Add(this.TabControl);
 			this.Name = "MainForm";
 			this.Text = "Hello World";
-			this.tabControl1.ResumeLayout(false);
+			this.TabControl.ResumeLayout(false);
 			this.simpleTextTabPage.ResumeLayout(false);
 			this.multiformattedTextTabPage.ResumeLayout(false);
 			this.customTextRendererTabPage.ResumeLayout(false);
@@ -128,12 +128,12 @@

 		#endregion

-		private System.Windows.Forms.TabControl tabControl1;
 		private System.Windows.Forms.TabPage simpleTextTabPage;
 		private System.Windows.Forms.TabPage multiformattedTextTabPage;
 		private System.Windows.Forms.TabPage customTextRendererTabPage;
 		public RenderPanel SimpleTextRenderPanel;
 		public RenderPanel MultiformattedTextRenderPanel;
 		public RenderPanel CustomTextRenderPanel;
+		public System.Windows.Forms.TabControl TabControl;
 	}
 }


no op if no tokens given

no op if no tokens given

--- KiteConnect/Ticker.cs
+++ KiteConnect/Ticker.cs
@@ -470,6 +470,8 @@
         /// <param name="Tokens">List of instrument instrument_tokens to subscribe</param>
         public void Subscribe(UInt32[] Tokens)
         {
+            if (Tokens.Length == 0) return;
+
             string msg = "{\"a\":\"subscribe\",\"v\":[" + String.Join(",", Tokens) + "]}";
             if (_debug) Console.WriteLine(msg.Length);

@@ -486,6 +488,8 @@
         /// <param name="Tokens">List of instrument instrument_tokens to unsubscribe</param>
         public void UnSubscribe(UInt32[] Tokens)
         {
+            if (Tokens.Length == 0) return;
+
             string msg = "{\"a\":\"unsubscribe\",\"v\":[" + String.Join(",", Tokens) + "]}";
             if (_debug) Console.WriteLine(msg);

@@ -503,6 +507,8 @@
         /// <param name="Mode">Mode to set. It can be one of the following: ltp, quote, full.</param>
         public void SetMode(UInt32[] Tokens, string Mode)
         {
+            if (Tokens.Length == 0) return;
+
             string msg = "{\"a\":\"mode\",\"v\":[\"" + Mode + "\", [" + String.Join(",", Tokens) + "]]}";
             if (_debug) Console.WriteLine(msg);


Add temp tests reference by https://github.com/pythonnet/pythonnet/pull/1074#issuecomment-596139665

--- src/embed_tests/TestDomainReload.cs
+++ src/embed_tests/TestDomainReload.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Diagnostics;
 using System.Reflection;
+using System.Runtime.InteropServices;
 using NUnit.Framework;
 using Python.Runtime;

@@ -115,6 +116,71 @@
             }
         }

+
+        #region Tempary tests
+        // https://github.com/pythonnet/pythonnet/pull/1074#issuecomment-596139665
+        [Test]
+        public void CrossReleaseBuiltinType()
+        {
+            try
+            {
+                var numRef = CreateNumReference();
+                GC.Collect();
+                GC.WaitForPendingFinalizers(); // <- this will put former `num` into Finalizer queue
+                Finalizer.Instance.Collect(forceDispose: true);
+                // ^- this will call PyObject.Dispose, which will call XDecref on `num.Handle`,
+                // but Python interpreter from "run" 1 is long gone, so it will corrupt memory instead.
+                Assert.False(numRef.IsAlive);
+            }
+            finally
+            {
+                PythonEngine.Shutdown();
+            }
+        }
+
+        [Test]
+        public void CrossReleaseCustomType()
+        {
+            try
+            {
+                var objRef = CreateConcreateObject();
+                GC.Collect();
+                GC.WaitForPendingFinalizers();
+                Finalizer.Instance.Collect(forceDispose: true);
+                Assert.False(objRef.IsAlive);
+            }
+            finally
+            {
+                PythonEngine.Shutdown();
+            }
+        }
+
+        private static WeakReference CreateNumReference()
+        {
+            PythonEngine.Initialize();
+            var num = 3216757418.ToPython();
+            Assert.AreEqual(num.Refcount, 1);
+            WeakReference numRef = new WeakReference(num, false);
+            PythonEngine.Shutdown(); // <- "run" 1 ends
+            PythonEngine.Initialize(); // <- "run" 2 starts
+            num = null;
+            return numRef;
+        }
+
+        private static WeakReference CreateConcreateObject()
+        {
+            PythonEngine.Initialize();
+            var obj = new Domain.MyClass().ToPython();
+            Assert.AreEqual(obj.Refcount, 1);
+            WeakReference numRef = new WeakReference(obj, false);
+            PythonEngine.Shutdown();
+            PythonEngine.Initialize();
+            obj = null;
+            return numRef;
+        }
+
+        #endregion Tempary tests
+
         /// <summary>
         /// This is a magic incantation required to run code in an application
         /// domain other than the current one.
@@ -305,6 +371,8 @@
 obj = MyClass()
 obj.Method()
 obj.StaticMethod()
+obj.Property = 1
+obj.Field = 10
 ", Assembly.GetExecutingAssembly().FullName);

                 using (Py.GIL())
@@ -333,11 +401,27 @@
             {
                 using (Py.GIL())
                 {
+                    IntPtr tp = Runtime.Runtime.PyObject_TYPE(handle);
+                    IntPtr tp_clear = Marshal.ReadIntPtr(tp, TypeOffset.tp_clear);

                     using (PyObject obj = new PyObject(handle))
                     {
                         obj.InvokeMethod("Method");
                         obj.InvokeMethod("StaticMethod");
+
+                        using (var scope = Py.CreateScope())
+                        {
+                            scope.Set("obj", obj);
+                            scope.Exec(@"
+obj.Method()
+obj.StaticMethod()
+obj.Property += 1
+obj.Field += 10
+");
+                        }
+                        var clrObj = obj.As<Domain.MyClass>();
+                        Assert.AreEqual(clrObj.Property, 2);
+                        Assert.AreEqual(clrObj.Field, 20);
                     }
                 }
             }
@@ -370,6 +454,8 @@
     [Serializable]
     public class MyClass
     {
+        public int Property { get; set; }
+        public int Field;
         public void Method() { }
         public static void StaticMethod() { }
     }


libgit2sharp has some enums with negative values

--- LibGit2Sharp/Net35.cs
+++ LibGit2Sharp/Net35.cs
@@ -1,5 +1,6 @@
 using System;
 using System.IO;
+using LibGit2Sharp.Core;

 namespace LibGit2Sharp
 {
@@ -39,8 +40,8 @@
                     value.GetType(), variable.GetType()));
             }

-            ulong num = Convert.ToUInt64(value);
-            return ((Convert.ToUInt64(variable) & num) == num);
+            long num = Convert.ToInt64(value);
+            return (Convert.ToInt64(variable) & num) == num;

         }


Create auto-index with default options only

--- LiteDB/Query/Query.cs
+++ LiteDB/Query/Query.cs
@@ -200,8 +200,10 @@
             if (index == null)
             {
                 //TODO: implement auto-index? this should be an options? and default index options?
-                throw new NotImplementedException("Index `" + this.Field + "` not found on collection `" + collection.Name + "`");
-                //collection.EnsureIndex(this.Field);
+                //throw new NotImplementedException("Index `" + this.Field + "` not found on collection `" + collection.Name + "`");
+                collection.EnsureIndex(this.Field);
+
+                index = col.GetIndex(this.Field);
             }

             // execute query to get all IndexNodes


Extracted into a method, generating a feature count.

--- bioconsole/Program.cs
+++ bioconsole/Program.cs
@@ -241,63 +241,7 @@
                                 verificationState = VerificationState.CollectingData;
                                 break;
                             case VerificationState.Verifying:
-
-                                string getModels = "select * from people where " +
-                                    //"(left_thigh between @left_thigh_lower and @left_thigh_upper) or " +
-                                    //"(right_thigh between @right_thigh_lower and @right_thigh_upper) or " +
-                                    //"(left_shin between @left_shin_lower and @left_shin_upper) or " +
-                                    //"(right_shin between @right_shin_lower and @right_shin_upper) or " +
-                                    //"(spine_upper between @spine_upper_lower and @spine_upper_upper) or " +
-                                    //"(spine_lower between @spine_lower_lower and @spine_lower_upper) or " +
-                                    //"(forearm_left between @forearm_left_lower and @forearm_left_upper) or " +
-                                    //"(forearm_right between @forearm_right_lower and @forearm_right_upper) or" +
-                                    //"(upperarm_left between @upperarm_left_lower and @upperarm_left_upper) or" +
-                                    //"(upperarm_right between @upperarm_right_lower and @upperarm_right_upper) or " +
-                                    "(neck between @neck_lower and @neck_upper)";
-
-                                using (SQLiteCommand command = new SQLiteCommand(m_dbConnection))
-                                {
-                                    command.CommandText = getModels;
-
-                                    foreach (string limb in limbs)
-                                    {
-                                        command.Parameters.Add(limb + "_lower", System.Data.DbType.Single);
-                                        command.Parameters[limb + "_lower"].Value = (person[limb] * 100) - 0.1f;
-
-                                        command.Parameters.Add(limb + "_upper", System.Data.DbType.Single);
-                                        command.Parameters[limb + "_upper"].Value = (person[limb] * 100) + 0.1f;
-                                    }
-
-                                    SQLiteDataReader reader = command.ExecuteReader();
-
-                                    Dictionary<string, Dictionary<string, float>> results = new Dictionary<string, Dictionary<string, float>>();
-                                    if (reader.HasRows)
-                                    {
-                                        Console.Write("Name(s) returned: ");
-                                        while (reader.Read())
-                                        {
-                                            string resName = (string)reader["name"];
-                                            if (!results.ContainsKey(resName))
-                                            {
-                                                results.Add(resName, new Dictionary<string, float>());
-                                                foreach (string limb in limbs)
-                                                {
-                                                    try
-                                                    {
-                                                        results[resName].Add(limb, (float)reader[limb]);
-                                                    }
-                                                    catch (Exception ex)
-                                                    {
-                                                        // do nothing
-                                                    }
-                                                }
-                                            }
-                                            Console.Write("{0}, ", resName);
-                                        }
-                                        Console.WriteLine();
-                                    }
-                                }
-
+                                VerifySkeleton(person, limbs);
                                 break;
                         }

@@ -307,6 +251,98 @@
             }
         }

+        private static void VerifySkeleton(Dictionary<string, float> person, string[] limbs)
+        {
+            string getModels = "select * from people where " +
+                "(left_thigh between @left_thigh_lower and @left_thigh_upper) or " +
+                "(right_thigh between @right_thigh_lower and @right_thigh_upper) or " +
+                "(left_shin between @left_shin_lower and @left_shin_upper) or " +
+                "(right_shin between @right_shin_lower and @right_shin_upper) or " +
+                "(spine_upper between @spine_upper_lower and @spine_upper_upper) or " +
+                "(spine_lower between @spine_lower_lower and @spine_lower_upper) or " +
+                "(forearm_left between @forearm_left_lower and @forearm_left_upper) or " +
+                "(forearm_right between @forearm_right_lower and @forearm_right_upper) or" +
+                "(upperarm_left between @upperarm_left_lower and @upperarm_left_upper) or" +
+                "(upperarm_right between @upperarm_right_lower and @upperarm_right_upper) or " +
+                "(neck between @neck_lower and @neck_upper)";
+
+            using (SQLiteCommand command = new SQLiteCommand(m_dbConnection))
+            {
+                command.CommandText = getModels;
+
+                foreach (string limb in limbs)
+                {
+                    command.Parameters.Add(limb + "_lower", System.Data.DbType.Single);
+                    command.Parameters[limb + "_lower"].Value = (person[limb] * 100) - 0.1f;
+
+                    command.Parameters.Add(limb + "_upper", System.Data.DbType.Single);
+                    command.Parameters[limb + "_upper"].Value = (person[limb] * 100) + 0.1f;
+                }
+
+                SQLiteDataReader reader = command.ExecuteReader();
+
+                Dictionary<string, Dictionary<string, double>> results = new Dictionary<string, Dictionary<string, double>>();
+                if (reader.HasRows)
+                {
+                    //Console.Write("Name(s) returned: ");
+                    while (reader.Read())
+                    {
+                        string resName = (string)reader["name"];
+                        if (!results.ContainsKey(resName))
+                        {
+                            results.Add(resName, new Dictionary<string, double>());
+                            try
+                            {
+                                results[resName].Add(limbs[0], (double)reader[limbs[0]]);
+                                results[resName].Add(limbs[1], (double)reader[limbs[1]]);
+                                results[resName].Add(limbs[2], (double)reader[limbs[2]]);
+                                results[resName].Add(limbs[3], (double)reader[limbs[3]]);
+                                results[resName].Add(limbs[4], (double)reader[limbs[4]]);
+                                results[resName].Add(limbs[5], (double)reader[limbs[5]]);
+                                results[resName].Add(limbs[6], (double)reader[limbs[6]]);
+                                results[resName].Add(limbs[7], (double)reader[limbs[7]]);
+                                results[resName].Add(limbs[8], (double)reader[limbs[8]]);
+                                results[resName].Add(limbs[9], (double)reader[limbs[9]]);
+                                results[resName].Add(limbs[10], (double)reader[limbs[10]]);
+                            }
+                            catch (Exception ex)
+                            {
+                                Console.WriteLine(ex);
+                            }
+                        }
+                        //Console.Write("{0}, ", resName);
+                    }
+                    //Console.WriteLine();
+
+                    //  Iterate through the results dictionary to compare values against detected
+                    //  count how many are close matches
+
+                    foreach (string key in results.Keys)
+                    {
+                        int featureCount = 0;
+                        foreach (string limb in results[key].Keys)
+                        {
+                            float detectedValue = person[limb] * 100;
+                            double queryValue = results[key][limb];
+
+                            float lower, upper;
+                            lower = detectedValue - 1f;
+                            upper = detectedValue + 1f;
+
+                            if ((lower < queryValue) && (upper > queryValue))
+                                featureCount++;
+                        }
+                        //Console.WriteLine("Feature count match for {0} is {1}", key, featureCount);
+
+                        if(featureCount >= 6)
+                        {
+                            Console.WriteLine("Very likely {0} detected, {1} features matched.", key, featureCount);
+                        }
+                    }
+                }
+            }
+        }
+
         private static void SaveData(Dictionary<string, float> person, string name)
         {
             string sql = "insert into people (name, left_thigh, right_thigh, left_shin, right_shin, spine_upper, spine_lower, forearm_left, forearm_right, upperarm_left, upperarm_right, neck)" +


added debug output

added debug output

--- source/Appccelerate.VersionTask/VersionTask.cs
+++ source/Appccelerate.VersionTask/VersionTask.cs
@@ -7,7 +7,7 @@
     using System.Xml.Linq;

     using Appccelerate.Version;
-
+    using LibGit2Sharp;
     using Microsoft.Build.Framework;
     using Microsoft.Build.Utilities;

@@ -48,6 +48,13 @@
                 base.Log.LogMessage(MessageImportance.Normal, "Version: " + version.Version);
                 base.Log.LogMessage(MessageImportance.Normal, "NugetVersion: " + version.NugetVersion);
                 base.Log.LogMessage(MessageImportance.Normal, "InformationalVersion:" + version.InformationalVersion);
+                base.Log.LogMessage(MessageImportance.Normal, "IsPullRequest:" + repositoryVersionInformation.IsPullRequest);
+
+                string repositoryPath = Repository.Discover(startingPath);
+
+                var repository = new Repository(repositoryPath);
+
+                base.Log.LogMessage(MessageImportance.Normal, "working on branch: " + repository.Head.CanonicalName);

                 string versionAssemblyInfo = string.Format(@"


Updated About page title

Updated About page title

--- source/NovusCraft.Site/Views/Home/About.cshtml
+++ source/NovusCraft.Site/Views/Home/About.cshtml
@@ -1,7 +1,7 @@
 @model object

 @{
-	ViewBag.Title = "Arnold Zokas, Lead .NET developer";
+	ViewBag.Title = "Arnold Zokas, Senior .NET developer";
 	ViewBag.Description = "Novus Craft are a software development consultancy delivering top solutions using Sitecore CMS, .NET, ASP.NET MVC, RavenDB and other technologies.";
 }


Use new new syntax for initialized fields

--- src/gitnstats.core/CommitVisitor.cs
+++ src/gitnstats.core/CommitVisitor.cs
@@ -23,7 +23,7 @@
             //WithStopWatch(() => Walk(commit, new HashSet<string>()), "Total Time Walking Graph: {0}");
         }

-        private Object padlock = new Object();
+        private Object padlock = new();
         private void Walk(Commit commit, ISet<string> visitedCommits)
         {
             // It's not safe to concurrently write to the Set.


Issue-57 Fixed an issue when objects will be deleted on DryRun mode

--- TimeSeries/PublicApis/SdkExamples/LocationDeleter/Deleter.cs
+++ TimeSeries/PublicApis/SdkExamples/LocationDeleter/Deleter.cs
@@ -393,18 +393,18 @@
             string confirmationDescription,
             string confirmationResponse)
         {
+            var summary = summarizeAction();
+
+            if (Context.DryRun)
+            {
+                Log.Info($"DryRun: {summary}");
+                return false;
+            }
+
             if (Context.SkipConfirmation)
             {
                 Log.Warn($"Auto-confirming {operationDescription}");
                 return true;
-            }
-
-            var summary = summarizeAction();
-
-            if (Context.DryRun)
-            {
-                Log.Info($"DryRun: {summary}");
-                return false;
             }

             Log.Warn(summary);


null check for empty strings in HTML remover

--- TomKamphuisHelpers/TomKamphuis/Extensions/StringExtension.cs
+++ TomKamphuisHelpers/TomKamphuis/Extensions/StringExtension.cs
@@ -69,7 +69,11 @@

             string output = Regex.Replace(input, "<[^>]*>", string.Empty);
             output = WebUtility.HtmlDecode(output);
-            output = StringHelper.RemoveSpecialCharactersFromString(output);
+
+            if(!string.IsNullOrEmpty(output))
+            {
+                output = StringHelper.RemoveSpecialCharactersFromString(output);
+            }

             return output;
         }


Directly use locale when getting boundaries

Creating a new locale from the localeId when calling
BreakIterator.GetBoundaries() seems unnecessary.

--- source/icu.net/BreakIterators/BreakIterator.cs
+++ source/icu.net/BreakIterators/BreakIterator.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2013 SIL International
+// Copyright (c) 2013 SIL International
 // This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
 using System;
 using System.Collections.Generic;
@@ -346,7 +346,7 @@
 			if (string.IsNullOrEmpty(text))
 				yield break;

-			foreach (var boundary in GetBoundaries(type, locale.Id, text, includeSpacesAndPunctuation: false))
+			foreach (var boundary in GetBoundaries(type, locale, text, includeSpacesAndPunctuation: false))
 			{
 				yield return text.Substring(boundary.Start, boundary.End - boundary.Start);
 			}


Added GetRequiredSetting method to fetch a required configuration setting value from the config file and made it so that other properties actually use that instead of reading the config file directly.

--- AppHarbor.Web.Security/ConfigFileAuthenticationConfiguration.cs
+++ AppHarbor.Web.Security/ConfigFileAuthenticationConfiguration.cs
@@ -46,11 +46,22 @@
 			}
 		}

+		private static string GetRequiredSetting(string name)
+		{
+			var setting = ConfigurationManager.AppSettings[name];
+			if (setting != null)
+			{
+				return setting;
+			}
+
+			throw new ConfigurationException(string.Format("Required setting '{0}' not found.", name));
+		}
+
 		public byte[] EncryptionKey
 		{
 			get
 			{
-				return ConfigurationManager.AppSettings["cookieauthentication.encryptionkey"].GetByteArrayFromHexString();
+				return GetRequiredSetting("cookieauthentication.encryptionkey").GetByteArrayFromHexString();
 			}
 		}

@@ -58,7 +69,7 @@
 		{
 			get
 			{
-				return ConfigurationManager.AppSettings["cookieauthentication.encryptioniv"].GetByteArrayFromHexString();
+				return GetRequiredSetting("cookieauthentication.encryptioniv").GetByteArrayFromHexString();
 			}
 		}

@@ -74,7 +85,7 @@
 		{
 			get
 			{
-				return ConfigurationManager.AppSettings["cookieauthentication.validationkey"].GetByteArrayFromHexString();
+				return GetRequiredSetting("cookieauthentication.validationkey").GetByteArrayFromHexString();
 			}
 		}


Update TimePickerPresenter.cs

Update TimePickerPresenter.cs

formatting change

--- src/Avalonia.Controls/DateTimePickers/TimePickerPresenter.cs
+++ src/Avalonia.Controls/DateTimePickers/TimePickerPresenter.cs
@@ -194,7 +194,7 @@

             if (ClockIdentifier == "12HourClock")
             {
-                hr = per == 1 ? (hr == 12) ? 12:hr + 12 : per == 0 && hr == 12 ? 0 : hr;
+                hr = per == 1 ? (hr == 12) ? 12 : hr + 12 : per == 0 && hr == 12 ? 0 : hr;
             }

             Time = new TimeSpan(hr, min, 0);


Implement the remaining BMI1/2 intrinsic (dotnet/coreclr#21480)

* Add tests for BMI1/2 intrinsic

* Implement the remaining BMI1/2 intrinsic

* Fix emitDispIns for BMI instruction

Signed-off-by: dotnet-bot <03c4cb6107ae99956a7681f2c97ff7104809a2bd@microsoft.com>

--- src/Common/src/CoreLib/System/Runtime/Intrinsics/X86/Bmi1.cs
+++ src/Common/src/CoreLib/System/Runtime/Intrinsics/X86/Bmi1.cs
@@ -35,7 +35,7 @@
             ///   BEXTR r64a, reg/m64, r64b
             /// This intrinisc is only available on 64-bit processes
             /// </summary>
-            public static ulong BitFieldExtract(ulong value, byte start, byte length) => BitFieldExtract(value, start, length);
+            public static ulong BitFieldExtract(ulong value, byte start, byte length) => BitFieldExtract(value, (ushort)(start | (length << 8)));

             /// <summary>
             /// unsigned __int64 _bextr2_u64 (unsigned __int64 a, unsigned __int64 control)
@@ -83,7 +83,7 @@
         /// unsigned int _bextr_u32 (unsigned int a, unsigned int start, unsigned int len)
         ///   BEXTR r32a, reg/m32, r32b
         /// </summary>
-        public static uint BitFieldExtract(uint value, byte start, byte length) => BitFieldExtract(value, start, length);
+        public static uint BitFieldExtract(uint value, byte start, byte length) => BitFieldExtract(value, (ushort)(start | (length << 8)));

         /// <summary>
         /// unsigned int _bextr2_u32 (unsigned int a, unsigned int control)


Remove unnecessary parameter.

Remove unnecessary parameter.

--- src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs
+++ src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs
@@ -5064,7 +5064,7 @@
             {
                 if (HasImplicitTypeArguments(node))
                 {
-                    method = InferMethodTypeArguments(method, (CSharpSyntaxNode)node.Syntax, GetArgumentsForMethodTypeInference(results, argumentsNoConversions), refKindsOpt, argsToParamsOpt, expanded);
+                    method = InferMethodTypeArguments(method, GetArgumentsForMethodTypeInference(results, argumentsNoConversions), refKindsOpt, argsToParamsOpt, expanded);
                     parametersOpt = method.Parameters;
                 }
                 if (ConstraintsHelper.RequiresChecking(method))
@@ -5825,7 +5825,6 @@

         private MethodSymbol InferMethodTypeArguments(
             MethodSymbol method,
-            CSharpSyntaxNode callSyntax,
             ImmutableArray<BoundExpression> arguments,
             ImmutableArray<RefKind> argumentRefKindsOpt,
             ImmutableArray<int> argsToParamsOpt,
@@ -7451,7 +7450,7 @@
                         arguments.Add(new BoundExpressionWithNullability(syntax, new BoundParameter(syntax, parameter), parameterType.NullableAnnotation, parameterType.Type));
                     }
                     Debug.Assert(_binder is object);
-                    method = InferMethodTypeArguments(method, (CSharpSyntaxNode)group.Syntax, arguments.ToImmutableAndFree(), argumentRefKindsOpt: default, argsToParamsOpt: default, expanded: false);
+                    method = InferMethodTypeArguments(method, arguments.ToImmutableAndFree(), argumentRefKindsOpt: default, argsToParamsOpt: default, expanded: false);
                 }
                 if (invokedAsExtensionMethod)
                 {
@@ -7791,7 +7790,7 @@
                         {
                             placeholderArgs.Add(new BoundExpressionWithNullability(variables[i].Expression.Syntax, variables[i].Expression, NullableAnnotation.Oblivious, conversion.DeconstructionInfo.OutputPlaceholders[i].Type));
                         }
-                        deconstructMethod = InferMethodTypeArguments(deconstructMethod, (CSharpSyntaxNode)invocation.Syntax, placeholderArgs.ToImmutableAndFree(), invocation.ArgumentRefKindsOpt, invocation.ArgsToParamsOpt, invocation.Expanded);
+                        deconstructMethod = InferMethodTypeArguments(deconstructMethod, placeholderArgs.ToImmutableAndFree(), invocation.ArgumentRefKindsOpt, invocation.ArgsToParamsOpt, invocation.Expanded);

                         // check the constraints remain valid with the re-inferred parameter types
                         if (ConstraintsHelper.RequiresChecking(deconstructMethod))


add JS script for checking the currently selected file for upload and generating a message if it is bigger than 4 MB (the default .net framework value). May not work on old browsers.

--- AstroPhotoGallery/AstroPhotoGallery/Views/Picture/Upload.cshtml
+++ AstroPhotoGallery/AstroPhotoGallery/Views/Picture/Upload.cshtml
@@ -60,3 +60,17 @@
         }
     </div>
 </div>
+
+@* JS script for checking the currently selected file for upload and generating a message if it is bigger than 4 MB (the default .net framework value). May not work on old browsers.*@
+
+@*<script>
+    $('#image').bind('change', function () {
+
+        if (this.files[0].size > 4194304) {
+
+            //this.files[0].size gets the size of the file.
+            alert("The size of the selected image exceeds the maximum allowed size of 4 MBs.");
+            document.getElementById("image").value = "";
+        }
+    });
+</script>*@


[AddinTile] Update style of labels to match the background colour (bgo#596076)

--- src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinTile.cs
+++ src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinTile.cs
@@ -74,6 +74,7 @@
             Attach (image, 0, 1, 0, 3, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 0, 0);

             title = new Label ();
+            SetLabelStyle (title);
             title.Show ();
             title.Xalign = 0.0f;
             title.Markup = String.Format ("{0}", GLib.Markup.EscapeText (addin.Name));
@@ -83,6 +84,7 @@
                 AttachOptions.Expand | AttachOptions.Fill, 0, 0);

             description = new WrapLabel ();
+            SetLabelStyle (description);
             description.Show ();
             description.Text = addin.Description.Description;
             description.Wrap = false;
@@ -92,6 +94,7 @@
                 AttachOptions.Expand | AttachOptions.Fill, 0, 0);

             authors = new WrapLabel ();
+            SetLabelStyle (authors);
             authors.Markup = String.Format (
                 "{0} {1}",
                 Catalog.GetString ("Authors:"),
@@ -131,7 +134,30 @@

             UpdateState ();
         }
-
+
+        private void SetLabelStyle (Widget label)
+        {
+            bool changing_styles = false;
+            label.StyleSet += delegate {
+                if (changing_styles) {
+                    return;
+                }
+
+                changing_styles = true;
+                label.ModifyBg (StateType.Normal, label.Style.Base (StateType.Normal));
+                label.ModifyBg (StateType.Active, label.Style.Base (StateType.Active));
+                label.ModifyBg (StateType.Prelight, label.Style.Base (StateType.Prelight));
+                label.ModifyBg (StateType.Selected, label.Style.Base (StateType.Selected));
+                label.ModifyBg (StateType.Insensitive, label.Style.Base (StateType.Insensitive));
+                label.ModifyFg (StateType.Normal, label.Style.Text (StateType.Normal));
+                label.ModifyFg (StateType.Active, label.Style.Text (StateType.Active));
+                label.ModifyFg (StateType.Prelight, label.Style.Text (StateType.Prelight));
+                label.ModifyFg (StateType.Selected, label.Style.Text (StateType.Selected));
+                label.ModifyFg (StateType.Insensitive, label.Style.Text (StateType.Insensitive));
+                changing_styles = false;
+            };
+        }
+
         protected override void OnRealized ()
         {
             WidgetFlags |= WidgetFlags.NoWindow;


Switch to "CorrelationScope" icon

Switch to "CorrelationScope" icon

--- src/EditorFeatures/Core/Shared/Extensions/GlyphExtensions.cs
+++ src/EditorFeatures/Core/Shared/Extensions/GlyphExtensions.cs
@@ -208,7 +208,7 @@
                     return new ImageId(ImageCatalogGuid, KnownImageIds.NuGet);

                 case Glyph.MatchingType:
-                    return new ImageId(ImageCatalogGuid, KnownImageIds.Sync);
+                    return new ImageId(ImageCatalogGuid, KnownImageIds.CorrelationScope);

                 default:
                     throw new ArgumentException(nameof(glyph));


Add UID when a vCard is created.

Add UID when a vCard is created.

--- CalDavSynchronizer/Implementation/Contacts/CardDavRepository.cs
+++ CalDavSynchronizer/Implementation/Contacts/CardDavRepository.cs
@@ -122,6 +122,7 @@
       using (AutomaticStopwatch.StartDebug (s_logger))
       {
         vCard newVcard = new vCard();
+        newVcard.UniqueId = Guid.NewGuid().ToString();
         var initializedVcard = entityInitializer (newVcard);
         return await _cardDavDataAccess.CreateEntity (Serialize (initializedVcard));
       }


Fixed hide show more buttons on Premieres page

--- CinemaWorldProject/CinemaWorld.Web/Views/Premieres/Index.cshtml
+++ CinemaWorldProject/CinemaWorld.Web/Views/Premieres/Index.cshtml
@@ -11,7 +11,7 @@
     {
         var movie = Model.ElementAt(i);

-

+

                 @movie.Title

@@ -19,17 +19,20 @@

-                @(movie.Description.Length > 100 ? movie.Description.Substring(0, 100)  + "..." : movie.Description)
+                @(movie.Description.Length > 100 ? movie.Description.Substring(0, 100) + "..." : movie.Description)

-

-                @Ajax.ActionLink("See more", "GetFullMovieDescription", new { id = movie.Id }, new AjaxOptions
-                {
-                    HttpMethod = "GET",
-                    InsertionMode = InsertionMode.Replace,
-                    UpdateTargetId = "movie-description-" + i.ToString(),
-                    OnSuccess = "hideSeeMoreBtn",
-                }, new { @class="btn", id=string.Format("seeMoreBtn-{0}", movie.Id)})
-

+            @if (movie.Description.Length > 100)
+            {
+

+                    @Ajax.ActionLink("See more", "GetFullMovieDescription", new { id = movie.Id }, new AjaxOptions
+                    {
+                        HttpMethod = "GET",
+                        InsertionMode = InsertionMode.Replace,
+                        UpdateTargetId = "movie-description-" + i.ToString(),
+                        OnSuccess = "hideSeeMoreBtn",
+                    }, new { @class = "btn", id = string.Format("seeMoreBtn-{0}", movie.Id) })
+

+            }

         if (i > 0 && (i + 1) % 3 == 0)
@@ -43,9 +46,11 @@

 @section scripts{
-
 }


Cleaned up the code a little bit.

Cleaned up the code a little bit.

--- src/Extensions/MSTest/Gallio.MSTestAdapter/MSTestExplorer.cs
+++ src/Extensions/MSTest/Gallio.MSTestAdapter/MSTestExplorer.cs
@@ -26,6 +26,7 @@
     /// </summary>
     internal class MSTestExplorer : BaseTestExplorer
     {
+        private const string MSTestAssemblyDisplayName = @"Microsoft.VisualStudio.QualityTools.UnitTestFramework";
         public readonly Dictionary<Version, ITest> frameworkTests;
         public readonly Dictionary<IAssemblyInfo, ITest> assemblyTests;
         public readonly Dictionary<ITypeInfo, ITest> typeTests;
@@ -69,7 +70,7 @@

         private static Version GetFrameworkVersion(IAssemblyInfo assembly)
         {
-            AssemblyName frameworkAssemblyName = ReflectionUtils.FindAssemblyReference(assembly, "Microsoft.VisualStudio.QualityTools.UnitTestFramework");
+            AssemblyName frameworkAssemblyName = ReflectionUtils.FindAssemblyReference(assembly, MSTestAssemblyDisplayName);
             return frameworkAssemblyName != null ? frameworkAssemblyName.Version : null;
         }

@@ -89,6 +90,7 @@

         private static ITest CreateFrameworkTest(Version frameworkVersion)
         {
+            //TODO: Use resource strings
             BaseTest frameworkTest = new BaseTest(String.Format("MSTest v{0}", frameworkVersion), null);
             frameworkTest.BaselineLocalId = "MSTest";
             frameworkTest.Kind = TestKinds.Framework;
@@ -103,7 +105,6 @@
             {
                 assemblyTest = CreateAssemblyTest(assembly);
                 frameworkTest.AddChild(assemblyTest);
-
                 assemblyTests.Add(assembly, assemblyTest);
             }

@@ -133,18 +134,14 @@
             {
                 try
                 {
-                    IEnumerable<IAttributeInfo> attributes = type.GetAttributeInfos(null, true);
-                    foreach (IAttributeInfo attribute in attributes)
+                    if (IsFixture(type))
                     {
-                        if (attribute.Type.FullName.CompareTo(MSTestAttributes.TestClassAttribute) == 0)
-                        {
-                            typeTest = CreateTypeTest(type);
-                            break;
-                        }
+                        typeTest = CreateTypeTest(type);
                     }
                 }
                 catch (Exception ex)
                 {
+                    //TODO: Localize this string
                     typeTest = new ErrorTest(type,
                         String.Format("An exception occurred while generating an MSTest test from '{0}'.", type),
                         ex);
@@ -159,7 +156,7 @@

             return typeTest;
         }
-
+
         private static MSTest CreateTypeTest(ITypeInfo typeInfo)
         {
             MSTest typeTest = new MSTest(typeInfo.Name, typeInfo);
@@ -172,81 +169,81 @@
                 {
                     if (methodAttribute.Type.FullName.CompareTo(MSTestAttributes.TestMethodAttribute) == 0)
                     {
-                        MSTest testMethod = new MSTest(method.Name, method);
-                        testMethod.Kind = TestKinds.Test;
-                        testMethod.IsTestCase = true;
+                        MSTest testMethod = CreateMethodTest(typeInfo, method);
                         typeTest.AddChild(testMethod);
                         break;
                     }
                 }
             }

-            //foreach (XunitMethodInfoAdapter methodInfo in testClassCommand.EnumerateTestMethods())
-            //    typeTest.AddChild(CreateMethodTest(typeInfo, methodInfo));
-
-            //// Add XML documentation.
-            //string xmlDocumentation = typeInfo.Target.GetXmlDocumentation();
-            //if (xmlDocumentation != null)
-            //    typeTest.Metadata.SetValue(MetadataKeys.XmlDocumentation, xmlDocumentation);
+            // Add XML documentation.
+            string xmlDocumentation = typeInfo.GetXmlDocumentation();
+            if (xmlDocumentation != null)
+                typeTest.Metadata.SetValue(MetadataKeys.XmlDocumentation, xmlDocumentation);

             return typeTest;
         }

-        //private static XunitTest CreateMethodTest(XunitTypeInfoAdapter typeInfo, XunitMethodInfoAdapter methodInfo)
-        //{
-        //    XunitTest methodTest = new XunitTest(methodInfo.Name, methodInfo.Target, typeInfo, methodInfo);
-        //    methodTest.Kind = TestKinds.Test;
-        //    methodTest.IsTestCase = true;
-
-        //    // Add skip reason.
-        //    if (XunitMethodUtility.IsSkip(methodInfo))
-        //    {
-        //        string skipReason = XunitMethodUtility.GetSkipReason(methodInfo);
-        //        if (skipReason != null)
-        //            methodTest.Metadata.SetValue(MetadataKeys.IgnoreReason, skipReason);
-        //    }
-
-        //    // Add traits.
-        //    if (XunitMethodUtility.HasTraits(methodInfo))
-        //    {
-        //        foreach (KeyValuePair<string, string> entry in XunitMethodUtility.GetTraits(methodInfo))
-        //        {
-        //            methodTest.Metadata.Add(entry.Key ?? @"", entry.Value ?? @"");
-        //        }
-        //    }
-
-        //    // Add XML documentation.
-        //    string xmlDocumentation = methodInfo.Target.GetXmlDocumentation();
-        //    if (xmlDocumentation != null)
-        //        methodTest.Metadata.SetValue(MetadataKeys.XmlDocumentation, xmlDocumentation);
-
-        //    return methodTest;
-        //}
+        private static MSTest CreateMethodTest(ITypeInfo typeInfo, IMethodInfo methodInfo)
+        {
+            MSTest methodTest = new MSTest(methodInfo.Name, methodInfo);
+            methodTest.Kind = TestKinds.Test;
+            methodTest.IsTestCase = true;
+
+            // Add skip reason.
+            string skipReason = null;
+            if (IsIgnored(methodInfo, out skipReason))
+            {
+                if (skipReason != null)
+                    methodTest.Metadata.SetValue(MetadataKeys.IgnoreReason, skipReason);
+            }
+
+            // Add traits.
+            //if (XunitMethodUtility.HasTraits(methodInfo))
+            //{
+            //    foreach (KeyValuePair<string, string> entry in XunitMethodUtility.GetTraits(methodInfo))
+            //    {
+            //        methodTest.Metadata.Add(entry.Key ?? @"", entry.Value ?? @"");
+            //    }
+            //}
+
+            // Add XML documentation.
+            string xmlDocumentation = methodInfo.GetXmlDocumentation();
+            if (xmlDocumentation != null)
+                methodTest.Metadata.SetValue(MetadataKeys.XmlDocumentation, xmlDocumentation);
+
+            return methodTest;
+        }
+
+        private static bool IsFixture(ITypeInfo type)
+        {
+            IEnumerable<IAttributeInfo> attributes = type.GetAttributeInfos(null, true);
+            foreach (IAttributeInfo attribute in attributes)
+            {
+                if (attribute.Type.FullName.CompareTo(MSTestAttributes.TestClassAttribute) == 0)
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        private static bool IsIgnored(IMethodInfo methodInfo, out string skipReason)
+        {
+            IEnumerable<IAttributeInfo> attributes = methodInfo.GetAttributeInfos(null, true);
+            foreach (IAttributeInfo attribute in attributes)
+            {
+                if (attribute.Type.FullName.CompareTo(MSTestAttributes.IgnoreAttribute) == 0)
+                {
+                    //TODO: Get the real reason
+                    skipReason = "Ignored";
+                    return true;
+                }
+            }
+
+            skipReason = null;
+            return false;
+        }
     }
-}
-//IList<ITypeInfo> types = assembly.GetTypes();
-//foreach (ITypeInfo type in types)
-//{
-//    IEnumerable<IAttributeInfo> attributes = type.GetAttributeInfos(null, true);
-//    foreach (IAttributeInfo attribute in attributes)
-//    {
-//        if (attribute.Type.FullName.CompareTo(MSTestAttributes.TestClassAttribute) == 0)
-//        {
-//            foreach (IMethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance))
-//            {
-//                IEnumerable<IAttributeInfo> methodAttributes = method.GetAttributeInfos(null, true);
-//                foreach (IAttributeInfo methodAttribute in methodAttributes)
-//                {
-//                    if (methodAttribute.Type.FullName.CompareTo(MSTestAttributes.TestMethodAttribute) == 0)
-//                    {
-//                        MSTest test = new MSTest(method.Name, method);
-//                        test.IsTestCase = true;
-//                        consumer(test);
-//                        break;
-//                    }
-//                }
-//                break;
-//            }
-//        }
-//    }
-//}+}


fixes Terminal entered command

fixes Terminal entered command

--- src/FlubuCore/Infrastructure/Terminal/ConsoleHintedOutput.cs
+++ src/FlubuCore/Infrastructure/Terminal/ConsoleHintedOutput.cs
@@ -44,12 +44,11 @@
             var fullInput = string.Empty;
             var readLine = string.Empty;
             var wasUserInput = false;
-            bool writeSugestionToConsole;
             var cursorPosition = new ConsoleCursorPosition(ConsoleUtils.Prompt.Length, Console.CursorTop, Console.WindowWidth);
             ClearConsoleLines(cursorPosition.StartTop, cursorPosition.Top);
             while ((input = Console.ReadKey()).Key != ConsoleKey.Enter)
             {
-                writeSugestionToConsole = false;
+                var writeSugestionToConsole = false;
                 int positionToDelete;
                 switch (input.Key)
                 {
@@ -193,7 +192,7 @@

                 ClearConsoleLines(cursorPosition.StartTop, cursorPosition.Top);
                 var li = fullInput.TrimEnd().LastIndexOf(" ");
-                    if (li == -1)
+                if (li == -1)
                 {
                     ConsoleUtils.Write(userInput, ConsoleColor.Green);
                     fullInput = userInput;
@@ -235,7 +234,7 @@
             //ClearConsoleLines();
             Console.WriteLine(string.Empty);
             AddCommandToHistory(readLine);
-            return readLine;
+            return fullInput;
         }

         private static void WriteSuggestion(Suggestion suggestion, ConsoleColor hintColor)


Cleanup

Cleanup

--- src/FubarDev.WebDavServer.AspNetCore/WebDavControllerBase.cs
+++ src/FubarDev.WebDavServer.AspNetCore/WebDavControllerBase.cs
@@ -116,9 +116,6 @@
             [FromBody] propfind request,
             CancellationToken cancellationToken = default(CancellationToken))
         {
-            var routeData = HttpContext.GetRouteData();
-            var baseUrl = Url.RouteUrl((object)null);
-            //var a = HttpContext. .GetLeftPart(UriPartial.Authority);
             var result = await _dispatcher.Class1.PropFindAsync(path ?? string.Empty, request, cancellationToken).ConfigureAwait(false);
             return new WebDavIndirectResult(_dispatcher, result, _responseLogger);
         }


Clean Up

Clean Up

--- src/FujiyBlog.Web/Views/Themes/Default/Shared/_Layout.cshtml
+++ src/FujiyBlog.Web/Views/Themes/Default/Shared/_Layout.cshtml
@@ -50,30 +50,18 @@

FUJIYBLOG v.01

-
-    @*
-
-
-
-
-    *@

     @if (Settings.SettingRepository.EnableGooglePlusOnePosts)
     {

     }
     @if (Settings.SettingRepository.EnableTwitterSharePosts)
     {

-        @**@
     }


fix nearby server message methods

fix nearby server message methods


Logging during hash verification step

Logging during hash verification step

--- Code/CapuchinSync.Core/DirectorySynchronization/HashVerifier.cs
+++ Code/CapuchinSync.Core/DirectorySynchronization/HashVerifier.cs
@@ -63,9 +63,16 @@
             {
                 if (_status == VerificationStatus.TargetFileNotRead)
                 {
-                    if (!_fileSystem.DoesFileExist(FullTargetPath))
+                    if (HashEntry.Hash == HashDictionaryEntry.UnknownHash)
+                    {
+                        _status = VerificationStatus.TargetFileDoesNotMatchHash;
+                        // TODO: Examine file size, last write time to determine if we really need to copy?
+                        Warn($"No hash was present for file {FullTargetPath}.  The file will be overwritten with source {FullSourcePath}.  When possible, try regenerating the hash dictionary file.");
+                    }
+                    else if (!_fileSystem.DoesFileExist(FullTargetPath))
                     {
                         _status = VerificationStatus.TargetFileDoesNotExist;
+                        Info($"File at {FullTargetPath} does not exist, so it will have to be copied from source.");
                     }
                     else
                     {
@@ -74,10 +81,12 @@
                             if (CalculatedHash == HashEntry.Hash)
                             {
                                 _status = VerificationStatus.TargetFileMatchesHash;
+                                Debug($"File at {FullTargetPath} matches source at {FullSourcePath} with hash {CalculatedHash}, so no further action is needed.");
                             }
                             else
                             {
                                 _status = VerificationStatus.TargetFileDoesNotMatchHash;
+                                Info($"File at {FullTargetPath} has hash {CalculatedHash}, which does not match {HashEntry.Hash} of source {FullSourcePath}, so it will have to be copied from source.");
                             }
                         }
                         catch (Exception e)


Code cleanup

Code cleanup

--- Core/OfficeDevPnP.Core/AppModelExtensions/BrandingExtensions.cs
+++ Core/OfficeDevPnP.Core/AppModelExtensions/BrandingExtensions.cs
@@ -346,9 +346,10 @@
         /// <returns>The uploaded file, with at least the ServerRelativeUrl property available</returns>
         public static File UploadThemeFile(this Web web, string fileName, string localFilePath, string themeFolderVersion = "15")
         {
-            if (fileName == null) { throw new ArgumentNullException("fileName"); }
+            if (fileName == null) { throw new ArgumentNullException(nameof(fileName)); }
             if (string.IsNullOrWhiteSpace(fileName)) { throw new ArgumentException(CoreResources.BrandingExtensions_UploadThemeFile_Destination_file_name_is_required_, "fileName"); }
-            if (localFilePath == null) { throw new ArgumentNullException("localFilePath"); }
+            if (localFilePath == null) { throw new ArgumentNullException(nameof(localFilePath)); }
+            if (themeFolderVersion == null) throw new ArgumentNullException(nameof(themeFolderVersion));
             if (string.IsNullOrWhiteSpace(localFilePath)) { throw new ArgumentException(CoreResources.BrandingExtensions_UploadThemeFile_Source_file_path_is_required_, "localFilePath"); }

             using (var localStream = new FileStream(localFilePath, FileMode.Open))
@@ -426,7 +427,7 @@
         {
             if (string.IsNullOrEmpty(sourceFilePath))
             {
-                throw new ArgumentNullException("sourceFilePath");
+                throw new ArgumentNullException(nameof(sourceFilePath));
             }

             if (!System.IO.File.Exists(sourceFilePath))
@@ -508,7 +509,7 @@
         public static File DeployMasterPage(this Web web, string sourceFilePath, string title, string description, string uiVersion = "15", string defaultCSSFile = "", string folderPath = "")
         {
             if (string.IsNullOrEmpty(sourceFilePath))
-                throw new ArgumentNullException("sourceFilePath");
+                throw new ArgumentNullException(nameof(sourceFilePath));

             if (!System.IO.File.Exists(sourceFilePath))
                 throw new FileNotFoundException("File for param sourceFilePath not found.", sourceFilePath);
@@ -708,7 +709,7 @@
         private static string GetLocalizedCurrentValue(this Web web)
         {
             web.EnsureProperties(w => w.Language);
-            ClientResult<string> currentTranslated = Microsoft.SharePoint.Client.Utilities.Utility.GetLocalizedString(web.Context, "$Resources:Current", "core", (int)web.Language);
+            ClientResult<string> currentTranslated = Utilities.Utility.GetLocalizedString(web.Context, "$Resources:Current", "core", (int)web.Language);
             web.Context.ExecuteQueryRetry();
             return currentTranslated.Value;
         }
@@ -734,7 +735,7 @@
         public static ThemeEntity GetComposedLook(this Web web, string composedLookName)
         {
             // List of OOB composed looks
-            List<string> defaultComposedLooks = new List<string>(new string[] { "Orange", "Sea Monster", "Green", "Lime", "Nature", "Blossom", "Sketch", "City", "Orbit", "Grey", "Characters", "Office", "Breeze", "Immerse", "Red", "Purple", "Wood" });
+            List<string> defaultComposedLooks = new List<string>(new[] { "Orange", "Sea Monster", "Green", "Lime", "Nature", "Blossom", "Sketch", "City", "Orbit", "Grey", "Characters", "Office", "Breeze", "Immerse", "Red", "Purple", "Wood" });

             // ThemeEntity object that will be
             ThemeEntity theme = null;
@@ -764,9 +765,9 @@
             web.Context.Load(web, w => w.Url);
             web.Context.ExecuteQueryRetry();

-            string siteCollectionUrl = "";
-            string subSitePath = "";
-            using (ClientContext cc = web.Context.Clone(web.Url))
+            var siteCollectionUrl = "";
+            var subSitePath = "";
+            using (var cc = web.Context.Clone(web.Url))
             {
                 cc.Load(cc.Site, s => s.Url);
                 cc.ExecuteQueryRetry();
@@ -856,7 +857,7 @@
                     web.IsUsingOfficeTheme())
                 {
                     theme.Name = "Office";
-                    theme.MasterPage = String.Format("{0}/_catalogs/masterpage/seattle.master", subSitePath);
+                    theme.MasterPage = $"{subSitePath}/_catalogs/masterpage/seattle.master";
                     theme.Theme = "/_catalogs/theme/15/palette001.spcolor";
                     theme.IsCustomComposedLook = false;
                 }
@@ -867,7 +868,7 @@

                     //first loop avoids comparing with "current" entry in order to detect oob themes
                     //if no match then the second run includes "current"
-                    for (int i = 0; i < 2; i++)
+                    for (var i = 0; i < 2; i++)
                     {
                         if (themeMatched)
                         {
@@ -932,7 +933,7 @@
                         if (!web.IsUsingOfficeTheme())
                         {
                             // Assume the the last added custom theme is what the site is using
-                            for (int i = themes.Count; i-- > 0;)
+                            for (var i = themes.Count; i-- > 0;)
                             {
                                 var themeItem = themes[i];
                                 if (themeItem["Name"] != null && customComposedLooks.Contains(themeItem["Name"] as string))
@@ -973,13 +974,13 @@
                 return theme;
             }

-            String designPreviewThemedCssFolderUrl = web.GetPropertyBagValueString("DesignPreviewThemedCssFolderUrl", null);
+            var designPreviewThemedCssFolderUrl = web.GetPropertyBagValueString("DesignPreviewThemedCssFolderUrl", null);

             // If name still is "Current" and there isn't a PreviewThemedCssFolderUrl
             // property in the property bag then we can't correctly determine the set
             // composed look...so return null
             if (!string.IsNullOrEmpty(theme.Name) && theme.Name.Equals(currentLookName, StringComparison.InvariantCultureIgnoreCase)
-                && String.IsNullOrEmpty(designPreviewThemedCssFolderUrl))
+                && string.IsNullOrEmpty(designPreviewThemedCssFolderUrl))
             {
                 return null;
             }
@@ -1017,7 +1018,8 @@
         /// <returns></returns>
         private static bool IsMatchingTheme(ThemeEntity theme, string masterPageUrl, string themeUrl, string fontUrl)
         {
-            bool themeUrlHasValue = false, fontUrlHasValue = false;
+            var themeUrlHasValue = false;
+            var fontUrlHasValue = false;

             //Is Masterpage Url meaningful for compare?
             var masterPageUrlHasValue = !string.IsNullOrEmpty(theme.MasterPage);
@@ -1081,16 +1083,16 @@
         {
             try
             {
-                ThemeInfo ti = web.ThemeInfo;
+                var ti = web.ThemeInfo;
                 web.Context.Load(ti);
                 var accentText = ti.GetThemeShadeByName("AccentText");
                 var backgroundOverlay = ti.GetThemeShadeByName("BackgroundOverlay");
                 var bodyText = ti.GetThemeShadeByName("BodyText");
                 web.Context.ExecuteQueryRetry();

-                string accentTextRGB = accentText.Value.Substring(2);
-                string backgroundOverlayARGB = backgroundOverlay.Value.Substring(2);
-                string bodyTextRGB = bodyText.Value.Substring(2);
+                var accentTextRGB = accentText.Value.Substring(2);
+                var backgroundOverlayARGB = backgroundOverlay.Value.Substring(2);
+                var bodyTextRGB = bodyText.Value.Substring(2);

                 if (accentTextRGB.Equals("0072C6") &&
                     backgroundOverlayARGB.Equals("FFFFFF") &&
@@ -1126,10 +1128,10 @@
                 throw new ArgumentNullException("pageLayoutName");
             }

-            string pageLayoutFolder = System.IO.Path.GetDirectoryName(pageLayoutName);
-            string pageLayoutNameWithoutPath = System.IO.Path.GetFileNameWithoutExtension(pageLayoutName);
-
-            if (!String.IsNullOrEmpty(pageLayoutFolder))
+            var pageLayoutFolder = Path.GetDirectoryName(pageLayoutName);
+            var pageLayoutNameWithoutPath = Path.GetFileNameWithoutExtension(pageLayoutName);
+
+            if (!string.IsNullOrEmpty(pageLayoutFolder))
             {
                 // strip trailing /
                 pageLayoutFolder = pageLayoutFolder.Replace("\\", "/");
@@ -1138,17 +1140,18 @@
                     pageLayoutFolder = pageLayoutFolder.Substring(1);
                 }

-                pageLayoutNameWithoutPath = String.Format("{0}/{1}", pageLayoutFolder, pageLayoutNameWithoutPath);
+                pageLayoutNameWithoutPath = $"{pageLayoutFolder}/{pageLayoutNameWithoutPath}";
             }

             var masterPageGallery = web.GetCatalog((int)ListTemplateType.MasterPageCatalog);
             web.Context.Load(masterPageGallery, x => x.RootFolder.ServerRelativeUrl);
             web.Context.ExecuteQueryRetry();

-            var fileRefValue = string.Format("{0}/{1}{2}", masterPageGallery.RootFolder.ServerRelativeUrl, pageLayoutNameWithoutPath, ".aspx");
+            var fileRefValue = $"{masterPageGallery.RootFolder.ServerRelativeUrl}/{pageLayoutNameWithoutPath}.aspx";
             var query = new CamlQuery();
             // Use query Scope='RecursiveAll' to iterate through sub folders of Master page library because we might have file in folder hierarchy
-            query.ViewXml = string.Format("<View Scope='RecursiveAll'><Query><Where><Eq><FieldRef Name='FileRef'/><Value Type='Text'>{0}</Value></Eq></Where></Query></View>", fileRefValue);
+            query.ViewXml =
+                $"<View Scope='RecursiveAll'><Query><Where><Eq><FieldRef Name='FileRef'/><Value Type='Text'>{fileRefValue}</Value></Eq></Where></Query></View>";
             var galleryItems = masterPageGallery.GetItems(query);
             web.Context.Load(masterPageGallery);
             web.Context.Load(galleryItems);
@@ -1166,7 +1169,7 @@
         [SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "OfficeDevPnP.Core.Diagnostics.Log.Debug(System.String,System.String,System.Object[])")]
         public static void SetMasterPageByUrl(this Web web, string masterPageServerRelativeUrl, bool resetSubsitesToInherit = false, bool updateRootOnly = false)
         {
-            if (string.IsNullOrEmpty(masterPageServerRelativeUrl)) { throw new ArgumentNullException("masterPageServerRelativeUrl"); }
+            if (string.IsNullOrEmpty(masterPageServerRelativeUrl)) { throw new ArgumentNullException(nameof(masterPageServerRelativeUrl)); }

             var websToUpdate = new List<Web>();
             web.Context.Load(web, w => w.AllProperties, w => w.ServerRelativeUrl);
@@ -1223,7 +1226,7 @@
         [SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "OfficeDevPnP.Core.Diagnostics.Log.Debug(System.String,System.String,System.Object[])")]
         public static void SetCustomMasterPageByUrl(this Web web, string masterPageServerRelativeUrl, bool resetSubsitesToInherit = false, bool updateRootOnly = false)
         {
-            if (string.IsNullOrEmpty(masterPageServerRelativeUrl)) { throw new ArgumentNullException("masterPageServerRelativeUrl"); }
+            if (string.IsNullOrEmpty(masterPageServerRelativeUrl)) { throw new ArgumentNullException(nameof(masterPageServerRelativeUrl)); }

             var websToUpdate = new List<Web>();
             web.Context.Load(web, w => w.AllProperties, w => w.ServerRelativeUrl);
@@ -1248,7 +1251,7 @@
                     foreach (var childWeb in websCollection)
                     {
                         var inheritThemeProperty = childWeb.GetPropertyBagValueString(InheritTheme, "");
-                        bool inheritTheme = false;
+                        var inheritTheme = false;
                         if (!string.IsNullOrEmpty(inheritThemeProperty))
                         {
                             inheritTheme = string.Equals(childWeb.AllProperties[InheritTheme].ToString(), "True", StringComparison.InvariantCultureIgnoreCase);
@@ -1279,10 +1282,10 @@
         public static void SetDefaultPageLayoutForSite(this Web web, Web rootWeb, string pageLayoutName)
         {
             if (rootWeb == null)
-                throw new ArgumentNullException("rootWeb");
+                throw new ArgumentNullException(nameof(rootWeb));

             if (string.IsNullOrEmpty(pageLayoutName))
-                throw new ArgumentNullException("pageLayoutName");
+                throw new ArgumentNullException(nameof(pageLayoutName));

             // Save to property bag as the default page layout for the site
             XmlDocument xd = new XmlDocument();
@@ -1293,24 +1296,24 @@
         private static XmlNode CreateXmlNodeFromPageLayout(XmlDocument xd, Web web, Web rootWeb, string pageLayoutName)
         {
             if (xd == null)
-                throw new ArgumentNullException("xd");
+                throw new ArgumentNullException(nameof(xd));

             if (web == null)
-                throw new ArgumentNullException("web");
+                throw new ArgumentNullException(nameof(web));

             if (rootWeb == null)
-                throw new ArgumentNullException("rootWeb");
+                throw new ArgumentNullException(nameof(rootWeb));

             if (string.IsNullOrEmpty(pageLayoutName))
-                throw new ArgumentNullException("pageLayoutName");
-
-            ListItem pageLayout = rootWeb.GetPageLayoutListItemByName(pageLayoutName);
+                throw new ArgumentNullException(nameof(pageLayoutName));
+
+            var pageLayout = rootWeb.GetPageLayoutListItemByName(pageLayoutName);

             // Parse the right styled xml for the layout - <layout guid="944ea6be-f287-42c6-aa11-3fd75ab1ee9e" url="_catalogs/masterpage/ArticleLeft.aspx" />
             XmlNode xmlNode = xd.CreateElement("layout");
-            XmlAttribute xmlAttribute = xd.CreateAttribute("guid");
+            var xmlAttribute = xd.CreateAttribute("guid");
             xmlAttribute.Value = pageLayout["UniqueId"].ToString();
-            XmlAttribute xmlAttribute2 = xd.CreateAttribute("url");
+            var xmlAttribute2 = xd.CreateAttribute("url");
             // Get relative URL to the particular site collection
             xmlAttribute2.Value = SolveSiteRelativeUrl(rootWeb, pageLayout["FileRef"].ToString());
             xmlNode.Attributes.SetNamedItem(xmlAttribute);
@@ -1321,10 +1324,10 @@
         private static string SolveSiteRelativeUrl(Web web, string url)
         {
             if (web == null)
-                throw new ArgumentNullException("web");
+                throw new ArgumentNullException(nameof(web));

             if (string.IsNullOrEmpty(url))
-                throw new ArgumentNullException("url");
+                throw new ArgumentNullException(nameof(url));

             web.EnsureProperties(w => w.ServerRelativeUrl);

@@ -1362,7 +1365,7 @@
         /// <param name="pageLayouts">The page layouts to make available</param>
         public static void SetAvailablePageLayouts(this Web web, Web rootWeb, IEnumerable<string> pageLayouts)
         {
-            XmlDocument xd = new XmlDocument();
+            var xd = new XmlDocument();
             XmlNode xmlNode = xd.CreateElement("pagelayouts");
             xd.AppendChild(xmlNode);
             foreach (var item in pageLayouts)
@@ -1380,9 +1383,9 @@
         /// <param name="availableTemplates">List of <see cref="WebTemplateEntity"/> objects that define the templates that are allowed</param>
         public static void SetAvailableWebTemplates(this Web web, List<WebTemplateEntity> availableTemplates)
         {
-            string propertyValue = string.Empty;
-
-            LanguageTemplateHash languages = new LanguageTemplateHash();
+            var propertyValue = string.Empty;
+
+            var languages = new LanguageTemplateHash();
             foreach (var item in availableTemplates)
             {
                 AddTemplateToCollection(languages, item);
@@ -1390,20 +1393,20 @@

             if (availableTemplates.Count > 0)
             {
-                XmlDocument xd = new XmlDocument();
+                var xd = new XmlDocument();
                 XmlNode xmlNode = xd.CreateElement("webtemplates");
                 xd.AppendChild(xmlNode);
                 foreach (var language in languages)
                 {
-                    XmlNode xmlLcidNode = xmlNode.AppendChild(xd.CreateElement("lcid"));
-                    XmlAttribute xmlAttribute = xd.CreateAttribute("id");
+                    var xmlLcidNode = xmlNode.AppendChild(xd.CreateElement("lcid"));
+                    var xmlAttribute = xd.CreateAttribute("id");
                     xmlAttribute.Value = language.Key;
                     xmlLcidNode.Attributes.SetNamedItem(xmlAttribute);

                     foreach (string item in language.Value)
                     {
-                        XmlNode xmlWTNode = xmlLcidNode.AppendChild(xd.CreateElement("webtemplate"));
-                        XmlAttribute xmlAttributeName = xd.CreateAttribute("name");
+                        var xmlWTNode = xmlLcidNode.AppendChild(xd.CreateElement("webtemplate"));
+                        var xmlAttributeName = xd.CreateAttribute("name");
                         xmlAttributeName.Value = item;
                         xmlWTNode.Attributes.SetNamedItem(xmlAttributeName);
                     }
@@ -1427,7 +1430,7 @@

         private static void AddTemplateToCollection(LanguageTemplateHash languages, WebTemplateEntity item)
         {
-            string key = string.Empty;
+            var key = string.Empty;
             if (string.IsNullOrEmpty(item.LanguageCode))
             {
                 key = "all";
@@ -1451,7 +1454,7 @@
         /// <param name="rootFolderRelativePath">The path relative to the root folder of the site, e.g. SitePages/Home.aspx</param>
         public static void SetHomePage(this Web web, string rootFolderRelativePath)
         {
-            Folder folder = web.RootFolder;
+            var folder = web.RootFolder;
             folder.WelcomePage = rootFolderRelativePath;
             folder.Update();
             web.Context.ExecuteQueryRetry();


splitting a long line for better readability

--- bigtable/api/QuickStart/QuickStart.cs
+++ bigtable/api/QuickStart/QuickStart.cs
@@ -34,7 +34,8 @@
                 BigtableClient bigtableClient = BigtableClient.Create();

                 // Read a row from my-table using a row key
-                Row row = bigtableClient.ReadRow(new TableName(projectId, instanceId, tableId), "r1", RowFilters.CellsPerRowLimit(1));
+                Row row = bigtableClient.ReadRow(
+                    new TableName(projectId, instanceId, tableId), "r1", RowFilters.CellsPerRowLimit(1));
                 // Print the row key and data (column value, labels, timestamp)
                 Console.WriteLine($"{"Row key:",-30}{row.Key.ToStringUtf8()}\n" +
                                   $"{"  Column Family:",-30}{row.Families[0].Name}\n" +


fix cancel.

fix cancel.

--- WalletWasabi.Fluent/ViewModels/Navigation/NavigationStack.cs
+++ WalletWasabi.Fluent/ViewModels/Navigation/NavigationStack.cs
@@ -75,7 +75,7 @@
 		{
 			var root = _backStack.Count > 0 ? _backStack.Last() : CurrentPage;

-			if (CurrentPage == root || (!keepRoot && _backStack.Count == 0 && CurrentPage is null))
+			if ((keepRoot && CurrentPage == root) || (!keepRoot && _backStack.Count == 0 && CurrentPage is null))
 			{
 				return;
 			}


Prevents comparison of the ThemeEntity.MasterPage property if the property is null

--- Core/OfficeDevPnP.Core/AppModelExtensions/BrandingExtensions.cs
+++ Core/OfficeDevPnP.Core/AppModelExtensions/BrandingExtensions.cs
@@ -896,7 +896,7 @@
                         if (!web.IsUsingOfficeTheme())
                         {
                             // Assume the the last added custom theme is what the site is using
-                            for (int i = themes.Count; i-- > 0;)
+                            for (int i = themes.Count; i-- > 0; )
                             {
                                 var themeItem = themes[i];
                                 if (themeItem["Name"] != null && customComposedLooks.Contains(themeItem["Name"] as string))
@@ -983,6 +983,9 @@
         {
             bool themeUrlHasValue = false, fontUrlHasValue = false;

+            //Is Masterpage Url meaningful for compare?
+            var masterPageUrlHasValue = !string.IsNullOrEmpty(theme.MasterPage);
+
             // Is theme URL meaningful for compare?
             if (!string.IsNullOrEmpty(theme.Theme))
             {
@@ -996,7 +999,7 @@
             }

             // Should we compare all of the values?
-            if (themeUrlHasValue && fontUrlHasValue)
+            if (masterPageUrlHasValue && themeUrlHasValue && fontUrlHasValue)
             {
                 if (theme.MasterPage.Equals(masterPageUrl, StringComparison.InvariantCultureIgnoreCase) &&
                     theme.Theme.Equals(themeUrl, StringComparison.InvariantCultureIgnoreCase) &&
@@ -1007,7 +1010,7 @@
             }

             // Should we compare only master page and theme URL?
-            if (themeUrlHasValue && !fontUrlHasValue)
+            if (masterPageUrlHasValue && themeUrlHasValue && !fontUrlHasValue)
             {
                 if (theme.MasterPage.Equals(masterPageUrl, StringComparison.InvariantCultureIgnoreCase) &&
                     theme.Theme.Equals(themeUrl, StringComparison.InvariantCultureIgnoreCase))
@@ -1017,7 +1020,7 @@
             }

             // Should we compare only master page and font value?
-            if (!themeUrlHasValue && fontUrlHasValue)
+            if (masterPageUrlHasValue && !themeUrlHasValue && fontUrlHasValue)
             {
                 if (theme.MasterPage.Equals(masterPageUrl, StringComparison.InvariantCultureIgnoreCase) &&
                     theme.Font.Equals(fontUrl, StringComparison.InvariantCultureIgnoreCase))
@@ -1027,7 +1030,7 @@
             }

             // Should we only compare master page
-            if (!themeUrlHasValue && !fontUrlHasValue)
+            if (masterPageUrlHasValue && !themeUrlHasValue && !fontUrlHasValue)
             {
                 if (theme.MasterPage.Equals(masterPageUrl, StringComparison.InvariantCultureIgnoreCase))
                 {


Add log

Add log

--- WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
+++ WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
@@ -1182,6 +1182,7 @@
 				var resultAll = await RpcClient.TestMempoolAcceptAsync(coinsToTest, fakeOutputsCount: (Alices.Count + 1) * 2);
 				if (resultAll.accept)
 				{
+					Logger.LogInfo($"Mempool acceptance successful! Number of Alices: {Alices.Count}.");
 					return Enumerable.Empty<Alice>();
 				}


Removed more unused code

Removed more unused code

Large chunks of ConvertMongoToFdoPartsOfSpeech aren't used. Ideally, we
can pretty much gut it and treat it just like any other OptionList, with
the exception of the SetPartOfSpeech static method. (The counterpart of
ConvertFdoToMongoPartsOfSpeech.FromMSA).

--- src/LfMerge/DataConverters/ConvertMongoToFdoPartsOfSpeech.cs
+++ src/LfMerge/DataConverters/ConvertMongoToFdoPartsOfSpeech.cs
@@ -53,55 +53,6 @@
 			FlattenedGoldEticItems.Value.ToDictionary(item => item.Guid, item => item)
 		);

-		public string NameFromGuid(Guid guid, bool flat=false)
-		{
-			return NameFromGuidStr(guid.ToString(), flat);
-		}
-
-		public string NameFromGuidStr(string guidStr, bool flat=false)
-		{
-			string result;
-			Dictionary<string, string> lookupTable = flat ?
-				PartOfSpeechMasterList.FlatPosNames :
-				PartOfSpeechMasterList.HierarchicalPosNames;
-			if (lookupTable.TryGetValue(guidStr, out result))
-				return result;
-			return null;
-		}
-
-		public IPartOfSpeech FromGuid(Guid guid)
-		{
-			IPartOfSpeech result;
-			if (TryGetPos(guid, out result))
-				return result;
-			string name = NameFromGuidStr(guid.ToString(), flat:false);
-			if (name == null) return null; // If it's not a well-known name, we'll need to create an entry
-			return CreateFromWellKnownGuid(guid);
-		}
-
-		public IPartOfSpeech FromGuidStr(string guidStr)
-		{
-			IPartOfSpeech result;
-			if (TryGetPos(guidStr, out result))
-				return result;
-			string name = NameFromGuidStr(guidStr, flat:false);
-			if (name == null) return null;
-			// We know we have a well-known name, so we should use it. TODO: Or should we?
-			Guid guid;
-			if (Guid.TryParse(guidStr, out guid))
-				return CreateFromWellKnownGuid(guid);
-			// Really shouldn't get here at all, but if we do...
-			throw new ArgumentException(String.Format("Well-known GUID {0} didn't parse", guidStr), "guidStr");
-			// TODO: Turn that into a log message and don't actually throw an exception.
-		}
-
-		public IPartOfSpeech FromGuidStrOrName(string guidStr, string name, string userWs = "en", string fallbackWs = "en")
-		{
-			IPartOfSpeech posFromGuid = FromGuidStr(guidStr);
-			if (posFromGuid != null) return posFromGuid;
-			return FromAbbrevAndName(name, userWs, fallbackWs);
-		}
-
 		public static void SetPartOfSpeech(IMoMorphSynAnalysis msa, IPartOfSpeech pos, IPartOfSpeech secondaryPos = null)
 		{
 			if (msa == null)
@@ -178,17 +129,6 @@
 				if (wsId != 0)
 					pos.Name.set_String(wsId, kv.Value);
 			}
-		}
-
-		private void PopulateCustomPos(IPartOfSpeech pos, string finalName, string userWs)
-		{
-			int wsId = _cache.WritingSystemFactory.GetWsFromStr(userWs);
-			pos.Name.set_String(wsId, finalName);
-		}
-
-		private bool TryGetPos(Guid guid, out IPartOfSpeech result)
-		{
-			return _posRepo.TryGetObject(guid, out result);
 		}

 		private bool TryGetPos(string guidStr, out IPartOfSpeech result)


Use pattern matching

Use pattern matching

Use pattern matching instead of the as keyword.

--- src/LondonTravel.Site/Identity/UserClaimsPrincipalFactory.cs
+++ src/LondonTravel.Site/Identity/UserClaimsPrincipalFactory.cs
@@ -30,9 +30,8 @@
         public async override Task<ClaimsPrincipal> CreateAsync(LondonTravelUser user)
         {
             var principal = await base.CreateAsync(user);
-            var identity = principal.Identity as ClaimsIdentity;

-            if (identity != null)
+            if (principal.Identity is ClaimsIdentity identity)
             {
                 foreach (LondonTravelRole role in user?.RoleClaims)
                 {


Rewrite ReadPacketAsync to reduce allocations.

This reduces allocations in the "ManyRowsNewSync" scenario by 44%.

--- src/MySqlConnector/Protocol/Serialization/ProtocolUtility.cs
+++ src/MySqlConnector/Protocol/Serialization/ProtocolUtility.cs
@@ -11,43 +11,52 @@
     {
 		public static ValueTask<Packet> ReadPacketAsync(BufferedByteReader bufferedByteReader, IByteHandler byteHandler, Func<int?> getNextSequenceNumber, ProtocolErrorBehavior protocolErrorBehavior, IOBehavior ioBehavior)
 		{
-			return bufferedByteReader.ReadBytesAsync(byteHandler, 4, ioBehavior)
-				.ContinueWith(headerBytes =>
-				{
-					if (headerBytes.Count < 4)
-					{
-						return protocolErrorBehavior == ProtocolErrorBehavior.Throw ?
-							ValueTaskExtensions.FromException<Packet>(new EndOfStreamException()) :
-							default(ValueTask<Packet>);
-					}
+			var headerBytesTask = bufferedByteReader.ReadBytesAsync(byteHandler, 4, ioBehavior);
+			if (headerBytesTask.IsCompleted)
+				return ReadPacketAfterHeader(headerBytesTask.Result, bufferedByteReader, byteHandler, getNextSequenceNumber, protocolErrorBehavior, ioBehavior);
+			return AddContinuation(headerBytesTask, bufferedByteReader, byteHandler, getNextSequenceNumber, protocolErrorBehavior, ioBehavior);

-					var payloadLength = (int) SerializationUtility.ReadUInt32(headerBytes.Array, headerBytes.Offset, 3);
-					int packetSequenceNumber = headerBytes.Array[headerBytes.Offset + 3];
+			// NOTE: use a local function (with no captures) to defer creation of lambda objects
+			ValueTask<Packet> AddContinuation(ValueTask<ArraySegment<byte>> headerBytes_, BufferedByteReader bufferedByteReader_, IByteHandler byteHandler_, Func<int?> getNextSequenceNumber_, ProtocolErrorBehavior protocolErrorBehavior_, IOBehavior ioBehavior_) =>
+				headerBytes_.ContinueWith(x => ReadPacketAfterHeader(x, bufferedByteReader_, byteHandler_, getNextSequenceNumber_, protocolErrorBehavior_, ioBehavior_));
+		}

-					var expectedSequenceNumber = getNextSequenceNumber() % 256;
-					if (expectedSequenceNumber.HasValue && packetSequenceNumber != expectedSequenceNumber.Value)
-					{
-						if (protocolErrorBehavior == ProtocolErrorBehavior.Ignore)
-							return default(ValueTask<Packet>);
+		private static ValueTask<Packet> ReadPacketAfterHeader(ArraySegment<byte> headerBytes, BufferedByteReader bufferedByteReader, IByteHandler byteHandler, Func<int?> getNextSequenceNumber, ProtocolErrorBehavior protocolErrorBehavior, IOBehavior ioBehavior)
+		{
+			if (headerBytes.Count < 4)
+			{
+				return protocolErrorBehavior == ProtocolErrorBehavior.Throw ?
+					ValueTaskExtensions.FromException<Packet>(new EndOfStreamException()) :
+					default(ValueTask<Packet>);
+			}

-						var exception = MySqlProtocolException.CreateForPacketOutOfOrder(expectedSequenceNumber.Value, packetSequenceNumber);
-						return ValueTaskExtensions.FromException<Packet>(exception);
-					}
+			var payloadLength = (int) SerializationUtility.ReadUInt32(headerBytes.Array, headerBytes.Offset, 3);
+			int packetSequenceNumber = headerBytes.Array[headerBytes.Offset + 3];

-					return bufferedByteReader.ReadBytesAsync(byteHandler, payloadLength, ioBehavior)
-						.ContinueWith(payloadBytes =>
-						{
-							if (payloadBytes.Count < payloadLength)
-							{
-								return protocolErrorBehavior == ProtocolErrorBehavior.Throw ?
-									ValueTaskExtensions.FromException<Packet>(new EndOfStreamException()) :
-									default(ValueTask<Packet>);
-							}
+			var expectedSequenceNumber = getNextSequenceNumber() % 256;
+			if (expectedSequenceNumber.HasValue && packetSequenceNumber != expectedSequenceNumber.Value)
+			{
+				if (protocolErrorBehavior == ProtocolErrorBehavior.Ignore)
+					return default(ValueTask<Packet>);

-							return new ValueTask<Packet>(new Packet(packetSequenceNumber, payloadBytes));
-						});
-				});
+				var exception = MySqlProtocolException.CreateForPacketOutOfOrder(expectedSequenceNumber.Value, packetSequenceNumber);
+				return ValueTaskExtensions.FromException<Packet>(exception);
+			}
+
+			var payloadBytesTask = bufferedByteReader.ReadBytesAsync(byteHandler, payloadLength, ioBehavior);
+			if (payloadBytesTask.IsCompleted)
+				return CreatePacketFromPayload(payloadBytesTask.Result, payloadLength, packetSequenceNumber, protocolErrorBehavior);
+			return AddContinuation(payloadBytesTask, payloadLength, packetSequenceNumber, protocolErrorBehavior);
+
+			// NOTE: use a local function (with no captures) to defer creation of lambda objects
+			ValueTask<Packet> AddContinuation(ValueTask<ArraySegment<byte>> payloadBytesTask_, int payloadLength_, int packetSequenceNumber_, ProtocolErrorBehavior protocolErrorBehavior_)
+				=> payloadBytesTask_.ContinueWith(x => CreatePacketFromPayload(x, payloadLength_, packetSequenceNumber_, protocolErrorBehavior_));
 		}
+
+		private static ValueTask<Packet> CreatePacketFromPayload(ArraySegment<byte> payloadBytes, int payloadLength, int packetSequenceNumber, ProtocolErrorBehavior protocolErrorBehavior) =>
+			payloadBytes.Count >= payloadLength ? new ValueTask<Packet>(new Packet(packetSequenceNumber, payloadBytes)) :
+				protocolErrorBehavior == ProtocolErrorBehavior.Throw ? ValueTaskExtensions.FromException<Packet>(new EndOfStreamException()) :
+				default(ValueTask<Packet>);

 		public static ValueTask<ArraySegment<byte>> ReadPayloadAsync(BufferedByteReader bufferedByteReader, IByteHandler byteHandler, Func<int?> getNextSequenceNumber, ArraySegment<byte> previousPayloads, ProtocolErrorBehavior protocolErrorBehavior, IOBehavior ioBehavior)
 		{


Language adjustment

Language adjustment

--- src/NadekoBot/Modules/Battlezone/Commands/BZ2/BZ2Provider.cs
+++ src/NadekoBot/Modules/Battlezone/Commands/BZ2/BZ2Provider.cs
@@ -341,10 +341,10 @@
                 switch (pong.ServerInfoMode)
                 {
                     case 1:
-                        builder.AppendLine($"Time    | In lobby for {pong.GameTimeMinutes} minutes");
+                        builder.AppendLine($"Time    | Not playing or in shell for {pong.GameTimeMinutes} minutes");
                         break;
                     case 3:
-                        builder.AppendLine($"Time    | In game for {pong.GameTimeMinutes} minutes");
+                        builder.AppendLine($"Time    | Playing for {pong.GameTimeMinutes} minutes");
                         break;
                 }