Cover RouteService with user tests - edited user test

--- BikeMates/BikeMates.Test/Services/RouteServiceTest.cs
+++ BikeMates/BikeMates.Test/Services/RouteServiceTest.cs
@@ -1,4 +1,5 @@
 using BikeMates.Application.Services;
+using BikeMates.Contracts.MailSender;
 using BikeMates.Contracts.Repositories;
 using BikeMates.Contracts.Services;
 using BikeMates.Domain.Entities;
@@ -15,12 +16,13 @@
         private IUserService userService;
         private Mock<IRouteRepository> routeRepository;
         private IRouteService routeService;
-
+        private Mock<IMailService> mailSender;
         [TestFixtureSetUp]
         public void InitialSetup()
         {
             userRepository = new Mock<IUserRepository>();
-            userService = new UserService(userRepository.Object);
+            mailSender = new Mock<IMailService>();
+            userService = new UserService(userRepository.Object, mailSender.Object);
             routeRepository = new Mock<IRouteRepository>();
             routeService = new RouteService(routeRepository.Object, userRepository.Object);
         }


message for VS tests

message for VS tests

--- Bounce.VisualStudio.Tests/VisualStudioSolutionTest.cs
+++ Bounce.VisualStudio.Tests/VisualStudioSolutionTest.cs
@@ -6,7 +6,7 @@
 using NUnit.Framework;

 namespace Bounce.VisualStudio.Tests {
-    [TestFixture]
+    [TestFixture, Explicit("should be executed with MSBuild in PATH, say, from nunit from a Visual Studio command prompt.")]
     public class VisualStudioSolutionTest {
         private const string SolutionUnzipDirectory = "TestSolution";


removed timestamp from mod messages

removed timestamp from mod messages

--- CompatBot/Utils/Extensions/DiscordClientExtensions.cs
+++ CompatBot/Utils/Extensions/DiscordClientExtensions.cs
@@ -220,7 +220,7 @@
                     Color = GetColor(severity),
                 }.AddField("Violator", author == null ? message.Author.Mention : GetMentionWithNickname(author), true)
                 .AddField("Channel",  message.Channel.IsPrivate ? "Bot's DM" : message.Channel.Mention, true)
-                .AddField("Time (UTC)", message.CreationTimestamp.ToString("yyyy-MM-dd HH:mm:ss"), true)
+                //.AddField("Time (UTC)", message.CreationTimestamp.ToString("yyyy-MM-dd HH:mm:ss"), true)
                 .AddField("Content of the offending item", content);
             if (!string.IsNullOrEmpty(actionList))
                 result.AddField("Filter Actions", actionList, true);


Footsteps cleanup (#3840)

Footsteps cleanup (#3840)

* Disable footsteps in space

* Just clean up footsteps

--- Content.Server/Physics/Controllers/MoverController.cs
+++ Content.Server/Physics/Controllers/MoverController.cs
@@ -1,5 +1,6 @@
 #nullable enable
 using System.Collections.Generic;
+using Content.Server.Actions;
 using Content.Server.GameObjects.Components.GUI;
 using Content.Server.GameObjects.Components.Items.Storage;
 using Content.Server.GameObjects.Components.Movement;
@@ -22,6 +23,7 @@
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
+using Robust.Shared.Utility;

 namespace Content.Server.Physics.Controllers
 {
@@ -98,59 +100,58 @@

         protected override void HandleFootsteps(IMoverComponent mover, IMobMoverComponent mobMover)
         {
+            if (!mover.Owner.HasTag("FootstepSound")) return;
+
             var transform = mover.Owner.Transform;
+            var coordinates = transform.Coordinates;
+            var gridId = coordinates.GetGridId(EntityManager);
+            var distanceNeeded = mover.Sprinting ? StepSoundMoveDistanceRunning : StepSoundMoveDistanceWalking;
+
             // Handle footsteps.
-            if (_mapManager.GridExists(mobMover.LastPosition.GetGridId(EntityManager)))
+            if (_mapManager.GridExists(gridId))
             {
                 // Can happen when teleporting between grids.
-                if (!transform.Coordinates.TryDistance(EntityManager, mobMover.LastPosition, out var distance))
+                if (!coordinates.TryDistance(EntityManager, mobMover.LastPosition, out var distance) ||
+                    distance > distanceNeeded)
                 {
-                    mobMover.LastPosition = transform.Coordinates;
-                    return;
+                    mobMover.StepSoundDistance = distanceNeeded;
                 }
-
-                mobMover.StepSoundDistance += distance;
-            }
-
-            mobMover.LastPosition = transform.Coordinates;
-            float distanceNeeded;
-            if (mover.Sprinting)
-            {
-                distanceNeeded = StepSoundMoveDistanceRunning;
+                else
+                {
+                    mobMover.StepSoundDistance += distance;
+                }
             }
             else
             {
-                distanceNeeded = StepSoundMoveDistanceWalking;
+                // In space no one can hear you squeak
+                return;
             }

-            if (mobMover.StepSoundDistance > distanceNeeded)
+            DebugTools.Assert(gridId != GridId.Invalid);
+            mobMover.LastPosition = coordinates;
+
+            if (mobMover.StepSoundDistance < distanceNeeded) return;
+
+            mobMover.StepSoundDistance -= distanceNeeded;
+
+            if (mover.Owner.TryGetComponent<InventoryComponent>(out var inventory)
+                && inventory.TryGetSlotItem<ItemComponent>(EquipmentSlotDefines.Slots.SHOES, out var item)
+                && item.Owner.TryGetComponent<FootstepModifierComponent>(out var modifier))
             {
-                mobMover.StepSoundDistance = 0;
-
-                if (!mover.Owner.HasTag("FootstepSound") || mover.Owner.Transform.GridID == GridId.Invalid)
-                {
-                    return;
-                }
-
-                if (mover.Owner.TryGetComponent<InventoryComponent>(out var inventory)
-                    && inventory.TryGetSlotItem<ItemComponent>(EquipmentSlotDefines.Slots.SHOES, out var item)
-                    && item.Owner.TryGetComponent<FootstepModifierComponent>(out var modifier))
-                {
-                    modifier.PlayFootstep();
-                }
-                else
-                {
-                    PlayFootstepSound(mover.Owner, mover.Sprinting);
-                }
+                modifier.PlayFootstep();
+            }
+            else
+            {
+                PlayFootstepSound(mover.Owner, gridId, coordinates, mover.Sprinting);
             }
         }

-        private void PlayFootstepSound(IEntity mover, bool sprinting)
+        private void PlayFootstepSound(IEntity mover, GridId gridId, EntityCoordinates coordinates, bool sprinting)
         {
-            var coordinates = mover.Transform.Coordinates;
-            // Step one: figure out sound collection prototype.
-            var grid = _mapManager.GetGrid(coordinates.GetGridId(EntityManager));
+            var grid = _mapManager.GetGrid(gridId);
             var tile = grid.GetTileRef(coordinates);
+
+            if (tile.IsSpace(_tileDefinitionManager)) return;

             // If the coordinates have a FootstepModifier component
             // i.e. component that emit sound on footsteps emit that sound
@@ -177,19 +178,17 @@
                 soundCollectionName = def.FootstepSounds;
             }

-            // Ok well we know the position of the
-            try
+            if (!_prototypeManager.TryIndex(soundCollectionName, out SoundCollectionPrototype? soundCollection))
             {
-                var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(soundCollectionName);
-                var file = _robustRandom.Pick(soundCollection.PickFiles);
-                SoundSystem.Play(Filter.Pvs(coordinates), file, coordinates, sprinting ? AudioParams.Default.WithVolume(0.75f) : null);
+                Logger.ErrorS("sound", $"Unable to find sound collection for {soundCollectionName}");
+                return;
             }
-            catch (UnknownPrototypeException)
-            {
-                // Shouldn't crash over a sound
-                Logger.ErrorS("sound", $"Unable to find sound collection for {soundCollectionName}");
-            }
+
+            SoundSystem.Play(
+                Filter.Pvs(coordinates),
+                _robustRandom.Pick(soundCollection.PickFiles),
+                mover,
+                sprinting ? AudioParams.Default.WithVolume(0.75f) : null);
         }
-
     }
 }


Use overloaded constructor in creation of middleware

--- Contentful.AspNetCore/MiddleWare/WebhookMiddleware.cs
+++ Contentful.AspNetCore/MiddleWare/WebhookMiddleware.cs
@@ -161,6 +161,11 @@

             configureConsumers(consumerBuilder);

+            if(consumerBuilder.WebhookAuthorization == null)
+            {
+                return builder.UseMiddleware<WebhookMiddleware>(consumerBuilder.Build());
+            }
+
             return builder.UseMiddleware<WebhookMiddleware>(consumerBuilder.Build(), consumerBuilder.WebhookAuthorization);
         }


MS-WOPI: Update capture code according to comments.

--- FileSyncandWOPI/Source/MS-WOPI/Adapter/CaptureCode.cs
+++ FileSyncandWOPI/Source/MS-WOPI/Adapter/CaptureCode.cs
@@ -225,7 +225,6 @@
             {
                 // Check whether "SupportsCoauth" is in JSON. If JSON string contain this item,it must follow JSON response format.
                 if (Common.IsRequirementEnabled("MS-WOPI", 950001, this.Site))
-
                 {
                     //string jsonItem = "SupportsCoauth";
                     Boolean isVerified = false;
@@ -372,23 +371,26 @@
                     //Verify MS-WOPI requirement: MS-WOPI_R292004
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         292004,
                         @"[In Response Body] FileExtension: A string specifying the file extension of the file.");

                     //Verify MS-WOPI requirement: MS-WOPI_R292005
                     this.Site.CaptureRequirementIfIsTrue(
-                        response.Headers[i].StartsWith("."),
+                        response.Headers.AllKeys[i].StartsWith("."),
                         292005,
                         @"[In Response Body] This value [FileExtension] MUST begin with a ""."".");
                 }
                 if (response.Headers.AllKeys[i] == "FileNameMaxLength")
-                //Verify MS-WOPI requirement: MS-WOPI_R292007
-                this.Site.CaptureRequirementIfAreEqual<Type>(
-                    typeof(Int32),
-                    response.Headers[i].GetType(),
-                    292007,
-                    @"[In Response Body] FileNameMaxLength: An integer indicating the maximum length for file names, including the file extension, supported by the WOPI server.");
+                {
+                    int FileNameMaxLength = 0;
+                    Boolean isInt = int.TryParse(response.Headers.AllKeys[i], out FileNameMaxLength);
+                    //Verify MS-WOPI requirement: MS-WOPI_R292007
+                    this.Site.CaptureRequirementIfIsTrue(
+                        isInt,
+                        292007,
+                        @"[In Response Body] FileNameMaxLength: An integer indicating the maximum length for file names, including the file extension, supported by the WOPI server.");
+                }
             }

             this.ValidateURL(checkFileInfo.CloseUrl, "CloseUrl");
@@ -432,7 +434,7 @@
                     //Verify MS-WOPI requirement: MS-WOPI_R370005
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         370005,
                         @"[In PutRelativeFile] X-WOPI-ValidRelativeTarget is a string.");
                 }
@@ -441,7 +443,7 @@
                     //Verify MS-WOPI requirement: MS-WOPI_R370008
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         370008,
                         @"[In PutRelativeFile] X-WOPI-Lock is a string.");
                 }
@@ -450,7 +452,7 @@
                     //Verify MS-WOPI requirement: MS-WOPI_R370013
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         370013,
                         @"[In PutRelativeFile] X-WOPI-LockFailureReason is a string.");
                 }
@@ -470,7 +472,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R401003
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         401003,
                         @"[In Lock] X-WOPI-Lock is a string.");
                 }
@@ -479,7 +481,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R401008
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         401008,
                         @"[In Lock] X-WOPI-LockFailureReason is a string.");
                 }
@@ -499,7 +501,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R422005
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         422005,
                         @"[In Unlock] X-WOPI-Lock is a string.");
                 }
@@ -508,7 +510,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R422010
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         422010,
                         @"[In Unlock] X-WOPI-LockFailureReason is a string.");
                 }
@@ -528,7 +530,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R439005
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         439005,
                         @"[In RefreshLock] X-WOPI-Lock is a string.");
                 }
@@ -537,7 +539,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R439010
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         439010,
                         @"[In RefreshLock] X-WOPI-LockFailureReason is a string.");
                 }
@@ -557,7 +559,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R685005
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         685005,
                         @"[In PutFile] X-WOPI-Lock is a string.");
                 }
@@ -566,7 +568,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R685010
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         685010,
                         @"[In PutFile] X-WOPI-LockFailureReason is a string.");
                 }
@@ -586,7 +588,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R460005
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         460005,
                         @"[In UnlockAndRelock] X-WOPI-Lock is a string.");
                 }
@@ -595,7 +597,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R460010
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         460010,
                         @"[In UnlockAndRelock] X-WOPI-LockFailureReason is a string.");
                 }
@@ -615,7 +617,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R469011
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         469011,
                         @"[In GetLock] X-WOPI-Lock is a string.");
                 }
@@ -624,7 +626,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R469016
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         469016,
                         @"[In GetLock]  X-WOPI-LockFailureReason is a string");
                 }
@@ -653,7 +655,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R592022
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         592022,
                         @"[In RenameFile] X-WOPI-LockFailureReason is a string.");
                 }
@@ -662,7 +664,7 @@
                     // Verify MS-WOPI requirement: MS-WOPI_R592027
                     this.Site.CaptureRequirementIfAreEqual<Type>(
                         typeof(String),
-                        response.Headers[i].GetType(),
+                        response.Headers.AllKeys[i].GetType(),
                         592027,
                         @"[In RenameFile] X-WOPI-LockFailureReason is a string");
                 }


Support for changing default language.

Support for changing default language.

--- Assets/Scripts/MenuUI.cs
+++ Assets/Scripts/MenuUI.cs
@@ -75,7 +75,13 @@
 			_settingsBoard.transform.Find("Language/Selector/Mask/English").gameObject,
 			_settingsBoard.transform.Find("Language/Selector/Mask/Tamil").gameObject
 		};
-
+
+		if(GameConfig.CurrentLanguage == 1)
+		{
+			iTween.MoveTo(_settingsLanguages[0], iTween.Hash("position", new Vector3(0, 35, 0), "time", .001f, "islocal", true));
+			iTween.MoveTo(_settingsLanguages[1], iTween.Hash("position", new Vector3(0, 0, 0), "time", .001f, "islocal", true));
+		}
+
 		_soundToggle = _settingsBoard.transform.Find("Sound/Toggle").GetComponent<Toggle>();
 		_musicToggle = _settingsBoard.transform.Find("Music/Toggle").GetComponent<Toggle>();
 		_volumeSlider = _settingsBoard.transform.Find("Volume/Slider").GetComponent<Slider>();
@@ -124,9 +130,7 @@
 		else if (!_animating && _buttonsDisabled)
 		{
 			foreach (Button button in _levelButtons)
-			{
 				button.interactable = true;
-			}

 			_chaptersBack.GetComponent<Button>().interactable = true;
 			_infoBack.GetComponent<Button>().interactable = true;


fixed acceleration and minimum speed

fixed acceleration and minimum speed

--- Assets/Scripts/Player.cs
+++ Assets/Scripts/Player.cs
@@ -2,13 +2,13 @@
 using System.Collections;

 public class Player : MonoBehaviour {
-	const float MIN_SPEED = 25f;
-	const float MAX_SPEED = 40f;
+	const float MIN_SPEED = 50f;
+	const float MAX_SPEED = 80f;
 	const float FAT_CONSUMPTIONRATE = 0.2f;

 	// Heart Constants
 	const float NORMAL_HEART = 1f;
-	float heartspeedIncrease = 0.1f;
+	float heartspeedIncrease = 0.05f;
 	float heartspeedDecrease = 0.1f;
 	const float HEART_SPEED_MIN = 0.4f;
 	const float STUN_DURATION = 2f;
@@ -33,6 +33,8 @@
 	private float heartbeatTimer;
 	private AudioSource heartbeat;
 	private float stunRemaining;
+
+	public string name;

 	public Player lastTouch;
 	public float sinceTouch;
@@ -99,8 +101,8 @@
 		}
 		if (move != 0) { //if moving
 			//if running
-			if(Input.GetKey(KeyCode.Space) && controllable || AIcontrollable) {
-				rigid.AddForce(transform.forward * move * (moveSpeed * moveSpeedMultiplier));
+			if((Input.GetKey(KeyCode.Space) && controllable) || AIcontrollable) {
+				rigid.AddForce(transform.forward * move * (moveSpeed * moveSpeedMultiplier * 1.25f));
 				if(rigid.velocity.magnitude > MAX_SPEED) {
 					rigid.velocity = rigid.velocity.normalized * MAX_SPEED;
 				}
@@ -118,9 +120,16 @@
 				}
 				increaseHeartbeat(true); //rest
 			}
+
+			if(rigid.velocity.magnitude > MIN_SPEED) {
+				rigid.velocity = rigid.velocity.normalized * MIN_SPEED;
+			}
 		} else {
 			increaseHeartbeat(true); //rest
 		}
+
+
+		if (name == "Me") Debug.Log(name + ": " + rigid.velocity.magnitude.ToString());
 	}

 	private void maxHeartbeatReached() {


Added method for finding the "current" contract for a continuous future. Only time-based CFs work for now.

--- QDMSServer/ContinuousFuturesBroker.cs
+++ QDMSServer/ContinuousFuturesBroker.cs
@@ -20,6 +20,8 @@
 using NLog;
 using QDMS;
 using System;
+using QLNet;
+using Instrument = QDMS.Instrument;

 #pragma warning disable 67
 namespace QDMSServer
@@ -50,12 +52,15 @@
         //This dictionary uses instrument IDs as keys, and holds the data that we use to construct our futures
         private Dictionary<int, List<OHLCBar>> _data;

-        public ContinuousFuturesBroker(IDataClient client = null, IInstrumentSource instrumentMgr = null)
+        public ContinuousFuturesBroker(IDataClient client = null, IInstrumentSource instrumentMgr = null, string clientName = "")
         {
             if (client == null)
             {
+                if(string.IsNullOrEmpty(clientName))
+                    clientName = "CONTFUTCLIENT";
+
                 _client = new QDMSClient.QDMSClient(
-                    "CONTFUTCLIENT",
+                    clientName,
                     "localhost",
                     Properties.Settings.Default.rtDBReqPort,
                     Properties.Settings.Default.rtDBPubPort,
@@ -343,9 +348,11 @@
                     //update the contracts
                     frontFuture = backFuture;
                     backFuture = futures.FirstOrDefault(x => x.Expiration > backFuture.Expiration);
-                    selectedFuture = futures.Where(x => x.Expiration >= frontFuture.Expiration).ElementAt(cf.Month - 1);
+                    selectedFuture = futures.Where(x => x.Expiration >= frontFuture.Expiration).ElementAtOrDefault(cf.Month - 1);
+

                     if (frontFuture == null) break; //no other futures left, get out
+                    if (selectedFuture == null) break;

                     frontData = new TimeSeries(_data[frontFuture.ID.Value]);
                     backData = backFuture != null ? new TimeSeries(_data[backFuture.ID.Value]) : null;
@@ -375,25 +382,6 @@
             RaiseEvent(HistoricalDataArrived, this, new HistoricalDataEventArgs(request, cfData));
         }

-        public event EventHandler<HistoricalDataEventArgs> HistoricalDataArrived;
-        public event EventHandler<ErrorArgs> Error;
-        public event EventHandler<DataSourceDisconnectEventArgs> Disconnected;
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="continuousFuture"></param>
-        /// <returns>The current front future for this continuous futures contract. Null if it is not found.</returns>
-        public Instrument GetCurrentFrontFuture(Instrument continuousFuture)
-        {
-            var searchInstrument = new Instrument { UnderlyingSymbol = continuousFuture.UnderlyingSymbol, Type = InstrumentType.Future };
-            var futures = _instrumentMgr.FindInstruments(search: searchInstrument);
-
-            if (futures.Count == 0) return null;
-            //TODO write this
-            return new Instrument();
-        }
-
         private void Log(LogLevel level, string message)
         {
             Application.Current.Dispatcher.Invoke( () =>
@@ -458,6 +446,94 @@
             if (handler == null) return;
             handler(sender, e);
         }
+
+        /// <summary>
+        /// Finds the currently active futures contract for a continuous futures instrument.
+        /// Returns an ID uniquely identifying this request.
+        /// The contract is returned asynchronously through the FoundFrontContract event.
+        /// </summary>
+        public int FindFrontContract(Instrument cfInstrument, int requestID, DateTime? date = null)
+        {
+            if (!cfInstrument.IsContinuousFuture) throw new Exception("Not a continuous future instrument.");
+
+            DateTime currentDate = DateTime.Now;
+            if (date != null)
+            {
+                currentDate = date.Value;
+            }
+
+            var cf = cfInstrument.ContinuousFuture;
+            if (cf.RolloverType == ContinuousFuturesRolloverType.Time)
+            {
+                //if the roll-over is time based, we can find the appropriate contract programmatically
+                DateTime currentMonthsExpirationDate = cf.UnderlyingSymbol.ExpirationDate(currentDate.Year, currentDate.Month);
+                DateTime switchOverDate = currentMonthsExpirationDate;
+                DateTime selectedDate = currentDate;
+
+                Calendar calendar = MyUtils.GetCalendarFromCountryCode("US"); //TODO make this dynamic
+
+                //this month's contract
+                //find the switchover date
+                int daysBack = cf.RolloverDays;
+                while (daysBack > 0)
+                {
+                    switchOverDate = switchOverDate.AddDays(-1);
+                    if (calendar.isBusinessDay(switchOverDate))
+                        daysBack--;
+                }
+
+                //this month's contract has already been switched to the next one
+                int monthsLeft = 1;
+                int count = 0;
+                if (selectedDate >= switchOverDate)
+                {
+                    while (monthsLeft > 0)
+                    {
+                        if (cf.MonthIsUsed(selectedDate.AddMonths(count).Month))
+                            monthsLeft--;
+                        count++;
+                    }
+                    selectedDate = selectedDate.AddMonths(count);
+                }
+
+                //we found the "front" month, no go back the required number of months
+                //while skipping unused months
+                monthsLeft = cf.Month - 1;
+                count = 0;
+                while (monthsLeft > 0)
+                {
+                    if (cf.MonthIsUsed(selectedDate.AddMonths(count).Month))
+                        monthsLeft--;
+                    count++;
+                }
+                selectedDate = selectedDate.AddMonths(count);
+
+                //we got the month we want! find the contract
+                var searchFunc = new Func<Instrument, bool>(
+                    x =>
+                        x.Expiration.HasValue &&
+                        x.Expiration.Value.Month == selectedDate.Month &&
+                        x.Expiration.Value.Year == selectedDate.Year &&
+                        x.UnderlyingSymbol == cf.UnderlyingSymbol.Symbol);
+
+                var contract = _instrumentMgr.FindInstruments(pred: searchFunc).FirstOrDefault();
+
+                RaiseEvent(FoundFrontContract, this, new FoundFrontContractEventArgs(requestID, contract));
+            }
+            else //otherwise, we have to actually look at the historical data to figure out which contract is selected
+            {
+                //TODO this is a tough one, because it needs to be asynchronous (historical
+                //data can take a long time to download). Not sure where it fits in, either...
+                //move it to the ContinuousFuturesBroker?
+            }
+
+            return 0;
+        }
+
+        public event EventHandler<HistoricalDataEventArgs> HistoricalDataArrived;
+        public event EventHandler<ErrorArgs> Error;
+        public event EventHandler<DataSourceDisconnectEventArgs> Disconnected;
+        public event EventHandler<FoundFrontContractEventArgs> FoundFrontContract;
     }
 }
 #pragma warning restore 67


FUCK. FUCK. FUCK.

FUCK. FUCK. FUCK.

--- AutoCountdown/Program.cs
+++ AutoCountdown/Program.cs
@@ -29,7 +29,7 @@

         static void IncomingImage(Object sender, NewImageEventArgs e)
         {
-            return;
+            //return;
             Bitmap Output = e.DecodedOutput;
             // First test to see if its the frame we want.
             Color Target = Color.FromArgb(255, 49, 76, 153);


Wrote the mechanism to find the front contract at a specified date, for non-time-based continuous futures.

--- QDMSServer/ContinuousFuturesBroker.cs
+++ QDMSServer/ContinuousFuturesBroker.cs
@@ -42,12 +42,24 @@
         // Key: request ID, Value: the list of contracts used to fulfill this request
         private readonly Dictionary<int, List<Instrument>> _contracts;

-        // Keeps track of the requests. Key: request ID, Value: the request
+        /// <summary>
+        ///  Keeps track of the requests. Key: request ID, Value: the request
+        /// </summary>
         private readonly Dictionary<int, HistoricalDataRequest> _requests;

+        /// <summary>
+        /// Front contract requests that need data to be downloaded, receive a HistoricalDataRequest
+        /// that is held in _requests. The same AssignedID also corresponds to a FrontContractRequest held here.
+        /// </summary>
+        private readonly Dictionary<int, FrontContractRequest> _frontContractRequestMap;
+
+        //keeps track of whether requests are for data, or for the front contract. True = data.
+        private readonly Dictionary<int, bool> _requestTypes;
+
         private readonly Logger _logger = LogManager.GetCurrentClassLogger();

         private readonly object _reqCountLock = new object();
+        private readonly object _requestsLock = new object();

         // Holds requests for the front contract of a CF, before they get processed
         private readonly BlockingCollection<FrontContractRequest> _frontContractRequests;
@@ -133,9 +145,29 @@
                 if (_requestCounts[cfReqID] == 0)
                 {
                     //we have received all the data we asked for
-                    //so now we want to generate the continuous prices
                     _requestCounts.Remove(e.Request.RequestID);
-                    GetContFutData(_requests[cfReqID]);
+                    HistoricalDataRequest req;
+                    lock (_requestsLock)
+                    {
+                        req = _requests[cfReqID];
+                        _requests.Remove(cfReqID);
+                    }
+
+                    if (_requestTypes[cfReqID])
+                    {
+                        //This request originates from a CF data request
+                        //so now we want to generate the continuous prices
+                        GetContFutData(req);
+                    }
+                    else
+                    {
+                        //This request originates from a front contract request
+                        Instrument frontContract = GetContFutData(req);
+                        FrontContractRequest originalReq = _frontContractRequestMap[cfReqID];
+                        RaiseEvent(FoundFrontContract, this, new FoundFrontContractEventArgs(originalReq.ID, frontContract, originalReq.Date.Value));
+                    }
+
+                    _requestTypes.Remove(e.Request.AssignedID);
                 }
             }
         }
@@ -153,11 +185,16 @@
             {
                 UnderlyingSymbol = request.Instrument.ContinuousFuture.UnderlyingSymbol.Symbol,
                 Type = InstrumentType.Future,
-                DatasourceID = request.Instrument.DatasourceID,
-                Datasource = request.Instrument.Datasource
+                DatasourceID = request.Instrument.DatasourceID
             };

             var futures = _instrumentMgr.FindInstruments(search: searchInstrument);
+
+            if (futures == null)
+            {
+                Log(LogLevel.Error, "CFB: Error in GetRequiredRequests, failed to return any contracts to historical request ID: " + request.AssignedID);
+                return requests;
+            }

             //order them by ascending expiration date
             futures = futures.OrderBy(x => x.Expiration).ToList();
@@ -178,9 +215,14 @@
             }

             //the first contract we need is the first one expiring before the start of the request period
-            var firstExpiration = futures
+            var expiringBeforeStart = futures
                 .Where(x => x.Expiration != null && x.Expiration.Value < request.StartingDate)
-                .Select(x => x.Expiration.Value).Max();
+                .Select(x => x.Expiration.Value).ToList();
+            DateTime firstExpiration;
+            if (expiringBeforeStart.Count > 0)
+                firstExpiration = expiringBeforeStart.Max();
+            else
+                firstExpiration = futures.Select(x => x.Expiration.Value).Min();

             futures = futures.Where(x => x.Expiration != null && x.Expiration.Value >= firstExpiration).ToList();

@@ -257,7 +299,11 @@
                 request.AssignedID));

             // add it to the collection of requests so we can access it later
-            _requests.Add(request.AssignedID, request);
+            lock (_requestsLock)
+            {
+                _requests.Add(request.AssignedID, request);
+            }
+            _requestTypes.Add(request.AssignedID, true);

             //find what contracts we need
             var reqs = GetRequiredRequests(request);
@@ -312,8 +358,7 @@
             //And at that time both the front and back futures are really far from expiration.
             //As such volumes can be wonky, and thus result in a rollover far before we ACTUALLY would
             //want to roll over if we had access to even earlier data.
-            if (frontFuture.Expiration.Value < request.StartingDate)
-                currentDate = frontFuture.Expiration.Value.AddDays(-20);
+            currentDate = frontFuture.Expiration.Value.AddDays(-20 - cf.RolloverDays);

             //final date is the earliest of: the last date of data available, or the request's endingdate
             DateTime lastDateAvailable = futures.Last().Expiration.Value;
@@ -559,11 +604,11 @@
         /// CFs with a time-based switchover are calculated on the spot
         /// CFs with other types of switchover require data, so we send off the appropriate data requests here
         /// </summary>
-        private void ProcessFrontContractRequests(FrontContractRequest req)
-        {
-            DateTime currentDate = req.Date ?? DateTime.Now;
-
-            var cf = req.Instrument.ContinuousFuture;
+        private void ProcessFrontContractRequest(FrontContractRequest request)
+        {
+            DateTime currentDate = request.Date ?? DateTime.Now;
+
+            var cf = request.Instrument.ContinuousFuture;
             if (cf.RolloverType == ContinuousFuturesRolloverType.Time)
             {
                 //if the roll-over is time based, we can find the appropriate contract programmatically
@@ -625,16 +670,60 @@

                 var contract = _instrumentMgr.FindInstruments(pred: searchFunc).FirstOrDefault();

-                RaiseEvent(FoundFrontContract, this, new FoundFrontContractEventArgs(req.ID, contract, currentDate));
+                RaiseEvent(FoundFrontContract, this, new FoundFrontContractEventArgs(request.ID, contract, currentDate));
             }
             else //otherwise, we have to actually look at the historical data to figure out which contract is selected
             {
                 //this is a tough one, because it needs to be asynchronous (historical
                 //data can take a long time to download).
-
-                //we use RequestHistoricalData to download the data,
-                //then when it's here we use GetContFutData to get the contract
-                //We keep track of it using the ID of the historical data request.....?
+                var r = new Random();
+
+                //we use GetRequiredRequests to get the historical requests we need to make
+                var tmpReq = new HistoricalDataRequest()
+                {
+                    Instrument = request.Instrument,
+                    StartingDate = currentDate.AddDays(-1),
+                    EndingDate = currentDate,
+                    Frequency = BarSize.OneDay
+                };
+
+                //give the request a unique id
+                lock (_requestsLock)
+                {
+                    int id;
+                    do
+                    {
+                        id = r.Next();
+                    } while (_requests.ContainsKey(id));
+                    tmpReq.AssignedID = id;
+                    _requests.Add(tmpReq.AssignedID, tmpReq);
+                }
+
+                var reqs = GetRequiredRequests(tmpReq);
+                //make sure the request is fulfillable with the available contracts, otherwise return empty-handed
+                if (reqs.Count == 0 || reqs.Count(x => x.Instrument.Expiration.HasValue && x.Instrument.Expiration.Value >= request.Date) == 0)
+                {
+                    RaiseEvent(FoundFrontContract, this, new FoundFrontContractEventArgs(request.ID, null, currentDate));
+                    lock (_requestsLock)
+                    {
+                        _requests.Remove(tmpReq.AssignedID);
+                    }
+                    return;
+                }
+
+                // add it to the collection of requests so we can access it later
+                _requestTypes.Add(tmpReq.AssignedID, false);
+
+                //add it to the front contract requests map
+                _frontContractRequestMap.Add(tmpReq.AssignedID, request);
+
+                //finally send out a request for all the data...when it arrives,
+                //we process it and return the required front future
+                foreach (HistoricalDataRequest req in reqs)
+                {
+                    int requestID = _client.RequestHistoricalData(req);
+                    _histReqIDMap.Add(requestID, tmpReq.AssignedID);
+                }
             }
         }


Deleted some template stuff

Deleted some template stuff

--- GamePortal/GamePortal.WebSite/Views/Home/Index.cshtml
+++ GamePortal/GamePortal.WebSite/Views/Home/Index.cshtml
@@ -1,45 +1,14 @@
 @{
     ViewBag.Title = "GAMERS PORTAL";
+    ViewBag.Message = "A portal for all gamers!";
 }
+
 @section featured {

             <hgroup class="title">

@ViewBag.Title.

-
@ViewBag.Message

             </hgroup>
-

-                To learn more about ASP.NET MVC visit
-                http://asp.net/mvc.
-                The page features videos, tutorials, and samples to help you get the most from ASP.NET MVC.
-                If you have any questions about ASP.NET MVC visit
-                our forums.
-

-}
-
We suggest the following:

-

-

-
Getting Started

-        ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that
-        enables a clean separation of concerns and that gives you full control over markup
-        for enjoyable, agile development. ASP.NET MVC includes many features that enable
-        fast, TDD-friendly development for creating sophisticated applications that use
-        the latest web standards.
-        Learn more…
-

-
-

-
Add NuGet packages and jump-start your coding

-        NuGet makes it easy to install and update free libraries and tools.
-        Learn more…
-

-
-

-
Find Web Hosting

-        You can easily find a web hosting company that offers the right mix of features
-        and price for your applications.
-        Learn more…
-

-

+}


Show warning to log when format exception happens.

--- RdlEngine/Functions/FunctionFormat.cs
+++ RdlEngine/Functions/FunctionFormat.cs
@@ -120,8 +120,9 @@
 			{
 				result = String.Format("{0:" + format + "}", o);
 			}
-			catch 		// invalid format string specified
-			{			//    treat as a weak error
+			catch (Exception ex) 		// invalid format string specified
+			{           //    treat as a weak error
+				rpt.rl.LogError(2, String.Format("Format string:{1} Value Type:{2} Exception:{0}", ex.Message, format, o.GetType().Name));
 				result = o.ToString();
 			}
 			return result;


show the time in Milliseconds

show the time in Milliseconds

--- Hangfire.AzureDocumentDB/DocumentDbDistributedLock.cs
+++ Hangfire.AzureDocumentDB/DocumentDbDistributedLock.cs
@@ -106,7 +106,7 @@
                 System.Threading.Thread.Sleep(2000);
             }

-            logger.Trace($"Acquired lock for {resource} in {acquireStart.Elapsed.TotalSeconds} seconds");
+            logger.Trace($"Acquired lock for {resource} in {acquireStart.Elapsed.TotalMilliseconds:#.##} ms");
         }

     }


작업자 간에 동기화 처리

작업자 간에 동기화 처리

--- Bible2PPT/PPT/Builder.cs
+++ Bible2PPT/PPT/Builder.cs
@@ -229,6 +229,7 @@

             // (targetEachVerses, mainBook, mainChapter)
             var queue = new ConcurrentQueue<Tuple<IEnumerable<IEnumerable<Verse>>, Book, Chapter>>();
+            var sync = new AutoResetEvent(false);

             var queries = job.QueryString.Split().Select(BibleQuery.ParseQuery).ToList();
             var e = new JobProgressEventArgs(job, null, 0, queries.Count, 0, 0);
@@ -286,6 +287,7 @@

                         var targetEachVerses = Inverse(eachTargetVerses);
                         queue.Enqueue(Tuple.Create(targetEachVerses, mainBook, mainChapter));
+                        sync.WaitOne();

                     PROGRESS_CHAPTER:
                         e = new JobProgressEventArgs(job, e.CurrentChapter, e.QueriesDone, e.Queries, e.ChaptersDone + 1, e.Chapters);
@@ -305,6 +307,7 @@
                 {
                     if (queue.TryDequeue(out var item))
                     {
+                        sync.Set();
                         var targetEachVerses = item.Item1;
                         var mainBook = item.Item2;
                         var mainChapter = item.Item3;
@@ -328,6 +331,7 @@
                     {
                         if (queue.TryDequeue(out var item))
                         {
+                            sync.Set();
                             var targetEachVerses = item.Item1;
                             var mainBook = item.Item2;
                             var mainChapter = item.Item3;


small refactoring for typeIsCollection variable (#498)

--- Refit/RequestBuilderImplementation.cs
+++ Refit/RequestBuilderImplementation.cs
@@ -565,12 +565,7 @@
                     // Check to see if it's an IEnumerable
                     var itemValue = paramList[i];
                     var enumerable = itemValue as IEnumerable<object>;
-                    var typeIsCollection = false;
-
-                    if (enumerable != null)
-                    {
-                        typeIsCollection = true;
-                    }
+                    var typeIsCollection = enumerable != null;

                     if (typeIsCollection)
                     {


Fix saving of database settings

Fix saving of database settings

--- Integration/Editor/Database/EditorLSDatabaseWindow.cs
+++ Integration/Editor/Database/EditorLSDatabaseWindow.cs
@@ -94,6 +94,7 @@
                 EditorGUILayout.PropertyField (editorTypeProp, new GUIContent ("Editor Type"));
                 SerializedProperty databaseTypeProp = obj.FindProperty("_databaseType");
                 EditorGUILayout.PropertyField (databaseTypeProp, new GUIContent ("Database Type"));
+                //EditorPrefs.SetString ("_databaseType",_databaseType.name);
                 obj.ApplyModifiedProperties ();

             }


Fix ordering bug

Fix ordering bug

--- JoinRpg.Services.Impl/Allrpg/AllrpgProjectImporter.cs
+++ JoinRpg.Services.Impl/Allrpg/AllrpgProjectImporter.cs
@@ -300,7 +300,7 @@
         Claims = new List<Claim>(),
         IsAcceptingClaims = true,
         Groups = new List<CharacterGroup>() {GetGroupByAllrpgId(vacancy.locat)},
-        PlotElementOrderData = "allrpg" + vacancy.code
+        PlotElementOrderData = $"allrpg{vacancy.code:00000}"
       };

       Characters.Add(vacancy.id, character);
@@ -388,7 +388,7 @@
         HaveDirectSlots = true,
         IsPublic = true,
         Description = new MarkdownString(locationData.content.Trim()),
-        ChildGroupsOrdering = "allrpg!"+locationData.code
+        ChildGroupsOrdering = $"allrpg!{locationData.code:00000}"
       };

       LocationsFromVacancies.Add(locationData.id, characterGroup);
@@ -416,7 +416,7 @@
         HaveDirectSlots = false,
         IsPublic = locationData.rights == 0,
         Description = new MarkdownString(locationData.description.Trim()),
-        ChildGroupsOrdering = "allrpg" + locationData.code
+        ChildGroupsOrdering = $"allrpg!{locationData.code:00000}"
       };

       Locations.Add(locationData.id,characterGroup);


Minor

Minor

--- Samples.Client.Model/WarehouseItem.cs
+++ Samples.Client.Model/WarehouseItem.cs
@@ -14,11 +14,9 @@
             int quantity)
         {
             Id = Guid.NewGuid();
-            Kind = kind;
-            Price = price;
-            Quantity = quantity;
-
-            CommitChanges();
+            _kind = kind;
+            _price = price;
+            _quantity = quantity;
         }

         private string _kind;


Fix Double Tap Prevention not turning off properly

--- LiveSplit/LiveSplit.Core/Model/DoubleTapPrevention.cs
+++ LiveSplit/LiveSplit.Core/Model/DoubleTapPrevention.cs
@@ -56,6 +56,9 @@

         protected bool CheckDoubleTap()
         {
+            if (!CurrentState.Settings.DoubleTapPrevention)
+                return true;
+
             if (CurrentState.CurrentPhase == TimerPhase.Ended)
                 return TimeStamp.Now - LastEvent > LongDelay;


Add summary.

Add summary.

--- Sandra.UI.WF/Storage/JsonTokenizer.cs
+++ Sandra.UI.WF/Storage/JsonTokenizer.cs
@@ -28,6 +28,12 @@
     /// </summary>
     public sealed class JsonTokenizer
     {
+        /// <summary>
+        /// Initializes a new instance of <see cref="JsonTokenizer"/>.
+        /// </summary>
+        /// <param name="json">
+        /// The JSON to tokenize.
+        /// </param>
         public JsonTokenizer(string json)
         {
             if (json == null) throw new ArgumentNullException(nameof(json));


Green: Provide implementations for VisitErrorString().

--- Sandra.UI.WF/Tests/JsonSyntaxTests.cs
+++ Sandra.UI.WF/Tests/JsonSyntaxTests.cs
@@ -182,6 +182,7 @@
             public override void VisitComment(JsonComment symbol) => VisitedType = typeof(JsonComment);
             public override void VisitCurlyClose(JsonCurlyClose symbol) => VisitedType = typeof(JsonCurlyClose);
             public override void VisitCurlyOpen(JsonCurlyOpen symbol) => VisitedType = typeof(JsonCurlyOpen);
+            public override void VisitErrorString(JsonErrorString symbol) => VisitedType = typeof(JsonErrorString);
             public override void VisitSquareBracketClose(JsonSquareBracketClose symbol) => VisitedType = typeof(JsonSquareBracketClose);
             public override void VisitSquareBracketOpen(JsonSquareBracketOpen symbol) => VisitedType = typeof(JsonSquareBracketOpen);
             public override void VisitString(JsonString symbol) => VisitedType = typeof(JsonString);
@@ -210,6 +211,7 @@
             public override Type VisitComment(JsonComment symbol) => typeof(JsonComment);
             public override Type VisitCurlyClose(JsonCurlyClose symbol) => typeof(JsonCurlyClose);
             public override Type VisitCurlyOpen(JsonCurlyOpen symbol) => typeof(JsonCurlyOpen);
+            public override Type VisitErrorString(JsonErrorString symbol) => typeof(JsonErrorString);
             public override Type VisitSquareBracketClose(JsonSquareBracketClose symbol) => typeof(JsonSquareBracketClose);
             public override Type VisitSquareBracketOpen(JsonSquareBracketOpen symbol) => typeof(JsonSquareBracketOpen);
             public override Type VisitString(JsonString symbol) => typeof(JsonString);


refinamento

refinamento

--- ManagementRevitPlugin/ManagementRevitPlugin/Plugin.cs
+++ ManagementRevitPlugin/ManagementRevitPlugin/Plugin.cs
@@ -50,7 +50,6 @@
         {
             // Find all Wall instances in the document by using category filter
             ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_Walls);
-
             // Apply the filter to the elements in the active document
             // Use shortcut WhereElementIsNotElementType() to find wall instances only
             FilteredElementCollector collector = new FilteredElementCollector(document);
@@ -59,11 +58,13 @@
             String prompt = string.Format("Total Walls: {0}. The walls in the current document are:\n", walls.Count);
             Wall wall;
             Double total = 0d;
+            Parameter parameter;
             foreach (Element e in walls)
             {
                 wall = e as Wall;
-                total += wall.get_Parameter(BuiltInParameter.HOST_AREA_COMPUTED).AsDouble();
-                prompt += total+"\n";
+                parameter = wall.get_Parameter(BuiltInParameter.HOST_AREA_COMPUTED);
+                prompt += string.Format("{0} ({1})\n", parameter.AsDouble(), parameter.DisplayUnitType);
+                total += parameter.AsDouble();
                 //prompt += wall.GetMaterialArea(e.Id, true) + "\n";
             }
             prompt = "Total: " + total+"\n"+prompt;


GetDepth() and GetName()

GetDepth() and GetName()

--- Scripts/DapCore/registry_/Registry.cs
+++ Scripts/DapCore/registry_/Registry.cs
@@ -76,6 +76,26 @@
                     }
                 }
             }
+        }
+
+        public static int GetDepth(string path) {
+            if (string.IsNullOrEmpty(path)) return 0;
+            int depth = 1;
+            foreach (char ch in path) {
+                if (ch == RegistryConsts.Separator) {
+                    depth++;
+                }
+            }
+            return depth;
+        }
+
+        public static string GetName(string path) {
+            if (string.IsNullOrEmpty(path)) return null;
+            int pos = path.LastIndexOf(RegistryConsts.Separator);
+            if (pos >= 0) {
+                return path.Substring(pos + 1);
+            }
+            return path;
         }

         public static string GetParentPath(string path) {


Disable 'Outlines' model view mode

Disable 'Outlines' model view mode

--- MatterControlLib/PartPreviewWindow/ViewStyleButton.cs
+++ MatterControlLib/PartPreviewWindow/ViewStyleButton.cs
@@ -96,6 +96,7 @@
 				useRadioStyle: true,
 				siblingRadioButtonList: siblingList);

+			/*
 			popupMenu.CreateBoolMenuItem(
 				"Outlines".Localize(),
 				viewIcons[RenderTypes.Outlines],
@@ -105,7 +106,7 @@
 					sceneContext.ViewState.RenderType = RenderTypes.Outlines;
 				},
 				useRadioStyle: true,
-				siblingRadioButtonList: siblingList);
+				siblingRadioButtonList: siblingList); */

 			popupMenu.CreateBoolMenuItem(
 				"Polygons".Localize(),


Only server can manager subscribers

Only server can manager subscribers

--- Scripts/GameApi/LiteNetLibIdentity.cs
+++ Scripts/GameApi/LiteNetLibIdentity.cs
@@ -259,6 +259,10 @@

         internal void ClearSubscribers()
         {
+            // Only server can manage subscribers
+            if (!IsServer)
+                return;
+
             var values = Subscribers.Values;
             foreach (var subscriber in values)
             {
@@ -269,6 +273,10 @@

         internal void AddSubscriber(LiteNetLibPlayer subscriber)
         {
+            // Only server can manage subscribers
+            if (!IsServer)
+                return;
+
             if (Subscribers.ContainsKey(subscriber.ConnectId))
             {
                 if (Manager.LogDebug)
@@ -282,13 +290,26 @@

         internal void RemoveSubscriber(LiteNetLibPlayer subscriber, bool removePlayerSubscribing = true)
         {
+            // Only server can manage subscribers
+            if (!IsServer)
+                return;
+
             Subscribers.Remove(subscriber.ConnectId);
             if (removePlayerSubscribing)
                 subscriber.RemoveSubscribing(this, false);
         }

+        internal bool ContainsSubscriber(long connectId)
+        {
+            return Subscribers.ContainsKey(connectId);
+        }
+
         public void RebuildSubscribers(bool initialize)
         {
+            // Only server can manage subscribers
+            if (!IsServer)
+                return;
+
             bool changed = false;
             bool shouldRebuild = false;
             HashSet<LiteNetLibPlayer> newSubscribers = new HashSet<LiteNetLibPlayer>();
@@ -340,6 +361,7 @@
                 }
             }

+            // Remove subscribers that is not in new subscribers list
             foreach (var subscriber in oldSubscribers)
             {
                 if (!newSubscribers.Contains(subscriber))


Slight changes to email message sending code

--- SecretSanta/Utilities/EmailMessage.cs
+++ SecretSanta/Utilities/EmailMessage.cs
@@ -10,22 +10,25 @@
         {
             using (var smtp = new SmtpClient(AppSettings.SmtpHost, AppSettings.SmtpPort))
             {
-                var message = new MailMessage();
-                message.From = from;
-                foreach (MailAddress recipient in to)
+                smtp.UseDefaultCredentials = false;
+                smtp.Credentials = new NetworkCredential(AppSettings.SmtpUser, AppSettings.SmtpPass);
+                smtp.EnableSsl = true;
+
+                using (var message = new MailMessage())
                 {
-                    message.To.Add(recipient);
+                    foreach (MailAddress recipient in to)
+                    {
+                        message.To.Add(recipient);
+                    }
+                    message.Subject = subject;
+                    message.Body = body.Replace(Environment.NewLine, "
");
+                    message.From = from;
+                    message.ReplyToList.Clear();
+                    message.ReplyToList.Add(from);
+                    message.IsBodyHtml = true;
+
+                    smtp.Send(message);
                 }
-                message.Subject = subject;
-                message.Body = body.Replace(Environment.NewLine, "
");
-                message.From = from;
-                message.ReplyToList.Clear();
-                message.ReplyToList.Add(from);
-                message.IsBodyHtml = true;
-
-                smtp.EnableSsl = true;
-                smtp.Credentials = new NetworkCredential(AppSettings.SmtpUser, AppSettings.SmtpPass);
-                smtp.Send(message);
             }
         }
     }


Add detected files to result

Add detected files to result

--- MediaBrowser.ApiInteraction/Data/LocalAssetManager.cs
+++ MediaBrowser.ApiInteraction/Data/LocalAssetManager.cs
@@ -121,6 +121,8 @@
                 {
                     itemFile.Type = ItemFileType.Media;
                 }
+
+                itemFiles.Add(itemFile);
             }

             return itemFiles;


check for nulls in the namevaluecollection

--- Mindscape.Raygun4Net/Messages/RaygunRequestMessage.cs
+++ Mindscape.Raygun4Net/Messages/RaygunRequestMessage.cs
@@ -3,6 +3,7 @@
 using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.IO;
+using System.Linq;
 using System.Web;

 namespace Mindscape.Raygun4Net.Messages
@@ -42,7 +43,7 @@

     private static IDictionary ToDictionary(NameValueCollection nameValueCollection, bool truncateValues = false)
     {
-      var keys = nameValueCollection.AllKeys;
+      var keys = nameValueCollection.AllKeys.Where(k => k != null);
       var dictionary = new Dictionary<string, string>();

       foreach (string key in keys)
@@ -59,7 +60,7 @@
               keyToSend = keyToSend.Substring(0, 256);
             }

-            if (valueToSend.Length > 256)
+            if (valueToSend != null && valueToSend.Length > 256)
             {
               valueToSend = valueToSend.Substring(0, 256);
             }


The negation syntax was used on event binding. For example, if the binding was {NavigationData !key} the c# generated would be !NavigationData["key"] = !NavigationData["!key"]. Changed so that negation is ignored for event binding so c# is now NavigationData["key"] = !NavigationData["key"]

--- Navigation/NavigationDataControlBuilderInterceptor.cs
+++ Navigation/NavigationDataControlBuilderInterceptor.cs
@@ -169,7 +169,7 @@
 				{
 					listener.Parameters.Add(new CodeParameterDeclarationExpression(new CodeTypeReference(parameter.ParameterType, CodeTypeReferenceOptions.GlobalReference), parameter.Name));
 				}
-				listener.Statements.Add(new CodeAssignStatement(GetNavigationDataAsType(null, navigationData, value, null, controlBuilder, null, linePragma), GetNavigationDataAsType(typeof(bool), navigationData, "!" + value, null, controlBuilder, null, linePragma)));
+				listener.Statements.Add(new CodeAssignStatement(GetNavigationDataAsType(null, navigationData, value, null, controlBuilder, null, linePragma), GetNavigationDataAsType(typeof(bool), navigationData, value.StartsWith("!", StringComparison.OrdinalIgnoreCase) ? value : "!" + value, null, controlBuilder, null, linePragma)));
 				listener.Statements[0].LinePragma = linePragma;
 				AttachEvent(false, listener, eventInfo.Name, eventInfo.EventHandlerType, linePragma, buildMethod, navigationDataClass);
 				return true;
@@ -243,7 +243,7 @@
 			if (navigationDataKey.Length == 0)
 				throw new HttpParseException(string.Format(CultureInfo.CurrentCulture, Resources.NavigationDataKeyMissing), null, controlBuilder.PageVirtualPath, null, linePragma.LineNumber);
 			CodeExpression navigationDataIndexer = new CodeIndexerExpression(navigationData, new CodePrimitiveExpression(navigationDataKey));
-			if (negation)
+			if (type != null && negation)
 				navigationDataIndexer = new CodeMethodInvokeExpression(new CodeMethodReferenceExpression(new CodeCastExpression(new CodeTypeReference(typeof(bool), CodeTypeReferenceOptions.GlobalReference), navigationDataIndexer), "Equals"), new CodePrimitiveExpression(false));
 			if (type == null || (type == typeof(bool) && negation))
 				return navigationDataIndexer;


Correcting JsResultCommand regression

Correcting JsResultCommand regression

--- Neutronium.Core/Binding/GlueObject/JsResultCommand.cs
+++ Neutronium.Core/Binding/GlueObject/JsResultCommand.cs
@@ -82,7 +82,7 @@

         private async Task SetResult(IJavascriptObject promise, IJSCSGlue bridgevalue)
         {
-            if (bridgevalue == null)
+            if (promise == null)
                 return;

             await WebView.RunAsync(async () =>


Removed namespace

Removed namespace

--- Octokit.Tests.Integration/Clients/GistsClientTests.cs
+++ Octokit.Tests.Integration/Clients/GistsClientTests.cs
@@ -1,130 +1,129 @@
 using System;
 using System.Linq;
 using System.Threading.Tasks;
+using Octokit;
+using Octokit.Tests.Integration;
 using Xunit;

-namespace Octokit.Tests.Integration.Clients
+public class GistsClientTests
 {
-    public class GistsClientTests
+    readonly IGistsClient _fixture;
+    const string testGistId = "6305249";
+
+    public GistsClientTests()
     {
-        readonly IGistsClient _fixture;
-        const string testGistId = "6305249";
+        var client = new GitHubClient(new ProductHeaderValue("OctokitTests"))
+        {
+            Credentials = Helper.Credentials
+        };

-        public GistsClientTests()
+        _fixture = client.Gist;
+    }
+
+    [IntegrationTest]
+    public async Task CanGetGist()
+    {
+        var retrieved = await _fixture.Get(testGistId);
+        Assert.NotNull(retrieved);
+    }
+
+    [IntegrationTest]
+    public async Task CanCreateEditAndDeleteAGist()
+    {
+        var newGist = new NewGist { Description = "my new gist", Public = true };
+
+        newGist.Files.Add("myGistTestFile.cs", "new GistsClient(connection).Create();");
+
+        var createdGist = await _fixture.Create(newGist);
+
+        Assert.NotNull(createdGist);
+        Assert.Equal(newGist.Description, createdGist.Description);
+        Assert.Equal(newGist.Public, createdGist.Public);
+
+        var gistUpdate = new GistUpdate { Description = "my newly updated gist" };
+        var gistFileUpdate = new GistFileUpdate
         {
-            var client = new GitHubClient(new ProductHeaderValue("OctokitTests"))
-            {
-                Credentials = Helper.Credentials
-            };
+            NewFileName = "myNewGistTestFile.cs",
+            Content = "new GistsClient(connection).Edit();"
+        };

-            _fixture = client.Gist;
-        }
+        gistUpdate.Files.Add("myGistTestFile.cs", gistFileUpdate);

-        [IntegrationTest]
-        public async Task CanGetGist()
-        {
-            var retrieved = await _fixture.Get(testGistId);
-            Assert.NotNull(retrieved);
-        }
+        var updatedGist = await _fixture.Edit(createdGist.Id, gistUpdate);

-        [IntegrationTest]
-        public async Task CanCreateEditAndDeleteAGist()
-        {
-            var newGist = new NewGist { Description = "my new gist", Public = true };
+        Assert.NotNull(updatedGist);
+        Assert.Equal(updatedGist.Description, gistUpdate.Description);

-            newGist.Files.Add("myGistTestFile.cs", "new GistsClient(connection).Create();");
+        Assert.DoesNotThrow(async () => { await _fixture.Delete(createdGist.Id); });
+    }

-            var createdGist = await _fixture.Create(newGist);
+    [IntegrationTest]
+    public async Task CanStarAndUnstarAGist()
+    {
+        await _fixture.Star(testGistId);

-            Assert.NotNull(createdGist);
-            Assert.Equal(newGist.Description, createdGist.Description);
-            Assert.Equal(newGist.Public, createdGist.Public);
+        var isStarredTrue = await _fixture.IsStarred(testGistId);
+        Assert.True(isStarredTrue);

-            var gistUpdate = new GistUpdate { Description = "my newly updated gist" };
-            var gistFileUpdate = new GistFileUpdate
-            {
-                NewFileName = "myNewGistTestFile.cs",
-                Content = "new GistsClient(connection).Edit();"
-            };
+        await _fixture.Unstar(testGistId);

-            gistUpdate.Files.Add("myGistTestFile.cs", gistFileUpdate);
+        var isStarredFalse = await _fixture.IsStarred(testGistId);
+        Assert.False(isStarredFalse);
+    }

-            var updatedGist = await _fixture.Edit(createdGist.Id, gistUpdate);
+    [IntegrationTest]
+    public async Task CanForkAGist()
+    {
+        var forkedGist = await _fixture.Fork(testGistId);

-            Assert.NotNull(updatedGist);
-            Assert.Equal(updatedGist.Description, gistUpdate.Description);
+        Assert.NotNull(forkedGist);

-            Assert.DoesNotThrow(async () => { await _fixture.Delete(createdGist.Id); });
-        }
+        await _fixture.Delete(forkedGist.Id);
+    }

-        [IntegrationTest]
-        public async Task CanStarAndUnstarAGist()
-        {
-            await _fixture.Star(testGistId);
+    [IntegrationTest]
+    public async Task CanListGists()
+    {
+        // Time is tricky between local and remote, be lenient
+        var startTime = DateTimeOffset.Now.Subtract(TimeSpan.FromHours(1));
+        var newGist = new NewGist { Description = "my new gist", Public = true };

-            var isStarredTrue = await _fixture.IsStarred(testGistId);
-            Assert.True(isStarredTrue);
+        newGist.Files.Add("myGistTestFile.cs", "new GistsClient(connection).Create();");

-            await _fixture.Unstar(testGistId);
+        var createdGist = await _fixture.Create(newGist);

-            var isStarredFalse = await _fixture.IsStarred(testGistId);
-            Assert.False(isStarredFalse);
-        }
+        // Test get all Gists
+        var gists = await _fixture.GetAll();
+        Assert.NotNull(gists);

-        [IntegrationTest]
-        public async Task CanForkAGist()
-        {
-            var forkedGist = await _fixture.Fork(testGistId);
+        // Test get all Gists since startTime
+        gists = await _fixture.GetAll(startTime);

-            Assert.NotNull(forkedGist);
+        Assert.NotNull(gists);
+        Assert.True(gists.Count > 0);

-            await _fixture.Delete(forkedGist.Id);
-        }
+        // Make sure we can successfully request gists for another user
+        Assert.DoesNotThrow(async () => { await _fixture.GetAllForUser("FakeHaacked"); });
+        Assert.DoesNotThrow(async () => { await _fixture.GetAllForUser("FakeHaacked", startTime); });

-        [IntegrationTest]
-        public async Task CanListGists()
-        {
-            // Time is tricky between local and remote, be lenient
-            var startTime = DateTimeOffset.Now.Subtract(TimeSpan.FromHours(1));
-            var newGist = new NewGist { Description = "my new gist", Public = true };
+        // Test public gists
+        var publicGists = await _fixture.GetAllPublic();
+        Assert.True(publicGists.Count > 1);

-            newGist.Files.Add("myGistTestFile.cs", "new GistsClient(connection).Create();");
+        var publicGistsSinceStartTime = await _fixture.GetAllPublic(startTime);
+        Assert.True(publicGistsSinceStartTime.Count > 0);

-            var createdGist = await _fixture.Create(newGist);
+        // Test starred gists
+        await _fixture.Star(createdGist.Id);
+        var starredGists = await _fixture.GetAllStarred();

-            // Test get all Gists
-            var gists = await _fixture.GetAll();
-            Assert.NotNull(gists);
+        Assert.NotNull(starredGists);
+        Assert.True(starredGists.Any(x => x.Id == createdGist.Id));

-            // Test get all Gists since startTime
-            gists = await _fixture.GetAll(startTime);
+        var starredGistsSinceStartTime = await _fixture.GetAllStarred(startTime);
+        Assert.NotNull(starredGistsSinceStartTime);
+        Assert.True(starredGistsSinceStartTime.Any(x => x.Id == createdGist.Id));

-            Assert.NotNull(gists);
-            Assert.True(gists.Count > 0);
-
-            // Make sure we can successfully request gists for another user
-            Assert.DoesNotThrow(async () => { await _fixture.GetAllForUser("FakeHaacked"); });
-            Assert.DoesNotThrow(async () => { await _fixture.GetAllForUser("FakeHaacked", startTime); });
-
-            // Test public gists
-            var publicGists = await _fixture.GetAllPublic();
-            Assert.True(publicGists.Count > 1);
-
-            var publicGistsSinceStartTime = await _fixture.GetAllPublic(startTime);
-            Assert.True(publicGistsSinceStartTime.Count > 0);
-
-            // Test starred gists
-            await _fixture.Star(createdGist.Id);
-            var starredGists = await _fixture.GetAllStarred();
-
-            Assert.NotNull(starredGists);
-            Assert.True(starredGists.Any(x => x.Id == createdGist.Id));
-
-            var starredGistsSinceStartTime = await _fixture.GetAllStarred(startTime);
-            Assert.NotNull(starredGistsSinceStartTime);
-            Assert.True(starredGistsSinceStartTime.Any(x => x.Id == createdGist.Id));
-
-            await _fixture.Delete(createdGist.Id);
-        }
+        await _fixture.Delete(createdGist.Id);
     }
-}+}


* Added ApplyPhysics helper on group.

* Added ApplyPhysics helper on group.

--- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1676,5 +1676,13 @@
                                     (int)(color.z * 0xff));
             Text = text;
         }
+
+        public void ApplyPhysics()
+        {
+            foreach(SceneObjectPart part in m_parts.Values )
+            {
+                part.ApplyPhysics();
+            }
+        }
     }
 }


- fixed some incorrect usages of prioritizedRenderTargets to renderTargets

git-svn-id: ad71a101fa69fb252e58119732bf51384d5dbd95@1312 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Projects/Axiom/Source/Engine/Graphics/RenderSystem.cs
+++ Projects/Axiom/Source/Engine/Graphics/RenderSystem.cs
@@ -358,7 +358,9 @@
 		public virtual RenderTarget DetachRenderTarget( RenderTarget target )
 		{
 			// TODO: Remove prioritized render targets
-			prioritizedRenderTargets.Remove( target );
+            renderTargets.Remove( target.Name );
+            prioritizedRenderTargets.Remove( target );
+
 			return target;
 		}

@@ -387,9 +389,9 @@
 		public virtual void InitRenderTargets()
 		{
 			// init stats for each render target
-			foreach ( RenderTarget target in prioritizedRenderTargets )
-			{
-				target.ResetStatistics();
+			foreach ( KeyValuePair<string,RenderTarget> item in renderTargets )
+			{
+				item.Value.ResetStatistics();
 			}
 		}

@@ -425,10 +427,9 @@
 		/// <param name="camera">Camera being removed.</param>
 		internal virtual void NotifyCameraRemoved( Camera camera )
 		{
-			for ( int i = 0; i < prioritizedRenderTargets.Count; i++ )
-			{
-				RenderTarget target = prioritizedRenderTargets[ i ];
-				target.NotifyCameraRemoved( camera );
+			foreach ( KeyValuePair<string, RenderTarget> item in renderTargets )
+			{
+				item.Value.NotifyCameraRemoved( camera );
 			}
 		}

@@ -627,12 +628,28 @@
 		public virtual void RemoveRenderTargets()
 		{
 			// destroy each render window
-			while ( prioritizedRenderTargets.Count > 0 )
-			{
-				RenderTarget target = prioritizedRenderTargets[ 0 ];
+            RenderTarget primary = null;
+			foreach ( KeyValuePair<string,RenderTarget> item in renderTargets )
+			{
+                RenderTarget target = item.Value;
+                //if ( primary == null && item.Value.IsPrimary )
+                //{
+                //  primary = target;
+                //}
+                //else
+                //{
 				DetachRenderTarget( target );
 				target.Dispose();
-			}
+                //}
+			}
+            if ( primary != null )
+            {
+                DetachRenderTarget( primary );
+                primary.Dispose();
+            }
+
+            renderTargets.Clear();
+            prioritizedRenderTargets.Clear();
 		}

 		/// <summary>


Don't show dropdown on Receive/Pay pages

--- Purchasing.Mvc/Views/Order/_ReviewOrderDetails.cshtml
+++ Purchasing.Mvc/Views/Order/_ReviewOrderDetails.cshtml
@@ -1,4 +1,5 @@
-@using Purchasing.Mvc.Helpers
+@using NPOI.SS.Formula.Functions
+@using Purchasing.Mvc.Helpers
 @model ReviewOrderViewModel

@@ -76,7 +77,7 @@

                              Post Order Status

-    @if (Model.CanReceiveItems)
+    @if (Model.CanReceiveItems && (ViewBag.HideEditDialogue == null || (bool)ViewBag.HideEditDialogue == false))
     {
         @Html.DropDownListFor(a => a.Order.PostStatus, SelectLists.PostStatusList, new { @class = "PostStatusDDL" })


Use correct operator for expression assignments.

--- Scripting/Parser/Construct/Expressions/Assignments.cs
+++ Scripting/Parser/Construct/Expressions/Assignments.cs
@@ -55,7 +55,7 @@
                 return;
             }

-            var assign = new CodeBinaryOperatorExpression();
+            var assign = new CodeBinaryOperatorExpression { Operator = CodeBinaryOperatorType.Assign };
             parts[i] = assign;

             if (assign.Left != null)


testing fonts

testing fonts

--- Server/src/SERVERAPI/Views/Report/ReportFields.cshtml
+++ Server/src/SERVERAPI/Views/Report/ReportFields.cshtml
@@ -121,7 +121,7 @@

-
+
                             Nutrient Application Plan: @Model.year

@@ -157,13 +157,13 @@

-                            Agronomic Balance (lbs / ac)
+                            Agronomic Balance (lbs / ac)

-                            Crop Removal Balance (lbs / ac)
+                            Crop Removal Balance (lbs / ac)


add help to launch page

add help to launch page

--- Server/src/SERVERAPI/Views/Shared/_LayoutNoNav.cshtml
+++ Server/src/SERVERAPI/Views/Shared/_LayoutNoNav.cshtml
@@ -113,6 +113,7 @@

Home Page

About

+
Help

@@ -131,6 +132,11 @@

                                     About
+
+
+
+
+                                    Help


Cleaned up unused experimental stuff

Cleaned up unused experimental stuff

And improved some comments.

--- ShaderEditorApp/View/DocumentEditor/CodeTipService.cs
+++ ShaderEditorApp/View/DocumentEditor/CodeTipService.cs
@@ -33,130 +33,38 @@

 		private CancellationTokenSource _outstandingRequest;

-		public TextSegmentCollection<CodeTip> _tips;
+		// Tips that are pushed at us by the diagnostic system.
+		private TextSegmentCollection<CodeTip> _pushTips;
+
+		// Provider for pulling tips from the compiler infrastructure.
 		private readonly ICodeTipProvider _tipProvider;
-
-		private class DummyTipProvider : ICodeTipProvider
-		{
-			public async Task<string> GetCodeTipAsync(int offset, CancellationToken cancellationToken)
-			{
-				try
-				{
-					Console.WriteLine("Getting tip...");
-					await Task.Delay(500, cancellationToken);
-					Console.WriteLine("Got tip.");
-					return "Awesome code!";
-				}
-				catch (TaskCanceledException)
-				{
-					Console.WriteLine("Canceled");
-					throw;
-				}
-			}
-		}
-
-		private class TipWithPosition
-		{
-			public string Contents { get; set; }
-			public TextViewPosition Position { get; set; }
-		}

 		public CodeTipService(TextEditor textEditor, ICodeTipProvider tipProvider)
 		{
 			_tipProvider = tipProvider;
 			_textEditor = textEditor;

-			/*
-			var mouseHover = Observable.FromEventPattern<MouseEventHandler, MouseEventArgs>(h => textEditor.MouseHover += h, h => textEditor.MouseHover -= h);
-			var mouseHoverStopped = Observable.FromEventPattern<MouseEventHandler, MouseEventArgs>(h => textEditor.MouseHoverStopped += h, h => textEditor.MouseHoverStopped -= h);
-
-			var cancel = mouseHover.Merge(mouseHoverStopped);
-
-			// Get new tips when hovering.
-			var positions = mouseHover
-				.Select(e => GetTextPosition(e.EventArgs))
-				.WhereHasValue()
-				.Select(position => new { position, offset = GetOffset(position) });
-
-			var providerTips = positions
-				.Select(location => Observable.FromAsync(ct => tipProvider.GetCodeTipAsync(location.offset, ct))
-					.Select(tip => new TipWithPosition { Contents = tip, Position = location.position }));
-
-			//var diagnosticTips = positions
-			//	.Select(pos => )
-
-			// Clear tips when stopped hovering.
-			var clearTips = mouseHoverStopped
-				.Select(x => Observable.Return<TipWithPosition>(null));
-
-			// Combine new tip and clear tip observables, switch on it and null-subscribe.
-			// This unsubscribes to any previous tip task when either asking for a new tip
-			// or clearing the tip, ensuring that the underlying task is cancelled.
-			providerTips.Merge(clearTips).Switch().Subscribe();
-
-			//tipStream.Subscribe(tip => Console.WriteLine(tip?.Contents));
-			providerTips
-				.Switch()
-				.ObserveOn(RxApp.MainThreadScheduler)
-				.Subscribe(SetToolTip);
-			*/
-
+			// Hook mouse hover events to show/clear tool tip.
 			_textEditor.MouseHover += OnMouseHover;
 			_textEditor.MouseHoverStopped += OnMouseHoverStopped;

+			// Create a single WPF tooltip object that we show and hide as appropriate.
 			_toolTip = new ToolTip();
 			ToolTipService.SetInitialShowDelay(_toolTip, 0);
 			_toolTip.PlacementTarget = _textEditor;
 			_toolTip.Placement = PlacementMode.Relative;

-			 _tips = new TextSegmentCollection<CodeTip>(textEditor.Document);
+			 _pushTips = new TextSegmentCollection<CodeTip>(textEditor.Document);
 		}

-		private void SetToolTip(TipWithPosition tip)
-		{
-			if (tip != null)
-			{
-				// Position the tooltip at the line base instead of the mouse cursor.
-				var textView = _textEditor.TextArea.TextView;
-				var basePosition = textView.GetVisualPosition(tip.Position, VisualYPosition.LineBottom) - textView.ScrollOffset;
-
-				_toolTip.Content = tip.Contents;
-				_toolTip.PlacementRectangle = new Rect(basePosition, basePosition);
-				_toolTip.IsOpen = true;
-			}
-			else
-			{
-				_toolTip.IsOpen = false;
-			}
-		}
-
+		// Push tips associated with spans of text.
 		public void SetTips(IEnumerable<CodeTip> tips)
 		{
-			_tips.Clear();
+			_pushTips.Clear();
 			foreach (var tip in tips)
 			{
-				_tips.Add(tip);
+				_pushTips.Add(tip);
 			}
-		}
-
-		// Convert mouse coords to text position.
-		private int GetOffset(TextViewPosition position)
-		{
-			return _textEditor.Document.GetOffset(position.Location);
-		}
-
-		// Convert mouse coords to text position.
-		private TextViewPosition? GetTextPosition(MouseEventArgs e)
-		{
-			var textView = _textEditor.TextArea.TextView;
-			var position = textView.GetPositionFloor(e.GetPosition(textView) + textView.ScrollOffset);
-			if (!position.HasValue || position.Value.Location.IsEmpty)
-			{
-				// Mouse is not at a valid text position.
-				return null;
-			}
-
-			return position;
 		}

 		private async void OnMouseHover(object sender, MouseEventArgs e)
@@ -174,12 +82,12 @@
 			}

 			var offset = _textEditor.Document.GetOffset(position.Value.Location);
-			var relaventTips = _tips.FindSegmentsContaining(offset);
+			var relaventPushTips = _pushTips.FindSegmentsContaining(offset);

-			if (relaventTips.Any())
+			if (relaventPushTips.Any())
 			{
-				// Show diagnostic tips straight away.
-				ShowTip(CombineTips(relaventTips), position.Value);
+				// Show push tips straight away.
+				ShowTip(CombineTips(relaventPushTips), position.Value);
 			}

 			_outstandingRequest = new CancellationTokenSource();
@@ -190,7 +98,7 @@
 				var providerTip = await _tipProvider.GetCodeTipAsync(offset, _outstandingRequest.Token);
 				if (providerTip != null)
 				{
-					ShowTip(CombineTips(relaventTips, providerTip), position.Value);
+					ShowTip(CombineTips(relaventPushTips, providerTip), position.Value);
 				}
 			}
 			catch (TaskCanceledException)
@@ -211,11 +119,11 @@
 		}

 		// Combine all tips into a single string.
-		private string CombineTips(IEnumerable<CodeTip> diagnosticTips, string providerTip = null)
+		private string CombineTips(IEnumerable<CodeTip> pushTips, string providerTip = null)
 		{
 			// Maybe want some formatting here?

-			var tips = diagnosticTips.Select(x => x.Contents);
+			var tips = pushTips.Select(x => x.Contents);

 			if (providerTip != null)
 			{


Fixes for PR.

Fixes for PR.

--- Simple.OData.Client.Core/Extensions/TypeExtensions.cs
+++ Simple.OData.Client.Core/Extensions/TypeExtensions.cs
@@ -134,8 +134,8 @@

         private static bool IsInstanceProperty(PropertyInfo propertyInfo)
         {
-            return (propertyInfo.CanRead  && !propertyInfo.GetGetMethod().IsStatic)
-                || (propertyInfo.CanWrite && !propertyInfo.GetSetMethod().IsStatic);
+            return (propertyInfo.CanRead  && !propertyInfo.GetMethod.IsStatic)
+                || (propertyInfo.CanWrite && !propertyInfo.SetMethod.IsStatic);
         }

         public static IEnumerable<PropertyInfo> GetDeclaredProperties(this Type type)


Speedup login by doing independent tasks in parallel

--- ArchiSteamFarm/Bot.cs
+++ ArchiSteamFarm/Bot.cs
@@ -1562,20 +1562,24 @@
 					}

 					if (BotConfig.DismissInventoryNotifications) {
-						await ArchiWebHandler.MarkInventory().ConfigureAwait(false);
+						Task.Run(async () => await ArchiWebHandler.MarkInventory().ConfigureAwait(false)).Forget();
 					}

 					if (BotConfig.SteamMasterClanID != 0) {
-						await ArchiWebHandler.JoinClan(BotConfig.SteamMasterClanID).ConfigureAwait(false);
-						JoinMasterChat();
+						Task.Run(async () => {
+							await ArchiWebHandler.JoinClan(BotConfig.SteamMasterClanID).ConfigureAwait(false);
+							JoinMasterChat();
+						}).Forget();
 					}

 					if (Program.GlobalConfig.Statistics) {
-						await ArchiWebHandler.JoinClan(ArchiSCFarmGroup).ConfigureAwait(false);
-						SteamFriends.JoinChat(ArchiSCFarmGroup);
+						Task.Run(async () => {
+							await ArchiWebHandler.JoinClan(ArchiSCFarmGroup).ConfigureAwait(false);
+							SteamFriends.JoinChat(ArchiSCFarmGroup);
+						}).Forget();
 					}

-					Trading.CheckTrades();
+					Task.Run(() => Trading.CheckTrades()).Forget();

 					Task.Run(async () => await CardsFarmer.StartFarming().ConfigureAwait(false)).Forget();
 					break;


Fix for editing title.

Fix for editing title.

--- Behaviors/EditMode.cs
+++ Behaviors/EditMode.cs
@@ -146,7 +146,12 @@
         /* ----------------------------------------------------------------- */
         private void WhenKeyDown(object sender, KeyEventArgs e)
         {
-            if (e.Key == Key.Enter) WhenLostFocus(sender, e);
+            switch (e.Key)
+            {
+                case Key.Enter:
+                    WhenLostFocus(sender, e);
+                    break;
+            }
         }

         /* ----------------------------------------------------------------- */
@@ -160,12 +165,7 @@
         /* ----------------------------------------------------------------- */
         private static void Enable(TextBox src)
         {
-            src.Background      = Brushes.White;
-            src.BorderBrush     = Brushes.Gray;
-            src.BorderThickness = new Thickness(1);
-            src.Cursor          = Cursors.IBeam;
-            src.Focusable       = true;
-            src.IsReadOnly      = false;
+            src.Visibility = Visibility.Visible;
             src.Focus();
             src.SelectAll();
         }
@@ -179,15 +179,10 @@
         /// </summary>
         ///
         /* ----------------------------------------------------------------- */
-        public static void Disable(TextBox src)
+        private static void Disable(TextBox src)
         {
             src.Select(0, 0);
-            src.Background      = Brushes.Transparent;
-            src.BorderBrush     = Brushes.Transparent;
-            src.BorderThickness = new Thickness(0);
-            src.Cursor          = Cursors.Arrow;
-            src.IsReadOnly      = true;
-            src.Focusable       = false;
+            src.Visibility = Visibility.Collapsed;
         }

         #endregion


made corrections to github formatting

made corrections to github formatting

--- ButtonEventTrigger.cs
+++ ButtonEventTrigger.cs
@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 using UnityEngine.EventSystems;
@@ -19,12 +19,11 @@
     fadePanel = overlayCanvas != null ? overlayCanvas.GetComponent<FadeOutPanel>() : null;
   }

-	// Use this for initialization
-	protected virtual void Start ()
+  // Use this for initialization
+  protected virtual void Start ()
   {
     myButton = GetComponent<Button>();
-	  EventTrigger trigger = GetComponent<EventTrigger>();
-
+    EventTrigger trigger = GetComponent<EventTrigger>();
     EventTrigger.Entry pointerEnter = new EventTrigger.Entry();
     pointerEnter.eventID = EventTriggerType.PointerEnter;
     pointerEnter.callback.AddListener( ( data ) => { OnPointerEnterDelegate( (PointerEventData)data ); } );
@@ -34,15 +33,13 @@
     pointerDown.eventID = EventTriggerType.PointerDown;
     pointerDown.callback.AddListener( ( data ) => { OnPointerDownDelegate( (PointerEventData)data ); } );
     trigger.triggers.Add( pointerDown );
-
-	}
+  }

   protected virtual void OnPointerEnterDelegate(PointerEventData data)
   {
     if (myButton.interactable && manager)
     {
       manager.PlayAudioClip(1);
-
     }
   }


CodeFactor

CodeFactor

--- WalletWasabi/BitcoinCore/Rpc/RpcErrorTools.cs
+++ WalletWasabi/BitcoinCore/Rpc/RpcErrorTools.cs
@@ -14,9 +14,11 @@

 		public const string SpentErrorTranslation = "At least one coin you are trying to spend is already spent.";

-		public static bool IsSpentError(string error) => new[] { SpentError1, SpentError2, SpentError3 }.Any(x => error.Contains(x, StringComparison.OrdinalIgnoreCase));
+		public static bool IsSpentError(string error)
+			=> new[] { SpentError1, SpentError2, SpentError3 }.Any(x => error.Contains(x, StringComparison.OrdinalIgnoreCase));

-		public static bool IsTooLongMempoolChainError(string error) => error.Contains(TooLongMempoolChainError, StringComparison.OrdinalIgnoreCase);
+		public static bool IsTooLongMempoolChainError(string error)
+			=> error.Contains(TooLongMempoolChainError, StringComparison.OrdinalIgnoreCase);

 		public static Dictionary<string, string> ErrorTranslations { get; } = new Dictionary<string, string>
 		{


Simplify transaction processing code

Simplify transaction processing code

--- WalletWasabi/Services/TransactionProcessor.cs
+++ WalletWasabi/Services/TransactionProcessor.cs
@@ -39,7 +39,6 @@
 			uint256 txId = tx.GetHash();
 			var walletRelevant = false;

-			bool justUpdate = false;
 			if (tx.Confirmed)
 			{
 				if (!tx.Transaction.PossiblyP2WPKHInvolved())
@@ -54,8 +53,12 @@
 					if (foundTx != default) // Must check again, because it's a concurrent collection!
 					{
 						foundTx.Update(tx);
-						walletRelevant = true;
-						justUpdate = true; // No need to check for double spend, we already processed this transaction, just update it.
+						foreach(var coin in Coins.Where(x => x.TransactionId == txId))
+						{
+							coin.Height = tx.Height;
+						}
+
+						return true; // relevant
 					}
 				}
 			}
@@ -64,7 +67,7 @@
 				return false; // We do not care about non-witness transactions for other than mempool cleanup.
 			}

-			if (!justUpdate && !tx.Transaction.IsCoinBase) // Transactions we already have and processed would be "double spends" but they shouldn't.
+			if (!tx.Transaction.IsCoinBase) // Transactions we already have and processed would be "double spends" but they shouldn't.
 			{
 				var doubleSpends = new List<SmartCoin>();
 				foreach (SmartCoin coin in Coins)
@@ -183,17 +186,6 @@
 							KeyManager.AssertLockedInternalKeysIndexed(14);
 						}
 					}
-					else // If we had this coin already.
-					{
-						if (newCoin.Height != Height.Mempool) // Update the height of this old coin we already had.
-						{
-							SmartCoin oldCoin = Coins.FirstOrDefault(x => x.TransactionId == txId && x.Index == i);
-							if (oldCoin != null) // Just to be sure, it is a concurrent collection.
-							{
-								oldCoin.Height = newCoin.Height;
-							}
-						}
-					}
 				}
 			}

@@ -225,4 +217,4 @@
 			return walletRelevant;
 		}
 	}
-}
+}


Completed work for seeding data for the Accounting module.

--- Web/Wilson.Web/Database/AccountingDbSeeder.cs
+++ Web/Wilson.Web/Database/AccountingDbSeeder.cs
@@ -24,6 +24,7 @@
         private static IEnumerable<Price> itemPrices;
         private static IEnumerable<Payment> payments;
         private static IEnumerable<StorehouseItem> storehouseItems;
+        private static IEnumerable<Bill> bills;

         /// <summary>
         /// Seeds the data for the Accounting module.
@@ -47,6 +48,7 @@
                 SeedInvoiceItems(db, !db.InvoiceItems.Any(), out invoiceItems);
                 SeedPaymets(db, !db.Payments.Any(), out payments);
                 SeedStorehouseItems(db, !db.StorehouseItems.Any(), out storehouseItems);
+                SeedBills(db, !db.Bills.Any(), out bills);

                 db.SaveChanges();
             }
@@ -606,5 +608,52 @@
                 storehouseItems = db.StorehouseItems.ToList();
             }
         }
+
+        private static void SeedBills(AccountingDbContext db, bool hasBills, out IEnumerable<Bill> bills)
+        {
+            if (hasBills)
+            {
+                bills = new List<Bill>()
+                {
+                    new Bill()
+                    {
+                        Date = new DateTime(2017, 2, 14),
+                        Amount = 10589.56M,
+                        HtmlContent = "Not implemented",
+                        InvoiceId = invoices.Where(x => x.SubTotal == 10589.56M).First().Id,
+                        ProjectId = projects.Where(x => x.Name.Equals("Office Building - Class A")).First().Id,
+                    },
+                    new Bill()
+                    {
+                        Date = new DateTime(2017, 3, 9),
+                        Amount = 5988M,
+                        HtmlContent = "Not implemented",
+                        InvoiceId = invoices.Where(x => x.SubTotal == 5988M).First().Id,
+                        ProjectId = projects.Where(x => x.Name.Equals("Apartment Complex - River View")).First().Id,
+                    },
+                    new Bill()
+                    {
+                        Date = new DateTime(2017, 4, 26),
+                        Amount = 4000M,
+                        HtmlContent = "Not implemented",
+                        InvoiceId = invoices.Where(x => x.SubTotal == 4000M).First().Id,
+                        ProjectId = projects.Where(x => x.Name.Equals("Apartment Complex - River View")).First().Id,
+                    },
+                    new Bill()
+                    {
+                        Date = new DateTime(2017, 4, 18),
+                        Amount = 8500M,
+                        HtmlContent = "Not implemented",
+                        ProjectId = projects.Where(x => x.Name.Equals("Head office renovation")).First().Id,
+                    },
+                };
+
+                db.Bills.AddRange(bills);
+            }
+            else
+            {
+                bills = db.Bills.ToList();
+            }
+        }
     }
 }