quick cleanup

quick cleanup

--- typesystem/TypeSystem.cs
+++ typesystem/TypeSystem.cs
@@ -1,264 +1,15 @@
 using System;
 using Typesystem.ValueTypes;

-namespace A
-{
-	public partial class A
-	{
-	}
-}
-
-namespace B
-{
-	public partial class A
-	{
-	}
-}
-
-
-
 namespace typesystem
 {
-	public class TypeSystem
+	public static class TypeSystem
 	{

 		public static void Main()
 		{
 			ValueTypesInitialization.example();
 			ValueTypeAliases.example();
-
-
-
-			/*
-			System.Console.WriteLine("Type system");
-
-			// value type: alias
-			int integerAlias = 12;
-			// corresponding .net type
-			System.Int32 integerType = 12;
-
-			System.Console.WriteLine(integerType == integerAlias);
-
-
-			// you cannot use unasigned alias type
-			int unasignedAlias = new int();
-			System.Console.WriteLine(unasignedAlias);
-			// you can use unasigned .net type beacuse it is reference type
-			System.Int32 unasignedType = new System.Int32();
-			System.Console.WriteLine(unasignedType.GetTypeCode());
-
-			Student stud = new Student();
-			System.Console.WriteLine(stud);
-
-
-			System.Console.WriteLine(Enum.GetName(typeof(Dummy), 2));
-
-			Console.WriteLine((12.1).GetType());
-
-			Student s;
-			s.firstName = "a";
-			s.lastName = "b";
-			Console.WriteLine(s);
-
-			WithClass aaa = new WithClass();
-			WithClass bbb = new WithClass(1, new Empty());
-			WithClass ccc;
-			ccc.foo = 1;
-			ccc.empty = new Empty();
-
-			System.Console.WriteLine(aaa);
-			System.Console.WriteLine(bbb);
-			System.Console.WriteLine(ccc);
-
-			Dummy a = (Dummy)17;
-			Console.WriteLine(a);
-
-			Movable movable = new Movable(1);
-			Console.WriteLine("Movable initial id=" + movable.getId());
-			Switcher switcher = new Switcher();
-			switcher.switchMovable(movable);
-			Console.WriteLine("Movable initial id=" + movable.getId());
-
-			// all positional args
-			methodCall(1, 2, 3, 4);
-
-			// all named args
-			methodCall(a: 1, c: 3, b: 2, d: 1);
-
-			// mixed positional with namedd
-			methodCall(1, 2, d: 3, c: 4);
-
-			int aaaa = 1;
-			int bbbb = 2;
-			Console.WriteLine("aaaa = " + aaaa);
-			passByReference<int>(ref aaaa, bbbb);
-			Console.WriteLine("aaaa= " + aaaa);
-
-			// casting between int and object
-			object o;
-			int i = 1;
-			o = i;
-			object oo = 1;
-
-			var strangeArray = Array.CreateInstance(typeof(Object), new int[] { 2 }, new int[] { 9 });
-
-			IndexedClass ic = new IndexedClass();
-			int iaaaa = ic[1, 2, 3];
-
-			bool result = 2 == null;
-			*/
-		}
-
-
-
-		public static void methodCall(int a, int b, int c, int d)
-		{
-		}
-
-		public static void sampleGeneric<T>()
-		{
-			T t = default(T);
-		}
-
-		public static void passByReference<T>(ref T a, T b)
-		{
-			a = b;
 		}
 	}
-
-	public class GenType<T> where T : propsClass, new()
-	{
-	}
-
-	public class propsClass
-	{
-		private int a;
-
-		public int ValueA
-		{
-			get
-			{
-				bar();
-				return foo();
-			}
-		}
-
-		private void bar()
-		{
-		}
-
-		private int foo()
-		{
-			return 1;
-		}
-
-	}
-
-	public class IdCls {
-
-		public string this[int i] => "aa";
-	public int this[string i] => 2;
-
 }
-
-	public class IndexedClass
-	{
-		//public int this[OuterForStatic o] => 1;
-		//public int this[int i] => 2;
-		public int this[int arg1, int arg2, int arg3] => 1;
-
-	}
-
-	public class OuterForStatic
-	{
-		public static class ImplictStatic
-		{
-			public static void foo()
-			{
-			}
-		}
-	}
-
-
-	public class OuterClass
-	{
-		private int privateField = 1;
-
-		public class InnerClass
-		{
-			private OuterClass outer;
-
-			public InnerClass(OuterClass outer)
-			{
-				this.outer = outer;
-			}
-
-			public void printPrivateField()
-			{
-				Console.WriteLine(outer.privateField);
-			}
-		}
-	}
-
-	public enum Dummy
-	{
-		A = 10, B, C
-	};
-
-	public struct Student
-	{
-		public string firstName;
-		public string lastName;
-
-		public Student(string firstName)
-		{
-			this.firstName = firstName;
-			this.lastName = "";
-		}
-	}
-
-	public class Movable
-	{
-		private int id;
-
-		public Movable(int id)
-		{
-			this.id = id;
-		}
-
-		public int getId()
-		{
-			return id;
-
-		}
-	}
-
-	public class Switcher
-	{
-		public void switchMovable( Movable movable) {
-			movable = new Movable(100);
-			Console.WriteLine("Internal movable id=" + movable.getId());
-		}
-	}
-
-
-
-
-	public class Empty {
-
-
-	}
-
-	public struct WithClass
-	{
-		public int foo;
-		public Empty empty;
-
-		public WithClass(int foo, Empty empty)
-		{
-			this.foo = foo;
-			this.empty = empty;
-		}
-	}
-
-}


测试将日志查看操作记录到日志中

测试将日志查看操作记录到日志中

--- 软件系统服务端模版/Form1.cs
+++ 软件系统服务端模版/Form1.cs
@@ -432,38 +432,46 @@
             if (headCode == CommonHeadCode.SimplifyHeadCode.网络日志查看)
             {
                 net_simplify_server.SendMessage(object1, net_socket_server.LogHelper.GetLogText());
+                RuntimeLogHelper.SaveInformation("网络日志查看");
             }
             else if (headCode == CommonHeadCode.SimplifyHeadCode.网络日志清空)
             {
                 net_socket_server.LogHelper.ClearLogText();
                 net_simplify_server.SendMessage(object1, "成功");
+                RuntimeLogHelper.SaveWarnning("网络日志清空");
             }
             else if (headCode == CommonHeadCode.SimplifyHeadCode.同步日志查看)
             {
                 net_simplify_server.SendMessage(object1, net_simplify_server.LogHelper.GetLogText());
+                RuntimeLogHelper.SaveInformation("同步日志查看");
             }
             else if (headCode == CommonHeadCode.SimplifyHeadCode.同步日志清空)
             {
                 net_simplify_server.LogHelper.ClearLogText();
                 net_simplify_server.SendMessage(object1, "成功");
+                RuntimeLogHelper.SaveWarnning("同步日志清空");
             }
             else if (headCode == CommonHeadCode.SimplifyHeadCode.更新日志查看)
             {
                 net_simplify_server.SendMessage(object1, net_soft_update_Server.LogHelper.GetLogText());
+                RuntimeLogHelper.SaveInformation("更新日志查看");
             }
             else if (headCode == CommonHeadCode.SimplifyHeadCode.更新日志清空)
             {
                 net_soft_update_Server.LogHelper.ClearLogText();
                 net_simplify_server.SendMessage(object1, "成功");
+                RuntimeLogHelper.SaveWarnning("更新日志清空");
             }
             else if (headCode == CommonHeadCode.SimplifyHeadCode.运行日志查看)
             {
                 net_simplify_server.SendMessage(object1, RuntimeLogHelper.GetLogText());
+                RuntimeLogHelper.SaveInformation("运行日志查看");
             }
             else if (headCode == CommonHeadCode.SimplifyHeadCode.运行日志清空)
             {
                 RuntimeLogHelper.ClearLogText();
                 net_simplify_server.SendMessage(object1, "成功");
+                RuntimeLogHelper.SaveInformation("运行日志清空");
             }
             else
             {
@@ -751,7 +759,14 @@
         #endregion

-
+        /*********************************************************************************************************
+         *
+         *    说明     日志的使用方式分为4个等级，1.普通 2.信息 3.警告 4.错误  对应的调用方法不一致
+         *    具体     如果想要调用存储[信息]等级日志，调用 RuntimeLogHelper.SaveInformation("等待存储的信息")
+         *    大小     调用10000次存储信息后，日志文件大小在200K左右，需要手动进行情况日志
+         *    注意     在存储信息时不要带有'['和']'这两个字符，会影响日志筛选时的准确性
+         *
+         **********************************************************************************************************/

         /// <summary>
         /// 用来记录一般的事物日志


Fix Module1 to run as independent app

Fix Module1 to run as independent app

--- modules/Module1/Program.cs
+++ modules/Module1/Program.cs
@@ -4,6 +4,8 @@
 using System.Linq;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.AspNetCore.Modules;

 namespace Module1
 {
@@ -14,6 +16,10 @@
             var host = new WebHostBuilder()
                 .UseKestrel()
                 .UseContentRoot(Directory.GetCurrentDirectory())
+                .ConfigureServices(services =>
+                {
+                    services.AddSingleton(new ModuleInstanceIdProvider("Module1"));
+                })
                 .UseStartup<Startup>()
                 .Build();


Extract archive file as asynchronous task

ARKADE-138

--- src/Arkivverket.Arkade.Core/Identify/TestSessionFactory.cs
+++ src/Arkivverket.Arkade.Core/Identify/TestSessionFactory.cs
@@ -1,5 +1,6 @@
 using System;
 using System.IO;
+using System.Threading.Tasks;
 using Arkivverket.Arkade.Core.Base;
 using Arkivverket.Arkade.Core.Base.Addml;
 using Arkivverket.Arkade.Core.Base.Addml.Definitions;
@@ -50,8 +51,10 @@
             WorkingDirectory workingDirectory = WorkingDirectory.FromUuid(uuid);

             TarExtractionStartedEvent();
-            _compressionUtility.ExtractFolderFromArchive(archiveFile.File, workingDirectory.Root().DirectoryInfo());
-            TarExtractionFinishedEvent(workingDirectory);
+
+            Task.Factory.StartNew(() =>
+                _compressionUtility.ExtractFolderFromArchive(archiveFile.File, workingDirectory.Root().DirectoryInfo())
+            ).ContinueWith(t => TarExtractionFinishedEvent(workingDirectory));

             TestSession testSession = NewSession(workingDirectory, archiveFile.ArchiveType, uuid);


Check for method being Private correctly.

--- src/Avalonia.Base/Data/Converters/DefaultValueConverter.cs
+++ src/Avalonia.Base/Data/Converters/DefaultValueConverter.cs
@@ -33,7 +33,7 @@

             if (typeof(ICommand).IsAssignableFrom(targetType) && value is Delegate d && d.Method.GetParameters().Length <= 1)
             {
-                if (d.Method.Attributes.HasFlag(System.Reflection.MethodAttributes.Private) == false)
+                if (d.Method.IsPrivate == false)
                 {
                     return new MethodToCommandConverter(d);
                 }


Fix #3 again

Fix #3 again

--- src/ChessVariantsTraining/Models/EndgameTrainingSession.cs
+++ src/ChessVariantsTraining/Models/EndgameTrainingSession.cs
@@ -70,18 +70,20 @@
                         AntichessGame copy = new AntichessGame(Game.GetFen());
                         copy.ApplyMove(valid, true);
                         ReadOnlyCollection<Move> validMoves2 = copy.GetValidMoves(copy.WhoseTurn);
+                        bool wonForAll = true;
                         foreach (Move valid2 in validMoves2)
                         {
                             AntichessGame copy2 = new AntichessGame(copy.GetFen());
                             copy2.ApplyMove(valid2, true);
-                            if (copy2.GetValidMoves(copy2.WhoseTurn).Any(x => copy2.GetPieceAt(x.NewPosition) == null))
+                            if (copy2.GetValidMoves(copy2.WhoseTurn).Any(x => copy2.GetPieceAt(x.NewPosition) != null))
                             {
-                                WasAlreadyLost = false;
+                                wonForAll = false;
                                 break;
                             }
                         }
-                        if (!WasAlreadyLost)
-                        {
+                        if (wonForAll)
+                        {
+                            WasAlreadyLost = false;
                             break;
                         }
                     }


Remove code that doesn’t have any observable side-effects.

Fixes #13830.

--- src/Compilers/CSharp/Portable/FlowAnalysis/DataFlowPass.cs
+++ src/Compilers/CSharp/Portable/FlowAnalysis/DataFlowPass.cs
@@ -1640,10 +1640,6 @@
             {
                 switch (local.DeclarationKind)
                 {
-                    case LocalDeclarationKind.RegularVariable:
-                        ReportIfUnused(local, assigned: true);
-                        break;
-
                     case LocalDeclarationKind.UsingVariable:
                         NoteRead(local); // At the end of the statement, there's an implied read when the local is disposed
                         break;
@@ -1672,17 +1668,7 @@
                 }
             }

-            var result = base.VisitFixedStatement(node);
-
-            foreach (LocalSymbol local in node.Locals)
-            {
-                if (local.DeclarationKind == LocalDeclarationKind.RegularVariable)
-                {
-                    ReportIfUnused(local, assigned: true);
-                }
-            }
-
-            return result;
+            return base.VisitFixedStatement(node);
         }

         public override BoundNode VisitSequence(BoundSequence node)


Add convenience overload for listing network domains by datacenter.

--- src/DD.CloudControl.Client/CloudControlClientExtensions.cs
+++ src/DD.CloudControl.Client/CloudControlClientExtensions.cs
@@ -14,7 +14,35 @@
 	public static class CloudControlClientExtensions
 	{
 		/// <summary>
-		/// 	Retrieve a the first matching network domain by name and datacenter.
+		/// 	List network domains in the specified datacenter.
+		/// </summary>
+		/// <param name="client">
+		/// 	The CloudControl API client.
+		/// </param>
+		/// <param name="datacenterId">
+		/// 	The Id of the datacenter containing the network domain to retrieve.
+		/// </param>
+		/// <param name="paging">
+		/// 	An optional <see cref="Paging"/> configuration for the results.
+		/// </param>
+		/// <param name="cancellationToken">
+		/// 	An optional cancellation token that can be used to cancel the request.
+		/// </param>
+		/// <returns>
+		/// 	The network domains (as <see cref="NetworkDomains"/>).
+		/// </returns>
+		public static Task<NetworkDomains> ListNetworkDomains(this CloudControlClient client, string datacenterId, Paging paging, CancellationToken cancellationToken = default(CancellationToken))
+		{
+			if (client == null)
+				throw new ArgumentNullException(nameof(client));
+
+			NetworkDomainQuery query = NetworkDomainQuery.ByDatacenter(datacenterId);
+
+			return client.ListNetworkDomains(query, paging, cancellationToken);
+		}
+
+		/// <summary>
+		/// 	Retrieve the first network domain in the specified datacenter with the specified name.
 		/// </summary>
 		/// <param name="client">
 		/// 	The CloudControl API client.


Removes using statement

Removes using statement

--- src/Elders.Cronus/Discoveries/AutoDiscoveryByReflection.cs
+++ src/Elders.Cronus/Discoveries/AutoDiscoveryByReflection.cs
@@ -1,6 +1,5 @@
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
-using System;

 namespace Elders.Cronus.Discoveries
 {


Fixed possible null reference exception when location has no ICAO code during delivery creation

--- src/FLS.Server.Service/Accounting/AccountingRuleService.cs
+++ src/FLS.Server.Service/Accounting/AccountingRuleService.cs
@@ -194,7 +194,7 @@

             foreach (var icaoCode in filter.MatchedLdgLocations)
             {
-                var location = locationListItems.FirstOrDefault(q => q.IcaoCode.ToUpper() == icaoCode.ToUpper());
+                var location = locationListItems.FirstOrDefault(q => q.IcaoCode != null && q.IcaoCode.ToUpper() == icaoCode.ToUpper());

                 if (location == null)
                 {
@@ -208,7 +208,7 @@

             foreach (var icaoCode in filter.MatchedStartLocations)
             {
-                var location = locationListItems.FirstOrDefault(q => q.IcaoCode.ToUpper() == icaoCode.ToUpper());
+                var location = locationListItems.FirstOrDefault(q => q.IcaoCode != null && q.IcaoCode.ToUpper() == icaoCode.ToUpper());

                 if (location == null)
                 {


wp8: toolbarGetHeight crash fixed

wp8: toolbarGetHeight crash fixed

--- platform/wp8/rhodes/MainPage.xaml.cs
+++ platform/wp8/rhodes/MainPage.xaml.cs
@@ -352,9 +352,14 @@
             updateAppBarModeAndVisibility(false);
         }

-		public int toolbarGetHeight()
+		private int toolbarGetHeightFunc()
         {
             return ApplicationBar.IsVisible ? (ApplicationBar.Mode == ApplicationBarMode.Default ? 72 : 30) : 0;
+        }
+
+        public int toolbarGetHeight()
+        {
+            return IntValueReturnAgent(toolbarGetHeightFunc);
         }

         public void toolbarAddAction(string text)
@@ -687,8 +692,8 @@

         private string StringValueByIntReturnAgent(Func<int, string> func, int index)
         {
-             if (isUIThread)
-                 return func(index);
+            if (isUIThread)
+                return func(index);

             Exception exception = null;
             var waitEvent = new System.Threading.ManualResetEvent(false);


Make `getClosestDisplayMode()` static and fix errors from merge

--- osu.Framework/Platform/SDL2DesktopWindow_Windowing.cs
+++ osu.Framework/Platform/SDL2DesktopWindow_Windowing.cs
@@ -560,7 +560,7 @@
                     break;

                 case WindowState.Fullscreen:
-                    var closestMode = getClosestDisplayMode(sizeFullscreen.Value, display, displayMode);
+                    var closestMode = getClosestDisplayMode(SDLWindowHandle, sizeFullscreen.Value, display, displayMode);

                     Size = new Size(closestMode.w, closestMode.h);

@@ -747,20 +747,20 @@

         #region Helper functions

-        private SDL.SDL_DisplayMode getClosestDisplayMode(Size size, Display display, DisplayMode requestedMode)
+        private static SDL.SDL_DisplayMode getClosestDisplayMode(IntPtr windowHandle, Size size, Display display, DisplayMode requestedMode)
         {
             SDL.SDL_ClearError(); // clear any stale error.

             // default size means to use the display's native size.
-            if (size == sizeFullscreen.Default)
-                size = currentDisplay.Bounds.Size;
+            if (size.Width == 9999 && size.Height == 9999)
+                size = display.Bounds.Size;

             var targetMode = new SDL.SDL_DisplayMode { w = size.Width, h = size.Height, refresh_rate = requestedMode.RefreshRate };

             if (SDL.SDL_GetClosestDisplayMode(display.Index, ref targetMode, out var mode) != IntPtr.Zero)
                 return mode;
             else
-                Logger.Log($"Unable to get preferred display mode (try #1/2). Target display: {displayIndex}, mode: {targetMode.ReadableString()}. SDL error: {SDL2Extensions.GetAndClearError()}");
+                Logger.Log($"Unable to get preferred display mode (try #1/2). Target display: {display.Index}, mode: {targetMode.ReadableString()}. SDL error: {SDL2Extensions.GetAndClearError()}");

             // fallback to current display's native bounds
             targetMode.w = display.Bounds.Width;
@@ -770,19 +770,19 @@
             if (SDL.SDL_GetClosestDisplayMode(display.Index, ref targetMode, out mode) != IntPtr.Zero)
                 return mode;
             else
-                Logger.Log($"Unable to get preferred display mode (try #2/2). Target display: {displayIndex}, mode: {targetMode.ReadableString()}. SDL error: {SDL2Extensions.GetAndClearError()}");
+                Logger.Log($"Unable to get preferred display mode (try #2/2). Target display: {display.Index}, mode: {targetMode.ReadableString()}. SDL error: {SDL2Extensions.GetAndClearError()}");

             // try the display's native display mode.
-            if (SDL.SDL_GetDesktopDisplayMode(displayIndex, out mode) == 0)
+            if (SDL.SDL_GetDesktopDisplayMode(display.Index, out mode) == 0)
                 return mode;
             else
-                Logger.Log($"Failed to get desktop display mode (try #1/3). Target display: {displayIndex}. SDL error: {SDL2Extensions.GetAndClearError()}", level: LogLevel.Error);
+                Logger.Log($"Failed to get desktop display mode (try #1/3). Target display: {display.Index}. SDL error: {SDL2Extensions.GetAndClearError()}", level: LogLevel.Error);

             // try the primary display mode.
-            if (SDL.SDL_GetDisplayMode(displayIndex, 0, out mode) == 0)
+            if (SDL.SDL_GetDisplayMode(display.Index, 0, out mode) == 0)
                 return mode;
             else
-                Logger.Log($"Failed to get desktop display mode (try #2/3). Target display: {displayIndex}. SDL error: {SDL2Extensions.GetAndClearError()}", level: LogLevel.Error);
+                Logger.Log($"Failed to get desktop display mode (try #2/3). Target display: {display.Index}. SDL error: {SDL2Extensions.GetAndClearError()}", level: LogLevel.Error);

             // try the primary display's primary display mode.
             if (SDL.SDL_GetDisplayMode(0, 0, out mode) == 0)
@@ -791,7 +791,7 @@
                 Logger.Log($"Failed to get desktop display mode (try #3/3). Target display: primary. SDL error: {SDL2Extensions.GetAndClearError()}", level: LogLevel.Error);

             // finally return the current mode if everything else fails.
-            if (SDL.SDL_GetWindowDisplayMode(SDLWindowHandle, out mode) >= 0)
+            if (SDL.SDL_GetWindowDisplayMode(windowHandle, out mode) >= 0)
                 return mode;
             else
                 Logger.Log($"Failed to get window display mode. SDL error: {SDL2Extensions.GetAndClearError()}", level: LogLevel.Error);


Port the old stacking algorithm

Port the old stacking algorithm

--- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs
+++ osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs
@@ -10,6 +10,8 @@
 {
     public class OsuBeatmapProcessor : BeatmapProcessor
     {
+        private const int stack_distance = 3;
+
         public OsuBeatmapProcessor(IBeatmap beatmap)
             : base(beatmap)
         {
@@ -18,17 +20,21 @@
         public override void PostProcess()
         {
             base.PostProcess();
-            applyStacking((Beatmap<OsuHitObject>)Beatmap);
+
+            var osuBeatmap = (Beatmap<OsuHitObject>)Beatmap;
+
+            // Reset stacking
+            foreach (var h in osuBeatmap.HitObjects)
+                h.StackHeight = 0;
+
+            if (Beatmap.BeatmapInfo.BeatmapVersion >= 6)
+                applyStacking(osuBeatmap);
+            else
+                applyStackingOld(osuBeatmap);
         }

         private void applyStacking(Beatmap<OsuHitObject> beatmap)
         {
-            const int stack_distance = 3;
-
-            // Reset stacking
-            for (int i = 0; i <= beatmap.HitObjects.Count - 1; i++)
-                beatmap.HitObjects[i].StackHeight = 0;
-
             // Extend the end index to include objects they are stacked on
             int extendedEndIndex = beatmap.HitObjects.Count - 1;
             for (int i = beatmap.HitObjects.Count - 1; i >= 0; i--)
@@ -167,5 +173,40 @@
                 }
             }
         }
+
+        private void applyStackingOld(Beatmap<OsuHitObject> beatmap)
+        {
+            for (int i = 0; i < beatmap.HitObjects.Count; i++)
+            {
+                OsuHitObject currHitObject = beatmap.HitObjects[i];
+
+                if (currHitObject.StackHeight != 0 && !(currHitObject is Slider))
+                    continue;
+
+                double startTime = (currHitObject as IHasEndTime)?.EndTime ?? currHitObject.StartTime;
+                int sliderStack = 0;
+
+                for (int j = i + 1; j < beatmap.HitObjects.Count; j++)
+                {
+                    double stackThreshold = beatmap.HitObjects[i].TimePreempt * beatmap.BeatmapInfo.StackLeniency;
+
+                    if (beatmap.HitObjects[j].StartTime - stackThreshold > startTime)
+                        break;
+
+                    if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, currHitObject.Position) < stack_distance)
+                    {
+                        currHitObject.StackHeight++;
+                        startTime = (beatmap.HitObjects[j] as IHasEndTime)?.EndTime ?? beatmap.HitObjects[i].StartTime;
+                    }
+                    else if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, currHitObject.EndPosition) < stack_distance)
+                    {
+                        //Case for sliders - bump notes down and right, rather than up and left.
+                        sliderStack++;
+                        beatmap.HitObjects[j].StackHeight -= sliderStack;
+                        startTime = (beatmap.HitObjects[j] as IHasEndTime)?.EndTime ?? beatmap.HitObjects[i].StartTime;
+                    }
+                }
+            }
+        }
     }
 }


Pass correct params to `UpdateableAvatar` ctor in `ChannelListItem`

--- osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs
+++ osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs
@@ -157,7 +157,7 @@
             if (channel.Type != ChannelType.PM)
                 return Drawable.Empty();

-            return new UpdateableAvatar(channel.Users.First(), false, false, true)
+            return new UpdateableAvatar(channel.Users.First(), isInteractive: false)
             {
                 Size = new Vector2(20),
                 Margin = new MarginPadding { Right = 5 },


These tests access the clipboard directly in the unit tests and hence
have flaky behavior across machines.  Disabling.

See https://github.com/dotnet/roslyn/issues/5544

--- src/InteractiveWindow/EditorTest/InteractiveWindowTests.cs
+++ src/InteractiveWindow/EditorTest/InteractiveWindowTests.cs
@@ -669,7 +669,7 @@
                 expectedRepl: null);
         }

-        [Fact]
+        [Fact(Skip = "5544"), WorkItem(5544, "https://github.com/dotnet/roslyn/issues/5544")]
         public void CutInputAndOutput()
         {
             Clipboard.Clear();
@@ -1106,7 +1106,7 @@
             AssertCaretVirtualPosition(3, 2);
         }

-        [Fact]
+        [Fact(Skip = "5544"), WorkItem(5544, "https://github.com/dotnet/roslyn/issues/5544")]
         public void CutWithOutSelectionInReadOnlyArea()
         {
             Submit(
@@ -1141,7 +1141,7 @@
             VerifyClipboardData("2", expectedRtf: null, expectedRepl: null);
         }

-        [Fact]
+        [Fact(Skip = "5544"), WorkItem(5544, "https://github.com/dotnet/roslyn/issues/5544")]
         public void CutWithSelectionInReadonlyArea()
         {
             Submit(


Stops notification reading from channel before subscription stopping.

--- src/Journalist.EventStore/Notifications/NotificationHub.cs
+++ src/Journalist.EventStore/Notifications/NotificationHub.cs
@@ -61,15 +61,15 @@

         public void StopNotificationProcessing()
         {
-            foreach (var subscriptions in m_subscriptions)
-            {
-                subscriptions.Stop();
-            }
-
             if (m_token != null)
             {
                 m_token.Cancel();
                 m_processingTask.Wait();
+            }
+
+            foreach (var subscriptions in m_subscriptions)
+            {
+                subscriptions.Stop();
             }
         }


Modifies run post-run detection procedures

--- src/Lithnet.Miiserver.AutoSync/MAInterface/MAController.cs
+++ src/Lithnet.Miiserver.AutoSync/MAInterface/MAController.cs
@@ -392,149 +392,209 @@

         private void QueueFollowupActions(RunDetails d)
         {
-            this.QueueFollowUpActionsExport(d);
-            this.QueueFollowUpActionsImport(d);
-            this.QueueFollowUpActionsSync(d);
-        }
-
-        private void QueueFollowUpActionsExport(RunDetails d)
-        {
-            for (int i = 0; i < d.StepDetails.Count; i++)
-            {
-                StepDetails s = d.StepDetails[i];
-
-                if (!s.StepDefinition.IsExportStep)
-                {
+            this.Trace($"Analyzing results from {d.RunProfileName} run #{d.RunNumber}");
+
+            for (int index = d.StepDetails.Count - 1; index >= 0; index--)
+            {
+                StepDetails s = d.StepDetails[index];
+
+                if (s.StepDefinition == null)
+                {
+                    this.LogWarn($"Step detail for step {s.StepNumber} was missing the step definition and cannot be processed");
                     continue;
                 }

-                // found an export step
-
-                if (!s.ExportCounters?.HasChanges ?? false)
-                {
+                if (s.StepDefinition.IsSyncStep)
+                {
+                    this.Trace($"Processing outbound changes from step {s.StepNumber} of {d.RunProfileName}");
+                    this.QueueFollowUpActionsSync(s);
                     continue;
                 }

-                // has unconfirmed changed
-                this.Trace($"Unconfirmed exports in last run");
-
-                string partitionName = s.StepDefinition.Partition;
-
-                if (partitionName == null)
-                {
-                    this.LogWarn($"Partition in step {i} of run profile {d.RunProfileName} had an empty partition");
+                Tuple<PartitionConfiguration, MARunProfileType> requiredAction = this.GetImportExportFollowUpActions(s);
+
+                if (requiredAction == null)
+                {
+                    // nothing to do
+                    this.Trace($"Step {s.StepNumber} of {d.RunProfileName} had no follow up actions to perform");
                     continue;
                 }

-                // can confirm import
-
-                bool hasConfirmed = false;
-
-                for (int j = i++; j < d.StepDetails.Count; j++)
-                {
-                    StepDetails followUpStep = d.StepDetails[j];
-
-                    if (followUpStep.StepDefinition.Partition != partitionName)
-                    {
+                if (this.WasFollowupAlreadyPerformed(d, index, requiredAction))
+                {
+                    this.Trace($"The expected follow up action '{requiredAction.Item2}' in partition '{requiredAction.Item1.Name}' for step {s.StepNumber} of run profile '{d.RunProfileName}' has already been performed");
+                }
+                else
+                {
+                    this.Trace($"The expected follow up action '{requiredAction.Item2}' in partition '{requiredAction.Item1.Name}' for step {s.StepNumber} of run profile '{d.RunProfileName}' has not yet been performed");
+
+                    if (requiredAction.Item2 == MARunProfileType.DeltaImport)
+                    {
+                        if (requiredAction.Item1.ConfirmingImportRunProfileName == null)
+                        {
+                            this.LogWarn($"A confirming import was required, but they have not been configured for partition {requiredAction.Item1.Name}");
+                            continue;
+                        }
+
+                        this.AddPendingActionIfNotQueued(new ExecutionParameters(requiredAction.Item1.ConfirmingImportRunProfileName), d.RunProfileName, true);
                         continue;
                     }

-                    if (followUpStep.StepDefinition.IsImportStep)
-                    {
-                        // already confirmed
-                        this.Trace($"Skipping confirming import as there was an import step in the run");
-                        hasConfirmed = true;
-                        break;
-                    }
-                }
-
-                if (hasConfirmed)
-                {
+                    if (requiredAction.Item2 == MARunProfileType.DeltaSync)
+                    {
+                        if (requiredAction.Item1.DeltaSyncRunProfileName == null)
+                        {
+                            this.LogWarn($"A delta sync was required, but they have not been configured for partition {requiredAction.Item1.Name}");
+                            continue;
+                        }
+
+                        this.AddPendingActionIfNotQueued(new ExecutionParameters(requiredAction.Item1.DeltaSyncRunProfileName), d.RunProfileName, true);
+                        continue;
+                    }
+                }
+            }
+        }
+
+        private bool WasFollowupAlreadyPerformed(RunDetails d, int i, Tuple<PartitionConfiguration, MARunProfileType> result)
+        {
+            for (int j = i - 1; j >= 0; j--)
+            {
+                StepDetails f = d.StepDetails[j];
+
+                if (f.StepDefinition == null)
+                {
+                    this.LogWarn($"Step detail was missing the step definition");
                     continue;
                 }

-                string confirmingImportRunProfileName = this.Configuration.Partitions.GetActiveItemOrNull(partitionName)?.ConfirmingImportRunProfileName;
-
-                if (confirmingImportRunProfileName == null)
-                {
-                    this.LogWarn($"Confirming imports have not been configured for partition {partitionName} or the partition could not be found");
+                PartitionConfiguration p = this.Configuration.Partitions.GetActiveItemOrNull(f.StepDefinition.Partition);
+
+                if (p == null || p.ID != result.Item1.ID)
+                {
+                    // not for this partition
                     continue;
                 }

-                this.AddPendingActionIfNotQueued(new ExecutionParameters(confirmingImportRunProfileName), d.RunProfileName, true);
-            }
-        }
-
-        private void QueueFollowUpActionsImport(RunDetails d)
-        {
-            for (int i = 0; i < d.StepDetails.Count; i++)
-            {
-                StepDetails s = d.StepDetails[i];
-
-                if (!s.StepDefinition.IsImportStep)
-                {
-                    continue;
-                }
-
-                // found an import step
-
-                if (!s.StagingCounters?.HasChanges ?? false)
-                {
-                    continue;
-                }
-
-                // has staged imports
-                this.Trace("Staged imports in last run");
-
-                string partitionName = s.StepDefinition.Partition;
-
-                if (partitionName == null)
-                {
-                    this.LogWarn($"Partition in step {i} of run profile {d.RunProfileName} had an empty partition");
-                    continue;
-                }
-
-                // can sync staged changed
-
-                bool hasSynced = false;
-
-                for (int j = i + 1; j < d.StepDetails.Count; j++)
-                {
-                    StepDetails followUpStep = d.StepDetails[j];
-
-                    if (followUpStep.StepDefinition.Partition != partitionName)
-                    {
-                        continue;
-                    }
-
-                    if (followUpStep.StepDefinition.IsSyncStep)
-                    {
-                        // already synced
-                        this.Trace($"Skipping sync of staged import as there was already a sync step in the run");
-                        hasSynced = true;
-                        break;
-                    }
-                }
-
-                if (hasSynced)
-                {
-                    continue;
-                }
-
-                string deltaSyncRunProfileName = this.Configuration.Partitions.GetActiveItemOrNull(partitionName)?.DeltaSyncRunProfileName;
-
-                if (deltaSyncRunProfileName == null)
-                {
-                    this.LogWarn($"Delta syncs have not been configured for partition {partitionName} or the partition was not found");
-                    continue;
-                }
-
-                this.AddPendingActionIfNotQueued(new ExecutionParameters(deltaSyncRunProfileName), d.RunProfileName, true);
-            }
-        }
-
-        private void QueueFollowUpActionsSync(RunDetails d)
-        {
+                if (f.StepDefinition.IsImportStep && result.Item2 == MARunProfileType.DeltaImport)
+                {
+                    // the required import follow up has already happened
+                    return true;
+                }
+
+                if (f.StepDefinition.IsExportStep && result.Item2 == MARunProfileType.Export)
+                {
+                    // the required export has already happened
+                    return true;
+                }
+
+                if (f.StepDefinition.IsSyncStep && result.Item2 == MARunProfileType.DeltaSync)
+                {
+                    // the required sync has already happened
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        private Tuple<PartitionConfiguration, MARunProfileType> GetImportExportFollowUpActions(StepDetails s)
+        {
+            if (s.StepDefinition == null)
+            {
+                this.LogWarn($"Step detail was missing the step definition");
+                return null;
+            }
+
+            if (s.StepDefinition.Type == RunStepType.Export)
+            {
+                return this.GetExportFollowUpAction(s);
+            }
+
+            if (s.StepDefinition.Type == RunStepType.FullImport || s.StepDefinition.Type == RunStepType.DeltaImport)
+            {
+                return this.GetImportFollowUpAction(s);
+            }
+
+            return null;
+        }
+
+        private Tuple<PartitionConfiguration, MARunProfileType> GetImportFollowUpAction(StepDetails s)
+        {
+            if (!s.StepDefinition.IsImportStep)
+            {
+                return null;
+            }
+
+            if (!s.StagingCounters?.HasChanges ?? false)
+            {
+                this.Trace($"No staged imports in step {s.StepNumber}");
+                return null;
+            }
+
+            // has staged imports
+            this.Trace($"Staged imports in step {s.StepNumber}");
+
+            string partitionName = s.StepDefinition.Partition;
+
+            if (partitionName == null)
+            {
+                this.LogWarn($"Partition in step {s.StepNumber} was blank");
+                return null;
+            }
+
+            PartitionConfiguration p = this.Configuration.Partitions.GetActiveItemOrNull(partitionName);
+
+            if (p == null)
+            {
+                this.LogWarn($"Could not find the partition {partitionName}");
+                return null;
+            }
+
+            return new Tuple<PartitionConfiguration, MARunProfileType>(p, MARunProfileType.DeltaSync);
+        }
+
+        private Tuple<PartitionConfiguration, MARunProfileType> GetExportFollowUpAction(StepDetails s)
+        {
+            if (!s.StepDefinition.IsExportStep)
+            {
+                return null;
+            }
+
+            if (!s.ExportCounters?.HasChanges ?? false)
+            {
+                this.Trace($"No unconfirmed exports in step {s.StepNumber}");
+                return null;
+            }
+
+            // has unconfirmed exports
+            this.Trace($"Unconfirmed exports in step {s.StepNumber}");
+
+            string partitionName = s.StepDefinition.Partition;
+
+            if (partitionName == null)
+            {
+                this.LogWarn($"Partition in step {s.StepNumber} was blank");
+                return null;
+            }
+
+            PartitionConfiguration p = this.Configuration.Partitions.GetActiveItemOrNull(partitionName);
+
+            if (p == null)
+            {
+                this.LogWarn($"Could not find the partition {partitionName}");
+                return null;
+            }
+
+            return new Tuple<PartitionConfiguration, MARunProfileType>(p, MARunProfileType.DeltaImport);
+        }
+
+        private void QueueFollowUpActionsSync(StepDetails s)
+        {
+            if (!s.StepDefinition.IsSyncStep)
+            {
+                return;
+            }
+
             SyncCompleteEventHandler registeredHandlers = MAController.SyncComplete;

             if (registeredHandlers == null)
@@ -543,33 +603,25 @@
                 return;
             }

-            foreach (StepDetails s in d.StepDetails)
-            {
-                if (!s.StepDefinition.IsSyncStep)
-                {
+            foreach (OutboundFlowCounters item in s.OutboundFlowCounters)
+            {
+                if (!item.HasChanges)
+                {
+                    this.Trace($"No outbound changes detected for {item.ManagementAgent}");
                     continue;
                 }

-                foreach (OutboundFlowCounters item in s.OutboundFlowCounters)
-                {
-                    if (!item.HasChanges)
-                    {
-                        this.Trace($"No outbound changes detected for {item.ManagementAgent}");
-                        continue;
-                    }
-
-                    SyncCompleteEventArgs args = new SyncCompleteEventArgs
-                    {
-                        SendingMAName = this.ManagementAgentName,
-                        TargetMA = item.MAID
-                    };
-
-                    this.Trace($"Sending outbound change notification for MA {item.ManagementAgent}");
-                    registeredHandlers(this, args);
-                }
-            }
-        }
-
+                SyncCompleteEventArgs args = new SyncCompleteEventArgs
+                {
+                    SendingMAName = this.ManagementAgentName,
+                    TargetMA = item.MAID
+                };
+
+                this.Trace($"Sending outbound change notification for MA {item.ManagementAgent}");
+                registeredHandlers(this, args);
+            }
+        }
+
         private void LogInfo(string message)
         {
             logger.Info($"{this.ManagementAgentName}: {message}");
@@ -607,7 +659,7 @@

         private void Debug(string message)
         {
-#if DEBUG
+#if LOCKDEBUG
             logger.Trace($"{this.ManagementAgentName}: {message}");
 #endif
         }
@@ -690,7 +742,7 @@
         }

         private void RaiseRunProfileComplete(string runProfileName, string lastStepStatus, int runNumber, DateTime? startTime, DateTime? endTime)
-        {
+        {
             Task.Run(() =>
             {
                 try
@@ -975,7 +1027,6 @@
                 this.WaitAndTakeLock(this.serviceControlLock, nameof(this.serviceControlLock), this.controllerCancellationTokenSource);
                 gotLock = true;
                 this.ControlState = ControlState.Starting;
-                Thread.Sleep(Global.RandomizeOffset(TimeSpan.FromSeconds(5).TotalMilliseconds));
                 this.pendingActionList = new ExecutionParameterCollection();
                 this.pendingActions = new BlockingCollection<ExecutionParameters>(this.pendingActionList);
                 this.perProfileLastRunStatus = new Dictionary<string, string>();


Use public IP only for Clustering mode.

Use public IP only for Clustering mode.

--- backend/src/Squidex/Config/Orleans/OrleansServices.cs
+++ backend/src/Squidex/Config/Orleans/OrleansServices.cs
@@ -70,18 +70,18 @@
             var orleansPortSilo = config.GetOptionalValue("orleans:siloPort", 11111);
             var orleansPortGateway = config.GetOptionalValue("orleans:gatewayPort", 40000);

-            var address = Helper.ResolveIPAddressAsync(Dns.GetHostName(), AddressFamily.InterNetwork).Result;
-
-            builder.ConfigureEndpoints(
-                address,
-                orleansPortSilo,
-                orleansPortGateway,
-                true);
-
             config.ConfigureByOption("orleans:clustering", new Alternatives
             {
                 ["MongoDB"] = () =>
                 {
+                    var address = Helper.ResolveIPAddressAsync(Dns.GetHostName(), AddressFamily.InterNetwork).Result;
+
+                    builder.ConfigureEndpoints(
+                        address,
+                        orleansPortSilo,
+                        orleansPortGateway,
+                        true);
+
                     builder.UseMongoDBClustering(options =>
                     {
                         options.Configure(config);
@@ -89,7 +89,7 @@
                 },
                 ["Development"] = () =>
                 {
-                    builder.UseDevelopmentClustering(new IPEndPoint(address, orleansPortSilo));
+                    builder.UseLocalhostClustering(orleansPortSilo, orleansPortGateway);
                 }
             });


Fixed bug in the Suggest.InputArrayIterator (in Lucene.Net.Tests.Suggest) that was causing the cursor to skip the first item it was iterating through.

--- src/Lucene.Net.Tests.Suggest/Suggest/InputArrayIterator.cs
+++ src/Lucene.Net.Tests.Suggest/Suggest/InputArrayIterator.cs
@@ -66,34 +66,24 @@

         public BytesRef Next()
         {
-            if (i.MoveNext() || (first && current != null))
+            // LUCENENET NOTE: We moved the cursor when
+            // the instance was created. Make sure we don't
+            // move it again until the second call to Next().
+            if (first && current != null)
             {
-                if (first)
-                {
-                    first = false;
-                }
-                else
-                {
-                    current = i.Current;
-                }
-                spare.CopyBytes(current.term);
-                return spare;
+                first = false;
+            }
+            else if (i.MoveNext())
+            {
+                current = i.Current;
+            }
+            else
+            {
+                return null;
             }

-            //if (i.hasNext() || (first && current != null))
-            //{
-            //    if (first)
-            //    {
-            //        first = false;
-            //    }
-            //    else
-            //    {
-            //        current = i.next();
-            //    }
-            //    spare.copyBytes(current.term);
-            //    return spare;
-            //}
-            return null;
+            spare.CopyBytes(current.term);
+            return spare;
         }

         public BytesRef Payload


Optimize manipulation of RouteData.Routers

This change avoid calling List.Clear() and new List(IEnumerable<T>) which
both end up calling into native methods via the Array static class. These
methods are designed to be performant for large collections, and for our
needs this collection has at most 1-4 items. This is worth 2-3% in
techempower plaintext.

--- src/Microsoft.AspNetCore.Routing.Abstractions/RouteData.cs
+++ src/Microsoft.AspNetCore.Routing.Abstractions/RouteData.cs
@@ -12,7 +12,7 @@
     public class RouteData
     {
         private RouteValueDictionary _dataTokens;
-        private IList<IRouter> _routers;
+        private List<IRouter> _routers;
         private RouteValueDictionary _values;

         /// <summary>
@@ -126,10 +126,23 @@
         /// <returns>A <see cref="RouteDataSnapshot"/> that captures the current state.</returns>
         public RouteDataSnapshot PushState(IRouter router, RouteValueDictionary values, RouteValueDictionary dataTokens)
         {
+            // Perf: this is optimized for small list sizes, in particular to avoid overhead of a native call in
+            // Array.CopyTo inside the List(IEnumerable<T>) constructor.
+            List<IRouter> routers = null;
+            var count = _routers?.Count;
+            if (count > 0)
+            {
+                routers = new List<IRouter>(count.Value);
+                for (var i = 0; i < count.Value; i++)
+                {
+                    routers.Add(_routers[i]);
+                }
+            }
+
             var snapshot = new RouteDataSnapshot(
                 this,
                 _dataTokens?.Count > 0 ? new RouteValueDictionary(_dataTokens) : null,
-                _routers?.Count > 0 ? new List<IRouter>(_routers) : null,
+                routers,
                 _values?.Count > 0 ? new RouteValueDictionary(_values) : null);

             if (router != null)
@@ -222,15 +235,41 @@
                 }
                 else if (_routers == null)
                 {
-                    _routeData._routers.Clear();
+                    // Perf: this is optimized for small list sizes, in particular to avoid overhead of a native call in
+                    // Array.Clear inside the List.Clear() method.
+                    var routers = _routeData._routers;
+                    for (var i = routers.Count - 1; i >= 0 ; i--)
+                    {
+                        routers.RemoveAt(i);
+                    }
                 }
                 else
                 {
-                    _routeData._routers.Clear();
-
-                    for (var i = 0; i < _routers.Count; i++)
-                    {
-                        _routeData._routers.Add(_routers[i]);
+                    // Perf: this is optimized for small list sizes, in particular to avoid overhead of a native call in
+                    // Array.Clear inside the List.Clear() method.
+                    //
+                    // We want to basically copy the contents of _routers in _routeData._routers - this change does
+                    // that with the minimal number of reads/writes and without calling Clear().
+                    var routers = _routeData._routers;
+                    var snapshotRouters = _routers;
+
+                    // This is made more complicated by the fact that List[int] throws if i == Count, so we have
+                    // to do two loops and call Add for those cases.
+                    var i = 0;
+                    for (; i < snapshotRouters.Count && i < routers.Count; i++)
+                    {
+                        routers[i] = snapshotRouters[i];
+                    }
+
+                    for (; i < snapshotRouters.Count; i++)
+                    {
+                        routers.Add(snapshotRouters[i]);
+                    }
+
+                    // Trim excess - again avoiding RemoveRange because it uses native methods.
+                    for (i = routers.Count - 1; i >= snapshotRouters.Count; i--)
+                    {
+                        routers.RemoveAt(i);
                     }
                 }


split

split

--- Med-Bay/NAudioFunctions/NAudioFunctions/Program.cs
+++ Med-Bay/NAudioFunctions/NAudioFunctions/Program.cs
@@ -12,10 +12,10 @@
     {
         static void Main(string[] args)
         {
-            string inputFile = "exciting.wav";
+            string inputFile = @"d:\ignite.wav";
             string outputFile = Path.GetFileNameWithoutExtension(inputFile) + "_mono.wav";
             ConvertWaveToMonoWave(inputFile, outputFile);
-            SplitWaveFile(inputFile, Path.GetFileNameWithoutExtension(inputFile) + "{0}.wav", 1);
+            SplitWaveFile(inputFile, Path.GetFileNameWithoutExtension(inputFile) + "{0}.wav", 600, 8);
         }
         static void ConvertMP3toWave(string file, string outputFile)
         {
@@ -38,7 +38,7 @@
                 }
             }
         }
-        static void SplitWaveFile(string file, string outputFilePattern, int chunkSizeinSeconds)
+        static void SplitWaveFile(string file, string outputFilePattern, int chunkSizeinSeconds, int overlapInSeconds)
         {
             using (WaveFileReader reader = new WaveFileReader(file))
             {
@@ -59,6 +59,8 @@
                         writer.Dispose();
                         writer = null;
                         fileCount++;
+                        if (reader.Position < reader.Length)
+                            reader.Position -= bufferSize * overlapInSeconds;
                     }
                 }
             }


Reset the plot manager when connecting to a session, rather than on disconnect. This ensures the plot windows are cleared when user switches workspaces.

--- src/R/Components/Impl/Plots/Implementation/RPlotManager.cs
+++ src/R/Components/Impl/Plots/Implementation/RPlotManager.cs
@@ -37,10 +37,10 @@
             _fileSystem = fileSystem;

             _disposableBag = DisposableBag.Create<RPlotManager>()
-                .Add(() => interactiveWorkflow.RSession.Disconnected += RSession_Disconnected)
+                .Add(() => interactiveWorkflow.RSession.Connected -= RSession_Connected)
                 .Add(() => interactiveWorkflow.RSession.Mutated -= RSession_Mutated);

-            interactiveWorkflow.RSession.Disconnected += RSession_Disconnected;
+            interactiveWorkflow.RSession.Connected += RSession_Connected;
             interactiveWorkflow.RSession.Mutated += RSession_Mutated;
         }

@@ -488,11 +488,11 @@
             device.DeviceNum = num ?? 0;
         }

-        private void RSession_Disconnected(object sender, EventArgs e) {
-            RSessionDisconnectedAsync().DoNotWait();
-        }
-
-        private async Task RSessionDisconnectedAsync() {
+        private void RSession_Connected(object sender, RConnectedEventArgs e) {
+            RSessionConnectedAsync().DoNotWait();
+        }
+
+        private async Task RSessionConnectedAsync() {
             await InteractiveWorkflow.Shell.SwitchToMainThreadAsync();

             RemoveAllDevices();


expect exception count to be the actual run count

--- Neo4j.Driver/Neo4j.Driver.Tests/RetryLogicTests.cs
+++ Neo4j.Driver/Neo4j.Driver.Tests/RetryLogicTests.cs
@@ -55,8 +55,10 @@
         {
             var timer = new Stopwatch();
             timer.Start();
+            var runCounter = 0;
             var e = Record.Exception(() => retryLogic.Retry<int>(() =>
             {
+                runCounter++;
                 var errorMessage = $"Thread {index} Failed at {timer.Elapsed}";
                 throw new SessionExpiredException(errorMessage);
             }));
@@ -66,7 +68,7 @@
             var error = e.InnerException as AggregateException;
             var innerErrors = error.Flatten().InnerExceptions;

-            innerErrors.Count.Should().BeGreaterOrEqualTo(2);
+            innerErrors.Count.Should().Be(runCounter);
             timer.Elapsed.TotalSeconds.Should().BeGreaterOrEqualTo(5);
         }


Remove ?. operator since I don't think it is supported yet

--- Nodejs/Product/Nodejs/Project/NodejsProjectNode.cs
+++ Nodejs/Product/Nodejs/Project/NodejsProjectNode.cs
@@ -119,7 +119,7 @@
                     return _typingsAcquirer;
                 }

-                var controller = ModulesNode?.NpmController;
+                var controller = ModulesNode != null ? ModulesNode.NpmController : null;
                 if (controller != null) {
                     _typingsAcquirer = new TypingsAcquisition(controller.ListBaseDirectory, controller.RootPackage.Path);
                 }


IDK why was this failing, but I got reports of NullReferenceException there. Solving it the best I can.

--- Ocell.UI/Ocell.Phone7/Pages/Elements/TweetModel.cs
+++ Ocell.UI/Ocell.Phone7/Pages/Elements/TweetModel.cs
@@ -229,18 +229,21 @@

         private void GetRetweets()
         {
-            ServiceDispatcher.GetDefaultService().Retweets(new RetweetsOptions { Id = Tweet.Id }, (statuses, response) =>
-            {
-                if (statuses != null && statuses.Any())
-                {
-                    HasRetweets = true;
-                    Deployment.Current.Dispatcher.BeginInvoke(() =>
-                    {
-                        foreach (var rt in statuses)
-                            UsersWhoRetweeted.Add(rt.Author);
-                    });
-                }
-            });
+            var service = ServiceDispatcher.GetCurrentService();
+
+            if (service != null)
+                service.Retweets(new RetweetsOptions { Id = Tweet.Id }, (statuses, response) =>
+             {
+                 if (statuses != null && statuses.Any())
+                 {
+                     HasRetweets = true;
+                     Deployment.Current.Dispatcher.BeginInvoke(() =>
+                     {
+                         foreach (var rt in statuses)
+                             UsersWhoRetweeted.Add(rt.Author);
+                     });
+                 }
+             });
         }

         public TweetModel()


fixed the problem with other avatar's clothes being white.

--- OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -444,6 +444,7 @@
             {
                 this.SendFullUpdateToOtherClient(avatar);
                 avatar.SendFullUpdateToOtherClient(this);
+                avatar.SendAppearanceToOtherAgent(this);
             }
         }


Removed left-over debug messages.

Removed left-over debug messages.

--- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -276,7 +276,7 @@
             {
                 if (UUID.Zero == transactionID)
                 {
-                    m_log.DebugFormat("[XXX] UUID.Zero = transactionID");
+
                     item.Name = itemUpd.Name;
                     item.Description = itemUpd.Description;
                     item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
@@ -303,7 +303,6 @@
                 }
                 else
                 {
-                    m_log.DebugFormat("[XXX] UUID.Zero != transactionID");
                     IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
                     if (agentTransactions != null)
                     {
@@ -388,7 +387,6 @@

                 if (Permissions.PropagatePermissions() && recipient != senderId)
                 {
-                    m_log.Debug("[XXX] Permissions.PropagatePermissions()");
                     // Trying to do this right this time. This is evil. If
                     // you believe in Good, go elsewhere. Vampires and other
                     // evil creatores only beyond this point. You have been


added missing senderId in GiveInventoryFolder this little mistake prevented passing on folders for HG visitors

Signed-off-by: BlueWall <1cc9acdd5f63e1564a3c843af672019c762caf24@bluewallgroup.com>

--- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -807,7 +807,7 @@
             UUID recipientId, UUID senderId, UUID folderId, UUID recipientParentFolderId)
         {
             //// Retrieve the folder from the sender
-            InventoryFolderBase folder = InventoryService.GetFolder(new InventoryFolderBase(folderId));
+            InventoryFolderBase folder = InventoryService.GetFolder(new InventoryFolderBase(folderId, senderId));
             if (null == folder)
             {
                 m_log.ErrorFormat(


Fixed an issue with SceneObjectPart.RemFlag that would prevent some objects from being persisted if they contained a script in the root prim and any other asset type in a child prim.

--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2798,7 +2798,8 @@
                 //m_log.Debug("Removing flag: " + ((PrimFlags)flag).ToString());
                 _flags &= ~flag;
                 if ((flag & PrimFlags.Scripted) != 0)
-                    ParentGroup.CheckIsScripted();
+                    if(ParentGroup != null)
+                        ParentGroup.CheckIsScripted();
             }
             //m_log.Debug("prev: " + prevflag.ToString() + " curr: " + Flags.ToString());
             //ScheduleFullUpdate();


Properly regenerate physics proxy when a mesh is resized.

This is done in SOP.Resize().  More common code from callers needs to be refactored into this method to reduce confusing copy/pasting

--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2831,6 +2831,12 @@
             StoreUndoState();
             m_shape.Scale = scale;

+            // If we're a mesh/sculpt, then we need to tell the physics engine about our new size.  To do this, we
+            // need to reinsert the sculpt data into the shape, since the physics engine deletes it when done to
+            // save memory
+            if (PhysActor != null)
+                CheckSculptAndLoad();
+
             ParentGroup.HasGroupChanged = true;
             ScheduleFullUpdate();
         }
@@ -4619,9 +4625,11 @@
         /// <summary>
         /// Update the textures on the part.
         /// </summary>
+        /// <remarks>
         /// Added to handle bug in libsecondlife's TextureEntry.ToBytes()
         /// not handling RGBA properly. Cycles through, and "fixes" the color
         /// info
+        /// </remarks>
         /// <param name="tex"></param>
         public void UpdateTexture(Primitive.TextureEntry tex)
         {


Sneaky S hiding

Sneaky S hiding

--- Presentation.Web/Controllers/API/UserController.cs
+++ Presentation.Web/Controllers/API/UserController.cs
@@ -243,7 +243,7 @@
                 header.Add("Organisationsenhed", "Default org.enhed");
                 header.Add("Advis", "Advis");
                 header.Add("Oprettet", "Oprettet Af");
-                header.Add("OrgRoller", "Organisations roller"); s
+                header.Add("OrgRoller", "Organisations roller");
                 header.Add("ITProjektRoller", "ITProjekt roller");
                 header.Add("ITSystemRoller", "ITSystem roller");
                 header.Add("ITKontraktRoller", "ITKontrakt roller");


handle mutli line logs correctly

handle mutli line logs correctly

--- ProcessEngineColumnizer/ProcessEngineColumnizer.cs
+++ ProcessEngineColumnizer/ProcessEngineColumnizer.cs
@@ -48,35 +48,49 @@

         public string[] SplitLine(ILogLineColumnizerCallback callback, string line)
         {
+            string[] columnContent = new string[CONST_COLUMNCOUNT];
             // fist split line into || sections (the log4net columns)
             string[] log4netSections = line.Split(splitString, 5, StringSplitOptions.None);

-            //extract process engine context out of message
-            string wholeMessage = log4netSections[4];
-            // find first [ and next ] -> thats the proc eng context
-            // [RunTimeGuid:966728c2-c4b4; WODE:12dd; WOIN:12a; ActivityInstance:'n/a']
-            int firstBracket = wholeMessage.IndexOf("[");
-            int lastBracket = wholeMessage.IndexOf("]");
+            //in case its a multiline log move whole content to Message column
+            //there wont be 5 sections separated with ||
+            if (log4netSections.Length < 5)
+            {
+                columnContent[0] = "-";
+                columnContent[1] = "-";
+                columnContent[2] = "-";
+                columnContent[3] = "-";
+                columnContent[4] = line;
+            }
+            else
+            {
+                //extract process engine context out of message
+                string wholeMessage = log4netSections[4];
+                // find first [ and next ] -> thats the proc eng context
+                // [RunTimeGuid:966728c2-c4b4; WODE:12dd; WOIN:12a; ActivityInstance:'n/a']
+                int firstBracket = wholeMessage.IndexOf("[");
+                int lastBracket = wholeMessage.IndexOf("]");

-            if (firstBracket < 0)
-                firstBracket = -1;
-            if (lastBracket < 0)
-                lastBracket = wholeMessage.Length - 1;
+                if (firstBracket < 0)
+                    firstBracket = -1;
+                if (lastBracket < 0)
+                    lastBracket = wholeMessage.Length - 1;

-            string procEngContext = wholeMessage.Substring(firstBracket + 1, lastBracket);
-            string msgNoContext = wholeMessage.Substring(lastBracket + 1).Trim();
+                string procEngContext = wholeMessage.Substring(firstBracket + 1, lastBracket);
+                string msgNoContext = wholeMessage.Substring(lastBracket + 1).Trim();

-            if (msgNoContext.StartsWith(":"))
-                msgNoContext = msgNoContext.Substring(1).Trim();
-            if (msgNoContext.StartsWith(":"))
-                msgNoContext = msgNoContext.Substring(1).Trim();
+                if (msgNoContext.StartsWith(":"))
+                    msgNoContext = msgNoContext.Substring(1).Trim();
+                if (msgNoContext.StartsWith(":"))
+                    msgNoContext = msgNoContext.Substring(1).Trim();

-            string[] columnContent = new string[CONST_COLUMNCOUNT];
-            columnContent[0] = log4netSections[0];
-            columnContent[1] = log4netSections[1] + log4netSections[2];
-            columnContent[2] = log4netSections[3];
-            columnContent[3] = procEngContext;
-            columnContent[4] = msgNoContext;
+
+                columnContent[0] = log4netSections[0];
+                columnContent[1] = log4netSections[1] + log4netSections[2];
+                columnContent[2] = log4netSections[3];
+                columnContent[3] = procEngContext;
+                columnContent[4] = msgNoContext;
+            }
             return columnContent;
         }

@@ -87,7 +101,7 @@

         public string GetDescription()
         {
-            return "attempts to make columsn out of logging context e.g. WOIN, Activity, etc...\r\nuse this log4net pattern:\r\n<conversionPattern value=\" % date{ dd MMM yyyy HH:mm: ss,fff}||[% thread] ||% -5level ||% logger ||% message % newline % exception\"/>";
+            return "attempts to make columsn out of logging context e.g. WOIN, Activity, etc...\r\\r\nuse this log4net pattern:\r\n<conversionPattern value=\" % date{ dd MMM yyyy HH:mm: ss,fff}||[% thread] ||% -5level ||% logger ||% message % newline % exception\"/>";
         }

         public string GetName()


Geometry is hard...

Geometry is hard...

--- Pulsar4X/Pulsar4X.Lib/Entities/StarSystemEntity.cs
+++ Pulsar4X/Pulsar4X.Lib/Entities/StarSystemEntity.cs
@@ -61,7 +61,7 @@
             float distX = (float)(posA.X - posB.X);
             float distY = (float)(posA.Y - posB.Y);

-            return (float)Math.Sqrt((distX * distX) - (distY * distY));
+            return (float)Math.Sqrt((distX * distX) + (distY * distY));
         }

         /// <summary>


Added stub for V2 of email batch process.

--- Purchasing.Web/Services/EmailNotificationSender.cs
+++ Purchasing.Web/Services/EmailNotificationSender.cs
@@ -42,17 +42,25 @@
         {
             // always trigger per event emails
             ProcessEmails(EmailPreferences.NotificationTypes.PerEvent);
+            ProcessEmailsV2(EmailPreferences.NotificationTypes.PerEvent);
         }

         public void SendDailyWeeklyNotifications()
         {
             ProcessEmails(EmailPreferences.NotificationTypes.Daily);
+            ProcessEmailsV2(EmailPreferences.NotificationTypes.Daily);

             // send weekly summaries
             if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
             {
                 ProcessEmails(EmailPreferences.NotificationTypes.Weekly);
+                ProcessEmailsV2(EmailPreferences.NotificationTypes.Weekly);
             }
+        }
+
+        private void ProcessEmailsV2(EmailPreferences.NotificationTypes notificationType)
+        {
+            return;
         }

         private void ProcessEmails(EmailPreferences.NotificationTypes notificationType)


Fixes potential race conditions when disposing the Pip package manager.

--- Python/Product/VSInterpreters/PipPackageManager.cs
+++ Python/Product/VSInterpreters/PipPackageManager.cs
@@ -618,11 +618,15 @@
             InstalledFilesChanged?.Invoke(this, EventArgs.Empty);

             var cts = new CancellationTokenSource();
+            var cancellationToken = cts.Token;
             var oldCts = Interlocked.Exchange(ref _currentRefresh, cts);
-            oldCts?.Cancel();
+            try {
+                oldCts?.Cancel();
+            } catch (ObjectDisposedException) {
+            }
             oldCts?.Dispose();

-            CacheInstalledPackagesAsync(false, cts.Token)
+            CacheInstalledPackagesAsync(false, cancellationToken)
                 .SilenceException<OperationCanceledException>()
                 .DoNotWait();
         }


Better check for popup mode

Better check for popup mode

--- R7.University.Employee/ViewEmployeeDetails.ascx.cs
+++ R7.University.Employee/ViewEmployeeDetails.ascx.cs
@@ -77,7 +77,19 @@

         protected bool InPopup
         {
-            get { return Request.QueryString ["popup"] != null; }
+            get {
+                var popupArg = Request.QueryString ["popup"];
+                if (string.IsNullOrEmpty (popupArg)) {
+                    return false;
+                }
+
+                bool popup;
+                if (bool.TryParse (popupArg, out popup)) {
+                    return popup;
+                }
+
+                return false;
+            }
         }

         protected bool InViewModule


Fix test failure

Fix test failure

--- Ref.Windows.Tests/ViewModels/PageViewModelTests.cs
+++ Ref.Windows.Tests/ViewModels/PageViewModelTests.cs
@@ -24,7 +24,7 @@
             vm.Edit();
             vm.PageRange = "34--37";

-            TestUtility.AssertRaisesPropertyChanged(vm, () => vm.Cancel(), "Pages");
+            TestUtility.AssertRaisesPropertyChanged(vm, () => vm.Cancel(), "PageRange");

             Assert.That(vm.IsReadOnly, Is.True);
             Assert.That(vm.PageRange, Is.EqualTo("34"));


[converter] implement nullable types

[converter] implement nullable types

--- RefactoringEssentials/VB/Converter/NodesVisitor.cs
+++ RefactoringEssentials/VB/Converter/NodesVisitor.cs
@@ -1361,6 +1361,11 @@
                 return SyntaxFactory.PredefinedType(SyntaxFactory.Token(ConvertToken(CS.CSharpExtensions.Kind(node.Keyword))));
             }

+            public override VisualBasicSyntaxNode VisitNullableType(CSS.NullableTypeSyntax node)
+            {
+                return SyntaxFactory.NullableType((TypeSyntax)node.ElementType.Accept(this));
+            }
+
             #endregion

             #region NameSyntax


Allow multiple concurrent filter streams

The current implementation of filters in libgit2sharp only allows for
one filter stream per type of filter at any given point in time. This
switches the storage of the necessary state from instance variables on
the Filter class to a dedicated state object which is tracked in a
dictionary keyed on the libgit2 stream pointer.

--- LibGit2Sharp/Filter.cs
+++ LibGit2Sharp/Filter.cs
@@ -1,5 +1,8 @@
 using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
 using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices;
@@ -47,18 +50,34 @@
         ~Filter()
         {
             GlobalSettings.DeregisterFilter(this);
+
+#if LEAKS_IDENTIFYING
+            int activeStreamCount = activeStreams.Count;
+            if (activeStreamCount > 0)
+            {
+                Trace.WriteLine(string.Format(CultureInfo.InvariantCulture, "{0} leaked {1} stream handles at finalization", GetType().Name, activeStreamCount));
+            }
+#endif
         }

         private readonly string name;
         private readonly IEnumerable<FilterAttributeEntry> attributes;
         private readonly GitFilter gitFilter;
-
-        private GitWriteStream thisStream;
-        private GitWriteStream nextStream;
-        private IntPtr thisPtr;
-        private IntPtr nextPtr;
-        private FilterSource filterSource;
-        private Stream output;
+        private readonly ConcurrentDictionary<IntPtr, StreamState> activeStreams = new ConcurrentDictionary<IntPtr, StreamState>();
+
+        /// <summary>
+        /// State bag used to keep necessary reference from being
+        /// garbage collected during filter processing.
+        /// </summary>
+        private class StreamState
+        {
+            public GitWriteStream thisStream;
+            public GitWriteStream nextStream;
+            public IntPtr thisPtr;
+            public IntPtr nextPtr;
+            public FilterSource filterSource;
+            public Stream output;
+        }

         /// <summary>
         /// The name that this filter was registered with
@@ -226,33 +245,44 @@
         int StreamCreateCallback(out IntPtr git_writestream_out, GitFilter self, IntPtr payload, IntPtr filterSourcePtr, IntPtr git_writestream_next)
         {
             int result = 0;
+            var state = new StreamState();

             try
             {
                 Ensure.ArgumentNotZeroIntPtr(filterSourcePtr, "filterSourcePtr");
                 Ensure.ArgumentNotZeroIntPtr(git_writestream_next, "git_writestream_next");

-                thisStream = new GitWriteStream();
-                thisStream.close = StreamCloseCallback;
-                thisStream.write = StreamWriteCallback;
-                thisStream.free = StreamFreeCallback;
-                thisPtr = Marshal.AllocHGlobal(Marshal.SizeOf(thisStream));
-                Marshal.StructureToPtr(thisStream, thisPtr, false);
-                nextPtr = git_writestream_next;
-                nextStream = new GitWriteStream();
-                Marshal.PtrToStructure(nextPtr, nextStream);
-                filterSource = FilterSource.FromNativePtr(filterSourcePtr);
-                output = new WriteStream(nextStream, nextPtr);
-
-                Create(filterSource.Path, filterSource.Root, filterSource.SourceMode);
+                state.thisStream = new GitWriteStream();
+                state.thisStream.close = StreamCloseCallback;
+                state.thisStream.write = StreamWriteCallback;
+                state.thisStream.free = StreamFreeCallback;
+
+                state.thisPtr = Marshal.AllocHGlobal(Marshal.SizeOf(state.thisStream));
+                Marshal.StructureToPtr(state.thisStream, state.thisPtr, false);
+
+                state.nextPtr = git_writestream_next;
+                state.nextStream = new GitWriteStream();
+                Marshal.PtrToStructure(state.nextPtr, state.nextStream);
+
+                state.filterSource = FilterSource.FromNativePtr(filterSourcePtr);
+                state.output = new WriteStream(state.nextStream, state.nextPtr);
+
+                Create(state.filterSource.Path, state.filterSource.Root, state.filterSource.SourceMode);
+
+                if (!activeStreams.TryAdd(state.thisPtr, state))
+                {
+                    // AFAICT this is a theoretical error that could only happen if we manage
+                    // to free the stream pointer but fail to remove the dictionary entry.
+                    throw new InvalidOperationException("Overlapping stream pointers");
+                }
             }
             catch (Exception exception)
             {
                 // unexpected failures means memory clean up required
-                if (thisPtr != IntPtr.Zero)
-                {
-                    Marshal.FreeHGlobal(thisPtr);
-                    thisPtr = IntPtr.Zero;
+                if (state.thisPtr != IntPtr.Zero)
+                {
+                    Marshal.FreeHGlobal(state.thisPtr);
+                    state.thisPtr = IntPtr.Zero;
                 }

                 Log.Write(LogLevel.Error, "Filter.StreamCreateCallback exception");
@@ -261,7 +291,7 @@
                 result = (int)GitErrorCode.Error;
             }

-            git_writestream_out = thisPtr;
+            git_writestream_out = state.thisPtr;

             return result;
         }
@@ -269,16 +299,25 @@
         int StreamCloseCallback(IntPtr stream)
         {
             int result = 0;
+            StreamState state;

             try
             {
                 Ensure.ArgumentNotZeroIntPtr(stream, "stream");
-                Ensure.ArgumentIsExpectedIntPtr(stream, thisPtr, "stream");
-
-                using (BufferedStream outputBuffer = new BufferedStream(output, BufferSize))
-                {
-                    Complete(filterSource.Path, filterSource.Root, outputBuffer);
-                }
+
+                if(!activeStreams.TryGetValue(stream, out state))
+                {
+                    throw new ArgumentException("Unknown stream pointer", "stream");
+                }
+
+                Ensure.ArgumentIsExpectedIntPtr(stream, state.thisPtr, "stream");
+
+                using (BufferedStream outputBuffer = new BufferedStream(state.output, BufferSize))
+                {
+                    Complete(state.filterSource.Path, state.filterSource.Root, outputBuffer);
+                }
+
+                result = state.nextStream.close(state.nextPtr);
             }
             catch (Exception exception)
             {
@@ -288,19 +327,25 @@
                 result = (int)GitErrorCode.Error;
             }

-            result = nextStream.close(nextPtr);
-
             return result;
         }

         void StreamFreeCallback(IntPtr stream)
         {
+            StreamState state;
+
             try
             {
                 Ensure.ArgumentNotZeroIntPtr(stream, "stream");
-                Ensure.ArgumentIsExpectedIntPtr(stream, thisPtr, "stream");
-
-                Marshal.FreeHGlobal(thisPtr);
+
+                if (!activeStreams.TryRemove(stream, out state))
+                {
+                    throw new ArgumentException("Double free or invalid stream pointer", "stream");
+                }
+
+                Ensure.ArgumentIsExpectedIntPtr(stream, state.thisPtr, "stream");
+
+                Marshal.FreeHGlobal(state.thisPtr);
             }
             catch (Exception exception)
             {
@@ -312,24 +357,31 @@
         unsafe int StreamWriteCallback(IntPtr stream, IntPtr buffer, UIntPtr len)
         {
             int result = 0;
+            StreamState state;

             try
             {
                 Ensure.ArgumentNotZeroIntPtr(stream, "stream");
                 Ensure.ArgumentNotZeroIntPtr(buffer, "buffer");
-                Ensure.ArgumentIsExpectedIntPtr(stream, thisPtr, "stream");
+
+                if (!activeStreams.TryGetValue(stream, out state))
+                {
+                    throw new ArgumentException("Invalid or already freed stream pointer", "stream");
+                }
+
+                Ensure.ArgumentIsExpectedIntPtr(stream, state.thisPtr, "stream");

                 using (UnmanagedMemoryStream input = new UnmanagedMemoryStream((byte*)buffer.ToPointer(), (long)len))
-                using (BufferedStream outputBuffer = new BufferedStream(output, BufferSize))
-                {
-                    switch (filterSource.SourceMode)
+                using (BufferedStream outputBuffer = new BufferedStream(state.output, BufferSize))
+                {
+                    switch (state.filterSource.SourceMode)
                     {
                         case FilterMode.Clean:
-                            Clean(filterSource.Path, filterSource.Root, input, outputBuffer);
+                            Clean(state.filterSource.Path, state.filterSource.Root, input, outputBuffer);
                             break;

                         case FilterMode.Smudge:
-                            Smudge(filterSource.Path, filterSource.Root, input, outputBuffer);
+                            Smudge(state.filterSource.Path, state.filterSource.Root, input, outputBuffer);
                             break;

                         default:


復帰時の処理を修正

復帰時の処理を修正

--- Libraries/Scheduler.cs
+++ Libraries/Scheduler.cs
@@ -426,10 +426,16 @@
         {
             if (!PowerModeAware) return;

+            var previous = State;
+
             switch (PowerMode)
             {
                 case PowerModes.Resume:
-                    if (State == SchedulerState.Suspend) Resume();
+                    if (State == SchedulerState.Suspend)
+                    {
+                        Resume();
+                        if (DateTime.Now - LastExecuted > Interval) RaiseExecute();
+                    }
                     break;
                 case PowerModes.StatusChange:
                     break;
@@ -440,7 +446,7 @@
                     break;
             }

-            this.LogDebug($"State:{State}\tPowerMode:{PowerMode}");
+            this.LogDebug($"PowerMode:{PowerMode}\tState:{previous}->{State}");
         }

         #endregion


[SFSRAP-6] Code review changes.

[SFSRAP-6] Code review changes.

--- RoslynPluginGenerator/DiagnosticAssemblyScanner.cs
+++ RoslynPluginGenerator/DiagnosticAssemblyScanner.cs
@@ -18,7 +18,7 @@
 namespace SonarQube.Plugins.Roslyn
 {
     /// <summary>
-    /// Searches for and instantiates Roslyn analyzers in unknown
+    /// Searches for and instantiates Roslyn analyzers in unknown folders and/or assemblies.
     /// </summary>
     public class DiagnosticAssemblyScanner
     {
@@ -53,7 +53,7 @@
         /// <see cref="DiagnosticAnalyzer"/>
         /// </summary>
         /// <returns>empty enumerable if no diagnostics were found</returns>
-        public IEnumerable<DiagnosticAnalyzer> InstantiateDiagnosticsFromAssembly(string assemblyPath, string language)
+        private IEnumerable<DiagnosticAnalyzer> InstantiateDiagnosticsFromAssembly(string assemblyPath, string language)
         {
             Assembly analyzerAssembly = LoadAnalyzerAssembly(assemblyPath);
             IEnumerable<DiagnosticAnalyzer> analyzers = null;


Callin SDelete

Callin SDelete

--- SDelete-Gui/SDelete-Gui/ViewModel/MainViewModel.cs
+++ SDelete-Gui/SDelete-Gui/ViewModel/MainViewModel.cs
@@ -27,7 +27,7 @@

         private void ExecuteInstall()
         {
-            AddContextMenuToFiles("prueba", "notepad.exe %1");
+            AddContextMenuToFiles("Borrado Seguro", "sdelete -p 10 -s -q \"%1\"");
         }


Added SeverityLevel return for Critical levels.

--- SLAB_AI/SLAB_AI/Utility/LogEventLevelExtensions.cs
+++ SLAB_AI/SLAB_AI/Utility/LogEventLevelExtensions.cs
@@ -29,10 +29,11 @@
                 case EventLevel.Error:
                     return SeverityLevel.Error;
                 case EventLevel.Critical:
+                    return SeverityLevel.Critical;
                 case EventLevel.LogAlways:
-                    return SeverityLevel.Critical;
+                    return SeverityLevel.Critical;
                 default:
-                    throw new ArgumentOutOfRangeException("EventLevel", logEventLevel, "The EventLevel is not recognized.");
+                    throw new ArgumentOutOfRangeException("EventLevel", logEventLevel, "The EventLevel is not recognized or out of range.");
             }
         }


[CFM_752] Stolen Goods

[CFM_752] Stolen Goods

--- SabberStoneCore/CardSets/Standard/GangsCardsGen.cs
+++ SabberStoneCore/CardSets/Standard/GangsCardsGen.cs
@@ -1703,11 +1703,13 @@
 			// - TAUNT = 1
 			// --------------------------------------------------------
 			cards.Add("CFM_752", new List<Enchantment> {
-				// TODO [CFM_752] Stolen Goods && Test: Stolen Goods_CFM_752
-				new Enchantment
-				{
-					Activation = EnchantmentActivation.SPELL,
-					SingleTask = null,
+				new Enchantment
+				{
+					Activation = EnchantmentActivation.SPELL,
+					SingleTask = ComplexTask.BuffRandomMinion(
+                        EntityType.HAND,
+                        Buffs.AttackHealth(3),
+                        SelfCondition.IsTagValue(GameTag.TAUNT, 1)),
 				},
 			});


Change default view template to MlokTemplatePage

--- src/umbraco.cms/businesslogic/template/ViewHelper.cs
+++ src/umbraco.cms/businesslogic/template/ViewHelper.cs
@@ -105,10 +105,14 @@

             if (string.IsNullOrEmpty(design))
             {
-                design = @"@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
-@{
-    Layout = null;
-}";
+                design = @"@inherits MlokTemplatePage
++@using Mlok.SitesFramework;
++@using Mlok.SitesFramework.Mvc;
++@using Mlok.SitesFramework.Mvc.Controls;
+ @{
+     Layout = null;
+ }";
+

                 if (template.MasterTemplate > 0)
                     design = design.Replace("null", string.Format("\"{0}.cshtml\"", new Template(template.MasterTemplate).Alias.Replace(" ", "")));


fixed image order in ReplaceMultipleImages

--- Signum.Engine.Extensions/Word/WordImageReplacer.cs
+++ Signum.Engine.Extensions/Word/WordImageReplacer.cs
@@ -67,7 +67,7 @@
             doc.MainDocumentPart.DeletePart(blips.First().Embed);

             var i = 0;
-            var bitmapStack = new Stack<Bitmap>(bitmaps);
+            var bitmapStack = new Stack<Bitmap>(bitmaps.Reverse());
             foreach (var blip in blips)
             {
                 ImagePart img = CreateImagePart(doc, bitmapStack.Pop(), newImagePartId + i, imagePartType);


Added test to ensure appending a node will include that node's next nodes

--- csharp/src/BackToBasics/SinglyLinkedListTests.cs
+++ csharp/src/BackToBasics/SinglyLinkedListTests.cs
@@ -50,7 +50,7 @@
 		}

 		[Test]
-		public void Append_node_to_end_of_single_item_list()
+		public void Append_single_node_to_end_of_single_item_list()
 		{
 			var list = new SinglyLinkedList<int>(new ListNode<int>(12));

@@ -62,7 +62,7 @@
 		}

 		[Test]
-		public void Append_node_to_end_of_multiple_item_list()
+		public void Append_single_node_to_end_of_multiple_item_list()
 		{
 			var head = new ListNode<int>(12) { Next = new ListNode<int>(77) };
 			var list = new SinglyLinkedList<int>(head);
@@ -75,7 +75,7 @@
 		}

 		[Test]
-		public void Append_node_to_empty_list()
+		public void Append_single_node_to_empty_list()
 		{
 			var list = new SinglyLinkedList<int>(null);

@@ -84,6 +84,19 @@

 			Assert.That(list.Length, Is.EqualTo(1));
 			Assert.That(list.Head, Is.EqualTo(node));
+		}
+
+		[Test]
+		public void Append_multiple_nodes_to_end_of_single_item_list()
+		{
+			var list = new SinglyLinkedList<int>(new ListNode<int>(12));
+
+			var node = new ListNode<int>(42) { Next = new ListNode<int>(99) };
+			list.Append(node);
+
+			Assert.That(list.Length, Is.EqualTo(3));
+			Assert.That(list.Head.Next, Is.EqualTo(node));
+			Assert.That(list.Head.Next.Next, Is.EqualTo(node.Next));
 		}

 		[Test]


EmptyList: comments

EmptyList: comments

--- projects/Epicycle.Commons_cs/Collections/EmptyList.cs
+++ projects/Epicycle.Commons_cs/Collections/EmptyList.cs
@@ -20,8 +20,15 @@

 namespace Epicycle.Commons.Collections
 {
+    /// <summary>
+    /// Contains an empty list of type T.
+    /// </summary>
+    /// <typeparam name="T">The empty list's elemets type.</typeparam>
     public static class EmptyList<T>
     {
+        /// <summary>
+        /// Empty read-only list.
+        /// </summary>
         public static readonly IReadOnlyList<T> Instance = new T[0];
     }
 }


Changed API Endpoint.

Changed API Endpoint.

--- mangasurvfetcher/Rest/RestController.cs
+++ mangasurvfetcher/Rest/RestController.cs
@@ -18,7 +18,11 @@

     public class RestController
     {
+#if RELEASE
+        public const string API_URL = "http://192.168.178.70:5000/api";
+#else
         public const string API_URL = "http://localhost:50107/api";
+#endif

         private readonly Uri Url;


Four4Sample - NaN propagation for addition

--- projects/Four4Sample/Four4.Test/CalculationTest.cs
+++ projects/Four4Sample/Four4.Test/CalculationTest.cs
@@ -53,6 +53,7 @@
         [InlineData("4 .4 +", "22/5")]
         [InlineData(".4 .44 4 + +", "121/25")]
         [InlineData("4 44 + 4 +", "52")]
+        [InlineData("4 4 4 - / 4 +", "NaN")]
         public void Addition(string input, string result)
         {
             Calc(input, result);


Add some initial material parsing code

Add some initial material parsing code

--- GUI/Types/Renderer/Renderer.cs
+++ GUI/Types/Renderer/Renderer.cs
@@ -42,6 +42,8 @@
         private Vector3 MaxBounds;

         private int MaxTextureMaxAnisotropy;
+
+        private List<Material> materials = new List<Material>();

         private struct drawCall
         {
@@ -67,6 +69,24 @@
         {
             public uint id;
             public uint offset;
+        }
+
+        private struct Material
+        {
+            public string name;
+            public string shaderName;
+            public Dictionary<string, int> intParams;
+            public Dictionary<string, float> floatParams;
+            public Dictionary<string, Vector4> vectorParams;
+            public Dictionary<string, long> textureParams;
+            //public Dictionary<string, ????> dynamicParams;
+            //public Dictionary<string, ????> dynamicTextureParams;
+            public Dictionary<string, int> intAttributes;
+            public Dictionary<string, float> floatAttributes;
+            public Dictionary<string, Vector4> vectorAttributes;
+            public Dictionary<string, long> textureAttributes;
+            public Dictionary<string, string> stringAttributes;
+            public string[] renderAttributesUsed; // ?
         }

         public Renderer(Resource resource, TabControl mainTabs)
@@ -488,6 +508,7 @@
             Console.WriteLine("Loading material " + name);

             string path = Utils.FileExtensions.FindResourcePath(name);
+            var mat = new Material();

             if (path == null)
             {
@@ -505,6 +526,74 @@
                 Console.WriteLine("File " + resource.ExternalReferences.ResourceRefInfoList[0].Name + " not found");
                 return 1;
             }
+
+            var matData = (NTRO) resource.Blocks[BlockType.DATA];
+            mat.name =  ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<string>)matData.Output["m_materialName"]).Value;
+            mat.shaderName = ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<string>)matData.Output["m_shaderName"]).Value;
+            //mat.renderAttributesUsed = ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<string>)matData.Output["m_renderAttributesUsed"]).Value; //TODO: string array?
+
+            var intParams = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_intParams"];
+            mat.intParams = new Dictionary<string, int>();
+            for (int i = 0; i < intParams.Count; i++)
+            {
+                var subStruct = ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<ValveResourceFormat.ResourceTypes.NTROSerialization.NTROStruct>)intParams[i]).Value;
+                mat.intParams.Add(((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<string>)subStruct["m_name"]).Value, ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<int>)subStruct["m_nValue"]).Value);
+            }
+
+            var floatParams = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_floatParams"];
+            mat.floatParams = new Dictionary<string, float>();
+            for (int i = 0; i < floatParams.Count; i++)
+            {
+                var subStruct = ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<ValveResourceFormat.ResourceTypes.NTROSerialization.NTROStruct>)floatParams[i]).Value;
+                mat.floatParams.Add(((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<string>)subStruct["m_name"]).Value, ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<float>)subStruct["m_flValue"]).Value);
+            }
+
+            var vectorParams = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_vectorParams"];
+            mat.vectorParams = new Dictionary<string, Vector4>();
+            for (int i = 0; i < vectorParams.Count; i++)
+            {
+                var subStruct = ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<ValveResourceFormat.ResourceTypes.NTROSerialization.NTROStruct>)vectorParams[i]).Value;
+                var ntroVector = ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<ValveResourceFormat.ResourceTypes.NTROSerialization.Vector4>)subStruct["m_value"]).Value;
+                mat.vectorParams.Add(((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<string>)subStruct["m_name"]).Value, new Vector4(ntroVector.field0, ntroVector.field1, ntroVector.field2, ntroVector.field3));
+            }
+
+            var textureParams = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_textureParams"];
+            mat.textureParams = new Dictionary<string, long>();
+            //TODO
+
+            var dynamicParams = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_dynamicParams"];
+            var dynamicTextureParams = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_dynamicTextureParams"];
+
+            var intAttributes = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_intAttributes"];
+            mat.intAttributes = new Dictionary<string, int>();
+            for(int i = 0; i < intAttributes.Count; i++)
+            {
+                var subStruct = ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<ValveResourceFormat.ResourceTypes.NTROSerialization.NTROStruct>) intAttributes[i]).Value;
+                mat.intAttributes.Add(((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<string>)subStruct["m_name"]).Value, ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<int>)subStruct["m_nValue"]).Value);
+            }
+
+            var floatAttributes = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_floatAttributes"];
+            mat.floatAttributes = new Dictionary<string, float>();
+            for (int i = 0; i < floatAttributes.Count; i++)
+            {
+                var subStruct = ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<ValveResourceFormat.ResourceTypes.NTROSerialization.NTROStruct>)floatAttributes[i]).Value;
+                mat.floatAttributes.Add(((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<string>)subStruct["m_name"]).Value, ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<float>)subStruct["m_flValue"]).Value);
+            }
+
+            var vectorAttributes = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_vectorAttributes"];
+            mat.vectorAttributes = new Dictionary<string, Vector4>();
+            for (int i = 0; i < vectorAttributes.Count; i++)
+            {
+                var subStruct = ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<ValveResourceFormat.ResourceTypes.NTROSerialization.NTROStruct>)vectorAttributes[i]).Value;
+                var ntroVector = ((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<ValveResourceFormat.ResourceTypes.NTROSerialization.Vector4>)subStruct["m_value"]).Value;
+                mat.vectorAttributes.Add(((ValveResourceFormat.ResourceTypes.NTROSerialization.NTROValue<string>)subStruct["m_name"]).Value, new Vector4(ntroVector.field0, ntroVector.field1, ntroVector.field2, ntroVector.field3));
+            }
+
+            var textureAttributes = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_textureAttributes"];
+            //TODO
+
+            var stringAttributes = (ValveResourceFormat.ResourceTypes.NTROSerialization.NTROArray)matData.Output["m_stringAttributes"];
+            //TODO

             var textureResource = new Resource();

@@ -573,9 +662,10 @@
             GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
             GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Repeat);
             GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Repeat);
-
+
             // bmp.UnlockBits(bmp_data);

+            materials.Add(mat);
             return id;

         }


New clientlib ver

New clientlib ver

--- KalturaClient/KalturaClient.cs
+++ KalturaClient/KalturaClient.cs
@@ -34,7 +34,7 @@
 		public KalturaClient(KalturaConfiguration config) : base(config)
 		{
 				ApiVersion = "3.3.0";
-				ClientTag = "dotnet:16-05-04";
+				ClientTag = "dotnet:16-05-05";
 		}

 		KalturaAccessControlProfileService _AccessControlProfileService;


Reduce the length of the fadeout animation

--- osu.Game/Screens/Loader.cs
+++ osu.Game/Screens/Loader.cs
@@ -42,7 +42,7 @@
         protected override void LogoSuspending(OsuLogo logo)
         {
             base.LogoSuspending(logo);
-            logo.FadeOut(logo.Alpha * 1000);
+            logo.FadeOut(logo.Alpha * 400);
         }

         private OsuScreen loadScreen;


Read registry only from windows os

Read registry only from windows os

--- src/SdkCommon/ClientRuntime/ClientRuntime/ServiceClient.cs
+++ src/SdkCommon/ClientRuntime/ClientRuntime/ServiceClient.cs
@@ -112,6 +112,14 @@
         /// <returns>Value for provided HKLM key</returns>
         private string ReadHKLMRegistry(string path, string key)
         {
+            switch (Environment.OSVersion.Platform)
+            {
+                case PlatformID.Unix:
+                case PlatformID.MacOSX:
+                case PlatformID.Xbox:
+                    return string.Empty;
+            }
+
             try
             {
                 using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(path))