updated template to include helper functions, but they need to be generated too

--- plugins/ubiq/ubiqGenerator/templates/DeviceDispatcher.cs
+++ plugins/ubiq/ubiqGenerator/templates/DeviceDispatcher.cs
@@ -29,5 +29,122 @@

 @@EventHandlers@@

+        internal short Register(int devID, int peerSocket)
+        {
+            int newID = devID;
+            bool newFlag = false;
+            if (newID == 0)
+            {
+                newFlag = true;
+                newID = (short)random.Next(1000, 10000);
+            }
+            bool chck = false;
+            while (!chck)
+            {
+                chck = true;
+                foreach (DevRecord devRecord in devTab)
+                {
+                    if (devRecord.ID == newID)
+                    {
+                        if (newFlag)
+                        {
+                            newID = (short)random.Next(1000, 10000);
+                            chck = false;
+                            break;
+                        }
+                        else
+                            return newID;
+                    }
+                }
+            }
+            if (!newFlag)
+                AddDevice(newID, peerSocket);
+            return newID;
+        }
+
+        internal bool SendCommandToDevice(int devID, int messageCode)
+        {
+        }
+
+        internal bool SendDataToDevice (int devID, [] byte data)
+        {
+        }
+
+        private void NotifyUsers(short devID, byte messageCode)
+        {
+            List<MailBox> userList = GetUserList(devID);
+            if (userList != null)
+            {
+                Message msg = new Message(devID, messageCode);
+                foreach (MailBox userBox in userList)
+                    _sendMessage(msg, userBox);
+            }
+        }
+
+        internal void NotifyUsers (short devID, byte[] data)
+        {
+            List<MailBox> userList = GetUserList(devID);
+            if (userList != null)
+            {
+                Message msg = new Message(devID, data);
+                foreach (MailBox userBox in userList)
+                {
+                    _sendMessage(msg, userBox);
+                }
+            }
+        }
+
+        internal void NotifyUsersErr(short devID, int errCode)
+        {
+            List<MailBox> userList = GetUserList(devID);
+            if (userList != null)
+            {
+                Message msg = Message.ErrorMessage(devID, (byte)errCode);
+                foreach (MailBox mailBox in userList)
+                    _sendMessage(msg, mailBox);
+            }
+
+        }
+
+       internal void RemoveDevice (int devID)
+       {
+           foreach (DevRecord devRecord in devTab)
+               if (devRecord.ID == devID) devTab.Remove(devRecord);
+       }
+
+       internal void AddUser (int devID, MailBox userBox)
+       {
+            foreach (DevRecord devRecord in devTab)
+            {
+                if (devRecord.ID == devID && !devRecord.UserList.Contains(userBox))
+                    devRecord.UserList.Add(userBox);
+            }
+        }
+
+        internal void RemoveUser (int devID, MailBox user)
+        {
+            foreach (DevRecord devRecord in devTab)
+            {
+                if (devRecord.ID == devID && devRecord.UserList.Contains(userBox))
+                    devRecord.UserList.Remove(userBox);
+            }
+        }
+
+
+       internal bool DeviceExists (int devID)
+       {
+           foreach (DevRecord devRecord in devTab)
+               if (devRecord.ID == devID) return true;
+           return false;
+       }
+
+       internal int SearchSocket (int devID)
+       {
+           foreach (DevRecord devRecord in devTab)
+           {
+               if (devRecord.ID == devID && devRecord.Socket != 0) return devRecord.Socket;
+           }
+           return 0;
+       }
     }
-}+}


Rename tests

Rename tests

To match new except comment keyword.

--- ObjectInitializer_AssignAll/ObjectInitializer_AssignAll.Test/UnitTests.cs
+++ ObjectInitializer_AssignAll/ObjectInitializer_AssignAll.Test/UnitTests.cs
@@ -197,7 +197,7 @@
         }

         [TestMethod]
-        public void IgnorePropertiesComment_BeforeLocalDeclaration_ExcludesPropertiesFromDiagnostic()
+        public void ExceptComment_BeforeLocalDeclaration_ExcludesPropertiesFromDiagnostic()
         {
             var testContent = @"
 namespace SampleConsoleApp
@@ -237,7 +237,7 @@
         }

         [TestMethod]
-        public void IgnorePropertiesComment_OnlyAffectsTheImmediatelyTrailingObjectInitializer()
+        public void ExceptComment_OnlyAffectsTheImmediatelyTrailingObjectInitializer()
         {
             var testContent = @"
 // ObjectInitializer_AssignAll enable
@@ -293,7 +293,7 @@
         }

         [TestMethod]
-        public void IgnorePropertiesComment_BeforeObjectCreation_ExcludesPropertiesFromDiagnostic()
+        public void ExceptComment_BeforeObjectCreation_ExcludesPropertiesFromDiagnostic()
         {
             var testContent = @"
 namespace SampleConsoleApp
@@ -333,7 +333,7 @@
         }

         [TestMethod]
-        public void IgnorePropertiesComment_BeforeReturn_ExcludesPropertiesFromDiagnostic()
+        public void ExceptComment_BeforeReturn_ExcludesPropertiesFromDiagnostic()
         {
             var testContent = @"
 namespace SampleConsoleApp
@@ -373,7 +373,7 @@
         }

         [TestMethod]
-        public void IgnorePropertiesComment_BeforeLambdaReturn_ExcludesPropertiesFromDiagnostic()
+        public void ExceptComment_BeforeLambdaReturn_ExcludesPropertiesFromDiagnostic()
         {
             var testContent = @"
 namespace SampleConsoleApp


Make the implementation of the message transfer module protected virtual throughout

--- OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -44,11 +44,11 @@
         private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

         // private bool m_Enabled = false;
-        private bool m_Gridmode = false;
-        private List<Scene> m_Scenes = new List<Scene>();
-        private Dictionary<UUID, ulong> m_UserRegionMap = new Dictionary<UUID, ulong>();
-
-        public void Initialise(Scene scene, IConfigSource config)
+        protected bool m_Gridmode = false;
+        protected List<Scene> m_Scenes = new List<Scene>();
+        protected Dictionary<UUID, ulong> m_UserRegionMap = new Dictionary<UUID, ulong>();
+
+        public virtual void Initialise(Scene scene, IConfigSource config)
         {
             IConfig cnf = config.Configs["Messaging"];
             if (cnf != null && cnf.GetString(
@@ -75,25 +75,25 @@
             }
         }

-        public void PostInitialise()
-        {
-        }
-
-        public void Close()
-        {
-        }
-
-        public string Name
+        public virtual void PostInitialise()
+        {
+        }
+
+        public virtual void Close()
+        {
+        }
+
+        public virtual string Name
         {
             get { return "MessageTransferModule"; }
         }

-        public bool IsSharedModule
+        public virtual bool IsSharedModule
         {
             get { return true; }
         }

-        public void SendInstantMessage(GridInstantMessage im, MessageResultNotification result)
+        public virtual void SendInstantMessage(GridInstantMessage im, MessageResultNotification result)
         {
             UUID toAgentID = new UUID(im.toAgentID);

@@ -402,7 +402,7 @@
         /// </summary>
         public delegate void GridInstantMessageDelegate(GridInstantMessage im, MessageResultNotification result, ulong prevRegionHandle);

-        private void GridInstantMessageCompleted(IAsyncResult iar)
+        protected virtual void GridInstantMessageCompleted(IAsyncResult iar)
         {
             GridInstantMessageDelegate icon =
                     (GridInstantMessageDelegate)iar.AsyncState;
@@ -551,7 +551,7 @@
         /// <param name="reginfo">RegionInfo we pull the data out of to send the request to</param>
         /// <param name="xmlrpcdata">The Instant Message data Hashtable</param>
         /// <returns>Bool if the message was successfully delivered at the other side.</returns>
-        private bool doIMSending(RegionInfo reginfo, Hashtable xmlrpcdata)
+        protected virtual bool doIMSending(RegionInfo reginfo, Hashtable xmlrpcdata)
         {

             ArrayList SendParams = new ArrayList();
@@ -595,7 +595,7 @@
         /// </summary>
         /// <param name="regionID">UUID of region to get the region handle for</param>
         /// <returns></returns>
-//        private ulong getLocalRegionHandleFromUUID(UUID regionID)
+//        private virtual ulong getLocalRegionHandleFromUUID(UUID regionID)
 //        {
 //            ulong returnhandle = 0;
 //
@@ -618,7 +618,7 @@
         /// </summary>
         /// <param name="msg">The GridInstantMessage object</param>
         /// <returns>Hashtable containing the XMLRPC request</returns>
-        private Hashtable ConvertGridInstantMessageToXMLRPC(GridInstantMessage msg)
+        protected virtual Hashtable ConvertGridInstantMessageToXMLRPC(GridInstantMessage msg)
         {
             Hashtable gim = new Hashtable();
             gim["from_agent_id"] = msg.fromAgentID.ToString();


Adjusted tests for civil status

Adjusted tests for civil status

--- PART/Source/CprBroker/CPRDirect.Tests/Objects/CurrentCivilStatus.Tests.cs
+++ PART/Source/CprBroker/CPRDirect.Tests/Objects/CurrentCivilStatus.Tests.cs
@@ -112,7 +112,7 @@
                 )
             {
                 var civil = new CurrentCivilStatusType() { CivilStatusCode = civilStatus, CivilStatusStartDate = DateTime.Today, SpousePNR = Utilities.RandomCprNumberString() };
-                var ret = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), civilStatus, Utilities.RandomSingleChar(Utilities.AlphabetChars, civilStatus), Utilities.RandomSingleChar(Utilities.AlphabetChars, civilStatus), false);
+                var ret = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), civilStatus, Utilities.RandomSingleChar(Utilities.AlphabetChars, civilStatus), Utilities.RandomSingleChar(Utilities.AlphabetChars, civilStatus), 'D', false);
                 Assert.AreEqual(DateTime.Today, ret[0].Virkning.FraTidspunkt.ToDateTime());
             }

@@ -123,7 +123,7 @@
                 )
             {
                 var civil = new CurrentCivilStatusType() { CivilStatusCode = civilStatus, CivilStatusStartDate = DateTime.Today, SpousePNR = Utilities.RandomCprNumberString() };
-                var ret = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), civilStatus, Utilities.RandomSingleChar(Utilities.AlphabetChars, civilStatus), Utilities.RandomSingleChar(Utilities.AlphabetChars, civilStatus), sameGenderForDead);
+                var ret = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), civilStatus, Utilities.RandomSingleChar(Utilities.AlphabetChars, civilStatus), Utilities.RandomSingleChar(Utilities.AlphabetChars, civilStatus),'D', sameGenderForDead);
                 Assert.Null(ret[0].Virkning.TilTidspunkt.ToDateTime());
             }

@@ -133,7 +133,7 @@
                 )
             {
                 var civil = new CurrentCivilStatusType() { CivilStatusCode = endedCivilStatus, CivilStatusStartDate = DateTime.Today, SpousePNR = Utilities.RandomCprNumberString() };
-                var ret = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), Utilities.RandomSingleChar(Utilities.AlphabetChars, endedCivilStatus), endedCivilStatus, Utilities.RandomSingleChar(Utilities.AlphabetChars, endedCivilStatus), false);
+                var ret = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), Utilities.RandomSingleChar(Utilities.AlphabetChars, endedCivilStatus), endedCivilStatus, Utilities.RandomSingleChar(Utilities.AlphabetChars, endedCivilStatus),endedCivilStatus, false);
                 Assert.AreEqual(DateTime.Today, ret[0].Virkning.TilTidspunkt.ToDateTime());
             }

@@ -144,7 +144,7 @@
                 )
             {
                 var civil = new CurrentCivilStatusType() { CivilStatusCode = endedCivilStatus, CivilStatusStartDate = DateTime.Today, SpousePNR = Utilities.RandomCprNumberString() };
-                var ret = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), Utilities.RandomSingleChar(Utilities.AlphabetChars, endedCivilStatus), endedCivilStatus, Utilities.RandomSingleChar(Utilities.AlphabetChars, endedCivilStatus),sameGenderForDead);
+                var ret = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), Utilities.RandomSingleChar(Utilities.AlphabetChars, endedCivilStatus), endedCivilStatus, Utilities.RandomSingleChar(Utilities.AlphabetChars, endedCivilStatus), endedCivilStatus, sameGenderForDead);
                 Assert.Null(ret[0].Virkning.FraTidspunkt.ToDateTime());
             }

@@ -154,7 +154,7 @@
                 )
             {
                 var civil = new CurrentCivilStatusType() { CivilStatusCode = deadCivilStatus, CivilStatusStartDate = DateTime.Today };
-                var ret = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus), Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus), deadCivilStatus, false);
+                var ret = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus), Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus), Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus), deadCivilStatus, false);
                 Assert.IsEmpty(ret);
             }

@@ -164,16 +164,22 @@
                 )
             {
                 var result = IndividualResponseType.ParseBatch(Properties.Resources.U12170_P_opgavenr_110901_ADRNVN_FE);
-                var f = result.Where(r => r.CurrentCivilStatus.CivilStatusCode == 'D' || r.HistoricalCivilStatus.Where(c => c.CivilStatusCode == 'D').Count() > 0).ToArray(); ;
+                var f = result.Where(r => r.CurrentCivilStatus.CivilStatusCode == 'D' || r.HistoricalCivilStatus.Where(c => c.CivilStatusCode == 'D').Count() > 0).ToArray();
                 var civil = new CurrentCivilStatusType() { CivilStatusCode = deadCivilStatus, CivilStatusStartDate = DateTime.Today, PNR = Utilities.RandomCprNumberString(), SpousePNR = Utilities.RandomCprNumberString() };
                 var ret1 = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(),
                     Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus),
                     Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus),
                     Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus),
+                    deadCivilStatus,
                     false
                     );
-                var ret2 = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(), Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus), Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus), Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus), false);
-                Assert.AreEqual(0, ret1.Length + ret2.Length);
+                var ret2 = CivilStatusWrapper.ToPersonRelationTypeArray(civil, null, pnr => Guid.NewGuid(),
+                    Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus),
+                    Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus),
+                    Utilities.RandomSingleChar(Utilities.AlphabetChars, deadCivilStatus),
+                    deadCivilStatus,
+                    true);
+                Assert.AreEqual(1, ret1.Length + ret2.Length);
             }

         }


Add ListPages/RandomPages to PageBlob in ni

--- src/CDrive/DriveInfo/AzureBlobServiceDriveInfo.cs
+++ src/CDrive/DriveInfo/AzureBlobServiceDriveInfo.cs
@@ -59,6 +59,30 @@
                     }
                 }
             }
+            else if (string.Equals(type, "RandomPages", StringComparison.InvariantCultureIgnoreCase))
+            {
+                //fill page blob with random data, each page data is 512Byte, and count is required
+                //e.g. ni PageBlob -type RandomPages -value <count>
+                if (newItemValue != null)
+                {
+                    var size = 0L;
+                    if (long.TryParse(newItemValue.ToString(), out size))
+                    {
+                        this.FillDataInPageBlob(path, size);
+                    }
+                    else
+                    {
+                        this.RootProvider.WriteWarning("Value is required.");
+                    }
+                }
+
+            }
+            else if (string.Equals(type, "ListPages", StringComparison.InvariantCultureIgnoreCase))
+            {
+                //List page ranges in page blob
+                //e.g. ni pageBlob -type ListPages
+                this.ListPageRanges(path);
+            }
             else if (string.Equals(type, "ContainerSAStoken", StringComparison.InvariantCultureIgnoreCase))
             {
                 var parts = PathResolver.SplitPath(path);
@@ -245,6 +269,69 @@
             else if (string.Equals(type, "Etag", StringComparison.InvariantCultureIgnoreCase))
             {
                 this.ShowEtag(path);
+            }
+        }
+
+        private void ListPageRanges(string path)
+        {
+            var parts = PathResolver.SplitPath(path);
+            if (parts.Count > 1)
+            {
+                var blob = this.Client.GetContainerReference(parts[0]).GetPageBlobReference(PathResolver.GetSubpath(path));
+                if (!blob.Exists())
+                {
+                    this.RootProvider.WriteWarning("PageBlob " + path + " does not exist.");
+                    return;
+                }
+
+                var count = 0L;
+                foreach(var r in blob.GetPageRanges())
+                {
+                    this.RootProvider.WriteWarning(string.Format("[{3}]\t[{0} - {1}] {2}", r.StartOffset, r.EndOffset, r.EndOffset - r.StartOffset + 1, count++));
+                }
+
+            }
+            else
+            {
+                this.RootProvider.WriteWarning("Please specify the page blob path.");
+            }
+        }
+
+        private void FillDataInPageBlob(string path, long count)
+        {
+            var parts = PathResolver.SplitPath(path);
+            if (parts.Count > 1)
+            {
+                var blob = this.Client.GetContainerReference(parts[0]).GetPageBlobReference(PathResolver.GetSubpath(path));
+                if (!blob.Exists())
+                {
+                    this.RootProvider.WriteWarning("PageBlob " + path + " does not exist.");
+                    return;
+                }
+
+                blob.FetchAttributes();
+                var total = blob.Properties.Length / 512;
+                var data = new byte[512];
+                var random = new Random();
+                random.NextBytes(data);
+
+                this.RootProvider.WriteWarning("Start writing pages...");
+                var tasks = new Task[count];
+
+                for (var i = 0; i < count; ++i) {
+                    var p = (long)(random.NextDouble() * total);
+
+                    var task = blob.WritePagesAsync(new MemoryStream(data), p * 512, null);
+                    tasks[i] = task;
+                }
+
+                this.RootProvider.WriteWarning("Waiting writing pages...");
+                Task.WaitAll(tasks);
+                this.RootProvider.WriteWarning("Completed writing pages...");
+            }
+            else
+            {
+                this.RootProvider.WriteWarning("Please specify the page blob path.");
             }
         }


(GH-2975) Prevents the addition of ANSI color if NO_COLOR env. variable is present https://no-color.org

--- src/Cake.Core/Diagnostics/Console/AnsiDetector.cs
+++ src/Cake.Core/Diagnostics/Console/AnsiDetector.cs
@@ -42,6 +42,13 @@

         public static bool SupportsAnsi(ICakeEnvironment environment)
         {
+            // Prevents the addition of ANSI color if NO_COLOR env. variable is present
+            // https://no-color.org
+            if (!string.IsNullOrWhiteSpace(environment.GetEnvironmentVariable("NO_COLOR")))
+            {
+                return false;
+            }
+
             // Github action doesn't setup a correct PTY but supports ANSI.
             if (!string.IsNullOrWhiteSpace(environment.GetEnvironmentVariable("GITHUB_ACTION")))
             {


New release v0.5.3

New release v0.5.3

--- src/CollectdWinService/Properties/AssemblyInfo.cs
+++ src/CollectdWinService/Properties/AssemblyInfo.cs
@@ -35,5 +35,5 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]

-[assembly: AssemblyVersion("0.5.2.0")]
-[assembly: AssemblyFileVersion("0.5.2.0")]+[assembly: AssemblyVersion("0.5.3.0")]
+[assembly: AssemblyFileVersion("0.5.3.0")]


Reduce steps for string.Contains(string value) (dotnet/coreclr#22008)

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

--- src/Common/src/CoreLib/System/String.Searching.cs
+++ src/Common/src/CoreLib/System/String.Searching.cs
@@ -3,8 +3,6 @@
 // See the LICENSE file in the project root for more information.

 using System.Globalization;
-using System.Numerics;
-using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using Internal.Runtime.CompilerServices;

@@ -14,7 +12,14 @@
     {
         public bool Contains(string value)
         {
-            return (IndexOf(value, StringComparison.Ordinal) >= 0);
+            if (value == null)
+                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
+
+            return SpanHelpers.IndexOf(
+                ref _firstChar,
+                Length,
+                ref value._firstChar,
+                value.Length) >= 0;
         }

         public bool Contains(string value, StringComparison comparisonType)


GetRequestInfo on ban

GetRequestInfo on ban

--- src/Core/Utilities/CustomIpRateLimitMiddleware.cs
+++ src/Core/Utilities/CustomIpRateLimitMiddleware.cs
@@ -60,7 +60,7 @@
             if(blockedCount > 10)
             {
                 _blockIpService.BlockIpAsync(identity.ClientIp, false);
-                _logger.LogInformation($"Blocked {identity.ClientIp} with token {GetToken(httpContext.Request)}");
+                _logger.LogInformation($"Blocked {identity.ClientIp}. Request Info: {GetRequestInfo(httpContext)}");
             }
             else
             {
@@ -69,30 +69,25 @@
             }
         }

-        private string GetToken(HttpRequest request)
+        private string GetRequestInfo(HttpContext httpContext)
         {
-            if(request == null)
+            if(httpContext == null || httpContext.Request == null)
             {
                 return null;
             }

-            var authorization = request.Headers["Authorization"].FirstOrDefault();
-            if(string.IsNullOrWhiteSpace(authorization))
+            var s = string.Empty;
+            foreach(var header in httpContext.Request.Headers)
             {
-                // Bearer token could exist in the 'Content-Language' header on clients that want to avoid pre-flights.
-                var languageAuth = request.Headers["Content-Language"].FirstOrDefault();
-                if(string.IsNullOrWhiteSpace(languageAuth) ||
-                    !languageAuth.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase))
-                {
-                    return request.Query["access_token"].FirstOrDefault();
-                }
-                else
-                {
-                    authorization = languageAuth.Split(',')[0];
-                }
+                s += $"H_{header.Key}: {header.Value} | ";
             }

-            return authorization;
+            foreach(var query in httpContext.Request.Query)
+            {
+                s += $"Q_{query.Key}: {query.Value} | ";
+            }
+
+            return s;
         }
     }
 }


Repeater test - timing fixed

Repeater test - timing fixed

--- src/DotVVM.Samples.Tests/Control/RepeaterTests.cs
+++ src/DotVVM.Samples.Tests/Control/RepeaterTests.cs
@@ -282,7 +282,13 @@
                     .Concat(serverRenderedItems.Select((element, index) => (element, index)));

                 var counter = 0;
-                void CheckCounter() => AssertUI.InnerTextEquals(counterElement, counter.ToString());
+                void CheckCounter()
+                {
+                    browser.WaitFor(() => {
+                        AssertUI.InnerTextEquals(counterElement, counter.ToString());
+                    }, 5000);
+                }
+
                 foreach (var item in allItems)
                 {
                     CheckCounter();


turning off debug logging by default

turning off debug logging by default

--- src/EasyRpc.AspNetCore/RpcServiceConfiguration.cs
+++ src/EasyRpc.AspNetCore/RpcServiceConfiguration.cs
@@ -4,6 +4,6 @@
     {
         public bool ShowErrorMessage { get; set; } = true;

-        public bool DebugLogging { get; set; } = true;
+        public bool DebugLogging { get; set; } = false;
     }
 }


Rename test for accuracy.

Rename test for accuracy.

--- src/Fixie.Tests/Internal/MethodDiscovererTests.cs
+++ src/Fixie.Tests/Internal/MethodDiscovererTests.cs
@@ -68,7 +68,7 @@
                     "PublicStaticWithArgsWithReturn(x)");
         }

-        public void ShouldNotConsiderIDisposableDisposeMethod()
+        public void ShouldNotConsiderIDisposableOrIAsyncDisposableMethods()
         {
             var discovery = new MaximumDiscovery();


App: Register the keyboard after carcosa started

--- projects/RagingBool.Carcosa.App_cs/MainWindow.xaml.cs
+++ projects/RagingBool.Carcosa.App_cs/MainWindow.xaml.cs
@@ -48,7 +48,6 @@
             InitKeyboardControlBoard();

             _carcosa.RegisterControlBoard(_keyboardControlBoard);
-            _carcosa.RegisterWindowsKeyboard(_keyboardManager);

             //RegisterMidiLpd8();

@@ -93,6 +92,8 @@
             _infoLabel.Content = String.Format("WORKSPACE: {0}", workspaceName);

             _carcosa.Start();
+
+            _carcosa.RegisterWindowsKeyboard(_keyboardManager);
         }

         private void Window_Closing(object sender, CancelEventArgs e)


Complex: +TODO

Complex: +TODO

--- projects/Epicycle.Commons_cs/_System/Numerics/Complex.cs
+++ projects/Epicycle.Commons_cs/_System/Numerics/Complex.cs
@@ -18,10 +18,11 @@

 #if NET35

+// TODO: Test ToString with formattings
+
 namespace System.Numerics
 {
     // compatible with .NET 4.5 (excluding BigInteger casting)
-
     public struct Complex : IEquatable<Complex>, IFormattable
     {
         private static readonly string FormatString = "({0}, {1})";


[3.0] Skip known failure in ShutdownTestWaitForShutdown (#14744)

- update src/Hosting/test/FunctionalTests/ShutdownTests.cs

Co-Authored-By: Andrew Stanton-Nurse <02e0a999c50b1f88df7a8f5a04e1b76b35ea6a88@stanton-nurse.com>

--- src/Hosting/test/FunctionalTests/ShutdownTests.cs
+++ src/Hosting/test/FunctionalTests/ShutdownTests.cs
@@ -33,7 +33,7 @@
             await ExecuteShutdownTest(nameof(ShutdownTestRun), "Run");
         }

-        [ConditionalFact]
+        [ConditionalFact(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/2577")]
         [Flaky("https://github.com/aspnet/Hosting/issues/1214", FlakyOn.All)]
         [OSSkipCondition(OperatingSystems.Windows)]
         [OSSkipCondition(OperatingSystems.MacOSX)]


Bud's build configuration now uses the 'new Project' syntax, instead of '.Project'.

--- .bud/Build.cs
+++ .bud/Build.cs
@@ -1,41 +1,45 @@
-using System.Collections.Generic;
+using System.IO;
 using Bud;
 using Bud.CSharp;
 using Bud.Projects;
 using Bud.Resources;
-using System.IO;

 public class Build : IBuild {
   public Settings Setup(Settings settings, string baseDir) {
-    return settings
-      .AddGlobally(CSharpKeys.TargetFramework.Init(Framework.Net46))
-      .Version("0.1.2")
-      .Project("bud", Path.Combine(baseDir, "bud"), Cs.Exe(
-        CSharpKeys.RootNamespace.Modify("Bud"),
-        Cs.Dependency("Bud.Core"),
-        Cs.Dependency("CommandLineParser")
-      ))
-      .Project("Bud.Core", Path.Combine(baseDir, "Core"), Res.Main(), Cs.Dll(
-        CSharpKeys.RootNamespace.Modify("Bud"),
-        Cs.Dependency("Microsoft.Bcl.Immutable"),
-        Cs.Dependency("Newtonsoft.Json"),
-        Cs.Dependency("NuGet.Core"),
-        Cs.Dependency("Antlr4.StringTemplate"),
-        Cs.Dependency("Bud.NUnit.ConsoleRunner")
-      ), Cs.Test(
-        CSharpKeys.RootNamespace.Modify("Bud"),
-        Cs.Dependency("NUnit")
-      ))
-      .Project("Bud.Test", Path.Combine(baseDir, "Test"), Cs.Dll(
-        Cs.Dependency("Bud.Core"),
-        Cs.Dependency("NUnit")
-      ))
-      .Project("Bud.SystemTests", Path.Combine(baseDir, "SystemTests"), Cs.Test(
-        Cs.Dependency("Bud.Test"),
-        NUnitPlugin.NUnitArgs.Modify(list => list.Add("/noshadow"))
-      ))
-      .Project("Bud.Examples.Snippets", Path.Combine(baseDir, "Bud.Examples.Snippets"), Cs.Dll(
-        Cs.Dependency("Bud.Core")
-      ));
+    var budCore = new Project("Bud.Core",
+                              Path.Combine(baseDir, "Core"),
+                              Res.Main(),
+                              Cs.Dll(CSharpKeys.RootNamespace.Modify("Bud"),
+                                     Cs.Dependency("Microsoft.Bcl.Immutable"),
+                                     Cs.Dependency("Newtonsoft.Json"),
+                                     Cs.Dependency("NuGet.Core"),
+                                     Cs.Dependency("Antlr4.StringTemplate"),
+                                     Cs.Dependency("Bud.NUnit.ConsoleRunner")),
+                              Cs.Test(CSharpKeys.RootNamespace.Modify("Bud"),
+                                      Cs.Dependency("NUnit")));
+
+    var bud = new Project("bud",
+                          Path.Combine(baseDir, "bud"),
+                          Cs.Exe(CSharpKeys.RootNamespace.Modify("Bud"),
+                                 Cs.Dependency("Bud.Core"),
+                                 Cs.Dependency("CommandLineParser")));
+
+    var budTest = new Project("Bud.Test",
+                              Path.Combine(baseDir, "Test"),
+                              Cs.Dll(Cs.Dependency("Bud.Core"),
+                                     Cs.Dependency("NUnit")));
+
+    var budSystemTests = new Project("Bud.SystemTests",
+                                     Path.Combine(baseDir, "SystemTests"),
+                                     Cs.Test(Cs.Dependency("Bud.Test"),
+                                             NUnitPlugin.NUnitArgs.Modify(list => list.Add("/noshadow"))));
+
+    var budExamplesSnippets = new Project("Bud.Examples.Snippets",
+                                          Path.Combine(baseDir, "Bud.Examples.Snippets"),
+                                          Cs.Dll(Cs.Dependency("Bud.Core")));
+
+    return settings.AddGlobally(CSharpKeys.TargetFramework.Init(Framework.Net46))
+                   .Version("0.1.2")
+                   .Add(bud, budCore, budTest, budSystemTests, budExamplesSnippets);
   }
 }


Prepend "Pictures/" to internal picture paths for LfPictureToFdoPicture (part 2)

-Also added check to handle null captions

TODO: update FDO picture factory to allow a specified GUID.  Currently, pictures originating
in LF will be duplicated when round-tripping.

--- src/LfMerge/Actions/UpdateFdoFromMongoDbAction.cs
+++ src/LfMerge/Actions/UpdateFdoFromMongoDbAction.cs
@@ -3,6 +3,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Text.RegularExpressions;
 using LfMerge.DataConverters;
 using LfMerge.FieldWorks;
 using LfMerge.Logging;
@@ -511,13 +512,32 @@
 			_customFieldConverter.SetCustomFieldsForThisCmObject(fdoExample, "examples", lfExample.CustomFields, lfExample.CustomFieldGuids);
 		}

+		/// <summary>
+		/// Converts LF picture into FDO picture.  Internal FDO pictures will need to have the
+		/// directory path "Pictures/" prepended to the filename.  Externally linked picture names won't be modifed.
+		/// </summary>
+		/// <param name="lfPicture">Lf picture.</param>
+		/// <param name="owner">Owning sense.</param>
 		private void LfPictureToFdoPicture(LfPicture lfPicture, ILexSense owner)
 		{
 			Guid guid = lfPicture.Guid ?? Guid.Empty;
-			KeyValuePair<int, string> kv = lfPicture.Caption.WsIdAndFirstNonEmptyString(_cache);
-			int captionWs = kv.Key;
-			string caption = kv.Value;
-			/* ICmPicture fdoPicture = */ GetOrCreatePictureByGuid(guid, owner, lfPicture.FileName, caption, captionWs);
+			int captionWs = _cache.DefaultAnalWs;
+			string caption = "";
+			if (lfPicture.Caption != null)
+			{
+				KeyValuePair<int, string> kv = lfPicture.Caption.WsIdAndFirstNonEmptyString(_cache);
+				captionWs = kv.Key;
+				caption = kv.Value;
+			}
+
+			// FDO expects internal pictures in a certain path.  If an external path already
+			// exists, leave it alone.
+			string pictureName = lfPicture.FileName;
+			Regex regex = new Regex(@"[/\\]");
+			const string fdoPicturePath = "Pictures/";
+			string picturePath = regex.Match(pictureName).Success ? pictureName : string.Format("{0}{1}", fdoPicturePath, pictureName);
+
+			/* ICmPicture fdoPicture = */ GetOrCreatePictureByGuid(guid, owner, picturePath, caption, captionWs);
 			// Ignoring fdoPicture.Description and other fdoPicture fields since LF won't touch them
 		}

@@ -692,15 +712,15 @@
 			if (!_pictureRepo.TryGetObject(guid, out result))
 			{
 				if (caption == null)
+				{
 					caption = "";
+					captionWs = _cache.DefaultAnalWs;
+				}
 				ITsString captionTss = TsStringUtils.MakeTss(caption, captionWs);
-				// FDO expects pictures in a certain path
-				const string fdoPicturePath = "Pictures/";
-				string picturePath = pictureName.StartsWith(fdoPicturePath) ? pictureName : string.Format("{0}{1}", fdoPicturePath, pictureName);
 				// NOTE: The CmPictureFactory class doesn't allow us to specify the GUID of the
 				// created Picture object. So we can't rely on GUIDs for round-tripping pictures.
 				// TODO: Look into what we *can* rely on for round-tripping pictures.
-				result = _pictureFactory.Create(picturePath, captionTss, CmFolderTags.LocalPictures);
+				result = _pictureFactory.Create(pictureName, captionTss, CmFolderTags.LocalPictures);
 				owner.PicturesOS.Add(result);
 			}
 			return result;


[GtkUtilities] bind gtk_show_uri (bgo#587320)

This replaces Gnome.Url.Show. Hooray.

--- src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs
+++ src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs
@@ -4,7 +4,7 @@
 // Author:
 //   Aaron Bockover <abockover@novell.com>
 //
-// Copyright (C) 2007 Novell, Inc.
+// Copyright 2007-2010 Novell, Inc.
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -164,5 +164,34 @@
                 }
             }
         }
+
+        public static bool ShowUri (string uri)
+        {
+            return ShowUri (null, uri);
+        }
+
+        public static bool ShowUri (Gdk.Screen screen, string uri)
+        {
+            return ShowUri (screen, uri, Gtk.Global.CurrentEventTime);
+        }
+
+        [System.Runtime.InteropServices.DllImport ("libgtk-win32-2.0-0.dll")]
+        private static extern unsafe bool gtk_show_uri (IntPtr screen, IntPtr uri, uint timestamp, out IntPtr error);
+
+        public static bool ShowUri (Gdk.Screen screen, string uri, uint timestamp)
+        {
+            var native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
+            var native_error = IntPtr.Zero;
+
+            try {
+                return gtk_show_uri (screen == null ? IntPtr.Zero : screen.Handle,
+                    native_uri, timestamp, out native_error);
+            } finally {
+                GLib.Marshaller.Free (native_uri);
+                if (native_error != IntPtr.Zero) {
+                    throw new GLib.GException (native_error);
+                }
+            }
+		}
     }
 }


BREAKING: Lucene.Net.Support.Threading: Marked ReentrantLock internal

--- src/Lucene.Net/Support/Threading/ReentrantLock.cs
+++ src/Lucene.Net/Support/Threading/ReentrantLock.cs
@@ -3,23 +3,23 @@
 namespace Lucene.Net.Support.Threading
 {
     /*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */

-    public class ReentrantLock
+    internal class ReentrantLock
     {
         // .NET Port: lock object used to emulate ReentrantLock
         private readonly object _lock = new object();


Read to null buffer

Read to null buffer

Read to null buffer rather than Stream.Null as the CopyToAsync will
create a `new byte[]` on each call
https://github.com/dotnet/coreclr/blob/bc146608854d1db9cdbcc0b08029a87754e12b49/src/mscorlib/src/System/IO/Stream.cs#L218
of size 81920 bytes!
https://github.com/dotnet/coreclr/blob/bc146608854d1db9cdbcc0b08029a87754e12b49/src/mscorlib/src/System/IO/Stream.cs#L48

--- src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs
+++ src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs
@@ -29,6 +29,7 @@
         private readonly object _onStartingSync = new Object();
         private readonly object _onCompletedSync = new Object();
         private readonly FrameRequestHeaders _requestHeaders = new FrameRequestHeaders();
+        private readonly byte[] _nullBuffer = new byte[4096];
         private readonly FrameResponseHeaders _responseHeaders = new FrameResponseHeaders();

         private List<KeyValuePair<Func<object, Task>, object>> _onStarting;
@@ -198,7 +199,10 @@
                             await ProduceEnd();

                             // Finish reading the request body in case the app did not.
-                            await RequestBody.CopyToAsync(Stream.Null);
+                            while (await RequestBody.ReadAsync(_nullBuffer, 0, _nullBuffer.Length) != 0)
+                            {
+                                ;
+                            }
                         }

                         terminated = !_keepAlive;


Do not show directories starting with dot in Solution window.

Directories such as ".vscode" created by VSCode would be displayed in
the Solution window. These are now treated as hidden directories and
are not shown in the Solution window.

--- src/MonoDevelop.Dnx/MonoDevelop.Dnx/DnxProject.cs
+++ src/MonoDevelop.Dnx/MonoDevelop.Dnx/DnxProject.cs
@@ -144,6 +144,11 @@
 		{
 			var info = new DirectoryInfo (directory);
 			bool excluded = excludedDirectoryNames.Any (name => name.Equals (info.Name, StringComparison.OrdinalIgnoreCase));
+
+			if (!excluded) {
+				excluded = info.Name.StartsWith (".", StringComparison.OrdinalIgnoreCase);
+			}
+
 			if (!excluded) {
 				excluded = IsPathExcluded (directory, excludedDirectories);
 			}


Minor refactoring

Minor refactoring

--- src/NJsonSchema/Generation/JsonSchemaGenerator.cs
+++ src/NJsonSchema/Generation/JsonSchemaGenerator.cs
@@ -22,15 +22,15 @@
     /// <summary>Generates a <see cref="JsonSchema4"/> object for a given type. </summary>
     public class JsonSchemaGenerator
     {
-        private static readonly Dictionary<string, string> WellKnownFormats = new Dictionary<string, string>
-                {
-                    {"DateTime", JsonFormatStrings.DateTime},
-                    {"Date", JsonFormatStrings.Date},
-                    {"Time", JsonFormatStrings.Time},
-                    {"EmailAddress", JsonFormatStrings.Email},
-                    {"PhoneNumber", JsonFormatStrings.Phone},
-                    {"Url", JsonFormatStrings.Uri}
-                };
+        private static readonly Dictionary<string, string> DataTypeFormats = new Dictionary<string, string>
+        {
+            {"DateTime", JsonFormatStrings.DateTime},
+            {"Date", JsonFormatStrings.Date},
+            {"Time", JsonFormatStrings.Time},
+            {"EmailAddress", JsonFormatStrings.Email},
+            {"PhoneNumber", JsonFormatStrings.Phone},
+            {"Url", JsonFormatStrings.Uri}
+        };

         /// <summary>Initializes a new instance of the <see cref="JsonSchemaGenerator"/> class.</summary>
         /// <param name="settings">The settings.</param>
@@ -555,9 +555,8 @@
             if (dataTypeAttribute != null)
             {
                 var dataType = dataTypeAttribute.DataType.ToString();
-
-                if (WellKnownFormats.ContainsKey(dataType))
-                    jsonProperty.Format = WellKnownFormats[dataType];
+                if (DataTypeFormats.ContainsKey(dataType))
+                    jsonProperty.Format = DataTypeFormats[dataType];
             }
         }


TempDirLayoutRenderer - Avoid exception on static class initialization

--- src/NLog/LayoutRenderers/TempDirLayoutRenderer.cs
+++ src/NLog/LayoutRenderers/TempDirLayoutRenderer.cs
@@ -48,7 +48,7 @@
     [ThreadSafe]
     public class TempDirLayoutRenderer : LayoutRenderer
     {
-        private static string tempDir = Path.GetTempPath();
+        private static string tempDir;

         /// <summary>
         /// Gets or sets the name of the file to be Path.Combine()'d with the directory name.
@@ -62,6 +62,17 @@
         /// <docgen category='Advanced Options' order='10' />
         public string Dir { get; set; }

+        /// <inheritdoc/>
+        protected override void InitializeLayoutRenderer()
+        {
+            if (tempDir == null)
+            {
+                tempDir = Path.GetTempPath();   // Can throw exception
+            }
+
+            base.InitializeLayoutRenderer();
+        }
+
         /// <summary>
         /// Renders the directory where NLog is located and appends it to the specified <see cref="StringBuilder" />.
         /// </summary>


Fix property modifier tests

Fix property modifier tests

--- src/PublicApiGeneratorTests/Property_modifiers.cs
+++ src/PublicApiGeneratorTests/Property_modifiers.cs
@@ -98,7 +98,7 @@
     public class ClassWithPublicStaticNewProperty : PublicApiGeneratorTests.Examples.ClassWithProtectedStaticProperty
     {
         public ClassWithPublicStaticNewProperty() { }
-        protected new static string Value { get; set; }
+        public new static string Value { get; set; }
     }
 }");
         }
@@ -182,7 +182,7 @@
     public class ClassWithSealedOverridingProperty : PublicApiGeneratorTests.Examples.ClassWithVirtualProperty
     {
         public ClassWithSealedOverridingProperty() { }
-        public sealed override string Value { get; set; }
+        public override sealed string Value { get; set; }
     }
 }");
         }
@@ -196,7 +196,7 @@
     public class ClassWithProtectedSealedOverridingProperty : PublicApiGeneratorTests.Examples.ClassWithVirtualProtectedProperty
     {
         public ClassWithProtectedSealedOverridingProperty() { }
-        protected sealed override string Value { get; set; }
+        protected override sealed string Value { get; set; }
     }
 }");
         }


fix support for queue attribute

fix support for queue attribute

--- src/Quidjibo.Aws.Sqs/Providers/SqsWorkProvider.cs
+++ src/Quidjibo.Aws.Sqs/Providers/SqsWorkProvider.cs
@@ -83,14 +83,14 @@
                 MaxNumberOfMessages = _batchSize,
                 VisibilityTimeout = _visibilityTimeout,
                 WaitTimeSeconds = _waitTimeSeconds,
-                MessageAttributeNames = new List<string> { WorkItemId, CorrelationId }
+                MessageAttributeNames = new List<string> { WorkItemId, CorrelationId, Queue }
             };

             var messages = await _client.ReceiveMessageAsync(request, cancellationToken);
             return messages.Messages.Select(message => new WorkItem
             {
                 Id = new Guid(message.MessageAttributes[WorkItemId].StringValue),
-                CorrelationId = new Guid(message.MessageAttributes[WorkItemId].StringValue),
+                CorrelationId = new Guid(message.MessageAttributes[CorrelationId].StringValue),
                 Queue = message.MessageAttributes[Queue].StringValue,
                 Token = message.ReceiptHandle,
                 Payload = Convert.FromBase64String(message.Body)