GetParam() and SetParam() bugs fixed

GetParam() and SetParam() bugs fixed

--- SerialPortNET.cs
+++ SerialPortNET.cs
@@ -26,16 +26,16 @@
         /// <param name="stopBits">Stop bits</param>
         public SerialPort(string portName, int baudRate, Parity parity, byte dataBits, StopBits stopBits)
         {
-            // Do some basic settings
             this.IsOpen = false;
             this.IsRunning = false;
             this.PortName = portName;
-            this.BaudRate = baudRate;
-            this.Parity = parity;
-            this.DataBits = dataBits;
-            this.StopBits = stopBits;
-
-            this.DtrControl = DtrControl.Enable; // Default
+
+            // parameters
+            this._baudRate = baudRate;
+            this._parity = parity;
+            this._dataBits = dataBits;
+            this._stopBits = stopBits;
+            this._dtrControl = DtrControl.Enable; // Default
         }

         #endregion Public Constructors
@@ -73,6 +73,7 @@
         /// </summary>
         public void Dispose()
         {
+            Debug.WriteLine("SerialPort Disposed!");
             Dispose(true);
             GC.SuppressFinalize(this);
         }
@@ -83,6 +84,7 @@
         /// <exception cref="IOException">
         /// Raises IOException if cannot open port, or if some error happened during reading or writing port settings. Read the exception message to clarify.
         /// </exception>
+        //[MethodImpl(MethodImplOptions.Synchronized)]
         public void Open()
         {
             serialHandle = NativeMethods.CreateFile("\\\\.\\" + this.PortName, (uint)(EFileAccess.FILE_GENERIC_READ | EFileAccess.FILE_GENERIC_WRITE), 0, IntPtr.Zero, (uint)ECreationDisposition.OpenExisting, (uint)EFileAttributes.Normal, IntPtr.Zero);
@@ -180,15 +182,20 @@
         /// <param name="count">The number of bytes to write. </param>
         public void Write(byte[] buffer, int offset, int count)
         {
-            if (count != 4)
-                Debugger.Break();
             //serialStream.Write(buffer, offset, count);
             uint bytesWrote = 0;
             byte[] offsetedBuffer = new byte[count];
             buffer.CopyTo(offsetedBuffer, offset);
-            bool success = NativeMethods.WriteFile(serialHandle, offsetedBuffer, (uint)count, out bytesWrote, IntPtr.Zero);
-            if (!success)
-                throw new IOException("Write returned error :" + new Win32Exception((int)NativeMethods.GetLastError()).Message);
+            try
+            {
+                bool success = NativeMethods.WriteFile(serialHandle, offsetedBuffer, (uint)count, out bytesWrote, IntPtr.Zero);
+                if (!success)
+                    throw new IOException("Write returned error :" + new Win32Exception((int)NativeMethods.GetLastError()).Message);
+            }
+            catch (Exception ex)
+            {
+                Debug.Write(ex);
+            }
         }

         /// <summary>
@@ -253,7 +260,6 @@

         private DCB GetParams()
         {
-
             DCB serialParams = new DCB();
             serialParams.DCBLength = (uint)Marshal.SizeOf(serialParams);

@@ -261,15 +267,6 @@
             {
                 if (!NativeMethods.GetCommState(serialHandle, ref serialParams))
                     throw new IOException("GetCommState error!");
-
-                this._baudRate = (int)serialParams.BaudRate;
-                this._dataBits = serialParams.ByteSize;
-                this._stopBits = serialParams.StopBits;
-                this._parity = serialParams.Parity;
-                this._dtrControl = serialParams.DtrControl;
-
-                if (!NativeMethods.SetCommState(serialHandle, ref serialParams))
-                    throw new IOException("SetCommState error!");
             }
             return serialParams;
         }
@@ -315,7 +312,7 @@
         /// <summary>
         /// Gets or sets the serial baud rate.
         /// </summary>
-        public int BaudRate { get { GetParams(); return _baudRate; } set { _baudRate = value; SetParams(); } }
+        public int BaudRate { get { return (int)GetParams().BaudRate; } set { _baudRate = value; SetParams(); } }

         /// <summary>
         /// Gets the number of bytes of data in the receive buffer.
@@ -342,12 +339,12 @@
         /// <summary>
         /// Gets or sets the standard length of data bits per byte.
         /// </summary>
-        public byte DataBits { get { GetParams(); return _dataBits; } set { _dataBits = value; SetParams(); } }
+        public byte DataBits { get { return GetParams().ByteSize; } set { _dataBits = value; SetParams(); } }

         /// <summary>
         /// Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication.
         /// </summary>
-        public DtrControl DtrControl { get { GetParams(); return _dtrControl; } set { _dtrControl = value; SetParams(); } }
+        public DtrControl DtrControl { get { return GetParams().DtrControl; } set { _dtrControl = value; SetParams(); } }

         /// <summary>
         /// Gets a value indicating the open or closed status of the <see cref="SerialPort"/> object.
@@ -362,7 +359,7 @@
         /// <summary>
         /// Gets or sets the parity-checking protocol.
         /// </summary>
-        public Parity Parity { get { GetParams(); return _parity; } set { _parity = value; SetParams(); } }
+        public Parity Parity { get { return GetParams().Parity; } set { _parity = value; SetParams(); } }

         /// <summary>
         /// Gets or sets the port for communications, including but not limited to all available COM ports.
@@ -374,6 +371,8 @@
         /// </summary>
         public int ReceivedBytesThreshold { get; set; }

+        public StopBits StopBits { get { return GetParams().StopBits; } set { _stopBits = value; SetParams(); } }
+
         #endregion Public Properties

         #region Public Fields
@@ -388,13 +387,9 @@
         #region Private Fields

         private int _baudRate;
-
         private byte _dataBits;
-
         private DtrControl _dtrControl;
-
         private Parity _parity;
-
         private StopBits _stopBits;

         // For asynchronous operation
@@ -405,7 +400,7 @@
         //FileStream serialStream;
         private SafeFileHandle serialHandle;

-        private StopBits StopBits;
+        private object synclock = new object();

         #endregion Private Fields
     }


Make sure we always turn off the heat

Make sure we always turn off the heat

--- MatterControlLib/ConfigurationPage/PrintLeveling/SetupWizards/PrintLevelingWizard.cs
+++ MatterControlLib/ConfigurationPage/PrintLeveling/SetupWizards/PrintLevelingWizard.cs
@@ -142,6 +142,12 @@
 				var servoRetract = printer.Settings.GetValue<double>(SettingsKey.z_servo_retracted_angle);
 				printer.Connection.QueueLine($"M280 P0 S{servoRetract}");
 			}
+		}
+
+		public override bool ClosePage()
+		{
+			printer.Connection.TurnOffBedAndExtruders(TurnOff.AfterDelay);
+			return base.ClosePage();
 		}

 		protected override IEnumerator<WizardPage> GetPages()


Fixed compile problem in v15

Fixed compile problem in v15

--- OfficeDevPnP.Core/OfficeDevPnP.Core/Framework/TimerJobs/Utilities/SiteEnumeration.cs
+++ OfficeDevPnP.Core/OfficeDevPnP.Core/Framework/TimerJobs/Utilities/SiteEnumeration.cs
@@ -54,6 +54,7 @@
         /// <param name="resolvedSites">List of site collections matching the passed wildcard site Url</param>
         internal void ResolveSite(Tenant tenant, string siteWildCard, List<string> resolvedSites)
         {
+#if !CLIENTSDKV15
             //strip the wildcard
             string searchString = siteWildCard.Substring(0, siteWildCard.IndexOf("*"));

@@ -66,6 +67,7 @@

             //iterate the found site collections and add the sites that match to the site wildcard
             MatchSites(resolvedSites, searchString);
+#endif
         }

         /// <summary>
@@ -109,7 +111,7 @@
         /// <param name="tenant">Tenant object to operate against</param>
         private void FillSitesViaTenantAPIAndSearch(Tenant tenant)
         {
-
+#if !CLIENTSDKV15
             // Use tenant API to get the regular sites
             var props = tenant.GetSiteCollections(includeDetail: false);

@@ -132,7 +134,7 @@

             // Use search api to get the OneDrive sites
             this.sites.AddRange(SiteSearch(tenant.Context, "contentclass:\"STS_Site\" AND WebTemplate:SPSPERS"));
-
+#endif
         }

         /// <summary>


Added comments in AssemblyInfo

Added comments in AssemblyInfo

--- windows/Liferay.SDK/Properties/AssemblyInfo.cs
+++ windows/Liferay.SDK/Properties/AssemblyInfo.cs
@@ -1,11 +1,25 @@
 using System.Reflection;
 using System.Resources;

-[assembly: AssemblyTitleAttribute("Liferay SDK for Windows")]
-[assembly: AssemblyDescriptionAttribute("")]
-[assembly: AssemblyProductAttribute("Liferay SDK for Windows")]
-[assembly: AssemblyCopyrightAttribute("Copyright (c) 2014 Andrea Di Giorgi. All rights reserved.")]
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Liferay SDK for Windows")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyProduct("Liferay SDK for Windows")]
+[assembly: AssemblyCopyright("Copyright (c) 2014 Andrea Di Giorgi. All rights reserved.")]
+[assembly: AssemblyTrademarkAttribute("Liferay is a registered trademark of Liferay, Inc.")]
+[assembly: NeutralResourcesLanguage("en")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersionAttribute("1.0.0.0")]
 [assembly: AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: NeutralResourcesLanguageAttribute("en")]
-[assembly: AssemblyTrademarkAttribute("Liferay is a registered trademark of Liferay, Inc.")]


The font cache was expecting the bounds to start at 0

This change is due to the fix in the IVertex source bounds being right.
They used to always start at 0,0 and that was a bug that this code had
taken a dependency on.

issue: MatterHackers/MCCentral#5506
Terminal incorrectly reports line sent

--- agg/Font/StyledTypeFace.cs
+++ agg/Font/StyledTypeFace.cs
@@ -202,7 +202,7 @@
 			var bounds = glyphForCharacter.GetBounds();

 			var charImage = new ImageBuffer(
-				Math.Max((int)(bounds.Width + .5), 1) + 1,
+				Math.Max((int)(bounds.Right + .5), 1) + 1,
 				Math.Max((int)Math.Ceiling(EmSizeInPixels + (-DescentInPixels) + .5), 1) + 1,
 				32,
 				new BlenderPreMultBGRA());


Change initial startup test script.

Change initial startup test script.

--- IronAHK/Program.cs
+++ IronAHK/Program.cs
@@ -14,7 +14,7 @@
             #region Test run

 #if DEBUG
-            const string test = "AsFloat";
+            const string test = "ComplexExpression";
             const string output = "/out test.exe";
             const string extra = "";
             const string cmd = extra + " " + output + " ..{0}..{0}..{0}Tests{0}Scripting{0}Code{0}" + test + ".ia";


Mark users as inactive if they are offline and they reconnect.

--- JabbR/Hubs/Chat.cs
+++ JabbR/Hubs/Chat.cs
@@ -84,6 +84,13 @@

             if (reconnecting)
             {
+                // If the user was marked as offline then mark them inactive
+                if (user.Status == (int)UserStatus.Offline)
+                {
+                    user.Status = (int)UserStatus.Inactive;
+                    _repository.CommitChanges();
+                }
+
                 // Ensure the client is re-added
                 _service.AddClient(user, Context.ConnectionId, UserAgent);
             }


Convert 4 models to c#

Convert 4 models to c#

--- src/ui/windows/TogglDesktop/TogglDesktop/DLL.cs
+++ src/ui/windows/TogglDesktop/TogglDesktop/DLL.cs
@@ -13,6 +13,70 @@
         private const string dll = "TogglDesktopDLL.dll";
         private const CharSet charset = CharSet.Ansi;
         private const CallingConvention convention = CallingConvention.Cdecl;
+
+        // Models
+
+        [StructLayout(LayoutKind.Sequential, CharSet = charset)]
+        public struct KopsikTimeEntryViewItem
+        {
+            public int DurationInSeconds;
+            public string Description;
+            public string ProjectAndTaskLabel;
+            public int WID;
+            public int PID;
+            public int TID;
+            public string Duration;
+            public string Color;
+            public string GUID;
+            public bool Billabel;
+            public string Tags;
+            public int Started;
+            public int Ended;
+            public string StartTimeString;
+            public string EndTimeString;
+            public int UpdatedAt;
+            public string DateHeader;
+            public string DateDuration;
+            public bool DurOnly;
+            public bool IsHeader;
+            public IntPtr Next;
+        }
+
+        [StructLayout(LayoutKind.Sequential, CharSet = charset)]
+        public struct KopsikAutocompleteItem
+        {
+            public string Text;
+            public string Description;
+            public string ProjectAndTaskLabel;
+            public int TaskID;
+            public int ProjectID;
+            public IntPtr Next;
+        }
+
+        [StructLayout(LayoutKind.Sequential, CharSet = charset)]
+        public struct KopsikViewItem
+        {
+            public int ID;
+            public string GUID;
+            public string Name;
+            public IntPtr Next;
+        }
+
+        [StructLayout(LayoutKind.Sequential, CharSet = charset)]
+        public struct KopsikSettingsViewItem
+        {
+            public bool UseProxy;
+            public string ProxyHost;
+            public int ProxyPort;
+            public string ProxyUsername;
+            public string ProxyPassword;
+            public bool UseIdleDetection;
+            public bool MenubarTimer;
+            public bool DockIcon;
+            public bool OnTop;
+            public bool Reminder;
+            public bool RecordTimeline;
+        }

         [DllImport(dll, CharSet = charset, CallingConvention = convention)]
         public static extern System.IntPtr kopsik_context_init(


Updated schema 201903 with Name for Footer

--- Core/OfficeDevPnP.Core/Framework/Provisioning/Providers/Xml/ProvisioningSchema-2019-03.cs
+++ Core/OfficeDevPnP.Core/Framework/Provisioning/Providers/Xml/ProvisioningSchema-2019-03.cs
@@ -5285,6 +5285,7 @@
     [System.SerializableAttribute()]
     [System.Diagnostics.DebuggerStepThroughAttribute()]
     [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema")]
     public partial class WikiPageWebPart {

         private System.Xml.XmlElement contentsField;
@@ -5437,6 +5438,7 @@
     [System.SerializableAttribute()]
     [System.Diagnostics.DebuggerStepThroughAttribute()]
     [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema")]
     public partial class BaseFieldValue {

         private string fieldNameField;
@@ -5471,6 +5473,7 @@
     [System.SerializableAttribute()]
     [System.Diagnostics.DebuggerStepThroughAttribute()]
     [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema")]
     public partial class FieldDefault : BaseFieldValue {
     }

@@ -5479,6 +5482,7 @@
     [System.SerializableAttribute()]
     [System.Diagnostics.DebuggerStepThroughAttribute()]
     [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema")]
     public partial class DataValue : BaseFieldValue {
     }

@@ -5688,6 +5692,7 @@
     [System.SerializableAttribute()]
     [System.Diagnostics.DebuggerStepThroughAttribute()]
     [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema")]
     public partial class WebPartPageWebPart {

         private System.Xml.XmlElement contentsField;


the interface getting collection of resources, has changed to filter on list of resource

git-svn-id: 0a00c2dd897b08c599ed2573a1b696556f964b14@344 0f896bb5-3ab0-2d4e-82a7-85ef10020915

--- PS.Mothership.Core/PS.Mothership.Core.Common/Contracts/Security/IAuthenticationService.cs
+++ PS.Mothership.Core/PS.Mothership.Core.Common/Contracts/Security/IAuthenticationService.cs
@@ -34,7 +34,7 @@
         IEnumerable<ResourceRolePermissionsDto> GetPermissionsByResource(Guid userGuid, ResourceEnum resource);

         [OperationContract]
-        IEnumerable<ResourceRolePermissionsDto> GetResourcePermissionsByCollection();
+        IEnumerable<ResourceRolePermissionsDto> GetResourcePermissionsByCollection(IList<ResourceEnum> resource);

         [OperationContract]
         IEnumerable<ResourceRolePermissionsDto> GetPermissionsByResourceType(Guid userGuid, ResourceTypeEnum resourceType);


Null checks are added

Null checks are added

--- LibSVMsharp/SVM.cs
+++ LibSVMsharp/SVM.cs
@@ -66,6 +66,16 @@
         /// <returns>SVM model according to the given training data and parameters.</returns>
         public static SVMModel Train(SVMProblem problem, SVMParameter parameter)
         {
+            if (problem == null)
+            {
+                throw new ArgumentNullException("problem");
+            }
+
+            if (parameter == null)
+            {
+                throw new ArgumentNullException("parameter");
+            }
+
             IntPtr ptr_problem = SVMProblem.Allocate(problem);
             IntPtr ptr_parameter = SVMParameter.Allocate(parameter);

@@ -87,6 +97,21 @@
         /// <param name="target"></param>
         public static void CrossValidation(SVMProblem problem, SVMParameter parameter, int nFolds, out double[] target)
         {
+            if (problem == null)
+            {
+                throw new ArgumentNullException("problem");
+            }
+
+            if (parameter == null)
+            {
+                throw new ArgumentNullException("parameter");
+            }
+
+            if (nFolds < 2)
+            {
+                throw new ArgumentOutOfRangeException("nFolds");
+            }
+
             IntPtr ptr_target = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(double)) * problem.Length);
             IntPtr ptr_problem = SVMProblem.Allocate(problem);
             IntPtr ptr_parameter = SVMParameter.Allocate(parameter);
@@ -167,6 +192,16 @@
         /// <returns></returns>
         public static double PredictValues(SVMModel model, SVMNode[] x, out double[] values)
         {
+            if (model == null)
+            {
+                throw new ArgumentNullException("model");
+            }
+
+            if (x == null)
+            {
+                throw new ArgumentNullException("x");
+            }
+
             IntPtr ptr_model = SVMModel.Allocate(model);
             double result = PredictValues(ptr_model, x, out values);
             SVMModel.Free(ptr_model);
@@ -182,7 +217,14 @@
         public static double PredictValues(IntPtr ptr_model, SVMNode[] x, out double[] values)
         {
             if (ptr_model == IntPtr.Zero)
+            {
                 throw new ArgumentNullException("ptr_model");
+            }
+
+            if (x == null)
+            {
+                throw new ArgumentNullException("x");
+            }

             int classCount = libsvm.svm_get_nr_class(ptr_model);
             int size = (int)(classCount * (classCount - 1) * 0.5);
@@ -213,6 +255,16 @@
         /// For an one-class model, +1 or -1 is returned.</returns>
         public static double Predict(SVMModel model, SVMNode[] x)
         {
+            if (model == null)
+            {
+                throw new ArgumentNullException("model");
+            }
+
+            if (x == null)
+            {
+                throw new ArgumentNullException("x");
+            }
+
             IntPtr ptr_model = SVMModel.Allocate(model);
             double result = Predict(ptr_model, x);
             SVMModel.Free(ptr_model);
@@ -227,7 +279,14 @@
         public static double Predict(IntPtr ptr_model, SVMNode[] x)
         {
             if (ptr_model == IntPtr.Zero)
+            {
                 throw new ArgumentNullException("ptr_model");
+            }
+
+            if (x == null)
+            {
+                throw new ArgumentNullException("x");
+            }

             List<SVMNode> nodes = x.Select(a => a.Clone()).ToList();
             nodes.Add(new SVMNode(-1, 0));
@@ -248,6 +307,16 @@
         /// <returns></returns>
         public static double PredictProbability(SVMModel model, SVMNode[] x, out double[] estimations)
         {
+            if (model == null)
+            {
+                throw new ArgumentNullException("model");
+            }
+
+            if (x == null)
+            {
+                throw new ArgumentNullException("x");
+            }
+
             IntPtr ptr_model = SVMModel.Allocate(model);
             double result = PredictProbability(ptr_model, x, out estimations);
             SVMModel.Free(ptr_model);
@@ -263,7 +332,14 @@
         public static double PredictProbability(IntPtr ptr_model, SVMNode[] x, out double[] estimations)
         {
             if (ptr_model == IntPtr.Zero)
+            {
                 throw new ArgumentNullException("ptr_model");
+            }
+
+            if (x == null)
+            {
+                throw new ArgumentNullException("x");
+            }

             bool isProbabilityModel = libsvm.svm_check_probability_model(ptr_model);
             if (!isProbabilityModel)
@@ -299,6 +375,16 @@
         /// <returns></returns>
         public static string CheckParameter(SVMProblem problem, SVMParameter parameter)
         {
+            if (problem == null)
+            {
+                throw new ArgumentNullException("problem");
+            }
+
+            if (parameter == null)
+            {
+                throw new ArgumentNullException("parameter");
+            }
+
             IntPtr ptr_problem = SVMProblem.Allocate(problem);
             IntPtr ptr_parameter = SVMParameter.Allocate(parameter);

@@ -320,6 +406,11 @@
         /// <returns></returns>
         public static bool CheckProbabilityModel(SVMModel model)
         {
+            if (model == null)
+            {
+                throw new ArgumentNullException("model");
+            }
+
             IntPtr ptr_model = SVMModel.Allocate(model);
             bool success = libsvm.svm_check_probability_model(ptr_model);
             SVMModel.Free(ptr_model);


CON-2014 align with bulk upload.

CON-2014 align with bulk upload.


Fix bugs in value comparison

Fix bugs in value comparison

--- YarnSpinner/Value.cs
+++ YarnSpinner/Value.cs
@@ -170,20 +170,15 @@
 			}

 			if (other.type == this.type) {
-				if( this.type == Type.Null ) {
+				switch (this.type) {
+				case Type.Null:
 					return 0;
-				}
-
-				if( this.type == Type.String ) {
-					return this.stringValue.CompareTo(other.stringValue);
-				}
-
-				if( this.type == Type.Number ) {
-					return this.numberValue.CompareTo(other.numberValue);
-				}
-
-				if( this.type == Type.Bool ) {
-					return this.boolValue.CompareTo(other.boolValue);
+				case Type.String:
+					return this.stringValue.CompareTo (other.stringValue);
+				case Type.Number:
+					return this.numberValue.CompareTo (other.numberValue);
+				case Type.Bool:
+					return this.boolValue.CompareTo (other.boolValue);
 				}
 			}

@@ -197,16 +192,21 @@
 				return false;
 			}

-			// so yea this stinks basically
 			var other = (Value)obj;
-			if (this.type == other.type) {
-				if (this.type == Type.Null) {
-					return true;
-				}
-				return this.backingValue.Equals(other.backingValue);
-			}
-
-			return base.Equals (obj);
+
+			switch (this.type) {
+			case Type.Number:
+				return this.AsNumber == other.AsNumber;
+			case Type.String:
+				return this.AsString == other.AsString;
+			case Type.Bool:
+				return this.AsBool == other.AsBool;
+			case Type.Null:
+				return other.type == Type.Null;
+			default:
+				throw new ArgumentOutOfRangeException ();
+			}
+
 		}

 		// override object.GetHashCode


修复清理目录与新建目录相同时，清理旧文件时出现的错误删除文件的bug

修复清理目录与新建目录相同时，清理旧文件时出现的错误删除文件的bug


a standard message

a standard message

--- dotnet/Vernacular/Exceptions/trunk/I/PropertyException.cs
+++ dotnet/Vernacular/Exceptions/trunk/I/PropertyException.cs
@@ -45,6 +45,12 @@
     public class PropertyException :
         SemanticException
     {
+        /// <summary>
+        /// A string that can be used, if you wish, as the message to signal that
+        /// the property is mandatory, but was not filled out.
+        /// </summary>
+        public const string MandatoryMessage = "MANDATORY";
+
         public PropertyException()
         {
         }


ProjectX: Fix a bug in GetDebugMethodRVAToTokenMap

GetTypicalMethodDefinition should be used to get the MSIL token instead of GetMethodDefinition

[tfs-changeset: 1674855]

--- src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs
+++ src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs
@@ -91,12 +91,12 @@

             foreach (IMethodBodyNode emitted in emittedMethods)
             {
-                if (!(emitted.Method.GetMethodDefinition() is Internal.TypeSystem.Ecma.EcmaMethod))
+                if (!(emitted.Method.GetTypicalMethodDefinition() is Internal.TypeSystem.Ecma.EcmaMethod))
                 {
                     continue;
                 }

-                EntityHandle methodHandle = pseudoAssembly.EmitMetadataHandleForTypeSystemEntity(emitted.Method.GetMethodDefinition());
+                EntityHandle methodHandle = pseudoAssembly.EmitMetadataHandleForTypeSystemEntity(emitted.Method.GetTypicalMethodDefinition());
                 Debug.Assert(methodHandle.Kind == HandleKind.MemberReference);
                 uint methodToken = (uint)MetadataTokens.GetToken(methodHandle);
                 uint methodTokenRid = methodToken & 0xFFFFFF;


Fixed https://github.com/aspnet/AspNetCore/issues/5206: Fixing a minor html syntax error

--- src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Home/Prerendering.cshtml
+++ src/Middleware/NodeServices/samples/NodeServicesExamples/Views/Home/Prerendering.cshtml
@@ -4,7 +4,7 @@
     This sample demonstrates how you can invoke a JavaScript module that contains
     prerendering logic for a Single-Page Application framework.

-

+

     Your prerendering boot function will receive parameters that describe the page
     being rendered and any data supplied by the .NET code. The return value should be
     a promise that resolves with data to be injected into the page, such as the


Tests fixed.

Tests fixed.

--- backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/SchemasSearchSourceTests.cs
+++ backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/SchemasSearchSourceTests.cs
@@ -13,6 +13,7 @@
 using FluentAssertions;
 using Squidex.Domain.Apps.Core;
 using Squidex.Domain.Apps.Core.Schemas;
+using Squidex.Domain.Apps.Core.TestHelpers;
 using Squidex.Domain.Apps.Entities.Search;
 using Squidex.Domain.Apps.Entities.TestHelpers;
 using Squidex.Infrastructure;
@@ -22,7 +23,7 @@

 namespace Squidex.Domain.Apps.Entities.Schemas
 {
-    public class SchemasSearchSourceTests
+    public class SchemasSearchSourceTests : IClassFixture<TranslationsFixture>
     {
         private readonly IUrlGenerator urlGenerator = A.Fake<IUrlGenerator>();
         private readonly IAppProvider appProvider = A.Fake<IAppProvider>();


Parametrization (in progress)

Parametrization (in progress)

--- Source/Apps/Microsoft/Released/Microsoft-NewsTemplate/Service/Data/TweetFunctionCSharp.cs
+++ Source/Apps/Microsoft/Released/Microsoft-NewsTemplate/Service/Data/TweetFunctionCSharp.cs
@@ -16,7 +16,7 @@
 using System.Net.Http;
 using System.Security.Cryptography.X509Certificates;
 using System.Web;
-
+using System.Data;

 public static async Task<object> Run(HttpRequestMessage req, TraceWriter log)
 {
@@ -43,6 +43,48 @@

 public class TweetHandler
 {
+    private static SqlParameter[] MapValuesToSqlParameters(params object[] list)
+    {
+        if (list == null)
+            return null;
+
+        SqlParameter[] result = new SqlParameter[list.Length];
+        for (int i = 0; i < list.Length; i++)
+        {
+            if (list[i] is int)
+                result[i].DbType = DbType.Int32;
+            else if (list[i] is uint)
+                result[i].DbType = DbType.UInt32;
+            else if (list[i] is long)
+                result[i].DbType = DbType.Int64;
+            else if (list[i] is ulong)
+                result[i].DbType = DbType.UInt64;
+            else if (list[i] is short)
+                result[i].DbType = DbType.Int16;
+            else if (list[i] is ushort)
+                result[i].DbType = DbType.UInt16;
+            else if (list[i] is byte)
+                result[i].DbType = DbType.Byte;
+            else if (list[i] is float)                     // Floating types
+                result[i].DbType = DbType.Single;
+            else if (list[i] is double)
+                result[i].DbType = DbType.Double;
+            else if (list[i] is DateTime)                  // Date and time
+                result[i].DbType = DbType.DateTime;
+            else if (list[i] is bool)                      // Boolean
+                result[i].DbType = DbType.Boolean;
+            else if (list[i] is char || list[i] is string) // Character type
+                result[i].DbType = DbType.String;
+            else
+                throw new Exception("Unexpected data type"); // OUR code should not use other types
+
+            result[i].Value = list[i];
+            result[i].ParameterName = $"@p{i + 1}"; // SqlClient doesn't accept anonymous parameters (expecting queries to use 1 based numbering for parameter names: @p1, @p2, etc...)
+        }
+
+
+        return result;
+    }
     public TweetHandler(string connection)
     {
         if (string.IsNullOrEmpty(connection))
@@ -125,18 +167,15 @@
         tweet = tweetObj;

         //Connect to Azure SQL Database & bring in Twitter Handles & IDs
-        string twitterHandles =
-            ExecuteSqlQuery("select value FROM pbist_twitter.configuration where name = \'twitterHandle\'", "value");
-        string twitterHandleId =
-            ExecuteSqlQuery("select value FROM pbist_twitter.configuration where name = \'twitterHandleId\'",
-                "value");
+        string twitterHandles  = ExecuteSqlQuery("select value FROM pbist_twitter.configuration where name = \'twitterHandle\'", "value");
+        string twitterHandleId = ExecuteSqlQuery("select value FROM pbist_twitter.configuration where name = \'twitterHandleId\'", "value");

         // Split out all the handles & create dictionary
-        String[] handle = null;
-        String[] handleId = null;
+        string[] handle = null;
+        string[] handleId = null;
         var dictionary = new Dictionary<string, string>();

-        if (twitterHandles != String.Empty)
+        if (!string.IsNullOrEmpty(twitterHandles))
         {
             handle = SplitHandles(twitterHandles, ',');
             handleId = SplitHandles(twitterHandleId, ',');
@@ -252,8 +291,10 @@

         //Save processed tweets into SQL
         int response = 0;
-        response = ExecuteSqlScalar(
-            $"Select count(1) FROM pbist_twitter.tweets_processed WHERE tweetid = '{processedTweets["tweetid"]}'");
+        string tweetId = processedTweets["tweetid"].ToString();
+        string statement = "SELECT Count(*) FROM pbist_twitter.tweets_processed WHERE tweetid = @p1";
+
+        response = ExecuteSqlScalar(statement, MapValuesToSqlParameters(tweetId));
         if (response == 0)
         {
             try
@@ -309,13 +350,19 @@
     }

     //Execute SQL query returning something
-    private int ExecuteSqlScalar(string sqlQuery)
+    private int ExecuteSqlScalar(string sqlQuery, SqlParameter[] parameters = null)
     {
         using (SqlConnection connection = new SqlConnection(connectionString.ToString()))
         {
             connection.Open();
-            var command = new SqlCommand(sqlQuery, connection);
-            return (int)command.ExecuteScalar();
+            using (SqlCommand command = new SqlCommand(sqlQuery, connection) { CommandTimeout = 0 })
+            {
+                if (parameters != null)
+                    command.Parameters.AddRange(parameters);
+
+                object v = command.ExecuteScalar();
+                return v == DBNull.Value ? 0 : Convert.ToInt32(v);
+            }
         }
     }


Added one log statement.

Added one log statement.

--- SubtextSystem/SubtextSolution/Subtext.Framework/Configuration/UrlBasedBlogInfoProvider.cs
+++ SubtextSystem/SubtextSolution/Subtext.Framework/Configuration/UrlBasedBlogInfoProvider.cs
@@ -133,7 +133,7 @@
 			BlogInfo info = (BlogInfo)context.Items[cacheKey];
 			if(info == null)
 			{
-				log.Info("BlogInfo was not in context cache using cacheKey '" + cacheKey + "'");
+				log.Debug("BlogInfo was not in context cache using cacheKey '" + cacheKey + "'");
 				string app = UrlFormats.GetBlogApplicationNameFromRequest(context.Request.RawUrl, context.Request.ApplicationPath);

 				if(!Config.IsValidApplicationName(app))


Changes to order certain operations are done in

--- TessellationAndVoxelizationGeometryLibrary/Voxelization/VoxelizedSolid_PublicFunctions.cs
+++ TessellationAndVoxelizationGeometryLibrary/Voxelization/VoxelizedSolid_PublicFunctions.cs
@@ -1278,24 +1278,30 @@
             if (!(start is null))
                 shift = start.subtract(mask[0]);
             var level = lastLevel;
+            var slice = ThickenMask(mask[0], toolDia, dir);
             foreach (var initCoord in mask)
             {
-                var coordinate = start is null ? initCoord : initCoord.add(shift);
-                var slice = ThickenMask(coordinate, toolDia, dir);
-                var stop = true;
-                foreach (var coord in slice)
-                {
-                    if (!ExceedsBounds(coord, level)) stop = false;
-                    var eVox = GetVoxelID(coord, level);
+                var tOffset = initCoord.subtract(mask[0]);
+                var stop = new [] { true, false };
+
+                for (var i = 0; i < slice.Count; i++)
+                {
+                    slice[i] = start is null ? slice[i] : slice[i].add(shift);
+                    slice[i].add(tOffset);
+                    //var coord = slice[i];
+                    if (!ExceedsBounds(slice[i], level)) stop[0] = false;
+                    var eVox = GetVoxelID(slice[i], level);
                     var dVox = designedSolid.GetVoxelID(eVox, level);
                     var role = Constants.GetRole(dVox);
                     if (role == VoxelRoleTypes.Full ||
                         (role == VoxelRoleTypes.Partial && stopAtPartial))
-                        stop = false;
-                    break;
-                }
-
-                if (stop) break;
+                    {
+                        stop[1] = true;
+                        break;
+                    }
+                }
+
+                if (stop[0] || stop[1]) break;
                 foreach (var coord in slice)
                 {
                     var eVox = GetVoxelID(coord, level);
@@ -1315,7 +1321,15 @@
         //ToDo: Add tool diameter to mask voxels
         private IList<int[]> ThickenMask(int[] vox, double toolDia, double[] dir)
         {
-
+            var voxels = new List<int[]>(new[] { vox });
+            //var voxDouble = new double[3];
+            //for (var i = 0; i < 3; i++)
+            //    voxDouble[i] = vox[i];
+            var toolPlane = new Flat(new double[] { vox[0], vox[1], vox[2] }, dir);
+
+
+
+            return voxels;
         }

         private IList<int[]> CreateProjectionMask(double[] dir, double tLimit,
@@ -1336,6 +1350,7 @@
             return voxels;
         }

+        //Exclusive by default (i.e. if line passes through vertex/edge it ony includes two voxels that are actually passed through)
         private static int[] GetNextVoxelCoord(IReadOnlyList<double> cInt, IReadOnlyList<double> direction, bool inclusive)
         {
             var searchDirs = new List<int>();


fixed for null slot causing failed generation


fix #226 specify encoding.utf8 with WriteAllText

--- scripts/ketarin-settings-commands-02-afterupdatingapp.cs
+++ scripts/ketarin-settings-commands-02-afterupdatingapp.cs
@@ -1,8 +1,7 @@
 ////////////////////////////////////////////////////////////////////////////////////////
-/// version 6.8.0.0
+/// version 6.9.0.0
 ///
-/// Changelog: Calc SHA256 sums
-/// Ticket: https://github.com/dtgm/chocolatey-packages/issues/196
+/// Changelog: Write files as UTF8
 ///

 // REQUIRES:
@@ -79,7 +78,7 @@
       //MessageBox.Show(contents);
       // Make files writable
       // File.SetAttributes(file, FileAttributes.Normal);
-      File.WriteAllText(file, contents);
+      File.WriteAllText(file, contents, Encoding.UTF8);
     } catch (Exception ex) {
       Console.WriteLine(ex.Message);
     }
@@ -120,7 +119,7 @@
       //MessageBox.Show(contents);
       contents = contents.Replace("{checksumx64}", replace64Checksum);
       //MessageBox.Show(contents);
-      File.WriteAllText(file, contents);
+      File.WriteAllText(file, contents, Encoding.UTF8);
     } catch (Exception ex) {
       Console.WriteLine(ex.Message);
     }
@@ -139,7 +138,7 @@
   foreach (string file in fileNuspec) {
     string contents = File.ReadAllText(file);
     contents = contents.Replace(strCheck, strReplace);
-    File.WriteAllText(file, contents);
+    File.WriteAllText(file, contents, Encoding.UTF8);
   }
 }
 */


CYK without labels is work.

CYK without labels is work.


Bugfix : Fix HumanReadableReporter for manual timers.

This commits make the reporter work with all children of TimerBase,
and not only TimerMetric instances.

--- src/metrics/Reporting/HumanReadableReportFormatter.cs
+++ src/metrics/Reporting/HumanReadableReportFormatter.cs
@@ -48,9 +48,9 @@
                     {
                         WriteMetered(sb, (MeterMetric)metric);
                     }
-                    else if (metric is TimerMetric)
+                    else if (metric is TimerMetricBase)
                     {
-                        WriteTimer(sb, (TimerMetric)metric);
+                        WriteTimer(sb, (TimerMetricBase)metric);
                     }
                     sb.AppendLine();
                 }
@@ -98,7 +98,7 @@
             sb.AppendFormat("            99.9%% <= %{0:F2}\n", percentiles[5]);
         }

-        protected void WriteTimer(StringBuilder sb, TimerMetric timer)
+        protected void WriteTimer(StringBuilder sb, TimerMetricBase timer)
         {
             WriteMetered(sb, timer);

@@ -141,4 +141,4 @@
             }
         }
     }
-}+}


Demonstrating reader context for #256.

Demonstrating reader context for #256.

--- test/ExtendedXmlSerializer.Tests/ReportedIssues/Issue256Tests.cs
+++ test/ExtendedXmlSerializer.Tests/ReportedIssues/Issue256Tests.cs
@@ -3,8 +3,10 @@
 using ExtendedXmlSerializer.ContentModel.Identification;
 using ExtendedXmlSerializer.Core;
 using ExtendedXmlSerializer.ExtensionModel;
+using ExtendedXmlSerializer.ExtensionModel.Content;
 using ExtendedXmlSerializer.ExtensionModel.Xml;
 using FluentAssertions;
+using System;
 using System.Collections.Generic;
 using System.Xml;
 using Xunit;
@@ -38,7 +40,8 @@
 			var data =
 				@"<?xml version=""1.0"" encoding=""utf-8""?><Issue256Tests-SubjectContinue xmlns=""clr-namespace:ExtendedXmlSerializer.Tests.ReportedIssues;assembly=ExtendedXmlSerializer.Tests""><Foo>Doesn't Exist!</Foo><Bar>Hello World!</Bar></Issue256Tests-SubjectContinue>";

-			new ConfigurationContainer().EnableMissingMemberHandling(command.Execute)
+			new ConfigurationContainer().EnableReaderContext()
+			                            .EnableMissingMemberHandling(command.Execute)
 			                            .Create()
 			                            .Deserialize<SubjectContinue>(data).Bar.Should().Be("Hello World!");
 			command.Captured.Name.Should()
@@ -47,20 +50,24 @@
 			       .BeGreaterThan(0);
 			command.Captured.Position.Should()
 			       .BeGreaterThan(0);
+			command.Captured.Type.Should()
+			       .Be(typeof(SubjectContinue));
 		}

 		public struct CapturedInfo
 		{
-			public CapturedInfo(string name, uint line, uint position)
+			public CapturedInfo(string name, uint line, uint position, Type type)
 			{
 				Name     = name;
 				Line = line;
 				Position = position;
+				Type = type;
 			}

 			public string Name { get; }
 			public uint Line { get; }
 			public uint Position { get; }
+			public Type Type { get; }
 		}

 		sealed class Command : ICommand<IFormatReader>
@@ -69,9 +76,13 @@

 			public void Execute(IFormatReader parameter)
 			{
+				var content =
+				ContentsHistory.Default.Get(parameter)
+				               .Peek();
+
 				var lineInfo = parameter.Get().To<IXmlLineInfo>();
 				Captured = new CapturedInfo(IdentityFormatter.Default.Get(parameter), (uint)lineInfo.LineNumber,
-				                            (uint)lineInfo.LinePosition);
+				                            (uint)lineInfo.LinePosition, content.Current.GetType());
 				if (parameter.Identifier != "http://www.w3.org/2000/xmlns/")
 				{
 					parameter.Content();


Handling when calibration is not active

Handling when calibration is not active

--- MainWindow.xaml.cs
+++ MainWindow.xaml.cs
@@ -70,12 +70,15 @@
             KinectElevationAngle = Config.GetElevationAngle();
             if (_currentKinectSensor != null) _currentKinectSensor.ElevationAngle = KinectElevationAngle;

-            if (!Boolean.Parse(Config.ReadConfigOption(Config.Keys.CalibrationActive))) return;
-            //set calibration values to zero in preparation for calibration
-            Application_Handler.fov_top = 0;
-            Application_Handler.fov_left = 0;
-            Application_Handler.fov_width = 640;
-            Application_Handler.fov_height = 480;
+            var cal = Config.ReadConfigOption(Config.Keys.CalibrationActive);
+            if (!String.IsNullOrEmpty(cal) && Boolean.Parse(cal))
+            {
+                //set calibration values to zero in preparation for calibration
+                Application_Handler.fov_top = 0;
+                Application_Handler.fov_left = 0;
+                Application_Handler.fov_width = 640;
+                Application_Handler.fov_height = 480;
+            }
         }

         private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)


SanitizeTextboxes

SanitizeTextboxes

SanitizeTextboxes

--- MainWindow.xaml.cs
+++ MainWindow.xaml.cs
@@ -64,17 +64,31 @@
             }
         }

+        /// <summary>
+        /// Trim every textbox from excess whitespace. Maybe remove bad characters too.
+        /// </summary>
+        public void SanitizeTextboxes()
+        {
+            txt_outputFileName.Text = txt_outputFileName.Text.Trim();
+            txt_downloadURL.Text = txt_downloadURL.Text.Trim();
+            txt_customArgs.Text = txt_customArgs.Text.Trim();
+        }
+

         /// <summary>
         /// Invoke the youtube-dl.exe and pass it arguments from the GUI to download a video/audio file
         /// </summary>
         public void Download()
         {
-            string downloadedFileExt = GetOutputFileFormat();
-
             //24 hour time like 6-27-2016_09-33
             string downloadDateTime = DateTime.Now.ToString("M-d-yyyy_HH-mm");

+            //download the target url as either best audio or best video
+            string downloadedFileExt = GetOutputFileFormat();
+
+            SanitizeTextboxes();
+
+            //default for a download file name if no name is given
             if (String.IsNullOrEmpty(txt_outputFileName.Text))
             {
                 txt_outputFileName.Text = "youtube-dl-download_" + downloadDateTime + downloadedFileExt;
@@ -83,15 +97,16 @@
             //if custom args are given
             if (!String.IsNullOrEmpty(txt_customArgs.Text))
             {
-                string customArgs = txt_downloadURL.Text + " " + txt_customArgs.Text;
+                string customArgs = " " + txt_downloadURL.Text + " " + txt_customArgs.Text;
                 Process.Start(YouTubeDLFilePath, customArgs);
                 txt_log.AppendText(downloadDateTime + ": " + txt_downloadURL.Text + " downloaded with custom args: " + Environment.NewLine + "\t" + txt_customArgs.Text);
                 return;
             }

-            string args = " " + txt_downloadURL.Text.Trim() + " -o " + txt_outputPath.Text + "\\" + txt_outputFileName.Text + downloadedFileExt;
+            string args = " " + txt_downloadURL.Text + " -o " + txt_outputPath.Text + "\\" + txt_outputFileName.Text + downloadedFileExt;

-            //force audio download from youtube
+            //force audio download from youtube? check if soundcloud works fine
+            //i think this is 128kbps quality too - investigate for higher quality (best)
             if (downloadedFileExt == ".mp3")// && txt_downloadURL.Text.Contains("*youtube.com*")
             {
                 args += " --extract-audio --audio-format mp3 -l";


changes to MainWindow.

changes to MainWindow.

(ResumeWatchDirectoryChanges): new method.

made current position methods public.

(CanExecuteExtract): new code-behind method for xaml widgets.
(CanExecuteDelete): renamed into CanExecuteOnPhysicalFile.

(ExtAutoCompleteBox.OnPopulating): capture trown exceptions.

--- MainWindow.xaml.cs
+++ MainWindow.xaml.cs
@@ -238,6 +238,11 @@
             m_watcher.EnableRaisingEvents = false;
         }

+        void ResumeWatchDirectoryChanges ()
+        {
+            m_watcher.EnableRaisingEvents = true;
+        }
+
         private void InvokeRefreshView (object source, FileSystemEventArgs e)
         {
             var watcher = source as FileSystemWatcher;
@@ -495,17 +500,17 @@

         #region Navigation history implementation

-        private string CurrentPath { get { return ViewModel.Path; } }
+        internal string CurrentPath { get { return ViewModel.Path; } }

         HistoryStack<DirectoryPosition> m_history = new HistoryStack<DirectoryPosition>();

-        DirectoryPosition GetCurrentPosition ()
+        public DirectoryPosition GetCurrentPosition ()
         {
             var evm = CurrentDirectory.SelectedItem as EntryViewModel;
             return new DirectoryPosition (ViewModel, evm);
         }

-        bool SetCurrentPosition (DirectoryPosition pos)
+        public bool SetCurrentPosition (DirectoryPosition pos)
         {
             var vm = TryCreateViewModel (pos.Path);
             if (null == vm)
@@ -525,7 +530,7 @@
             }
         }

-        private void SaveCurrentPosition ()
+        public void SaveCurrentPosition ()
         {
             m_history.Push (GetCurrentPosition());
         }
@@ -821,7 +826,26 @@
             e.CanExecute = !ViewModel.IsArchive;
         }

-        private void CanExecuteDelete (object sender, CanExecuteRoutedEventArgs e)
+        private void CanExecuteExtract (object sender, CanExecuteRoutedEventArgs e)
+        {
+            if (ViewModel.IsArchive)
+            {
+                e.CanExecute = true;
+                return;
+            }
+            else if (CurrentDirectory.SelectedIndex != -1)
+            {
+                var entry = CurrentDirectory.SelectedItem as EntryViewModel;
+                if (entry != null && !entry.IsDirectory)
+                {
+                    e.CanExecute = true;
+                    return;
+                }
+            }
+            e.CanExecute = false;
+        }
+
+        private void CanExecuteOnPhysicalFile (object sender, CanExecuteRoutedEventArgs e)
         {
             if (!ViewModel.IsArchive && CurrentDirectory.SelectedIndex != -1)
             {
@@ -892,16 +916,23 @@
         protected override void OnPopulating (PopulatingEventArgs e)
         {
             var candidates = new List<string>();
-            string dirname = Path.GetDirectoryName (this.Text);
-            if (!string.IsNullOrEmpty (this.Text) && Directory.Exists (dirname))
-            {
-                foreach (var dir in Directory.GetDirectories (dirname))
-                {
-                    if (dir.StartsWith (dirname, StringComparison.CurrentCultureIgnoreCase))
-                        candidates.Add (dir);
-                }
-            }
-            this.ItemsSource = candidates;
+            try
+            {
+                string dirname = Path.GetDirectoryName (this.Text);
+                if (!string.IsNullOrEmpty (this.Text) && Directory.Exists (dirname))
+                {
+                    foreach (var dir in Directory.GetDirectories (dirname))
+                    {
+                        if (dir.StartsWith (dirname, StringComparison.CurrentCultureIgnoreCase))
+                            candidates.Add (dir);
+                    }
+                }
+                this.ItemsSource = candidates;
+            }
+            catch
+            {
+                // ignore filesystem errors
+            }
             base.OnPopulating (e);
         }
     }


Fixed Kinect sensor startup.

Fixed Kinect sensor startup.

--- MainWindow.xaml.cs
+++ MainWindow.xaml.cs
@@ -74,6 +74,10 @@

         private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
         {
+            //start and stop old kinect sensor kinect sensor
+            KinectSensor sensor1 = KinectSensor.KinectSensors[0];
+            sensor1.Stop();
+
             //get active directory to which files can be writen and read
             GetDirectoryPath();
             //start system monitoring
@@ -92,7 +96,14 @@
         private void SensorChooserOnKinectChanged(object sender, KinectChangedEventArgs args)
         {

-
+            //get kinect sensor
+            kinect = KinectSensor.KinectSensors[0];
+            //stop any previous kinect session
+            StopKinect(kinect);
+            if (kinect == null)
+            {
+                return;
+            }

             //Kinect filter parameters
             var parameters = new TransformSmoothParameters
@@ -121,9 +132,8 @@
                     // E.g.: sensor might be abruptly unplugged.
                     error = true;
                 }
-            }
-
-            if (args.NewSensor != null)
+            }
+            else //if (args.NewSensor != null)
             {
                 try
                 {
@@ -194,14 +204,14 @@
                     // KinectSensor might enter an invalid state while enabling/disabling streams or stream features.
                     // E.g.: sensor might be abruptly unplugged.
                 }
+
+                if (!error)
+                {
+                    kinectRegion.KinectSensor = args.NewSensor;
+
+                }

-            }
-
-            if (!error)
-            {
-                kinectRegion.KinectSensor = args.NewSensor;
-
-            }
+            }


edit word dialog service

edit word dialog service

--- AirlineTicketOffice.Main/ViewModel/TariffsVM.cs
+++ AirlineTicketOffice.Main/ViewModel/TariffsVM.cs
@@ -212,7 +212,7 @@

         private ICommand _openFileWordCommand;
         /// <summary>
-        /// Command open pdf and another file via set
+        /// Command open word file via  DocumentViewer.Document and set
         /// uri in webBrowser.Novigate in TariffsView.
         /// </summary>
         public ICommand OpenFileWordCommand
@@ -228,9 +228,9 @@
                         {
                             if (_wordFileDialogService.OpenFileDialog() == true)
                             {
-                                string filePath = _wordFileDialogService.FilePath;

                                 Navigate(_wordFileDialogService.Document, "word");
+
                             }
                         }
                         catch (Exception ex)


Delete Activity.cs

Delete Activity.cs

--- Models/Activity.cs
+++ Models/Activity.cs
@@ -1,49 +0,0 @@
-namespace Treehouse.FitnessFrog.Models
-{
-    /// <summary>
-    /// Represents a physical activity.
-    /// </summary>
-    public class Activity
-    {
-        /// <summary>
-        /// The list of activity types.
-        /// </summary>
-        public enum ActivityType
-        {
-            Basketball = 1,
-            Biking = 2,
-            Hiking = 3,
-            Kayaking = 4,
-            PokemonGo = 5,
-            Running = 6,
-            Skiing = 7,
-            Swimming = 8,
-            Walking = 9,
-            WeightLifting = 10
-        }
-
-        /// <summary>
-        /// Constructors an activity for the provided activity type and name.
-        /// </summary>
-        /// <param name="activityType">The activity type for the activity.</param>
-        /// <param name="name">The name for the activity.</param>
-        public Activity(ActivityType activityType, string name = null)
-        {
-            Id = (int)activityType;
-
-            // If we don't have a name argument,
-            // then use the string representation of the activity type for the name.
-            Name = name ?? activityType.ToString();
-        }
-
-        /// <summary>
-        /// The ID of the activity.
-        /// </summary>
-        public int Id { get; set; }
-
-        /// <summary>
-        /// The name of the activity.
-        /// </summary>
-        public string Name { get; set; }
-    }
-}


Remove some factors that may further affect *the* issue

--- MonoMod/MonoMod.cs
+++ MonoMod/MonoMod.cs
@@ -408,10 +408,9 @@

             for (int i = 0; i < body.Instructions.Count; i++) {
                 Instruction instruction = body.Instructions[i];
-                Object operand = instruction.Operand;
-
-                if (operand is MethodReference) {
-                    MethodReference methodCalled = (MethodReference) operand;
+
+                if (instruction.Operand is MethodReference) {
+                    MethodReference methodCalled = (MethodReference) instruction.Operand;
                     if (methodCalled.FullName == RemovePrefixes(method.FullName, method.DeclaringType.Name)) {
                         instruction.Operand = method;
                     } else {
@@ -463,8 +462,8 @@
                     }
                 }

-                if (operand is FieldReference) {
-                    FieldReference field = (FieldReference) operand;
+                if (instruction.Operand is FieldReference) {
+                    FieldReference field = (FieldReference) instruction.Operand;

                     TypeReference findTypeRef = FindType(field.DeclaringType, false);
                     TypeDefinition findType = findTypeRef == null ? null : findTypeRef.Resolve();
@@ -483,7 +482,7 @@
                         }
                     }

-                    if (field == operand && findType != null) {
+                    if (field == instruction.Operand && findType != null) {
                         //Console.WriteLine("F: new: " + field.FullName);
                         FieldDefinition oldField = null;
                         TypeDefinition oldType = (TypeDefinition) field.DeclaringType;
@@ -502,25 +501,25 @@
                         }
                     }

-                    if (field == operand) {
+                    if (field == instruction.Operand) {
                         field = new FieldReference(field.Name, FindType(field.FieldType), FindType(field.DeclaringType));
                     }

                     instruction.Operand = field;
                 }

-                if (operand is TypeReference) {
+                if (instruction.Operand is TypeReference) {
                     #if GENERIC_TYPE_REFERENCE
-                    if (((TypeReference) operand).IsGenericParameter) {
+                    if (((TypeReference) instruction.Operand).IsGenericParameter) {
                         Console.WriteLine("WARNING: GENERIC_TYPE_REFERENCE currently being tested extensively in the devbuilds - use with care!");
                         Console.WriteLine(Environment.StackTrace);

-                        Console.WriteLine("Generic param wanted: " + ((TypeReference) operand).FullName);
+                        Console.WriteLine("Generic param wanted: " + ((TypeReference) instruction.Operand).FullName);
                         Console.WriteLine("Method: " + method.FullName);
                         for (int gi = 0; gi < method.GenericParameters.Count; gi++) {
                             GenericParameter genericParam = method.GenericParameters[gi];
                             Console.WriteLine("Checking against: " + genericParam.FullName);
-                            if (genericParam.FullName == ((TypeReference) operand).FullName) {
+                            if (genericParam.FullName == ((TypeReference) instruction.Operand).FullName) {
                                 Console.WriteLine("Success!");
                                 instruction.Operand = Module.Import(genericParam);
                                 break;
@@ -528,7 +527,7 @@
                         }
                     } else
                     #endif
-                    instruction.Operand = FindType((TypeReference) operand);
+                    instruction.Operand = FindType((TypeReference) instruction.Operand);
                 }

                 #if GENERIC_PARAM
@@ -539,6 +538,8 @@
                     instruction.Operand = new GenericParameter(((GenericParameter) instruction.Operand).Name, method);
                 }
                 #endif
+
+                body.Instructions[i] = instruction;
             }

             for (int i = 0; i < body.Variables.Count; i++) {


Try to fix #5

Try to fix #5

--- MonoMod/MonoMod.cs
+++ MonoMod/MonoMod.cs
@@ -511,8 +511,14 @@
                         }

                         if (findMethod != null) {
-                            IsBlacklisted(findMethod.Module.Name, findMethod.DeclaringType.FullName+"."+findMethod.Name, HasAttribute(findMethod.Resolve(), "MonoModBlacklisted"));
-                        }
+                            MethodDefinition findMethodDef = findMethod.Resolve();
+                            IsBlacklisted(findMethod.Module.Name, findMethod.DeclaringType.FullName+"."+findMethod.Name, HasAttribute(findMethodDef, "MonoModBlacklisted"));
+                            //Quite untested - fixes invalid IL when calling virtual methods when not virtual in patch
+                            if (findMethodDef.Attributes.HasFlag(MethodAttributes.Virtual)) {
+                                instruction.OpCode = OpCodes.Callvirt;
+                            }
+                        }
+
                         operand = findMethod ?? Module.Import(methodCalled);
                     }
                 }


FlowchartWindow default EditorStyles labels

Previously was forcing use of white labels, with changes to unity theme in 2019.4.8 using default editorstyle label instead yields more readable results

--- Assets/Fungus/Scripts/Editor/FlowchartWindow.cs
+++ Assets/Fungus/Scripts/Editor/FlowchartWindow.cs
@@ -302,7 +302,7 @@

             if (EditorStyles.whiteLabel != null && handlerStyle == null)
             {
-                handlerStyle = new GUIStyle(EditorStyles.whiteLabel);
+                handlerStyle = new GUIStyle(EditorStyles.label);
                 handlerStyle.wordWrap = true;
                 handlerStyle.margin.top = 0;
                 handlerStyle.margin.bottom = 0;
@@ -914,7 +914,7 @@

                 GUILayout.BeginVertical();
                 {
-                    GUILayout.Label(flowchart.name, EditorStyles.whiteBoldLabel);
+                    GUILayout.Label(flowchart.name, EditorStyles.boldLabel);

                     GUILayout.Space(2);


When I tell you to quote something, I mean it!

--- MimeKit/Rfc2047.cs
+++ MimeKit/Rfc2047.cs
@@ -971,9 +971,6 @@
 			if (text == null)
 				throw new ArgumentNullException ("value");

-			if (text.IndexOfAny (ByteExtensions.TokenSpecials.ToCharArray ()) == -1)
-				return text;
-
 			var sb = new StringBuilder ();

 			sb.Append ("\"");


float support

float support

--- Assets/Terasurware/Editor/ExcelImporterMaker.cs
+++ Assets/Terasurware/Editor/ExcelImporterMaker.cs
@@ -296,6 +296,9 @@
                 } else
                 {
                     // only the head of array should generate code
+						case ValueType.FLOAT:
+							builder.AppendFormat(tab + "cell = row.GetCell({1}); p.{0} = (float)(cell == null ? 0 : cell.NumericCellValue);", row.name, rowCount);
+							break;
                     if (!isInbetweenArray)
                     {
                         int arrayLength = 0;
@@ -315,6 +318,9 @@
                             case ValueType.INT:
                                 builder.AppendFormat(tab + "p.{0} = new int[{1}];", row.name, arrayLength);
                                 break;
+							case ValueType.FLOAT:
+								builder.AppendFormat(tab + "p.{0} = new float[{1}];", row.name, arrayLength);
+								break;
                             case ValueType.STRING:
                                 builder.AppendFormat(tab + "p.{0} = new string[{1}];", row.name, arrayLength);
                                 break;
@@ -333,6 +339,9 @@
                                     break;
                                 case ValueType.INT:
                                     builder.AppendFormat(tab + "cell = row.GetCell({1}); p.{0}[{2}] = (int)(cell == null ? 0 : cell.NumericCellValue);", row.name, rowCount + i, i);
+								case ValueType.FLOAT:
+									builder.AppendFormat(tab + "cell = row.GetCell({1}); p.{0}[{2}] = (float)(cell == null ? 0.0 : cell.NumericCellValue);", row.name, rowCount + i, i);
+									break;
                                     break;
                                 case ValueType.STRING:
                                     builder.AppendFormat(tab + "cell = row.GetCell({1}); p.{0}[{2}] = (cell == null ? \"\" : cell.StringCellValue);", row.name, rowCount + i, i);


Added CreatePointOfInterestViewModel PerRequest to container

--- AugmentedSzczecin/AugmentedSzczecin/App.xaml.cs
+++ AugmentedSzczecin/AugmentedSzczecin/App.xaml.cs
@@ -36,6 +36,7 @@
             _container.PerRequest<SignInViewModel>();
             _container.PerRequest<ResetPasswordViewModel>();
             _container.PerRequest<AddPointOfInterestViewModel>();
+            _container.PerRequest<CreatePointOfInterestViewModel>();
             _container.PerRequest<IPointOfInterestService, PointOfInterestService>();
             _container.PerRequest<ILocationService, LocationService>();
             _container.PerRequest<IAccountService, AccountService>();


Dispose AssemblyResolver with new Cecil manually

--- MonoMod/MonoMod.cs
+++ MonoMod/MonoMod.cs
@@ -2266,6 +2266,8 @@
         public virtual void Dispose() {
             Module?.SymbolReader?.Dispose();
             #if MONOMOD_CECIL_NEW
+			AssemblyResolver.Dispose();
+			AssemblyResolver = null;
             Module?.Dispose();
             #endif
             foreach (ModuleDefinition dep in Dependencies) {


Optimization code using extensions

Optimization code using extensions

--- AzureBlobFileSystem/AzureBlobStorageProvider.cs
+++ AzureBlobFileSystem/AzureBlobStorageProvider.cs
@@ -263,10 +263,7 @@
         {
             var container = EnsurePathIsRelativeAndEnsureContainer(ref path);

-            if (container.BlobExists(path))
-            {
-                throw new ArgumentException("File " + path + " already exists");
-            }
+            container.EnsureBlobDoesNotExist(path);

             var blob = container.GetBlockBlobReference(path);
             var contentType = GetContentType(path);


Fixed potential crash in NavMenus

Fixed potential crash in NavMenus

--- NavMenuListView.cs
+++ NavMenuListView.cs
@@ -87,13 +87,16 @@
             for (int i = 0; i < this.Items.Count; i++)
             {
                 var lvi = (ListViewItem)this.ContainerFromIndex(i);
-                if (i != index)
-                {
-                    lvi.IsSelected = false;
-                }
-                else if (i == index)
-                {
-                    lvi.IsSelected = true;
+                if (lvi != null)
+                {
+                    if (i != index)
+                    {
+                        lvi.IsSelected = false;
+                    }
+                    else if (i == index)
+                    {
+                        lvi.IsSelected = true;
+                    }
                 }
             }
         }


* rename _filterInvChars->FilterInvalidCharacters, change from private to internal * add URL decoding to HttpRequest cookie parsing

--- Net/HTTPRequest.cs
+++ Net/HTTPRequest.cs
@@ -46,7 +46,7 @@
         /// </summary>
         /// <param name="str">The string to filter.</param>
         /// <returns>The provided string, filtered to remove disallowed characters.</returns>
-        private static string _filterInvChars(string str)
+        internal static string FilterInvalidCharacters(string str)
         {
             return str
                 .TrimStart(VAR_NOSTART.ToCharArray())
@@ -128,7 +128,7 @@
                 if (!inVal && c == '=')
                 {
                     inVal = true;
-                    section = _filterInvChars(
+                    section = FilterInvalidCharacters(
                         WebUtility.UrlDecode(qBuilder.ToString())
                         );
                     qBuilder.Clear();
@@ -141,7 +141,7 @@
                 }
                 else if (!inVal && c == '&')
                 {
-                    section = _filterInvChars(
+                    section = FilterInvalidCharacters(
                         WebUtility.UrlDecode(qBuilder.ToString())
                         );
                     dynObj[section] = String.Empty;
@@ -155,7 +155,7 @@

             if (!inVal)
             {
-                section = _filterInvChars(
+                section = FilterInvalidCharacters(
                     WebUtility.UrlDecode(qBuilder.ToString())
                     );

@@ -379,7 +379,11 @@
                     .Select(h => NameValueHttpHeader.ParsePairs(h.Value))
                     .SelectMany(d => d)
                     .ToList()
-                    .ForEach(nvp => dynObj.Add(_filterInvChars(nvp.Key), nvp.Value));
+                    .ForEach(
+                        nvp => dynObj.Add(
+                            FilterInvalidCharacters(nvp.Key),
+                            WebUtility.UrlDecode(nvp.Value)
+                        ));

                 _cookies = dynObj;
             }


Add back blue border

Add back blue border

--- osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs
+++ osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs
@@ -1,6 +1,7 @@
 // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
 // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

+using osu.Framework.Allocation;
 using OpenTK.Graphics;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
@@ -145,5 +146,11 @@

             textBox.OnCommit += OnCommit;
         }
+
+        [BackgroundDependencyLoader]
+        private void load(OsuColour colours)
+        {
+            textBox.BorderColour = colours.Blue;
+        }
     }
 }


TimeSpans fix.

TimeSpans fix.

--- targets/csharp-unityv2/source/Shared/Internal/Util.cs
+++ targets/csharp-unityv2/source/Shared/Internal/Util.cs
@@ -83,6 +83,12 @@
                     if (result)
                         return output;
                 }
+                else if (type == typeof(TimeSpan))
+                {
+                    double seconds;
+                    if (double.TryParse(valueStr, out seconds))
+                        return TimeSpan.FromSeconds(seconds);
+                }
                 return base.DeserializeObject(value, type);
             }

@@ -108,6 +114,11 @@
                 else if (input is DateTimeOffset)
                 {
                     output = ((DateTimeOffset)input).ToString(_defaultDateTimeFormats[DEFAULT_UTC_OUTPUT_INDEX], CultureInfo.CurrentCulture);
+                    return true;
+                }
+                else if (input is TimeSpan)
+                {
+                    output = ((TimeSpan)input).TotalSeconds;
                     return true;
                 }
                 return base.TrySerializeKnownTypes(input, out output);


add unstarted server test

add unstarted server test

--- src/csharp/Grpc.Core.Tests/ServerTest.cs
+++ src/csharp/Grpc.Core.Tests/ServerTest.cs
@@ -93,5 +93,12 @@

             server.ShutdownAsync().Wait();
         }
+
+        [Test]
+        public void UnstartedServerDoesNotPreventShutdown()
+        {
+            // just create a server, don't start it, and make sure it doesn't prevent shutdown.
+            var server = new Server();
+        }
     }
 }


cleanup namespace

cleanup namespace

--- BitSharp.Storage.Esent/PersistentUtxoBuilder.cs
+++ BitSharp.Storage.Esent/PersistentUtxoBuilder.cs
@@ -40,12 +40,12 @@
             this.Dispose();
         }

-        public bool ContainsKey(Common.UInt256 txHash)
+        public bool ContainsKey(UInt256 txHash)
         {
             return this.utxo.ContainsKey(txHash);
         }

-        public bool Remove(Common.UInt256 txHash)
+        public bool Remove(UInt256 txHash)
         {
             return this.utxo.Remove(txHash);
         }
@@ -55,14 +55,14 @@
             this.utxo.Clear();
         }

-        public void Add(Common.UInt256 txHash, UnspentTx unspentTx)
+        public void Add(UInt256 txHash, UnspentTx unspentTx)
         {
             this.utxo.Add(txHash, StorageEncoder.EncodeUnspentTx(unspentTx));
         }

         public int Count { get { return this.utxo.Count; } }

-        public UnspentTx this[Common.UInt256 txHash]
+        public UnspentTx this[UInt256 txHash]
         {
             get
             {


Changed BaseUOW for dynamic fixes

Changed BaseUOW for dynamic fixes

--- Caelan.Frameworks.BIZ/Classes/BaseUnitOfWork.cs
+++ Caelan.Frameworks.BIZ/Classes/BaseUnitOfWork.cs
@@ -3,84 +3,82 @@
 using System.Data.Entity;
 using System.Dynamic;
 using System.Linq;
-using System.Reflection;
 using Caelan.Frameworks.BIZ.Interfaces;
 using Caelan.Frameworks.DAL.Interfaces;

 namespace Caelan.Frameworks.BIZ.Classes
 {
-    public abstract class BaseUnitOfWork : DynamicObject, IDisposable
-    {
-        private readonly Dictionary<string, BaseRepository> _repositories;
+	public abstract class BaseUnitOfWork : DynamicObject, IDisposable
+	{
+		private readonly Dictionary<string, BaseRepository> _repositories;

-        protected BaseUnitOfWork()
-        {
-            _repositories = new Dictionary<string, BaseRepository>();
-            //_repositories = (Assembly.GetCallingAssembly().GetTypes().Where(t => t.BaseType == typeof(BaseRepository)) ?? Assembly.GetCallingAssembly().GetReferencedAssemblies().OrderBy(t => t.Name).Select(Assembly.Load).SelectMany(assembly => assembly.GetTypes().Where(t => t.BaseType == typeof(BaseRepository)))).Select(t => new KeyValuePair<string, BaseRepository>(t.Name.Replace("Repository", string.Empty), Activator.CreateInstance(t.MakeGenericType(t.GetGenericArguments()), this) as BaseRepository)).ToDictionary(t => t.Key, t => t.Value);
-        }
+		protected BaseUnitOfWork()
+		{
+			_repositories = GetType().Assembly.GetTypes().Where(t => t.BaseType == typeof(BaseRepository)).Select(t => new KeyValuePair<string, BaseRepository>(t.Name.Replace("Repository", string.Empty), Activator.CreateInstance(t.IsGenericType ? t.MakeGenericType(t.GetGenericArguments()) : t, this) as BaseRepository)).ToDictionary(t => t.Key, t => t.Value);
+		}

-        protected abstract DbContext Context();
+		protected abstract DbContext Context();

-        internal DbSet<TEntity> GetDbSet<TEntity, TDTO, TKey>(BaseRepository<TEntity, TDTO, TKey> repository)
-            where TEntity : class, IEntity<TKey>, new()
-            where TDTO : class, IDTO<TKey>, new()
-            where TKey : IEquatable<TKey>
-        {
-            return repository.DbSetFuncGetter().Invoke(Context());
-        }
+		internal DbSet<TEntity> GetDbSet<TEntity, TDTO, TKey>(BaseRepository<TEntity, TDTO, TKey> repository)
+			where TEntity : class, IEntity<TKey>, new()
+			where TDTO : class, IDTO<TKey>, new()
+			where TKey : IEquatable<TKey>
+		{
+			return repository.DbSetFuncGetter().Invoke(Context());
+		}

-        public int SaveChanges()
-        {
-            return Context().SaveChanges();
-        }
+		public int SaveChanges()
+		{
+			return Context().SaveChanges();
+		}

-        public void Dispose()
-        {
-            //Context.Dispose();
-        }
+		public void Dispose()
+		{
+			//Context.Dispose();
+		}

-        public override bool TryGetMember(GetMemberBinder binder, out object result)
-        {
-            if (!_repositories.ContainsKey(binder.Name))
-            {
-                var repoType = Type.GetType(binder.Name + "Repository");
+		public override bool TryGetMember(GetMemberBinder binder, out object result)
+		{
+			if (!_repositories.ContainsKey(binder.Name))
+			{
+				var repoType = GetType().Assembly.GetTypes().FirstOrDefault(t => t.Name == binder.Name + "Repository");

-                if (repoType == null)
-                {
-                    result = false;
-                    return false;
-                }
+				if (repoType == null)
+				{
+					result = false;
+					return false;
+				}

-                var repo = Activator.CreateInstance(repoType, this) as BaseRepository;
+				var repo = Activator.CreateInstance(repoType, this) as BaseRepository;

-                if (repo == null)
-                {
-                    result = null;
-                    return false;
-                }
+				if (repo == null)
+				{
+					result = null;
+					return false;
+				}

-                var property = Context().GetType().GetProperty(binder.Name);
+				var property = Context().GetType().GetProperty(binder.Name);

-                if (property == null)
-                {
-                    result = null;
-                    return false;
-                }
+				if (property == null)
+				{
+					result = null;
+					return false;
+				}

-                if (!_repositories.ContainsKey(binder.Name))
-                    _repositories.Add(binder.Name, repo);
-                else
-                    _repositories[binder.Name] = repo;
-            }
+				if (!_repositories.ContainsKey(binder.Name))
+					_repositories.Add(binder.Name, repo);
+				else
+					_repositories[binder.Name] = repo;
+			}

-            result = _repositories[binder.Name];
+			result = _repositories[binder.Name];

-            return true;
-        }
+			return true;
+		}

-        public override IEnumerable<string> GetDynamicMemberNames()
-        {
-            return _repositories.Keys;
-        }
-    }
+		public override IEnumerable<string> GetDynamicMemberNames()
+		{
+			return _repositories.Keys;
+		}
+	}
 }


Make the log level configurable

Make the log level configurable

--- CertiPay.Common/WebServices/MessageInspector.cs
+++ CertiPay.Common/WebServices/MessageInspector.cs
@@ -27,14 +27,14 @@
         /// Instantiate a default message inspector that logs all sent and received messages
         /// to CertiPay.Common.Logging
         /// </summary>
-        public MessageInspectorBehavior()
+        public MessageInspectorBehavior(LogLevel level = LogLevel.Info)
         {
             var log = LogManager.GetLogger<RawMessageInspector>();

             this._inspector = new RawMessageInspector
             {
-                OnSend = (message) => log.WithContext("Message", message).Info("Message Sent"),
-                OnReceive = (message) => log.WithContext("Message", message).Info("Message Received")
+                OnSend = (message) => log.WithContext("Message", message).Log(level, "Message Sent"),
+                OnReceive = (message) => log.WithContext("Message", message).Log(level, "Message Received")
             };
         }


Add some example on how to use

Add some example on how to use

--- CertiPay.Common/WebServices/MessageInspector.cs
+++ CertiPay.Common/WebServices/MessageInspector.cs
@@ -8,6 +8,15 @@
 {
     /// <summary>
     /// Behavior that can be added to the WCF client to getting request and response raw XML.
+    ///
+    /// Usage:
+    ///
+    ///     Action<Message> OnSend = (message) => Log.Info(message.ToString());
+    ///     Action<Message> OnReceive = (message) => Log.Info(message.ToString());
+    ///
+    ///     var client = new ServiceAPI.ServiceAPISoapClient(GetBinding(), new EndpointAddress(Url));
+    ///
+    ///     client.Endpoint.EndpointBehaviors.Add(new MessageInspectorBehavior(OnSend, OnReceive));
     /// </summary>
     public class MessageInspectorBehavior : IEndpointBehavior
     {


Added a PP list command

Added a PP list command

--- PPeXM64/Program.cs
+++ PPeXM64/Program.cs
@@ -127,6 +127,17 @@

                 handler.WriteString(IsLoaded.ToString());
             }
+            if (request == "pplist")
+            {
+                //Send a list of all loaded .pp files
+
+                var loadedPP = Cache.TotalFiles.Select(x => x.ArchiveName).Distinct();
+
+                if (loadedPP.Count() > 0)
+                    handler.WriteString(loadedPP.Aggregate((a, b) => a.Replace(".pp", "") + " " + b.Replace(".pp", "")));
+                else
+                    handler.WriteString("");
+            }
             else if (request == "load")
             {
                 //Transfer the file


Add tracing to KeepAliveTimeoutTests.ConnectionKeptAliveBetweenRequests to investigate test failures.

--- test/Kestrel.FunctionalTests/KeepAliveTimeoutTests.cs
+++ test/Kestrel.FunctionalTests/KeepAliveTimeoutTests.cs
@@ -2,6 +2,7 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

 using System;
+using System.Diagnostics;
 using System.IO;
 using System.Text;
 using System.Threading;
@@ -11,15 +12,26 @@
 using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
 using Microsoft.AspNetCore.Testing;
 using Microsoft.AspNetCore.Testing.xunit;
+using Microsoft.Extensions.Logging;
 using Xunit;
+using Xunit.Abstractions;

 namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
 {
     public class KeepAliveTimeoutTests
     {
-        private static readonly TimeSpan KeepAliveTimeout = TimeSpan.FromSeconds(10);
-        private static readonly TimeSpan LongDelay = TimeSpan.FromSeconds(30);
-        private static readonly TimeSpan ShortDelay = TimeSpan.FromSeconds(LongDelay.TotalSeconds / 10);
+        private static readonly TimeSpan _keepAliveTimeout = TimeSpan.FromSeconds(10);
+        private static readonly TimeSpan _longDelay = TimeSpan.FromSeconds(30);
+        private static readonly TimeSpan _shortDelay = TimeSpan.FromSeconds(_longDelay.TotalSeconds / 10);
+
+        private readonly ILoggerFactory _loggerFactory = new LoggerFactory();
+        private readonly ILogger _logger;
+
+        public KeepAliveTimeoutTests(ITestOutputHelper output)
+        {
+            _loggerFactory.AddXunit(output);
+            _logger = _loggerFactory.CreateLogger("Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.KeepAliveTimeoutTests");
+        }

         [Fact]
         public Task TestKeepAliveTimeout()
@@ -62,7 +74,7 @@
                     "",
                     "");
                 await ReceiveResponse(connection);
-                await connection.WaitForConnectionClose().TimeoutAfter(LongDelay);
+                await connection.WaitForConnectionClose().TimeoutAfter(_longDelay);
             }
         }

@@ -77,7 +89,12 @@
                         "Host:",
                         "",
                         "");
-                    await Task.Delay(ShortDelay);
+
+                    var stopWatch = new Stopwatch();
+                    stopWatch.Start();
+                    await Task.Delay(_shortDelay);
+                    stopWatch.Stop();
+                    _logger.LogDebug($"Short delay lasted {TimeSpan.FromMilliseconds(stopWatch.ElapsedMilliseconds).TotalSeconds} seconds instead of {_shortDelay.TotalSeconds} seconds.");
                 }

                 for (var i = 0; i < 10; i++)
@@ -92,7 +109,7 @@
             using (var connection = server.CreateConnection())
             {
                 var cts = new CancellationTokenSource();
-                cts.CancelAfter(LongDelay);
+                cts.CancelAfter(_longDelay);

                 await connection.Send(
                         "POST /consume HTTP/1.1",
@@ -107,7 +124,7 @@
                         "1",
                         "a",
                         "");
-                    await Task.Delay(ShortDelay);
+                    await Task.Delay(_shortDelay);
                 }

                 await connection.Send(
@@ -127,7 +144,7 @@
                     "Host:",
                     "",
                     "");
-                cts.CancelAfter(LongDelay);
+                cts.CancelAfter(_longDelay);

                 while (!cts.IsCancellationRequested)
                 {
@@ -149,8 +166,8 @@
         {
             using (var connection = server.CreateConnection())
             {
-                await Task.Delay(LongDelay);
-                await connection.WaitForConnectionClose().TimeoutAfter(LongDelay);
+                await Task.Delay(_longDelay);
+                await connection.WaitForConnectionClose().TimeoutAfter(_longDelay);
             }
         }

@@ -172,7 +189,7 @@
                 await connection.Receive(
                     "",
                     "");
-                cts.CancelAfter(LongDelay);
+                cts.CancelAfter(_longDelay);

                 while (!cts.IsCancellationRequested)
                 {
@@ -185,7 +202,7 @@

         private TestServer CreateServer(CancellationToken longRunningCt, CancellationToken upgradeCt)
         {
-            return new TestServer(httpContext => App(httpContext, longRunningCt, upgradeCt), new TestServiceContext
+            return new TestServer(httpContext => App(httpContext, longRunningCt, upgradeCt), new TestServiceContext(_loggerFactory)
             {
                 // Use real SystemClock so timeouts trigger.
                 SystemClock = new SystemClock(),
@@ -194,7 +211,7 @@
                     AddServerHeader = false,
                     Limits =
                     {
-                        KeepAliveTimeout = KeepAliveTimeout,
+                        KeepAliveTimeout = _keepAliveTimeout,
                         MinRequestBodyDataRate = null
                     }
                 }
@@ -220,7 +237,7 @@
                 {
                     while (!upgradeCt.IsCancellationRequested)
                     {
-                        await Task.Delay(LongDelay);
+                        await Task.Delay(_longDelay);
                     }

                     responseStream = stream;


Adding Utf8Json to Json Reader performance tests (#2401)

* Adding Utf8Json to Json Reader performance tests

*  Update comment to reflect change in number of tests`

--- tests/Benchmarks/System.Text.JsonLab/JsonReaderPerf.cs
+++ tests/Benchmarks/System.Text.JsonLab/JsonReaderPerf.cs
@@ -29,7 +29,7 @@
         Json400KB
     }

-    // Since there are 120 tests here (4 * 2 * 15), setting low values for the warmupCount, targetCount, and invocationCount
+    // Since there are 90 tests here (6 * 15), setting low values for the warmupCount, targetCount, and invocationCount
     [SimpleJob(-1, 3, 5, 1024)]
     [MemoryDiagnoser]
     public class JsonReaderPerf
@@ -40,7 +40,7 @@
         private MemoryStream _stream;
         private StreamReader _reader;

-        [Params(true, false)]
+        [Params(true)]
         public bool IsUTF8Encoded;

         [ParamsSource(nameof(TestCaseValues))]
@@ -114,6 +114,52 @@
             return IsUTF8Encoded ?
                     JsonLabReturnBytesHelper(_dataUtf8, SymbolTable.InvariantUtf8) :
                     JsonLabReturnBytesHelper(_dataUtf16, SymbolTable.InvariantUtf16, 2);
+        }
+
+        [Benchmark]
+        public void ReaderUtf8JsonEmptyLoop()
+        {
+            Utf8Json.JsonReader json = new Utf8Json.JsonReader(_dataUtf8);
+
+            while (json.GetCurrentJsonToken() != Utf8Json.JsonToken.None)
+            {
+                json.ReadNext();
+            }
+        }
+
+        [Benchmark]
+        public byte[] ReaderUtf8JsonReturnBytes()
+        {
+            Utf8Json.JsonReader json = new Utf8Json.JsonReader(_dataUtf8);
+
+            byte[] outputArray = new byte[_dataUtf8.Length * 2];
+            Span<byte> destination = outputArray;
+
+            Utf8Json.JsonToken token = json.GetCurrentJsonToken();
+            while (token != Utf8Json.JsonToken.None)
+            {
+                json.ReadNext();
+                token = json.GetCurrentJsonToken();
+
+                switch (token)
+                {
+                    case Utf8Json.JsonToken.String:
+                    case Utf8Json.JsonToken.Number:
+                    case Utf8Json.JsonToken.True:
+                    case Utf8Json.JsonToken.False:
+                    case Utf8Json.JsonToken.Null:
+                        ReadOnlySpan<byte> valueSpan = json.ReadNextBlockSegment();
+                        valueSpan.CopyTo(destination);
+                        destination[valueSpan.Length] = (byte)',';
+                        destination[valueSpan.Length + 1] = (byte)' ';
+                        destination = destination.Slice(valueSpan.Length + 2);
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+            return outputArray;
         }

         private string NewtonsoftReturnStringHelper(TextReader reader)
@@ -133,7 +179,7 @@

         private byte[] JsonLabReturnBytesHelper(byte[] data, SymbolTable symbolTable, int utf16Multiplier = 1)
         {
-            byte[] outputArray = new byte[data.Length];
+            byte[] outputArray = new byte[data.Length * 2];

             Span<byte> destination = outputArray;
             var json = new JsonReader(data, symbolTable);


微调代码。 :wedding:

微调代码。 :wedding:

--- tests/Common/Expressions/InsertStatementBuilderTest.cs
+++ tests/Common/Expressions/InsertStatementBuilderTest.cs
@@ -78,7 +78,6 @@
 					UserId = userId,
 					Name = name ?? "Popeye",
 					FullName = fullName ?? "Popeye Zhong",
-					Avatar = ":smile:",
 					Email = "zongsoft@qq.com",
 					Namespace = "Zongsoft",
 					Status = Security.Membership.UserStatus.Active,


fixed tests

fixed tests

--- tests/Autodash.Core.Tests/FakeLoggerProvider.cs
+++ tests/Autodash.Core.Tests/FakeLoggerProvider.cs
@@ -24,6 +24,14 @@
             {
             }

+            public void Warning(string message)
+            {
+            }
+
+            public void Warning(string message, params object[] args)
+            {
+            }
+
             public void Error(string message)
             {
             }


Mark access to exception if task faulted as safe

There are seemingly no C#-side compile-time guarantees that it is safe,
but if the task's state is `Faulted` (as is checked right before), the
exception cannot be null as per the documentation.

--- osu.Game/Extensions/TaskExtensions.cs
+++ osu.Game/Extensions/TaskExtensions.cs
@@ -6,6 +6,7 @@
 using System;
 using System.Threading;
 using System.Threading.Tasks;
+using osu.Framework.Extensions.ObjectExtensions;

 namespace osu.Game.Extensions
 {
@@ -50,7 +51,7 @@
                         }
                         else if (continuationTask.IsFaulted)
                         {
-                            tcs.TrySetException(continuationTask.Exception);
+                            tcs.TrySetException(continuationTask.Exception.AsNonNull());
                         }
                         else
                         {


Allow loginOverlay to be null if there's no cached instance in DI (for testing cases)

--- osu.Game/Screens/Menu/ButtonSystem.cs
+++ osu.Game/Screens/Menu/ButtonSystem.cs
@@ -103,7 +103,7 @@
         [Resolved(CanBeNull = true)]
         private NotificationOverlay notifications { get; set; }

-        [Resolved]
+        [Resolved(CanBeNull = true)]
         private LoginOverlay loginOverlay { get; set; }

         [BackgroundDependencyLoader(true)]
@@ -141,7 +141,7 @@
                     Icon = FontAwesome.Solid.Globe,
                     Activated = () =>
                     {
-                        loginOverlay.Show();
+                        loginOverlay?.Show();
                         return true;
                     }
                 });


Fix osu logo shockwave playing when transition is aborted

This is a very nice use-case scenario for TransformSequence.OnComplete

--- osu.Game/Screens/Menu/ButtonSystem.cs
+++ osu.Game/Screens/Menu/ButtonSystem.cs
@@ -250,15 +250,13 @@
                         case MenuState.TopLevel:
                             buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);

-                            osuLogo.ClearTransforms();
                             osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
-                            osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
+                            var sequence = osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
+
+                            if (fromInitial && osuLogo.Scale.X > 0.5f)
+                                sequence.OnComplete(o => o.Impact());

                             buttonArea.FadeIn(300);
-
-                            if (fromInitial && osuLogo.Scale.X > 0.5f)
-                                using (osuLogo.BeginDelayedSequence(200, true))
-                                    osuLogo.Impact();

                             Scheduler.AddDelayed(() => toolbar?.Show(), 150);


Make multiplayer screen handle user activity updates from subscreens.

--- osu.Game/Screens/Multi/Multiplayer.cs
+++ osu.Game/Screens/Multi/Multiplayer.cs
@@ -24,6 +24,7 @@
 using osu.Game.Screens.Multi.Lounge.Components;
 using osu.Game.Screens.Multi.Match;
 using osu.Game.Screens.Multi.Match.Components;
+using osu.Game.Users;
 using osuTK;

 namespace osu.Game.Screens.Multi
@@ -140,10 +141,10 @@
                 }
             };

-            screenStack.Push(loungeSubScreen = new LoungeSubScreen());
-
             screenStack.ScreenPushed += screenPushed;
             screenStack.ScreenExited += screenExited;
+
+            screenStack.Push(loungeSubScreen = new LoungeSubScreen());
         }

         private readonly IBindable<APIState> apiState = new Bindable<APIState>();
@@ -311,18 +312,18 @@

         private void screenPushed(IScreen lastScreen, IScreen newScreen)
         {
-            subScreenChanged(newScreen);
+            subScreenChanged(lastScreen, newScreen);
         }

         private void screenExited(IScreen lastScreen, IScreen newScreen)
         {
-            subScreenChanged(newScreen);
+            subScreenChanged(lastScreen, newScreen);

             if (screenStack.CurrentScreen == null && this.IsCurrentScreen())
                 this.Exit();
         }

-        private void subScreenChanged(IScreen newScreen)
+        private void subScreenChanged(IScreen lastScreen, IScreen newScreen)
         {
             switch (newScreen)
             {
@@ -336,6 +337,12 @@
                     headerBackground.MoveToX(-MultiplayerSubScreen.X_SHIFT, MultiplayerSubScreen.X_MOVE_DURATION, Easing.OutQuint);
                     break;
             }
+
+            if (lastScreen is IOsuScreen lastOsuScreen)
+                Activity.UnbindFrom(lastOsuScreen.Activity);
+
+            if (newScreen is IOsuScreen newOsuScreen)
+                ((IBindable<UserActivity>)Activity).BindTo(newOsuScreen.Activity);

             updatePollingRate(isIdle.Value);
             createButton.FadeTo(newScreen is LoungeSubScreen ? 1 : 0, 200);


Use block body for constructor to fix remaining code inspection issue

--- osu.Game/Screens/Play/PlayerLoader.cs
+++ osu.Game/Screens/Play/PlayerLoader.cs
@@ -499,7 +499,10 @@

         private class MutedNotification : SimpleNotification
         {
-            public MutedNotification() => Text = "Your music volume is set to 0%! Click here to restore it.";
+            public MutedNotification()
+            {
+                Text = "Your music volume is set to 0%! Click here to restore it.";
+            }

             public override bool IsImportant => true;


Add back schedule for safety

Add back schedule for safety

--- osu.Game/Screens/Play/SongProgress.cs
+++ osu.Game/Screens/Play/SongProgress.cs
@@ -175,10 +175,15 @@
                         if (skinManager.EnsureMutableSkin())
                             return;

-                        var skin = skinManager.CurrentSkin.Value;
-                        skin.UpdateDrawableTarget(skinnableTarget);
-
-                        skinManager.Save(skin);
+                        // If `EnsureMutableSkin` actually changed the skin, default layout may take a frame to apply.
+                        // See `SkinnableTargetComponentsContainer`'s use of ScheduleAfterChildren.
+                        ScheduleAfterChildren(() =>
+                        {
+                            var skin = skinManager.CurrentSkin.Value;
+                            skin.UpdateDrawableTarget(skinnableTarget);
+
+                            skinManager.Save(skin);
+                        });

                         configShowGraph.SetDefault();
                     }


more oversized characters

more oversized characters

--- CompatBot/EventHandlers/UsernameZalgoMonitor.cs
+++ CompatBot/EventHandlers/UsernameZalgoMonitor.cs
@@ -12,7 +12,7 @@
     {
         private static readonly HashSet<char> OversizedChars = new HashSet<char>
         {
-            '꧁', '꧂', '⎝', '⎠', '⧹', '⧸',
+            '꧁', '꧂', '⎝', '⎠', '⧹', '⧸', '⎛', '⎞',
         };

         public static async Task OnUserUpdated(UserUpdateEventArgs args)


Show the prototype id when failing dummy icon test (#3340)

* Show the prototype id when failing dummy icon test

* Remove redundant import

--- Content.IntegrationTests/Tests/DummyIconTest.cs
+++ Content.IntegrationTests/Tests/DummyIconTest.cs
@@ -26,7 +26,11 @@
                 {
                     if (!proto.Components.ContainsKey("Sprite")) continue;

-                    var _ = SpriteComponent.GetPrototypeTextures(proto, resourceCache).ToList();
+                    Assert.DoesNotThrow(() =>
+                    {
+                        var _ = SpriteComponent.GetPrototypeTextures(proto, resourceCache).ToList();
+                    }, "Prototype {0} threw an exception when getting its textures.",
+                        proto.ID);
                 }
             });
         }