Lazy load children: most of them won't be needed for adding or deleting a single item. Adding an item is now just 20 times as expensive as reading it back :)

--- Trie/OptimizedTrie.cs
+++ Trie/OptimizedTrie.cs
@@ -52,7 +52,7 @@
             var root = new TrieItem(EmptyKey, null);
             while (i < _storage.Length - sizeof(ushort))
             {
-                var itemRead = TrieItem.Read(this, ref i);
+                var itemRead = TrieItem.Read(_storage, ref i);
                 if (itemRead == null)
                     break;
                 root.AddChild(itemRead);
@@ -224,21 +224,22 @@
                 return size;
             }

-            public static TrieItem Read(OptimizedTrie storage, ref int address)
+            public static TrieItem Read(byte[] buffer, ref int address)
             {
                 bool hasvalue;
                 bool haschildren;
-                Bufferpart key = GetKey(storage._storage, ref address, out hasvalue, out haschildren);
+                Bufferpart key = GetKey(buffer, ref address, out hasvalue, out haschildren);
                 if (key.Length == 0)
                     return null;
                 long? value = null;
                 if (hasvalue)
-                    value = storage.ReadLong(address, out address);
+                    value = buffer.ReadLong(ref address);
                 var result = new TrieItem(key.GetBytes(), value);
                 if (haschildren)
                 {
-                    var payloadLength = storage.ReadUshort(address, out address);
-                    result.Payload = new Bufferpart(storage._storage, address, payloadLength).GetBytes();
+                    var payloadLength = buffer.ReadUshort(ref address);
+                    result.Payload = new Bufferpart(buffer, address, payloadLength).GetBytes();
+                    address += payloadLength;
                 }
                 return result;
             }
@@ -313,7 +314,6 @@
             private void ReadChildren()
             {
                 var address = 0;
-
                 while (address < Payload.Length)
                 {
                     AddChild(Read(Payload, ref address));
@@ -371,6 +371,7 @@
                 }
                 else if (item._children.Count > 1)
                     item.Value = null;
+                HasChildren = _children.Count > 0;
             }
         }

@@ -380,4 +381,20 @@
             next = address + bytes.Length;
         }
     }
+
+    public static class ByteArrayExtensions
+    {
+        public static long ReadLong(this byte[] buffer, ref int address)
+        {
+            var result = BitConverter.ToInt64(buffer, address);
+            address += sizeof(long);
+            return result;
+        }
+        public static ushort ReadUshort(this byte[] buffer, ref int address)
+        {
+            var result = BitConverter.ToUInt16(buffer, address);
+            address += sizeof(ushort);
+            return result;
+        }
+    }
 }


play bird sound on join lobby

play bird sound on join lobby

--- Assets/Scripts/StateManagement/GameStates/LobbyScreen.cs
+++ Assets/Scripts/StateManagement/GameStates/LobbyScreen.cs
@@ -15,6 +15,13 @@
 		SetParticipatingBirds (new []{
 			0, 3, 4, 7
 		});
+
+		// Show my bird.
+		Bird bird = GameController.GetBird (DataCache.PlayerIndex);
+		Debug.LogWarning (bird);
+		transform.Find ("GUI Canvas/Content/Character Image").GetComponent<Image> ().sprite = bird.headSprite;
+		transform.Find ("GUI Canvas/Content/Character Name").GetComponent<Text> ().text = bird.name;
+		Camera.main.GetComponent<AudioSource> ().PlayOneShot (bird.sound);
 	}

 	// Set the birds currently participating in this game.
@@ -36,8 +43,7 @@
 	// Called when the start button is pressed.
 	public void OnPressStartButton () {
         BirbClient client = GameObject.Find("BirbClient").GetComponent<BirbClient>();
-        client.SendBirbMessage(BirbClient.BirbMessageCode.BEGIN, DataCache.RoomKey, GameStarted);
-        //Debug.LogWarning ("Start game not implemented server-side. Initalizing client-side testing.");
+        client.SendBirbMessage(BirbClient.BirbMessageCode.BEGIN, DataCache.RoomKey, GameStarted);
 	}

 	// Sets whether or not the host controls are shown.


debug output for cross-correlation offset evaluation

--- AudioAlign/AudioAlign.Audio/Matching/CrossCorrelation.cs
+++ AudioAlign/AudioAlign.Audio/Matching/CrossCorrelation.cs
@@ -209,6 +209,7 @@
                     match.Track2.CreateAudioStream(), iT2,
                     progressMonitor, out result);
                 Debug.WriteLine("CC: " + match + ": " + offset + " (" + sw.Elapsed + ")");
+                Debug.WriteLine("CCEV;" + match + ";" + offset.TotalMilliseconds + ";" + result.MaxValue + ";" + result.AbsoluteMaxValue + ";" + result.Correlations.Average() + ";" + result.Correlations.Average(f => Math.Abs(f)));

                 return new Match(match) {
                     Track2Time = match.Track2Time + offset,


bug fix

bug fix

--- Aurora/Physics/AuroraOpenDynamicsEngine/AODECharacter.cs
+++ Aurora/Physics/AuroraOpenDynamicsEngine/AODECharacter.cs
@@ -345,7 +345,7 @@
                         m_colliderObjectfilter = 0;
                     }

-                if (m_colliderGroundfilter == 0)
+                if (m_colliderObjectfilter == 0)
                     m_iscollidingObj = false;
                 else
                     m_iscollidingObj = true;


namespace changes

namespace changes

--- CameraExport360.cs
+++ CameraExport360.cs
@@ -44,7 +44,7 @@
 		var Texture = Capture360ToTexture(cam);

 		var DefaultName = cam.name + "_360";
-		System.Action<string, PopX.IO.ImageFileType> SaveTextureToFile = (Filename, Extension) =>
+		System.Action<PopX.IO.ImageFileType,string> SaveTextureToFile = (Extension,Filename) =>
 		{
 			byte[] Bytes = null;

@@ -102,7 +102,7 @@
 		try
 		{
 			Capture360ToRenderTexture(cam, rt);
-			var Output = SaveTextureToPng.GetTexture2D(rt, false);
+			var Output = PopX.Textures.GetTexture2D(rt, false);
 			RenderTexture.ReleaseTemporary(rt);
 			return Output;
 		}


EnsureLeftCurly checks initial currentToken

--- Pdoxcl2Sharp/ParadoxParser.cs
+++ Pdoxcl2Sharp/ParadoxParser.cs
@@ -526,14 +526,17 @@

         /// <summary>
-        /// Checks the next token in the stream in an attempt to locate a left curly.  If the token encountered is
+        /// Checks the current, and if needed next token in the stream in an attempt to locate a left curly.  If the token encountered is
         /// an equality symbol, it will read the next token and see if that is a left curly, e.g. x = { y }.
-        /// If the initial token isn't an equality symbol or a left curly, or if the initial token is an equality symbol
+        /// If the initial read token isn't an equality symbol or a left curly, or if the initial read token is an equality symbol
         /// but the subsequent token isn't a left curly, then an exception is thrown.
         /// </summary>
         /// <exception cref="InvalidOperationException"></exception>
         private void ensureLeftCurly()
         {
+            if (currentToken == LexerToken.LeftCurly)
+                return;
+
             currentToken = getNextToken();
             if (currentToken == LexerToken.Equals)
                 currentToken = getNextToken();


Use UnsafeStringComparer for compares in StringSet

--- PerformanceTypes/StringSet.cs
+++ PerformanceTypes/StringSet.cs
@@ -209,7 +209,7 @@
             while (cursor.MightHaveMore)
             {
                 var value = cursor.NextString();
-                if (value != null && IsMatchingString(value, buffer, start, length))
+                if (value != null && UnsafeStringComparer.AreEqual(value, buffer, start, length))
                     return value;
             }

@@ -273,19 +273,5 @@

             _data = new BucketsAndSlots(newBuckets, newSlots, oldData.NextAvailableSlotIndex);
         }
-
-        static bool IsMatchingString(string s, char[] buffer, int start, int length)
-        {
-            if (s.Length != length)
-                return false;
-
-            for (var i = start; i < length; i++)
-            {
-                if (s[i] != buffer[i])
-                    return false;
-            }
-
-            return true;
-        }
     }
 }


cd1b52d  Fixes #6313 - When a user starts to get a User ID set, then we set this User ID to the existing visit rather than create a new visit for this user id specifically

--- Piwik.Tracker/PiwikTracker.cs
+++ Piwik.Tracker/PiwikTracker.cs
@@ -1109,6 +1109,8 @@

         /// <summary>
         /// Hash function used internally by Piwik to hash a User ID into the Visitor ID.
+        ///
+        /// Note: matches implementation of Tracker\Request->getUserIdHashed()
         /// </summary>
         static public string getUserIdHashed(string id)
         {


Support mocking of Hazelcast.Net.Tests assembly's own interfaces (#701)

--- src/Hazelcast.Net.Tests/Properties/AssemblyInfo.cs
+++ src/Hazelcast.Net.Tests/Properties/AssemblyInfo.cs
@@ -12,8 +12,22 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.

+using System.Runtime.CompilerServices;
 using NUnit.Framework;

 // sets a default (large) timeout so tests eventually abort
 // 10 min * 60 sec * 1000 ms - no test should last more that 10 mins
 [assembly:Timeout( 10 * 60 * 1000)]
+
+#if ASSEMBLY_SIGNING
+
+// see https://github.com/Moq/moq4/wiki/Quickstart and https://stackoverflow.com/questions/30089042
+// we need the full public key here in order to be able to use Moq when our assemblies are signed
+[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
+
+#else
+
+// moq
+[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
+
+#endif


initial

initial

--- Ccr.MaterialDesign/MaterialDesign/SwatchClassifierMap.cs
+++ Ccr.MaterialDesign/MaterialDesign/SwatchClassifierMap.cs
@@ -5,7 +5,7 @@
 using System.Threading.Tasks;

 namespace Ccr.MaterialDesign
-{
+{
 	//public static class SwatchClassifierMap
 	//{
 	//	public static Swatch GetSwatch(


notification message changed. close #112

--- src/Kondor.Service/Handlers/NotificationHandler.cs
+++ src/Kondor.Service/Handlers/NotificationHandler.cs
@@ -5,6 +5,7 @@
 using Kondor.Domain;
 using Kondor.Domain.Enums;
 using Kondor.Domain.Models;
+using Kondor.Service.Leitner;
 using Kondor.Service.Managers;

 namespace Kondor.Service.Handlers
@@ -17,8 +18,9 @@
         private readonly ISettingHandler _settingHandler;
         private readonly ITextManager _textManager;
         private readonly IViews _views;
+        private readonly ILeitnerService _leitnerService;

-        public NotificationHandler(ITelegramApiManager telegramApiManager, IUserApi userApi, ISettingHandler settingHandler, ITextManager textManager, IUnitOfWork unitOfWork, IViews views)
+        public NotificationHandler(ITelegramApiManager telegramApiManager, IUserApi userApi, ISettingHandler settingHandler, ITextManager textManager, IUnitOfWork unitOfWork, IViews views, ILeitnerService leitnerService)
         {
             _telegramApiManager = telegramApiManager;
             _userApi = userApi;
@@ -26,6 +28,7 @@
             _textManager = textManager;
             _unitOfWork = unitOfWork;
             _views = views;
+            _leitnerService = leitnerService;
         }

         public void SendNotification()
@@ -79,7 +82,18 @@
                                 _unitOfWork.Save();

-                                _telegramApiManager.SendMessage(temp.ChatId, _textManager.GetText(StringResources.BackMessage), _views.Index().Keyboards);
+                                try
+                                {
+                                    var cardState = _leitnerService.GetCardForExam(telegramUserId);
+
+                                    var notificationMessageBody = cardState.Card.DeserializeCardData().GetFrontExamView();
+
+                                    _telegramApiManager.SendMessage(temp.ChatId, notificationMessageBody, _views.Exam(cardState.Id).Keyboards);
+                                }
+                                catch (IndexOutOfRangeException)
+                                {
+                                    _telegramApiManager.SendMessage(temp.ChatId, _textManager.GetText(StringResources.BackMessage), _views.Index().Keyboards);
+                                }
                             }
                         }
                     }


Lucene.Net.Core.Search.BitsFilteredDocIdSet refactor: Renamed member variable camelCase

--- src/Lucene.Net.Core/Search/BitsFilteredDocIdSet.cs
+++ src/Lucene.Net.Core/Search/BitsFilteredDocIdSet.cs
@@ -30,7 +30,7 @@

     public sealed class BitsFilteredDocIdSet : FilteredDocIdSet
     {
-        private readonly Bits AcceptDocs; // LUCENENET TODO: rename
+        private readonly Bits acceptDocs;

         /// <summary>
         /// Convenience wrapper method: If {@code acceptDocs == null} it returns the original set without wrapping. </summary>
@@ -53,12 +53,12 @@
             {
                 throw new System.NullReferenceException("acceptDocs is null");
             }
-            this.AcceptDocs = acceptDocs;
+            this.acceptDocs = acceptDocs;
         }

         protected override bool Match(int docid)
         {
-            return AcceptDocs.Get(docid);
+            return acceptDocs.Get(docid);
         }
     }
 }


#738 Support legacy environment keys

#738 Support legacy environment keys

--- src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs
+++ src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs
@@ -47,7 +47,19 @@
             _configureLoggingDelegates = new List<Action<ILoggerFactory>>();

             // This may end up storing null, but that's indistinguishable from not adding it.
-            UseSetting(WebHostDefaults.EnvironmentKey, Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"));
+            UseSetting(WebHostDefaults.EnvironmentKey, Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")
+                // Legacy keys, never remove these.
+                ?? Environment.GetEnvironmentVariable("Hosting:Environment")
+                ?? Environment.GetEnvironmentVariable("ASPNET_ENV"));
+
+            if (Environment.GetEnvironmentVariable("Hosting:Environment") != null)
+            {
+                Console.WriteLine("The environment variable 'Hosting:Environment' is obsolete and has been replaced with 'ASPNETCORE_ENVIRONMENT'");
+            }
+            if (Environment.GetEnvironmentVariable("ASPNET_ENV") != null)
+            {
+                Console.WriteLine("The environment variable 'ASPNET_ENV' is obsolete and has been replaced with 'ASPNETCORE_ENVIRONMENT'");
+            }
         }

         /// <summary>


Use compound assignment in /Microsoft.WSMan (#17721)

--- src/Microsoft.WSMan.Management/WSManConnections.cs
+++ src/Microsoft.WSMan.Management/WSManConnections.cs
@@ -360,10 +360,7 @@
         protected override void BeginProcessing()
         {
             WSManHelper helper = new WSManHelper(this);
-            if (computername == null)
-            {
-                computername = "localhost";
-            }
+            computername ??= "localhost";

             if (this.SessionState.Path.CurrentProviderLocation(WSManStringLiterals.rootpath).Path.StartsWith(WSManStringLiterals.rootpath + ":" + WSManStringLiterals.DefaultPathSeparator + computername, StringComparison.OrdinalIgnoreCase))
             {


Fixed FieldOfStudy problem and added transaction to CCCUser signup #760 #761

--- web/api/v1/auth/signup.cshtml
+++ web/api/v1/auth/signup.cshtml
@@ -171,8 +171,17 @@
         {
             using (var db = new LcDatabase())
             {
-                InsertCccUser(db, login.userID);
-                InsertUserEducation(db, login.userID);
+                db.Execute("BEGIN TRANSACTION");
+                try
+                {
+                    InsertCccUser(db, login.userID);
+                    InsertUserEducation(db, login.userID);
+                    db.Execute("COMMIT TRANSACTION");
+                }
+                catch
+                {
+                    db.Execute("ROLLBACK TRANSACTION");
+                }
             }
         }
         private void InsertCccUser(LcDatabase db, int userID)
@@ -202,11 +211,16 @@
         {
             var institutionID = Request["institutionID"].AsInt();
             var fieldOfStudyID = Request["fieldOfStudyID"].AsInt();
+            var fieldOfStudy = db.QueryValue(@"
+                SELECT FieldOfStudyName
+                FROM FieldOfStudy
+                WHERE FieldOfStudyID = @0
+            ", fieldOfStudyID);
             db.Execute(@"
                 INSERT usereducation (
                     UserID,
                     InstitutionID,
-                    FieldOfStudyID,
+                    FieldOfStudy,
                     DegreeCertificate,
                     CreatedDate,
                     ModifiedDate,
@@ -222,7 +236,7 @@
                     'sys',
                     1
                 )
-            ", userID, institutionID, fieldOfStudyID);
+            ", userID, institutionID, fieldOfStudy);
         }
     }
 }


Use a Queue<T> instead of Stack<T> - fixes #16

--- src/MindstormR.Server.Nancy/Modules/RobotModule.cs
+++ src/MindstormR.Server.Nancy/Modules/RobotModule.cs
@@ -8,7 +8,7 @@
     public class RobotModule : NancyModule
     {
         private static List<int> _clients = new List<int>();
-        private static Dictionary<int, Stack<Command>> _commands = new Dictionary<int, Stack<Command>>();
+        private static Dictionary<int, Queue<Command>> _commands = new Dictionary<int, Queue<Command>>();
         private static int _id = 1000;

         public RobotModule()
@@ -32,7 +32,7 @@
         {
             int id = _id++;
             _clients.Add(id);
-            _commands.Add(id, new Stack<Command>());
+            _commands.Add(id, new Queue<Command>());
             return id.ToString();
         }

@@ -51,10 +51,10 @@
         private dynamic PushCommand(int id, Command command)
         {
             // Push a command on the stack of the robot with the specified id.
-            Stack<Command> commands;
+            Queue<Command> commands;
             if (_commands.TryGetValue(id, out commands))
             {
-                commands.Push(command);
+                commands.Enqueue(command);
                 return true.ToString();
             }

@@ -64,12 +64,12 @@
         private dynamic PopCommand(dynamic parameters)
         {
             // Pop the last command from the stack of the robot with the specified id.
-            Stack<Command> commands;
+            Queue<Command> commands;
             if (_commands.TryGetValue(parameters.id, out commands))
             {
                 if (commands.Count > 0)
                 {
-                    string s = commands.Pop().ToString();
+                    string s = commands.Dequeue().ToString();
                     return s;
                 }
             }


Cleanup

Cleanup

--- Client/Systems/VesselImmortalSys/VesselImmortalSystem.cs
+++ Client/Systems/VesselImmortalSys/VesselImmortalSystem.cs
@@ -34,8 +34,8 @@
         protected override void OnEnabled()
         {
             base.OnEnabled();
+            SetupRoutine(new RoutineDefinition(1000, RoutineExecution.Update, MakeOtherPlayerVesselsImmortal));
             SetupRoutine(new RoutineDefinition(2000, RoutineExecution.Update, UpdateOwnedAndOtherPeopleVesselList));
-            SetupRoutine(new RoutineDefinition(1000, RoutineExecution.Update, MakeOtherPlayerVesselsImmortal));
         }

         protected override void OnDisabled()
@@ -72,9 +72,7 @@
                     .Where(v=> !VesselRemoveSystem.Singleton.VesselWillBeKilled(v)));

                 OwnedVessels.Clear();
-                OwnedVessels.AddRange(OwnedVesselIds
-                    .Select(FlightGlobals.FindVessel)
-                    .Where(v => v != null));
+                OwnedVessels.AddRange(OwnedVesselIds.Select(FlightGlobals.FindVessel));

                 OtherPeopleVessels.Clear();
                 OtherPeopleVessels.AddRange(LockSystem.LockQuery.GetAllControlLocks()
@@ -82,8 +80,7 @@
                     .Select(l => l.VesselId)
                     .Except(OwnedVesselIds)
                     .Where(v => !VesselRemoveSystem.Singleton.VesselWillBeKilled(v))
-                    .Select(FlightGlobals.FindVessel)
-                    .Where(v => v != null));
+                    .Select(FlightGlobals.FindVessel));
             }
         }

@@ -104,8 +101,8 @@
                     SetVesselImmortalState(vessel, true);
                 }

-                if(FlightGlobals.ActiveVessel != null) //If we are spectating set our own vessel as immortal
-                    SetVesselImmortalState(FlightGlobals.ActiveVessel, VesselCommon.IsSpectating);
+                //If we are spectating set our own vessel as immortal
+                SetVesselImmortalState(FlightGlobals.ActiveVessel, VesselCommon.IsSpectating);
             }
         }

@@ -118,6 +115,8 @@
         /// </summary>
         private static void SetVesselImmortalState(Vessel vessel, bool immortal)
         {
+            if (vessel == null) return;
+
             foreach (var part in vessel.Parts.Where(p => p.attachJoint != null))
             {
                 part.attachJoint.SetUnbreakable(immortal, part.rigidAttachment);


Add another migration step to UWP.

Add another migration step to UWP.

--- src/Money.UI.Universal/Bootstrap/UpgradeService.cs
+++ src/Money.UI.Universal/Bootstrap/UpgradeService.cs
@@ -34,7 +34,7 @@
         private readonly IPriceConverter priceConverter;
         private readonly Func<IKey> userKeyGetter;

-        public const int CurrentVersion = 5;
+        public const int CurrentVersion = 6;

         public UpgradeService(ICommandDispatcher commandDispatcher, IEventRebuilderStore eventStore, IFormatter eventFormatter, IFactory<EventSourcingContext> eventSourceContextFactory, IFactory<ReadModelContext> readModelContextFactory, IFactory<ApplicationDataContainer> storageContainerFactory, IPriceConverter priceConverter, Func<IKey> userKeyGetter)
             : base(storageContainerFactory, CurrentVersion)
@@ -88,6 +88,12 @@
                 context.StartingStep(4 - currentVersion, "Adding user info to entries.");
                 await UpgradeVersion5();
             }
+
+            if (currentVersion < 6)
+            {
+                context.StartingStep(1 - currentVersion, "Rebuilding internal database.");
+                await UpgradeVersion6();
+            }
         }

         private async Task UpgradeVersion1()
@@ -202,5 +208,10 @@

             await RecreateReadModelContextAsync();
         }
+
+        private async Task UpgradeVersion6()
+        {
+            await RecreateReadModelContextAsync();
+        }
     }
 }


Fixed invalid type reference in XML comment

--- src/Nancy/Bootstrapper/ApplicationRegistrations.cs
+++ src/Nancy/Bootstrapper/ApplicationRegistrations.cs
@@ -38,7 +38,7 @@
         }

         /// <summary>
-        /// Scans for the implementation of <typeparamref name="T"/> and registers it.
+        /// Scans for the implementation of <typeparamref name="TRegistration"/> and registers it.
         /// </summary>
         /// <typeparam name="TRegistration">The <see cref="Type"/> to scan for and register as.</typeparam>
         public void Register<TRegistration>()


Minor text adjustment

Minor text adjustment

--- src/NuGetGallery/Views/Packages/ReportAbuse.cshtml
+++ src/NuGetGallery/Views/Packages/ReportAbuse.cshtml
@@ -8,15 +8,15 @@

Report Abuse

-    Important: Please to not use this form to report a bug in a package you are using!

+    Important: Please do not use this form to report a bug in a package you are using!

     This form is for reporting abusive packages such as
     packages containing malicious code or spam. If "@Model.PackageId" simply doesn't
     work, or if you need help getting the package installed, please
-    click here to contact the owners of "@Model.PackageId".
+    contact the owners instead.

Please provide a detailed abuse report. Include exactly what the package did, for example if you are reporting a package with a virus or malicious code,
-    please explain how you detected this! We cannot delete packages without convincing proof.

+    please provide evidence to support your claim! We cannot delete packages without evidence that they exhibit malicious behavior.

 @if (!Model.ConfirmedUser)
 {


Fix replace all mistake

Fix replace all mistake

--- src/OmniSharp.Host/MSBuild/Discovery/Extensions.cs
+++ src/OmniSharp.Host/MSBuild/Discovery/Extensions.cs
@@ -20,7 +20,7 @@
             {
                 // Did we end up choosing the standalone MSBuild because there was an invalid Visual Studio?
                 // If so, provide a helpful message to the user.
-                if (invalidVSFound && bestInstanceFound.DiscoveryType == DiscoveryType.VisualStudioSetup)
+                if (invalidVSFound && bestInstanceFound.DiscoveryType == DiscoveryType.StandAlone)
                 {
                     logger.LogWarning(
                         $@"It looks like you have Visual Studio lower than VS 2019 {s_minimumMSBuildVersion} installed.
@@ -28,7 +28,7 @@
                     );
                 }

-                if (vsWithoutSdkResolver && bestInstanceFound.DiscoveryType == DiscoveryType.VisualStudioSetup)
+                if (vsWithoutSdkResolver && bestInstanceFound.DiscoveryType == DiscoveryType.StandAlone)
                 {
                     logger.LogWarning(
                         @"It looks like you have Visual Studio 2019 installed without .NET Core SDK support which is required by OmniSharp.


Improve code documentation in the IMutationValidator interface

--- src/Openchain.Infrastructure/IMutationValidator.cs
+++ src/Openchain.Infrastructure/IMutationValidator.cs
@@ -17,8 +17,18 @@

 namespace Openchain.Infrastructure
 {
+    /// <summary>
+    /// Represents a service capable of verifying a mutation.
+    /// </summary>
     public interface IMutationValidator
     {
+        /// <summary>
+        /// Validates a mutation.
+        /// </summary>
+        /// <param name="mutation">The mutation to validate.</param>
+        /// <param name="authentication">Authentication data provided along with the mutation.</param>
+        /// <param name="accounts">Dictionary containing the current version of records being affected.</param>
+        /// <returns>The task object representing the asynchronous operation.</returns>
         Task Validate(ParsedMutation mutation, IReadOnlyList<SignatureEvidence> authentication, IReadOnlyDictionary<AccountKey, AccountStatus> accounts);
     }
 }


Make JsonConverters inside OrleansJsonSerializer public (#3398)

--- src/Orleans/Serialization/OrleansJsonSerializer.cs
+++ src/Orleans/Serialization/OrleansJsonSerializer.cs
@@ -162,7 +162,7 @@

 #region JsonConverters

-    internal class IPAddressConverter : JsonConverter
+    public class IPAddressConverter : JsonConverter
     {
         public override bool CanConvert(Type objectType)
         {
@@ -182,7 +182,7 @@
         }
     }

-    internal class GrainIdConverter : JsonConverter
+    public class GrainIdConverter : JsonConverter
     {
         public override bool CanConvert(Type objectType)
         {
@@ -206,7 +206,7 @@
         }
     }

-    internal class SiloAddressConverter : JsonConverter
+    public class SiloAddressConverter : JsonConverter
     {
         public override bool CanConvert(Type objectType)
         {
@@ -230,7 +230,7 @@
         }
     }

-    internal class UniqueKeyConverter : JsonConverter
+    public class UniqueKeyConverter : JsonConverter
     {
         public override bool CanConvert(Type objectType)
         {
@@ -254,7 +254,7 @@
         }
     }

-    internal class IPEndPointConverter : JsonConverter
+    public class IPEndPointConverter : JsonConverter
     {
         public override bool CanConvert(Type objectType)
         {
@@ -281,7 +281,7 @@
         }
     }

-    internal class GrainReferenceConverter : JsonConverter
+    public class GrainReferenceConverter : JsonConverter
     {
         private static readonly Type AddressableType = typeof(IAddressable);
         private readonly IGrainFactory grainFactory;


Add tests for json lists.

Add tests for json lists.

--- ConsoleApps/FunWithSpikes/FunWithNewtonsoft/ListTests.cs
+++ ConsoleApps/FunWithSpikes/FunWithNewtonsoft/ListTests.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using Newtonsoft.Json;
+using NUnit.Framework;
 using System.Collections.Generic;

 namespace FunWithNewtonsoft
@@ -7,16 +8,56 @@
     public class ListTests
     {
         [Test]
-        public void Deserialize_PartialList_ReturnsList()
+        public void DeserializeObject_JsonList_ReturnsList()
         {
             // Assemble
             string json = @"
-                {'Number':'1','Letter':'A'},
-                {'Number':'2','Letter':'B'},
-                {'Number':'3','Letter':'C'},";
+                [
+                    {'Number':'1','Letter':'A'},
+                    {'Number':'2','Letter':'B'},
+                    {'Number':'3','Letter':'C'}
+                ]";

             // Act
-            List<Data> actual = null;
+            List<Data> actual = JsonConvert.DeserializeObject<List<Data>>(json);
+
+            // Assert
+            Assert.AreEqual(1, actual[0].Number);
+            Assert.AreEqual("A", actual[0].Letter);
+
+            Assert.AreEqual(2, actual[1].Number);
+            Assert.AreEqual("B", actual[1].Letter);
+
+            Assert.AreEqual(3, actual[2].Number);
+            Assert.AreEqual("C", actual[2].Letter);
+        }
+
+        [Test]
+        public void DeserializeObject_MissingSquareBracesAroundJsonList_Throws()
+        {
+            // Assemble
+            string json = @"
+                    {'Number':'1','Letter':'A'},
+                    {'Number':'2','Letter':'B'},
+                    {'Number':'3','Letter':'C'}";
+
+            // Act
+            Assert.Throws<JsonSerializationException>(() => JsonConvert.DeserializeObject<List<Data>>(json));
+        }
+
+        [Test]
+        public void DeserializeObject_TrailingCommaAtEndOfJsonList_ReturnsList()
+        {
+            // Assemble
+            string json = @"
+                [
+                    {'Number':'1','Letter':'A'},
+                    {'Number':'2','Letter':'B'},
+                    {'Number':'3','Letter':'C'},
+                ]";
+
+            // Act
+            List<Data> actual = JsonConvert.DeserializeObject<List<Data>>(json);

             // Assert
             Assert.AreEqual(1, actual[0].Number);


check that's not my buffers

check that's not my buffers

--- Cowboy/Cowboy.Sockets/Buffer/GrowingByteBufferManager.cs
+++ Cowboy/Cowboy.Sockets/Buffer/GrowingByteBufferManager.cs
@@ -94,7 +94,8 @@

             lock (_sync)
             {
-                _bufferStack.Push(buffer);
+                if (buffer.Length == BufferSize)
+                    _bufferStack.Push(buffer);
             }
         }


Adding Google Analytics code

Adding Google Analytics code

--- CronExpressionDescriptor.Demo/Views/Default/Index.cshtml
+++ CronExpressionDescriptor.Demo/Views/Default/Index.cshtml
@@ -83,5 +83,17 @@
             </footer>
         </form>
     </div>
+    <script>
+        (function (i, s, o, g, r, a, m) {
+            i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
+                (i[r].q = i[r].q || []).push(arguments)
+            }, i[r].l = 1 * new Date(); a = s.createElement(o),
+            m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
+        })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
+
+        ga('create', 'UA-19416043-5', 'auto');
+        ga('send', 'pageview');
+
+    </script>
 </body>
 </html>


PP9-12293: fix share test with expiration time

--- src/Picturepark.SDK.V1.Tests/Clients/ShareTests.cs
+++ src/Picturepark.SDK.V1.Tests/Clients/ShareTests.cs
@@ -345,7 +345,7 @@
             {
                 Contents = shareContentItems,
                 Description = "Description of Embed share",
-                ExpirationDate = new DateTime(2020, 12, 31),
+                ExpirationDate = DateTime.Now + TimeSpan.FromDays(7),
                 Name = "Embed share"
             };

@@ -378,7 +378,7 @@
             {
                 Contents = contents,
                 Description = "Description of Embed share",
-                ExpirationDate = new DateTime(2020, 12, 31),
+                ExpirationDate = DateTime.Now + TimeSpan.FromDays(7),
                 Name = "Embed share"
             }).ConfigureAwait(false);

@@ -403,7 +403,7 @@
             {
                 Contents = contents,
                 Description = "Description of Embed share",
-                ExpirationDate = new DateTime(2020, 12, 31),
+                ExpirationDate = DateTime.Now + TimeSpan.FromDays(7),
                 Name = "Embed share"
             }).ConfigureAwait(false);

@@ -466,7 +466,7 @@
             {
                 Contents = shareContentItems,
                 Description = "Description of Embed share",
-                ExpirationDate = new DateTime(2020, 12, 31),
+                ExpirationDate = DateTime.Now + TimeSpan.FromDays(7),
                 Name = "Embed share"
             };


add configurable params for StdRowLockSemaphore for Failure obtaining db row lock

--- src/Quartz/Impl/AdoJobStore/StdRowLockSemaphore.cs
+++ src/Quartz/Impl/AdoJobStore/StdRowLockSemaphore.cs
@@ -65,6 +65,19 @@
         {
         }

+        // Configurable lock retry parameters
+
+        /// <summary>
+        /// Maximum retry attempts, defaults to 3.
+        /// </summary>
+        public int MaxRetry { get; set; } = 3;
+
+        /// <summary>
+        /// Sleep between attempts, defaults to 1 second.
+        /// </summary>
+        [TimeSpanParseRule(TimeSpanParseRule.Milliseconds)]
+        public TimeSpan RetryPeriod { get; set; } = TimeSpan.FromMilliseconds(1000);
+
         /// <summary>
         /// Execute the SQL select for update that will lock the proper database row.
         /// </summary>
@@ -79,6 +92,11 @@
             Exception initCause = null;
             // attempt lock two times (to work-around possible race conditions in inserting the lock row the first time running)
             int count = 0;
+
+            // Configurable lock retry attempts
+            var maxRetryLocal = MaxRetry;
+            var retryPeriodLocal = RetryPeriod;
+
             do
             {
                 count++;
@@ -113,10 +131,10 @@

                                 if (res != 1)
                                 {
-                                    if (count < 3)
+                                    if (count < maxRetryLocal)
                                     {
                                         // pause a bit to give another thread some time to commit the insert of the new lock row
-                                        await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken).ConfigureAwait(false);
+                                        await Task.Delay(retryPeriodLocal, cancellationToken).ConfigureAwait(false);

                                         // try again ...
                                         continue;
@@ -141,13 +159,13 @@

                     if (Log.IsDebugEnabled())
                     {
-                        Log.DebugFormat("Lock '{0}' was not obtained by: {1}{2}", lockName, requestorId, count < 3 ? " - will try again." : "");
+                        Log.DebugFormat("Lock '{0}' was not obtained by: {1}{2}", lockName, requestorId, count < maxRetryLocal ? " - will try again." : "");
                     }

-                    if (count < 3)
+                    if (count < maxRetryLocal)
                     {
                         // pause a bit to give another thread some time to commit the insert of the new lock row
-                        await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken).ConfigureAwait(false);
+                        await Task.Delay(retryPeriodLocal, cancellationToken).ConfigureAwait(false);

                         // try again ...
                         continue;
@@ -155,7 +173,7 @@

                     throw new LockException("Failure obtaining db row lock: " + sqle.Message, sqle);
                 }
-            } while (count < 4);
+            } while (count < maxRetryLocal + 1);

             throw new LockException("Failure obtaining db row lock, reached maximum number of attempts. Initial exception (if any) attached as root cause.", initCause);
         }


refactor: warnings fixed

refactor: warnings fixed

--- src/Reni/TokenClasses/Whitespace/WhiteSpaceView.cs
+++ src/Reni/TokenClasses/Whitespace/WhiteSpaceView.cs
@@ -5,7 +5,7 @@

 namespace Reni.TokenClasses.Whitespace
 {
-    class WhiteSpaceView : DumpableObject
+    sealed class WhiteSpaceView : DumpableObject
     {
         readonly WhiteSpaceItem Target;


Added ConfigureAwait(false) to Task.Delay

--- src/SendGrid/Reliability/RetryDelegatingHandler.cs
+++ src/SendGrid/Reliability/RetryDelegatingHandler.cs
@@ -58,7 +58,7 @@
                     }

                     // ReSharper disable once MethodSupportsCancellation, cancel will be indicated on the token
-                    await Task.Delay(this.settings.RetryInterval);
+                    await Task.Delay(this.settings.RetryInterval).ConfigureAwait(false);
                 }
                 catch (HttpRequestException)
                 {
@@ -69,7 +69,7 @@
                         throw;
                     }

-                    await Task.Delay(this.settings.RetryInterval);
+                    await Task.Delay(this.settings.RetryInterval).ConfigureAwait(false);
                 }
             }


Get MessageId from sendGridResponse

Get MessageId from sendGridResponse

--- src/Senders/FluentEmail.SendGrid/SendGridSender.cs
+++ src/Senders/FluentEmail.SendGrid/SendGridSender.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Threading;
@@ -106,6 +107,13 @@

             var sendResponse = new SendResponse();

+            if (sendGridResponse.Headers.TryGetValues(
+                "X-Message-ID",
+                out IEnumerable<string> messageIds))
+            {
+                sendResponse.MessageId = messageIds.FirstOrDefault();
+            }
+
             if (IsHttpSuccess((int)sendGridResponse.StatusCode)) return sendResponse;

             sendResponse.ErrorMessages.Add($"{sendGridResponse.StatusCode}");


Added support for OR logic in Queue and Topic filters (#293)

* Added support for OR logic in Queue and Topic filters

* Refactored TimeoutException

--- src/ServiceBusExplorer/Helpers/ServiceBusHelper.cs
+++ src/ServiceBusExplorer/Helpers/ServiceBusHelper.cs
@@ -1872,15 +1872,36 @@
                 if (string.IsNullOrEmpty(serviceBusNamespaceInstance.EntityPath))
                 {
                     var taskList = new List<Task>();
-                    var task = string.IsNullOrWhiteSpace(filter) ? namespaceManager.GetQueuesAsync() : namespaceManager.GetQueuesAsync(filter);
-                    taskList.Add(task);
-                    taskList.Add(Task.Delay(TimeSpan.FromSeconds(MainForm.SingletonMainForm.ServerTimeout)));
-                    Task.WaitAny(taskList.ToArray());
-                    if (task.IsCompleted)
-                    {
-                        return task.Result;
-                    }
-                    throw new TimeoutException();
+                    //Documentation states AND is the only logical clause allowed in the filter (And FYI a maximum of only 3 filter expressions allowed)
+                    //https://docs.microsoft.com/en-us/dotnet/api/microsoft.servicebus.namespacemanager.getqueuesasync?view=azure-dotnet#Microsoft_ServiceBus_NamespaceManager_GetQueuesAsync_System_String_
+                    //Split on ' OR ' and combine queues returned
+                    IEnumerable<QueueDescription> queues = new List<QueueDescription>();
+                    var filters = new List<string>();
+                    if (string.IsNullOrWhiteSpace(filter))
+                    {
+                        filters.Add(filter);
+                    }
+                    else
+                    {
+                        filters = filter.ToLowerInvariant().Split(new[] { " or " }, StringSplitOptions.None).ToList();
+                    }
+                    foreach (var splitFilter in filters)
+                    {
+                        var task = string.IsNullOrWhiteSpace(filter) ? namespaceManager.GetQueuesAsync() : namespaceManager.GetQueuesAsync(splitFilter);
+                        taskList.Add(task);
+                        taskList.Add(Task.Delay(TimeSpan.FromSeconds(MainForm.SingletonMainForm.ServerTimeout)));
+                        Task.WaitAny(taskList.ToArray());
+                        if (task.IsCompleted)
+                        {
+                            queues = queues.Union(task.Result);
+                            taskList.Clear();
+                        }
+                        else
+                        {
+                            throw new TimeoutException();
+                        }
+                    }
+                    return queues;
                 }

                 return new List<QueueDescription> {
@@ -2002,27 +2023,40 @@
         {
             if (namespaceManager != null)
             {
+                //Documentation states AND is the only logical clause allowed in the filter
+                //https://docs.microsoft.com/en-us/dotnet/api/microsoft.servicebus.namespacemanager.gettopicsasync?view=azure-dotnet
+                //Split on ' OR ' and combine queues returned
                 var taskList = new List<Task>();
                 if (string.IsNullOrEmpty(serviceBusNamespaceInstance.EntityPath))
                 {
-                    Task<IEnumerable<TopicDescription>> task;
+                    IEnumerable<TopicDescription> topics = new List<TopicDescription>();
+                    var filters = new List<string>();
                     if (string.IsNullOrWhiteSpace(filter))
                     {
-                        task = namespaceManager.GetTopicsAsync();
+                        filters.Add(filter);
                     }
                     else
                     {
-                        task = namespaceManager.GetTopicsAsync(filter);
-                    }
-
-                    taskList.Add(task);
-                    taskList.Add(Task.Delay(TimeSpan.FromSeconds(MainForm.SingletonMainForm.ServerTimeout)));
-                    Task.WaitAny(taskList.ToArray());
-                    if (task.IsCompleted)
-                    {
-                        return task.Result;
-                    }
-                    throw new TimeoutException();
+                        filters = filter.ToLowerInvariant().Split(new[] { " or " }, StringSplitOptions.None).ToList();
+                    }
+
+                    foreach (var splitFilter in filters)
+                    {
+                        var task = string.IsNullOrWhiteSpace(filter) ? namespaceManager.GetTopicsAsync() : namespaceManager.GetTopicsAsync(splitFilter);
+                        taskList.Add(task);
+                        taskList.Add(Task.Delay(TimeSpan.FromSeconds(MainForm.SingletonMainForm.ServerTimeout)));
+                        Task.WaitAny(taskList.ToArray());
+                        if (task.IsCompleted)
+                        {
+                            topics = topics.Union(task.Result);
+                            taskList.Clear();
+                        }
+                        else
+                        {
+                            throw new TimeoutException();
+                        }
+                    }
+                    return topics;
                 }

                 return new List<TopicDescription> {


Remove failed Tasks from list.

Remove failed Tasks from list.

--- AsyncIO/TaskPool.cs
+++ AsyncIO/TaskPool.cs
@@ -50,7 +50,11 @@
             {
                 RemoveTask(task);

-            }).Catch(Fail);
+            }).Catch(ex =>
+            {
+                RemoveTask(task);
+                Fail(ex);
+            });
         }

         public Task Drain()
@@ -59,7 +63,7 @@
             {
                 // Mark the operation as complete
                 _tcs.SetResult(null);
-
+
                 // Clear the list
                 _tasks.Clear();


more formatting

more formatting

--- RepoStats/views/commit.cshtml
+++ RepoStats/views/commit.cshtml
@@ -19,8 +19,8 @@

                 @foreach (var item in Model.FileChanges)
                 {
-

-
+

+
                             @item.Path

@@ -29,7 +29,17 @@

-
@item.Diff

+                            @foreach (var line in item.Diff.Split('\n'))
+                            {
+                                if (line.StartsWith("+"))
+                                {
+                                    @:
@line

+                                }
+                                else
+                                {
+                                    @:@line
+                                }
+                            }

         }


Change the Order for Inlining Multi Units

--- GekkoAssembler.Common/Optimizers/IRMultiUnitOptimizer.cs
+++ GekkoAssembler.Common/Optimizers/IRMultiUnitOptimizer.cs
@@ -11,8 +11,8 @@
             var units = block.Units;

             var newUnits = units
-                .Select(x => x is IRCodeBlock ? Optimize(x as IRCodeBlock) : x)
-                .SelectMany(x => x is IRMultiUnit ? (x as IRMultiUnit).Inner : (IEnumerable<IIRUnit>)new[] { x });
+                .SelectMany(x => x is IRMultiUnit ? (x as IRMultiUnit).Inner : (IEnumerable<IIRUnit>)new[] { x })
+                .Select(x => x is IRCodeBlock ? Optimize(x as IRCodeBlock) : x);

             return new IRCodeBlock(newUnits);
         }


Corrected color in broken preset test

Corrected color in broken preset test

--- src/Sleddog.Blink1.ExplicitTests/Blink1mk2Tests.cs
+++ src/Sleddog.Blink1.ExplicitTests/Blink1mk2Tests.cs
@@ -53,7 +53,7 @@
         [RequireBlink1Mk2Hardware(Skip = "Current issue with color comparison, but it is right")]
         public void SavePresetWritesToDevice()
         {
-            var expected = new Blink1Preset(Color.DarkSlateGray, TimeSpan.FromSeconds(1.5));
+            var expected = new Blink1Preset(Color.FromArgb(255, 50, 100, 200), TimeSpan.FromSeconds(1.5));

             blink1.EnableGamma = false;


Update StringExtensionsTests.cs

Update StringExtensionsTests.cs

--- Ghpr.Core.Tests/Core/Extensions/StringExtensionsTests.cs
+++ Ghpr.Core.Tests/Core/Extensions/StringExtensionsTests.cs
@@ -20,6 +20,7 @@
             Directory.Delete(path);
         }

+        [TestCase(null, "d98c1dd4-008f-04b2-e980-0998ecf8427e")]
         [TestCase("value", "60c16320-6e8d-af0b-8024-9c42e2be5804")]
         [TestCase("@#$%^&*", "13f43c69-dfa2-20cc-d646-f6640cc49968")]
         [TestCase("value  -  asdfa - s!", "5148c927-4668-af01-b893-28f44bb86689")]


Got rid of unneeded variable.

Got rid of unneeded variable.

Since I changed it from the gridrow's height to the TreeViewItem's ActualHeight..

--- GongSolutions.Wpf.DragDrop/DropTargetHighlightAdorner.cs
+++ GongSolutions.Wpf.DragDrop/DropTargetHighlightAdorner.cs
@@ -19,11 +19,8 @@

         var tvItem = visualTargetItem as TreeViewItem;
         if (tvItem != null && VisualTreeHelper.GetChildrenCount(tvItem) > 0) {
-          var grid = VisualTreeHelper.GetChild(tvItem, 0) as Grid;
-          if (grid != null) {
-            var descendant = VisualTreeHelper.GetDescendantBounds(tvItem);
-            rect = new Rect(tvItem.TranslatePoint(new Point(), this.AdornedElement), new Size(descendant.Width + 4, tvItem.ActualHeight));
-          }
+          var descendant = VisualTreeHelper.GetDescendantBounds(tvItem);
+          rect = new Rect(tvItem.TranslatePoint(new Point(), this.AdornedElement), new Size(descendant.Width + 4, tvItem.ActualHeight));
         }
         if (rect.IsEmpty) {
           rect = new Rect(visualTargetItem.TranslatePoint(new Point(), this.AdornedElement), VisualTreeHelper.GetDescendantBounds(visualTargetItem).Size);


Delete frmSystemInformation.cs

Delete frmSystemInformation.cs

--- Server/Forms/frmSystemInformation.cs
+++ Server/Forms/frmSystemInformation.cs
@@ -1,63 +0,0 @@
-using System;
-using System.Windows.Forms;
-using xServer.Core;
-
-namespace xServer.Forms
-{
-    public partial class FrmSystemInformation : Form
-    {
-        private readonly Client _connectClient;
-
-        public FrmSystemInformation(Client c)
-        {
-            _connectClient = c;
-            _connectClient.Value.FrmSi = this;
-
-            InitializeComponent();
-        }
-
-        private void FrmSystemInformation_Load(object sender, EventArgs e)
-        {
-            if (_connectClient != null)
-            {
-                this.Text = string.Format("xRAT 2.0 - System Information [{0}:{1}]", _connectClient.EndPoint.Address.ToString(), _connectClient.EndPoint.Port.ToString());
-                new Core.Packets.ServerPackets.GetSystemInfo().Execute(_connectClient);
-
-                if (_connectClient.Value != null)
-                {
-                    ListViewItem lvi = new ListViewItem(new string[] { "Operating System", _connectClient.Value.OperatingSystem });
-                    lstSystem.Items.Add(lvi);
-                    lvi = new ListViewItem(new string[] { "Architecture", (_connectClient.Value.OperatingSystem.Contains("32 Bit")) ? "x86 (32 Bit)" : "x64 (64 Bit)" });
-                    lstSystem.Items.Add(lvi);
-                    lvi = new ListViewItem(new string[] { "", "Getting more information..." });
-                    lstSystem.Items.Add(lvi);
-                }
-            }
-        }
-
-        private void FrmSystemInformation_FormClosing(object sender, FormClosingEventArgs e)
-        {
-            if (_connectClient.Value != null)
-                _connectClient.Value.FrmSi = null;
-        }
-
-        private void ctxtCopy_Click(object sender, EventArgs e)
-        {
-            if (lstSystem.SelectedItems.Count != 0)
-            {
-                string output = string.Empty;
-
-                foreach (ListViewItem lvi in lstSystem.SelectedItems)
-                {
-                    foreach (ListViewItem.ListViewSubItem lvs in lvi.SubItems)
-                        output += lvs.Text + " : ";
-
-                    output = output.Remove(output.Length - 3);
-                    output = output + "\r\n";
-                }
-
-                Clipboard.SetText(output);
-            }
-        }
-    }
-}


Fix issue with rename admin command (#3794)

--- Source/ACE.Database/ShardDatabase.cs
+++ Source/ACE.Database/ShardDatabase.cs
@@ -609,7 +609,7 @@
             var context = new ShardDbContext();

             var result = context.Character
-                .FirstOrDefault(r => r.Name.Equals(name, StringComparison.OrdinalIgnoreCase) && !r.IsDeleted);
+                .FirstOrDefault(r => r.Name == name && !r.IsDeleted);

             return result;
         }


Return a 413 too big status code when the post is too big.

--- Source/Api/Utility/OverageHandler.cs
+++ Source/Api/Utility/OverageHandler.cs
@@ -56,9 +56,9 @@

             bool overLimit = _organizationRepository.IncrementUsage(project.OrganizationId, tooBig);

-            // block large submissions, but return success status code so the client doesn't keep sending them
+            // block large submissions, client should break them up or remove some of the data.
             if (tooBig)
-                return CreateResponse(request, HttpStatusCode.Accepted, "Event submission discarded for being too large.");
+                return CreateResponse(request, HttpStatusCode.RequestEntityTooLarge, "Event submission discarded for being too large.");

             if (overLimit) {
                 _statsClient.Counter(MetricNames.PostsBlocked);


Improve save performance

Improve save performance

--- JeremyAnsel.Media.An8/JeremyAnsel.Media.An8/Tokenizer.cs
+++ JeremyAnsel.Media.An8/JeremyAnsel.Media.An8/Tokenizer.cs
@@ -422,12 +422,7 @@
                 {
                     if (currentIndex != index)
                     {
-                        lines.Add(string.Join(
-                            " ",
-                            tokens
-                            .Skip(currentIndex)
-                            .Take(index - currentIndex)
-                            .Where(t => !BuildTokens.Contains(t, StringComparer.Ordinal))));
+                        lines.Add(JoinTokens(tokens, currentIndex, index));
                     }

                     currentIndex = index + 1;
@@ -436,12 +431,7 @@

             if (currentIndex != tokens.Length)
             {
-                lines.Add(string.Join(
-                    " ",
-                    tokens
-                    .Skip(currentIndex)
-                    .Take(tokens.Length - currentIndex)
-                    .Where(t => !BuildTokens.Contains(t, StringComparer.Ordinal))));
+                lines.Add(JoinTokens(tokens, currentIndex, tokens.Length));
             }

             var sb = new StringBuilder();
@@ -466,6 +456,31 @@
             }

             return sb.ToString();
+        }
+
+        /// <summary>
+        /// Joins tokens into a string.
+        /// </summary>
+        /// <param name="tokens">The tokens.</param>
+        /// <param name="start">The position of the first token.</param>
+        /// <param name="end">The position of the last token.</param>
+        /// <returns>A string with the tokens.</returns>
+        private static string JoinTokens(string[] tokens, int start, int end)
+        {
+            int count = end - start;
+
+            for (int i = 0; i < count; i++)
+            {
+                string t = tokens[start + i];
+
+                if (BuildTokens.Contains(t, StringComparer.Ordinal))
+                {
+                    count = i;
+                    break;
+                }
+            }
+
+            return string.Join(" ", tokens, start, count);
         }

         /// <summary>


[Core] Allow GetDeviceExtensionProperties without layer name

--- Source/SharpVulkan/PhysicalDevice.cs
+++ Source/SharpVulkan/PhysicalDevice.cs
@@ -18,6 +18,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.

+using System;
 using System.Runtime.InteropServices;

 namespace SharpVulkan
@@ -42,9 +43,9 @@
             }
         }

-        public unsafe ExtensionProperties[] GetDeviceExtensionProperties(string layerName)
+        public unsafe ExtensionProperties[] GetDeviceExtensionProperties(string layerName = null)
         {
-            var nativeString = Marshal.StringToHGlobalAnsi(layerName);
+            var nativeString = layerName != null ? Marshal.StringToHGlobalAnsi(layerName) : IntPtr.Zero;
             try
             {
                 uint count = 0;


Now also enabled Inventory persistence in standalone mode when account Authentication is turned off.

--- OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -47,6 +47,10 @@
                 this.m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);

                 profile = this.m_userManager.getUserProfile(firstname, lastname);
+                if (profile != null)
+                {
+                    m_Parent.InvenServices.CreateNewUserInventory(profile.UUID);
+                }

                 return profile;
             }


Minor improvement of previous patch.

Minor improvement of previous patch.

--- OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
+++ OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
@@ -134,11 +134,13 @@
                 int ch, string[] buttonlabels)
         {
             string username = m_scene.UserManagementModule.GetUserName(ownerID);
-            string ownerFirstName, ownerLastName;
+            string ownerFirstName, ownerLastName = String.Empty;
             if (!String.IsNullOrEmpty(username))
             {
-                ownerFirstName = username.Split(' ')[0];
-                ownerLastName = username.Split(' ')[1];
+                string[] parts = username.Split(' ');
+                ownerFirstName = parts[0];
+                if (parts.Length > 1)
+                    ownerLastName = username.Split(' ')[1];
             }
             else
             {
@@ -172,11 +174,13 @@
                 int chatChannel, string name, UUID objectid, UUID ownerID)
         {
             string username = m_scene.UserManagementModule.GetUserName(ownerID);
-            string ownerFirstName, ownerLastName;
+            string ownerFirstName, ownerLastName = String.Empty;
             if (!String.IsNullOrEmpty(username))
             {
-                ownerFirstName = username.Split(' ')[0];
-                ownerLastName = username.Split(' ')[1];
+                string[] parts = username.Split(' ');
+                ownerFirstName = parts[0];
+                if (parts.Length > 1)
+                    ownerLastName = username.Split(' ')[1];
             }
             else
             {


Comment out unused variables, ought to deal with mesh uploading.

--- OpenSim/Services/CapsService/CAPModules/InventoryCAPS.cs
+++ OpenSim/Services/CapsService/CAPModules/InventoryCAPS.cs
@@ -382,8 +382,8 @@
                     asset_type == "object")
                 {
                     OSDMap meshMap = (OSDMap)map["asset_resources"];
-                    OSDArray instance_list = (OSDArray)meshMap["instance_list"];
-                    OSDArray mesh_list = (OSDArray)meshMap["mesh_list"];
+                    //OSDArray instance_list = (OSDArray)meshMap["instance_list"];
+                    //OSDArray mesh_list = (OSDArray)meshMap["mesh_list"];
                     OSDArray texture_list = (OSDArray)meshMap["texture_list"];
                     charge = texture_list.Count * mm.UploadCharge +
                         meshMap.Count * mm.UploadCharge;


Exercised the selection of generic methods in non-generic types using LINQ syntax.

--- Src/Albedo.UnitTests/MethodsTests.cs
+++ Src/Albedo.UnitTests/MethodsTests.cs
@@ -100,6 +100,20 @@
                     .GetMethod("OmitParametersGeneric")
                     .MakeGenericMethod(typeof(T));
             Assert.Equal(expected, actual);
+        }
+
+        [Fact]
+        public void QueryParameterLessGenericMethodUsingLinqSyntax()
+        {
+            var sut = new Methods<ClassWithMethods>();
+
+            var actual = from x in sut select x.OmitParametersGeneric<T>();
+
+            var expected =
+                typeof(ClassWithMethods)
+                    .GetMethod("OmitParametersGeneric")
+                    .MakeGenericMethod(typeof(T));
+            Assert.Equal(expected, actual);
         }

         private class ClassWithMethods


Added XML documentation for ValueCollectingVisitor

.Visit(AssemblyElement).

--- Src/Albedo/ValueCollectingVisitor.cs
+++ Src/Albedo/ValueCollectingVisitor.cs
@@ -48,6 +48,19 @@
             get { return this.target; }
         }

+        /// <summary>Visits the specified assembly element.</summary>
+        /// <param name="assemblyElement">The assembly element.</param>
+        /// <returns>Always throws.</returns>
+        /// <exception cref="System.NotSupportedException">
+        /// Collecting values from an entire assembly is not supported.
+        /// ValueCollectingVisitor collect values from a single object (the
+        /// 'target'), and the values collected must correspond to fields or
+        /// properties on that object. Attempting to collect values from an
+        /// entire Assembly is meaningless, because an Assembly normally
+        /// defines more than a single type. In the rare case where you have an
+        /// assembly with only a single type, use the Visit(TypeElement)
+        /// overload instead.
+        /// </exception>
         public override IReflectionVisitor<IEnumerable<object>> Visit(
             AssemblyElement assemblyElement)
         {


Enable ETW logging for eta tests.

Enable ETW logging for eta tests.

Since some of our recent ETA failures have not been diagnosable from looking at crashdumps alone, I'm enabling a circular buffer for our Logging instrumentation (the using (Logger.LogBlock.... statements).  This will place a TaoEvents.etl file beside Tao.exe which can be used to see the last events leading up to a crash or hang.  Note that for an in-process logging buffer to work, RoslynEventSource has to be initialized before TraceEventNativeMethods.EnableTraceEx2 can be called. (changeset 1283444)

--- Src/Workspaces/Core/Log/EtwLogger.cs
+++ Src/Workspaces/Core/Log/EtwLogger.cs
@@ -15,6 +15,7 @@
     {
         public static readonly EtwLogger Instance = new EtwLogger();
         private readonly Func<FeatureId, FunctionId, bool> loggingChecker;
+        private readonly RoslynEventSource source = RoslynEventSource.Instance;

         // Use an object pool since we may be logging up to 1-10k events/second
         private readonly ObjectPool<RoslynEtwLogBlock> etwBlocksPool;
@@ -41,18 +42,18 @@

         public bool IsEnabled(FeatureId featureId, FunctionId functionId)
         {
-            return RoslynEventSource.Instance.IsEnabled() && (this.loggingChecker == null || this.loggingChecker(featureId, functionId));
+            return source.IsEnabled() && (this.loggingChecker == null || this.loggingChecker(featureId, functionId));
         }

         public bool IsVerbose()
         {
             // "-1" makes this to work with any keyword
-            return RoslynEventSource.Instance.IsEnabled(EventLevel.Verbose, (EventKeywords)(-1));
+            return source.IsEnabled(EventLevel.Verbose, (EventKeywords)(-1));
         }

         public void Log(FeatureId featureId, FunctionId functionId, string message)
         {
-            RoslynEventSource.Instance.Log(message, featureId, functionId);
+            source.Log(message, featureId, functionId);
         }

         public IDisposable LogBlock(FeatureId featureId, FunctionId functionId, string message, int blockId, CancellationToken cancellationToken)


modify: TokenTest.csの命名規則に関する修正

modify: TokenTest.csの命名規則に関する修正

* 定数の頭文字を大文字に変更

--- UnitTest/TokenTest.cs
+++ UnitTest/TokenTest.cs
@@ -8,12 +8,12 @@
     [TestClass]
     public class TokenTest
     {
-        const string name = "dummyName";
-        const string nameShort = "n";
-        const string regex = "dummyRegex";
-        const string source = "dummyText";
-        const int index = 2;
-        const int length = 3;
+        const string Name = "dummyName";
+        const string NameShort = "n";
+        const string Regex = "dummyRegex";
+        const string Source = "dummyText";
+        const int Index = 2;
+        const int Length = 3;
         static CharPosition position;
         static RegexTokenEntry entry, entryShort;

@@ -21,56 +21,56 @@
         public static void ClassInitialize(TestContext context)
         {
             position = new CharPosition(1, 3);
-            entry = new RegexTokenEntry(name, regex);
-            entryShort = new RegexTokenEntry(nameShort, regex);
+            entry = new RegexTokenEntry(Name, Regex);
+            entryShort = new RegexTokenEntry(NameShort, Regex);
         }

         [TestMethod]
         public void LengthTest()
         {
-            Token token = new Token(entry, string.Empty, source, index, length);
-            Assert.AreEqual(length, token.Length);
+            Token token = new Token(entry, string.Empty, Source, Index, Length);
+            Assert.AreEqual(Length, token.Length);
         }

         [TestMethod]
         public void EntryTest()
         {
-            Token token = new Token(entry, string.Empty, source, index, length);
+            Token token = new Token(entry, string.Empty, Source, Index, Length);
             Assert.AreEqual(entry, token.Entry);
         }

         [TestMethod]
         public void TextTest()
         {
-            Token token = new Token(entry, string.Empty, source, index, length);
+            Token token = new Token(entry, string.Empty, Source, Index, Length);
             Assert.AreEqual("mmy", token.Text);
         }

         [TestMethod]
         public void TextTest2()
         {
-            Token token = new Token(entry, string.Empty, source, index, 0);
+            Token token = new Token(entry, string.Empty, Source, Index, 0);
             Assert.AreEqual(string.Empty, token.Text);
         }

         [TestMethod]
         public void IndexTest()
         {
-            Token token = new Token(entry, string.Empty, source, index, length);
-            Assert.AreEqual(index, token.Index);
+            Token token = new Token(entry, string.Empty, Source, Index, Length);
+            Assert.AreEqual(Index, token.Index);
         }

         [TestMethod]
         public void PositionTest()
         {
-            Token token = new Token(entry, string.Empty, source, index, length);
+            Token token = new Token(entry, string.Empty, Source, Index, Length);
             Assert.AreEqual(position, token.CodePosition.CharPosition);
         }

         [TestMethod]
         public void PositionTest2()
         {
-            Token token = new Token(entry, string.Empty, source, source.Length, 0);
+            Token token = new Token(entry, string.Empty, Source, Source.Length, 0);
             Assert.AreEqual(new CharPosition(1, 10), token.CodePosition.CharPosition);
         }

@@ -84,7 +84,7 @@
         [TestMethod]
         public void ToStringTest()
         {
-            Token token = new Token(entry, string.Empty, source, index, length);
+            Token token = new Token(entry, string.Empty, Source, Index, Length);
             string tokenString = token.ToString();

             Assert.IsTrue(tokenString.Contains(position.Line.ToString()));
@@ -96,7 +96,7 @@
         [TestMethod]
         public void ToStringTestShort()
         {
-            Token token = new Token(entryShort, string.Empty, source, index, length);
+            Token token = new Token(entryShort, string.Empty, Source, Index, Length);
             string tokenString = token.ToString();

             Assert.IsTrue(tokenString.Contains(position.Line.ToString()));
@@ -108,21 +108,21 @@
         [ExpectedException(typeof(ArgumentOutOfRangeException))]
         public void ConstructorError1()
         {
-            Token token = new Token(entry, string.Empty, source, source.Length, 1);
+            Token token = new Token(entry, string.Empty, Source, Source.Length, 1);
         }

         [TestMethod]
         [ExpectedException(typeof(ArgumentNullException))]
         public void ConstructorError2()
         {
-            Token token = new Token(null, string.Empty, source, 0, 1);
+            Token token = new Token(null, string.Empty, Source, 0, 1);
         }

         [TestMethod]
         [ExpectedException(typeof(ArgumentNullException))]
         public void ConstructorError3()
         {
-            Token token = new Token(entry, null, source, 0, 1);
+            Token token = new Token(entry, null, Source, 0, 1);
         }

         [TestMethod]
@@ -136,21 +136,21 @@
         [ExpectedException(typeof(ArgumentOutOfRangeException))]
         public void ConstructorError5()
         {
-            Token token = new Token(entry, string.Empty, source, -1, 1);
+            Token token = new Token(entry, string.Empty, Source, -1, 1);
         }

         [TestMethod]
         [ExpectedException(typeof(ArgumentOutOfRangeException))]
         public void ConstructorError6()
         {
-            Token token = new Token(entry, string.Empty, source, source.Length + 1, -1);
+            Token token = new Token(entry, string.Empty, Source, Source.Length + 1, -1);
         }

         [TestMethod]
         [ExpectedException(typeof(ArgumentOutOfRangeException))]
         public void ConstructorError7()
         {
-            Token token = new Token(entry, string.Empty, source, 0, -1);
+            Token token = new Token(entry, string.Empty, Source, 0, -1);
         }
     }
 }


Fix SearchSource editing when action keyword is not changed (#856)

* Fixed SearchSource edit

* Remove temp var

--- Plugins/Wox.Plugin.WebSearch/SearchSourceSetting.xaml.cs
+++ Plugins/Wox.Plugin.WebSearch/SearchSourceSetting.xaml.cs
@@ -96,11 +96,10 @@

         private void EditSearchSource()
         {
-            var keyword = _searchSource.ActionKeyword;
-            if (!PluginManager.ActionKeywordRegistered(keyword))
+            var newKeyword = _searchSource.ActionKeyword;
+            var oldKeyword = _oldSearchSource.ActionKeyword;
+            if (!PluginManager.ActionKeywordRegistered(newKeyword) || oldKeyword == newKeyword)
             {
-                var newKeyword = keyword;
-                var oldKeyword = _oldSearchSource.ActionKeyword;
                 var id = _context.CurrentPluginMetadata.ID;
                 PluginManager.ReplaceActionKeyword(id, oldKeyword, newKeyword);


Disable code that moves remaining lines at the end (in sub-to-sub align)

--- UtilsAlignSubToSub.cs
+++ UtilsAlignSubToSub.cs
@@ -83,13 +83,13 @@
 			// This queue will process all these slices that have some elements in them.
 			while(queue.Count > 0) {
 				RemainingSlice slice = queue.Dequeue();
-				if(slice.listToChangeLines.Count == 0 || slice.referenceListLines.Count == 0) {
-					// TODO: these shouldn't just be moved out of the way but left in another slice
-					// this is more debug code than anything else
-					UtilsSubtitle.ShiftByTime(slice.listToChangeLines, 10000);
-					UtilsSubtitle.ShiftByTime(slice.referenceListLines, 10000);
-					continue;
-				}
+				//if(slice.listToChangeLines.Count == 0 || slice.referenceListLines.Count == 0) {
+				//	// T O D O: these shouldn't just be moved out of the way but left in another slice
+				//	// this is more debug code than anything else
+				//	UtilsSubtitle.ShiftByTime(slice.listToChangeLines, 10000);
+				//	UtilsSubtitle.ShiftByTime(slice.referenceListLines, 10000);
+				//	continue;
+				//}

 				double bestOffset = FindBestOffset(slice);
 				ApplyOffset(slice, bestOffset, queue);
@@ -272,12 +272,12 @@

 			// left slice
 			newSlice = GetSubSlice(biMatchedLinesList, 0, bestRowStart);
-			UtilsSubtitle.ShiftByTime(newSlice.listToChangeLines, -offset);
+			//UtilsSubtitle.ShiftByTime(newSlice.listToChangeLines, -offset); // by disabling this code, remaining slices are now embedded in greater slices
 			queue.Enqueue(newSlice);

 			// right slice
 			newSlice = GetSubSlice(biMatchedLinesList, bestRowStart + maxNumGoodMatched + 1, biMatchedLinesList.Count);
-			UtilsSubtitle.ShiftByTime(newSlice.listToChangeLines, -offset);
+			//UtilsSubtitle.ShiftByTime(newSlice.listToChangeLines, -offset);
 			queue.Enqueue(newSlice);
 		}


Make the default of the autogenerated name be without the 1.

--- StructuredXmlEditor/Data/FileItem.cs
+++ StructuredXmlEditor/Data/FileItem.cs
@@ -222,26 +222,41 @@
 			var fdef = Definition as FileDefinition;
 			if (string.IsNullOrWhiteSpace(Value))
 			{
-				int index = 1;
 				var baseName = Path.GetFileNameWithoutExtension(DataModel.Document.Path) + Name;
-				while (true)
-				{
-					var name = baseName + index + "." + fdef.AllowedFileTypes.First();
-					if (!File.Exists(name))
-					{
-						if (fdef.StripExtension)
-						{
-							Value = baseName + index;
-						}
-						else
-						{
-							Value = name;
-						}
-
-						break;
-					}
-
-					index++;
+				var name = baseName + "." + fdef.AllowedFileTypes.First();
+				if (!File.Exists(name))
+				{
+					if (fdef.StripExtension)
+					{
+						Value = baseName;
+					}
+					else
+					{
+						Value = name;
+					}
+				}
+				else
+				{
+					int index = 2;
+					while (true)
+					{
+						name = baseName + index + "." + fdef.AllowedFileTypes.First();
+						if (!File.Exists(name))
+						{
+							if (fdef.StripExtension)
+							{
+								Value = baseName + index;
+							}
+							else
+							{
+								Value = name;
+							}
+
+							break;
+						}
+
+						index++;
+					}
 				}
 			}
 			else if (File.Exists(FullPath))


ソースコードを整理．

ソースコードを整理．

--- SweetMutusData/SweetMutusDocument.cs
+++ SweetMutusData/SweetMutusDocument.cs
@@ -76,19 +76,41 @@
 			if (operationCache != null)
 			{
 				this.AddOperationHistory(operationCache);
-				if (operationCache is QuestionCategoryChangedCache)
-				{
-					this.QuestionCategoryChanged(this, EventArgs.Empty);
-				}
 				// ★ここに書くと，Undoのときにイベントが発生しないのでは...
-				if (operationCache is QuestionNoChangedCache)
-				{
-					this.QuestionNoChanged(this, EventArgs.Empty);
-				}
-			}
-		}
-		#endregion
-
+				// →実際，発生しないので，その場合はSweetMutusDocument_UndoCompletedから同じ処理を呼び出す．
+				NotifyOperation(operationCache);
+			}
+		}
+		#endregion
+
+		// (0.2.3)
+		protected void NotifyOperation(IOperationCache operationCache)
+		{
+			if (operationCache is QuestionCategoryChangedCache)
+			{
+				this.QuestionCategoryChanged(this, EventArgs.Empty);
+			}
+			if (operationCache is QuestionNoChangedCache)
+			{
+				this.QuestionNoChanged(this, EventArgs.Empty);
+			}
+		}
+
+		/// <summary>
+		/// 問題のカテゴリ変更があったときに発生します。
+		/// </summary>
+		public event EventHandler QuestionCategoryChanged = delegate { };
+
+		/// <summary>
+		/// 問題のNo変更があったときに発生します。
+		/// </summary>
+		public event EventHandler QuestionNoChanged = delegate { };
+
+		// (0.2.3)
+		private void SweetMutusDocument_UndoCompleted(object sender, UndoCompletedEventArgs e)
+		{
+			NotifyOperation(e.OperationCache);
+		}

 		#region 曲関連

@@ -318,29 +340,6 @@
 			this.AddOperationHistory(new RootDirectoryChangedCache(this.Questions, e.PreviousValue, e.CurrentValue));
 		}
 		#endregion
-
-		/// <summary>
-		/// 問題のカテゴリ変更があったときに発生します。
-		/// </summary>
-		public event EventHandler QuestionCategoryChanged = delegate { };
-
-		/// <summary>
-		/// 問題のNo変更があったときに発生します。
-		/// </summary>
-		public event EventHandler QuestionNoChanged = delegate { };
-
-		// (0.2.3)
-		private void SweetMutusDocument_UndoCompleted(object sender, UndoCompletedEventArgs e)
-		{
-			if (e.OperationCache is QuestionNoChangedCache)
-			{
-				this.QuestionNoChanged(this, EventArgs.Empty);
-			}
-			else if (e.OperationCache is QuestionCategoryChangedCache)
-			{
-				this.QuestionCategoryChanged(this, EventArgs.Empty);
-			}
-		}

 		#endregion


Updated tests to reflect db changes

Updated tests to reflect db changes

--- Purchasing.Tests/RepositoryTests/OrderRepositoryTests.cs
+++ Purchasing.Tests/RepositoryTests/OrderRepositoryTests.cs
@@ -1511,6 +1511,73 @@
         }
         #endregion ShippingAmount Tests

+
+        #region FreightAmount Tests
+
+        [TestMethod]
+        public void TestFreightAmountWithZeroUnitPriceSaves()
+        {
+            #region Arrange
+            var record = GetValid(9);
+            record.FreightAmount = 0;
+            #endregion Arrange
+
+            #region Act
+            OrderRepository.DbContext.BeginTransaction();
+            OrderRepository.EnsurePersistent(record);
+            OrderRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(0, record.FreightAmount);
+            Assert.IsFalse(record.IsTransient());
+            Assert.IsTrue(record.IsValid());
+            #endregion Assert
+        }
+
+        [TestMethod]
+        public void TestFreightAmountWithUnitPriceSaves1()
+        {
+            #region Arrange
+            var record = GetValid(9);
+            record.FreightAmount = 0.001m;
+            #endregion Arrange
+
+            #region Act
+            OrderRepository.DbContext.BeginTransaction();
+            OrderRepository.EnsurePersistent(record);
+            OrderRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(0.001m, record.FreightAmount);
+            Assert.IsFalse(record.IsTransient());
+            Assert.IsTrue(record.IsValid());
+            #endregion Assert
+        }
+
+        [TestMethod]
+        public void TestFreightAmountWithUnitPriceSaves2()
+        {
+            #region Arrange
+            var record = GetValid(9);
+            record.FreightAmount = 999999999.999m;
+            #endregion Arrange
+
+            #region Act
+            OrderRepository.DbContext.BeginTransaction();
+            OrderRepository.EnsurePersistent(record);
+            OrderRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(999999999.999m, record.FreightAmount);
+            Assert.IsFalse(record.IsTransient());
+            Assert.IsTrue(record.IsValid());
+            #endregion Assert
+        }
+        #endregion FreightAmount Tests
+
         #region Justification Tests
         #region Invalid Tests

@@ -5812,6 +5879,173 @@
             #endregion Assert
         }
         #endregion TotalFromDb Tests
+
+        #region CompletionReason Tests
+
+        #region Valid Tests
+
+        /// <summary>
+        /// Tests the CompletionReason with null value saves.
+        /// </summary>
+        [TestMethod]
+        public void TestCompletionReasonWithNullValueSaves()
+        {
+            #region Arrange
+            var order = GetValid(9);
+            order.CompletionReason = null;
+            #endregion Arrange
+
+            #region Act
+            OrderRepository.DbContext.BeginTransaction();
+            OrderRepository.EnsurePersistent(order);
+            OrderRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.IsFalse(order.IsTransient());
+            Assert.IsTrue(order.IsValid());
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Tests the CompletionReason with empty string saves.
+        /// </summary>
+        [TestMethod]
+        public void TestCompletionReasonWithEmptyStringSaves()
+        {
+            #region Arrange
+            var order = GetValid(9);
+            order.CompletionReason = string.Empty;
+            #endregion Arrange
+
+            #region Act
+            OrderRepository.DbContext.BeginTransaction();
+            OrderRepository.EnsurePersistent(order);
+            OrderRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.IsFalse(order.IsTransient());
+            Assert.IsTrue(order.IsValid());
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Tests the CompletionReason with one space saves.
+        /// </summary>
+        [TestMethod]
+        public void TestCompletionReasonWithOneSpaceSaves()
+        {
+            #region Arrange
+            var order = GetValid(9);
+            order.CompletionReason = " ";
+            #endregion Arrange
+
+            #region Act
+            OrderRepository.DbContext.BeginTransaction();
+            OrderRepository.EnsurePersistent(order);
+            OrderRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.IsFalse(order.IsTransient());
+            Assert.IsTrue(order.IsValid());
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Tests the CompletionReason with one character saves.
+        /// </summary>
+        [TestMethod]
+        public void TestCompletionReasonWithOneCharacterSaves()
+        {
+            #region Arrange
+            var order = GetValid(9);
+            order.CompletionReason = "x";
+            #endregion Arrange
+
+            #region Act
+            OrderRepository.DbContext.BeginTransaction();
+            OrderRepository.EnsurePersistent(order);
+            OrderRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.IsFalse(order.IsTransient());
+            Assert.IsTrue(order.IsValid());
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Tests the CompletionReason with long value saves.
+        /// </summary>
+        [TestMethod]
+        public void TestCompletionReasonWithLongValueSaves()
+        {
+            #region Arrange
+            var order = GetValid(9);
+            order.CompletionReason = "x".RepeatTimes(999);
+            #endregion Arrange
+
+            #region Act
+            OrderRepository.DbContext.BeginTransaction();
+            OrderRepository.EnsurePersistent(order);
+            OrderRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(999, order.CompletionReason.Length);
+            Assert.IsFalse(order.IsTransient());
+            Assert.IsTrue(order.IsValid());
+            #endregion Assert
+        }
+
+        #endregion Valid Tests
+        #endregion CompletionReason Tests
+
+        #region GrandTotalFromDb Tests
+
+
+        [TestMethod]
+        public void TestGrandTotalFromDbReturnsExpectedvalue()
+        {
+            #region Arrange
+            var order = GetValid(9);
+            order.LineItems = new List<LineItem>();
+            order.LineItems.Add(CreateValidEntities.LineItem(1));
+            order.LineItems.Add(CreateValidEntities.LineItem(2));
+            order.LineItems.Add(CreateValidEntities.LineItem(3));
+            order.LineItems[0].Quantity = 1;
+            order.LineItems[0].UnitPrice = 10;
+            order.LineItems[1].Quantity = 2;
+            order.LineItems[1].UnitPrice = 0.1m;
+            order.LineItems[2].Quantity = 3;
+            order.LineItems[2].UnitPrice = 0.01m;
+            order.LineItems[0].Order = order;
+            order.LineItems[1].Order = order;
+            order.LineItems[2].Order = order;
+            order.FreightAmount = 100;
+            order.EstimatedTax = 15;
+            order.ShippingAmount = 1000;
+            var total = order.Total();
+            order.TotalFromDb = total;
+            #endregion Arrange
+
+            #region Act
+            OrderRepository.DbContext.BeginTransaction();
+            OrderRepository.EnsurePersistent(order);
+            OrderRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(10.23m, total);
+            Assert.AreEqual(1126.7645m, order.GrandTotal());
+            #endregion Assert
+        }
+
+
+        #endregion GrandTotalFromDb Tests
+

         #region Constructor Tests

@@ -5873,11 +6107,13 @@
             expectedFields.Add(new NameAndType("Approvals", "System.Collections.Generic.IList`1[Purchasing.Core.Domain.Approval]", new List<string>()));
             expectedFields.Add(new NameAndType("ApproverName", "System.String", new List<string>()));
             expectedFields.Add(new NameAndType("Attachments", "System.Collections.Generic.IList`1[Purchasing.Core.Domain.Attachment]", new List<string>()));
+            expectedFields.Add(new NameAndType("CompletionReason", "System.String", new List<string>()));
             expectedFields.Add(new NameAndType("ControlledSubstances", "System.Collections.Generic.IList`1[Purchasing.Core.Domain.ControlledSubstanceInformation]", new List<string>()));
             expectedFields.Add(new NameAndType("CreatedBy", "Purchasing.Core.Domain.User", new List<string>
             {
                  "[System.ComponentModel.DataAnnotations.RequiredAttribute()]"
             }));
+            expectedFields.Add(new NameAndType("CustomFieldAnswers", "System.Collections.Generic.IList`1[Purchasing.Core.Domain.CustomFieldAnswer]", new List<string>()));
             expectedFields.Add(new NameAndType("DateCreated", "System.DateTime", new List<string>()));
             expectedFields.Add(new NameAndType("DateNeeded", "System.Nullable`1[System.DateTime]", new List<string>()));
             expectedFields.Add(new NameAndType("DateOrdered", "System.Nullable`1[System.DateTime]", new List<string>()));
@@ -5894,6 +6130,8 @@
             }));
             expectedFields.Add(new NameAndType("EmailQueues", "System.Collections.Generic.IList`1[Purchasing.Core.Domain.EmailQueue]", new List<string>()));
             expectedFields.Add(new NameAndType("EstimatedTax", "System.Decimal", new List<string>()));
+            expectedFields.Add(new NameAndType("FreightAmount", "System.Decimal", new List<string>()));
+            expectedFields.Add(new NameAndType("GrandTotalFromDb", "System.Decimal", new List<string>()));
             expectedFields.Add(new NameAndType("HasControlledSubstance", "System.Boolean", new List<string>()));
             expectedFields.Add(new NameAndType("HasLineSplits", "System.Boolean", new List<string>()));
             expectedFields.Add(new NameAndType("Id", "System.Int32", new List<string>


Reuse the SyncOMatic instance

Reuse the SyncOMatic instance

This leverages the local on-disk blob store and the various caches.
By minimizing the number of requests to the GH api, this makes the test run about 20% faster.

--- SyncOMatic.Core.Tests/SyncFixture.cs
+++ SyncOMatic.Core.Tests/SyncFixture.cs
@@ -8,10 +8,18 @@
     [TestFixture]
     public class SyncFixture
     {
-        [TestCase("ServiceMatrix","develop","src",null,null)]
-        [TestCase("NServiceBus", "develop", "src", null, null)]
-        [TestCase("ServiceInsight", "develop", "src", null, null)]
-        public void PerformRepoSync(string repoName, string defaultBranch, string srcRoot, string solutionName, List<SyncItem> itemsToSync)
+        [Test]
+        public void Sync()
+        {
+            using (var som = new SyncOMatic(Helper.Credentials, Helper.Proxy, DiffFixture.ConsoleLogger))
+            {
+                PerformRepoSync(som, "ServiceMatrix", "develop", "src", null, null);
+                PerformRepoSync(som, "NServiceBus", "develop", "src", null, null);
+                PerformRepoSync(som, "ServiceInsight", "develop", "src", null, null);
+            }
+        }
+
+        void PerformRepoSync(SyncOMatic som, string repoName, string defaultBranch, string srcRoot, string solutionName, List<SyncItem> itemsToSync)
         {
             if (itemsToSync == null)
             {
@@ -31,27 +39,20 @@
                 SrcRoot = srcRoot
             };

+            var diff = som.Diff(toSync.GetMapper(itemsToSync));
+            Assert.NotNull(diff);
+
+            var createdSyncBranch = som.Sync(diff, SyncOutput.CreateBranch).FirstOrDefault();

-            using (var som = new SyncOMatic(Helper.Credentials, Helper.Proxy, DiffFixture.ConsoleLogger))
+            if (string.IsNullOrEmpty(createdSyncBranch))
             {
-                var diff = som.Diff(toSync.GetMapper(itemsToSync));
-                Assert.NotNull(diff);
-
-                var createdSyncBranch = som.Sync(diff, SyncOutput.CreateBranch).FirstOrDefault();
-
-
-                if (string.IsNullOrEmpty(createdSyncBranch))
-                {
-                    Console.Out.WriteLine("Repo {0} is in sync",repoName);
-                }
-                else
-                {
-                    Console.Out.WriteLine("Sync branch created for {0}, please click here to create a pull: {1}", repoName, createdSyncBranch);
-                }
+                Console.Out.WriteLine("Repo {0} is in sync",repoName);
+            }
+            else
+            {
+                Console.Out.WriteLine("Sync branch created for {0}, please click here to create a pull: {1}", repoName, createdSyncBranch);
             }
         }
-
-
     }
 }


Updated split account templates to use tooltips with account names

--- Purchasing.Web/Views/Order/_AccountSelectTemplate.cshtml
+++ Purchasing.Web/Views/Order/_AccountSelectTemplate.cshtml
@@ -3,10 +3,10 @@
 <script id="accounts-select-template" type="text/x-jquery-tmpl">
     <div class="account-container">
         <select class="account-number" id="splitAccount" name="splits[${index}].Account">
-            <option value="">--Account--</option>
+            <option value="" title="No Account Selected">--Account--</option>
             @foreach (Account account in Model)
             {
-                <option>@account.Id</option>
+                <option title="@account.Name">@account.Id</option>
             }
         </select>
         <select name="splits[${index}].SubAccount" class="account-subaccount" disabled="disabled"><option value>--Sub Account--</option></select>


Adds capability to cut corners (or not)

Adds capability to cut corners (or not)

--- PurpleKingdomGamesCore/Core/Pathfinding/Seekers/AStar.cs
+++ PurpleKingdomGamesCore/Core/Pathfinding/Seekers/AStar.cs
@@ -93,21 +93,24 @@
             while (openNodes.Count > 0) {
                 currentNode = openNodes.Remove();

-                // If we have a maximum climb, then make sure that the current node hasn't climbed too high
-                if (maxClimb != 0 && getAscentDistance(currentNode, grid) > maxClimb) {
-                    break;
-                }
-
-                // If we have a maximum climb, then make sure that the current node hasn't fallen too far
-                if (maxDescent != 0 && getDescentDistance(currentNode, grid) > maxDescent) {
-                    break;
-                }
-
-                closedNodes.Add(currentNode.ReferenceNode);
+                // If we have reached the target node then break from the loop
                 if (currentNode.GridPosition == target) {
                     targetNode = currentNode;
                     break;
                 }
+
+                // If we have a maximum climb, then make sure that the current node hasn't climbed too high
+                if (maxClimb != 0 && getAscentDistance(currentNode, grid) > maxClimb) {
+                    continue;
+                }
+
+                // If we have a maximum climb, then make sure that the current node hasn't fallen too far
+                if (maxDescent != 0 && getDescentDistance(currentNode, grid) > maxDescent) {
+                    continue;
+                }
+
+                // Add the current node to the closed list
+                closedNodes.Add(currentNode.ReferenceNode);

                 Point2D currentGridPos = currentNode.GridPosition;

@@ -137,6 +140,25 @@
                             node.GridPosition.X != currentGridPos.X &&
                             node.GridPosition.Y != currentGridPos.Y
                         );
+
+                        // If we're not meant to cut corners, tehn we need to check this now
+                        if (isDiagonal && !cutCorners) {
+                            // If we are further down the grid, then check the square
+                            // above to make sure it's also passable
+                            if (refNode.GridPosition.Y > 0 && refNode.GridPosition.Y > currentGridPos.Y) {
+                                if (!grid[(int) refNode.GridPosition.X, (int) (refNode.GridPosition.Y - 1)].Passable) {
+                                    continue;
+                                }
+                            }
+
+                            // If we are further up the grid, then check the square
+                            // below to make sure it's also passable
+                            if (refNode.GridPosition.Y < maxY && refNode.GridPosition.Y < currentGridPos.Y) {
+                                if (!grid[(int) refNode.GridPosition.X, (int) (refNode.GridPosition.Y + 1)].Passable) {
+                                    continue;
+                                }
+                            }
+                        }

                         // Is this node on the open list already?
                         if (refNode == null) {


added comments

added comments

--- Reusable.SmartConfig.Core/TehCodez/FirstSettingFinder.cs
+++ Reusable.SmartConfig.Core/TehCodez/FirstSettingFinder.cs
@@ -8,6 +8,9 @@

 namespace Reusable.SmartConfig
 {
+    /// <summary>
+    /// The same setting can be defined in multiple data-stores. This setting-finder picks the first setting it finds.
+    /// </summary>
     public class FirstSettingFinder : ISettingFinder
     {
         public bool TryFindSetting(


Add  NULL check for GetResources

Add  NULL check for GetResources

--- SS.Integration.Adapter/UdapiClient/UdapiServiceFacade.cs
+++ SS.Integration.Adapter/UdapiClient/UdapiServiceFacade.cs
@@ -85,7 +85,16 @@
         public List<IResourceFacade> GetResources(string featureName)
         {
             if (_service == null)
+            {
+                _logger.Warn($"Method=GetResources Service=null");
                 return null;
+            }
+
+            if (_settings == null)
+            {
+                _logger.Warn($"Method=GetResources Settings=null");
+                return null;
+            }

             var resourceFacade = new List<IResourceFacade>();

@@ -94,7 +103,18 @@
             if (udapiFeature != null)
             {
                 var udapiResources = udapiFeature.GetResources();
-                resourceFacade.AddRange(udapiResources.Select(udapiResource => new UdapiResourceFacade(udapiResource, featureName, _reconnectStrategy, _settings.EchoDelay, _settings.EchoInterval)));
+                if (udapiResources == null)
+                {
+                    _logger.Warn($"Method=GetResources udapiResources=null");
+                    return null;
+                }
+
+                var resourcesToAdd = udapiResources.Select(udapiResource => new UdapiResourceFacade(udapiResource,
+                    featureName, _reconnectStrategy, _settings.EchoDelay, _settings.EchoInterval)).ToList();
+
+                _logger.Debug($"Method=GetResources FeatureName={featureName} ResourcesCount={resourcesToAdd.Count}");
+
+                resourceFacade.AddRange(resourcesToAdd);
             }

             return resourceFacade;


add ProcessRunnerLogic.OnFinally

add ProcessRunnerLogic.OnFinally

--- Signum.Engine.Extensions/Processes/ProcessRunnerLogic.cs
+++ Signum.Engine.Extensions/Processes/ProcessRunnerLogic.cs
@@ -25,6 +25,8 @@
 {
     public static class ProcessRunnerLogic
     {
+        public static Action<ExecutingProcess> OnFinally;
+
         static Dictionary<Lite<ProcessEntity>, ExecutingProcess> executing = new Dictionary<Lite<ProcessEntity>, ExecutingProcess>();

         static Timer timerNextExecution;
@@ -464,7 +466,7 @@
                 tr.Commit();
             }
         }
-
+
         public void Execute()
         {
             var user = ExecutionMode.Global().Using(_ => CurrentProcess.User.Retrieve());
@@ -507,6 +509,10 @@
                         using (OperationLogic.AllowSave<ProcessEntity>())
                             CurrentProcess.Save();
                     }
+                    finally
+                    {
+                        ProcessRunnerLogic.OnFinally?.Invoke(this);
+                    }
                 }
             }
         }


lock ChartScriptParameter

lock ChartScriptParameter

--- Signum.Entities.Extensions/Chart/ChartScriptParameter.cs
+++ Signum.Entities.Extensions/Chart/ChartScriptParameter.cs
@@ -102,9 +102,15 @@
             if (enumValues != null)
                 return enumValues;

-            string error = EnumValueList.TryParse(valueDefinition, out enumValues);
-            if (error.HasText())
-                throw new FormatException(error);
+            lock (this)
+            {
+                if (enumValues != null)
+                    return enumValues;
+
+                string error = EnumValueList.TryParse(valueDefinition, out enumValues);
+                if (error.HasText())
+                    throw new FormatException(error);
+            }

             return enumValues;
         }
@@ -118,9 +124,16 @@

             if (numberInterval != null)
                 return numberInterval;
-            string error = NumberInterval.TryParse(valueDefinition, out numberInterval);
-            if (error.HasText())
-                throw new FormatException(error);
+
+            lock (this)
+            {
+                if (numberInterval != null)
+                    return numberInterval;
+
+                string error = NumberInterval.TryParse(valueDefinition, out numberInterval);
+                if (error.HasText())
+                    throw new FormatException(error);
+            }

             return numberInterval;
         }


- Added more division tests

- Added more division tests

--- Source/Mosa.Platform.Internal.x86.xUnit/DivisionTests.cs
+++ Source/Mosa.Platform.Internal.x86.xUnit/DivisionTests.cs
@@ -54,6 +54,9 @@
 		[InlineData(ulong.MaxValue, ulong.MaxValue - 1)]
 		[InlineData(ulong.MaxValue - 1, ulong.MaxValue)]
 		[InlineData(ulong.MaxValue, ulong.MaxValue)]
+		[InlineData((ulong)4294967294, (ulong)1)]
+		[InlineData((ulong)4294967295, (ulong)1)]
+		[InlineData((ulong)4294967295, (ulong)2)]
 		public void udiv64(ulong n, ulong d)
 		{
 			ulong expected = n / d;


Blocks exist

Blocks exist

--- Jump.cs
+++ Jump.cs
@@ -18,7 +18,7 @@

         public List<Block> blocks;

-        GraphicsDeviceManager graphics;
+        public GraphicsDeviceManager graphics;
         private Player player;
         public SpriteBatch batch;

@@ -29,17 +29,17 @@
             graphics = new GraphicsDeviceManager(this);
             graphics.PreferredBackBufferWidth = SCREENWIDTH;
             graphics.PreferredBackBufferHeight = SCREENHEIGHT;
-
+            this.blocks = new List<Block>();
             Content.RootDirectory = "Content";
         }

         protected override void Initialize()
         {
-			Block block = new Block(0, 0, 100, 200, Color.Blue, 20);
+			Block block = new Block(this, new Rectangle(0, 0, 100, 200), Color.Blue, 20);
             player = new Player(this, new Rectangle(512, 384, 32, 32));
             this.Components.Add(player);
             this.Components.Add(block);
-            this.blocks.add(block);
+            this.blocks.Add(block);
             base.Initialize();

         }


Create CONTACTS file if it does not exist.

--- Main.cs
+++ Main.cs
@@ -20,6 +20,11 @@
 	}

 	static void ReadDataFile(string[] args) {
+		if (!File.Exists(FILENAME))
+		{
+			using (TextWriter writer = File.CreateText(FILENAME)) { }
+		}
+
 		try {
 			contactList = new ContactList();
 			using (StreamReader reader = File.OpenText(FILENAME)) {