fix RunCoroutine

fix RunCoroutine

--- Assets/Engine/Script/Common/API.cs
+++ Assets/Engine/Script/Common/API.cs
@@ -267,7 +267,7 @@
         API.StartCoroutine(doCoroutine(ins, func, args));
     }

-    private static IEnumerator doCoroutine(YieldInstruction ins, LuaFunction func, object args)
+    private static IEnumerator doCoroutine(YieldInstruction ins, LuaFunction func, params object[] args)
     {
         yield return ins;
         if (args != null)


Fixed NullReferenceException

Fixed NullReferenceException

If a package was to be updated, but the update couldn't be found in any
sources, it previously threw a null reference exception.  Now it detects
when it's null and outputs an error message, letting execution continue.

Added an error message for general packages not being found too,
although there was no exception in that case.

--- Assets/NuGet/Editor/NugetHelper.cs
+++ Assets/NuGet/Editor/NugetHelper.cs
@@ -696,8 +696,15 @@
                         // the installed version is older than the version to install, so update it
                         NugetPackage newPackage = GetSpecificPackage(package);

-                        LogVerbose("{0} {1} is installed, but need {2} or greater.  Updating to {3}", installedPackage.Id, installedPackage.Version, package.Version, newPackage.Version);
-                        Update(installedPackage, newPackage, false);
+                        if (newPackage != null)
+                        {
+                            LogVerbose("{0} {1} is installed, but need {2} or greater. Updating to {3}", installedPackage.Id, installedPackage.Version, package.Version, newPackage.Version);
+                            Update(installedPackage, newPackage, false);
+                        }
+                        else
+                        {
+                            Debug.LogErrorFormat("{0} {1} is installed, but need {2} or greater. Could not find appropriate package.", installedPackage.Id, installedPackage.Version, package.Version);
+                        }
                         return;
                     }
                     else
@@ -715,6 +722,10 @@
             if (foundPackage != null)
             {
                 Install(foundPackage, false);
+            }
+            else
+            {
+                Debug.LogErrorFormat("Could not find {0} {1} or greater.", package.Id, package.Version);
             }
         }


Start work on bullet controller

Start work on bullet controller

--- Assets/Scripts/BulletController.cs
+++ Assets/Scripts/BulletController.cs
@@ -3,13 +3,25 @@

 public class BulletController : MonoBehaviour {

+	private float speed;
+	public Transfrom target;
+
 	// Use this for initialization
 	void Start () {
-
+		speed = 5f;
 	}

 	// Update is called once per frame
 	void Update () {
-
+		Vector3 direction = target.position - this.transform.localPosition;
+		float distanceCurrentFrame = speed * Time.deltaTime;
+
+		if(direction.magnitude <= distanceCurrentFrame) {
+			// We reached the node
+			doBulletHit();
+		} else {
+			this.transform.Translate(direction.normalized * distanceCurrentFrame, Space.World);
+			/* this.transform.rotation = Quaternion.Lerp(this.transform.rotation, tar) */
+		}
 	}
 }


fix DrawDomino()

fix DrawDomino()

--- Assets/Scripts/PlayerController.cs
+++ Assets/Scripts/PlayerController.cs
@@ -530,12 +530,12 @@
         {
             while (!HasCardToPlay())
             {
-                //toFix
-//                if (tileController.DrawCard() != null)
-//                {
-                    dominoControllers.Add(tileController.DrawCard());
+                DominoController addedDomino = tileController.DrawCard();
+                if (addedDomino != null)
+                {
+                    dominoControllers.Add(addedDomino);
                     AddDomino();
-//                }
+                }

             }
         }


Implemented Scale animation coroutine

Implemented Scale animation coroutine


Added fractal Stuff

Added fractal Stuff

--- Assets/scripts/TerrainGenerator.cs
+++ Assets/scripts/TerrainGenerator.cs
@@ -53,6 +53,7 @@
 {
     private Voronoi voronoiGenerator;
     private Perlin perlinGenerator;
+    private RidgedMultifractal fractalGenerator;
     private Dictionary<float, int[]> plates;
     private float[,] map;
     private int width, height;
@@ -71,6 +72,12 @@
         perlinGenerator.Frequency = 0.006;
         perlinGenerator.Lacunarity = 5.5;
         perlinGenerator.Persistence = 0.15;
+
+        fractalGenerator = new RidgedMultifractal();
+        //fractalGenerator.Lacunarity = 2.5;
+        fractalGenerator.OctaveCount = 4;
+        fractalGenerator.Frequency = 0.01;
+
     }

     public override float [,] GenerateMap(int width, int height)
@@ -127,15 +134,18 @@
         float gradient_level = 0.0f;
         float gradient_curve = 0.0f;
         float perlin_value = 0.0f;
+        float fractal_value = 0.0f;
         float weight_coeff = 0.0f;
-        for (int y = 0; y < height; y++) {
-            for (int x = 0; x < width; x++) {
-
+        float base_coeff = 0.1f;
+        for (int y = 0; y < height; y++) {
+            for (int x = 0; x < width; x++) {
+
+                fractal_value = get_fractal_value(x, y);
                 perlin_value = get_perlin_value(x, y);

                 weight_coeff = get_weight(x, y);

-                h = perlin_value * weight_coeff;
+                h = fractal_value * weight_coeff + perlin_value * base_coeff;

                 if (h < 0.0f)
                     h = 0.0f;
@@ -152,12 +162,17 @@

     private float get_perlin_value(int x, int y)
     {
-        return (float) Math.Abs(perlinGenerator.GetValue((double) x, (double) y, 0.05));
+        return (float) ((perlinGenerator.GetValue((double) x, (double) y, 0.05) / 2.0 + 0.5));
+    }
+
+    private float get_fractal_value(int x, int y)
+    {
+        return (float) ((fractalGenerator.GetValue((double) x, (double) y, 0.5) / 2.0) + 0.5);
     }

     private float get_weight(int x, int y)
     {
-        float range = 100.0f;
+        float range = 200.0f;
         //return 1.0f;
         /*
         if (x > 10 && x < width - 10) {
@@ -182,10 +197,10 @@
         if (smallest_dist > bottom_dist)
             smallest_dist = bottom_dist;

-        if (smallest_dist > range)
-            return 0.1f;
+        if (smallest_dist >= range)
+            return 0.0f;

-        return (100.0f - smallest_dist) / 100.0f;
+        return (range - smallest_dist) / range;
     }

     private bool isBoundaryPoint(int x, int y)


214: 	Hosts moved to root (under Putty Sessions tree) are forever stuck there.  (Fix for bug introduced in 1.3.0.4)

git-svn-id: 67c3ee79c80598486550ce992e66ca9291e224ee@264 8d6e282c-8220-11de-b77e-d9b456c0130a

--- SuperPutty/SessionTreeview.cs
+++ SuperPutty/SessionTreeview.cs
@@ -767,8 +767,8 @@
                 nodePayload.Remove();

                 // add new
+                node.Nodes.Add(nodeNew);
                 UpdateSessionId(nodeNew, (SessionData)nodeNew.Tag); //
-                node.Nodes.Add(nodeNew);

                 // If this a folder, reset it's childrens sessionIds
                 if (IsFolderNode(nodeNew))


Use LINQ for retrieving unpaged list of questions

--- SurveyMonkeyApi/Containers.cs
+++ SurveyMonkeyApi/Containers.cs
@@ -86,20 +86,11 @@
         public string preview_url { get; set; }
         public string nickname { get; set; }
         public List<Page> pages { get; set; }
-
         public List<Question> questions
         {
             get
             {
-                List<Question> qs = new List<Question>();
-                foreach (var page in pages)
-                {
-                    foreach (var question in page.questions)
-                    {
-                        qs.Add(question);
-                    }
-                }
-                return qs;
+                return pages.SelectMany(page => page.questions).ToList();
             }
         }
     }


Changes to NumberRange

Changes to NumberRange

--- System/Utility/NumberRange.cs
+++ System/Utility/NumberRange.cs
@@ -1,21 +1,91 @@
-namespace VorliasEngine2D.System.Utility
+using System;
+
+namespace VorliasEngine2D.System.Utility
 {
-    public class NumberRange
+    /// <summary>
+    /// A number range
+    /// </summary>
+    public struct NumberRange
     {
+        static Random numberRangeRandom = new Random();
+
+        /// <summary>
+        /// The minimum value
+        /// </summary>
         public float Min
         {
             get; private set;
         }
+
+        /// <summary>
+        /// The maximum value
+        /// </summary>
         public float Max
         {
             get; private set;
         }

+        /// <summary>
+        /// A random value between the Min and Max value
+        /// </summary>
+        public float Random
+        {
+            get
+            {
+                return (float) numberRangeRandom.NextDouble() * (Max - Min) + Min;
+            }
+        }
+
+        /// <summary>
+        /// Whether or not the target NumberRange overlaps this number range
+        /// </summary>
+        /// <param name="other">The other number range</param>
+        /// <returns>True if the NumberRanges overlap</returns>
         public bool Overlaps(NumberRange other)
         {
             return !(other.Max < Min || other.Min > Max);
         }

+        /// <summary>
+        /// Whether or not the specified number is in the range
+        /// </summary>
+        /// <param name="value">The number to check</param>
+        /// <returns>True if the number is in range</returns>
+        public bool InRange(float value)
+        {
+            return (value >= Min) && (value <= Max);
+        }
+
+        /// <summary>
+        /// Gets the number clamped to this NumberRange
+        /// </summary>
+        /// <param name="value">The value to clamp</param>
+        /// <returns>The number, clamped</returns>
+        public float Clamped(float value)
+        {
+            if (value > Max)
+                return Max;
+            else if (value < Min)
+                return Min;
+            else
+                return value;
+        }
+
+        /// <summary>
+        /// Creates a NumberRange with a single value
+        /// </summary>
+        /// <param name="value">The value</param>
+        public NumberRange(float value)
+        {
+            Min = value;
+            Max = value;
+        }
+
+        /// <summary>
+        /// Creates a number range with a minimum and maximum
+        /// </summary>
+        /// <param name="min">The minimum value</param>
+        /// <param name="max">The maximum value</param>
         public NumberRange(float min, float max)
         {
             Min = min;


Had to comment out the InvokeOnAfterSaveProgress and InvokeOnAfterLoadProgress methods, they do not inject properly for me.

--- Libraries/Farmhand/Events/Save.cs
+++ Libraries/Farmhand/Events/Save.cs
@@ -36,11 +36,11 @@
             EventCommon.SafeInvoke(OnBeforeSave, null);
         }

-        [Hook(HookType.Exit, "StardewValley.SaveGame/<getSaveEnumerator>d__46", "MoveNext")]
+        /*[Hook(HookType.Exit, "StardewValley.SaveGame/<getSaveEnumerator>d__46", "MoveNext")]
         internal static void InvokeOnAfterSaveProgress([ThisBind] IEnumerator<int> @this)
         {
             EventCommon.SafeInvoke(OnAfterSaveProgress, null, new EventArgsOnAfterSaveProgress(@this.Current));
-        }
+        }*/

         [Hook(HookType.Entry, "StardewValley.SaveGame", "Load")]
         internal static bool InvokeOnBeforeLoad([InputBind(typeof(string), "filename")] string filename)


todas las macetas puestas

todas las macetas puestas


Attempt to fix errors when determining when to upload/compress files

--- TIReplayDownloader/Program.cs
+++ TIReplayDownloader/Program.cs
@@ -167,7 +167,7 @@
                                           {Description = DescriptionRegex.Match(response).Groups[1].Captures[0].Value};
                             if (dem.Description.Contains("3/3") || dem.Description.Contains("4/5") || dem.Description.Contains("5/5"))
                             {
-                                File.AppendAllText("downloaded.txt", (matchnum + 5000) + "\r\n");
+                                File.AppendAllText("uploadlist.txt", dem.Series + "\r\n");
                                 ConsoleExt.Log("{0} was not played.", matchnum);
                                 return new Demo();
                             }
@@ -255,11 +255,10 @@
                                                             AddHTML(demo);
                                                             HTMLRender.Render();
                                                             if ((Directory.GetFiles(Path.Combine(SaveDirectory, "TI3 - " + demo.Series))
-                                                                .Count(file => Path.GetExtension(path) == ".dem") >= demo.NumberOfGames ||
-                                                                // Magic numbers, this means the game after this was not played.
-                                                                (File.ReadAllText("downloaded.txt").Contains((matchnum + 5001).ToString())))
+                                                                .Count(file => Path.GetExtension(path) == ".dem") >= demo.NumberOfGames)
                                                                 && !File.Exists(Path.Combine(SaveDirectory, "TI3 - " + demo.Series + ".zip")))
                                                             {
+                                                                ConsoleExt.Log("Starting compression and upload of {0}.", matchnum);
                                                                 Compress(demo.Series);
                                                             }
                                                         }
@@ -448,7 +447,6 @@
                 .TrimEnd(new char[] { '=' });
         }

-        //TODO: Save all main event demo info to add back into HTML, or save the dict.
         static void AddHTML(Demo demo)
         {
             lock (HTMLRender.FormatStrings)


jobmanager back to not single instance

jobmanager back to not single instance

--- Manager/Manager/ManagerStarter.cs
+++ Manager/Manager/ManagerStarter.cs
@@ -14,7 +14,7 @@
 			builder.RegisterType<NodeManager>()
 				.As<INodeManager>();

-			builder.RegisterType<JobManager>().SingleInstance();
+			builder.RegisterType<JobManager>();

 			builder.RegisterType<HttpSender>()
 				.As<IHttpSender>();


change client list cookie to manually encode

--- source/Core/Configuration/Hosting/ClientListCookie.cs
+++ source/Core/Configuration/Hosting/ClientListCookie.cs
@@ -14,12 +14,14 @@
  * limitations under the License.
  */

+using IdentityModel;
 using IdentityServer3.Core.Extensions;
 using Microsoft.Owin;
 using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Text;

 namespace IdentityServer3.Core.Configuration.Hosting
 {
@@ -124,6 +126,12 @@
                 value = ".";
                 expires = DateTime.Now.AddYears(-1);
             }
+            else
+            {
+                // encode the value
+                var bytes = Encoding.UTF8.GetBytes(value);
+                value = Base64Url.Encode(bytes);
+            }

             var opts = new Microsoft.Owin.CookieOptions
             {
@@ -138,7 +146,28 @@

         string GetCookie()
         {
-            return this.ctx.Request.Cookies[CookieName];
+            var value = this.ctx.Request.Cookies[CookieName];
+
+            // the check here is to allow for handling cookies prior to manually encoding
+            if (!String.IsNullOrWhiteSpace(value) && !value.StartsWith("["))
+            {
+                try
+                {
+                    var bytes = Base64Url.Decode(value);
+                    value = Encoding.UTF8.GetString(bytes);
+                }
+                catch
+                {
+                }
+            }
+
+            if (!value.StartsWith("["))
+            {
+                // deal with double encoding or just invalid values
+                value = "";
+            }
+
+            return value;
         }
     }
 }


Refactor a while(true) loop in a fixed for.

--- box2d/Collision/b2TimeOfImpact.cs
+++ box2d/Collision/b2TimeOfImpact.cs
@@ -554,9 +554,9 @@
 					}

 					// Compute 1D root of: f(x) - target = 0
-					int rootIterCount = 0;
+					int rootIterCount;
 					float a1 = t1, a2 = t2;
-					while (true)
+					for (rootIterCount = 0; rootIterCount != 50; ++rootIterCount)
 					{
 						// Use a mix of the secant rule and bisection.
 						float t;
@@ -591,14 +591,8 @@
 							a2 = t;
 							s2 = s;
 						}
-
-						++rootIterCount;
+
 						++b2_toiRootIters;
-
-						if (rootIterCount == 50)
-						{
-							break;
-						}
 					}

 					b2_toiMaxRootIters = Math.Max(b2_toiMaxRootIters, rootIterCount);


Dispose Master view model in MasterDetailShellViewModel

--- src/AppShell/ViewModels/MasterDetailShellViewModel.cs
+++ src/AppShell/ViewModels/MasterDetailShellViewModel.cs
@@ -30,6 +30,9 @@
         public override void Dispose()
         {
             base.Dispose();
+
+            if (Master != null)
+                Master.Dispose();

             serviceDispatcher.Unsubscribe<IMasterDetailNavigationService>(this);
         }


Type version for System and ArchiveSystem bugfix

ARKADE-301

--- src/Arkivverket.Arkade.GUI/Models/GuiMetaDataModel.cs
+++ src/Arkivverket.Arkade.GUI/Models/GuiMetaDataModel.cs
@@ -220,7 +220,7 @@
             {
                 SystemName = systemName;
                 SystemVersion = systemVersion;
-                SystemVersion = systemType;
+                SystemType = systemType;
                 SystemTypeVersion = systemTypeVersion;
             }


Fix crash caused by passing null as constant value when creating Literal bound node

--- src/Compilers/Core/Portable/Compilation/Expression.cs
+++ src/Compilers/Core/Portable/Compilation/Expression.cs
@@ -46,7 +46,7 @@
                 return SynthesizeNumeric(((INamedTypeSymbol)type).EnumUnderlyingType, value);
             }

-            return null;
+            return ConstantValue.Bad;
         }

         public static BinaryOperationKind DeriveAdditionKind(ITypeSymbol type)


Changed to tag ILogger with plugin name

Changed to tag ILogger with plugin name

--- src/Core/NetFusion.Bootstrap/Plugins/ModuleContext.cs
+++ src/Core/NetFusion.Bootstrap/Plugins/ModuleContext.cs
@@ -62,7 +62,7 @@
             _compositeApp = compositeApp ?? throw new ArgumentNullException(nameof(compositeApp));

             Plugin = plugin ?? throw new ArgumentNullException(nameof(plugin));
-            Logger = _compositeApp.LoggerFactory.CreateLogger(plugin.Manifest.Name);
+            Logger = _compositeApp.LoggerFactory.CreateLogger(plugin.GetType().FullName);

             AppHost = compositeApp.AppHostPlugin;
             AllPluginTypes = FilteredTypesByPluginType();


fixed missing quotes

fixed missing quotes

--- tdsm-core/Entry.cs
+++ tdsm-core/Entry.cs
@@ -474,11 +474,11 @@
                 .WithPermissionNode("tdsm.group")
                 .WithDescription("Manage groups and their permissions")
                 .WithHelpText("add <group> <ApplyToGuests> <Parent> <R> <G> <B> <Prefix> <Suffix>")
-                .WithHelpText("remove <group>)
+                .WithHelpText("remove <group>")
                 .WithHelpText("addnode <group> <node> [deny]")
-                .WithHelpText("removenode <group> <node>)
+                .WithHelpText("removenode <group> <node>")
                 .WithHelpText("list")
-                .WithHelpText("listnodes <group>)
+                .WithHelpText("listnodes <group>")
                 .Calls(this.GroupPermission);
             AddCommand("user")
                 .WithAccessLevel(AccessLevel.OP)


Fix for automatically getting the identity of a newly inserted entity if it uses auto increment.


Handle missing reference pngs

Handle missing reference pngs

--- TestSuite/TestDisplay.xaml.cs
+++ TestSuite/TestDisplay.xaml.cs
@@ -34,9 +34,29 @@

             var device = CanvasDevice.GetSharedDevice(false);

-            data.ReferencePng = await CanvasBitmap.LoadAsync(device, new Uri(test.ReferencePngUri));
+            data.ReferencePng = await DownloadPng(device, new Uri(test.ReferencePngUri));

             return data;
+        }
+
+        private static async Task<CanvasBitmap> DownloadPng(CanvasDevice device, Uri uri)
+        {
+            try
+            {
+                return await CanvasBitmap.LoadAsync(device, uri);
+            }
+            catch (FileNotFoundException)
+            {
+                var rt = new CanvasRenderTarget(device, 480, 360, 96);
+
+                using (var ds = rt.CreateDrawingSession())
+                {
+                    ds.Clear(Colors.Transparent);
+                    ds.DrawLine(0, 0, (float)rt.Size.Width, (float)rt.Size.Height, Colors.Black, 1);
+                    ds.DrawLine(0, (float)rt.Size.Height, (float)rt.Size.Width, 0, Colors.Black, 1);
+                }
+                return rt;
+            }
         }

         TestDisplayData(SvgTest test)


Comment typo

Comment typo

--- src/DatenMeister.WPF/Forms/Base/ItemsTreeView.xaml.cs
+++ src/DatenMeister.WPF/Forms/Base/ItemsTreeView.xaml.cs
@@ -253,7 +253,7 @@

         /// <summary>
         /// Creates the treeview item for the given item.
-        /// If thie item is an object and contains additional items within the properties,
+        /// If this item is an object and contains additional items within the properties,
         /// these subitems are also creates as TreeViewItemss
         /// </summary>
         /// <param name="item"></param>


Improves error logging

Improves error logging

--- src/Elders.Cronus/Projections/ProjectionRepository.cs
+++ src/Elders.Cronus/Projections/ProjectionRepository.cs
@@ -97,7 +97,7 @@

                     if (result.HasError)
                     {
-                        log.Error("Failed to update projection because the projection version failed to load. Please replay the projection to restore the state. Self-heal hint!" + Environment.NewLine + $"\tProjectionName:{projectionName}" + Environment.NewLine + $"\tEvent:{@event}");
+                        log.Error("Failed to update projection because the projection version failed to load. Please replay the projection to restore the state. Self-heal hint!" + Environment.NewLine + result.Error + Environment.NewLine + $"\tProjectionName:{projectionName}" + Environment.NewLine + $"\tEvent:{@event}");
                     }
                 }
             }


Changeable Double Click Delay

Changeable Double Click Delay

--- MonoGameUi/BaseScreenComponent.cs
+++ MonoGameUi/BaseScreenComponent.cs
@@ -13,7 +13,10 @@
     /// </summary>
     public class BaseScreenComponent : DrawableGameComponent
     {
-        public const int DOUBLECLICKDELAY = 500;
+        /// <summary>
+        /// Maximaler Standard Delay zwischen zwei Clicks innerhalb eines Double Clicks.
+        /// </summary>
+        public const int DEFAULTDOUBLECLICKDELAY = 500;

         private ContainerControl root;

@@ -77,6 +80,11 @@
         /// Legt fest, ob es Keyboard Support geben soll.
         /// </summary>
         public bool KeyboardEnabled { get; set; }
+
+        /// <summary>
+        /// Gibt den maximalen Zeitraum in Millisekunden zwischen zwei Clicks an um einen Double Click auszulösen oder legt diesen fest.
+        /// </summary>
+        public int DoubleClickDelay { get; set; }

         /// <summary>
         /// Gibt den aktuellen Modus der Maus zurück.
@@ -110,6 +118,7 @@
             MouseEnabled = true;
             GamePadEnabled = true;
             TouchEnabled = true;
+            DoubleClickDelay = DEFAULTDOUBLECLICKDELAY;

 #if !ANDROID

@@ -323,7 +332,7 @@
                                 LeftMouseClick(leftClickArgs);

                             if (lastLeftClick.HasValue &&
-                                gameTime.TotalGameTime - lastLeftClick.Value < TimeSpan.FromMilliseconds(DOUBLECLICKDELAY))
+                                gameTime.TotalGameTime - lastLeftClick.Value < TimeSpan.FromMilliseconds(DoubleClickDelay))
                             {
                                 // Double Left Click
                                 MouseEventArgs leftDoubleClickArgs = new MouseEventArgs
@@ -394,7 +403,7 @@
                                 RightMouseClick(rightClickArgs);

                             if (lastRightClick.HasValue &&
-                                gameTime.TotalGameTime - lastRightClick.Value < TimeSpan.FromMilliseconds(DOUBLECLICKDELAY))
+                                gameTime.TotalGameTime - lastRightClick.Value < TimeSpan.FromMilliseconds(DoubleClickDelay))
                             {
                                 // Double Left Click
                                 MouseEventArgs rightDoubleClickArgs = new MouseEventArgs
@@ -666,7 +675,7 @@
                                     TouchTap(tapArgs);

                                 if (lastTouchTap.HasValue &&
-                                gameTime.TotalGameTime - lastLeftClick.Value < TimeSpan.FromMilliseconds(DOUBLECLICKDELAY))
+                                gameTime.TotalGameTime - lastLeftClick.Value < TimeSpan.FromMilliseconds(DoubleClickDelay))
                                 {
                                     // Double Tap
                                     TouchEventArgs doubleTapArgs = new TouchEventArgs


Change in unit tests initialization to work with case

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

--- Tests/Test_NUnit/WriteTest.cs
+++ Tests/Test_NUnit/WriteTest.cs
@@ -61,7 +61,7 @@
         public void TestSetup()
         {
             Northwind db = CreateDB();
-            db.ExecuteCommand("DELETE FROM Products WHERE ProductName like 'temp%'");
+            db.ExecuteCommand("DELETE FROM <<Products>> WHERE <<ProductName>> like 'temp%'");
         }
     }


Fixed Accounts Test

Fixed Accounts Test

--- src/Feature/Accounts/Tests/AccountsControllerTests.cs
+++ src/Feature/Accounts/Tests/AccountsControllerTests.cs
@@ -81,19 +81,19 @@

     [Theory]
     [AutoDbData]
-    public void LoginDialogShouldReturnViewIfNotValid(IAccountRepository repo, [NoAutoProperties] AccountsController controller, LoginInfo info)
-    {
-      var result = controller.LoginDialog(info);
+    public void _LoginShouldReturnViewIfNotValid(IAccountRepository repo, [NoAutoProperties] AccountsController controller, LoginInfo info)
+    {
+      var result = controller._Login(info);
       result.Should().BeOfType<ViewResult>();
     }

     [Theory]
     [AutoDbData]
-    public void LoginDialogShouldRedirectIfLoggedIn(Database db, [Content] DbItem item, [Frozen] IAccountRepository repo, LoginInfo info, INotificationService service, IAccountsSettingsService accountSetting)
+    public void _LoginShouldRedirectIfLoggedIn(Database db, [Content] DbItem item, [Frozen] IAccountRepository repo, LoginInfo info, INotificationService service, IAccountsSettingsService accountSetting)
     {
       var controller = new AccountsController(repo, service, accountSetting, null, null);
       repo.Login(string.Empty, string.Empty).ReturnsForAnyArgs(x => true);
-      var result = controller.LoginDialog(info);
+      var result = controller._Login(info);
       result.Should().BeOfType<JsonResult>();
       ((result as JsonResult).Data as LoginResult).RedirectUrl.Should().BeEquivalentTo(info.ReturnUrl);
     }


Whitespace.

Whitespace.

--- LerpHelper.cs
+++ LerpHelper.cs
@@ -3,7 +3,7 @@

 public class LerpHelper {

-    /*Returns a curve that starts rising quickly, then slows down as it approaches 1.
+    /* Returns a curve that starts rising quickly, then slows down as it approaches 1.
      * High velocity to one with deceleration.
      * percentProgress: Lerp between 0 and 1
      * steepness: How quickly the line rises initially. Larger values make it almost a right angle. Must be larger than 0.
@@ -18,7 +18,7 @@
         return curvePercent;
     }

-    /*Reverse of CurveToOneFastSlow
+    /* Reverse of CurveToOneFastSlow
      * Low velocity to zero with acceleration.
      * percentProgress: Lerp between 0 and 1
      * steepness: How quickly the line rises initially. Larger values make it almost a right angle. Must be larger than 0.
@@ -28,7 +28,7 @@
     }

-    /*Reverses the progress between 0 to 1.
+    /* Reverses the progress between 0 to 1.
      */
     public static float Reverse(float percentProgress) {
         return Mathf.Clamp01(1f - percentProgress);


Remove unneeded debug output

Remove unneeded debug output

--- MultiMiner.Win/Forms/MinerForm.cs
+++ MultiMiner.Win/Forms/MinerForm.cs
@@ -286,7 +286,6 @@

         private void DoRefreshViewFromViewModel()
         {
-            Debug.WriteLine(String.Format("{0}: {1}", Environment.TickCount, "RefreshViewFromViewModel"));
             PositionAdvancedAreaCloseButton();
             RefreshDetailsToggleButton();
             PositionCoinChooseLabels();


Removed unnecessary directives

Removed unnecessary directives

--- MyLibrary.CustomIO/CsvableBase.cs
+++ MyLibrary.CustomIO/CsvableBase.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Linq;
-using System.Text.RegularExpressions;
+using System.Linq;

 namespace MyLibrary.CustomIO
 {


replace not needed .ToList() to .ToArray()

--- LightWands.cs
+++ LightWands.cs
@@ -3308,7 +3308,7 @@
                 return this.notifications
                     .Where(n => n.Kind == NotificationKind.OnNext)
                     .Select(n => n.Value)
-                    .ToList();
+                    .ToArray();
             }
         }

@@ -3320,7 +3320,7 @@
                 return this.notifications
                     .Where(n => n.Kind == NotificationKind.OnError)
                     .Select(n => n.Exception)
-                    .ToList();
+                    .ToArray();
             }
         }

@@ -3329,7 +3329,7 @@
         {
             get
             {
-                return notifications.ToList();
+                return notifications.ToArray();
             }
         }


Altered parameter name retrieval so expression is only evaluated if an exception occurs

--- NUte.Core/Validation/Validator.cs
+++ NUte.Core/Validation/Validator.cs
@@ -10,8 +10,9 @@
     {
         private sealed class ParameterInfo<TValue>
         {
-            public string Name { get; set; }
             public TValue Value { get; set; }
+
+            public Func<string> Name { get; set; }
         }

         public static void NotNull(Expression<Func<object>> parameter, Action<string, string, bool> exception)
@@ -32,7 +33,7 @@

             if (string.IsNullOrEmpty(parameterInfo.Value) && exception != null)
             {
-                exception.Invoke("The parameter value is empty.", parameterInfo.Name, false);
+                exception.Invoke("The parameter value is empty.", parameterInfo.Name.Invoke(), false);
             }
         }

@@ -42,7 +43,7 @@

             if (string.IsNullOrWhiteSpace(parameterInfo.Value) && exception != null)
             {
-                exception.Invoke("The parameter value is whitespace.", parameterInfo.Name, false);
+                exception.Invoke("The parameter value is whitespace.", parameterInfo.Name.Invoke(), false);
             }
         }

@@ -65,11 +66,11 @@
         {
             var parameterInfo = NotNull(parameter, exception);

-            ValidateElements(parameterInfo.Name, parameterInfo.Value, false, false, exception);
+            ValidateElements(parameterInfo.Name.Invoke(), parameterInfo.Value, false, false, exception);

             if (parameterInfo.Value.Any(string.IsNullOrWhiteSpace) && exception != null)
             {
-                exception.Invoke("The parameter value contains at least one whitespace element.", parameterInfo.Name, false);
+                exception.Invoke("The parameter value contains at least one whitespace element.", parameterInfo.Name.Invoke(), false);
             }
         }

@@ -77,7 +78,7 @@
         {
             var parameterInfo = NotNull(parameter, exception);

-            ValidateElements(parameterInfo.Name, parameterInfo.Value, allowEmpty, allowNullElements, exception);
+            ValidateElements(parameterInfo.Name.Invoke(), parameterInfo.Value, allowEmpty, allowNullElements, exception);
         }

         private static void ValidateElements(string parameterName, IEnumerable parameterValue, bool allowEmpty, bool allowNullElements, Action<string, string, bool> exception)
@@ -105,7 +106,7 @@

             if (isEqual && exception != null)
             {
-                exception.Invoke(null, parameterInfo.Name, true);
+                exception.Invoke(null, parameterInfo.Name.Invoke(), true);
             }

             return parameterInfo;
@@ -123,8 +124,8 @@

             return new ParameterInfo<TValue>
                 {
-                    Name = GetParameterName(parameter),
-                    Value = @delegate.Invoke()
+                    Value = @delegate.Invoke(),
+                    Name = () => GetParameterName(parameter)
                 };
         }


ui finds and displays all types of scripts

--- src/Merge/src/SSDTDevPack.Merge/UI/MainWindow.xaml.cs
+++ src/Merge/src/SSDTDevPack.Merge/UI/MainWindow.xaml.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Reflection;
 using System.Text;
@@ -15,6 +16,7 @@
 using System.Windows.Shapes;
 using EnvDTE;
 using SSDTDevPack.Common.Enumerators;
+using SSDTDevPack.Common.ProjectItems;

 namespace SSDTDevPack.Merge.UI
 {
@@ -26,17 +28,23 @@
         public MainWindow()
         {
             InitializeComponent();
-
+
             if (Assembly.GetCallingAssembly().FullName != "WinFormHost.Merge, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
                 PopulateTreeview();
         }

+        private void ClearWindows()
+        {
+            ProjectItems.Items.Clear();
+        }
+
         public void PopulateTreeview()
         {
+            Dispatcher.Invoke(ClearWindows);
+
             var projects = new ProjectEnumerator().Get(ProjectType.SSDT);

             var root = Dispatcher.Invoke(() => new TreeViewItem());
-

             foreach (var project in projects)
             {
@@ -54,9 +62,50 @@

         private TreeViewItem GetProjectNode(Project project)
         {
-            var root = new TreeViewItem();
+            var root = Dispatcher.Invoke(() => new TreeViewItem());
+            Dispatcher.Invoke(() => CreateProjectDefaults(root, project));
+
+
+
+            return root;
+        }
+
+        private void CreateProjectDefaults(TreeViewItem root, Project project)
+        {
             root.Header = project.Name;
-            return root;
+
+            var preDeploy = GetScripts(project, "PreDeploy");
+            var postDeploy = GetScripts(project, "PostDeploy");
+            var other = GetScripts(project, "None");
+
+            root.Items.Add(preDeploy);
+            root.Items.Add(postDeploy);
+            root.Items.Add(other);
+
+        }
+
+        private TreeViewItem GetScripts(Project project, string type)
+        {
+            var node = new TreeViewItem();
+            node.Header = type;
+
+            foreach (ProjectItem item in new ProjectItemEnumerator().Get(project).Where(p => p.HasBuildAction(type)))
+            {
+                node.Items.Add(GetScriptNode(item));
+            }
+
+            return node;
+
+        }
+
+        private TreeViewItem GetScriptNode(ProjectItem item)
+        {
+            var node = new TreeViewItem();
+            node.Header = item.Name;
+
+            //parse the merge statements...
+
+            return node;
         }

         private void ToolbarRefresh_Click(object sender, RoutedEventArgs e)


fix thx to kong

fix thx to kong

--- src/NadekoBot/Modules/Searches/Commands/Translator.cs
+++ src/NadekoBot/Modules/Searches/Commands/Translator.cs
@@ -94,7 +94,7 @@
                 text = text?.Trim();
                 if (string.IsNullOrWhiteSpace(text))
                     throw new ArgumentException();
-                return await GoogleTranslator.Instance.Translate(text, from, to).ConfigureAwait(false);
+                return (await GoogleTranslator.Instance.Translate(text, from, to).ConfigureAwait(false)).SanitizeMentions();
             }

             public enum AutoDeleteAutoTranslate


Add backpressure ExistingPipe test

Add backpressure ExistingPipe test

--- src/Nerdbank.Streams.Tests/MultiplexingStreamTests.cs
+++ src/Nerdbank.Streams.Tests/MultiplexingStreamTests.cs
@@ -598,6 +598,49 @@
     }

     [Fact]
+    public async Task Backpressure_ExistingPipe()
+    {
+        const int backpressureThreshold = 80 * 1024;
+        var mx2Pipe = FullDuplexStream.CreatePipePair(new PipeOptions(pauseWriterThreshold: backpressureThreshold));
+        var mx1ChannelTask = this.mx1.OfferChannelAsync("a", this.TimeoutToken);
+        var mx2ChannelTask = this.mx2.AcceptChannelAsync(
+            "a",
+            new MultiplexingStream.ChannelOptions
+            {
+                ExistingPipe = mx2Pipe.Item1,
+                InputPipeOptions = new PipeOptions(pauseWriterThreshold: backpressureThreshold),
+            },
+            this.TimeoutToken);
+        var channels = await WhenAllSucceedOrAnyFail(mx1ChannelTask, mx2ChannelTask).WithCancellation(this.TimeoutToken);
+        var (a, b) = (channels[0], channels[1]);
+
+        // Write far more than would be allowed.
+        const int bytesWritten = backpressureThreshold * 5;
+        this.Logger.WriteLine("Writing {0} bytes.", bytesWritten);
+        Task<FlushResult> writeTask = a.Output.WriteAsync(new byte[bytesWritten], this.TimeoutToken).AsTask();
+
+        while (true)
+        {
+            var readResult = await mx2Pipe.Item2.Input.ReadAsync(this.TimeoutToken);
+            this.Logger.WriteLine("Read returned buffer with length: {0}", readResult.Buffer.Length);
+
+            if (readResult.Buffer.Length < bytesWritten)
+            {
+                // Demand more by claiming to have examined everything.
+                mx2Pipe.Item2.Input.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End);
+            }
+            else
+            {
+                // We got it all at once. So go ahead and consume it.
+                mx2Pipe.Item2.Input.AdvanceTo(readResult.Buffer.End);
+                break;
+            }
+        }
+
+        await writeTask;
+    }
+
+    [Fact]
     public async Task CanProperties()
     {
         var (s1, s2) = await this.EstablishChannelStreamsAsync(string.Empty);


Be a bit more aggressive in killing test process

--- src/OmniSharp.DotNetTest/Helpers/DotNetTestManager.cs
+++ src/OmniSharp.DotNetTest/Helpers/DotNetTestManager.cs
@@ -96,7 +96,10 @@

             if (!testProcess.HasExited)
             {
-                testProcess.Kill();
+                if (!testProcess.WaitForExit(3000))
+                {
+                    testProcess.KillAll();
+                }
             }

             return new RunDotNetTestResponse


Use ConcurrentDictionary in CachingScriptMetadataResolver

--- src/OmniSharp.Script/CachingScriptMetadataResolver.cs
+++ src/OmniSharp.Script/CachingScriptMetadataResolver.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Concurrent;
 using System.Collections.Immutable;
 using Microsoft.CodeAnalysis;

@@ -7,8 +7,8 @@
     public class CachingScriptMetadataResolver : MetadataReferenceResolver
     {
         private readonly MetadataReferenceResolver _defaultReferenceResolver;
-        private static Dictionary<string, ImmutableArray<PortableExecutableReference>> DirectReferenceCache = new Dictionary<string, ImmutableArray<PortableExecutableReference>>();
-        private static Dictionary<string, PortableExecutableReference> MissingReferenceCache = new Dictionary<string, PortableExecutableReference>();
+        private static ConcurrentDictionary<string, ImmutableArray<PortableExecutableReference>> DirectReferenceCache = new ConcurrentDictionary<string, ImmutableArray<PortableExecutableReference>>();
+        private static ConcurrentDictionary<string, PortableExecutableReference> MissingReferenceCache = new ConcurrentDictionary<string, PortableExecutableReference>();

         public CachingScriptMetadataResolver(MetadataReferenceResolver defaultReferenceResolver)
         {
@@ -29,35 +29,13 @@

         public override PortableExecutableReference ResolveMissingAssembly(MetadataReference definition, AssemblyIdentity referenceIdentity)
         {
-            if (MissingReferenceCache.ContainsKey(referenceIdentity.Name))
-            {
-                return MissingReferenceCache[referenceIdentity.Name];
-            }
-
-            var result = _defaultReferenceResolver.ResolveMissingAssembly(definition, referenceIdentity);
-            if (result != null)
-            {
-                MissingReferenceCache[referenceIdentity.Name] = result;
-            }
-
-            return result;
+            return MissingReferenceCache.GetOrAdd(referenceIdentity.Name, _ => _defaultReferenceResolver.ResolveMissingAssembly(definition, referenceIdentity));
         }

         public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties)
         {
             var key = $"{reference}-{baseFilePath}";
-            if (DirectReferenceCache.ContainsKey(key))
-            {
-                return DirectReferenceCache[key];
-            }
-
-            var result = _defaultReferenceResolver.ResolveReference(reference, baseFilePath, properties);
-            if (result.Length > 0)
-            {
-                DirectReferenceCache[key] = result;
-            }
-
-            return result;
+            return DirectReferenceCache.GetOrAdd(key, _ => _defaultReferenceResolver.ResolveReference(reference, baseFilePath, properties));
         }
     }
 }


add to do

add to do

--- MasterMind.cs
+++ MasterMind.cs
@@ -13,7 +13,10 @@
 using MasterMind.Components;
 using SharpDX;
 using Utility = MasterMind.Components.Utility;
-
+// TODO:
+// show teemo passive and shrooms
+// show pink ward
+// show ward ranges
 namespace MasterMind
 {
     public static class MasterMind


unquote option on readcsv to drop "z" lead/trail quotes

--- primitives.cs
+++ primitives.cs
@@ -2581,6 +2581,7 @@

             var limit = optionsDict.ContainsKey("limit") ? Int64.Parse(optionsDict["limit"]) : Int64.MaxValue;
             var delimiter = !optionsDict.ContainsKey("delimiter") ? ',' : Char.Parse(optionsDict["delimiter"].Replace("\\t", "\t"));
+            var unquote = optionsDict.ContainsKey("unquote");
             HashSet<string> keepColumns = null;
             if (optionsDict.ContainsKey("cols")) {
                 keepColumns = new HashSet<string>();
@@ -2602,6 +2603,9 @@

             var headerLine = File.ReadLines(fileName).First();
             headers = headerLine.Split(delimiter).Select(x=>x.Trim()).ToArray();
+            if (unquote) {
+                headers = headers.Select(x => x.Trim('\"')).ToArray();
+            }
             fieldCount = headers.Length;

             int[] manualTypes = null;
@@ -2625,7 +2629,9 @@
             if (manualTypes == null) {
                 foreach (var line in File.ReadLines(fileName).Skip(1)) {
                     var csv = line.Split(delimiter);
-
+                    if (unquote) {
+                        csv = csv.Select(x => x.Trim('\"')).ToArray();
+                    }
                     if (iLine++ > 1000 && iLine > limit) { break; }
                     for (var k = 0; k < fieldCount; k++) {
                         int n = 0;
@@ -2685,7 +2691,9 @@
             foreach (var line in File.ReadLines(fileName).Skip(1)) {

                 var csv = line.Split(delimiter);
-
+                if (unquote) {
+                    csv = csv.Select(x => x.Trim('\"')).ToArray();
+                }
                 if (rowCount >= limit) { break; }

                 rowCount++;


Fix font

Fix font

--- Nibbles.Shared/GameAppDelegate.cs
+++ Nibbles.Shared/GameAppDelegate.cs
@@ -8,7 +8,7 @@
 {
 	public class GameAppDelegate : CCApplicationDelegate
 	{
-		public const string MainFont = "fonts/Roboto-Light.tff";
+		public const string MainFont = "fonts/Roboto-Light.ttf";
 		#if __ANDROID__
 		public static Android.App.Activity CurrentActivity { get; set; }
 		#endif


Added regions to Win32ProcessConfig.

Added regions to Win32ProcessConfig.

--- NtApiDotNet/Win32/Win32Process.cs
+++ NtApiDotNet/Win32/Win32Process.cs
@@ -1067,6 +1067,7 @@
     /// </summary>
     public sealed class Win32Process : IDisposable
     {
+        #region Static Methods
         /// <summary>
         /// Create process with a token.
         /// </summary>
@@ -1236,6 +1237,7 @@
             };
             return CreateProcess(config);
         }
+        #endregion

         /// <summary>
         /// Dispose the process.
@@ -1244,13 +1246,7 @@
         {
             if (TerminateOnDispose)
             {
-                try
-                {
-                    Process?.Terminate(NtStatus.STATUS_PROCESS_IS_TERMINATING);
-                }
-                catch (NtException)
-                {
-                }
+                Process?.Terminate(NtStatus.STATUS_PROCESS_IS_TERMINATING, false);
             }
             Process?.Dispose();
             Thread?.Dispose();
@@ -1281,6 +1277,7 @@
             Process?.Terminate(exitcode);
         }

+        #region Public Properties
         /// <summary>
         /// The handle to the process.
         /// </summary>
@@ -1309,7 +1306,9 @@
         /// Get the process' exit status as an NtStatus code.
         /// </summary>
         public NtStatus ExitNtStatus => Process.ExitNtStatus;
-
+        #endregion
+
+        #region Public Operators
         /// <summary>
         /// Explicit conversion operator to an NtThread object.
         /// </summary>
@@ -1321,7 +1320,9 @@
         /// </summary>
         /// <param name="process">The win32 process</param>
         public static explicit operator NtProcess(Win32Process process) => process.Process;
-
+        #endregion
+
+        #region Constructors
         internal Win32Process(PROCESS_INFORMATION proc_info, bool terminate_on_dispose)
         {
             Process = NtProcess.FromHandle(new SafeKernelObjectHandle(proc_info.hProcess, true));
@@ -1330,5 +1331,6 @@
             Tid = proc_info.dwThreadId;
             TerminateOnDispose = terminate_on_dispose;
         }
+        #endregion
     }
 }


put controversial check back (fixes unit test)

--- src/SAML2.Core/Validation/Saml20StatementValidator.cs
+++ src/SAML2.Core/Validation/Saml20StatementValidator.cs
@@ -174,13 +174,15 @@
                         }

                         authnContextDeclRefFound = true;
-                        // I don't believe this is a valid check.  See: https://lists.oasis-open.org/archives/security-services/200703/msg00004.html
-                        //if (!Uri.IsWellFormedUriString((string)authnContext.Items[i], UriKind.Absolute))
-                        //{
-                        //    throw new Saml20FormatException("AuthnContextDeclRef has a value which is not a wellformed absolute uri");
-                        //}
-
-                        break;
+
+                        // There is some concern about this being a valid check.
+                        // See: https://lists.oasis-open.org/archives/security-services/200703/msg00004.html
+                        // http://saml2.codeplex.com/SourceControl/network/forks/etlerch/saml2/contribution/5740
+                        if (!Uri.IsWellFormedUriString((string)authnContext.Items[i], UriKind.Absolute)) {
+                            throw new Saml20FormatException("AuthnContextDeclRef has a value which is not a wellformed absolute uri");
+                        }
+
+                    break;
                     case Schema.Core.AuthnContextType.AuthnContextDecl:
                         throw new Saml20FormatException("AuthnContextDecl elements are not allowed in this implementation");
                     default:


core/NotNull: Minor refactor, use optional parameters in exception ctor

--- src/SQLite.Net/NotNullConstraintViolationException.cs
+++ src/SQLite.Net/NotNullConstraintViolationException.cs
@@ -28,12 +28,7 @@
 {
     public class NotNullConstraintViolationException : SQLiteException
     {
-        protected NotNullConstraintViolationException(Result r, string message)
-            : this(r, message, null, null)
-        {
-        }
-
-        protected NotNullConstraintViolationException(Result r, string message, TableMapping mapping, object obj)
+        protected NotNullConstraintViolationException(Result r, string message, TableMapping mapping = null, object obj = null)
             : base(r, message)
         {
             if (mapping != null && obj != null)


Added more tests for workspace and project

--- Toggl.Tests/TimeEntryTests.cs
+++ Toggl.Tests/TimeEntryTests.cs
@@ -129,7 +129,59 @@

             Assert.True(exp.Id==null);
         }
+
+        [Test]
+        public void HasProject()
+        {
+
+            var act = new TimeEntry()
+            {
+                Id = Constants.DefaultTimeEntryId,
+                Billable = true,
+                CreatedWith = "TimeEntryTestAdd",
+                Description = "Test Desc" + DateTime.Now.Ticks,
+                Duration = 1000,
+                Start = DateTime.Now.ToIsoDateStr(),
+                Stop = DateTime.Now.AddMinutes(20).ToIsoDateStr(),
+                Project = new Project { Id = Constants.DefaultProjectId }
+
+            };
+
+            var tmp = timeEntrySrv.Add(act);
+            Assert.IsNotNull(tmp);
+            var exp = timeEntrySrv.Get(tmp.Id.Value);
+            Assert.IsNotNull(exp);
+            Assert.IsNotNull(exp.Project);
+        }
+
+        [Test]
+        public void HasWorkspace()
+        {
+
+            var act = new TimeEntry()
+            {
+                Id = Constants.DefaultTimeEntryId,
+                Billable = true,
+                CreatedWith = "TimeEntryTestAdd",
+                Description = "Test Desc" + DateTime.Now.Ticks,
+                Duration = 1000,
+                Start = DateTime.Now.ToIsoDateStr(),
+                Stop = DateTime.Now.AddMinutes(20).ToIsoDateStr(),
+                Workspace = new Workspace(){Id=Constants.DefaultWorkspaceId}
+
+            };
+
+            var tmp = timeEntrySrv.Add(act);
+            Assert.IsNotNull(tmp);
+            var exp = timeEntrySrv.Get(tmp.Id.Value);
+            Assert.IsNotNull(exp);
+            Assert.IsNotNull(exp.Workspace);
+        }

     }

-}
+    }
+
+
+
+


Update PlayerTest.cs

Update PlayerTest.cs

--- UnitTestProject/PlayerTest.cs
+++ UnitTestProject/PlayerTest.cs
@@ -279,7 +279,7 @@
 		[TestMethod]
 		public void Compare_Save_Files()
 		{
-			Assert.Inconclusive("Code is temporarily stripped from project");
+			//Assert.Inconclusive("Code is temporarily stripped from project");
 			SaveData newSave = New_Save_File_With_Standard_Unit_Test_Values();

 			//SaveManager.Overwrite(newSave, 1);
@@ -446,7 +446,7 @@
 		[TestMethod]
 		public void SaveData_Load_Party()
 		{
-			Assert.Inconclusive("Code is temporarily stripped from project");
+			//Assert.Inconclusive("Code is temporarily stripped from project");
 			Overwrite_New_Save_File_With_Standard_Unit_Test_Values();

 			byte saveSlot = 0;
@@ -482,7 +482,7 @@
 		[TestMethod]
 		public void Player_Load_Party()
 		{
-			Assert.Inconclusive("Code is temporarily stripped from project");
+			//Assert.Inconclusive("Code is temporarily stripped from project");
 			Overwrite_New_Save_File_With_Standard_Unit_Test_Values();

 			byte saveSlot = 0;


Added more negative tests

Added more negative tests

--- UnitTests/Css/CssMediaList.cs
+++ UnitTests/Css/CssMediaList.cs
@@ -124,17 +124,73 @@
         public void AllFeatureMaxWidthMediaListMissingAnd()
         {
             var source = @"@media all (max-width:30px) {
-    h1 { color: green }
-}";
-            var sheet = CssParser.ParseStyleSheet(source);
-            Assert.AreEqual(0, sheet.CssRules.Length);
+    h1 { color: red }
+}";
+            var sheet = CssParser.ParseStyleSheet(source);
+            Assert.AreEqual(0, sheet.CssRules.Length);
+        }
+
+        [TestMethod]
+        public void NoMediaQueryGivenSkip()
+        {
+            var source = @"@media {
+    h1 { color: red }
+}";
+            var sheet = CssParser.ParseStyleSheet(source);
+            Assert.AreEqual(0, sheet.CssRules.Length);
+        }
+
+        [TestMethod]
+        public void NotNoMediaTypeOrExpressionSkip()
+        {
+            var source = @"@media not {
+    h1 { color: red }
+}";
+            var sheet = CssParser.ParseStyleSheet(source);
+            Assert.AreEqual(0, sheet.CssRules.Length);
+        }
+
+        [TestMethod]
+        public void OnlyNoMediaTypeOrExpressionSkip()
+        {
+            var source = @"@media only {
+    h1 { color: red }
+}";
+            var sheet = CssParser.ParseStyleSheet(source);
+            Assert.AreEqual(0, sheet.CssRules.Length);
+        }
+
+        [TestMethod]
+        public void MediaFeatureMissingSkip()
+        {
+            var source = @"@media () {
+    h1 { color: red }
+}";
+
+            var sheet = CssParser.ParseStyleSheet(source);
+            Assert.AreEqual(0, sheet.CssRules.Length);
+        }
+
+        [TestMethod]
+        public void MediaFeatureMissingSkipReadNext()
+        {
+            var source = @"@media () {
+    h1 { color: red }
+}
+h1 { color: green }";
+            var sheet = CssParser.ParseStyleSheet(source);
+            Assert.AreEqual(1, sheet.CssRules.Length);
+            Assert.IsInstanceOfType(sheet.CssRules[0], typeof(CSSStyleRule));
+            var style = (CSSStyleRule)sheet.CssRules[0];
+            Assert.AreEqual("green", style.Style.Color);
+            Assert.AreEqual("h1", style.SelectorText);
         }

         [TestMethod]
         public void FeatureMaxWidthMediaListMissingConnectedAnd()
         {
             var source = @"@media (max-width:30px) (min-width:10px) {
-    h1 { color: green }
+    h1 { color: red }
 }";
             var sheet = CssParser.ParseStyleSheet(source);
             Assert.AreEqual(0, sheet.CssRules.Length);
@@ -144,7 +200,7 @@
         public void TvScreenMediaListMissingComma()
         {
             var source = @"@media tv screen {
-    h1 { color: green }
+    h1 { color: red }
 }";
             var sheet = CssParser.ParseStyleSheet(source);
             Assert.AreEqual(0, sheet.CssRules.Length);
@@ -161,6 +217,22 @@
             Assert.IsInstanceOfType(sheet.CssRules[0], typeof(CSSMediaRule));
             var media = (CSSMediaRule)sheet.CssRules[0];
             Assert.AreEqual("all and (max-width: 30px)", media.ConditionText);
+            var list = media.Media;
+            Assert.AreEqual(1, list.Length);
+            Assert.AreEqual(1, media.CssRules.Length);
+        }
+
+        [TestMethod]
+        public void FeatureAspectRatioMediaList()
+        {
+            var source = @"@media (aspect-ratio: 16/9) {
+    h1 { color: green }
+}";
+            var sheet = CssParser.ParseStyleSheet(source);
+            Assert.AreEqual(1, sheet.CssRules.Length);
+            Assert.IsInstanceOfType(sheet.CssRules[0], typeof(CSSMediaRule));
+            var media = (CSSMediaRule)sheet.CssRules[0];
+            Assert.AreEqual("(aspect-ratio: 16 / 9)", media.ConditionText);
             var list = media.Media;
             Assert.AreEqual(1, list.Length);
             Assert.AreEqual(1, media.CssRules.Length);


Fixed Volume for Octaeder

Fixed Volume for Octaeder

--- VoxelEditor/View/ChunkMesh.cs
+++ VoxelEditor/View/ChunkMesh.cs
@@ -272,7 +272,8 @@

         public ChunkMesh(Chunk chunk, int sizeX = Constant.ChunkSizeX, int sizeY = Constant.ChunkSizeY, int sizeZ = Constant.ChunkSizeZ)
         {
-            sqrtHalf = (float)Math.Sqrt(0.5);
+            //sqrtHalf = (float)Math.Sqrt(0.5);
+            sqrtHalf = (float)Math.Sqrt((Math.Pow((Math.Pow(3/Math.Sqrt(2),1.0/3.0)),2))/2);

             for (int x = 0; x < sizeX; x++)
             {


Fix layout issues

Fix layout issues

--- WLEditor/MainForm.Designer.cs
+++ WLEditor/MainForm.Designer.cs
@@ -61,26 +61,24 @@
 			this.bToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
 			this.objectPictureBox = new System.Windows.Forms.PictureBox();
 			this.mainTable = new System.Windows.Forms.TableLayoutPanel();
-			this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
 			this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
 			this.tilesPictureBox = new System.Windows.Forms.PictureBox();
+			this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
 			this.LevelPanel.SuspendLayout();
 			((System.ComponentModel.ISupportInitialize)(this.levelPictureBox)).BeginInit();
 			this.menuStrip1.SuspendLayout();
 			((System.ComponentModel.ISupportInitialize)(this.objectPictureBox)).BeginInit();
 			this.mainTable.SuspendLayout();
-			this.tableLayoutPanel1.SuspendLayout();
 			this.flowLayoutPanel1.SuspendLayout();
 			((System.ComponentModel.ISupportInitialize)(this.tilesPictureBox)).BeginInit();
+			this.tableLayoutPanel1.SuspendLayout();
 			this.SuspendLayout();
 			//
 			// LevelPanel
 			//
-			this.LevelPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-			| System.Windows.Forms.AnchorStyles.Left)
-			| System.Windows.Forms.AnchorStyles.Right)));
 			this.LevelPanel.AutoScroll = true;
 			this.LevelPanel.Controls.Add(this.levelPictureBox);
+			this.LevelPanel.Dock = System.Windows.Forms.DockStyle.Fill;
 			this.LevelPanel.Location = new System.Drawing.Point(137, 3);
 			this.LevelPanel.Name = "LevelPanel";
 			this.LevelPanel.Size = new System.Drawing.Size(1069, 586);
@@ -89,10 +87,9 @@
 			//
 			// levelPictureBox
 			//
-			this.levelPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
 			this.levelPictureBox.Location = new System.Drawing.Point(0, 0);
 			this.levelPictureBox.Name = "levelPictureBox";
-			this.levelPictureBox.Size = new System.Drawing.Size(1069, 586);
+			this.levelPictureBox.Size = new System.Drawing.Size(4096, 512);
 			this.levelPictureBox.TabIndex = 2;
 			this.levelPictureBox.TabStop = false;
 			this.levelPictureBox.Paint += new System.Windows.Forms.PaintEventHandler(this.LevelPictureBoxPaint);
@@ -314,6 +311,30 @@
 			this.mainTable.Size = new System.Drawing.Size(1209, 592);
 			this.mainTable.TabIndex = 3;
 			//
+			// flowLayoutPanel1
+			//
+			this.flowLayoutPanel1.AutoSize = true;
+			this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+			this.flowLayoutPanel1.Controls.Add(this.tilesPictureBox);
+			this.flowLayoutPanel1.Controls.Add(this.objectPictureBox);
+			this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
+			this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+			this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
+			this.flowLayoutPanel1.Name = "flowLayoutPanel1";
+			this.flowLayoutPanel1.Size = new System.Drawing.Size(134, 332);
+			this.flowLayoutPanel1.TabIndex = 2;
+			//
+			// tilesPictureBox
+			//
+			this.tilesPictureBox.Location = new System.Drawing.Point(3, 3);
+			this.tilesPictureBox.Name = "tilesPictureBox";
+			this.tilesPictureBox.Size = new System.Drawing.Size(128, 256);
+			this.tilesPictureBox.TabIndex = 3;
+			this.tilesPictureBox.TabStop = false;
+			this.tilesPictureBox.Visible = false;
+			this.tilesPictureBox.Paint += new System.Windows.Forms.PaintEventHandler(this.ObjectsPictureBoxPaint);
+			this.tilesPictureBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ObjectsPictureBoxMouseDown);
+			//
 			// tableLayoutPanel1
 			//
 			this.tableLayoutPanel1.ColumnCount = 1;
@@ -328,30 +349,6 @@
 			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
 			this.tableLayoutPanel1.Size = new System.Drawing.Size(1209, 619);
 			this.tableLayoutPanel1.TabIndex = 8;
-			//
-			// flowLayoutPanel1
-			//
-			this.flowLayoutPanel1.AutoSize = true;
-			this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
-			this.flowLayoutPanel1.Controls.Add(this.tilesPictureBox);
-			this.flowLayoutPanel1.Controls.Add(this.objectPictureBox);
-			this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
-			this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
-			this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
-			this.flowLayoutPanel1.Name = "flowLayoutPanel1";
-			this.flowLayoutPanel1.Size = new System.Drawing.Size(134, 332);
-			this.flowLayoutPanel1.TabIndex = 2;
-			//
-			// tilesPictureBox
-			//
-			this.tilesPictureBox.Location = new System.Drawing.Point(3, 3);
-			this.tilesPictureBox.Name = "tilesPictureBox";
-			this.tilesPictureBox.Size = new System.Drawing.Size(128, 256);
-			this.tilesPictureBox.TabIndex = 3;
-			this.tilesPictureBox.TabStop = false;
-			this.tilesPictureBox.Visible = false;
-			this.tilesPictureBox.Paint += new System.Windows.Forms.PaintEventHandler(this.ObjectsPictureBoxPaint);
-			this.tilesPictureBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ObjectsPictureBoxMouseDown);
 			//
 			// MainForm
 			//
@@ -371,9 +368,9 @@
 			((System.ComponentModel.ISupportInitialize)(this.objectPictureBox)).EndInit();
 			this.mainTable.ResumeLayout(false);
 			this.mainTable.PerformLayout();
-			this.tableLayoutPanel1.ResumeLayout(false);
 			this.flowLayoutPanel1.ResumeLayout(false);
 			((System.ComponentModel.ISupportInitialize)(this.tilesPictureBox)).EndInit();
+			this.tableLayoutPanel1.ResumeLayout(false);
 			this.ResumeLayout(false);
 			this.PerformLayout();


Buffer the complete result set in `Events.List()`, require a `count:` or default to 30 to match server default.

--- src/Seq.Api/Api/ResourceGroups/EventsResourceGroup.cs
+++ src/Seq.Api/Api/ResourceGroups/EventsResourceGroup.cs
@@ -1,7 +1,9 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Threading.Tasks;
 using Seq.Api.Model.Events;
+using Seq.Api.Model.Shared;
 using Seq.Api.Model.Signals;

 namespace Seq.Api.ResourceGroups
@@ -21,7 +23,54 @@

         public async Task<List<EventEntity>> ListAsync(
             string filter = null,
-            int? count = null,
+            int count = 30,
+            string startAtId = null,
+            string afterId = null,
+            bool render = false,
+            DateTime? fromDateUtc = null,
+            DateTime? toDateUtc = null,
+            int? shortCircuitAfter = null)
+        {
+            var parameters = new Dictionary<string, object> { { "count", count } };
+            if (filter != null) { parameters.Add("filter", filter); }
+            if (startAtId != null) { parameters.Add("startAtId", startAtId); }
+            if (afterId != null) { parameters.Add("afterId", afterId); }
+            if (render) { parameters.Add("render", true); }
+            if (fromDateUtc != null) { parameters.Add("fromDateUtc", fromDateUtc.Value); }
+            if (toDateUtc != null) { parameters.Add("toDateUtc", toDateUtc.Value); }
+            if (shortCircuitAfter != null) { parameters.Add("shortCircuitAfter", shortCircuitAfter.Value); }
+
+            var chunks = new List<List<EventEntity>>();
+            var remaining = count;
+
+            while (true)
+            {
+                var resultSet = await GroupGetAsync<ResultSetPart>("InSignal", parameters);
+                chunks.Add(resultSet.Events);
+                remaining -= resultSet.Events.Count;
+
+                if (remaining <= 0)
+                    break;
+
+                if (resultSet.Statistics.Status != ResultSetStatus.Partial)
+                    break;
+
+                parameters["afterId"] = resultSet.Statistics.LastReadEventId;
+                parameters["count"] = remaining;
+            }
+
+            var result = new List<EventEntity>(chunks.Sum(c => c.Count));
+            foreach (var evt in chunks.SelectMany(c => c))
+                result.Add(evt);
+
+            return result;
+        }
+
+        public async Task<ResultSetPart> InSignalAsync(
+            SignalEntity signal = null,
+            string[] intersectIds = null,
+            string filter = null,
+            int count = 30,
             string startAtId = null,
             string afterId = null,
             bool render = false,
@@ -29,35 +78,9 @@
             DateTime? toDateUtc = null,
             int? shortCircuitAfter = null)
         {
-            var parameters = new Dictionary<string, object>();
-            if (filter != null) { parameters.Add("filter", filter); }
-            if (count != null) { parameters.Add("count", count.Value); }
-            if (startAtId != null) { parameters.Add("startAtId", startAtId); }
-            if (afterId != null) { parameters.Add("afterId", afterId); }
-            if (render) { parameters.Add("render", true); }
-            if (fromDateUtc != null) { parameters.Add("fromDateUtc", fromDateUtc.Value); }
-            if (toDateUtc != null) { parameters.Add("toDateUtc", toDateUtc.Value); }
-            if (shortCircuitAfter != null) { parameters.Add("shortCircuitAfter", shortCircuitAfter.Value); }
-
-            return await GroupListAsync<EventEntity>("Items", parameters);
-        }
-
-        public async Task<ResultSetPart> InSignalAsync(
-            SignalEntity signal = null,
-            string[] intersectIds = null,
-            string filter = null,
-            int? count = null,
-            string startAtId = null,
-            string afterId = null,
-            bool render = false,
-            DateTime? fromDateUtc = null,
-            DateTime? toDateUtc = null,
-            int? shortCircuitAfter = null)
-        {
-            var parameters = new Dictionary<string, object>();
+            var parameters = new Dictionary<string, object>{{ "count", count }};
             if (intersectIds != null && intersectIds.Length > 0) { parameters.Add("intersectIds", string.Join(",", intersectIds)); }
             if (filter != null) { parameters.Add("filter", filter); }
-            if (count != null) { parameters.Add("count", count.Value); }
             if (startAtId != null) { parameters.Add("startAtId", startAtId); }
             if (afterId != null) { parameters.Add("afterId", afterId); }
             if (render) { parameters.Add("render", true); }
@@ -72,7 +95,7 @@
         public async Task<ResultSetPart> InSignalAsync(
             string[] intersectIds,
             string filter = null,
-            int? count = null,
+            int count = 30,
             string startAtId = null,
             string afterId = null,
             bool render = false,
@@ -82,9 +105,12 @@
         {
             if (intersectIds == null) throw new ArgumentNullException("intersectIds");

-            var parameters = new Dictionary<string, object> { { "intersectIds", string.Join(",", intersectIds) } };
+            var parameters = new Dictionary<string, object>
+            {
+                { "intersectIds", string.Join(",", intersectIds) },
+                { "count", count }
+            };
             if (filter != null) { parameters.Add("filter", filter); }
-            if (count != null) { parameters.Add("count", count.Value); }
             if (startAtId != null) { parameters.Add("startAtId", startAtId); }
             if (afterId != null) { parameters.Add("afterId", afterId); }
             if (render) { parameters.Add("render", true); }


Remove using.

Remove using.

--- src/Server/FileSystemContents/IFileContentsFactory.cs
+++ src/Server/FileSystemContents/IFileContentsFactory.cs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

-using System;
 using VsChromium.Core.Files;

 namespace VsChromium.Server.FileSystemContents {


Disable sporadically failing GetGCMemoryInfo test (#37995)

--- src/System.Runtime/tests/System/GCTests.netcoreapp.cs
+++ src/System.Runtime/tests/System/GCTests.netcoreapp.cs
@@ -26,6 +26,7 @@
             Assert.True((end - start) < 5 * size, $"Allocated too much: start: {start} end: {end} size: {size}");
         }

+        [ActiveIssue(37378)]
         [Fact]
         public static void GetGCMemoryInfo()
         {


Address PR feedback

Address PR feedback

--- src/System.Text.Encoding/tests/EncodingTestHelpers.cs
+++ src/System.Text.Encoding/tests/EncodingTestHelpers.cs
@@ -12,21 +12,8 @@

         public static void Encode(Encoding encoding, string chars, int index, int count, byte[] expected)
         {
-            byte[] fullArray = new byte[expected.Length + 4];
-            for (int i = 0; i < fullArray.Length; i++)
-            {
-                fullArray[i] = (byte)i;
-            }
-
             GetByteCount(encoding, chars, index, count, expected.Length);
-            GetBytes(encoding, chars, index, count, new byte[expected.Length], 0, expected);
-            GetBytes(encoding, chars, index, count, fullArray, 2, expected);
-
-            if (count == 0)
-            {
-                // If count == 0 should not throw even though the byteIndex is invalid
-                GetBytes(encoding, chars, index, count, new byte[10], 10, expected);
-            }
+            GetBytes(encoding, chars, index, count, expected);
         }

         private static void GetByteCount(Encoding encoding, string chars, int index, int count, int expected)
@@ -41,8 +28,26 @@
             // Use GetByteCount(char[], int, int)
             Assert.Equal(expected, encoding.GetByteCount(charArray, index, count));
         }
-
-        private static void GetBytes(Encoding encoding, string source, int index, int count, byte[] bytes, int byteIndex, byte[] expectedBytes)
+
+        private static void GetBytes(Encoding encoding, string source, int index, int count, byte[] expectedBytes)
+        {
+            byte[] fullArray = new byte[expectedBytes.Length + 4];
+            for (int i = 0; i < fullArray.Length; i++)
+            {
+                fullArray[i] = (byte)i;
+            }
+
+            VerifyGetBytes(encoding, source, index, count, new byte[expectedBytes.Length], 0, expectedBytes);
+            VerifyGetBytes(encoding, source, index, count, fullArray, 2, expectedBytes);
+
+            if (count == 0)
+            {
+                // If count == 0, GetBytes should not throw even though byteIndex is invalid
+                VerifyGetBytes(encoding, source, index, count, new byte[10], 10, expectedBytes);
+            }
+        }
+
+        private static void VerifyGetBytes(Encoding encoding, string source, int index, int count, byte[] bytes, int byteIndex, byte[] expectedBytes)
         {
             byte[] originalBytes = (byte[])bytes.Clone();

@@ -93,23 +98,8 @@

         public static void Decode(Encoding encoding, byte[] bytes, int index, int count, char[] expected)
         {
-            char[] fullArray = new char[expected.Length + 2];
-            for (int i = 0; i < fullArray.Length; i++)
-            {
-                fullArray[i] = (char)i;
-            }
-
             GetCharCount(encoding, bytes, index, count, expected.Length);
-
-            GetChars(encoding, bytes, index, count, new char[expected.Length], 0, expected);
-            GetChars(encoding, bytes, index, count, fullArray, 2, expected);
-
-            if (count == 0)
-            {
-                // If count == 0 should not throw even though the byteIndex is invalid
-                GetChars(encoding, bytes, index, count, new char[10], 10, expected);
-            }
-
+            GetChars(encoding, bytes, index, count, expected);
             GetString(encoding, bytes, index, count, new string(expected));
         }

@@ -124,7 +114,26 @@
             Assert.Equal(expected, encoding.GetCharCount(bytes, index, count));
         }

-        private static void GetChars(Encoding encoding, byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, char[] expectedChars)
+        private static void GetChars(Encoding encoding, byte[] bytes, int index, int count, char[]
+         expectedChars)
+        {
+            char[] fullArray = new char[expectedChars.Length + 4];
+            for (int i = 0; i < fullArray.Length; i++)
+            {
+                fullArray[i] = (char)i;
+            }
+
+            VerifyGetChars(encoding, bytes, index, count, new char[expectedChars.Length], 0, expectedChars);
+            VerifyGetChars(encoding, bytes, index, count, fullArray, 2, expectedChars);
+
+            if (count == 0)
+            {
+                // If count == 0, GetChars should not throw even though charIndex is invalid
+                VerifyGetChars(encoding, bytes, index, count, new char[10], 10, expectedChars);
+            }
+        }
+
+        private static void VerifyGetChars(Encoding encoding, byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, char[] expectedChars)
         {
             char[] originalChars = (char[])chars.Clone();


Fix too many slashes in Activtiy paths.

Fix too many slashes in Activtiy paths.

--- src/TraceEvent/Computers/StartStopActivityComputer.cs
+++ src/TraceEvent/Computers/StartStopActivityComputer.cs
@@ -620,7 +620,6 @@

             var processID = ActivityPathProcessID(guid);
             StringBuilder sb = Utilities.StringBuilderCache.Acquire();
-            sb.Append('/');
             if (processID != 0)
             {
                 sb.Append("/#");    // Use /# to mark the fact that the first number is a process ID.


Fixing a problem with rfc 3986 in 'dec-octet'

--- src/Uri.Grammar/dec-octet/DecimalOctetLexerFactory.cs
+++ src/Uri.Grammar/dec-octet/DecimalOctetLexerFactory.cs
@@ -104,7 +104,12 @@
             var l = this.sequenceLexerFactory.Create(k, d);

             // DIGIT / %x31-39 DIGIT / "1" 2DIGIT / "2" %x30-34 DIGIT / "25" %x30-35
-            var m = this.alternativeLexerFactory.Create(d, l, j, g, c);
+            //var m = this.alternativeLexerFactory.Create(d, l, j, g, c);
+
+            // MEMO: I reversed the rule, because the rule would never work with greedy matching
+
+            // "25" %x30-35 / "2" %x30-34 DIGIT / "1" 2DIGIT / %x31-39 DIGIT / DIGIT
+            var m = this.alternativeLexerFactory.Create(c, g, j, l, d);

             // dec-octet
             return new DecimalOctetLexer(m);


Fix CSP warnings in Firefox

Fix CSP warnings in Firefox

Fix content security policy warnings in Firefox.
ajax.cdnjs.com is warned for an object source which does not occur in
Chrome.
Firefox seems to want maxcdn.bootstrapcdn.com as a default source
despite Chrome not generating a warning and it being specified for
scripts, styles and fonts.

--- src/Website/Middleware/CustomHttpHeadersMiddleware.cs
+++ src/Website/Middleware/CustomHttpHeadersMiddleware.cs
@@ -141,14 +141,14 @@
         private static string BuildContentSecurityPolicy(bool isProduction, SiteOptions options)
         {
             var basePolicy = $@"
-default-src 'self';
+default-src 'self' maxcdn.bootstrapcdn.com;
 script-src 'self' ajax.googleapis.com cdnjs.cloudflare.com maxcdn.bootstrapcdn.com platform.linkedin.com platform.twitter.com www.google-analytics.com www.openhub.net 'unsafe-inline';
 style-src 'self' ajax.googleapis.com fonts.googleapis.com maxcdn.bootstrapcdn.com 'unsafe-inline';
 img-src 'self' stackoverflow.com static.licdn.com stats.g.doubleclick.net syndication.twitter.com www.google-analytics.com www.linkedin.com www.openhub.net data:;
 font-src 'self' ajax.googleapis.com fonts.googleapis.com fonts.gstatic.com maxcdn.bootstrapcdn.com;
 connect-src 'self' {GetApiOriginForContentSecurityPolicy(options)};
 media-src 'none';
-object-src cdnjs.cloudflare.com;
+object-src ajax.cdnjs.com cdnjs.cloudflare.com;
 child-src ghbtns.com platform.linkedin.com platform.twitter.com www.openhub.net;
 frame-ancestors 'none';
 form-action 'self';


Exposed getEndTime value

Exposed getEndTime value

Exposed endTime value for the trajectory to return the time of an impact

--- Plugin/API.cs
+++ Plugin/API.cs
@@ -15,6 +15,16 @@
             {
                 Settings.fetch.AlwaysUpdate = value;
             }
+        }
+
+        public static double? getEndTime()
+        {
+            foreach (var patch in Trajectory.fetch.patches)
+            {
+                if (patch.impactPosition.HasValue)
+                    return patch.endTime;
+            }
+            return null;
         }

         public static Vector3? getImpactPosition()


Fixed bad indexes when shrinking source list

--- PooledList.cs
+++ PooledList.cs
@@ -138,12 +138,12 @@
             currentData = newData;

             int existingItemsCount = currentItems.Count;
-            int newCount = currentData.Count;
+            int newCount = Mathf.Max(currentData.Count, existingItemsCount);

             ResizeList(currentItems, newCount);

             int itemIndex;
-            for (itemIndex = 0; itemIndex < newCount; ++itemIndex)
+            for (itemIndex = 0; itemIndex < currentData.Count; ++itemIndex)
             {
                 var dataValue = currentData[itemIndex];


download latest 'kcptun-client', when not exist

--- kcptun-gui/Controller/UpdateChecker.cs
+++ kcptun-gui/Controller/UpdateChecker.cs
@@ -163,7 +163,8 @@
             DownloadState state = new DownloadState
             {
                 release = release,
-                saveTo = Utils.GetTempPath(release.name)
+                saveTo = Utils.GetTempPath(release.name),
+                percent = 0
             };
             Download(state);
         }
@@ -174,7 +175,27 @@
             {
                 WebClient http = CreateWebClient();
                 http.DownloadFileCompleted += Http_DownloadFileCompleted;
+                http.DownloadProgressChanged += Http_DownloadProgressChanged;
+                state.percent = 0;
                 http.DownloadFileAsync(new Uri(state.release.browser_download_url), state.saveTo, state);
+                Console.WriteLine($"Downloading {state.release.browser_download_url}...");
+            }
+            catch (Exception ex)
+            {
+                Logging.LogUsefulException(ex);
+            }
+        }
+
+        private void Http_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
+        {
+            try
+            {
+                DownloadState state = (DownloadState)e.UserState;
+                if (state.percent != e.ProgressPercentage)
+                {
+                    state.percent = e.ProgressPercentage;
+                    Console.WriteLine($"{e.ProgressPercentage}%  {e.BytesReceived}/{e.TotalBytesToReceive} Bytes");
+                }
             }
             catch (Exception ex)
             {
@@ -332,6 +353,7 @@
         {
             public Release release;
             public string saveTo;
+            public int percent;
             public object userState;
         }


Fix TeamCity.SetParameter by introducing parameter specific setters

--- source/Nuke.Common/BuildServers/TeamCity.cs
+++ source/Nuke.Common/BuildServers/TeamCity.cs
@@ -146,9 +146,19 @@
             Write("buildNumber", number);
         }

-        public void SetParameter(string key, string value)
-        {
-            Write("setParameter", x => x.AddKeyValue(key, value));
+        public void SetConfigurationParameter(string name, string value)
+        {
+            Write("setParameter", x => x.AddKeyValue("name", name).AddKeyValue("value", value));
+        }
+
+        public void SetEnvironmentVariable(string name, string value)
+        {
+            Write("setParameter", x => x.AddKeyValue("name", $"env.{name}").AddKeyValue("value", value));
+        }
+
+        public void SetSystemProperty(string name, string value)
+        {
+            Write("setParameter", x => x.AddKeyValue("name", $"system.{name}").AddKeyValue("value", value));
         }

         public void AddStatisticValue(string key, string value)


Fix: IGDB links being imported with wrong labels

--- source/PlayniteServices/Models/IGDB/IGDB.cs
+++ source/PlayniteServices/Models/IGDB/IGDB.cs
@@ -21,9 +21,9 @@
         Android = 12,
         Steam = 13,
         Reddit = 14,
-        Discord = 15,
-        GooglePlus = 16,
-        Tumblr = 17,
+        Itch = 15,
+        Epic = 16,
+        GOG = 17,
         LinkedIn = 18,
         Pinterest = 19,
         SoundCloud = 20,


Fix: Uninstalled Uplay games don't have Uplay source assigned to them automatically #1536

--- source/Plugins/UplayLibrary/UplayLibrary.cs
+++ source/Plugins/UplayLibrary/UplayLibrary.cs
@@ -76,7 +76,8 @@
                     GameId = item.uplay_id.ToString(),
                     BackgroundImage = item.root.background_image,
                     Icon = item.root.icon_image,
-                    CoverImage = item.root.thumb_image
+                    CoverImage = item.root.thumb_image,
+                    Source = "Uplay"
                 };

                 games.Add(newGame);


Removed duplicate file

Removed duplicate file

--- source/xcite.logging/streams/StreamStore.cs
+++ source/xcite.logging/streams/StreamStore.cs
@@ -1,30 +0,0 @@
-using System;
-
-namespace xcite.logging.streams {
-    /// <summary> Provides access to all available instance of <see cref="ILogStream"/>. </summary>
-    public static class StreamStore {
-        private static readonly Type[] StreamTypes = {
-            typeof(ConsoleStream), typeof(DebugStream), typeof(FileStream),
-            typeof(TraceStream)
-        };
-
-        /// <summary>
-        /// Returns a new instance of <see cref="ILogStream"/> that owns
-        /// the specified <paramref name="shortName"/>.
-        /// </summary>
-        public static ILogStream GetStreamInstance(string shortName) {
-            if (string.IsNullOrEmpty(shortName)) return null;
-            string nmlc = shortName.ToLower();
-
-            for (int i = -1; ++i != StreamTypes.Length;) {
-                Type streamType = StreamTypes[i];
-                string fnlc = streamType.FullName?.ToLower();
-                if (fnlc == null) continue;
-
-                if (fnlc.EndsWith(nmlc)) return (ILogStream) Activator.CreateInstance(streamType);
-            }
-
-            return null;
-        }
-    }
-}


Add support for value of type JTokenType.Date

--- Nustache.Core/JValueIdentifier.cs
+++ Nustache.Core/JValueIdentifier.cs
@@ -61,7 +61,11 @@
                 return GetValue<double>(jValueType, jValue);
             }

-            return null;
+			if (typeOfValue == "Date") // JTokenType.Date
+			{
+				return GetValue<DateTime>(jValueType, jValue);
+			}
+			return null;
         }

         #endregion


updated seed controller comments

updated seed controller comments

--- Oak/Controllers/SeedController.cs
+++ Oak/Controllers/SeedController.cs
@@ -7,54 +7,49 @@

 namespace Oak.Controllers
 {
-    public class LocalOnly : ActionFilterAttribute
-    {
-        public override void OnActionExecuting(ActionExecutingContext filterContext)
-        {
-            if (!RunningLocally(filterContext)) filterContext.Result = new HttpNotFoundResult();
-        }
-
-        public bool RunningLocally(ActionExecutingContext filterContext)
-        {
-            return filterContext.RequestContext.HttpContext.Request.IsLocal;
-        }
-    }
-
+    /*
+     * Hi there.  This is where you define the schema for your database.  The nuget package rake-dot-net
+     * has two commands that hook into this class.  One is 'rake reset' and the other is 'rake sample'.
+     * The 'rake reset' command will drop all tables and regen your schema.  The 'rake sample' command
+     * will drop all tables, regen your schema and insert sample data you've specified.  To get started
+     * update the Scripts() method in the class below.
+     */
     public class Schema
     {
         /// <summary>
         /// Change this method to create your tables.  Take a look
-        /// at each method, CreateSampleTable(), CreateAnotherSampleTable(),
-        /// AlterSampleTable() and AdHocChange()...you'll want to replace
-        /// this with your own set of methods.
+        /// at each method, CreateSampleTable(), AlterSampleTable() and AdHocChange()...
+        /// you'll want to replace this with your own set of methods.
         /// </summary>
-        public IEnumerable<Func<string>> Scripts()
+        public IEnumerable<Func<dynamic>> Scripts()
         {
             yield return CreateSampleTable;

-            yield return CreateAnotherSampleTable;
+            yield return AlterSampleTable;

-            yield return AlterSampleTable;
+            yield return AdHocChange;
         }

-        //here is a sample of how to create a table
+        //here is a sample of how you create a table
+        //use Seed's CreateTable method
+        //when you create a new method, make sure you return it
+        //from the Scripts method body
         public string CreateSampleTable()
         {
             return Seed.CreateTable("SampleTable", new dynamic[]
             {
-                new { Id = "uniqueidentifier", PrimaryKey = true },
+                //create anonymous types for each column you want
+                new { Id = "int", Identity = true, PrimaryKey = true },
+                //here are other ways you can create a primary key column
+                //or new { Id = "uniqueidentifier", PrimaryKey = true },
+                //or Seed.Id(),
+                //or Seed.GuidId(),
+
+                //here is how you would create a column named Foo with a default value
                 new { Foo = "nvarchar(max)", Default = "Hello" },
+
+                //here is how you would create a nullable column
                 new { Bar = "int", Nullable = false }
-            });
-        }
-
-        //here is another sample of how to create a table
-        public string CreateAnotherSampleTable()
-        {
-            return Seed.CreateTable("AnotherSampleTable", new dynamic[]
-            {
-                new { Id = "int", Identity = true, PrimaryKey = true },
-                new { Foo = "nvarchar(max)", Default = "Hello", Nullable = false },
             });
         }

@@ -68,7 +63,8 @@
             });
         }

-        //different ad hoc queries
+        //you can run a suite of ad hoc queries by
+        //creating a method that returns an IEnumerable of string.
         public IEnumerable<string> AdHocChange()
         {
             //hey look, you can just do an ad hoc read
@@ -82,15 +78,15 @@
             var name = "select top 1 name from sysobjects".ExecuteScalar() as string;

             yield return "drop table SampleTable";
-
-            yield return "drop table AnotherSampleTable";
         }

+        //here is how you would create sample entries, if you have
+        //the rake-dot-net nuget package, you can run the command
+        //'rake sample' to generate these sample entries
         public void SampleEntries()
         {
             new
             {
-                Id = Guid.NewGuid(),
                 Title = "Hello World",
                 Body = "Lorem Ipsum"
             }.InsertInto("Blogs");
@@ -101,6 +97,10 @@
         public Schema(Seed seed) { Seed = seed; }
     }

+
+    //this class is the hook into the Schema class
+    //the PurgeDb(), All(), Export(), and SampleEntires() controller
+    //actions are all accessible via rake-dot-net
     [LocalOnly]
     public class SeedController : Controller
     {
@@ -161,4 +161,17 @@
             filterContext.ExceptionHandled = true;
         }
     }
+
+    public class LocalOnly : ActionFilterAttribute
+    {
+        public override void OnActionExecuting(ActionExecutingContext filterContext)
+        {
+            if (!RunningLocally(filterContext)) filterContext.Result = new HttpNotFoundResult();
+        }
+
+        public bool RunningLocally(ActionExecutingContext filterContext)
+        {
+            return filterContext.RequestContext.HttpContext.Request.IsLocal;
+        }
+    }
 }


Modified toggles for debug printing

Modified toggles for debug printing

--- CardboardInput/CardboardManager.cs
+++ CardboardInput/CardboardManager.cs
@@ -35,6 +35,7 @@
   public bool vibrateOnFocusChange = false;

   // Debug
+  public bool debugNotificationsEnabled = true;
   public bool debugChartsEnabled = false;
   public KeyCode debugMagnetKey = KeyCode.Space;
   public KeyCode debugOrientationKey = KeyCode.Tab;
@@ -80,7 +81,7 @@
     if (recentlyFocusedObject != FocusedObject()) ReportFocusChange();
     recentlyFocusedObject = FocusedObject();

-    if (Debug.isDebugBuild && debugChartsEnabled) {
+    if (debugChartsEnabled) {
       string charts = rawInput.MagnetReadingsChart() + "\n" + MagnetStateChart();
       Debug.Log(charts);
     }
@@ -90,7 +91,7 @@
     if (currentMagnetState == MagnetState.Up) {
       currentMagnetState = MagnetState.Down;
       OnMagnetDown(this, new CardboardEvent());
-      if (Debug.isDebugBuild) Debug.Log(" *** Magnet Down *** ");
+      if (debugNotificationsEnabled) Debug.Log(" *** Magnet Down *** ");
       if (vibrateOnMagnetDown) Vibrate();
       clickStartTime = Time.time;
     }
@@ -100,7 +101,7 @@
     if (currentMagnetState == MagnetState.Down) {
       currentMagnetState = MagnetState.Up;
       OnMagnetUp(this, new CardboardEvent());
-      if (Debug.isDebugBuild) Debug.Log(" *** Magnet Up *** ");
+      if (debugNotificationsEnabled) Debug.Log(" *** Magnet Up *** ");
       if (vibrateOnMagnetUp) Vibrate();
       CheckForClick();
     }
@@ -114,14 +115,14 @@

   private void ReportClick() {
     OnMagnetClicked(this, new CardboardEvent());
-    if (Debug.isDebugBuild) Debug.Log(" *** Magnet Click *** ");
+    if (debugNotificationsEnabled) Debug.Log(" *** Magnet Click *** ");
     if (vibrateOnMagnetClicked) Vibrate();
   }

   private void ReportTilt() {
     if (!tiltReported) {
       OnOrientationTilt(this, new CardboardEvent());
-      if (Debug.isDebugBuild) Debug.Log(" *** Orientation Tilt *** ");
+      if (debugNotificationsEnabled) Debug.Log(" *** Orientation Tilt *** ");
       if (vibrateOnOrientationTilt) Vibrate();
       tiltReported = true;
     }
@@ -129,7 +130,7 @@

   private void ReportFocusChange() {
     OnFocusChange(this, new CardboardEvent());
-    //if (Debug.isDebugBuild) Debug.Log(" *** Focus Changed *** ");
+    if (debugNotificationsEnabled) Debug.Log(" *** Focus Changed *** ");
     if (vibrateOnFocusChange) Vibrate();
     focusStartTime = Time.time;
   }


WPF - Rename WindowStateChanged to OnWindowStateChanged

Also tweak some of the comments

--- CefSharp.Wpf/ChromiumWebBrowser.cs
+++ CefSharp.Wpf/ChromiumWebBrowser.cs
@@ -41,7 +41,8 @@
         /// </summary>
         private HwndSource source;
         /// <summary>
-        /// The source window bound to window related EventHandlers
+        /// The HwndSource RootVisual (Window) - We store a reference
+        /// to unsubscribe event handlers
         /// </summary>
         private Window sourceWindow;
         /// <summary>
@@ -560,10 +561,11 @@
                     }

                     PresentationSource.RemoveSourceChangedHandler(this, PresentationSourceChangedHandler);
-                    // Release window event listeners if SourceChanged event wasn't received before disposal
+                    // Release window event listeners if PresentationSourceChangedHandler event wasn't
+                    // fired before Dispose
                     if (sourceWindow != null)
                     {
-                        sourceWindow.StateChanged -= WindowStateChanged;
+                        sourceWindow.StateChanged -= OnWindowStateChanged;
                         sourceWindow.LocationChanged -= OnWindowLocationChanged;
                         sourceWindow = null;
                     }
@@ -1592,7 +1594,7 @@
                     var window = source.RootVisual as Window;
                     if(window != null)
                     {
-                        window.StateChanged += WindowStateChanged;
+                        window.StateChanged += OnWindowStateChanged;
                         window.LocationChanged += OnWindowLocationChanged;
                         sourceWindow = window;
                     }
@@ -1607,14 +1609,14 @@
                 var window = args.OldSource.RootVisual as Window;
                 if (window != null)
                 {
-                    window.StateChanged -= WindowStateChanged;
+                    window.StateChanged -= OnWindowStateChanged;
                     window.LocationChanged -= OnWindowLocationChanged;
                     sourceWindow = null;
                 }
             }
         }

-        private void WindowStateChanged(object sender, EventArgs e)
+        private void OnWindowStateChanged(object sender, EventArgs e)
         {
             var window = (Window)sender;


Chordious.WPF: Fix update from github servers

--- Chordious.WPF/Utils/UpdateUtils.cs
+++ Chordious.WPF/Utils/UpdateUtils.cs
@@ -168,7 +168,10 @@
             using (WebClient client = new WebClient())
             {
                 client.Headers["User-Agent"] = _userAgent;
+                SecurityProtocolType oldType = ServicePointManager.SecurityProtocol;
+                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // Fix since Github only supports TLS1.2
                 client.DownloadFile(installerInfo.Url, msiPath);
+                ServicePointManager.SecurityProtocol = oldType;
             }

             string cmdFile = Path.Combine(tempPath, "UpdateChordious.cmd");


Allow directory searches to supply their own query id

--- OpenMetaverse/DirectoryManager.cs
+++ OpenMetaverse/DirectoryManager.cs
@@ -953,8 +953,12 @@
         /// <returns></returns>
         public UUID StartGroupSearch(string searchText, int queryStart)
         {
+            return StartGroupSearch(searchText, queryStart, UUID.Random());
+        }
+        public UUID StartGroupSearch(string searchText, int queryStart, UUID queryID)
+        {
             return StartGroupSearch(searchText, queryStart, DirFindFlags.Groups | DirFindFlags.IncludePG
-                | DirFindFlags.IncludeMature | DirFindFlags.IncludeAdult);
+                | DirFindFlags.IncludeMature | DirFindFlags.IncludeAdult, queryID);
         }

         /// <summary>
@@ -966,12 +970,16 @@
         /// <returns></returns>
         public UUID StartGroupSearch(string searchText, int queryStart, DirFindFlags flags)
         {
+            return  StartGroupSearch(searchText, queryStart, flags, UUID.Random());
+        }
+        public UUID StartGroupSearch(string searchText, int queryStart, DirFindFlags flags, UUID queryID)
+        {
             DirFindQueryPacket find = new DirFindQueryPacket();
             find.AgentData.AgentID = Client.Self.AgentID;
             find.AgentData.SessionID = Client.Self.SessionID;
             find.QueryData.QueryFlags = (uint)flags;
             find.QueryData.QueryText = Utils.StringToBytes(searchText);
-            find.QueryData.QueryID = UUID.Random();
+            find.QueryData.QueryID = queryID;
             find.QueryData.QueryStart = queryStart;

             Client.Network.SendPacket(find);
@@ -986,13 +994,17 @@
         /// <param name="queryStart"></param>
         /// <returns></returns>
         public UUID StartPeopleSearch(string searchText, int queryStart)
+        {
+            return StartPeopleSearch(searchText, queryStart, UUID.Random());
+        }
+        public UUID StartPeopleSearch(string searchText, int queryStart, UUID queryID)
         {
             DirFindQueryPacket find = new DirFindQueryPacket();
             find.AgentData.AgentID = Client.Self.AgentID;
             find.AgentData.SessionID = Client.Self.SessionID;
             find.QueryData.QueryFlags = (uint)DirFindFlags.People;
             find.QueryData.QueryText = Utils.StringToBytes(searchText);
-            find.QueryData.QueryID = UUID.Random();
+            find.QueryData.QueryID = queryID;
             find.QueryData.QueryStart = queryStart;

             Client.Network.SendPacket(find);


Fix issue preventing MVC gate to take a new dotnet cli

--- src/dotnet/commands/dotnet-compile/ManagedCompiler.cs
+++ src/dotnet/commands/dotnet-compile/ManagedCompiler.cs
@@ -114,7 +114,7 @@
                 var dependencyContext = new DependencyContextBuilder().Build(compilationOptions,
                     allExports,
                     allExports,
-                    string.IsNullOrEmpty(context.RuntimeIdentifier),
+                    args.PortableMode,
                     context.TargetFramework,
                     context.RuntimeIdentifier ?? string.Empty);