Fixed GridViewPagingSorting tests

Fixed GridViewPagingSorting tests

--- src/DotVVM.Samples.Common/ViewModels/ControlSamples/GridView/GridViewPagingSortingViewModel.cs
+++ src/DotVVM.Samples.Common/ViewModels/ControlSamples/GridView/GridViewPagingSortingViewModel.cs
@@ -34,17 +34,13 @@
             }.AsQueryable();
         }

-        public GridViewDataSet<CustomerData> CustomersDataSet { get; set; } = new GridViewDataSet<CustomerData>()
-        {
-            PagingOptions = new PagingOptions()
-            {
+        public GridViewDataSet<CustomerData> CustomersDataSet { get; set; } = new GridViewDataSet<CustomerData>() {
+            PagingOptions = new PagingOptions() {
                 PageSize = 10
             }
         };
-        public GridViewDataSet<CustomerData> EmptyCustomersDataSet { get; set; } = new GridViewDataSet<CustomerData>()
-        {
-            PagingOptions = new PagingOptions()
-            {
+        public GridViewDataSet<CustomerData> EmptyCustomersDataSet { get; set; } = new GridViewDataSet<CustomerData>() {
+            PagingOptions = new PagingOptions() {
                 PageSize = 10
             }
         };
@@ -87,6 +83,7 @@
             }
             else
             {
+                CustomersDataSet.PagingOptions.PageIndex = 0;
                 CustomersDataSet.SortingOptions.SortExpression = "BirthDate";
                 CustomersDataSet.SortingOptions.SortDescending = false;
             }


Updated Logging (#738)

Updated Logging (#738)

--- src/MigrationTools.Clients.AzureDevops.ObjectModel/_Enginev1/Clients/TfsReflectedWorkItemId.cs
+++ src/MigrationTools.Clients.AzureDevops.ObjectModel/_Enginev1/Clients/TfsReflectedWorkItemId.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Text.RegularExpressions;
-using MigrationTools;
 using MigrationTools._EngineV1.DataContracts;
 using Serilog;

@@ -38,6 +37,7 @@
                 _WorkItemId = match.Groups["id"].Value;
                 _ProjectName = match.Groups["project"].Value;
                 _Connection = new Uri(match.Groups["org"].Value);
+                Log.Verbose("TfsReflectedWorkItemId: Match Sucess from {ReflectedWorkItemId}: {@ReflectedWorkItemIdObject}", ReflectedWorkItemId, this);
             }
             else
             {
@@ -48,6 +48,18 @@

         public override string ToString()
         {
+            if (_Connection is null)
+            {
+                throw new ArgumentNullException(nameof(_Connection));
+            }
+            if (_ProjectName is null)
+            {
+                throw new ArgumentNullException(nameof(_ProjectName));
+            }
+            if (_WorkItemId is null)
+            {
+                throw new ArgumentNullException(nameof(_WorkItemId));
+            }
             return string.Format("{0}/{1}/_workitems/edit/{2}", _Connection.ToString().TrimEnd('/'), _ProjectName, _WorkItemId);
         }
     }


Fixed issue with delta handling for listinstance fieldrefs

--- OfficeDevPnP.Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/ObjectListInstance.cs
+++ OfficeDevPnP.Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/ObjectListInstance.cs
@@ -88,7 +88,7 @@
                                 }
                                 else
                                 {
-                                    UpdateFieldRef(field, fieldRef);
+                                    UpdateFieldRef(listInfo.SiteList, field.Id, fieldRef);
                                 }
                             }

@@ -255,28 +255,34 @@
             }
         }

-        private static void UpdateFieldRef(Field field, FieldRef fieldRef)
-        {
+        private static void UpdateFieldRef(List siteList, Guid fieldId, FieldRef fieldRef)
+        {
+            // find the field in the list
+            var listField = siteList.Fields.GetById(fieldId);
+
+            siteList.Context.Load(listField, f => f.Title, f => f.Hidden, f => f.Required);
+            siteList.Context.ExecuteQueryRetry();
+
             var isDirty = false;
-            if (!string.IsNullOrEmpty(fieldRef.DisplayName) && fieldRef.DisplayName != field.Title)
-            {
-                field.Title = fieldRef.DisplayName;
+            if (!string.IsNullOrEmpty(fieldRef.DisplayName) && fieldRef.DisplayName != listField.Title)
+            {
+                listField.Title = fieldRef.DisplayName;
                 isDirty = true;
             }
-            if (fieldRef.Hidden != field.Hidden)
-            {
-                field.Hidden = fieldRef.Hidden;
+            if (fieldRef.Hidden != listField.Hidden)
+            {
+                listField.Hidden = fieldRef.Hidden;
                 isDirty = true;
             }
-            if (fieldRef.Required != field.Required)
-            {
-                field.Required = fieldRef.Required;
+            if (fieldRef.Required != listField.Required)
+            {
+                listField.Required = fieldRef.Required;
                 isDirty = true;
             }
             if (isDirty)
             {
-                field.UpdateAndPushChanges(true);
-                field.Context.ExecuteQueryRetry();
+                listField.UpdateAndPushChanges(true);
+                siteList.Context.ExecuteQueryRetry();
             }
         }


Ensure the mode is Convert by default in AudioBufferWriter

--- source/Cosmos.System2/Audio/IO/AudioBufferWriter.cs
+++ source/Cosmos.System2/Audio/IO/AudioBufferWriter.cs
@@ -63,6 +63,8 @@
                     buffer = new byte[
                         Math.Max(writeFormat.ChannelSize, target.format.ChannelSize) * Math.Max(writeFormat.channels, target.format.channels)
                     ];
+
+                    mode = OperationMode.Convert;
                 }
             }
         }


Add checksum computation for incoming packets (disabled for now)

--- source/Cosmos.System2/Network/IPv4/TCP/TCPPacket.cs
+++ source/Cosmos.System2/Network/IPv4/TCP/TCPPacket.cs
@@ -33,7 +33,7 @@
         protected int headerLenght;
         protected int flags;
         protected int wsValue;
-        protected int checksum;
+        protected ushort checksum;
         protected int urgentPointer;

         protected List<TCPOption> options = null;
@@ -50,10 +50,17 @@

             Global.mDebugger.Send("[Received] TCP packet from " + packet.SourceIP.ToString() + ":" + packet.SourcePort.ToString());

-            var receiver = TcpClient.GetClient(packet.DestinationPort);
-            if (receiver != null)
-            {
-                receiver.ReceiveData(packet);
+            if (packet.CheckCRC())
+            {
+                var receiver = TcpClient.GetClient(packet.DestinationPort);
+                if (receiver != null)
+                {
+                    receiver.ReceiveData(packet);
+                }
+            }
+            else
+            {
+                Global.mDebugger.Send("Checksum incorrect! Packet passed.");
             }
         }

@@ -257,6 +264,26 @@
             return header;
         }

+        /// <summary>
+        /// Check TCP Checksum
+        /// </summary>
+        /// <returns>True if checksum correct, False otherwise.</returns>
+        public bool CheckCRC()
+        {
+            /*byte[] header = MakeHeader();
+
+            if (CalcOcCRC(header, 0, header.Length) == checksum)
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }*/
+            return true;
+        }
+
+
         internal ushort DestinationPort
         {
             get { return destinationPort; }


Fix #222

Fix #222

--- source/FFImageLoading.Touch/Work/ImageLoaderTask.cs
+++ source/FFImageLoading.Touch/Work/ImageLoaderTask.cs
@@ -361,7 +361,7 @@
 					downsampleHeight = downsampleHeight.PointsToPixels();
 				}

-				imageIn = nsdata.ToImage(new CoreGraphics.CGSize(downsampleWidth, downsampleHeight), _imageScale, NSDataExtensions.RCTResizeMode.ScaleAspectFill, imageInformation);
+				imageIn = nsdata.ToImage(new CoreGraphics.CGSize(downsampleWidth, downsampleHeight), ScaleHelper.Scale, NSDataExtensions.RCTResizeMode.ScaleAspectFill, imageInformation);
 			}
 			else if (Parameters.DownSampleSize != null && imageIn != null)
 			{


Testausgabe erweitert

Testausgabe erweitert

git-tfs-id: [https://tfs.codeplex.com:443/tfs/TFS15]$/cyan;C8867

--- source/IntegrationTest_DistributedEvents/Program.cs
+++ source/IntegrationTest_DistributedEvents/Program.cs
@@ -90,11 +90,16 @@

             _proxyCallbackSingleton.DoSomething();
             if (_callbackCountSingleton == 1)
+            {
                 successCount++;
-
+                Console.WriteLine("Singleton Callback Test passed.");
+            }
             _proxyCallbackSingleCall.DoSomething();
             if (_callbackCountSingleCall == 1)
+            {
                 successCount++;
+                Console.WriteLine("SingleCall Callback Test passed.");
+            }

             RegisterEvents();
             if (_registrationsSingleton == _proxySingleton.Registrations)
@@ -104,11 +109,17 @@

             _proxySingleton.TriggerEvent();
             if (_firedCountSingleton == 1)
+            {
                 successCount++;
+                Console.WriteLine("Singleton Event Test passed.");
+            }

             _proxySingleCall.TriggerEvent();
             if (_firedCountSingleCall == 1)
+            {
                 successCount++;
+                Console.WriteLine("SingleCall Event Test passed.");
+            }

             UnregisterEvents();
             if (_registrationsSingleton == _proxySingleton.Registrations)


Fixed clash code w/ enemy

Fixed clash code w/ enemy

--- Concerto/Assets/Scripts/Player/Platformer.cs
+++ Concerto/Assets/Scripts/Player/Platformer.cs
@@ -323,11 +323,10 @@
     /// </summary>
     void Clash()
     {
-        //normal of this to Enemy
-        if(Vector2.Dot(transform.position, currentEnemy.GetComponent<Rigidbody2D>().transform.position) < 0)
-            lerpDestination = new Vector2(transform.position.x - lerpDistance, transform.position.y );
-        else
+        if (flipped)
             lerpDestination = new Vector2(transform.position.x + lerpDistance, transform.position.y);
+        else
+            lerpDestination = new Vector2(transform.position.x - lerpDistance, transform.position.y);
     }

     /// <summary>


Add Load, save, run ticks, save test to ensure map is inert.

--- Content.IntegrationTests/SaveLoadSaveTest.cs
+++ Content.IntegrationTests/SaveLoadSaveTest.cs
@@ -2,6 +2,7 @@
 using System.Threading.Tasks;
 using NUnit.Framework;
 using Robust.Server.Interfaces.Maps;
+using Robust.Server.Interfaces.Timing;
 using Robust.Shared.Interfaces.Map;
 using Robust.Shared.Interfaces.Resources;
 using Robust.Shared.Map;
@@ -50,5 +51,57 @@

             Assert.That(one, Is.EqualTo(two));
         }
+
+        /// <summary>
+        ///     Loads the default map, runs it for 5 ticks, then assert that it did not change.
+        /// </summary>
+        [Test]
+        public async Task LoadSaveTicksSaveStationStation()
+        {
+            var server = StartServer();
+            await server.WaitIdleAsync();
+            var mapLoader = server.ResolveDependency<IMapLoader>();
+            var mapManager = server.ResolveDependency<IMapManager>();
+            var pauseMgr = server.ResolveDependency<IPauseManager>();
+
+            IMapGrid grid = default;
+
+            // Load stationstation.yml as uninitialized map, and save it to ensure it's up to date.
+            server.Post(() =>
+            {
+                var map = mapManager.CreateMap();
+                pauseMgr.AddUninitializedMap(map);
+                grid = mapLoader.LoadBlueprint(map, "Maps/stationstation.yml");
+                mapLoader.SaveBlueprint(grid.Index, "load save ticks save 1.yml");
+            });
+
+            // Run 5 ticks.
+            server.RunTicks(5);
+
+            server.Post(() =>
+            {
+                mapLoader.SaveBlueprint(grid.Index, "load save ticks save 2.yml");
+            });
+
+            await server.WaitIdleAsync();
+            var userData = server.ResolveDependency<IResourceManager>().UserData;
+
+            string one;
+            string two;
+
+            using (var stream = userData.Open(new ResourcePath("load save ticks save 1.yml"), FileMode.Open))
+            using (var reader = new StreamReader(stream))
+            {
+                one = reader.ReadToEnd();
+            }
+
+            using (var stream = userData.Open(new ResourcePath("load save ticks save 2.yml"), FileMode.Open))
+            using (var reader = new StreamReader(stream))
+            {
+                two = reader.ReadToEnd();
+            }
+
+            Assert.That(one, Is.EqualTo(two));
+        }
     }
 }


invitation token

invitation token

--- Controllers/Models/OrganizationController.cs
+++ Controllers/Models/OrganizationController.cs
@@ -1,4 +1,5 @@
-using App.Models;
+using App.Mailers;
+using App.Models;
 using Scaffold;
 using System;
 using System.Collections.Generic;
@@ -52,6 +53,7 @@
             var roles = new List<string>{ Role.VOLUNTEER};
             User inviter = KawalDesaController.GetCurrentUser();
             var token = InvitationToken.Create(dbContext, email, inviter, org, roles, new List<Region>());
+            new UserMailer().Invitation(token).Deliver();
             return token.User;
         }


--- Core/OfficeDevPnP.Core.Tests/ALM/ALMTests.cs
+++ Core/OfficeDevPnP.Core.Tests/ALM/ALMTests.cs
@@ -150,39 +150,40 @@
             }
         }

-        [TestMethod]
-        public async Task InstallUninstallTestAsync()
-        {
-            using (var clientContext = TestCommon.CreateClientContext())
-            {
-                AppManager manager = new AppManager(clientContext);
+        // No point in having this test as we can't wait for the installation to fully complete before calling uninstall
+        //[TestMethod]
+        //public async Task InstallUninstallTestAsync()
+        //{
+        //    using (var clientContext = TestCommon.CreateClientContext())
+        //    {
+        //        AppManager manager = new AppManager(clientContext);

-                var appBytes = OfficeDevPnP.Core.Tests.Properties.Resources.alm;
+        //        var appBytes = OfficeDevPnP.Core.Tests.Properties.Resources.alm;

-                var appMetadata = await manager.AddAsync(appBytes, $"app-{appGuid}.sppkg", true);
+        //        var appMetadata = await manager.AddAsync(appBytes, $"app-{appGuid}.sppkg", true);

-                Assert.IsNotNull(appMetadata);
+        //        Assert.IsNotNull(appMetadata);

-                var installResults = await manager.InstallAsync(appMetadata);
+        //        var installResults = await manager.InstallAsync(appMetadata);

-                Assert.IsTrue(installResults);
+        //        Assert.IsTrue(installResults);

-                //TODO: Better test required
-                /*
-                var installedMetadata = await manager.GetAvailableAsync(appMetadata.Id);
+        //        //TODO: Better test required
+        //        /*
+        //        var installedMetadata = await manager.GetAvailableAsync(appMetadata.Id);

-                Thread.Sleep(10000); // sleep 10 seconds
+        //        Thread.Sleep(10000); // sleep 10 seconds

-                Assert.IsTrue(installedMetadata.InstalledVersion != null);
-                */
+        //        Assert.IsTrue(installedMetadata.InstalledVersion != null);
+        //        */

-                var uninstallResults = await manager.UninstallAsync(appMetadata);
+        //        var uninstallResults = await manager.UninstallAsync(appMetadata);

-                Assert.IsTrue(uninstallResults);
+        //        Assert.IsTrue(uninstallResults);

-                await manager.RemoveAsync(appMetadata);
-            }
-        }
+        //        await manager.RemoveAsync(appMetadata);
+        //    }
+        //}
     }
 }
 #endif


Remove directory names from Event Log names

--- src/Ampla.LogReader/EventLogs/FileEventLogReader.cs
+++ src/Ampla.LogReader/EventLogs/FileEventLogReader.cs
@@ -16,6 +16,20 @@
             this.limitEntries = limitEntries;
         }

+        private static string RemoveDirectoryNames(string logName)
+        {
+            // sometimes the EventLog.LogName will include full filenames
+            if (logName.Contains(@"\"))
+            {
+                if (File.Exists(logName))
+                {
+                    return new FileInfo(logName).Name;
+                }
+                return logName.Replace("\\", "_");
+            }
+            return logName;
+        }
+
         protected override List<SimpleEventLogEntry> ReadEntries()
         {
             List<SimpleEventLogEntry> entries = new List<SimpleEventLogEntry>();
@@ -27,7 +41,9 @@
                     int count = 0;
                     if (eventRecord != null)
                     {
-                        Name = eventRecord.LogName;
+                        // Use the name of event log from the records
+                        // may need to remove directory names
+                        Name = RemoveDirectoryNames(eventRecord.LogName);
                         count = 1;
                     }
                     if (limitEntries > 0)


Make ThreadSafeObjectPool actually thread safe

--- src/Avalonia.Base/Threading/ThreadSafeObjectPool.cs
+++ src/Avalonia.Base/Threading/ThreadSafeObjectPool.cs
@@ -5,7 +5,6 @@
     public class ThreadSafeObjectPool<T> where T : class, new()
     {
         private Stack<T> _stack = new Stack<T>();
-        private object _lock = new object();
         public static ThreadSafeObjectPool<T> Default { get; } = new ThreadSafeObjectPool<T>();

         public T Get()
@@ -20,7 +19,7 @@

         public void Return(T obj)
         {
-            lock (_stack)
+            lock (_lock)
             {
                 _stack.Push(obj);
             }


Fix for broken build caused by LibPalaso change

--- src/BloomExe/Collection/CollectionSettingsDialog.cs
+++ src/BloomExe/Collection/CollectionSettingsDialog.cs
@@ -164,7 +164,7 @@
 			using (var dlg = new LanguageLookupDialog())
 			{
 				//at this point, we don't let them customize the national languages
-				dlg.ShowDesiredLanguageNameField = potentiallyCustomName != null;
+				dlg.IsDesiredLanguageNameFieldVisible = potentiallyCustomName != null;

 				var language = new LanguageInfo() { LanguageTag = iso639Code};
 				if (!string.IsNullOrEmpty(potentiallyCustomName))


remove cruft

remove cruft

git-svn-id: fcce7d6ce0ac15bf24f68871b5145d46fc068279@2817 2c1201b4-01cd-e047-a400-b836ae1fbc61

--- src/Boo.Lang.Compiler/Steps/CheckAttributesUsage.cs
+++ src/Boo.Lang.Compiler/Steps/CheckAttributesUsage.cs
@@ -88,10 +88,6 @@
 			}

 			// handle special compiler-supported attributes
-			if (typeof(System.Diagnostics.ConditionalAttribute) == attrType
-				&& null != (node.Arguments[0] as StringLiteralExpression)) {
-				AddStringToNodeAnnotation(node.ParentNode, "ConditionalSymbols", (node.Arguments[0] as StringLiteralExpression).Value);
-			}
 			//TODO: ObsoleteAttribute
 		}

@@ -119,14 +115,6 @@
 		{
 		}

-
-		private static void AddStringToNodeAnnotation(Node node, string annotation, string value)
-		{
-			if (!node.ContainsAnnotation(annotation))
-				node.Annotate(annotation, new List<string>());
-			(node[annotation] as List<string>).Add(value);
-		}
-
 		private static Dictionary<Type, AttributeTargets> _nodesUsageTargets = null;

 		private static void SetupNodesUsageTargetsDictionary()
@@ -150,4 +138,5 @@
 		}

 	}
-}+}
+


Shorter node utilization histogram bars (#4261)

Limit the number of histogram bar segments. For long runs the number of segments
can be counted in hundreds of thousands (for instance a build which took 8061.7s
would generate a single line line 161,235 characters long) which is a bit
excessive and makes viewing text logs with histograms quite painful at times.

This commit implements a scaled approach in which the number of bar elements
calculated with the original formula is subdivided as follows:

 * <= 100 segments remains as-is, scale 1:1, character used: `.`
 * > 100 <= 1000 segments, scale 1:100, character used: `+`
 * > 1000 segments, scale 1:1000, character used: `#`

Additionaly, scale is printed after the histogram bar if it's different than
`1:1`

--- src/Build/BackEnd/Components/Scheduler/Scheduler.cs
+++ src/Build/BackEnd/Components/Scheduler/Scheduler.cs
@@ -2206,7 +2206,34 @@
                 accumulatedDuration += duration;
             }

-            string durationBar = new String('#', (int)(duration / 0.05));
+            // Limit the number of histogram bar segments. For long runs the number of segments can be counted in
+            // hundreds of thousands (for instance a build which took 8061.7s would generate a line 161,235 characters
+            // long) which is a bit excessive. The scales implemented below limit the generated line length to
+            // manageable proportions even for very long runs.
+            int durationElementCount = (int)(duration / 0.05);
+            int scale;
+            char barSegment;
+            if (durationElementCount <= 100)
+            {
+                barSegment = '.';
+                scale = 1;
+            }
+            else if (durationElementCount <= 1000)
+            {
+                barSegment = '+';
+                scale = 100;
+            }
+            else
+            {
+                barSegment = '#';
+                scale = 1000;
+            }
+
+            string durationBar = new string(barSegment, durationElementCount / scale);
+            if (scale > 1)
+            {
+                durationBar = $"{durationBar} (scale 1:{scale})";
+            }
             if (haveNonIdleNode)
             {
                 loggingService.LogComment(context, MessageImportance.Normal, "NodeUtilizationEntry", stringBuilder, duration, accumulatedDuration, durationBar);


A minor change.

A minor change.

--- src/Caliburn.Micro.WP7.Extensions/StorageHandler.cs
+++ src/Caliburn.Micro.WP7.Extensions/StorageHandler.cs
@@ -13,7 +13,7 @@
             getId = getter;
         }

-        StorageCoordinator IStorageHandler.Coordinator { get; set; }
+        public StorageCoordinator Coordinator { get; set; }

         public StorageInstructionBuilder<T> Property(Expression<Func<T, object>> property) {
             var info = (PropertyInfo)property.GetMemberInfo();


Added additional null check.

Added additional null check.

--- src/CatSkald.Roguelike.DungeonGenerator/Maps/Map.cs
+++ src/CatSkald.Roguelike.DungeonGenerator/Maps/Map.cs
@@ -115,6 +115,7 @@
             Throw.IfNull(rooms, nameof(rooms));
             foreach (var room in rooms)
             {
+                Throw.IfNull(room, nameof(room));
                 ThrowD.IfOutsideMap(this, room);
             }


修复递增表达式构建器中的错误。 :dizzy_face:

修复递增表达式构建器中的错误。 :dizzy_face:

--- src/Common/Expressions/IncrementStatementBuilder.cs
+++ src/Common/Expressions/IncrementStatementBuilder.cs
@@ -57,8 +57,6 @@
 			if(context.Source.Features.Support(Feature.Updation.Outputting))
 			{
 				statement.Returning = new ReturningClause();
-
-				statement.Returning.Table.Field((Metadata.IDataEntitySimplexProperty)property);
 				statement.Returning.Append(field, ReturningClause.ReturningMode.Inserted);
 			}
 			else


Still trying to track down a problem that only happens on the build server...

--- src/Couchbase.Lite.Tests.Shared/NotificationTest.cs
+++ src/Couchbase.Lite.Tests.Shared/NotificationTest.cs
@@ -26,6 +26,7 @@
 using Couchbase.Lite;
 using FluentAssertions;

+using Newtonsoft.Json;
 #if !WINDOWS_UWP
 using Xunit;
 using Xunit.Abstractions;
@@ -181,6 +182,8 @@
                     _expectedDocumentChanges.Should()
                         .Contain(args.DocumentID, "because otherwise a rogue notification came");
                     _expectedDocumentChanges.Remove(args.DocumentID);
+
+                    WriteLine($"Expecting {_expectedDocumentChanges.Count} more changes ({JsonConvert.SerializeObject(_expectedDocumentChanges)}");
                     return _expectedDocumentChanges.Count == 0;
                 });
             }


Added extension method for get category

Added extension method for get category

--- src/Eventing.Core/Domain/StreamCategoryAttribute.cs
+++ src/Eventing.Core/Domain/StreamCategoryAttribute.cs
@@ -33,5 +33,16 @@
                         .FirstOrDefault(a => a is StreamCategoryAttribute);
             return att is null ? null : ((StreamCategoryAttribute)att).CategoryName;
         }
+
+        public static string GetCategoryProjectionStream<T>()
+        {
+            return GetCategoryProjectionStream(typeof(T));
+        }
+
+        public static string GetCategoryProjectionStream(Type type)
+        {
+            var category = GetCategory(type);
+            return $"$ce-{category}";
+        }
     }
 }


remove destination_path

remove destination_path

--- tools/gui/starter/ProjectDialog.cs
+++ tools/gui/starter/ProjectDialog.cs
@@ -17,7 +17,7 @@
 		{
 			win.project_name = name_entry.Text;
 			win.source_path = source_entry.Text;
-			win.destination_path = destination_entry.Text;
+			// win.destination_path = destination_entry.Text;
 		}

 		protected void OnSourceButtonClicked (object sender, EventArgs e)
@@ -34,7 +34,7 @@

 			fc.Destroy ();
 		}
-
+/*
 		protected void OnDestinationButtonClicked (object sender, EventArgs e)
 		{
 			Gtk.FileChooserDialog fc = new Gtk.FileChooserDialog("Choose the file to open",
@@ -49,6 +49,7 @@

 			fc.Destroy ();
 		}
+*/
 	}
 }


Bug fixing in Engine (the line clearing the board was missing )

--- src/GameFifteen.UI/GameFifteen.UI.Console/Engine.cs
+++ src/GameFifteen.UI/GameFifteen.UI.Console/Engine.cs
@@ -95,6 +95,7 @@
         protected override void Play()
         {
             this.game.Shuffle();
+            this.printer.ClearBoard();

             while (!this.context.IsGameOver)
             {


Update unit test

Update unit test

--- src/CommitmentsV2/SFA.DAS.CommitmentsV2.Jobs.UnitTests/ScheduledJobs/ImportStandardsJobTests.cs
+++ src/CommitmentsV2/SFA.DAS.CommitmentsV2.Jobs.UnitTests/ScheduledJobs/ImportStandardsJobTests.cs
@@ -22,6 +22,7 @@
         [Test, MoqAutoData]
         public async Task Then_The_Standards_Are_Imported_From_The_Client(
             StandardResponse apiResponse,
+            IEnumerable<StandardSummary> invalidStatusStandards,
             [Frozen] Mock<IApiClient> apiClient,
             [Frozen] Mock<IProviderCommitmentsDbContext> context,
             ImportStandardsJob importStandardsJob
@@ -29,6 +30,7 @@
         {
             //Arrange
             apiResponse.Standards.ToList().ForEach(s => s.Status = "Approved for delivery");
+            apiResponse.Standards.ToList().AddRange(invalidStatusStandards);
             apiClient.Setup(x => x.Get<StandardResponse>(It.IsAny<GetStandardsRequest>())).ReturnsAsync(apiResponse);
             var importedStandards = new List<StandardSummary>();
             context.Setup(d => d.ExecuteSqlCommandAsync("EXEC ImportStandards @standards", It.IsAny<SqlParameter>()))
@@ -123,6 +125,7 @@
         [Test, MoqAutoData]
         public async Task Then_The_StandardsFunding_Items_Are_Imported_From_The_Client(
             StandardResponse apiResponse,
+            IEnumerable<StandardSummary> invalidStatusStandards,
             [Frozen] Mock<IApiClient> apiClient,
             [Frozen] Mock<IProviderCommitmentsDbContext> context,
             ImportStandardsJob importStandardsJob
@@ -130,6 +133,7 @@
         {
             //Arrange
             apiResponse.Standards.ToList().ForEach(s => s.Status = "Approved for delivery");
+            apiResponse.Standards.ToList().AddRange(invalidStatusStandards);
             apiClient.Setup(x => x.Get<StandardResponse>(It.IsAny<GetStandardsRequest>())).ReturnsAsync(apiResponse);
             var importedStandardFunding = new List<FundingPeriodItem>();
             context.Setup(d => d.ExecuteSqlCommandAsync("EXEC ImportStandardsFunding @standardsFunding", It.IsAny<SqlParameter>()))
@@ -170,6 +174,7 @@
         [Test, MoqAutoData]
         public async Task Then_The_StandardOptions_Items_Are_Imported_From_The_Client(
             StandardResponse apiResponse,
+            IEnumerable<StandardSummary> invalidStatusStandards,
             [Frozen] Mock<IApiClient> apiClient,
             [Frozen] Mock<IProviderCommitmentsDbContext> context,
             ImportStandardsJob importStandardsJob
@@ -177,6 +182,7 @@
         {
             //Arrange
             apiResponse.Standards.ToList().ForEach(s => s.Status = "Approved for delivery");
+            apiResponse.Standards.ToList().AddRange(invalidStatusStandards);
             apiClient.Setup(x => x.Get<StandardResponse>(It.IsAny<GetStandardsRequest>())).ReturnsAsync(apiResponse);
             var importedStandardOptions = new List<object>();
             context.Setup(d => d.ExecuteSqlCommandAsync("EXEC ImportStandardOptions @standardOptions", It.IsAny<SqlParameter>()))


New runbook types - Python2, Python3, Bash

--- src/ResourceManagement/Automation/AutomationManagement/Generated/Models/RunbookTypeEnum.cs
+++ src/ResourceManagement/Automation/AutomationManagement/Generated/Models/RunbookTypeEnum.cs
@@ -40,5 +40,11 @@
         public const string GraphPowerShellWorkflow = "GraphPowerShellWorkflow";

         public const string GraphPowerShell = "GraphPowerShell";
+
+        public const string Python2 = "Python2";
+
+        public const string Python3 = "Python3";
+
+        public const string Bash = "Bash";
     }
 }


Remove stale TODO comment

Remove stale TODO comment

--- src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Security/DoNotDisableCertificateValidation.cs
+++ src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Security/DoNotDisableCertificateValidation.cs
@@ -112,8 +112,7 @@
                                             return;
                                         }

-                                        // TODO(LINCHE): This is an issue tracked by #2009. We filter extraneous based on IsImplicit.
-                                        var targetOperations = ImmutableArray.ToImmutableArray(blockOperation.Descendants()).WithoutFullyImplicitOperations();
+                                        var targetOperations = blockOperation.Descendants().ToImmutableArray().WithoutFullyImplicitOperations();
                                         alwaysReturnTrue = AlwaysReturnTrue(targetOperations);
                                         break;
                                 }


one more tweak

one more tweak

--- src/ResourceManagement/ServerManagement/ServerManagement.Tests/ServerManagementTestBase.cs
+++ src/ResourceManagement/ServerManagement/ServerManagement.Tests/ServerManagementTestBase.cs
@@ -31,7 +31,7 @@

         public ServerManagementTestBase(ITestOutputHelper output)
         {
-
+#if WHEN_RUNNING_IN_VS
             // add environment variables so that we can just use the visual studio test runner for doing interactive testing.
             // these get ignored when they are already set.
             Extensions.SetEnvironmentVariableIfNotAlreadySet("TEST_HTTPMOCK_OUTPUT",
@@ -39,7 +39,7 @@
             Extensions.SetEnvironmentVariableIfNotAlreadySet("TEST_CSM_ORGID_AUTHENTICATION",
                 "SubscriptionId=3e82a90d-d19e-42f9-bb43-9112945846ef;BaseUri=https://management.azure.com/;AADAuthEndpoint=https://login.windows.net/");
             Extensions.SetEnvironmentVariableIfNotAlreadySet("AZURE_TEST_MODE", "Record");
-
+#endif
             // since HttpMockServer.Mode doesn't get set until after I'd like to know what state we're in
             // we'll preemptively set it to what it will get set to later anyway.
             HttpMockServer.Mode = "record".Equals(Environment.GetEnvironmentVariable("AZURE_TEST_MODE"),


Pass CancellationToken to GetDeclaredSymbol and remove redundant null checks

--- src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
+++ src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
@@ -176,7 +176,7 @@

             private IEnumerable<TypeInferenceInfo> InferTypeInArrowExpressionClause(ArrowExpressionClauseSyntax arrowClause)
             {
-                var parentSymbol = SemanticModel.GetDeclaredSymbol(arrowClause.Parent);
+                var parentSymbol = SemanticModel.GetDeclaredSymbol(arrowClause.Parent, CancellationToken);
                 var symbolReturnType = GetSymbolReturnType();

                 return symbolReturnType != null
@@ -187,8 +187,8 @@
                 {
                     switch (parentSymbol)
                     {
-                        case IPropertySymbol property: return property?.Type;
-                        case IMethodSymbol method: return method?.ReturnType;
+                        case IPropertySymbol property: return property.Type;
+                        case IMethodSymbol method: return method.ReturnType;
                         default: return null;
                     }
                 }


add custom property validation on devices

--- src/LagoVista.IoT.DeviceAdmin.Models/CustomField.cs
+++ src/LagoVista.IoT.DeviceAdmin.Models/CustomField.cs
@@ -6,6 +6,8 @@
 using LagoVista.IoT.DeviceAdmin.Resources;
 using Newtonsoft.Json;
 using System;
+using System.Linq;
+using LagoVista.Core;
 using System.Collections.Generic;

 namespace LagoVista.IoT.DeviceAdmin.Models
@@ -78,7 +80,59 @@
             };
         }

-        public void Validate(ValidationResult result)
+        public void Validate(string value, ValidationResult result, Actions action)
+        {
+            if(IsRequired && String.IsNullOrEmpty(value))
+            {
+                result.AddUserError($"{Label} is a required field.");
+                return;
+            }
+
+            if(String.IsNullOrEmpty(value))
+            {
+                return;
+            }
+
+
+            switch(FieldType.Value)
+            {
+                case ParameterTypes.DateTime:
+                    if (!value.SuccessfulJSONDate()) result.AddUserError($"Date must be in ISO 8601 format YYYY-MM-DDTHH:MM:SS.SSSZ for {Name}");
+                    break;
+                case ParameterTypes.Decimal:
+                    if(!double.TryParse(value, out double dbl)) result.AddUserError($"Invalid Double Value for {Name}");
+                    break;
+                case ParameterTypes.GeoLocation:
+                    break;
+                case ParameterTypes.Integer:
+                    if (!int.TryParse(value, out int intValue)) result.AddUserError($"Invalid Integer Value for {Name}");
+                    break;
+                case ParameterTypes.State:
+                    if (StateSet == null)
+                    {
+                        result.AddSystemError($"Data type was State, but no state set provided, invalid configuration on {Name}");
+                    }
+                    else if(StateSet.Value == null)
+                    {
+                        result.AddSystemError($"StateSet was present but value was not, invalid configuration on {Name}");
+                    }
+                    else
+                    {
+                        if(!StateSet.Value.States.Where(stat=>stat.Key == value).Any()) result.AddUserError($"Attempt to set property to invalid date {value}, possible values are [{StateSet.Value.States.Select(st=>st.Key).Aggregate((cur, nxt) => cur + "," + nxt)}] for {Name}");
+                    }
+                    break;
+                case ParameterTypes.TrueFalse:
+                    if (value != "true" && value != "false") result.AddUserError($"Value must be [true] or [false] for {Name}");
+                    break;
+                case ParameterTypes.ValueWithUnit:
+                    if (!double.TryParse(value, out double dblVal)) result.AddUserError($"Invalid Number Value for {Name}");
+                    break;
+
+            }
+        }
+
+        [CustomValidator]
+        public void Validate(ValidationResult result, Actions action)
         {
             if (EntityHeader.IsNullOrEmpty(FieldType)) result.AddUserError("Field Type is Required.");

@@ -89,8 +143,7 @@
             else if(FieldType.Value == ParameterTypes.State)
             {
                 if (EntityHeader.IsNullOrEmpty(StateSet)) result.AddUserError("If State Set is selected for the Field Type, you must specify a State Set.");
-            }
-
+            }
         }
     }
 }


HintPaths for additional references, added via mcs.rsp (#437)

--- unity/JetBrains.Rider.Unity.Editor/EditorPlugin/AssetPostprocessors/CsprojAssetPostprocessor.cs
+++ unity/JetBrains.Rider.Unity.Editor/EditorPlugin/AssetPostprocessors/CsprojAssetPostprocessor.cs
@@ -145,7 +145,7 @@
     }

-    private static readonly string  PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH = Path.GetFullPath("Assets/mcs.rsp");
+    private static readonly string PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH = Path.GetFullPath("Assets/mcs.rsp");
     private const string UNITY_PLAYER_PROJECT_NAME = "Assembly-CSharp.csproj";
     private const string UNITY_EDITOR_PROJECT_NAME = "Assembly-CSharp-Editor.csproj";
     private const string UNITY_UNSAFE_KEYWORD = "-unsafe";
@@ -300,17 +300,36 @@

           foreach (var referenceName in referenceList)
           {
-            ApplyCustomReference(referenceName, projectContentElement, xmlns);
-          }
-        }
-      }
-    }
-
-    private static void ApplyCustomReference(string name, XElement projectContentElement, XNamespace xmlns)
+            string hintPath = null;
+            if (PluginSettings.SystemInfoRiderPlugin.operatingSystemFamily == OperatingSystemFamilyRider.Windows)
+            {
+              var unityAppBaseFolder = Path.GetDirectoryName(EditorApplication.applicationPath);
+              var monoDir = new DirectoryInfo(Path.Combine(unityAppBaseFolder, "MonoBleedingEdge/lib/mono"));
+              if (!monoDir.Exists)
+                monoDir = new DirectoryInfo(Path.Combine(unityAppBaseFolder, "Data/MonoBleedingEdge/lib/mono"));
+
+              var newestApiDir = monoDir.GetDirectories("4.*").LastOrDefault();
+              if (newestApiDir != null)
+              {
+                var dllPath = new FileInfo(Path.Combine(newestApiDir.FullName, referenceName));
+                if (dllPath.Exists)
+                  hintPath = dllPath.FullName;
+              }
+            }
+
+            ApplyCustomReference(referenceName, projectContentElement, xmlns, hintPath);
+          }
+        }
+      }
+    }
+
+    private static void ApplyCustomReference(string name, XElement projectContentElement, XNamespace xmlns, string hintPath = null)
     {
       var itemGroup = new XElement(xmlns + "ItemGroup");
       var reference = new XElement(xmlns + "Reference");
       reference.Add(new XAttribute("Include", Path.GetFileNameWithoutExtension(name)));
+      if (!string.IsNullOrEmpty(hintPath))
+        reference.Add(new XElement(xmlns + "HintPath", hintPath));
       itemGroup.Add(reference);
       projectContentElement.Add(itemGroup);
     }


feat: make top miners range configurable

--- src/Miningcore/Api/Controllers/PoolApiController.cs
+++ src/Miningcore/Api/Controllers/PoolApiController.cs
@@ -50,7 +50,7 @@
     #region Actions

     [HttpGet]
-    public async Task<GetPoolsResponse> Get(CancellationToken ct)
+    public async Task<GetPoolsResponse> Get(CancellationToken ct, [FromQuery] uint topMinersRange = 24)
     {
         var response = new GetPoolsResponse
         {
@@ -70,7 +70,7 @@
                 result.TotalBlocks = await cf.Run(con => blocksRepo.GetPoolBlockCountAsync(con, config.Id, ct));
                 result.LastPoolBlockTime = await cf.Run(con => blocksRepo.GetLastPoolBlockTimeAsync(con, config.Id));

-                var from = clock.Now.AddDays(-1);
+                var from = clock.Now.AddHours(-topMinersRange);

                 var minersByHashrate = await cf.Run(con => statsRepo.PagePoolMinersByHashrateAsync(con, config.Id, from, 0, 15, ct));

@@ -110,7 +110,7 @@
     }

     [HttpGet("{poolId}")]
-    public async Task<GetPoolResponse> GetPoolInfoAsync(string poolId, CancellationToken ct)
+    public async Task<GetPoolResponse> GetPoolInfoAsync(string poolId, CancellationToken ct, [FromQuery] uint topMinersRange = 24)
     {
         var pool = GetPool(poolId);

@@ -130,7 +130,7 @@
         response.Pool.TotalBlocks = await cf.Run(con => blocksRepo.GetPoolBlockCountAsync(con, pool.Id, ct));
         response.Pool.LastPoolBlockTime = await cf.Run(con => blocksRepo.GetLastPoolBlockTimeAsync(con, pool.Id));

-        var from = clock.Now.AddDays(-1);
+        var from = clock.Now.AddHours(-topMinersRange);

         response.Pool.TopMiners = (await cf.Run(con => statsRepo.PagePoolMinersByHashrateAsync(con, pool.Id, from, 0, 15, ct)))
             .Select(mapper.Map<MinerPerformanceStats>)
@@ -177,14 +177,14 @@

     [HttpGet("{poolId}/miners")]
     public async Task<MinerPerformanceStats[]> PagePoolMinersAsync(
-        string poolId, [FromQuery] int page, [FromQuery] int pageSize = 15)
+        string poolId, [FromQuery] int page, [FromQuery] int pageSize = 15, [FromQuery] uint topMinersRange = 24)
     {
         var pool = GetPool(poolId);
         var ct = HttpContext.RequestAborted;

         // set range
         var end = clock.Now;
-        var start = end.AddDays(-1);
+        var start = end.AddHours(-topMinersRange);

         var miners = (await cf.Run(con => statsRepo.PagePoolMinersByHashrateAsync(con, pool.Id, start, page, pageSize, ct)))
             .Select(mapper.Map<MinerPerformanceStats>)


Version 1.1.*

Version 1.1.*

--- src/OpenWeatherMap.Net45/Properties/AssemblyInfo.cs
+++ src/OpenWeatherMap.Net45/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
 //
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.1.*")]
 [assembly: AssemblyFileVersion("1.0.0.0")]


delete one duplicate definition of script for jQueryUI

--- src/Orchard.Web/Modules/Orchard.Resources/jQuery.cs
+++ src/Orchard.Web/Modules/Orchard.Resources/jQuery.cs
@@ -20,7 +20,7 @@
             // DEPRECATED - FOR COMPATIBILITY WITH VERSIONS < 1.10
             manifest.DefineScript("jQueryUI_Core").SetDependencies("jQueryUI"); // Core doesn't exist anymore
             manifest.DefineScript("jQueryUI_Widget").SetDependencies("jQueryUI_Widgets"); // Subset has been renamed
-            manifest.DefineStyle("jQueryUI").SetUrl("jquery-ui.min.css", "jquery-ui.css").SetVersion("1.11.2");
+
             manifest.DefineStyle("jQueryUI_Structure").SetUrl("jquery-ui.structure.min.css", "jquery-ui.structure.css").SetVersion("1.11.2");
             manifest.DefineStyle("jQueryUI_Theme").SetUrl("jquery-ui.theme.min.css", "jquery-ui.theme.css").SetVersion("1.11.2");


overload metadata fix

overload metadata fix

https://github.com/peachpiecompiler/peachpie/issues/126

--- src/Peachpie.CodeAnalysis/Symbols/OverrideHelper.cs
+++ src/Peachpie.CodeAnalysis/Symbols/OverrideHelper.cs
@@ -115,9 +115,8 @@
                         }
                     }

-                    // remember m's base declaration cannot be overriden again
-                    var mbase = m.OverriddenMethod;
-                    if (mbase != null)
+                    // already overriden methods cannot be overriden again:
+                    for (var mbase = m.OverriddenMethod; mbase != null; mbase = mbase.OverriddenMethod)
                     {
                         overriden.Add((MethodSymbol)mbase);
                     }


David/Nick #949 - Fixing merge issues

David/Nick #949 - Fixing merge issues

--- src/StockportWebapp/Controllers/GroupsController.cs
+++ src/StockportWebapp/Controllers/GroupsController.cs
@@ -117,14 +117,8 @@
         public async Task<IActionResult> AddAGroup()
         {
             var groupSubmission = new GroupSubmission();
-            var response = await _repository.Get<List<GroupCategory>>();
-            var listOfGroupCategories = response.Content as List<GroupCategory>;
-            if (listOfGroupCategories != null)
-            {
-                groupSubmission.AvailableCategories = listOfGroupCategories.Select(logc => logc.Name).OrderBy(c => c).ToList();
-            }
-
-            var categoryResponse = await _repository.Get<List<GroupCategory>>();
+
+            groupSubmission.AvailableCategories = await GetAvailableGroupCategories();

             return View(groupSubmission);
         }
@@ -134,25 +128,32 @@
         [ServiceFilter(typeof(ValidateReCaptchaAttribute))]
         public async Task<IActionResult> AddAGroup(GroupSubmission groupSubmission)
         {
+            groupSubmission.AvailableCategories = await GetAvailableGroupCategories();
+
+            if (!ModelState.IsValid)
+            {
+                ViewBag.SubmissionError = GetErrorsFromModelState(ModelState);
+                return View(groupSubmission);
+            }
+
+            var successCode = await _groupRepository.SendEmailMessage(groupSubmission);
+            if (successCode == HttpStatusCode.OK) return RedirectToAction("ThankYouMessage");
+
+            ViewBag.SubmissionError = "There was a problem submitting the group, please try again.";
+
+            return View(groupSubmission);
+        }
+
+        private async Task<List<string>> GetAvailableGroupCategories()
+        {
             var response = await _repository.Get<List<GroupCategory>>();
             var listOfGroupCategories = response.Content as List<GroupCategory>;
             if (listOfGroupCategories != null)
             {
-                groupSubmission.AvailableCategories = listOfGroupCategories.Select(logc => logc.Name).OrderBy(c => c).ToList();
-            }
-
-            if (!ModelState.IsValid)
-            {
-                ViewBag.SubmissionError = GetErrorsFromModelState(ModelState);
-                return View(groupSubmission);
-            }
-
-            var successCode = await _groupRepository.SendEmailMessage(groupSubmission);
-            if (successCode == HttpStatusCode.OK) return RedirectToAction("ThankYouMessage");
-
-            ViewBag.SubmissionError = "There was a problem submitting the group, please try again.";
-
-            return View(groupSubmission);
+                return listOfGroupCategories.Select(logc => logc.Name).OrderBy(c => c).ToList();
+            }
+
+            return null;
         }

         [HttpGet]
@@ -638,12 +639,7 @@
             model.Twitter = group.Twitter;
             model.Website = group.Website;

-            var categoryResponse = await _repository.Get<List<GroupCategory>>();
-            var listOfGroupCategories = categoryResponse.Content as List<GroupCategory>;
-            if (listOfGroupCategories != null)
-            {
-                model.AvailableCategories = listOfGroupCategories.Select(logc => logc.Name).OrderBy(c => c).ToList();
-            }
+            model.AvailableCategories = await GetAvailableGroupCategories();

             return View(model);
         }
@@ -657,6 +653,8 @@
             if (!response.IsSuccessful()) return response;

             var group = response.Content as Group;
+
+            model.AvailableCategories = await GetAvailableGroupCategories();

             var categoryResponse = await _repository.Get<List<GroupCategory>>();
             var listOfGroupCategories = categoryResponse.Content as List<GroupCategory>;


Try setting Syncthing console encoding to UTF-8

--- src/SyncTrayzor/SyncThing/SyncThingProcessRunner.cs
+++ src/SyncTrayzor/SyncThing/SyncThingProcessRunner.cs
@@ -102,6 +102,8 @@
                 RedirectStandardInput = true,
                 RedirectStandardError = true,
                 RedirectStandardOutput = true,
+                StandardOutputEncoding = Encoding.UTF8,
+                StandardErrorEncoding = Encoding.UTF8,
             };

             foreach (var kvp in this.EnvironmentalVariables)


Changes to get security zone when urlmon.dll is not present (#2625)

--- src/System.Management.Automation/utils/ClrFacade.cs
+++ src/System.Management.Automation/utils/ClrFacade.cs
@@ -23,6 +23,8 @@
 using System.Runtime.Loader; /* used in facade APIs related to assembly operations */
 using System.Management.Automation.Host;          /* used in facade API 'GetUninitializedObject' */
 using Microsoft.PowerShell.CoreClr.Stubs;         /* used in facade API 'GetFileSecurityZone' */
+using System.Management.Automation.Internal;
+using System.Text.RegularExpressions;
 #else
 using Microsoft.PowerShell.Commands.Internal; /* used in the facade APIs related to 'SafeProcessHandle' */
 using System.Runtime.Serialization;           /* used in facade API 'GetUninitializedObject' */
@@ -419,8 +421,163 @@
         {
             Diagnostics.Assert(Path.IsPathRooted(filePath), "Caller makes sure the path is rooted.");
             Diagnostics.Assert(Utils.NativeFileExists(filePath), "Caller makes sure the file exists.");
+#if CORECLR
+            string sysRoot = System.Environment.GetEnvironmentVariable("SystemRoot");
+            string urlmonPath = Path.Combine(sysRoot, @"System32\urlmon.dll");
+            if (Utils.NativeFileExists(urlmonPath))
+            {
+                return MapSecurityZoneWithUrlmon(filePath);
+            }
+            return MapSecurityZoneWithoutUrlmon(filePath);
+#else
             return MapSecurityZoneWithUrlmon(filePath);
-        }
+#endif
+        }
+
+#if CORECLR
+        #region WithoutUrlmon
+
+        /// <summary>
+        /// Map the file to SecurityZone without using urlmon.dll.
+        /// This is needed on NanoServer because urlmon.dll is not in OneCore.
+        /// </summary>
+        /// <remarks>
+        /// The algorithm is as follows:
+        ///
+        /// 1. Alternate data stream "Zone.Identifier" is checked first. If this alternate data stream has content, then the content is parsed to determine the SecurityZone.
+        /// 2. If the alternate data stream "Zone.Identifier" doesn't exist, or its content is not expected, then the file path will be analyzed to determine the SecurityZone.
+        ///
+        /// For #1, the parsing rules are observed as follows:
+        ///   A. Read content of the data stream line by line. Each line is trimmed.
+        ///   B. Try to match the current line with '^\[ZoneTransfer\]'.
+        ///        - if matching, then do step (#C) starting from the next line
+        ///        - if not matching, then continue to do step (#B) with the next line.
+        ///   C. Try to match the current line with '^ZoneId\s*=\s*(.*)'
+        ///        - if matching, check if the ZoneId is valid. Then return the corresponding SecurityZone if the 'ZoneId' is valid, or 'NoZone' if invalid.
+        ///        - if not matching, then continue to do step (#C) with the next line.
+        ///   D. Reach EOF, then return 'NoZone'.
+        /// After #1, if the returned SecurityZone is 'NoZone', then proceed with #2. Otherwise, return it as the mapping result.
+        ///
+        /// For #2, the analysis rules are observed as follows:
+        ///   A. If the path is a UNC path, then
+        ///       - if the host name of the UNC path is IP address, then mapping it to "Internet" zone.
+        ///       - if the host name of the UNC path has dot (.) in it, then mapping it to "internet" zone.
+        ///       - otherwise, mapping it to "intranet" zone.
+        ///   B. If the path is not UNC path, then get the root drive,
+        ///       - if the drive is CDRom, mapping it to "Untrusted" zone
+        ///       - if the drive is Network, mapping it to "Intranet" zone
+        ///       - otherwise, mapping it to "MyComputer" zone.
+        ///
+        /// The above algorithm has two changes comparing to the behavior of "Zone.CreateFromUrl" I observed:
+        ///   (1) If a file downloaded from internet (ZoneId=3) is not on the local machine, "Zone.CreateFromUrl" won't respect the MOTW.
+        ///       I think it makes more sense for powershell to always check the MOTW first, even for files not on local box.
+        ///   (2) When it's a UNC path and is actually a loopback (\\127.0.0.1\c$\test.txt), "Zone.CreateFromUrl" returns "Internet", but
+        ///       the above algorithm changes it to be "MyComputer" because it's actually the same computer.
+        /// </remarks>
+        private static SecurityZone MapSecurityZoneWithoutUrlmon(string filePath)
+        {
+            SecurityZone reval = ReadFromZoneIdentifierDataStream(filePath);
+            if (reval != SecurityZone.NoZone) { return reval; }
+
+            // If it reaches here, then we either couldn't get the ZoneId information, or the ZoneId is invalid.
+            // In this case, we try to determine the SecurityZone by analyzing the file path.
+            Uri uri = new Uri(filePath);
+            if (uri.IsUnc)
+            {
+                if (uri.IsLoopback)
+                {
+                    return SecurityZone.MyComputer;
+                }
+
+                if (uri.HostNameType == UriHostNameType.IPv4 ||
+                    uri.HostNameType == UriHostNameType.IPv6)
+                {
+                    return SecurityZone.Internet;
+                }
+
+                // This is also an observation of Zone.CreateFromUrl/Zone.SecurityZone. If the host name
+                // has 'dot' in it, the file will be treated as in Internet security zone. Otherwise, it's
+                // in Intranet security zone.
+                string hostName = uri.Host;
+                return hostName.IndexOf('.') == -1 ? SecurityZone.Intranet : SecurityZone.Internet;
+            }
+
+            string root = Path.GetPathRoot(filePath);
+            DriveInfo drive = new DriveInfo(root);
+            switch (drive.DriveType)
+            {
+                case DriveType.NoRootDirectory:
+                case DriveType.Unknown:
+                case DriveType.CDRom:
+                    return SecurityZone.Untrusted;
+                case DriveType.Network:
+                    return SecurityZone.Intranet;
+                default:
+                    return SecurityZone.MyComputer;
+            }
+        }
+
+        /// <summary>
+        /// Read the 'Zone.Identifier' alternate data stream to determin SecurityZone of the file.
+        /// </summary>
+        private static SecurityZone ReadFromZoneIdentifierDataStream(string filePath)
+        {
+            try
+            {
+                FileStream zoneDataSteam = AlternateDataStreamUtilities.CreateFileStream(
+                                            filePath, "Zone.Identifier", FileMode.Open,
+                                            FileAccess.Read, FileShare.Read);
+
+                // If we successfully get the zone data stream, try to read the ZoneId information
+                using (StreamReader zoneDataReader = new StreamReader(zoneDataSteam, GetDefaultEncoding()))
+                {
+                    string line = null;
+                    bool zoneTransferMatched = false;
+
+                    // After a lot experiments with Zone.CreateFromUrl/Zone.SecurityZone, the way it handles the alternate
+                    // data stream 'Zone.Identifier' is observed as follows:
+                    //    1. Read content of the data stream line by line. Each line is trimmed.
+                    //    2. Try to match the current line with '^\[ZoneTransfer\]'.
+                    //           - if matching, then do step #3 starting from the next line
+                    //           - if not matching, then continue to do step #2 with the next line.
+                    //    3. Try to match the current line with '^ZoneId\s*=\s*(.*)'
+                    //           - if matching, check if the ZoneId is valid. Then return the corresponding SecurityZone if valid, or 'NoZone' if invalid.
+                    //           - if not matching, then continue to do step #3 with the next line.
+                    //    4. Reach EOF, then return 'NoZone'.
+                    while ((line = zoneDataReader.ReadLine()) != null)
+                    {
+                        line = line.Trim();
+                        if (!zoneTransferMatched)
+                        {
+                            zoneTransferMatched = Regex.IsMatch(line, @"^\[ZoneTransfer\]", RegexOptions.IgnoreCase);
+                        }
+                        else
+                        {
+                            Match match = Regex.Match(line, @"^ZoneId\s*=\s*(.*)", RegexOptions.IgnoreCase);
+                            if (!match.Success) { continue; }
+
+                            // Match found. Validate ZoneId value.
+                            string zoneIdRawValue = match.Groups[1].Value;
+                            match = Regex.Match(zoneIdRawValue, @"^[+-]?\d+", RegexOptions.IgnoreCase);
+                            if (!match.Success) { return SecurityZone.NoZone; }
+
+                            string zoneId = match.Groups[0].Value;
+                            SecurityZone result;
+                            return LanguagePrimitives.TryConvertTo(zoneId, out result) ? result : SecurityZone.NoZone;
+                        }
+                    }
+                }
+            }
+            catch (FileNotFoundException)
+            {
+                // FileNotFoundException may be thrown by AlternateDataStreamUtilities.CreateFileStream when the data stream 'Zone.Identifier'
+                // does not exist, or when the underlying file system doesn't support alternate data stream.
+            }
+
+            return SecurityZone.NoZone;
+        }
+        #endregion WithoutUrlmon
+#endif

         /// <summary>
         /// Map the file to SecurityZone using urlmon.dll, depending on 'IInternetSecurityManager::MapUrlToZone'.


Remove Unnecessary Debug Assert in ObjectToComInterface

The Debug.Assert(obj == null || obj is __ComObject) is Unnecessary and incorrect:

Unnecessary: There is another Debug.Assert(!typeHnd.IsNull()) later, which will do similar(or better) check. since Debug.Assert(!typeHnd.IsNull()) also handle managed winmdobject case.

Incorrect: it miss a case such as obj itself is a managed winmd object case.
so it should be Debug.Assert(obj == null || obj is __ComObject || obj is managed winmd object);

[tfs-changeset: 1670398]

--- src/System.Private.Interop/src/Shared/McgMarshal.cs
+++ src/System.Private.Interop/src/Shared/McgMarshal.cs
@@ -692,10 +692,7 @@

             if (typeHnd.IsComClass())
             {
-                Debug.Assert(obj == null || obj is __ComObject);
-                ///
-                /// This code path should be executed only for WinRT classes
-                ///
+                // This code path should be executed only for WinRT classes
                 typeHnd = typeHnd.GetDefaultInterface();
                 Debug.Assert(!typeHnd.IsNull());
             }


U4-10764 - minor fix

U4-10764 - minor fix

--- src/Umbraco.Core/Events/ScopeEventDispatcherBase.cs
+++ src/Umbraco.Core/Events/ScopeEventDispatcherBase.cs
@@ -170,10 +170,13 @@
                     if (eventObjects == null)
                     {
                         // single object, cast as an IEntity
-                        // if cannot cast, cannot filter, nothing to do - just add to output FIXME not?
+                        // if cannot cast, cannot filter, nothing - just include event definition in result
                         var eventEntity = args.EventObject as IEntity;
                         if (eventEntity == null)
+                        {
+                            result.Add(def);
                             continue;
+                        }

                         // look for this entity in superceding event args
                         // found = must be removed (ie not added), else track


remove unused code

remove unused code

Signed-off-by: Bjarke Berg <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@bergmania.dk>

--- src/Umbraco.Web.Common/Macros/UmbracoMacroResult.cs
+++ src/Umbraco.Web.Common/Macros/UmbracoMacroResult.cs
@@ -1,9 +0,0 @@
-using Microsoft.AspNetCore.Mvc.ViewComponents;
-
-namespace Umbraco.Web.Macros
-{
-    internal class UmbracoMacroResult  : ViewViewComponentResult
-    {
-
-    }
-}


Wait for GetAssetsAsync before returning

--- src/Workspaces/Remote/Core/SolutionAssetProvider.cs
+++ src/Workspaces/Remote/Core/SolutionAssetProvider.cs
@@ -59,7 +59,7 @@
             // (non-contiguous) memory allocated for the underlying buffers. The amount of memory is bounded by the total size of the serialized assets.
             var localPipe = new Pipe(RemoteHostAssetSerialization.PipeOptionsWithUnlimitedWriterBuffer);

-            Task.Run(() =>
+            var task1 = Task.Run(() =>
             {
                 try
                 {
@@ -71,12 +71,14 @@
                 {
                     // no-op
                 }
-            }, cancellationToken).Forget();
+            }, cancellationToken);

             // Complete RPC once we send the initial piece of data and start waiting for the writer to send more,
             // so the client can start reading from the stream. Once CopyPipeDataAsync completes the pipeWriter
             // the corresponding client-side pipeReader will complete and the data transfer will be finished.
-            CopyPipeDataAsync().Forget();
+            var task2 = CopyPipeDataAsync();
+
+            await Task.WhenAll(task1, task2).ConfigureAwait(false);

             async Task CopyPipeDataAsync()
             {


Fix code view issue

Fix code view issue

--- Dependinator/ModelViewing/DataHandling/Private/Parsing/Private/SolutionParsing/SolutionParser.cs
+++ Dependinator/ModelViewing/DataHandling/Private/Parsing/Private/SolutionParsing/SolutionParser.cs
@@ -20,7 +20,7 @@

 		private readonly List<AssemblyParser> assemblyParsers = new List<AssemblyParser>();

-		private List<DataNode> parentNodesToSend;
+		private List<DataNode> parentNodesToSend = new List<DataNode>();

 		public SolutionParser(string solutionFilePath, DataItemsCallback itemsCallback)
@@ -35,7 +35,6 @@

 		public async Task<R> ParseAsync()
 		{
-			parentNodesToSend = new List<DataNode>();
 			parentNodesToSend.Add(GetSolutionNode());

 			R result = CreateAssemblyParsers();


Notification Service tests

Notification Service tests

--- Purchasing.Tests/ServiceTests/NotificationServiceTests/NotificationServiceTestsOrderCreated01.cs
+++ Purchasing.Tests/ServiceTests/NotificationServiceTests/NotificationServiceTestsOrderCreated01.cs
@@ -386,5 +386,431 @@
             Assert.AreEqual("zoidberg", order.EmailQueues[3].User.Id);
             #endregion Assert
         }
+
+        /// <summary>
+        /// Same as above, but some users email prefs say not when order arrives for approval.
+        /// </summary>
+        [TestMethod]
+        public void TestOrderCreatedProcessArrival8()
+        {
+            #region Arrange
+            UserIdentity.Expect(a => a.Current).Return("bender");
+            SetupUsers();
+            var order = SetupData1("bender", OrderStatusCodeRepository.GetNullableById(OrderStatusCode.Codes.Approver));
+            order.DateCreated = new DateTime(2011, 12, 31, 09, 49, 33);
+
+            var approvals = new List<Approval>();
+            CreateApprovals(approvals, OrderStatusCodeRepository.GetNullableById(OrderStatusCode.Codes.Approver), order);
+            var conditionalApproval = new Approval();
+            conditionalApproval.Order = new Order();
+            conditionalApproval.Order.SetIdTo(order.Id);
+            conditionalApproval.StatusCode = OrderStatusCodeRepository.GetNullableById(Role.Codes.Approver);
+            conditionalApproval.User = UserRepository.GetNullableById("zoidberg");
+            conditionalApproval.SecondaryUser = UserRepository.GetNullableById("zoidberg");
+            approvals.Add(conditionalApproval);
+
+            var saveLevel = 0;
+            foreach(var approval in approvals)
+            {
+                if(approval.User != null && approval.User.Id == "hsimpson")
+                {
+                    saveLevel = approval.StatusCode.Level;
+                    approval.User = null;
+                    approval.SecondaryUser = null;
+                }
+                order.AddApproval(approval);
+            }
+            order.Workgroup.Permissions = new List<WorkgroupPermission>();
+            var permission = CreateValidEntities.WorkgroupPermission(1);
+            permission.User = new User("Flarg");
+            permission.Role = new Role(OrderStatusCode.Codes.Approver);
+            permission.Role.Level = saveLevel;
+            order.Workgroup.Permissions.Add(permission);
+
+            permission = CreateValidEntities.WorkgroupPermission(2);
+            permission.User = new User("Blarg");
+            permission.Role = new Role(OrderStatusCode.Codes.Approver);
+            permission.Role.Level = saveLevel;
+            order.Workgroup.Permissions.Add(permission);
+
+            order.GenerateRequestNumber();
+
+            var emailPrefs = new List<EmailPreferences>();
+            emailPrefs.Add(new EmailPreferences("bender"));
+            emailPrefs[0].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[0].RequesterOrderSubmission = false;
+            new FakeEmailPreferences(0, EmailPreferenceRepository, emailPrefs, true);
+
+            #endregion Arrange
+
+            #region Act
+            NotificationService.OrderCreated(order);
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(3, order.EmailQueues.Count());
+            //Assert.AreEqual(string.Format("Order request {0} has been submitted.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            //Assert.AreEqual("bender", order.EmailQueues[0].User.Id);
+            Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            Assert.AreEqual("Flarg", order.EmailQueues[0].User.Id);
+            Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[1].Text);
+            Assert.AreEqual("Blarg", order.EmailQueues[1].User.Id);
+
+            Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[2].Text);
+            Assert.AreEqual("zoidberg", order.EmailQueues[2].User.Id);
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Same as above, but some users email prefs say not when order arrives for approval.
+        /// </summary>
+        [TestMethod]
+        public void TestOrderCreatedProcessArrival9()
+        {
+            #region Arrange
+            UserIdentity.Expect(a => a.Current).Return("bender");
+            SetupUsers();
+            var order = SetupData1("bender", OrderStatusCodeRepository.GetNullableById(OrderStatusCode.Codes.Approver));
+            order.DateCreated = new DateTime(2011, 12, 31, 09, 49, 33);
+
+            var approvals = new List<Approval>();
+            CreateApprovals(approvals, OrderStatusCodeRepository.GetNullableById(OrderStatusCode.Codes.Approver), order);
+            var conditionalApproval = new Approval();
+            conditionalApproval.Order = new Order();
+            conditionalApproval.Order.SetIdTo(order.Id);
+            conditionalApproval.StatusCode = OrderStatusCodeRepository.GetNullableById(Role.Codes.Approver);
+            conditionalApproval.User = UserRepository.GetNullableById("zoidberg");
+            conditionalApproval.SecondaryUser = UserRepository.GetNullableById("zoidberg");
+            approvals.Add(conditionalApproval);
+
+            var saveLevel = 0;
+            foreach(var approval in approvals)
+            {
+                if(approval.User != null && approval.User.Id == "hsimpson")
+                {
+                    saveLevel = approval.StatusCode.Level;
+                    approval.User = null;
+                    approval.SecondaryUser = null;
+                }
+                order.AddApproval(approval);
+            }
+            order.Workgroup.Permissions = new List<WorkgroupPermission>();
+            var permission = CreateValidEntities.WorkgroupPermission(1);
+            permission.User = new User("Flarg");
+            permission.Role = new Role(OrderStatusCode.Codes.Approver);
+            permission.Role.Level = saveLevel;
+            order.Workgroup.Permissions.Add(permission);
+
+            permission = CreateValidEntities.WorkgroupPermission(2);
+            permission.User = new User("Blarg");
+            permission.Role = new Role(OrderStatusCode.Codes.Approver);
+            permission.Role.Level = saveLevel;
+            order.Workgroup.Permissions.Add(permission);
+
+            order.GenerateRequestNumber();
+
+            var emailPrefs = new List<EmailPreferences>();
+            emailPrefs.Add(new EmailPreferences("bender"));
+            emailPrefs[0].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[0].RequesterOrderSubmission = false;
+
+            emailPrefs.Add(new EmailPreferences("Flarg"));
+            emailPrefs[1].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[1].RequesterOrderSubmission = false;  //Doesn't Matter, did not create it
+
+            new FakeEmailPreferences(0, EmailPreferenceRepository, emailPrefs, true);
+
+            #endregion Arrange
+
+            #region Act
+            NotificationService.OrderCreated(order);
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(3, order.EmailQueues.Count());
+            //Assert.AreEqual(string.Format("Order request {0} has been submitted.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            //Assert.AreEqual("bender", order.EmailQueues[0].User.Id);
+            Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            Assert.AreEqual("Flarg", order.EmailQueues[0].User.Id);
+            Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[1].Text);
+            Assert.AreEqual("Blarg", order.EmailQueues[1].User.Id);
+
+            Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[2].Text);
+            Assert.AreEqual("zoidberg", order.EmailQueues[2].User.Id);
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Same as above, but some users email prefs say not when order arrives for approval.
+        /// </summary>
+        [TestMethod]
+        public void TestOrderCreatedProcessArrival10()
+        {
+            #region Arrange
+            UserIdentity.Expect(a => a.Current).Return("bender");
+            SetupUsers();
+            var order = SetupData1("bender", OrderStatusCodeRepository.GetNullableById(OrderStatusCode.Codes.Approver));
+            order.DateCreated = new DateTime(2011, 12, 31, 09, 49, 33);
+
+            var approvals = new List<Approval>();
+            CreateApprovals(approvals, OrderStatusCodeRepository.GetNullableById(OrderStatusCode.Codes.Approver), order);
+            var conditionalApproval = new Approval();
+            conditionalApproval.Order = new Order();
+            conditionalApproval.Order.SetIdTo(order.Id);
+            conditionalApproval.StatusCode = OrderStatusCodeRepository.GetNullableById(Role.Codes.Approver);
+            conditionalApproval.User = UserRepository.GetNullableById("zoidberg");
+            conditionalApproval.SecondaryUser = UserRepository.GetNullableById("zoidberg");
+            approvals.Add(conditionalApproval);
+
+            var saveLevel = 0;
+            foreach(var approval in approvals)
+            {
+                if(approval.User != null && approval.User.Id == "hsimpson")
+                {
+                    saveLevel = approval.StatusCode.Level;
+                    approval.User = null;
+                    approval.SecondaryUser = null;
+                }
+                order.AddApproval(approval);
+            }
+            order.Workgroup.Permissions = new List<WorkgroupPermission>();
+            var permission = CreateValidEntities.WorkgroupPermission(1);
+            permission.User = new User("Flarg");
+            permission.Role = new Role(OrderStatusCode.Codes.Approver);
+            permission.Role.Level = saveLevel;
+            order.Workgroup.Permissions.Add(permission);
+
+            permission = CreateValidEntities.WorkgroupPermission(2);
+            permission.User = new User("Blarg");
+            permission.Role = new Role(OrderStatusCode.Codes.Approver);
+            permission.Role.Level = saveLevel;
+            order.Workgroup.Permissions.Add(permission);
+
+            order.GenerateRequestNumber();
+
+            var emailPrefs = new List<EmailPreferences>();
+            emailPrefs.Add(new EmailPreferences("bender"));
+            emailPrefs[0].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[0].RequesterOrderSubmission = false;
+
+            emailPrefs.Add(new EmailPreferences("Flarg"));
+            emailPrefs[1].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[1].RequesterOrderSubmission = false;  //Doesn't Matter, did not create it
+            emailPrefs[1].ApproverOrderArrive = false;
+
+            new FakeEmailPreferences(0, EmailPreferenceRepository, emailPrefs, true);
+
+            #endregion Arrange
+
+            #region Act
+            NotificationService.OrderCreated(order);
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(2, order.EmailQueues.Count());
+            //Assert.AreEqual(string.Format("Order request {0} has been submitted.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            //Assert.AreEqual("bender", order.EmailQueues[0].User.Id);
+            //Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            //Assert.AreEqual("Flarg", order.EmailQueues[0].User.Id);
+            Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            Assert.AreEqual("Blarg", order.EmailQueues[0].User.Id);
+
+            Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[1].Text);
+            Assert.AreEqual("zoidberg", order.EmailQueues[1].User.Id);
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Same as above, but some users email prefs say not when order arrives for approval.
+        /// </summary>
+        [TestMethod]
+        public void TestOrderCreatedProcessArrival11()
+        {
+            #region Arrange
+            UserIdentity.Expect(a => a.Current).Return("bender");
+            SetupUsers();
+            var order = SetupData1("bender", OrderStatusCodeRepository.GetNullableById(OrderStatusCode.Codes.Approver));
+            order.DateCreated = new DateTime(2011, 12, 31, 09, 49, 33);
+
+            var approvals = new List<Approval>();
+            CreateApprovals(approvals, OrderStatusCodeRepository.GetNullableById(OrderStatusCode.Codes.Approver), order);
+            var conditionalApproval = new Approval();
+            conditionalApproval.Order = new Order();
+            conditionalApproval.Order.SetIdTo(order.Id);
+            conditionalApproval.StatusCode = OrderStatusCodeRepository.GetNullableById(Role.Codes.Approver);
+            conditionalApproval.User = UserRepository.GetNullableById("zoidberg");
+            conditionalApproval.SecondaryUser = UserRepository.GetNullableById("zoidberg");
+            approvals.Add(conditionalApproval);
+
+            var saveLevel = 0;
+            foreach(var approval in approvals)
+            {
+                if(approval.User != null && approval.User.Id == "hsimpson")
+                {
+                    saveLevel = approval.StatusCode.Level;
+                    approval.User = null;
+                    approval.SecondaryUser = null;
+                }
+                order.AddApproval(approval);
+            }
+            order.Workgroup.Permissions = new List<WorkgroupPermission>();
+            var permission = CreateValidEntities.WorkgroupPermission(1);
+            permission.User = new User("Flarg");
+            permission.Role = new Role(OrderStatusCode.Codes.Approver);
+            permission.Role.Level = saveLevel;
+            order.Workgroup.Permissions.Add(permission);
+
+            permission = CreateValidEntities.WorkgroupPermission(2);
+            permission.User = new User("Blarg");
+            permission.Role = new Role(OrderStatusCode.Codes.Approver);
+            permission.Role.Level = saveLevel;
+            order.Workgroup.Permissions.Add(permission);
+
+            order.GenerateRequestNumber();
+
+            var emailPrefs = new List<EmailPreferences>();
+            emailPrefs.Add(new EmailPreferences("bender"));
+            emailPrefs[0].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[0].RequesterOrderSubmission = false;
+
+            emailPrefs.Add(new EmailPreferences("Flarg"));
+            emailPrefs[1].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[1].RequesterOrderSubmission = true;  //Doesn't Matter, did not create it
+            emailPrefs[1].ApproverOrderArrive = false;
+
+            emailPrefs.Add(new EmailPreferences("Blarg"));
+            emailPrefs[2].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[2].RequesterOrderSubmission = false;  //Doesn't Matter, did not create it
+            emailPrefs[2].ApproverOrderArrive = false;
+
+            emailPrefs.Add(new EmailPreferences("zoidberg"));
+            emailPrefs[3].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[3].ApproverOrderArrive = false;
+            new FakeEmailPreferences(0, EmailPreferenceRepository, emailPrefs, true);
+
+            #endregion Arrange
+
+            #region Act
+            NotificationService.OrderCreated(order);
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(0, order.EmailQueues.Count());
+            //Assert.AreEqual(string.Format("Order request {0} has been submitted.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            //Assert.AreEqual("bender", order.EmailQueues[0].User.Id);
+            //Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            //Assert.AreEqual("Flarg", order.EmailQueues[0].User.Id);
+            //Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            //Assert.AreEqual("Blarg", order.EmailQueues[0].User.Id);
+
+            //Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[1].Text);
+            //Assert.AreEqual("zoidberg", order.EmailQueues[1].User.Id);
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Check that those further up the approval chain are not notified
+        /// </summary>
+        [TestMethod]
+        public void TestOrderCreatedProcessArrival12()
+        {
+            #region Arrange
+            UserIdentity.Expect(a => a.Current).Return("bender");
+            SetupUsers();
+            var order = SetupData1("bender", OrderStatusCodeRepository.GetNullableById(OrderStatusCode.Codes.Approver));
+            order.DateCreated = new DateTime(2011, 12, 31, 09, 49, 33);
+
+            var approvals = new List<Approval>();
+            CreateApprovals(approvals, OrderStatusCodeRepository.GetNullableById(OrderStatusCode.Codes.Approver), order);
+            var conditionalApproval = new Approval();
+            conditionalApproval.Order = new Order();
+            conditionalApproval.Order.SetIdTo(order.Id);
+            conditionalApproval.StatusCode = OrderStatusCodeRepository.GetNullableById(Role.Codes.Approver);
+            conditionalApproval.User = UserRepository.GetNullableById("zoidberg");
+            conditionalApproval.SecondaryUser = UserRepository.GetNullableById("zoidberg");
+            approvals.Add(conditionalApproval);
+
+            var accountManager = new Approval();
+            accountManager.Order = new Order();
+            accountManager.Order.SetIdTo(order.Id);
+            accountManager.StatusCode = OrderStatusCodeRepository.GetNullableById(Role.Codes.AccountManager);
+            accountManager.User = UserRepository.GetNullableById("AccManag");
+            accountManager.SecondaryUser = UserRepository.GetNullableById("AccManag");
+            approvals.Add(accountManager);
+
+            var purchaser = new Approval();
+            purchaser.Order = new Order();
+            purchaser.Order.SetIdTo(order.Id);
+            purchaser.StatusCode = OrderStatusCodeRepository.GetNullableById(Role.Codes.AccountManager);
+            purchaser.User = UserRepository.GetNullableById("pur");
+            purchaser.SecondaryUser = UserRepository.GetNullableById("pur");
+            approvals.Add(purchaser);
+
+            var saveLevel = 0;
+            foreach(var approval in approvals)
+            {
+                if(approval.User != null && approval.User.Id == "hsimpson")
+                {
+                    saveLevel = approval.StatusCode.Level;
+                    approval.User = null;
+                    approval.SecondaryUser = null;
+                }
+                order.AddApproval(approval);
+            }
+            order.Workgroup.Permissions = new List<WorkgroupPermission>();
+            var permission = CreateValidEntities.WorkgroupPermission(1);
+            permission.User = new User("Flarg");
+            permission.Role = new Role(OrderStatusCode.Codes.Approver);
+            permission.Role.Level = saveLevel;
+            order.Workgroup.Permissions.Add(permission);
+
+            permission = CreateValidEntities.WorkgroupPermission(2);
+            permission.User = new User("Blarg");
+            permission.Role = new Role(OrderStatusCode.Codes.Approver);
+            permission.Role.Level = saveLevel;
+            order.Workgroup.Permissions.Add(permission);
+
+            order.GenerateRequestNumber();
+
+            var emailPrefs = new List<EmailPreferences>();
+            emailPrefs.Add(new EmailPreferences("bender"));
+            emailPrefs[0].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[0].RequesterOrderSubmission = false;
+
+            emailPrefs.Add(new EmailPreferences("Flarg"));
+            emailPrefs[1].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[1].RequesterOrderSubmission = true;  //Doesn't Matter, did not create it
+            emailPrefs[1].ApproverOrderArrive = false;
+
+            emailPrefs.Add(new EmailPreferences("Blarg"));
+            emailPrefs[2].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[2].RequesterOrderSubmission = false;  //Doesn't Matter, did not create it
+            emailPrefs[2].ApproverOrderArrive = false;
+
+            emailPrefs.Add(new EmailPreferences("zoidberg"));
+            emailPrefs[3].NotificationType = EmailPreferences.NotificationTypes.Daily;
+            emailPrefs[3].ApproverOrderArrive = false;
+            new FakeEmailPreferences(0, EmailPreferenceRepository, emailPrefs, true);
+
+            #endregion Arrange
+
+            #region Act
+            NotificationService.OrderCreated(order);
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(0, order.EmailQueues.Count());
+            Assert.AreEqual(7, order.Approvals.Count());
+            //Assert.AreEqual(string.Format("Order request {0} has been submitted.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            //Assert.AreEqual("bender", order.EmailQueues[0].User.Id);
+            //Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            //Assert.AreEqual("Flarg", order.EmailQueues[0].User.Id);
+            //Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[0].Text);
+            //Assert.AreEqual("Blarg", order.EmailQueues[0].User.Id);
+
+            //Assert.AreEqual(string.Format("Order request {0} has arrived at your level (Approver) for review from Bender Rodriguez.", "#-FT1P9YR"), order.EmailQueues[1].Text);
+            //Assert.AreEqual("zoidberg", order.EmailQueues[1].User.Id);
+            #endregion Assert
+        }
     }
 }


ose was null

ose was null

--- Terradue.OpenSearch.DataAnalyzer/Terradue/OpenSearch/DataAnalyzer/LocalDataListOpensearchable.cs
+++ Terradue.OpenSearch.DataAnalyzer/Terradue/OpenSearch/DataAnalyzer/LocalDataListOpensearchable.cs
@@ -94,7 +94,7 @@
             osd.Description = "This Search Service performs queries in the index {0}. There are several URL templates that return the results in different formats." +
                                             "This search service is in accordance with the OGC 10-032r3 specification.";

-            var searchExtensions = ose.Extensions;
+            var searchExtensions = OpenSearchEngine.Extensions;
             List<OpenSearchDescriptionUrl> urls = new List<OpenSearchDescriptionUrl>();

             NameValueCollection parameters = GetOpenSearchParameters(this.DefaultMimeType);


Make the SessionPool refresh test more tolerant

If WaitForPoolAsync returns at exactly the instant when the final
session is created, the refresh time will be exactly "now + refresh
period". We shouldn't need the clock to tick between those intervals.

I believe all the other conditions are okay.

--- apis/Google.Cloud.Spanner.Data/Google.Cloud.Spanner.Data.IntegrationTests/V1/SessionPoolTests.cs
+++ apis/Google.Cloud.Spanner.Data/Google.Cloud.Spanner.Data.IntegrationTests/V1/SessionPoolTests.cs
@@ -54,7 +54,7 @@
                 var expectedRefreshTime = DateTime.UtcNow + options.IdleSessionRefreshDelay;
                 // Acquire all the sessions, which should all have a required refresh time within our upper bound
                 var initialSessions = await AcquireSessionsAsync(pool);
-                Assert.All(initialSessions, s => Assert.True(s.RefreshTimeForTest < expectedRefreshTime));
+                Assert.All(initialSessions, s => Assert.True(s.RefreshTimeForTest <= expectedRefreshTime));

                 // Wait for everything to idle out
                 await Task.Delay(options.IdleSessionRefreshDelay + TimeSpan.FromSeconds(1));


Clear debug

Clear debug

--- Proto/Assets/Scripts/UI/ClockUI.cs
+++ Proto/Assets/Scripts/UI/ClockUI.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Collections;
+using System.Collections;
 using UnityEngine;
 using UnityEngine.UI;

@@ -86,10 +85,7 @@

     private static float GetSecondClockPosition(float time)
     {
-        Debug.Log("Total time : " + time);
         var seconds = time % _totalTime;
-        Debug.Log("Seconds : " + seconds);
-        Debug.Log("Result : " + -(360/_totalTime * seconds + 2));
         return -(360/_totalTime * seconds + 2);
     }


look ahead on both the chain and the block txes, fix duplicate block read

--- BitSharp.Core/Workers/ChainStateWorker.cs
+++ BitSharp.Core/Workers/ChainStateWorker.cs
@@ -96,7 +96,9 @@
             {
                 // calculate the new blockchain along the target path
                 var didWork = false;
-                foreach (var pathElement in this.chainStateBuilder.Chain.NavigateTowards(this.getTargetChain))
+                foreach (var pathElement in
+                    this.ChainedBlockLookAhead(this.chainStateBuilder.Chain.NavigateTowards(this.getTargetChain),
+                        chainLookAhead: 10, txLookAhead: 100))
                 {
                     // cooperative loop
                     this.ThrowIfCancelled();
@@ -106,12 +108,12 @@
                     // get block and metadata for next link in blockchain
                     var direction = pathElement.Item1;
                     var chainedHeader = pathElement.Item2;
+                    var blockTxes = pathElement.Item3;

                     var blockStopwatch = Stopwatch.StartNew();
                     if (direction > 0)
                     {
-                        this.chainStateBuilder.AddBlock(chainedHeader,
-                            this.blockCache.ReadBlock(chainedHeader).LookAhead(10));
+                        this.chainStateBuilder.AddBlock(chainedHeader, blockTxes);
                     }
                     else if (direction < 0)
                     {
@@ -156,7 +158,7 @@
             }
         }

-        private IEnumerable<Tuple<int, ChainedBlock>> ChainedBlockLookAhead(IEnumerable<Tuple<int, ChainedHeader>> chain, int lookAhead)
+        private IEnumerable<Tuple<int, ChainedHeader, IEnumerable<BlockTx>>> ChainedBlockLookAhead(IEnumerable<Tuple<int, ChainedHeader>> chain, int chainLookAhead, int txLookAhead)
         {
             return chain
                 .Select(
@@ -168,14 +170,10 @@
                             this.ThrowIfCancelled();

                             var direction = chainedHeaderTuple.Item1;
+                            var chainedHeader = chainedHeaderTuple.Item2;
+                            var blockTxes = this.blockCache.ReadBlock(chainedHeader).LookAhead(txLookAhead);

-                            var chainedHeader = chainedHeaderTuple.Item2;
-                            var block = new MethodTimer(false).Time("GetBlock", () =>
-                                this.blockCache[chainedHeader.Hash]);
-
-                            var chainedBlock = new ChainedBlock(chainedHeader, block);
-
-                            return Tuple.Create(direction, chainedBlock);
+                            return Tuple.Create(direction, chainedHeader, blockTxes);
                         }
                         catch (MissingDataException e)
                         {
@@ -183,7 +181,7 @@
                             throw;
                         }
                     })
-                .LookAhead(1);
+                .LookAhead(chainLookAhead);
         }
     }
 }


Added Attributes to LineItem to match the DB. Added LineItem Repository Tests

--- Purchasing.Core/Domain/LineItem.cs
+++ Purchasing.Core/Domain/LineItem.cs
@@ -1,7 +1,8 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
 using FluentNHibernate.Mapping;
-using UCDArch.Core.DomainModel;
-
+using UCDArch.Core.DomainModel;
+
 namespace Purchasing.Core.Domain
 {
     public class LineItem : DomainObject
@@ -12,12 +13,16 @@
         }

         public virtual decimal Quantity { get; set; }
+        [StringLength(25)]
         public virtual string CatalogNumber { get; set; }
-        public virtual string Description { get; set; }
+        public virtual string Description { get; set; }
+        [StringLength(25)]
         public virtual string Unit { get; set; }
         public virtual decimal UnitPrice { get; set; }
+        [StringLength(200)]
         public virtual string Url { get; set; }
         public virtual string Notes { get; set; }
+        [Required]
         public virtual Order Order { get; set; }

         public virtual Commodity Commodity { get; set; }


Fixed a bug when multiple requests arrive close to each other.

--- QDMSServer/HistoricalDataBroker.cs
+++ QDMSServer/HistoricalDataBroker.cs
@@ -373,7 +373,7 @@

             //give the request an ID that we can use to track it
             var rand = new Random();
-            request.AssignedID = rand.Next(1, int.MaxValue);
+

             //log the request
             Application.Current.Dispatcher.Invoke(() =>
@@ -392,6 +392,12 @@
             //we have the identity of the sender and their request, now we add them to our request id -> identity map
             lock (_identityMapLock)
             {
+                //requests can arrive very close to each other and thus have the same seed, so we need to make sure it's unique
+                do
+                {
+                    request.AssignedID = rand.Next(1, int.MaxValue);
+                } while (_requestToIdentityMap.ContainsKey(request.AssignedID));
+
                 _requestToIdentityMap.Add(request.AssignedID, requesterIdentity);
             }


Correction of a NRE that I caused because the hook was needing the

Correction of a NRE that I caused because the Correction of a NRE that I caused because the hook was needing a valid reference to GameObjectReference.

Moved the NULL assignation after the hook invoke.

--- UnityProject/Assets/Scripts/Items/ClothingItem.cs
+++ UnityProject/Assets/Scripts/Items/ClothingItem.cs
@@ -93,8 +93,6 @@
 		UpdateReferenceOffset();
 		if (Item == null)
 		{
-			GameObjectReference = null; // Remove the item from equipment
-
 			if (spriteHandler != null) //need to remove
 			{
 				spriteHandler.spriteData = null;
@@ -109,6 +107,7 @@
 					OnClothingEquiped?.Invoke(unequippedClothing, false);
 			}

+			GameObjectReference = null; // Remove the item from equipment
 		}

 		if (Item != null)


[Core] Updated LevelUp logic to use XPath

--- Cassini.FitocracyAnalyzer.Core/Crawler.cs
+++ Cassini.FitocracyAnalyzer.Core/Crawler.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Linq;

+using OpenQA.Selenium;
 using OpenQA.Selenium.Firefox;
 using System.Threading;
 using System.Globalization;
@@ -54,11 +55,11 @@
 				submitButton.Click ();

 				Thread.Sleep (1000);
-				driver.Navigate().GoToUrl("http://www.fitocracy.com/profile/");
-
+				driver.Navigate().GoToUrl(fitocracyProfilePage);

 				var imgElement = driver.FindElementByXPath ("//input[@name='profile_user']");
 				userId = imgElement.GetAttribute ("value");
+

 				var indexer = 0;
 				while(true) {
@@ -74,38 +75,44 @@
 					var workouts = driver.FindElementsByXPath ("//div[@data-ag-type='workout']");
 					indexer += 15;
 					Console.WriteLine (indexer + ":" +workouts.Count);
+					foreach (var workout in workouts) {
+						var workoutData = workout.Text;
+						var tagName = workout.TagName;
+
+						var actionPrompts = workout.FindElements (By.XPath (".//div[@class='action_prompt']"));
+						var prompts = actionPrompts.Select (x => x.Text).ToList ();
+					}

 					var levelUps = driver.FindElementsByXPath ("//div[@data-ag-type='levelup']");
 					foreach (var levelUp in levelUps)
-						HandleLevelUp (levelUp.Text);
+						HandleLevelUp (levelUp);
 				}
 			}
 		}

-		protected void HandleLevelUp (string levelUpData)
+		protected void HandleLevelUp (IWebElement levelUp)
 		{
-			string[] levelUpSplit = levelUpData.Split (new [] { '\n' });
+			var levelRaw = levelUp.FindElement (
+				By.XPath (".//div[@class='dramatic-description']")).Text;
+			var dateRaw = levelUp.FindElement (
+				By.XPath (".//a[@class='action_time gray_link']")).Text;

-			string dateRaw = levelUpSplit [1];
-			string levelRaw = levelUpSplit [3];
-			string propsRaw = levelUpSplit [7];
+			var propsRaw = levelUp.FindElement (By.XPath (".//span[@class='prop-list']"));
+			var propsListRaw = propsRaw.FindElements(
+				By.XPath (".//span")).Select (x => x.Text.Replace(",","")).ToList ();

 			string levelStr = levelRaw.Split (new [] { ' ' }, StringSplitOptions.RemoveEmptyEntries) [1];
 			int level = Convert.ToInt32 (levelStr);

+
 			DateTime dateTime = DateTime.ParseExact (dateRaw, "s", CultureInfo.InvariantCulture);

-			var proppedStr = propsRaw.Contains ("others") ? propsRaw.Split (
-				new [] { "others propped this." }, StringSplitOptions.RemoveEmptyEntries) [1] : propsRaw;
-			proppedStr = proppedStr.Replace ("propped this.", "");
-
-			var props = proppedStr.Split (new [] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList ();
-
-			var levelUp = new LevelUp (level, dateTime, props);
+			var levelUpInst = new LevelUp (level, dateTime, propsListRaw);

 			if (LevelUps != null)
-				LevelUps (this, new LevelUpEventArgs (levelUp));
+				LevelUps (this, new LevelUpEventArgs (levelUpInst));
 		}
 	}
 }

+


Send scenarios only while in flight or track station

--- Client/Systems/Scenario/ScenarioSystem.cs
+++ Client/Systems/Scenario/ScenarioSystem.cs
@@ -70,7 +70,7 @@
         /// </summary>
         public void SendScenarioModules()
         {
-            if (Enabled)
+            if (Enabled && HighLogic.LoadedScene >= GameScenes.FLIGHT)
             {
                 var modules = ScenarioRunner.GetLoadedModules();
                 ParseModulesToConfigNodes(modules);