refactor GetDefaultBrowserPath method

refactor GetDefaultBrowserPath method

--- test/BizwebSharp.ConsoleTests/Infrastructure/Hepler.cs
+++ test/BizwebSharp.ConsoleTests/Infrastructure/Hepler.cs
@@ -13,37 +13,42 @@
             try
             {
                 //Read default browser path from userChoiceLKey
-                var userChoiceKey = Registry.CurrentUser.OpenSubKey(urlAssociation + @"\UserChoice", false);
+                using (var userChoiceKey = Registry.CurrentUser.OpenSubKey(urlAssociation + @"\UserChoice", false))
+                {
+                    if (userChoiceKey == null)
+                    {
+                        //Read default browser path from Win XP registry key
+                        using (var browserKey = Registry.ClassesRoot.OpenSubKey(@"HTTP\shell\open\command", false))
+                        {
+                            string path;
+                            if (browserKey == null)
+                            {
+                                using (var browserKey2 = Registry.CurrentUser.OpenSubKey(urlAssociation, false))
+                                {
+                                    path = browserKey2.GetValue(null) as string;
+                                }
+                            }
+                            else
+                            {
+                                path = browserKey.GetValue(null) as string;
+                            }

-                //If user choice was not found, try machine default
-                if (userChoiceKey == null)
-                {
-                    //Read default browser path from Win XP registry key
-                    var browserKey = Registry.ClassesRoot.OpenSubKey(@"HTTP\shell\open\command", false);
+                            return CleanifyBrowserPath(path);
+                        }
+                    }
+                    else
+                    {
+                        // user defined browser choice was found
+                        var progId = (userChoiceKey.GetValue("ProgId").ToString());
+                        userChoiceKey.Dispose();

-                    //If browser path wasn’t found, try Win Vista (and newer) registry key
-                    if (browserKey == null)
-                    {
-                        browserKey =
-                        Registry.CurrentUser.OpenSubKey(
-                        urlAssociation, false);
+                        // now look up the path of the executable
+                        var concreteBrowserKey = browserPathKey.Replace("$BROWSER$", progId);
+                        using (var kp = Registry.ClassesRoot.OpenSubKey(concreteBrowserKey, false))
+                        {
+                            return CleanifyBrowserPath(kp.GetValue(null) as string);
+                        }
                     }
-                    var path = CleanifyBrowserPath(browserKey.GetValue(null) as string);
-                    browserKey.Dispose();
-                    return path;
-                }
-                else
-                {
-                    // user defined browser choice was found
-                    var progId = (userChoiceKey.GetValue("ProgId").ToString());
-                    userChoiceKey.Dispose();
-
-                    // now look up the path of the executable
-                    var concreteBrowserKey = browserPathKey.Replace("$BROWSER$", progId);
-                    var kp = Registry.ClassesRoot.OpenSubKey(concreteBrowserKey, false);
-                    var browserPath = CleanifyBrowserPath(kp.GetValue(null) as string);
-                    kp.Dispose();
-                    return browserPath;
                 }
             }
             catch (Exception)


Cache Storage in HeadlessGameHost

Cache Storage in HeadlessGameHost

Fixes tests in osu!

--- osu.Framework.Desktop/Platform/HeadlessGameHost.cs
+++ osu.Framework.Desktop/Platform/HeadlessGameHost.cs
@@ -2,10 +2,7 @@
 // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

 using System.Collections.Generic;
-using osu.Framework.Allocation;
-using osu.Framework.Input;
 using osu.Framework.Input.Handlers;
-using osu.Framework.Statistics;
 using OpenTK;

 namespace osu.Framework.Desktop.Platform
@@ -17,14 +14,9 @@
     {
         public HeadlessGameHost(string gameName = @"", bool bindIPC = false) : base(gameName, bindIPC)
         {
-            Size = Vector2.One; //we may be expected to have a non-zero size by components we run.
+            Size = Vector2.One; //we may be expected to have a non-zero size by components we run.
             UpdateScheduler.Update();
-        }
-
-        [Initializer]
-        private void Load()
-        {
-            Storage = new DesktopStorage(string.Empty);
+            Dependencies.Cache(Storage = new DesktopStorage(string.Empty));
         }

         protected override void UpdateInitialize()


Cleanup length accessing to allow for null rows/cells

--- osu.Framework/Graphics/Containers/GridContainer.cs
+++ osu.Framework/Graphics/Containers/GridContainer.cs
@@ -16,6 +16,9 @@
         /// <summary>
         /// The content of this <see cref="GridContainer"/>, arranged in a 2D grid array, where each array
         /// of <see cref="Drawable"/>s represents a row and each element of that array represents a column.
+        /// <para>
+        /// Null elements are allowed to represent blank rows/cells.
+        /// </para>
         /// </summary>
         public Drawable[][] Content
         {
@@ -88,9 +91,8 @@
         private Cached cellLayout = new Cached();

         private CellContainer[,] cells = new CellContainer[0, 0];
-
-        private int totalColumns => Content.Max(c => c.Length);
-        private int totalRows => Content.Length;
+        private int cellRows => cells.GetLength(0);
+        private int cellColumns => cells.GetLength(1);

         /// <summary>
         /// Moves content from <see cref="Content"/> into cells.
@@ -99,6 +101,9 @@
         {
             if (cellContent.IsValid)
                 return;
+
+            int requiredRows = Content?.Length ?? 0;
+            int requiredColumns = requiredRows == 0 ? 0 : Content.Max(c => c?.Length ?? 0);

             // Clear cell containers without disposing, as the content might be reused
             foreach (var cell in cells)
@@ -109,16 +114,29 @@
             ClearInternal();
             cellLayout.Invalidate();

-            // Create the new cell containers
-            cells = new CellContainer[totalRows, totalColumns];
-            for (int r = 0; r < cells.GetLength(0); r++)
-                for (int c = 0; c < cells.GetLength(1); c++)
+            // Create the new cell containers and add content
+            cells = new CellContainer[requiredRows, requiredColumns];
+            for (int r = 0; r < cellRows; r++)
+                for (int c = 0; c < cellColumns; c++)
+                {
+                    // Add cell
                     AddInternal(cells[r, c] = new CellContainer());

-            // Transfer content into the new cell containers
-            for (int r = 0; r < Content.Length; r++)
-                for (int c = 0; c < Content[r].Length; c++)
+                    // Allow empty rows
+                    if (Content[r] == null)
+                        continue;
+
+                    // Allow non-square grids
+                    if (c >= Content[r].Length)
+                        continue;
+
+                    // Allow empty cells
+                    if (Content[r][c] == null)
+                        continue;
+
+                    // Add content
                     cells[r, c].Add(Content[r][c]);
+                }

             cellContent.Validate();
         }
@@ -137,8 +155,8 @@
                 cell.IsHeightDefined = false;
             }

-            int autoSizedRows = totalRows;
-            int autoSizedColumns = totalColumns;
+            int autoSizedRows = cellRows;
+            int autoSizedColumns = cellColumns;

             float definedWidth = 0;
             float definedHeight = 0;
@@ -148,10 +166,10 @@
             {
                 foreach (var d in columnDimensions)
                 {
-                    if (d.Index >= cells.GetLength(1))
-                        continue;
-
-                    for (int r = 0; r < cells.GetLength(0); r++)
+                    if (d.Index >= cellColumns)
+                        continue;
+
+                    for (int r = 0; r < cellRows; r++)
                     {
                         cells[r, d.Index].IsWidthDefined = true;

@@ -171,10 +189,10 @@
             {
                 foreach (var d in rowDimensions)
                 {
-                    if (d.Index >= cells.GetLength(0))
-                        continue;
-
-                    for (int c = 0; c < cells.GetLength(1); c++)
+                    if (d.Index >= cellRows)
+                        continue;
+
+                    for (int c = 0; c < cellColumns; c++)
                     {
                         cells[d.Index, c].IsHeightDefined = true;

@@ -197,8 +215,8 @@
             );

             // Add sizing to non-explicitly-defined columns and add positional offsets
-            for (int r = 0; r < cells.GetLength(0); r++)
-                for (int c = 0; c < cells.GetLength(1); c++)
+            for (int r = 0; r < cellRows; r++)
+                for (int c = 0; c < cellColumns; c++)
                 {
                     if (!cells[r, c].IsWidthDefined)
                         cells[r, c].Width = autoSize.X;


Add a basic guard against setting ScrollMethod too late in initialisation

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

+using System;
 using System.Collections.Generic;
 using System.Linq;
 using osu.Framework.Allocation;
@@ -50,9 +51,21 @@

         protected new ManiaRulesetConfigManager Config => (ManiaRulesetConfigManager)base.Config;

-        public ScrollVisualisationMethod ScrollMethod = ScrollVisualisationMethod.Sequential;
+        public ScrollVisualisationMethod ScrollMethod
+        {
+            get => scrollMethod;
+            set
+            {
+                if (IsLoaded)
+                    throw new InvalidOperationException($"Can't alter {nameof(ScrollMethod)} after ruleset is already loaded");

-        protected override ScrollVisualisationMethod VisualisationMethod => ScrollMethod;
+                scrollMethod = value;
+            }
+        }
+
+        private ScrollVisualisationMethod scrollMethod = ScrollVisualisationMethod.Sequential;
+
+        protected override ScrollVisualisationMethod VisualisationMethod => scrollMethod;

         private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>();
         private readonly Bindable<double> configTimeRange = new BindableDouble();


Remove another whitespace

Remove another whitespace

--- osu.Game/Overlays/Settings/Sections/SkinSection.cs
+++ osu.Game/Overlays/Settings/Sections/SkinSection.cs
@@ -143,7 +143,6 @@
             List<SkinInfo> userSkinsList = skinsList.GetRange(firstNonDefault + 1, skinsList.Count - (firstNonDefault + 1));
             skinsList.RemoveRange(firstNonDefault + 1, skinsList.Count - (firstNonDefault + 1));
             userSkinsList.Sort((a, b) => String.Compare(a.Name, b.Name, StringComparison.OrdinalIgnoreCase));
-
             skinsList.AddRange(userSkinsList);
             return skinsList;
         }


Test for property set forwarding

Test for property set forwarding

--- AngleSharp.Scripting.JavaScript.Tests/GeneratorTests.cs
+++ AngleSharp.Scripting.JavaScript.Tests/GeneratorTests.cs
@@ -1,6 +1,7 @@
 namespace AngleSharp.Scripting.JavaScript.Tests
 {
     using AngleSharp.Dom;
+    using AngleSharp.Dom.Css;
     using AngleSharp.Scripting.JavaScript.Generator;
     using NUnit.Framework;
     using System;
@@ -108,5 +109,29 @@
                 Assert.IsTrue(bindingFields.Any(m => m.Key == fields[i]));
             }
         }
+
+        [Test]
+        public void ICssMediaRuleShouldHaveCorrectForwardsToProperty()
+        {
+            var name = "CSSMediaRule";
+            var binding = GeneralExtensions.GetBindings(new Dictionary<String, List<Type>>
+            {
+                { name, ListOf(typeof(ICssMediaRule)) }
+            }).First() as BindingClass;
+            var bindingProperties = binding.GetAll<BindingProperty>();
+            var media = bindingProperties.Where(m => m.Key == "media").FirstOrDefault();
+            Assert.AreEqual(name, binding.Name);
+            Assert.AreEqual(0, binding.Constructors.Count());
+            Assert.AreEqual(0, binding.Deleters.Count());
+            Assert.AreEqual(0, binding.Getters.Count());
+            Assert.AreEqual(0, binding.Setters.Count());
+            Assert.IsNotNull(media);
+            Assert.IsFalse(media.Value.IsLenient);
+            Assert.AreEqual("Media", media.Value.OriginalName);
+            Assert.AreEqual("MediaText", media.Value.ForwardedTo);
+            Assert.IsTrue(media.Value.AllowGet);
+            Assert.IsFalse(media.Value.AllowSet);
+            Assert.AreEqual(typeof(IMediaList), media.Value.ValueType);
+        }
     }
 }


fixed incompatibility regarding manufacturer name and SteamVR 1.2.1

--- Assets/VRTK/Source/SDK/SteamVR/SDK_SteamVRController.cs
+++ Assets/VRTK/Source/SDK/SteamVR/SDK_SteamVRController.cs
@@ -909,7 +909,17 @@

         protected virtual string GetModelNumber(uint index)
         {
-            return (SteamVR.instance != null ? SteamVR.instance.GetStringProperty(ETrackedDeviceProperty.Prop_ModelNumber_String, index) : "").ToLower();
+            string modelNumber = "";
+            if (SteamVR.instance != null)
+            {
+
+#if VRTK_DEFINE_STEAMVR_PLUGIN_1_2_2_OR_NEWER
+                modelNumber = SteamVR.instance.GetStringProperty(ETrackedDeviceProperty.Prop_ModelNumber_String, index);
+#else
+                modelNumber = SteamVR.instance.hmd_ModelNumber;
+#endif
+            }
+            return modelNumber.ToLower();
         }
 #endif
     }


Removed image service DI

Removed image service DI

--- Collectively.Services.Remarks/Framework/Bootstrapper.cs
+++ Collectively.Services.Remarks/Framework/Bootstrapper.cs
@@ -79,7 +79,6 @@
                 builder.RegisterType<RemarkPhotoService>().As<IRemarkPhotoService>();
                 builder.RegisterType<UserService>().As<IUserService>();
                 builder.RegisterType<SocialMediaService>().As<ISocialMediaService>();
-                builder.RegisterType<ImageService>().As<IImageService>();
                 builder.RegisterType<UniqueNumberGenerator>().As<IUniqueNumberGenerator>().SingleInstance();
                 builder.RegisterInstance(_configuration.GetSettings<ExceptionlessSettings>()).SingleInstance();
                 builder.RegisterType<ExceptionlessExceptionHandler>().As<IExceptionHandler>().SingleInstance();


Only dispopse the local recoveryFile variable if it doesn't point to the _recoveryFile member variable

--- DataTanker/Core/PageManagement/FileSystemPageManager.cs
+++ DataTanker/Core/PageManagement/FileSystemPageManager.cs
@@ -76,7 +76,7 @@

         private static void EnsureFileExists(string fileName)
         {
-            if (File.Exists(fileName))
+            if (File.Exists(fileName))
                 return;

             using (File.Create(fileName))
@@ -119,7 +119,7 @@
                 _pagemap.Flush();

                 _storageStream.Seek(0, SeekOrigin.End);
-
+
                 _storageStream.Write(pageBytes, 0, _pageSize);
                 Flush(_storageStream);
             }
@@ -145,7 +145,7 @@
                 _pagemap.TruncateLastFreePageMarker();
                 _pagemap.Flush();

-
+
                 _storageStream.Seek(pageAllocation, SeekOrigin.Begin);
                 _storageStream.Write(pageBytes, 0, _pageSize);
                 Flush(_storageStream);
@@ -192,7 +192,7 @@
                     // write an allocation marker of reallocated page
                     _pagemap.WritePageAllocation(lastPageIndex, newPageAllocation);

-                    // write an allocation marker of first free page
+                    // write an allocation marker of first free page
                     _pagemap.WritePageAllocation(firstFreePage.Item2, -1);

                     // write a disk-to-virtual entry of reallocated page
@@ -222,7 +222,7 @@

         /// <summary>
         /// Gets or sets a maximum number of empty (removed) pages in a storage file.
-        /// When the number of empty pages exceeds this value, the vacuum
+        /// When the number of empty pages exceeds this value, the vacuum
         /// routine starts.
         /// </summary>
         public int MaxEmptyPages
@@ -266,7 +266,7 @@

         /// <summary>
         /// Switches page manager instance to the atomic operation mode.
-        /// In such a mode, all further changes can be applied all at once
+        /// In such a mode, all further changes can be applied all at once
         /// by calling ExitAtomicOperation() method or canceled.
         /// </summary>
         public void EnterAtomicOperation()
@@ -283,7 +283,7 @@
         {
             if (_deferredUpdatesMode)
             {
-                // write end marker to indicate that
+                // write end marker to indicate that
                 // one can playback the recovery records
                 // without risking to corrupt the storage
                 _recoveryFile.WriteFinalMarker();
@@ -343,7 +343,7 @@
                 if (_pagemap.GetPageAllocation(pageIndex) == -1)
                     return false;

-                if (_pagemap.IsPageRemoved(pageIndex))
+                if (_pagemap.IsPageRemoved(pageIndex))
                     return false;

                 return true;
@@ -399,7 +399,7 @@
         /// <summary>
         /// Fetches the page with specified index using provided array as a container.
         /// Callee should have full control over the sharing of content.
-        /// This method should used to reduce buffers reallocation.
+        /// This method should used to reduce buffers reallocation.
         /// </summary>
         /// <param name="pageIndex">An index of page</param>
         /// <param name="content">The content of creating page</param>
@@ -478,7 +478,7 @@
                     Flush(_storageStream);
                 }
             }
-            finally
+            finally
             {
                 Unlock();
             }
@@ -576,7 +576,7 @@

                 OpenExistingPageSpace();
             }
-            finally
+            finally
             {
                 Unlock();
             }
@@ -639,10 +639,9 @@
                 // reset recovery file in any way
                 recoveryFile.Reset();
             }
-            finally
-            {
-                if (_recoveryFile != null)
-                    recoveryFile.Dispose();
+            finally
+            {
+                DisposeIfNotMemberVariable(recoveryFile);
             }
         }

@@ -720,11 +719,17 @@
             Dispose(false);
         }

+        private void DisposeIfNotMemberVariable(RecoveryFile recoveryFile)
+        {
+            if (_recoveryFile == null)
+                recoveryFile.Dispose();
+        }
+
         /// <summary>
         /// Initializes a new instance of the FileSystemPageManager.
         /// </summary>
         /// <param name="pageSize"></param>
-        internal FileSystemPageManager(int pageSize)
+        internal FileSystemPageManager(int pageSize)
             : this (pageSize, false, 1)
         {
         }


Bug #973 name M and MS stars

Bug #973 name M and MS stars

--- EDDiscovery/EliteDangerous/JournalEvents/JournalScan.cs
+++ EDDiscovery/EliteDangerous/JournalEvents/JournalScan.cs
@@ -533,9 +533,11 @@
                 case EDStar.CHd:
                     return new Tuple<System.Drawing.Image, string>(EDDiscovery.Properties.Resources.C7III, string.Format("Carbon {0} star", StarType));

-                case EDStar.MS: //seen in log
-                case EDStar.S:   // seen in log
-                    return new Tuple<System.Drawing.Image, string>(EDDiscovery.Properties.Resources.DefaultStar, string.Format("Unknown Type {0} star", StarType));
+                case EDStar.MS: //seen in log https://en.wikipedia.org/wiki/S-type_star
+                    return new Tuple<System.Drawing.Image, string>(EDDiscovery.Properties.Resources.M5V, string.Format("Intermediate low Zirconium Monoxide Type {0} star", StarType));
+
+                case EDStar.S:   // seen in log, data from http://elite-dangerous.wikia.com/wiki/Stars
+                    return new Tuple<System.Drawing.Image, string>(EDDiscovery.Properties.Resources.DefaultStar, string.Format("Cool Giant Zirconium Monoxide rich Type {0} star", StarType));

                 // white dwarf
                 case EDStar.D:
@@ -553,7 +555,7 @@
                 case EDStar.DC:
                 case EDStar.DCV:
                 case EDStar.DX:
-                    return new Tuple<System.Drawing.Image, string>(EDDiscovery.Properties.Resources.DA6VII_White, string.Format("White Dwarf ({0}) star", StarType));
+                    return new Tuple<System.Drawing.Image, string>(EDDiscovery.Properties.Resources.DA6VII_White, string.Format("White Dwarf {0} star", StarType));

                 case EDStar.N:
                     return new Tuple<System.Drawing.Image, string>(EDDiscovery.Properties.Resources.Neutron_Star, "Neutron Star");


Fixed indices accessor to use ubyte or ushort and fixed min/max checks.


Ability to close the filter column by pressing the B button in fullscreen mode #2479


fix: Private methods aren't added as commands (#1773)

Fix breaking change introduced by #1521


cookies path

cookies path

--- freelunch.uk/Views/Shared/_Layout.cshtml
+++ freelunch.uk/Views/Shared/_Layout.cshtml
@@ -53,7 +53,7 @@
         }

         $('#consent').on('click', function () {
-            document.cookie = "cookies=yes; max-age=" + (5 * 365 * 24 * 60 * 60);
+            document.cookie = "cookies=yes; path=/; max-age=" + (5 * 365 * 24 * 60 * 60);
             $('#cookie-consent').slideUp('slow');
         });
         $('#learn-more').on('click', function () {
@@ -135,9 +135,6 @@
                                 @_username

-

-                            @Html.ActionLink("Privacy", "Privacy", "Home")
-


Remove on unnecessary null check

Remove on unnecessary null check

--- osu.Framework/Testing/DynamicClassCompiler.cs
+++ osu.Framework/Testing/DynamicClassCompiler.cs
@@ -176,7 +176,7 @@
                 {
                     ms.Seek(0, SeekOrigin.Begin);
                     CompilationFinished?.Invoke(
-                        Assembly.Load(ms.ToArray()).GetModules()[0]?.GetTypes().LastOrDefault(t => t.FullName == checkpointObject.GetType().FullName)
+                        Assembly.Load(ms.ToArray()).GetModules()[0].GetTypes().LastOrDefault(t => t.FullName == checkpointObject.GetType().FullName)
                     );
                 }
                 else


Improve code readability of FooterButtonRandom OnPressed

--- osu.Game/Screens/Select/FooterButtonRandom.cs
+++ osu.Game/Screens/Select/FooterButtonRandom.cs
@@ -39,7 +39,7 @@
         {
             rewindSearch = action == GlobalAction.SelectPreviousRandom;

-            if (action != GlobalAction.SelectNextRandom && !rewindSearch)
+            if (action != GlobalAction.SelectNextRandom && action != GlobalAction.SelectPreviousRandom)
             {
                 return false;
             }


Fix to order foreign keys by name to ensure consistency when comparing to a previous script.

--- model/Database.cs
+++ model/Database.cs
@@ -1036,7 +1036,7 @@
 			WriteSchemaScript(log);
 			WriteScriptDir("tables", Tables.ToArray(), log);
 			WriteScriptDir("table_types", TableTypes.ToArray(), log);
-			WriteScriptDir("foreign_keys", ForeignKeys.ToArray(), log);
+			WriteScriptDir("foreign_keys", ForeignKeys.OrderBy(x => x.Name).ToArray(), log);
 			foreach (var routineType in Routines.GroupBy(x => x.RoutineType)) {
 				var dir = routineType.Key.ToString().ToLower() + "s";
 				WriteScriptDir(dir, routineType.ToArray(), log);


Fix issue with invoking next middleware.

If websocket is handled, we don't want any further middleware. Only non-websocket requests should be passed to next middleware.

--- src/WebSocketManager/WebSocketManagerMiddleware.cs
+++ src/WebSocketManager/WebSocketManagerMiddleware.cs
@@ -23,7 +23,10 @@
         public async Task Invoke(HttpContext context)
         {
             if (!context.WebSockets.IsWebSocketRequest)
+            {
+                await _next.Invoke(context);
                 return;
+            }

             var socket = await context.WebSockets.AcceptWebSocketAsync().ConfigureAwait(false);
             await _webSocketHandler.OnConnected(socket).ConfigureAwait(false);
@@ -52,9 +55,6 @@
                 }

             });
-
-            //TODO - investigate the Kestrel exception thrown when this is the last middleware
-            //await _next.Invoke(context);
         }

         private async Task Receive(WebSocket socket, Action<WebSocketReceiveResult, string> handleMessage)


Add undo/redo for transitive reduction.

Add undo/redo for transitive reduction.

--- src/Zametek.ViewModel.ProjectPlan/MainViewModel.cs
+++ src/Zametek.ViewModel.ProjectPlan/MainViewModel.cs
@@ -850,7 +850,13 @@

         private async Task RunTransitiveReductionAsync()
         {
-            await Task.Run(() => m_CoreViewModel.RunTransitiveReduction()).ConfigureAwait(true);
+            await Task.Run(() =>
+            {
+                m_CoreViewModel.RecordRedoUndo(() =>
+                {
+                    m_CoreViewModel.RunTransitiveReduction();
+                });
+            }).ConfigureAwait(true);
         }

         private async Task RunAutoCompileAsync()


Fix null reference in new Package Console on install/uninstall.

Null reference occurred in MonoDevelop 5.2 since the latest code
listens for package install and uninstall events which did not have
the project set. Now the extended addin does not fire these events
when a PowerShell command is run in the console.

--- src/MonoDevelop.PackageManagement.Extensions/MonoDevelop.PackageManagement/ProcessPackageAction2.cs
+++ src/MonoDevelop.PackageManagement.Extensions/MonoDevelop.PackageManagement/ProcessPackageAction2.cs
@@ -68,12 +68,12 @@

 		protected void OnParentPackageInstalled ()
 		{
-			packageManagementEvents.OnParentPackageInstalled (Package, null);
+			//packageManagementEvents.OnParentPackageInstalled (Package, null);
 		}

 		protected void OnParentPackageUninstalled ()
 		{
-			packageManagementEvents.OnParentPackageUninstalled (Package, null);
+			//packageManagementEvents.OnParentPackageUninstalled (Package, null);
 		}

 		public void Execute ()


Fixes two problems, needing to use indexers on a dynamic, and a logic error that prevented the durable log files from being processed. (#266)

--- src/Serilog.Sinks.Elasticsearch/Sinks/ElasticSearch/Durable/Elasticsearch/ElasticsearchLogClient.cs
+++ src/Serilog.Sinks.Elasticsearch/Sinks/ElasticSearch/Durable/Elasticsearch/ElasticsearchLogClient.cs
@@ -35,7 +35,7 @@
             return await SendPayloadAsync(payload, true);
         }

-        public async Task<SentPayloadResult> SendPayloadAsync(List<string> payload,bool first)
+        public async Task<SentPayloadResult> SendPayloadAsync(List<string> payload, bool first)
         {
             try
             {
@@ -45,10 +45,10 @@
                 if (response.Success)
                 {
                     var cleanPayload = new List<string>();
-                    var invalidPayload = GetInvalidPayloadAsync(response, payload,out cleanPayload);
-                    if ((cleanPayload?.Any() ?? false) && first)
+                    var invalidPayload = GetInvalidPayloadAsync(response, payload, out cleanPayload);
+                    if ((cleanPayload?.Any() == false) && first)
                     {
-                        await SendPayloadAsync(cleanPayload,false);
+                        await SendPayloadAsync(cleanPayload, false);
                     }

                     return new SentPayloadResult(response, true, invalidPayload);
@@ -85,7 +85,8 @@
             bool hasErrors = false;
             foreach (dynamic item in items)
             {
-                long? status = item.index?.status;
+                var itemIndex = item?["index"];
+                long? status = itemIndex?["status"];
                 i++;
                 if (!status.HasValue || status < 300)
                 {
@@ -93,8 +94,8 @@
                 }

                 hasErrors = true;
-                var id = item.index?._id;
-                var error = item.index?.error;
+                var id = itemIndex?["_id"];
+                var error = itemIndex?["error"];
                 if (int.TryParse(id.Split('_')[0], out int index))
                 {
                     SelfLog.WriteLine("Received failed ElasticSearch shipping result {0}: {1}. Failed payload : {2}.", status, error?.ToString(), payload.ElementAt(index * 2 + 1));


Remove SynchronizedList

Remove SynchronizedList

Fixes #1859
As stated in the issue, SynchronizedList and its accompanying internal
method are not called or used at across the dotnet projects, so it can
be dropped with a heavy heart.

--- src/mscorlib/src/System/Collections/Generic/List.cs
+++ src/mscorlib/src/System/Collections/Generic/List.cs
@@ -1040,108 +1040,6 @@
                 }
             }
             return true;
-        }
-
-        internal static IList<T> Synchronized(List<T> list) {
-            return new SynchronizedList(list);
-        }
-
-        [Serializable()]
-        internal class SynchronizedList : IList<T> {
-            private List<T> _list;
-            private Object _root;
-
-            internal SynchronizedList(List<T> list) {
-                _list = list;
-                _root = ((System.Collections.ICollection)list).SyncRoot;
-            }
-
-            public int Count {
-                get {
-                    lock (_root) {
-                        return _list.Count;
-                    }
-                }
-            }
-
-            public bool IsReadOnly {
-                get {
-                    return ((ICollection<T>)_list).IsReadOnly;
-                }
-            }
-
-            public void Add(T item) {
-                lock (_root) {
-                    _list.Add(item);
-                }
-            }
-
-            public void Clear() {
-                lock (_root) {
-                    _list.Clear();
-                }
-            }
-
-            public bool Contains(T item) {
-                lock (_root) {
-                    return _list.Contains(item);
-                }
-            }
-
-            public void CopyTo(T[] array, int arrayIndex) {
-                lock (_root) {
-                    _list.CopyTo(array, arrayIndex);
-                }
-            }
-
-            public bool Remove(T item) {
-                lock (_root) {
-                    return _list.Remove(item);
-                }
-            }
-
-            System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
-                lock (_root) {
-                    return _list.GetEnumerator();
-                }
-            }
-
-            IEnumerator<T> IEnumerable<T>.GetEnumerator() {
-                lock (_root) {
-                    return ((IEnumerable<T>)_list).GetEnumerator();
-                }
-            }
-
-            public T this[int index] {
-                get {
-                    lock(_root) {
-                        return _list[index];
-                    }
-                }
-                set {
-                    lock(_root) {
-                        _list[index] = value;
-                    }
-                }
-            }
-
-            public int IndexOf(T item) {
-                lock (_root) {
-                    return _list.IndexOf(item);
-                }
-            }
-
-            public void Insert(int index, T item) {
-                lock (_root) {
-                    _list.Insert(index, item);
-                }
-            }
-
-            public void RemoveAt(int index) {
-                lock (_root) {
-                    _list.RemoveAt(index);
-                }
-            }
         }

         [Serializable]


Made services optional at inmem factory

Made services optional at inmem factory

--- source/Core/Configuration/InMemoryFactory.cs
+++ source/Core/Configuration/InMemoryFactory.cs
@@ -8,20 +8,29 @@
     public static class InMemoryFactory
     {
         public static IdentityServerServiceFactory Create(
-            IEnumerable<InMemoryUser> users,
-            IEnumerable<Client> clients,
-            IEnumerable<Scope> scopes)
+            IEnumerable<InMemoryUser> users = null,
+            IEnumerable<Client> clients = null,
+            IEnumerable<Scope> scopes = null)
         {
-            var userService = new InMemoryUserService(users);
-            var scopeService = new InMemoryScopeService(scopes);
-            var clientService = new InMemoryClientService(clients);
+            var factory = new IdentityServerServiceFactory();
+
+            if (users != null)
+            {
+                var userService = new InMemoryUserService(users);
+                factory.UserService = Registration.RegisterFactory<IUserService>(() => userService);
+            }

-            var factory = new IdentityServerServiceFactory
+            if (clients != null)
             {
-                UserService = Registration.RegisterFactory<IUserService>(() => userService),
-                ScopeService = Registration.RegisterFactory<IScopeService>(() => scopeService),
-                ClientService = Registration.RegisterFactory<IClientService>(() => clientService)
-            };
+                var clientService = new InMemoryClientService(clients);
+                factory.ClientService = Registration.RegisterFactory<IClientService>(() => clientService);
+            }
+
+            if (scopes != null)
+            {
+                var scopeService = new InMemoryScopeService(scopes);
+                factory.ScopeService = Registration.RegisterFactory<IScopeService>(() => scopeService);
+            }

             return factory;
         }


Fix exit code when using ProceedAfterFailure

--- source/Nuke.Common/Execution/BuildManager.cs
+++ source/Nuke.Common/Execution/BuildManager.cs
@@ -16,7 +16,9 @@
 {
     internal static class BuildManager
     {
-        private static LinkedList<Action> s_cancellationHandlers = new LinkedList<Action>();
+        private const int c_errorExitCode = -1;
+
+        private static readonly LinkedList<Action> s_cancellationHandlers = new LinkedList<Action>();

         public static event Action CancellationHandler
         {
@@ -61,13 +63,13 @@
                 BuildExecutor.Execute(
                     build,
                     ParameterService.Instance.GetParameter<string[]>(() => build.SkippedTargets));
-
-                return 0;
+
+                return IsSuccessful(build) ? 0 : c_errorExitCode;
             }
             catch (Exception exception)
             {
                 Logger.Error(exception);
-                return -1;
+                return c_errorExitCode;
             }
             finally
             {
@@ -90,7 +92,7 @@
                 if (build.ExecutionPlan != null)
                 {
                     Logger.Normal();
-                    WriteSummary(build.ExecutionPlan);
+                    WriteSummary(build);
                 }

                 build.OnBuildFinished();
@@ -107,14 +109,14 @@
             return Activator.CreateInstance<T>();
         }

-        private static void WriteSummary(IReadOnlyCollection<ExecutableTarget> executionPlan)
+        private static void WriteSummary(NukeBuild build)
         {
             Logger.LogLevel = LogLevel.Trace;
-            var firstColumn = Math.Max(executionPlan.Max(x => x.Name.Length) + 4, val2: 19);
+            var firstColumn = Math.Max(build.ExecutionPlan.Max(x => x.Name.Length) + 4, val2: 19);
             var secondColumn = 10;
             var thirdColumn = 10;
             var allColumns = firstColumn + secondColumn + thirdColumn;
-            var totalDuration = executionPlan.Aggregate(TimeSpan.Zero, (t, x) => t.Add(x.Duration));
+            var totalDuration = build.ExecutionPlan.Aggregate(TimeSpan.Zero, (t, x) => t.Add(x.Duration));

             string CreateLine(string target, string executionStatus, string duration, string appendix = null)
                 => target.PadRight(firstColumn, paddingChar: ' ')
@@ -128,7 +130,7 @@
             Logger.Normal(new string(c: '=', count: allColumns));
             Logger.Info(CreateLine("Target", "Status", "Duration"));
             Logger.Normal(new string(c: '-', count: allColumns));
-            foreach (var target in executionPlan)
+            foreach (var target in build.ExecutionPlan)
             {
                 var line = CreateLine(target.Name, target.Status.ToString(), ToMinutesAndSeconds(target.Duration), target.SkipReason);
                 switch (target.Status)
@@ -152,17 +154,22 @@
             Logger.Normal(new string(c: '=', count: allColumns));
             Logger.Normal();

-            var buildSucceeded = executionPlan
-                .All(x => x.Status != ExecutionStatus.Failed &&
-                          x.Status != ExecutionStatus.NotRun &&
-                          x.Status != ExecutionStatus.Aborted);
+            var buildSucceeded = IsSuccessful(build);
             if (buildSucceeded)
                 Logger.Success($"Build succeeded on {DateTime.Now.ToString(CultureInfo.CurrentCulture)}.");
             else
                 Logger.Error($"Build failed on {DateTime.Now.ToString(CultureInfo.CurrentCulture)}.");
             Logger.Normal();
         }
-
+
+        private static bool IsSuccessful(NukeBuild build)
+        {
+            return build.ExecutionPlan
+                .All(x => x.Status != ExecutionStatus.Failed &&
+                          x.Status != ExecutionStatus.NotRun &&
+                          x.Status != ExecutionStatus.Aborted);
+        }
+
         public static void WriteWarningsAndErrors(SevereMessagesOutputSink outputSink)
         {
             if (outputSink.SevereMessages.Count <= 0)


CHANGED: Tools.BlueprintEditor - Tree view shows blueprints ordered by name.

--- Tools/BlueprintEditor/Slash.Tools.BlueprintEditor.WPF/Source/ViewModels/BlueprintManagerViewModel.cs
+++ Tools/BlueprintEditor/Slash.Tools.BlueprintEditor.WPF/Source/ViewModels/BlueprintManagerViewModel.cs
@@ -46,7 +46,7 @@
             this.Blueprints = new ObservableCollection<BlueprintViewModel>();

             IEnumerable<KeyValuePair<string, Blueprint>> blueprints = this.blueprintManager.Blueprints;
-            foreach (var blueprintPair in blueprints)
+            foreach (var blueprintPair in blueprints.OrderBy(blueprint => blueprint.Key))
             {
                 this.Blueprints.Add(
                     new BlueprintViewModel(blueprintPair.Key, blueprintPair.Value)


fix interface

fix interface

--- src/CodeComb.Net.EmailSender/IEmailSender.cs
+++ src/CodeComb.Net.EmailSender/IEmailSender.cs
@@ -5,7 +5,7 @@

 namespace CodeComb.Net.EmailSender
 {
-    interface IEmailSender
+    public interface IEmailSender
     {
         Task SendEmailAsync(string email, string subject, string message);
     }


Add TODO for substitutions and limit filtering to instance .ctors only

--- src/Common/src/TypeSystem/Ecma/EcmaModule.cs
+++ src/Common/src/TypeSystem/Ecma/EcmaModule.cs
@@ -359,12 +359,13 @@
                     // Try to resolve the name and signature in the current type, or any of the base types.
                     do
                     {
+                        // TODO: handle substitutions
                         MethodDesc method = typeDescToInspect.GetMethod(name, sig);
                         if (method != null)
                         {
                             // If this resolved to one of the base types, make sure it's not a constructor.
-                            // Constructors are not inherited.
-                            if (typeDescToInspect != parentTypeDesc && (method.IsConstructor || method.IsStaticConstructor))
+                            // Instance constructors are not inherited.
+                            if (typeDescToInspect != parentTypeDesc && method.IsConstructor)
                                 break;

                             return method;


Respond to PR feedback

Respond to PR feedback

--- src/Compilers/Extension/AssemblyRedirects.cs
+++ src/Compilers/Extension/AssemblyRedirects.cs
@@ -15,7 +15,6 @@
 [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.IO.FileSystem.DriveInfo.dll")]
 [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.IO.FileSystem.Primitives.dll")]
 [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.IO.Pipes.dll")]
-[assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Reflection.dll")]
 [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Runtime.InteropServices.RuntimeInformation.dll")]
 [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Security.AccessControl.dll")]
 [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Security.Claims.dll")]


Adding title for easy ref

Adding title for easy ref

--- src/Dkbe.CaptivePortal.MockServer/Program.cs
+++ src/Dkbe.CaptivePortal.MockServer/Program.cs
@@ -15,6 +15,8 @@
     {
         public static void Main(string[] args)
         {
+            Console.Title = "Mock Server";
+
             var config = new ConfigurationBuilder()
                .AddCommandLine(args)
                .Build();


Cleaning again

Cleaning again

--- src/FSharpVSPowerTools/GeneralOptionsPage.cs
+++ src/FSharpVSPowerTools/GeneralOptionsPage.cs
@@ -141,7 +141,7 @@
         {
             if (e.ApplyBehavior == ApplyKind.Apply)
             {
-                this.XmlDocEnabled = _optionsControl.XmlDocEnabled;
+                XmlDocEnabled = _optionsControl.XmlDocEnabled;
                 FormattingEnabled = _optionsControl.FormattingEnabled;

                 if (NavBarEnabled != _optionsControl.NavBarEnabled && SetNavigationBarConfig(_optionsControl.NavBarEnabled))


bump default ua

bump default ua

--- src/FilterLists.Services/UserAgentService.cs
+++ src/FilterLists.Services/UserAgentService.cs
@@ -13,7 +13,7 @@
         private const string UaStringSourceClass = "get-the-list";

         private const string UaStringDefault =
-            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36";
+            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36";

         public static async Task<string> GetMostPopularString()
         {


Corrected spelling mistake in method name MigrateUp overload

--- src/FluentMigrator.Runner/MigrationRunner.cs
+++ src/FluentMigrator.Runner/MigrationRunner.cs
@@ -68,7 +68,7 @@
 			ProfileLoader.ApplyProfiles();
 		}

-        public void MigrationUp()
+        public void MigrateUp()
         {
             MigrateUp(true);
         }


Applied IdentityPart-FluentGeneratorMethods.patch from Derick Bailey, which makes some of the identity part methods fluid.

git-svn-id: a161142445158cf41e00e2afdd70bb78aded5464@43 48f0ce17-cc52-0410-af8c-857c09b6549b

--- src/FluentNHibernate/Mapping/IdentityPart.cs
+++ src/FluentNHibernate/Mapping/IdentityPart.cs
@@ -82,14 +82,16 @@
 			get { return 0; }
 		}

-		public void SetGeneratorClass(string generator)
+		public IdentityPart SetGeneratorClass(string generator)
 		{
 			_generatorClass = generator;
+			return this;
 		}

-		public void AddGeneratorParam(string name, string innerXml)
+		public IdentityPart AddGeneratorParam(string name, string innerXml)
 		{
 			_generatorParameters.Store(name, innerXml);
+			return this;
 		}

         /// <summary>


Abstract marshaler into overridable method in NAPI sources.

--- src/Generator/Generators/NAPI/NAPISources.cs
+++ src/Generator/Generators/NAPI/NAPISources.cs
@@ -736,7 +736,7 @@
                     ReturnType = param.QualifiedType
                 };

-                var marshal = new NAPIMarshalNativeToManagedPrinter(ctx);
+                var marshal = GetMarshalNativeToManagedPrinter(ctx);
                 param.Visit(marshal);

                 if (!string.IsNullOrWhiteSpace(marshal.Context.Before))
@@ -761,7 +761,7 @@
                 ReturnType = function.ReturnType
             };

-            var marshal = new NAPIMarshalNativeToManagedPrinter(ctx);
+            var marshal = GetMarshalNativeToManagedPrinter(ctx);
             function.ReturnType.Visit(marshal);

             if (!string.IsNullOrWhiteSpace(marshal.Context.Before))
@@ -809,6 +809,16 @@
             }

             return marshals;
+        }
+
+        public virtual MarshalPrinter<MarshalContext> GetMarshalManagedToNativePrinter(MarshalContext ctx)
+        {
+            return new NAPIMarshalManagedToNativePrinter(ctx);
+        }
+
+        public virtual MarshalPrinter<MarshalContext> GetMarshalNativeToManagedPrinter(MarshalContext ctx)
+        {
+            return new NAPIMarshalNativeToManagedPrinter(ctx);
         }

         public virtual ParamMarshal GenerateFunctionParamMarshal(Parameter param, int paramIndex,
@@ -830,7 +840,7 @@
                 Function = function
             };

-            var marshal = new NAPIMarshalManagedToNativePrinter(ctx);
+            var marshal = GetMarshalManagedToNativePrinter(ctx);
             effectiveParam.Visit(marshal);

             if (string.IsNullOrEmpty(marshal.Context.Return))


Remove Down() from Migrator (it is not used by the engine)

--- src/IonFar.SharePoint.Migration/Migration.cs
+++ src/IonFar.SharePoint.Migration/Migration.cs
@@ -9,8 +9,6 @@
     {
         public abstract void Up(ClientContext clientContext, IUpgradeLog logger);

-        public virtual void Down(ClientContext clientContext, IUpgradeLog logger) { }
-
         protected string BaseFolder
         {
             get


#sadtrombone. No parallelized http tests

--- src/Jasper.Http.Testing/NoParallelization.cs
+++ src/Jasper.Http.Testing/NoParallelization.cs
@@ -1,5 +1,4 @@
 using Xunit;

-#if RELEASE
-    [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]
-#endif
+[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]
+


Fix MetaPixel build

Fix MetaPixel build

--- extensions/Tools/MetaPixel/MetaPixel.cs
+++ extensions/Tools/MetaPixel/MetaPixel.cs
@@ -113,7 +113,7 @@
 				mini_query.Terms = FSpot.OrTerm.FromTags ((Tag []) taglist.ToArray (typeof (Tag)));
 				photos = mini_query.Photos;
 			} else {
-				photos = MainWindow.Toplevel.ActivePhotos ();
+				photos = MainWindow.Toplevel.Query.Photos;
 			}

 			if (photos.Length == 0) {


Maximized variant ID to 63 characters and optimized the regex

--- source/DD4T.Templates.Base/Utils/BinaryPublisher.cs
+++ source/DD4T.Templates.Base/Utils/BinaryPublisher.cs
@@ -305,8 +305,9 @@

         private string GetVariantId(params string[] keys)
         {
-            Regex re = new Regex("\\W");
-            return string.Join("_", keys.Select(k => re.Replace(k, "")));
+            Regex re = new Regex("[^A-Za-z0-9-_.:]+");
+            var result = string.Join("_", keys.Select(k => re.Replace(k, "")));
+            return result.Length > 63 ? result.Substring(0, 63) : result;
         }

         #endregion


Refactored ControllerBase

Refactored ControllerBase

--- source/NovusCraft/Web/Controllers/ControllerBase.cs
+++ source/NovusCraft/Web/Controllers/ControllerBase.cs
@@ -14,10 +14,11 @@
 			if (filterContext.IsChildAction)
 				return;

-			var documentSession = ObjectFactory.GetInstance<IDocumentSession>();
-			if (filterContext.Exception == null)
-				documentSession.SaveChanges();
-			documentSession.Dispose();
+			using (var documentSession = ObjectFactory.GetInstance<IDocumentSession>())
+			{
+				if (filterContext.Exception == null)
+					documentSession.SaveChanges();
+			}

 			base.OnActionExecuted(filterContext);
 		}


fixed sql string error

fixed sql string error

--- src/MemoryDB.SqlServer/SQLServerDataStore.cs
+++ src/MemoryDB.SqlServer/SQLServerDataStore.cs
@@ -107,7 +107,7 @@
             using (var db = new Database(_connectionName))
             {
                 var sql = $"SELECT Id, Value FROM  {_tableName}";
-                db.Fetch<JsonItem>(sql, _tableName);
+                db.Fetch<JsonItem>(sql);
             }

             return jsonList;
@@ -117,8 +117,8 @@
         {
             using (var db = new Database(_connectionName))
             {
-                var sql = "IF OBJECT_ID(@0) IS NOT NULL SELECT 1 ELSE SELECT 0;";
-                return  db.ExecuteScalar<bool>(sql, _tableName);
+                var sql = $"IF OBJECT_ID('{_tableName}') IS NOT NULL SELECT 1 ELSE SELECT 0;";
+                return  db.ExecuteScalar<bool>(sql);
             }
         }


Update version number to 1.1.1019.43

Update version number to 1.1.1019.43

--- src/Mockaroo.Core/Properties/AssemblyInfo.cs
+++ src/Mockaroo.Core/Properties/AssemblyInfo.cs
@@ -1,30 +1,63 @@
-using System.Resources;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Mockaroo.Core")]
-[assembly: AssemblyDescription("A portable class library that allows you to generate sample data based on your object type using the Mockaroo API.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Ackara")]
-[assembly: AssemblyProduct("Mockaroo.Core")]
-[assembly: AssemblyCopyright("Copyright ©  2016")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: NeutralResourcesLanguage("en")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.3.16206.277")]
-[assembly: AssemblyFileVersion("1.3.16206.276")]
+using System.Resources;
+
+using System.Reflection;
+
+using System.Runtime.CompilerServices;
+
+using System.Runtime.InteropServices;
+
+
+
+// General Information about an assembly is controlled through the following
+
+// set of attributes. Change these attribute values to modify the information
+
+// associated with an assembly.
+
+[assembly: AssemblyTitle("Mockaroo.Core")]
+
+[assembly: AssemblyDescription("A portable class library that allows you to generate sample data based on your object type using the Mockaroo API.")]
+
+[assembly: AssemblyConfiguration("")]
+
+[assembly: AssemblyCompany("Ackara")]
+
+[assembly: AssemblyProduct("Mockaroo.Core")]
+
+[assembly: AssemblyCopyright("Copyright   2016")]
+
+[assembly: AssemblyTrademark("")]
+
+[assembly: AssemblyCulture("")]
+
+[assembly: NeutralResourcesLanguage("en")]
+
+
+
+// Version information for an assembly consists of the following four values:
+
+//
+
+//      Major Version
+
+//      Minor Version
+
+//      Build Number
+
+//      Revision
+
+//
+
+// You can specify all the values or you can default the Build and Revision Numbers
+
+// by using the '*' as shown below:
+
+// [assembly: AssemblyVersion("1.1.1019.43")]
+
+[assembly: AssemblyVersion("1.1.1019.43")]
+
+[assembly: AssemblyFileVersion("1.1.1019.43")]
+
+
+
+


TableStructure.cs: Missing "as" keyword (from Hibernate). Use SqlTypeFactory.NoTypes.

--- src/NHibernate/Id/Enhanced/TableStructure.cs
+++ src/NHibernate/Id/Enhanced/TableStructure.cs
@@ -38,7 +38,7 @@
 			_incrementSize = incrementSize;

 			var b = new SqlStringBuilder();
-			b.Add("select ").Add(valueColumnName).Add(" id_val").Add(" from ").Add(dialect.AppendLockHint(LockMode.Upgrade, tableName))
+			b.Add("select ").Add(valueColumnName).Add(" as id_val").Add(" from ").Add(dialect.AppendLockHint(LockMode.Upgrade, tableName))
 				.Add(dialect.ForUpdateString);

 			_selectQuery = b.ToSqlString();
@@ -111,7 +111,7 @@
 				{
 					object selectedValue;

-					IDbCommand selectCmd = session.Factory.ConnectionProvider.Driver.GenerateCommand(CommandType.Text, _selectQuery, new SqlType[0]);
+					IDbCommand selectCmd = session.Factory.ConnectionProvider.Driver.GenerateCommand(CommandType.Text, _selectQuery, SqlTypeFactory.NoTypes);
 					using (selectCmd)
 					{
 						selectCmd.Connection = conn;


Delegate requests for the NumberFormat and DateFormat to the underlying CultureInfo, instead of maintaining a field for each of them.

--- src/NodaTime/Globalization/NodaFormatInfo.cs
+++ src/NodaTime/Globalization/NodaFormatInfo.cs
@@ -60,8 +60,6 @@
         private static readonly Cache<CultureInfo, NodaFormatInfo> Cache = new Cache<CultureInfo, NodaFormatInfo>
             (500, culture => new NodaFormatInfo(culture), new ReferenceEqualityComparer<CultureInfo>());

-        private readonly DateTimeFormatInfo dateTimeFormat;
-        private readonly NumberFormatInfo numberFormat;
         private readonly CultureInfo cultureInfo;
         private readonly string offsetPatternFull;
         private readonly string offsetPatternLong;
@@ -90,8 +88,6 @@
         {
             Preconditions.CheckNotNull(cultureInfo, "cultureInfo");
             this.cultureInfo = cultureInfo;
-            numberFormat = cultureInfo.NumberFormat;
-            dateTimeFormat = cultureInfo.DateTimeFormat;
             var manager = PatternResources.ResourceManager;
             offsetPatternFull = manager.GetString("OffsetPatternFull", cultureInfo);
             offsetPatternLong = manager.GetString("OffsetPatternLong", cultureInfo);
@@ -240,12 +236,12 @@
         /// <summary>
         /// Gets the number format associated with this formatting information.
         /// </summary>
-        public NumberFormatInfo NumberFormat { get { return numberFormat; } }
+        public NumberFormatInfo NumberFormat { get { return cultureInfo.NumberFormat; } }

         /// <summary>
         /// Gets the BCL date time format associated with this formatting information.
         /// </summary>
-        public DateTimeFormatInfo DateTimeFormat { get { return dateTimeFormat; } }
+        public DateTimeFormatInfo DateTimeFormat { get { return cultureInfo.DateTimeFormat; } }

         /// <summary>
         /// Gets the decimal separator from the number format associated with this provider.
@@ -386,7 +382,7 @@
         /// </summary>
         internal static void ClearCache()
         {
-            lock (Cache) Cache.Clear();
+            Cache.Clear();
         }

         /// <summary>


Code compilation at runtime (work in progress)

--- src/NoiseLab.PolyGen.Core/Domain/Database.cs
+++ src/NoiseLab.PolyGen.Core/Domain/Database.cs
@@ -1,8 +1,10 @@
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.CSharp;
 using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Emit;
 using Microsoft.CodeAnalysis.Formatting;

 namespace NoiseLab.PolyGen.Core.Domain
@@ -20,7 +22,62 @@
             }
         }

-        internal CompilationUnitSyntax GenerateCompilationUnitSyntax()
+        public (EmitResult emitResult, byte[] bytes) GenerateExecutable()
+        {
+            var compilationUnit = GenerateCompilationUnitSyntax();
+
+            var syntaxTree = CSharpSyntaxTree.Create(compilationUnit);
+            // TODO: Get rid of hard-coded path. Use assembly resources instead.
+            var basePath = @"c:\Work\NoiseLab\PolyGen\src\NoiseLab.PolyGen.Core\MetadataReferences\";
+            MetadataReference[] references =
+            {
+                MetadataReference.CreateFromFile($@"{basePath}netstandard.library.2.0.0\build\netstandard2.0\ref\netstandard.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}netstandard.library.2.0.0\build\netstandard2.0\ref\System.Runtime.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}system.componentmodel.annotations.4.4.0\ref\netcore50\System.ComponentModel.Annotations.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.entityframeworkcore.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.entityframeworkcore.relational.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.entityframeworkcore.sqlserver.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.SqlServer.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.aspnetcore.hosting.2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.aspnetcore.hosting.abstractions.2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.aspnetcore.http.abstractions.2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.Abstractions.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.aspnetcore.mvc.2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.aspnetcore.mvc.abstractions.2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Abstractions.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.aspnetcore.mvc.core.2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Core.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.aspnetcore.mvc.viewfeatures.2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.ViewFeatures.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.aspnetcore.server.iisintegration.2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Server.IISIntegration.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.aspnetcore.server.kestrel.2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.extensions.configuration.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.extensions.configuration.binder.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.extensions.configuration.abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.extensions.configuration.environmentvariables.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.EnvironmentVariables.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.extensions.configuration.fileextensions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.FileExtensions.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.extensions.configuration.json.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Json.dll"),
+                MetadataReference.CreateFromFile($@"{basePath}microsoft.extensions.dependencyinjection.abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll"),
+            };
+
+            var compilation = CSharpCompilation.Create(
+                "NoiseLab.PolyGen.Generated",
+                new[] { syntaxTree },
+                references,
+                new CSharpCompilationOptions(OutputKind.ConsoleApplication));
+
+            EmitResult result;
+            byte[] bytes = null;
+            using (var ms = new MemoryStream())
+            {
+                result = compilation.Emit(ms);
+
+                if (result.Success)
+                {
+                    ms.Seek(0, SeekOrigin.Begin);
+                    bytes = new byte[ms.Length];
+                    ms.Read(bytes, 0, (int) ms.Length);
+                }
+            }
+            return (result, bytes);
+        }
+
+        private CompilationUnitSyntax GenerateCompilationUnitSyntax()
         {
             var classes = new List<MemberDeclarationSyntax>();
             classes.AddRange(Tables.Select(t => t.GenerateOrmModel()));


Update Matrix.cs

Update Matrix.cs

typo

--- src/Numerics/LinearAlgebra/Generic/Matrix.cs
+++ src/Numerics/LinearAlgebra/Generic/Matrix.cs
@@ -1388,7 +1388,7 @@
         }

         /// <summary>
-        /// Iterates throw each element in the matrix (row-wise).
+        /// Iterates through each element in the matrix (row-wise).
         /// </summary>
         /// <returns>The value at the current iteration along with its position (row, column, value).</returns>
         public virtual IEnumerable<Tuple<int, int, T>> IndexedEnumerator()


bump version

bump version

--- src/OpenGraph-Net/Properties/AssemblyInfo.cs
+++ src/OpenGraph-Net/Properties/AssemblyInfo.cs
@@ -1,5 +1,5 @@
-// <copyright file="AssemblyInfo.cs" company="SHHH Innovations LLC">
-// Copyright SHHH Innovations LLC
+// <copyright file="AssemblyInfo.cs">
+// Copyright Geoff Horsey
 // </copyright>

 using System;
@@ -39,5 +39,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.0.1")]
-[assembly: AssemblyFileVersion("1.2.0.1")]
+[assembly: AssemblyVersion("1.3.0.0")]
+[assembly: AssemblyFileVersion("1.3.0.0")]


refact(AnimationsName): Removed enum which is not used

--- src/Rg.Plugins.Popup/Enums/AnimationsName.cs
+++ src/Rg.Plugins.Popup/Enums/AnimationsName.cs
@@ -1,44 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Rg.Plugins.Popup.Enums
-{
-    public enum AnimationsName
-    {
-        Others,
-        // Scale Up
-        ScaleCenterUp,
-        ScaleTopUp,
-        ScaleTopBottomUp,
-        ScaleBottomUp,
-        ScaleBottomTopUp,
-        ScaleLeftUp,
-        ScaleLeftRightUp,
-        ScaleRightUp,
-        ScaleRightLeftUp,
-        // Scale Down
-        ScaleCenterDown,
-        ScaleTopDown,
-        ScaleTopBottomDown,
-        ScaleBottomDown,
-        ScaleBottomTopDown,
-        ScaleLeftDown,
-        ScaleLeftRightDown,
-        ScaleRightDown,
-        ScaleRightLeftDown,
-        // Move
-        MoveTop,
-        MoveTopBottom,
-        MoveBottom,
-        MoveBottomTop,
-        MoveLeft,
-        MoveLeftRight,
-        MoveRight,
-        MoveRightLeft,
-
-        Fade
-    }
-}


David/Lydia - Removing accidental method

--- src/StockportContentApi/Http/HttpResponse.cs
+++ src/StockportContentApi/Http/HttpResponse.cs
@@ -49,11 +49,6 @@
             }
         }

-        internal static HttpResponse Failure(HttpStatusCode notFound)
-        {
-            throw new NotImplementedException();
-        }
-
         public override string ToString()
         {
             return JsonConvert.SerializeObject(this);


[SC] Remove unused file (#2577)

[SC] Remove unused file (#2577)

--- src/Stratis.SmartContracts/CreateContract.cs
+++ src/Stratis.SmartContracts/CreateContract.cs
@@ -1,15 +0,0 @@
-namespace Stratis.SmartContracts
-{
-    public sealed class CreateContract
-    {
-        /// <summary>
-        /// If required, the method parameters that will be passed to the <see cref="ContractMethodName"/>.
-        /// </summary>
-        public object[] MethodParameters { get; set; }
-
-        /// <summary>
-        /// The amount of gas to spend in this contract call. If not set the protocol default will be used.
-        /// </summary>
-        public ulong GasBudget { get; set; }
-    }
-}


Ensure current build parameters are used.

Instead of historic build.

Because we want to use current location of the repository,
otherwise might not even able to check it out.

--- src/TeamCityApi/Helpers/Git/VcsRootHelper.cs
+++ src/TeamCityApi/Helpers/Git/VcsRootHelper.cs
@@ -46,7 +46,7 @@
             VcsRoot vcsRoot = await _client.VcsRoots.ById(vcsRootId);

             Log.Debug(string.Format("VCSRoot: {0}",vcsRoot));
-            VcsCommit commit = new VcsCommit(vcsRoot, build.Properties.Property, commitSha);
+            VcsCommit commit = new VcsCommit(vcsRoot, currentBuildConfig.Parameters.Property, commitSha);

             return commit;


Fix StartDate nullability in VoiceChatScheduled

--- src/Telegram.Bot/Types/VoiceChatScheduled.cs
+++ src/Telegram.Bot/Types/VoiceChatScheduled.cs
@@ -10,10 +10,9 @@
     public class VoiceChatScheduled
     {
         /// <summary>
-        /// Point in time (Unix timestamp) when the voice chat is supposed to be started by a chat administrator
+        /// Point in time when the voice chat is supposed to be started by a chat administrator
         /// </summary>
-        [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
         [JsonConverter(typeof(UnixDateTimeConverter))]
-        public DateTime? StartDate { get; set; }
+        public DateTime StartDate { get; set; }
     }
 }


Make ThreadSafeFlags public

Make ThreadSafeFlags public

These are consumed from the ECMA type system implementation and need to
be public.

--- src/TypeSystem/src/Common/ThreadSafeFlags.cs
+++ src/TypeSystem/src/Common/ThreadSafeFlags.cs
@@ -6,7 +6,7 @@

 namespace Internal.TypeSystem
 {
-    struct ThreadSafeFlags
+    public struct ThreadSafeFlags
     {
         private volatile int _value;


change the order to be alphabetical

change the order to be alphabetical

--- AstroPhotoGallery/AstroPhotoGallery/Controllers/Admin/UserController.cs
+++ AstroPhotoGallery/AstroPhotoGallery/Controllers/Admin/UserController.cs
@@ -38,6 +38,7 @@
             using (var db = new GalleryDbContext())
             {
                 var users = db.Users
+                    .OrderBy(u => u.Email)
                     .ToList();

                 if (!string.IsNullOrEmpty(searchUser))


fix incomplete downloads from Google Drive

--- CompatBot/EventHandlers/LogParsing/SourceHandlers/GoogleDriveHandler.cs
+++ CompatBot/EventHandlers/LogParsing/SourceHandlers/GoogleDriveHandler.cs
@@ -111,17 +111,27 @@

             public async Task FillPipeAsync(PipeWriter writer)
             {
-                var pipe = new Pipe();
-                using (var pushStream = pipe.Writer.AsStream())
+                try
                 {
-                    var progressTask = fileInfoRequest.DownloadAsync(pushStream, Config.Cts.Token);
-                    using (var pullStream = pipe.Reader.AsStream())
+                    var pipe = new Pipe();
+                    using (var pushStream = pipe.Writer.AsStream())
                     {
-                        var pipingTask = handler.FillPipeAsync(pullStream, writer);
-                        await progressTask.ConfigureAwait(false);
-                        pipe.Writer.Complete();
-                        await pipingTask.ConfigureAwait(false);
-                    }
+                        var progressTask = fileInfoRequest.DownloadAsync(pushStream, Config.Cts.Token);
+                        using (var pullStream = pipe.Reader.AsStream())
+                        {
+                            var pipingTask = handler.FillPipeAsync(pullStream, writer);
+                            var result = await progressTask.ConfigureAwait(false);
+                            if (result.Status != DownloadStatus.Completed)
+                                Config.Log.Error(result.Exception, "Failed to download file from Google Drive: " + result.Status);
+                            await pipe.Writer.FlushAsync(Config.Cts.Token).ConfigureAwait(false);
+                            pipe.Writer.Complete();
+                            await pipingTask.ConfigureAwait(false);
+                        }
+                    }
+                }
+                catch (Exception e)
+                {
+                    Config.Log.Error(e, "Failed to download file from Google Drive");
                 }
             }
         }


Improve storage window layout & add text clipping.

--- Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs
+++ Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs
@@ -229,7 +229,7 @@
                 {
                     VerticalExpand = true,
                     HorizontalExpand = true,
-                    HScrollEnabled = true,
+                    HScrollEnabled = false,
                     VScrollEnabled = true,
                 };
                 _entityList = new VBoxContainer
@@ -328,7 +328,7 @@
             public EntityUid EntityUid { get; set; }
             public Button ActualButton { get; }
             public SpriteView EntitySpriteView { get; }
-            public Control EntityControl { get; }
+            public Control SizeControl { get; }
             public Label EntityName { get; }
             public Label EntitySize { get; }

@@ -352,32 +352,23 @@
                 EntityName = new Label
                 {
                     VerticalAlignment = VAlignment.Center,
+                    HorizontalExpand = true,
+                    Margin = new Thickness(0, 0, 6, 0),
                     Text = "Backpack",
-                };
+                    ClipText = true
+                };
+
                 hBoxContainer.AddChild(EntitySpriteView);
                 hBoxContainer.AddChild(EntityName);

-                EntityControl = new Control
-                {
-                    HorizontalExpand = true
-                };
                 EntitySize = new Label
                 {
-                    VerticalAlignment = VAlignment.Center,
+                    VerticalAlignment = VAlignment.Bottom,
                     Text = "Size 6",
                     Align = Label.AlignMode.Right,
-                    /*AnchorLeft = 1.0f,
-                    AnchorRight = 1.0f,
-                    AnchorBottom = 0.5f,
-                    AnchorTop = 0.5f,
-                    MarginLeft = -38.0f,
-                    MarginTop = -7.0f,
-                    MarginRight = -5.0f,
-                    MarginBottom = 7.0f*/
-                };
-
-                EntityControl.AddChild(EntitySize);
-                hBoxContainer.AddChild(EntityControl);
+                };
+
+                hBoxContainer.AddChild(EntitySize);
                 AddChild(hBoxContainer);
             }
         }


#599 Fix async bug in OnUIThreadAsync

#599 Fix async bug in OnUIThreadAsync

--- src/Caliburn.Micro.Platform/XamlPlatformProvider.cs
+++ src/Caliburn.Micro.Platform/XamlPlatformProvider.cs
@@ -76,7 +76,7 @@
 #if WINDOWS_UWP
             return dispatcher.RunTaskAsync(action);
 #else
-            return dispatcher.InvokeAsync(action).Task;
+            return dispatcher.InvokeAsync(action).Task.Unwrap();
 #endif
         }


using as operator instead of implicit type specification reduces amount of dynamic code at play.

Is there a better way to tell the C# compiler that BuildConversionExpression method must in fact return a LambdaExpression?

--- src/Cartographer/Compiler/MappingStrategyBuilder.cs
+++ src/Cartographer/Compiler/MappingStrategyBuilder.cs
@@ -84,7 +84,7 @@
 				try
 				{
 					instance = conversionPatternRepository.Lease(type);
-					LambdaExpression expression = instance.BuildConversionExpression(mapping);
+					var expression = instance.BuildConversionExpression(mapping) as LambdaExpression;
 					if (expression != null)
 					{
 						return new DelegatingConversionStep(expression);


Optimize GC.AllocateUninitializedArray and use it in StringBuilder (#27364)

* use GC.AllocateUninitializedArray for allocating internal char buffers

* force inlining of AllocateUninitializedArray to have no perf hit on the small buffers hot path

* insrease the threshold from 256 to 2048 bytes

* use Unsafe.As instead of a cast

* remove the size precondition from AllocateNewArray method, the called AllocateSzArray is responsible for handling negative size

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

--- src/Common/src/CoreLib/System/Text/StringBuilder.cs
+++ src/Common/src/CoreLib/System/Text/StringBuilder.cs
@@ -144,7 +144,7 @@
             }
             capacity = Math.Max(capacity, length);

-            m_ChunkChars = new char[capacity];
+            m_ChunkChars = GC.AllocateUninitializedArray<char>(capacity);
             m_ChunkLength = length;

             unsafe
@@ -182,7 +182,7 @@
             }

             m_MaxCapacity = maxCapacity;
-            m_ChunkChars = new char[capacity];
+            m_ChunkChars = GC.AllocateUninitializedArray<char>(capacity);
         }

         private StringBuilder(SerializationInfo info, StreamingContext context)
@@ -242,7 +242,7 @@

             // Assign
             m_MaxCapacity = persistedMaxCapacity;
-            m_ChunkChars = new char[persistedCapacity];
+            m_ChunkChars = GC.AllocateUninitializedArray<char>(persistedCapacity);
             persistedString.CopyTo(0, m_ChunkChars, 0, persistedString.Length);
             m_ChunkLength = persistedString.Length;
             m_ChunkPrevious = null;
@@ -314,7 +314,7 @@
                 if (Capacity != value)
                 {
                     int newLen = value - m_ChunkOffset;
-                    char[] newArray = new char[newLen];
+                    char[] newArray = GC.AllocateUninitializedArray<char>(newLen);
                     Array.Copy(m_ChunkChars, 0, newArray, 0, m_ChunkLength);
                     m_ChunkChars = newArray;
                 }
@@ -479,7 +479,7 @@
                         {
                             // We crossed a chunk boundary when reducing the Length. We must replace this middle-chunk with a new larger chunk,
                             // to ensure the capacity we want is preserved.
-                            char[] newArray = new char[newLen];
+                            char[] newArray = GC.AllocateUninitializedArray<char>(newLen);
                             Array.Copy(chunk.m_ChunkChars, 0, newArray, 0, chunk.m_ChunkLength);
                             m_ChunkChars = newArray;
                         }
@@ -2423,7 +2423,7 @@
             }

             // Allocate the array before updating any state to avoid leaving inconsistent state behind in case of out of memory exception
-            char[] chunkChars = new char[newBlockLength];
+            char[] chunkChars = GC.AllocateUninitializedArray<char>(newBlockLength);

             // Move all of the data from this chunk to a new one, via a few O(1) pointer adjustments.
             // Then, have this chunk point to the new one as its predecessor.
@@ -2569,7 +2569,7 @@
             Debug.Assert(size > 0);
             Debug.Assert(maxCapacity > 0);

-            m_ChunkChars = new char[size];
+            m_ChunkChars = GC.AllocateUninitializedArray<char>(size);
             m_MaxCapacity = maxCapacity;
             m_ChunkPrevious = previousBlock;
             if (previousBlock != null)


Fix StartsWith overload.

Fix StartsWith overload.

--- src/BinlogTool/SaveFiles.cs
+++ src/BinlogTool/SaveFiles.cs
@@ -60,7 +60,7 @@
             var arguments = invocation.CommandLineArguments.Tokenize();
             foreach (var argument in arguments)
             {
-                if (argument.StartsWith('/'))
+                if (argument.StartsWith("/"))
                 {
                     var reference = TryGetReference(argument);
                     if (reference != null)


Throw for necessary settings

Throw for necessary settings

--- src/Core/WinSWCore/Configuration/DefaultSettings.cs
+++ src/Core/WinSWCore/Configuration/DefaultSettings.cs
@@ -13,10 +13,10 @@
     /// </summary>
     public sealed class DefaultWinSWSettings : IWinSWConfiguration
     {
-        public string Id => null;
-        public string Caption => null;
-        public string Description => null;
-        public string Executable => null;
+        public string Id => throw new InvalidOperationException(nameof(Id) + " must be specified.");
+        public string Caption => throw new InvalidOperationException(nameof(Caption) + " must be specified.");
+        public string Description => throw new InvalidOperationException(nameof(Description) + " must be specified.");
+        public string Executable => throw new InvalidOperationException(nameof(Executable) + " must be specified.");
         public bool HideWindow => false;

         // this returns the executable name as given by the calling process, so
@@ -27,7 +27,7 @@
         public bool AllowServiceAcountLogonRight => false;
         public string? ServiceAccountPassword => null;
         public string ServiceAccountUser => "NULL\\NULL";
-        public List<Native.SC_ACTION> FailureActions => new List<Native.SC_ACTION>();
+        public List<Native.SC_ACTION> FailureActions => new List<Native.SC_ACTION>(0);
         public TimeSpan ResetFailureAfter => TimeSpan.FromDays(1);

         // Executable management
@@ -58,8 +58,8 @@
         public string ErrFilePattern => ".err.log";

         // Environment
-        public List<Download> Downloads => new List<Download>();
-        public Dictionary<string, string> EnvironmentVariables => new Dictionary<string, string>();
+        public List<Download> Downloads => new List<Download>(0);
+        public Dictionary<string, string> EnvironmentVariables => new Dictionary<string, string>(0);

         // Misc
         public bool BeepOnShutdown => false;


Remove unused private setters

Remove unused private setters

This fixes the following Resharper warning:
> Non-readonly property referenced in 'GetHashCode()'

--- src/ByteSizeLib/ByteSize.cs
+++ src/ByteSizeLib/ByteSize.cs
@@ -14,8 +14,8 @@
         public const long BitsInByte = 8;
         public const string BitSymbol = "b";
         public const string ByteSymbol = "B";
-        public long Bits { get; private set; }
-        public double Bytes { get; private set; }
+        public long Bits { get; }
+        public double Bytes { get; }

         public string LargestWholeNumberBinarySymbol
         {


Fixed bug #1675391 - Non-standard (X-) properties are sometimes serialized wrong

--- DDay.iCal/Serialization/iCalendar/Components/ComponentBaseSerializer.cs
+++ DDay.iCal/Serialization/iCalendar/Components/ComponentBaseSerializer.cs
@@ -101,9 +101,17 @@

                     // If the property is non-standard, then replace
                     // it with an X-name
-                    foreach (object attr in itemAttrs)
-                        if (attr is NonstandardAttribute)
-                            ico.Name = "X-" + ico.Name;
+                    if (!ico.Name.StartsWith("X-"))
+                    {
+                        foreach (object attr in itemAttrs)
+                        {
+                            if (attr is NonstandardAttribute)
+                            {
+                                ico.Name = "X-" + ico.Name;
+                                break;
+                            }
+                        }
+                    }
                 }

                 // Retrieve custom attributes for this field/property


[director] Fixed swapped zoom-in and zoom-out command (on mouse wheel).

--- DereTore.Applications.StarlightDirector/UI/Controls/ScoreEditor.xaml.cs
+++ DereTore.Applications.StarlightDirector/UI/Controls/ScoreEditor.xaml.cs
@@ -61,9 +61,9 @@
             // Zooming
             if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) {
                 if (e.Delta > 0) {
+                    ZoomIn();
+                } else {
                     ZoomOut();
-                } else {
-                    ZoomIn();
                 }
                 return;
             }


Connection: add pending operation before serializing CSHARP-266

--- src/Cassandra/Connection.cs
+++ src/Cassandra/Connection.cs
@@ -644,26 +644,29 @@
             }
             //We have a valid stream id
             //Only 1 thread at a time can be here.
+            _logger.Verbose("Sending #" + streamId + " for " + state.Request.GetType().Name);
+            _pendingOperations.AddOrUpdate(streamId, state, (k, oldValue) => state);
             try
             {
-                _logger.Verbose("Sending #" + streamId + " for " + state.Request.GetType().Name);
                 var frameStream = state.Request.GetFrame(streamId).Stream;
-                _pendingOperations.AddOrUpdate(streamId, state, (k, oldValue) => state);
-                //We will not use the request, stop reference it.
+                //We will not use the request any more, stop reference it.
                 state.Request = null;
                 //Start sending it
                 _tcpSocket.Write(frameStream);
             }
             catch (Exception ex)
             {
+                //There was an error while serializing or begin sending
                 _logger.Error(ex);
-                //The request was not written
+                //The request was not written, clear it from pending operations
                 _pendingOperations.TryRemove(streamId, out state);
+                //Leave the stream id
                 _freeOperations.Push(streamId);
-                //We are done with it
+                //Callback with the Exception
                 state.InvokeCallback(ex);
             }
         }
+
         /// <summary>
         /// Try to write the next item in the write queue. Thread safe.
         /// </summary>


Connection: Allow thread inlining for start sending

--- src/Cassandra/Connection.cs
+++ src/Cassandra/Connection.cs
@@ -61,8 +61,6 @@
         private volatile byte[] _minimalBuffer;
         private volatile string _keyspace;
         private readonly object _keyspaceLock = new object();
-        ///  TaskScheduler used to handle read tasks
-        private readonly TaskScheduler _readScheduler = new LimitedParallelismTaskScheduler(1);
         ///  TaskScheduler used to handle write tasks
         private readonly TaskScheduler _writeScheduler = new LimitedParallelismTaskScheduler(1);
         ///
@@ -442,25 +440,19 @@
                 return;
             }
             //We are currently using an IO Thread
-            //Use TaskScheduler assigned for reading
-            var closureBuffer = (byte[]) buffer.Clone();
-            var closureBytesReceived = bytesReceived;
-            Task.Factory.StartNew(() =>
-            {
-                //Parse the data received
-                var streamIdAvailable = ReadParse(closureBuffer, 0, closureBytesReceived);
-                if (!streamIdAvailable)
-                {
-                    return;
-                }
-                if (_pendingWaitHandle != null && _pendingOperations.Count == 0 && _writeQueue.Count == 0)
-                {
-                    _pendingWaitHandle.Set();
-                }
-                //Process a next item in the queue if possible.
-                //Maybe there are there items in the write queue that were waiting on a fresh streamId
-                SendQueueNext();
-            }, CancellationToken.None, TaskCreationOptions.None, _readScheduler);
+            //Parse the data received
+            var streamIdAvailable = ReadParse(buffer, 0, bytesReceived);
+            if (!streamIdAvailable)
+            {
+                return;
+            }
+            if (_pendingWaitHandle != null && _pendingOperations.Count == 0 && _writeQueue.Count == 0)
+            {
+                _pendingWaitHandle.Set();
+            }
+            //Process a next item in the queue if possible.
+            //Maybe there are there items in the write queue that were waiting on a fresh streamId
+            SendQueueNext();
         }

         ///
@@ -609,18 +601,26 @@
                 Request = request,
                 Callback = callback
             };
-            SendQueueProcess(state);
+            SendQueueProcess(state, true);
         }

         ///
         /// Try to write the item provided. Thread safe.
         ///
-        private void SendQueueProcess(OperationState state)
+        /// <param name="state">The request and callback</param>
+        /// <param name="useInlining">Determines if the current thread can be used to start sending the request</param>
+        private void SendQueueProcess(OperationState state, bool useInlining)
         {
             var canWrite = Interlocked.CompareExchange(ref _canWriteNext, 0, 1);
             if (canWrite == 1)
             {
-                //Start a new task using the write TaskScheduler
+                if (useInlining)
+                {
+                    //Use the current thread to start the write operation
+                    SendQueueProcessItem(state);
+                    return;
+                }
+                //Start a new task using the TaskScheduler for writing
                 Task.Factory.StartNew(() => SendQueueProcessItem(state), CancellationToken.None, TaskCreationOptions.None, _writeScheduler);
             }
             else
@@ -672,7 +672,7 @@
             OperationState state;
             if (_writeQueue.TryDequeue(out state))
             {
-                SendQueueProcess(state);
+                SendQueueProcess(state, false);
             }
         }


Revert this hack to the name filter.

Revert this hack to the name filter.

The actul bug was that Xamarin Studio was incorrectly specifying
the test name. This has been fixed now.

--- src/framework/Internal/Filters/SimpleNameFilter.cs
+++ src/framework/Internal/Filters/SimpleNameFilter.cs
@@ -84,7 +84,7 @@
 		public override bool Match( ITest test )
 		{
 			foreach (var name in names)
-				if (name == test.FullName || test.FullName.StartsWith(name))
+				if (name == test.FullName)
 					return true;
 			return false;
 		}


- tests fix

- tests fix

--- Judge/Judge.Tests/Application/ProblemsServiceTests/GetStatementTests.cs
+++ Judge/Judge.Tests/Application/ProblemsServiceTests/GetStatementTests.cs
@@ -1,4 +1,5 @@
-using Judge.Application;
+using System;
+using Judge.Application;
 using Judge.Data;
 using Judge.Model.CheckSolution;
 using NUnit.Framework;
@@ -35,7 +36,7 @@
         }

         [Test]
-        public void StatementTest()
+        public void OpenedTaskStatementTest()
         {
             var task = new Task
             {
@@ -43,7 +44,8 @@
                 TimeLimitMilliseconds = 5000,
                 Name = "Task",
                 Statement = "*bb*",
-                TestsFolder = "Folder"
+                TestsFolder = "Folder",
+                IsOpened = true
             };
             _taskRepository.Stub(o => o.Get(1)).Return(task);
             var result = _service.GetStatement(1);
@@ -53,5 +55,21 @@
             Assert.That(result.Statement, Is.EqualTo(task.Statement));
             Assert.That(result.Name, Is.EqualTo(task.Name));
         }
+
+        [Test]
+        public void ClosedTaskStatementTest()
+        {
+            var task = new Task
+            {
+                MemoryLimitBytes = 1024000,
+                TimeLimitMilliseconds = 5000,
+                Name = "Task",
+                Statement = "*bb*",
+                TestsFolder = "Folder",
+                IsOpened = false
+            };
+            _taskRepository.Stub(o => o.Get(1)).Return(task);
+            Assert.Throws<InvalidOperationException>(() => _service.GetStatement(1));
+        }
     }
 }


Why isn't this an int...

Why isn't this an int...

--- SharpTox/Tox.cs
+++ SharpTox/Tox.cs
@@ -9,7 +9,7 @@
 {
     #region Event Delegates
     public delegate void OnFriendRequestDelegate(string id, string message);
-    public delegate void OnConnectionStatusDelegate(int friendnumber, byte status);
+    public delegate void OnConnectionStatusDelegate(int friendnumber, int status);
     public delegate void OnFriendMessageDelegate(int friendnumber, string message);
     public delegate void OnFriendActionDelegate(int friendnumber, string action);
     public delegate void OnNameChangeDelegate(int friendnumber, string newname);
@@ -274,7 +274,6 @@
             }
         }

-
         /// <summary>
         /// Loads the tox data file from a location specified by filename.
         /// </summary>
@@ -305,7 +304,6 @@
             }
         }

-
         /// <summary>
         /// Retrieves an array of group member names. Not implemented yet.
         /// </summary>
@@ -1057,7 +1055,7 @@
             ToxFunctions.CallbackConnectionStatus(tox, connectionstatusdelegate = new ToxDelegates.CallbackConnectionStatusDelegate((IntPtr t, int friendnumber, byte status, IntPtr userdata) =>
             {
                 if (OnConnectionStatusChanged != null)
-                    Invoker(OnConnectionStatusChanged, friendnumber, status);
+                    Invoker(OnConnectionStatusChanged, friendnumber, (int)status);
             }));

             ToxFunctions.CallbackFriendMessage(tox, friendmessagedelegate = new ToxDelegates.CallbackFriendMessageDelegate((IntPtr t, int friendnumber, byte[] message, ushort length, IntPtr userdata) =>


Version bump.

Version bump.

--- SolutionInfo.cs
+++ SolutionInfo.cs
@@ -29,5 +29,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.1.0.6")]
-[assembly: AssemblyFileVersion("0.1.0.6")]
+[assembly: AssemblyVersion("0.1.0.7")]
+[assembly: AssemblyFileVersion("0.1.0.7")]


Disable connection pool

Disable connection pool

--- Spider/Lobby.cs
+++ Spider/Lobby.cs
@@ -47,7 +47,7 @@

                 // return client back to the cold, dark, pool.
                 //connection = null;
-                Core.Pool.PutObject(connection);
+                //Core.Pool.PutObject(connection);
                 waitForLobby.Set();
             });
             waitForLobby.WaitOne();


Manually merged fix for #71

Manually merged fix for #71

--- src/ZXing.Net.Mobile/iOS/ZXingScannerView.cs
+++ src/ZXing.Net.Mobile/iOS/ZXingScannerView.cs
@@ -507,6 +507,8 @@
 			if (!stopped)
 				return;

+			stopped = false;
+
 			var perf = PerformanceCounter.Start ();

 			Setup (this.Frame);


Make repel disc cut anchoring in half rather than remove it completely.

--- game/server/weapons/disc.repel.cs
+++ game/server/weapons/disc.repel.cs
@@ -162,8 +162,8 @@
 		// remove possible barrier from enemy...
 		%col.deactivateBarrier();

-		// remove enemy's anchoring...
-		%col.setGridConnection(0);
+		// remove 50% of enemy's anchoring...
+		%col.setGridConnection(%col.gridConnection*0.50);

 		// push enemy away from player...
 		%vec = VectorSub(%col.getPosition(), %source.getPosition());


Don't make UpdateDialog TopMost, that's globally always-on-top

--- renderdocui/Windows/Dialogs/UpdateDialog.Designer.cs
+++ renderdocui/Windows/Dialogs/UpdateDialog.Designer.cs
@@ -115,7 +115,6 @@
             this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "Update Available";
-            this.TopMost = true;
             this.ResumeLayout(false);
             this.PerformLayout();


stop hanging tests in resharper 8

stop hanging tests in resharper 8


SlimAPI支持以 http://domain/entry?METHOD[.FORMAT][(CALLBACK)] 形式指定API调用的元参数信息。

--- src/cmstar.WebApi/Slim/SlimApiHttpHandler.cs
+++ src/cmstar.WebApi/Slim/SlimApiHttpHandler.cs
@@ -93,25 +93,52 @@
             var requestState = new SlimApiRequestState();
             var request = context.Request;

-            requestState._methodName = request.ExplicicParam(MetaParamMethodName);
-            requestState._callbackName = request.ExplicicParam(MetaParamCallback);
-
-            var format = request.ExplicicParam(MetaParamFormat);
-            if (!String.IsNullOrEmpty(format))
-            {
-                var formatOptions = format.ToLower().Split(TypeHelper.CollectionElementSpliter);
+            // 元参数可以两种方式体现（中括号内内容为可选）：
+            // 形式1：http://domain/entry?~method=METHOD[&~format=FORMAT][&~callback=CALLBACK]
+            // 形式2：http://domain/entry?METHOD[.FORMAT][(CALLBACK)]
+            // 形式2优先级高于形式1
+
+            string method = null;
+            string callback = null;
+            string format = null;
+
+            // 先从形式2中获取
+            var mixedMetaParams = request.QueryString[null];
+            if (mixedMetaParams != null)
+            {
+                ParseMixedMetaParams(mixedMetaParams, out method, out format, out callback);
+            }
+
+            // 未从形式2中获取的参数再从形式1中获取
+            if (string.IsNullOrEmpty(method))
+                method = request.ExplicicParam(MetaParamMethodName);
+
+            if (string.IsNullOrEmpty(callback))
+                callback = request.ExplicicParam(MetaParamCallback);
+
+            if (string.IsNullOrEmpty(format))
+                format = request.ExplicicParam(MetaParamFormat);
+
+            if (!string.IsNullOrEmpty(format))
+            {
+                var formatOptions = format.Split(TypeHelper.CollectionElementSpliter);
+                var ignoreCaseComparer = StringComparer.OrdinalIgnoreCase;
+
                 foreach (var formatOption in formatOptions)
                 {
-                    if (formatOption == MetaResponseFormatPlain)
+                    if (ignoreCaseComparer.Equals(formatOption, MetaResponseFormatPlain))
                     {
-                        requestState._usePlainText = true;
+                        requestState.UsePlainText = true;
                     }
                     else
                     {
-                        requestState._requestFormat = formatOption;
+                        requestState.RequestFormat = formatOption;
                     }
                 }
             }
+
+            requestState.MethodName = method;
+            requestState.CallbackName = callback;

             return requestState;
         }
@@ -125,7 +152,7 @@
         /// <returns>方法名称。</returns>
         protected override string RetriveRequestMethodName(HttpContext context, object requestState)
         {
-            return ((SlimApiRequestState)requestState)._methodName;
+            return ((SlimApiRequestState)requestState).MethodName;
         }

         /// <summary>
@@ -137,7 +164,7 @@
         /// <returns>调用的API方法所使用的参数解析器的名称。</returns>
         protected override string RetrieveRequestDecoderName(HttpContext context, object requestState)
         {
-            return ((SlimApiRequestState)requestState)._requestFormat;
+            return ((SlimApiRequestState)requestState).RequestFormat;
         }

         /// <summary>
@@ -183,9 +210,9 @@
         {
             var slimApiRequestState = (SlimApiRequestState)requestState;
             var httpResponse = context.Response;
-            var isJsonp = !String.IsNullOrEmpty(slimApiRequestState._callbackName);
-
-            if (slimApiRequestState._usePlainText)
+            var isJsonp = !String.IsNullOrEmpty(slimApiRequestState.CallbackName);
+
+            if (slimApiRequestState.UsePlainText)
             {
                 httpResponse.ContentType = "text/plain";
             }
@@ -200,7 +227,7 @@

             if (isJsonp)
             {
-                httpResponse.Write(slimApiRequestState._callbackName);
+                httpResponse.Write(slimApiRequestState.CallbackName);
                 httpResponse.Write("(");
             }

@@ -267,12 +294,96 @@
             return body;
         }

+        private void ParseMixedMetaParams(string input, out string method, out string format, out string callback)
+        {
+            // METHOD.FORMAT(CALLBACK)
+            format = callback = null;
+
+            const int followedByFomat = 1;
+            const int followedByCallback = 2;
+
+            var inputLength = input.Length;
+            var position = 0;
+            var followedBy = 0;
+
+            while (position < inputLength)
+            {
+                var c = input[position];
+
+                if (c == '.') // hit the beginning of the format name
+                {
+                    followedBy = followedByFomat;
+                    break;
+                }
+
+                if (c == '(') // hit the beginning of the callback name
+                {
+                    followedBy = followedByCallback;
+                    break;
+                }
+
+                if (++position == inputLength)
+                {
+                    method = input;
+                    return;
+                }
+            }
+
+            method = input.Substring(0, position);
+
+            if (followedBy == followedByFomat)
+            {
+                position++; // move to the next char after .
+                var formatStartIndex = position;
+                var paramLength = 0;
+                while (position < inputLength)
+                {
+                    var c = input[position];
+
+                    if (c == '(') // hit the beginning of the callback name
+                    {
+                        followedBy = followedByCallback;
+                        break;
+                    }
+
+                    paramLength++;
+                    position++;
+                }
+
+                format = input.Substring(formatStartIndex, paramLength);
+            }
+
+            if (followedBy == followedByCallback)
+            {
+                position++; // move to the next char after (
+
+                var callbackStartIndex = position;
+                var paramLength = 0;
+                while (true)
+                {
+                    var c = input[position];
+
+                    if (c == ')') // hit the end of the callback name
+                        break;
+
+                    paramLength++;
+                    position++;
+
+                    // if there's not a ')', means no callback name specified
+                    if (position == inputLength)
+                        return;
+                }
+
+                callback = input.Substring(callbackStartIndex, paramLength);
+            }
+        }
+
         private class SlimApiRequestState
         {
-            public string _methodName;
-            public string _callbackName;
-            public string _requestFormat;
-            public bool _usePlainText;
+            public string MethodName;
+            public string CallbackName;
+            public string RequestFormat;
+            public bool UsePlainText;
         }
     }
 }