#20 Wrap diff text with symbol "|" to see differences in whitespaces

--- TranslatorTests/Comparence.cs
+++ TranslatorTests/Comparence.cs
@@ -105,7 +105,7 @@
                     sb.AppendLine();
                     sb.AppendLine("DIFF for " + diff.ToString());
                     sb.AppendLine();
-                    sb.AppendLine(diffText);
+                    sb.AppendLine("|" + diffText + "|");
                 }
                 catch (Exception ex)
                 {
@@ -156,10 +156,7 @@

             }

-            //if (cd.Result != CompareResult.TheSame)
-            //{
-                comparence.Add(file.Name, cd);
-            //}
+            comparence.Add(file.Name, cd);
         }

         private static string AnyDifference(string file1, string file2)
@@ -169,7 +166,7 @@
                 using (Stream s2 = new FileStream(file2, FileMode.Open, FileAccess.Read, FileShare.Read))
                 {
                     if (s1.Length != s2.Length)
-                        return string.Format("Length difference {0} vs {1}", s1.Length, s2.Length);
+                        return string.Format("Length difference {0} vs {1}", s2.Length, s1.Length);

                     int i = 0;
                     while (i < s1.Length)
@@ -177,7 +174,7 @@
                         var b1 = s1.ReadByte();
                         var b2 = s2.ReadByte();
                         if ( b1 != b2 )
-                            return string.Format("Content difference found at {0} with {1} vs {2}", i, b1, b2);
+                            return string.Format("Content difference found at {0} with {1} vs {2}", i, b2, b1);

                         i++;
                     }


Fix typo (#15038)

Fix typo (#15038)

--- sdk/core/Azure.Core.TestFramework/src/RecordEntry.cs
+++ sdk/core/Azure.Core.TestFramework/src/RecordEntry.cs
@@ -190,7 +190,7 @@
                     // so if the root is an array we can't write it directly
                     // fallback to generic string writing. Also, if the root is a string
                     // we don't want to write it directly, as this would make matching
-                    // not won't work in libraries that allow passing JSON as a string.
+                    // not work in libraries that allow passing JSON as a string.
                     if (document.RootElement.ValueKind != JsonValueKind.Array &&
                         document.RootElement.ValueKind != JsonValueKind.String)
                     {


Removed unnessary parameter

Removed unnessary parameter

--- Commands/Admin/GetTenantAppCatalogUrl.cs
+++ Commands/Admin/GetTenantAppCatalogUrl.cs
@@ -19,9 +19,6 @@
     [CmdletExample(Code = @"PS:> Get-PnPTenantAppCatalogUrl", Remarks = "Returns the url of the tenant scoped app catalog site collection", SortOrder = 1)]
     public class GetTenantAppCatalogUrl : PnPCmdlet
     {
-        [Parameter(Mandatory = false, HelpMessage = "The key of the value to retrieve.")]
-        public string Key;
-
         protected override void ExecuteCmdlet()
         {
             var settings = Microsoft.SharePoint.Client.TenantSettings.GetCurrent(ClientContext);


Changed "max age" of EDDN event to 10 minutes to avoid sending outdated messages when importing data

--- DW.ELA.Plugin.EDDN/EddnEventConverter.cs
+++ DW.ELA.Plugin.EDDN/EddnEventConverter.cs
@@ -14,7 +14,7 @@
     {
         private static readonly ILogger logger = LogManager.GetCurrentClassLogger();
         public string UploaderID = "Unknown";
-        public TimeSpan MaxAge = TimeSpan.FromHours(6);
+        public TimeSpan MaxAge = TimeSpan.FromMinutes(10); // TODO: should extract to separate class

         private readonly IPlayerStateHistoryRecorder stateHistoryRecorder;


renamed prop

renamed prop

--- DataGen/Types/CountryCode/CountryCode.cs
+++ DataGen/Types/CountryCode/CountryCode.cs
@@ -13,7 +13,5 @@
             Code = code;
         }

-        public string ConstructNumber => Enumerable.Range(1, 7)
-            .Aggregate(Code, (current, i) => current + HelperClass.Randomizer(0, 9));
     }
 }


added app service tests

added app service tests

--- Tests.Unit.Core.ApplicationServices/ApplicationServices/RightsHolders/RightsHoldersServiceTest.cs
+++ Tests.Unit.Core.ApplicationServices/ApplicationServices/RightsHolders/RightsHoldersServiceTest.cs
@@ -1,8 +1,11 @@
-using System.Linq;
+using System;
+using System.Linq;
 using Core.ApplicationServices.Authorization;
 using Core.ApplicationServices.RightsHolders;
 using Core.ApplicationServices.System;
+using Core.DomainModel.ItSystem;
 using Core.DomainModel.Organization;
+using Core.DomainModel.Result;
 using Core.DomainServices;
 using Moq;
 using Tests.Toolkit.Patterns;
@@ -15,28 +18,28 @@
         private readonly RightsHoldersService _sut;
         private readonly Mock<IOrganizationalUserContext> _userContextMock;
         private readonly Mock<IGenericRepository<Organization>> _organizationRepositoryMock;
+        private readonly Mock<IItSystemService> _itSystemServiceMock;

         public RightsHoldersServiceTest()
         {
             _userContextMock = new Mock<IOrganizationalUserContext>();
             _organizationRepositoryMock = new Mock<IGenericRepository<Organization>>();
-            _sut = new RightsHoldersService(_userContextMock.Object, _organizationRepositoryMock.Object, Mock.Of<IItSystemService>());
+            _itSystemServiceMock = new Mock<IItSystemService>();
+            _sut = new RightsHoldersService(_userContextMock.Object, _organizationRepositoryMock.Object, _itSystemServiceMock.Object);
         }
-
-        //TODO: Test the bridge methods

         [Fact]
         public void ResolveOrganizationsWhereAuthenticatedUserHasRightsHolderAccess_Returns_Only_Organizations_Where_User_Has_RightsHolderAccessRole()
         {
             //Arrange
             Organization expectedOrg1 = new() { Id = A<int>() };
-            Organization expectedOrg2 = new() {Id = expectedOrg1.Id + 1};
-            Organization noMatchOrg = new() {Id = expectedOrg2.Id + 1};
+            Organization expectedOrg2 = new() { Id = expectedOrg1.Id + 1 };
+            Organization noMatchOrg = new() { Id = expectedOrg2.Id + 1 };

             _userContextMock.Setup(x => x.GetOrganizationIdsWhereHasRole(OrganizationRole.RightsHolderAccess))
-                .Returns(new[] {expectedOrg1.Id, expectedOrg2.Id});
+                .Returns(new[] { expectedOrg1.Id, expectedOrg2.Id });
             _organizationRepositoryMock.Setup(x => x.AsQueryable())
-                .Returns(new EnumerableQuery<Organization>(new[] {noMatchOrg, expectedOrg1, expectedOrg2}));
+                .Returns(new EnumerableQuery<Organization>(new[] { noMatchOrg, expectedOrg1, expectedOrg2 }));

             //Act
             var organizations = _sut.ResolveOrganizationsWhereAuthenticatedUserHasRightsHolderAccess().ToList();
@@ -46,5 +49,72 @@
             Assert.Same(expectedOrg1, organizations.First());
             Assert.Same(expectedOrg2, organizations.Last());
         }
+
+        [Fact]
+        public void GetAvailableSystems_Returns_Forbidden_If_User_Does_Not_Have_RightsHoldersAccess()
+        {
+            //Arrange
+            ExpectUserHasRightsHolderAccessReturns(false);
+
+            //Act
+            var result = _sut.GetAvailableSystems();
+
+            //Assert
+            Assert.True(result.Failed);
+            Assert.Equal(OperationFailure.Forbidden, result.Error.FailureType);
+        }
+
+        [Fact]
+        public void Can_GetAvailableSystems_If_User_Has_RightsHoldersAccess()
+        {
+            //Arrange
+            ExpectUserHasRightsHolderAccessReturns(true);
+            var expectedResponse = Mock.Of<IQueryable<ItSystem>>();
+            _itSystemServiceMock.Setup(x => x.GetAvailableSystems()).Returns(expectedResponse);
+
+            //Act
+            var result = _sut.GetAvailableSystems();
+
+            //Assert
+            Assert.True(result.Ok);
+            Assert.Same(expectedResponse, result.Value);
+        }
+
+        [Fact]
+        public void GetSystem_Returns_Forbidden_If_User_Does_Not_Have_RightsHoldersAccess()
+        {
+            //Arrange
+            ExpectUserHasRightsHolderAccessReturns(false);
+
+            //Act
+            var result = _sut.GetSystem(A<Guid>());
+
+            //Assert
+            Assert.True(result.Failed);
+            Assert.Equal(OperationFailure.Forbidden, result.Error.FailureType);
+        }
+
+        [Fact]
+        public void Can_GetSystem_If_User_Has_RightsHoldersAccess()
+        {
+            //Arrange
+            var systemUuid = A<Guid>();
+            ExpectUserHasRightsHolderAccessReturns(true);
+            var itSystem = new ItSystem();
+
+            _itSystemServiceMock.Setup(x => x.GetSystem(systemUuid)).Returns(itSystem);
+
+            //Act
+            var result = _sut.GetSystem(systemUuid);
+
+            //Assert
+            Assert.True(result.Ok);
+            Assert.Same(itSystem,result.Value);
+        }
+
+        private void ExpectUserHasRightsHolderAccessReturns(bool value)
+        {
+            _userContextMock.Setup(x => x.HasRoleInAnyOrganization(OrganizationRole.RightsHolderAccess)).Returns(value);
+        }
     }
 }


Added initial testing functionality for Journey class

--- fleetTRACK/MainActivity.cs
+++ fleetTRACK/MainActivity.cs
@@ -25,9 +25,15 @@
             // Get our button from the layout resource,
             // and attach an event to it
             Button button = FindViewById<Button>(Resource.Id.btnLoggingToggle);
-            Single[] test = new Single[1];
-            Android.Locations.Location.DistanceBetween(-31.7362024, 115.7659186, -31.7524007, 115.7710995, test);
-            button.Click += delegate { button.Text = String.Format("Ditance between: {0}", test[0] / 1000); };
+
+            button.Click +=  delegate {
+                _currentJourney = new Journey(this, "Toyota", "WM01", "001", "A1", "1023", "1", "12", "ECU", "4", "Adam", "");
+                _currentJourney.Start();
+                button.Text = "Logging for 30 seconds...";
+                System.Threading.Thread.Sleep(30000);
+                _currentJourney.Stop();
+                _currentJourney.WriteLogFiles();
+            };
         }
     }
 }


clean

clean

--- Demos/GridViewer/GLUIs/QuadStripModel.cs
+++ Demos/GridViewer/GLUIs/QuadStripModel.cs
@@ -87,11 +87,12 @@
                         buffer.Create((this.quadCount + 1) * 2);
                         unsafe
                         {
-                            Random random = new Random();
+                            //Random random = new Random();
                             var array = (float*)buffer.Header.ToPointer();
                             for (int i = 0; i < (this.quadCount + 1); i++)
                             {
-                                array[i * 2 + 0] = (float)random.NextDouble();
+                                //array[i * 2 + 0] = (float)random.NextDouble();
+                                array[i * 2 + 0] = (float)i / (float)this.quadCount;
                                 array[i * 2 + 1] = array[i * 2 + 0];
                             }
                         }


Added DxfHelpers class

Added DxfHelpers class

--- Dependencies/Renderer.Dxf/DxfRenderer.cs
+++ Dependencies/Renderer.Dxf/DxfRenderer.cs
@@ -21,6 +21,33 @@
     /// <summary>
     ///
     /// </summary>
+    public static class DxfHelpers
+    {
+        /// <summary>
+        ///
+        /// </summary>
+        public static double LineweightFactor = 96.0/2540.0;
+
+        /// <summary>
+        ///
+        /// </summary>
+        public static short[] Lineweights =
+        {
+            -3, -2, -1, 0, 5, 9, 13, 15, 18, 20, 25, 30, 35, 40, 50, 53, 60, 70, 80, 90, 100, 106, 120, 140, 158, 200, 211
+        };
+
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="thickness"></param>
+        /// <returns></returns>
+        public static short ThicknessToLineweight(double thickness)
+        {
+            short lineweight = (short)(thickness / LineweightFactor);
+            return Lineweights.OrderBy(x => Math.Abs((long) x - lineweight)).First();
+        }
+    }
+
     public class DxfRenderer : T2d.ObservableObject, T2d.IRenderer
     {
         private T2d.RendererState _state = new T2d.RendererState();


update method for dual protocol

update method for dual protocol

--- DynamixelServo.Driver/DynamixelDriver.cs
+++ DynamixelServo.Driver/DynamixelDriver.cs
@@ -76,7 +76,8 @@
          {
             throw new InvalidOperationException("New ID alredy taken");
          }
-         WriteByte(servoId, ADDR_MX_ID, newServoId, protocol);
+         ushort address = protocol == DynamixelProtocol.Version1 ? ADDR_MX_ID : ADDR_XL_ID;
+         WriteByte(servoId, address, newServoId, protocol);
       }

       public bool IsMoving(byte servoId, DynamixelProtocol protocol = DynamixelProtocol.Version1)


Model Logic Bug Fix

Model Logic Bug Fix

--- Dynamo/Dynamo.Core/GeneratorViewModel.cs
+++ Dynamo/Dynamo.Core/GeneratorViewModel.cs
@@ -291,8 +291,8 @@
         {
             get
             {
-                if (!File.Exists(Project.SolutionFile)) return false;
-                if (!Directory.Exists(Project.TemplateFolder)) return false;
+                if (!File.Exists(SolutionFile)) return false;
+                if (!Directory.Exists(TemplateFolder)) return false;
                 if (!IsConnectionStringValid) return false;

                 return true;


documentation

documentation

--- ElectronNET.CLI/Commands/BuildCommand.cs
+++ ElectronNET.CLI/Commands/BuildCommand.cs
@@ -3,6 +3,7 @@
 using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices;
+using System.Text;
 using System.Threading.Tasks;
 using ElectronNET.CLI.Commands.Actions;

@@ -12,7 +13,14 @@
     {
         public const string COMMAND_NAME = "build";
         public const string COMMAND_DESCRIPTION = "Build your Electron Application.";
-        public const string COMMAND_ARGUMENTS = "<Platform> to build (default is current OS, possible values are: win,osx,linux)";
+        public static string COMMAND_ARGUMENTS = "Needed: '/target' with params 'win/osx/linux' to build for a typical app or use 'custom' and specify .NET Core build config & electron build config" + Environment.NewLine +
+                                                 " for custom target, check .NET Core RID Catalog and Electron build target/" + Environment.NewLine +
+                                                 " e.g. '/target win' or '/target custom \"win7-x86;win32\"'" + Environment.NewLine +
+                                                 "Optional: '/dotnet-configuration' with the desired .NET Core build config e.g. release or debug. Default = Release" + Environment.NewLine +
+                                                 "Optional: '/electron-arch' to specify the resulting electron processor architecture (e.g. ia86 for x86 builds). Be aware to use the '/target custom' param as well!" + Environment.NewLine +
+                                                 "Optional: '/electron-params' specify any other valid parameter, which will be routed to the electron-packager." + Environment.NewLine +
+                                                 "Full example for a 32bit debug build with electron prune: build /target custom win7-x86;win32 /dotnet-configuration Debug /electron-arch ia32  /electron-params \"--prune=true \"";
+
         public static IList<CommandOption> CommandOptions { get; set; } = new List<CommandOption>();

         private string[] _args;


Fixes to naming and resolving in plugin manager.

--- Emzi0767.Ada/Plugins/AdaPluginManager.cs
+++ Emzi0767.Ada/Plugins/AdaPluginManager.cs
@@ -27,7 +27,7 @@
             L.W("ADA PLG", "Loading all plugin assemblies");
             this.LoadedAssemblies = new Dictionary<string, Assembly>();
             var a = typeof(AdaPlugin).GetTypeInfo().Assembly;
-            this.LoadedAssemblies.Add(a.FullName, a);
+            this.LoadedAssemblies.Add(a.GetName().Name, a);
             this.MainAssembly = a;
             var l = a.Location;
             l = Path.GetDirectoryName(l);
@@ -40,6 +40,7 @@
                 {
                     L.W("ADA PLG", "Loaded reference file '{0}'", xx);
                     var xa = FrameworkAssemblyLoader.LoadFile(xx);
+                    this.LoadedAssemblies.Add(xa.GetName().Name, xa);
                 }
             }


StatusLabel Improvement

StatusLabel Improvement

StatusLabel now clears after 3 seconds.

--- EndlessClient/EndlessClient/InGameHud.cs
+++ EndlessClient/EndlessClient/InGameHud.cs
@@ -61,6 +61,8 @@
 		private readonly XNALabel clockLabel; //label that is updated on a timer
 		private Timer clockTimer;

+		private DateTime? statusStartTime;
+
 		private InGameStates state;
 		private ChatMode currentChatMode;
 		private Texture2D modeTexture;
@@ -257,13 +259,17 @@
 			if (!Game.Components.Contains(World.Instance.ActiveMapRenderer))
 				Game.Components.Add(World.Instance.ActiveMapRenderer);
 			World.Instance.ActiveCharacterRenderer.Visible = true;
-			if (!Game.Components.Contains(World.Instance.ActiveCharacterRenderer))
-				Game.Components.Add(World.Instance.ActiveCharacterRenderer);

 			clockTimer = new Timer(threadState =>
 			{
 				string fmt = string.Format("{0,2:D2}:{1,2:D2}:{2,2:D2}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
 				lock(clockLock) clockLabel.Text = fmt;
+
+				if (statusStartTime.HasValue && (DateTime.Now - statusStartTime.Value).Milliseconds > 3000)
+				{
+					SetStatusLabel("");
+				}
+
 			}, null, 0, 1000);

 			base.Initialize();
@@ -524,6 +530,7 @@
 		public void SetStatusLabel(string text)
 		{
 			statusLabel.Text = text;
+			statusStartTime = !string.IsNullOrEmpty(text) ? new DateTime?(DateTime.Now) : null;
 		}
 		#endregion


Fix the build

Fix the build

--- Espera/Espera.Core/Management/Library.cs
+++ Espera/Espera.Core/Management/Library.cs
@@ -1,4 +1,5 @@
 using Akavache;
+using Espera.Core.Analytics;
 using Espera.Core.Audio;
 using Espera.Core.Settings;
 using Rareform.Extensions;
@@ -86,17 +87,13 @@
         /// <summary>
         /// Gets a value indicating whether the next song in the playlist can be played.
         /// </summary>
-        /// <value>
-        /// true if the next song in the playlist can be played; otherwise, false.
-        /// </value>
+        /// <value>true if the next song in the playlist can be played; otherwise, false.</value>
         public IObservable<bool> CanPlayNextSong { get; private set; }

         /// <summary>
         /// Gets a value indicating whether the previous song in the playlist can be played.
         /// </summary>
-        /// <value>
-        /// true if the previous song in the playlist can be played; otherwise, false.
-        /// </value>
+        /// <value>true if the previous song in the playlist can be played; otherwise, false.</value>
         public IObservable<bool> CanPlayPreviousSong { get; private set; }

         public Playlist CurrentPlaylist { get; private set; }
@@ -117,8 +114,8 @@
         public IObservable<TimeSpan> CurrentTimeChanged { get; private set; }

         /// <summary>
-        /// Gets an observable that reports whether the library is currently
-        /// looking for new songs at the song source or removing songs that don't exist anymore.
+        /// Gets an observable that reports whether the library is currently looking for new songs
+        /// at the song source or removing songs that don't exist anymore.
         /// </summary>
         public IObservable<bool> IsUpdating
         {
@@ -138,7 +135,7 @@
         public IObservable<AudioPlayerState> PlaybackState { get; private set; }

         /// <summary>
-        /// Returns an enumeration of playlists that implements <see cref="INotifyCollectionChanged"/>.
+        /// Returns an enumeration of playlists that implements <see cref="INotifyCollectionChanged" />.
         /// </summary>
         public IReadOnlyReactiveList<Playlist> Playlists
         {
@@ -203,8 +200,12 @@
         /// <summary>
         /// Adds a new playlist to the library and immediately sets it as the current playlist.
         /// </summary>
-        /// <param name="name">The name of the playlist, It is required that no other playlist has this name.</param>
-        /// <exception cref="InvalidOperationException">A playlist with the specified name already exists.</exception>
+        /// <param name="name">
+        /// The name of the playlist, It is required that no other playlist has this name.
+        /// </param>
+        /// <exception cref="InvalidOperationException">
+        /// A playlist with the specified name already exists.
+        /// </exception>
         public void AddAndSwitchToPlaylist(string name, Guid accessToken)
         {
             this.accessControl.VerifyAccess(accessToken, this.settings.LockPlaylist);
@@ -216,8 +217,12 @@
         /// <summary>
         /// Adds a new playlist with the specified name to the library.
         /// </summary>
-        /// <param name="name">The name of the playlist. It is required that no other playlist has this name.</param>
-        /// <exception cref="InvalidOperationException">A playlist with the specified name already exists.</exception>
+        /// <param name="name">
+        /// The name of the playlist. It is required that no other playlist has this name.
+        /// </param>
+        /// <exception cref="InvalidOperationException">
+        /// A playlist with the specified name already exists.
+        /// </exception>
         public void AddPlaylist(string name, Guid accessToken)
         {
             if (name == null)
@@ -232,8 +237,8 @@
         }

         /// <summary>
-        /// Adds the specified song to the end of the playlist.
-        /// This method is only available in administrator mode.
+        /// Adds the specified song to the end of the playlist. This method is only available in
+        /// administrator mode.
         /// </summary>
         /// <param name="songList">The songs to add to the end of the playlist.</param>
         public void AddSongsToPlaylist(IEnumerable<Song> songList, Guid accessToken)
@@ -247,8 +252,8 @@
         }

         /// <summary>
-        /// Adds the song to the end of the playlist.
-        /// This method throws an exception, if there is an outstanding timeout.
+        /// Adds the song to the end of the playlist. This method throws an exception, if there is
+        /// an outstanding timeout.
         /// </summary>
         /// <param name="song">The song to add to the end of the playlist.</param>
         public void AddSongToPlaylist(Song song)
@@ -625,7 +630,8 @@

             List<LocalSong> enumerable = songList.ToList();

-            // NB: Check if the number of occurences of the artwork key match the number of songs with the same artwork key
+            // NB: Check if the number of occurences of the artwork key match the number of songs
+            //     with the same artwork key
             // so we don't delete artwork keys that still have a corresponding song in the library
             Dictionary<string, int> artworkKeys = this.Songs
                 .Select(x => x.ArtworkKey.FirstAsync().Wait())
@@ -722,10 +728,9 @@

                     bool added = this.songs.Add(song);

-                    // Inverse the condition, as this case happens way more often and
-                    // we want to release the lock as soon as possible
-                    // We also keep the write lock open so we can be sure we find
-                    // the song and it isn't removed in the meanwhile
+                    // Inverse the condition, as this case happens way more often and we want to
+                    // release the lock as soon as possible We also keep the write lock open so we
+                    // can be sure we find the song and it isn't removed in the meanwhile
                     if (!added)
                     {
                         Song existing = this.songs.First(x => x.OriginalPath == song.OriginalPath);
@@ -774,7 +779,7 @@
                     int songCount = this.songs.Count;
                     this.songLock.ExitReadLock();

-                    Analytics.Instance.RecordLibrarySizeAsync(songCount);
+                    AnalyticsClient.Instance.RecordLibrarySizeAsync(songCount);

                     this.isUpdating.OnNext(false);
                 });


Ensure existing credentials are restored before test exists.

--- FidelityWebDriver.Demo.Tests/AppTests.cs
+++ FidelityWebDriver.Demo.Tests/AppTests.cs
@@ -76,7 +76,8 @@

             if (string.IsNullOrEmpty(Settings.Default.Username) || string.IsNullOrEmpty(Settings.Default.Password))
             {
-                Assert.Inconclusive("Username or password not set; not going to persist empty credentials!");
+                Settings.Default.Reload();
+                Assert.Inconclusive("Username or password not modified; not going to persist empty credentials!");
             }
             else
             {


Adding Header columns list to excel storage base class

--- FileHelpers/DataLink/ExcelStorageBase.cs
+++ FileHelpers/DataLink/ExcelStorageBase.cs
@@ -70,6 +70,9 @@
         private ExcelReadStopBehavior mExcelReadStopBehavior = ExcelReadStopBehavior.StopOnEmptyRow;
         private int mExcelReadStopAfterEmptyRows = 1;

+        private bool mAddHeaderRows;
+        private List<string> mColumnHeaders=new List<string>();
+
         #endregion

         #region "  Public Properties  "
@@ -148,6 +151,24 @@
             set { mExcelReadStopAfterEmptyRows = value; }
         }

+        /// <summary>
+        /// Add Header rows to excel
+        /// </summary>
+        public bool AddHeaderRows
+        {
+            get { return mAddHeaderRows; }
+            set { mAddHeaderRows = value; }
+        }
+
+        /// <summary>
+        /// List Of column headers
+        /// </summary>
+        public List<string> ColumnsHeaders
+        {
+            get { return mColumnHeaders; }
+            set { mColumnHeaders = value; }
+        }
+
         #endregion

         #region "  CellIsEmpty  "
@@ -283,4 +304,4 @@
         /// <summary>All cells in the row being empty means we should stop reading</summary>
         StopOnEmptyRow = 0,
     }
-}+}


Provide a Reconnect operation for the mixer to simplify handling fakes etc.


Only call Invalidate on change

Only call Invalidate on change

- Issue MatterHackers/MCCentral#3067
Hang on MatterControl close if Extruder/Bed popup open

--- PartPreviewWindow/RoundedToggleSwitch.cs
+++ PartPreviewWindow/RoundedToggleSwitch.cs
@@ -60,8 +60,11 @@
 			get => _checked;
 			set
 			{
-				_checked = value;
-				this.Invalidate();
+				if (_checked != value)
+				{
+					_checked = value;
+					this.Invalidate();
+				}
 			}
 		}


Update AbpProjectNameNavigationProvider.cs

--- aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Startup/AbpProjectNameNavigationProvider.cs
+++ aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Startup/AbpProjectNameNavigationProvider.cs
@@ -1,4 +1,5 @@
 using Abp.Application.Navigation;
+using Abp.Authorization;
 using Abp.Localization;
 using AbpCompanyName.AbpProjectName.Authorization;

@@ -26,7 +27,7 @@
                         L("Tenants"),
                         url: "Tenants",
                         icon: "fas fa-building",
-                        requiredPermissionName: PermissionNames.Pages_Tenants
+                        permissionDependency: new SimplePermissionDependency(PermissionNames.Pages_Tenants)
                     )
                 ).AddItem(
                     new MenuItemDefinition(
@@ -34,7 +35,7 @@
                         L("Users"),
                         url: "Users",
                         icon: "fas fa-users",
-                        requiredPermissionName: PermissionNames.Pages_Users
+                        permissionDependency: new SimplePermissionDependency(PermissionNames.Pages_Users)
                     )
                 ).AddItem(
                     new MenuItemDefinition(
@@ -42,8 +43,8 @@
                         L("Roles"),
                         url: "Roles",
                         icon: "fas fa-theater-masks",
-                        requiredPermissionName: PermissionNames.Pages_Roles
-                    )
+                        permissionDependency: new SimplePermissionDependency(PermissionNames.Pages_Roles)
+                            )
                 )
                 .AddItem(
                     new MenuItemDefinition(


Clarify comment in 3-byte processing

Clarify comment in 3-byte processing

Signed-off-by: dotnet-bot <03c4cb6107ae99956a7681f2c97ff7104809a2bd@microsoft.com>

--- src/Common/src/CoreLib/System/Text/Unicode/Utf8Utility.Transcoding.cs
+++ src/Common/src/CoreLib/System/Text/Unicode/Utf8Utility.Transcoding.cs
@@ -506,8 +506,8 @@
                             if (outputCharsRemaining > 1 && (nint)(void*)Unsafe.ByteOffset(ref *pInputBuffer, ref *pFinalPosWhereCanReadDWordFromInputBuffer) >= 3)
                             {
                                 // We're going to attempt to read a second 3-byte sequence and write them both out simultaneously using PEXT.
-                                // Since we already validated the first byte of the second DWORD (it's the same as the final byte of the
-                                // first DWORD), the only checks that remain are the overlong + surrogate checks. If the overlong or surrogate
+                                // We need to check the continuation bit mask on the remaining two bytes (and we may as well check the leading
+                                // byte mask again since it's free), then perform overlong + surrogate checks. If the overlong or surrogate
                                 // checks fail, we'll fall through to the remainder of the logic which will transcode the original valid
                                 // 3-byte UTF-8 sequence we read; and on the next iteration of the loop the validation routine will run again,
                                 // fail, and redirect control flow to the error handling logic at the very end of this method.


Dependencies introduced and they are working

--- src/DatenMeister/Provider/ManagementProviders/ManagementViewPlugin.cs
+++ src/DatenMeister/Provider/ManagementProviders/ManagementViewPlugin.cs
@@ -11,9 +11,11 @@
 using DatenMeister.Provider.ManagementProviders.Model;
 using DatenMeister.Runtime.Workspaces;
 using DatenMeister.Uml.Helper;
+using DatenMeister.Uml.Plugin;

 namespace DatenMeister.Provider.ManagementProviders
 {
+    [PluginDependency(typeof(UmlPlugin))]
     public class ManagementViewPlugin : IDatenMeisterPlugin
     {
         private readonly ViewLogic _viewLogic;


Removing Dummy Authentication

Removing Dummy Authentication

--- src/Eurofurence.App.Server.Services/Security/AuthenticationHandler.cs
+++ src/Eurofurence.App.Server.Services/Security/AuthenticationHandler.cs
@@ -25,12 +25,8 @@

         public async Task<AuthenticationResponse> AuthorizeViaRegSys(RegSysAuthenticationRequest request)
         {
-            // Temporary little hack...
-            //var isValid = await _registrationSystemAuthenticationBridge.VerifyCredentialSetAsync(
-            //  request.RegNo, request.Username, request.Password);
-
-            await Task.Delay(1);
-            var isValid = request.Password == request.RegNo.ToString();
+            var isValid = await _registrationSystemAuthenticationBridge.VerifyCredentialSetAsync(
+              request.RegNo, request.Username, request.Password);

             if (!isValid)
                 return null;


Refactor

Refactor

--- ScriptLinkStandard/Helpers/SafeGetInt.cs
+++ ScriptLinkStandard/Helpers/SafeGetInt.cs
@@ -9,8 +9,8 @@
         /// <returns></returns>
         public static int SafeGetInt(string fieldValue)
         {
-            int integerTest, tempValue = 0;
-            if (int.TryParse(fieldValue, out integerTest))
+            int tempValue = 0;
+            if (int.TryParse(fieldValue, out int integerTest))
             {
                 tempValue = int.Parse(fieldValue);
             }


Minor changes

Minor changes

--- Sibelius.Web/Views/Shared/_Layout.cshtml
+++ Sibelius.Web/Views/Shared/_Layout.cshtml
@@ -20,11 +20,6 @@

 @{
     ViewBag.bodyclass = ViewBag.bodyclass == null ? "light-body" : ViewBag.bodyclass;
-    string curUrl = Request.Url.AbsoluteUri.ToUpper();
-    string coursesClass = curUrl.Contains("COURSES") ? "class=active" : "";
-    string postsClass = curUrl.Contains("POSTS") ? "class=active" : "";
-    string aboutClass = curUrl.Contains("ABOUT") ? "class=active" : "";
-    string questionsClass = curUrl.Contains("QUESTIONS") ? "class=active" : "";
 }

@@ -40,6 +35,13 @@

+            @{
+                string curUrl = Request.Url.AbsoluteUri.ToUpper();
+                string coursesClass = curUrl.Contains("COURSES") ? "class=active" : "";
+                string postsClass = curUrl.Contains("POSTS") ? "class=active" : "";
+                string aboutClass = curUrl.Contains("ABOUT") ? "class=active" : "";
+                string questionsClass = curUrl.Contains("QUESTIONS") ? "class=active" : "";
+            }

@@ -142,7 +144,7 @@
     @Scripts.Render("~/bundles/modernizr")
     @Scripts.Render("~/bundles/jquery")
     @Scripts.Render("~/bundles/bootstrap")
-    @Scripts.Render("~/bundles/jsutils")
+    @Scripts.Render("~/bundles/jsutils")
     @if (Session["fonts"] == null)
     {
         @Html.Partial("_Fonts")
@@ -160,7 +162,7 @@

         ga('create', 'UA-59510259-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>


Added route handler for catching no culture routes

--- culture-route-constraint/src/Startup.cs
+++ culture-route-constraint/src/Startup.cs
@@ -10,6 +10,8 @@
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Mvc.Routing;
 using Microsoft.AspNetCore.Routing;
+using Microsoft.AspNetCore.Http;
+using System.Threading.Tasks;

 namespace WebApplication
 {
@@ -66,7 +68,7 @@
         }

         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
-        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
+        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, RequestLocalizationOptions localizationOptions)
         {
             loggerFactory.AddConsole(Configuration.GetSection("Logging"));
             loggerFactory.AddDebug();
@@ -76,6 +78,15 @@
                 routes.MapRoute(
                     name: "default",
                     template: "{culture:culturecode}/{controller=Home}/{action=Index}/{id?}");
+                routes.MapGet("{culture:culturecode}/{*path}", ctx => { });
+                routes.MapGet("{*path}", (RequestDelegate)(ctx =>
+               {
+                   var cultureCode = localizationOptions.DefaultRequestCulture.Culture.Name;
+                   var path = ctx.GetRouteValue("path") ?? string.Empty;
+                   var culturedPath = $"/{cultureCode}/{path}";
+                   ctx.Response.Redirect(culturedPath);
+                   return Task.CompletedTask;
+               }));
             });
         }
     }


Add comments and remove default values in the contructor

--- src/Microsoft.AspNetCore.Mvc.ViewFeatures/Rendering/SelectListItem.cs
+++ src/Microsoft.AspNetCore.Mvc.ViewFeatures/Rendering/SelectListItem.cs
@@ -10,14 +10,35 @@
     /// </summary>
     public class SelectListItem
     {
+        /// <summary>
+        /// Initializes a new instance of <see cref="SelectListItem"/>.
+        /// </summary>
         public SelectListItem() { }

-        public SelectListItem(string text, string value, bool selected = false, bool disabled = false)
+        /// <summary>
+        /// Initializes a new instance of <see cref="SelectListItem"/>.
+        /// </summary>
+        /// <param name="text">The display text of this <see cref="SelectListItem"/>.</param>
+        /// <param name="value">The value of this <see cref="SelectListItem"/>.</param>
+        public SelectListItem(string text, string value)
+            : this()
+        {
+            Text = text;
+            Value = value;
+        }
+
+        /// <summary>
+        /// Initializes a new instance of <see cref="SelectListItem"/>.
+        /// </summary>
+        /// <param name="text">The display text of this <see cref="SelectListItem"/>.</param>
+        /// <param name="value">The value of this <see cref="SelectListItem"/>.</param>
+        /// <param name="selected">Value that indicates whether this <see cref="SelectListItem"/> is selected.</param>
+        /// <param name="disabled">Value that indicates whether this <see cref="SelectListItem"/> is disabled.</param>
+        public SelectListItem(string text, string value, bool selected, bool disabled)
+            : this(text, value)
         {
             Disabled = disabled;
             Selected = selected;
-            Text = text;
-            Value = value;
         }

         /// <summary>


Fix IParameterDataSource/IParamaterDataProvider on generic methods in CF

--- src/NUnitFramework/framework/Attributes/CombiningStrategyAttribute.cs
+++ src/NUnitFramework/framework/Attributes/CombiningStrategyAttribute.cs
@@ -1,4 +1,4 @@
-// ***********************************************************************
+// ***********************************************************************
 // Copyright (c) 2014 Charlie Poole
 //
 // Permission is hereby granted, free of charge, to any person obtaining
@@ -8,10 +8,10 @@
 // distribute, sublicense, and/or sell copies of the Software, and to
 // permit persons to whom the Software is furnished to do so, subject to
 // the following conditions:
-//
+//
 // The above copyright notice and this permission notice shall be
 // included in all copies or substantial portions of the Software.
-//
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -34,7 +34,7 @@

     /// <summary>
     /// Marks a test to use a particular CombiningStrategy to join
-    /// any parameter data provided. Since this is the default, the
+    /// any parameter data provided. Since this is the default, the
     /// attribute is optional.
     /// </summary>
     [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
@@ -62,7 +62,9 @@
         /// </summary>
         /// <param name="strategy">Combining strategy to be used</param>
         protected CombiningStrategyAttribute(object strategy)
-            : this((ICombiningStrategy)strategy) { }
+            : this((ICombiningStrategy)strategy)
+        {
+        }

         #region ITestBuilder Members

@@ -78,11 +80,40 @@
             List<TestMethod> tests = new List<TestMethod>();

 #if NETCF
-            // TODO: Requires each data provider to have ability to probe a generic method. May require change to IParameterData interface.
             if (method.ContainsGenericParameters)
+            {
+                var genericParams = method.GetGenericArguments();
+                var numGenericParams = genericParams.Length;
+
+                var o = new object();
+                var tryArgs = Enumerable.Repeat(o, numGenericParams).ToArray();
+
+                var mi = method.MakeGenericMethodEx(tryArgs);
+                if (mi == null)
+                    return tests;
+
+                var par = mi.GetParameters();
+                if (par.Length == 0)
+                    return tests;
+
+                var sourceData = par.Select(p => _dataProvider.GetDataFor(p)).ToArray();
+                foreach (var parms in _strategy.GetTestCases(sourceData))
+                {
+                    mi = method.MakeGenericMethodEx(parms.Arguments);
+                    if (mi == null)
+                    {
+                        var tm = new TestMethod(method, suite);
+                        tm.RunState = RunState.NotRunnable;
+                        tm.Properties.Set(PropertyNames.SkipReason, "Incompatible arguments");
+                        tests.Add(tm);
+                    }
+                    else
+                        tests.Add(_builder.BuildTestMethod(mi, suite, (ParameterSet)parms));
+                }
+
                 return tests;
+            }
 #endif
-
             ParameterInfo[] parameters = method.GetParameters();

             if (parameters.Length > 0)


Fixed bug in Message Handler that converts Unix Time to DateTime

--- src/Nether.Ingest/MessageHandlers/UnixTimeToDateTimeMessageHandler.cs
+++ src/Nether.Ingest/MessageHandlers/UnixTimeToDateTimeMessageHandler.cs
@@ -3,6 +3,7 @@

 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Threading.Tasks;

 namespace Nether.Ingest
@@ -18,14 +19,15 @@

         public Task<MessageHandlerResults> ProcessMessageAsync(Message msg, string pipelineName, int index)
         {
-            foreach (var msgProp in msg.Properties)
+
+            foreach (var key in msg.Properties.Keys.ToArray())
             {
-                if (_propertiesToChange.Contains(msgProp.Key))
+                if (_propertiesToChange.Contains(key))
                 {
-                    long seconds = long.Parse(msgProp.Value);
+                    long seconds = long.Parse(msg.Properties[key]);
                     var offset = DateTimeOffset.FromUnixTimeSeconds(seconds);

-                    msg.Properties[msgProp.Key] = offset.UtcDateTime.ToString();
+                    msg.Properties[key] = offset.UtcDateTime.ToString();
                 }
             }


Refactored orbit propagation to be more modular & functional.

--- SolarSailNavigator/SolarSailNavigator.cs
+++ SolarSailNavigator/SolarSailNavigator.cs
@@ -135,60 +135,40 @@

 	public override void OnFixedUpdate() {
 	    if (FlightGlobals.fetch != null) {
-
+
 		double UT = Planetarium.GetUniversalTime();
+		double dT = TimeWarp.fixedDeltaTime;

 		solar_force_d = 0;
 		if (!IsEnabled) { return; }
-
+
 		// Force attitude to sail frame
 		if (IsLocked) {
 		    vessel.SetRotation(SailFrame(vessel.orbit, coneAngle_f, clockAngle_f, UT));
 		}
-
+
 		double sunlightFactor = 1.0;

 		if (!inSun(vessel.orbit, UT)) {
 		    sunlightFactor = 0.0;
 		}
-
-		Vector3d solarForce = CalculateSolarForce(this, vessel.orbit, this.part.transform, UT);
-
-		Vector3d solar_accel = solarForce / vessel.GetTotalMass() / 1000.0 * TimeWarp.fixedDeltaTime;
+
+		Vector3d solarForce = CalculateSolarForce(this, vessel.orbit, this.part.transform, UT) * sunlightFactor;
+
+		Vector3d solarAccel = solarForce / vessel.GetTotalMass() / 1000.0;
+
 		if (!this.vessel.packed) {
-		    vessel.ChangeWorldVelocity(solar_accel);
+		    vessel.ChangeWorldVelocity(solarAccel * dT);
 		} else {
-		    if (sunlightFactor > 0) {
-			double temp1 = solar_accel.y;
-			solar_accel.y = solar_accel.z;
-			solar_accel.z = temp1;
-			Vector3d position = vessel.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime());
-			Orbit orbit2 = new Orbit(vessel.orbit.inclination, vessel.orbit.eccentricity, vessel.orbit.semiMajorAxis, vessel.orbit.LAN, vessel.orbit.argumentOfPeriapsis, vessel.orbit.meanAnomalyAtEpoch, vessel.orbit.epoch, vessel.orbit.referenceBody);
-			orbit2.UpdateFromStateVectors(position, vessel.orbit.vel + solar_accel, vessel.orbit.referenceBody, Planetarium.GetUniversalTime());
-			//print(orbit2.timeToAp);
-			if (!double.IsNaN(orbit2.inclination) && !double.IsNaN(orbit2.eccentricity) && !double.IsNaN(orbit2.semiMajorAxis) && orbit2.timeToAp > TimeWarp.fixedDeltaTime) {
-			    vessel.orbit.inclination = orbit2.inclination;
-			    vessel.orbit.eccentricity = orbit2.eccentricity;
-			    vessel.orbit.semiMajorAxis = orbit2.semiMajorAxis;
-			    vessel.orbit.LAN = orbit2.LAN;
-			    vessel.orbit.argumentOfPeriapsis = orbit2.argumentOfPeriapsis;
-			    vessel.orbit.meanAnomalyAtEpoch = orbit2.meanAnomalyAtEpoch;
-			    vessel.orbit.epoch = orbit2.epoch;
-			    vessel.orbit.referenceBody = orbit2.referenceBody;
-			    vessel.orbit.Init();
-
-			    //vessel.orbit.UpdateFromOrbitAtUT(orbit2, Planetarium.GetUniversalTime(), orbit2.referenceBody);
-			    vessel.orbit.UpdateFromUT(Planetarium.GetUniversalTime());
-			}
-
-		    }
-		}
+		    PropagateStep(vessel.orbit, solarAccel, this.part.transform, UT, dT);
+		}
+
 		solar_force_d = solarForce.magnitude;
-		solar_acc_d = solar_accel.magnitude / TimeWarp.fixedDeltaTime;
+		solar_acc_d = solarAccel.magnitude;
 	    }
 	    count++;
 	}
-
+
 	public static Quaternion RTNFrame (Vessel vessel) {
 	    // Center of mass position
 	    var CM = vessel.findWorldCenterOfMass();
@@ -328,9 +308,33 @@
 	    } else {
 		return Vector3d.zero;
 	    }
-
-	}
-
+	}
+
+	// Propagate orbit one time step
+	public static void PropagateStep (Orbit orbit, Vector3d accel, Transform transform, double UT, double dT) {
+
+	    // Return updated orbit if in sun
+	    if (accel.magnitude > 0) {
+		// Transpose Y and Z for Orbit class
+		Vector3d accel_orbit = new Vector3d(accel.x, accel.z, accel.y);
+		Vector3d position = orbit.getRelativePositionAtUT(UT);
+		Orbit orbit2 = new Orbit(orbit.inclination, orbit.eccentricity, orbit.semiMajorAxis, orbit.LAN, orbit.argumentOfPeriapsis, orbit.meanAnomalyAtEpoch, orbit.epoch, orbit.referenceBody);
+		orbit2.UpdateFromStateVectors(position, orbit.getOrbitalVelocityAtUT(UT) + accel_orbit * dT, orbit.referenceBody, UT);
+		if (!double.IsNaN(orbit2.inclination) && !double.IsNaN(orbit2.eccentricity) && !double.IsNaN(orbit2.semiMajorAxis) && orbit2.timeToAp > dT) {
+		    orbit.inclination = orbit2.inclination;
+		    orbit.eccentricity = orbit2.eccentricity;
+		    orbit.semiMajorAxis = orbit2.semiMajorAxis;
+		    orbit.LAN = orbit2.LAN;
+		    orbit.argumentOfPeriapsis = orbit2.argumentOfPeriapsis;
+		    orbit.meanAnomalyAtEpoch = orbit2.meanAnomalyAtEpoch;
+		    orbit.epoch = orbit2.epoch;
+		    orbit.referenceBody = orbit2.referenceBody;
+		    orbit.Init();
+		    orbit.UpdateFromUT(UT);
+		}
+	    }
+	}
+
 	// Transpose X and Y elements for conversion of Orbit vector3d
 	public static Vector3d transposeYZ (Vector3d v) {
 	    return new Vector3d(v.x, v.z, v.y);


Added 8ball

Added 8ball

--- SoraBot/SoraBot.Bot/Modules/FunModule.cs
+++ SoraBot/SoraBot.Bot/Modules/FunModule.cs
@@ -1,4 +1,5 @@
-using System.Threading.Tasks;
+using System;
+using System.Threading.Tasks;
 using Discord;
 using Discord.Commands;
 using SoraBot.Common.Extensions.Modules;
@@ -9,8 +10,7 @@
     [Summary("A bunch of fun and useless commands.")]
     public class FunModule : SoraSocketCommandModule
     {
-        [Command("ruined")]
-        [Alias("dayruined")]
+        [Command("ruined"), Alias("dayruined")]
         [Summary("Posts the meme my disappointment is immeasurable")]
         public Task DayRuined() =>
             ReplyAsync("", embed: new EmbedBuilder()
@@ -26,5 +26,39 @@
             await Task.Delay(1500);
             await msg.ModifyAsync(x => { x.Content = "( ͡⌐■ ͜ʖ ͡-■)"; });
         }
+
+        [Command("8ball"), Alias("8b"), Summary("Ask and get an 8ball answer")]
+        public async Task Ball([Summary("Question"), Remainder] string question)
+        {
+            Random r = new Random();
+            await ReplyDefaultEmbed("🎱 " + ball[r.Next(ball.Length)]);
+        }
+
+        #region data
+        private string[] ball = new[]
+        {
+            "Signs point to yes. ",
+            "Yes.",
+            "Reply hazy, try again.",
+            "Without a doubt. ",
+            "My sources say no. ",
+            "As I see it, yes. ",
+            "You may rely on it.",
+            "Concentrate and ask again.",
+            "Outlook not so good. ",
+            "It is decidedly so.",
+            "Better not tell you now.",
+            "Very doubtful. ",
+            "Yes - definitely. ",
+            "It is certain. ",
+            "Cannot predict now. ",
+            "Most likely. ",
+            "Ask again later. ",
+            "My reply is no. ",
+            "Outlook good. ",
+            "Don't count on it."
+        };
+        #endregion
+
     }
 }


fixing extra pack slot (#1839)

fixing extra pack slot (#1839)

--- Source/ACE.Server/WorldObjects/Player.cs
+++ Source/ACE.Server/WorldObjects/Player.cs
@@ -122,7 +122,7 @@
                 //    character.IsAdvocate= true;
             }

-            ContainerCapacity = 7;
+            ContainerCapacity = (byte)(7 + AugmentationExtraPackSlot);

             if (Session != null && AdvocateQuest && IsAdvocate) // Advocate permissions are per character regardless of override
             {


Fix issue with SellPrice usage for AlternateCurrency (#2979)

--- Source/ACE.Server/WorldObjects/Vendor.cs
+++ Source/ACE.Server/WorldObjects/Vendor.cs
@@ -442,21 +442,26 @@
                 if (wo.ItemType == ItemType.PromissoryNote)
                     sellRate = 1.15;

-                goldcost += Math.Max(1, (uint)Math.Ceiling(((float)sellRate * (wo.Value ?? 0)) - 0.1));
+                var cost = Math.Max(1, (uint)Math.Ceiling(((float)sellRate * (wo.Value ?? 0)) - 0.1));
+
+                if (AlternateCurrency == null)
+                    goldcost += cost;
+                else
+                    altcost += cost;
             }

             foreach (WorldObject wo in genlist)
             {
+                var sellRate = SellPrice ?? 1.0;
+                if (wo.ItemType == ItemType.PromissoryNote)
+                    sellRate = 1.15;
+
+                var cost = Math.Max(1, (uint)Math.Ceiling(((float)sellRate * (wo.Value ?? 0)) - 0.1));
+
                 if (AlternateCurrency == null)
-                {
-                    var sellRate = SellPrice ?? 1.0;
-                    if (wo.ItemType == ItemType.PromissoryNote)
-                        sellRate = 1.15;
-
-                    goldcost += Math.Max(1, (uint)Math.Ceiling(((float)sellRate * (wo.Value ?? 0)) - 0.1));
-                }
+                    goldcost += cost;
                 else
-                    altcost += (uint)Math.Max(1, wo.Value ?? 1);
+                    altcost += cost;
             }

             if (IsBusy && genlist.Any(i => i.GetProperty(PropertyBool.VendorService) == true))


Fix Twilio configuration

Fix Twilio configuration

--- src/WebJobs.Extensions.Twilio/Bindings/TwilioScriptBindingProvider.cs
+++ src/WebJobs.Extensions.Twilio/Bindings/TwilioScriptBindingProvider.cs
@@ -26,33 +26,6 @@
             _twilioAssemblyName = typeof(SMSMessage).Assembly.GetName().Name;
         }

-        internal static TwilioSmsConfiguration CreateConfiguration(JObject metadata)
-        {
-            var twilioConfig = new TwilioSmsConfiguration();
-
-            JObject configSection = (JObject)metadata.GetValue("twilioSMS", StringComparison.OrdinalIgnoreCase);
-            JToken value = null;
-            if (configSection != null)
-            {
-                if (configSection.TryGetValue("from", StringComparison.OrdinalIgnoreCase, out value))
-                {
-                    twilioConfig.From = value.ToString();
-                }
-
-                if (configSection.TryGetValue("to", StringComparison.OrdinalIgnoreCase, out value))
-                {
-                    twilioConfig.To = value.ToString();
-                }
-
-                if (configSection.TryGetValue("body", StringComparison.OrdinalIgnoreCase, out value))
-                {
-                    twilioConfig.Body = value.ToString();
-                }
-            }
-
-            return twilioConfig;
-        }
-
         /// <inheritdoc/>
         public override bool TryCreate(ScriptBindingContext context, out ScriptBinding binding)
         {
@@ -65,7 +38,7 @@

             if (string.Compare(context.Type, "twilioSMS", StringComparison.OrdinalIgnoreCase) == 0)
             {
-                binding = new TwilioBinding(context);
+                binding = new TwilioSmsBinding(context);
             }

             return binding != null;
@@ -74,11 +47,7 @@
         /// <inheritdoc/>
         public override void Initialize()
         {
-            var twilioConfig = CreateConfiguration(Metadata);
-            if (!string.IsNullOrEmpty(twilioConfig.AccountSid) && !string.IsNullOrEmpty(twilioConfig.AuthToken))
-            {
-                Config.UseTwilioSms(twilioConfig);
-            }
+            Config.UseTwilioSms();
         }

         /// <inheritdoc/>
@@ -94,9 +63,9 @@
             return assembly != null;
         }

-        private class TwilioBinding : ScriptBinding
+        private class TwilioSmsBinding : ScriptBinding
         {
-            public TwilioBinding(ScriptBindingContext context) : base(context)
+            public TwilioSmsBinding(ScriptBindingContext context) : base(context)
             {
             }

@@ -114,6 +83,8 @@
                 {
                     new TwilioSmsAttribute
                     {
+                        AccountSidSetting = Context.GetMetadataValue<string>("accountSid"),
+                        AuthTokenSetting = Context.GetMetadataValue<string>("authToken"),
                         To = Context.GetMetadataValue<string>("to"),
                         From = Context.GetMetadataValue<string>("from"),
                         Body = Context.GetMetadataValue<string>("body")


fixed wrong alpha values for the colors of the PixelDataRenderer and a small index exception if the height of the bitmatrix is too small

--- Source/lib/renderer/PixelDataRenderer.cs
+++ Source/lib/renderer/PixelDataRenderer.cs
@@ -53,11 +53,11 @@
          /// <summary>
          /// the color black
          /// </summary>
-         public static Color Black = new Color(0);
+         public static Color Black = new Color(0xFF000000);
          /// <summary>
          /// the color white
          /// </summary>
-         public static Color White = new Color(0x00FFFFFF);
+         public static Color White = new Color(0xFFFFFFFF);

          /// <summary>
          /// value of the alpha channel
@@ -177,6 +177,9 @@
             }
          }

+         if (emptyArea < heigth)
+            emptyArea = 0;
+
          var pixels = new byte[width * heigth * 4];
          var index = 0;


Bump to v0.4.0

Bump to v0.4.0

--- Source/mi-360/Properties/AssemblyInfo.cs
+++ Source/mi-360/Properties/AssemblyInfo.cs
@@ -32,4 +32,4 @@
 // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
 // usando l'asterisco '*' come illustrato di seguito:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.3.1")]
+[assembly: AssemblyVersion("0.4.0")]


minor

minor

--- src/biz.dfch.CS.Entity.LifeCycleManager.Tests/LifeCycleManagerTest.cs
+++ src/biz.dfch.CS.Entity.LifeCycleManager.Tests/LifeCycleManagerTest.cs
@@ -19,7 +19,6 @@
 using biz.dfch.CS.Entity.LifeCycleManager.Contracts.Loaders;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using MSTestExtensions;
-using Newtonsoft.Json;
 using Telerik.JustMock;

 namespace biz.dfch.CS.Entity.LifeCycleManager.Tests
@@ -86,12 +85,14 @@
         }

         [TestMethod]
+        [WorkItem(21)]
         public void ChangeStateForLockedEntityThrowsException()
         {
             // DFTODO Define which exception should be thrown (Adjust test method name)
         }

         [TestMethod]
+        [WorkItem(21)]
         public void ChangeStateForNonLockedEntityLocksEntity()
         {

@@ -126,5 +127,9 @@
         {

         }
+
+        /**
+         * For entity framework mocking see here: https://github.com/tailsu/Telerik.JustMock.EntityFramework
+         **/
     }
 }


Fix Linux and Mac builds

Fix Linux and Mac builds

--- cake/constants.cake
+++ cake/constants.cake
@@ -33,10 +33,10 @@
 var ENGINE_CORE_TESTS_PROJECT = SOURCE_DIR + "NUnitEngine/nunit.engine.core.tests/nunit.engine.core.tests.csproj";
 var CONSOLE_PROJECT = SOURCE_DIR + "NUnitConsole/nunit-console/nunit-console.csproj";
 var CONSOLE_TESTS_PROJECT = SOURCE_DIR + "NUnitConsole/nunit-console.tests/nunit-console.tests.csproj";
-var MOCK_ASSEMBLY_PROJECT = SOURCE_DIR + "NUnitEngine/mock-assembly/mock-assembly.csproj";
-var MOCK_ASSEMBLY_X86_PROJECT = SOURCE_DIR + "NUnitEngine/mock-assembly-x86/mock-assembly-x86.csproj";
-var MOCK_ASSEMBLY_NUNIT4_PROJECT = SOURCE_DIR + "NUnitEngine/mock-assembly-nunit4/mock-assembly-nunit4.csproj";
-var NOTEST_PROJECT = SOURCE_DIR + "NUnitEngine/notest-assembly/notest-assembly.csproj";
+var MOCK_ASSEMBLY_PROJECT = SOURCE_DIR + "TestData/mock-assembly/mock-assembly.csproj";
+var MOCK_ASSEMBLY_X86_PROJECT = SOURCE_DIR + "TestData/mock-assembly-x86/mock-assembly-x86.csproj";
+var MOCK_ASSEMBLY_NUNIT4_PROJECT = SOURCE_DIR + "TestData/mock-assembly-nunit4/mock-assembly-nunit4.csproj";
+var NOTEST_PROJECT = SOURCE_DIR + "TestData/notest-assembly/notest-assembly.csproj";
 // Console Runner
 var NET20_CONSOLE = BIN_DIR + "net20/nunit-console.exe";
 var NET60_CONSOLE = BIN_DIR + "net6.0/nunit-console.dll";


AdventureSample - reduce gotos in Climb routine


AdventureSample - extract Wear method

AdventureSample - extract Wear method


ExpressionSample - refactor parser (extract operator expressions)

--- projects/ExpressionSample/GWExpr/BasicExpression.cs
+++ projects/ExpressionSample/GWExpr/BasicExpression.cs
@@ -362,14 +362,6 @@
                 {
                     return new OrExpression(x, y);
                 }
-
-                private sealed class OrExpression : BinaryExpression
-                {
-                    public OrExpression(BasicExpression x, BasicExpression y)
-                        : base("Or", x, y)
-                    {
-                    }
-                }
             }

             private sealed class AndOperator : IOperator
@@ -384,14 +376,6 @@
                 {
                     return new AndExpression(x, y);
                 }
-
-                private sealed class AndExpression : BinaryExpression
-                {
-                    public AndExpression(BasicExpression x, BasicExpression y)
-                        : base("And", x, y)
-                    {
-                    }
-                }
             }

             private sealed class EqOperator : IOperator
@@ -406,14 +390,6 @@
                 {
                     return new EqExpression(x, y);
                 }
-
-                private sealed class EqExpression : BinaryExpression
-                {
-                    public EqExpression(BasicExpression x, BasicExpression y)
-                        : base("Eq", x, y)
-                    {
-                    }
-                }
             }

             private sealed class NeOperator : IOperator
@@ -428,14 +404,6 @@
                 {
                     return new NeExpression(x, y);
                 }
-
-                private sealed class NeExpression : BinaryExpression
-                {
-                    public NeExpression(BasicExpression x, BasicExpression y)
-                        : base("Ne", x, y)
-                    {
-                    }
-                }
             }

             private sealed class LtOperator : IOperator
@@ -450,14 +418,6 @@
                 {
                     return new LtExpression(x, y);
                 }
-
-                private sealed class LtExpression : BinaryExpression
-                {
-                    public LtExpression(BasicExpression x, BasicExpression y)
-                        : base("Lt", x, y)
-                    {
-                    }
-                }
             }

             private sealed class GtOperator : IOperator
@@ -472,14 +432,6 @@
                 {
                     return new GtExpression(x, y);
                 }
-
-                private sealed class GtExpression : BinaryExpression
-                {
-                    public GtExpression(BasicExpression x, BasicExpression y)
-                        : base("Gt", x, y)
-                    {
-                    }
-                }
             }

             private sealed class AddOperator : IOperator
@@ -494,14 +446,6 @@
                 {
                     return new AddExpression(x, y);
                 }
-
-                private sealed class AddExpression : BinaryExpression
-                {
-                    public AddExpression(BasicExpression x, BasicExpression y)
-                        : base("Add", x, y)
-                    {
-                    }
-                }
             }

             private sealed class SubtractOperator : IOperator
@@ -516,14 +460,6 @@
                 {
                     return new SubtractExpression(x, y);
                 }
-
-                private sealed class SubtractExpression : BinaryExpression
-                {
-                    public SubtractExpression(BasicExpression x, BasicExpression y)
-                        : base("Subtract", x, y)
-                    {
-                    }
-                }
             }

             private sealed class MultiplyOperator : IOperator
@@ -538,14 +474,6 @@
                 {
                     return new MultiplyExpression(x, y);
                 }
-
-                private sealed class MultiplyExpression : BinaryExpression
-                {
-                    public MultiplyExpression(BasicExpression x, BasicExpression y)
-                        : base("Multiply", x, y)
-                    {
-                    }
-                }
             }

             private sealed class DivideOperator : IOperator
@@ -560,14 +488,6 @@
                 {
                     return new DivideExpression(x, y);
                 }
-
-                private sealed class DivideExpression : BinaryExpression
-                {
-                    public DivideExpression(BasicExpression x, BasicExpression y)
-                        : base("Divide", x, y)
-                    {
-                    }
-                }
             }

             private sealed class PowOperator : IOperator
@@ -582,13 +502,93 @@
                 {
                     return new PowExpression(x, y);
                 }
-
-                private sealed class PowExpression : BinaryExpression
-                {
-                    public PowExpression(BasicExpression x, BasicExpression y)
-                        : base("Pow", x, y)
-                    {
-                    }
+            }
+
+            private sealed class OrExpression : BinaryExpression
+            {
+                public OrExpression(BasicExpression x, BasicExpression y)
+                    : base("Or", x, y)
+                {
+                }
+            }
+
+            private sealed class AndExpression : BinaryExpression
+            {
+                public AndExpression(BasicExpression x, BasicExpression y)
+                    : base("And", x, y)
+                {
+                }
+            }
+
+            private sealed class EqExpression : BinaryExpression
+            {
+                public EqExpression(BasicExpression x, BasicExpression y)
+                    : base("Eq", x, y)
+                {
+                }
+            }
+
+            private sealed class NeExpression : BinaryExpression
+            {
+                public NeExpression(BasicExpression x, BasicExpression y)
+                    : base("Ne", x, y)
+                {
+                }
+            }
+
+            private sealed class LtExpression : BinaryExpression
+            {
+                public LtExpression(BasicExpression x, BasicExpression y)
+                    : base("Lt", x, y)
+                {
+                }
+            }
+
+            private sealed class GtExpression : BinaryExpression
+            {
+                public GtExpression(BasicExpression x, BasicExpression y)
+                    : base("Gt", x, y)
+                {
+                }
+            }
+
+            private sealed class AddExpression : BinaryExpression
+            {
+                public AddExpression(BasicExpression x, BasicExpression y)
+                    : base("Add", x, y)
+                {
+                }
+            }
+
+            private sealed class SubtractExpression : BinaryExpression
+            {
+                public SubtractExpression(BasicExpression x, BasicExpression y)
+                    : base("Subtract", x, y)
+                {
+                }
+            }
+
+            private sealed class MultiplyExpression : BinaryExpression
+            {
+                public MultiplyExpression(BasicExpression x, BasicExpression y)
+                    : base("Multiply", x, y)
+                {
+                }
+            }
+
+            private sealed class DivideExpression : BinaryExpression
+            {
+                public DivideExpression(BasicExpression x, BasicExpression y)
+                    : base("Divide", x, y)
+                {
+                }
+            }
+
+            private sealed class PowExpression : BinaryExpression
+            {
+                public PowExpression(BasicExpression x, BasicExpression y)
+                    : base("Pow", x, y)
+                {
                 }
             }
         }


[dotnet] implement getting and setting permissions on Safari

--- dotnet/src/webdriver/Safari/SafariDriver.cs
+++ dotnet/src/webdriver/Safari/SafariDriver.cs
@@ -17,6 +17,7 @@
 // </copyright>

 using System;
+using System.Collections.Generic;
 using OpenQA.Selenium.Remote;

 namespace OpenQA.Selenium.Safari
@@ -61,6 +62,9 @@
     /// </example>
     public class SafariDriver : WebDriver
     {
+        private const string GetPermissionsCommand = "getPermissions";
+        private const string SetPermissionsCommand = "setPermissions";
+
         /// <summary>
         /// Initializes a new instance of the <see cref="SafariDriver"/> class.
         /// </summary>
@@ -140,6 +144,37 @@
         public SafariDriver(SafariDriverService service, SafariOptions options, TimeSpan commandTimeout)
             : base(new DriverServiceCommandExecutor(service, commandTimeout), ConvertOptionsToCapabilities(options))
         {
+            this.AddCustomSafariCommand(GetPermissionsCommand, HttpCommandInfo.GetCommand, "/session/{sessionId}/apple/permissions");
+            this.AddCustomSafariCommand(SetPermissionsCommand, HttpCommandInfo.PostCommand, "/session/{sessionId}/apple/permissions");
+        }
+
+        /// <summary>
+        /// Set permission of an item on the browser. The only supported permission at this time is "getUserMedia".
+        /// </summary>
+        /// <param name="permissionName">The name of the item to set permission on.</param>
+        /// <param name="permissionValue">Whether the permission has been granted.</param>
+        public void SetPermission(string permissionName, bool permissionValue)
+        {
+            if (string.IsNullOrEmpty(permissionName))
+            {
+                throw new ArgumentNullException("permissionName", "permission must not be null or the empty string");
+            }
+
+            Dictionary<string, object> permissions = new Dictionary<string, object>();
+            permissions[permissionName] = permissionValue;
+            Dictionary<string, object> parameters = new Dictionary<string, object>();
+            parameters["permissions"] = permissions;
+            this.Execute(SetPermissionsCommand, parameters);
+        }
+
+        /// <summary>
+        /// Returns Each available permission item and whether it is allowed or not.
+        /// </summary>
+        /// <returns>whether the item is allowed or not.</returns>
+        public Object GetPermissions()
+        {
+            Response response = this.Execute(GetPermissionsCommand, null);
+            return response.Value;
         }

         /// <summary>
@@ -167,5 +202,11 @@

             return options.ToCapabilities();
         }
+
+        private void AddCustomSafariCommand(string commandName, string method, string resourcePath)
+        {
+            HttpCommandInfo commandInfoToAdd = new HttpCommandInfo(method, resourcePath);
+            this.CommandExecutor.TryAddCommand(commandName, commandInfoToAdd);
+        }
     }
 }


Bump CI.

Bump CI.


Fix the letter case of key for PagePropertyCollection.DisplayTitle .


Articles (Chore) Removed cache from Articles so we can update snow notification page quicker

--- src/StockportWebapp/Controllers/ArticleController.cs
+++ src/StockportWebapp/Controllers/ArticleController.cs
@@ -13,7 +13,7 @@

 namespace StockportWebapp.Controllers
 {
-    [ResponseCache(Location = ResponseCacheLocation.Any, Duration = Cache.Short)]
+    //[ResponseCache(Location = ResponseCacheLocation.Any, Duration = Cache.Short)]
     public class ArticleController : Controller
     {
         private readonly IProcessedContentRepository _repository;


implemented WebSocketPipelineFilter

implemented WebSocketPipelineFilter

--- src/SuperSocket.WebSocket/WebSocketPipelineFilter.cs
+++ src/SuperSocket.WebSocket/WebSocketPipelineFilter.cs
@@ -1,6 +1,8 @@
 using System;
 using System.Buffers;
+using System.Collections.Generic;
 using System.Collections.Specialized;
+using System.IO;
 using System.Text;
 using SuperSocket.ProtoBase;

@@ -8,7 +10,13 @@
 {
     public class WebSocketPipelineFilter : IPipelineFilter<WebSocketPackage>
     {
-        private static readonly ReadOnlyMemory<byte> _headerTerminator = Encoding.UTF8.GetBytes("\r\n\r\n");
+        private static ReadOnlySpan<byte> _CRLF => new byte[] { (byte)'\r', (byte)'\n' };
+
+        private static readonly char _TAB = '\t';
+
+        private static readonly char _COLON = '\t';
+
+        private static readonly ReadOnlyMemory<byte> _headerTerminator = new byte[] { (byte)'\r', (byte)'\n', (byte)'\r', (byte)'\n' };

         public IPackageDecoder<WebSocketPackage> Decoder { get; set; }

@@ -31,22 +39,91 @@
                 }
             }

-            //var headerItems = ParseHttpHeaderItems(pack);
+            var header = ParseHttpHeaderItems(pack);

-            //var secWebSocketVersion = headerItems[WebSocketConstant.SecWebSocketVersion];
-            //var secWebSocketKey = headerItems[WebSocketConstant.SecWebSocketKey];
+            var package = new WebSocketPackage
+            {
+                HttpHeader = header,
+                OpCode = OpCode.Handshake
+            };

-            return null;
+            return package;
         }

-        private NameValueCollection ParseHttpHeaderItems(ReadOnlySequence<byte> header)
+        private HttpHeader ParseHttpHeaderItems(ReadOnlySequence<byte> header)
         {
-            throw new NotImplementedException();
+            var headerText = header.GetString(Encoding.UTF8);
+            var reader = new StringReader(headerText);
+            var firstLine = reader.ReadLine();
+
+            if (string.IsNullOrEmpty(firstLine))
+                return null;
+
+            var items = new NameValueCollection();
+
+            var prevKey = string.Empty;
+            var line = string.Empty;
+
+            while (!string.IsNullOrEmpty(line = reader.ReadLine()))
+            {
+                if (line.StartsWith(_TAB) && !string.IsNullOrEmpty(prevKey))
+                {
+                    var currentValue = items.Get(prevKey);
+                    items[prevKey] = currentValue + line.Trim();
+                    continue;
+                }
+
+                int pos = line.IndexOf(_COLON);
+
+                if (pos <= 0)
+                    continue;
+
+                string key = line.Substring(0, pos);
+
+                if (!string.IsNullOrEmpty(key))
+                    key = key.Trim();
+
+                if (string.IsNullOrEmpty(key))
+                    continue;
+
+                var valueOffset = pos + 1;
+
+                if (line.Length <= valueOffset) //No value in this line
+                    continue;
+
+                var value = line.Substring(valueOffset);
+
+                if (!string.IsNullOrEmpty(value) && value.StartsWith(' ') && value.Length > 1)
+                    value = value.Substring(1);
+
+                var existingValue = items.Get(key);
+
+                if (string.IsNullOrEmpty(existingValue))
+                {
+                    items.Add(key, value);
+                }
+                else
+                {
+                    items[key] = existingValue + ", " + value;
+                }
+
+                prevKey = key;
+            }
+
+            var metaInfo = firstLine.Split(' ');
+
+            if (metaInfo.Length != 3)
+            {
+                // invalid first line
+                return null;
+            }
+
+            return new HttpHeader(metaInfo[0], metaInfo[1], metaInfo[2], items);
         }

         public void Reset()
         {
-            throw new NotImplementedException();
+
         }
     }
 }


Use explicit primitive types

Use explicit primitive types

--- osu.Game.Rulesets.Osu/Mods/OsuModNoScope.cs
+++ osu.Game.Rulesets.Osu/Mods/OsuModNoScope.cs
@@ -82,8 +82,8 @@

         public virtual void Update(Playfield playfield)
         {
-            var shouldAlwaysShowCursor = isBreakTime.Value || spinnerPeriods.IsInAny(playfield.Clock.CurrentTime);
-            var targetAlpha = shouldAlwaysShowCursor ? 1 : comboBasedAlpha;
+            bool shouldAlwaysShowCursor = isBreakTime.Value || spinnerPeriods.IsInAny(playfield.Clock.CurrentTime);
+            float targetAlpha = shouldAlwaysShowCursor ? 1 : comboBasedAlpha;
             playfield.Cursor.Alpha = (float)Interpolation.Lerp(playfield.Cursor.Alpha, targetAlpha, Math.Clamp(playfield.Time.Elapsed / transition_duration, 0, 1));
         }
     }


Update xmldoc

Update xmldoc

--- osu.Game/Rulesets/Scoring/ScoreProcessor.cs
+++ osu.Game/Rulesets/Scoring/ScoreProcessor.cs
@@ -458,7 +458,7 @@
         }

         /// <summary>
-        /// Populates the given score with remaining statistics as "missed" and marks it with <see cref="ScoreRank.F"/> rank.
+        /// Populates a failed score, marking it with the <see cref="ScoreRank.F"/> rank.
         /// </summary>
         public void FailScore(ScoreInfo score)
         {


Make BeatmapInfoWedge display properly for converts

--- osu.Game/Screens/Select/BeatmapInfoWedge.cs
+++ osu.Game/Screens/Select/BeatmapInfoWedge.cs
@@ -4,9 +4,11 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using JetBrains.Annotations;
 using OpenTK;
 using OpenTK.Graphics;
 using osu.Framework.Allocation;
+using osu.Framework.Configuration;
 using osu.Framework.Extensions.Color4Extensions;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Colour;
@@ -21,12 +23,16 @@
 using osu.Framework.Graphics.Shapes;
 using osu.Framework.Graphics.Cursor;
 using osu.Framework.Localisation;
+using osu.Game.Rulesets;
+using osu.Game.Rulesets.UI;

 namespace osu.Game.Screens.Select
 {
     public class BeatmapInfoWedge : OverlayContainer
     {
         private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0);
+
+        private readonly IBindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();

         protected BufferedWedgeInfo Info;

@@ -46,6 +52,14 @@
             };
         }

+        [BackgroundDependencyLoader(true)]
+        private void load([CanBeNull] OsuGame osuGame)
+        {
+            if (osuGame != null)
+                ruleset.BindTo(osuGame.Ruleset);
+            ruleset.ValueChanged += updateRuleset;
+        }
+
         protected override bool BlockPassThroughMouse => false;

         protected override void PopIn()
@@ -62,7 +76,17 @@
             this.FadeOut(500, Easing.In);
         }

+        private WorkingBeatmap beatmap;
+
         public void UpdateBeatmap(WorkingBeatmap beatmap)
+        {
+            this.beatmap = beatmap;
+            loadBeatmap();
+        }
+
+        private void updateRuleset(RulesetInfo ruleset) => loadBeatmap();
+
+        private void loadBeatmap()
         {
             LoadComponentAsync(new BufferedWedgeInfo(beatmap)
             {
@@ -90,14 +114,18 @@
             private UnicodeBindableString titleBinding;
             private UnicodeBindableString artistBinding;

+            private RulesetInfo ruleset;
+
             public BufferedWedgeInfo(WorkingBeatmap working)
             {
                 this.working = working;
             }

-            [BackgroundDependencyLoader]
-            private void load(LocalisationEngine localisation)
-            {
+            [BackgroundDependencyLoader(true)]
+            private void load([NotNull] LocalisationEngine localisation, [CanBeNull] OsuGame osuGame)
+            {
+                ruleset = osuGame?.Ruleset.Value ?? working.BeatmapInfo.Ruleset;
+
                 var beatmapInfo = working.BeatmapInfo;
                 var metadata = beatmapInfo.Metadata ?? working.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();

@@ -211,7 +239,6 @@
             private InfoLabel[] getInfoLabels()
             {
                 var beatmap = working.Beatmap;
-                var info = working.BeatmapInfo;

                 List<InfoLabel> labels = new List<InfoLabel>();

@@ -234,8 +261,20 @@
                         Content = getBPMRange(beatmap),
                     }));

-                    //get statistics for the current ruleset.
-                    labels.AddRange(working.GetPlayableBeatmap(info.Ruleset).GetStatistics().Select(s => new InfoLabel(s)));
+                    IBeatmap playableBeatmap;
+
+                    try
+                    {
+                        // Try to get the beatmap with the user's ruleset
+                        playableBeatmap = working.GetPlayableBeatmap(ruleset);
+                    }
+                    catch (BeatmapInvalidForRulesetException)
+                    {
+                        // Can't be converted to the user's ruleset, so use the beatmap's own ruleset
+                        playableBeatmap = working.GetPlayableBeatmap(working.BeatmapInfo.Ruleset);
+                    }
+
+                    labels.AddRange(playableBeatmap.GetStatistics().Select(s => new InfoLabel(s)));
                 }

                 return labels.ToArray();


reduced complexity

reduced complexity

--- osu.Game/Screens/Select/BeatmapInfoWedge.cs
+++ osu.Game/Screens/Select/BeatmapInfoWedge.cs
@@ -233,15 +233,35 @@
                             },
                         }
                     },
-                    topRightMetadataContainer = new Container
+                    new FillFlowContainer
                     {
                         Name = "Topright-aligned metadata",
                         Anchor = Anchor.TopRight,
                         Origin = Anchor.TopRight,
+                        Direction = FillDirection.Vertical,
                         Padding = new MarginPadding { Top = 14, Right = shear_width / 2 },
                         AutoSizeAxes = Axes.Both,
                         Shear = wedged_container_shear,
-                        Child = createTopRightMetadataContainer(beatmapInfo, starDifficulty.Value ?? new StarDifficulty())
+                        Children = new Drawable[]
+                        {
+                            starRatingContainer = new Container
+                            {
+                                AutoSizeAxes = Axes.Both,
+                                Anchor = Anchor.TopRight,
+                                Origin = Anchor.TopRight,
+                                Shear = -wedged_container_shear,
+                                Margin = new MarginPadding { Bottom = 5 }
+                            },
+                            StatusPill = new BeatmapSetOnlineStatusPill
+                            {
+                                Anchor = Anchor.TopRight,
+                                Origin = Anchor.TopRight,
+                                Shear = -wedged_container_shear,
+                                TextSize = 11,
+                                TextPadding = new MarginPadding { Horizontal = 8, Vertical = 2 },
+                                Status = beatmapInfo.Status,
+                            }
+                        }
                     },
                     new FillFlowContainer
                     {
@@ -299,51 +319,24 @@
             {
                 var difficulty = valueChanged.NewValue ?? new StarDifficulty();

-                topRightMetadataContainer.Child.FadeOut(250);
-                topRightMetadataContainer.Child.Expire();
-                topRightMetadataContainer.Child = createTopRightMetadataContainer(beatmap.BeatmapInfo, difficulty);
-
-                difficultyColourBarContainer.Child.Expire();
-                difficultyColourBarContainer.Child = createDifficultyColourBar(difficulty);
-            }
-
-            private DifficultyColourBar createDifficultyColourBar(StarDifficulty difficulty)
-                => new DifficultyColourBar(difficulty)
+                if (starRatingContainer.Children.Count > 0)
+                {
+                    starRatingContainer.Child.FadeOut(250);
+                    starRatingContainer.Child.Expire();
+                }
+
+                starRatingContainer.Child = difficulty.Stars > 0 ? new StarRatingDisplay(difficulty) : Empty();
+
+                if (difficultyColourBarContainer.Children.Count > 0)
+                {
+                    difficultyColourBarContainer.Child.Expire();
+                }
+
+                difficultyColourBarContainer.Child = new DifficultyColourBar(difficulty)
                 {
                     RelativeSizeAxes = Axes.Y,
                     Width = 20,
                 };
-
-            private FillFlowContainer createTopRightMetadataContainer(BeatmapInfo beatmapInfo, StarDifficulty difficulty)
-            {
-                var container = new FillFlowContainer
-                {
-                    Direction = FillDirection.Vertical,
-                    AutoSizeAxes = Axes.Both,
-                };
-
-                if (difficulty.Stars > 0)
-                {
-                    container.Add(new StarRatingDisplay(difficulty)
-                    {
-                        Anchor = Anchor.TopRight,
-                        Origin = Anchor.TopRight,
-                        Shear = -wedged_container_shear,
-                        Margin = new MarginPadding { Bottom = 5 }
-                    });
-                }
-
-                container.Add(StatusPill = new BeatmapSetOnlineStatusPill
-                {
-                    Anchor = Anchor.TopRight,
-                    Origin = Anchor.TopRight,
-                    Shear = -wedged_container_shear,
-                    TextSize = 11,
-                    TextPadding = new MarginPadding { Horizontal = 8, Vertical = 2 },
-                    Status = beatmapInfo.Status,
-                });
-
-                return container;
             }

             private void refreshModInformation(ValueChangedEvent<IReadOnlyList<Mod>> modsChangedEvent)


Tabs toggle, but still need to implement functionality to change pages as tabs toggle

--- otr-project/Views/User/ItemsBorrowed.cshtml
+++ otr-project/Views/User/ItemsBorrowed.cshtml
@@ -8,8 +8,8 @@

-
Currently Borrowing

-
Borrowed In The Past

+
Currently Borrowing

+
Borrowed In The Past

@@ -100,152 +100,16 @@

-


Update src/Tools/BuildValidator/FileNameEqualityComparer.cs

Co-authored-by: Jared Parsons <d131939c23330f3c945ed5437217aca3c84079c2@gmail.com>

--- src/Tools/BuildValidator/FileNameEqualityComparer.cs
+++ src/Tools/BuildValidator/FileNameEqualityComparer.cs
@@ -8,7 +8,7 @@

 namespace BuildValidator
 {
-    internal class FileNameEqualityComparer : IEqualityComparer<FileInfo>
+    internal sealed class FileNameEqualityComparer : IEqualityComparer<FileInfo>
     {
         public const StringComparison StringComparison = System.StringComparison.OrdinalIgnoreCase;
         public static readonly StringComparer StringComparer = StringComparer.FromComparison(StringComparison);


Fix unit tests to have the correct types as well

--- src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs
+++ src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs
@@ -159,11 +159,11 @@
             if (contentTypeService == null)
             {
                 var contentTypeServiceMock = new Mock<IContentTypeService>();
-                contentTypeServiceMock.Setup(x => x.GetAllContentTypes())
-                    .Returns(new List<IContentType>()
+                contentTypeServiceMock.Setup(x => x.GetAllMediaTypes())
+                    .Returns(new List<IMediaType>()
                     {
-                        new ContentType(-1) {Alias = "Folder", Name = "Folder", Id = 1031, Icon = "icon-folder"},
-                        new ContentType(-1) {Alias = "Image", Name = "Image", Id = 1032, Icon = "icon-picture"}
+                        new MediaType(-1) {Alias = "Folder", Name = "Folder", Id = 1031, Icon = "icon-folder"},
+                        new MediaType(-1) {Alias = "Image", Name = "Image", Id = 1032, Icon = "icon-picture"}
                     });
                 contentTypeService = contentTypeServiceMock.Object;
             }


Tests desafio 6

Tests desafio 6

--- BeatItTest/Test.cs
+++ BeatItTest/Test.cs
@@ -1,4 +1,5 @@
-using BeatIt_.Resources;
+using System;
+using BeatIt_.Resources;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using BeatIt_.AppCode.Challenges;
 using BeatIt_.AppCode.Classes;
@@ -213,6 +214,59 @@
         }
     };

+
+    [TestClass] // Throw The Phone
+    public class TestingChallengeDetail6
+    {
+        private const double GravitationalAcceleration = -9.80665f;
+
+        [TestMethod]
+        public void TestingFunction_CalcularPuntaje()
+        {
+            var ch6 = new ChallengeDetail6();
+            int puntos = ch6.CalcularPuntaje(0.1f);
+            Assert.AreEqual(puntos, 0);
+
+            double tiempo = Math.Sqrt(2 * 8 / -GravitationalAcceleration);
+            puntos = ch6.CalcularPuntaje(tiempo);
+            Assert.AreEqual(puntos, 120);
+
+            ch6 = new ChallengeDetail6(6, "", 2, 3, false);
+
+            puntos = ch6.CalcularPuntaje(0.1f);
+            Assert.AreEqual(puntos, 0);
+
+            tiempo = Math.Sqrt(2 * 8 / -GravitationalAcceleration);
+            puntos = ch6.CalcularPuntaje(tiempo);
+            Assert.AreEqual(puntos, 60);
+
+            tiempo = Math.Sqrt(3 * 8 / -GravitationalAcceleration);
+            puntos = ch6.CalcularPuntaje(tiempo);
+            Assert.AreEqual(puntos, 120);
+
+            tiempo = Math.Sqrt(4 * 8 / -GravitationalAcceleration);
+            puntos = ch6.CalcularPuntaje(tiempo);
+            Assert.AreEqual(puntos, 180);
+        }
+
+        [TestMethod]
+        public void TestingFunction_CompleteChallenge()
+        {
+            var ifc = FacadeController.GetInstanceForTesting(new User(), System.DateTime.Now.AddDays(-1), System.DateTime.Now.AddDays(6));
+            var ch6 = (ChallengeDetail6) ifc.GetChallenge(6);
+
+            double tiempo = Math.Sqrt(2 * 8 / -GravitationalAcceleration);
+            ch6.CompleteChallenge(tiempo);
+            Assert.AreEqual(ch6.State.BestScore, 120);
+
+            tiempo = Math.Sqrt(3 * 8 / -GravitationalAcceleration);
+            ch6.CompleteChallenge(tiempo);
+            Assert.AreEqual(ch6.State.BestScore, 180);
+            Assert.AreEqual(ch6.State.LastScore, 180);
+        }
+    }
+
+
     [TestClass] //Catch Me
     public class TestingChallengeDetail7
     {


Update test logger to lock before messages (#29104)

--- src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Helpers/TestLoggerProvider.cs
+++ src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Helpers/TestLoggerProvider.cs
@@ -29,14 +29,25 @@
         {
             private List<string> _messages = new List<string>();

+            private object _sync = new object();
+
             public IEnumerable<string> Messages
             {
-                get { return _messages; }
+                get
+                {
+                    lock (_sync)
+                    {
+                        return new List<string>(_messages);
+                    }
+                }
             }

             public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
             {
-                _messages.Add(formatter(state, exception));
+                lock (_sync)
+                {
+                    _messages.Add(formatter(state, exception));
+                }
             }

             public bool IsEnabled(LogLevel logLevel)
@@ -58,4 +69,4 @@
             }
         }
     }
-}+}