Fix unit tests to use a mock Api dependency and run locally instead of calling out to web. Split unit tests so each test asserts a single condition

--- JenkinsTransport.UnitTests/JenkinsTransportExtensionTests.cs
+++ JenkinsTransport.UnitTests/JenkinsTransportExtensionTests.cs
@@ -21,6 +21,15 @@
         {
             public Mock<IWebRequestFactory> MockWebRequestFactory { get; set; }
             public Mock<IJenkinsApiFactory> MockJenkinsApiFactory { get; set; }
+            public Mock<IJenkinsApi> MockApi;
+            public IJenkinsApi Api
+            {
+                get
+                {
+                    return MockApi.Object;
+                }
+            }
+
             public IWebRequestFactory WebRequestFactory { get { return MockWebRequestFactory.Object; } }
             public IJenkinsApiFactory JenkinsApiFactory { get { return MockJenkinsApiFactory.Object; }}

@@ -28,6 +37,16 @@
             {
                 MockWebRequestFactory = new Mock<IWebRequestFactory>();
                 MockJenkinsApiFactory = new Mock<IJenkinsApiFactory>();
+                MockApi = new Mock<IJenkinsApi>();
+
+                // Default configuration for ApiFactory is to return this mock
+                MockJenkinsApiFactory
+                    .Setup(x => x.Create(
+                        It.IsAny<string>(),
+                        It.IsAny<string>(),
+                        It.IsAny<IWebRequestFactory>()))
+                    .Returns(Api);
+
             }
         }

@@ -90,22 +109,81 @@
             Assert.AreEqual(target.Configuration.Url, "https://some.othertest.server.com/");
         }

-        [TestMethod]
-        public void TestRetrieveProjectManager()
-        {
-            TestMocks mocks = new TestMocks();
-            var target = CreateTestTarget(mocks);
+        [TestMethod]
+        public void RetrieveProjectManager_should_return_instance_of_JenkinsProjectManager()
+        {
+            TestMocks mocks = new TestMocks();
+            var target = CreateTestTarget(mocks);
+
+            List<JenkinsJob> allJobs = new List<JenkinsJob>();
+
+            mocks.MockApi
+                .Setup(x => x.GetAllJobs())
+                .Returns(allJobs);

             // Act
             var projectManager = target.RetrieveProjectManager("Test Project");
-            Assert.IsInstanceOfType(projectManager, typeof(JenkinsProjectManager));
-
-            var jenkinsProjectManager = (JenkinsProjectManager)projectManager;
-            Assert.AreEqual(target.Configuration, jenkinsProjectManager.Configuration);
-            Assert.AreEqual(jenkinsProjectManager.ProjectName, "Test Project");
-            Assert.IsNotNull(jenkinsProjectManager.AuthorizationInformation);
-        }
-
+
+            // Assert
+            projectManager.Should().BeAssignableTo<JenkinsProjectManager>();
+        }
+
+        [TestMethod]
+        public void RetrieveProjectManager_instance_should_use_configuration()
+        {
+            TestMocks mocks = new TestMocks();
+            var target = CreateTestTarget(mocks);
+
+            List<JenkinsJob> allJobs = new List<JenkinsJob>();
+
+            mocks.MockApi
+                .Setup(x => x.GetAllJobs())
+                .Returns(allJobs);
+
+            // Act
+            var projectManager = (JenkinsProjectManager) target.RetrieveProjectManager("Test Project");
+
+            // Assert
+            target.Configuration.Should().Be(projectManager.Configuration);
+        }
+
+        [TestMethod]
+        public void RetrieveProjectManager_instance_should_use_supplied_projectName()
+        {
+            TestMocks mocks = new TestMocks();
+            var target = CreateTestTarget(mocks);
+
+            List<JenkinsJob> allJobs = new List<JenkinsJob>();
+
+            mocks.MockApi
+                .Setup(x => x.GetAllJobs())
+                .Returns(allJobs);
+
+            // Act
+            var projectManager = (JenkinsProjectManager)target.RetrieveProjectManager("Test Project");
+
+            // Assert
+            projectManager.ProjectName.Should().Be("Test Project");
+        }
+
+        [TestMethod]
+        public void RetrieveProjectManager_instance_AuthorizationInformation_should_not_be_null()
+        {
+            TestMocks mocks = new TestMocks();
+            var target = CreateTestTarget(mocks);
+
+            List<JenkinsJob> allJobs = new List<JenkinsJob>();
+
+            mocks.MockApi
+                .Setup(x => x.GetAllJobs())
+                .Returns(allJobs);
+
+            // Act
+            var projectManager = (JenkinsProjectManager)target.RetrieveProjectManager("Test Project");
+
+            // Assert
+            projectManager.AuthorizationInformation.Should().NotBeNull();
+        }

         [TestMethod]
         public void TestRetrieveServerManager()


Info messages if there is no invoice.

Info messages if there is no invoice.

--- LanceTrack.Web/Features/Invoicing/InvoiceListTemplate.cshtml
+++ LanceTrack.Web/Features/Invoicing/InvoiceListTemplate.cshtml
@@ -18,7 +18,8 @@
         Archive

-

+

         Invoice #

@@ -33,7 +34,7 @@

         {{inv.invoiceNum}}
@@ -58,3 +59,7 @@
         {{ inv.isPaid ? "Paid" : "Cancelled" }}

+

+    No invoices yet. Track time and bill some project to make invoice.
+


remove whitespace

remove whitespace

--- src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiRequests/GetAccountProjectionSummaryRequest.cs
+++ src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiRequests/GetAccountProjectionSummaryRequest.cs
@@ -7,7 +7,6 @@
         private readonly long _accountId;
         public string GetUrl => $"Projections/{_accountId}";

-
         public GetAccountProjectionSummaryRequest(long accountId)
         {
             _accountId = accountId;


Update the entity type with a complex type property unit test.

--- test/ODataReader.v4UnitTests/Given_entity_types_in_a_valid_edmx_when_passed_to_the_ODataReader.cs
+++ test/ODataReader.v4UnitTests/Given_entity_types_in_a_valid_edmx_when_passed_to_the_ODataReader.cs
@@ -287,7 +287,7 @@
         }

         [Fact]
-        public void When_BaseType_blah()
+        public void When_a_Property_references_a_ComplexType_it_returns_an_OdcmEntityClass_with_a_property_having_the_corresponding_OdcmComplexType()
         {
             string complexTypePropertyName = string.Empty;

@@ -322,11 +322,11 @@
                 .BeOfType<OdcmEntityClass>("because entity types should result in an OdcmEntityClass");
             var complexProperty = (from property in odcmEntityType.As<OdcmEntityClass>().Properties
                                    where property.Name.Equals(complexTypePropertyName)
-                                   select property);
-            complexProperty.Count()
-                .Should()
-                .Be(1, "because a property referencing a complex type should result in a property in the OdcmEntityClass");
-            complexProperty.First().Type
+                                   select property).FirstOrDefault();
+            complexProperty
+                .Should()
+                .NotBeNull("because a property referencing a complex type should result in a property in the OdcmEntityClass");
+            complexProperty.Type
                 .Should()
                 .Be(odcmComplexType, "because a property referencing a complex type should result in a property with a type matching the OdcmComplexClass of the property");
         }


Fix remaining cases of invalid bindable operations during lease

--- osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs
+++ osu.Game/Screens/OnlinePlay/Lounge/Components/RoomsContainer.cs
@@ -154,7 +154,8 @@

         protected override bool OnClick(ClickEvent e)
         {
-            selectedRoom.Value = null;
+            if (!selectedRoom.Disabled)
+                selectedRoom.Value = null;
             return base.OnClick(e);
         }

@@ -216,6 +217,9 @@

         private void selectNext(int direction)
         {
+            if (selectedRoom.Disabled)
+                return;
+
             var visibleRooms = Rooms.AsEnumerable().Where(r => r.IsPresent);

             Room room;


Detect region enabled by default

Detect region enabled by default

--- src/bindings/csharp/alprnet/Alpr.cs
+++ src/bindings/csharp/alprnet/Alpr.cs
@@ -79,6 +79,7 @@
             try
             {
                 native_instance = openalpr_init(country, config_file, runtime_dir);
+                openalpr_set_detect_region(native_instance, 1);
             }
             catch (System.DllNotFoundException)
             {


RegEx specification is not depending on user provider.

--- code/Toggle.Net.Tests/TextFile/RegExTest.cs
+++ code/Toggle.Net.Tests/TextFile/RegExTest.cs
@@ -24,7 +24,6 @@
 			mappings.AddMapping("myRegex", new RegExSpecification(new Regex("^" + wordToMatch + "$")));

 			var toggleChecker = new ToggleConfiguration(new FileParser(new FileReaderStub(content), mappings))
-				.SetUserProvider(new UserProviderStub("sometoggle"))
 				.Create();

 			toggleChecker.IsEnabled("sometoggle")
@@ -45,7 +44,6 @@
 			mappings.AddMapping("myRegex", new RegExSpecification(new Regex("^somethingelse$")));

 			var toggleChecker = new ToggleConfiguration(new FileParser(new FileReaderStub(content), mappings))
-				.SetUserProvider(new UserProviderStub("sometoggle"))
 				.Create();

 			toggleChecker.IsEnabled("sometoggle")
@@ -66,7 +64,7 @@

 			Assert.Throws<IncorrectTextFileException>(() =>
 				new ToggleConfiguration(new FileParser(new FileReaderStub(content), mappings))
-				.SetUserProvider(new UserProviderStub("sometoggle")).Create()).ToString()
+				.Create()).ToString()
 			.Should().Contain(string.Format(RegExSpecification.MustDeclareRegexPattern, "sometoggle"));
 		}
 	}


Updated assembly version number

Updated assembly version number

--- MSBuild.NugetContentRestore.Tasks/Properties/AssemblyInfo.cs
+++ MSBuild.NugetContentRestore.Tasks/Properties/AssemblyInfo.cs
@@ -13,5 +13,5 @@
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("1d75b795-214e-43cf-87ad-c34a814c2e57")]

-[assembly: AssemblyVersion("0.1.6.0")]
-[assembly: AssemblyFileVersion("0.1.6.0")]
+[assembly: AssemblyVersion("0.1.7.0")]
+[assembly: AssemblyFileVersion("0.1.7.0")]


Fixes convention not working for Model_Prop_AttributeShortName

--- ModelMetadataExtensions/ConventionalModelMetadataProvider.cs
+++ ModelMetadataExtensions/ConventionalModelMetadataProvider.cs
@@ -89,10 +89,10 @@
                         if (!resourceType.PropertyExists(resourceKey)) {
                             continue;
                         }
+                    }

-                        validationAttribute.ErrorMessageResourceType = resourceType;
-                        validationAttribute.ErrorMessageResourceName = resourceKey;
-                    }
+                    validationAttribute.ErrorMessageResourceType = resourceType;
+                    validationAttribute.ErrorMessageResourceName = resourceKey;
                 }
             }
         }


Fixed an issue where lists regions would not show the correct amount of items.

Fixed an issue where lists regions would not show the correct amount of
items.

--- core/Piranha/Repositories/PageRepository.cs
+++ core/Piranha/Repositories/PageRepository.cs
@@ -475,6 +475,8 @@
                             }
                         }
                     } else {
+
+                        var fieldCount = page.Fields.Count(f => f.RegionId == regionKey && f.FieldId == region.Fields[0].Id);
                         var sortOrder = 0;

                         do {
@@ -486,7 +488,7 @@
                                 AddComplexValue(model, regionKey, fields.Where(f => f.SortOrder == sortOrder).ToList());
                             }
                             sortOrder++;
-                        } while (page.Fields.Count(f => f.SortOrder == sortOrder) > 0);
+                        } while (fieldCount > sortOrder);
                     }
                 }
                 return model;


Alter casing of abbreviations in LcdMode enum

--- elbgb_core/LCDController.cs
+++ elbgb_core/LCDController.cs
@@ -34,8 +34,8 @@
 		{
 			HBlank = 0x00,
 			VBlank = 0x01,
-			OAMRead = 0x02,
-			VRAMRead = 0x03,
+			OamRead = 0x02,
+			VramRead = 0x03,
 		}

 		private const int ScreenWidth = 160;
@@ -97,10 +97,12 @@
 		{
 			SynchroniseWithSystemClock();

+			// 0x8000 - 0x9FFF - vram
 			if (address >= 0x8000 && address <= 0x9fff)
 			{
 				return _vram[address & 0x1FFF];
 			}
+			// 0xFE00 - 0xFE9F - OAM memory
 			else if (address >= 0xFE00 && address <= 0xFE9F)
 			{
 				return _oam[address & 0xFF];
@@ -151,10 +153,12 @@
 		{
 			SynchroniseWithSystemClock();

+			// 0x8000 - 0x9FFF - vram
 			if (address >= 0x8000 && address <= 0x9fff)
 			{
 				_vram[address & 0x1FFF] = value;
 			}
+			// 0xFE00 - 0xFE9F - OAM memory
 			else if (address >= 0xFE00 && address <= 0xFE9F)
 			{
 				_oam[address & 0xFF] = value;
@@ -171,7 +175,7 @@
 						// lcd starts in mode 2 when enabled
 						if (_displayEnabled)
 						{
-							_lcdMode = LcdMode.OAMRead;
+							_lcdMode = LcdMode.OamRead;
 						}
 						// reset LY when display is disabled
 						else
@@ -314,7 +318,7 @@
 				// Mode 2 - OAM read, 77-83 cycles of frame
 				if ((_frameClock % 456) < 80)
 				{
-					if (_lcdMode != LcdMode.OAMRead)
+					if (_lcdMode != LcdMode.OamRead)
 					{
 						// We've just entered OAM read so we're at the beginning of the line,
 						// increment the current scanline unless we're coming from VBlank, then
@@ -325,7 +329,7 @@
 							CompareScanlineValue();
 						}

-						_lcdMode = LcdMode.OAMRead;
+						_lcdMode = LcdMode.OamRead;

 						// raise OAM stat interrupt if requested
 						if ((_lcdStatus & 0x20) == 0x20) _gb.RequestInterrupt(Interrupt.LCDCStatus);
@@ -334,9 +338,9 @@
 				// Mode 3 - OAM and VRAM read, 162-175 cycles of frame
 				else if ((_frameClock % 456) < 252)
 				{
-					if (_lcdMode != LcdMode.VRAMRead)
+					if (_lcdMode != LcdMode.VramRead)
 					{
-						_lcdMode = LcdMode.VRAMRead;
+						_lcdMode = LcdMode.VramRead;
 					}
 				}
 				// Mode 0 - HBlank, 201-207 cycles of frame
@@ -379,7 +383,7 @@
 					// present the screen data
 					_gb.Interface.VideoRefresh(_screenData);
 				}
-				// processing vblank
+				// processing vblank
 				else
 				{
 					_vblankClock += cycleCount;


Stream role temporarily disabled

Stream role temporarily disabled

--- NadekoBot.Core/Modules/Utility/Services/StreamRoleService.cs
+++ NadekoBot.Core/Modules/Utility/Services/StreamRoleService.cs
@@ -1,18 +1,18 @@
-using System;
+using Discord;
+using Discord.Net;
+using Discord.WebSocket;
+using NadekoBot.Common.TypeReaders;
+using NadekoBot.Core.Services;
+using NadekoBot.Core.Services.Database.Models;
+using NadekoBot.Extensions;
+using NadekoBot.Modules.Utility.Common;
+using NadekoBot.Modules.Utility.Common.Exceptions;
+using NadekoBot.Modules.Utility.Extensions;
+using NLog;
+using System;
 using System.Collections.Concurrent;
 using System.Linq;
 using System.Threading.Tasks;
-using Discord;
-using Discord.WebSocket;
-using NadekoBot.Extensions;
-using NadekoBot.Core.Services;
-using NadekoBot.Core.Services.Database.Models;
-using NLog;
-using NadekoBot.Modules.Utility.Extensions;
-using NadekoBot.Common.TypeReaders;
-using NadekoBot.Modules.Utility.Common;
-using NadekoBot.Modules.Utility.Common.Exceptions;
-using Discord.Net;

 namespace NadekoBot.Modules.Utility.Services
 {
@@ -57,14 +57,14 @@

         private Task Client_GuildMemberUpdated(SocketGuildUser before, SocketGuildUser after)
         {
-            var _ = Task.Run(async () =>
-            {
-                //if user wasn't streaming or didn't have a game status at all
-                if (guildSettings.TryGetValue(after.Guild.Id, out var setting))
-                {
-                    await RescanUser(after, setting).ConfigureAwait(false);
-                }
-            });
+            //var _ = Task.Run(async () =>
+            //{
+            //    //if user wasn't streaming or didn't have a game status at all
+            //    if (guildSettings.TryGetValue(after.Guild.Id, out var setting))
+            //    {
+            //        await RescanUser(after, setting).ConfigureAwait(false);
+            //    }
+            //});

             return Task.CompletedTask;
         }


Now generating really janky roads

Now generating really janky roads

--- Navier-Boats/Navier-Boats/Navier-Boats/Engine/Level/Chunk.cs
+++ Navier-Boats/Navier-Boats/Navier-Boats/Engine/Level/Chunk.cs
@@ -80,10 +80,7 @@
             #endregion

             #region RoadLayer
-            if (x == 0 && y == 0)
-            {
-                chunkDataRoadLayer = terrainGen.GetStartingChunkPattern();
-            }
+            chunkDataRoadLayer = terrainGen.GenerateRoadLayer(connections);
             #endregion

             #region OverLayer


[Partial fix for bug #987646] Ensure that the Open Images pad disposes of old image previews.

--- Pinta.Gui.Widgets/Widgets/OpenImages/OpenImagesListWidget.cs
+++ Pinta.Gui.Widgets/Widgets/OpenImages/OpenImagesListWidget.cs
@@ -149,6 +149,13 @@

 		private void RebuildDocumentList ()
 		{
+            // Ensure that the old image previews are disposed.
+            foreach (object[] row in store)
+            {
+                var imageSurface = (Cairo.ImageSurface)row[0];
+                (imageSurface as IDisposable).Dispose ();
+            }
+
 			store.Clear ();

 			foreach (Document doc in PintaCore.Workspace.OpenDocuments)


Add ENAME_EXCLAMATION_MARK condition

Add ENAME_EXCLAMATION_MARK condition

--- PoorMansTSqlFormatterLib/Formatters/TSqlStandardFormatter.cs
+++ PoorMansTSqlFormatterLib/Formatters/TSqlStandardFormatter.cs
@@ -571,6 +571,7 @@
                     break;

                 case SqlXmlConstants.ENAME_PERIOD:
+                case SqlXmlConstants.ENAME_EXCLAMATION_MARK:
                 case SqlXmlConstants.ENAME_SEMICOLON:
                 case SqlXmlConstants.ENAME_SCOPERESOLUTIONOPERATOR:
                     //always ignores requested word spacing, and doesn't request a following space either.


xpath is hard

xpath is hard

--- RelhaxModpack/RelhaxModpack/Windows/ModSelectionList.xaml.cs
+++ RelhaxModpack/RelhaxModpack/Windows/ModSelectionList.xaml.cs
@@ -308,8 +308,8 @@
                 //if not stable db, update WoT current version and online folder version macros from modInfoxml itself
                 if (ModpackSettings.DatabaseDistroVersion != DatabaseVersions.Stable)
                 {
-                    Settings.WoTModpackOnlineFolderVersion = XMLUtils.GetXMLStringFromXPath(modInfoDocument, "//modInfoAlpha.xml@onlineFolder");
-                    Settings.WoTClientVersion = XMLUtils.GetXMLStringFromXPath(modInfoDocument, "//modInfoAlpha.xml@version");
+                    Settings.WoTModpackOnlineFolderVersion = XMLUtils.GetXMLStringFromXPath(modInfoDocument, "//modInfoAlpha.xml/@onlineFolder");
+                    Settings.WoTClientVersion = XMLUtils.GetXMLStringFromXPath(modInfoDocument, "//modInfoAlpha.xml/@version");
                 }

                 //parse the modInfoXml to list in memory


Handle the cases where the output extension already begins with a "." or is empty

--- Sharpmake.Generators/VisualStudio/ProjectOptionsGenerator.cs
+++ Sharpmake.Generators/VisualStudio/ProjectOptionsGenerator.cs
@@ -1087,12 +1087,15 @@
         private void GenerateLinkerOptions(IGenerationContext context, ProjectOptionsGenerationContext optionsContext)
         {
             string outputExtension = context.Configuration.OutputExtension;
-            string outputFileName = $"{optionsContext.PlatformVcxproj.GetOutputFileNamePrefix(context, context.Configuration.Output)}{optionsContext.TargetName}";
+            if (outputExtension.Length > 0 && !outputExtension.StartsWith(".", StringComparison.Ordinal))
+                outputExtension = outputExtension.Insert(0, ".");
+
+            string outputFileName = optionsContext.PlatformVcxproj.GetOutputFileNamePrefix(context, context.Configuration.Output) + optionsContext.TargetName;

             context.Options["ImportLibrary"] = FileGeneratorUtilities.RemoveLineTag;
             context.CommandLineOptions["ImportLibrary"] = FileGeneratorUtilities.RemoveLineTag;
             context.Options["OutputFileName"] = outputFileName;
-            context.Options["OutputFileExtension"] = "." + outputExtension;
+            context.Options["OutputFileExtension"] = outputExtension;

             context.Options["AdditionalDeploymentFolders"] = "";

@@ -1103,7 +1106,7 @@
                 case Project.Configuration.OutputType.Exe:
                 case Project.Configuration.OutputType.DotNetConsoleApp:
                 case Project.Configuration.OutputType.DotNetWindowsApp:
-                    context.Options["OutputFile"] = optionsContext.OutputDirectoryRelative + Util.WindowsSeparator + outputFileName + "." + outputExtension;
+                    context.Options["OutputFile"] = optionsContext.OutputDirectoryRelative + Util.WindowsSeparator + outputFileName + outputExtension;
                     if (context.Configuration.Output == Project.Configuration.OutputType.Dll)
                     {
                         string importLibRelative = optionsContext.OutputLibraryDirectoryRelative + Util.WindowsSeparator + optionsContext.TargetName + ".lib";
@@ -1112,7 +1115,7 @@
                     }
                     break;
                 case Project.Configuration.OutputType.Lib:
-                    context.Options["OutputFile"] = optionsContext.OutputLibraryDirectoryRelative + Util.WindowsSeparator + outputFileName + "." + outputExtension;
+                    context.Options["OutputFile"] = optionsContext.OutputLibraryDirectoryRelative + Util.WindowsSeparator + outputFileName + outputExtension;
                     break;
                 case Project.Configuration.OutputType.Utility:
                 case Project.Configuration.OutputType.None:


AvoidAutomaticUpgrade

AvoidAutomaticUpgrade

--- Signum.Engine.Extensions/Authorization/OperationAuthLogic.cs
+++ Signum.Engine.Extensions/Authorization/OperationAuthLogic.cs
@@ -24,6 +24,8 @@
         public static IManualAuth<Enum, OperationAllowed> Manual { get { return cache; } }

         public static bool IsStarted { get { return cache != null; } }
+
+        public static readonly HashSet<Enum> AvoidAutomaticUpgrade = new HashSet<Enum>();

         public static void Start(SchemaBuilder sb)
         {
@@ -257,38 +259,44 @@
         {
             var result = Max(baseValues);

+            if(key != null && OperationAuthLogic.AvoidAutomaticUpgrade.Contains(key))
+                return result;
+
+            if (key != null && result == OperationAuthLogic.MaxTypePermission(key, TypeAllowedBasic.Modify, t => TypeAuthLogic.GetAllowedBase(role, t)) )
+                return OperationAuthLogic.MaxTypePermission(key, TypeAllowedBasic.Modify, t => TypeAuthLogic.GetAllowed(role, t));
+
+            return result;
+        }
+
+        static OperationAllowed Max(IEnumerable<OperationAllowed> baseValues)
+        {
+            OperationAllowed result = OperationAllowed.None;
+
+            foreach (var item in baseValues)
+            {
+                if (item > result)
+                    result = item;
+
+                if (result == OperationAllowed.Allow)
+                    return result;
+
+            }
+            return result;
+        }
+
+        protected override OperationAllowed Intersection(Enum key, Lite<RoleDN> role, IEnumerable<OperationAllowed> baseValues)
+        {
+            var result = Min(baseValues);
+
+            if (key != null && OperationAuthLogic.AvoidAutomaticUpgrade.Contains(key))
+                return result;
+
             if (key != null && result == OperationAuthLogic.MaxTypePermission(key, TypeAllowedBasic.Modify, t => TypeAuthLogic.GetAllowedBase(role, t)))
                 return OperationAuthLogic.MaxTypePermission(key, TypeAllowedBasic.Modify, t => TypeAuthLogic.GetAllowed(role, t));

             return result;
         }

-        static OperationAllowed Max(IEnumerable<OperationAllowed> baseValues)
-        {
-            OperationAllowed result = OperationAllowed.None;
-
-            foreach (var item in baseValues)
-            {
-                if (item > result)
-                    result = item;
-
-                if (result == OperationAllowed.Allow)
-                    return result;
-
-            }
-            return result;
-        }
-
-        protected override OperationAllowed Intersection(Enum key, Lite<RoleDN> role, IEnumerable<OperationAllowed> baseValues)
-        {
-            var result = Min(baseValues);
-
-            if (key != null && result == OperationAuthLogic.MaxTypePermission(key, TypeAllowedBasic.Modify, t => TypeAuthLogic.GetAllowedBase(role, t)))
-                return OperationAuthLogic.MaxTypePermission(key, TypeAllowedBasic.Modify, t => TypeAuthLogic.GetAllowed(role, t));
-
-            return result;
-        }
-
         private static OperationAllowed Min(IEnumerable<OperationAllowed> baseValues)
         {
             OperationAllowed result = OperationAllowed.Allow;
@@ -307,7 +315,9 @@

         public override Func<Enum, OperationAllowed> MergeDefault(Lite<RoleDN> role, IEnumerable<Func<Enum, OperationAllowed>> baseDefaultValues)
         {
-            return key => OperationAuthLogic.MaxTypePermission(key, TypeAllowedBasic.Modify, t => TypeAuthLogic.GetAllowed(role, t));
+            return key =>
+                OperationAuthLogic.AvoidAutomaticUpgrade.Contains(key) ? OperationAllowed.None :
+                OperationAuthLogic.MaxTypePermission(key, TypeAllowedBasic.Modify, t => TypeAuthLogic.GetAllowed(role, t));
         }
     }


Made QosChannels automatically initialized.

--- Framework/Backstab.cs
+++ Framework/Backstab.cs
@@ -69,7 +69,12 @@
 [System.Serializable]
 public class ChannelData {
 	public QosType qosType;
-	[ReadOnly] public int id;
+	public int id;
+
+	public ChannelData (QosType qosType, int id) {
+		this.qosType = qosType;
+		this.id = id;
+	}
 }

 public class Backstab : MonoBehaviour {
@@ -94,6 +99,7 @@
 	public int NumConnections { get { return numConnections; } }
 	private int attemptConnectionId = -108; //The ID of the connection most recently attempted.

+	[ReadOnly]
 	public ChannelData[] channelData;

 	private bool isServer;
@@ -294,8 +300,14 @@

 	private ConnectionConfig GetConnectionConfig () {
 		ConnectionConfig config = new ConnectionConfig();
-		foreach (ChannelData d in channelData) { d.id = config.AddChannel(d.qosType); }
+		List<ChannelData> cd = new List<ChannelData>();
+
+		foreach (QosType q in Enum.GetValues(typeof(QosType))) {
+			cd.Add(new ChannelData(q, config.AddChannel(q)));
+		}
+
 		ConnectionConfig.Validate(config);
+		channelData = cd.ToArray();
 		return config;
 	}


Version 1.3.0.0

Version 1.3.0.0

--- GlobalAssemblyInfo.cs
+++ GlobalAssemblyInfo.cs
@@ -20,5 +20,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.2.0.5")]
-[assembly: AssemblyFileVersion("1.2.0.5")]
+[assembly: AssemblyVersion("1.3.0.0")]
+[assembly: AssemblyFileVersion("1.3.0.0")]


Added locking in MultitenantContainer.Dispose; added comments around lock statements; switched from synchronized Hashtable to standard Hashtable as we manage locks ourselves.

--- contrib/Source/AutofacContrib.Multitenant/MultitenantContainer.cs
+++ contrib/Source/AutofacContrib.Multitenant/MultitenantContainer.cs
@@ -1,11 +1,11 @@
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Diagnostics.CodeAnalysis;
 using System.Globalization;
 using Autofac;
 using Autofac.Core;
 using Autofac.Util;
-using System.Collections;

 namespace AutofacContrib.Multitenant
 {
@@ -58,13 +58,14 @@
         /// is <see cref="System.Object"/>, value is <see cref="Autofac.ILifetimeScope"/>.
         /// </summary>
         /// <remarks>
-        /// Using synchronized <see cref="System.Collections.Hashtable"/> rather than
+        /// Using <see cref="System.Collections.Hashtable"/> rather than
         /// a generic dictionary because dictionaries aren't threadsafe even with
-        /// the lock/double-check.
+        /// the lock/double-check. Doesn't have to be a synchronized hashtable
+        /// since we're managing the write operations internally with our own locks.
         /// </remarks>
         /// <seealso href="http://stackoverflow.com/questions/2624301/how-to-show-that-the-double-checked-lock-pattern-with-dictionarys-trygetvalue-is"/>
         // Issue #280: Incorrect double-checked-lock pattern usage in MultitenantContainer.GetTenantScope
-        private readonly Hashtable _tenantLifetimeScopes = Hashtable.Synchronized(new Hashtable());
+        private readonly Hashtable _tenantLifetimeScopes = new Hashtable();

         /// <summary>
         /// Gets the base application container.
@@ -264,8 +265,14 @@
                 tenantId = this._defaultTenantId;
             }

+            // Skipping a read/lock/double-check here since ConfigureTenant
+            // doesn't get called often and is OK to block. Jump straight to
+            // the lock before read.
             lock (this._tenantLifetimeScopes.SyncRoot)
             {
+                // The check and [potential] scope creation are locked here to
+                // ensure atomicity. We don't want to check and then have another
+                // thread create the lifetime scope behind our backs.
                 if (this._tenantLifetimeScopes.ContainsKey(tenantId))
                 {
                     throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, Properties.Resources.MultitenantContainer_TenantAlreadyConfigured, tenantId));
@@ -285,9 +292,14 @@
         {
             if (disposing)
             {
-                foreach (ILifetimeScope scope in this._tenantLifetimeScopes.Values)
+                // Lock the lifetime scope table so no threads can add new lifetime
+                // scopes while we're disposing.
+                lock (this._tenantLifetimeScopes.SyncRoot)
                 {
-                    scope.Dispose();
+                    foreach (ILifetimeScope scope in this._tenantLifetimeScopes.Values)
+                    {
+                        scope.Dispose();
+                    }
                 }
                 this.ApplicationContainer.Dispose();
             }
@@ -330,11 +342,15 @@
             {
                 tenantId = this._defaultTenantId;
             }
+
             object tenantScope = this._tenantLifetimeScopes[tenantId];
             if (tenantScope == null)
             {
                 lock (this._tenantLifetimeScopes.SyncRoot)
                 {
+                    // The check and [potential] scope creation are locked here to
+                    // ensure atomicity. We don't want to check and then have another
+                    // thread create the lifetime scope behind our backs.
                     tenantScope = this._tenantLifetimeScopes[tenantId];
                     if (tenantScope == null)
                     {


Added htmlAttributes overload of NavigationLink extensions

--- NavigationMvc/LinkExtensions.cs
+++ NavigationMvc/LinkExtensions.cs
@@ -1,4 +1,5 @@
-using System.Web;
+using System.Collections.Generic;
+using System.Web;
 using System.Web.Mvc;

 namespace Navigation.Mvc
@@ -12,10 +13,16 @@

 		public static MvcHtmlString NavigationLink(this HtmlHelper htmlHelper, string linkText, string action, NavigationData toData)
 		{
+			return NavigationLink(htmlHelper, linkText, action, toData, null);
+		}
+
+		public static MvcHtmlString NavigationLink(this HtmlHelper htmlHelper, string linkText, string action, NavigationData toData, IDictionary<string, object> htmlAttributes)
+		{
 			TagBuilder tagBuilder = new TagBuilder("a")
 			{
 				InnerHtml = !string.IsNullOrEmpty(linkText) ? HttpUtility.HtmlEncode(linkText) : string.Empty
 			};
+			tagBuilder.MergeAttributes<string, object>(htmlAttributes);
 			tagBuilder.MergeAttribute("href", StateController.GetNavigationLink(action, toData));
 			return MvcHtmlString.Create(tagBuilder.ToString(TagRenderMode.Normal));
 		}


Added "is_local" to the PlaylistTrack-Object

--- SpotifyAPI/SpotifyWebAPI/Models/GeneralModels.cs
+++ SpotifyAPI/SpotifyWebAPI/Models/GeneralModels.cs
@@ -51,6 +51,8 @@
         public PublicProfile AddedBy { get; set; }
         [JsonProperty("track")]
         public FullTrack Track { get; set; }
+        [JsonProperty("is_local")]
+        public Boolean IsLocal { get; set; }
     }
     public class CreatePlaylistArgs
     {


add possibility to register a timer for each nancy request

--- Src/Adapters/Nancy.Metrics/NancyGlobalMetrics.cs
+++ Src/Adapters/Nancy.Metrics/NancyGlobalMetrics.cs
@@ -1,12 +1,14 @@

 using System;
 using Metrics;
+using Metrics.Utils;
 using Nancy.Bootstrapper;
 namespace Nancy.Metrics
 {
     public class NancyGlobalMetrics : IHideObjectMembers
     {
         private const string TimerItemsKey = "__Mertics.RequestTimer__";
+        private const string RequestStartTimeKey = "__Metrics.RequestStartTime__";

         private readonly MetricsRegistry registry;

@@ -23,6 +25,9 @@
         /// processing Nancy requests.
         /// Registers a Timer metric named "NancyFx.Requests" that records how many requests per second are handled and also
         /// keeps a histogram of the request duration.
+        /// Registers a counter for the number of active requests.
+        /// Registers a histogram for the size of the POST and PUT requests.
+        /// Registers a timer metric for each non-error request.
         /// </summary>
         /// <param name="nancyPipelines">Pipelines to hook on.</param>
         public void RegisterAllMetrics(IPipelines nancyPipelines)
@@ -31,6 +36,7 @@
             RegisterErrorsMeter(nancyPipelines);
             RegisterActiveRequestCounter(nancyPipelines);
             RegisterPostAndPutRequestSizeHistogram(nancyPipelines);
+            RegisterTimerForEachRequest(nancyPipelines);
         }

         /// <summary>
@@ -114,6 +120,26 @@
             });
         }

+        public void RegisterTimerForEachRequest(IPipelines nancyPipelines)
+        {
+            nancyPipelines.BeforeRequest.AddItemToStartOfPipeline(ctx =>
+            {
+                ctx.Items["RequestStartTimeKey"] = Clock.Default.Nanoseconds;
+                return null;
+            });
+
+            nancyPipelines.AfterRequest.AddItemToEndOfPipeline(ctx =>
+            {
+                if (ctx.ResolvedRoute != null && !(ctx.ResolvedRoute is Routing.NotFoundRoute))
+                {
+                    string name = string.Format("{0}.{1} [{2}]", this.MetricsPrefix, ctx.ResolvedRoute.Description.Method, ctx.ResolvedRoute.Description.Path);
+                    var startTime = (long)ctx.Items["RequestStartTimeKey"];
+                    var elapsed = Clock.Default.Nanoseconds - startTime;
+                    Metric.Timer(name, Unit.Requests).Record(elapsed, TimeUnit.Nanoseconds);
+                }
+            });
+        }
+
         private string Name(string name)
         {
             if (!string.IsNullOrEmpty(this.MetricsPrefix))


Added InvalidHandle property.

Added InvalidHandle property.

--- NtApiDotNet/Win32/Win32Utils.cs
+++ NtApiDotNet/Win32/Win32Utils.cs
@@ -128,5 +128,10 @@
                 throw new SafeWin32Exception();
             }
         }
+
+        /// <summary>
+        /// Get Windows INVALID_HANDLE_VALUE.
+        /// </summary>
+        public static IntPtr InvalidHandle { get => new IntPtr(-1); }
     }
 }


Refactor to the http in GithubClient

Refactor to the http in GithubClient

--- NuKeeper/Github/GithubClient.cs
+++ NuKeeper/Github/GithubClient.cs
@@ -3,7 +3,6 @@
 using System.Text;
 using System.Threading.Tasks;
 using Newtonsoft.Json;
-using NuGet.Protocol;

 namespace NuKeeper.Github
 {
@@ -12,11 +11,10 @@
         private readonly Settings _settings;
         private readonly GithubRequestBuilder _requestBuilder;

-        private static JsonSerializerSettings jsonSettings = new JsonSerializerSettings
+        private static readonly JsonSerializerSettings JsonSettings = new JsonSerializerSettings
         {
             ContractResolver = new LowercaseContractResolver()
         };
-

         public GithubClient(Settings settings)
         {
@@ -32,14 +30,18 @@
             }

             var requestUri = _requestBuilder.AddSecretToken(uri);
-
-            var requestBody = JsonConvert.SerializeObject(content, jsonSettings);
-
             var request = _requestBuilder.ConstructRequestMessage(requestUri, HttpMethod.Post);
-            request.Content = new StringContent(requestBody, Encoding.UTF8, "application/vnd.github.v3.text+json");
+            request.Content = ToJsonContent(content);

             var client = new HttpClient();
             return await client.SendAsync(request);
+        }
+
+        private HttpContent ToJsonContent<T>(T content)
+        {
+            var requestBody = JsonConvert.SerializeObject(content, JsonSettings);
+            const string gitHubApiJsonType = "application/vnd.github.v3.text+json";
+            return new StringContent(requestBody, Encoding.UTF8, gitHubApiJsonType);
         }

         public async Task<OpenPullRequestResult> OpenPullRequest(OpenPullRequestRequest request)


Add Detach() to TempFile

Add Detach() to TempFile

--- Palaso/IO/TempFile.cs
+++ Palaso/IO/TempFile.cs
@@ -19,6 +19,7 @@
 	{
 		protected string _path;
 		private string _folderToDelete; // if not null, delete this as well on dispose
+		private bool _detached;

 		public TempFile()
 		{
@@ -56,9 +57,21 @@
 			get { return _path; }
 		}

+		/// <summary>
+		/// Don't try to delete this file when Dispose()'d.
+		/// </summary>
+		public void Detach()
+		{
+			_detached = true;
+		}
+
 		// See comment on class above regarding Dispose
 		public void Dispose()
 		{
+			if (_detached)
+			{
+				return;
+			}
 			File.Delete(_path);
 			if (_folderToDelete != null)
 				DirectoryUtilities.DeleteDirectoryRobust(_folderToDelete);


Alt method

Alt method

--- Parsing/LangParser.cs
+++ Parsing/LangParser.cs
@@ -11,6 +11,11 @@
         // For recursive definitions use properties.  Also make sure fields that
         // are defined in terms of other fields occur last.

+        private static Parser<T> Alt<T>( params Parser<T>[] parsers )
+        {
+            return ParserUtil.Alternate( parsers );
+        }
+
         private static Parser<string> Lit( string value )
         {
             return ParserUtil.Match( value );
@@ -32,14 +37,14 @@
         }

         public static Parser<Empty> EndLine =
-            ParserUtil.Alternate(
+            Alt(
                 Lit( "\r\n" ),
                 Lit( "\n" ),
                 Lit( "\r" ) ).Map( v => new Empty() );

                 // TODO probably need end of file in here too
         public static Parser<Empty> Ws =
-            ParserUtil.Alternate(
+            Alt(
                 EndLine,
                 CastEmpty( Lit( " " ) ),
                 CastEmpty( Lit( "\t" ) ),
@@ -47,13 +52,13 @@
                 CastEmpty( Lit( "\v" ) ) ).ZeroOrMore().Map( v => new Empty() );

         public static Parser<NBoolean> Boolean =
-            ParserUtil.Alternate(
+            Alt(
                 Lit( "true" ),
                 Lit( "false" ) )
             .Map( value => new NBoolean( value == "true" ) );

         private static Parser<int> Digits =
-            ParserUtil.Alternate(
+            Alt(
                 Lit( "0" ),
                 Lit( "1" ),
                 Lit( "2" ),
@@ -69,7 +74,7 @@
             .Map( value => int.Parse( value ) );

         private static Parser<string> NonNumSymbolChar =
-            ParserUtil.Alternate(
+            Alt(
                 ParserUtil.EatCharIf( Char.IsLetter ).Map( c => new String( c, 1 ) ),
                 Lit( "_" ),
                 Lit( "~" ),
@@ -78,7 +83,7 @@

         public static Parser<string> Symbol =
             Bind( NonNumSymbolChar,            first =>
-            Bind( ParserUtil.Alternate(
+            Bind( Alt(
                       NonNumSymbolChar,
                       Digits.Map( d => d.ToString() ) )
                             .ZeroOrMore()
@@ -108,7 +113,7 @@
             Bind( Lit( "." ), () =>
             Bind( Digits, deci =>
             Bind(
-                ParserUtil.Alternate(
+                Alt(
                     Lit( "E" ),
                     Lit( "e" ) ), () =>
             Bind( Negative, negExp =>
@@ -116,7 +121,7 @@
             Unit( new Number( whole, negWhole, exponent, negExp, deci ) ) ) ) ) ) ) ) );

         public static Parser<Number> Number =
-            ParserUtil.Alternate(
+            Alt(
                 // The order here matters.  If we start with WholeNumber, then
                 // we will miss parse an exponent and/or decimal.
                 ExponentNumber,
@@ -138,13 +143,13 @@
             Unit( new NString( str ) ) ) ) ) );

         public static Parser<NString> NString =
-            ParserUtil.Alternate(
+            Alt(
                 NormalString,
                 RawString );

         private static Parser<Empty> LineComment =
             Bind( Lit( "--" ), () =>
-            Bind( ParserUtil.ParseUntil( ParserUtil.Alternate( EndLine, ParserUtil.End ) ), () =>
+            Bind( ParserUtil.ParseUntil( Alt( EndLine, ParserUtil.End ) ), () =>
             Unit( new Empty() ) ) );

         private static Parser<Empty> BlockComment =
@@ -157,7 +162,7 @@
             Unit( new Empty() ) ) ) ) );

         public static Parser<Empty> Comment =
-            ParserUtil.Alternate(
+            Alt(
                 // TODO test the toggle block sometime
                 // Line Comment needs to happen first in order to pull off the toggle block trick
                 LineComment,
@@ -229,7 +234,7 @@
         }
              // TODO test when finished
         private static Parser<Expr> _expr =
-            ParserUtil.Alternate(
+            Alt(
                 CastExpr( Boolean ),
                 CastExpr( Number ),
                 CastExpr( NString ),


LIBOMV-636: More timer cleanup

LIBOMV-636: More timer cleanup

git-svn-id: e915c4f8b2ea2a6e63cbe989b51c0994a698cc26@2999 52acb1d6-8a22-11de-b505-999d5b087335

--- OpenMetaverse/NetworkManager.cs
+++ OpenMetaverse/NetworkManager.cs
@@ -541,7 +541,11 @@
         public void RequestLogout()
         {
             // No need to run the disconnect timer any more
-            if (DisconnectTimer != null) DisconnectTimer.Dispose();
+            if (DisconnectTimer != null)
+            {
+                DisconnectTimer.Dispose();
+                DisconnectTimer = null;
+            }

             // This will catch a Logout when the client is not logged in
             if (CurrentSim == null || !connected)
@@ -642,7 +646,7 @@
             // Fire the disconnected callback
             if (OnDisconnected != null)
             {
-                try { OnDisconnected(DisconnectType.ClientInitiated, String.Empty); }
+                try { OnDisconnected(type, type.ToString()); }
                 catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
             }
         }
@@ -777,9 +781,11 @@
         {
             if (!connected || CurrentSim == null)
             {
-                Timer timer = DisconnectTimer;
-                if (timer != null)
-                    timer.Dispose();
+                if (DisconnectTimer != null)
+                {
+                    DisconnectTimer.Dispose();
+                    DisconnectTimer = null;
+                }
                 connected = false;
             }
             else if (CurrentSim.DisconnectCandidate)
@@ -788,7 +794,12 @@
                 Logger.Log("Network timeout for the current simulator (" +
                     CurrentSim.ToString() + "), logging out", Helpers.LogLevel.Warning, Client);

-                if (DisconnectTimer != null) DisconnectTimer.Dispose();
+                if (DisconnectTimer != null)
+                {
+                    DisconnectTimer.Dispose();
+                    DisconnectTimer = null;
+                }
+
                 connected = false;

                 // Shutdown the network layer


Fix the summary of RequestLogout (Existing Method)

--- OpenMetaverse/NetworkManager.cs
+++ OpenMetaverse/NetworkManager.cs
@@ -704,9 +704,8 @@
         }

         ///
-        /// Initiate the logout process. Check if logout succeeded with the
-        /// OnLogoutReply event, and if this does not fire the
-        /// Shutdown() function needs to be manually called
+        /// Initiate the logout process. The Shutdown() function
+        /// needs to be manually called.
         ///
         public void RequestLogout()
         {


added some comments and an indicator on line splits

--- Purchasing.Core/Domain/Order.cs
+++ Purchasing.Core/Domain/Order.cs
@@ -57,9 +57,31 @@
             return LineItems.Sum(amt => amt.Quantity*amt.UnitPrice);
         }

+        /// <summary>
+        /// Grand total is total + tax/shipping/freight
+        /// </summary>
+        /// <returns></returns>
+        public virtual decimal GrandTotal()
+        {
+            //TODO: add calculation for tax/shipping/freight
+            return Total();
+        }
+
+        /// <summary>
+        /// Order Request Number (unique identifier for the specific order)
+        /// </summary>
+        /// <returns></returns>
         public virtual string OrderRequestNumber()
         {
             return string.Format("{0}-{1}", string.Format("{0:mmddyy}", DateCreated), string.Format("{0:000000}", Id));
+        }
+
+        /// <summary>
+        /// Check if the order is split by line items
+        /// </summary>
+        public virtual bool HasLineSplits
+        {
+            get { return Splits.Any(a => a.LineItem != null); }
         }

         public virtual void AddLineItem(LineItem lineItem)


Fix log4net config page

Fix log4net config page

--- Tracker/Service/Administration/LogConfig.ascx.cs
+++ Tracker/Service/Administration/LogConfig.ascx.cs
@@ -47,7 +47,7 @@
       string configFilePath =
         Path.Combine(
           HttpRuntime.AppDomainAppPath,
-          ConfigurationManager.AppSettings["log4net.Config"] );
+          ConfigurationManager.AppSettings["LogConfig"] );

       if ( sender == this.updateConfigButton )
       {
@@ -88,14 +88,11 @@
       string configFilePath =
         Path.Combine(
           HttpRuntime.AppDomainAppPath,
-          ConfigurationManager.AppSettings["log4net.Config"] );
+          ConfigurationManager.AppSettings["LogConfig"] );

-      bool shouldWatch;
-      string shouldWatchConfigString = ConfigurationManager.AppSettings["log4net.Config.Watch"];
-      bool.TryParse( shouldWatchConfigString, out shouldWatch );
-
+      bool shouldWatch = true;
       this.configFileNameLabel.Text = configFilePath;
-      this.shouldWatchLabel.Text = string.Format( "'{0}' ({1})", shouldWatchConfigString, shouldWatch );
+      this.shouldWatchLabel.Text = string.Format( "'{0}' ({1})", shouldWatch, shouldWatch );

       try
       {


Fix the message for adding/subtracting time with a negative time

--- TwitchPlaysAssembly/Src/Commands/BombCommands.cs
+++ TwitchPlaysAssembly/Src/Commands/BombCommands.cs
@@ -141,9 +141,12 @@

 		bomb.CurrentTimer = direct ? time : negative ? bomb.CurrentTimer - time : bomb.CurrentTimer + time;

+		// If the time requested was negative, we need to flip the message.
+		bool negativeTime = time < 0 ? !negative : negative;
+
 		IRCConnection.SendMessage(direct
 			? $"Set the bomb's timer to {Math.Abs(time < 0 ? 0 : time).FormatTime()}."
-			: $"{(negative ? "Subtracted" : "Added")} {Math.Abs(time).FormatTime()} {(negative ? "from" : "to")} the timer.", user, !isWhisper);
+			: $"{(negativeTime ? "Subtracted" : "Added")} {Math.Abs(time).FormatTime()} {(negativeTime ? "from" : "to")} the timer.", user, !isWhisper);
 	}

 	[Command(@"(?:add|increase|(subtract|decrease|remove)|(change|set)) +(?:(strikes?|s)|strikelimit|sl|maxstrikes?|ms) +(-?\d+)", AccessLevel.Admin, AccessLevel.Admin)]


Stray open paren

Stray open paren


capitalization

capitalization

--- WalletWasabi/BitcoinCore/Monitoring/RpcStatus.cs
+++ WalletWasabi/BitcoinCore/Monitoring/RpcStatus.cs
@@ -16,21 +16,21 @@
 				var diff = headers - blocks;
 				if (peersCount == 0)
 				{
-					Status = "Full Node is connecting...";
+					Status = "Full node is connecting...";
 				}
 				else if (diff == 0)
 				{
 					Synchronized = true;
-					Status = "Full Node is synchronized";
+					Status = "Full node is synchronized";
 				}
 				else
 				{
-					Status = $"Full Node is downloading {diff} blocks...";
+					Status = $"Full node is downloading {diff} blocks...";
 				}
 			}
 			else
 			{
-				Status = "Full Node is unresponsive";
+				Status = "Full node is unresponsive";
 			}

 			Success = success;


Improve logging

Improve logging

--- WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
+++ WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
@@ -465,22 +465,23 @@

 								case CcjRoundPhase.Signing:
 									{
-										var outpointsToBan = new List<OutPoint>();
+										var alicesToBan = new List<Alice>();
+
 										using (await RoundSynchronizerLock.LockAsync())
 										{
 											foreach (Alice alice in Alices)
 											{
 												if (alice.State != AliceState.SignedCoinJoin)
 												{
-													outpointsToBan.AddRange(alice.Inputs.Select(x => x.Outpoint));
+													alicesToBan.Add(alice);
 												}
 											}
 										}
-										if (outpointsToBan.Any())
+										if (alicesToBan.Any())
 										{
-											await UtxoReferee.BanUtxosAsync(1, DateTimeOffset.UtcNow, forceNoted: false, RoundId, outpointsToBan.ToArray());
+											await UtxoReferee.BanUtxosAsync(1, DateTimeOffset.UtcNow, forceNoted: false, RoundId, alicesToBan.SelectMany(x => x.Inputs.Select(y => y.Outpoint)).ToArray());
 										}
-										Abort(nameof(CcjRound), "Not all Alices signed.");
+										Abort(nameof(CcjRound), $"{alicesToBan.Count} Alices did not sign.");
 									}
 									break;


make github personal access token as password field

--- Xekina/Xekina/Views/Settings/EditDefaults.cshtml
+++ Xekina/Xekina/Views/Settings/EditDefaults.cshtml
@@ -76,7 +76,7 @@

             @Html.LabelFor(model => model.GitHubPersonalAccessToken, htmlAttributes: new { @class = "control-label col-md-2" })

-                @Html.EditorFor(model => model.GitHubPersonalAccessToken, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.EditorFor(model => model.GitHubPersonalAccessToken, new { htmlAttributes = new { @class = "form-control", type = "password" } })
                 @Html.ValidationMessageFor(model => model.GitHubPersonalAccessToken, "", new { @class = "text-danger" })


fix returnBody bug

fix returnBody bug

--- Qiniu/RS/PutPolicy.cs
+++ Qiniu/RS/PutPolicy.cs
@@ -196,9 +196,6 @@
 			if (string.IsNullOrEmpty (callBackUrl) ^ string.IsNullOrEmpty (callBackBody)) {
 				throw new Exception ("CallBackUrl and CallBackBody error");
 			}
-			if (string.IsNullOrEmpty (returnUrl) ^ string.IsNullOrEmpty (returnBody)) {
-				throw new Exception ("returnUrl and returnBody error");
-			}
 			if (!string.IsNullOrEmpty (returnUrl) && !string.IsNullOrEmpty (callBackUrl)) {
 				throw new Exception ("returnUrl and callBackUrl error");
 			}


Reverting change to accessToken

Reverting change to accessToken

--- Shippo/APIResource.cs
+++ Shippo/APIResource.cs
@@ -67,10 +67,9 @@

             // Disable lines below for basic auth
             string tokenType = "ShippoToken";
-            //if (accessToken.StartsWith("oauth."))
-            //{
-            //    tokenType = "Bearer";
-            //}
+            if (accessToken.StartsWith("oauth.")) {
+                tokenType = "Bearer";
+            }
             req.Headers.Add("Authorization", string.Format("{0} {1}", tokenType, accessToken));
             if (apiVersion != null) {
                 req.Headers.Add("Shippo-API-Version", apiVersion);


Many new textures, styles, texture map rects

--- Source/CapComSkins.cs
+++ Source/CapComSkins.cs
@@ -20,17 +20,13 @@
 		internal static GUIStyle titleButtonBehind;
 		internal static GUIStyle textureButton;
 		internal static GUIStyle tabButton;
+		internal static GUIStyle tabButtonInactive;
 		internal static GUIStyle menuButton;
 		internal static GUIStyle keycodeButton;
 		internal static GUIStyle warningButton;

 		//Icon Button styles
 		internal static GUIStyle iconButton;
-		internal static GUIStyle acceptButton;
-		internal static GUIStyle declineButton;
-		internal static GUIStyle cancelButton;
-		internal static GUIStyle tabButtonKSP;
-		internal static GUIStyle titleButtonKSP;

 		//Text label styles
 		internal static GUIStyle headerText;
@@ -60,13 +56,10 @@
 		internal static Texture2D windowTex;
 		internal static Texture2D buttonHover;
 		internal static Texture2D fundsGreen;
-		internal static Texture2D fundsRed;
-		internal static Texture2D repGreen;
 		internal static Texture2D repRed;
 		internal static Texture2D science;
 		internal static Texture2D orderAsc;
 		internal static Texture2D orderDesc;
-		internal static Texture2D tooltipIcon;
 		internal static Texture2D goldStar;
 		internal static Texture2D goldStarTwo;
 		internal static Texture2D goldStarThree;
@@ -80,6 +73,13 @@
 		internal static Texture2D emptyBox;
 		internal static Texture2D notesPlusIcon;
 		internal static Texture2D notesMinusIcon;
+		internal static Texture2D sortStars;
+		internal static Texture2D sortRewards;
+		internal static Texture2D sortAgents;
+		internal static Texture2D toggleOn;
+		internal static Texture2D toggleOff;
+		internal static Texture2D toggleHoverOff;
+		internal static Texture2D toggleHoverOn;

 		//Mission Control Center texture map
 		internal static Texture2D missionControlTexture;
@@ -88,14 +88,17 @@
 		internal static Rect acceptButtonNormal = new Rect(0, 0.3671875f, 0.04296875f, 0.0439456125f);
 		internal static Rect acceptButtonHover = new Rect(0.0478515625f, 0.3671875f, 0.04296875f, 0.0439456125f);
 		internal static Rect acceptButtonActive = new Rect(0.095703125f, 0.3671875f, 0.04296875f, 0.0439456125f);
+		internal static Rect acceptButtonInactive = new Rect(0, 0.4169921875f, 0.04296875f, 0.0439456125f);

 		internal static Rect declineButtonNormal = new Rect(0.0478515625f, 0.4169921875f, 0.04296875f, 0.0439456125f);
 		internal static Rect declineButtonHover = new Rect(0.095703125f, 0.4169921875f, 0.04296875f, 0.0439456125f);
 		internal static Rect declineButtonActive = new Rect(0, 0.466796875f, 0.04296875f, 0.0439456125f);
+		internal static Rect declineButtonInactive = new Rect(0.0478515625f, 0.466796875f, 0.04296875f, 0.0439456125f);

 		internal static Rect cancelButtonNormal = new Rect(0.095703125f, 0.466796875f, 0.04296875f, 0.0439456125f);
 		internal static Rect cancelButtonHover = new Rect(0, 0.5166015625f, 0.04296875f, 0.0439456125f);
 		internal static Rect cancelButtonActive = new Rect(0.0478515625f, 0.5166015625f, 0.04296875f, 0.0439456125f);
+		internal static Rect cancelButtonInactive = new Rect(0.095703125f, 0.5166015625f, 0.04296875f, 0.0439456125f);

 		internal static Rect titleButtonFlagNormal = new Rect(0, 0.3125f, 0.0751953125f, 0.0498046875f);
 		internal static Rect titleButtonFlagActive = new Rect(0, 0.2626953125f, 0.0751953125f, 0.0498046875f);
@@ -126,13 +129,10 @@
 			toolbarIcon = GameDatabase.Instance.GetTexture("CapCom/Textures/CapComAppIcon", false);
 			buttonHover = GameDatabase.Instance.GetTexture("CapCom/Textures/ButtonHover", false);
 			fundsGreen = GameDatabase.Instance.GetTexture("CapCom/Textures/FundsGreenIcon", false);
-			fundsRed = GameDatabase.Instance.GetTexture("CapCom/Textures/FundsRedIcon", false);
-			repGreen = GameDatabase.Instance.GetTexture("CapCom/Textures/RepGreenIcon", false);
 			repRed = GameDatabase.Instance.GetTexture("CapCom/Textures/RepRedIcon", false);
 			science = GameDatabase.Instance.GetTexture("CapCom/Textures/ScienceIcon", false);
 			orderAsc = GameDatabase.Instance.GetTexture("CapCom/Textures/OrderAsc", false);
 			orderDesc = GameDatabase.Instance.GetTexture("CapCom/Textures/OrderDesc", false);
-			tooltipIcon = GameDatabase.Instance.GetTexture("CapCom/Textures/ToolTipIcon", false);
 			goldStar = GameDatabase.Instance.GetTexture("CapCom/Textures/GoldStar", false);
 			goldStarTwo = GameDatabase.Instance.GetTexture("CapCom/Textures/GoldStarTwo", false);
 			goldStarThree = GameDatabase.Instance.GetTexture("CapCom/Textures/GoldStarThree", false);
@@ -146,6 +146,14 @@
 			emptyBox = GameDatabase.Instance.GetTexture("CapCom/Textures/EmptyBoxIcon", false);
 			notesPlusIcon = GameDatabase.Instance.GetTexture("CapCom/Textures/OpenNotesIcon", false);
 			notesMinusIcon = GameDatabase.Instance.GetTexture("CapCom/Textures/CloseNotesIcon", false);
+			sortStars = GameDatabase.Instance.GetTexture("CapCom/Textures/SortDifficultyIcon", false);
+			sortRewards = GameDatabase.Instance.GetTexture("CapCom/Textures/SortRewardsIcon", false);
+			sortAgents = GameDatabase.Instance.GetTexture("CapCom/Textures/SortRewardsIcon", false);
+
+			toggleOn = CC_SkinsLibrary.DefKSPSkin.toggle.onNormal.background;
+			toggleOff = CC_SkinsLibrary.DefKSPSkin.toggle.normal.background;
+			toggleHoverOff = CC_SkinsLibrary.DefKSPSkin.toggle.hover.background;
+			toggleHoverOn = CC_SkinsLibrary.DefKSPSkin.toggle.onHover.background;

 			initializeSkins();
 		}
@@ -182,9 +190,13 @@
 			titleButtonBehind.hover.textColor = titleButtonBehind.normal.textColor;

 			tabButton = new GUIStyle(CC_SkinsLibrary.DefUnitySkin.button);
-			tabButton.fontSize = 12 + fontSize;
+			tabButton.fontSize = 14 + fontSize;
 			tabButton.fontStyle = FontStyle.Bold;
-			tabButton.normal.textColor = XKCDColors.FadedRed;
+			tabButton.normal.textColor = XKCDColors.White;
+
+			tabButtonInactive = new GUIStyle(tabButton);
+			tabButtonInactive.fontSize = 12 + fontSize;
+			tabButtonInactive.normal.textColor = XKCDColors.LightGrey;

 			textureButton = new GUIStyle(CC_SkinsLibrary.DefUnitySkin.button);
 			textureButton.fontSize = 14;


add test results check

add test results check

--- TestRunner/Program.cs
+++ TestRunner/Program.cs
@@ -38,6 +38,41 @@
     {
       Console.WriteLine("done.");
       Console.ReadKey();
+    }
+
+    static bool isExpectedOutput(string projDir)
+    {
+      var sources = Directory.GetFiles(projDir, "*.cs", SearchOption.AllDirectories);
+      foreach (var src in sources)
+      {
+        var fname = Path.GetFileNameWithoutExtension(src);
+        if (fname == "AssemblyInfo") { continue; }
+        if (src.Contains("_old.cs")) { continue; }
+        if (src.Contains("TemporaryGeneratedFile")) { continue; }
+        var expected_path = Path.ChangeExtension(src, ".txt");
+        var expectedLines = File.ReadAllLines(expected_path);
+        var observedLines = File.ReadAllLines(src);
+        if (observedLines.Length != expectedLines.Length)
+        {
+          Console.WriteLine("Expected and Observed files don't have the same number of lines");
+          return false;
+
+
+        }
+        for (int i = 0; i < observedLines.Length; ++i)
+        {
+          if (observedLines[i] != expectedLines[i])
+          {
+            Console.WriteLine("Lines don't match:");
+            Console.WriteLine("Expected: " + expectedLines[i]);
+            Console.WriteLine("Observed: " + observedLines[i]);
+            return false;
+          }
+        }
+
+      }
+      return true;
+
     }

     static void Main(string[] args)
@@ -94,9 +129,10 @@
           Console.WriteLine("Annotating failed.");
         }

+        Console.WriteLine(isExpectedOutput(projDir.FullName));
         CleanUp(projDir.FullName);
-        Exit();
       }
+      Exit();
     }
   }
 }


redundant combine

redundant combine

--- Tests/WeaverHelper.cs
+++ Tests/WeaverHelper.cs
@@ -11,7 +11,7 @@

     public WeaverHelper(string assemblyName)
     {
-        BeforeAssemblyPath = Path.GetFullPath(Path.Combine(TestContext.CurrentContext.TestDirectory, assemblyName+".dll"));
+        BeforeAssemblyPath = Path.Combine(TestContext.CurrentContext.TestDirectory, assemblyName+".dll");

         AfterAssemblyPath = BeforeAssemblyPath.Replace(".dll", "2.dll");
         File.Copy(BeforeAssemblyPath, AfterAssemblyPath, true);


c# generation more readable

c# generation more readable

--- Cogs.Publishers/CsSchemaPublisher.cs
+++ Cogs.Publishers/CsSchemaPublisher.cs
@@ -68,6 +68,7 @@
             {
                 // add class description using '$' for newline and '#' for tabs
                 var newClass = new StringBuilder("using System;");
+                newClass.AppendLine();
                 newClass.AppendLine("using System.Linq;");
                 newClass.AppendLine("using Newtonsoft.Json;");
                 newClass.AppendLine("using Newtonsoft.Json.Linq;");
@@ -802,21 +803,33 @@
             return "{Environment.NewLine}                    ((JArray)prop.First).Add(item);";
         }

-// -------------------------------
+
         // creates a file called IIdentifiable.cs which holds the IIdentifiable interface from which all item types descend
         private void CreateIIdentifiable(CogsModel model, string projName)
         {
-            StringBuilder builder = new StringBuilder("using System;$using Newtonsoft.Json.Linq;$using System.Collections.Generic;$$namespace " +
-                    projName + "${$#/// <summary>$#/// IIdentifiable class which all object Inherit from. Used to Serialize to Json $#/// <summary>");
-            builder.Append("$#public interface IIdentifiable$#{");
+            StringBuilder builder = new StringBuilder("using System;");
+            builder.AppendLine();
+            builder.AppendLine("using Newtonsoft.Json.Linq;");
+            builder.AppendLine("using System.Collections.Generic;");
+            builder.AppendLine();
+            builder.AppendLine($"namespace {projName}");
+            builder.AppendLine("{");
+            builder.AppendLine("    /// <summary>");
+            builder.AppendLine("    /// IIdentifiable class which all object Inherit from. Used to Serialize to Json");
+            builder.AppendLine("    /// <summary>");
+            builder.AppendLine("    public interface IIdentifiable");
+            builder.AppendLine("    {");
             foreach (var prop in model.Identification)
             {
-                builder.Append("$##" + prop.DataTypeName + " " + prop.Name + " { get; set; }");
-            }
-            builder.Append("$##JProperty ToJson();$##string ReferenceId { get; set; }$##void InitializeReferences(Dictionary<string, IIdentifiable> dict, string json);$#}$}");
-            File.WriteAllText(Path.Combine(TargetDirectory, "IIdentifiable.cs"), builder.ToString().Replace("#", "    ").Replace("$", Environment.NewLine));
-        }
-
+                builder.AppendLine($"        {prop.DataTypeName} {prop.Name} {{ get; set; }}");
+            }
+            builder.AppendLine("        JProperty ToJson();");
+            builder.AppendLine("        string ReferenceId { get; set; }");
+            builder.AppendLine("        void InitializeReferences(Dictionary<string, IIdentifiable> dict, string json);");
+            builder.AppendLine("    }");
+            builder.AppendLine("}");
+            File.WriteAllText(Path.Combine(TargetDirectory, "IIdentifiable.cs"), builder.ToString());
+        }

         // Creates the ItemContainer Class
@@ -839,7 +852,6 @@
         public List<IIdentifiable> Items { get; } = new List<IIdentifiable>();
         public List<IIdentifiable> TopLevelReferences { get; } = new List<IIdentifiable>();

-
         public string Serialize()
         {
             JObject builder = new JObject();
@@ -892,7 +904,8 @@
                     var clss = type.Key;
                     foreach (KeyValuePair<string, JToken> instance in (JObject)type.Value)
                     {
-                        IIdentifiable obj = null;???
+                        IIdentifiable obj = null;
+???
                         if (obj == null) { throw new InvalidOperationException(); }
                         obj.ReferenceId = instance.Key;
                         Items.Add(obj);
@@ -912,12 +925,11 @@
             string start = "";
             foreach(var item in model.ItemTypes)
             {
-                ifs.Append("$######" + start + "if (clss.Equals(\"" + item.Name + "\")) { obj = JsonConvert.DeserializeObject<" + item.Name +
-                    ">(instance.Value.ToString()); }");
+                ifs.AppendLine($"                        {start}if (clss.Equals(\"{item.Name}\")) {{ obj = " +
+                    $"JsonConvert.DeserializeObject<{item.Name}>(instance.Value.ToString()); }}");
                 start = "else ";
             }
-            File.WriteAllText(Path.Combine(TargetDirectory, "ItemContainer.cs"), clss.Replace("!!!", projName).Replace("???", ifs.ToString()
-                .Replace("#", "    ").Replace("$", Environment.NewLine)));
+            File.WriteAllText(Path.Combine(TargetDirectory, "ItemContainer.cs"), clss.Replace("!!!", projName).Replace("???", ifs.ToString()));
         }

@@ -988,7 +1000,9 @@
                 }
             }
             if (single != null) { return single; }
-            var t = objectType.GetGenericArguments()[0].Name;???
+            var t = objectType.GetGenericArguments()[0].Name;
+
+???
             return new InvalidOperationException();
         }

@@ -1116,10 +1130,9 @@
             StringBuilder ifs = new StringBuilder();
             foreach (var item in model.ItemTypes)
             {
-                ifs.Append("$###if (t.Equals(\"" + item.Name + "\")) { return list.Cast<" + item.Name + ">().ToList(); }");
-            }
-            File.WriteAllText(Path.Combine(TargetDirectory, "JsonConverter.cs"), clss.Replace("!!!", projName).Replace("???", ifs.ToString()
-                .Replace("$", Environment.NewLine).Replace("#", "    ")));
+                ifs.AppendLine($"            if (t.Equals(\"{item.Name}\")) {{ return list.Cast<{item.Name}>().ToList(); }}");
+            }
+            File.WriteAllText(Path.Combine(TargetDirectory, "JsonConverter.cs"), clss.Replace("!!!", projName).Replace("???", ifs.ToString()));
         }


AdventureSample - move Add(Verb) method to VerbRoutines class

--- projects/AdventureSample/src/Adventure/adventure.cs
+++ projects/AdventureSample/src/Adventure/adventure.cs
@@ -621,34 +621,29 @@

     private void InitHandlers(VerbRoutines verbRoutines)
     {
-        AddVerb(verbRoutines, "GO", Go);
-        AddVerb(verbRoutines, "GET", Get);
-        AddVerb(verbRoutines, "TAK", Get);
-        AddVerb(verbRoutines, "DRO", Drop);
-        AddVerb(verbRoutines, "THR", Drop);
-        AddVerb(verbRoutines, "INV", Inventory);
-        AddVerb(verbRoutines, "I", Inventory);
-        AddVerb(verbRoutines, "LOO", Look);
-        AddVerb(verbRoutines, "L", Look);
-        AddVerb(verbRoutines, "EXA", Examine);
-        AddVerb(verbRoutines, "QUI", Quit);
-        AddVerb(verbRoutines, "REA", Read);
-        AddVerb(verbRoutines, "OPE", Open);
-        AddVerb(verbRoutines, "POU", Pour);
-        AddVerb(verbRoutines, "CLI", Climb);
-        AddVerb(verbRoutines, "JUM", Jump);
-        AddVerb(verbRoutines, "DIG", Dig);
-        AddVerb(verbRoutines, "ROW", Row);
-        AddVerb(verbRoutines, "WAV", Wave);
-        AddVerb(verbRoutines, "LEA", Leave);
-        AddVerb(verbRoutines, "EXI", Leave);
-        AddVerb(verbRoutines, "FIG", Fight);
-        AddVerb(verbRoutines, "WEA", Wear);
-    }
-
-    private void AddVerb(VerbRoutines verbRoutines, string v, Func<VerbResult> handler)
-    {
-        verbRoutines.D.Add(v, handler);
+        verbRoutines.Add("GO", Go);
+        verbRoutines.Add("GET", Get);
+        verbRoutines.Add("TAK", Get);
+        verbRoutines.Add("DRO", Drop);
+        verbRoutines.Add("THR", Drop);
+        verbRoutines.Add("INV", Inventory);
+        verbRoutines.Add("I", Inventory);
+        verbRoutines.Add("LOO", Look);
+        verbRoutines.Add("L", Look);
+        verbRoutines.Add("EXA", Examine);
+        verbRoutines.Add("QUI", Quit);
+        verbRoutines.Add("REA", Read);
+        verbRoutines.Add("OPE", Open);
+        verbRoutines.Add("POU", Pour);
+        verbRoutines.Add("CLI", Climb);
+        verbRoutines.Add("JUM", Jump);
+        verbRoutines.Add("DIG", Dig);
+        verbRoutines.Add("ROW", Row);
+        verbRoutines.Add("WAV", Wave);
+        verbRoutines.Add("LEA", Leave);
+        verbRoutines.Add("EXI", Leave);
+        verbRoutines.Add("FIG", Fight);
+        verbRoutines.Add("WEA", Wear);
     }

     private VerbResult UnknownVerb()
@@ -1354,6 +1349,11 @@

         public Dictionary<string, Func<VerbResult>> D => verbRoutines;

+        public void Add(string verb, Func<VerbResult> handler)
+        {
+            this.verbRoutines.Add(verb, handler);
+        }
+
         public VerbResult Handle(string verb)
         {
             Func<VerbResult> verbRoutine;


made changes to color and wording of "Volunteer" button as per PR review

--- AllReadyApp/Web-App/AllReady/Views/Activity/Activity.cshtml
+++ AllReadyApp/Web-App/AllReady/Views/Activity/Activity.cshtml
@@ -125,7 +125,7 @@
                     if (!Model.IsClosed)
                      {

-                             Volunteer
+                             Volunteer

                      }
                      else
@@ -138,7 +138,7 @@
                     if (!Model.IsClosed)
                      {

-                             <button class="btn btn-primary btn-volunteer" data-bind="visible: !enrolled(), click: signupForActivity" style="display: none">Volunteer
 for this Activity</button>
+                             <button class="btn btn-default btn-volunteer" data-bind="visible: !enrolled(), click: signupForActivity" style="display: none">Volunteer</button>

                      }
                      else


assembly version update

assembly version update

--- Andromeda/Andromeda-Actions-Core/Properties/AssemblyInfo.cs
+++ Andromeda/Andromeda-Actions-Core/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("0.5.0.0")]
-[assembly: AssemblyFileVersion("0.5.0.0")]
+[assembly: AssemblyVersion("0.6.0.0")]
+[assembly: AssemblyFileVersion("0.6.0.0")]


fix sql error

fix sql error

--- Argonne/Api/ArgonneWebApi/Controllers/CampaignController.cs
+++ Argonne/Api/ArgonneWebApi/Controllers/CampaignController.cs
@@ -646,7 +646,7 @@
                 end = DateTime.UtcNow + TimeSpan.FromDays(1);

             var campaignIdParam = new SqlParameter("@campaignId", idGuid);
-            var adIdParam = new SqlParameter("@adId", string.Empty);
+            var adIdParam = new SqlParameter("@adId", string.Empty);//can't use null here or EF barks
             var startDateParam = new SqlParameter("@dateFrom", start);
             var endDateParam = new SqlParameter("@dateTo", end);


instrument poke pointer

instrument poke pointer

--- Assets/MRTK/SDK/Features/UX/Scripts/Pointers/PokePointer.cs
+++ Assets/MRTK/SDK/Features/UX/Scripts/Pointers/PokePointer.cs
@@ -4,6 +4,7 @@
 using Microsoft.MixedReality.Toolkit.Physics;
 using Microsoft.MixedReality.Toolkit.Utilities;
 using UnityEngine;
+using UnityEngine.Profiling;

 namespace Microsoft.MixedReality.Toolkit.Input
 {
@@ -139,6 +140,8 @@

         public override void OnPreSceneQuery()
         {
+            Profiler.BeginSample("[MRTK] PokePointer.OnPreSceneQuery");
+
             if (Rays == null)
             {
                 Rays = new RayStep[1];
@@ -187,10 +190,14 @@
             closestProximityTouchable = newClosestTouchable;

             visuals.SetActive(IsActive);
+
+            Profiler.EndSample(); // OnPreSceneQuery
         }

         private bool FindClosestTouchableForLayerMask(LayerMask layerMask, out BaseNearInteractionTouchable closest, out float closestDistance, out Vector3 closestNormal)
         {
+            Profiler.BeginSample("[MRTK] PokePointer.FindClosestTouchableForLayerMask");
+
             closest = null;
             closestDistance = float.PositiveInfinity;
             closestNormal = Vector3.zero;
@@ -239,16 +246,20 @@
                 }
             }

+            Profiler.EndSample(); // FindClosestTouchableForLayerMask
             return closest != null;
         }

         /// <inheritdoc />
         public override void OnPostSceneQuery()
         {
+            Profiler.BeginSample("[MRTK] PokePointer.OnPostSceneQuery");
+
             base.OnPostSceneQuery();

             if (!IsActive)
             {
+                Profiler.EndSample(); // OnPostSceneQuery - early exit
                 return;
             }

@@ -301,6 +312,8 @@
             }

             PreviousPosition = Position;
+
+            Profiler.EndSample(); // OnPostSceneQuery
         }

         /// <inheritdoc />


fix margin on crowdfund

fix margin on crowdfund

--- BTCPayServer/Views/AppsPublic/Crowdfund/VueCrowdfund.cshtml
+++ BTCPayServer/Views/AppsPublic/Crowdfund/VueCrowdfund.cshtml
@@ -124,7 +124,7 @@
                 <template v-if="srvModel.disqusEnabled">

-

+

@@ -139,14 +139,14 @@

-

+

                 </template>
                 <template v-else>

-

+


Remove test parallelization (#712)

Remove test parallelization (#712)

--- test/IISIntegration.FunctionalTests/Properties/AssemblyInfo.cs
+++ test/IISIntegration.FunctionalTests/Properties/AssemblyInfo.cs
@@ -2,4 +2,7 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

 // All functional tests in this project require a version of IIS express with an updated schema
+using Xunit;
+
 [assembly: Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests.IISExpressSupportsInProcessHosting]
+[assembly: CollectionBehavior(DisableTestParallelization = true)]


Add test coverage for type registrations that rely on external serializers

--- test/NonSiloTests/SerializationTests/ExternalSerializerTest.cs
+++ test/NonSiloTests/SerializationTests/ExternalSerializerTest.cs
@@ -7,6 +7,7 @@

 namespace UnitTests.Serialization
 {
+    [TestCategory("Serialization")]
     public class ExternalSerializerTest
     {
         public ExternalSerializerTest()
@@ -14,13 +15,13 @@
             SerializationTestEnvironment.Initialize(new List<TypeInfo> { typeof(FakeSerializer).GetTypeInfo() }, null);
         }

-        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("Serialization")]
+        [Fact, TestCategory("BVT"), TestCategory("Functional")]
         public void SerializationTests_CustomSerializerInitialized()
         {
             Assert.True(FakeSerializer.Initialized, "The fake serializer wasn't discovered");
         }

-        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("Serialization")]
+        [Fact, TestCategory("BVT"), TestCategory("Functional")]
         public void SerializationTests_CustomSerializerIsSupportedType()
         {
             var data = new FakeSerialized { SomeData = "some data" };
@@ -29,7 +30,7 @@
             Assert.True(FakeSerializer.IsSupportedTypeCalled, "type discovery failed");
         }

-        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("Serialization")]
+        [Fact, TestCategory("BVT"), TestCategory("Functional")]
         public void SerializationTests_ThatSerializeAndDeserializeWereInvoked()
         {
             var data = new FakeSerialized { SomeData = "some data" };
@@ -38,12 +39,26 @@
             Assert.True(FakeSerializer.DeserializeCalled);
         }

-        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("Serialization")]
+        [Fact, TestCategory("BVT"), TestCategory("Functional")]
         public void SerializationTests_ThatCopyWasInvoked()
         {
             var data = new FakeSerialized { SomeData = "some data" };
             SerializationManager.DeepCopy(data);
             Assert.True(FakeSerializer.DeepCopyCalled);
+        }
+
+        [Fact, TestCategory("BVT"), TestCategory("Functional")]
+        public void SerializationTests_ExternalSerializerUsedEvenIfCodegenDidntGenerateSerializersForIt()
+        {
+            var data = new FakeSerializedWithNoCodegenSerializers { SomeData = "some data", SomeMoreData = "more data" };
+            SerializationManager.RoundTripSerializationForTesting(data);
+            Assert.True(FakeSerializer.SerializeCalled);
+            Assert.True(FakeSerializer.DeserializeCalled);
+    }
+
+        private class FakeSerializedWithNoCodegenSerializers : FakeSerialized
+        {
+            public string SomeMoreData;
         }
     }

@@ -72,7 +87,7 @@
         public bool IsSupportedType(Type itemType)
         {
             IsSupportedTypeCalled = true;
-            return itemType == typeof(FakeSerialized);
+            return typeof(FakeSerialized).IsAssignableFrom(itemType);
         }

         public object DeepCopy(object source)
@@ -91,7 +106,7 @@
         {
             DeserializeCalled = true;
             reader.ReadToken();
-            return new FakeSerialized { SomeData = "fake deserialization" };
+            return (FakeSerialized)Activator.CreateInstance(expectedType);
         }
     }
 }


Changed level progression with help of added initial variable. Added if/else to pause/not pause timer  when opening about box.

--- PingPong/frmPingPong.cs
+++ PingPong/frmPingPong.cs
@@ -31,6 +31,7 @@
         int score; // Counter for how many times ball hits the paddle
         int life; // Number of lives
         int level; // Level and score + difficulty multiplier
+        int levelscore; // Level score;

         Boolean hit;
         Boolean gameover;
@@ -140,9 +141,10 @@
                         hit = true;
                         by += -(imgBall.Height + imgPaddle.Height); // This is for bouncing the ball when it's hitting the paddle to avoid "cheating"

-                        if (score%5 == 1)
+                        if ((level <= 1) || ((level > 1 && level <= 5) && score-levelscore > levelscore+5) || (level > 5 && score - levelscore > levelscore)) // Level change
                         {
                             level++;
+                            levelscore = score;
                             lblLevel.Text = level.ToString();
                         }

@@ -252,15 +254,24 @@
         {
             try
             {
-                gameTimer.Stop();
-
-                DialogResult dr = new DialogResult();
-                frmAboutBox abtbox = new frmAboutBox();
-                dr = abtbox.ShowDialog();
-
-                if (dr == DialogResult.OK)
-                {
-                    gameTimer.Start();
+                if (gameover)
+                {
+                    DialogResult dr = new DialogResult();
+                    frmAboutBox abtbox = new frmAboutBox();
+                    dr = abtbox.ShowDialog();
+                }
+                else
+                {
+                    gameTimer.Stop();
+
+                    DialogResult dr = new DialogResult();
+                    frmAboutBox abtbox = new frmAboutBox();
+                    dr = abtbox.ShowDialog();
+
+                    if (dr == DialogResult.OK)
+                    {
+                        gameTimer.Start();
+                    }
                 }
             }
             catch (Exception exc)


Use pattern matching

Use pattern matching

--- ComputerAlgebra/Extensions/Factor.cs
+++ ComputerAlgebra/Extensions/Factor.cs
@@ -16,10 +16,10 @@
                     yield return -1;
                     yield return Real.Abs((Real)i);
                 }
-                else if (i is Power)
+                else if (i is Power power)
                 {
                     yield return i;
-                    yield return ((Power)i).Left;
+                    yield return power.Left;
                 }
                 else
                 {


Implemented native CSOM webpart export for SPO

--- Core/OfficeDevPnP.Core/AppModelExtensions/PageExtensions.cs
+++ Core/OfficeDevPnP.Core/AppModelExtensions/PageExtensions.cs
@@ -12,10 +12,13 @@
 using System.Net;
 using System.IO;
 using System.Text;
+using System.Web.UI.WebControls.WebParts;
 using OfficeDevPnP.Core.Utilities;
 using Microsoft.SharePoint.Client.Publishing.Navigation;
 using Microsoft.SharePoint.Client.Taxonomy;
 using OfficeDevPnP.Core.Utilities.WebParts;
+using PersonalizationScope = Microsoft.SharePoint.Client.WebParts.PersonalizationScope;
+using WebPart = Microsoft.SharePoint.Client.WebParts.WebPart;

 namespace Microsoft.SharePoint.Client
 {
@@ -381,6 +384,7 @@

             if (id != Guid.Empty)
             {
+#if ONPREMISES
                 var uri = new Uri(web.Context.Url);
                 var serverRelativeUrl = web.EnsureProperty(w => w.ServerRelativeUrl);
                 var hostUri = uri.Host;
@@ -388,9 +392,8 @@
                 var pageUrl = string.Format("{0}://{1}{2}", uri.Scheme, uri.Host, serverRelativePageUrl);
                 var request = (HttpWebRequest)WebRequest.Create(string.Format("{0}/_vti_bin/exportwp.aspx?pageurl={1}&guidstring={2}", webUrl, pageUrl, id.ToString()));

-#if ONPREMISES
                 request.Credentials = web.Context.Credentials;
-#else
+
                 var credentials = web.Context.Credentials as SharePointOnlineCredentials;
                 var authCookieValue = credentials.GetAuthenticationCookie(uri);

@@ -405,7 +408,7 @@
                 };
                 request.CookieContainer = new CookieContainer();
                 request.CookieContainer.Add(fedAuth);
-#endif
+

                 var response = request.GetResponse();
                 using (Stream stream = response.GetResponseStream())
@@ -413,19 +416,59 @@
                     StreamReader reader = new StreamReader(stream, Encoding.UTF8);
                     webPartXml = reader.ReadToEnd();
                 }
-            }
-
+
+#else
+
+                var webPartPage = web.GetFileByServerRelativeUrl(serverRelativePageUrl);
+
+                var limitedWebPartManager = webPartPage.GetLimitedWebPartManager(PersonalizationScope.Shared);
+
+                var query =
+                    web.Context.LoadQuery(
+                        limitedWebPartManager.WebParts.IncludeWithDefaultProperties(w => w.Id, w => w.ZoneId,
+                                w => w.WebPart, w => w.WebPart.Title, w => w.WebPart.Properties, w => w.WebPart.Hidden)
+                            .Where(w => w.Id == id));
+
+                web.Context.ExecuteQueryRetry();
+
+                if (query.Any())
+                {
+                    wp = query.First();
+
+                    var exportMode = (WebPartExportMode)Enum.Parse(typeof(WebPartExportMode), wp.WebPart.Properties["ExportMode"].ToString());
+                    var changed = false;
+                    if (exportMode != WebPartExportMode.All)
+                    {
+                        wp.WebPart.Properties["ExportMode"] = WebPartExportMode.All;
+                        wp.SaveWebPartChanges();
+                        web.Context.ExecuteQueryRetry();
+                        changed = true;
+                    }
+
+                    var result = limitedWebPartManager.ExportWebPart(id);
+                    web.Context.ExecuteQueryRetry();
+                    webPartXml = result.Value;
+
+                    if (changed)
+                    {
+                        wp.WebPart.Properties["ExportMode"] = exportMode;
+                        wp.SaveWebPartChanges();
+                        web.Context.ExecuteQueryRetry();
+                    }
+                }
+#endif
+            }
             return webPartXml;
         }

-                /// <summary>
-                /// Applies a layout to a wiki page
-                /// </summary>
-                /// <param name="web">Site to be processed - can be root web or sub site</param>
-                /// <param name="layout">Wiki page layout to be applied</param>
-                /// <param name="serverRelativePageUrl"></param>
-                /// <exception cref="System.ArgumentException">Thrown when serverRelativePageUrl is a zero-length string or contains only white space</exception>
-                /// <exception cref="System.ArgumentNullException">Thrown when serverRelativePageUrl is null</exception>
+        /// <summary>
+        /// Applies a layout to a wiki page
+        /// </summary>
+        /// <param name="web">Site to be processed - can be root web or sub site</param>
+        /// <param name="layout">Wiki page layout to be applied</param>
+        /// <param name="serverRelativePageUrl"></param>
+        /// <exception cref="System.ArgumentException">Thrown when serverRelativePageUrl is a zero-length string or contains only white space</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when serverRelativePageUrl is null</exception>
         public static void AddLayoutToWikiPage(this Web web, WikiPageLayout layout, string serverRelativePageUrl)
         {
             if (string.IsNullOrEmpty(serverRelativePageUrl))
@@ -980,11 +1023,11 @@
         /// <exception cref="System.ArgumentNullException">Thrown when key or serverRelativePageUrl is null</exception>
         public static void SetWebPartProperty(this Web web, string key, bool value, Guid id, string serverRelativePageUrl)
         {
-            SetWebPartPropertyInternal(web,key,value,id,serverRelativePageUrl);
-        }
-
-	    private static WebPartDefinition AddWebPart(File webPartPage, WebPartEntity webPart, string zoneId, int zoneIndex)
-	    {
+            SetWebPartPropertyInternal(web, key, value, id, serverRelativePageUrl);
+        }
+
+        private static WebPartDefinition AddWebPart(File webPartPage, WebPartEntity webPart, string zoneId, int zoneIndex)
+        {
             var limitedWebPartManager = webPartPage.GetLimitedWebPartManager(PersonalizationScope.Shared);
             var oWebPartDefinition = limitedWebPartManager.ImportWebPart(webPart.WebPartXml);

@@ -992,10 +1035,10 @@
             webPartPage.Context.Load(wpdNew);
             webPartPage.Context.ExecuteQueryRetry();

-	        WebPartPostProcessorFactory.Resolve(webPart.WebPartXml).Process(wpdNew, webPartPage);
+            WebPartPostProcessorFactory.Resolve(webPart.WebPartXml).Process(wpdNew, webPartPage);

             return wpdNew;
-	    }
+        }

         private static void SetWebPartPropertyInternal(this Web web, string key, object value, Guid id, string serverRelativePageUrl)
         {
@@ -1104,7 +1147,7 @@
         /// <param name="schedule">Defines whether to define a schedule or not.</param>
         /// <exception cref="System.ArgumentNullException">Thrown when key or pageName is a zero-length string or contains only white space</exception>
         /// <exception cref="System.ArgumentException">Thrown when key or pageName is null</exception>
-        public static void AddPublishingPage(this Web web, string pageName, string pageTemplateName, string title = null,
+        public static void AddPublishingPage(this Web web, string pageName, string pageTemplateName, string title = null,
             bool publish = false, Folder folder = null,
             DateTime? startDate = null, DateTime? endDate = null, Boolean schedule = false)
         {
@@ -1148,7 +1191,7 @@
             // Configure the publishing page
             var pageInformation = new PublishingPageInformation
             {
-                Name = !pageName.EndsWith(".aspx", StringComparison.InvariantCultureIgnoreCase) ?
+                Name = !pageName.EndsWith(".aspx", StringComparison.InvariantCultureIgnoreCase) ?
                     string.Format("{0}.aspx", pageName) : pageName,
                 PageLayoutListItem = pageLayoutItem,
             };
@@ -1207,8 +1250,8 @@
         /// <param name="showInGlobalNavigation">Defines whether the navigation item has to be shown in the Global Navigation, optional and default to true.</param>
         /// <param name="showInCurrentNavigation">Defines whether the navigation item has to be shown in the Current Navigation, optional and default to true.</param>
         /// <returns>The simple link URL just created.</returns>
-        public static String AddNavigationFriendlyUrl(this PublishingPage page, Web web,
-            String navigationTitle, String friendlyUrlSegment, NavigationTermSetItem editableParent,
+        public static String AddNavigationFriendlyUrl(this PublishingPage page, Web web,
+            String navigationTitle, String friendlyUrlSegment, NavigationTermSetItem editableParent,
             Boolean showInGlobalNavigation = true, Boolean showInCurrentNavigation = true)
         {
             // Add the Friendly URL


made filters into method chains

made filters into method chains

--- DataGen/Types/Name/NameRepository.cs
+++ DataGen/Types/Name/NameRepository.cs
@@ -27,17 +27,15 @@

         private readonly Origin _origin;

-        public IEnumerable<NameRepository> FilterByRegion(params string[] regions) {
-            return from region in regions
+        public IEnumerable<NameRepository> FilterByRegion(params string[] regions)
+            => from region in regions
                 where region == _origin.Region
                 select this;
-        }

-        public IEnumerable<NameRepository> FilterByCountry(params string[] countries) {
-            return from country in countries
+        public IEnumerable<NameRepository> FilterByCountry(params string[] countries)
+            => from country in countries
                 where country == _origin.Country
                 select this;
-        }

         private class Origin {
             public readonly string Country;


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs
+++ websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs
@@ -182,7 +182,12 @@
     /// Gets the value of the Origin header included in the handshake request.
     /// </summary>
     /// <value>
-    /// A <see cref="string"/> that represents the value of the Origin header.
+    ///   <para>
+    ///   A <see cref="string"/> that represents the value of the Origin header.
+    ///   </para>
+    ///   <para>
+    ///   <see langword="null"/> if the header is not present.
+    ///   </para>
     /// </value>
     public override string Origin {
       get {


modify DynamoDbAutoscalerIntervalProvisioner constructor to allow passing in the config file location

--- DynamoDbAutoScaler/DynamoDbAutoscalerIntervalProvisioner.cs
+++ DynamoDbAutoScaler/DynamoDbAutoscalerIntervalProvisioner.cs
@@ -31,8 +31,8 @@
             ensureMetricsAreProvisionedTimer.Interval = DemandCheckInterval.TotalMilliseconds;
         }

-        public DynamoDbAutoscalerIntervalProvisioner(ILogger logger) :
-            this(logger, new Autoscaler(logger), new LocalFileGlobalAutoscalingConfigurationSetFactory())
+        public DynamoDbAutoscalerIntervalProvisioner(ILogger logger, string localFilePath = "./autoscaling.json") :
+            this(logger, new Autoscaler(logger), new LocalFileGlobalAutoscalingConfigurationSetFactory(localFilePath))
         {

         }


Resolve #1426 -- Fix getting xp from the wrong team (#1424)

Fix getting xp from allied minions/champions instead of enemies

--- GameServerLib/GameObjects/AttackableUnits/AttackableUnit.cs
+++ GameServerLib/GameObjects/AttackableUnits/AttackableUnit.cs
@@ -700,7 +700,7 @@
             {
                 if (!(obj is IMonster))
                 {
-                    var champs = _game.ObjectManager.GetChampionsInRangeFromTeam(Position, _game.Map.MapScript.MapScriptMetadata.AIVars.EXPRadius, Team, true);
+                    var champs = _game.ObjectManager.GetChampionsInRangeFromTeam(Position, _game.Map.MapScript.MapScriptMetadata.AIVars.EXPRadius, CustomConvert.GetEnemyTeam(Team), true);
                     if (champs.Count > 0)
                     {
                         var expPerChamp = obj.Stats.ExpGivenOnDeath.Total / champs.Count;


Code gen: fixing choosing representating template instance for generating generics user type

--- GenerateUserTypesFromPdb/UserTypeFactory/UserTypeFactory.cs
+++ GenerateUserTypesFromPdb/UserTypeFactory/UserTypeFactory.cs
@@ -178,7 +178,7 @@
                         if (noneIsTemplate)
                         {
                             template = specializedTemplate;
-                            break;
+                            continue;
                         }

                         // This one is good as any...


20000006-1411 #267 - Removida validação duplicada para a exibição do nome do aluno.

--- Src/GestaoEscolar/Classe/LancamentoSondagem/Cadastro.aspx.cs
+++ Src/GestaoEscolar/Classe/LancamentoSondagem/Cadastro.aspx.cs
@@ -866,15 +866,6 @@
                     {
                         rptQuestoes.DataSource = lstQuestoes.Skip((VS_NumPagina - 1) * VS_QtdQuestoesPagina).Take(VS_QtdQuestoesPagina);
                         rptQuestoes.DataBind();
-
-                        if (VS_snd_opcaoResposta == (byte)ACA_SondagemOpcaoResposta.SelecaoUnica && lstSubQuestoes.Count > 0)
-                        {
-                            Label lblNomeAluno = (Label)e.Item.FindControl("lblNomeAluno");
-                            if (lblNomeAluno != null)
-                            {
-                                lblNomeAluno.Visible = false;
-                            }
-                        }
                     }
                 }
                 else


Fixed a crash in FindInstruments() when an instrument has no exchange set.

--- QDMSServer/InstrumentManager.cs
+++ QDMSServer/InstrumentManager.cs
@@ -144,7 +144,8 @@
                 var instruments = query.Where(pred).ToList();
                 foreach (Instrument i in instruments)
                 {
-                    i.Exchange.Sessions.ToList();
+                    if(i.Exchange != null)
+                        i.Exchange.Sessions.ToList();
                 }
                 return instruments;
             }


correct typo in comment

correct typo in comment

--- RDFSharp/Model/RDFGraphIndex.cs
+++ RDFSharp/Model/RDFGraphIndex.cs
@@ -31,7 +31,7 @@
         internal Dictionary<long, RDFResource> ResourcesRegister { get; set; }

         /// <summary>
-        /// Register of the graph's lietarls
+        /// Register of the graph's literals
         /// </summary>
         internal Dictionary<long, RDFLiteral> LiteralsRegister { get; set; }


Fix for scripting engine.

Fix for scripting engine.

--- Rant/Engine/RantFunctionInfo.cs
+++ Rant/Engine/RantFunctionInfo.cs
@@ -70,6 +70,10 @@
                 {
                     rantType = RantParameterType.Number;
                 }
+                else if (type == typeof(ObjectModel.RantObject))
+                {
+                    rantType = RantParameterType.RantObject;
+                }
                 else
                 {
                     throw new ArgumentException($"({method.Name}) Unsupported type '{type}' for parameter '{parameters[i].Name}'. Must be a string, number, or RantAction.");


Add support for getting new posts and new comments that are "before" a given post or comment

--- RedditSharp/Things/Subreddit.cs
+++ RedditSharp/Things/Subreddit.cs
@@ -14,6 +14,7 @@
     {
         private const string SubredditPostUrl = "/r/{0}.json";
         private const string SubredditNewUrl = "/r/{0}/new.json?sort=new";
+        private const string SubredditNewBeforeUrl = "/r/{0}/new.json?sort=new&before={1}";
         private const string SubredditHotUrl = "/r/{0}/hot.json";
         private const string SubredditRisingUrl = "/r/{0}/rising.json";
         private const string SubredditTopUrl = "/r/{0}/top.json?t={1}";
@@ -38,6 +39,7 @@
         private const string SubmitLinkUrl = "/api/submit";
         private const string FlairListUrl = "/r/{0}/api/flairlist.json";
         private const string CommentsUrl = "/r/{0}/comments.json";
+        private const string CommentsBeforeUrl = "/r/{0}/comments.json?before={1}";
         private const string SearchUrl = "/r/{0}/search.json?q={1}&restrict_sr=on&sort={2}&t={3}";
         private const string SearchUrlDate = "/r/{0}/search.json?q=timestamp:{1}..{2}&restrict_sr=on&sort={3}&syntax=cloudsearch";
         private const string ModLogUrl = "/r/{0}/about/log.json";
@@ -199,7 +201,25 @@

             return new Listing<Post>(Reddit, string.Format(SearchUrlDate, Name, from.DateTimeToUnixTimestamp(), to.DateTimeToUnixTimestamp(), sort), WebAgent);
         }
-
+
+        public Listing<Post> GetNewPostsBefore(Post p)
+        {
+            if (Name == "/")
+            {
+                return new Listing<Post>(Reddit, "/new.json?sort_by=new&before=" + p.FullName, WebAgent);
+            }
+            return new Listing<Post>(Reddit, string.Format(SubredditNewBeforeUrl, Name, p.FullName).ToLower(), WebAgent);
+        }
+
+        public Listing<Comment> GetNewCommentsBefore(Comment c)
+        {
+            if (Name == "/")
+            {
+                return new Listing<Comment>(Reddit, "/comments.json?before=" + c.FullName, WebAgent);
+            }
+            return new Listing<Comment>(Reddit, string.Format(CommentsBeforeUrl, Name, c.FullName).ToLower(), WebAgent);
+        }
+
         public SubredditSettings Settings
         {
             get


Fix project factory registration

Fix project factory registration

--- IceBuilder/Package.cs
+++ IceBuilder/Package.cs
@@ -312,6 +312,8 @@
                 CommandLineMode = (bool)value;
             }

+            this.RegisterProjectFactory(new ProjectFactory());
+
             if (!CommandLineMode)
             {
                 ResourcesDirectory = Path.Combine(
@@ -376,7 +378,6 @@
                     mcs.AddCommand(menuItemRemove);
                     menuItemRemove.BeforeQueryStatus += removeIceBuilder_BeforeQueryStatus;
                 }
-                this.RegisterProjectFactory(new ProjectFactory());

                 //
                 // If IceHome isn't set try to locate the latest version installed and use that.


Fix a dumb error in getting a new chunk.

Creating a new chunk, then adding another new chunk to the collection
then returning the chunk that only exists on the stack is not the best
way to go for retaining changes.

--- InfiniMap/ChunkMap.cs
+++ InfiniMap/ChunkMap.cs
@@ -64,8 +64,8 @@
                 }
             }

-            var newChunk = new Chunk<T>(_chunkHeight, _chunkWidth);
-            _map.Add(Tuple.Create(xChunk, yChunk), new Chunk<T>());
+            var newChunk = new Chunk<T>();
+            _map.Add(Tuple.Create(xChunk, yChunk), newChunk);
             return newChunk;
         }