imageList edition

imageList edition

--- StroopTest/FormImgConfig.cs
+++ StroopTest/FormImgConfig.cs
@@ -35,7 +35,7 @@
                 if (result == DialogResult.OK)
                 {
                     string dir = defineFilePath.ReturnValue;
-                    imgListNameTextBox.Text = dir.Remove(dir.Length - 4);
+                    imgListNameTextBox.Text = dir.Remove(dir.Length - 6); // removes the _img identification from file while editing (when its saved it is always added again)

                     string[] filePaths = StroopProgram.readDirListFile(path + "/" + dir + ".lst");
                     readImagesIntoDGV(filePaths, imgPathDataGridView);
@@ -48,7 +48,7 @@
                 MessageBox.Show(ex.Message);
             }
         }
-
+
         private void btnOpen_Click(object sender, EventArgs e)
         {
             openImagesDirectory();
@@ -88,11 +88,18 @@
         private void readImagesIntoDGV(string[] directory, DataGridView imagesDataGridView)
         {
             DataGridView dgv = imagesDataGridView;
-            foreach (string file in directory)
-            {
-                Image image = Image.FromFile(file);
-                dgv.Rows.Add(Path.GetFileNameWithoutExtension(file), image, file);
-                ((DataGridViewImageColumn)dgv.Columns[1]).ImageLayout = DataGridViewImageCellLayout.Stretch;
+            try
+            {
+                foreach (string file in directory)
+                {
+                    Image image = Image.FromFile(file);
+                    dgv.Rows.Add(Path.GetFileNameWithoutExtension(file), image, file);
+                    ((DataGridViewImageColumn)dgv.Columns[1]).ImageLayout = DataGridViewImageCellLayout.Stretch;
+                }
+            }
+            catch(Exception ex)
+            {
+                throw ex;
             }
         }

@@ -158,7 +165,7 @@
                     throw new Exception("Preencha o campo com o nome do arquivo!");
                 }
                 DataGridView dgv = imgPathDataGridView;
-                DGVManipulation.saveColumnToListFile(dgv, 2, path, imgListNameTextBox.Text + "_img");
+                DGVManipulation.saveColumnToListFile(dgv, 2, path, imgListNameTextBox.Text + "_image");
                 Close();
             }
             catch (Exception ex) { MessageBox.Show(ex.Message); }


Small fix

Small fix

--- SuperPutty/ctlPuttyPanel.cs
+++ SuperPutty/ctlPuttyPanel.cs
@@ -463,7 +463,7 @@
                 try
                 {
                     this.SetFocusToChildApplication("MenuHandler");
-                    for (int i = 0; i < tags.Length; ++i)
+                    for (int i = 0; i < commands.Length; ++i)
                     {
                         NativeMethods.SendMessage(m_AppPanel.AppWindowHandle, (uint)NativeMethods.WM.SYSCOMMAND, commands[i], 0);
                     }


Refactor TestSceneHitCircle to show judgements

--- osu.Game.Rulesets.Osu.Tests/TestSceneHitCircle.cs
+++ osu.Game.Rulesets.Osu.Tests/TestSceneHitCircle.cs
@@ -1,17 +1,17 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

+using System.Linq;
+using NUnit.Framework;
 using osu.Framework.Graphics;
-using osu.Framework.Graphics.Containers;
 using osu.Game.Beatmaps;
 using osu.Game.Beatmaps.ControlPoints;
+using osu.Game.Rulesets.Mods;
 using osu.Game.Rulesets.Osu.Objects;
 using osu.Game.Rulesets.Osu.Objects.Drawables;
+using osu.Game.Rulesets.Osu.UI;
+using osu.Game.Rulesets.Scoring;
 using osuTK;
-using osu.Game.Rulesets.Mods;
-using System.Linq;
-using NUnit.Framework;
-using osu.Game.Rulesets.Scoring;

 namespace osu.Game.Rulesets.Osu.Tests
 {
@@ -39,12 +39,36 @@

         private Drawable testSingle(float circleSize, bool auto = false, double timeOffset = 0, Vector2? positionOffset = null)
         {
+            var drawable = createSingle(circleSize, auto, timeOffset, positionOffset);
+
+            var playfield = new TestOsuPlayfield();
+            playfield.Add(drawable);
+            return playfield;
+        }
+
+        private Drawable testStream(float circleSize, bool auto = false)
+        {
+            var playfield = new TestOsuPlayfield();
+
+            Vector2 pos = new Vector2(-250, 0);
+
+            for (int i = 0; i <= 1000; i += 100)
+            {
+                playfield.Add(createSingle(circleSize, auto, i, pos));
+                pos.X += 50;
+            }
+
+            return playfield;
+        }
+
+        private TestDrawableHitCircle createSingle(float circleSize, bool auto, double timeOffset, Vector2? positionOffset)
+        {
             positionOffset ??= Vector2.Zero;

             var circle = new HitCircle
             {
                 StartTime = Time.Current + 1000 + timeOffset,
-                Position = positionOffset.Value,
+                Position = OsuPlayfield.BASE_SIZE / 4 + positionOffset.Value,
             };

             circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize });
@@ -53,30 +77,13 @@

             foreach (var mod in SelectedMods.Value.OfType<IApplicableToDrawableHitObjects>())
                 mod.ApplyToDrawableHitObjects(new[] { drawable });
-
             return drawable;
         }

         protected virtual TestDrawableHitCircle CreateDrawableHitCircle(HitCircle circle, bool auto) => new TestDrawableHitCircle(circle, auto)
         {
-            Anchor = Anchor.Centre,
             Depth = depthIndex++
         };
-
-        private Drawable testStream(float circleSize, bool auto = false)
-        {
-            var container = new Container { RelativeSizeAxes = Axes.Both };
-
-            Vector2 pos = new Vector2(-250, 0);
-
-            for (int i = 0; i <= 1000; i += 100)
-            {
-                container.Add(testSingle(circleSize, auto, i, pos));
-                pos.X += 50;
-            }
-
-            return container;
-        }

         protected class TestDrawableHitCircle : DrawableHitCircle
         {
@@ -101,5 +108,13 @@
                     base.CheckForResult(userTriggered, timeOffset);
             }
         }
+
+        protected class TestOsuPlayfield : OsuPlayfield
+        {
+            public TestOsuPlayfield()
+            {
+                RelativeSizeAxes = Axes.Both;
+            }
+        }
     }
 }


Use SingleOrDefault() where possible

Use SingleOrDefault() where possible

--- osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs
+++ osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs
@@ -322,13 +322,13 @@

         private string getSampleBank(IList<HitSampleInfo> samples, bool banksOnly = false, bool zeroBanks = false)
         {
-            LegacySampleBank normalBank = toLegacySampleBank(samples.FirstOrDefault(s => s.Name == HitSampleInfo.HIT_NORMAL)?.Bank);
+            LegacySampleBank normalBank = toLegacySampleBank(samples.SingleOrDefault(s => s.Name == HitSampleInfo.HIT_NORMAL)?.Bank);
             LegacySampleBank addBank = toLegacySampleBank(samples.FirstOrDefault(s => !string.IsNullOrEmpty(s.Name) && s.Name != HitSampleInfo.HIT_NORMAL)?.Bank);

             string customSampleBank = toLegacyCustomSampleBank(samples.FirstOrDefault()?.Suffix);
             string sampleFilename = samples.FirstOrDefault(s => string.IsNullOrEmpty(s.Name))?.LookupNames.First() ?? string.Empty;

-            int volume = samples.First().Volume;
+            int volume = samples.FirstOrDefault()?.Volume ?? 100;

             StringBuilder sb = new StringBuilder();


Add check for BGA

Add check for BGA

--- source/Cosmos.HAL/Drivers/VBEDriver.cs
+++ source/Cosmos.HAL/Drivers/VBEDriver.cs
@@ -19,6 +19,9 @@

         public void vbe_set(ushort xres, ushort yres, ushort bpp)
         {
+            if (Cosmos.HAL.PCI.GetDevice(1234, 1111) == null){
+                throw new Exception("No BGA adapter found..");
+            }
             //Disable Display
             vbe_write(0x4, 0x00);
             //Set Display Xres


Update AHCI.cs

Update AHCI.cs

--- source/Cosmos.HAL2/BlockDevice/AHCI.cs
+++ source/Cosmos.HAL2/BlockDevice/AHCI.cs
@@ -66,13 +66,12 @@

         public AHCI(PCIDevice aAHCIDevice)
         {
-            mAHCIDebugger.Send("Something wrong!");
             aAHCIDevice.EnableBusMaster(true);
             aAHCIDevice.EnableMemory(true);

             mABAR = aAHCIDevice.BaseAddressBar[5].BaseAddress;
             mGeneric = new GenericRegisters(aAHCIDevice.BaseAddressBar[5].BaseAddress);
-            mGeneric.GlobalHostControl |= (1U << 31);
+            mGeneric.GlobalHostControl |= (1U << 31); // Enable AHCI

             GetCapabilities();
             mPorts.Capacity = (int)NumOfPorts;


テキストの描画のサイズ計算

テキストの描画のサイズ計算

--- TextEditor/MyEditor.xaml.cs
+++ TextEditor/MyEditor.xaml.cs
@@ -34,17 +34,15 @@
         const char LF = '\n';
         int CursorPos = 0;
         List<TChar> Chars = new List<TChar>();
+        List<TShape> DrawList = new List<TShape>();
         CanvasTextFormat TextFormat = new CanvasTextFormat();
         bool InComposition = false;
         int SelOrigin = -1;
         int SelCurrent = -1;
-        int SelStart;
-        int SelEnd;
         int LineCount = 1;
         double LineHeight = double.NaN;
         int ViewLineCount;
         Point ViewPadding = new Point(5, 5);
-        Point ClickedPoint = new Point(double.NaN, double.NaN);

         // テキストの選択位置
         CoreTextRange Selection;
@@ -76,7 +74,14 @@
             wnd.PointerWheelChanged += CoreWindow_PointerWheelChanged;
         }

+        Size MeasureText(string str, CanvasTextFormat text_format) {
+            Rect rc = (new CanvasTextLayout(Win2DCanvas, str, text_format, float.MaxValue, float.MaxValue)).LayoutBounds;
+
+            return new Size(rc.Width, rc.Height);
+        }
+
         private void Win2DCanvas_Draw(Microsoft.Graphics.Canvas.UI.Xaml.CanvasControl sender, Microsoft.Graphics.Canvas.UI.Xaml.CanvasDrawEventArgs args) {
+            DrawList.Clear();
             if (double.IsNaN(LineHeight)) {
                 // 最初の場合

@@ -112,7 +117,6 @@
                 }
             }

-
             float x_start = (float)ViewPadding.X, y = (float)ViewPadding.Y;

             int sel_start = Math.Min(SelOrigin, SelCurrent);
@@ -139,13 +143,13 @@

                     line_sw.Write(str);

-                    Rect rc = (new CanvasTextLayout(args.DrawingSession, str, TextFormat, float.MaxValue, float.MaxValue)).LayoutBounds;
-
-                    float xe = (float)(x + rc.Width);
-                    float yb = (float)(y + rc.Height);
+                    Size sz = MeasureText(str, TextFormat);
+
+                    float xe = (float)(x + sz.Width);
+                    float yb = (float)(y + sz.Height);
                     if (selected) {

-                        args.DrawingSession.FillRectangle(x, y, (float)rc.Width, (float)rc.Height, Colors.Blue);
+                        args.DrawingSession.FillRectangle(x, y, (float)sz.Width, (float)sz.Height, Colors.Blue);
                         args.DrawingSession.DrawText(str, x, y, Colors.White, TextFormat);
                     }
                     else {
@@ -174,31 +178,9 @@
                         }
                     }

-                    if(! double.IsNaN( ClickedPoint.X)) {
-
-                        Rect phrase_rc = new Rect(x, y, rc.Width, rc.Height);
-
-                        if (phrase_rc.Contains(ClickedPoint)) {
-
-                            int phrase_pos;
-                            StringWriter phrase_sw = new StringWriter();
-                            for(phrase_pos = phrase_start_pos; phrase_pos <= pos; phrase_pos++) {
-
-                                phrase_sw.Write(Chars[phrase_pos].Chr);
-                                Rect rc2 = (new CanvasTextLayout(args.DrawingSession, phrase_sw.ToString(), TextFormat, float.MaxValue, float.MaxValue)).LayoutBounds;
-                                Rect sub_phrase_rc = new Rect(x, y, rc2.Width, rc2.Height);
-                                if (sub_phrase_rc.Contains(ClickedPoint)) {
-
-                                    SetCursorPos(VirtualKey.None, phrase_pos);
-                                    break;
-                                }
-                            }
-
-                            ClickedPoint = new Point(double.NaN, double.NaN);
-                        }
-                    }
-
-                    x += (float)rc.Width;
+                    DrawList.Add(new TShape(x, y, sz, phrase_start_pos, pos));
+
+                    x += (float)sz.Width;

                     if (Chars.Count <= pos || Chars[pos].Chr == LF) {

@@ -235,8 +217,6 @@
                     break;
                 }
             }
-
-            ClickedPoint = new Point(double.NaN, double.NaN);
         }

         private void Win2DCanvas_SizeChanged(object sender, SizeChangedEventArgs e) {
@@ -244,7 +224,6 @@

         private void Win2DCanvas_PointerPressed(object sender, PointerRoutedEventArgs e) {
             Debug.WriteLine("Win2DCanvas_PointerPressed");
-
         }

         int GetLineTop(int current_pos) {
@@ -315,6 +294,7 @@
                 }
             }

+
             Win2DCanvas.Invalidate();
         }

@@ -323,14 +303,14 @@
             int next_line_top;
             bool control_down = ((Window.Current.CoreWindow.GetKeyState(VirtualKey.Control) & CoreVirtualKeyStates.Down) != 0);

-            Debug.WriteLine("CoreWindow KeyDown : {0} {1} {2}", e.VirtualKey, OverlappedButton.FocusState, InComposition);
+            Debug.WriteLine("<<--- CoreWindow KeyDown : {0} {1} {2}", e.VirtualKey, OverlappedButton.FocusState, InComposition);

             if (editContext == null || InComposition || OverlappedButton.FocusState == FocusState.Unfocused) {
                 return;
             }

             switch (e.VirtualKey) {
-            case Windows.System.VirtualKey.Left:
+            case VirtualKey.Left: // 左矢印(←)
                 if (0 < CursorPos) {

                     SetCursorPos(e.VirtualKey, CursorPos - 1);
@@ -338,7 +318,7 @@
                 }
                 break;

-            case Windows.System.VirtualKey.Right:
+            case VirtualKey.Right: // 右矢印(→)
                 if (CursorPos < Chars.Count) {

                     SetCursorPos(e.VirtualKey, CursorPos + 1);
@@ -347,7 +327,7 @@

                 break;

-            case Windows.System.VirtualKey.Up: {
+            case VirtualKey.Up: { // 上矢印(↑)
                     // 現在の行の先頭位置を得る。
                     current_line_top = GetLineTop(CursorPos);

@@ -367,7 +347,7 @@
                 }
                 break;

-            case Windows.System.VirtualKey.Down: {
+            case VirtualKey.Down: { // 下矢印(↓)
                     // 現在の行の先頭位置を得る。
                     current_line_top = GetLineTop(CursorPos);

@@ -400,7 +380,7 @@
                 }
                 break;

-            case Windows.System.VirtualKey.Home: {
+            case VirtualKey.Home: {
                     int new_pos;

                     if ((Window.Current.CoreWindow.GetKeyState(VirtualKey.Control) & CoreVirtualKeyStates.Down) != 0) {
@@ -422,7 +402,7 @@
                 }
                 break;

-            case Windows.System.VirtualKey.End: {
+            case VirtualKey.End: {
                     int new_pos;

                     if ((Window.Current.CoreWindow.GetKeyState(VirtualKey.Control) & CoreVirtualKeyStates.Down) != 0) {
@@ -485,13 +465,13 @@
                 }
                 break;

-            case Windows.System.VirtualKey.Back: {
+            case VirtualKey.Back: {

                     if (0 < CursorPos) {

                         if (SelOrigin != -1) {

-                            ReplaceText(SelStart, SelEnd, "");
+                            ReplaceText(Selection.StartCaretPosition, Selection.EndCaretPosition, "");
                         }
                         else {

@@ -501,13 +481,13 @@
                 }
                 break;

-            case Windows.System.VirtualKey.Delete: {
+            case VirtualKey.Delete: {

                     if (CursorPos < Chars.Count) {

                         if(SelOrigin != -1) {

-                            ReplaceText(SelStart, SelEnd, "");
+                            ReplaceText(Selection.StartCaretPosition, Selection.EndCaretPosition, "");
                         }
                         else {

@@ -517,13 +497,14 @@
                 }
                 break;

-            case Windows.System.VirtualKey.Enter: {
-                    ReplaceText(SelStart, SelEnd, "\n");
+            case VirtualKey.Enter: {
+                    ReplaceText(Selection.StartCaretPosition, Selection.EndCaretPosition, "\n");
                 }
                 break;

             case VirtualKey.C:
                 if (control_down && SelOrigin != -1) {
+                    // Ctrl+Cで選択中の場合

                     // https://msdn.microsoft.com/en-us/windows/uwp/app-to-app/copy-and-paste

@@ -545,6 +526,7 @@

             case VirtualKey.V:
                 if (control_down) {
+                    // Ctrl+Vの場合

                     DataPackageView dataPackageView = Clipboard.GetContent();
                     if (dataPackageView.Contains(StandardDataFormats.Text)) {
@@ -569,6 +551,7 @@
             }

             if (SelOrigin != -1 && (Window.Current.CoreWindow.GetKeyState(VirtualKey.Shift) & CoreVirtualKeyStates.Down) == 0) {
+                // 選択中でシフトキーが押されてない場合

                 switch (e.VirtualKey) {
                 case VirtualKey.Shift:
@@ -576,10 +559,12 @@
                     break;

                 default:
+                    // 選択状態を解除する。
+
                     SelOrigin = -1;
                     SelCurrent = -1;
-                    SelStart = CursorPos;
-                    SelEnd = CursorPos;
+                    Selection.StartCaretPosition = CursorPos;
+                    Selection.EndCaretPosition = CursorPos;
                     Win2DCanvas.Invalidate();
                     break;
                 }
@@ -590,14 +575,33 @@
         }

         private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs e) {
-            Point pt = Win2DCanvas.TransformToVisual(Window.Current.Content).TransformPoint(new Point(0, 0));
-
-            ClickedPoint = new Point(e.CurrentPoint.Position.X - pt.X, e.CurrentPoint.Position.Y - pt.Y);
-
-            Debug.WriteLine("CoreWindow PointerPressed {0} {1} {2}", e.CurrentPoint.Position, pt, ClickedPoint);
+            Point canvas_pos = Win2DCanvas.TransformToVisual(Window.Current.Content).TransformPoint(new Point(0, 0));
+
+            Point pt = new Point(e.CurrentPoint.Position.X - canvas_pos.X, e.CurrentPoint.Position.Y - canvas_pos.Y);
+
+            foreach(TShape shape in DrawList) {
+                if (shape.Bounds.Contains(pt)) {
+
+                    int phrase_pos;
+                    StringWriter phrase_sw = new StringWriter();
+                    for (phrase_pos = shape.Range.StartPos; phrase_pos <= shape.Range.EndPos; phrase_pos++) {
+
+                        phrase_sw.Write(Chars[phrase_pos].Chr);
+
+                        Size sz = MeasureText(phrase_sw.ToString(), TextFormat);
+                        Rect sub_phrase_rc = new Rect(shape.Bounds.X, shape.Bounds.Y, sz.Width, sz.Height);
+                        if (sub_phrase_rc.Contains(pt)) {
+
+                            SetCursorPos(VirtualKey.None, phrase_pos);
+                            break;
+                        }
+                    }
+                }
+            }
+
+            Debug.WriteLine("CoreWindow PointerPressed {0} {1} {2}", e.CurrentPoint.Position, canvas_pos, pt);
             Win2DCanvas.Invalidate();
         }
-

         private void CoreWindow_PointerWheelChanged(CoreWindow sender, PointerEventArgs args) {
             int scroll_direction = (0 < args.CurrentPoint.Properties.MouseWheelDelta ? -1 : 1);
@@ -613,12 +617,12 @@

             if (shift_down && CursorPos != pos) {
                 switch (key) {
-                case Windows.System.VirtualKey.Left:
-                case Windows.System.VirtualKey.Right:
-                case Windows.System.VirtualKey.Up:
-                case Windows.System.VirtualKey.Down:
-                case Windows.System.VirtualKey.Home:
-                case Windows.System.VirtualKey.End:
+                case VirtualKey.Left:
+                case VirtualKey.Right:
+                case VirtualKey.Up:
+                case VirtualKey.Down:
+                case VirtualKey.Home:
+                case VirtualKey.End:

                     if (SelOrigin == -1) {

@@ -635,17 +639,14 @@

             if (SelOrigin != -1) {

-                SelStart = Math.Min(SelOrigin, SelCurrent);
-                SelEnd = Math.Max(SelOrigin, SelCurrent);
+                Selection.StartCaretPosition = Math.Min(SelOrigin, SelCurrent);
+                Selection.EndCaretPosition = Math.Max(SelOrigin, SelCurrent);
             }
             else {

-                SelStart = CursorPos;
-                SelEnd = CursorPos;
-            }
-
-            Selection.StartCaretPosition = pos;
-            Selection.EndCaretPosition = pos;
+                Selection.StartCaretPosition = CursorPos;
+                Selection.EndCaretPosition = CursorPos;
+            }

             Win2DCanvas.Invalidate();
         }
@@ -670,6 +671,25 @@

         public TChar(char c) {
             Chr = c;
+        }
+    }
+
+    public struct TRange {
+        public Int32 StartPos;
+        public Int32 EndPos;
+    }
+
+    public class TShape {
+        public Rect     Bounds;
+        public TRange   Range;
+
+        public TShape(double x, double y, Size sz, int start_pos, int end_pos) {
+            Bounds.X        = x;
+            Bounds.Y        = y;
+            Bounds.Width    = sz.Width;
+            Bounds.Height   = sz.Height;
+            Range.StartPos  = start_pos;
+            Range.EndPos    = end_pos;
         }
     }


Portfolio: BarChart fix

Portfolio: BarChart fix

--- UWP/Views/Portfolio.xaml.cs
+++ UWP/Views/Portfolio.xaml.cs
@@ -169,7 +169,8 @@
             for (int i = 0; i < minCommon; i++) {
                 chartData.Add(new ChartPoint {
                     Date = dates_arr.ElementAt(i),
-                    Value = (float)worth_arr[i]
+                    Value = (float)worth_arr[i],
+                    Volume = 0
                 });
             }
             vm.Chart.ChartData = chartData;
@@ -183,6 +184,8 @@
             /// Calculate min-max to adjust axis
             var MinMax = GraphHelper.GetMinMaxOfArray(chartData.Select(d => d.Value).ToList());
             vm.Chart.PricesMinMax = GraphHelper.OffsetMinMaxForChart(MinMax.Min, MinMax.Max);
+            vm.Chart.VolumeMax = GraphHelper.GetMaxOfVolume(chartData);
+            vm.Chart.VolumeMax = (vm.Chart.VolumeMax == 0) ? 10 : vm.Chart.VolumeMax;
         }

         /// ###############################################################################################


Update a test method 'StringUtilsTest#GetPositionByIndexTest'

--- UnitTest/StringUtilsTest.cs
+++ UnitTest/StringUtilsTest.cs
@@ -33,6 +33,7 @@
             Assert.AreEqual(new CharPosition(1, 7), "abc123".GetPositionByIndex(6));
             Assert.AreEqual(new CharPosition(2, 3), "abc\n123".GetPositionByIndex(6));
             Assert.AreEqual(new CharPosition(2, 4), "abc\n123".GetPositionByIndex(7));
+            Assert.AreEqual(new CharPosition(2, 3), "abc\n123\n456".GetPositionByIndex(6));
         }

         [TestMethod]


add 911 and escape button. modify to make responsive to most devices.

--- Web/Views/Home/Index.cshtml
+++ Web/Views/Home/Index.cshtml
@@ -33,13 +33,18 @@

         .help_btn {
             height: 50px;
-            width: 320px;
+            width: 300px;
         }

         .help_btn2 {
             height: 50px;
             width: 200px;
         }
+
+        /*.escape_btn{
+            height: 70px;
+            width: 200px;
+        }*/
     </style>

@@ -47,16 +52,19 @@

-

-                @*

-
-                            <input type="image" src="~/images/911.png" />
-
-
*@
+

+

+
+
+                            ESCAPE
+
+
+
+

-

+

-
Need Help?

+
Need Help?

Concerning?

@@ -68,6 +76,15 @@

                                 <button class="btn btn-md u-btn-white g-color-white g-bg-green g-brd-white--hover g-color-primary--hover g-bg-white--hover g-rounded-25 help_btn" ng-click="IxCtrl.helpBtn()">Someone I Know Needs Help</button>
+

+

+
+
+                                        Emergency
+                                        Call 911
+
+
+


fixed drawing of measured markup

fixed drawing of measured markup

--- WebApp/App_Code/MapMaker.cs
+++ WebApp/App_Code/MapMaker.cs
@@ -328,7 +328,7 @@
                 markup.Color = reader.GetString(1);
                 markup.Glow = !reader.IsDBNull(2) ? reader.GetString(2) : null;
                 markup.Text = !reader.IsDBNull(3) ? reader.GetString(3) : null;
-                markup.Measured = !reader.IsDBNull(4) ? (int?)reader.GetInt32(4) : null;
+                markup.Measured = !reader.IsDBNull(4) ? (int?)reader.GetInt16(4) : null;

                 markupList.Add(markup);
               }


DASyncTcpClient

DASyncTcpClient

--- samples/SimpleConsole/IMPlugin/DAysncTcpClient.cs
+++ samples/SimpleConsole/IMPlugin/DAysncTcpClient.cs
@@ -9,21 +9,14 @@
 {
     public class DAysncTcpClient
     {
-        private Socket rawSocket = null;
+        private TcpClient rawSocket = new TcpClient();
+
+        private void InnerOnAsyncConnected(IAsyncResult result)
+        {
+
+        }

         private String host;
-
-        private void CheckCreateRawSocket()
-        {
-            if (rawSocket == null)
-            {
-                rawSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-                //rawSocket.Blocking = false;
-                byte[] inOptionValues = BitConverter.GetBytes(1);
-                byte[] outOptionValues = BitConverter.GetBytes(0);
-                rawSocket.IOControl(IOControlCode.NonBlockingIO, inOptionValues, outOptionValues);
-            }
-        }

         public String Host
         {
@@ -39,17 +32,14 @@
             set { port = value; }
         }

-        public void Connect(int timeOut)
-        {
-            CheckCreateRawSocket();
-
+        public void Connect()
+        {
             rawSocket.Connect(host, port);
-
-            ArrayList wr = new ArrayList();
-            wr.Add(this);
-            Socket.Select(null, wr, null, 5000);
         }

-
+        public void ConnectASync()
+        {
+            rawSocket.BeginConnect(host, port, new AsyncCallback(InnerOnAsyncConnected), rawSocket);
+        }
     }
 }


Added ID to register button

Added ID to register button

--- src/SFA.DAS.EmployerUsers.Web/Views/Account/Register.cshtml
+++ src/SFA.DAS.EmployerUsers.Web/Views/Account/Register.cshtml
@@ -110,7 +110,7 @@
             By continuing you accept the terms of use.

     </fieldset>
-    <button type="submit" class="button">Set me up</button>
+    <button type="submit" class="button" id="button-register">Set me up</button>
 </form>
 @section scripts {
     @Scripts.Render("~/bundles/password")


Reduce CredentialHostKey allocations

Reduce CredentialHostKey allocations

CredentialHostKey can be a struct instead of a class. Unlike with the
Uri-based dictionary, there's no need to enumerate all items in the
Host/Port-based dictionary to find the greatest prefix length.
Instead, we can look up the item in the dictionary directly.

There's also no need to cache the hash code. Allocations associated
with ToUpperInvariant().GetHashCode() can be avoided by using
StringComparer.OrdinalIgnoreCase.GetHashCode().

--- src/System.Net.Primitives/src/System/Net/CredentialCache.cs
+++ src/System.Net.Primitives/src/System/Net/CredentialCache.cs
@@ -86,7 +86,7 @@

             ++_version;

-            CredentialHostKey key = new CredentialHostKey(host, port, authenticationType);
+            var key = new CredentialHostKey(host, port, authenticationType);

             if (GlobalLog.IsEnabled)
             {
@@ -155,7 +155,7 @@

             ++_version;

-            CredentialHostKey key = new CredentialHostKey(host, port, authenticationType);
+            var key = new CredentialHostKey(host, port, authenticationType);

             if (GlobalLog.IsEnabled)
             {
@@ -253,19 +253,10 @@
                 return null;
             }

-            NetworkCredential match = null;
-
-            // Enumerate through every credential in the cache
-            foreach (KeyValuePair<CredentialHostKey, NetworkCredential> pair in _cacheForHosts)
-            {
-                CredentialHostKey key = pair.Key;
-
-                // Determine if this credential is applicable to the current Uri/AuthType
-                if (key.Match(host, port, authenticationType))
-                {
-                    match = pair.Value;
-                }
-            }
+            var key = new CredentialHostKey(host, port, authenticationType);
+
+            NetworkCredential match;
+            _cacheForHosts.TryGetValue(key, out match);

             if (GlobalLog.IsEnabled)
             {
@@ -460,7 +451,7 @@
         }
     }

-    internal class CredentialHostKey : IEquatable<CredentialHostKey>
+    internal struct CredentialHostKey : IEquatable<CredentialHostKey>
     {
         public readonly string Host;
         public readonly string AuthenticationType;
@@ -468,53 +459,22 @@

         internal CredentialHostKey(string host, int port, string authenticationType)
         {
+            Debug.Assert(!string.IsNullOrEmpty(host));
+            Debug.Assert(port >= 0);
+            Debug.Assert(authenticationType != null);
+
             Host = host;
             Port = port;
             AuthenticationType = authenticationType;
         }

-        internal bool Match(string host, int port, string authenticationType)
-        {
-            if (host == null || authenticationType == null)
-            {
-                return false;
-            }
-
-            // If the protocols don't match, this credential is not applicable for the given Uri.
-            if (!string.Equals(authenticationType, AuthenticationType, StringComparison.OrdinalIgnoreCase) ||
-                !string.Equals(Host, host, StringComparison.OrdinalIgnoreCase) ||
-                port != Port)
-            {
-                return false;
-            }
-
-            if (GlobalLog.IsEnabled)
-            {
-                GlobalLog.Print("CredentialKey::Match(" + Host.ToString() + ":" + Port.ToString() + " & " + host.ToString() + ":" + port.ToString() + ")");
-            }
-            return true;
-        }
-
-        private int _hashCode = 0;
-        private bool _computedHashCode = false;
-        public override int GetHashCode()
-        {
-            if (!_computedHashCode)
-            {
-                // Compute HashCode on demand
-                _hashCode = AuthenticationType.ToUpperInvariant().GetHashCode() + Host.ToUpperInvariant().GetHashCode() + Port.GetHashCode();
-                _computedHashCode = true;
-            }
-            return _hashCode;
-        }
+        public override int GetHashCode() =>
+            StringComparer.OrdinalIgnoreCase.GetHashCode(AuthenticationType) ^
+            StringComparer.OrdinalIgnoreCase.GetHashCode(Host) ^
+            Port.GetHashCode();

         public bool Equals(CredentialHostKey other)
         {
-            if (other == null)
-            {
-                return false;
-            }
-
             bool equals =
                 string.Equals(AuthenticationType, other.AuthenticationType, StringComparison.OrdinalIgnoreCase) &&
                 string.Equals(Host, other.Host, StringComparison.OrdinalIgnoreCase) &&
@@ -522,20 +482,17 @@

             if (GlobalLog.IsEnabled)
             {
-                GlobalLog.Print("CredentialKey::Equals(" + ToString() + ", " + other.ToString() + ") returns " + equals.ToString());
-            }
+                GlobalLog.Print("CredentialHostKey::Equals(" + ToString() + ", " + other.ToString() + ") returns " + equals.ToString());
+            }
+
             return equals;
         }

-        public override bool Equals(object comparand)
-        {
-            return Equals(comparand as CredentialHostKey);
-        }
-
-        public override string ToString()
-        {
-            return "[" + Host.Length.ToString(NumberFormatInfo.InvariantInfo) + "]:" + Host + ":" + Port.ToString(NumberFormatInfo.InvariantInfo) + ":" + LoggingHash.ObjectToString(AuthenticationType);
-        }
+        public override bool Equals(object obj) =>
+            obj is CredentialHostKey && Equals((CredentialHostKey)obj);
+
+        public override string ToString() =>
+            Host + ":" + Port.ToString(NumberFormatInfo.InvariantInfo) + ":" + LoggingHash.ObjectToString(AuthenticationType);
     }

     internal class CredentialKey : IEquatable<CredentialKey>


Add tests to verify that JSON deserializer doesn't do any multiplication or addition on the string length (#41754)

* Add deserialization tests for very long input strings (#41687)

* Fix tests

* Add deserialization tests for the maximum possible string length

* Improve long strings creation in deserialization tests for netcoreapp

* Extract common logic from if/def block

* Fix assertion

* Remove unnecessary test cases

* Remove other extra test cases

--- src/System.Text.Json/tests/Serialization/Value.ReadTests.cs
+++ src/System.Text.Json/tests/Serialization/Value.ReadTests.cs
@@ -380,12 +380,47 @@
         public static void LongInputString(int length)
         {
             // Verify boundary conditions in Deserialize() that inspect the size to determine allocation strategy.
-            string repeated = new string('x', length - 2);
-            string json = $"\"{repeated}\"";
-            Assert.Equal(length, json.Length);
+            DeserializeLongJsonString(length);
+        }
+
+        private const int MaxInt = int.MaxValue / MaxExpansionFactorWhileTranscoding;
+        private const int MaximumPossibleStringLength = int.MaxValue / 2 - 32;
+
+        // NOTE: VeryLongInputString test is constrained to run on Windows and MacOSX because it causes
+        //       problems on Linux due to the way deferred memory allocation works. On Linux, the allocation can
+        //       succeed even if there is not enough memory but then the test may get killed by the OOM killer at the
+        //       time the memory is accessed which triggers the full memory allocation.
+        [ConditionalTheory(nameof(IsX64))]
+        [PlatformSpecific(TestPlatforms.Windows | TestPlatforms.OSX)]
+        [InlineData(MaxInt)]
+        [InlineData(MaximumPossibleStringLength)]
+        [OuterLoop]
+        public static void VeryLongInputString(int length)
+        {
+            // Verify that deserializer does not do any multiplication or addition on the string length
+            DeserializeLongJsonString(length);
+        }
+
+        private static void DeserializeLongJsonString(int stringLength)
+        {
+            string json;
+            char fillChar = 'x';
+
+#if BUILDING_INBOX_LIBRARY
+            json = string.Create(stringLength, fillChar, (chars, fillChar) =>
+            {
+                chars.Fill(fillChar);
+                chars[0] = '"';
+                chars[chars.Length - 1] = '"';
+            });
+#else
+            string repeated = new string(fillChar, stringLength - 2);
+            json = $"\"{repeated}\"";
+#endif
+            Assert.Equal(stringLength, json.Length);

             string str = JsonSerializer.Deserialize<string>(json);
-            Assert.Equal(repeated, str);
+            Assert.True(json.AsSpan(1, json.Length - 2).SequenceEqual(str.AsSpan()));
         }
     }
 }


Fix the ugly checkbox

Fix the ugly checkbox

--- src/TestWebsite/Views/Shared/EditorTemplates/Boolean.cshtml
+++ src/TestWebsite/Views/Shared/EditorTemplates/Boolean.cshtml
@@ -1,4 +1,6 @@
 @model Boolean?
-
-@Html.CheckBox("", @Model.GetValueOrDefault(false), new {@class="form-control check-box checkbox-inline"})
-+

+
+        @Html.CheckBox("", @Model.GetValueOrDefault(false))
+
+


ensures that when querying for a tag with a comma that we encode it so that it finds it.

--- src/Umbraco.Core/Persistence/Repositories/TagsRepository.cs
+++ src/Umbraco.Core/Persistence/Repositories/TagsRepository.cs
@@ -185,6 +185,10 @@

         public IEnumerable<TaggedEntity> GetTaggedEntitiesByTag(TaggableObjectTypes objectType, string tag, string tagGroup = null)
         {
+            //ensure that we html encode any comma's so they are found!
+            // http://issues.umbraco.org/issue/U4-4741
+            var replaced = tag.Replace(",", ",");
+
             var nodeObjectType = GetNodeObjectType(objectType);

             var sql = new Sql()
@@ -199,7 +203,7 @@
                 .InnerJoin<NodeDto>()
                 .On<NodeDto, ContentDto>(left => left.NodeId, right => right.NodeId)
                 .Where<NodeDto>(dto => dto.NodeObjectType == nodeObjectType)
-                .Where<TagDto>(dto => dto.Tag == tag);
+                .Where<TagDto>(dto => dto.Tag == replaced);

             if (tagGroup.IsNullOrWhiteSpace() == false)
             {


Ensure registered configuration builders are called at the end of the build process

--- src/WebJobs.Script.WebHost/WebScriptHostBuilderExtension.cs
+++ src/WebJobs.Script.WebHost/WebScriptHostBuilderExtension.cs
@@ -22,6 +22,16 @@
             ILoggerFactory configLoggerFactory = rootServiceProvider.GetService<ILoggerFactory>();

             builder.UseServiceProviderFactory(new JobHostScopedServiceProviderFactory(rootServiceProvider, rootScopeFactory))
+                .AddScriptHost(webHostOptions, configLoggerFactory, webJobsBuilder =>
+                {
+                    webJobsBuilder
+                        .AddWebJobsLogging() // Enables WebJobs v1 classic logging
+                        .AddAzureStorageCoreServices();
+
+                    configureWebJobs?.Invoke(webJobsBuilder);
+
+                    ConfigureRegisteredBuilders(webJobsBuilder, rootServiceProvider);
+                })
                 .ConfigureAppConfiguration(configurationBuilder =>
                 {
                     ConfigureRegisteredBuilders(configurationBuilder, rootServiceProvider);
@@ -33,16 +43,6 @@
                     loggingBuilder.Services.AddSingleton<ILoggerProvider, SystemLoggerProvider>();

                     ConfigureRegisteredBuilders(loggingBuilder, rootServiceProvider);
-                })
-                .AddScriptHost(webHostOptions, configLoggerFactory, webJobsBuilder =>
-                {
-                    webJobsBuilder
-                        .AddWebJobsLogging() // Enables WebJobs v1 classic logging
-                        .AddAzureStorageCoreServices();
-
-                    configureWebJobs?.Invoke(webJobsBuilder);
-
-                    ConfigureRegisteredBuilders(webJobsBuilder, rootServiceProvider);
                 })
                 .ConfigureServices(services =>
                 {


internal

internal

--- src/ZeroFormatter.FSharpExtensions/FSharpOptionFormatter.cs
+++ src/ZeroFormatter.FSharpExtensions/FSharpOptionFormatter.cs
@@ -4,7 +4,7 @@

 namespace ZeroFormatter.Extensions
 {
-    public class FSharpOptionStructFormatter<TTypeResolver, T> : Formatter<TTypeResolver, FSharpOption<T>>
+    internal class FSharpOptionStructFormatter<TTypeResolver, T> : Formatter<TTypeResolver, FSharpOption<T>>
         where T : struct
         where TTypeResolver : ITypeResolver, new()
     {
@@ -60,7 +60,7 @@
         }
     }

-    public class FSharpOptionObjectFormatter<TTypeResolver, T> : Formatter<TTypeResolver, FSharpOption<T>>
+    internal class FSharpOptionObjectFormatter<TTypeResolver, T> : Formatter<TTypeResolver, FSharpOption<T>>
         where T : class
         where TTypeResolver : ITypeResolver, new()
     {


Fix: Crash when removing game(s)

Fix: Crash when removing game(s)

--- source/Playnite/GamesEditor.cs
+++ source/Playnite/GamesEditor.cs
@@ -312,7 +312,14 @@
                 return;
             }

-            Database.Games.Remove(game);
+            if (Database.Games[game.Id] == null)
+            {
+                logger.Warn($"Failed to remove game {game.Name} {game.Id}, game doesn't exists anymore.");
+            }
+            else
+            {
+                Database.Games.Remove(game);
+            }
         }

         public void RemoveGames(List<Game> games)
@@ -334,6 +341,15 @@
                 MessageBoxImage.Question) != MessageBoxResult.Yes)
             {
                 return;
+            }
+
+            foreach (var game in games.ToList())
+            {
+                if (Database.Games[game.Id] == null)
+                {
+                    logger.Warn($"Failed to remove game {game.Name} {game.Id}, game doesn't exists anymore.");
+                    games.Remove(game);
+                }
             }

             Database.Games.Remove(games);


Bump version.

Bump version.

--- source/SharpFlame/Constants.cs
+++ source/SharpFlame/Constants.cs
@@ -1,9 +1,9 @@
 internal static class Constants
 {
     public const string ProgramName = "SharpFlame";
-    public const string ProgramVersionNumber = "0.23";
+    public const string ProgramVersionNumber = "0.24";
 #if Mono
-    public const string ProgramPlatform = "Mono 0.23";
+    public const string ProgramPlatform = "Mono 0.24";
 #else
     public const string ProgramPlatform = "Windows";
 #endif


License clean up.

License clean up.

--- LNF/Scheduler/Extensions.cs
+++ LNF/Scheduler/Extensions.cs
@@ -1,20 +1,4 @@
-/*
-  Copyright 2017 University of Michigan
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-*/
-
-using LNF.Cache;
+using LNF.Cache;
 using LNF.CommonTools;
 using LNF.Data;
 using LNF.Models.Data;


Fixed a bug, that caused the YoutubeAudioPlayer to raise the SongFinished event, even if the song hasn't started yet.

This was caused by the VlcPlayer.EndReached event, that raised prematurely.
For now, the solution I've come up is a bit of a hack, i use the TimeChanged event of the VlcPlayer class and check if the current time is equal or greater than the total duration,
but because it doesn't fit always perfectly, I subtract one second from the total duration so that the SongFinished event is hopefully raised.

--- Espera/Espera.Core/Audio/YoutubeAudioPlayer.cs
+++ Espera/Espera.Core/Audio/YoutubeAudioPlayer.cs
@@ -30,7 +30,7 @@

             this.player = new VlcControl();

-            this.player.EndReached += (sender, e) => this.OnSongFinished(EventArgs.Empty);
+            this.player.TimeChanged += (sender, e) => this.OnSongFinished(EventArgs.Empty);
         }

         public override AudioPlayerState PlaybackState
@@ -95,5 +95,14 @@
             this.player.Dispose();
             VlcContext.CloseAll();
         }
+
+        protected override void OnSongFinished(EventArgs e)
+        {
+            // HACK: Cut the time one second before it really ends, so that the current time reaches the duration
+            if (this.player.Time >= this.player.Duration - TimeSpan.FromSeconds(1))
+            {
+                base.OnSongFinished(e);
+            }
+        }
     }
 }


Fixed the playback state

Fixed the playback state

--- Espera/Espera.Core/Audio/YoutubeAudioPlayer.cs
+++ Espera/Espera.Core/Audio/YoutubeAudioPlayer.cs
@@ -38,10 +38,13 @@
                 switch (this.player.State)
                 {
                     case States.Playing:
+                    case States.Buffering:
+                    case States.Opening:
                         return AudioPlayerState.Playing;
                     case States.Paused:
                         return AudioPlayerState.Paused;
                     case States.Stopped:
+                    case States.Ended:
                         return AudioPlayerState.Stopped;
                     default:
                         return AudioPlayerState.None;


Reword that

Reword that

--- Espera/Espera.Core/Management/AccessControl.cs
+++ Espera/Espera.Core/Management/AccessControl.cs
@@ -16,7 +16,7 @@
     /// </summary>
     /// <remarks>
     /// The basic idea is, that each endpoint (be it the local GUI, or a mobile phone) gets an access token
-    /// much like in an web API. This access token can be upgraded by providing the password that the administrator
+    /// similiar to a Web API. This access token can be upgraded by providing the password that the administrator
     /// has specified.
     /// </remarks>
     internal class AccessControl : IEnableLogger, ILocalAccessControl, IRemoteAccessControl


Some suppressed ReSharper-inspections may now be deleted.

--- ExRam.Gremlinq/Gremlin/GremlinQueryLanguage.cs
+++ ExRam.Gremlinq/Gremlin/GremlinQueryLanguage.cs
@@ -145,14 +145,12 @@
         public static IGremlinQuery<Vertex> Both<T>(this IGremlinQuery query)
         {
             return query
-                // ReSharper disable once CoVariantArrayConversion
                 .AddStep<Vertex>("both", GetDerivedLabelNames<T>(query.Provider.Model));
         }

         public static IGremlinQuery<T> BothE<T>(this IGremlinQuery query)
         {
             return query
-                // ReSharper disable once CoVariantArrayConversion
                 .AddStep<T>("bothE", GetDerivedLabelNames<T>(query.Provider.Model));
         }

@@ -288,14 +286,12 @@
         public static IGremlinQuery<Vertex> In<T>(this IGremlinQuery query)
         {
             return query
-                // ReSharper disable once CoVariantArrayConversion
                 .AddStep<Vertex>("in", GetDerivedLabelNames<T>(query.Provider.Model));
         }

         public static IGremlinQuery<T> InE<T>(this IGremlinQuery query)
         {
             return query
-                // ReSharper disable once CoVariantArrayConversion
                 .AddStep<T>("inE", GetDerivedLabelNames<T>(query.Provider.Model));
         }

@@ -375,7 +371,6 @@
         public static IGremlinQuery<T> OutE<T>(this IGremlinQuery query)
         {
             return query
-                // ReSharper disable once CoVariantArrayConversion
                 .AddStep<T>("outE", GetDerivedLabelNames<T>(query.Provider.Model));
         }

@@ -389,7 +384,6 @@
         public static IGremlinQuery<Vertex> Out<T>(this IGremlinQuery query)
         {
             return query
-                // ReSharper disable once CoVariantArrayConversion
                 .AddStep<Vertex>("out", GetDerivedLabelNames<T>(query.Provider.Model));
         }


Resharper code

Resharper code

--- WinFormTemplate/FormMain.cs
+++ WinFormTemplate/FormMain.cs
@@ -36,10 +36,10 @@
       InitializeComponent();
     }

-    readonly Dictionary<string, string> languageDicoEn = new Dictionary<string, string>();
-    readonly Dictionary<string, string> languageDicoFr = new Dictionary<string, string>();
+    readonly Dictionary<string, string> _languageDicoEn = new Dictionary<string, string>();
+    readonly Dictionary<string, string> _languageDicoFr = new Dictionary<string, string>();
     private const string OneSpace = " ";
-    private string currentLanguage = "english";
+    private string _currentLanguage = "english";

     private void QuitToolStripMenuItem_Click(object sender, EventArgs e)
     {
@@ -92,8 +92,8 @@
                    };
       foreach (var i in result)
       {
-        languageDicoEn.Add(i.name, i.englishValue);
-        languageDicoFr.Add(i.name, i.frenchValue);
+        _languageDicoEn.Add(i.name, i.englishValue);
+        _languageDicoFr.Add(i.name, i.frenchValue);
       }
     }

@@ -274,13 +274,13 @@

     private void frenchToolStripMenuItem_Click(object sender, EventArgs e)
     {
-      currentLanguage = Language.French.ToString();
+      _currentLanguage = Language.French.ToString();
       SetLanguage(Language.French.ToString());
     }

     private void englishToolStripMenuItem_Click(object sender, EventArgs e)
     {
-      currentLanguage = Language.English.ToString();
+      _currentLanguage = Language.English.ToString();
       SetLanguage(Language.English.ToString());
     }

@@ -291,107 +291,110 @@
         case "English":
           frenchToolStripMenuItem.Checked = false;
           englishToolStripMenuItem.Checked = true;
-          fileToolStripMenuItem.Text = languageDicoEn["MenuFile"];
-          newToolStripMenuItem.Text = languageDicoEn["MenuFileNew"];
-          openToolStripMenuItem.Text = languageDicoEn["MenuFileOpen"];
-          saveToolStripMenuItem.Text = languageDicoEn["MenuFileSave"];
-          saveasToolStripMenuItem.Text = languageDicoEn["MenuFileSaveAs"];
-          printPreviewToolStripMenuItem.Text = languageDicoEn["MenuFilePrint"];
-          printPreviewToolStripMenuItem.Text = languageDicoEn["MenufilePageSetup"];
-          quitToolStripMenuItem.Text = languageDicoEn["MenufileQuit"];
-          editToolStripMenuItem.Text = languageDicoEn["MenuEdit"];
-          cancelToolStripMenuItem.Text = languageDicoEn["MenuEditCancel"];
-          redoToolStripMenuItem.Text = languageDicoEn["MenuEditRedo"];
-          cutToolStripMenuItem.Text = languageDicoEn["MenuEditCut"];
-          copyToolStripMenuItem.Text = languageDicoEn["MenuEditCopy"];
-          pasteToolStripMenuItem.Text = languageDicoEn["MenuEditPaste"];
-          selectAllToolStripMenuItem.Text = languageDicoEn["MenuEditSelectAll"];
-          toolsToolStripMenuItem.Text = languageDicoEn["MenuTools"];
-          personalizeToolStripMenuItem.Text = languageDicoEn["MenuToolsCustomize"];
-          optionsToolStripMenuItem.Text = languageDicoEn["MenuToolsOptions"];
-          languagetoolStripMenuItem.Text = languageDicoEn["MenuLanguage"];
-          englishToolStripMenuItem.Text = languageDicoEn["MenuLanguageEnglish"];
-          frenchToolStripMenuItem.Text = languageDicoEn["MenuLanguageFrench"];
-          helpToolStripMenuItem.Text = languageDicoEn["MenuHelp"];
-          summaryToolStripMenuItem.Text = languageDicoEn["MenuHelpSummary"];
-          indexToolStripMenuItem.Text = languageDicoEn["MenuHelpIndex"];
-          searchToolStripMenuItem.Text = languageDicoEn["MenuHelpSearch"];
-          aboutToolStripMenuItem.Text = languageDicoEn["MenuHelpAbout"];
-
-          currentLanguage = "English";
+          fileToolStripMenuItem.Text = _languageDicoEn["MenuFile"];
+          newToolStripMenuItem.Text = _languageDicoEn["MenuFileNew"];
+          openToolStripMenuItem.Text = _languageDicoEn["MenuFileOpen"];
+          saveToolStripMenuItem.Text = _languageDicoEn["MenuFileSave"];
+          saveasToolStripMenuItem.Text = _languageDicoEn["MenuFileSaveAs"];
+          printPreviewToolStripMenuItem.Text = _languageDicoEn["MenuFilePrint"];
+          printPreviewToolStripMenuItem.Text = _languageDicoEn["MenufilePageSetup"];
+          quitToolStripMenuItem.Text = _languageDicoEn["MenufileQuit"];
+          editToolStripMenuItem.Text = _languageDicoEn["MenuEdit"];
+          cancelToolStripMenuItem.Text = _languageDicoEn["MenuEditCancel"];
+          redoToolStripMenuItem.Text = _languageDicoEn["MenuEditRedo"];
+          cutToolStripMenuItem.Text = _languageDicoEn["MenuEditCut"];
+          copyToolStripMenuItem.Text = _languageDicoEn["MenuEditCopy"];
+          pasteToolStripMenuItem.Text = _languageDicoEn["MenuEditPaste"];
+          selectAllToolStripMenuItem.Text = _languageDicoEn["MenuEditSelectAll"];
+          toolsToolStripMenuItem.Text = _languageDicoEn["MenuTools"];
+          personalizeToolStripMenuItem.Text = _languageDicoEn["MenuToolsCustomize"];
+          optionsToolStripMenuItem.Text = _languageDicoEn["MenuToolsOptions"];
+          languagetoolStripMenuItem.Text = _languageDicoEn["MenuLanguage"];
+          englishToolStripMenuItem.Text = _languageDicoEn["MenuLanguageEnglish"];
+          frenchToolStripMenuItem.Text = _languageDicoEn["MenuLanguageFrench"];
+          helpToolStripMenuItem.Text = _languageDicoEn["MenuHelp"];
+          summaryToolStripMenuItem.Text = _languageDicoEn["MenuHelpSummary"];
+          indexToolStripMenuItem.Text = _languageDicoEn["MenuHelpIndex"];
+          searchToolStripMenuItem.Text = _languageDicoEn["MenuHelpSearch"];
+          aboutToolStripMenuItem.Text = _languageDicoEn["MenuHelpAbout"];
+
+          _currentLanguage = "English";
           break;
         case "French":
           frenchToolStripMenuItem.Checked = true;
           englishToolStripMenuItem.Checked = false;
-          fileToolStripMenuItem.Text = languageDicoFr["MenuFile"];
-          newToolStripMenuItem.Text = languageDicoFr["MenuFileNew"];
-          openToolStripMenuItem.Text = languageDicoFr["MenuFileOpen"];
-          saveToolStripMenuItem.Text = languageDicoFr["MenuFileSave"];
-          saveasToolStripMenuItem.Text = languageDicoFr["MenuFileSaveAs"];
-          printPreviewToolStripMenuItem.Text = languageDicoFr["MenuFilePrint"];
-          printPreviewToolStripMenuItem.Text = languageDicoFr["MenufilePageSetup"];
-          quitToolStripMenuItem.Text = languageDicoFr["MenufileQuit"];
-          editToolStripMenuItem.Text = languageDicoFr["MenuEdit"];
-          cancelToolStripMenuItem.Text = languageDicoFr["MenuEditCancel"];
-          redoToolStripMenuItem.Text = languageDicoFr["MenuEditRedo"];
-          cutToolStripMenuItem.Text = languageDicoFr["MenuEditCut"];
-          copyToolStripMenuItem.Text = languageDicoFr["MenuEditCopy"];
-          pasteToolStripMenuItem.Text = languageDicoFr["MenuEditPaste"];
-          selectAllToolStripMenuItem.Text = languageDicoFr["MenuEditSelectAll"];
-          toolsToolStripMenuItem.Text = languageDicoFr["MenuTools"];
-          personalizeToolStripMenuItem.Text = languageDicoFr["MenuToolsCustomize"];
-          optionsToolStripMenuItem.Text = languageDicoFr["MenuToolsOptions"];
-          languagetoolStripMenuItem.Text = languageDicoFr["MenuLanguage"];
-          englishToolStripMenuItem.Text = languageDicoFr["MenuLanguageEnglish"];
-          frenchToolStripMenuItem.Text = languageDicoFr["MenuLanguageFrench"];
-          helpToolStripMenuItem.Text = languageDicoFr["MenuHelp"];
-          summaryToolStripMenuItem.Text = languageDicoFr["MenuHelpSummary"];
-          indexToolStripMenuItem.Text = languageDicoFr["MenuHelpIndex"];
-          searchToolStripMenuItem.Text = languageDicoFr["MenuHelpSearch"];
-          aboutToolStripMenuItem.Text = languageDicoFr["MenuHelpAbout"];
-
-          currentLanguage = "French";
+          fileToolStripMenuItem.Text = _languageDicoFr["MenuFile"];
+          newToolStripMenuItem.Text = _languageDicoFr["MenuFileNew"];
+          openToolStripMenuItem.Text = _languageDicoFr["MenuFileOpen"];
+          saveToolStripMenuItem.Text = _languageDicoFr["MenuFileSave"];
+          saveasToolStripMenuItem.Text = _languageDicoFr["MenuFileSaveAs"];
+          printPreviewToolStripMenuItem.Text = _languageDicoFr["MenuFilePrint"];
+          printPreviewToolStripMenuItem.Text = _languageDicoFr["MenufilePageSetup"];
+          quitToolStripMenuItem.Text = _languageDicoFr["MenufileQuit"];
+          editToolStripMenuItem.Text = _languageDicoFr["MenuEdit"];
+          cancelToolStripMenuItem.Text = _languageDicoFr["MenuEditCancel"];
+          redoToolStripMenuItem.Text = _languageDicoFr["MenuEditRedo"];
+          cutToolStripMenuItem.Text = _languageDicoFr["MenuEditCut"];
+          copyToolStripMenuItem.Text = _languageDicoFr["MenuEditCopy"];
+          pasteToolStripMenuItem.Text = _languageDicoFr["MenuEditPaste"];
+          selectAllToolStripMenuItem.Text = _languageDicoFr["MenuEditSelectAll"];
+          toolsToolStripMenuItem.Text = _languageDicoFr["MenuTools"];
+          personalizeToolStripMenuItem.Text = _languageDicoFr["MenuToolsCustomize"];
+          optionsToolStripMenuItem.Text = _languageDicoFr["MenuToolsOptions"];
+          languagetoolStripMenuItem.Text = _languageDicoFr["MenuLanguage"];
+          englishToolStripMenuItem.Text = _languageDicoFr["MenuLanguageEnglish"];
+          frenchToolStripMenuItem.Text = _languageDicoFr["MenuLanguageFrench"];
+          helpToolStripMenuItem.Text = _languageDicoFr["MenuHelp"];
+          summaryToolStripMenuItem.Text = _languageDicoFr["MenuHelpSummary"];
+          indexToolStripMenuItem.Text = _languageDicoFr["MenuHelpIndex"];
+          searchToolStripMenuItem.Text = _languageDicoFr["MenuHelpSearch"];
+          aboutToolStripMenuItem.Text = _languageDicoFr["MenuHelpAbout"];
+
+          _currentLanguage = "French";
           break;
       }
     }

     private void cutToolStripMenuItem_Click(object sender, EventArgs e)
+    {
+      Control focusedControl = FindFocusedControl(new Control()); // replace new control by your control like tabControlMain
+      var tb = focusedControl as TextBox;
+      if (tb != null)
+      {
+        CutToClipboard(tb);
+      }
+    }
+
+    private void copyToolStripMenuItem_Click(object sender, EventArgs e)
+    {
+      Control focusedControl = FindFocusedControl(new Control()); // replace new control by your control like tabControlMain
+      var tb = focusedControl as TextBox;
+      if (tb != null)
+      {
+        CopyToClipboard(tb);
+      }
+    }
+
+    private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
+    {
+      Control focusedControl = FindFocusedControl(new Control()); // replace new control by your control like tabControlMain
+      var tb = focusedControl as TextBox;
+      if (tb != null)
+      {
+        PasteFromClipboard(tb);
+      }
+    }
+
+    private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
     {
       Control focusedControl = FindFocusedControl(new Control()); // replace new control by your control like tabControlMain
       if (focusedControl is TextBox)
       {
-        CutToClipboard((TextBox)focusedControl);
-      }
-    }
-
-    private void copyToolStripMenuItem_Click(object sender, EventArgs e)
-    {
-      Control focusedControl = FindFocusedControl(new Control()); // replace new control by your control like tabControlMain
-      if (focusedControl is TextBox)
-      {
-        CopyToClipboard((TextBox)focusedControl);
-      }
-    }
-
-    private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
-    {
-      Control focusedControl = FindFocusedControl(new Control()); // replace new control by your control like tabControlMain
-      if (focusedControl is TextBox)
-      {
-        PasteFromClipboard((TextBox)focusedControl);
-      }
-    }
-
-    private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
-    {
-      Control focusedControl = FindFocusedControl(new Control()); // replace new control by your control like tabControlMain
-      if (focusedControl is TextBox)
-      {
         //((TextBox)focusedControl).SelectAll;
       }
     }

-    private void CutToClipboard(TextBox tb, string errorMessage = "nothing")
+    private void CutToClipboard(TextBoxBase tb, string errorMessage = "nothing")
     {
       if (tb != ActiveControl) return;
       if (tb.Text == string.Empty)
@@ -450,14 +453,14 @@
     private string GetTranslatedString(string index)
     {
       string result = string.Empty;
-      switch (currentLanguage.ToLower())
+      switch (_currentLanguage.ToLower())
       {
         case "english":
-          result = languageDicoEn.ContainsKey(index) ? languageDicoEn[index] :
+          result = _languageDicoEn.ContainsKey(index) ? _languageDicoEn[index] :
            "the term: \"" + index + "\" has not been translated yet.\nPlease tell the developer to translate this term";
           break;
         case "french":
-          result = languageDicoFr.ContainsKey(index) ? languageDicoFr[index] :
+          result = _languageDicoFr.ContainsKey(index) ? _languageDicoFr[index] :
             "the term: \"" + index + "\" has not been translated yet.\nPlease tell the developer to translate this term";
           break;
       }


Minor changes in Logger

Minor changes in Logger

--- Yggdrasil/Logging/Logger.cs
+++ Yggdrasil/Logging/Logger.cs
@@ -10,11 +10,10 @@
 {
 	public sealed class Logger
 	{
+		private Regex _codeRegex = new Regex(@"\^[a-z]+[0-9]*;", RegexOptions.Compiled);
+
 		private static Dictionary<string, Logger> _loggers;
-
 		private List<LoggerTarget> _targets;
-
-		private Regex codeRegex = new Regex(@"\^[a-z]+[0-9]*;", RegexOptions.Compiled);

 		/// <summary>
 		/// Name of the logger.
@@ -95,6 +94,10 @@
 			return this;
 		}

+		/// <summary>
+		/// Returns list of all targets.
+		/// </summary>
+		/// <returns></returns>
 		public LoggerTarget[] GetTargets()
 		{
 			lock (_targets)
@@ -213,7 +216,7 @@
 						continue;

 					var messageRaw = string.Format(target.GetFormat(level), level, message);
-					var messageClean = codeRegex.Replace(messageRaw, "");
+					var messageClean = _codeRegex.Replace(messageRaw, "");

 					target.Write(level, message, messageRaw, messageClean);
 				}


Fix DrawVisualiser nullref.

Fix DrawVisualiser nullref.

--- osu.Framework/Graphics/DrawVisualiser.cs
+++ osu.Framework/Graphics/DrawVisualiser.cs
@@ -153,7 +153,7 @@
                 };

                 var sprite = Target as Sprite;
-                if (sprite != null)
+                if (sprite?.Texture != null)
                     previewBox = new Sprite(sprite.Texture) { Scale = new Vector2((float)sprite.Texture.Width / sprite.Texture.Height, 1) };
                 else
                     previewBox = new Box() { Colour = Color4.White };


Reduce default tolerance

Reduce default tolerance

--- osu.Game/Screens/Select/FilterControl.cs
+++ osu.Game/Screens/Select/FilterControl.cs
@@ -197,23 +197,23 @@
                 switch (key)
                 {
                     case "stars" when double.TryParse(value, out var stars):
-                        updateCriteriaRange(ref criteria.StarDifficulty, op, stars, 0.5);
+                        updateCriteriaRange(ref criteria.StarDifficulty, op, stars);
                         break;

                     case "ar" when double.TryParse(value, out var ar):
-                        updateCriteriaRange(ref criteria.ApproachRate, op, ar, 0.3);
+                        updateCriteriaRange(ref criteria.ApproachRate, op, ar);
                         break;

                     case "dr" when double.TryParse(value, out var dr):
-                        updateCriteriaRange(ref criteria.DrainRate, op, dr, 0.3);
+                        updateCriteriaRange(ref criteria.DrainRate, op, dr);
                         break;

                     case "cs" when double.TryParse(value, out var cs):
-                        updateCriteriaRange(ref criteria.CircleSize, op, cs, 0.3);
+                        updateCriteriaRange(ref criteria.CircleSize, op, cs);
                         break;

                     case "bpm" when double.TryParse(value, out var bpm):
-                        updateCriteriaRange(ref criteria.BPM, op, bpm, 0.3);
+                        updateCriteriaRange(ref criteria.BPM, op, bpm);
                         break;

                     case "length" when double.TryParse(value.TrimEnd('m', 's', 'h'), out var length):
@@ -239,7 +239,7 @@
             }
         }

-        private void updateCriteriaRange(ref FilterCriteria.OptionalRange range, string op, double value, double equalityToleration = 0)
+        private void updateCriteriaRange(ref FilterCriteria.OptionalRange range, string op, double value, double tolerance = 0.05)
         {
             switch (op)
             {
@@ -249,8 +249,8 @@
                 case "=":
                 case ":":
                     range.IsInclusive = true;
-                    range.Min = value - equalityToleration;
-                    range.Max = value + equalityToleration;
+                    range.Min = value - tolerance;
+                    range.Max = value + tolerance;
                     break;

                 case ">":


Fix crash with multiple range criterias

Fix crash with multiple range criterias

--- osu.Game/Screens/Select/FilterControl.cs
+++ osu.Game/Screens/Select/FilterControl.cs
@@ -235,7 +235,7 @@
                         break;
                 }

-                query = query.Remove(match.Index, match.Length);
+                query = query.Replace(match.ToString(), "");
             }
         }


Fix ki* textures having an incorrect vertical position

--- osu.Game/Skinning/LegacyHealthDisplay.cs
+++ osu.Game/Skinning/LegacyHealthDisplay.cs
@@ -80,7 +80,7 @@
                 Math.Clamp(Clock.ElapsedFrameTime, 0, 200),
                 fill.Width, (float)Current.Value * maxFillWidth, 0, 200, Easing.OutQuint);

-            marker.Position = fill.Position + new Vector2(fill.DrawWidth, fill.DrawHeight / 2);
+            marker.Position = fill.Position + new Vector2(fill.DrawWidth, 0);
         }

         public void Flash(JudgementResult result) => marker.Flash(result);


Better variable name

Better variable name

--- osu.Framework/Graphics/UserInterface/TextBox.cs
+++ osu.Framework/Graphics/UserInterface/TextBox.cs
@@ -577,11 +577,11 @@
             // as we are grabbing *all* waiting text, we may receive two or more characters.
             // each of these characters will still fire OnKeyDown events (which we want to block) so we need to
             // store our "handled" state until all keys are released.
-            handledText = true;
+            handledUserTextInput = true;
             return true;
         }

-        private bool handledText;
+        private bool handledUserTextInput;

         protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
         {
@@ -621,15 +621,14 @@
                     return true;
             }

-            return handledText;
+            return handledUserTextInput;
         }

         protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
         {
             HandlePendingText(state);

-            if (!state.Keyboard.Keys.Any())
-                handledText = false;
+            handledUserTextInput &= state.Keyboard.Keys.Any();

             return base.OnKeyUp(state, args);
         }


Correctly handle first display position

Correctly handle first display position

--- osu.Framework/Platform/Sdl/Sdl2WindowBackend.cs
+++ osu.Framework/Platform/Sdl/Sdl2WindowBackend.cs
@@ -80,7 +80,8 @@
             set
             {
                 position = value;
-                commandScheduler.Add(() => SDL.SDL_SetWindowPosition(SdlWindowHandle, value.X, value.Y));
+                if (SdlWindowHandle != IntPtr.Zero)
+                    commandScheduler.Add(() => SDL.SDL_SetWindowPosition(SdlWindowHandle, value.X, value.Y));
             }
         }

@@ -92,7 +93,8 @@
             set
             {
                 size = value;
-                commandScheduler.Add(() => SDL.SDL_SetWindowSize(SdlWindowHandle, value.Width, value.Height));
+                if (SdlWindowHandle != IntPtr.Zero)
+                    commandScheduler.Add(() => SDL.SDL_SetWindowSize(SdlWindowHandle, value.Width, value.Height));
             }
         }

@@ -129,6 +131,10 @@
             set
             {
                 initialWindowState = value;
+
+                if (SdlWindowHandle == IntPtr.Zero)
+                    return;
+
                 commandScheduler.Add(() =>
                 {
                     switch (value)
@@ -211,24 +217,21 @@
         public Display PrimaryDisplay => Displays.First();

         private Display currentDisplay;
-        private int initialDisplayIndex;
-        private int lastDisplayIndex;
+        private int lastDisplayIndex = -1;

         public Display CurrentDisplay
         {
-            get => currentDisplay ??= Displays.ElementAtOrDefault(SdlWindowHandle == IntPtr.Zero ? initialDisplayIndex : windowDisplayIndex);
-            set
-            {
-                initialDisplayIndex = value.Index;
-
+            get => currentDisplay ??= Displays.ElementAtOrDefault(SdlWindowHandle == IntPtr.Zero ? 0 : windowDisplayIndex);
+            set
+            {
                 if (value.Index == windowDisplayIndex)
                     return;

-                int x = value.Bounds.Left + value.Bounds.Width / 2 - Size.Width / 2;
-                int y = value.Bounds.Top + value.Bounds.Height / 2 - Size.Height / 2;
-
+                int x = value.Bounds.Left + value.Bounds.Width / 2 - size.Width / 2;
+                int y = value.Bounds.Top + value.Bounds.Height / 2 - size.Height / 2;
+
+                WindowState = WindowState.Normal;
                 Position = new Point(x, y);
-                WindowState = WindowState.Normal;
             }
         }

@@ -396,7 +399,6 @@
                                         WindowState.ToFlags();

             SdlWindowHandle = SDL.SDL_CreateWindow(Title, Position.X, Position.Y, Size.Width, Size.Height, flags);
-            // CurrentDisplayIndex = windowDisplayIndex;
             scale.Invalidate();
             Exists = true;
         }


update hand transparency

update hand transparency

--- NewtonVR/NVRHand.cs
+++ NewtonVR/NVRHand.cs
@@ -101,9 +101,9 @@

         private HTW.HTWHandController       m_handController;
         private HTW.HTWChildCollision []    m_handColliders;
-        private Material                    m_handMaterial;
-        private Texture                     m_handTexture;
-        private Color                       m_handAmbientColor;
+        //private Material                    m_handMaterial;
+        //private Texture                     m_handTexture;
+        //private Color                       m_handAmbientColor;

         public NVRInputDevice CurrentInputDevice
 		{
@@ -964,9 +964,9 @@

                 m_handController = gameObject.GetComponentInChildren<HTW.HTWHandController>();
                 m_handColliders = gameObject.GetComponentsInChildren<HTW.HTWChildCollision>();
-                m_handMaterial = m_handController.gameObject.GetComponentInChildren<Renderer>().material;
-                m_handTexture = m_handMaterial.mainTexture;
-                m_handAmbientColor = m_handMaterial.color;
+                //m_handMaterial = m_handController.gameObject.GetComponentInChildren<Renderer>().material;
+                //m_handTexture = m_handMaterial.mainTexture;
+                //m_handAmbientColor = m_handMaterial.color;
             }

             Player.RegisterHand(this);
@@ -1035,9 +1035,11 @@
         {
             if (m_handController != null)
             {
-                NVRHelpers.SetOpaque(m_handController.gameObject.GetComponentInChildren<Renderer>().material);
-                m_handMaterial.color = m_handAmbientColor;
-                m_handMaterial.mainTexture = m_handTexture;
+                m_handController.SetOpaque(true);
+
+                //NVRHelpers.SetOpaque(m_handController.gameObject.GetComponentInChildren<Renderer>().material);
+                //m_handMaterial.color = m_handAmbientColor;
+                //m_handMaterial.mainTexture = m_handTexture;
             }
         }

@@ -1045,10 +1047,12 @@
         {
             if (m_handController != null)
             {
-                Color transparentcolor = Color.white;
-                transparentcolor.a = (float)VisibilityLevel.Ghost / 100f;
-
-                NVRHelpers.SetTransparent(m_handController.gameObject.GetComponentInChildren<Renderer>().material, transparentcolor);
+                m_handController.SetOpaque(false);
+
+                //Color transparentcolor = Color.white;
+                //transparentcolor.a = (float)VisibilityLevel.Ghost / 100f;
+
+                //NVRHelpers.SetTransparent(m_handController.gameObject.GetComponentInChildren<Renderer>().material, transparentcolor);
             }
         }
     }


Count() -> Count

Count() -> Count

--- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs
+++ osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs
@@ -103,7 +103,7 @@
                     manager.Delete(imported.First());

                     Assert.IsTrue(manager.GetAllUsableBeatmapSets().Count == 0);
-                    Assert.IsTrue(manager.QueryBeatmapSets(_ => true).ToList().Count() == 1);
+                    Assert.IsTrue(manager.QueryBeatmapSets(_ => true).ToList().Count == 1);
                     Assert.IsTrue(manager.QueryBeatmapSets(_ => true).First().DeletePending);

                     temp = prepareTempCopy(osz_path);


Test that changing ruleset resets mods

Test that changing ruleset resets mods

--- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs
+++ osu.Game.Tests/Visual/TestCasePlaySongSelect.cs
@@ -8,11 +8,15 @@
 using System.Text;
 using NUnit.Framework;
 using osu.Framework.Allocation;
+using osu.Framework.Configuration;
 using osu.Framework.Extensions;
 using osu.Framework.MathUtils;
 using osu.Game.Beatmaps;
 using osu.Game.Database;
 using osu.Game.Rulesets;
+using osu.Game.Rulesets.Mods;
+using osu.Game.Rulesets.Osu.Mods;
+using osu.Game.Rulesets.Taiko;
 using osu.Game.Screens.Select;
 using osu.Game.Screens.Select.Carousel;
 using osu.Game.Screens.Select.Filter;
@@ -29,6 +33,10 @@
         private WorkingBeatmap defaultBeatmap;
         private DatabaseContextFactory factory;

+        [Cached]
+        [Cached(Type = typeof(IBindable<IEnumerable<Mod>>))]
+        private readonly Bindable<IEnumerable<Mod>> selectedMods = new Bindable<IEnumerable<Mod>>(new Mod[] { });
+
         public override IReadOnlyList<Type> RequiredTypes => new[]
         {
             typeof(SongSelect),
@@ -49,6 +57,8 @@

         private class TestSongSelect : PlaySongSelect
         {
+            public new Bindable<RulesetInfo> Ruleset => base.Ruleset;
+
             public WorkingBeatmap CurrentBeatmap => Beatmap.Value;
             public WorkingBeatmap CurrentBeatmapDetailsBeatmap => BeatmapDetails.Beatmap;
             public new BeatmapCarousel Carousel => base.Carousel;
@@ -143,10 +153,41 @@
             AddUntilStep(() => songSelect.Carousel.SelectedBeatmap == null, "no selection");
         }

+        [Test]
+        public void TestRulesetChangeResetsMods()
+        {
+            changeRuleset(0);
+
+            changeMods(new OsuModHardRock());
+
+            int actionIndex = 0;
+            int modChangeIndex = 0;
+            int rulesetChangeIndex = 0;
+
+            AddStep("change ruleset", () =>
+            {
+                songSelect.CurrentBeatmap.Mods.ValueChanged += onModChange;
+                songSelect.Ruleset.ValueChanged += onRulesetChange;
+
+                Ruleset.Value = new TaikoRuleset().RulesetInfo;
+
+                songSelect.CurrentBeatmap.Mods.ValueChanged -= onModChange;
+                songSelect.Ruleset.ValueChanged -= onRulesetChange;
+            });
+
+            AddAssert("mods changed before ruleset", () => modChangeIndex < rulesetChangeIndex);
+            AddAssert("empty mods", () => !selectedMods.Value.Any());
+
+            void onModChange(IEnumerable<Mod> mods) => modChangeIndex = actionIndex++;
+            void onRulesetChange(RulesetInfo ruleset) => rulesetChangeIndex = actionIndex--;
+        }
+
         private void importForRuleset(int id) => AddStep($"import test map for ruleset {id}", () => manager.Import(createTestBeatmapSet(getImportId(), rulesets.AvailableRulesets.Where(r => r.ID == id).ToArray())));

         private static int importId;
         private int getImportId() => ++importId;
+
+        private void changeMods(params Mod[] mods) => AddStep($"change mods to {string.Join(", ", mods.Select(m => m.ShortenedName))}", () => selectedMods.Value = mods);

         private void changeRuleset(int id) => AddStep($"change ruleset to {id}", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == id));


Visual adjustments

Visual adjustments

--- osu.Game/Graphics/UserInterface/PageSelector.cs
+++ osu.Game/Graphics/UserInterface/PageSelector.cs
@@ -13,6 +13,7 @@
 using osu.Game.Graphics.Containers;
 using System.Collections.Generic;
 using osu.Framework.Extensions.IEnumerableExtensions;
+using osuTK.Graphics;

 namespace osu.Game.Graphics.UserInterface
 {
@@ -100,38 +101,47 @@

         private abstract class PageItem : OsuHoverContainer
         {
-            private const int margin = 8;
+            private const int margin = 10;
             private const int height = 20;
+
+            protected override Container<Drawable> Content => contentContainer;
+
+            private readonly CircularContainer contentContainer;

             protected PageItem(string text)
             {
                 AutoSizeAxes = Axes.X;
                 Height = height;

-                var contentContainer = new CircularContainer
+                base.Content.Add(contentContainer = new CircularContainer
                 {
                     AutoSizeAxes = Axes.X,
                     RelativeSizeAxes = Axes.Y,
                     Masking = true,
-                };
+                });

                 var background = CreateBackground();
                 if (background != null)
-                    contentContainer.Add(background);
+                    Add(background);

                 var drawableText = CreateText(text);
                 if (drawableText != null)
                 {
                     drawableText.Margin = new MarginPadding { Horizontal = margin };
-                    contentContainer.Add(drawableText);
+                    Add(drawableText);
                 }
-
-                Add(contentContainer);
+            }
+
+            [BackgroundDependencyLoader]
+            private void load(OsuColour colours)
+            {
+                IdleColour = colours.Seafoam;
+                HoverColour = colours.Seafoam.Lighten(30f);
             }

             protected abstract Drawable CreateText(string text);

-            protected abstract Drawable CreateBackground();
+            protected virtual Drawable CreateBackground() => null;
         }

         private class DrawablePage : PageItem
@@ -144,44 +154,35 @@
                 : base(text)
             {
             }
-
-            protected override Drawable CreateBackground() => null;

             protected override Drawable CreateText(string text) => SpriteText = new SpriteText
             {
                 Anchor = Anchor.Centre,
                 Origin = Anchor.Centre,
                 Text = text,
+                Font = OsuFont.GetFont(size: 12),
+            };
+        }
+
+        private class SelectedPage : DrawablePage
+        {
+            private Box background;
+
+            protected override IEnumerable<Drawable> EffectTargets => new[] { background };
+
+            public SelectedPage(string text)
+                : base(text)
+            {
+            }
+
+            protected override Drawable CreateBackground() => background = new Box
+            {
+                RelativeSizeAxes = Axes.Both,
             };

             [BackgroundDependencyLoader]
             private void load(OsuColour colours)
             {
-                IdleColour = colours.Seafoam;
-                HoverColour = colours.Seafoam.Lighten(30f);
-            }
-        }
-
-        private class SelectedPage : DrawablePage
-        {
-            private Box background;
-
-            protected override IEnumerable<Drawable> EffectTargets => null;
-
-            public SelectedPage(string text)
-                : base(text)
-            {
-            }
-
-            protected override Drawable CreateBackground() => background = new Box
-            {
-                RelativeSizeAxes = Axes.Both,
-            };
-
-            [BackgroundDependencyLoader]
-            private void load(OsuColour colours)
-            {
-                background.Colour = colours.Seafoam;
                 SpriteText.Colour = colours.GreySeafoamDark;
             }
         }
@@ -196,11 +197,14 @@

         private class Button : PageItem
         {
+            private const int duration = 100;
+
             private Box background;
             private FillFlowContainer textContainer;
             private SpriteIcon icon;
-
-            protected override IEnumerable<Drawable> EffectTargets => new[] { background };
+            private readonly Box fadeBox;
+
+            protected override IEnumerable<Drawable> EffectTargets => new[] { textContainer };

             public Button(bool rightAligned, string text)
                 : base(text)
@@ -214,13 +218,29 @@
                 });

                 icon.Icon = alignment == Anchor.x2 ? FontAwesome.Solid.ChevronLeft : FontAwesome.Solid.ChevronRight;
+
+                Add(fadeBox = new Box
+                {
+                    RelativeSizeAxes = Axes.Both,
+                    Colour = Color4.Black.Opacity(100)
+                });
             }

             [BackgroundDependencyLoader]
             private void load(OsuColour colours)
             {
-                IdleColour = colours.GreySeafoamDark;
-                HoverColour = colours.GrayA;
+                background.Colour = colours.GreySeafoamDark;
+            }
+
+            protected override void LoadComplete()
+            {
+                base.LoadComplete();
+                Enabled.BindValueChanged(onEnabledChanged, true);
+            }
+
+            private void onEnabledChanged(ValueChangedEvent<bool> enabled)
+            {
+                fadeBox.FadeTo(enabled.NewValue ? 0 : 1, duration);
             }

             protected override Drawable CreateBackground() => background = new Box
@@ -231,16 +251,19 @@
             protected override Drawable CreateText(string text) => textContainer = new FillFlowContainer
             {
                 AutoSizeAxes = Axes.Both,
+                Anchor = Anchor.Centre,
+                Origin = Anchor.Centre,
                 Direction = FillDirection.Horizontal,
                 Children = new Drawable[]
                 {
                     new SpriteText
                     {
                         Text = text.ToUpper(),
+                        Font = OsuFont.GetFont(size: 12),
                     },
                     icon = new SpriteIcon
                     {
-                        Size = new Vector2(10),
+                        Size = new Vector2(8),
                     },
                 }
             };


Add prev/next buttons

Add prev/next buttons

--- osu.Game/Graphics/UserInterface/PageSelector.cs
+++ osu.Game/Graphics/UserInterface/PageSelector.cs
@@ -10,12 +10,13 @@
 using osu.Framework.Input.Events;
 using osu.Framework.Extensions.Color4Extensions;
 using System;
+using osuTK;

 namespace osu.Game.Graphics.UserInterface
 {
     public class PageSelector : CompositeDrawable
     {
-        public readonly BindableInt CurrentPage = new BindableInt();
+        public readonly BindableInt CurrentPage = new BindableInt(1);

         private readonly int maxPages;
         private readonly FillFlowContainer pillsFlow;
@@ -43,6 +44,11 @@
         private void redraw()
         {
             pillsFlow.Clear();
+
+            if (CurrentPage.Value == 1)
+                addPreviousPageButton();
+            else
+                addPreviousPageButton(() => CurrentPage.Value -= 1);

             if (CurrentPage.Value > 3)
                 addDrawablePage(1);
@@ -63,6 +69,11 @@

             if (CurrentPage.Value + 2 < maxPages)
                 addDrawablePage(maxPages);
+
+            if (CurrentPage.Value == maxPages)
+                addNextPageButton();
+            else
+                addNextPageButton(() => CurrentPage.Value += 1);
         }

         private void addDrawablePage(int page)
@@ -78,6 +89,16 @@
         private void addCurrentPagePill()
         {
             pillsFlow.Add(new SelectedPage(CurrentPage.Value.ToString()));
+        }
+
+        private void addPreviousPageButton(Action action = null)
+        {
+            pillsFlow.Add(new PreviousPageButton(action));
+        }
+
+        private void addNextPageButton(Action action = null)
+        {
+            pillsFlow.Add(new NextPageButton(action));
         }

         private abstract class DrawablePage : CompositeDrawable
@@ -86,6 +107,7 @@
             private const int margin = 8;

             protected readonly string Text;
+            protected readonly Drawable Content;

             protected DrawablePage(string text)
             {
@@ -99,10 +121,10 @@
                 if (background != null)
                     AddInternal(background);

-                var content = CreateContent();
-                content.Margin = new MarginPadding { Horizontal = margin };
-
-                AddInternal(content);
+                Content = CreateContent();
+                Content.Margin = new MarginPadding { Horizontal = margin };
+
+                AddInternal(Content);
             }

             protected abstract Drawable CreateContent();
@@ -112,25 +134,23 @@

         private abstract class ActivatedDrawablePage : DrawablePage
         {
-            private readonly Action action;
-
-            public ActivatedDrawablePage(string text, Action action)
+            protected readonly Action Action;
+
+            public ActivatedDrawablePage(string text, Action action = null)
                 : base(text)
             {
-                this.action = action;
+                Action = action;
             }

             protected override bool OnClick(ClickEvent e)
             {
-                action?.Invoke();
+                Action?.Invoke();
                 return base.OnClick(e);
             }
         }

         private class Page : ActivatedDrawablePage
         {
-            private SpriteText text;
-
             private OsuColour colours;

             public Page(string text, Action action)
@@ -142,22 +162,22 @@
             private void load(OsuColour colours)
             {
                 this.colours = colours;
-                text.Colour = colours.Seafoam;
+                Content.Colour = colours.Seafoam;
             }

             protected override bool OnHover(HoverEvent e)
             {
-                text.Colour = colours.Seafoam.Lighten(30f);
+                Content.Colour = colours.Seafoam.Lighten(30f);
                 return base.OnHover(e);
             }

             protected override void OnHoverLost(HoverLostEvent e)
             {
-                text.Colour = colours.Seafoam;
+                Content.Colour = colours.Seafoam;
                 base.OnHoverLost(e);
             }

-            protected override Drawable CreateContent() => text = new SpriteText
+            protected override Drawable CreateContent() => new SpriteText
             {
                 Anchor = Anchor.Centre,
                 Origin = Anchor.Centre,
@@ -167,8 +187,6 @@

         private class SelectedPage : DrawablePage
         {
-            private SpriteText text;
-
             private Box background;

             public SelectedPage(string text)
@@ -179,11 +197,11 @@
             [BackgroundDependencyLoader]
             private void load(OsuColour colours)
             {
-                text.Colour = colours.GreySeafoam;
+                Content.Colour = colours.GreySeafoam;
                 background.Colour = colours.Seafoam;
             }

-            protected override Drawable CreateContent() => text = new SpriteText
+            protected override Drawable CreateContent() => new SpriteText
             {
                 Anchor = Anchor.Centre,
                 Origin = Anchor.Centre,
@@ -203,8 +221,6 @@

         private class Placeholder : DrawablePage
         {
-            private SpriteText text;
-
             public Placeholder()
                 : base("...")
             {
@@ -213,14 +229,160 @@
             [BackgroundDependencyLoader]
             private void load(OsuColour colours)
             {
-                text.Colour = colours.Seafoam;
-            }
-
-            protected override Drawable CreateContent() => text = new SpriteText
+                Content.Colour = colours.Seafoam;
+            }
+
+            protected override Drawable CreateContent() => new SpriteText
             {
                 Anchor = Anchor.Centre,
                 Origin = Anchor.Centre,
                 Text = Text
+            };
+        }
+
+        private class PreviousPageButton : ActivatedDrawablePage
+        {
+            private OsuColour colours;
+            private Box background;
+
+            public PreviousPageButton(Action action)
+                : base("prev", action)
+            {
+            }
+
+            [BackgroundDependencyLoader]
+            private void load(OsuColour colours)
+            {
+                this.colours = colours;
+                Content.Colour = colours.Seafoam;
+                background.Colour = colours.GreySeafoam;
+
+                if (Action == null)
+                {
+                    Content.FadeColour(colours.GrayA);
+                    background.FadeColour(colours.GrayA);
+                }
+            }
+
+            protected override bool OnHover(HoverEvent e)
+            {
+                Content.Colour = colours.Seafoam.Lighten(30f);
+                return base.OnHover(e);
+            }
+
+            protected override void OnHoverLost(HoverLostEvent e)
+            {
+                Content.Colour = colours.Seafoam;
+                base.OnHoverLost(e);
+            }
+
+            protected override Drawable CreateContent() => new FillFlowContainer
+            {
+                Anchor = Anchor.Centre,
+                Origin = Anchor.Centre,
+                AutoSizeAxes = Axes.X,
+                RelativeSizeAxes = Axes.Y,
+                Direction = FillDirection.Horizontal,
+                Spacing = new Vector2(3),
+                Children = new Drawable[]
+                {
+                    new SpriteIcon
+                    {
+                        Anchor = Anchor.CentreLeft,
+                        Origin = Anchor.CentreLeft,
+                        Icon = FontAwesome.Solid.CaretLeft,
+                        Size = new Vector2(10),
+                    },
+                    new SpriteText
+                    {
+                        Anchor = Anchor.CentreLeft,
+                        Origin = Anchor.CentreLeft,
+                        Text = Text.ToUpper(),
+                    }
+                }
+            };
+
+            protected override Drawable CreateBackground() => new CircularContainer
+            {
+                RelativeSizeAxes = Axes.Both,
+                Masking = true,
+                Child = background = new Box
+                {
+                    RelativeSizeAxes = Axes.Both,
+                }
+            };
+        }
+
+        private class NextPageButton : ActivatedDrawablePage
+        {
+            private OsuColour colours;
+            private Box background;
+
+            public NextPageButton(Action action)
+                : base("next", action)
+            {
+            }
+
+            [BackgroundDependencyLoader]
+            private void load(OsuColour colours)
+            {
+                this.colours = colours;
+                Content.Colour = colours.Seafoam;
+                background.Colour = colours.GreySeafoam;
+
+                if (Action == null)
+                {
+                    Content.FadeColour(colours.GrayA);
+                    background.FadeColour(colours.GrayA);
+                }
+            }
+
+            protected override bool OnHover(HoverEvent e)
+            {
+                Content.Colour = colours.Seafoam.Lighten(30f);
+                return base.OnHover(e);
+            }
+
+            protected override void OnHoverLost(HoverLostEvent e)
+            {
+                Content.Colour = colours.Seafoam;
+                base.OnHoverLost(e);
+            }
+
+            protected override Drawable CreateContent() => new FillFlowContainer
+            {
+                Anchor = Anchor.Centre,
+                Origin = Anchor.Centre,
+                AutoSizeAxes = Axes.X,
+                RelativeSizeAxes = Axes.Y,
+                Direction = FillDirection.Horizontal,
+                Spacing = new Vector2(3),
+                Children = new Drawable[]
+                {
+                    new SpriteText
+                    {
+                        Anchor = Anchor.CentreLeft,
+                        Origin = Anchor.CentreLeft,
+                        Text = Text.ToUpper(),
+                    },
+                    new SpriteIcon
+                    {
+                        Anchor = Anchor.CentreLeft,
+                        Origin = Anchor.CentreLeft,
+                        Icon = FontAwesome.Solid.CaretRight,
+                        Size = new Vector2(10),
+                    },
+                }
+            };
+
+            protected override Drawable CreateBackground() => new CircularContainer
+            {
+                RelativeSizeAxes = Axes.Both,
+                Masking = true,
+                Child = background = new Box
+                {
+                    RelativeSizeAxes = Axes.Both,
+                }
             };
         }
     }


Added constructor with empty user

Added constructor with empty user

--- src/biz.dfch.CS.CoffeeTracker.Core/Model/ApplicationUser.cs
+++ src/biz.dfch.CS.CoffeeTracker.Core/Model/ApplicationUser.cs
@@ -30,6 +30,11 @@
             this.IsAdmin = false;
         }

+        public ApplicationUser()
+        {
+            IsAdmin = false;
+        }
+
         [Required]
         public string Password { get; set; }


experimental

experimental

--- src/biz.dfch.CS.Entity.LifeCycleManager/LifeCycleManager.cs
+++ src/biz.dfch.CS.Entity.LifeCycleManager/LifeCycleManager.cs
@@ -28,7 +28,7 @@

         public LifeCycleManager()
         {
-            _stateMachine = new StateMachine.StateMachine();
+
         }
     }
 }


[Glue] Added SetVariableValue method to make working with NamedObjects a little easier.


Update census ref test

Update census ref test

--- FTAnalyser/FactDateTest/CensusReferenceTest.cs
+++ FTAnalyser/FactDateTest/CensusReferenceTest.cs
@@ -78,7 +78,7 @@
             CensusHO107Test("Database online. Class: HO107; Piece 709; Book: 6; Civil Parish: StLeonard Shoreditch; County: Middlesex; Enumeration District: 19;Folio: 53; Page: 15; Line: 16; GSU roll: 438819.", CensusDate.UKCENSUS1841, "709", "6", "53", "15");
             CensusHO107Test("HO107, Piece 704, Folio 11, Page  14", CensusDate.UKCENSUS1841, "704", string.Empty, "11", "14");
             CensusHO107Test("Database online. Class: HO107; Piece: 1782; Folio: 719; Page: 25; GSU", CensusDate.UKCENSUS1851, "1782", string.Empty, "719", "25");
-            CensusHO107Test(@" Bethnal Green, folio 10/9, page 11, Caroline Shaboe; digital images, \i FindMyPast.co.uk\i0  (https://search.findmypast.co.uk/search-world-Records/1841-england-wales-and-scotland-census : accessed 29 Dec 2009); citing PRO HO/107/692", CensusDate.UKCENSUS1841, "692", "9", "10", "11");
+            CensusHO107Test(@" Bethnal Green, folio 10/9, page 11, Caroline Shaboe; digital images, \i FindMyPast.co.uk\i0  (https://search.findmypast.co.uk/search-world-Records/1841-england-wales-and-scotland-census : accessed 29 Dec 2009); citing PRO HO/107/692", CensusDate.UKCENSUS1841, "692", "10", "9", "11");
             CensusHO107Test(@"Leeds, Yorkshire, folio 9, page 10, John Knowling; digital images, \i FindMyPast.co.uk\i0 (https://search.findmypast.co.uk/search-world-Records/1841-england-wales-and-scotland-census : accessed 20 Oct 2017); citing PRO HO/107/1345", CensusDate.UKCENSUS1841, "1345", "", "9", "10");
             CensusHO107Test("HO107/797/10 f6 p5", CensusDate.UKCENSUS1841, "797", "10", "6", "5");
             CensusHO107Test("Archive reference HO107 Piece number 142 Book number 10 Folio number 51 Page number 1 Record set 1841 England, Wales & Scotland Census", CensusDate.UKCENSUS1841, "142", "10", "51", "1");


Deserialize nullable with null value

Deserialize nullable with null value

When the type being deserialized has an string value it return de default value of the underlying type instead of null

--- FileContextCore/Serializer/SerializerHelper.cs
+++ FileContextCore/Serializer/SerializerHelper.cs
@@ -13,12 +13,12 @@
     {
         public static object Deserialize(this string input, Type type)
         {
-	        type = Nullable.GetUnderlyingType(type) ?? type;
-
             if (string.IsNullOrEmpty(input))
             {
                 return type.GetDefaultValue();
             }
+
+	    type = Nullable.GetUnderlyingType(type) ?? type;

             if (type == typeof(DateTimeOffset))
             {


Add some minor log rows

Add some minor log rows

--- GitMind/RepositoryViews/RepositoryViewModel.cs
+++ GitMind/RepositoryViews/RepositoryViewModel.cs
@@ -599,6 +599,7 @@
 				if (!ignoreTopIndex && commitPosition.Index == 0)
 				{
 					// The index was 0 (top) lest ensure the index remains 0 again
+					Log.Warn("Scroll to 0 since first position was 0");
 					ScrollTo(0);
 					if (Commits.Any())
 					{
@@ -623,6 +624,7 @@
 				}
 			}

+			Log.Warn("Scroll to 0");
 			ScrollTo(0);
 			if (Commits.Any())
 			{


Put an else {} around the new code so that it doesn't run if the previous check succeeded

--- InWorldz/InWorldz.Phlox.Engine/LSLSystemAPI.cs
+++ InWorldz/InWorldz.Phlox.Engine/LSLSystemAPI.cs
@@ -4363,11 +4363,14 @@
                     {
                         implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION;
                     }
-                    ScenePresence.PositionInfo info = presence.GetPosInfo();
-                    if(info.Parent != null && info.Parent.ObjectOwner == m_host.OwnerID)
-                    {
-                        implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION;
-                    }
+                    else
+                    {
+						ScenePresence.PositionInfo info = presence.GetPosInfo();
+						if(info.Parent != null && info.Parent.ObjectOwner == m_host.OwnerID)
+						{
+							implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION;
+						}
+					}
                 }
             }


Relative path fix

Relative path fix

--- samples/WebApp/Views/Shared/_Layout.cshtml
+++ samples/WebApp/Views/Shared/_Layout.cshtml
@@ -4,9 +4,9 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>@ViewData["Title"] - WebApp</title>
-    <link rel="stylesheet" href="/sample/css/bootstrap.min.css">
-    <link rel="stylesheet" href="/sample/css/styles.min.css?v=kV71e_YcyYBN1q9bxoNObvVLErsCB5_N75krHUEhDs8">
-    <link href="/embedded/lib/img/favicon.ico" rel="shortcut icon">
+    <link rel="stylesheet" href="~/sample/css/bootstrap.min.css">
+    <link rel="stylesheet" href="~/sample/css/styles.min.css?v=kV71e_YcyYBN1q9bxoNObvVLErsCB5_N75krHUEhDs8">
+    <link href="~/embedded/lib/img/favicon.ico" rel="shortcut icon">

 </head>
 <body>