added another optimization to cursorExtensions

Former-commit-id: c0ad32c22ba1a6130542034ebc59b794110e0c37

--- MeTLMeeting/SandRibbon/Utils/CursorExtensions.cs
+++ MeTLMeeting/SandRibbon/Utils/CursorExtensions.cs
@@ -43,17 +43,18 @@
                         {
                             //Tell me please that there's a faster way of doing this!
                             var Color = System.Drawing.Color.FromArgb((int)pixels[(y * width) + x]);
-                            if (Color.A == 0)
+                            if (Color.A == 0 || Color.A == 255)
                             {
                                 bitmap.SetPixel(x, y, Color);
                             }
                             else
                             {
+                                var Alpha = Color.A;
                                 double PreMult = Color.A / 255;
                                 var Red = ((byte)(Color.R * PreMult));
                                 var Green = ((byte)(Color.G * PreMult));
                                 var Blue = ((byte)(Color.B * PreMult));
-                                var colorString = new Color { A = (byte)Color.A, R = (byte)Red, G = (byte)Green, B = (byte)Blue }.ToString();
+                                var colorString = new Color { A = (byte)Alpha, R = (byte)Red, G = (byte)Green, B = (byte)Blue }.ToString();
                                 var newColor = (System.Drawing.Color)converter.ConvertFromString(colorString);
                                 bitmap.SetPixel(x, y, newColor);
                             }
@@ -88,6 +89,8 @@
             Cursor cursor = null;
             App.Current.Dispatcher.adopt(() =>
             {
+                if (fe.Height < 1) fe.Height = 1;
+                if (fe.Width < 1) fe.Width = 1;
                 var grid = new System.Windows.Controls.Grid
                 {
                     Height = 128,
@@ -122,7 +125,7 @@
                     Width = pen.Width,
                     Fill = colour,
                     Stroke = colour,
-                    StrokeThickness = 1,
+                    StrokeThickness = 2,
                     StrokeLineJoin = PenLineJoin.Round,
                     HorizontalAlignment = HorizontalAlignment.Center,
                     VerticalAlignment = VerticalAlignment.Center


Update HttpInListener.cs (#315)

Update HttpInListener.cs (#315)

--- src/OpenTelemetry.Collector.AspNetCore/Implementation/HttpInListener.cs
+++ src/OpenTelemetry.Collector.AspNetCore/Implementation/HttpInListener.cs
@@ -53,7 +53,7 @@

             var request = context.Request;

-            // see the spec https://github.com/open-telemetry/OpenTelemetry-specs/blob/master/trace/HTTP.md
+            // see the spec https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-semantic-conventions.md
             var path = (request.PathBase.HasValue || request.Path.HasValue) ? (request.PathBase + request.Path).ToString() : "/";

             ISpan span;


returning one task

returning one task

--- src/TeamTasker.Web/TeamTasker.Web/Controllers/TasksController.cs
+++ src/TeamTasker.Web/TeamTasker.Web/Controllers/TasksController.cs
@@ -59,7 +59,7 @@
                             DueDate = t.DueDate,
                             Instructions = t.Instructions,
                             AssignedMembers = t.AssignedMembers.Select(m => new { m.Name }).ToList()
-                        });
+                        }).Single();

             return Json(task, JsonRequestBehavior.AllowGet);
         }


fix for CS1998: This async method lacks 'await' in tests. (#606)

* fix for CS1998: This async method lacks 'await' in tests.

* task: Update Microsoft.Sourcelink.Github to v1

* Attempting to fix build error: Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly

--- src/Shouldly.Tests/ShouldThrow/FuncOfTaskWhichThrowsDirectlyScenario.cs
+++ src/Shouldly.Tests/ShouldThrow/FuncOfTaskWhichThrowsDirectlyScenario.cs
@@ -38,17 +38,17 @@
         }

         [Fact]
-        public void ShouldPassTimeoutExceptionAsync()
+        public async Task ShouldPassTimeoutExceptionAsync()
         {
-            var task = new Func<Task>(async () => { throw new TimeoutException(); });
-            task.ShouldThrow<TimeoutException>();
+            var task = new Func<Task>(async () => { await Task.FromException(new TimeoutException()); });
+            await Task.FromResult(task.ShouldThrow<TimeoutException>());
         }

         [Fact]
-        public void ShouldPassTimeoutExceptionAsync_ExceptionTypePassedIn()
+        public async Task ShouldPassTimeoutExceptionAsync_ExceptionTypePassedIn()
         {
-            var task = new Func<Task>(async () => { throw new TimeoutException(); });
-            task.ShouldThrow(typeof(TimeoutException));
+            var task = new Func<Task>(async () => { await Task.FromException(new TimeoutException()); });
+            await Task.FromResult(task.ShouldThrow(typeof(TimeoutException)));
         }
     }
 }


add an "obsolete" tag for obsolete tanks

--- src/Smellyriver.TankInspector.Pro/Repository/BigworldXmlPreprocessor.cs
+++ src/Smellyriver.TankInspector.Pro/Repository/BigworldXmlPreprocessor.cs
@@ -60,8 +60,7 @@

                         if (e.Element("shortUserString") == null)
                         {
-                            var userStringElement = e.Element("userString");
-                            Debug.Assert(userStringElement != null, "userStringElement!=null");
+                            var userStringElement = e.ExistedElement("userString");
                             e.Add(new XElement(userStringElement) { Name = "shortUserString" });
                         }

@@ -707,6 +706,7 @@
                     {
                         var tankKey = tank.Attribute("key").Value;
                         var tankElement = tankElements[tankKey];
+                        var maybeObsolete = tankElement.ExistedElement("price").ExistedAttribute("currency").Value != "gold";

                         var successorsElement = new XElement("successors");
                         string[] successors;
@@ -717,6 +717,7 @@
                                 var successorElement = new XElement("successor");
                                 successorElement.SetAttributeValue("key", successor);
                                 successorsElement.Add(successorElement);
+                                maybeObsolete = false;
                             }
                         }
                         tankElement.Add(successorsElement);
@@ -730,9 +731,19 @@
                                 var predecessorElement = new XElement("predecessor");
                                 predecessorElement.SetAttributeValue("key", predecessor);
                                 predecessorsElement.Add(predecessorElement);
+                                maybeObsolete = false;
                             }
                         }
                         tankElement.Add(predecessorsElement);
+
+                        if (maybeObsolete)
+                        {
+                            var secretTags = tankElement.ExistedElement("secretTags");
+                            if (!secretTags.Elements().Any())
+                            {
+                                secretTags.Add(new XElement("tag", "obsolete"));
+                            }
+                        }
                     });
                 });


Fix compiler tests.

Fix compiler tests.

--- src/TypeScriptBinding.Tests/Hosting/TypeScriptCompilerArgumentsTests.cs
+++ src/TypeScriptBinding.Tests/Hosting/TypeScriptCompilerArgumentsTests.cs
@@ -20,7 +20,7 @@
 		{
 			properties = new Properties();
 			options = new TypeScriptOptions(properties);
-			options.IncludeComments = false;
+			options.IncludeComments = true;
 			options.GenerateSourceMap = false;
 			options.EcmaScriptTargetVersion = "";
 			options.ModuleKind = "";
@@ -108,15 +108,15 @@
 		}

 		[Test]
-		public void GetArguments_IncludeComments_CommentsArgAdded()
+		public void GetArguments_IncludeCommentsIsFalse_RemoteCommentsArgAdded()
 		{
 			CreateCommandLine();
 			AddTypeScriptFiles("a.ts");
-			options.IncludeComments = true;
+			options.IncludeComments = false;

 			string[] arguments = commandLine.GetArguments();

-			AssertArgsAreEqual(arguments, "--comments", "a.ts");
+			AssertArgsAreEqual(arguments, "--removeComments", "a.ts");
 		}

 		[Test]


Code distance calculation algorithm was improved

--- src/WaveletCodesTools/FixedDistanceCodesFactory/StandardCodesFactory.cs
+++ src/WaveletCodesTools/FixedDistanceCodesFactory/StandardCodesFactory.cs
@@ -35,11 +35,14 @@
             var codewordLength = generatingPolynomial.Field.Order - 1;
             var informationWordLength = codewordLength % 2 == 0 ? codewordLength / 2 : (codewordLength - 1) / 2;

-            var codeDistance = 1;
+            var codeDistance = 0;
             var field = generatingPolynomial.Field;
-            for (var i = 0;
-                i < codewordLength && generatingPolynomial.Evaluate(field.GetGeneratingElementPower(i)) == 0;
-                i++, codeDistance++) ;
+            for (var i = 0; i < codewordLength; i++)
+            {
+                var zerosCount = 0;
+                for (; i < codewordLength && generatingPolynomial.Evaluate(field.GetGeneratingElementPower(i)) == 0; i++, zerosCount++) ;
+                codeDistance = Math.Max(codeDistance, zerosCount + 1);
+            }
             if (codeDistance <= 1
                 || codewordLength % 2 == 0 && codeDistance > codewordLength / 2 + 1
                 || codewordLength % 2 == 1 && codeDistance > (codewordLength + 1) / 2 + 1)


Update the bonus off movies as well.

Update the bonus off movies as well.

--- MoviePicker.WebApp/Controllers/HomeController.cs
+++ MoviePicker.WebApp/Controllers/HomeController.cs
@@ -118,7 +118,6 @@

 					foreach (var movie in miner.Picks.Movies)
 					{
-						//var fmlMovie = fmlMovies.FirstOrDefault(item => item.MovieName == movie.MovieName);
 						var fmlMovie = fmlMovies.FirstOrDefault(item => item.Equals(movie));

 						if (fmlMovie != null)
@@ -129,11 +128,11 @@

 					foreach (var movie in miner.PicksBonusOff.Movies)
 					{
-						var baseMovie = fmlMovies.FirstOrDefault(item => item.MovieName == movie.MovieName);
-
-						if (baseMovie != null)
+						var fmlMovie = fmlMovies.FirstOrDefault(item => item.Equals(movie));
+
+						if (fmlMovie != null)
 						{
-							movie.ImageUrl = baseMovie.ImageUrl;
+							movie.ImageUrl = fmlMovie.ImageUrl;
 						}
 					}


unit tests for deleting a repo

unit tests for deleting a repo

--- Octokit.Tests/Clients/RepositoriesClientTests.cs
+++ Octokit.Tests/Clients/RepositoriesClientTests.cs
@@ -94,6 +94,29 @@
             }
         }

+        public class TheDeleteMethod
+        {
+            [Fact]
+            public async Task EnsuresNonNullArguments()
+            {
+                var repositoriesClient = new RepositoriesClient(Substitute.For<IApiConnection<Repository>>());
+
+                await AssertEx.Throws<ArgumentNullException>(async () => await repositoriesClient.Delete(null, "aRepoName"));
+                await AssertEx.Throws<ArgumentNullException>(async () => await repositoriesClient.Delete("anOwner", null));
+            }
+
+            [Fact]
+            public async Task RequestsCorrectUrl()
+            {
+                var client = Substitute.For<IApiConnection<Repository>>();
+                var repositoriesClient = new RepositoriesClient(client);
+
+                await repositoriesClient.Delete("theOwner", "theRepoName");
+
+                client.Received().Delete(Arg.Is<Uri>(u => u.ToString() == "/repos/theOwner/theRepoName"));
+            }
+        }
+
         public class TheGetMethod
         {
             [Fact]


Fixed some more VV-related bugs

Fixed some more VV-related bugs

--- OpenUtau.Plugin.Builtin/ENDeltaVer2Phonemizer.cs
+++ OpenUtau.Plugin.Builtin/ENDeltaVer2Phonemizer.cs
@@ -84,6 +84,14 @@
                     basePhoneme = $"@ {v}";
                 } else if (v == "V" && !HasOto($"{prevV} V", syllable.vowelTone) && HasOto($"{prevV} @", syllable.vowelTone)) {
                     basePhoneme = $"{prevV} @";
+                } else if (prevV == "E" && !HasOto($"E {v}", syllable.vowelTone) && HasOto($"e {v}", syllable.vowelTone)) {
+                    basePhoneme = $"e {v}";
+                } else if (v == "E" && !HasOto($"{prevV} E", syllable.vowelTone) && HasOto($"{prevV} e", syllable.vowelTone)) {
+                    basePhoneme = $"{prevV} e";
+                } else if (prevV == "o" && !HasOto($"o {v}", syllable.vowelTone) && HasOto($"O {v}", syllable.vowelTone)) {
+                    basePhoneme = $"O {v}";
+                } else if (v == "o" && !HasOto($"{prevV} o", syllable.vowelTone) && HasOto($"{prevV} O", syllable.vowelTone)) {
+                    basePhoneme = $"{prevV} O";
                 } else if (!HasOto($"{prevV} {v}", syllable.vowelTone)) {
                     basePhoneme = $"{v}";
                 }
@@ -94,6 +102,10 @@
                     basePhoneme = rcv;
                 } else if (v == "V" && !HasOto(rcv, syllable.vowelTone) && HasOto($"- {cc[0]}@", syllable.vowelTone)) {
                     basePhoneme = $"- {cc[0]}@";
+                } else if (v == "E" && !HasOto(rcv, syllable.vowelTone) && HasOto($"- {cc[0]}e", syllable.vowelTone)) {
+                    basePhoneme = $"- {cc[0]}e";
+                } else if (v == "o" && !HasOto(rcv, syllable.vowelTone) && HasOto($"- {cc[0]}O", syllable.vowelTone)) {
+                    basePhoneme = $"- {cc[0]}O";
                 } else {
                     basePhoneme = $"{cc[0]}{v}";
                     if (consonants.Contains(cc[0])) {
@@ -137,6 +149,12 @@
                 } else if (prevV == "V" && !HasOto($"V {cc[0]}", syllable.vowelTone) && !HasOto(vcv, syllable.vowelTone) && !HasOto(vccv, syllable.vowelTone) && HasOto($"@ {string.Join("", cc)}", syllable.vowelTone)) {
                     basePhoneme = $"{cc.Last()}{v}";
                     phonemes.Add($"@ {string.Join("", cc)}");
+                } else if (prevV == "E" && !HasOto($"E {cc[0]}", syllable.vowelTone) && !HasOto(vcv, syllable.vowelTone) && !HasOto(vccv, syllable.vowelTone) && HasOto($"e {string.Join("", cc)}", syllable.vowelTone)) {
+                    basePhoneme = $"{cc.Last()}{v}";
+                    phonemes.Add($"e {string.Join("", cc)}");
+                } else if (prevV == "o" && !HasOto($"o {cc[0]}", syllable.vowelTone) && !HasOto(vcv, syllable.vowelTone) && !HasOto(vccv, syllable.vowelTone) && HasOto($"O {string.Join("", cc)}", syllable.vowelTone)) {
+                    basePhoneme = $"{cc.Last()}{v}";
+                    phonemes.Add($"O {string.Join("", cc)}");
                 } else {
                     // try CCV
                     basePhoneme = cc.Last() + v;
@@ -245,6 +263,10 @@
                     phonemes.Add(vcr);
                 } else if (v == "V" && !HasOto(vcr, ending.tone) && HasOto($"@ {cc[0]}-", ending.tone)) {
                     phonemes.Add($"@ {cc[0]}-");
+                } else if (v == "E" && !HasOto(vcr, ending.tone) && HasOto($"e {cc[0]}-", ending.tone)) {
+                    phonemes.Add($"e {cc[0]}-");
+                } else if (v == "o" && !HasOto(vcr, ending.tone) && HasOto($"O {cc[0]}-", ending.tone)) {
+                    phonemes.Add($"O {cc[0]}-");
                 } else {
                     phonemes.Add($"{v} {cc[0]}");
                     if (burstConsonants.Contains(cc[0])) {
@@ -308,6 +330,12 @@
             {
                 alias = alias.Replace(vowel, "@");
             }
+            foreach (var vowel in new[] { "E" }) {
+                alias = alias.Replace(vowel, "e");
+            }
+            foreach (var vowel in new[] { "o" }) {
+                alias = alias.Replace(vowel, "O");
+            }
             return alias;
         }


vccv validate word fix

vccv validate word fix

--- OpenUtau.Plugin.Builtin/RussianVCCVPhonemizer.cs
+++ OpenUtau.Plugin.Builtin/RussianVCCVPhonemizer.cs
@@ -11,7 +11,7 @@
         private readonly string[] vowels = "a,e,o,u,y,i,M,N,ex,ax,x".Split(",");
         private readonly string[] consonants = "sh',sh,zh,j,ts,ch,b',b,v',v,g',g,d',d,z',z,k',k,l',l,m',m,n',n,p',p,r',r,s',s,t',t,f',f,h',h".Split(",");
         private readonly string[] burstConsonants = "t,t',k,k',p,p',ch,ts,b,b',g,g',d,d'".Split(",");
-        private readonly Dictionary<string, string> dictionaryReplacements = ("a=ax;aa=a;ay=ax;b=b;bb=b';c=ts;ch=ch;d=d;dd=d';ee=e;" +
+        private readonly Dictionary<string, string> dictionaryReplacements = ("a=ax;aa=a;ay=a;b=b;bb=b';c=ts;ch=ch;d=d;dd=d';ee=e;" +
             "f=f;ff=f';g=g;gg=g';h=h;hh=h';i=x;ii=i;j=j;ja=a;je=e;jo=o;ju=u;k=k;kk=k';l=l;ll=l';m=m;mm=m';n=n;nn=n';oo=o;ae=e;" +
             "p=p;pp=p';r=r;rr=r';s=s;sch=sh';sh=sh;ss=s';t=t;tt=t';u=u;uj=u;uu=u;v=v;vv=v';y=ex;yy=y;z=z;zh=zh;zz=z'").Split(';')
                 .Select(entry => entry.Split('='))
@@ -106,11 +106,6 @@
             return phonemes;
         }

-        // russian specific replacements
-        protected override string[] GetDictionaryWordPhonemes(string phonemesString) {
-            return base.GetDictionaryWordPhonemes(phonemesString.Replace("' ay", "' aa").Replace("ch ay", "ch aa").Replace("j ay", "j aa"));
-        }
-
         protected override string ValidateAlias(string alias) {
             foreach (var consonant in new[] { "'", "ch", "j" }) {
                 foreach (var vowel in new[] { "ax", "ex" }) {


Fix test

Fix test

--- OpenUtau.Test/Core/USTx/UstxSerializationTest.cs
+++ OpenUtau.Test/Core/USTx/UstxSerializationTest.cs
@@ -61,6 +61,7 @@
     'shift': 0.0,
     'drift': 0.0
   },
+  'exp': {},
   'nex': [
     {
       'index': null,


Adds missing field in sound effect

Adds missing field in sound effect

--- Pdelvo.Minecraft.Protocol/Packets/SoundEffect.cs
+++ Pdelvo.Minecraft.Protocol/Packets/SoundEffect.cs
@@ -23,30 +23,41 @@
         /// <value>The effect Id.</value>
         /// <remarks></remarks>
         public int EffectId { get; set; }
+
         /// <summary>
         /// Gets or sets the X.
         /// </summary>
         /// <value>The X.</value>
         /// <remarks></remarks>
         public int PositionX { get; set; }
+
         /// <summary>
         /// Gets or sets the Y.
         /// </summary>
         /// <value>The Y.</value>
         /// <remarks></remarks>
         public byte PositionY { get; set; }
+
         /// <summary>
         /// Gets or sets the Z.
         /// </summary>
         /// <value>The Z.</value>
         /// <remarks></remarks>
         public int PositionZ { get; set; }
+
         /// <summary>
         /// Gets or sets the sound data.
         /// </summary>
         /// <value>The sound data.</value>
         /// <remarks></remarks>
         public int SoundData { get; set; }
+
+        /// <summary>
+        /// True if the volume will not decrease if the distance between player and source is big
+        /// </summary>
+        /// <value>NoVolumeDecrease</value>
+        /// <remarks></remarks>
+        public bool NoVolumeDecrease { get; set; }

         /// <summary>
         /// Receives the specified reader.
@@ -63,6 +74,15 @@
             PositionY = reader.ReadByte();
             PositionZ = reader.ReadInt32();
             SoundData = reader.ReadInt32();
+
+            if (version >= 47)
+            {
+                NoVolumeDecrease = reader.ReadBoolean();
+            }
+            else
+            {
+                NoVolumeDecrease = EffectId == 1013;
+            }
         }

         /// <summary>
@@ -81,6 +101,10 @@
             writer.Write(PositionY);
             writer.Write(PositionZ);
             writer.Write(SoundData);
+            if (version >= 47)
+            {
+                writer.Write(NoVolumeDecrease);
+            }
         }
     }
 }


Update PoolID.cs

Update PoolID.cs

--- PoolingSystem_Demo/Assets/Demo/Scripts/PoolID.cs
+++ PoolingSystem_Demo/Assets/Demo/Scripts/PoolID.cs
@@ -1,8 +1,9 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;

-public class PoolID : MonoBehaviour {
-	[SerializeField]private int _id;
+public class PoolID : MonoBehaviour
+{
+	private int _id;
 	private bool _init;

 	public int id
@@ -21,4 +22,11 @@
 		_id = obj.transform.GetInstanceID();
 		_init = true;
 	}
+
+	// This ensures objects that we are caching don't get polluted with our tag script, so destroy on exit
+	// Also, in case PoolingSystem misses removing it
+	void OnApplicationQuit()
+	{
+			Component.DestroyImmediate(this, true);
+	}
 }


- removed extraneous xform declaration and allocation.

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

--- Projects/Axiom/Source/Engine/Overlays/Overlay.cs
+++ Projects/Axiom/Source/Engine/Overlays/Overlay.cs
@@ -154,12 +154,10 @@
             // max 100 container levels per overlay, should be plenty
             element.NotifyZOrder( zOrder * 100 );

-            Matrix4[] xform = new Matrix4[ 256 ];
             GetWorldTransforms( xform );

             element.NotifyWorldTransforms( xform );
             element.NotifyViewport();
-

         }


added filter to user list, so it filters o nly people with actual roles.

--- Purchasing.Web/Controllers/ListSyncController.cs
+++ Purchasing.Web/Controllers/ListSyncController.cs
@@ -1,58 +1,56 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Web.Mvc;
-using Purchasing.Core;
-using Purchasing.Web.Attributes;
-using UCDArch.Web.Controller;
-
-namespace Purchasing.Web.Controllers
-{
-    [AuthenticateListView]
-    public class ListSyncController : SuperController
-    {
-        private readonly IRepositoryFactory _repositoryFactory;
-
-        public ListSyncController(IRepositoryFactory repositoryFactory)
-        {
-            _repositoryFactory = repositoryFactory;
-        }
-
-        public ActionResult Users()
-        {
-            var users =
-                _repositoryFactory.UserRepository.Queryable.Select(
-                    x => new UserEmailResult {Email = x.Email, Name = x.FirstName + " " + x.LastName});
-
-            return Content(WriteUsers(users), "text/plain");
-        }
-
-        public ActionResult Admins()
-        {
-            var adminUsers = from user in _repositoryFactory.UserRepository.Queryable
-                             where user.Roles.Any()
-                             select new UserEmailResult { Email = user.Email, Name = user.FirstName + " " + user.LastName };
-
-            return Content(WriteUsers(adminUsers), "text/plain");
-        }
-
-        private string WriteUsers(IEnumerable<UserEmailResult> users)
-        {
-            var str = new StringBuilder();
-
-            foreach (var user in users.ToList().Distinct())
-            {
-                str.AppendFormat("{0} {1}{2}", user.Email, user.Name, Environment.NewLine);
-            }
-
-            return str.ToString();
-        }
-
-        private class UserEmailResult
-        {
-            public string Email { get; set; }
-            public string Name { get; set; }
-        }
-    }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Web.Mvc;
+using Purchasing.Core;
+using Purchasing.Web.Attributes;
+using UCDArch.Web.Controller;
+
+namespace Purchasing.Web.Controllers
+{
+    [AuthenticateListView]
+    public class ListSyncController : SuperController
+    {
+        private readonly IRepositoryFactory _repositoryFactory;
+
+        public ListSyncController(IRepositoryFactory repositoryFactory)
+        {
+            _repositoryFactory = repositoryFactory;
+        }
+
+        public ActionResult Users()
+        {
+            var users = _repositoryFactory.UserRepository.Queryable.Where(a => a.WorkgroupPermissions.Any() || a.Roles.Any()).Select(x => new UserEmailResult {Email = x.Email, Name = x.FirstName + " " + x.LastName});
+
+            return Content(WriteUsers(users), "text/plain");
+        }
+
+        public ActionResult Admins()
+        {
+            var adminUsers = from user in _repositoryFactory.UserRepository.Queryable
+                             where user.Roles.Any()
+                             select new UserEmailResult { Email = user.Email, Name = user.FirstName + " " + user.LastName };
+
+            return Content(WriteUsers(adminUsers), "text/plain");
+        }
+
+        private string WriteUsers(IEnumerable<UserEmailResult> users)
+        {
+            var str = new StringBuilder();
+
+            foreach (var user in users.ToList().Distinct())
+            {
+                str.AppendFormat("{0} {1}{2}", user.Email, user.Name, Environment.NewLine);
+            }
+
+            return str.ToString();
+        }
+
+        private class UserEmailResult
+        {
+            public string Email { get; set; }
+            public string Name { get; set; }
+        }
+    }
 }


little more styling work.

little more styling work.

--- Purchasing.Web/Views/OrderMockup/ReadOnly.cshtml
+++ Purchasing.Web/Views/OrderMockup/ReadOnly.cshtml
@@ -32,8 +32,11 @@
         .row-split-prob {background-color: lightcoral;}
         .row-split table {border: none;}
         #history table, #notes table { border: none; }
+        #history table tr, #notes table tr {border-bottom: 1px solid lightgray;}
         #history table tr > td:first-child, #notes table tr > td:first-child { width: 150px;}
         #history table tr > td:last-child, #notes table tr > td:last-child { width: 150px;}
+
+        .acct-info .account, .acct-info .subaccount, .acct-info .project {margin-right: 20px;}
     </style>


Win32Window.FindDescendants 戻り値の null チェック

refs #111

--- RucheHome.Voiceroid/ProcessFactory.PlusExImpl.cs
+++ RucheHome.Voiceroid/ProcessFactory.PlusExImpl.cs
@@ -89,7 +89,7 @@
                 {
                     return
                         dialog
-                            .FindDescendants(@"Edit")
+                            .FindDescendants(@"Edit")?
                             .FirstOrDefault(
                                 c => c.GetAncestor(5)?.Handle == dialog.Handle);
                 }
@@ -140,6 +140,11 @@
                 catch (Exception ex)
                 {
                     ThreadTrace.WriteException(ex);
+                    return false;
+                }
+                if (controls == null)
+                {
+                    // ちょうどアプリ終了したタイミング等で null になりうる
                     return false;
                 }


feat(Text to Speech): Revised service to use the default US South URL if none is supplied

--- Scripts/Services/TextToSpeech/v1/TextToSpeech.cs
+++ Scripts/Services/TextToSpeech/v1/TextToSpeech.cs
@@ -146,6 +146,11 @@
             if (credentials.HasCredentials() || credentials.HasWatsonAuthenticationToken() || credentials.HasIamTokenData())
             {
                 Credentials = credentials;
+
+                if (string.IsNullOrEmpty(credentials.Url))
+                {
+                    credentials.Url = Url;
+                }
             }
             else
             {


Dummy commit

Dummy commit

--- Sdl.Community.GroupShareKit/IGroupShareClient.cs
+++ Sdl.Community.GroupShareKit/IGroupShareClient.cs
@@ -23,6 +23,7 @@
         /// </remarks>
         IProjectClient Project { get; }

+
         /// <summary>
         /// The base address of the GroupShare API.
         /// </summary>


fix compile

fix compile

--- Signum.Engine.Extensions/Dynamic/DynamicLogic.cs
+++ Signum.Engine.Extensions/Dynamic/DynamicLogic.cs
@@ -49,6 +49,9 @@

         public static FileInfo GetLoadedCodeGenAssemblyFileInfo()
         {
+            if (DynamicCode.CodeGenAssemblyPath.IsNullOrEmpty())
+                return null;
+
             return new DirectoryInfo(DynamicCode.CodeGenDirectory)
                 .GetFiles(Path.GetFileName(DynamicCode.CodeGenAssemblyPath))
                 .FirstOrDefault();
@@ -184,7 +187,7 @@
                 try
                 {
                     Directory.EnumerateFiles(DynamicCode.CodeGenDirectory)
-                        .Where(a => !inMemory || a != DynamicCode.CodeGenAssemblyPath)
+                        .Where(a => a != DynamicCode.CodeGenAssemblyPath)
                         .ToList()
                         .ForEach(a => File.Delete(a));
                 }
@@ -208,9 +211,18 @@
                 DynamicCode.CodeGenGeneratedAssembly = $"{DynamicCode.CodeGenAssembly.Before(".")}.{Guid.NewGuid()}.dll";
                 var outputAssembly = inMemory ? null : Path.Combine(DynamicCode.CodeGenDirectory, DynamicCode.CodeGenGeneratedAssembly);

-                using (var stream = inMemory ? (Stream)new MemoryStream() : File.Create(outputAssembly))
+                using (var stream = (Stream)new MemoryStream())
                 {
                     var emitResult = compilation.Emit(stream);
+
+                    if (emitResult.Success && !inMemory)
+                    {
+                        using (FileStream file = new FileStream(outputAssembly, FileMode.Create, FileAccess.ReadWrite))
+                        {
+                            stream.Position = 0;
+                            stream.CopyTo(file);
+                        }
+                    }

                     return new CompilationResult
                     {


Test modelling subviews works.

Test modelling subviews works.

--- Silk.Data.SQL.ORM.Tests/FlattenEmbeddingTests.cs
+++ Silk.Data.SQL.ORM.Tests/FlattenEmbeddingTests.cs
@@ -173,6 +173,50 @@
 		}

 		[TestMethod]
+		public async Task InsertViewOfObjectWithRequiredPropertiesAsViews()
+		{
+			var dataModel = _conventionModel;
+
+			foreach (var table in dataModel.Schema.Tables)
+			{
+				await table.CreateAsync(TestDb.Provider);
+			}
+
+			try
+			{
+				var modelInstance = new ViewOfObjectWithRequiredPropertiesAsViews
+				{
+					ModelB1 = new SubModelBView { Data = 5 },
+					ModelB2 = new SubModelBView { Data = 10 }
+				};
+				await dataModel.Insert(modelInstance)
+					.ExecuteAsync(TestDb.Provider);
+
+				using (var queryResult = await TestDb.Provider.ExecuteReaderAsync(
+					QueryExpression.Select(
+						new[] { QueryExpression.All() },
+						from: QueryExpression.Table(dataModel.Schema.EntityTable.TableName)
+					)))
+				{
+					Assert.IsTrue(queryResult.HasRows);
+					Assert.IsTrue(await queryResult.ReadAsync());
+
+					Assert.AreEqual(modelInstance.Id, queryResult.GetGuid(queryResult.GetOrdinal(nameof(modelInstance.Id))));
+					Assert.IsTrue(queryResult.IsDBNull(queryResult.GetOrdinal("ModelAData")));
+					Assert.AreEqual(modelInstance.ModelB1.Data, queryResult.GetInt32(queryResult.GetOrdinal("ModelB1Data")));
+					Assert.AreEqual(modelInstance.ModelB2.Data, queryResult.GetInt32(queryResult.GetOrdinal("ModelB2Data")));
+				}
+			}
+			finally
+			{
+				foreach (var table in dataModel.Schema.Tables)
+				{
+					await table.DropAsync(TestDb.Provider);
+				}
+			}
+		}
+
+		[TestMethod]
 		public async Task UpdateConventionModelWithoutNulls()
 		{
 			var dataModel = _conventionModel;
@@ -599,5 +643,17 @@
 			public SubModelB ModelB1 { get; set; }
 			public SubModelB ModelB2 { get; set; }
 		}
+
+		private class ViewOfObjectWithRequiredPropertiesAsViews
+		{
+			public Guid Id { get; private set; }
+			public SubModelBView ModelB1 { get; set; }
+			public SubModelBView ModelB2 { get; set; }
+		}
+
+		private class SubModelBView
+		{
+			public int Data { get; set; }
+		}
 	}
 }


refs #16 VisitCoreの引数を変更

refs #16
VisitCoreの引数を変更

--- Source/DeclarativeSql/Helpers/PredicateParser.cs
+++ Source/DeclarativeSql/Helpers/PredicateParser.cs
@@ -58,29 +58,29 @@
         /// <returns>式またはいずれかの部分式が変更された場合は変更された式。それ以外の場合は元の式。</returns>
         protected override Expression VisitBinary(BinaryExpression node)
         {
-            return this.VisitCore(() =>
-            {
-                //--- AND/OR : 左右を保持する要素として生成
-                //--- 比較演算子 (<, <=, >=, >, ==, !=) : 左辺のプロパティ名と右辺の値を抽出
-                switch (node.NodeType)
-                {
-                    case ExpressionType.AndAlso:
-                    case ExpressionType.OrElse:
-                        return new PredicateElement(node.NodeType.ToPredicateOperator());
-
-                    case ExpressionType.LessThan:
-                    case ExpressionType.LessThanOrEqual:
-                    case ExpressionType.GreaterThan:
-                    case ExpressionType.GreaterThanOrEqual:
-                    case ExpressionType.Equal:
-                    case ExpressionType.NotEqual:
-                        return this.ParseBinary(node);
-
-                    default:
-                        throw new InvalidOperationException();
-                }
-            },
-            () => base.VisitBinary(node));
+            //--- AND/OR : 左右を保持する要素として生成
+            //--- 比較演算子 (<, <=, >=, >, ==, !=) : 左辺のプロパティ名と右辺の値を抽出
+            PredicateElement element;
+            switch (node.NodeType)
+            {
+                case ExpressionType.AndAlso:
+                case ExpressionType.OrElse:
+                    element = new PredicateElement(node.NodeType.ToPredicateOperator());
+                    break;
+
+                case ExpressionType.LessThan:
+                case ExpressionType.LessThanOrEqual:
+                case ExpressionType.GreaterThan:
+                case ExpressionType.GreaterThanOrEqual:
+                case ExpressionType.Equal:
+                case ExpressionType.NotEqual:
+                    element = this.ParseBinary(node);
+                    break;
+
+                default:
+                    throw new InvalidOperationException();
+            }
+            return this.VisitCore(element, () => base.VisitBinary(node));
         }

@@ -95,36 +95,32 @@
             if (node.Method.DeclaringType == typeof(Enumerable))
             if (node.Method.Name == nameof(Enumerable.Contains))
             {
-                return this.VisitCore(() =>
+                //--- プロパティ名を取得
+                var propertyName = this.ExtractMemberName(node.Arguments[1]);
+                if (propertyName == null)
+                    throw new InvalidOperationException();
+
+                //--- 要素生成
+                //--- in句は1000件以上あるとエラーが発生するためorでつなぐ
+                var source  = (this.ExtractValue(node.Arguments[0]) as IEnumerable)
+                            .Cast<object>()
+                            .Buffer(1000)
+                            .Select(x => x.ToArray());
+
+                PredicateElement root = null;
+                foreach (var x in source)
                 {
-                    //--- プロパティ名を取得
-                    var propertyName = this.ExtractMemberName(node.Arguments[1]);
-                    if (propertyName == null)
-                        throw new InvalidOperationException();
-
-                    //--- 要素生成
-                    //--- in句は1000件以上あるとエラーが発生するためorでつなぐ
-                    var source  = (this.ExtractValue(node.Arguments[0]) as IEnumerable)
-                                .Cast<object>()
-                                .Buffer(1000)
-                                .Select(x => x.ToArray());
-
-                    PredicateElement root = null;
-                    foreach (var x in source)
+                    if (root != null)
                     {
-                        if (root != null)
-                        {
-                            var parent   = new PredicateElement(PredicateOperator.OrElse);
-                            parent.Left  = new PredicateElement(PredicateOperator.Contains, this.parameter.Type, propertyName, x);
-                            parent.Right = root;
-                            root         = parent;
-                            continue;
-                        }
-                        root = new PredicateElement(PredicateOperator.Contains, this.parameter.Type, propertyName, x);
+                        var parent   = new PredicateElement(PredicateOperator.OrElse);
+                        parent.Left  = new PredicateElement(PredicateOperator.Contains, this.parameter.Type, propertyName, x);
+                        parent.Right = root;
+                        root         = parent;
+                        continue;
                     }
-                    return root;
-                },
-                () => base.VisitMethodCall(node));
+                    root = new PredicateElement(PredicateOperator.Contains, this.parameter.Type, propertyName, x);
+                }
+                return this.VisitCore(root, () => base.VisitMethodCall(node));
             }

             //--- default
@@ -137,14 +133,11 @@
         /// <summary>
         /// 式を走査します。
         /// </summary>
-        /// <param name="elementGenerator">要素生成デリゲート</param>
+        /// <param name="element">要素生成</param>
         /// <param name="baseCall">基底メソッド呼び出しデリゲート</param>
         /// <returns>式またはいずれかの部分式が変更された場合は変更された式。それ以外の場合は元の式。</returns>
-        private Expression VisitCore(Func<PredicateElement> elementGenerator, Func<Expression> baseCall)
-        {
-            //--- 要素生成
-            var element = elementGenerator();
-
+        private Expression VisitCore(PredicateElement element, Func<Expression> baseCall)
+        {
             //--- 親要素と関連付け
             var parent = this.cache.Count == 0 ? null : this.cache.Peek();
             if (parent != null)


Test added for correct null handling in Equals() and GetHashCode().

--- Sources/BeltTest/Belt/MemberwiseEquatableTest.cs
+++ Sources/BeltTest/Belt/MemberwiseEquatableTest.cs
@@ -68,6 +68,20 @@
             Assert.Equal(x.GetHashCode(), y.GetHashCode());
         }

+        [Fact]
+        public void Null_values_do_not_throw_exceptions_in_equals_and_getHashCode()
+        {
+            var x = new ValueType("asdf", 42, true, null, new ValueType2("xyz"));
+            var y = new ValueType("asdf", 42, true, null, new ValueType2("xyz"));
+
+            Assert.True(x.Equals(y));
+            Assert.True(y.Equals(x));
+            Assert.True(x == y);
+            Assert.False(x != y);
+
+            Assert.Equal(x.GetHashCode(), y.GetHashCode());
+        }
+
         // TODO Add sequence equality tests

         // ReSharper disable NotAccessedField.Local


Misc Decimal optimizations

Misc Decimal optimizations

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

--- src/mscorlib/shared/System/Math.cs
+++ src/mscorlib/shared/System/Math.cs
@@ -96,7 +96,7 @@
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static decimal Abs(decimal value)
         {
-            return decimal.Abs(value);
+            return decimal.Abs(ref value);
         }

         [StackTraceHidden]
@@ -453,7 +453,7 @@
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static decimal Max(decimal val1, decimal val2)
         {
-            return decimal.Max(val1, val2);
+            return decimal.Max(ref val1, ref val2);
         }

         public static double Max(double val1, double val2)
@@ -541,7 +541,7 @@
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static decimal Min(decimal val1, decimal val2)
         {
-            return decimal.Min(val1, val2);
+            return decimal.Min(ref val1, ref val2);
         }

         public static double Min(double val1, double val2)


Don't load libraries on netstandard2.0, let the framework do it.

--- iMobileDevice-net/NativeLibraries.cs
+++ iMobileDevice-net/NativeLibraries.cs
@@ -17,7 +17,7 @@
         /// </summary>
         public static bool LibraryFound
         {
-#if !NETSTANDARD1_5
+#if !NETSTANDARD1_5 && !NETSTANDARD2_0
             get;
             private set;
 #else
@@ -47,7 +47,7 @@
         /// </param>
         public static void Load(string directory)
         {
-#if !NETSTANDARD1_5
+#if !NETSTANDARD1_5 && !NETSTANDARD2_0
             if (directory == null)
             {
                 throw new ArgumentNullException(nameof(directory));


Improve error messages #28 - fix error message for searching by text

--- Src/MvcPages/SeleniumUtils/SeleniumExtensions.cs
+++ Src/MvcPages/SeleniumUtils/SeleniumExtensions.cs
@@ -309,14 +309,10 @@
                     : By.XPath(string.Format(".//*[((normalize-space(.) = {0}) and (count(*)=0) )or (normalize-space(text()) = {0}) or ((@type='submit' or  @type='reset') and @value={0}) or (@title={0})]", xpathLiteral));
                 return GetStableElementByInScope(driver, by, scope);
             }
-            catch (WebDriverTimeoutException ex)
-            {
-                if (ex.InnerException is NoSuchElementException)
-                {
-                    var message = $"Cannot find element with text='{linkText}'";
-                    throw new WebElementNotFoundException(message, ex);
-                }
-                throw;
+            catch (CannotFindElementByException ex)
+            {
+                var message = $"Cannot find element with text='{linkText}'";
+                throw new WebElementNotFoundException(message, ex);
             }
         }


Windows: Silverlight namespace fix

Windows: Silverlight namespace fix

--- source/FFImageLoading.Shared/ImageService.cs
+++ source/FFImageLoading.Shared/ImageService.cs
@@ -8,8 +8,14 @@
 using System.Threading;
 using System.IO;
 using System.Threading.Tasks;
+using System.Linq;
+
+
+#if SILVERLIGHT
+using FFImageLoading.Concurrency;
+#else
 using System.Collections.Concurrent;
-using System.Linq;
+#endif

 namespace FFImageLoading
 {


Le sigh, another network message that lets clients dictate what happens.

--- Terraria_Server/Messages/PlayerAddBuffMessage.cs
+++ Terraria_Server/Messages/PlayerAddBuffMessage.cs
@@ -1,4 +1,5 @@
 using System;
+using Terraria_Server.Logging;

 namespace Terraria_Server.Messages
 {
@@ -12,15 +13,16 @@
 		public void Process(int start, int length, int num, int whoAmI, byte[] readBuffer, byte bufferData)
 		{
 			var playerId = readBuffer[num++];
+			var type = readBuffer[num++];
+			var time = BitConverter.ToInt16 (readBuffer, num);

-			if (playerId != whoAmI)
+			if (type > 26 || time > 900 /*max buff time*/
+				|| (playerId != whoAmI && ((type != 20 && type != 24) || time > 600 /*max debuff time*/)))
 			{
+				ProgramLog.Debug.Log ("PLAYER_ADD_BUFF: from={0}, for={1}, type={2}, time={3}", whoAmI, playerId, type, time);
 				Netplay.slots[whoAmI].Kick ("Cheating detected (PLAYER_ADD_BUFF forgery).");
 				return;
 			}
-
-			var type = readBuffer[num++];
-			var time = BitConverter.ToInt16 (readBuffer, num);

 			Main.players[whoAmI].AddBuff (type, time, true);


Fixed Switch

Fixed Switch

git-svn-id: 61c3ae23f3a6520e9bc357b51591209af2ede9d8@890 45b04e34-05f1-4d87-a130-40a8491d5c8b

--- Test/Mosa/Runtime/CompilerFramework/IL/Switch.cs
+++ Test/Mosa/Runtime/CompilerFramework/IL/Switch.cs
@@ -34,19 +34,249 @@
         ///
         /// </summary>
         /// <param name="a"></param>
+        [TestCase((sbyte)1)]
+        [TestCase((sbyte)23)]
+        [TestCase((sbyte)-1)]
+        [TestCase((sbyte)0)]
+        // And reverse
+        [TestCase((sbyte)2)]
+        [TestCase((sbyte)-2)]
+        [Test]
+        public void SwitchI1(sbyte a)
+        {
+            CodeSource = @"static class Test {
+                static sbyte SwitchI1(sbyte expect, sbyte a) { return Switch_Target(a); }
+                static sbyte Switch_Target(sbyte a)
+                {
+                    switch(a)
+                    {
+                        case 0:
+                            return 0;
+                            break;
+                        case 1:
+                            return 1;
+                            break;
+                        case -1:
+                            return -1;
+                            break;
+                        case 2:
+                            return 2;
+                            break;
+                        case -2:
+                            return -2;
+                            break;
+                        case 23:
+                            return 23;
+                            break;
+                        case sbyte.MinValue:
+                            return sbyte.MinValue;
+                            break;
+                        case sbyte.MaxValue:
+                            return sbyte.MaxValue;
+                            break;
+                        default:
+                            return 42;
+                            break;
+                    }
+                }
+            }";
+            Assert.AreEqual(a, Run<I1_I1>("", "Test", "SwitchI1", a, a));
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="expect"></param>
+        /// <param name="a"></param>
+        /// <returns></returns>
+        delegate bool U1_U1(byte expect, byte a);
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="a"></param>
+        [TestCase((byte)1)]
+        [TestCase((byte)23)]
+        [TestCase((byte)0)]
+        // And reverse
+        [TestCase((byte)2)]
+        [Test]
+        public void SwitchU1(byte a)
+        {
+            CodeSource = @"static class Test {
+                static bool SwitchU1(byte expect, byte a) { return expect == Switch_Target(a); }
+                static byte Switch_Target(byte a)
+                {
+                    switch(a)
+                    {
+                        case 0:
+                            return 0;
+                            break;
+                        case 1:
+                            return 1;
+                            break;
+                        case 2:
+                            return 2;
+                            break;
+                        case 23:
+                            return 23;
+                            break;
+                        case byte.MaxValue:
+                            return byte.MaxValue;
+                            break;
+                        default:
+                            return 42;
+                            break;
+                    }
+                }
+            }";
+            Assert.IsTrue((bool)Run<U1_U1>("", "Test", "SwitchU1", a, a));
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="expect"></param>
+        /// <param name="a"></param>
+        /// <returns></returns>
+        delegate bool I2_I2(short expect, short a);
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="a"></param>
+        [TestCase((short)1)]
+        [TestCase((short)23)]
+        [TestCase((short)-1)]
+        [TestCase((short)0)]
+        // And reverse
+        [TestCase((short)2)]
+        [TestCase((short)-2)]
+        // (MinValue, X) Cases
+        [TestCase(short.MinValue)]
+        // (MaxValue, X) Cases
+        [TestCase(short.MaxValue)]
+        [Test]
+        public void SwitchI2(short a)
+        {
+            CodeSource = @"static class Test {
+                static bool SwitchI2(short expect, short a) { return expect == Switch_Target(a); }
+                static short Switch_Target(short a)
+                {
+                    switch(a)
+                    {
+                        case 0:
+                            return 0;
+                            break;
+                        case 1:
+                            return 1;
+                            break;
+                        case -1:
+                            return -1;
+                            break;
+                        case 2:
+                            return 2;
+                            break;
+                        case -2:
+                            return -2;
+                            break;
+                        case 23:
+                            return 23;
+                            break;
+                        case short.MinValue:
+                            return short.MinValue;
+                            break;
+                        case short.MaxValue:
+                            return short.MaxValue;
+                            break;
+                        default:
+                            return 42;
+                            break;
+                    }
+                }
+            }";
+            Assert.IsTrue((bool)Run<I2_I2>("", "Test", "SwitchI2", a, a));
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="expect"></param>
+        /// <param name="a"></param>
+        /// <returns></returns>
+        delegate bool U2_U2(ushort expect, ushort a);
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="a"></param>
+        [TestCase((ushort)1)]
+        [TestCase((ushort)23)]
+        [TestCase((ushort)0)]
+        // And reverse
+        [TestCase((ushort)2)]
+        // (MinValue, X) Cases
+        [TestCase(ushort.MinValue)]
+        // (MaxValue, X) Cases
+        [TestCase(ushort.MaxValue)]
+        [Test]
+        public void SwitchU2(ushort a)
+        {
+            CodeSource = @"static class Test {
+                static bool SwitchU2(ushort expect, ushort a) { return expect == Switch_Target(a); }
+                static ushort Switch_Target(ushort a)
+                {
+                    switch(a)
+                    {
+                        case 0:
+                            return 0;
+                            break;
+                        case 1:
+                            return 1;
+                            break;
+                        case 2:
+                            return 2;
+                            break;
+                        case 23:
+                            return 23;
+                            break;
+                        case ushort.MaxValue:
+                            return ushort.MaxValue;
+                            break;
+                        default:
+                            return 42;
+                            break;
+                    }
+                }
+            }";
+            Assert.IsTrue((bool)Run<U2_U2>("", "Test", "SwitchU2", a, a));
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="expect"></param>
+        /// <param name="a"></param>
+        /// <returns></returns>
+        delegate bool I4_I4(int expect, int a);
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="a"></param>
         [TestCase(1)]
         [TestCase(23)]
         [TestCase(-1)]
         [TestCase(0)]
         // And reverse
         [TestCase(2)]
-        [TestCase(-2)]
-        [Test]
-        public void SwitchI1(sbyte a)
-        {
-            CodeSource = @"static class Test {
-                static sbyte SwitchI1(sbyte expect, sbyte a) { return Switch_Target(a); }
-                static sbyte Switch_Target(sbyte a)
+        [TestCase(-2)]
+        // (MinValue, X) Cases
+        [TestCase(int.MinValue)]
+        // (MaxValue, X) Cases
+        [TestCase(int.MaxValue)]
+        [Test]
+        public void SwitchI4(int a)
+        {
+            CodeSource = @"static class Test {
+                static bool SwitchI4(int expect, int a) { return expect == Switch_Target(a); }
+                static int Switch_Target(int a)
                 {
                     switch(a)
                     {
@@ -68,77 +298,82 @@
                         case 23:
                             return 23;
                             break;
-                        case sbyte.MinValue:
-                            return sbyte.MinValue;
-                            break;
-                        case sbyte.MaxValue:
-                            return sbyte.MaxValue;
-                            break;
-                        default:
-                            return 42;
-                            break;
-                    }
-                }
-            }";
-            Assert.AreEqual(a, Run<I1_I1>("", "Test", "SwitchI1", a, a));
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="expect"></param>
-        /// <param name="a"></param>
-        /// <returns></returns>
-        delegate bool U1_U1(byte expect, byte a);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="a"></param>
-        [TestCase(1)]
-        [TestCase(23)]
-        [TestCase(0)]
-        // And reverse
-        [TestCase(2)]
-        [Test]
-        public void SwitchU1(byte a)
-        {
-            CodeSource = @"static class Test {
-                static bool SwitchU1(byte expect, byte a) { return expect == Switch_Target(a); }
-                static byte Switch_Target(byte a)
-                {
-                    switch(a)
-                    {
-                        case 0:
-                            return 0;
-                            break;
-                        case 1:
-                            return 1;
-                            break;
-                        case 2:
-                            return 2;
-                            break;
-                        case 23:
-                            return 23;
-                            break;
-                        case byte.MaxValue:
-                            return byte.MaxValue;
-                            break;
-                        default:
-                            return 42;
-                            break;
-                    }
-                }
-            }";
-            Assert.IsTrue((bool)Run<U1_U1>("", "Test", "SwitchU1", a, a));
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="expect"></param>
-        /// <param name="a"></param>
-        /// <returns></returns>
-        delegate bool I2_I2(short expect, short a);
+                        case int.MinValue:
+                            return int.MinValue;
+                            break;
+                        case int.MaxValue:
+                            return int.MaxValue;
+                            break;
+                        default:
+                            return 42;
+                            break;
+                    }
+                }
+            }";
+            Assert.IsTrue((bool)Run<I4_I4>("", "Test", "SwitchI4", a, a));
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="expect"></param>
+        /// <param name="a"></param>
+        /// <returns></returns>
+        delegate bool U4_U4(uint expect, uint a);
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="a"></param>
+        [TestCase((uint)1)]
+        [TestCase((uint)23)]
+        [TestCase((uint)0)]
+        // And reverse
+        [TestCase((uint)2)]
+        // (MinValue, X) Cases
+        [TestCase(uint.MinValue)]
+        // (MaxValue, X) Cases
+        [TestCase(uint.MaxValue)]
+        [Test]
+        public void SwitchU4(uint a)
+        {
+            CodeSource = @"static class Test {
+                static bool SwitchU4(uint expect, uint a) { return expect == Switch_Target(a); }
+                static uint Switch_Target(uint a)
+                {
+                    switch(a)
+                    {
+                        case 0:
+                            return 0;
+                            break;
+                        case 1:
+                            return 1;
+                            break;
+                        case 2:
+                            return 2;
+                            break;
+                        case 23:
+                            return 23;
+                            break;
+                        case uint.MaxValue:
+                            return uint.MaxValue;
+                            break;
+                        default:
+                            return 42;
+                            break;
+                    }
+                }
+            }";
+            Assert.IsTrue((bool)Run<U4_U4>("", "Test", "SwitchU4", a, a));
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="expect"></param>
+        /// <param name="a"></param>
+        /// <returns></returns>
+        delegate bool I8_I8(long expect, long a);
+        delegate long I8_I8_R(long expect, long a);
         /// <summary>
         ///
         /// </summary>
@@ -151,15 +386,15 @@
         [TestCase(2)]
         [TestCase(-2)]
         // (MinValue, X) Cases
-        [TestCase(short.MinValue)]
-        // (MaxValue, X) Cases
-        [TestCase(short.MaxValue)]
-        [Test]
-        public void SwitchI2(short a)
-        {
-            CodeSource = @"static class Test {
-                static bool SwitchI2(short expect, short a) { return expect == Switch_Target(a); }
-                static short Switch_Target(short a)
+        [TestCase(long.MinValue)]
+        // (MaxValue, X) Cases
+        [TestCase(long.MaxValue)]
+        [Test]
+        public void SwitchI8(long a)
+        {
+            CodeSource = @"static class Test {
+                static long SwitchI8(long expect, long a) { return Switch_Target(a); }
+                static long Switch_Target(long a)
                 {
                     switch(a)
                     {
@@ -181,241 +416,6 @@
                         case 23:
                             return 23;
                             break;
-                        case short.MinValue:
-                            return short.MinValue;
-                            break;
-                        case short.MaxValue:
-                            return short.MaxValue;
-                            break;
-                        default:
-                            return 42;
-                            break;
-                    }
-                }
-            }";
-            Assert.IsTrue((bool)Run<I2_I2>("", "Test", "SwitchI2", a, a));
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="expect"></param>
-        /// <param name="a"></param>
-        /// <returns></returns>
-        delegate bool U2_U2(ushort expect, ushort a);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="a"></param>
-        [TestCase(1)]
-        [TestCase(23)]
-        [TestCase(0)]
-        // And reverse
-        [TestCase(2)]
-        // (MinValue, X) Cases
-        [TestCase(ushort.MinValue)]
-        // (MaxValue, X) Cases
-        [TestCase(ushort.MaxValue)]
-        [Test]
-        public void SwitchU2(ushort a)
-        {
-            CodeSource = @"static class Test {
-                static bool SwitchU2(ushort expect, ushort a) { return expect == Switch_Target(a); }
-                static ushort Switch_Target(ushort a)
-                {
-                    switch(a)
-                    {
-                        case 0:
-                            return 0;
-                            break;
-                        case 1:
-                            return 1;
-                            break;
-                        case 2:
-                            return 2;
-                            break;
-                        case 23:
-                            return 23;
-                            break;
-                        case ushort.MaxValue:
-                            return ushort.MaxValue;
-                            break;
-                        default:
-                            return 42;
-                            break;
-                    }
-                }
-            }";
-            Assert.IsTrue((bool)Run<U2_U2>("", "Test", "SwitchU2", a, a));
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="expect"></param>
-        /// <param name="a"></param>
-        /// <returns></returns>
-        delegate bool I4_I4(int expect, int a);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="a"></param>
-        [TestCase(1)]
-        [TestCase(23)]
-        [TestCase(-1)]
-        [TestCase(0)]
-        // And reverse
-        [TestCase(2)]
-        [TestCase(-2)]
-        // (MinValue, X) Cases
-        [TestCase(int.MinValue)]
-        // (MaxValue, X) Cases
-        [TestCase(int.MaxValue)]
-        [Test]
-        public void SwitchI4(int a)
-        {
-            CodeSource = @"static class Test {
-                static bool SwitchI4(int expect, int a) { return expect == Switch_Target(a); }
-                static int Switch_Target(int a)
-                {
-                    switch(a)
-                    {
-                        case 0:
-                            return 0;
-                            break;
-                        case 1:
-                            return 1;
-                            break;
-                        case -1:
-                            return -1;
-                            break;
-                        case 2:
-                            return 2;
-                            break;
-                        case -2:
-                            return -2;
-                            break;
-                        case 23:
-                            return 23;
-                            break;
-                        case int.MinValue:
-                            return int.MinValue;
-                            break;
-                        case int.MaxValue:
-                            return int.MaxValue;
-                            break;
-                        default:
-                            return 42;
-                            break;
-                    }
-                }
-            }";
-            Assert.IsTrue((bool)Run<I4_I4>("", "Test", "SwitchI4", a, a));
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="expect"></param>
-        /// <param name="a"></param>
-        /// <returns></returns>
-        delegate bool U4_U4(uint expect, uint a);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="a"></param>
-        [TestCase(1)]
-        [TestCase(23)]
-        [TestCase(0)]
-        // And reverse
-        [TestCase(2)]
-        // (MinValue, X) Cases
-        [TestCase(uint.MinValue)]
-        // (MaxValue, X) Cases
-        [TestCase(uint.MaxValue)]
-        [Test]
-        public void SwitchU4(uint a)
-        {
-            CodeSource = @"static class Test {
-                static bool SwitchU4(uint expect, uint a) { return expect == Switch_Target(a); }
-                static uint Switch_Target(uint a)
-                {
-                    switch(a)
-                    {
-                        case 0:
-                            return 0;
-                            break;
-                        case 1:
-                            return 1;
-                            break;
-                        case 2:
-                            return 2;
-                            break;
-                        case 23:
-                            return 23;
-                            break;
-                        case uint.MaxValue:
-                            return uint.MaxValue;
-                            break;
-                        default:
-                            return 42;
-                            break;
-                    }
-                }
-            }";
-            Assert.IsTrue((bool)Run<U4_U4>("", "Test", "SwitchU4", a, a));
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="expect"></param>
-        /// <param name="a"></param>
-        /// <returns></returns>
-        delegate bool I8_I8(long expect, long a);
-        delegate long I8_I8_R(long expect, long a);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="a"></param>
-        [TestCase(1)]
-        [TestCase(23)]
-        [TestCase(-1)]
-        [TestCase(0)]
-        // And reverse
-        [TestCase(2)]
-        [TestCase(-2)]
-        // (MinValue, X) Cases
-        [TestCase(long.MinValue)]
-        // (MaxValue, X) Cases
-        [TestCase(long.MaxValue)]
-        [Test]
-        public void SwitchI8(long a)
-        {
-            CodeSource = @"static class Test {
-                static long SwitchI8(long expect, long a) { return Switch_Target(a); }
-                static long Switch_Target(long a)
-                {
-                    switch(a)
-                    {
-                        case 0:
-                            return 0;
-                            break;
-                        case 1:
-                            return 1;
-                            break;
-                        case -1:
-                            return -1;
-                            break;
-                        case 2:
-                            return 2;
-                            break;
-                        case -2:
-                            return -2;
-                            break;
-                        case 23:
-                            return 23;
-                            break;
                         case long.MinValue:
                             return long.MinValue;
                             break;
@@ -442,11 +442,11 @@
         ///
         /// </summary>
         /// <param name="a"></param>
-        [TestCase(1)]
-        [TestCase(23)]
-        [TestCase(0)]
-        // And reverse
-        [TestCase(2)]
+        [TestCase((ulong)1)]
+        [TestCase((ulong)23)]
+        [TestCase((ulong)0)]
+        // And reverse
+        [TestCase((ulong)2)]
         // (MinValue, X) Cases
         [TestCase(ulong.MinValue)]
         // (MaxValue, X) Cases


Added IsTemplate property support

Added IsTemplate property support

--- Test2d.Editor/Editor/Factories/ProjectFactory.cs
+++ Test2d.Editor/Editor/Factories/ProjectFactory.cs
@@ -57,6 +57,7 @@
         {
             var container = Container.Create(name);

+            container.IsTemplate = true;
             container.Background = ArgbColor.Create(0xFF, 0xFF, 0xFF, 0xFF);

             foreach (var layer in container.Layers)


Fix breaking test

Fix breaking test

--- TestMoya/Extensions/DictionaryExtensionsTests.cs
+++ TestMoya/Extensions/DictionaryExtensionsTests.cs
@@ -37,7 +37,7 @@
             var exception = Record.Exception(() => originalDictionary.AddRange(null));

             Assert.Equal(typeof(ArgumentNullException), exception.GetType());
-            Assert.Equal("Value cannot be null.\r\nParameter name: collection", exception.Message);
+            Assert.Equal("Argument cannot be null.\r\nParameter name: collection", exception.Message);
         }

         [Fact]


Improve messages in PostBuildSettings.

Improve messages in PostBuildSettings.

--- UnrealBinaryBuilder/Classes/PostBuildSettings.cs
+++ UnrealBinaryBuilder/Classes/PostBuildSettings.cs
@@ -158,7 +158,7 @@
 			{
 				using (var zipFile = new ZipFile { CompressionLevel = CL })
 				{
-					Application.Current.Dispatcher.Invoke(() => { mainWindow.FileSaveState.Content = "State: Finding files..."; });
+					Application.Current.Dispatcher.Invoke(() => { mainWindow.FileSaveState.Content = $"State: Be Patient! This might take a long time. Ninjas are finding files in {InBuildDirectory}"; });
 					IEnumerable<string> files = Directory.EnumerateFiles(InBuildDirectory, "*.*", SearchOption.AllDirectories);

 					ZipCancelToken.ThrowIfCancellationRequested();
@@ -335,7 +335,13 @@

 					zipFile.UseZip64WhenSaving = Zip64Option.Always;
 					zipFile.Save(ZipLocationToSave);
-					Application.Current.Dispatcher.Invoke(() => { mainWindow.AddLogEntry($"Done zipping. File location: {ZipLocationToSave}"); });
+					Application.Current.Dispatcher.Invoke(() =>
+					{
+						mainWindow.CancelZipping.IsEnabled = false;
+						mainWindow.CurrentFileSaving.Visibility = Visibility.Collapsed;
+						mainWindow.FileSaveState.Content = $"State: Saved to {ZipLocationToSave}";
+						mainWindow.AddLogEntry($"Done zipping. {ZipLocationToSave}");
+					});
 				}
 			}, ZipCancelToken);


Let TextBox DI GameHost directly rather than accessing via Game.

--- osu.Framework/Graphics/UserInterface/TextBox.cs
+++ osu.Framework/Graphics/UserInterface/TextBox.cs
@@ -17,6 +17,7 @@
 using OpenTK.Input;
 using osu.Framework.Allocation;
 using osu.Framework.Audio;
+using osu.Framework.Platform;

 namespace osu.Framework.Graphics.UserInterface
 {
@@ -91,11 +92,11 @@
         }

         [BackgroundDependencyLoader]
-        private void load(BaseGame game, AudioManager audio)
+        private void load(BasicGameHost host, AudioManager audio)
         {
             this.audio = audio;

-            textInput = game.Host.GetTextInput();
+            textInput = host.GetTextInput();
             if (textInput != null)
             {
                 textInput.OnNewImeComposition += delegate (string s)


Properly block SDL IME results sent as multiple events

--- osu.Framework/Platform/Windows/WindowsWindow.cs
+++ osu.Framework/Platform/Windows/WindowsWindow.cs
@@ -4,6 +4,7 @@
 using System;
 using System.Drawing;
 using System.Runtime.InteropServices;
+using JetBrains.Annotations;
 using osu.Framework.Platform.SDL2;
 using osu.Framework.Platform.Windows.Native;
 using SDL2;
@@ -72,12 +73,18 @@

         public override void ResetIme() => ScheduleCommand(() => Imm.CancelComposition(WindowHandle));

-        protected override void HandleTextInputEvent(SDL.SDL_TextInputEvent evtText)
-        {
-            // block SDL text input if there was a recent result from `handleImeMessage()`.
-            if (recentImeResult)
-            {
-                recentImeResult = false;
+        protected override unsafe void HandleTextInputEvent(SDL.SDL_TextInputEvent evtText)
+        {
+            if (!SDL2Extensions.TryGetStringFromBytePointer(evtText.text, out string sdlResult))
+                return;
+
+            // Block SDL text input if it was already handled by `handleImeMessage()`.
+            // SDL truncates text over 32 bytes and sends it as multiple events.
+            // We assume these events will be handled in the same `pollSDLEvents()` call.
+            if (lastImeResult?.Contains(sdlResult) == true)
+            {
+                // clear the result after this SDL event loop finishes so normal text input isn't blocked.
+                EventScheduler.AddOnce(() => lastImeResult = null);
                 return;
             }

@@ -99,10 +106,14 @@
         private bool imeCompositionActive;

         /// <summary>
-        /// Whether an IME result was recently posted.
-        /// </summary>
-        /// <remarks>Used for blocking SDL IME results since we handle those ourselves.</remarks>
-        private bool recentImeResult;
+        /// The last IME result.
+        /// </summary>
+        /// <remarks>
+        /// Used for blocking SDL IME results since we handle those ourselves.
+        /// Cleared when the SDL events are blocked.
+        /// </remarks>
+        [CanBeNull]
+        private string lastImeResult;

         private void handleImeMessage(IntPtr hWnd, uint uMsg, long lParam)
         {
@@ -118,7 +129,7 @@
                     {
                         if (inputContext.TryGetImeResult(out string resultText))
                         {
-                            recentImeResult = true;
+                            lastImeResult = resultText;
                             ScheduleEvent(() => TriggerTextInput(resultText));
                         }


Fix scheduled tasks not being cleaned up between test steps

--- osu.Game.Rulesets.Osu.Tests/TestSceneShaking.cs
+++ osu.Game.Rulesets.Osu.Tests/TestSceneShaking.cs
@@ -1,8 +1,11 @@
 // 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.Collections.Generic;
 using System.Diagnostics;
+using osu.Framework.Threading;
 using osu.Framework.Utils;
+using osu.Game.Beatmaps;
 using osu.Game.Rulesets.Osu.Objects;
 using osu.Game.Rulesets.Scoring;

@@ -10,6 +13,19 @@
 {
     public class TestSceneShaking : TestSceneHitCircle
     {
+        private readonly List<ScheduledDelegate> scheduledTasks = new List<ScheduledDelegate>();
+
+        protected override IBeatmap CreateBeatmapForSkinProvider()
+        {
+            // best way to run cleanup before a new step is run
+            foreach (var task in scheduledTasks)
+                task.Cancel();
+
+            scheduledTasks.Clear();
+
+            return base.CreateBeatmapForSkinProvider();
+        }
+
         protected override TestDrawableHitCircle CreateDrawableHitCircle(HitCircle circle, bool auto)
         {
             var drawableHitObject = base.CreateDrawableHitCircle(circle, auto);
@@ -17,7 +33,7 @@
             Debug.Assert(drawableHitObject.HitObject.HitWindows != null);

             double delay = drawableHitObject.HitObject.StartTime - (drawableHitObject.HitObject.HitWindows.WindowFor(HitResult.Miss) + RNG.Next(0, 300)) - Time.Current;
-            Scheduler.AddDelayed(() => drawableHitObject.TriggerJudgement(), delay);
+            scheduledTasks.Add(Scheduler.AddDelayed(() => drawableHitObject.TriggerJudgement(), delay));

             return drawableHitObject;
         }


Use local input manager

Use local input manager

--- osu.Game/Graphics/Cursor/MenuCursorContainer.cs
+++ osu.Game/Graphics/Cursor/MenuCursorContainer.cs
@@ -48,7 +48,7 @@
         {
             base.Update();

-            var lastMouseSource = GetContainingInputManager().CurrentState.Mouse.LastSource;
+            var lastMouseSource = inputManager.CurrentState.Mouse.LastSource;
             bool hasValidInput = lastMouseSource != null && !(lastMouseSource is ISourcedFromTouch);

             if (!hasValidInput || !CanShowCursor)


Trigger a value changed event when the number of digits changes

--- osu.Game/Graphics/UserInterface/OsuSliderBar.cs
+++ osu.Game/Graphics/UserInterface/OsuSliderBar.cs
@@ -28,10 +28,26 @@
         private readonly Box leftBox;
         private readonly Box rightBox;

+        private int tooltipDecimalDigits = 1;
         /// <summary>
         /// The amount of decimal digits to display for <see cref="OsuSliderBar{T}"/>s with floating point values.
         /// </summary>
-        public int TooltipDecimalDigits = 1;
+        public int TooltipDecimalDigits
+        {
+            get => tooltipDecimalDigits;
+            set
+            {
+                if (tooltipDecimalDigits == value)
+                    return;
+                tooltipDecimalDigits = value;
+
+                if (IsLoaded)
+                {
+                    // Some users may want to see the updated ToolTipText
+                    Current.TriggerChange();
+                }
+            }
+        }

         public virtual string TooltipText
         {


Line endings.

Line endings.

--- osu.Game/Screens/Multiplayer/ParticipantInfo.cs
+++ osu.Game/Screens/Multiplayer/ParticipantInfo.cs
@@ -1,142 +1,142 @@
-using System.Collections.Generic;
-using System.Linq;
-using OpenTK;
-using osu.Framework.Allocation;
-using osu.Framework.Graphics;
-using osu.Framework.Graphics.Containers;
-using osu.Framework.Graphics.Shapes;
-using osu.Game.Graphics;
-using osu.Game.Graphics.Sprites;
-using osu.Game.Users;
-
-namespace osu.Game.Screens.Multiplayer
-{
-    public class ParticipantInfo : Container
-    {
-        private readonly Container flagContainer;
-        private readonly OsuSpriteText host;
-        private readonly FillFlowContainer levelRangeContainer;
-        private readonly OsuSpriteText levelRangeLower;
-        private readonly OsuSpriteText levelRangeHigher;
-
-        public User Host
-        {
-            set
-            {
-                host.Text = value.Username;
-                flagContainer.Children = new[] { new DrawableFlag(value.Country?.FlagName ?? @"__") { RelativeSizeAxes = Axes.Both } };
-            }
-        }
-
-        public IEnumerable<User> Participants
-        {
-            set
-            {
-                var ranks = value.Select(u => u.GlobalRank);
-                levelRangeLower.Text = ranks.Min().ToString();
-                levelRangeHigher.Text = ranks.Max().ToString();
-            }
-        }
-
-        public ParticipantInfo(string rankPrefix = null)
-        {
-            RelativeSizeAxes = Axes.X;
-            Height = 15f;
-
-            Children = new Drawable[]
-            {
-                new FillFlowContainer
-                {
-                    AutoSizeAxes = Axes.X,
-                    RelativeSizeAxes = Axes.Y,
-                    Direction = FillDirection.Horizontal,
-                    Spacing = new Vector2(5f, 0f),
-                    Children = new Drawable[]
-                    {
-                        flagContainer = new Container
-                        {
-                            Width = 22f,
-                            RelativeSizeAxes = Axes.Y,
-                        },
-                        new Container //todo: team banners
-                        {
-                            Width = 38f,
-                            RelativeSizeAxes = Axes.Y,
-                            CornerRadius = 2f,
-                            Masking = true,
-                            Children = new[]
-                            {
-                                new Box
-                                {
-                                    RelativeSizeAxes = Axes.Both,
-                                    Colour = OsuColour.FromHex(@"ad387e"),
-                                },
-                            },
-                        },
-                        new OsuSpriteText
-                        {
-                            Text = "hosted by",
-                            Anchor = Anchor.CentreLeft,
-                            Origin = Anchor.CentreLeft,
-                            TextSize = 14,
-                        },
-                        host = new OsuSpriteText
-                        {
-                            Anchor = Anchor.CentreLeft,
-                            Origin = Anchor.CentreLeft,
-                            TextSize = 14,
-                            Font = @"Exo2.0-BoldItalic",
-                        },
-                    },
-                },
-                levelRangeContainer = new FillFlowContainer
-                {
-                    Anchor = Anchor.CentreRight,
-                    Origin = Anchor.CentreRight,
-                    AutoSizeAxes = Axes.Both,
-                    Direction = FillDirection.Horizontal,
-                    Children = new[]
-                    {
-                        new OsuSpriteText
-                        {
-                            Text = rankPrefix,
-                            TextSize = 14,
-                        },
-                        new OsuSpriteText
-                        {
-                            Text = "#",
-                            TextSize = 14,
-                        },
-                        levelRangeLower = new OsuSpriteText
-                        {
-                            TextSize = 14,
-                            Font = @"Exo2.0-Bold",
-                        },
-                        new OsuSpriteText
-                        {
-                            Text = " - ",
-                            TextSize = 14,
-                        },
-                        new OsuSpriteText
-                        {
-                            Text = "#",
-                            TextSize = 14,
-                        },
-                        levelRangeHigher = new OsuSpriteText
-                        {
-                            TextSize = 14,
-                            Font = @"Exo2.0-Bold",
-                        },
-                    },
-                },
-            };
-        }
-
-        [BackgroundDependencyLoader]
-        private void load(OsuColour colours)
-        {
-            levelRangeContainer.Colour = colours.Gray9;
-            host.Colour = colours.Blue;
-        }
-    }
-}
+using System.Collections.Generic;
+using System.Linq;
+using OpenTK;
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Graphics;
+using osu.Game.Graphics.Sprites;
+using osu.Game.Users;
+
+namespace osu.Game.Screens.Multiplayer
+{
+    public class ParticipantInfo : Container
+    {
+        private readonly Container flagContainer;
+        private readonly OsuSpriteText host;
+        private readonly FillFlowContainer levelRangeContainer;
+        private readonly OsuSpriteText levelRangeLower;
+        private readonly OsuSpriteText levelRangeHigher;
+
+        public User Host
+        {
+            set
+            {
+                host.Text = value.Username;
+                flagContainer.Children = new[] { new DrawableFlag(value.Country?.FlagName ?? @"__") { RelativeSizeAxes = Axes.Both } };
+            }
+        }
+
+        public IEnumerable<User> Participants
+        {
+            set
+            {
+                var ranks = value.Select(u => u.GlobalRank);
+                levelRangeLower.Text = ranks.Min().ToString();
+                levelRangeHigher.Text = ranks.Max().ToString();
+            }
+        }
+
+        public ParticipantInfo(string rankPrefix = null)
+        {
+            RelativeSizeAxes = Axes.X;
+            Height = 15f;
+
+            Children = new Drawable[]
+            {
+                new FillFlowContainer
+                {
+                    AutoSizeAxes = Axes.X,
+                    RelativeSizeAxes = Axes.Y,
+                    Direction = FillDirection.Horizontal,
+                    Spacing = new Vector2(5f, 0f),
+                    Children = new Drawable[]
+                    {
+                        flagContainer = new Container
+                        {
+                            Width = 22f,
+                            RelativeSizeAxes = Axes.Y,
+                        },
+                        new Container //todo: team banners
+                        {
+                            Width = 38f,
+                            RelativeSizeAxes = Axes.Y,
+                            CornerRadius = 2f,
+                            Masking = true,
+                            Children = new[]
+                            {
+                                new Box
+                                {
+                                    RelativeSizeAxes = Axes.Both,
+                                    Colour = OsuColour.FromHex(@"ad387e"),
+                                },
+                            },
+                        },
+                        new OsuSpriteText
+                        {
+                            Text = "hosted by",
+                            Anchor = Anchor.CentreLeft,
+                            Origin = Anchor.CentreLeft,
+                            TextSize = 14,
+                        },
+                        host = new OsuSpriteText
+                        {
+                            Anchor = Anchor.CentreLeft,
+                            Origin = Anchor.CentreLeft,
+                            TextSize = 14,
+                            Font = @"Exo2.0-BoldItalic",
+                        },
+                    },
+                },
+                levelRangeContainer = new FillFlowContainer
+                {
+                    Anchor = Anchor.CentreRight,
+                    Origin = Anchor.CentreRight,
+                    AutoSizeAxes = Axes.Both,
+                    Direction = FillDirection.Horizontal,
+                    Children = new[]
+                    {
+                        new OsuSpriteText
+                        {
+                            Text = rankPrefix,
+                            TextSize = 14,
+                        },
+                        new OsuSpriteText
+                        {
+                            Text = "#",
+                            TextSize = 14,
+                        },
+                        levelRangeLower = new OsuSpriteText
+                        {
+                            TextSize = 14,
+                            Font = @"Exo2.0-Bold",
+                        },
+                        new OsuSpriteText
+                        {
+                            Text = " - ",
+                            TextSize = 14,
+                        },
+                        new OsuSpriteText
+                        {
+                            Text = "#",
+                            TextSize = 14,
+                        },
+                        levelRangeHigher = new OsuSpriteText
+                        {
+                            TextSize = 14,
+                            Font = @"Exo2.0-Bold",
+                        },
+                    },
+                },
+            };
+        }
+
+        [BackgroundDependencyLoader]
+        private void load(OsuColour colours)
+        {
+            levelRangeContainer.Colour = colours.Gray9;
+            host.Colour = colours.Blue;
+        }
+    }
+}


Use SSL

Use SSL

Use SSL for pulling in jquery to ensure the page works properly when running the site on SSL

--- src/AlloyDemoKit/Views/FindPage/Index.cshtml
+++ src/AlloyDemoKit/Views/FindPage/Index.cshtml
@@ -7,9 +7,9 @@
 @{
     Layout = "~/Views/Shared/Layouts/_TwoPlusOne.cshtml";

-    ClientResources.RequireStyle("http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css");
-    ClientResources.RequireScript("http://code.jquery.com/jquery-1.9.1.js");
-    ClientResources.RequireScript("http://code.jquery.com/ui/1.10.3/jquery-ui.js");
+    ClientResources.RequireStyle("https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css");
+    ClientResources.RequireScript("https://code.jquery.com/jquery-1.9.1.js");
+    ClientResources.RequireScript("https://code.jquery.com/ui/1.10.3/jquery-ui.js");
 }

 <script language="javascript">
@@ -207,4 +207,4 @@
             </ul>
         </div>
     }
-}+}


Normalize with new line

Normalize with new line

--- src/AngleSharp.Css.Tests/Styling/CssSheet.cs
+++ src/AngleSharp.Css.Tests/Styling/CssSheet.cs
@@ -101,7 +101,7 @@
         [Test]
         public void CssSheetIgnoreVendorPrefixes()
         {
-            var css = @".something {
+            var css = @".something {
   -o-border-radius: 5px;
   -webkit-border-radius: 5px;
   border-radius: 5px;
@@ -540,7 +540,7 @@
                 Assert.AreEqual(names[i], decl.Name);
                 Assert.AreEqual(propertyName, decl.Name);
                 Assert.IsFalse(decl.IsImportant);
-                Assert.AreEqual("20px", decl.Value);
+                Assert.AreEqual("20px", decl.Value);
             }
         }

@@ -859,7 +859,7 @@
             var css = "@-ms-viewport{width:device-width} .dsip { display: block; }";
             var doc = ParseStyleSheet(css, options);
             var result = doc.ToCss();
-            Assert.AreEqual("@-ms-viewport{width:device-width}\r\n.dsip { display: block }", result);
+            Assert.AreEqual("@-ms-viewport{width:device-width}" + Environment.NewLine + ".dsip { display: block }", result);
         }

         [Test]
@@ -868,7 +868,7 @@
             var css = "@media screen and (max-width: 400px) {  @-ms-viewport { width: 320px; }  }  .dsip { display: block; }";
             var doc = ParseStyleSheet(css);
             var result = doc.ToCss();
-            Assert.AreEqual("@media screen and (max-width: 400px) { }\r\n.dsip { display: block }", result);
+            Assert.AreEqual("@media screen and (max-width: 400px) { }" + Environment.NewLine + ".dsip { display: block }", result);
         }

         [Test]
@@ -882,7 +882,7 @@
             var css = "@media screen and (max-width: 400px) {  @-ms-viewport { width: 320px; }  }  .dsip { display: block; }";
             var doc = ParseStyleSheet(css, options);
             var result = doc.ToCss();
-            Assert.AreEqual("@media screen and (max-width: 400px) { @-ms-viewport { width: 320px; } }\r\n.dsip { display: block }", result);
+            Assert.AreEqual("@media screen and (max-width: 400px) { @-ms-viewport { width: 320px; } }" + Environment.NewLine + ".dsip { display: block }", result);
         }

         [Test]
@@ -890,10 +890,10 @@
         {
             var s = ParseStyleSheet(String.Empty);
             Assert.AreEqual(0, s.Rules.Length);
-
+
             s.Insert("a {color: blue}", 0);
             Assert.AreEqual(1, s.Rules.Length);
-
+
             s.Insert("a *:first-child, a img {border: none}", 1);
             Assert.AreEqual(2, s.Rules.Length);


Update FindInScopeAttribute

Update FindInScopeAttribute

--- src/Atata/Attributes/FindInScopeAttribute.cs
+++ src/Atata/Attributes/FindInScopeAttribute.cs
@@ -10,6 +10,6 @@
             Scope = scope;
         }

-        public ScopeSource Scope { get; set; }
+        public ScopeSource Scope { get; private set; }
     }
 }


fix some more

fix some more

--- src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs
+++ src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs
@@ -108,6 +108,7 @@
             }
             else if (_serviceConnected & obj.NewOwner is null)
             {
+                DestroyTrayIcon();
                 _serviceConnected = false;
             }
         }
@@ -137,7 +138,6 @@
             _statusNotifierItemDbusObj.SetIcon(_icon);

             _statusNotifierItemDbusObj.ActivationDelegate += OnClicked;
-            _isVisible = true;
         }

         private void DestroyTrayIcon()
@@ -147,7 +147,6 @@

             _connection.UnregisterObject(_statusNotifierItemDbusObj);
             _connection.UnregisterServiceAsync(_sysTrayServiceName);
-            _isVisible = false;
         }

         public void Dispose()
@@ -197,6 +196,8 @@
             {
                 DestroyTrayIcon();
             }
+
+            _isVisible = visible;
         }

         public void SetToolTipText(string? text)


Added some xml code comments on SaveAsync methods.

--- src/AzureCloudTable.Api/CloudTableContext.cs
+++ src/AzureCloudTable.Api/CloudTableContext.cs
@@ -453,8 +453,21 @@
             ExecuteTableOperation(domainEntities, typeOfSave);
         }

+        /// <summary>
+        /// Asynchronously writes the domain entity to the Table based on the kind of Table Operation specified in the SaveType enum.
+        /// </summary>
+        /// <param name="domainEntity"></param>
+        /// <param name="typeOfSave"></param>
+        /// <returns></returns>
         public async Task SaveAsync(TDomainEntity domainEntity, SaveType typeOfSave) { await ExecuteTableOperationAsync(domainEntity, typeOfSave); }

+        /// <summary>
+        /// Asynchronously writes the domain entities to their respective tables based on the kind of table operation specified by the
+        /// SaveType enum parameter.
+        /// </summary>
+        /// <param name="domainEntities"></param>
+        /// <param name="typeOfSave"></param>
+        /// <returns></returns>
         public async Task SaveAsync(IEnumerable<TDomainEntity> domainEntities, SaveType typeOfSave)
         {
             await ExecuteTableOperationAsync(domainEntities, typeOfSave);


Reverting to no-tray icon.

Reverting to no-tray icon.

--- src/BolognesePlayer/BologneseBootstrapper.cs
+++ src/BolognesePlayer/BologneseBootstrapper.cs
@@ -46,8 +46,9 @@
             _container.Singleton<IPomodoroSegmentFactory, PomodoroSegmentFactory>();
             _container.Singleton<IMediaManager, TrackManager>();
             _container.Singleton<ISongFactory, SongFactory>();
-            _container.PerRequest<IShell, TrayShellViewModel>();
-            _container.PerRequest<IConductActiveItem, ShellViewModel>("RealShell");
+            //_container.PerRequest<IShell, TrayShellViewModel>();
+            //_container.Singleton<IConductActiveItem, ShellViewModel>("RealShell");
+            _container.PerRequest<IShell, ShellViewModel>("RealShell");

             _container.Singleton<Alerter>();
             _container.Singleton<Screen, SmallPlayerViewModel>("player");
@@ -62,4 +63,4 @@
             DisplayRootViewFor<IShell>();
         }
     }
-}
+}


Add GetHashCode test for nint.

Add GetHashCode test for nint.

--- src/DotNetCross.NativeInts.Tests/nintTest.cs
+++ src/DotNetCross.NativeInts.Tests/nintTest.cs
@@ -1401,5 +1401,24 @@
             Assert.IsFalse(new nint(0).Equals((object)""));
             Assert.IsFalse(new nint(0).Equals((object)"test"));
         }
+
+        [TestMethod]
+        public void GetHashCode_nint()
+        {
+            Assert.AreEqual(-5, new nint(-5).GetHashCode());
+            Assert.AreEqual(-4, new nint(-4).GetHashCode());
+            Assert.AreEqual(-3, new nint(-3).GetHashCode());
+            Assert.AreEqual(-2, new nint(-2).GetHashCode());
+            Assert.AreEqual(-1, new nint(-1).GetHashCode());
+            Assert.AreEqual(0, new nint(0).GetHashCode());
+            Assert.AreEqual(1, new nint(1).GetHashCode());
+            Assert.AreEqual(2, new nint(2).GetHashCode());
+            Assert.AreEqual(3, new nint(3).GetHashCode());
+            Assert.AreEqual(4, new nint(4).GetHashCode());
+            Assert.AreEqual(5, new nint(5).GetHashCode());
+
+            Assert.AreEqual(int.MinValue, (nint)long.MaxValue.GetHashCode());
+            Assert.AreEqual(int.MinValue, (nint)long.MinValue.GetHashCode());
+        }
     }
-}
+    }


Timing issue in test fixed

Timing issue in test fixed

--- src/DotVVM.Samples.Tests/BasicSamplesTest.cs
+++ src/DotVVM.Samples.Tests/BasicSamplesTest.cs
@@ -1078,7 +1078,8 @@
             RunInAllBrowsers(browser =>
             {
                 browser.NavigateToUrl(BaseUrl + "Sample36");
-
+                Thread.Sleep(WaitTime);
+
                 Assert.AreEqual("test1", browser.FindAll("*[data-id=test1_marker]").Single().GetAttribute("id"));
                 Assert.AreEqual("test2", browser.FindAll("*[data-id=test2_marker]").Single().GetAttribute("id"));


Adding a parameterless constructor for 'TrailerPartLexer'

--- src/Http.Grammar/Rfc7230/TrailerPartLexer.cs
+++ src/Http.Grammar/Rfc7230/TrailerPartLexer.cs
@@ -10,6 +10,11 @@
     {
         private readonly ILexer<EndOfLine> endOfLineLexer;
         private readonly ILexer<HeaderField> headerFieldLexer;
+
+        public TrailerPartLexer()
+            : this(new HeaderFieldLexer(), new EndOfLineLexer())
+        {
+        }

         public TrailerPartLexer(ILexer<HeaderField> headerFieldLexer, ILexer<EndOfLine> endOfLineLexer)
             : base("trailer-part")


Updated Reader to throw an appropriate exception if someone attempts to use the source enumerator before calling GetEnumerator or after disposing.

--- test/BackLINQ.Tests/Reader.cs
+++ test/BackLINQ.Tests/Reader.cs
@@ -103,24 +103,34 @@
             }
         }

+        private IEnumerator<T> GetSourceEnumerator()
+        {
+            if (source != null && cursor == null)
+                throw new InvalidOperationException(/* GetEnumerator not called yet */);
+            if (source == null && cursor == null)
+                throw new ObjectDisposedException(GetType().FullName);
+
+            return cursor;
+        }
+
         bool IEnumerator.MoveNext()
         {
-            return cursor.MoveNext();
+            return GetSourceEnumerator().MoveNext();
         }

         void IEnumerator.Reset()
         {
-            cursor.Reset();
+            GetSourceEnumerator().Reset();
         }

         T IEnumerator<T>.Current
         {
-            get { return cursor.Current; }
+            get { return GetSourceEnumerator().Current; }
         }

         object IEnumerator.Current
         {
-            get { return ((IEnumerator<T>)this).Current; }
+            get { return ((IEnumerator<T>) this).Current; }
         }
     }


Use delegate instead of virtual methods in tour.

--- src/Itinero.Optimization/Tours/Typed/Tour.cs
+++ src/Itinero.Optimization/Tours/Typed/Tour.cs
@@ -21,6 +21,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using Itinero.Optimization.Algorithms;
+using System.Text;

 namespace Itinero.Optimization.Tours.Typed
 {
@@ -34,24 +35,33 @@
         private readonly Func<T, int> _getId;
         private readonly Func<int, T> _getVisit;

-        protected Tour(Tour tour)
-        {
+        protected Tour(Func<T, int> getId, Func<int, T> getVisit, Tour tour)
+        {
+            _getId = getId;
+            _getVisit = getVisit;
+
             _tour = tour;
         }

         /// <summary>
         /// Creates a new route based on the given array.
         /// </summary>
-        public Tour(IEnumerable<T> customers)
-        {
+        public Tour(Func<T, int> getId, Func<int, T> getVisit, IEnumerable<T> customers)
+        {
+            _getId = getId;
+            _getVisit = getVisit;
+
             _tour = new Tour(customers.Select(x => _getId(x)));
         }

         /// <summary>
         /// Creates a new route based on the given array.
         /// </summary>
-        public Tour(IEnumerable<T> customers, T? last)
-        {
+        public Tour(Func<T, int> getId, Func<int, T> getVisit, IEnumerable<T> customers, T? last)
+        {
+            _getId = getId;
+            _getVisit = getVisit;
+
             int? lastId = null;
             if (last.HasValue)
             {
@@ -348,7 +358,7 @@
         /// <returns></returns>
         public object Clone()
         {
-            return new Tour<T>(_tour);
+            return new Tour<T>(_getId, _getVisit, _tour);
         }

         /// <summary>
@@ -362,5 +372,38 @@
                 _tour.CopyFrom(typedCopy._tour);
             }
         }
+
+        /// <summary>
+        /// Returns a description of this route.
+        /// </summary>
+        /// <returns></returns>
+        public override string ToString()
+        {
+            T? previous = null;
+            var result = new StringBuilder();
+            foreach (var customer in this)
+            {
+                if (previous == null)
+                {
+                    result.Append('[');
+                    result.Append(customer);
+                    result.Append(']');
+                }
+                else if (!this.Last.HasValue || _getId(customer) != _getId(this.Last.Value))
+                {
+                    result.Append("->");
+                    result.Append(customer);
+                }
+                previous = customer;
+            }
+
+            if (this.Last.HasValue && this.Count > 1)
+            {
+                result.Append("->[");
+                result.Append(this.Last.Value);
+                result.Append("]");
+            }
+            return result.ToString();
+        }
     }
 }