Removed unnecessary ReadOption.Loose from some tests.

--- test/ExcelDataReader.Tests/ExcelBinaryReaderTest.cs
+++ test/ExcelDataReader.Tests/ExcelBinaryReaderTest.cs
@@ -958,7 +958,7 @@
         [TestMethod]
         public void Issue_11636_BiffStream()
         {
-            using (IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_Issue_11636_BiffStream"), ReadOption.Loose))
+            using (IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_Issue_11636_BiffStream")))
             {
                 excelReader.IsFirstRowAsColumnNames = false;
                 var dataset = excelReader.AsDataSet();
@@ -1022,7 +1022,7 @@
 #if !NETCOREAPP1_0
             ExcelDataReader.Log.Log.InitializeWith<Log.Logger.Log4NetLog>();
 #endif
-            using (IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_Issue_11818_OutOfRange"), ReadOption.Loose))
+            using (IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_Issue_11818_OutOfRange")))
             {
                 excelReader.IsFirstRowAsColumnNames = false;
                 var dataset = excelReader.AsDataSet();
@@ -1034,7 +1034,7 @@
         [TestMethod]
         public void Test_Issue_111_NoRowRecords()
         {
-            using (IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_git_issue_111_NoRowRecords"), ReadOption.Loose))
+            using (IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_git_issue_111_NoRowRecords")))
             {
                 var dataset = excelReader.AsDataSet();

@@ -1049,7 +1049,7 @@
         [TestMethod]
         public void Test_Git_Issue_145()
         {
-            using (IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_Git_Issue_145"), ReadOption.Loose))
+            using (IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_Git_Issue_145")))
             {
                 excelReader.Read();
                 excelReader.Read();
@@ -1100,7 +1100,7 @@
         [TestMethod]
         public void GitIssue_173()
         {
-            using (var excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_git_issue_173"), true, ReadOption.Loose))
+            using (var excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_git_issue_173")))
             {
                 var ds = excelReader.AsDataSet();
                 Assert.IsNotNull(ds);
@@ -1112,7 +1112,7 @@
         [TestMethod]
         public void ReadWriteProtectedStructureUsingStandardEncryption()
         {
-            using (var excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("protectedsheet-xxx"), true, ReadOption.Loose))
+            using (var excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("protectedsheet-xxx")))
             {
                 var ds = excelReader.AsDataSet();
                 Assert.IsNotNull(ds);
@@ -1125,7 +1125,7 @@
         [TestMethod]
         public void TestIncludeTableWithOnlyImage()
         {
-            using (var excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("TestTableOnlyImage_x01oct2016"), true, ReadOption.Loose))
+            using (var excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("TestTableOnlyImage_x01oct2016")))
             {
                 var ds = excelReader.AsDataSet();
                 Assert.IsNotNull(ds);
@@ -1136,7 +1136,7 @@
         [TestMethod]
         public void AllowFfffAsByteOrder()
         {
-            using (var excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_InvalidByteOrderValueInHeader"), true, ReadOption.Loose))
+            using (var excelReader = ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_InvalidByteOrderValueInHeader")))
             {
                 int tableCount = 0;
                 do


Attempts to fix tests.

Attempts to fix tests.

--- test/Rocket.Chat.Net.Tests/Integration/RoomFacts.cs
+++ test/Rocket.Chat.Net.Tests/Integration/RoomFacts.cs
@@ -59,8 +59,8 @@
             result.Result.Should().BeNull();
             result.Error.Reason.Should().Be("Not allowed");
         }
-
-        [Fact]
+
+        [Fact(Skip = "Preventing tests from completing")]
         public async Task Create_direct_message_that_does_not_exist_should_create_room()
         {
             var roomName = $"{Constants.TwoUsername}";
@@ -232,9 +232,7 @@
             result.HasError.Should().BeFalse();
             result.Result.Channels.Should().Contain(x => x.Name == "general" && x.Id == "GENERAL");
         }
-
-        private readonly Task<IRocketChatDriver> _composeTask = ComposeAsync();
-
+
         private static async Task<IRocketChatDriver> ComposeAsync()
         {
             var driver = new RocketChatDriver(Constants.RocketServer, false);
@@ -253,7 +251,7 @@
             {
                 return;
             }
-            using (var driver = _composeTask.Result)
+            using (var driver = ComposeAsync().Result)
             {
                 var rooms = driver.Rooms;
                 var toDelete = rooms.Where(x => RoomsCreatedByName.Contains(x.Name));


Expose TimeEntryId used to create tags view.

--- Phoebe/Data/Views/TimeEntryTagsView.cs
+++ Phoebe/Data/Views/TimeEntryTagsView.cs
@@ -20,6 +20,10 @@
             this.timeEntryId = timeEntryId;

             Reload ();
+        }
+
+        public Guid TimeEntryId {
+            get { return timeEntryId; }
         }

         public event EventHandler Updated;


addressing some partials and misses along with some code clean up

--- test/Serilog.Tests/MethodOverloadConventionTests.cs
+++ test/Serilog.Tests/MethodOverloadConventionTests.cs
@@ -95,7 +95,6 @@
             var writeMethod = methods.Single();

             Assert.True(writeMethod.IsPublic);
-
             Assert.Equal(writeMethod.ReturnType, typeof(void));

             LogEventLevel level = LogEventLevel.Information;
@@ -110,7 +109,7 @@
             if (loggerType == typeof(SilentLogger))
                 return;
             else
-                TestResults(level, sink);
+                EvaluateSingleResult(level, sink);
         }

         [Theory]
@@ -130,7 +129,6 @@
             foreach (var method in methodSet)
             {
                 Assert.Equal(method.ReturnType, typeof(ILogger));
-
                 Assert.True(method.IsPublic);

                 var signatureMatchAndInvokeSuccess = false;
@@ -184,7 +182,6 @@
             var messageTemplateAttr = method.GetCustomAttribute<MessageTemplateFormatMethodAttribute>();

             Assert.NotNull(messageTemplateAttr);
-
             Assert.Equal(messageTemplateAttr.MessageTemplateParameterName, MessageTemplate);

             var parameters = method.GetParameters();
@@ -428,8 +425,24 @@
             var enrichedLogger = InvokeMethod(method, logger, new object[] { propertyName, propertyValue, false });

             Assert.NotNull(enrichedLogger);
-
             Assert.True(enrichedLogger is ILogger);
+
+            //silentlogger will always return itself
+            if (method.DeclaringType == typeof(SilentLogger))
+                return;
+
+            Assert.NotSame(logger, enrichedLogger);
+
+            //invalid args path
+            var sameLogger = InvokeMethod(method, logger, new object[] { null, null, false });
+
+            Assert.NotNull(sameLogger);
+            Assert.True(sameLogger is ILogger);
+
+            if (method.DeclaringType == typeof(Log))
+                Assert.Same(Log.Logger, sameLogger);
+            else
+                Assert.Same(logger, sameLogger);
         }

         //public ILogger ForContext<TSource>()
@@ -459,7 +472,6 @@
             var enrichedLogger = InvokeMethod(method, logger, null, new Type[] { typeof(object) });

             Assert.NotNull(enrichedLogger);
-
             Assert.True(enrichedLogger is ILogger);
         }

@@ -475,7 +487,6 @@
                 var arg = args.Single();

                 Assert.Equal(arg.Name, "source");
-
                 Assert.Equal(arg.ParameterType, typeof(Type));
             }
             catch (XunitException e)
@@ -495,7 +506,6 @@
         void TestForContextResult(MethodInfo method, ILogger logger, object normalResult)
         {
             Assert.NotNull(normalResult);
-
             Assert.True(normalResult is ILogger);

             if (method.DeclaringType == typeof(SilentLogger))
@@ -538,7 +548,6 @@
             foreach (var method in methodSet)
             {
                 Assert.Equal(method.ReturnType, typeof(void));
-
                 Assert.True(method.IsPublic);

                 if (checkMesgTempAttr)
@@ -546,7 +555,6 @@
                     var messageTemplateAttr = method.GetCustomAttribute<MessageTemplateFormatMethodAttribute>();

                     Assert.NotNull(messageTemplateAttr);
-
                     Assert.Equal(messageTemplateAttr.MessageTemplateParameterName, MessageTemplate);
                 }

@@ -739,7 +747,7 @@

             if (method.Name == Write)
             {
-                level = LogEventLevel.Verbose;
+                level = LogEventLevel.Information;

                 var paramList = new List<object>() { level };

@@ -756,7 +764,6 @@
         static void InvokeConventionMethod(MethodInfo method, Type[] typeArgs, object[] parameters)
         {
             CollectingSink sink;
-
             LogEventLevel level;

             InvokeConventionMethod(method, typeArgs, parameters, out level, out sink);
@@ -765,12 +772,11 @@
         static void InvokeConventionMethodAndTest(MethodInfo method, Type[] typeArgs, object[] parameters)
         {
             CollectingSink sink;
-
             LogEventLevel level;

             InvokeConventionMethod(method, typeArgs, parameters, out level, out sink);

-            TestResults(level, sink);
+            EvaluateSingleResult(level, sink);
         }

         // parameters will always be ordered so single evaluation method will work
@@ -788,9 +794,7 @@
                     expectedArgCount++;

                     Assert.Equal(parameters[index].ParameterType, typeof(LogEventLevel));
-
                     Assert.Equal(parameters[index].Name, "level");
-
                     index++;
                 }

@@ -800,17 +804,13 @@
                 if (hasExceptionArg) //verify exception argument type and name
                 {
                     Assert.Equal(parameters[index].ParameterType, typeof(Exception));
-
                     Assert.Equal(parameters[index].Name, "exception");
-
                     index++;
                 }

                 //check for message template string argument
                 Assert.Equal(parameters[index].ParameterType, typeof(string));
-
                 Assert.Equal(parameters[index].Name, MessageTemplate);
-
                 index++;

                 if (isGeneric) //validate type arguments, generic parameters, and cross-reference
@@ -829,9 +829,7 @@
                             var genericConstraints = genericTypeArgs[i].GetTypeInfo().GetGenericParameterConstraints();

                             Assert.Empty(genericConstraints);
-
                             Assert.Equal(parameters[index].Name, $"propertyValue{i}");
-
                             Assert.Equal(parameters[index].ParameterType, genericTypeArgs[i]);
                         }
                     }
@@ -844,11 +842,8 @@
                         var genericConstraints = genericTypeArg.GetTypeInfo().GetGenericParameterConstraints();

                         Assert.Empty(genericConstraints);
-
                         Assert.Equal(parameters[index].Name, "propertyValue");
-
                         Assert.Equal(genericTypeArg, parameters[index].ParameterType);
-
                         index++;
                     }
                 }
@@ -863,9 +858,7 @@
                     var paramsAttr = parameters[index].GetCustomAttribute(typeof(ParamArrayAttribute), inherit: false);

                     Assert.NotNull(paramsAttr);
-
                     Assert.Equal(paramsArrayArg.ParameterType, typeof(object[]));
-
                     Assert.Equal(paramsArrayArg.Name, "propertyValues");
                 }
             }
@@ -897,8 +890,9 @@
                 return method.Invoke(instance, parameters);
         }

-        static void TestResults(LogEventLevel level, CollectingSink results)
-        {
+        static void EvaluateSingleResult(LogEventLevel level, CollectingSink results)
+        {
+            //evaluate single log event
             Assert.Equal(1, results.Events.Count);

             var evt = results.Events.Single();


UdpStream.Size is now writable

UdpStream.Size is now writable

--- src/managed/udpkit/udpStream.cs
+++ src/managed/udpkit/udpStream.cs
@@ -41,6 +41,7 @@

         public int Size {
             get { return Length; }
+            set { Length = UdpMath.Clamp(value, 0, Data.Length << 3); }
         }

         public int Position {


Update Pokemon.cs

Update Pokemon.cs

--- PokemonUnity.Shared/Monster/Pokemon.cs
+++ PokemonUnity.Shared/Monster/Pokemon.cs
@@ -244,6 +244,8 @@
 			eggSteps = _base.HatchTime;
             Ability = abilityFlag;
             Gender = gender; //GenderRatio.//Pokemon.PokemonData.GetPokemon(pokemon).MaleRatio
+			if(pokemon == Pokemons.UNOWN)
+				form = new System.Random(Core.Seed()).Next(Game.PokemonFormsData[pokemon].Length);
 			//ToDo: Undo comment
 			//Item = (Items)_base.HeldItem[0,Core.pokemonGeneration];
             GenerateMoveset();
@@ -2126,7 +2128,9 @@
         /// Some forms have a SpeciesId and others are battle only
         /// Note: All of the forms appear to be registered as Enums already...
         /// Why not just change from `INT` to `(enum)Pokemons`?
-        public int Form { get; set; }//{ get { return _base.Form; } set { if (value >= 0 && value <= _base.Forms) _base.Form = value; } }
+        //public int Form { get { return form; } set { if (value >= 0 && value <= Game.PokemonFormsData[pokemons].Count()) form = value; } }
+        public int Form { get { return form; } set { if (value >= 0 && value <= Game.PokemonFormsData[pokemons].Length) form = value; } }
+		private int form { get; set; }

         /*// <summary>
         /// Returns the species name of this Pokemon


Added call to Stream.Close on TcpTransport

--- src/Lime.Transport.Tcp/TcpTransport.cs
+++ src/Lime.Transport.Tcp/TcpTransport.cs
@@ -594,7 +594,10 @@
         /// <exception cref="System.NotImplementedException"></exception>
         protected override Task PerformCloseAsync(CancellationToken cancellationToken)
         {
-            cancellationToken.ThrowIfCancellationRequested();
+            cancellationToken.ThrowIfCancellationRequested();
+#if NET461
+            _stream?.Close();
+#endif
             _tcpClient.Close();
             return Task.FromResult<object>(null);
         }


Updated logger in simplepens

Updated logger in simplepens

Former-commit-id: a93406ae12fccf8d0e4b9c0fb9e02d83ef464701

--- PowerpointPlugins/SimplePens/Logger.cs
+++ PowerpointPlugins/SimplePens/Logger.cs
@@ -10,10 +10,12 @@
 using System.Collections;
 using System.ComponentModel;
 using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Web;

 namespace PowerpointJabber
 {
-    public class CouchTraceListener : TraceListener
+public class CouchTraceListener : TraceListener
     {
         public override void Write(string message)
         {
@@ -56,19 +58,37 @@
                     + ", \"Slide\" : " + Slide +"}";
             }
         }
+        public NameValueCollection QueryString
+        {
+            get
+            {
+                var queryString = HttpUtility.ParseQueryString(string.Empty);
+
+                queryString["program"] = "simplepens";
+                queryString["version"] = Version;
+                queryString["content"] = Content;
+                queryString["timestamp"] = Convert.ToString(Timestamp);
+                queryString["user"] = User;
+                queryString["server"] = Server;
+                queryString["slide"] = Convert.ToString(Slide);
+
+                return queryString;
+            }
+        }
     }
     public class Logger
     {
         public static readonly string POST_LOG = "http://madam.adm.monash.edu.au:5984/simplepens_log";
+        static readonly Uri LoggingServer = new Uri("https://madam.adm.monash.edu.au:1188/log_message.yaws");
         private static WebClient client()
         {
             var client = new WebClient();
             client.Encoding = Encoding.UTF8;
-            client.Headers = new WebHeaderCollection();
-            client.Headers.Add("Content-Type: application/json");
+            //client.Headers = new WebHeaderCollection();
+            //client.Headers.Add("Content-Type: application/json");
             return client;
         }
-        private static Uri couchServer = new Uri(POST_LOG);
+        //private static Uri couchServer = new Uri(POST_LOG);
         private static string[] LogExceptions = new[] {
                 "powerpnt.exe Information: 0 :"};
         public static void StartLogger()
@@ -119,7 +139,9 @@
         {
             try
             {
-                client().UploadStringAsync(couchServer, message.JSON);
+                //client().UploadStringAsync(couchServer, message.JSON);
+                client().QueryString = message.QueryString;
+                client().DownloadStringAsync(LoggingServer);
             }
             catch (Exception)
             {


Fix wrong control localized

Fix wrong control localized

--- R7.Documents/SettingsDocuments.ascx.cs
+++ R7.Documents/SettingsDocuments.ascx.cs
@@ -335,8 +335,7 @@
             grdDisplayColumns.DataKeyField = "ColumnName";

             if (!IsPostBack) {
-                // TODO: Original: Localization.LocalizeDataGrid(ref grdDisplayColumns, this.LocalResourceFile);
-                Localization.LocalizeDataGrid (ref grdSortColumns, LocalResourceFile);
+                Localization.LocalizeDataGrid (ref grdDisplayColumns, LocalResourceFile);
             }

             grdDisplayColumns.DataBind ();


fixed the bug that SuperSocket will still try to send data to the client even if the connection drops

--- SocketEngine/AsyncSocketSession.cs
+++ SocketEngine/AsyncSocketSession.cs
@@ -83,6 +83,13 @@
         {
             var queue = e.UserToken as SendingQueue;

+            if (!ProcessCompleted(e))
+            {
+                ClearPrevSendState(e);
+                OnSendError(queue, CloseReason.SocketError);
+                return;
+            }
+
             var count = queue.Sum(q => q.Count);

             if (count != e.BytesTransferred)
@@ -94,13 +101,6 @@
                 return;
             }

-            if (!ProcessCompleted(e))
-            {
-                ClearPrevSendState(e);
-                OnSendError(queue, CloseReason.SocketError);
-                return;
-            }
-
             ClearPrevSendState(e);
             base.OnSendingCompleted(queue);
         }


fixed a potential NullReferenceException issue which is caused in racing condition situation

--- SocketEngine/AsyncSocketSession.cs
+++ SocketEngine/AsyncSocketSession.cs
@@ -233,14 +233,13 @@

         protected override void OnClosed(CloseReason reason)
         {
-            if (m_SocketEventArgSend != null)
-            {
-                m_SocketEventArgSend.Completed -= new EventHandler<SocketAsyncEventArgs>(OnSendingCompleted);
-                m_SocketEventArgSend.Dispose();
-                m_SocketEventArgSend = null;
-            }
-
-            base.OnClosed(reason);
+            var sae = m_SocketEventArgSend;
+
+            if (Interlocked.CompareExchange(ref m_SocketEventArgSend, null, sae) == sae)
+            {
+                sae.Dispose();
+                base.OnClosed(reason);
+            }
         }

         protected override void ReturnBuffer(IList<KeyValuePair<ArraySegment<byte>, IBufferState>> buffers, int offset, int length)


Finished the "Command Buffers" section

Finished the "Command Buffers" section

--- Source/VulkaNet/VkCommandBuffer.cs
+++ Source/VulkaNet/VkCommandBuffer.cs
@@ -33,6 +33,7 @@
         VkResult Reset(VkCommandBufferResetFlags flags);
         VkResult Begin(IVkCommandBufferBeginInfo beginInfo);
         VkResult End();
+        void CmdExecuteCommands(IReadOnlyList<IVkCommandBuffer> commandBuffers);
     }

     public unsafe class VkCommandBuffer : IVkCommandBuffer
@@ -74,11 +75,18 @@
             public delegate VkResult EndCommandBufferDelegate(
                 HandleType commandBuffer);

+            public CmdExecuteCommandsDelegate CmdExecuteCommands { get; }
+            public delegate void CmdExecuteCommandsDelegate(
+                HandleType commandBuffer,
+                int commandBufferCount,
+                HandleType* pCommandBuffers);
+
             public DirectFunctions(IVkDevice device)
             {
                 ResetCommandBuffer = device.GetDeviceDelegate<ResetCommandBufferDelegate>("vkResetCommandBuffer");
                 BeginCommandBuffer = device.GetDeviceDelegate<BeginCommandBufferDelegate>("vkBeginCommandBuffer");
                 EndCommandBuffer = device.GetDeviceDelegate<EndCommandBufferDelegate>("vkEndCommandBuffer");
+                CmdExecuteCommands = device.GetDeviceDelegate<CmdExecuteCommandsDelegate>("vkCmdExecuteCommands");
             }
         }

@@ -103,6 +111,18 @@
         {
             return Direct.EndCommandBuffer(Handle);
         }
+
+        public void CmdExecuteCommands(IReadOnlyList<IVkCommandBuffer> commandBuffers)
+        {
+            var unmanagedSize = commandBuffers.SizeOfMarshalDirect();
+            var unamangedArray = new byte[unmanagedSize];
+            fixed (byte* unmanagedStart = unamangedArray)
+            {
+                var unamanged = unmanagedStart;
+                var pCommandBuffers = commandBuffers.MarshalDirect(ref unamanged);
+                Direct.CmdExecuteCommands(Handle, commandBuffers.Count, pCommandBuffers);
+            }
+        }
     }

     public static unsafe class VkCommandBufferExtensions


Mac's ps is different from ubuntu's: doesn't support "h" (no headers) option, different output formatting specification.

--- src/MICore/Transports/PipeTransport.cs
+++ src/MICore/Transports/PipeTransport.cs
@@ -90,14 +90,16 @@

         private void KillProcess(Process p)
         {
-            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
-            {
-                // Run 'ps h -o "%p %P"', which generates a list of the process ids (%p) and parent process ids (%P).
+            bool isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
+            bool isOSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
+            if (isLinux || isOSX)
+            {
+                // On linux run 'ps -x -o "%p %P"' (similarly on Mac), which generates a list of the process ids (%p) and parent process ids (%P).
                 // Using this list, issue a 'kill' command for each child process. Kill the children (recursively) to eliminate
                 // the entire process tree rooted at p.
                 Process ps = new Process();
                 ps.StartInfo.FileName ="/bin/ps";
-                ps.StartInfo.Arguments = "h -o \"%p %P\"";
+                ps.StartInfo.Arguments = isLinux ? "-x -o \"%p %P\"" : "-x -o \"pid ppid\"";
                 ps.StartInfo.RedirectStandardOutput = true;
                 ps.StartInfo.UseShellExecute = false;
                 ps.Start();
@@ -107,9 +109,12 @@
                 while ((line = ps.StandardOutput.ReadLine()) != null)
                 {
                     line = line.Trim();
-                    int id = Int32.Parse(line.Substring(0, line.IndexOfAny(whitespace)), CultureInfo.InvariantCulture);
-                    int pid = Int32.Parse(line.Substring(line.IndexOfAny(whitespace)).Trim(), CultureInfo.InvariantCulture);
-                    processAndParent.Add(new Tuple<int, int>(id, pid));
+                    int id, pid;
+                    if (Int32.TryParse(line.Substring(0, line.IndexOfAny(whitespace)), NumberStyles.Integer, CultureInfo.InvariantCulture, out id)
+                        && Int32.TryParse(line.Substring(line.IndexOfAny(whitespace)).Trim(), NumberStyles.Integer, CultureInfo.InvariantCulture, out pid))
+                    {
+                        processAndParent.Add(new Tuple<int, int>(id, pid));
+                    }
                 }
                 KillChildren(processAndParent, p.Id);
             }


V2 development

V2 development


reverts the finding of articulate roots - this needs to be done with the xpath navigator

--- src/Articulate/ArticulateRoutes.cs
+++ src/Articulate/ArticulateRoutes.cs
@@ -17,60 +17,60 @@
     /// </summary>
     public static class ArticulateRoutes
     {
-        /// <summary>
-        /// This is used to indicate the max search depth of the tree to find Articulate roots
-        /// </summary>
-        public static int MaxSearchDepth = 5;
-
-        /// <summary>
-        /// Finds the articulate roots in the project without iterating over every single node
-        /// </summary>
-        /// <param name="umbracoCache"></param>
-        /// <returns></returns>
-        public static IEnumerable<IPublishedContent> FindArticulateRoots(ContextualPublishedCache umbracoCache)
-        {
-            var found = new HashSet<IPublishedContent>();
-            foreach (var child in umbracoCache.GetAtRoot())
-            {
-                if (child.DocumentTypeAlias == "Articulate")
-                {
-                    found.Add(child);
-                }
-                else
-                {
-                    FindArticulateRoots(child, found);
-                }
-            }
-            return found;
-        }
-
-        /// <summary>
-        /// Used to recursively search through the children
-        /// </summary>
-        /// <param name="current"></param>
-        /// <param name="found"></param>
-        private static void FindArticulateRoots(IPublishedContent current, ISet<IPublishedContent> found)
-        {
-            //stop searching here if it's too deep
-            if (current.Level > MaxSearchDepth) return;
-
-            foreach (var child in current.Children)
-            {
-                if (child.DocumentTypeAlias == "Articulate")
-                {
-                    found.Add(child);
-                }
-                else
-                {
-                    FindArticulateRoots(child, found);
-                }
-            }
-        }
+        ///// <summary>
+        ///// This is used to indicate the max search depth of the tree to find Articulate roots
+        ///// </summary>
+        //public static int MaxSearchDepth = 5;
+
+        ///// <summary>
+        ///// Finds the articulate roots in the project without iterating over every single node
+        ///// </summary>
+        ///// <param name="umbracoCache"></param>
+        ///// <returns></returns>
+        //public static IEnumerable<IPublishedContent> FindArticulateRoots(ContextualPublishedCache umbracoCache)
+        //{
+        //    var found = new HashSet<IPublishedContent>();
+        //    foreach (var child in umbracoCache.GetAtRoot())
+        //    {
+        //        if (child.DocumentTypeAlias == "Articulate")
+        //        {
+        //            found.Add(child);
+        //        }
+        //        else
+        //        {
+        //            FindArticulateRoots(child, found);
+        //        }
+        //    }
+        //    return found;
+        //}
+
+        ///// <summary>
+        ///// Used to recursively search through the children
+        ///// </summary>
+        ///// <param name="current"></param>
+        ///// <param name="found"></param>
+        //private static void FindArticulateRoots(IPublishedContent current, ISet<IPublishedContent> found)
+        //{
+        //    //stop searching here if it's too deep
+        //    if (current.Level > MaxSearchDepth) return;
+
+        //    foreach (var child in current.Children)
+        //    {
+        //        if (child.DocumentTypeAlias == "Articulate")
+        //        {
+        //            found.Add(child);
+        //        }
+        //        else
+        //        {
+        //            FindArticulateRoots(child, found);
+        //        }
+        //    }
+        //}

         public static void MapRoutes(RouteCollection routes, ContextualPublishedCache umbracoCache, UrlProvider umbracoUrlProvider)
         {
             //find all articulate root nodes
-            var articulateNodes = FindArticulateRoots(umbracoCache);
+            var articulateNodes = umbracoCache.GetByXPath("//Articulate").ToArray();

             //NOTE: need to write lock because this might need to be remapped while the app is running if


雑魚、上むかない

雑魚、上むかない

たぶんね


Prevent crash when switching themes.

Prevent crash when switching themes.

--- src/Avalonia.Base/StyledElement.cs
+++ src/Avalonia.Base/StyledElement.cs
@@ -873,9 +873,12 @@

                     if (applied.Source == styles[i])
                     {
+                        _appliedStyles.RemoveAt(j);
                         applied.Dispose();
-                        _appliedStyles.RemoveAt(j);
                     }
+
+                    if (j > _appliedStyles.Count)
+                        j = _appliedStyles.Count;
                 }
             }
         }


Use MathUtilities

Use MathUtilities

--- src/Avalonia.Controls/WrapPanel.cs
+++ src/Avalonia.Controls/WrapPanel.cs
@@ -112,13 +112,13 @@
                 //this is the size of the child in UV space
                 var sz = new UVSize(Orientation, child.DesiredSize.Width, child.DesiredSize.Height);

-                if ((curLineSize.U + sz.U) > uvConstraint.U) //need to switch to another line
+                if (MathUtilities.GreaterThan(curLineSize.U + sz.U, uvConstraint.U) //need to switch to another line
                 {
                     panelSize.U = Max(curLineSize.U, panelSize.U);
                     panelSize.V += curLineSize.V;
                     curLineSize = sz;

-                    if (sz.U > uvConstraint.U) //the element is wider then the constrint - give it a separate line
+                    if (MathUtilities.GreaterThan(sz.U, uvConstraint.U)) //the element is wider then the constrint - give it a separate line
                     {
                         panelSize.U = Max(sz.U, panelSize.U);
                         panelSize.V += sz.V;


Added lost focus-within to pseudo classes attr

--- src/Avalonia.Input/InputElement.cs
+++ src/Avalonia.Input/InputElement.cs
@@ -16,7 +16,7 @@
     /// <summary>
     /// Implements input-related functionality for a control.
     /// </summary>
-    [PseudoClasses(":disabled", ":focus", ":focus-visible", ":pointerover")]
+    [PseudoClasses(":disabled", ":focus", ":focus-visible", ":focus-within", ":pointerover")]
     public class InputElement : Interactive, IInputElement
     {
         /// <summary>


Have SystemPosition use decimal instead of double to improve accuracy

--- EliteJournalReader/SystemPosition.cs
+++ EliteJournalReader/SystemPosition.cs
@@ -10,7 +10,7 @@
 {
     public struct SystemPosition
     {
-        public double X, Y, Z;
+        public decimal X, Y, Z;

         public bool IsZero()
         {
@@ -31,10 +31,19 @@

         public override int GetHashCode()
         {
-            return (int)((X * 10000 + Y * 10000 + Z * 10000) % int.MaxValue);
+            //https://stackoverflow.com/a/892640/3131828
+            unchecked
+            {
+                int h = 23;
+                h *= 31 + X.GetHashCode();
+                h *= 31 + Y.GetHashCode();
+                h *= 31 + Z.GetHashCode();
+
+                return h;
+            }
         }

-        public double[] ToArray()
+        public decimal[] ToArray()
         {
             return new[] { X, Y, Z };
         }
@@ -57,7 +66,7 @@
             var pos = (SystemPosition)existingValue;
             if (JToken.ReadFrom(reader) is JArray jarr)
             {
-                double[] array = jarr.ToObject<double[]>();
+                decimal[] array = jarr.ToObject<decimal[]>();
                 pos.X = Math.Round(array[0], 3);
                 pos.Y = Math.Round(array[1], 3);
                 pos.Z = Math.Round(array[2], 3);


Fix WP8 first register error

Fix WP8 first register error

FIX Problem when first register in wp8 doesn't work because callback not
initialize before call to open.

--- src/wp8/PushPlugin.cs
+++ src/wp8/PushPlugin.cs
@@ -29,7 +29,7 @@
             if (pushChannel == null)
             {
                 pushChannel = new HttpNotificationChannel(this.pushOptions.ChannelName);
-
+				SubscribePushChannelEvents(pushChannel);
                 try
                 {
                     pushChannel.Open();
@@ -43,8 +43,10 @@
                 pushChannel.BindToShellToast();
                 pushChannel.BindToShellTile();
             }
-
-            SubscribePushChannelEvents(pushChannel);
+			else {
+				SubscribePushChannelEvents(pushChannel);
+			}
+
             var result = new RegisterResult
             {
                 ChannelName = this.pushOptions.ChannelName,


remove async

remove async

--- FireCrypt/FireCrypt/MainForm.cs
+++ FireCrypt/FireCrypt/MainForm.cs
@@ -94,14 +94,14 @@
 				if (!currentVolume.Unlocked)
 				{
 					label5.Text = "Unlocking...";
-					await Task.Run(()=>TryUnlockVolume());
-					//TryUnlockVolume();
+					//await Task.Run(()=>TryUnlockVolume());
+					TryUnlockVolume();
 				}
 				else
 				{
 					label5.Text = "Locking...";
-					await Task.Run(()=>TryLockVolume());
-					//TryLockVolume();
+					//await Task.Run(()=>TryLockVolume());
+					TryLockVolume();
 				}
 			}
 			catch (NullReferenceException)


E-mail do contador, o outro commit era da empresa

--- SpedBr/SpedBr.SpedFiscal/Bloco0.cs
+++ SpedBr/SpedBr.SpedFiscal/Bloco0.cs
@@ -311,7 +311,7 @@
             /// <summary>
             ///     Endereço do correio eletrônico.
             /// </summary>
-            [SpedCampos(13, "EMAIL", "C", 0, 0, true)]
+            [SpedCampos(13, "EMAIL", "C", int.MaxValue, 0, true)]
             public string Email { get; set; }

             /// <summary>


Simplify Binidings

Simplify Binidings

--- code/SoftwareThresher/SoftwareThresher/Configurations/ConfigurationLoader.cs
+++ code/SoftwareThresher/SoftwareThresher/Configurations/ConfigurationLoader.cs
@@ -11,7 +11,6 @@
    }

    public class ConfigurationLoader : IConfigurationLoader {
-      const BindingFlags FindBindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.DeclaredOnly;
       const string SettingsSectionName = "settings";
       const string TasksSectionName = "tasks";

@@ -85,7 +84,7 @@

       static void SetAttribute(XmlAttribute attribute, object output, string xmlNodeName) {
          try {
-            var property = output.GetType().GetProperty(attribute.Name, FindBindingFlags);
+            var property = output.GetType().GetProperty(attribute.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.DeclaredOnly);
             property.SetValue(output, attribute.Value);
          }
          catch (Exception) {


Fixed bug in post build step

Fixed bug in post build step

--- FactorioModBuilder/Build/Compiler.cs
+++ FactorioModBuilder/Build/Compiler.cs
@@ -148,14 +148,9 @@
         private void PostBuild(CompileSettings settings)
         {
             // move the temporary directory project contents to the output directory
-            string srcPath = Path.Combine(settings.BaseTempDirectory, settings.ProjectName);
-            string destPath = Path.Combine(settings.BaseOutDirectory, settings.ProjectName);
-            if (Directory.Exists(destPath))
-                Directory.Delete(destPath, true);
-            Directory.CreateDirectory(destPath);
-            Directory.Move(
-                Path.Combine(settings.BaseTempDirectory, settings.ProjectName),
-                Path.Combine(settings.BaseOutDirectory, settings.ProjectName));
+            if (Directory.Exists(settings.BaseOutDirectory))
+                Directory.Delete(settings.BaseOutDirectory, true);
+            Directory.Move(settings.BaseTempDirectory, settings.BaseOutDirectory);
         }

         public bool AddExtension(ICompilerExtension ext)


Fixed incorrect double to an int.

Fixed incorrect double to an int.

--- src/Model/Report/User/UserHappiness.cs
+++ src/Model/Report/User/UserHappiness.cs
@@ -18,7 +18,7 @@
             public double Great { get; set; }
             public double Okay { get; set; }
             public double NotGood { get; set; }
-            public double GreatCount { get; set; }
+            public int GreatCount { get; set; }
             public int OkayCount { get; set; }
             public int NotGoodCount { get; set; }
             public int TotalCustomers { get; set; }


Added a test case

Added a test case

--- src/Nancy.Tests/Unit/RequestFixture.cs
+++ src/Nancy.Tests/Unit/RequestFixture.cs
@@ -385,6 +385,27 @@
             request.Url.Scheme.ShouldEqual(protocol);
         }

+		[Fact]
+		public void Should_split_cookie_in_two_parts_only()
+		{
+			// Given, when
+			var cookieName = "_nc";
+			var cookieData = "Y+M3rcC/7ssXvHTx9pwCbwQVV4g=sp0hUZVApYgGbKZIU4bvXbBCVl9fhSEssEXSGdrt4jVag6PO1oed8lSd+EJD1nzWx4OTTCTZKjYRWeHE97QVND4jJIl+DuKRgJnSl3hWI5gdgGjcxqCSTvMOMGmW3NHLVyKpajGD8tq1DXhXMyXHjTzrCAYl8TGzwyJJGx/gd7VMJeRbAy9JdHOxEUlCKUnPneWN6q+/ITFryAa5hAdfcjXmh4Fgym75whKOMkWO+yM2icdsciX0ShcvnEQ/bXcTHTya6d7dJVfZl7qQ8AgIQv8ucQHxD3NxIvHNPBwms2ClaPds0HG5N+7pu7eMSFZjUHpDrrCnFvYN+JDiG3GMpf98LuCCvxemvipJo2MUkY4J1LvaDFoWA5tIxAfItZJkSIW2d8JPDwFk8OHJy8zhyn8AjD2JFqWaUZr4y9KZOtgI0V0Qlq0mS3mDSlLn29xapgoPHBvykwQjR6TwF2pBLpStsfZa/tXbEv2mc3VO3CnErIA1lEfKNqn9C/Dw6hqW";
+			var headers = new Dictionary<string, IEnumerable<string>> ();
+			var cookies = new List<string> ();
+			cookies.Add (string.Format ("{0}={1}", cookieName, cookieData));
+			headers.Add ("cookie", cookies);
+			var newUrl = new Url
+			{
+				Path = "/"
+			};
+			var request = new Request ("GET", newUrl, null, headers);
+
+			// Then
+			request.Cookies[cookieName].ShouldEqual (cookieData);
+
+		}
+
         private static RequestStream CreateRequestStream()
         {
             return CreateRequestStream(new MemoryStream());


Add on setup function, override it to do stuffs after Setup behaviour

--- Scripts/GameApi/LiteNetLibBehaviour.cs
+++ Scripts/GameApi/LiteNetLibBehaviour.cs
@@ -130,6 +130,7 @@
             this.behaviourIndex = behaviourIndex;
             SetupSyncElements(syncFieldNames, CacheSyncFieldInfos, syncFields);
             SetupSyncElements(syncListNames, CacheSyncListInfos, syncLists);
+            OnSetup();
         }

         private void SetupSyncElements<T>(List<string> fieldNames, Dictionary<string, FieldInfo> cache, List<T> elementList) where T : LiteNetLibElement
@@ -302,5 +303,7 @@
                     list.SendOperation(peer, LiteNetLibSyncList.Operation.Insert, i);
             }
         }
+
+        public virtual void OnSetup() { }
     }
 }


Improve codes

Improve codes

--- Scripts/GameApi/LiteNetLibTransform.cs
+++ Scripts/GameApi/LiteNetLibTransform.cs
@@ -32,6 +32,7 @@
         private float lastClientTimestamp = 0;
         private float lastServerTimestamp = 0;
         private TransformResult startInterpResult;
+        private TransformResult endInterpResult;
         private TransformResult lastResult;
         private TransformResult syncResult;

@@ -50,7 +51,7 @@
             lastResult = new TransformResult();
             lastResult.position = TempTransform.position;
             lastResult.rotation = TempTransform.rotation;
-            lastResult.timestamp = Time.time;
+            lastResult.timestamp = Time.realtimeSinceStartup;
             syncResult = lastResult;
             interpResults.Add(lastResult);
         }
@@ -74,7 +75,7 @@
                 return;
             lastClientTimestamp = result.timestamp;
             // Adding results to the results list so they can be used in interpolation process
-            result.timestamp = Time.time;
+            result.timestamp = Time.realtimeSinceStartup;
             interpResults.Add(result);
         }

@@ -84,7 +85,7 @@
             {
                 syncResult.position = TempTransform.position;
                 syncResult.rotation = TempTransform.rotation;
-                syncResult.timestamp = Time.time;
+                syncResult.timestamp = Time.realtimeSinceStartup;
                 return true;
             }
             return false;
@@ -99,7 +100,7 @@
             writer.Put(TempTransform.rotation.y);
             writer.Put(TempTransform.rotation.z);
             writer.Put(TempTransform.rotation.w);
-            writer.Put(Time.time);
+            writer.Put(Time.realtimeSinceStartup);
         }

         public override void OnDeserialize(NetDataReader reader)
@@ -116,7 +117,7 @@
                 return;
             lastServerTimestamp = result.timestamp;
             // Adding results to the results list so they can be used in interpolation process
-            result.timestamp = Time.time;
+            result.timestamp = Time.realtimeSinceStartup;
             interpResults.Add(result);
         }

@@ -132,7 +133,7 @@
             // Sending client transform result to server
             else if (canClientSendResult && IsLocalClient)
             {
-                if (syncElapsed >= SendInterval)
+                if (syncElapsed >= sendInterval)
                 {
                     // Send transform to server only when there are changes on transform
                     if (ShouldSyncBehaviour())
@@ -153,7 +154,7 @@
             if (interpResults.Count == 0)
                 isInterpolating = false;

-            if (interpResults.Count >= 2)
+            if (interpResults.Count > 0)
                 isInterpolating = true;

             if (isInterpolating)
@@ -162,12 +163,14 @@
                 if (!ShouldSnap(lastInterpResult.position))
                 {
                     if (interpStep == 0)
+                    {
                         startInterpResult = lastResult;
-
-                    float step = 1f / SendInterval;
-
-                    lastResult.position = Vector3.Lerp(startInterpResult.position, interpResults[0].position, interpStep);
-                    lastResult.rotation = Quaternion.Slerp(startInterpResult.rotation, interpResults[0].rotation, interpStep);
+                        endInterpResult = interpResults[0];
+                    }
+
+                    float step = 1f / sendInterval;
+                    lastResult.position = Vector3.Lerp(startInterpResult.position, endInterpResult.position, interpStep);
+                    lastResult.rotation = Quaternion.Slerp(startInterpResult.rotation, endInterpResult.rotation, interpStep);

                     if (TempRigidbody3D != null)
                         InterpolateRigibody3D();
@@ -181,7 +184,7 @@
                     interpStep += step * Time.fixedDeltaTime;
                     if (interpStep >= 1)
                     {
-                        interpStep = 0;
+                        interpStep = 0f;
                         interpResults.RemoveAt(0);
                     }
                 }


Made delimiter code more readable

Made delimiter code more readable

--- StringCalcKata/StringCalculator.cs
+++ StringCalcKata/StringCalculator.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Linq;
 using System.Text;

@@ -6,29 +7,37 @@
 {
     public class StringCalculator
     {
-        private static readonly string[] DefaultDelimiters = { ",", "\n" };
+        private static readonly string[] DefaultDelims = { ",", "\n" };
+        private const string DelimStart = "//";
+        private const string DelimEnd = "\n";
+        private static readonly string[] DelimEnds = { DelimEnd };

         public int Add(string sum)
         {
             if (sum == string.Empty) return 0;
             var calculation = new StringBuilder(sum);
-            var delimiter = Delimiter(calculation);
             var total = 0;
-            foreach (var value in calculation.ToString().Split(delimiter, StringSplitOptions.None).Select(number => Convert.ToInt32(number)))
+            foreach (var number in NumbersFromString(calculation))
             {
-                if(value < 0) throw new ArgumentOutOfRangeException(sum, "Negatives are not allowed.");
-                if(value > 1000) continue;
-                total += value;
+                if(number < 0) throw new ArgumentOutOfRangeException(sum, "Negatives are not allowed.");
+                if(number > 1000) continue;
+                total += number;
             }
             return total;
+        }
+
+        private static IEnumerable<int> NumbersFromString(StringBuilder calculation)
+        {
+            var delimiter = Delimiter(calculation);
+            return calculation.ToString().Split(delimiter, StringSplitOptions.None).Select(number => Convert.ToInt32(number));
         }

         private static string[] Delimiter(StringBuilder sum)
         {
             var calculation = sum.ToString();
-            if (!calculation.StartsWith("//")) return DefaultDelimiters;
-            var delimiter = new[] { calculation.Split(new[] {"\n"}, StringSplitOptions.None).First().Remove(0, 2) };
-            sum.Remove(0, 3 + delimiter[0].Length);
+            if (!calculation.StartsWith(DelimStart)) return DefaultDelims;
+            var delimiter = new[] { calculation.Split(DelimEnds, StringSplitOptions.None).First().Remove(0, DelimStart.Length) };
+            sum.Remove(0, DelimStart.Length + DelimEnd.Length + delimiter[0].Length);
             return delimiter;
         }
     }


1, Cannot add variable after game object starts

--- Synchronica/Simulation/Recorder.cs
+++ Synchronica/Simulation/Recorder.cs
@@ -67,6 +67,9 @@

         public Variable<bool> AddBoolean(GameObject gameObject, int id, bool value)
         {
+            if (gameObject.StartTime < this.scene.ElapsedTime)
+                throw new InvalidOperationException("Cannot add variable after game object starts");
+
             var variable = new VBoolean(gameObject, id, value);
             gameObject.AddVariable(variable);
             return variable;
@@ -74,6 +77,9 @@

         public Variable<short> AddInt16(GameObject gameObject, int id, short value)
         {
+            if (gameObject.StartTime < this.scene.ElapsedTime)
+                throw new InvalidOperationException("Cannot add variable after game object starts");
+
             var variable = new VInt16(gameObject, id, value);
             gameObject.AddVariable(variable);
             return variable;
@@ -81,6 +87,9 @@

         public Variable<int> AddInt32(GameObject gameObject, int id, int value)
         {
+            if (gameObject.StartTime < this.scene.ElapsedTime)
+                throw new InvalidOperationException("Cannot add variable after game object starts");
+
             var variable = new VInt32(gameObject, id, value);
             gameObject.AddVariable(variable);
             return variable;
@@ -88,6 +97,9 @@

         public Variable<long> AddInt64(GameObject gameObject, int id, long value)
         {
+            if (gameObject.StartTime < this.scene.ElapsedTime)
+                throw new InvalidOperationException("Cannot add variable after game object starts");
+
             var variable = new VInt64(gameObject, id, value);
             gameObject.AddVariable(variable);
             return variable;
@@ -95,6 +107,9 @@

         public Variable<float> AddFloat(GameObject gameObject, int id, float value)
         {
+            if (gameObject.StartTime < this.scene.ElapsedTime)
+                throw new InvalidOperationException("Cannot add variable after game object starts");
+
             var variable = new VFloat(gameObject, id, value);
             gameObject.AddVariable(variable);
             return variable;


added ShowKick property for kick button in player popup

--- TCC.Core/ViewModels/TooltipInfo.cs
+++ TCC.Core/ViewModels/TooltipInfo.cs
@@ -106,6 +106,7 @@
         {
             get => GroupWindowViewModel.Instance.AmILeader() && GroupWindowViewModel.Instance.Raid && GroupWindowViewModel.Instance.Exists(Name) && Name != SessionManager.CurrentPlayer.Name;
         }
+        public bool ShowKick => GroupWindowViewModel.Instance.AmILeader() && GroupWindowViewModel.Instance.Exists(Name) && Name != SessionManager.CurrentPlayer.Name;
         public bool ShowDelegateLeader
         {
             get => GroupWindowViewModel.Instance.AmILeader() && GroupWindowViewModel.Instance.Exists(Name) && Name != SessionManager.CurrentPlayer.Name;
@@ -136,6 +137,7 @@
             NPC(nameof(ShowPartyInvite));
             NPC(nameof(ShowGuildInvite));
             NPC(nameof(ShowAddFriend));
+            NPC(nameof(ShowKick));
             NPC(nameof(ShowWhisper));
             NPC(nameof(BlockLabelText));
             NPC(nameof(FriendLabelText));


Adds more watchdog logs

Adds more watchdog logs

--- TGS.Server/Instance/DreamDaemon.cs
+++ TGS.Server/Instance/DreamDaemon.cs
@@ -374,7 +374,9 @@
 						}
 					}

-					WriteCurrentDDLog("Crash detected!");
+					WriteCurrentDDLog("Crash detected! Exit code: ": Proc.ExitCode);
+					var runtimeS = (DateTime.Now - starttime).TotalSeconds;
+					WriteWarning("DD crashed: Exit Code: " + Proc.ExitCode + " Seconds running: " + runtimeS);

 					lock (watchdogLock)
 					{
@@ -384,7 +386,7 @@

 						if (AwaitingShutdown == ShutdownRequestPhase.Pinged)
 							return;
-						var BadStart = (DateTime.Now - starttime).TotalSeconds < DDBadStartTime;
+						var BadStart = runtimeS < DDBadStartTime;
 						if (BadStart)
 						{
 							++retries;
@@ -619,6 +621,7 @@
 					{
 						GameAPIVersion = null;  //needs updating
 					}
+					WriteInfo("Starting DD: " + Proc.StartInfo.FileName + " " + Proc.StartInfo.Arguments);
 					Proc.Start();
 					Proc.PriorityClass = ProcessPriorityClass.AboveNormal;


Fix typo

Fix typo

--- SimpleTwitchBot.Lib/TwitchIrcClient.cs
+++ SimpleTwitchBot.Lib/TwitchIrcClient.cs
@@ -36,7 +36,7 @@
         {
             switch(e.Message.Command)
             {
-                case "PRIVMGS":
+                case "PRIVMSG":
                     var chatMessage = new TwitchChatMessage(e.Message);
                     CallOnChatMessageReceived(chatMessage);
                     break;


Linkedin

Linkedin

--- SkepsisWeb/Views/Shared/_Layout.cshtml
+++ SkepsisWeb/Views/Shared/_Layout.cshtml
@@ -136,7 +136,8 @@

Copyright 2016 Skepsis ry • Sivuston ylläpidosta vastaa NSD Oy

                 @if (!string.IsNullOrEmpty(@ViewBag.OgPageUrl)) {
-

+
Tweet

+

                 }

@@ -154,5 +155,7 @@
       ga('create', 'UA-27605309-1', 'auto');
       ga('send', 'pageview');
     </script>
+
+


React to IAuthorizationFilter changes

React to IAuthorizationFilter changes

--- src/Orchard.Security/FakeUserFilter.cs
+++ src/Orchard.Security/FakeUserFilter.cs
@@ -7,7 +7,7 @@
     [ScopedComponent(typeof(IFilterMetadata))]
     public class FakeUserFilter : IAuthorizationFilter
     {
-        public void OnAuthorization(AuthorizationContext context)
+        public void OnAuthorization(AuthorizationFilterContext context)
         {
             var validPrincipal = new ClaimsPrincipal(
                 new ClaimsIdentity( new[] {


Tweak Enum.TryParse whitespace skipping slightly

As a simple addendum to my previous Enum.TryParse change, if the string
begins with whitespace, we already know where the whitespace ends, so we
don't need to retraverse it.

--- src/mscorlib/src/System/Enum.cs
+++ src/mscorlib/src/System/Enum.cs
@@ -428,7 +428,7 @@
                 StringComparison.OrdinalIgnoreCase :
                 StringComparison.Ordinal;

-            int valueIndex = 0;
+            int valueIndex = firstNonWhitespaceIndex;
             while (valueIndex <= value.Length) // '=' is to handle invalid case of an ending comma
             {
                 // Find the next separator, if there is one, otherwise the end of the string.


Accommodate existing RequestContext.PropagateActivityId value in ClusterClient (#5575)

--- src/Orleans.Core/Core/ClusterClient.cs
+++ src/Orleans.Core/Core/ClusterClient.cs
@@ -44,7 +44,7 @@
             this.clusterClientLifecycle = new ClusterClientLifecycle(loggerFactory.CreateLogger<LifecycleSubject>());

             //set PropagateActivityId flag from node cofnig
-            RequestContext.PropagateActivityId = clientMessagingOptions.Value.PropagateActivityId;
+            RequestContext.PropagateActivityId |= clientMessagingOptions.Value.PropagateActivityId;

             // register all lifecycle participants
             IEnumerable<ILifecycleParticipant<IClusterClientLifecycle>> lifecycleParticipants = this.ServiceProvider.GetServices<ILifecycleParticipant<IClusterClientLifecycle>>();


Add parameter names to ArgumentExceptions in Guid

--- src/mscorlib/src/System/Guid.cs
+++ src/mscorlib/src/System/Guid.cs
@@ -49,7 +49,7 @@
             if (b==null)
                 throw new ArgumentNullException("b");
             if (b.Length != 16)
-                throw new ArgumentException(Environment.GetResourceString("Arg_GuidArrayCtor", "16"));
+                throw new ArgumentException(Environment.GetResourceString("Arg_GuidArrayCtor", "16"), "b");
             Contract.EndContractBlock();

             _a = ((int)b[3] << 24) | ((int)b[2] << 16) | ((int)b[1] << 8) | b[0];
@@ -90,7 +90,7 @@
                 throw new ArgumentNullException("d");
             // Check that array is not too big
             if(d.Length != 8)
-                throw new ArgumentException(Environment.GetResourceString("Arg_GuidArrayCtor", "8"));
+                throw new ArgumentException(Environment.GetResourceString("Arg_GuidArrayCtor", "8"), "d");
             Contract.EndContractBlock();

             _a  = a;
@@ -1004,7 +1004,7 @@
                 return 1;
             }
             if (!(value is Guid)) {
-                throw new ArgumentException(Environment.GetResourceString("Arg_MustBeGuid"));
+                throw new ArgumentException(Environment.GetResourceString("Arg_MustBeGuid"), "value");
             }
             Guid g = (Guid)value;


task repo changes

task repo changes

--- TaskHistory.Impl/Tasks/TaskRepo.cs
+++ TaskHistory.Impl/Tasks/TaskRepo.cs
@@ -71,6 +71,24 @@
 			_dataProxy.ExecuteNonQuery(DeleteStoredProcedure, parameters);
 		}

+		public bool SetTaskStatus(int taskId, int userId, bool status)
+		{
+			var parameters = new List<ISqlDataParameter>();
+			parameters.Add(_dataProxy.CreateParameter("pTaskId", taskId));
+			parameters.Add(_dataProxy.CreateParameter("pUserId", userId));
+			parameters.Add(_dataProxy.CreateParameter("pStatus", status));
+
+			// TODO this should come back from ExecuteNonQuery (either true, if record actually was updated).
+			// for example wasDeleted => stillDeleted is false
+			bool isSuccessful = true;
+
+			// TODO in order for that to make sense. ExecuteNonQuery has to return something...
+			// TODO also TODO implement this in SQL
+			_dataProxy.ExecuteNonQuery("TaskStatusSetStoredProcedure", parameters);
+
+			return isSuccessful;
+		}
+
 		public TaskRepo(TaskFactory taskFactory,
 			ApplicationDataProxy applicationDataProxy)
 		{


Improve dbFailureRetry validation

Improve dbFailureRetry validation

--- src/Quartz/Impl/StdSchedulerFactory.cs
+++ src/Quartz/Impl/StdSchedulerFactory.cs
@@ -381,11 +381,10 @@
                 throw new SchedulerException("quartz.scheduler.idleWaitTime of less than 1000ms is not legal.");
             }

-            TimeSpan dbFailureRetryVal = cfg.GetTimeSpanProperty(PropertySchedulerDbFailureRetryInterval, dbFailureRetry);
-            // Ensure not to accept any negative value, or else Thread.sleep() will throw exception in JobRunShell
-            if (dbFailureRetryVal >= TimeSpan.Zero)
-            {
-                dbFailureRetry = dbFailureRetryVal;
+            dbFailureRetry = cfg.GetTimeSpanProperty(PropertySchedulerDbFailureRetryInterval, dbFailureRetry);
+            if (dbFailureRetry < TimeSpan.Zero)
+            {
+                throw new SchedulerException(PropertySchedulerDbFailureRetryInterval + " of less than 0 ms is not legal.");
             }

             bool makeSchedulerThreadDaemon = cfg.GetBooleanProperty(PropertySchedulerMakeSchedulerThreadDaemon);


Removed AssemblyInfo.cs

Removed AssemblyInfo.cs

--- src/Scrutor/Properties/AssemblyInfo.cs
+++ src/Scrutor/Properties/AssemblyInfo.cs
@@ -1,15 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("Scrutor")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Scrutor")]
-[assembly: AssemblyCopyright("Copyright © Kristian Hellang 2015")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("1d63da77-e425-4fea-bc82-94a8f6c3024e")]


handle new language tags with no iso639-3 yet

--- SIL.WritingSystems/Sldr.cs
+++ SIL.WritingSystems/Sldr.cs
@@ -453,9 +453,16 @@
 				if (!entry.tag.StartsWith("x-")) // tags starting with x- have undefined structure so ignoring them
 				{
 					LanguageSubtag languageTag;
-					if (!entry.deprecated && (entry.iso639_3 != null) && !StandardSubtags.RegisteredLanguages.TryGet(entry.iso639_3, out languageTag) && !StandardSubtags.RegisteredLanguages.TryGet(entry.tag.Split('-')[0], out languageTag))
-					{
-						StandardSubtags.AddLanguage(entry.iso639_3, entry.name, false, entry.iso639_3);
+					if (!entry.deprecated && !StandardSubtags.RegisteredLanguages.TryGet(entry.tag.Split('-')[0], out languageTag))
+					{
+						if (entry.iso639_3 == null)
+						{
+							StandardSubtags.AddLanguage(entry.tag.Split('-')[0], entry.name, false, entry.tag.Split('-')[0]);
+						}
+						else if (!StandardSubtags.RegisteredLanguages.TryGet(entry.iso639_3, out languageTag))
+						{
+							StandardSubtags.AddLanguage(entry.iso639_3, entry.name, false, entry.iso639_3);
+						}
 					}
 					string implicitStringCode = null;


Wpf: Fix mnemonic conversions for buttons/label

--- Source/Eto.Platform.Wpf/Conversions.cs
+++ Source/Eto.Platform.Wpf/Conversions.cs
@@ -88,22 +88,34 @@
 		}

 		public static string ToWpfMneumonic (this string value)
-		{
-			if (value == null)
-				return null;
-			return value.Replace ("_", "__").Replace ("&", "_");
+		{
+			if (value == null)
+				return string.Empty;
+			value = value.Replace ("_", "__");
+			var match = Regex.Match (value, @"(?<=([^&](?:[&]{2})*)|^)[&](?![&])");
+			if (match.Success) {
+				var sb = new StringBuilder (value);
+				sb[match.Index] = '_';
+				sb.Replace ("&&", "&");
+				return sb.ToString ();
+			}
+			return value.Replace ("&&", "&");
 		}

 		public static string ConvertMneumonicFromWPF (object obj)
 		{
 			var value = obj as string;
 			if (value == null)
-				return null;
-			return Regex.Replace (value, "(?<![_])[_]", (match) => {
-				if (match.Value == "__")
-					return "_";
-				else
-					return "&"; });
+				return null;
+			var match = Regex.Match (value, @"(?<=([^_](?:[_]{2})*)|^)[_](?![_])");
+			if (match.Success) {
+				var sb = new StringBuilder (value);
+				sb[match.Index] = '&';
+				sb.Replace ("__", "_");
+				return sb.ToString ();
+			}
+			value = value.Replace ("__", "_");
+			return value;
 		}

         public static KeyPressEventArgs ToEto(this swi.KeyEventArgs e, KeyType keyType)


added object Get(string path, object parameters, Type resultType)

--- Source/Facebook/FacebookClient.Sync.cs
+++ Source/Facebook/FacebookClient.Sync.cs
@@ -150,7 +150,19 @@
         [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords")]
         public virtual object Get(string path, object parameters)
         {
-            return Api(HttpMethod.Get, path, parameters, null);
+            return Get(path, parameters, null);
+        }
+
+        /// <summary>
+        /// Makes a GET request to the Facebook server.
+        /// </summary>
+        /// <param name="path">The resource path or the resource url.</param>
+        /// <param name="parameters">The parameters.</param>
+        /// <param name="resultType">The result type.</param>
+        /// <returns>The json result.</returns>
+        public virtual object Get(string path, object parameters, Type resultType)
+        {
+            return Api(HttpMethod.Get, path, parameters, resultType);
         }

         /// <summary>


Remove unneeded test

Remove unneeded test

--- Samples/TestBed/Program.cs
+++ Samples/TestBed/Program.cs
@@ -96,8 +96,6 @@
                   | filterEmpty
                   | writeLine;

-        var x = Proxy.compose(words, filterEmpty | writeLine);
-
         var foldTest1 = repeat(Console<Runtime>.readKeys)
                       | keyChar
                       | words


* Better handling when YouTube/Vimeo video returns Not Found

--- Source/HtmlRenderer/Dom/CssBoxFrame.cs
+++ Source/HtmlRenderer/Dom/CssBoxFrame.cs
@@ -168,90 +168,98 @@
         {
             try
             {
-                var idx = e.Result.IndexOf("\"media$title\"");
-                if (idx > -1)
-                {
-                    idx = e.Result.IndexOf("\"$t\"", idx);
-                    if (idx > -1)
+                if( !e.Cancelled )
+                {
+                    if( e.Error == null )
                     {
-                        idx = e.Result.IndexOf('"', idx+4);
+                        var idx = e.Result.IndexOf("\"media$title\"", StringComparison.Ordinal);
                         if (idx > -1)
                         {
-                            var endIdx = e.Result.IndexOf('"', idx + 1);
-                            while (e.Result[endIdx - 1] == '\\')
-                                endIdx = e.Result.IndexOf('"', endIdx + 1);
-                            if (endIdx > -1)
-                            {
-                                _videoTitle = e.Result.Substring(idx + 1, endIdx - idx - 1).Replace("\\\"","\"");
-                            }
-                        }
-                    }
-                }
-
-                idx = e.Result.IndexOf("\"media$thumbnail\"");
-                if(idx > -1)
-                {
-                    var iidx = e.Result.IndexOf("sddefault", idx);
-                    if (iidx > -1)
-                    {
-                        if (string.IsNullOrEmpty(Width)) Width = "640px";
-                        if (string.IsNullOrEmpty(Height)) Height = "480px";
+                            idx = e.Result.IndexOf("\"$t\"", idx);
+                            if (idx > -1)
+                            {
+                                idx = e.Result.IndexOf('"', idx + 4);
+                                if (idx > -1)
+                                {
+                                    var endIdx = e.Result.IndexOf('"', idx + 1);
+                                    while (e.Result[endIdx - 1] == '\\')
+                                        endIdx = e.Result.IndexOf('"', endIdx + 1);
+                                    if (endIdx > -1)
+                                    {
+                                        _videoTitle = e.Result.Substring(idx + 1, endIdx - idx - 1).Replace("\\\"", "\"");
+                                    }
+                                }
+                            }
+                        }
+
+                        idx = e.Result.IndexOf("\"media$thumbnail\"", StringComparison.Ordinal);
+                        if (idx > -1)
+                        {
+                            var iidx = e.Result.IndexOf("sddefault", idx);
+                            if (iidx > -1)
+                            {
+                                if (string.IsNullOrEmpty(Width)) Width = "640px";
+                                if (string.IsNullOrEmpty(Height)) Height = "480px";
+                            }
+                            else
+                            {
+                                iidx = e.Result.IndexOf("hqdefault", idx);
+                                if (iidx > -1)
+                                {
+                                    if (string.IsNullOrEmpty(Width)) Width = "480px";
+                                    if (string.IsNullOrEmpty(Height)) Height = "360px";
+                                }
+                                else
+                                {
+                                    iidx = e.Result.IndexOf("mqdefault", idx);
+                                    if (iidx > -1)
+                                    {
+                                        if (string.IsNullOrEmpty(Width)) Width = "320px";
+                                        if (string.IsNullOrEmpty(Height)) Height = "180px";
+                                    }
+                                    else
+                                    {
+                                        iidx = e.Result.IndexOf("default", idx);
+                                        if (string.IsNullOrEmpty(Width)) Width = "120px";
+                                        if (string.IsNullOrEmpty(Height)) Height = "90px";
+                                    }
+                                }
+                            }
+
+                            iidx = e.Result.LastIndexOf("http:", iidx, StringComparison.Ordinal);
+                            if (iidx > -1)
+                            {
+                                var endIdx = e.Result.IndexOf('"', iidx);
+                                if (endIdx > -1)
+                                {
+                                    _videoImageUrl = e.Result.Substring(iidx, endIdx - iidx).Replace("\\\"", "\"").Replace("\\", "");
+                                }
+                            }
+                        }
+
+                        idx = e.Result.IndexOf("\"link\"", StringComparison.Ordinal);
+                        if (idx > -1)
+                        {
+                            idx = e.Result.IndexOf("http:", idx);
+                            if (idx > -1)
+                            {
+                                var endIdx = e.Result.IndexOf('"', idx);
+                                if (endIdx > -1)
+                                {
+                                    _videoLinkUrl = e.Result.Substring(idx, endIdx - idx).Replace("\\\"", "\"").Replace("\\", "");
+                                }
+                            }
+                        }
                     }
                     else
                     {
-                        iidx = e.Result.IndexOf("hqdefault", idx);
-                        if (iidx > -1)
-                        {
-                            if (string.IsNullOrEmpty(Width)) Width = "480px";
-                            if (string.IsNullOrEmpty(Height)) Height = "360px";
-                        }
-                        else
-                        {
-                            iidx = e.Result.IndexOf("mqdefault", idx);
-                            if (iidx > -1)
-                            {
-                                if (string.IsNullOrEmpty(Width)) Width = "320px";
-                                if (string.IsNullOrEmpty(Height)) Height = "180px";
-                            }
-                            else
-                            {
-                                iidx = e.Result.IndexOf("default", idx);
-                                if (string.IsNullOrEmpty(Width)) Width = "120px";
-                                if (string.IsNullOrEmpty(Height)) Height = "90px";
-                            }
-                        }
+                        HandleDataLoadFailure(e.Error, "YouTube");
                     }
-
-                    iidx = e.Result.LastIndexOf("http:", iidx);
-                    if(iidx > -1)
-                    {
-                        var endIdx = e.Result.IndexOf('"', iidx);
-                        if(endIdx > -1)
-                        {
-                            _videoImageUrl = e.Result.Substring(iidx, endIdx - iidx).Replace("\\\"", "\"").Replace("\\", "");
-                        }
-                    }
-                }
-
-                idx = e.Result.IndexOf("\"link\"");
-                if (idx > -1)
-                {
-                    idx = e.Result.IndexOf("http:", idx);
-                    if (idx > -1)
-                    {
-                        var endIdx = e.Result.IndexOf('"', idx);
-                        if (endIdx > -1)
-                        {
-                            _videoLinkUrl = e.Result.Substring(idx, endIdx - idx).Replace("\\\"", "\"").Replace("\\", "");
-                        }
-                    }
                 }
             }
             catch (Exception ex)
             {
-                _imageLoadingComplete = true;
-                SetErrorBorder();
-                HtmlContainer.ReportError(HtmlRenderErrorType.Iframe, "Failed to parse youtube video response", ex);
+                HtmlContainer.ReportError(HtmlRenderErrorType.Iframe, "Failed to parse YouTube video response", ex);
             }

             HandlePostApiCall(sender);
@@ -290,76 +298,111 @@
         {
             try
             {
-                var idx = e.Result.IndexOf("\"title\"");
-                if (idx > -1)
-                {
-                    idx = e.Result.IndexOf('"', idx + 7);
-                    if (idx > -1)
+                if( !e.Cancelled )
+                {
+                    if( e.Error == null )
                     {
-                        var endIdx = e.Result.IndexOf('"', idx + 1);
-                        while (e.Result[endIdx - 1] == '\\')
-                            endIdx = e.Result.IndexOf('"', endIdx + 1);
-                        if (endIdx > -1)
-                        {
-                            _videoTitle = e.Result.Substring(idx + 1, endIdx - idx - 1).Replace("\\\"", "\"");
-                        }
-                    }
-                }
-
-                idx = e.Result.IndexOf("\"thumbnail_large\"");
-                if (idx > -1)
-                {
-                    if (string.IsNullOrEmpty(Width)) Width = "640";
-                    if (string.IsNullOrEmpty(Height)) Height = "360";
-                }
-                else
-                {
-                    idx = e.Result.IndexOf("thumbnail_medium", idx);
-                    if (idx > -1)
-                    {
-                        if (string.IsNullOrEmpty(Width)) Width = "200";
-                        if (string.IsNullOrEmpty(Height)) Height = "150";
+                        var idx = e.Result.IndexOf("\"title\"", StringComparison.Ordinal);
+                        if( idx > -1 )
+                        {
+                            idx = e.Result.IndexOf('"', idx + 7);
+                            if( idx > -1 )
+                            {
+                                var endIdx = e.Result.IndexOf('"', idx + 1);
+                                while( e.Result[endIdx - 1] == '\\' )
+                                    endIdx = e.Result.IndexOf('"', endIdx + 1);
+                                if( endIdx > -1 )
+                                {
+                                    _videoTitle = e.Result.Substring(idx + 1, endIdx - idx - 1).Replace("\\\"", "\"");
+                                }
+                            }
+                        }
+
+                        idx = e.Result.IndexOf("\"thumbnail_large\"", StringComparison.Ordinal);
+                        if( idx > -1 )
+                        {
+                            if( string.IsNullOrEmpty(Width) )
+                                Width = "640";
+                            if( string.IsNullOrEmpty(Height) )
+                                Height = "360";
+                        }
+                        else
+                        {
+                            idx = e.Result.IndexOf("thumbnail_medium", idx);
+                            if( idx > -1 )
+                            {
+                                if( string.IsNullOrEmpty(Width) )
+                                    Width = "200";
+                                if( string.IsNullOrEmpty(Height) )
+                                    Height = "150";
+                            }
+                            else
+                            {
+                                idx = e.Result.IndexOf("thumbnail_small", idx);
+                                if( string.IsNullOrEmpty(Width) )
+                                    Width = "100";
+                                if( string.IsNullOrEmpty(Height) )
+                                    Height = "75";
+                            }
+                        }
+                        if( idx > -1 )
+                        {
+                            idx = e.Result.IndexOf("http:", idx);
+                            if( idx > -1 )
+                            {
+                                var endIdx = e.Result.IndexOf('"', idx);
+                                if( endIdx > -1 )
+                                {
+                                    _videoImageUrl = e.Result.Substring(idx, endIdx - idx).Replace("\\\"", "\"").Replace("\\", "");
+                                }
+                            }
+                        }
+
+                        idx = e.Result.IndexOf("\"url\"", StringComparison.Ordinal);
+                        if( idx > -1 )
+                        {
+                            idx = e.Result.IndexOf("http:", idx);
+                            if( idx > -1 )
+                            {
+                                var endIdx = e.Result.IndexOf('"', idx);
+                                if( endIdx > -1 )
+                                {
+                                    _videoLinkUrl = e.Result.Substring(idx, endIdx - idx).Replace("\\\"", "\"").Replace("\\", "");
+                                }
+                            }
+                        }
                     }
                     else
                     {
-                        idx = e.Result.IndexOf("thumbnail_small", idx);
-                        if (string.IsNullOrEmpty(Width)) Width = "100";
-                        if (string.IsNullOrEmpty(Height)) Height = "75";
+                        HandleDataLoadFailure(e.Error, "Vimeo");
                     }
                 }
-                if(idx > -1)
-                {
-                    idx = e.Result.IndexOf("http:", idx);
-                    if (idx > -1)
-                    {
-                        var endIdx = e.Result.IndexOf('"', idx);
-                        if (endIdx > -1)
-                        {
-                            _videoImageUrl = e.Result.Substring(idx, endIdx - idx).Replace("\\\"", "\"").Replace("\\", "");
-                        }
-                    }
-                }
-
-                idx = e.Result.IndexOf("\"url\"");
-                if (idx > -1)
-                {
-                    idx = e.Result.IndexOf("http:", idx);
-                    if (idx > -1)
-                    {
-                        var endIdx = e.Result.IndexOf('"', idx);
-                        if (endIdx > -1)
-                        {
-                            _videoLinkUrl = e.Result.Substring(idx, endIdx - idx).Replace("\\\"", "\"").Replace("\\", "");
-                        }
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                HtmlContainer.ReportError(HtmlRenderErrorType.Iframe, "Failed to parse vimeo video response", ex);
+            }
+            catch(Exception ex)
+            {
+                HtmlContainer.ReportError(HtmlRenderErrorType.Iframe, "Failed to parse Vimeo video response", ex);
             }

             HandlePostApiCall(sender);
+        }
+
+        /// <summary>
+        /// Handle error occurred during video data load to handle if the video was not found.
+        /// </summary>
+        /// <param name="ex">the exception that occurred during data load web request</param>
+        /// <param name="source">the name of the video source (YouTube/Vimeo/Etc.)</param>
+        private void HandleDataLoadFailure(Exception ex, string source)
+        {
+            var webError = ex as WebException;
+            var webResponse = webError != null ? webError.Response as HttpWebResponse : null;
+            if( webResponse != null && webResponse.StatusCode == HttpStatusCode.NotFound )
+            {
+                _videoTitle = "The video is not found, possibly removed by the user.";
+            }
+            else
+            {
+                HtmlContainer.ReportError(HtmlRenderErrorType.Iframe, "Failed to load " + source + " video data", ex);
+            }
         }

         /// <summary>


Forgot a Windows Phone 8 check - fixed now

--- Scripts/LanguageManager.cs
+++ Scripts/LanguageManager.cs
@@ -534,19 +534,24 @@
 			Debug.LogWarning("LanguageManager.cs: The system language of this application is Unknown");
 			return "Unknown";
 		}
-
+
 		string systemLanguage = Application.systemLanguage.ToString();
+#if !UNITY_WP8
 		CultureInfo[] cultureInfos = CultureInfo.GetCultures(CultureTypes.AllCultures);
 		foreach(CultureInfo info in cultureInfos)
 		{
 			if(info.EnglishName == systemLanguage)
 			{
-				return info.Name;
+				return info.Name;
 			}
 		}
-
+
 		Debug.LogError("LanguageManager.cs: A system language of this application is could not be found!");
 		return "System Language not found!";
+#else
+		Debug.LogError("LanguageManager.cs: GetSystemLanguage() Feature is not currently available in Smart Localization for Windows Phone 8");
+		return defaultLanguage;
+#endif
 	}
 	/// <summary>
 	/// Gets the culture info of the specified string


First commit

First commit


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Server/WebSocketServiceManager.cs
+++ websocket-sharp/Server/WebSocketServiceManager.cs
@@ -686,22 +686,53 @@
     }

     /// <summary>
-    /// Sends binary data from the specified <see cref="Stream"/> asynchronously to
+    /// Sends the specified <paramref name="length"/> of data from
+    /// the specified <paramref name="stream"/> asynchronously to
     /// every client in the WebSocket services.
     /// </summary>
     /// <remarks>
-    /// This method doesn't wait for the send to be complete.
+    /// This method does not wait for the send to be complete.
     /// </remarks>
     /// <param name="stream">
-    /// A <see cref="Stream"/> from which contains the binary data to send.
+    /// A <see cref="Stream"/> from which reads the binary data to send.
     /// </param>
     /// <param name="length">
-    /// An <see cref="int"/> that represents the number of bytes to send.
+    /// An <see cref="int"/> that specifies the number of bytes to
+    /// read and send.
     /// </param>
     /// <param name="completed">
-    /// An <see cref="Action"/> delegate that references the method(s) called when
-    /// the send is complete.
-    /// </param>
+    ///   <para>
+    ///   An <see cref="Action"/> delegate or
+    ///   <see langword="null"/> if not needed.
+    ///   </para>
+    ///   <para>
+    ///   That delegate invokes the method called when
+    ///   the send is complete.
+    ///   </para>
+    /// </param>
+    /// <exception cref="InvalidOperationException">
+    /// The current state of the manager is not Start.
+    /// </exception>
+    /// <exception cref="ArgumentNullException">
+    /// <paramref name="stream"/> is <see langword="null"/>.
+    /// </exception>
+    /// <exception cref="ArgumentException">
+    ///   <para>
+    ///   <paramref name="stream"/> cannot be read.
+    ///   </para>
+    ///   <para>
+    ///   -or-
+    ///   </para>
+    ///   <para>
+    ///   <paramref name="length"/> is less than 1.
+    ///   </para>
+    ///   <para>
+    ///   -or-
+    ///   </para>
+    ///   <para>
+    ///   No data could be read from <paramref name="stream"/>.
+    ///   </para>
+    /// </exception>
     public void BroadcastAsync (Stream stream, int length, Action completed)
     {
       if (_state != ServerState.Start) {


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Server/WebSocketServiceManager.cs
+++ websocket-sharp/Server/WebSocketServiceManager.cs
@@ -323,12 +323,14 @@

     internal bool Remove (string path)
     {
+      path = HttpUtility.UrlDecode (path).TrimEndSlash ();
+
       WebSocketServiceHost host;
       lock (_sync) {
-        path = HttpUtility.UrlDecode (path).TrimEndSlash ();
         if (!_hosts.TryGetValue (path, out host)) {
           _logger.Error (
-            "A WebSocket service with the specified path isn't found:\n  path: " + path);
+            "A WebSocket service with the specified path could not be found."
+          );

           return false;
         }
@@ -337,7 +339,7 @@
       }

       if (host.State == ServerState.Start)
-        host.Stop ((ushort) CloseStatusCode.Away, null);
+        host.Stop (1001, String.Empty);

       return true;
     }


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Server/WebSocketServiceManager.cs
+++ websocket-sharp/Server/WebSocketServiceManager.cs
@@ -132,7 +132,7 @@
     /// </exception>
     /// <exception cref="ArgumentException">
     ///   <para>
-    ///   <paramref name="path"/> is empty.
+    ///   <paramref name="path"/> is an empty string.
     ///   </para>
     ///   <para>
     ///   -or-


Additional documentation/comments to the search class.

--- notepad/Search.cs
+++ notepad/Search.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Text.RegularExpressions;
 using System.Windows.Forms;

@@ -23,6 +22,11 @@
 			mainWindow = main;
 		}

+		/// <summary>
+		/// Iterate through the list - this goes forwards though the list and increments the current item by one
+		/// </summary>
+		/// <param name="sender"></param>
+		/// <param name="e"></param>
 		private void next_Click(object sender, EventArgs e) {
 			if(current == (found.Count - 1)) {
 				return;	// should never actually be hit.
@@ -35,6 +39,11 @@
 			mainWindow.BringToFront();
 		}

+		/// <summary>
+		/// Iterate through the list - this goes backwards though the list and decrements the current item by one
+		/// </summary>
+		/// <param name="sender"></param>
+		/// <param name="e"></param>
 		private void previous_Click(object sender, EventArgs e) {
 			if(current == 0) {
 				return; // should never actually be hit.
@@ -47,11 +56,13 @@
 			mainWindow.BringToFront();
 		}

+		/// <summary>
+		/// Runs the regex over the textbox with the text to find, then calls relevant functions to complete the task. Only works if there are more than 1 results found, and that the text is not empty/spaces.
+		/// </summary>
 		private void searchButton_Click(object sender, EventArgs e) {
 			var match = new Regex(textToFind.Text);
 			var results = match.Matches(textbox.Text);

-
 			if(textToFind.Equals(' ') || String.IsNullOrWhiteSpace(textToFind.Text)) {
 				MessageBox.Show("Please enter some text to find.");
 				return;	// should also handle this, with a message box or something.
@@ -66,11 +77,19 @@
 			}
 		}

+		/// <summary>
+		/// Selects the text inside the textbox
+		/// </summary>
+		/// <param name="start">The start index of the word found</param>
+		/// <param name="length">The length of the word</param>
 		private void SetTextBoxSelection(int start, int length) {
 			textbox.SelectionStart = start;
 			textbox.SelectionLength = length;
 		}

+		/// <summary>
+		/// Sets the next & previous buttons to be enabled or disabled depending on where they are in the list.
+		/// </summary>
 		private void SetButtons() {
 			if(current == (found.Count - 1) && (found.Count > 1)) {
 				previous.Enabled = true;
@@ -81,6 +100,12 @@
 			}
 		}

+		/// <summary>
+		/// Creates a new search result object with the correct position and length
+		/// </summary>
+		/// <param name="position">Position of the first character</param>
+		/// <param name="length">Length of the word</param>
+		/// <returns>SearchResult object with relevant position and length</returns>
 		private SearchResult CreateResult(int position, int length) {
 			return new SearchResult {
 				Postition = position,
@@ -88,12 +113,21 @@
 			};
 		}

+		/// <summary>
+		/// Used to simulate a click of the search button if enter is pressed.
+		/// </summary>
+		/// <param name="sender">Object textbox</param>
+		/// <param name="e">KeyPressEventArgs</param>
 		private void textToFind_KeyPress(object sender, KeyPressEventArgs e) {
 			if(e.KeyChar == (char)Keys.Enter) {
 				searchButton.PerformClick();	// simulate a mouse click if return is pressed.
 			}
 		}

+		/// <summary>
+		/// Cycles through the matches of the Regex, adds the results to a list, then sets the default buttons, and selection of the textbox.
+		/// </summary>
+		/// <param name="match"></param>
 		private void FoundResults(MatchCollection match) {
 			var index = 0;
 			foreach (Match item in match) {


Adding more tests for MoveDeclarationNearReference

--- src/EditorFeatures/CSharpTest/MoveDeclarationNearReference/MoveDeclarationNearReferenceTests.cs
+++ src/EditorFeatures/CSharpTest/MoveDeclarationNearReference/MoveDeclarationNearReferenceTests.cs
@@ -1393,5 +1393,67 @@
     }
 }");
         }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsMoveDeclarationNearReference)]
+        public async Task TestUsedInMultipleSwitchSections_MoveToSwitchStatement()
+        {
+            await TestInRegularAndScriptAsync(
+@"class C
+{
+    void M()
+    {
+        int [||]x;
+        System.Console.WriteLine();
+        switch (true)
+        {
+            case true:
+                x = 0;
+                break;
+            case false:
+                x = 0;
+                break;
+        }
+    }
+}",
+@"class C
+{
+    void M()
+    {
+        System.Console.WriteLine();
+        int x;
+        switch (true)
+        {
+            case true:
+                x = 0;
+                break;
+            case false:
+                x = 0;
+                break;
+        }
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsMoveDeclarationNearReference)]
+        public async Task TestUsedInMultipleSwitchSections_CannotMove()
+        {
+            await TestMissingInRegularAndScriptAsync(
+@"class C
+{
+    void M()
+    {
+        int [||]x;
+        switch (true)
+        {
+            case true:
+                x = 0;
+                break;
+            case false:
+                x = 0;
+                break;
+        }
+    }
+}");
+        }
     }
 }


#28882 Set up demo environment for da.dk

--- Safewhere.Samples.STS/Safewhere.Samples.STS.WebsiteDemo/LogAction.cs
+++ Safewhere.Samples.STS/Safewhere.Samples.STS.WebsiteDemo/LogAction.cs
@@ -43,8 +43,7 @@

         #region IAction Members

-        public void LoginAction(AbstractEndpointHandler handler, HttpContext context,
-            dk.nita.saml20.Saml20Assertion assertion)
+        public void LoginAction(AbstractEndpointHandler handler, HttpContext context, Saml20Assertion assertion)
         {
             if (handler == null)
             {
@@ -61,9 +60,6 @@
                 Logging.Instance.Error("SamlPrincipalAction - LogOnAction assertion is null");
                 throw new ArgumentNullException("assertion");
             }
-            //var idpEndpoint = handler.GetEndpoint((string)context.Session[AbstractEndpointHandler.IdpTempSessionKey]);
-            //Logging.Instance.Information("SamlPricipalAction - LogOnAction: idpEndpoint Id = {0}, Name = {1} OmitAssertionSignatureCheck = {2}", idpEndpoint.Id, idpEndpoint.Name, idpEndpoint.OmitAssertionSignatureCheck);
-
             Saml2SecurityTokenHandler securityTokenHandler =
                 this.sessionAuthModule.FederationConfiguration.IdentityConfiguration.SecurityTokenHandlers[
                     typeof (Saml2SecurityToken)] as Saml2SecurityTokenHandler;
@@ -72,37 +68,17 @@
             if (securityTokenHandler != null)
             {
                 var assertionXml = assertion.XmlAssertion;
-                System.IO.StringReader reader = new System.IO.StringReader(assertionXml.OuterXml);
-                XmlReader xReader = XmlReader.Create(reader);
-                var bootstraptoken = securityTokenHandler.ReadToken(xReader);
-                HttpContext.Current.Session["boostraptoken"] = bootstraptoken;
+                using (System.IO.StringReader reader = new System.IO.StringReader(assertionXml.OuterXml))
+                {
+                    XmlReader xReader = XmlReader.Create(reader);
+                    var bootstraptoken = securityTokenHandler.ReadToken(xReader);
+                    HttpContext.Current.Session["boostraptoken"] = bootstraptoken;
+                }
             }
-
-            //var nameClaimType = SamlPrincipalAction.DetermineNameClaimType(idpEndpoint, securityTokenHandler);
-            //var roleClaimType = SamlPrincipalAction.DetermineRoleClaimType(idpEndpoint, securityTokenHandler);
-            //Logging.Instance.Information("SamlPricipalAction - LogOnAction: nameClaimType = {0}, roleClaimType = {1}", nameClaimType, roleClaimType);
-
-            //DateTime validTo;
-            //if (assertion.Conditions != null && assertion.Conditions.NotOnOrAfter.HasValue)
-            //{
-            //    Logging.Instance.Information("Creating CreateSessionSecurityToken. Assertion.Conditions.NotOnOrAfter exists. Use it for validTo.");
-            //    validTo = assertion.Conditions.NotOnOrAfter.Value;
-            //}
-            //else
-            //{
-            //    Logging.Instance.Information("Creating CreateSessionSecurityToken. Either Assertion.Conditions is null or its NotOnOrAfter doesn't exist. Use UtcNow + SessionSecurityTokenHandler.DefaultTokenLifetime for validTo.");
-            //    validTo = DateTime.UtcNow + SessionSecurityTokenHandler.DefaultTokenLifetime;
-            //}
-
-            var principal = BuildClaimsPrincipal(assertion);
-
-            //var sessionSecurityToken = this.sessionAuthModule.CreateSessionSecurityToken(principal, string.Empty, DateTime.UtcNow, validTo, false);
-            //this.sessionAuthModule.AuthenticateSessionSecurityToken(sessionSecurityToken, true);
-
-            //SaveNameId(context, assertion);
+            BuildClaimsPrincipal(assertion);
         }

-        private ClaimsPrincipal BuildClaimsPrincipal(dk.nita.saml20.Saml20Assertion assertion)
+        private void BuildClaimsPrincipal(Saml20Assertion assertion)
         {
             Saml2Assertion bootstrapAssertion = CreateSaml2Assertion(assertion);

@@ -130,13 +106,12 @@
                 }
             }
             claimsPrincipal.AddIdentity(claimsIdentity);
-            //ClaimsPrincipal.Current.AddIdentity(claimsIdentity);
             if (string.IsNullOrEmpty(claimsPrincipal.Identity.Name))
             {
                 throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "No value set for NameClaimType: '{0}'", claimsIdentity.NameClaimType));
             }

-            return claimsPrincipal;
+            return;
         }

         private Saml2Assertion CreateSaml2Assertion(Saml20Assertion assertion)
@@ -149,17 +124,6 @@
             }
             result.Statements.Add(new Saml2AttributeStatement(attributes));
             return result;
-        }
-
-        private static void SaveNameId(HttpContext context, dk.nita.saml20.Saml20Assertion assertion)
-        {
-            if (assertion.Subject != null &&
-                !string.IsNullOrEmpty(assertion.Subject.Value))
-            {
-                string nameId = assertion.Subject.Value;
-                Logging.Instance.Information("SamlPrincipalAction - SaveNameId nameId = {0}", nameId);
-                context.Session["http://www.oasis-open.org/committees/security"] = nameId;
-            }
         }

         public void LogoutAction(AbstractEndpointHandler handler, HttpContext context,


RandomRoutes was renamed.

RandomRoutes was renamed.

--- src/Itinero.Optimization/Abstract/Solvers/VRP/Operators/Relocate/Multi/MultiRelocateOperator.cs
+++ src/Itinero.Optimization/Abstract/Solvers/VRP/Operators/Relocate/Multi/MultiRelocateOperator.cs
@@ -67,7 +67,7 @@
         public bool Apply(TProblem problem, TObjective objective, TSolution solution, out float delta)
         {
             int t1, t2;
-            if (!RandomGeneratorExtensions.randomRoutes(solution.Count, out t1, out t2))
+            if (!RandomGeneratorExtensions.RandomRoutes(solution.Count, out t1, out t2))
             {
                 delta = 0;
                 return false;


Fix Not implemented exception from DoNotHideBaseClassMethods.Fixer

Fixes #1692

--- src/Microsoft.CodeQuality.Analyzers/Core/ApiDesignGuidelines/DoNotHideBaseClassMethods.Fixer.cs
+++ src/Microsoft.CodeQuality.Analyzers/Core/ApiDesignGuidelines/DoNotHideBaseClassMethods.Fixer.cs
@@ -20,11 +20,10 @@
             return WellKnownFixAllProviders.BatchFixer;
         }

-        public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
+        public sealed override Task RegisterCodeFixesAsync(CodeFixContext context)
         {
-            // This is to get rid of warning CS1998, please remove when implementing this analyzer
-            await Task.Run(() => { }).ConfigureAwait(false);
-            throw new NotImplementedException();
+            // Fixer not yet implemented.
+            return Task.CompletedTask;
         }
     }
 }


minor UI fix to show index columns in order of actual generation

--- Source/nHydrate.Dsl/Overrides/Index.cs
+++ Source/nHydrate.Dsl/Overrides/Index.cs
@@ -142,21 +142,21 @@
 			base.OnDeleting();
 		}

-		public override string ToString()
-		{
-			var retval = string.Empty;
-			foreach (var ic in this.IndexColumns)
-			{
-				var f = this.Entity.Fields.FirstOrDefault(x => x.Id == ic.FieldID);
-				if (retval.Length > 0)
-					retval += ",";
-				if (f == null)
-					retval += "(Unknown)";
-				else
-					retval += f;
-			}
-			return retval;
-		}
+        public override string ToString()
+        {
+            var retval = string.Empty;
+            foreach (var ic in this.IndexColumns.OrderBy(x => x.SortOrder).ThenBy(x => x.Field.Name))
+            {
+                var f = this.Entity.Fields.FirstOrDefault(x => x.Id == ic.FieldID);
+                if (retval.Length > 0)
+                    retval += ",";
+                if (f == null)
+                    retval += "(Unknown)";
+                else
+                    retval += f;
+            }
+            return retval;
+        }

 		#region IModuleLink


Revert "Fix previous sample channels not immediately freed on new playbacks"

This reverts commit 4e5b65e9da3c975cf37535fb4c565f12d895f8f6.

--- osu.Framework/Audio/Sample/SampleChannelBass.cs
+++ osu.Framework/Audio/Sample/SampleChannelBass.cs
@@ -91,11 +91,11 @@
                     return;
                 }

-                // Free previous channels as we're creating a new channel for every playback, since old channels
-                // may be overriden when too many other channels are created from the same sample.
-                if (Bass.ChannelIsActive(channel) != PlaybackState.Stopped)
-                    Bass.ChannelStop(channel);
+                // Remove looping flag from previous channel to prevent endless playback
+                setLoopFlag(false);

+                // We are creating a new channel for every playback, since old channels may
+                // be overridden when too many other channels are created from the same sample.
                 channel = ((SampleBass)Sample).CreateChannel();

                 Bass.ChannelSetAttribute(channel, ChannelAttribute.NoRamp, 1);


Prioritise FrameworkActionContainer input

--- osu.Framework/Input/FrameworkActionContainer.cs
+++ osu.Framework/Input/FrameworkActionContainer.cs
@@ -18,6 +18,8 @@
             new KeyBinding(new[] { InputKey.Alt, InputKey.Enter }, FrameworkAction.ToggleFullscreen),
         };

+        protected override bool Prioritised => true;
+
         protected override IEnumerable<Drawable> KeyBindingInputQueue => new[] { Child }.Concat(base.KeyBindingInputQueue);
     }


Remove empty line

Remove empty line

--- osu.Game/Overlays/Comments/CommentsContainer.cs
+++ osu.Game/Overlays/Comments/CommentsContainer.cs
@@ -183,7 +183,6 @@
                     moreButton.IsLoading = false;
                 }
                 moreButton.FadeTo(response.HasMore ? 1 : 0);
-
             }, loadCancellation.Token);
         }


Logic fix.

Logic fix.

--- SharpPlugins/PluginBase.cs
+++ SharpPlugins/PluginBase.cs
@@ -17,7 +17,7 @@
         public static string GetAuthor(Type type)
         {
             var attribute = getAttribute(type);
-            return attribute == null ? string.Empty : attribute.Author != null ? string.Empty : attribute.Author;
+            return attribute == null ? string.Empty : attribute.Author == null ? string.Empty : attribute.Author;
         }

         /// <summary>
@@ -28,7 +28,7 @@
         public static string GetDescription(Type type)
         {
             var attribute = getAttribute(type);
-            return attribute == null ? string.Empty : attribute.Description != null ? string.Empty : attribute.Description;
+            return attribute == null ? string.Empty : attribute.Description == null ? string.Empty : attribute.Description;
         }

         /// <summary>
@@ -39,7 +39,7 @@
         public static string GetName(Type type)
         {
             var attribute = getAttribute(type);
-            return attribute == null ? string.Empty : attribute.Name != null ? string.Empty : attribute.Name;
+            return attribute == null ? string.Empty : attribute.Name == null ? string.Empty : attribute.Name;
         }

         /// <summary>
@@ -50,7 +50,7 @@
         public static string GetVersion(Type type)
         {
             var attribute = getAttribute(type);
-            return attribute == null ? string.Empty : attribute.Version != null ? string.Empty : attribute.Version;
+            return attribute == null ? string.Empty : attribute.Version == null ? string.Empty : attribute.Version;
         }

         /// <summary>