Tidy up scale/rotation operation code

Tidy up scale/rotation operation code

--- osu.Game.Rulesets.Osu/Edit/OsuSelectionHandler.cs
+++ osu.Game.Rulesets.Osu/Edit/OsuSelectionHandler.cs
@@ -6,6 +6,7 @@
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Primitives;
 using osu.Framework.Input.Events;
+using osu.Framework.Utils;
 using osu.Game.Rulesets.Objects.Types;
 using osu.Game.Rulesets.Osu.Objects;
 using osu.Game.Screens.Edit.Compose.Components;
@@ -22,24 +23,25 @@
                 CanScaleX = true,
                 CanScaleY = true,

-                OperationStarted = onStart,
-                OperationEnded = onEnd,
-
-                OnRotation = handleRotation,
+                OperationStarted = () => ChangeHandler.BeginChange(),
+                OperationEnded = () =>
+                {
+                    ChangeHandler.EndChange();
+                    referenceOrigin = null;
+                },
+
+                OnRotation = e => rotateSelection(e.Delta.X),
                 OnScaleX = handleScaleX,
                 OnScaleY = handleScaleY,
             };

-        private void onEnd()
-        {
-            ChangeHandler.EndChange();
-            centre = null;
-        }
-
-        private void onStart()
-        {
-            ChangeHandler.BeginChange();
-        }
+        public override bool HandleMovement(MoveSelectionEvent moveEvent) =>
+            moveSelection(moveEvent.InstantDelta);
+
+        /// <summary>
+        /// During a transform, the initial origin is stored so it can be used throughout the operation.
+        /// </summary>
+        private Vector2? referenceOrigin;

         private void handleScaleY(DragEvent e, Anchor reference)
         {
@@ -61,7 +63,7 @@

             if (direction < 0)
             {
-                // when resizing from a top drag handle, we want to move the selection first
+                // when resizing from a left drag handle, we want to move the selection first
                 if (!moveSelection(new Vector2(e.Delta.X, 0)))
                     return;
             }
@@ -69,37 +71,27 @@
             scaleSelection(new Vector2(direction * e.Delta.X, 0));
         }

-        private Vector2? centre;
-
-        private void handleRotation(DragEvent e)
-        {
-            rotateSelection(e.Delta.X);
-        }
-
-        public override bool HandleMovement(MoveSelectionEvent moveEvent) =>
-            moveSelection(moveEvent.InstantDelta);
-
         private bool rotateSelection(in float delta)
         {
             Quad quad = getSelectionQuad();

-            centre ??= quad.Centre;
-
-            foreach (var h in SelectedHitObjects.OfType<OsuHitObject>())
-            {
-                if (h is Spinner)
-                {
-                    // Spinners don't support position adjustments
-                    continue;
-                }
-
-                h.Position = Rotate(h.Position, centre.Value, delta);
+            referenceOrigin ??= quad.Centre;
+
+            foreach (var h in SelectedHitObjects.OfType<OsuHitObject>())
+            {
+                if (h is Spinner)
+                {
+                    // Spinners don't support position adjustments
+                    continue;
+                }
+
+                h.Position = rotatePointAroundOrigin(h.Position, referenceOrigin.Value, delta);

                 if (h is IHasPath path)
                 {
                     foreach (var point in path.Path.ControlPoints)
                     {
-                        point.Position.Value = Rotate(point.Position.Value, Vector2.Zero, delta);
+                        point.Position.Value = rotatePointAroundOrigin(point.Position.Value, Vector2.Zero, delta);
                     }
                 }
             }
@@ -194,24 +186,24 @@
         }

         /// <summary>
-        /// Returns rotated position from a given point.
+        /// Rotate a point around an arbitrary origin.
         /// </summary>
-        /// <param name="p">The point.</param>
-        /// <param name="center">The center to rotate around.</param>
+        /// <param name="point">The point.</param>
+        /// <param name="origin">The centre origin to rotate around.</param>
         /// <param name="angle">The angle to rotate (in degrees).</param>
-        internal static Vector2 Rotate(Vector2 p, Vector2 center, float angle)
+        private static Vector2 rotatePointAroundOrigin(Vector2 point, Vector2 origin, float angle)
         {
             angle = -angle;

-            p.X -= center.X;
-            p.Y -= center.Y;
+            point.X -= origin.X;
+            point.Y -= origin.Y;

             Vector2 ret;
-            ret.X = (float)(p.X * Math.Cos(angle / 180f * Math.PI) + p.Y * Math.Sin(angle / 180f * Math.PI));
-            ret.Y = (float)(p.X * -Math.Sin(angle / 180f * Math.PI) + p.Y * Math.Cos(angle / 180f * Math.PI));
-
-            ret.X += center.X;
-            ret.Y += center.Y;
+            ret.X = (float)(point.X * Math.Cos(MathUtils.DegreesToRadians(angle)) + point.Y * Math.Sin(angle / 180f * Math.PI));
+            ret.Y = (float)(point.X * -Math.Sin(MathUtils.DegreesToRadians(angle)) + point.Y * Math.Cos(angle / 180f * Math.PI));
+
+            ret.X += origin.X;
+            ret.Y += origin.Y;

             return ret;
         }


Add xmldocs

Add xmldocs

--- osu.Game/Graphics/UserInterface/RollingCounter.cs
+++ osu.Game/Graphics/UserInterface/RollingCounter.cs
@@ -160,8 +160,15 @@
             this.TransformTo(nameof(DisplayedCount), newValue, rollingTotalDuration, RollingEasing);
         }

+        /// <summary>
+        /// Creates the text. Delegates to <see cref="CreateSpriteText"/> by default.
+        /// </summary>
         protected virtual IHasText CreateText() => CreateSpriteText();

+        /// <summary>
+        /// Creates an <see cref="OsuSpriteText"/> which may be used to display this counter's text.
+        /// May not be called if <see cref="CreateText"/> is overridden.
+        /// </summary>
         protected virtual OsuSpriteText CreateSpriteText() => new OsuSpriteText
         {
             Font = OsuFont.Numeric.With(size: 40f),


Fix unability to mannualy switch ruleset

--- osu.Game/Overlays/Toolbar/ToolbarRulesetButton.cs
+++ osu.Game/Overlays/Toolbar/ToolbarRulesetButton.cs
@@ -6,6 +6,7 @@
 using osu.Game.Rulesets;
 using osuTK.Graphics;
 using osu.Framework.Graphics;
+using osu.Framework.Input.Events;

 namespace osu.Game.Overlays.Toolbar
 {
@@ -59,6 +60,12 @@
                 }
             }

+            protected override bool OnClick(ClickEvent e)
+            {
+                Parent.Click();
+                return base.OnClick(e);
+            }
+
             protected override void LoadComplete()
             {
                 base.LoadComplete();


Maintain sort stability by using carousel item ID as fallback

--- osu.Game/Screens/Select/Carousel/CarouselGroup.cs
+++ osu.Game/Screens/Select/Carousel/CarouselGroup.cs
@@ -24,6 +24,7 @@
         private ulong currentChildID;

         private Comparer<CarouselItem>? criteriaComparer;
+        private Comparer<CarouselItem>? itemIDComparer;

         private FilterCriteria? lastCriteria;

@@ -90,7 +91,8 @@

             // IEnumerable<T>.OrderBy() is used instead of List<T>.Sort() to ensure sorting stability
             criteriaComparer = Comparer<CarouselItem>.Create((x, y) => x.CompareTo(criteria, y));
-            items = items.OrderBy(c => c, criteriaComparer).ToList();
+            itemIDComparer = Comparer<CarouselItem>.Create((x, y) => x.ChildID.CompareTo(y.ChildID));
+            items = items.OrderBy(c => c, criteriaComparer).ThenBy(c => c, itemIDComparer).ToList();

             lastCriteria = criteria;
         }


Quash the region ID on intersim messages. That prevents people from determining another avatars location

--- OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -423,7 +423,7 @@
                     gim.fromAgentName = fromAgentName;
                     gim.fromGroup = fromGroup;
                     gim.imSessionID = imSessionID.Guid;
-                    gim.RegionID = RegionID.Guid;
+                    gim.RegionID = UUID.Zero.Guid; // RegionID.Guid;
                     gim.timestamp = timestamp;
                     gim.toAgentID = toAgentID.Guid;
                     gim.message = message;


* Added debug logging to SimianGrid inventory service response parsing

--- OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
+++ OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
@@ -745,6 +745,7 @@
                 }
             }

+            m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invFolders.Count + " folders from SimianGrid response");
             return invFolders;
         }

@@ -810,6 +811,7 @@
                 }
             }

+            m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invItems.Count + " items from SimianGrid response");
             return invItems;
         }


Bugfix: name end date is optional for historical names

--- PART/Source/CprBroker/DBR/Extensions/CprConverterExtensions.PersonName.cs
+++ PART/Source/CprBroker/DBR/Extensions/CprConverterExtensions.PersonName.cs
@@ -39,7 +39,7 @@
             pn.SearchNameDate = null; //Said to be always 0
             pn.FirstName = string.Format("{0} {1}", currentName.FirstName_s, currentName.MiddleName).Trim();
             pn.LastName = currentName.LastName;
-
+
             // Special logic for addressing name
             pn.AddressingName = ToDprAddressingName(currentName.AddressingName, currentName.LastName);
             pn.SearchName = null; //Said to be always blank
@@ -64,7 +64,8 @@
             if (historicalName.NameStartDate.HasValue)
                 pn.NameStartDate = CprBroker.Utilities.Dates.DateToDecimal(historicalName.NameStartDate.Value, 12);

-            pn.NameTerminationDate = CprBroker.Utilities.Dates.DateToDecimal(historicalName.NameEndDate.Value, 12);
+            if (historicalName.NameEndDate.HasValue)
+                pn.NameTerminationDate = CprBroker.Utilities.Dates.DateToDecimal(historicalName.NameEndDate.Value, 12);
             pn.AddressingNameDate = null; //TODO: Can be fetched in CPR Services, adrnvnhaenstart
             if (!char.IsWhiteSpace(historicalName.CorrectionMarker))
                 pn.CorrectionMarker = historicalName.CorrectionMarker;


explicitly handles the request time out

explicitly handles the request time out

--- ResilientClient.CSharp/ResilientClient.CSharp/Actors/WhimsyClientActor.cs
+++ ResilientClient.CSharp/ResilientClient.CSharp/Actors/WhimsyClientActor.cs
@@ -36,7 +36,18 @@

         private async Task<IResponseWrapper<string>> QueryApi(string getPath)
         {
-            var response = await _httpClient.GetAsync(GetPathToUri(getPath));
+            HttpResponseMessage response;
+            try
+            {
+
+                response = await _httpClient.GetAsync(GetPathToUri(getPath));
+            }
+            catch (TaskCanceledException e)
+            {
+
+                return new ResponseFailure<string>(new Exception($"{getPath} request timed out"));
+            }
+
             if (response.IsSuccessStatusCode)
             {
                 var content = await response.Content.ReadAsStringAsync();


quick refactoring

quick refactoring

--- Source/GitClientVS.Infrastructure/ViewModels/PullRequestsMainViewModel.cs
+++ Source/GitClientVS.Infrastructure/ViewModels/PullRequestsMainViewModel.cs
@@ -30,7 +30,6 @@
         private List<GitPullRequest> _filteredGitPullRequests;
         private string _errorMessage;
         private ReactiveCommand<object> _goToCreateNewPullRequestCommand;
-        private ReactiveCommand<object> _filterPullRequests;

         private List<GitUser> _authors;
         private GitUser _selectedAuthor;
@@ -54,7 +53,6 @@
             set
             {
                 this.RaiseAndSetIfChanged(ref _selectedStatus, value);
-                Filter();
             }
         }

@@ -88,7 +86,6 @@
         public ICommand InitializeCommand => _initializeCommand;
         public ICommand GoToDetailsCommand => _goToDetailsCommand;
         public ICommand GotoCreateNewPullRequestCommand => _goToCreateNewPullRequestCommand;
-        public ICommand FilterPullRequestsCommand => _filterPullRequests;

         [ImportingConstructor]
@@ -103,6 +100,7 @@
             _pageNavigationService = pageNavigationService;
             _authors = new List<GitUser>();
             _filteredGitPullRequests = new List<GitPullRequest>();
+            this.WhenAnyValue(x => x.SelectedStatus).Subscribe(_ => Filter());
             SelectedStatus = GitPullRequestStatus.Open;
         }

@@ -111,9 +109,6 @@
             _initializeCommand = ReactiveCommand.CreateAsyncTask(CanLoadPullRequests(), _ => LoadPullRequests());
             _goToCreateNewPullRequestCommand = ReactiveCommand.Create(Observable.Return(true));
             _goToCreateNewPullRequestCommand.Subscribe(_ => { _pageNavigationService.Navigate(PageIds.CreatePullRequestsPageId); });
-
-            //_filterPullRequests = ReactiveCommand.Create(Observable.Return(true));
-           // _filterPullRequests.Subscribe(_ => Filter());

             _goToDetailsCommand = ReactiveCommand.Create(Observable.Return(true));
             _goToDetailsCommand.Subscribe(x => { _pageNavigationService.Navigate(PageIds.PullRequestsDetailPageId, x); });


#697 запечатал ProxyHttpClientFactory

#697 запечатал ProxyHttpClientFactory

--- VkNet/Infrastructure/Authorization/ImplicitFlow/ProxyHttpClientFactory.cs
+++ VkNet/Infrastructure/Authorization/ImplicitFlow/ProxyHttpClientFactory.cs
@@ -1,10 +1,13 @@
 using System.Net;
 using System.Net.Http;
 using Flurl.Http.Configuration;
+using JetBrains.Annotations;

 namespace VkNet.Infrastructure.Authorization.ImplicitFlow
 {
-	public class ProxyHttpClientFactory: DefaultHttpClientFactory
+	/// <inheritdoc />
+	[UsedImplicitly]
+	public sealed class ProxyHttpClientFactory : DefaultHttpClientFactory
 	{
 		private readonly IWebProxy _proxy;

@@ -22,7 +25,8 @@
 				return new HttpClientHandler();
 			}

-			return new HttpClientHandler {
+			return new HttpClientHandler
+			{
 				Proxy = _proxy,
 				UseProxy = true
 			};


Must remember to clean up my toys when I'm done with them

--- src/Turbocharged.Beanstalk/PhysicalConnection.cs
+++ src/Turbocharged.Beanstalk/PhysicalConnection.cs
@@ -42,6 +42,7 @@
             _receiveTask = Disposable.Create(() =>
             {
                 cts.Cancel();
+                cts.Dispose();
             });
         }


ServiceSid -> Service in Message tests

ServiceSid -> Service in Message tests

--- src/Twilio.Api.Tests.Integration/MessageTests.cs
+++ src/Twilio.Api.Tests.Integration/MessageTests.cs
@@ -52,7 +52,7 @@
         }

         [Test]
-        public void ShouldSendMessageWithServiceSid()
+        public void ShouldSendMessageWithService()
         {
             IRestRequest savedRequest = null;
             _mockClient.Setup(trc => trc.Execute<Message>(It.IsAny<IRestRequest>()))
@@ -61,7 +61,7 @@
             var client = _mockClient.Object;
             const string body = ".NET Unit Test Message";

-            client.SendMessageWithServiceSid(From, To, body);
+            client.SendMessageWithService(From, To, body);

             _mockClient.Verify(trc => trc.Execute<Message>(It.IsAny<IRestRequest>()), Times.Once);
             Assert.IsNotNull(savedRequest);
@@ -109,7 +109,7 @@
         }

         [Test]
-        public void ShouldSendMessageWithServiceSidAsynchronously()
+        public void ShouldSendMessageWithServiceAsynchronously()
         {
             IRestRequest savedRequest = null;
             _mockClient.Setup(trc => trc.ExecuteAsync(It.IsAny<IRestRequest>(), It.IsAny<Action<Message>>()))
@@ -118,7 +118,7 @@
             _manualResetEvent = new ManualResetEvent(false);
             const string body = ".NET Unit Test Message";

-            client.SendMessageWithServiceSid(From, To, body, message => _manualResetEvent.Set());
+            client.SendMessageWithService(From, To, body, message => _manualResetEvent.Set());
             _manualResetEvent.WaitOne(1);

             _mockClient.Verify(trc => trc.ExecuteAsync(It.IsAny<IRestRequest>(), It.IsAny<Action<Message>>()), Times.Once);


Update index.cshtml

Update index.cshtml

--- input/docs/handbook/index.cshtml
+++ input/docs/handbook/index.cshtml
@@ -1,4 +1,2 @@
 Order: 15
 ---
-
-@Html.Partial("_ChildPages")


Error when importing from non-existent SDK

The if-exists checks meant that if you had a badly defined MSBuildSDKsPath
or an SDK name that didn't exist, you would get no error and just silently
get no imports. That's no good.

This adds the implicit import unconditionally, requiring all SDKs to have
both an Sdk.props and an Sdk.targets for the moment.

--- src/XMakeBuildEngine/Evaluation/ProjectParser.cs
+++ src/XMakeBuildEngine/Evaluation/ProjectParser.cs
@@ -213,7 +213,8 @@
                     var finalImportPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildSDKsPath,
                         sdkName, "Sdk", "Sdk.targets");

-                    if (File.Exists(initialImportPath))
+                    // TODO: don't require all SDKs to have both props and targets
+                    // if (File.Exists(initialImportPath))
                     {
                         var implicitImportElement = element.OwnerDocument.CreateElement(XMakeElements.import);

@@ -226,7 +227,8 @@
                         element.PrependChild(implicitImportElement);
                     }

-                    if (File.Exists(finalImportPath))
+                    // TODO: don't require all SDKs to have both props and targets
+                    // if (File.Exists(finalImportPath))
                     {
                         var implicitImportElement = element.OwnerDocument.CreateElement(XMakeElements.import);


create a polling version

create a polling version

--- addons/Rules/Tweek.Drivers.Rules.Management/TweekManagementRulesDriver.cs
+++ addons/Rules/Tweek.Drivers.Rules.Management/TweekManagementRulesDriver.cs
@@ -23,6 +23,7 @@

     public class TweekManagementRulesDriver : IRulesDriver, IDisposable
     {
+
         public event Action<IDictionary<string, RuleDefinition>> OnRulesChange;

         private const string RULESET_PATH =  "/ruleset/latest";
@@ -64,23 +65,39 @@
             var measuredGetter = MeasureAsync<string, HttpResponseMessage>(metrics, "download_latest_header", s=>getter(s));
             var measuredDownloader = MeasureAsync(metrics, "download_ruleset", (HttpResponseMessage message)=> message.ExtractRules());

-            _pipeline = Observable.Timer(TimeSpan.Zero, TimeSpan.FromSeconds(30))
+            _pipeline = Observable.Create<Dictionary<string, RuleDefinition>>( async (sub, ct)=>{
+                    var shouldStop = false;
+                    try {
+                    string currentVersion = null;
+                    while(!shouldStop){
+                        {
+                            var response = await measuredGetter(RULESET_PATH);
+                            var newVersion = response.GetRulesVersion();
+                            if (newVersion == currentVersion) {
+                                await Task.Delay(30000);
+                                continue;
+                            }
+                            currentVersion = newVersion;
+                            var ruleset = await measuredDownloader(response);
+                            CurrentLabel = newVersion;
+                            await Task.Delay(5000);
+                            sub.OnNext(ruleset);
+                        }
+                    }
+                    } catch(Exception ex){
+                        sub.OnError(ex);
+                        shouldStop = true;
+                    }
+                    ct.Register(()=> shouldStop = true);
+                    return ()=> shouldStop=true ;
+                })
                 .SubscribeOn(scheduler)
-                .Select(_ => Observable.FromAsync(() => measuredGetter(RULESET_PATH)))
-                .Switch()
-                .Do(_ => LastCheckTime = DateTime.UtcNow)
-                .DistinctUntilChanged(x => x.GetRulesVersion())
-                .Select(x => Observable.FromAsync(() => measuredDownloader(x)).Select(rules => (label: x.GetRulesVersion(), rules: rules)))
-                .Switch()
                 .Catch((Exception exception) =>
                 {
                     logger.LogWarning($"Failed to update rules: \r\n{exception}");
-                    return Observable.Empty<(string label, Dictionary<string, RuleDefinition> rules)>()
+                    return Observable.Empty<Dictionary<string, RuleDefinition>>()
                         .Delay(TimeSpan.FromMinutes(1));
                 })
-                .Repeat()
-                .Do(x => CurrentLabel = x.label)
-                .Select(x=>x.rules)
                 .Replay(1);
         }


Fix for X-Forwarded-For

Fix for X-Forwarded-For

--- src/acastaner_mvc6/Controllers/HomeController.cs
+++ src/acastaner_mvc6/Controllers/HomeController.cs
@@ -1,4 +1,5 @@
 using Microsoft.AspNetCore.Mvc;
+using System;

 namespace acastaner.Controllers
 {
@@ -56,7 +57,7 @@
             ViewBag.SubHeading = "(Aucune de ces informations n'est enregistrée)";
             ViewBag.HeaderImage = "tools-bg.png";

-            ViewBag.RemoteIpAddress = HttpContext.Connection.RemoteIpAddress.ToString();
+            ViewBag.RemoteIpAddress = String.IsNullOrEmpty(Request.Headers["X-Forwarded-For"].ToString()) ? HttpContext.Connection.RemoteIpAddress.ToString() : Request.Headers["X-Forwarded-For"].ToString();
             ViewBag.BrowserUserAgent = HttpContext.Request.Headers["User-Agent"].ToString();
             ViewBag.IsTls = HttpContext.Request.IsHttps;


finished MetricsGossipSpec

finished MetricsGossipSpec

--- src/core/Akka.Cluster.Tests/MetricsGossipSpec.cs
+++ src/core/Akka.Cluster.Tests/MetricsGossipSpec.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System.Collections.Immutable;
+using System.Linq;
 using System.Runtime.Remoting;
 using Akka.Actor;
 using Akka.TestKit;
@@ -92,7 +93,44 @@
         [Fact]
         public void MetricsGossip_must_get_the_current_NodeMetrics_if_it_exists_in_local_nodes()
         {
-
+            var m1 = new NodeMetrics(new Address("akka.tcp", "sys", "a", 2554), StandardMetrics.NewTimestamp(),
+               _collector.Sample().Metrics);
+            var g1 = MetricsGossip.Empty + m1;
+            g1.NodeMetricsFor(m1.Address).Metrics.ShouldBe(m1.Metrics);
+        }
+
+        [Fact]
+        public void MetricsGossip_must_remove_a_node_if_it_is_no_longer_up()
+        {
+            var m1 = new NodeMetrics(new Address("akka.tcp", "sys", "a", 2554), StandardMetrics.NewTimestamp(),
+                _collector.Sample().Metrics);
+            var m2 = new NodeMetrics(new Address("akka.tcp", "sys", "a", 2555), StandardMetrics.NewTimestamp(),
+                _collector.Sample().Metrics);
+
+            var g1 = MetricsGossip.Empty + m1 + m2;
+            g1.Nodes.Count.ShouldBe(2);
+            var g2 = g1.Remove(m1.Address);
+            g2.Nodes.Count.ShouldBe(1);
+            g2.Nodes.Any(x => x.Address == m1.Address).ShouldBeFalse();
+            g2.NodeMetricsFor(m1.Address).ShouldBe(null);
+            g2.NodeMetricsFor(m2.Address).Metrics.ShouldBe(m2.Metrics);
+        }
+
+        [Fact]
+        public void MetricsGossip_must_filter_nodes()
+        {
+            var m1 = new NodeMetrics(new Address("akka.tcp", "sys", "a", 2554), StandardMetrics.NewTimestamp(),
+                _collector.Sample().Metrics);
+            var m2 = new NodeMetrics(new Address("akka.tcp", "sys", "a", 2555), StandardMetrics.NewTimestamp(),
+                _collector.Sample().Metrics);
+
+            var g1 = MetricsGossip.Empty + m1 + m2;
+            g1.Nodes.Count.ShouldBe(2);
+            var g2 = g1.Filter(ImmutableHashSet.Create<Address>(new[] {m2.Address}));
+            g2.Nodes.Count.ShouldBe(1);
+            g2.Nodes.Any(x => x.Address == m1.Address).ShouldBeFalse();
+            g2.NodeMetricsFor(m1.Address).ShouldBe(null);
+            g2.NodeMetricsFor(m2.Address).Metrics.ShouldBe(m2.Metrics);
         }
     }
 }


Fixed an error that caused the wrong expected hall information to be saved

--- src/electric-mouse/Controllers/HallController.cs
+++ src/electric-mouse/Controllers/HallController.cs
@@ -41,7 +41,7 @@
                     Sections = new List<RouteSection>()
                 };

-                if (model.Type <= 0)
+                if (model.Type >= 0)
                 {
                     hall.ExpectedType = model.Type;
                 }


Supress some of the pop'ing of expressions.

--- LINQToTTree/LINQToTTreeLib/CodeContext.cs
+++ LINQToTTree/LINQToTTreeLib/CodeContext.cs
@@ -420,7 +420,7 @@
         {
             foreach (var v in _cachedScopeVars)
             {
-                v.Pop();
+                //v.Pop();
             }
             _cachedScopeVars.Clear();
         }


correctly process 404 NotFound

correctly process 404 NotFound

--- MailRuCloud/MailRuCloudApi/MailRuCloud.cs
+++ MailRuCloud/MailRuCloudApi/MailRuCloud.cs
@@ -95,9 +95,8 @@
                 datares = await new FolderInfoRequest(CloudApi, null == ulink ? path : ulink.Href, ulink != null)
                     .MakeRequestAsync().ConfigureAwait(false);
             }
-            catch (Exception e)
-            {
-                Logger.Warn($"Cannot get {path} with exception {e}");
+            catch (WebException e) when ((e.Response as HttpWebResponse)?.StatusCode == HttpStatusCode.NotFound)
+            {
                 return null;
             }


Bump assemby versions for a major release

--- MaxMind.GeoIP2/Properties/AssemblyInfo.cs
+++ MaxMind.GeoIP2/Properties/AssemblyInfo.cs
@@ -42,9 +42,9 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]

-[assembly: AssemblyVersion("2.6.0.0")]
-[assembly: AssemblyFileVersion("2.6.0")]
-[assembly: AssemblyInformationalVersion("2.6.0")]
+[assembly: AssemblyVersion("3.0.0.0")]
+[assembly: AssemblyFileVersion("3.0.0")]
+[assembly: AssemblyInformationalVersion("3.0.0")]
 [assembly: InternalsVisibleTo("MaxMind.GeoIP2.UnitTests,PublicKey=" +
                               "0024000004800000940000000602000000240000525341310004000001000100e30b6e4a9425b1" +
                               "617ffc8bdf79801e67a371f9f650db860dc0dfff92cb63258765a0955c6fcde1da78dbaf5bf84d" +


- Adding Channel & User Subscription Gifted events

--- Mixer.Base/Clients/ConstellationClient.cs
+++ Mixer.Base/Clients/ConstellationClient.cs
@@ -153,8 +153,19 @@
         /// https://dev.mixer.com/reference/constellation/events/live/channel%20skill
         /// </summary>
         [Name("Channel Skill Used")]
-        channel__id__skill
-}
+        channel__id__skill,
+
+        /// <summary>
+        /// https://dev.mixer.com/reference/constellation/events/live/channel%20subscription%20gifted
+        /// </summary>
+        [Name("Channel Subscription Gifted")]
+        channel__id__subscriptionGifted,
+        /// <summary>
+        /// https://dev.mixer.com/reference/constellation/events/live/user%20subscription%20gifted
+        /// </summary>
+        [Name("User Subscription Gifted")]
+        user__id__subscriptionGifted
+    }

     /// <summary>
     /// The real-time client for Constellation event interactions.


- Fixing issue with web socket client packet joining

--- Mixer.Base/Clients/WebSocketClientBase.cs
+++ Mixer.Base/Clients/WebSocketClientBase.cs
@@ -298,12 +298,12 @@
                                     {
                                         if (packet.type.Equals("method"))
                                         {
-                                            MethodPacket methodPacket = JsonConvert.DeserializeObject<MethodPacket>(jsonBuffer);
+                                            MethodPacket methodPacket = JsonConvert.DeserializeObject<MethodPacket>(packetData);
                                             this.SendSpecificPacket(methodPacket, this.OnMethodOccurred);
                                         }
                                         else if (packet.type.Equals("reply"))
                                         {
-                                            ReplyPacket replyPacket = JsonConvert.DeserializeObject<ReplyPacket>(jsonBuffer);
+                                            ReplyPacket replyPacket = JsonConvert.DeserializeObject<ReplyPacket>(packetData);

                                             if (this.replyIDListeners.ContainsKey(replyPacket.id))
                                             {
@@ -314,12 +314,10 @@
                                         }
                                         else if (packet.type.Equals("event"))
                                         {
-                                            EventPacket eventPacket = JsonConvert.DeserializeObject<EventPacket>(jsonBuffer);
+                                            EventPacket eventPacket = JsonConvert.DeserializeObject<EventPacket>(packetData);
                                             this.SendSpecificPacket(eventPacket, this.OnEventOccurred);
                                         }
                                     }
-
-                                    jsonBuffer = string.Empty;
                                 }
                             }
                             else


Do not hardcode the width when computing the size, to support device rotation

--- MonoTouch.Dialog/Elements/ElementBadge.cs
+++ MonoTouch.Dialog/Elements/ElementBadge.cs
@@ -98,7 +98,7 @@

 		public float GetHeight (UITableView tableView, NSIndexPath indexPath)
 		{
-			SizeF size = new SizeF (280, float.MaxValue);
+			SizeF size = new SizeF (tableView.Bounds.Width - 40, float.MaxValue);
 			float height = tableView.StringSize (Caption, Font, size, LineBreakMode).Height + 10;

 			// Image is 57 pixels tall, add some padding


bugfix for removing hashtypes on mono

bugfix for removing hashtypes on mono

--- Multiformats.Hash.Tests/ExtensionTests.cs
+++ Multiformats.Hash.Tests/ExtensionTests.cs
@@ -22,7 +22,7 @@

 #if MONO
             HashType hash;
-            while ((hash = hashes.SingleOrDefault(h => h.ToString().StartsWith("BLAKE2S"))) != null)
+            while ((hash = hashes.FirstOrDefault(h => h.ToString().StartsWith("BLAKE2S"))) != default(HashType))
             {
                 hashes.Remove(hash);
             }


Fix GUI in Visualizer.

Fix GUI in Visualizer.

--- N2.Visualizer/RuleSelectionDialog.xaml.cs
+++ N2.Visualizer/RuleSelectionDialog.xaml.cs
@@ -103,7 +103,7 @@
     {
       return string.IsNullOrEmpty(grammar.Namespace)
         ? grammar.Name
-        : grammar.Name + "(" + grammar.Namespace + ")";
+        : grammar.Name + " (" + grammar.Namespace + ")";
     }
   }
 }


Added wait until available before instance setup steps.

--- Naos.Deployment.Core/DeploymentManager.cs
+++ Naos.Deployment.Core/DeploymentManager.cs
@@ -167,6 +167,10 @@
                 this.announce("Waiting for Administrator password to be available (takes a few minutes for this).");
                 var machineManager = this.GetMachineManagerForInstance(createdInstanceDescription);

+                this.announce(
+                    "Waiting for machine to be accessible via WinRM (requires connectivity - make sure VPN is up if applicable).");
+                this.WaitUntilMachineIsAccessible(machineManager);
+
                 var instanceLevelSetupSteps =
                     this.setupStepFactory.GetInstanceLevelSetupSteps(createdInstanceDescription.ComputerName);
                 this.announce("Running setup actions that finalize the instance creation.");
@@ -175,7 +179,7 @@

                 // this is necessary for finishing start up items, might have to try a few times until WinRM is available...
                 this.announce(
-                    "Rebooting new instance to finalize any items from user data setup (requires connectivity - make sure VPN is up if applicable).");
+                    "Rebooting new instance to finalize any items from instance setup (requires connectivity - make sure VPN is up if applicable).");
                 this.RebootInstance(machineManager);

                 // get all message bus handler initializations to know if we need a handler.
@@ -567,9 +571,14 @@
                 }
             }

+            this.WaitUntilMachineIsAccessible(machineManager);
+        }
+
+        private void WaitUntilMachineIsAccessible(MachineManager machineManager)
+        {
             // TODO: move to machineManager.BlockUntilAvailable(TimeSpan.Zero);
             this.announce("Waiting for machine to come back up from reboot.");
-            sleepTimeInSeconds = 10d;
+            var sleepTimeInSeconds = 10d;
             var reachable = false;
             while (!reachable)
             {


populate folders if RemoveResourceInfos is null

--- NextcloudApp/Services/DirectoryService.cs
+++ NextcloudApp/Services/DirectoryService.cs
@@ -236,6 +236,10 @@
                                 Folders.Add(new FileOrFolder(item));
                             }
                         }
+                        else
+                        {
+                            Folders.Add(new FileOrFolder(item));
+                        }
                     }
                 }
             }


(GH-1785) Bump LatestBreakingChange to 0.22.0

- Fixes #1785

--- src/Cake.Core/Constants.cs
+++ src/Cake.Core/Constants.cs
@@ -8,7 +8,7 @@
 {
     internal static class Constants
     {
-        public static readonly Version LatestBreakingChange = new Version(0, 16, 0);
+        public static readonly Version LatestBreakingChange = new Version(0, 22, 0);

         public static class Settings
         {


Update SystemLaunch.cs

Update SystemLaunch.cs

--- src/Common/SystemLaunch.cs
+++ src/Common/SystemLaunch.cs
@@ -8,21 +8,51 @@
 	{
 		public static bool Path(string path)
 		{
-			return File.Exists(path) ? Launch(path) : false;
+			if (String.IsNullOrWhiteSpace(path))
+			{
+				throw new ArgumentNullException(nameof(path));
+			}
+
+			return File.Exists(path) && Launch(path);
 		}

 		public static bool Uri(Uri uri)
 		{
-			return uri.IsAbsoluteUri ? Launch(uri.AbsoluteUri) : false;
+			if (uri is null)
+			{
+				throw new ArgumentNullException(nameof(uri));
+			}
+
+			return uri.IsAbsoluteUri && Launch(uri.AbsoluteUri);
 		}

-		private static bool Launch(string launchString)
+		public static bool Launch(string launchString)
 		{
+			if (String.IsNullOrWhiteSpace(launchString))
+			{
+				throw new ArgumentNullException(nameof(launchString));
+			}
+
 			ProcessStartInfo pInfo = new ProcessStartInfo(launchString)
 			{
 				UseShellExecute = true
 			};

+			return LaunchInternal(pInfo);
+		}
+
+		public static bool Launch(ProcessStartInfo pInfo)
+		{
+			if (pInfo is null)
+			{
+				throw new ArgumentNullException(nameof(pInfo));
+			}
+
+			return LaunchInternal(pInfo);
+		}
+
+		private static bool LaunchInternal(ProcessStartInfo pInfo)
+		{
 			using Process p = new Process
 			{
 				StartInfo = pInfo


Update DeviceModel.cs

Update DeviceModel.cs

Added list of ContextItems and direct reference to Manufacturer, for PAIL compatibility.

--- source/ADAPT/Equipment/DeviceModel.cs
+++ source/ADAPT/Equipment/DeviceModel.cs
@@ -11,6 +11,7 @@
  *******************************************************************************/

 using AgGateway.ADAPT.ApplicationDataModel.Common;
+using System.Collections.Generic;

 namespace AgGateway.ADAPT.ApplicationDataModel.Equipment
 {
@@ -19,14 +20,19 @@
         public DeviceModel()
         {
             Id = CompoundIdentifierFactory.Instance.Create();
+            ContextItems = new List<ContextItem>();
         }

         public CompoundIdentifier Id { get; private set; }

         public string Description { get; set; }

+        public int ManufacturerId { get; set; }
+
         public int SeriesId { get; set; }

         public int BrandId { get; set; }
+
+        public List<ContextItem> ContextItems { get; set; }
     }
 }


Simplify default ctor.

Simplify default ctor.

--- src/Core/PackageManager.cs
+++ src/Core/PackageManager.cs
@@ -14,8 +14,8 @@
         private event EventHandler<PackageOperationEventArgs> _packageUninstalling;
         private event EventHandler<PackageOperationEventArgs> _packageUninstalled;

-        public PackageManager(IPackageRepository sourceRepository, IPackagePathResolver pathResolver, string path)
-            : this(sourceRepository, pathResolver, new PhysicalFileSystem(path)) {
+        public PackageManager(IPackageRepository sourceRepository, string path)
+            : this(sourceRepository, new DefaultPackagePathResolver(path), new PhysicalFileSystem(path)) {
         }

         public PackageManager(IPackageRepository sourceRepository, IPackagePathResolver pathResolver, IFileSystem fileSystem) :


Add Replaced and ReplacedUserId to the File noun

--- OpenAsset.RestClient.Library/Noun/File.cs
+++ OpenAsset.RestClient.Library/Noun/File.cs
@@ -58,6 +58,10 @@
         protected string uploaded;
         [JsonProperty(NullValueHandling = NullValueHandling.Ignore), BaseNounProperty]
         protected int? user_id;
+        [JsonProperty(NullValueHandling = NullValueHandling.Ignore), BaseNounProperty, VersionImplemented("9.0.0")]
+        protected string replaced;
+        [JsonProperty(NullValueHandling = NullValueHandling.Ignore), BaseNounProperty, VersionImplemented("9.0.0")]
+        protected int? replaced_user_id;
         [JsonProperty(NullValueHandling = NullValueHandling.Ignore), BaseNounProperty]
         protected string deleted;
         [JsonProperty(NullValueHandling = NullValueHandling.Ignore), BaseNounProperty]
@@ -206,6 +210,18 @@
             set { user_id = value; }
         }

+        public virtual DateTime Replaced
+        {
+            get { return dbString2DateTime(replaced); }
+            set { replaced = dateTime2DbString(value); }
+        }
+
+        public virtual int ReplacedUserId
+        {
+            get { return replaced_user_id ?? default(int); }
+            set { replaced_user_id = value; }
+        }
+
         public virtual DateTime Deleted
         {
             get { return dbString2DateTime(deleted); }


refactor: unused items removed

refactor: unused items removed

--- src/reni2/Parser/Syntax.cs
+++ src/reni2/Parser/Syntax.cs
@@ -20,9 +20,6 @@
         {
             protected NoChildren(BinaryTree anchor)
                 : base(anchor) { }
-
-            protected NoChildren(int objectId, BinaryTree anchor)
-                : base(objectId, anchor) { }

             [DisableDump]
             internal sealed override int LeftDirectChildCount => 0;
@@ -92,6 +89,7 @@
         internal IEnumerable<Syntax> ItemsAsLongAs(Func<Syntax, bool> condition)
             => this.GetNodesFromLeftToRight().SelectMany(node => node.CheckedItemsAsLongAs(condition));

+
         internal class Level
         {
             public bool IsCorrectOrder;


Updated AsemblyInfo

Updated AsemblyInfo

--- PID_Controller/Properties/AssemblyInfo.cs
+++ PID_Controller/Properties/AssemblyInfo.cs
@@ -6,9 +6,9 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("PID_Controller")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyDescription("A C# PID controller implementation")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("Tommallama")]
 [assembly: AssemblyProduct("PID_Controller")]
 [assembly: AssemblyCopyright("Copyright ©  2017")]
 [assembly: AssemblyTrademark("")]


Space after attributes in XMLStorage

Space after attributes in XMLStorage

--- PathfinderAPI/Util/XMLStorageAttribute.cs
+++ PathfinderAPI/Util/XMLStorageAttribute.cs
@@ -34,7 +34,8 @@
                 }

                 string val = (string)fieldInfo.GetValue(obj);
-                builder.Append($"{fieldInfo.Name}=\"{val}\"");
+                if (val != null)
+                    builder.Append($"{fieldInfo.Name}=\"{val}\" ");
             }
             foreach (var propertyInfo in thisType.GetProperties(Flags))
             {
@@ -50,7 +51,8 @@
                 }

                 string val = (string)getMethod.Invoke(obj, null);
-                builder.Append($"{propertyInfo.Name}=\"{val}\"");
+                if (val != null)
+                    builder.Append($"{propertyInfo.Name}=\"{val}\" ");
             }

             builder.Append("/>");


Made Abstract component public

Made Abstract component public

--- Primal/Main/Elements/AbstractComponent.cs
+++ Primal/Main/Elements/AbstractComponent.cs
@@ -4,7 +4,7 @@
     /// <summary>
     /// Abstract Implementation of the IComponent Interface.
     /// </summary>
-    class AbstractComponent : IComponent {
+    public class AbstractComponent : IComponent {
         public void Dispose() {
             //Empty, to be overridden.
         }


First functioning pass at consolidated connection logic

--- PrinterCommunication/PrinterConnection.cs
+++ PrinterCommunication/PrinterConnection.cs
@@ -34,6 +34,7 @@
 using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices;
+using System.Text;
 using System.Text.RegularExpressions;
 using System.Threading;
 using System.Threading.Tasks;
@@ -835,17 +836,10 @@
 		/// of occasional OnConnectionFailed calls, .Disable and .stopTryingToConnect
 		/// </summary>
 		/// <param name="abortReason">The concise message which will be used to describe the connection failure</param>
-		/// <param name="shutdownReadLoop">Shutdown/join the readFromPrinterThread</param>
-		public void AbortConnectionAttempt(string abortReason, bool shutdownReadLoop = true)
+		public void AbortConnectionAttempt(string abortReason)
 		{
 			// Set .Disconnecting to allow the read loop to exit gracefully before a forced thread join (and extended timeout)
 			CommunicationState = CommunicationStates.Disconnecting;
-
-			// Shutdown the readFromPrinter thread
-			if (shutdownReadLoop)
-			{
-				ReadThread.Join();
-			}

 			// Shutdown the serial port
 			if (serialPort != null)
@@ -967,46 +961,63 @@
 #if __ANDROID__
 						ToggleHighLowHigh(serialPort);
 #endif
+										// TODO: Review and reconsider the cases where this was required
 										// wait a bit of time to let the firmware start up
-										Thread.Sleep(500);
+										//Thread.Sleep(500);
+
 										CommunicationState = CommunicationStates.AttemptingToConnect;

-
-										// Read character data until we see a newline
-										while(...)
-
-										// If we've encountered a newline character and we're still in .AttemptingToConnect
-										if (CommunicationState == CommunicationStates.AttemptingToConnect)
+										// We have to send a line because some printers (like old print-r-bots) do not send anything when connecting and there is no other way to know they are there.
+										SendLineToPrinterNow("M110 N1");
+
+										var sb = new StringBuilder();
+
+										// Read character data until we see a newline or exceed the MAX_INVALID_CONNECTION_CHARS threshold
+										while (true)
 										{
-											// TODO: This is an initial proof of concept for validating the printer response after DTR. More work is
-											// needed to test this technique across existing hardware and/or edge cases where this simple approach
-											// (initial line having more than 3 non-ASCII characters) may not be adequate or appropriate.
-											// TODO: Revise the INVALID char count to an agreed upon threshold
-											string[] segments = lastLineRead.Split('?');
-											if (segments.Length <= MAX_INVALID_CONNECTION_CHARS)
+											// Read, sanitize, store
+											string response = serialPort.ReadExisting().Replace("\r\n", "\n").Replace('\r', '\n');
+											sb.Append(response);
+
+											bool hasNewline = response.Contains('\n');
+											if (hasNewline || response.Contains('?'))
 											{
-												CommunicationState = CommunicationStates.Connected;
-												TurnOffBedAndExtruders(); // make sure our ui and the printer agree and that the printer is in a known state (not heating).
-												haveReportedError = false;
-												// now send any command that initialize this printer
-												ClearQueuedGCode();
-												string connectGCode = printer.Settings.GetValue(SettingsKey.connect_gcode);
-												SendLineToPrinterNow(connectGCode);
-
-												// Call global event
-												AnyConnectionSucceeded.CallEvents(this, null);
-
-												// Call instance event
-												ConnectionSucceeded.CallEvents(this, null);
-											}
-											else
-											{
-												// Force port shutdown and cleanup
-												AbortConnectionAttempt("Invalid printer response".Localize(), false);
+												int invalidCharactersOnFirstLine = sb.ToString().Split('?').Length - 1;
+												if (hasNewline
+													&& invalidCharactersOnFirstLine <= MAX_INVALID_CONNECTION_CHARS)
+												{
+													// Switch to connected state when a newline is found and we haven't exceeded the invalid char count
+													CommunicationState = CommunicationStates.Connected;
+													TurnOffBedAndExtruders(); // make sure our ui and the printer agree and that the printer is in a known state (not heating).
+													haveReportedError = false;
+													// now send any command that initialize this printer
+													ClearQueuedGCode();
+
+													SendLineToPrinterNow(
+														printer.Settings.GetValue(SettingsKey.connect_gcode));
+
+													// Call global event
+													AnyConnectionSucceeded.CallEvents(this, null);
+
+													// Call instance event
+													ConnectionSucceeded.CallEvents(this, null);
+
+													// Exit loop
+													break;
+												}
+												else if (invalidCharactersOnFirstLine > MAX_INVALID_CONNECTION_CHARS)
+												{
+													// Abort if we've exceeded the invalid char count
+
+													// Force port shutdown and cleanup
+													AbortConnectionAttempt("Invalid printer response".Localize());
+													return;
+												}
 											}
 										}

-										ReadThread.Join();
+										// Place all consumed data back in the buffer to be processed by ReadFromPrinter
+										dataLastRead = sb.ToString();

 										Console.WriteLine("ReadFromPrinter thread created.");
 										ReadThread.Start(this);
@@ -1473,10 +1484,10 @@
 			}
 		}

+		private string dataLastRead = string.Empty;
+
 		public void ReadFromPrinter(ReadThread readThreadHolder)
 		{
-			string dataLastRead = string.Empty;
-
 			Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
 			timeSinceLastReadAnything.Restart();
 			// we want this while loop to be as fast as possible. Don't allow any significant work to happen in here
@@ -1515,17 +1526,6 @@
 							do
 							{
 								int returnPosition = dataLastRead.IndexOf('\n');
-
-								// Abort if we're AttemptingToConnect, no newline was found in the accumulator string and there's too many non-ascii chars
-								if (this.communicationState == CommunicationStates.AttemptingToConnect && returnPosition < 0)
-								{
-									int totalInvalid = dataLastRead.Count(c => c == '?');
-									if (totalInvalid > MAX_INVALID_CONNECTION_CHARS)
-									{
-										AbortConnectionAttempt("Invalid printer response".Localize(), false);
-									}
-								}
-
 								if (returnPosition < 0)
 								{
 									// there is no return keep getting characters
@@ -2131,10 +2131,13 @@
 		{
 			loadedGCode.Clear();
 			// Force a reset of the printer checksum state (but allow it to be write regexed)
-			var transformedCommand = processWriteRegExStream11.ProcessWriteRegEx("M110 N1");
-			foreach (var line in transformedCommand)
-			{
-				WriteChecksumLineToPrinter(line);
+			var transformedCommand = processWriteRegExStream11?.ProcessWriteRegEx("M110 N1");
+			if (transformedCommand != null)
+			{
+				foreach (var line in transformedCommand)
+				{
+					WriteChecksumLineToPrinter(line);
+				}
 			}
 		}


1574 Crash in require Ensures all.json is deployed to the experimental hive. Asserts if all.json is missing. Stops lazily creating ModuleTable._builtins, since we expect to always have builtins. Suppresses unnecessary warnings on resource strings with format specifiers.

--- Product/SharedProject/ProjectResources.cs
+++ Product/SharedProject/ProjectResources.cs
@@ -212,11 +212,11 @@
             }

             Debug.WriteLineIf(
-                Enumerable.Range(0, args.Length).Any(i => result.IndexOf(string.Format("{{{0}}}", i)) < 0),
+                Enumerable.Range(0, args.Length).Any(i => result.IndexOf(string.Format("{{{0}", i)) < 0),
                 string.Format("Resource string '{0}' does not use all {1} arguments", value, args.Length)
             );
             Debug.WriteLineIf(
-                result.IndexOf(string.Format("{{{0}}}", args.Length)) >= 0,
+                result.IndexOf(string.Format("{{{0}", args.Length)) >= 0,
                 string.Format("Resource string '{0}' requires more than {1} argument(s)", value, args.Length)
             );


- Removed isManuallyDefined because it was shadowing Resource.IsManuallyLoaded [1820278]

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

--- Projects/Axiom/Source/Engine/Core/Mesh.cs
+++ Projects/Axiom/Source/Engine/Core/Mesh.cs
@@ -138,26 +138,6 @@

 		#endregion SubMesh Properties

-		/// <summary>
-		///		Flag that indicates whether or not this mesh will be loaded from a file, or constructed manually.
-		///	</summary>
-		protected bool isManuallyDefined = false;
-		/// <summary>
-		///		Defines whether this mesh is to be loaded from a resource, or created manually at runtime.
-		/// </summary>
-		public bool IsManuallyDefined
-		{
-			get
-			{
-				return isManuallyDefined;
-			}
-			set
-			{
-				isManuallyDefined = value;
-			}
-		}
-
-
 		#region BoundingBox Property

 		/// <summary>
@@ -2789,7 +2769,7 @@
 			// Preload();

 			// load this bad boy if it is not to be manually defined
-			if ( !isManuallyDefined )
+			if ( !IsManuallyLoaded )
 			{
 				MeshSerializer serializer = new MeshSerializer();


Fixing a crash bug in GeneratorTypeReplacer

--- src/Boo.Lang.Compiler/Steps/Generators/GeneratorTypeReplacer.cs
+++ src/Boo.Lang.Compiler/Steps/Generators/GeneratorTypeReplacer.cs
@@ -73,7 +73,11 @@
 	                .Select(gp => (IGenericParameter) gp.Entity).ToArray();
                 mapper = new GeneratorTypeReplacer();
                 foreach (var genParam in type.GenericInfo.GenericParameters)
-                    mapper.Replace(genParam, allGenParams.First(gp => gp.Name.Equals(genParam.Name)));
+                {
+                    var replacement = allGenParams.FirstOrDefault(gp => gp.Name.Equals(genParam.Name));
+                    if (replacement != null)
+                        mapper.Replace(genParam, replacement);
+                }
 	            return mapper.MapType(type);
 	        }
             mapper = null;


Enhanced cs client db context sample

Enhanced cs client db context sample

--- src/CSharpClient/Bit.CSharpClientSample/Data/SampleDbContext.cs
+++ src/CSharpClient/Bit.CSharpClientSample/Data/SampleDbContext.cs
@@ -32,6 +32,8 @@
         protected override void OnModelCreating(ModelBuilder modelBuilder)
         {
             modelBuilder.AddSyncableDto<TestCustomerDto>();
+
+            base.OnModelCreating(modelBuilder);
         }

         public virtual DbSet<TestCustomerDto> TestCustomers { get; set; }


instance method call flow analysis fix

instance method call flow analysis fix

--- src/Compiler/PhpCodeAnalysis/FlowAnalysis/ExpressionAnalysis.cs
+++ src/Compiler/PhpCodeAnalysis/FlowAnalysis/ExpressionAnalysis.cs
@@ -1025,18 +1025,25 @@
             //
             TypeRefMask result_type = 0;

-            // reanalyse candidates
-            foreach (var c in overloads.Candidates)
-            {
-                // analyze TargetMethod with x.Arguments
-                // require method result type if access != none
-                var enqueued = this.Worklist.EnqueueRoutine(c, _analysis.CurrentBlock, args);
-                if (enqueued)   // => target has to be reanalysed
-                {
-                    // note: continuing current block may be waste of time
-                }
-
-                result_type |= c.GetResultType(TypeCtx);
+            if (overloads.IsFinal)
+            {
+                // reanalyse candidates
+                foreach (var c in overloads.Candidates)
+                {
+                    // analyze TargetMethod with x.Arguments
+                    // require method result type if access != none
+                    var enqueued = this.Worklist.EnqueueRoutine(c, _analysis.CurrentBlock, args);
+                    if (enqueued)   // => target has to be reanalysed
+                    {
+                        // note: continuing current block may be waste of time
+                    }
+
+                    result_type |= c.GetResultType(TypeCtx);
+                }
+            }
+            else
+            {
+                result_type = TypeRefMask.AnyType;
             }

             x.Overloads = overloads;


Fixes #712: Don't add Unicode BOM by default Changes default encoding to be UTF-8 without a signature.

--- Python/Product/Analysis/Parsing/Parser.cs
+++ Python/Product/Analysis/Parsing/Parser.cs
@@ -4831,7 +4831,7 @@
         /// New in 1.1.
         /// </summary>
         public static Encoding GetEncodingFromStream(Stream stream) {
-            return GetStreamReaderWithEncoding(stream, Encoding.UTF8, ErrorSink.Null).CurrentEncoding;
+            return GetStreamReaderWithEncoding(stream, new UTF8Encoding(false), ErrorSink.Null).CurrentEncoding;
         }

         private static StreamReader/*!*/ GetStreamReaderWithEncoding(Stream/*!*/ stream, Encoding/*!*/ defaultEncoding, ErrorSink errors) {


More tests for optional parameters.

More tests for optional parameters.

--- src/EditorFeatures/CSharpTest/AddParameter/AddParameterTests.cs
+++ src/EditorFeatures/CSharpTest/AddParameter/AddParameterTests.cs
@@ -2025,6 +2025,33 @@
             await TestInRegularAndScriptAsync(code, fix0, index: 0);
         }

+        [WorkItem(21446, "https://github.com/dotnet/roslyn/issues/21446")]
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsAddParameter)]
+        public async Task TestInvocation_InvocationStyles_Named_WithOptionalParam()
+        {
+            // error CS1739: The best overload for 'M' does not have a parameter named 'i3'
+            var code =
+@"
+class C
+{
+    void M(int i1, int i2 = 1) { }
+    void Test()
+    {
+        M(1, i2: 2, [|i3|]: 3);
+    }
+}";
+            var fix0 =
+@"
+class C
+{
+    void M(int i1, int i2 = 1, int i3 = 0) { }
+    void Test()
+    {
+        M(1, i2: 2, i3: 3);
+    }
+}";
+            await TestInRegularAndScriptAsync(code, fix0, index: 0);
+        }

         [WorkItem(21446, "https://github.com/dotnet/roslyn/issues/21446")]
         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsAddParameter)]


update test for default change

update test for default change

--- src/EditorFeatures/Test/SolutionCrawler/WorkCoordinatorTests.cs
+++ src/EditorFeatures/Test/SolutionCrawler/WorkCoordinatorTests.cs
@@ -696,12 +696,14 @@
         }

         [Fact, WorkItem(739943, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/739943")]
-        public async Task SemanticChange_Propagation()
+        public async Task SemanticChange_Propagation_Transitive()
         {
             var solution = GetInitialSolutionInfoWithP2P();

             using (var workspace = new WorkCoordinatorWorkspace(SolutionCrawler))
             {
+                workspace.Options = workspace.Options.WithChangedOption(InternalSolutionCrawlerOptions.DirectDependencyPropagationOnly, false);
+
                 workspace.OnSolutionAdded(solution);
                 await WaitWaiterAsync(workspace.ExportProvider);

@@ -712,13 +714,28 @@

                 Assert.Equal(1, worker.SyntaxDocumentIds.Count);
                 Assert.Equal(4, worker.DocumentIds.Count);
-
-#if false
-                Assert.True(1 == worker.SyntaxDocumentIds.Count,
-                    string.Format("Expected 1 SyntaxDocumentIds, Got {0}\n\n{1}", worker.SyntaxDocumentIds.Count, GetListenerTrace(workspace.ExportProvider)));
-                Assert.True(4 == worker.DocumentIds.Count,
-                    string.Format("Expected 4 DocumentIds, Got {0}\n\n{1}", worker.DocumentIds.Count, GetListenerTrace(workspace.ExportProvider)));
-#endif
+            }
+        }
+
+        [Fact, WorkItem(739943, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/739943")]
+        public async Task SemanticChange_Propagation_Direct()
+        {
+            var solution = GetInitialSolutionInfoWithP2P();
+
+            using (var workspace = new WorkCoordinatorWorkspace(SolutionCrawler))
+            {
+                workspace.Options = workspace.Options.WithChangedOption(InternalSolutionCrawlerOptions.DirectDependencyPropagationOnly, true);
+
+                workspace.OnSolutionAdded(solution);
+                await WaitWaiterAsync(workspace.ExportProvider);
+
+                var id = solution.Projects[0].Id;
+                var info = DocumentInfo.Create(DocumentId.CreateNewId(id), "D6");
+
+                var worker = await ExecuteOperation(workspace, w => w.OnDocumentAdded(info));
+
+                Assert.Equal(1, worker.SyntaxDocumentIds.Count);
+                Assert.Equal(3, worker.DocumentIds.Count);
             }
         }


Removed unnessesary OrderBy in GetDataConfig

--- src/Marten/QuerySession.cs
+++ src/Marten/QuerySession.cs
@@ -458,7 +458,6 @@
                 .Indexes
                 .OfType<FullTextIndex>()
                 .Where(i => i.RegConfig == regConfig)
-                .OrderBy(i => i.RegConfig)
                 .Select(i => i.DataConfig)
                 .FirstOrDefault() ?? FullTextIndex.DefaultRegConfig;
         }


Fixed unit test due to message changes

Fixed unit test due to message changes

Former-commit-id: c32c5e8c5c8ff24d70e1ed198aa0af4c73876d73

--- src/MassTransit.Tests/Configuration/When_configuration_fails.cs
+++ src/MassTransit.Tests/Configuration/When_configuration_fails.cs
@@ -59,8 +59,8 @@
 					x.ReceiveFrom("loopback://localhost/mt_queue");
 					x.Validate()
 						.Any(result => result.Disposition == ValidationResultDisposition.Warning
-									   && result.Message.Contains("default c'tor")
-									   && result.Key.Contains("CTorWarning"))
+									   && result.Message.Contains("default")
+									   && result.Key.Contains("Consumer"))
 						.ShouldBeTrue(string.Format("there should be a warning on message without default c'tors"));
 				}))
 			{


Fix projection aggregator

Fix projection aggregator

--- src/NRules/NRules.RuleModel/Aggregators/ProjectionAggregator.cs
+++ src/NRules/NRules.RuleModel/Aggregators/ProjectionAggregator.cs
@@ -36,6 +36,7 @@
             var source = (TSource)fact;
             var value = _selector(source);
             var oldValue = _sourceToValue[source];
+            _sourceToValue[source] = value;

             if (Equals(oldValue, value))
                 return new[] { AggregationResult.Modified(value) };


More exceptions, flush out bug

More exceptions, flush out bug

--- src/Paramore.Brighter.MessagingGateway.AWSSQS/ChannelFactory.cs
+++ src/Paramore.Brighter.MessagingGateway.AWSSQS/ChannelFactory.cs
@@ -162,23 +162,23 @@
             AmazonSimpleNotificationServiceClient snsClient,
             string queueUrl)
         {
-            throw new Exception($"Trace variables during bind topic: {_channelTopicARN}, against queue {queueUrl}");
-            /*
             var subscription = snsClient.SubscribeQueueAsync(_channelTopicARN, sqsClient, queueUrl).Result;
             if (!string.IsNullOrEmpty(subscription))
             {
+                throw new Exception($"Trace variables during bind topic: {_channelTopicARN}, against queue {queueUrl}");
+            /*
                 //We need to support raw messages to allow the use of message attributes
                 var response = snsClient.SetSubscriptionAttributesAsync(new SetSubscriptionAttributesRequest(subscription, "RawMessageDelivery", "true")).Result;
                 if (response.HttpStatusCode != HttpStatusCode.OK)
                 {
                     throw new InvalidOperationException($"Unable to set subscription attribute for raw message delivery");
                 }
+            */
             }
             else
             {
                 throw new InvalidOperationException($"Could not subscribe to topic: {_channelTopicARN} from queue: {queueUrl} in region {_awsConnection.Region}");
             }
-            */
         }

         private string ToSecondsAsString(int timeountInMilliseconds)


Fix for "PSInvalidOperationException: Nested pipeline should run only from a running pipeline." when using PowerShell v3

--- src/PowerBridge/Internal/IPowerShellCommandParameterProvider.cs
+++ src/PowerBridge/Internal/IPowerShellCommandParameterProvider.cs
@@ -14,7 +14,7 @@
     {
         public string[] GetDefaultParameterSetParameterNames(string commandName)
         {
-            using (var powerShell = PowerShell.Create(RunspaceMode.CurrentRunspace))
+            using (var powerShell = PowerShell.Create(RunspaceMode.NewRunspace))
             {
                 var command = new Command("Get-Command");
                 command.Parameters.Add("Name", commandName);


Changed link

Changed link

--- src/SFA.DAS.EmployerUsers.Web/Views/Shared/_CookieBanner.cshtml
+++ src/SFA.DAS.EmployerUsers.Web/Views/Shared/_CookieBanner.cshtml
@@ -5,7 +5,7 @@

Tell us whether you accept cookies

-
We use cookies to collect information about how you use this service. We use this information to make the service work as well as possible and improve this service.

+
We use cookies to collect information about how you use this service. We use this information to make the service work as well as possible and improve this service.

                             <button class="govuk-button das-cookie-banner__button" type="submit" data-accept-cookies="true">Accept all cookies</button>


Neil/Raj - added logo into hs footer

Neil/Raj - added logo into hs footer

--- src/StockportWebapp/Views/healthystockport/Shared/Footer.cshtml
+++ src/StockportWebapp/Views/healthystockport/Shared/Footer.cshtml
@@ -1,4 +1,8 @@
-
+@using System.Threading.Tasks
+@using StockportWebapp.Models
+@inject IStaticAssets StaticAssets
+
+
     @*This script enables the feedback button.*@

@@ -23,7 +27,7 @@

Funded By

-
+


Ensure all selected inputs are added when only adding selected inputs (#3067)

See #3041.

The `BuildTransactionWithSelectedInputs` test case passes after this fix.

--- src/Stratis.Bitcoin.Features.Wallet/WalletTransactionHandler.cs
+++ src/Stratis.Bitcoin.Features.Wallet/WalletTransactionHandler.cs
@@ -311,6 +311,9 @@
             if (balance < totalToSend)
                 throw new WalletException("Not enough funds.");

+            Money sum = 0;
+            var coins = new List<Coin>();
+
             if (context.SelectedInputs != null && context.SelectedInputs.Any())
             {
                 // 'SelectedInputs' are inputs that must be included in the
@@ -331,16 +334,22 @@
                             context.UnspentOutputs.Remove(unspentOutputsItem.Value);
                     }
                 }
-            }
-
-            Money sum = 0;
-            int index = 0;
-            var coins = new List<Coin>();
-            foreach (UnspentOutputReference item in context.UnspentOutputs.OrderByDescending(a => a.Confirmations > 0).ThenByDescending(a => a.Transaction.Amount))
-            {
-                coins.Add(new Coin(item.Transaction.Id, (uint)item.Transaction.Index, item.Transaction.Amount, item.Transaction.ScriptPubKey));
-                sum += item.Transaction.Amount;
-                index++;
+
+                foreach (OutPoint outPoint in context.SelectedInputs)
+                {
+                    UnspentOutputReference item = availableHashList[outPoint];
+
+                    coins.Add(new Coin(item.Transaction.Id, (uint)item.Transaction.Index, item.Transaction.Amount, item.Transaction.ScriptPubKey));
+                    sum += item.Transaction.Amount;
+                }
+            }
+
+            foreach (UnspentOutputReference item in context.UnspentOutputs
+                .OrderByDescending(a => a.Confirmations > 0)
+                .ThenByDescending(a => a.Transaction.Amount))
+            {
+                if (context.SelectedInputs?.Contains(item.ToOutPoint()) ?? false)
+                    continue;

                 // If the total value is above the target
                 // then it's safe to stop adding UTXOs to the coin list.
@@ -348,6 +357,9 @@
                 // when the wallet is bloated with UTXOs.
                 if (sum > totalToSend)
                     break;
+
+                coins.Add(new Coin(item.Transaction.Id, (uint)item.Transaction.Index, item.Transaction.Amount, item.Transaction.ScriptPubKey));
+                sum += item.Transaction.Amount;
             }

             // All the UTXOs are added to the builder without filtering.


Correct creation of corners when the skew is too high

--- geometry/objects/RoundedCube.cs
+++ geometry/objects/RoundedCube.cs
@@ -209,13 +209,13 @@
 		// Create the top or bottom planes

 		// TR
-		addCornerVerticesToArray(ref vertices, ref position, segments, radius, w * 0.5f - radius + offsetX, -h * 0.5f + radius + offsetY, z);
+		addCornerVerticesToArray(ref vertices, ref position, segments, radius, w * 0.5f - radius + offsetX, -h * 0.5f + radius + offsetY, z, false, true);
 		// BR
-		addCornerVerticesToArray(ref vertices, ref position, segments, radius, w * 0.5f - radius + offsetX, h * 0.5f - radius + offsetY, z);
+		addCornerVerticesToArray(ref vertices, ref position, segments, radius, w * 0.5f - radius + offsetX, h * 0.5f - radius + offsetY, z, false, false);
 		// BL
-		addCornerVerticesToArray(ref vertices, ref position, segments, radius, -w * 0.5f + radius + offsetX, h * 0.5f - radius + offsetY, z);
+		addCornerVerticesToArray(ref vertices, ref position, segments, radius, -w * 0.5f + radius + offsetX, h * 0.5f - radius + offsetY, z, true, false);
 		// TL
-		addCornerVerticesToArray(ref vertices, ref position, segments, radius, -w * 0.5f + radius + offsetX, -h * 0.5f + radius + offsetY, z);
+		addCornerVerticesToArray(ref vertices, ref position, segments, radius, -w * 0.5f + radius + offsetX, -h * 0.5f + radius + offsetY, z, true, true);
 	}

 	private void addCapTrianglesToArray(ref int[] triangles, ref int position, int verticesPosition, int verticesPerPlane, bool flip = false) {
@@ -268,23 +268,23 @@
 		}
 	}

-	private void addCornerVerticesToArray(ref Vector3[] vertices, ref int position, int segments, float radius, float x, float y, float z) {
+	private void addCornerVerticesToArray(ref Vector3[] vertices, ref int position, int segments, float radius, float x, float y, float z, bool leftCorner, bool topCorner) {
 		// Create the corner vertices
 		if (segments == 0) {
 			// No rounded corner at all
-			vertices[position].x = x + (x > 0 ? radius : -radius);
-			vertices[position].y = y + (y > 0 ? radius : -radius);
+			vertices[position].x = x + (leftCorner ? -radius : radius);
+			vertices[position].y = y + (topCorner ? -radius : radius);
 			vertices[position].z = z;
 			position++;
 		} else {
 			const float HALF_PI = (float)(Math.PI * 0.5);

 			float startingAngle;
-			if (x > 0 && y > 0) {
+			if (!leftCorner && !topCorner) {
 				startingAngle = 0;
-			} else if (x < 0 && y > 0) {
+			} else if (leftCorner && !topCorner) {
 				startingAngle = HALF_PI;
-			} else if (x < 0 && y < 0) {
+			} else if (leftCorner && topCorner) {
 				startingAngle = HALF_PI * 2f;
 			} else {
 				startingAngle = HALF_PI * 3f;


Changed decoding of Jws.Payload from UTF-8 to ASCII because ASCII is the natural encoding for Base64

--- solution/xmisc.core.authentication/tokens/jws.cs
+++ solution/xmisc.core.authentication/tokens/jws.cs
@@ -151,7 +151,7 @@
             {
                 throw new ArgumentException($"{nameof(value)} can neither be null nor empty.", nameof(value));
             }
-            var content = value.FromBase64UrlSafe().FromUtf8Bytes();
+            var content = value.FromBase64UrlSafe().FromAsciiBytes();
             var o = JsonObject.Parse(content);

             return new Payload


Passing test for BOGOF applied to basket with multiple unrelated items

--- engine/engine/tests/BuyOneGetOneFreeRuleTests.cs
+++ engine/engine/tests/BuyOneGetOneFreeRuleTests.cs
@@ -32,6 +32,19 @@
             Assert.That(returnedBasket, Is.EquivalentTo(expectedBasket));
         }

+        [Test]
+        public void BasketWithMultipleUnrelatedItems()
+        {
+            m_InputBasket.Add("apple", 1, 3);
+            var rule = new BuyOneGetOneFreeRule("item");
+
+            var returnedBasket = rule.Apply(m_InputBasket);
+
+            var expectedBasket = new Basket();
+            expectedBasket.Add("apple", 1, 3);
+            Assert.That(returnedBasket, Is.EquivalentTo(expectedBasket));
+        }
+
         [SetUp]
         public void Setup()
         {


Added a very liberal llVector3.Parse() and .TryParse().
If you feed it 3 numbers with any combinations of arrow brackets, commas or spaces, you should get a vector.

git-svn-id: baf6e02d125cf6f9bfcfe153b2eb83d6e1f5ace6@921 52acb1d6-8a22-11de-b505-999d5b087335

--- libsecondlife-cs/Types.cs
+++ libsecondlife-cs/Types.cs
@@ -500,6 +500,33 @@
 		}

         /// <summary>
+        /// Generate a llVector3 from a string
+        /// </summary>
+        /// <param name="val">A string representation of a 3d vector, enclosed
+        /// in arrow brackets and separated by commas</param>
+        /// <example>llVector3.Parse("<128.00000, 128.50000, 20.00000>")</example>
+        public static LLVector3 Parse(string val)
+        {
+            char[] splitChar = { ',', ' ' };
+            string[] split = val.Replace("<","").Replace(">","").Split(splitChar, StringSplitOptions.RemoveEmptyEntries);
+            return new LLVector3(float.Parse(split[0].Trim()), float.Parse(split[1].Trim()), float.Parse(split[2].Trim()));
+        }
+
+        public static bool TryParse(string val, out LLVector3 result)
+        {
+            try
+            {
+                result = Parse(val);
+                return true;
+            }
+            catch (Exception)
+            {
+                result = new LLVector3();
+                return false;
+            }
+        }
+
+        /// <summary>
         ///
         /// </summary>
         /// <param name="o"></param>


fix culture-specific test

fix culture-specific test

--- source/fitSharpTest/NUnit/Fit/ParseSymbolTest.cs
+++ source/fitSharpTest/NUnit/Fit/ParseSymbolTest.cs
@@ -27,8 +27,8 @@
         }

         [Test] public void ParsesTypeFromString() {
-            Parser.Processor.Get<Symbols>().Save("symbol", "123.45");
-            Assert.AreEqual(123.45, ParseAs<double>("<<symbol"));
+            Parser.Processor.Get<Symbols>().Save("symbol", 123.45d.ToString());
+            Assert.AreEqual(123.45d, ParseAs<double>("<<symbol"));
         }

         [Test] public void ParseAddsInformationSuffix() {


stabs in the dark at login loops.

stabs in the dark at login loops.

--- src/website/Global.asax.cs
+++ src/website/Global.asax.cs
@@ -1,4 +1,5 @@
 using System;
+using System.IdentityModel.Tokens;
 using System.Security.Claims;
 using System.Security.Principal;
 using System.Threading;
@@ -7,6 +8,7 @@
 using System.Web.Optimization;
 using System.Web.Routing;
 using Kcsara.Database.Web.api;
+using Microsoft.IdentityModel.Protocols;
 using Ninject;

 namespace Kcsara.Database.Web
@@ -32,5 +34,19 @@
         Thread.CurrentPrincipal = Context.User;
       }
     }
+
+    protected void Application_Error(Object sender, EventArgs e)
+    {
+      var ex = Server.GetLastError();
+      if (ex is OpenIdConnectProtocolInvalidNonceException || ex is SecurityTokenExpiredException)
+      {
+        Response.Redirect("~/");
+      }
+    }
+
+    void Session_Start(object sender, EventArgs e)
+    {
+      // place holder to solve endless loop issue
+    }
   }
 }


Recognise dummy multiline string modifier option.

--- Scripting/Parser/Texts/MulitlineString.cs
+++ Scripting/Parser/Texts/MulitlineString.cs
@@ -43,6 +43,9 @@
                     {
                         case "LTRIM":
                             ltrim = true;
+                            break;
+
+                        case "RTRIM":
                             break;

                         case "RTRIM0":


fix FirebirdDialect FIRST keyword naming/positioning

--- Serenity.Data/Dialects/FirebirdDialect.cs
+++ Serenity.Data/Dialects/FirebirdDialect.cs
@@ -149,7 +149,7 @@
         {
             get
             {
-                return "TOP";
+                return "FIRST";
             }
         }

@@ -181,7 +181,7 @@
         {
             get
             {
-                return true;
+                return false;
             }
         }
     }


Simplify loading providers.

Simplify loading providers.

--- ShowRenamer.Extensibility/PluginLoader.cs
+++ ShowRenamer.Extensibility/PluginLoader.cs
@@ -51,13 +51,10 @@
             // Regexes
             IEnumerable<Regex> allPluginRegexes = plugins.SelectMany(r => r.FileNameRegexes);
             Debug.WriteLine($"Found {allPluginRegexes.Count()} regexes.");
-            List<SimpleRegexMatcher> allMatchers = new List<SimpleRegexMatcher>();
             foreach (Regex r in allPluginRegexes)
             {
-                allMatchers.Add(new SimpleRegexMatcher(r));
+                allProviders.Add(new SimpleRegexMatcher(r));
             }
-            Debug.WriteLine($"Initialised {allMatchers.Count} regexes.");
-            allProviders.Concat(allMatchers);
             Debug.WriteLine($"{allProviders.Count} providers after regexes.");
             // Other providers
             allProviders.Concat(plugins.SelectMany(r => r.FileNameProviders));


forceCreate

forceCreate

--- Signum.Utilities/DescriptionAttributes.cs
+++ Signum.Utilities/DescriptionAttributes.cs
@@ -259,7 +259,7 @@
         {
             return localizations
                 .GetOrAdd(cultureInfo, ci => new ConcurrentDictionary<Assembly, LocalizedAssembly>())
-                .GetOrAdd(assembly, (Assembly a) => LocalizedAssembly.ImportXml(assembly, cultureInfo));
+                .GetOrAdd(assembly, (Assembly a) => LocalizedAssembly.ImportXml(assembly, cultureInfo, forceCreate : false));
         }

         internal static DescriptionOptions? OnDefaultDescriptionOptions(Type type)
@@ -365,8 +365,8 @@

             DescriptionManager.Invalidate();
         }
-
-        public static LocalizedAssembly ImportXml(Assembly assembly, CultureInfo cultureInfo)
+
+        public static LocalizedAssembly ImportXml(Assembly assembly, CultureInfo cultureInfo, bool forceCreate)
         {
             var defaultCulture = GetDefaultAssemblyCulture(assembly);

@@ -383,7 +383,7 @@
                 .Distinct(x => x.Key)
                 .ToDictionary();

-            if (!isDefault && file == null)
+            if (!isDefault && !forceCreate && file == null)
                 return null;

             var result = new LocalizedAssembly


Code refactor

Code refactor

--- src/serilog-sinks-mysql/Sinks/MySQL/MySqlSink.cs
+++ src/serilog-sinks-mysql/Sinks/MySQL/MySqlSink.cs
@@ -119,9 +119,9 @@
                         foreach (var logEvent in logEventsBatch)
                         {
                             insertCommand.Parameters["@ts"].Value = _storeTimestampInUtc
-                                ? logEvent.Timestamp.ToUniversalTime().ToString("o")
-                                : logEvent.Timestamp.ToString("o");
-
+                                ? logEvent.Timestamp.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss.fffzzz")
+                                : logEvent.Timestamp.ToString("yyyy-MM-dd HH:mm:ss.fffzzz");
+
                             insertCommand.Parameters["@lvel"].Value = logEvent.Level.ToString();
                             insertCommand.Parameters["@msg"].Value = logEvent.MessageTemplate.ToString();
                             insertCommand.Parameters["@ex"].Value = logEvent.Exception?.ToString();


Implement selection order.

Implement selection order.

--- Sketchball/Controls/PinballEditControl.cs
+++ Sketchball/Controls/PinballEditControl.cs
@@ -28,6 +28,12 @@
                 if (prevElement != _selectedElement)
                 {
                     RaiseSelectionChanged(prevElement);
+
+                    if (SelectedElement != null)
+                    {
+                        PinballMachine.Remove(SelectedElement);
+                        PinballMachine.Add(SelectedElement);
+                    }
                     Invalidate();
                 }
             }
@@ -73,7 +79,7 @@

             SelectionPen = new Pen(Color.Black, 1);
             SelectionPen.DashStyle = DashStyle.Dash;
-
+
             UpdateSize();

             History.Change += () => { Invalidate(); };


Fix CA2101

Fix CA2101

--- csharp/TpsGraphNet/NativeMethods.cs
+++ csharp/TpsGraphNet/NativeMethods.cs
@@ -7,7 +7,7 @@
     {
         #region public static methods

-        [DllImport("kernel32", EntryPoint = "CreateFileMapping", SetLastError = true, CharSet = CharSet.Auto)]
+        [DllImport("kernel32", EntryPoint = "CreateFileMapping", SetLastError = true, CharSet = CharSet.Unicode)]
         public static extern IntPtr CreateFileMapping(IntPtr hFile, IntPtr lpAttributes, int flProtect, int dwMaximumSizeLow, int dwMaximumSizeHigh, string lpName);

         [DllImport("kernel32", EntryPoint = "CloseHandle", SetLastError = true)]


fixed highlighting integration test

fixed highlighting integration test

--- SolrNet.Tests/Integration.Sample/Tests.cs
+++ SolrNet.Tests/Integration.Sample/Tests.cs
@@ -17,6 +17,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Linq;
 using MbUnit.Framework;
 using Microsoft.Practices.ServiceLocation;
 using SolrNet.Commands.Parameters;
@@ -184,7 +185,7 @@
             Assert.IsNotNull(results.Highlights);
             Assert.AreEqual(1, results.Highlights.Count);
             foreach (var h in results.Highlights[results[0].Id]) {
-                Console.WriteLine("{0}: {1}", h.Key, h.Value);
+                Console.WriteLine("{0}: {1}", h.Key, string.Join(", ", h.Value.ToArray()));
             }
         }


Remove AssumeNotNull

Remove AssumeNotNull

--- src/Narvalo.Fx/Sequence.cs
+++ src/Narvalo.Fx/Sequence.cs
@@ -96,7 +96,11 @@

             // We could use "yield break", but Enumerable.Empty<T> is more readable
             // with the additional benefit of returning a singleton.
-            return Enumerable.Empty<TSource>().AssumeNotNull();
+            var retval = Enumerable.Empty<TSource>();
+
+            Contract.Assume(retval != null);
+
+            return retval;
         }
     }
 }


improved LruCache

improved LruCache

--- src/Aardvark.Base/AlgoDat/LruCache.cs
+++ src/Aardvark.Base/AlgoDat/LruCache.cs
@@ -80,6 +80,8 @@
                 {
                     if (m_deleteAct != null)
                         m_deleteAct(removeKey, entry.Value);
+                    var disposable = entry.Value as IDisposable;
+                    if (disposable != null) disposable.Dispose();
                     size -= entry.Size;
                 }
                 else
@@ -121,6 +123,33 @@
             }
         }

+        public TValue GetOrAdd(TKey key, long size, Func<TValue> valueFun)
+        {
+            Entry entry;
+            lock (m_lock)
+            {
+                if (m_cache.TryGetValue(key, out entry))
+                {
+                    entry.Time = ++m_time;
+                    Sink(m_heap, entry.Index);
+                }
+                else
+                {
+                    Shrink(m_size + size);
+                    entry = new Entry
+                    {
+                        Time = ++m_time,
+                        Size = size,
+                        Key = key,
+                        Value = valueFun(),
+                    };
+                    m_cache[key] = entry;
+                    Enqueue(m_heap, entry);
+                }
+                return entry.Value;
+            }
+        }
+
         /// <summary>
         /// Remove the entry with the supplied key from the hash.
         /// Returns true on success and puts the value of the
@@ -135,6 +164,8 @@
                 {
                     m_size -= entry.Size;
                     RemoveAt(m_heap, entry.Index);
+                    if (m_deleteAct != null)
+                        m_deleteAct(key, entry.Value);
                     value = entry.Value;
                     return true;
                 }
@@ -156,6 +187,10 @@
                 {
                     m_size -= entry.Size;
                     RemoveAt(m_heap, entry.Index);
+                    if (m_deleteAct != null)
+                        m_deleteAct(key, entry.Value);
+                    var disposable = entry.Value as IDisposable;
+                    if (disposable != null) disposable.Dispose();
                     return true;
                 }
                 return false;


Make seal last and move newing up create map functions before do config and seal.

--- src/AutoMapper/MapperConfiguration.cs
+++ src/AutoMapper/MapperConfiguration.cs
@@ -39,15 +39,15 @@

             _profiles.Add(_defaultProfile);

-            _validator = new ConfigurationValidator(this);
-
-            configure(this);
-
-            Seal();
-
             ExpressionBuilder = new ExpressionBuilder(this);
             _getTypeMap = GetTypeMap;
             _createMapperFunc = CreateMapperFunc;
+
+            _validator = new ConfigurationValidator(this);
+
+            configure(this);
+
+            Seal();
         }

         public string ProfileName => "";


Update QueryableExtensions.cs

Update QueryableExtensions.cs

--- src/AutoMapper/QueryableExtensions.cs
+++ src/AutoMapper/QueryableExtensions.cs
@@ -1,14 +1,14 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Reflection;
-using AutoMapper.Impl;
-using AutoMapper.Internal;
-
 namespace AutoMapper.QueryableExtensions
 {
+    using System;
+    using System.Collections;
+    using System.Collections.Generic;
+    using System.Linq;
+    using System.Linq.Expressions;
+    using System.Reflection;
+    using AutoMapper.Impl;
+    using AutoMapper.Internal;
+
     public static class Extensions
     {
         private static readonly IDictionaryFactory DictionaryFactory = PlatformAdapter.Resolve<IDictionaryFactory>();


Added extension method to convert mocks to their objects.

--- Source/Core.Testing/Moq/MockExtensions.cs
+++ Source/Core.Testing/Moq/MockExtensions.cs
@@ -30,7 +30,24 @@

 namespace Moq
 {
+    using System.Collections.Generic;
+    using System.Linq;
+    using nGratis.Cop.Core.Contract;
+
     public static partial class MockExtensions
     {
+        public static T[] ToObjects<T>(this IEnumerable<Mock<T>> mocks)
+            where T : class
+
+        {
+            Guard
+                .Require(mocks, nameof(mocks))
+                .Is.Not.Null()
+                .Is.Not.Empty();
+
+            return mocks
+                .Select(mock => mock.Object)
+                .ToArray();
+        }
     }
 }


Fix test.

Fix test.

--- src/Core/Tests/Queue/QueueTestBase.cs
+++ src/Core/Tests/Queue/QueueTestBase.cs
@@ -495,7 +495,7 @@
             await queue.EnqueueAsync(new SimpleWorkItem { Id = 2, Data = "Testing" });
             await queue.EnqueueAsync(new SimpleWorkItem { Id = 3, Data = "Testing" });

-            await Task.Delay(50);
+            await Task.Delay(100);

             _logger.Trace("Before dequeue");
             var item = await queue.DequeueAsync();
@@ -510,7 +510,7 @@
             _logger.Trace("Before asserts");
             Assert.Equal(2, completedCount);

-            Assert.Equal(3, (await metricsClient.GetGaugeStatsAsync("metric.workitemdata.count")).Max);
+            Assert.InRange((await metricsClient.GetGaugeStatsAsync("metric.workitemdata.count")).Max, 2, 3);
             Assert.InRange((await metricsClient.GetGaugeStatsAsync("metric.workitemdata.working")).Max, 0, 1);

             Assert.Equal(3, await metricsClient.GetCounterCountAsync("metric.workitemdata.simple.enqueued"));


Refactored variable name

Refactored variable name

--- src/CryptoKnight.Client.UI/Startup.cs
+++ src/CryptoKnight.Client.UI/Startup.cs
@@ -52,10 +52,10 @@
             {
                 var assemblyName = file.Name.Replace(".dll", "");
                 Console.WriteLine($@"Loaded DLL: {assemblyName}");
-                var addIn = LoadAddIn(assemblyName, pluginSandboxDomain);
-                if (addIn == null) continue;
+                var plugin = LoadAddIn(assemblyName, pluginSandboxDomain);
+                if (plugin == null) continue;

-                Console.WriteLine($@"{file.Name}: {addIn.Decrypt(addIn.Encrypt("Blob"))}");
+                Console.WriteLine($@"{file.Name}: {plugin.Decrypt(plugin.Encrypt("Blob"))}");
             }

         }


Written tests for ObjectTrackingEnabled and DeferredLoadingEnabled

git-svn-id: 1800f71f313d917366f95485fa960eed04b40598@1043 33146b6e-df29-0410-a1ca-39be37fb9416

--- src/DbLinq/Test/Providers/ReadTest.cs
+++ src/DbLinq/Test/Providers/ReadTest.cs
@@ -333,6 +333,42 @@
             Assert.AreEqual(4, employeeCount, "Expected for employees, got count=" + employeeCount);
         }

+        [Test]
+        [ExpectedException(ExceptionType=typeof(InvalidOperationException), ExpectedMessage="Data context options cannot be modified after results have been returned from a query.")]
+        public void C13_Changing_ObjectTrackingEnabled2False()
+        {
+            Northwind db = CreateDB();
+            var q = from t in db.Territories
+                    select t;
+            var employeeCount = q.Count();
+            db.ObjectTrackingEnabled = false;
+            Assert.AreEqual(4, employeeCount, "Expected for employees, got count=" + employeeCount);
+        }
+
+        [Test]
+        [ExpectedException(ExceptionType = typeof(InvalidOperationException), ExpectedMessage = "Data context options cannot be modified after results have been returned from a query.")]
+        public void C14_Changing_DeferredLoadingEnabled2False()
+        {
+            Northwind db = CreateDB();
+            var q = from t in db.Territories
+                    select t;
+            var employeeCount = q.Count();
+            db.DeferredLoadingEnabled = false;
+            Assert.AreEqual(4, employeeCount, "Expected for employees, got count=" + employeeCount);
+        }
+
+        [Test]
+        [ExpectedException(ExceptionType = typeof(InvalidOperationException), ExpectedMessage = "Object tracking is not enabled for the current data context instance.")]
+        public void C15_SubmitChanges_DeferredLoadingEnabled_False()
+        {
+            Northwind db = CreateDB();
+            db.ObjectTrackingEnabled = false;
+            var q = from t in db.Territories
+                    select t;
+            var employeeCount = q.Count();
+            db.SubmitChanges();
+        }
+
         #endregion

         #region region D - select first or last - calls IQueryable.Execute instead of GetEnumerator


Renamed AudioService functions

Renamed AudioService functions

--- src/Discord.Net.Audio/AudioService.cs
+++ src/Discord.Net.Audio/AudioService.cs
@@ -119,7 +119,7 @@
 			};
 		}

-		public DiscordAudioClient GetVoiceClient(Server server)
+		public DiscordAudioClient GetClient(Server server)
 		{
 			if (server == null) throw new ArgumentNullException(nameof(server));

@@ -137,7 +137,7 @@
 			else
 				return null;
 		}
-		private Task<DiscordAudioClient> CreateVoiceClient(Server server)
+		private Task<DiscordAudioClient> CreateClient(Server server)
 		{
 			if (!Config.EnableMultiserver)
 			{
@@ -170,17 +170,17 @@
 			return Task.FromResult(client);
 		}

-		public async Task<DiscordAudioClient> JoinVoiceServer(Channel channel)
+		public async Task<DiscordAudioClient> Join(Channel channel)
 		{
 			if (channel == null) throw new ArgumentNullException(nameof(channel));
 			//CheckReady(true);

-			var client = await CreateVoiceClient(channel.Server).ConfigureAwait(false);
+			var client = await CreateClient(channel.Server).ConfigureAwait(false);
 			await client.Join(channel).ConfigureAwait(false);
 			return client;
 		}
-
-		public async Task LeaveVoiceServer(Server server)
+
+		public async Task Leave(Server server)
 		{
 			if (server == null) throw new ArgumentNullException(nameof(server));
 			//CheckReady(true);


#10154 remove "floating-point" noise improvement

--- Source/OxyPlot/Utilities/AxisUtilities.cs
+++ Source/OxyPlot/Utilities/AxisUtilities.cs
@@ -70,7 +70,7 @@
                 i++;

                 // try to get rid of numerical noise
-                var v = Math.Round(value / step, 15) * step;
+                var v = Math.Round(value / step, 14) * step;
                 values.Add(v);
                 value += step;
             }


Adds class documentation to VariableModel.

--- src/Dyna.Core/Models/VariableModel.cs
+++ src/Dyna.Core/Models/VariableModel.cs
@@ -2,6 +2,9 @@

 namespace Dyna.Core.Models
 {
+    /// <summary>
+    /// A variable can hold a value constrained by a constraint.
+    /// </summary>
     [Serializable]
     public class VariableModel : GraphicModel
     {