fixed major performance issue causing crashes in kle update

--- Core.DomainServices/Repositories/KLE/KLEStandardRepository.cs
+++ Core.DomainServices/Repositories/KLE/KLEStandardRepository.cs
@@ -108,14 +108,14 @@
                             ActiveFrom = mostRecentTaskRef.ActiveFrom,
                         });
                     }
-                    else if (existingTaskRef.Uuid == Guid.Empty)
+                    else if (existingTaskRef.Uuid != mostRecentTaskRef.Uuid)
                     {
                         result.Add(new KLEChange
                         {
                             Uuid = mostRecentTaskRef.Uuid,
                             ChangeType = KLEChangeType.UuidPatched,
                             TaskKey = existingTaskRef.TaskKey,
-                            ChangeDetails = "Opdatering af null uuid",
+                            ChangeDetails = "Opdatering af uuid",
                             ActiveTo = mostRecentTaskRef.ActiveTo,
                             ActiveFrom = mostRecentTaskRef.ActiveFrom,
                         });
@@ -195,7 +195,10 @@

         private void RemoveProjectTaskRefs(KLEChange kleChange)
         {
-            var removedTaskRef = _existingTaskRefRepository.GetWithReferencePreload(t => t.ItProjects).First(t => t.TaskKey == kleChange.TaskKey);
+            var removedTaskRef = _existingTaskRefRepository
+                .GetWithReferencePreload(t => t.ItProjects)
+                .First(t => t.TaskKey == kleChange.TaskKey);
+
             foreach (var itProject in removedTaskRef.ItProjects.ToList())
             {
                 itProject.TaskRefs.Remove(removedTaskRef);
@@ -205,7 +208,10 @@

         private void RemoveSystemTaskRefs(KLEChange kleChange)
         {
-            var removedTaskRef = _existingTaskRefRepository.GetWithReferencePreload(t => t.ItSystems).First(t => t.TaskKey == kleChange.TaskKey);
+            var removedTaskRef = _existingTaskRefRepository
+                .GetWithReferencePreload(t => t.ItSystems)
+                .First(t => t.TaskKey == kleChange.TaskKey);
+
             foreach (var itSystem in removedTaskRef.ItSystems.ToList())
             {
                 itSystem.TaskRefs.Remove(removedTaskRef);
@@ -215,7 +221,10 @@

         private void RemoveSystemUsageOptOutTaskRefs(KLEChange kleChange)
         {
-            var removedTaskRef = _existingTaskRefRepository.GetWithReferencePreload(t => t.ItSystemUsagesOptOut).First(t => t.TaskKey == kleChange.TaskKey);
+            var removedTaskRef = _existingTaskRefRepository
+                .GetWithReferencePreload(t => t.ItSystemUsagesOptOut)
+                .First(t => t.TaskKey == kleChange.TaskKey);
+
             foreach (var itSystemUsageOptOut in removedTaskRef.ItSystemUsagesOptOut.ToList())
             {
                 itSystemUsageOptOut.TaskRefs.Remove(removedTaskRef);
@@ -225,10 +234,16 @@

         private void RemoveSystemUsageTaskRefs(List<KLEChange> kleChanges)
         {
-            var systemUsages = _systemUsageRepository.GetWithReferencePreload(s => s.TaskRefs);
-            foreach (var systemUsage in systemUsages.ToList())
-            {
-                foreach (var taskRef in systemUsage.TaskRefs.ToList().Where(t => kleChanges.Exists(c => c.TaskKey == t.TaskKey)))
+            var removedTaskKeys = kleChanges.Select(x => x.TaskKey).ToHashSet();
+
+            var affectedSystemUsages = _systemUsageRepository
+                .GetWithReferencePreload(s => s.TaskRefs)
+                .Where(system => system.TaskRefs.Any(tr => removedTaskKeys.Contains(tr.TaskKey)))
+                .ToList();
+
+            foreach (var systemUsage in affectedSystemUsages)
+            {
+                foreach (var taskRef in systemUsage.TaskRefs.Where(t => removedTaskKeys.Contains(t.TaskKey)).ToList())
                 {
                     systemUsage.TaskRefs.Remove(taskRef);
                 }
@@ -249,7 +264,14 @@

         private void RemoveTaskRef(IEnumerable<KLEChange> kleChanges)
         {
-            var removedTaskRefs = kleChanges.Select(c => _existingTaskRefRepository.Get(t => t.TaskKey == c.TaskKey).First());
+            var removedTaskKeys = kleChanges
+                .Select(x => x.TaskKey)
+                .ToList();
+
+            var removedTaskRefs = _existingTaskRefRepository
+                .AsQueryable()
+                .Where(tr => removedTaskKeys.Contains(tr.TaskKey))
+                .ToList();

             _existingTaskRefRepository.RemoveRange(removedTaskRefs);
         }


Explicitly set working directory for automation tests

- MatterSlice not found: IssueMatterHackers/MCCentral#612

--- Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs
+++ Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs
@@ -354,11 +354,23 @@
 			QueueTemplate queueItemFolderToAdd = QueueTemplate.None,
 			int overrideWidth = -1, int overrideHeight = -1)
 		{
+			// Walk back a step in the stack and output the callers name
+			StackTrace st = new StackTrace(false);
+			Debug.WriteLine("\r\n ***** Running automation test: {0} {1} ", st.GetFrames().Skip(1).First().GetMethod().Name, DateTime.Now);
+
 			if (staticDataPathOverride == null)
 			{
 				// Popping one directory above MatterControl, then back down into MatterControl ensures this works in MCCentral as well and MatterControl
 				staticDataPathOverride = TestContext.CurrentContext.ResolveProjectPath(5, "MatterControl", "StaticData");
 			}
+
+#if DEBUG
+			string outputDirectory = "Debug";
+#else
+			string outputDirectory = "Release";
+#endif
+
+			Environment.CurrentDirectory = TestContext.CurrentContext.ResolveProjectPath(5, "MatterControl", "bin", outputDirectory);

 #if !__ANDROID__
 			// Set the static data to point to the directory of MatterControl


Keep EmployerAccountTransactionsHandler

Keep EmployerAccountTransactionsHandler

--- src/SFA.DAS.EmployerApprenticeshipsService.Application/Queries/GetEmployerAccountTransactions/GetEmployerAccountTransactionsHandler.cs
+++ src/SFA.DAS.EmployerApprenticeshipsService.Application/Queries/GetEmployerAccountTransactions/GetEmployerAccountTransactionsHandler.cs
@@ -1,177 +0,0 @@
-using MediatR;
-using SFA.DAS.Validation;
-using SFA.DAS.EAS.Domain.Interfaces;
-using SFA.DAS.EAS.Domain.Models.Levy;
-using SFA.DAS.EAS.Domain.Models.Payments;
-using SFA.DAS.EAS.Domain.Models.Transaction;
-using SFA.DAS.EAS.Domain.Models.Transfers;
-using SFA.DAS.HashingService;
-using SFA.DAS.NLog.Logger;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using SFA.DAS.EAS.Domain.Models.ExpiredFunds;
-using SFA.DAS.EAS.Application.MarkerInterfaces;
-
-namespace SFA.DAS.EAS.Application.Queries.GetEmployerAccountTransactions
-{
-    public class GetEmployerAccountTransactionsHandler :
-        IAsyncRequestHandler<GetEmployerAccountTransactionsQuery, GetEmployerAccountTransactionsResponse>
-    {
-        private readonly IDasLevyService _dasLevyService;
-        private readonly IValidator<GetEmployerAccountTransactionsQuery> _validator;
-        private readonly IHashingService _hashingService;
-        private readonly IPublicHashingService _publicHashingService;
-        private readonly ILog _logger;
-
-        public GetEmployerAccountTransactionsHandler(
-            IDasLevyService dasLevyService,
-            IValidator<GetEmployerAccountTransactionsQuery> validator,
-            ILog logger,
-            IHashingService hashingService,
-            IPublicHashingService publicHashingService)
-        {
-            _dasLevyService = dasLevyService;
-            _validator = validator;
-            _logger = logger;
-            _hashingService = hashingService;
-            _publicHashingService = publicHashingService;
-        }
-
-        public async Task<GetEmployerAccountTransactionsResponse> Handle(GetEmployerAccountTransactionsQuery message)
-        {
-            var result = await _validator.ValidateAsync(message);
-
-            if (!result.IsValid())
-            {
-                throw new InvalidRequestException(result.ValidationDictionary);
-            }
-
-            if (result.IsUnauthorized)
-            {
-                throw new UnauthorizedAccessException();
-            }
-
-            var toDate = CalculateToDate(message);
-            var fromDate = new DateTime(toDate.Year, toDate.Month, 1);
-
-            var accountId = _hashingService.DecodeValue(message.HashedAccountId);
-            var transactions = await _dasLevyService.GetAccountTransactionsByDateRange(accountId, fromDate, toDate);
-
-            var hasPreviousTransactions = await _dasLevyService.GetPreviousAccountTransaction(accountId, fromDate) > 0;
-
-            if (!transactions.Any())
-            {
-                return GetResponse(message.HashedAccountId, accountId, hasPreviousTransactions, toDate.Year, toDate.Month);
-            }
-
-            foreach (var transaction in transactions)
-            {
-                await GenerateTransactionDescription(transaction);
-            }
-
-            PopulateTransferPublicHashedIds(transactions);
-
-            return GetResponse(message.HashedAccountId, accountId, transactions, hasPreviousTransactions, toDate.Year, toDate.Month);
-        }
-
-        private static DateTime CalculateToDate(GetEmployerAccountTransactionsQuery message)
-        {
-            var year = message.Year == default(int) ? DateTime.Now.Year : message.Year;
-            var month = message.Month == default(int) ? DateTime.Now.Month : message.Month;
-
-            var daysInMonth = DateTime.DaysInMonth(year, month);
-
-            var toDate = new DateTime(year, month, daysInMonth);
-            return toDate;
-        }
-
-        private async Task GenerateTransactionDescription(TransactionLine transaction)
-        {
-            if (transaction.GetType() == typeof(LevyDeclarationTransactionLine))
-            {
-                transaction.Description = transaction.Amount >= 0 ? "Levy" : "Levy adjustment";
-            }
-            else if (transaction.GetType() == typeof(PaymentTransactionLine))
-            {
-                var paymentTransaction = (PaymentTransactionLine)transaction;
-
-                transaction.Description = await GetPaymentTransactionDescription(paymentTransaction);
-            }
-            else if (transaction.GetType() == typeof(ExpiredFundTransactionLine))
-            {
-                transaction.Description = "Expired levy";
-            }
-            else if (transaction.GetType() == typeof(TransferTransactionLine))
-            {
-                var transferTransaction = (TransferTransactionLine)transaction;
-
-                if (transferTransaction.TransactionAccountIsTransferSender)
-                {
-                    transaction.Description = $"Transfer sent to {transferTransaction.ReceiverAccountName}";
-                }
-                else
-                {
-                    transaction.Description = $"Transfer received from {transferTransaction.SenderAccountName}";
-                }
-            }
-        }
-
-        private async Task<string> GetPaymentTransactionDescription(PaymentTransactionLine transaction)
-        {
-            var transactionPrefix = transaction.IsCoInvested ? "Co-investment - " : string.Empty;
-
-            try
-            {
-                var ukprn = Convert.ToInt32(transaction.UkPrn);
-                var providerName = await _dasLevyService.GetProviderName(ukprn, transaction.AccountId, transaction.PeriodEnd);
-                if (providerName != null)
-                    return $"{transactionPrefix}{providerName}";
-            }
-            catch (Exception ex)
-            {
-                _logger.Info($"Provider not found for UkPrn:{transaction.UkPrn} - {ex.Message}");
-            }
-
-            return $"{transactionPrefix}Training provider - name not recognised";
-
-        }
-
-        private static GetEmployerAccountTransactionsResponse GetResponse(string hashedAccountId, long accountId, bool hasPreviousTransactions, int year, int month)
-        {
-            return GetResponse(hashedAccountId, accountId, new List<TransactionLine>(), hasPreviousTransactions, year, month);
-        }
-
-        private static GetEmployerAccountTransactionsResponse GetResponse(
-            string hashedAccountId, long accountId, ICollection<TransactionLine> transactions, bool hasPreviousTransactions, int year, int month)
-        {
-            return new GetEmployerAccountTransactionsResponse
-            {
-                Data = new AggregationData
-                {
-                    HashedAccountId = hashedAccountId,
-                    AccountId = accountId,
-                    TransactionLines = transactions
-                },
-                AccountHasPreviousTransactions = hasPreviousTransactions,
-                Year = year,
-                Month = month
-            };
-        }
-
-        private void PopulateTransferPublicHashedIds(IEnumerable<TransactionLine> transactions)
-        {
-            var transferTransactions = transactions.OfType<TransferTransactionLine>();
-
-            foreach (var transaction in transferTransactions)
-            {
-                transaction.ReceiverAccountPublicHashedId =
-                    _publicHashingService.HashValue(transaction.ReceiverAccountId);
-
-                transaction.SenderAccountPublicHashedId =
-                    _publicHashingService.HashValue(transaction.SenderAccountId);
-            }
-        }
-    }
-}


added more DishesAsyncService tests

added more DishesAsyncService tests

--- WhenItsDone/Tests/LibTests/WhenItsDone.Services.Tests/DishesAsyncServiceTests/DishesAsyncServiceTests/GetTopCountDishesByRating_Should.cs
+++ WhenItsDone/Tests/LibTests/WhenItsDone.Services.Tests/DishesAsyncServiceTests/DishesAsyncServiceTests/GetTopCountDishesByRating_Should.cs
@@ -64,5 +64,39 @@

             asyncRepository.Verify(repo => repo.GetTopCountDishesByRating(dishesCount), Times.Once);
         }
+
+        [Test]
+        public void ShouldReturnCorrectType_WhenParameteresAreCorrect()
+        {
+            var asyncRepository = new Mock<IDishesAsyncRepository>();
+            asyncRepository.Setup(repo => repo.GetTopCountDishesByRating(It.IsAny<int>())).Returns(Task.Run<IEnumerable<NamePhotoDishView>>(() => new List<NamePhotoDishView>()));
+
+            var unitOfWorkFactory = new Mock<IDisposableUnitOfWorkFactory>();
+
+            var dishesAsyncService = new DishesAsyncService(asyncRepository.Object, unitOfWorkFactory.Object);
+
+            var dishesCount = 3;
+            var actualResult = dishesAsyncService.GetTopCountDishesByRating(dishesCount);
+
+            Assert.That(actualResult, Is.InstanceOf<IEnumerable<NamePhotoDishView>>());
+        }
+
+        [Test]
+        public void ShouldReturnCorrectObject_WhenParameteresAreCorrect()
+        {
+            var asyncRepository = new Mock<IDishesAsyncRepository>();
+
+            IEnumerable<NamePhotoDishView> mockRepositoryResult = new List<NamePhotoDishView>() { new Mock<NamePhotoDishView>().Object };
+            asyncRepository.Setup(repo => repo.GetTopCountDishesByRating(It.IsAny<int>())).Returns(Task.Run<IEnumerable<NamePhotoDishView>>(() => mockRepositoryResult));
+
+            var unitOfWorkFactory = new Mock<IDisposableUnitOfWorkFactory>();
+
+            var dishesAsyncService = new DishesAsyncService(asyncRepository.Object, unitOfWorkFactory.Object);
+
+            var dishesCount = 3;
+            var actualResult = dishesAsyncService.GetTopCountDishesByRating(dishesCount);
+
+            Assert.That(actualResult, Is.SameAs(mockRepositoryResult));
+        }
     }
 }


Fixed rebasing bug

Fixed rebasing bug

--- Assets/Scripts/EnemyFullAI.cs
+++ Assets/Scripts/EnemyFullAI.cs
@@ -188,7 +188,6 @@
 			this.rb2d.velocity = Vector2.zero;
 		}

-<<<<<<< HEAD
 		/*if (this.targetHeading.magnitude < this.melee.getWeapon ().range + 0.5f) {
 			Vector3 n = this.targetHeading.normalized;
 			if (n.x > Mathf.Sqrt (2f) / 2f) {
@@ -204,18 +203,6 @@
 			Vector3 n = this.targetHeading.normalized;
 			if (n.y < - Mathf.Sqrt (2f) / 2f) {
 				this.melee.getWeapon ().AttackSouth ();
-=======
-		/*if (this.targetHeading.magnitude < this.melee.getWeapon().range + 0.5f) {
-			Vector3 n = this.targetHeading.normalized;
-			if (n.x > Mathf.Sqrt (2) / 2) {
-				this.melee.getWeapon().AttackEast ();
-			} else if (n.x < - Mathf.Sqrt (2) / 2) {
-				this.melee.getWeapon().AttackWest ();
-			} else if (n.y > Mathf.Sqrt (2) / 2) {
-				this.melee.getWeapon().AttackNorth ();
-			} else if (n.y < -Mathf.Sqrt (2) / 2) {
-				this.melee.getWeapon().AttackSouth ();
->>>>>>> (Bug) Changed melee attackers to hit player on contact. Fixed snowman
 			}
 		}*/
 	}


Проверка на некорректность хода (с анимацией)

--- Assets/Scripts/GameManager.cs
+++ Assets/Scripts/GameManager.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using UnityEngine;
+using UnityEngine.Networking;

 namespace Assets.Scripts {
     public class GameManager: MonoBehaviour {
@@ -20,6 +21,10 @@
         private bool _isUpdatingGrid;
         private float _updatingGridCounter;
         private PlayerStats _player;
+
+        private GemLogic _lastMovedGem1;
+        private GemLogic _lastMovedGem2;
+

         private void Start() {
@@ -163,8 +168,20 @@
             MoveGem(gem1, gem2.GridPos);
             MoveGem(gem2, tmpPos);

+            _lastMovedGem1 = gem1;
+            _lastMovedGem2 = gem2;
+            Invoke("CheckReverseTurn", Constants.GemTransitionTime/2);
+
             SelectGem(null);
             _updatingGridCounter = Constants.GemTransitionTime;
+        }
+
+        public void CheckReverseTurn() {
+            if (!GetMatchesGem().Any()) {
+                var tmpPos = _lastMovedGem1.GridPos;
+                MoveGem(_lastMovedGem1, _lastMovedGem2.GridPos);
+                MoveGem(_lastMovedGem2, tmpPos);
+            }
         }

         private void SelectGem(GemLogic gem) {


Resourceからの読み込みを非同期に変更 ImageLoader内での画像保持を削除

--- Assets/Scripts/ImageLoader.cs
+++ Assets/Scripts/ImageLoader.cs
@@ -83,8 +83,6 @@
 			}
 		}

-		private Dictionary<string, Sprite> spriteItems = new Dictionary<string, Sprite>();
-
 		void Start()
 		{
 			parentAbsPath = GetParentAbsPath(gameObject.transform);
@@ -154,21 +152,20 @@
 			Debug.Log("FilePath : " + filePath);
 			Debug.Log("RefPath : " + resourceFilePath);

-			// Resourceを取得
-			if (!spriteItems.ContainsKey(filePath))
+			// 非同期読み込み
+			StartCoroutine(LoadSpriteProcess());
+		}
+
+		private IEnumerator LoadSpriteProcess()
+		{
+			var request = Resources.LoadAsync<Sprite>(resourceFilePath);
+
+			while(!request.isDone)
 			{
-				// Editorで読み込まれた時点でSpriteに自動変換しているのでここでは気にしない
+				yield return null;
+			}

-				var sp = Resources.Load<Sprite>(resourceFilePath);
-				image.sprite = sp;
-
-				// 一度読み込んだSpriteの保持は切り替え処理側(LangageMode等)で行ったほうが良いと思われる
-				spriteItems.Add(filePath, sp);
-			}
-			else
-			{
-				image.sprite = spriteItems[filePath];
-			}
+			image.sprite = request.asset as Sprite;
 			image.SetNativeSize();
 		}
 	}


merging

merging

--- Assets/Scripts/SelectUnits.cs
+++ Assets/Scripts/SelectUnits.cs
@@ -24,8 +24,9 @@
 				GameObject obj = hitInfo.collider.gameObject;

 				if (!selectedUnits.Contains (obj)) {
-					if (!Input.GetKey (KeyCode.LeftShift))
+					if (!Input.GetKey (KeyCode.LeftShift)) {
 						ClearSelectedUnits ();
+					}
 					selectedUnits.Add (obj);
 					obj.renderer.material.color = Color.green;
 				}


Tabs to spaces

Tabs to spaces

--- Assets/Scripts/UI/GameMenu.cs
+++ Assets/Scripts/UI/GameMenu.cs
@@ -3,72 +3,72 @@

 namespace Tetris
 {
-	public class GameMenu : MonoBehaviour
-	{
-		[SerializeField] private Text _scoreLabel;
-		[SerializeField] private Text _highscoreLabel;
+    public class GameMenu : MonoBehaviour
+    {
+        [SerializeField] private Text _scoreLabel;
+        [SerializeField] private Text _highscoreLabel;

-		private GameController _gameController;
-		private ScoreController _scoreController;
+        private GameController _gameController;
+        private ScoreController _scoreController;

-		#region MonoBehaviour
+        #region MonoBehaviour

-		private void OnEnable()
-		{
-			SetDisplayedScore(0);
-			SetDisplayedHighscore(1000);
-		}
+        private void OnEnable()
+        {
+            SetDisplayedScore(0);
+            SetDisplayedHighscore(1000);
+        }

-		private void Start()
-		{
-			_scoreController.OnScoreUpdate += SetDisplayedScore;
-			_scoreController.OnHighscoreUpdate += SetDisplayedHighscore;
-		}
+        private void Start()
+        {
+            _scoreController.OnScoreUpdate += SetDisplayedScore;
+            _scoreController.OnHighscoreUpdate += SetDisplayedHighscore;
+        }

-		private void OnDestroy()
-		{
-			_scoreController.OnScoreUpdate -= SetDisplayedScore;
-			_scoreController.OnHighscoreUpdate -= SetDisplayedHighscore;
-		}
+        private void OnDestroy()
+        {
+            _scoreController.OnScoreUpdate -= SetDisplayedScore;
+            _scoreController.OnHighscoreUpdate -= SetDisplayedHighscore;
+        }

-		#endregion
+        #endregion

-		#region Public methods
+        #region Public methods

-		public void Initialize(GameController gameController, ScoreController scoreController)
-		{
-			this._gameController = gameController;
-			this._scoreController = scoreController;
-		}
+        public void Initialize(GameController gameController, ScoreController scoreController)
+        {
+            this._gameController = gameController;
+            this._scoreController = scoreController;
+        }

-		public void SetDisplayedScore(long score)
-		{
-			SetScoreLabel(_scoreLabel, score);
-		}
+        public void SetDisplayedScore(long score)
+        {
+            SetScoreLabel(_scoreLabel, score);
+        }

-		public void SetDisplayedHighscore(long highscore)
-		{
-			SetScoreLabel(_highscoreLabel, highscore);
-		}
+        public void SetDisplayedHighscore(long highscore)
+        {
+            SetScoreLabel(_highscoreLabel, highscore);
+        }

-		#endregion
+        #endregion

-		#region Button actions
+        #region Button actions

-		public void RestartButtonWasSelected()
-		{
-			_gameController.RestartGame();
-		}
+        public void RestartButtonWasSelected()
+        {
+            _gameController.RestartGame();
+        }

-		#endregion
+        #endregion

-		#region Private methods
+        #region Private methods

-		private void SetScoreLabel(Text label, long score)
-		{
-			label.text = score.ToString("00000000");
-		}
+        private void SetScoreLabel(Text label, long score)
+        {
+            label.text = score.ToString("00000000");
+        }

-		#endregion
-	}
+        #endregion
+    }
 }


Removed debug message in CameraScroll.cs

--- Assets/src/ui/CameraScroll.cs
+++ Assets/src/ui/CameraScroll.cs
@@ -11,7 +11,6 @@
 		/* Determine camera bounds based on screen size and stuff. Based on
 		 * http://answers.unity3d.com/questions/501893/calculating-2d-camera-bounds.html */
 		float cameraWidth = Camera.main.camera.orthographicSize * Screen.width / Screen.height;
-		Debug.Log (cameraWidth);
 		X_MIN = cameraWidth - 6.65f; //6.65 was determined by testing until it worked
 		X_MAX = 6.65f - cameraWidth;
 	}


Added rotation to the sprite via the horizontal axis

--- Assets/PlayerMovement.cs
+++ Assets/PlayerMovement.cs
@@ -5,9 +5,18 @@
 public class PlayerMovement : MonoBehaviour {

 	public float playerSpeed = 5f;
+	public float rotationSpeed = 180f;

 	// Update is called once per frame
 	void Update () {
+		// rotation
+		Quaternion rotation = transform.rotation;
+		float z = rotation.eulerAngles.z;
+		z += Input.GetAxis ("Horizontal") * rotationSpeed * Time.deltaTime;
+		rotation = Quaternion.Euler (0, 0, z);
+		transform.rotation = rotation;
+
+		// vertical movement
 		Vector3 position = transform.position;
 		position.y += Input.GetAxis ("Vertical") * playerSpeed * Time.deltaTime;
 		transform.position = position;


Properly handle nulls

Properly handle nulls

--- Assets/Plugins/Carrot.cs
+++ Assets/Plugins/Carrot.cs
@@ -106,8 +106,8 @@
             using(AndroidJavaObject activity = playerClass.GetStatic<AndroidJavaObject>("currentActivity"),
                                     appIdString = new AndroidJavaObject("java.lang.String", appId),
                                     appSecretString = new AndroidJavaObject("java.lang.String", appSecret),
-                                    hostnameString = new AndroidJavaObject("java.lang.String", hostname),
-                                    debugUDIDString = new AndroidJavaObject("java.lang.String", debugUDID))
+                                    hostnameString = (hostname != null ? new AndroidJavaObject("java.lang.String", hostname) : null),
+                                    debugUDIDString = (debugUDID != null ? new AndroidJavaObject("java.lang.String", debugUDID) : null))
             {
                mCarrot = new AndroidJavaObject("com.CarrotInc.Carrot.Carrot", activity, appIdString,
                                                appSecretString, hostnameString, debugUDIDString);
@@ -174,7 +174,7 @@
       public bool postHighScore(uint score, string leaderboardId = null)
       {
 #if UNITY_ANDROID
-         using(AndroidJavaObject leaderboardIdString = new AndroidJavaObject("java.lang.String", leaderboardId))
+         using(AndroidJavaObject leaderboardIdString = (leaderboardId != null ? new AndroidJavaObject("java.lang.String", leaderboardId) : null))
          {
             return mCarrot.Call<bool>("postHighScore", (int)score, leaderboardIdString);
          }
@@ -204,7 +204,7 @@
          string actionPropertiesJson = (actionProperties == null ? null : Json.Serialize(actionProperties));
 #if UNITY_ANDROID
          using(AndroidJavaObject actionIdString = new AndroidJavaObject("java.lang.String", actionId),
-                                 actionPropertiesString = new AndroidJavaObject("java.lang.String", actionPropertiesJson),
+                                 actionPropertiesString = (actionPropertiesJson != null ? new AndroidJavaObject("java.lang.String", actionPropertiesJson) : null),
                                  objectInstanceIdString = new AndroidJavaObject("java.lang.String", objectInstanceId))
          {
             return mCarrot.Call<bool>("postJsonAction", actionIdString, actionPropertiesString, objectInstanceIdString);
@@ -241,10 +241,10 @@
          string objectPropertiesJson = Json.Serialize(objectProperties);
 #if UNITY_ANDROID
          using(AndroidJavaObject actionIdString = new AndroidJavaObject("java.lang.String", actionId),
-                                 actionPropertiesString = new AndroidJavaObject("java.lang.String", actionPropertiesJson),
+                                 actionPropertiesString = (actionPropertiesJson != null ? new AndroidJavaObject("java.lang.String", actionPropertiesJson) : null),
                                  objectIdString = new AndroidJavaObject("java.lang.String", objectId),
                                  objectPropertiesString = new AndroidJavaObject("java.lang.String", objectPropertiesJson),
-                                 objectInstanceIdString = new AndroidJavaObject("java.lang.String", objectInstanceId))
+                                 objectInstanceIdString = (objectInstanceId != null ? new AndroidJavaObject("java.lang.String", objectInstanceId) : null))
          {
             return mCarrot.Call<bool>("postJsonAction", actionIdString, actionPropertiesString, objectIdString, objectPropertiesString, objectInstanceIdString);
          }


修改会话返回结果格式

修改会话返回结果格式

--- BAH.BOS.WebAPI.ServiceStub/SessionService.cs
+++ BAH.BOS.WebAPI.ServiceStub/SessionService.cs
@@ -29,7 +29,7 @@
             return new ServiceResult
             {
                 Code = (int)ResultCode.Success,
-                Message = string.Format("{0}，服务端已收到你的心跳信号！", this.KDContext.Session.AppContext.SessionId)
+                Message = string.Format("SessionId:{0}，服务端已收到你的心跳信号！", this.KDContext.Session.AppContext.SessionId)
             };
         }//end method


Fix score for alt display

Fix score for alt display

--- Battery-Commander.Web/Views/APFT/List.cshtml
+++ Battery-Commander.Web/Views/APFT/List.cshtml
@@ -52,7 +52,7 @@
                 {

                         @Html.DisplayFor(_ => soldier.LastApft, "APFT")
-                        @if(!soldier.LastApft.IsPassing)
+                        @if (!soldier.LastApft.IsPassing)
                         {
                             @(soldier.ConsecutiveApftFailures)x
                         }
@@ -67,17 +67,24 @@
                     @Html.DisplayFor(_ => soldier.LastApft.PushUpScore)
                     @Html.DisplayFor(_ => soldier.LastApft.SitUps)
                     @Html.DisplayFor(_ => soldier.LastApft.SitUpScore)
-
+
+
+                        @Html.DisplayFor(_ => soldier.LastApft.Run)
+                        @if (soldier.LastApft.IsAlternateAerobicEvent)
+                        {
+                            Alt.
+                        }
+
+
                         @if (soldier.LastApft.IsAlternateAerobicEvent)
                         {
                             Alt.
                         }
                         else
                         {
-                            @Html.DisplayFor(_ => soldier.LastApft.Run)
+                            @Html.DisplayFor(_ => soldier.LastApft.RunScore)
                         }

-                    @Html.DisplayFor(_ => soldier.LastApft.RunScore)
                 }
                 else
                 {
@@ -96,4 +103,4 @@

         }

-

+


disable compaction, with TODO

disable compaction, with TODO

--- BitSharp.Storage/MemoryUtxoBuilderStorage.cs
+++ BitSharp.Storage/MemoryUtxoBuilderStorage.cs
@@ -103,15 +103,23 @@

         public IUtxoStorage Close(UInt256 blockHash)
         {
-            var compactUnspentTransactions = ImmutableDictionary.CreateBuilder<UInt256, UnspentTx>();
-            foreach (var unspentTransaction in this.unspentTransactions)
-                compactUnspentTransactions.Add(unspentTransaction);
+            //TODO figure out if creating clean dictionaries actually has any benefits
+            if (true)
+            {
+                return new MemoryUtxoStorage(blockHash, this.unspentTransactions.ToImmutable(), this.unspentOutputs.ToImmutable());
+            }
+            else
+            {
+                var compactUnspentTransactions = ImmutableDictionary.CreateBuilder<UInt256, UnspentTx>();
+                foreach (var unspentTransaction in this.unspentTransactions)
+                    compactUnspentTransactions.Add(unspentTransaction);

-            var compactUnspentOutputs = ImmutableDictionary.CreateBuilder<TxOutputKey, TxOutput>();
-            foreach (var unspentOutput in this.unspentOutputs)
-                compactUnspentOutputs.Add(unspentOutput);
-
-            return new MemoryUtxoStorage(blockHash, compactUnspentTransactions.ToImmutable(), compactUnspentOutputs.ToImmutable());
+                var compactUnspentOutputs = ImmutableDictionary.CreateBuilder<TxOutputKey, TxOutput>();
+                foreach (var unspentOutput in this.unspentOutputs)
+                    compactUnspentOutputs.Add(unspentOutput);
+
+                return new MemoryUtxoStorage(blockHash, compactUnspentTransactions.ToImmutable(), compactUnspentOutputs.ToImmutable());
+            }
         }

         public void Dispose()


More meaningless code changes because I'm lazy

--- BrainFuckInterpreterLib/BrainFuckDebugger.cs
+++ BrainFuckInterpreterLib/BrainFuckDebugger.cs
@@ -14,10 +14,7 @@

         public IEnumerable<int> BreakPoints
         {
-            get
-            {
-                foreach (var position in _breakPoints) yield return position;
-            }
+            get { return _breakPoints.AsEnumerable(); }
         }

         public event BreakPointHitEventHandler BreakPointHit;
@@ -31,8 +28,8 @@

         public void ToggleBreakPoint(int position)
         {
-            if (!_breakPoints.Contains(position)) _breakPoints.Add(position);
-            else _breakPoints.Remove(position);
+            if (_breakPoints.Contains(position)) _breakPoints.Remove(position);
+            else                                 _breakPoints.Add(position);
         }

         public void Start()


A change back

A change back

--- Enum/EnumListLambda.cs
+++ Enum/EnumListLambda.cs
@@ -3,42 +3,62 @@
 class IENumDemo
 {

+
     /// <summary>
     /// Create a cosinus table enumerator with 0..360 deg values
     /// </summary>
-    private IEnumerator costable = new Func<List<float>>(() =>
+    private IEnumerable<float> cosdata = new Func<IEnumerable<float>>(() =>
+    {
+        for (int v = 0; v < 360; v++)
         {
-            List<float> nn = new List<float>();
-            for (int v = 0; v < 360; v++)
-            {
-                nn.Add((float)Math.Cos(v * Math.PI / 180));
-            }
+            yield return (float)Math.Cos(v * Math.PI / 180);
+        }
+    }
+        )();

-            return nn;
-        }
-
-        )().GetEnumerator();
+    /// <summary>
+    /// Create a cosinus table IEnumerator from the cosdata table
+    /// </summary>
+    private IEnumerator cosenum = cosdata.GetEnumerator();

     /// <summary>
-    /// Demonstrates eternal fetch of next value from an IEnumerator
-    /// At end of list the enumerator is reset to start of list
+    /// Demonstrates eternal fetch of one value at a time from an IEnumerator
+    /// If end of list the enumerator is reset to the enumeration start
     /// </summary>
     /// <returns></returns>
     private float GetaNum()
     {
         //Advance to next item
-        if (!costable.MoveNext())
+        if (!cosenum.MoveNext())
         {
             //End of list - reset and advance to first
-            costable.Reset();
-            costable.MoveNext();
+            cosenum.Reset();
+            cosenum.MoveNext();
         }

         //Return Enum current value
-        yield return costable.Current;
-
-
+        return cosenum.Current;
+
+
     }

+
+    /// <summary>
+    /// Basic demo how to construct an IEnumerable from a loop
+    /// Can be useful if only a few values at the begining of a collection is normally used
+    /// or to deliver continuos chunks of data from a source in a streaming manner.
+    /// </summary>
+    /// <returns></returns>
+    private IEnumerable<float> GetaList()
+    {
+        for (int v = 0; v < 360; v++)
+
+            //Yield value and execution to calling routine
+            yield return (float)Math.Cos(v * Math.PI / 180);
+        }
+
+    }
+
+
 }


remove new context check

remove new context check

--- Dialog/artm.MvxPlugins.Dialog.Droid/Services/DialogService.cs
+++ Dialog/artm.MvxPlugins.Dialog.Droid/Services/DialogService.cs
@@ -80,9 +80,7 @@
         public async Task<List<int>> ShowMultipleChoice(DialogServiceMultiItemsBundle bundle)
         {
             var tcs = new TaskCompletionSource<List<int>>();
-
-            var builder = new AlertDialog.Builder(CurrentContext);
-
+
             // Attempt to re-use last dialog to increate performance
             // If only the title is different, we can still re-use it
             if (DialogServiceMultiItemsBundle.SameValuesAs(_lastMultipleItemsBundle, bundle) == false
@@ -94,6 +92,7 @@
             }
             else
             {
+                var builder = new AlertDialog.Builder(CurrentContext);
                 ConfigureBuilder(builder, bundle);
                 UpdateTaskCompletionSource(builder, bundle, tcs);
                 _lastMultipleChoiceDialog = builder.Create();
@@ -172,20 +171,6 @@
             return checkedItemsIndex;
         }

-        private bool IsNewContext(AlertDialog.Builder builder)
-        {
-            if (builder == null) return true;
-
-            var package = (ContextWrapper)builder.Context as ContextWrapper;
-            var bContext = package.BaseContext as Activity;
-            var cConext = CurrentContext as Activity;
-            if(bContext.LocalClassName.Equals(cConext.LocalClassName))
-            {
-                return false;
-            }
-            return true;
-        }
-
         private Activity CurrentContext
         {
             get


Clear the cache when marking invalidate

Clear the cache when marking invalidate

--- PolygonMesh/Mesh.cs
+++ PolygonMesh/Mesh.cs
@@ -291,6 +291,7 @@
 			{
 				fastAABBTransform = Matrix4X4.Identity;
 				fastAABBTransform[0, 0] = double.MinValue;
+				cachedAABB = null;
 				ChangedCount++;
 			}
 		}


clean up

clean up

--- bstrkr.mobile/bstrkr.android/Views/VehicleMarker.cs
+++ bstrkr.mobile/bstrkr.android/Views/VehicleMarker.cs
@@ -103,17 +103,21 @@
 			GeoPoint targetPosition = GeoPoint.Empty;
 			WaySegment pathSegment = null;
 			var animate = false;
+			var startPositionIsInView = false;
+			var finalPositionIsInView = false;
 			while(!animate && _animationQueue.TryDequeue(out pathSegment))
 			{
-				animate = latLngBounds.Contains(pathSegment.StartPosition.ToLatLng()) ||
-						  latLngBounds.Contains(pathSegment.FinalPosition.ToLatLng());
+				startPositionIsInView = latLngBounds.Contains(pathSegment.StartPosition.ToLatLng());
+				finalPositionIsInView = latLngBounds.Contains(pathSegment.FinalPosition.ToLatLng());
+
+				animate = startPositionIsInView || finalPositionIsInView;

 				targetPosition = pathSegment.FinalPosition;
 			}

 			if (animate)
 			{
-				_animatorRunner.Animate(pathSegment);
+				_animatorRunner.Animate(pathSegment, finalPositionIsInView);
 			}
 			else
 			{
@@ -156,13 +160,26 @@

 			public bool AnimationRunning { get { return _animationRunning; } }

-			public void Animate(WaySegment waySegment)
-			{
-				ObjectAnimator animator = ObjectAnimator.OfObject(
-								_marker,
-								"Position",
-								new TpEvaluator(),
-								waySegment.FinalPosition.ToLatLng());
+			public void Animate(WaySegment waySegment, bool animateStartPosition)
+			{
+				ObjectAnimator animator = null;
+				if (animateStartPosition)
+				{
+					animator = ObjectAnimator.OfObject(
+													_marker,
+													"Position",
+													new TpEvaluator(),
+													waySegment.StartPosition.ToLatLng(),
+													waySegment.FinalPosition.ToLatLng());
+				}
+				else
+				{
+					animator = ObjectAnimator.OfObject(
+													_marker,
+													"Position",
+													new TpEvaluator(),
+													waySegment.FinalPosition.ToLatLng());
+				}

 				animator.AddListener(this);
 				animator.SetDuration(Convert.ToInt64(waySegment.Duration.TotalMilliseconds));


Initial Heatmap tests

Initial Heatmap tests

--- test/DroneSafetyApi.UnitTests/ServicesTests/HeatmapTests.cs
+++ test/DroneSafetyApi.UnitTests/ServicesTests/HeatmapTests.cs
@@ -6,6 +6,7 @@
 using System.ComponentModel.DataAnnotations;
 using Xunit;
 using Xunit.Extensions;
+using System.Linq;

 namespace DroneSafetyApi.UnitTests.ServicesTests
 {
@@ -40,27 +41,25 @@

         [Theory, MemberData(nameof(PointExamples))]
         public void ProcessPoint_CorrectlyInsertsPointsIntoHeatMap(Bounds area, int numberLonPoints,
-            Point point, Position position, bool isValid)
-        {
-            // Arrange
-            var heatmap = new HeatMap(area, numberLonPoints);
-            var x = position.Longitude;
-            var y = position.Latitude;
-            var heatmapPoint = new HeatmapPoint { X = position.Longitude,
-                Y = position.Latitude, Value = 1 };
-
-            // Act
-            heatmap.ProcessPoint(point, 1);
+            Point point, int severity, Position position, bool isValid)
+        {
+            // Arrange
+            var heatmap = new HeatMap(area, numberLonPoints);
+
+            // Act
+            heatmap.ProcessPoint(point, severity);
             var points = heatmap.GetHeatMapPoints();
+            var heatmapPoint = points.FirstOrDefault(x => x.X == position.Longitude &&
+                x.Y == position.Latitude && x.Value == severity);

             // Assert
             if (isValid)
             {
-                Assert.Contains(heatmapPoint, points);
+                Assert.NotNull(heatmapPoint);
             }
             else
             {
-                Assert.DoesNotContain(heatmapPoint, points);
+                Assert.Null(heatmapPoint);
             }
         }
         public static object[] PointExamples
@@ -72,39 +71,44 @@
                 return new[]
                 {

-                    new object[] { area1, 100, new Point(5,5), new Position(5,5), true },
-                    new object[] { area1, 100, new Point(5,5), new Position(6,5), false },
-                    new object[] { area1, 100, new Point(2.11,7.87), new Position(2.1,7.9), true },
-                    new object[] { area1, 100, new Point(2.11,7.87), new Position(2.11,7.87), false },
-                    new object[] { area2, 500, new Point(0.09, 52.21), new Position(0.090046691894531253, 52.209983825683594), true },
-                    new object[] { area2, 500, new Point(0.09, 52.21), new Position(0.09, 52.21), false },
-                };
-            }
-        }
-        /*
+                    new object[] { area1, 100, new Point(5,5), 1, new Position(5,5), true },
+                    new object[] { area1, 100, new Point(5,5), 1, new Position(6,5), false },
+                    new object[] { area1, 100, new Point(-1,11), 1, new Position(-1,11), false },
+                    new object[] { area1, 100, new Point(2.11,7.87), 1, new Position(2.1,7.9), true },
+                    new object[] { area1, 100, new Point(2.11,7.87), 1, new Position(2.11,7.87), false },
+                    new object[] { area2, 500, new Point(0.09, 52.21), 1, new Position(0.090046691894531253, 52.209983825683594), true },
+                    new object[] { area2, 500, new Point(0.09, 52.21), 1, new Position(0.09, 52.21), false },
+                };
+            }
+        }
+
         [Theory, MemberData(nameof(CircleExamples))]
         public void ProcessCircle_CorrectlyInsertsCirclesIntoHeatMap(Bounds area, int numberLonPoints,
-            Point circleCentre, int radius, Position[] positions, bool isValid)
-        {
-            // Arrange
-            var heatmap = new HeatMap(area, numberLonPoints);
-
-            // Act
-            heatmap.ProcessCircle(circleCentre, radius, 1);
-            var points = heatmap.Map.Keys;
+            Point circleCentre, int radius, int severity, Position[] positions, bool isValid)
+        {
+            // Arrange
+            var heatmap = new HeatMap(area, numberLonPoints);
+
+            // Act
+            heatmap.ProcessCircle(circleCentre, radius, severity);
+            var points = heatmap.GetHeatMapPoints();

             // Assert
             if (isValid)
             {
-                foreach (Position pos in positions)
-                {
-                    Assert.Contains(pos, points);
+                foreach (Position position in positions)
+                {
+                    var heatmapPoint = points.FirstOrDefault(x => x.X == position.Longitude &&
+                        x.Y == position.Latitude && x.Value == severity);
+                    Assert.NotNull(heatmapPoint);
                 }
             } else
             {
-                foreach (Position pos in positions)
-                {
-                    Assert.DoesNotContain(pos, points);
+                foreach (Position position in positions)
+                {
+                    var heatmapPoint = points.FirstOrDefault(x => x.X == position.Longitude &&
+                        x.Y == position.Latitude && x.Value == severity);
+                    Assert.Null(heatmapPoint);
                 }
             }
         }
@@ -131,42 +135,45 @@
                 return new[]
                 {

-                    new object[] { area1, 100, new Point(5,5), 3 * HeatMap.MetresInLatDegree,
+                    new object[] { area1, 100, new Point(5,5), 3 * HeatMap.MetresInLatDegree, 1,
                         new Position[] { new Position(5,5), new Position(4.5,4.5), new Position(7,7) }, true },
-                    new object[] { area1, 100, new Point(5,5), 3 * HeatMap.MetresInLatDegree,
+                    new object[] { area1, 100, new Point(5,5), 3 * HeatMap.MetresInLatDegree, 1,
                         new Position[] { new Position(1,2), new Position(5,9), new Position(8.01,8.01) }, false },
-                    new object[] { area1, 100, new Point(5,5), 3 * HeatMap.MetresInLatDegree,
+                    new object[] { area1, 100, new Point(5,5), 3 * HeatMap.MetresInLatDegree, 1,
                         new Position[] { new Position(5.01, 5.01), new Position(4.49,4.49) }, false },
-                    new object[] { area2, 500, new Point(0.12, 52.203), 600, goodPositions, true },
-                    new object[] { area2, 500, new Point(0.12, 52.203), 600, badPositions, false },
-                };
-            }
-        }
-
+                    new object[] { area2, 500, new Point(0.12, 52.203), 600, 1, goodPositions, true },
+                    new object[] { area2, 500, new Point(0.12, 52.203), 600, 1, badPositions, false },
+                };
+            }
+        }
+
         [Theory, MemberData(nameof(PolygonExamples))]
         public void ProcessPolygon_CorrectlyInsertsPolygonsIntoHeatMap(Bounds area, int numberLonPoints,
-            Polygon polygon, Position[] positions, bool isValid)
-        {
-            // Arrange
-            var heatmap = new HeatMap(area, numberLonPoints);
-
-            // Act
-            heatmap.ProcessPolygon(polygon, 1);
-            var points = heatmap.Map.Keys;
+            Polygon polygon, int severity, Position[] positions, bool isValid)
+        {
+            // Arrange
+            var heatmap = new HeatMap(area, numberLonPoints);
+
+            // Act
+            heatmap.ProcessPolygon(polygon, severity);
+            var points = heatmap.GetHeatMapPoints();

             // Assert
             if (isValid)
             {
-                foreach (Position pos in positions)
-                {
-                    Assert.Contains(pos, points);
-                }
-            }
-            else
-            {
-                foreach (Position pos in positions)
-                {
-                    Assert.DoesNotContain(pos, points);
+                foreach (Position position in positions)
+                {
+                    var heatmapPoint = points.FirstOrDefault(x => x.X == position.Longitude &&
+                        x.Y == position.Latitude && x.Value == severity);
+                    Assert.NotNull(heatmapPoint);
+                }
+            } else
+            {
+                foreach (Position position in positions)
+                {
+                    var heatmapPoint = points.FirstOrDefault(x => x.X == position.Longitude &&
+                        x.Y == position.Latitude && x.Value == severity);
+                    Assert.Null(heatmapPoint);
                 }
             }
         }
@@ -176,27 +183,75 @@
             {
                 Bounds area1 = new Bounds(new Position(0, 0), new Position(10, 10));
                 Bounds area2 = new Bounds(new Position(0.0707244873046875, 52.170983918129096), new Position(0.1847076416015625, 52.230743427331866));
+                Polygon poly1 = new Polygon(new[]
+                {
+                    new Position(0.11, 52.203),
+                    new Position(0.12, 52.203),
+                    new Position(0.12, 52.213),
+                    new Position(0.11, 52.213),
+                    new Position(0.11, 52.203)
+                });
+                Polygon poly2 = new Polygon(new[]
+                {
+                    new Position(0.081, 52.193),
+                    new Position(0.14, 52.207),
+                    new Position(0.147, 52.225),
+                    new Position(0.158, 52.213),
+                    new Position(0.111, 52.21),
+                    new Position(0.071, 52.182),
+                    new Position(0.081, 52.193)
+                });
                 Position[] goodPoly1Positions = new Position[]
                 {
-
+                    new Position(0.110335693359375, 52.206792297363279),
+                    new Position(0.11193145751953125, 52.207932128906251),
+                    new Position(0.11626281738281249, 52.21226348876953),
+                    new Position(0.11968231201171875, 52.203372802734371),
+                    new Position(0.113983154296875, 52.212947387695309)
                 };
                 Position[] badPoly1Positions = new Position[]
                 {
-
-                };
-                return new[]
-                {
-
-                    new object[] { area1, 100, new Point(5,5), 3 * HeatMap.MetresInLatDegree,
-                        new Position[] { new Position(5,5), new Position(4.5,4.5), new Position(7,7) }, true },
-                    new object[] { area1, 100, new Point(5,5), 3 * HeatMap.MetresInLatDegree,
-                        new Position[] { new Position(1,2), new Position(5,9), new Position(8.01,8.01) }, false },
-                    new object[] { area1, 100, new Point(5,5), 3 * HeatMap.MetresInLatDegree,
-                        new Position[] { new Position(5.01, 5.01), new Position(4.49,4.49) }, false },
-                    new object[] { area2, 500, new Point(0.12, 52.203), 600, goodPositions, true },
-                    new object[] { area2, 500, new Point(0.12, 52.203), 600, badPositions, false },
-                };
-            }
-        }*/
+                    new Position(0.11626281738281249,52.199269409179685),
+                    new Position(0.0,51),
+                    new Position(0.11, 52.203),
+                    new Position(0.11854248046875,52.199497375488278)
+                };
+                Position[] goodPoly2Positions1 = new Position[]
+                {
+                    new Position(0.0715814208984375, 52.182627868652339),
+                    new Position(0.077508544921874992, 52.187643127441405),
+                    new Position(0.10212890625, 52.199269409179685),
+                    new Position(0.157752685546875, 52.2131753540039)
+                };
+                Position[] badPoly2Positions1 = new Position[]
+                {
+                    new Position(0.147, 52.225),
+                    new Position(0.158, 52.213),
+                    new Position(-1,-1),
+                    new Position(0.0916424560546875, 52.21043975830078)
+                };
+                Position[] goodPoly2Positions2 = new Position[]
+                {
+                    new Position(0.071809387207031256, 52.182627868652347),
+                    new Position(0.13791961669921876, 52.211123657226565),
+                    new Position(0.15159759521484376, 52.215682983398438)
+                };
+                Position[] badPoly2Positions2 = new Position[]
+                {
+                    new Position(0.0715814208984375, 52.182627868652339),
+                    new Position(0.158, 52.213),
+                    new Position(-1,-1)
+                };
+                return new[]
+                {
+                    new object[] { area2, 500, poly1, 1, goodPoly1Positions, true },
+                    new object[] { area2, 500, poly1, 1, badPoly1Positions, false },
+                    new object[] { area2, 500, poly2, 1, goodPoly2Positions1, true },
+                    new object[] { area2, 500, poly2, 1, badPoly2Positions1, false },
+                    new object[] { area2, 100, poly2, 1, goodPoly2Positions2, true },
+                    new object[] { area2, 100, poly2, 1, badPoly2Positions2, false },
+                };
+            }
+        }
     }
 }


Some cleanup

Some cleanup

--- test/E2ETests/Implementation/OpenIdConnectLoginScenarios.cs
+++ test/E2ETests/Implementation/OpenIdConnectLoginScenarios.cs
@@ -39,13 +39,6 @@
             Assert.NotNull(queryItems["nonce"]);
             Assert.NotNull(_httpClientHandler.CookieContainer.GetCookies(new Uri(_applicationBaseUrl)).GetCookieWithName(".AspNet.OpenIdConnect.Nonce.protectedString"));

-            Console.WriteLine("Before..");
-            foreach (Cookie item in _httpClientHandler.CookieContainer.GetCookies(new Uri(_applicationBaseUrl)))
-            {
-                Console.WriteLine(item.Name + " " + item.Value + " " + item.Path);
-            }
-            Console.WriteLine("End of Before..");
-
             // This is just enable the auto-redirect.
             _httpClientHandler = new HttpClientHandler() { AllowAutoRedirect = true };
             _httpClient = new HttpClient(_httpClientHandler) { BaseAddress = new Uri(_applicationBaseUrl) };
@@ -63,12 +56,6 @@
             response = _httpClient.PostAsync(string.Empty, new FormUrlEncodedContent(token.ToArray())).Result;
             ThrowIfResponseStatusNotOk(response);
             responseContent = response.Content.ReadAsStringAsync().Result;
-            Console.WriteLine("After..");
-            foreach (Cookie item in _httpClientHandler.CookieContainer.GetCookies(new Uri(_applicationBaseUrl)))
-            {
-                Console.WriteLine(item.Name + " " + item.Value + " " + item.Path);
-            }
-            Console.WriteLine("end of After..");
             Assert.Equal(_applicationBaseUrl + "Account/ExternalLoginCallback?ReturnUrl=%2F", response.RequestMessage.RequestUri.AbsoluteUri);

             formParameters = new List<KeyValuePair<string, string>>


WPF Custom context menu - let CEF know when the menu has been closed

--- CefSharp.Wpf.Example/Handlers/MenuHandler.cs
+++ CefSharp.Wpf.Example/Handlers/MenuHandler.cs
@@ -5,6 +5,7 @@
 using System;
 using System.Collections.Generic;
 using System.Windows.Controls;
+using System.Windows;
 using GalaSoft.MvvmLight.Command;

 namespace CefSharp.Wpf.Example.Handlers
@@ -69,6 +70,22 @@
                     IsOpen = true
                 };

+                RoutedEventHandler handler = null;
+
+                handler = (s, e) =>
+                {
+                    menu.Closed -= handler;
+
+                    //If the callback has been disposed then it's already been executed
+                    //so don't call Cancel
+                    if(!callback.IsDisposed)
+                    {
+                        callback.Cancel();
+                    }
+                };
+
+                menu.Closed += handler;
+
                 foreach (var item in menuItems)
                 {
                     menu.Items.Add(new MenuItem


relative output path.

relative output path.

--- QuickPDF/Program.cs
+++ QuickPDF/Program.cs
@@ -16,6 +16,8 @@

             // First is output file.
             var output = args.First();
+            if (!Path.IsPathRooted(output))
+                output = Environment.CurrentDirectory + @"\" + output;

             // Rest is image files.
             var files = args.Skip(1);


Fixed colors of board positions

Fixed colors of board positions

--- LimakeSilverLightUI/MainPage.xaml.cs
+++ LimakeSilverLightUI/MainPage.xaml.cs
@@ -115,38 +115,47 @@

                 if (i < (int)Position.GreenGoal1)
                 {
+                    pi.Color = Colors.White;
                     boardPanel.Children.Add(pc);
                 }
                 else if (i < (int)Position.RedGoal1)
                 {
+                    pi.Color = Colors.Green;
                     greenGoalPanel.Children.Add(pc);
                 }
                 else if (i < (int)Position.BlueGoal1)
                 {
+                    pi.Color = Colors.Red;
                     redGoalPanel.Children.Add(pc);
                 }
                 else if (i < (int)Position.YellowGoal1)
                 {
+                    pi.Color = Colors.Blue;
                     blueGoalPanel.Children.Add(pc);
                 }
                 else if (i < (int)Position.GreenHome1)
                 {
+                    pi.Color = Colors.Yellow;
                     yellowGoalPanel.Children.Add(pc);
                 }
                 else if (i < (int)Position.RedHome1)
                 {
+                    pi.Color = Colors.Green;
                     greenHomePanel.Children.Add(pc);
                 }
                 else if (i < (int)Position.BlueHome1)
                 {
+                    pi.Color = Colors.Red;
                     redHomePanel.Children.Add(pc);
                 }
                 else if (i < (int)Position.YellowHome1)
                 {
+                    pi.Color = Colors.Blue;
                     blueHomePanel.Children.Add(pc);
                 }
                 else
                 {
+                    pi.Color = Colors.Yellow;
                     yellowHomePanel.Children.Add(pc);
                 }
             }
@@ -257,6 +266,7 @@
     public class PositionInfo
     {
         public String Name { get; set; }
+        public Color Color { get; set; }
     }

     public class PieceInfo


Update export_excel.cs

Update export_excel.cs

--- Export/export_excel.cs
+++ Export/export_excel.cs
@@ -4,8 +4,9 @@
 // www.pcb-investigator.com
 // SDK online reference http://www.pcb-investigator.com/sites/default/files/documents/InterfaceDocumentation/Index.html
 // SDK http://www.pcb-investigator.com/en/sdk-participate
+//
 // Example to export data to excel, component references, partnames and packages are written in excel table.
-// This can script is a basic example how to export data to MS excel, you can update it to add more information for components or change it a little bit to export e.g. net information.
+// This script is a basic example how to export data to MS excel, you can update it to add more information for components or change it a little bit to export e.g. net information.
 //-----------------------------------------------------------------------------------
 using System;
 using System.Collections.Generic;


Some small optimizations, turned on RowReduce call

--- Circuit/Simulation/LinqCompiledSimulation.cs
+++ Circuit/Simulation/LinqCompiledSimulation.cs
@@ -343,7 +343,7 @@
         }

         // Solve a system of linear equations
-        private void Solve(CodeGen code, LinqExpr Ab, IEnumerable<LinearCombination> Equations, IEnumerable<Expression> Unknowns)
+        private static void Solve(CodeGen code, LinqExpr Ab, IEnumerable<LinearCombination> Equations, IEnumerable<Expression> Unknowns)
         {
             LinearCombination[] eqs = Equations.ToArray();
             Expression[] deltas = Unknowns.ToArray();
@@ -365,12 +365,12 @@
             }

             // Gaussian elimination on this turd.
-            RowReduce(code, Ab, M, N);
-            //code.Add(LinqExpr.Call(
-            //    typeof(LinqCompiledSimulation).GetMethod("RowReduce", BindingFlags.Static | BindingFlags.NonPublic, null, new[] { typeof(double[][]), typeof(int), typeof(int) }, null),
-            //    Ab,
-            //    LinqExpr.Constant(M),
-            //    LinqExpr.Constant(N)));
+            //RowReduce(code, Ab, M, N);
+            code.Add(LinqExpr.Call(
+                GetMethod<LinqCompiledSimulation>("RowReduce", Ab.Type, typeof(int), typeof(int)),
+                Ab,
+                LinqExpr.Constant(M),
+                LinqExpr.Constant(N)));

             // Ab is now upper triangular, solve it.
             for (int j = N - 1; j >= 0; --j)
@@ -398,8 +398,9 @@
                 // Find a pivot row for this variable.
                 for (int i = j + 1; i < M; ++i)
                 {
+                    double[] Abi = Ab[i];
                     // if(|JxF[i][j]| > max) { pi = i, max = |JxF[i][j]| }
-                    double maxj = Math.Abs(Ab[i][j]);
+                    double maxj = Math.Abs(Abi[j]);
                     if (maxj > max)
                     {
                         pi = i;
@@ -408,18 +409,23 @@
                 }

                 // Swap pivot row with the current row.
+                double[] Abj = Ab[j];
                 if (pi != j)
+                {
+                    double[] Abpi = Ab[pi];
                     for (int ij = j; ij <= N; ++ij)
-                        Swap(ref Ab[j][ij], ref Ab[pi][ij]);
+                        Swap(ref Abj[ij], ref Abpi[ij]);
+                }

                 // Eliminate the rows after the pivot.
-                double p = Ab[j][j];
+                double p = Abj[j];
                 for (int i = j + 1; i < M; ++i)
                 {
-                    double s = Ab[i][j] / p;
-                    //if (s != 0.0)
-                    for (int ij = j + 1; ij <= N; ++ij)
-                        Ab[i][ij] -= Ab[j][ij] * s;
+                    double[] Abi = Ab[i];
+                    double s = Abi[j] / p;
+                    if (s != 0.0)
+                        for (int ij = j + 1; ij <= N; ++ij)
+                            Abi[ij] -= Abj[ij] * s;
                 }
             }
         }
@@ -438,6 +444,8 @@
                 LinqExpr max = code.ReDeclInit<double>("max", Abs(LinqExpr.ArrayAccess(Abj, _j)));

                 // Find a pivot row for this variable.
+                //code.For(j + 1, M, _i =>
+                //{
                 for (int i = j + 1; i < M; ++i)
                 {
                     LinqExpr _i = LinqExpr.Constant(i);
@@ -468,6 +476,8 @@

                 // Eliminate the rows after the pivot.
                 LinqExpr p = code.ReDeclInit<double>("p", LinqExpr.ArrayAccess(Abj, _j));
+                //code.For(j + 1, M, _i =>
+                //{
                 for (int i = j + 1; i < M; ++i)
                 {
                     LinqExpr _i = LinqExpr.Constant(i);
@@ -522,17 +532,24 @@

         private static void Swap(ref double a, ref double b) { double t = a; a = b; b = t; }

+        // Get a method of T with the given name/param types.
+        private static MethodInfo GetMethod(Type T, string Name, params Type[] ParamTypes) { return T.GetMethod(Name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, ParamTypes, null); }
+        private static MethodInfo GetMethod<T>(string Name, params Type[] ParamTypes) { return GetMethod(typeof(T), Name, ParamTypes); }
+
         // Returns 1 / x.
         private static LinqExpr Reciprocal(LinqExpr x) { return LinqExpr.Divide(ConstantExpr(1.0, x.Type), x); }
         // Returns abs(x).
-        private static LinqExpr Abs(LinqExpr x) { return LinqExpr.Call(typeof(System.Math).GetMethod("Abs", new Type[] { x.Type }), x); }
+        private static LinqExpr Abs(LinqExpr x) { return LinqExpr.Call(GetMethod(typeof(Math), "Abs", x.Type), x); }
         // Returns x*x.
         private static LinqExpr Square(LinqExpr x) { return LinqExpr.Multiply(x, x); }

-        private static MethodInfo IsNaN = typeof(double).GetMethod("IsNaN");
-        private static MethodInfo IsInfinity = typeof(double).GetMethod("IsInfinity");
         // Returns true if x is not NaN or Inf
-        private static LinqExpr IsNotReal(LinqExpr x) { return LinqExpr.Or(LinqExpr.Call(null, IsNaN, x), LinqExpr.Call(null, IsInfinity, x)); }
+        private static LinqExpr IsNotReal(LinqExpr x)
+        {
+            return LinqExpr.Or(
+                LinqExpr.Call(GetMethod(x.Type, "IsNaN", x.Type), x),
+                LinqExpr.Call(GetMethod(x.Type, "IsInfinity", x.Type), x));
+        }
         // Round x to zero if it is sub-normal.
         private static LinqExpr RoundDenormToZero(LinqExpr x) { return x; }
         // Generate expression to swap a and b, using t as a temporary.


Updated version in AssemblyInfo

Updated version in AssemblyInfo

--- Cirqus.TypeScript/Properties/AssemblyInfo.cs
+++ Cirqus.TypeScript/Properties/AssemblyInfo.cs
@@ -32,4 +32,4 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("0.1")]
 [assembly: AssemblyVersion("0.1")]
-[assembly: AssemblyFileVersion("0.1.0")]
+[assembly: AssemblyFileVersion("0.1.1")]


Updated NumCIL BlackScholes example to use boolean operations

--- benchmark/CIL/Tester/BlackScholes.cs
+++ benchmark/CIL/Tester/BlackScholes.cs
@@ -20,8 +20,8 @@
             var K = 1.0f / (1.0f + 0.2316419f * L);
             var w = 1.0f - 1.0f / ((DATA)Math.Sqrt(2 * Math.PI)) * (-L * L / 2.0f).Exp() * (a1 * K + a2 * (K.Pow(2)) + a3 * (K.Pow(3)) + a4 * (K.Pow(4)) + a5 * (K.Pow(5)));

-            var mask1 = X.Apply<LessThan>();
-            var mask2 = X.Apply<GreaterThanOrEqual>();
+            var mask1 = (NdArray)(X < 0);
+            var mask2 = (NdArray)(X >= 0);

             w = w * mask2 + (1.0f - w) * mask1;
             return w;


comments yo

comments yo

--- AutoGridDemo/AutoGrid.cs
+++ AutoGridDemo/AutoGrid.cs
@@ -178,6 +178,9 @@
             set { SetValue(ColumnsProperty, value); }
         }

+        /// <summary>
+        /// Use to grid.row and grid.column from being ignored to manually layout a child element. (set autogrid.autoplace="false" on the child)
+        /// </summary>
         public static readonly DependencyProperty AutoplaceProperty =
             DependencyProperty.RegisterAttached("Autoplace", typeof (bool), typeof (AutoGrid), new PropertyMetadata(true));


Adjustments to tests

Adjustments to tests

--- B2Lib.Tests/FileTests.cs
+++ B2Lib.Tests/FileTests.cs
@@ -192,39 +192,38 @@
             File.WriteAllText(_tmpPath, "Testworld,123");

             // Upload it
-            B2File file = _bucket.CreateFile("test").UploadFileData(new FileInfo(_tmpPath));
-            TestFileContents(file);
+            B2File originalFile = _bucket.CreateFile("test").UploadFileData(new FileInfo(_tmpPath));
+            TestFileContents(originalFile);

             // Enumerate it
             List<B2File> list = _bucket.GetFiles().ToList();
-            B2File listFile = list.FirstOrDefault(s => s.FileId == file.FileId);
+            B2File listFile = list.FirstOrDefault(s => s.FileId == originalFile.FileId);

             TestFileContents(listFile, B2FileAction.Upload);

             // Hide it
-            _bucket.HideFile(listFile.FileName);
-            B2File hideFileItem = _bucket.GetFiles().FirstOrDefault(s => s.FileName.Equals(listFile.FileName));
+            _bucket.HideFile(originalFile.FileName);

             // Enumerate it (it should now be hidden)
             list = _bucket.GetFiles().ToList();
-            listFile = list.FirstOrDefault(s => s.FileId == file.FileId);
+            listFile = list.FirstOrDefault(s => s.FileId == originalFile.FileId);

             Assert.IsNull(listFile);

             // Enumerate versions (it should be visible)
             List<B2FileItemBase> versions = _bucket.GetFileVersions().ToList();
-            B2File hideFile = versions.OfType<B2File>().FirstOrDefault(s => s.FileId == hideFileItem.FileId);
-            listFile = versions.OfType<B2File>().FirstOrDefault(s => s.FileId == file.FileId);
+            B2File hideFile = versions.OfType<B2File>().FirstOrDefault(s => s.FileName == originalFile.FileName && s.Action == B2FileAction.Hide);
+            listFile = versions.OfType<B2File>().FirstOrDefault(s => s.FileId == originalFile.FileId);

             TestFileContents(hideFile, B2FileAction.Hide);
             TestFileContents(listFile, B2FileAction.Upload);

             // Delete file
-            file.Delete();
+            originalFile.Delete();

             // Ensure list is blank
-            List<B2File> blankFilesList = _bucket.GetFiles().ToList();
-            Assert.IsFalse(blankFilesList.Any(s => s.FileId == file.FileId));
+            List<B2FileItemBase> blankFilesList = _bucket.GetFileVersions().ToList();
+            Assert.IsFalse(blankFilesList.Any(s => s.FileId == originalFile.FileId));
         }

         [TestMethod]


English culture

English culture

--- BbsSample/Global.asax.cs
+++ BbsSample/Global.asax.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.Linq;
 using System.Web;
 using System.Web.Mvc;
@@ -12,6 +13,9 @@
     {
         protected void Application_Start()
         {
+            CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
+            CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");
+
             AreaRegistration.RegisterAllAreas();
             FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
             RouteConfig.RegisterRoutes(RouteTable.Routes);


Made good use of ConnectChange in GTK's WizardDialog

--- Selene.Gtk/Selene.Gtk.Frontend/WizardDialog.cs
+++ Selene.Gtk/Selene.Gtk.Frontend/WizardDialog.cs
@@ -59,6 +59,7 @@
                     foreach(Control Cont in Subcat.Controls)
                     {
                         WidgetPair Add = ProcureState(Cont) as WidgetPair;
+                        Add.Converter.ConnectChange(Add, HandleChange);
                         Table.AddWidget(Add);
                         StateList.Add(Add);
                     }
@@ -70,14 +71,12 @@
                 Win.SetPageComplete(Table, true);
                 i++;
             }
-            Win.WidgetEvent += HandleWidgetEvent;
             State = StateList.ToArray();
         }

-        void HandleWidgetEvent(object o, WidgetEventArgs args)
+        void HandleChange(object o, EventArgs args)
         {
-            if(args.Event.Type == Gdk.EventType.KeyRelease || args.Event.Type == Gdk.EventType.LeaveNotify)
-                Revalidate();
+            Revalidate();
         }

         void Revalidate()


Formatting

Formatting

--- SimpleMvcSitemap.Tests/SitemapProviderTests.cs
+++ SimpleMvcSitemap.Tests/SitemapProviderTests.cs
@@ -123,6 +123,7 @@
         }

+
         [Test]
         public void CreateSitemapWithConfiguration_HttpContextIsNull_ThrowsException()
         {
@@ -172,8 +173,7 @@
             _config.Setup(item => item.CreateSitemapUrl(It.Is<int>(i => i <= 3))).Returns(string.Empty);

             Expression<Func<SitemapIndexModel, bool>> validateIndex = index => index.Nodes.Count == 3;
-            _actionResultFactory.Setup(item => item.CreateXmlResult(It.Is(validateIndex)))
-                                .Returns(_expectedResult);
+            _actionResultFactory.Setup(item => item.CreateXmlResult(It.Is(validateIndex))).Returns(_expectedResult);

             ActionResult result = _sitemapProvider.CreateSitemap(_httpContext.Object, sitemapNodes, _config.Object);


Improve reliability of Service Fabric HandlesSiloAdditionAndRemoval test (#3154)

--- test/TestServiceFabric/FabricMembershipOracleTests.cs
+++ test/TestServiceFabric/FabricMembershipOracleTests.cs
@@ -132,11 +132,11 @@
                     SiloAddress.New(new IPEndPoint(IPAddress.Loopback, 4), 2),
                     "OtherNewSilo"),
             };
-
-            listener.VersionReached.Reset();
-            listener.WaitForVersion = 4;
+
+            // The local silo transitioned to 'Joining' and then 'Active' and two other silos became 'Active',
+            // so the version must be 4
             this.resolver.Notify(silos);
-            listener.VersionReached.WaitOne(TimeSpan.FromMinutes(1));
+            listener.WaitForVersion(4);
             Assert.Equal(3, listener.Silos.Count);
             Assert.Contains(silos[1].SiloAddress, listener.Silos.Keys);
             Assert.Equal(SiloStatus.Active, listener.Silos[silos[1].SiloAddress]);
@@ -154,9 +154,9 @@
             Assert.Equal(2, multiClusters.Count);

             // Remove a silo and verify that it's been removed.
-            listener.WaitForVersion = 5;
+            // The single removal will bump the version to 5.
             this.resolver.Notify(new[] {silos[1]});
-            listener.VersionReached.WaitOne(TimeSpan.FromMinutes(1));
+            listener.WaitForVersion(5);
             Assert.Equal(3, listener.Silos.Count);
             Assert.Contains(silos[1].SiloAddress, listener.Silos.Keys);
             Assert.Equal(SiloStatus.Active, listener.Silos[silos[1].SiloAddress]);
@@ -168,7 +168,7 @@

             // Remove a silo and verify that it's been removed.
             this.resolver.Notify(new FabricSiloInfo[0]);
-            listener.VersionReached.WaitOne(TimeSpan.FromMinutes(1));
+            listener.WaitForVersion(6);

             Assert.Equal(3, listener.Silos.Count);
             Assert.Contains(silos[1].SiloAddress, listener.Silos.Keys);
@@ -214,9 +214,9 @@

         private class MockStatusListener : ISiloStatusListener
         {
-            public int Version { get; private set; }
-            public int WaitForVersion { get; set; }
-            public AutoResetEvent VersionReached { get; } = new AutoResetEvent(false);
+            private AutoResetEvent versionUpdated = new AutoResetEvent(false);
+
+            public int Version => this.Notifications.Count;
             public Dictionary<SiloAddress, SiloStatus> Silos { get; } = new Dictionary<SiloAddress, SiloStatus>();
             public List<Tuple<SiloAddress, SiloStatus>> Notifications { get; } = new List<Tuple<SiloAddress, SiloStatus>>();

@@ -224,8 +224,25 @@
             {
                 this.Notifications.Add(Tuple.Create(updatedSilo, status));
                 this.Silos[updatedSilo] = status;
-                this.Version++;
-                if (this.Version >= this.WaitForVersion) this.VersionReached.Set();
+                this.versionUpdated.Set();
+            }
+
+            public void WaitForVersion(int version)
+            {
+                while (version > this.Version)
+                {
+                    // If we are at the correct version, exit without waiting.
+                    if (this.Version >= version)
+                    {
+                        break;
+                    }
+
+                    // Wait to be pulsed by an incoming update.
+                    this.versionUpdated.WaitOne(TimeSpan.FromMinutes(1));
+                }
+
+                // Wake up any waiters to check the current version.
+                this.versionUpdated.Set();
             }
         }


no null list

no null list

--- SolrNet/Impl/SolrMoreLikeThisHandlerResults.cs
+++ SolrNet/Impl/SolrMoreLikeThisHandlerResults.cs
@@ -15,6 +15,10 @@
         /// <summary>
         /// Interesting terms in More-like-this query
         /// </summary>
-        public IList<KeyValuePair<string, float>> InterestingTerms { get; set; }
+        public IList<KeyValuePair<string, float>> InterestingTerms { get; set; }
+
+        public SolrMoreLikeThisHandlerResults() {
+            InterestingTerms = new List<KeyValuePair<string, float>>();
+        }
     }
 }


Fix unit test

Fix unit test

--- test/VisualStudio.Test/VsPackageSourceProviderTest.cs
+++ test/VisualStudio.Test/VsPackageSourceProviderTest.cs
@@ -429,8 +429,8 @@
   <disabledPackageSources>
     <add key=""Windows 8 Packages"" value=""true"" />
   </disabledPackageSources>
-</configuration>",
-                  configFileContent);
+</configuration>".Replace("\r", ""),
+                  configFileContent.Replace("\r", ""));
         }

         [Fact]
@@ -649,8 +649,8 @@
   <activePackageSource>
     <add key=""Windows 8 Packages"" value=""https://www.nuget.org/api/v2/curated-feeds/windows8-packages/"" />
   </activePackageSource>
-</configuration>",
-                  configFileContent);
+</configuration>".Replace("\r", ""),
+                  configFileContent.Replace("\r", ""));
         }

         private static void AssertPackageSource(PackageSource ps, string name, string source)


Fixed: Default for makeCollectionPropertiesTrackable

--- Source/ChangeTracking/ChangeTrackingFactory.cs
+++ Source/ChangeTracking/ChangeTrackingFactory.cs
@@ -8,7 +8,7 @@
         static ChangeTrackingFactory() => Default = new ChangeTrackingFactory();
         public static ChangeTrackingFactory Default { get; }

-        public ChangeTrackingFactory() : this(makeComplexPropertiesTrackable: true, makeCollectionPropertiesTrackable: false)
+        public ChangeTrackingFactory() : this(makeComplexPropertiesTrackable: true, makeCollectionPropertiesTrackable: true)
         {

         }


Added UniversitiesOfInterest to studentInfo model

--- Source/Data/Interapp.Data.Models/University.cs
+++ Source/Data/Interapp.Data.Models/University.cs
@@ -9,11 +9,13 @@
     public class University
     {
         private ICollection<StudentInfo> students;
+        private ICollection<StudentInfo> interestedStudents;
         private ICollection<Document> documentRequirements;

         public University()
         {
             this.students = new HashSet<StudentInfo>();
+            this.interestedStudents = new HashSet<StudentInfo>();
             this.documentRequirements = new HashSet<Document>();
         }

@@ -68,6 +70,20 @@
             }
         }

+        [InverseProperty("UniversitiesOfInterest")]
+        public virtual ICollection<StudentInfo> InterestedStudents
+        {
+            get
+            {
+                return this.interestedStudents;
+            }
+
+            set
+            {
+                this.interestedStudents = value;
+            }
+        }
+
         [InverseProperty("University")]
         public virtual ICollection<StudentInfo> Students
         {


Added models to context

Added models to context

--- Source/Data/Interapp.Data/InterappDbContext.cs
+++ Source/Data/Interapp.Data/InterappDbContext.cs
@@ -2,6 +2,7 @@
 {
     using Microsoft.AspNet.Identity.EntityFramework;
     using Models;
+    using System.Data.Entity;

     public class InterappDbContext : IdentityDbContext<User>
     {
@@ -10,6 +11,18 @@
         {
         }

+        public IDbSet<Country> Countries { get; set; }
+
+        public IDbSet<Document> Documents { get; set; }
+
+        public IDbSet<Essay> Essays { get; set; }
+
+        public IDbSet<Major> Majors { get; set; }
+
+        public IDbSet<Score> Scores { get; set; }
+
+        public IDbSet<University> Universities { get; set; }
+
         public static InterappDbContext Create()
         {
             return new InterappDbContext();


Update links to "Maximize WPF 3D Performance"

--- Source/HelixToolkit.Wpf/Helpers/MeshBuilder.cs
+++ Source/HelixToolkit.Wpf/Helpers/MeshBuilder.cs
@@ -22,7 +22,7 @@
     /// Builds MeshGeometry3D objects.
     ///
     /// <remarks>
-    /// Performance tips for MeshGeometry3D (See MSDN)
+    /// Performance tips for MeshGeometry3D (See MSDN)
     /// <para>
     /// High impact:
     /// Mesh animation—changing the individual vertices of a mesh on a per-frame basis—is not always efficient in
@@ -2536,7 +2536,7 @@
         /// Checks the performance limits.
         ///
         /// <remarks>
-        /// See MSDN.
+        /// See MSDN.
         /// Try to keep mesh sizes under these limits:
         /// Positions : 20,001 point instances
         /// TriangleIndices : 60,003 integer instances


ObjReader: Support for multiple materials within the same group

--- Source/HelixToolkit.Wpf/Importers/ObjReader.cs
+++ Source/HelixToolkit.Wpf/Importers/ObjReader.cs
@@ -297,7 +297,13 @@
                             this.LoadMaterialLib(values);
                             break;
                         case "usemtl": // material name
+                            this.EnsureNewMesh();
+
                             this.SetMaterial(values);
+                            break;
+                        case "usemap": // texture map name
+                            this.EnsureNewMesh();
+
                             break;
                         case "bevel": // bevel interpolation
                         case "c_interp": // color interpolation
@@ -432,6 +438,18 @@
         }

         /// <summary>
+        /// Ensures that a new mesh is created.
+        /// </summary>
+        private void EnsureNewMesh()
+        {
+            if (this.CurrentGroup.MeshBuilder.TriangleIndices.Count != 0)
+            {
+                this.CurrentGroup.AddMesh();
+                this.smoothingGroupMaps.Clear();
+            }
+        }
+
+        /// <summary>
         /// Sets the smoothing group number.
         /// </summary>
         /// <param name="values">The group number.</param>
@@ -676,8 +694,10 @@
             var modelGroup = new Model3DGroup();
             foreach (var g in this.Groups)
             {
-                var gm = new GeometryModel3D { Geometry = g.MeshBuilder.ToMesh(), Material = g.Material, BackMaterial = g.Material };
-                modelGroup.Children.Add(gm);
+                foreach (var gm in g.CreateModels())
+                {
+                    modelGroup.Children.Add(gm);
+                }
             }

             return modelGroup;
@@ -857,6 +877,16 @@
         /// </summary>
         public class Group
         {
+            /// <summary>
+            /// List of mesh builders.
+            /// </summary>
+            private readonly IList<MeshBuilder> meshBuilders;
+
+            /// <summary>
+            /// List of materials.
+            /// </summary>
+            private readonly IList<Material> materials;
+
             #region Constructors and Destructors

             /// <summary>
@@ -868,8 +898,9 @@
             public Group(string name)
             {
                 this.Name = name;
-                this.Material = MaterialHelper.CreateMaterial(Brushes.Green);
-                this.MeshBuilder = new MeshBuilder(true, true);
+                this.meshBuilders = new List<MeshBuilder>();
+                this.materials = new List<Material>();
+                this.AddMesh();
             }

             #endregion
@@ -877,24 +908,64 @@
             #region Public Properties

             /// <summary>
-            ///   Gets or sets the material.
+            ///   Sets the material.
             /// </summary>
             /// <value>The material.</value>
-            public Material Material { get; set; }
-
-            /// <summary>
-            ///   Gets or sets the mesh builder.
+            public Material Material
+            {
+                set
+                {
+                    this.materials[this.materials.Count - 1] = value;
+                }
+            }
+
+            /// <summary>
+            ///   Gets the mesh builder for the current mesh.
             /// </summary>
             /// <value>The mesh builder.</value>
-            public MeshBuilder MeshBuilder { get; set; }
-
-            /// <summary>
-            ///   Gets or sets the name.
+            public MeshBuilder MeshBuilder
+            {
+                get
+                {
+                    return this.meshBuilders[this.meshBuilders.Count - 1];
+                }
+            }
+
+            /// <summary>
+            ///   Gets or sets the group name.
             /// </summary>
             /// <value>The name.</value>
             public string Name { get; set; }

             #endregion
+
+            /// <summary>
+            /// Adds a mesh.
+            /// </summary>
+            public void AddMesh()
+            {
+                var meshBuilder = new MeshBuilder(true, true);
+                this.meshBuilders.Add(meshBuilder);
+                this.materials.Add(HelixToolkit.Wpf.Materials.Green);
+            }
+
+            /// <summary>
+            /// Creates the models of the group.
+            /// </summary>
+            /// <returns>The models.</returns>
+            public IEnumerable<Model3D> CreateModels()
+            {
+                for (int i = 0; i < this.meshBuilders.Count; i++)
+                {
+                    yield return
+                        new GeometryModel3D
+                            {
+                                Geometry = this.meshBuilders[i].ToMesh(),
+                                Material = this.materials[i],
+                                BackMaterial = this.materials[i]
+                            };
+                }
+            }
         }

         /// <summary>


[Package Explorer] Ask for confirmation before deleting content.

--- Tools/NuGet/NuGetPackageExplorer/PackageViewModel/PackagePart/PackagePart.cs
+++ Tools/NuGet/NuGetPackageExplorer/PackageViewModel/PackagePart/PackagePart.cs
@@ -100,6 +100,10 @@
         }

         public void Delete() {
+            bool confirm = PackageViewModel.MessageBox.Confirm("Are you sure you want to delete it?");
+            if (!confirm) {
+                return;
+            }

             if (Parent != null) {
                 Parent.Children.Remove(this);


- Service.Dispose() is now virtual.

- Service.Dispose() is now virtual.

--- Unity/Assets/GameFramework/Services/_GenPrototypeService/PrototypeService.cs
+++ Unity/Assets/GameFramework/Services/_GenPrototypeService/PrototypeService.cs
@@ -91,7 +91,7 @@

         bool isDisposed = false;

-        public void Dispose() {
+        public virtual void Dispose() {
             if (isDisposed || Kernel.applicationQuitting) return;
             isDisposed = true;
             disposables.Dispose();


Dummy checkin

Dummy checkin

--- src/GitLink/Pdb/PdbFile.cs
+++ src/GitLink/Pdb/PdbFile.cs
@@ -57,6 +57,7 @@
             get { return Info.NameToPdbName.ContainsKey(SrcSrvContent); }
         }

+
         public int SrcSrv
         {
             get { return Info.NameToPdbName[SrcSrvContent].Stream; }


Move Force.MassByAccelerationEqualsForce overload with double out of the WinRT compiled code

--- UnitsNet/CustomCode/UnitClasses/Force.extra.cs
+++ UnitsNet/CustomCode/UnitClasses/Force.extra.cs
@@ -58,6 +58,11 @@
             double newtons = p.Pascals*metersSquared;
             return new Force(newtons);
         }
+
+        public static Force FromMassByAcceleration(Mass mass, double metersPerSecondSquared)
+        {
+          return new Force(mass.Kilograms * metersPerSecondSquared);
+        }
 #endif

         public static Force FromPressureByArea(Pressure p, Area area)
@@ -66,11 +71,6 @@
             return new Force(newtons);
         }

-        public static Force FromMassByAcceleration(Mass mass, double metersPerSecondSquared)
-        {
-            return new Force(mass.Kilograms*metersPerSecondSquared);
-        }
-
         public static Force FromMassByAcceleration(Mass mass, Acceleration acceleration)
         {
             return new Force(mass.Kilograms * acceleration.MeterPerSecondSquared);


Removed the gameserver running check as you should be able to have multiple gameservers running for one loginserver

--- src/L2dotNET/GameServer.cs
+++ src/L2dotNET/GameServer.cs
@@ -31,8 +31,6 @@

         public void Start()
         {
-            CheckRunningProcesses();
-
             Config.Config.Instance.Initialize();

             PreReqValidation.Instance.Initialize();
@@ -122,16 +120,5 @@
         {
             ClientManager.Instance.AddClient(clientSocket);
         }
-
-        private void CheckRunningProcesses()
-        {
-            if (Process.GetProcessesByName("L2dotNET.GameService").Length == 1)
-                return;
-
-            Log.Fatal("A L2dotNET.GameService process is already running!");
-            Log.Info("Press ENTER to exit...");
-            Console.Read();
-            Environment.Exit(0);
-        }
     }
 }


Update LocalizationStartup.cs

Update LocalizationStartup.cs

--- src/LocalizationStartup.cs
+++ src/LocalizationStartup.cs
@@ -1,4 +1,4 @@
-// @yasinkuyu
+// @yasinkuyu
 // 05/08/2014

 using System;
@@ -50,7 +50,7 @@
         /// </summary>
         /// <param id="id">Xml localization item id</param>
         /// <returns></returns>
-        public string GetLang(string id)
+        public string GetLang(string id, string _culture = "")
         {
             ReadCookie();

@@ -64,6 +64,9 @@

             if (string.IsNullOrEmpty(xmlFolderName))
                 Folder = xmlFolderName;
+
+            if (string.IsNullOrEmpty(_culture))
+                Culture = _culture;

             string applicationName = string.Format("{0}_{1}_", Culture, uniqueApplicationName);

@@ -112,4 +115,4 @@
             return null;
         }
     }
-}+}


Poll better, faster, stronger :muscle:

Poll better, faster, stronger :muscle:

--- src/MindstormR.EV3/Main.cs
+++ src/MindstormR.EV3/Main.cs
@@ -16,7 +16,7 @@
 {
     class MainClass
     {
-        private const string baseUrl = "http://test.henkmollema.nl/robot/";
+        private const string BaseUrl = "http://test.henkmollema.nl/robot/";
         private static int _id;

         public static void Main(string[] args)
@@ -36,7 +36,7 @@

                 var sw = Stopwatch.StartNew();
                 var client = new WebClient();
-                string s = client.DownloadString(baseUrl + "login");
+                string s = client.DownloadString(BaseUrl + "login");
                 sw.Stop();

                 if (!int.TryParse(s, out _id))
@@ -62,13 +62,13 @@
                     // Get the new command and push the sensor data in one go.
                     string command = client.DownloadString(
                                          string.Format("{0}/{1}/command?touch={2}&gyro={3}&color={4}&ir={5}&battery={6}",
-                                             baseUrl,
+                                             BaseUrl,
                                              _id,
                                              touchSensor.ReadAsString(),
                                              gyroSensor.ReadAsString(),
                                              colorSensor.ReadAsString(),
                                              irSensor.ReadAsString(),
-                                             (int)(Battery.Current * 1000)));
+                                             (int)(Battery.Current * 100)));
                     sw.Stop();

                     Info("Command: '{0}' ({1:n2}ms)", false, "Robot " + _id, command, sw.Elapsed.TotalMilliseconds);
@@ -101,12 +101,12 @@
                     }

                     // todo: consider using signalr for this -> #18
-                    Thread.Sleep(250);
+                    Thread.Sleep(100);
                 }

                 vehicle.Off();
                 Info("Logging out...", false, "Robot " + _id);
-                client.DownloadString(baseUrl + _id + "/logout");
+                client.DownloadString(BaseUrl + _id + "/logout");
                 Info("Logged out", false, "Robot " + _id);
                 terminateProgram.WaitOne();
             }


Added test

Added test

Returns moveNext so fails)

--- tests/NLog.UnitTests/LayoutRenderers/CallSiteTests.cs
+++ tests/NLog.UnitTests/LayoutRenderers/CallSiteTests.cs
@@ -31,6 +31,9 @@
 // THE POSSIBILITY OF SUCH DAMAGE.
 //

+using System.IO;
+using System.Threading.Tasks;
+
 namespace NLog.UnitTests.LayoutRenderers
 {
     using System;
@@ -191,7 +194,7 @@
             MethodBase currentMethod = MethodBase.GetCurrentMethod();
             AssertDebugLastMessage("debug", currentMethod.DeclaringType.FullName.Substring(0, 3) + " msg");
         }
-
+
         [Fact]
         public void ClassNameWithPaddingTestPadLeftAlignRightTest()
         {
@@ -549,6 +552,35 @@
         }

+        [Fact]
+        public void Show_correct_method_with_async()
+        {
+
+            //namespace en name of current method
+            const string currentMethodFullName = "NLog.UnitTests.LayoutRenderers.CallSiteTests.Show_correct_method_with_async";
+
+            LogManager.Configuration = CreateConfigurationFromString(@"
+           <nlog>
+               <targets><target name='debug' type='Debug' layout='${callsite}|${message}' /></targets>
+               <rules>
+                   <logger name='*' levels='Warn' writeTo='debug' />
+               </rules>
+           </nlog>");
+
+            AsyncMethod().Wait();
+            AssertDebugLastMessage("debug", string.Format("{0}|direct", currentMethodFullName));
+
+        }
+
+        private async Task AsyncMethod()
+        {
+            var findFile = new FileInfo("test.txt");
+            var logger = LogManager.GetCurrentClassLogger();
+            logger.Warn("direct");
+            var reader = new StreamReader(new MemoryStream(new byte[0]));
+            await reader.ReadLineAsync();
+        }
+

         public class CompositeWrapper
         {


Fix deadlock in integration test

Fix deadlock in integration test

--- tests/Tgstation.Server.Tests/Instance/WatchdogTest.cs
+++ tests/Tgstation.Server.Tests/Instance/WatchdogTest.cs
@@ -89,7 +89,7 @@
 			var killTask = Task.Run(() =>
 			{
 				killTaskStarted.SetResult(null);
-				while (jobTcs.Task?.IsCompleted != true)
+				while (!jobTcs.Task.IsCompleted)
 					KillDD(false);
 			});

@@ -98,12 +98,12 @@
 			{
 				await killTaskStarted.Task;
 				var dumpTask = instanceClient.DreamDaemon.CreateDump(cancellationToken);
+				job = await WaitForJob(await dumpTask, 20, true, null, cancellationToken);
+			}
+			finally
+			{
+				jobTcs.SetResult(null);
 				await killTask;
-				job = await WaitForJob(await dumpTask, 20, true, null, cancellationToken);
-			}
-			finally
-			{
-				jobTcs.SetResult(null);
 			}
 			Assert.IsTrue(job.ErrorCode == ErrorCode.DreamDaemonOffline || job.ErrorCode == ErrorCode.GCoreFailure, $"{job.ErrorCode}: {job.ExceptionDetails}");
 			await Task.Delay(TimeSpan.FromSeconds(20), cancellationToken);


another fix

another fix

--- src/NadekoBot/NadekoBot.cs
+++ src/NadekoBot/NadekoBot.cs
@@ -28,6 +28,7 @@
 using System.IO;
 using NadekoBot.Services.Pokemon;
 using NadekoBot.DataStructures;
+using NadekoBot.Extensions;

 namespace NadekoBot
 {


better logs?

better logs?

--- src/NadekoBot/NadekoBot.cs
+++ src/NadekoBot/NadekoBot.cs
@@ -7,6 +7,7 @@
 using NLog.Config;
 using NLog.Targets;
 using System;
+using System.Diagnostics;
 using System.Linq;
 using System.Reflection;
 using System.Threading.Tasks;
@@ -94,14 +95,41 @@
         {
             var throwaway = Task.Run(async () =>
             {
+                var sw = new Stopwatch();
+                sw.Start();
                 var t = await Commands.Execute(imsg, imsg.Content);
+                sw.Stop();
+                var channel = (imsg.Channel as ITextChannel);
                 if (t.IsSuccess)
                 {
-                    _log.Info("Command Executed\n\tFull Message: {0}",imsg.Content);
+
+                    _log.Info("Command Executed after {4}s\n\t" +
+                              "User: {0}\n\t" +
+                              "Server: {1}\n\t" +
+                              "Channel: {2}\n\t" +
+                              "Message: {3}",
+                              imsg.Author + " [" + imsg.Author.Id + "]\n\t", // {0}
+                              (channel == null ? "PRIVATE" : channel.Guild.Name + " [" + channel.Guild.Id + "]") + "\n\t", // {1}
+                              (channel == null ? "PRIVATE" : channel.Name + " [" + channel.Id + "]") + "\n\t", //{2}
+                              imsg.Content, // {3}
+                              sw.Elapsed.TotalSeconds // {4}
+                              );
                 }
                 else if (!t.IsSuccess && t.Error != CommandError.UnknownCommand)
                 {
-                    _log.Warn("Command errored!\n\tFull Message: {0}\n\tError:{1}", imsg.Content, t.ErrorReason);
+                    _log.Warn("Command Errored after {5}s\n\t" +
+                              "User: {0}\n\t" +
+                              "Server: {1}\n\t" +
+                              "Channel: {2}\n\t" +
+                              "Message: {3}\n\t" +
+                              "Error: {4}",
+                              imsg.Author + " [" + imsg.Author.Id + "]\n\t", // {0}
+                              (channel == null ? "PRIVATE" : channel.Guild.Name + " [" + channel.Guild.Id + "]") + "\n\t", // {1}
+                              (channel == null ? "PRIVATE" : channel.Name + " [" + channel.Id + "]") + "\n\t", //{2}
+                              imsg.Content,// {3}
+                              t.ErrorReason, // {4}
+                              sw.Elapsed.TotalSeconds //{5}
+                              );
                 }
             });