Extract Tilemap palette init

Extract Tilemap palette init

--- Pre2/AssetConverter.cs
+++ Pre2/AssetConverter.cs
@@ -105,17 +105,8 @@

         public static Palette GetLevelPalette(int levelIdx)
         {
-            int numPaletteEntries = 16;
             byte[] vgaPalette = LevelPalettes[LevelPals[levelIdx]];
-            Palette palette = new Palette(numPaletteEntries);
-            for (var i = 0; i < numPaletteEntries; i++)
-            {
-                byte r = ConvertVgaToRgb(vgaPalette[i * 3 + 0]);
-                byte g = ConvertVgaToRgb(vgaPalette[i * 3 + 1]);
-                byte b = ConvertVgaToRgb(vgaPalette[i * 3 + 2]);
-                palette.SetColor(i, new Color(r, g, b));
-            }
-            return palette;
+            return GetPalette(vgaPalette);
         }

         public static Bitmap GetLevelBackground(int levelIdx)
@@ -538,6 +529,20 @@
             return palettes;
         }

+        private static Palette GetPalette(byte[] vgaPalette)
+        {
+            int numEntries = vgaPalette.Length / 3;
+            Palette palette = new Palette(numEntries);
+            for (var i = 0; i < numEntries; i++)
+            {
+                byte r = ConvertVgaToRgb(vgaPalette[i * 3 + 0]);
+                byte g = ConvertVgaToRgb(vgaPalette[i * 3 + 1]);
+                byte b = ConvertVgaToRgb(vgaPalette[i * 3 + 2]);
+                palette.SetColor(i, new Color(r, g, b));
+            }
+            return palette;
+        }
+
         private static byte ConvertVgaToRgb(byte sixBitValue)
         {
             sixBitValue &= 0x3F; // make sure it's really 6-bit value


Use `lock` instead of `MethodImplOptions.Synchronized`

--- PusherClient/Pusher.cs
+++ PusherClient/Pusher.cs
@@ -2,7 +2,6 @@
 using System.Collections.Generic;
 using Newtonsoft.Json;
 using System.Diagnostics;
-using System.Runtime.CompilerServices;

 namespace PusherClient
 {
@@ -104,37 +103,40 @@
         [MethodImpl(MethodImplOptions.Synchronized)]
         public void Connect()
         {
-            // Check current connection state
-            if (_connection != null)
-            {
-              Trace.TraceEvent(TraceEventType.Warning, 0, "Attempt to connect when another connection has already started. New attempt has been ignored.");
-              return;
-            }
-
-            var scheme = "ws://";
-
-            if (_options.Encrypted)
-                scheme = "wss://";
-
-            // TODO: Fallback to secure?
-
-            string url = String.Format("{0}{1}/app/{2}?protocol={3}&client={4}&version={5}",
-                scheme, _options.Host, _applicationKey, Settings.Default.ProtocolVersion, Settings.Default.ClientName,
-                Settings.Default.VersionNumber);
-
-            _connection = new Connection(this, url);
-            _connection.Connected += _connection_Connected;
-            _connection.ConnectionStateChanged +=_connection_ConnectionStateChanged;
-            if (_errorEvent != null)
-            {
-                // subscribe to the connection's error handler
-                foreach (ErrorEventHandler handler in _errorEvent.GetInvocationList())
-                {
-                    _connection.Error += handler;
-                }
-            }
-            _connection.Connect();
-
+            // Prevent multiple concurrent connections
+            lock(_lockingObject)
+            {
+                // Ensure we only ever attempt to connect once
+                if (_connection != null)
+                {
+                  Trace.TraceEvent(TraceEventType.Warning, 0, "Attempt to connect when another connection has already started. New attempt has been ignored.");
+                  return;
+                }
+
+                var scheme = "ws://";
+
+                if (_options.Encrypted)
+                    scheme = "wss://";
+
+                // TODO: Fallback to secure?
+
+                string url = String.Format("{0}{1}/app/{2}?protocol={3}&client={4}&version={5}",
+                    scheme, _options.Host, _applicationKey, Settings.Default.ProtocolVersion, Settings.Default.ClientName,
+                    Settings.Default.VersionNumber);
+
+                _connection = new Connection(this, url);
+                _connection.Connected += _connection_Connected;
+                _connection.ConnectionStateChanged +=_connection_ConnectionStateChanged;
+                if (_errorEvent != null)
+                {
+                    // subscribe to the connection's error handler
+                    foreach (ErrorEventHandler handler in _errorEvent.GetInvocationList())
+                    {
+                        _connection.Error += handler;
+                    }
+                }
+                _connection.Connect();
+            }
         }

         public void Disconnect()


Fixed the line drawing issue on the drawing surface.

--- src/LogoSharp.Drawing/Turtle.cs
+++ src/LogoSharp.Drawing/Turtle.cs
@@ -50,6 +50,7 @@

             this.drawingImage = new Bitmap(this.control.ClientSize.Width, this.control.ClientSize.Height);
             this.drawingGraphics = Graphics.FromImage(this.drawingImage);
+
             this.drawingGraphics.SmoothingMode = SmoothingMode.AntiAlias;
         }

@@ -116,8 +117,7 @@
             var toX = (int)(this.Position.X + steps * Math.Cos(this.Angle * Math.PI / 180));
             var toY = (int)(this.Position.Y + steps * Math.Sin(this.Angle * Math.PI / 180));

-            this.drawingGraphics.DrawLine(Pens.Black, WorldPositionToControl(this.control, new Point(fromX, fromY)),
-                WorldPositionToControl(this.control, new Point(toX, toY)));
+            this.DrawLine(this.Position, new Point(toX, toY));

             this.Position = new Point(toX, toY);
         }
@@ -144,6 +144,19 @@
             this.turtlePicture.Image = RotateImage(this.turtleImage, this.angle);
             this.turtlePicture.Width = this.turtlePicture.Image.Width;
             this.turtlePicture.Height = this.turtlePicture.Image.Height;
+        }
+
+        private void DrawLine(Point from, Point to)
+        {
+            using (var pen = new Pen(this.PenColor, 2.0F) { StartCap = LineCap.Round, EndCap = LineCap.Round })
+            {
+                var fromPoint = WorldPositionToControl(this.control, new Point(from.X, from.Y));
+                var toPoint = WorldPositionToControl(this.control, new Point(to.X, to.Y));
+
+                this.drawingGraphics.DrawLine(pen, fromPoint, toPoint);
+
+                this.control.Invalidate();
+            }
         }

         private void Dispose(bool disposing)


Add implement LuryComplex

Add implement LuryComplex

--- src/Lury/Objects/LuryComplex.cs
+++ src/Lury/Objects/LuryComplex.cs
@@ -32,6 +32,107 @@
 {
     public class LuryComplex : LuryNumber
     {
+        private readonly double real, imag;
+
+        public double Real　{ get { return this.real; } }
+
+        public double Imag　{ get { return this.imag; } }
+
+        public LuryComplex(double real, double imag)
+        {
+            this.real = real;
+            this.imag = imag;
+        }
+
+        public override LuryObject Pow(LuryObject other)
+        {
+            throw new NotSupportedException();
+        }
+
+        public override LuryObject Pos()
+        {
+            return this;
+        }
+
+        public override LuryObject Neg()
+        {
+            return new LuryComplex(-this.real, -this.imag);
+        }
+
+        public override LuryObject Mul(LuryObject other)
+        {
+            if (other is LuryInteger)
+                return new LuryComplex(this.real　* ((LuryInteger)other).Value, this.imag * ((LuryInteger)other).Value);
+
+            if (other is LuryReal)
+                return new LuryComplex(this.real　* ((LuryReal)other).Value, this.imag * ((LuryReal)other).Value);
+
+            if (other is LuryComplex)
+                return new LuryComplex(this.real　* ((LuryComplex)other).Real, this.imag * ((LuryComplex)other).Imag);
+
+            throw new NotSupportedException();
+        }
+
+        public override LuryObject Div(LuryObject other)
+        {
+            if (other is LuryInteger)
+                return new LuryComplex(this.real　/ ((LuryInteger)other).Value, this.imag * ((LuryInteger)other).Value);
+
+            if (other is LuryReal)
+                return new LuryComplex(this.real　/ ((LuryReal)other).Value, this.imag * ((LuryReal)other).Value);
+
+            if (other is LuryComplex)
+                return new LuryComplex(this.real　/ ((LuryComplex)other).Real, this.imag * ((LuryComplex)other).Imag);
+
+            throw new NotSupportedException();
+        }
+
+        public override LuryObject IDiv(LuryObject other)
+        {
+            throw new NotSupportedException();
+        }
+
+        public override LuryObject Add(LuryObject other)
+        {
+            if (other is LuryInteger)
+                return new LuryComplex(this.real　+ ((LuryInteger)other).Value, this.imag);
+
+            if (other is LuryReal)
+                return new LuryComplex(this.real　+ ((LuryReal)other).Value, this.imag);
+
+            if (other is LuryComplex)
+                return new LuryComplex(this.real　+ ((LuryComplex)other).Real, this.imag　+ ((LuryComplex)other).Imag);
+
+            throw new NotSupportedException();
+        }
+
+        public override LuryObject Sub(LuryObject other)
+        {
+            if (other is LuryInteger)
+                return new LuryComplex(this.real　- ((LuryInteger)other).Value, this.imag);
+
+            if (other is LuryReal)
+                return new LuryComplex(this.real　- ((LuryReal)other).Value, this.imag);
+
+            if (other is LuryComplex)
+                return new LuryComplex(this.real　- ((LuryComplex)other).Real, this.imag　+ ((LuryComplex)other).Imag);
+
+            throw new NotSupportedException();
+        }
+
+        public override LuryBoolean CEq(LuryObject other)
+        {
+            if (other is LuryInteger)
+                return this.real == (double)((LuryInteger)other).Value && this.imag == 0.0 ? LuryBoolean.True : LuryBoolean.False;
+
+            if (other is LuryReal)
+                return this.real == ((LuryReal)other).Value && this.imag == 0.0 ? LuryBoolean.True : LuryBoolean.False;
+
+            if (other is LuryComplex)
+                return this.real == ((LuryComplex)other).real && this.imag == ((LuryComplex)other).imag ? LuryBoolean.True : LuryBoolean.False;
+
+            throw new NotSupportedException();
+        }
     }
 }


Turn off autoselection if another selection has been made

--- RebaseAssister/Main.cs
+++ RebaseAssister/Main.cs
@@ -55,7 +55,10 @@
 				    var currentPosition = scintillaGateway.GetCurrentPos();
 				    if (currentPosition != lastPositionWhenUiUpdate)
 				    {
-					    lastPositionWhenUiUpdate = firstWordSelector.SelectFirstWordOfLine(scintillaGateway);
+					    if (scintillaGateway.GetSelectionEmpty())
+					    {
+						    lastPositionWhenUiUpdate = firstWordSelector.SelectFirstWordOfLine(scintillaGateway);
+					    }
 				    }
 				    return;
 			    }


Fix LogNUnitError extension method of AtataContextBuilder according to 3.6.0 version of NUnit

--- src/Atata/Context/AtataContextBuilderExtensions.cs
+++ src/Atata/Context/AtataContextBuilderExtensions.cs
@@ -132,7 +132,7 @@
                 dynamic testContext = GetNUnitTestContext();
                 var testResult = testContext.Result;

-                if ((int)testResult.Outcome.Status == 3)
+                if ((bool)testResult.Outcome.Status.ToString().Contains("Fail"))
                     AtataContext.Current.Log.Error((string)testResult.Message, (string)testResult.StackTrace);
             });
         }


Use null _dirty as meaning "needs first update".

--- src/Avalonia.Visuals/Rendering/DeferredRenderer.cs
+++ src/Avalonia.Visuals/Rendering/DeferredRenderer.cs
@@ -16,9 +16,8 @@
         private readonly IRenderRoot _root;
         private Scene _scene;
         private IRenderTarget _renderTarget;
-        private List<IVisual> _dirty = new List<IVisual>();
+        private List<IVisual> _dirty;
         private DirtyRects _dirtyRects;
-        private bool _needsUpdate;
         private bool _updateQueued;
         private bool _rendering;

@@ -46,14 +45,7 @@

         public void AddDirty(IVisual visual)
         {
-            // If the root of the scene has no children, then the scene is being set up; don't
-            // bother filling the dirty list with every control in the window.
-            if (_scene.Root.Children.Count > 0)
-            {
-                _dirty.Add(visual);
-            }
-
-            _needsUpdate = true;
+            _dirty?.Add(visual);
         }

         public void Dispose()
@@ -66,7 +58,7 @@

         public IEnumerable<IVisual> HitTest(Point p, Func<IVisual, bool> filter)
         {
-            if (_renderLoop == null && _needsUpdate)
+            if (_renderLoop == null && (_dirty == null || _dirty.Count > 0))
             {
                 // When unit testing the renderLoop may be null, so update the scene manually.
                 UpdateScene();
@@ -136,7 +128,13 @@
                 var scene = _scene.Clone();
                 var dirtyRects = new DirtyRects();

-                if (_dirty.Count > 0)
+                if (_dirty == null)
+                {
+                    _dirty = new List<IVisual>();
+                    SceneBuilder.UpdateAll(scene);
+                    dirtyRects.Add(new Rect(_root.ClientSize));
+                }
+                else if (_dirty.Count > 0)
                 {
                     foreach (var visual in _dirty)
                     {
@@ -145,11 +143,6 @@

                     dirtyRects.Coalesce();
                 }
-                else
-                {
-                    SceneBuilder.UpdateAll(scene);
-                    dirtyRects.Add(new Rect(_root.ClientSize));
-                }

                 lock (_scene)
                 {
@@ -158,7 +151,6 @@
                 }

                 _dirty.Clear();
-                _needsUpdate = false;
                 _root.Invalidate(new Rect(_root.ClientSize));
             }
             finally
@@ -174,7 +166,7 @@
                 return;
             }

-            if (_needsUpdate && !_updateQueued)
+            if (!_updateQueued && (_dirty == null || _dirty.Count > 0))
             {
                 Dispatcher.UIThread.InvokeAsync(UpdateScene, DispatcherPriority.Render);
                 _updateQueued = true;


Fixed a bug in the validation of strings in the FiglutEntityModel.

--- source/trunk/Windows/Figlut.Server.Toolkit.45/Web/MVC/Models/FiglutEntityModel.cs
+++ source/trunk/Windows/Figlut.Server.Toolkit.45/Web/MVC/Models/FiglutEntityModel.cs
@@ -21,7 +21,7 @@
         public bool IsStringFieldSet(string fieldName, string fieldValue, out string errorMessage)
         {
             errorMessage = null;
-            if (string.IsNullOrEmpty(fieldName))
+            if (string.IsNullOrEmpty(fieldValue))
             {
                 errorMessage = $"{fieldName} not entered.";
                 return false;


auto-regenerated resource stuff

auto-regenerated resource stuff

--- src/BluetoothWidget/Resources/Resource.Designer.cs
+++ src/BluetoothWidget/Resources/Resource.Designer.cs
@@ -2,7 +2,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.18063
+//     Runtime Version:4.0.30319.34014
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.


Introduce DefaultDisableEventSubscriptionsOfChildValuesValue so it can be applied to all models at once

--- src/Catel.Core/Catel.Core.Shared/Data/ModelBase.cs
+++ src/Catel.Core/Catel.Core.Shared/Data/ModelBase.cs
@@ -158,6 +158,7 @@
             PropertyDataManager = PropertyDataManager.Default;

             DefaultValidateUsingDataAnnotationsValue = true;
+            DefaultDisableEventSubscriptionsOfChildValuesValue = false;
             DefaultSerializer = IoCConfiguration.DefaultDependencyResolver.Resolve<ISerializer>();
         }

@@ -306,6 +307,11 @@
         protected bool DisableEventSubscriptionsOfChildValues { get; set; }

         /// <summary>
+        /// Gets or sets a value indicating whether event subscriptions of child values should be disabled.
+        /// </summary>
+        public static bool DefaultDisableEventSubscriptionsOfChildValuesValue { get; set; }
+
+        /// <summary>
         /// Gets the property data manager that manages the properties of this object.
         /// </summary>
         /// <value>The property data manager.</value>
@@ -314,15 +320,6 @@
 #endif
         [XmlIgnore]
         internal static PropertyDataManager PropertyDataManager { get; private set; }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether this object is subscribed to all childs.
-        /// </summary>
-#if NET || SILVERLIGHT
-        [Browsable(false)]
-#endif
-        [XmlIgnore]
-        private bool SubscribedToEvents { get; set; }

         /// <summary>
         /// Gets a value indicating whether this object is currently initializing.
@@ -528,6 +525,7 @@
             Serializer = DefaultSerializer;
             SuspendValidation = DefaultSuspendValidationValue;
             ValidateUsingDataAnnotations = DefaultValidateUsingDataAnnotationsValue;
+            DisableEventSubscriptionsOfChildValues = DefaultDisableEventSubscriptionsOfChildValuesValue;
             DeserializationSucceeded = false;
             HandlePropertyAndCollectionChanges = true;
             AlwaysInvokeNotifyChanged = false;


Minor edits

Minor edits

--- src/Chatham.Kit.ServiceDiscovery.Cache/Throttle.cs
+++ src/Chatham.Kit.ServiceDiscovery.Cache/Throttle.cs
@@ -6,6 +6,8 @@
 {
     public class Throttle : IThrottle
     {
+        private bool _disposed;
+
         private readonly TimeSpan _maxPeriod;
         private readonly SemaphoreSlim _throttleActions, _throttlePeriods;

@@ -46,8 +48,6 @@
             }, cancel);
         }

-        private bool _disposed;
-
         protected virtual void Dispose(bool disposing)
         {
             if (_disposed)
@@ -60,6 +60,7 @@
                 _throttleActions.Dispose();
                 _throttlePeriods.Dispose();
             }
+
             _disposed = true;
         }


Suppress reload workspace dialog on reset

--- src/R/Components/Impl/InteractiveWorkflow/Implementation/RInteractiveEvaluator.cs
+++ src/R/Components/Impl/InteractiveWorkflow/Implementation/RInteractiveEvaluator.cs
@@ -100,9 +100,8 @@

         public async Task<ExecutionResult> ResetAsync(bool initialize = true) {
             try {
-                bool isResetting = true;
                 if (Session.IsHostRunning) {
-                    isResetting = await SaveStateAsync();
+                    await SaveStateAsync();
                     WriteErrorLine(Environment.NewLine + Resources.MicrosoftRHostStopping);
                     await Session.StopHostAsync(true);
                 }
@@ -112,26 +111,24 @@
                 }

                 WriteErrorLine(Environment.NewLine + Resources.MicrosoftRHostStarting);
-                return await InitializeAsync(isResetting);
+                return await InitializeAsync(isResetting: true);
             } catch (Exception ex) {
                 Trace.Fail($"Exception in RInteractiveEvaluator.ResetAsync\n{ex}");
                 return ExecutionResult.Failure;
             }
         }

-        private async Task<bool> SaveStateAsync() {
+        private async Task SaveStateAsync() {
             try {
                 if (_settings.ShowSaveOnResetConfirmationDialog == YesNo.Yes) {
                     if (MessageButtons.Yes == await _coreShell.ShowMessageAsync(Resources.Warning_SaveOnReset, MessageButtons.YesNo)) {
                         await Session.ExecuteAsync("rtvs:::save_state()");
-                        return false;
                     }
                 }
             } catch (RHostDisconnectedException rhdex) {
                 WriteRHostDisconnectedError(rhdex);
                 WriteErrorLine(Resources.Error_FailedToSaveState);
             }
-            return true;
         }

         public bool CanExecuteCode(string text) {


Extracted resource key name whitelist to config context.

https://github.com/valdisiljuconoks/localization-provider-epi/issues/66

--- src/DbLocalizationProvider/ConfigurationContext.cs
+++ src/DbLocalizationProvider/ConfigurationContext.cs
@@ -5,7 +5,7 @@
 using System.Collections.Generic;
 using System.Globalization;
 using System.Reflection;
-using System.Runtime.InteropServices.ComTypes;
+using System.Text.RegularExpressions;
 using DbLocalizationProvider.Cache;
 using DbLocalizationProvider.Export;
 using DbLocalizationProvider.Import;
@@ -189,6 +189,11 @@
         public ILogger Logger { get; set; } = new NullLogger();

         /// <summary>
+        /// If you are looking for a way to allow other characters in resource key name - this is the property to set.
+        /// </summary>
+        public Regex ResourceKeyNameFilter { get; set; } = new Regex("^[.@+\\\"\\=\\/\\[\\]a-zA-Z0-9]+$");
+
+        /// <summary>
         ///     Method to initialize and configure localization provider.
         /// </summary>
         /// <param name="configCallback">Configuration setup action.</param>


Add cleandatabase call in global steps

Add cleandatabase call in global steps

Added call to clean the levy database after running the tests for
transactions.

--- src/SFA.DAS.EAS.Transactions.AcceptanceTests/Steps/CommonSteps/GlobalTestSteps.cs
+++ src/SFA.DAS.EAS.Transactions.AcceptanceTests/Steps/CommonSteps/GlobalTestSteps.cs
@@ -28,6 +28,9 @@

             var cleanDownDb = _container.GetInstance<ICleanDatabase>();
             cleanDownDb.Execute().Wait();
+
+            var cleanDownTransactionDb = _container.GetInstance<ICleanTransactionsDatabase>();
+            cleanDownTransactionDb.Execute().Wait();
         }
     }
 }


update demo

update demo

--- src/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Views/Shared/_Layout.cshtml
+++ src/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Views/Shared/_Layout.cshtml
@@ -45,7 +45,7 @@

                 @*重要公告（2017-2-22）：Nuget 上的 Senparc.Weixin.MP.dll v14.3.126 有一个统一订单的 bug，已经在 v14.3.127 中修正。*@
-                2017年3月13日已发布新版本，建议更新。点击这里查看。
+                2017年3月28日已发布新版本，支持小程序新发布的“新能力”，建议更新。点击这里查看。


Disable http pipelining

Disable http pipelining

Pipelining isn't supported by elasticsearch.  Closes #830.

--- src/Elasticsearch.Net/Connection/HttpConnection.cs
+++ src/Elasticsearch.Net/Connection/HttpConnection.cs
@@ -184,6 +184,7 @@
 			myReq.Accept = "application/json";
 			myReq.ContentType = "application/json";
 			myReq.MaximumResponseHeadersLength = -1;
+			myReq.Pipelined = false;
 			//myReq.AllowWriteStreamBuffering = false;
 			if (this.ConnectionSettings.EnableCompressedResponses)
 			{


Change SafeMemoryMappedFileHandle to use IntPtr.Zero instead of new IntPtr(0)

--- src/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.cs
+++ src/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.cs
@@ -32,7 +32,7 @@
             [SecurityCritical]
             get
             {
-                return handle == new IntPtr(0) || handle == new IntPtr(-1);
+                return handle == IntPtr.Zero || handle == new IntPtr(-1);
             }
         }
     }


Expected exception changed on Linux machines

* Linux machines used to throw a PNSE when trying to cert store location LocalMachine which is when we knew to use the CurrentUser location instead.
* At some point it began wrapping the PNSE inside of a CryptographicException, just need our infra logic to account for this change.

--- src/System.Private.ServiceModel/tests/Common/Infrastructure/CertificateManager.cs
+++ src/System.Private.ServiceModel/tests/Common/Infrastructure/CertificateManager.cs
@@ -54,6 +54,12 @@
                         // Linux
                         s_PlatformSpecificRootStoreLocation = StoreLocation.CurrentUser;
                     }
+                    catch(CryptographicException)
+                    {
+                        // Linux
+                        s_PlatformSpecificRootStoreLocation = StoreLocation.CurrentUser;
+                    }
+
                     s_PlatformSpecificStoreLocationIsSet = true;
                 }
                 return s_PlatformSpecificRootStoreLocation;


Skip HighlightRefsMultipleSubmisionsVerifyRenameTags tests

(cherry picked from commit 63a730bbcc1d696f065984739b8f09fde5901a0a)

--- src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReplIdeFeatures.cs
+++ src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReplIdeFeatures.cs
@@ -88,7 +88,7 @@
             VisualStudio.InteractiveWindow.VerifyTags(WellKnownTagNames.MarkerFormatDefinition_HighlightedWrittenReference, 0);
         }

-        [WpfFact]
+        [WpfFact(Skip = "https://github.com/dotnet/roslyn/issues/46027")]
         public void HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpWhenInvokedOnSubmittedText()
         {
             VisualStudio.InteractiveWindow.SubmitText("class Goo { }");
@@ -100,7 +100,7 @@
             VisualStudio.InteractiveWindow.VerifyTags(WellKnownTagNames.MarkerFormatDefinition_HighlightedReference, 1);
         }

-        [WpfFact]
+        [WpfFact(Skip = "https://github.com/dotnet/roslyn/issues/46027")]
         public void HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnUnsubmittedText()
         {
             VisualStudio.InteractiveWindow.SubmitText("class Goo { }");
@@ -112,7 +112,7 @@
             VisualStudio.InteractiveWindow.VerifyTags(WellKnownTagNames.MarkerFormatDefinition_HighlightedReference, 1);
         }

-        [WpfFact]
+        [WpfFact(Skip = "https://github.com/dotnet/roslyn/issues/46027")]
         public void HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnTypesWhenInvokedOnSubmittedText()
         {
             VisualStudio.InteractiveWindow.SubmitText("class Goo { }");
@@ -124,7 +124,7 @@
             VisualStudio.InteractiveWindow.VerifyTags(WellKnownTagNames.MarkerFormatDefinition_HighlightedReference, 2);
         }

-        [WpfFact]
+        [WpfFact(Skip = "https://github.com/dotnet/roslyn/issues/46027")]
         public void HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnTypesWhenInvokedOnUnsubmittedText()
         {
             VisualStudio.InteractiveWindow.SubmitText("class Goo { }");


Untabified and cleanupped

Untabified and cleanupped

--- src/FluentMigrator.Tests/Unit/TaskExecutorTests.cs
+++ src/FluentMigrator.Tests/Unit/TaskExecutorTests.cs
@@ -1,21 +1,3 @@
-#region License
-//
-// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
 using System;
 using System.Data;
 using System.Linq.Expressions;
@@ -27,16 +9,20 @@

 namespace FluentMigrator.Tests.Unit
 {
-	[TestFixture]
-	public class TaskExecutorTests : IntegrationTestBase
-	{
-        private Mock<IMigrationRunner> _migrationRunner;
+    [TestFixture]
+    public class TaskExecutorTests : IntegrationTestBase
+    {
+        #region Setup/Teardown

         [SetUp]
         public void SetUp()
         {
             _migrationRunner = new Mock<IMigrationRunner>();
         }
+
+        #endregion
+
+        private Mock<IMigrationRunner> _migrationRunner;

         private void Verify(Expression<Action<IMigrationRunner>> func, string task, long version, int steps)
         {
@@ -66,6 +52,23 @@
             taskExecutor.Execute();

             _migrationRunner.VerifyAll();
+        }
+
+        [Test]
+        public void InvalidProviderNameShouldThrowArgumentException()
+        {
+            var runnerContext = new Mock<IRunnerContext>();
+            runnerContext.SetupGet(x => x.Database).Returns("sqlWRONG");
+            runnerContext.SetupGet(x => x.Connection).Returns(IntegrationTestOptions.SqlServer2008.ConnectionString);
+            runnerContext.SetupGet(x => x.Target).Returns(GetType().Assembly.Location);
+
+            Assert.Throws<ProcessorFactoryNotFoundException>(() => new TaskExecutor(runnerContext.Object).Execute());
+        }
+
+        [Test]
+        public void ShouldCallMigrateDownIfSpecified()
+        {
+            Verify(x => x.MigrateDown(It.Is<long>(c => c == 20)), "migrate:down", 20, 0);
         }

         [Test]
@@ -100,38 +103,20 @@
         {
             Verify(x => x.Rollback(It.Is<int>(c => c == 1)), "rollback", 0, 0);
         }
+    }

-        [Test]
-        public void ShouldCallMigrateDownIfSpecified()
-        {
-            Verify(x => x.MigrateDown(It.Is<long>(c => c == 20)), "migrate:down", 20, 0);
-        }
-
-	    [Test]
-	    public void InvalidProviderNameShouldThrowArgumentException()
-	    {
-            var runnerContext = new Mock<IRunnerContext>();
-            runnerContext.SetupGet(x => x.Database).Returns("sqlWRONG");
-            runnerContext.SetupGet(x => x.Connection).Returns(IntegrationTestOptions.SqlServer2008.ConnectionString);
-            runnerContext.SetupGet(x => x.Target).Returns(GetType().Assembly.Location);
-
-	        Assert.Throws<ProcessorFactoryNotFoundException>(() => new TaskExecutor(runnerContext.Object).Execute());
-
-	    }
-	}
-
-    class FakeTaskExecutor: TaskExecutor
+    internal class FakeTaskExecutor : TaskExecutor
     {
         private readonly IMigrationRunner runner;

         public FakeTaskExecutor(IRunnerContext runnerContext, IMigrationRunner runner) : base(runnerContext)
-         {
-             this.runner = runner;
-         }
+        {
+            this.runner = runner;
+        }

         protected override void Initialize()
         {
             Runner = runner;
         }
     }
-}
+}


Allow instantiating jQueryPosition

Allow instantiating jQueryPosition

--- src/Libraries/jQuery/jQuery.Core/jQueryPosition.cs
+++ src/Libraries/jQuery/jQuery.Core/jQueryPosition.cs
@@ -14,9 +14,13 @@
     /// </summary>
     [ScriptImport]
     [ScriptIgnoreNamespace]
+    [ScriptName("Object")]
     public sealed class jQueryPosition {

-        private jQueryPosition() {
+        public jQueryPosition() {
+        }
+
+        public jQueryPosition(params object[] nameValuePairs) {
         }

         /// <summary>
@@ -26,6 +30,8 @@
         public int Left {
             get {
                 return 0;
+            }
+            set {
             }
         }

@@ -37,6 +43,8 @@
             get {
                 return 0;
             }
+            set {
+            }
         }

         public static implicit operator Dictionary(jQueryPosition position) {


Fixing small typo in a comment (#1328)

Fixing small typo in a comment (#1328)

--- src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs
+++ src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs
@@ -339,7 +339,7 @@

         private void AddApplicationServices(IServiceCollection services, IServiceProvider hostingServiceProvider)
         {
-            // We are forwarding services from hosting contrainer so hosting container
+            // We are forwarding services from hosting container so hosting container
             // can still manage their lifetime (disposal) shared instances with application services.
             // NOTE: This code overrides original services lifetime. Instances would always be singleton in
             // application container.


Only add enums and object definitions in AddGenerators

--- src/NJsonSchema.CodeGeneration/TypeResolverBase.cs
+++ src/NJsonSchema.CodeGeneration/TypeResolverBase.cs
@@ -75,7 +75,14 @@
             if (definitions != null)
             {
                 foreach (var pair in definitions)
-                    AddGenerator(pair.Value.ActualSchema, pair.Key);
+                {
+                    var schema = pair.Value.ActualSchema;
+                    var isCodeGeneratingSchema = !schema.IsDictionary && !schema.IsAnyType &&
+                        (schema.IsEnumeration || schema.Type == JsonObjectType.None || schema.Type.HasFlag(JsonObjectType.Object));
+
+                    if (isCodeGeneratingSchema)
+                        AddGenerator(schema, pair.Key);
+                }
             }
         }


Add corrections for separator violations

--- Rules/UseWhitespace.cs
+++ Rules/UseWhitespace.cs
@@ -177,13 +177,37 @@
             // TODO update separator error string
             foreach (var tokenNode in tokenOperations.GetTokenNodes(IsSeparator).Where(predicate))
             {
+                var errorKind = tokenNode.Value.Kind == TokenKind.Comma
+                    ? ErrorKind.SeparatorComma
+                    : ErrorKind.SeparatorSemi;
                 yield return getDiagnosticRecord(
                     tokenNode.Value,
-                    tokenNode.Value.Kind == TokenKind.Comma ? ErrorKind.SeparatorComma : ErrorKind.SeparatorSemi);
-            }
-        }
-
-        private DiagnosticRecord getDiagnosticRecord(Token token, ErrorKind errKind)
+                    errorKind,
+                    GetSeparatorCorrections(errorKind, tokenNode.Value, tokenNode.Next.Value).ToList());
+            }
+        }
+
+        private IEnumerable<CorrectionExtent> GetSeparatorCorrections(
+            ErrorKind errorKind,
+            Token separatorToken,
+            Token nextToken)
+        {
+            var e1 = separatorToken.Extent;
+            var e2 = nextToken.Extent;
+            var extent = new ScriptExtent(
+                new ScriptPosition(e1.File, e1.StartLineNumber, e1.StartColumnNumber, null),
+                new ScriptPosition(e2.File, e2.StartLineNumber, e2.StartColumnNumber, null));
+            yield return new CorrectionExtent(
+                separatorToken.Extent,
+                separatorToken.Text + whiteSpace,
+                separatorToken.Extent.File,
+                GetError(errorKind)); // TODO replace with better string
+        }
+
+        private DiagnosticRecord getDiagnosticRecord(
+            Token token,
+            ErrorKind errKind,
+            List<CorrectionExtent> corrections)
         {
             return new DiagnosticRecord(
                 GetError(errKind),
@@ -192,7 +216,7 @@
                 GetDiagnosticSeverity(),
                 token.Extent.File,
                 null,
-                null);
+                corrections);
         }

         private bool IsKeyword(Token token)


MINOR: only log journal reports if they're non-empty

--- isc.onec.adapter/Server.cs
+++ isc.onec.adapter/Server.cs
@@ -52,8 +52,10 @@

 				if (this.service != null) {
 					var journalReport = this.service.getJournalReport();
-					logger.Debug(journalReport);
-					eventLog.WriteEntry(journalReport, EventLogEntryType.Error);
+					if (journalReport != null && journalReport.Length != 0) {
+						logger.Debug(journalReport);
+						eventLog.WriteEntry(journalReport, EventLogEntryType.Error);
+					}

 					this.service.disconnect();
 					this.service = null;


Add check for login success

Add check for login success

--- PogoLocationFeeder/Program.cs
+++ PogoLocationFeeder/Program.cs
@@ -146,7 +146,18 @@
                 if (settings.useToken && settings.DiscordToken != null)
                     await _client.Connect(settings.DiscordToken);
                 else if (settings.DiscordUser != null && settings.DiscordPassword != null)
-                    await _client.Connect(settings.DiscordUser, settings.DiscordPassword);
+                {
+                    try
+                    {
+                        await _client.Connect(settings.DiscordUser, settings.DiscordPassword);
+                    }
+                    catch
+                    {
+                        Console.WriteLine("Failed to authroize Discord user! Check your config.json and try again.");
+                        Console.ReadKey();
+                        return;
+                    }
+                }
                 else
                 {
                     Console.WriteLine("Please set your logins in the config.json first");


Add NCryptEnumKeys test based on IntPtr

Add NCryptEnumKeys test based on IntPtr

--- src/NCrypt.Tests/NCryptFacts.cs
+++ src/NCrypt.Tests/NCryptFacts.cs
@@ -218,7 +218,7 @@
     }

     [Fact]
-    public unsafe void NCryptEnumKeys_Test()
+    public unsafe void NCryptEnumKeys_pointer_Test()
     {
         using (var provider = NCryptOpenStorageProvider(KeyStorageProviders.MS_KEY_STORAGE_PROVIDER))
         {
@@ -255,6 +255,45 @@
         }
     }

+    [Fact]
+    public unsafe void NCryptEnumKeys_IntPtr_Test()
+    {
+        using (var provider = NCryptOpenStorageProvider(KeyStorageProviders.MS_KEY_STORAGE_PROVIDER))
+        {
+            const string scope = null;
+            IntPtr ipkeyName;
+            IntPtr enumState = IntPtr.Zero;
+            SECURITY_STATUS status = NCryptEnumKeys(provider, scope, out ipkeyName, ref enumState);
+            while (status == SECURITY_STATUS.ERROR_SUCCESS)
+            {
+                var keyName = (NCryptKeyName*)ipkeyName.ToPointer();
+                this.logger.WriteLine($"{keyName->Name} ({keyName->Algid})");
+
+                if (keyName->Name.StartsWith("PclCrypto_"))
+                {
+                    using (var key = NCryptOpenKey(provider, *keyName))
+                    {
+                        NCryptDeleteKey(key).ThrowOnError();
+                        key.SetHandleAsInvalid();
+                    }
+                }
+
+                NCryptFreeBuffer(keyName).ThrowOnError();
+                status = NCryptEnumKeys(provider, scope, out ipkeyName, ref enumState);
+            }
+
+            if (enumState != null)
+            {
+                NCryptFreeBuffer(enumState).ThrowOnError();
+            }
+
+            if (status != SECURITY_STATUS.NTE_NO_MORE_ITEMS)
+            {
+                status.ThrowOnError();
+            }
+        }
+    }
+
     private static int GetMinimumKeySize(SafeKeyHandle key)
     {
         var keyLengths = NCryptGetProperty<NCRYPT_SUPPORTED_LENGTHS>(key, KeyStoragePropertyIdentifiers.NCRYPT_LENGTHS_PROPERTY);


Added snippets for OffsetDemo in Demo (#1488)

* Added snippets for OffsetDemo in Demo

* Fixed snippets for Offset in Demo (CompareTo needs Assert.Less)

* Updated OffsetDemo

Changed CompareTo and Equals method

--- src/NodaTime.Demo/OffsetDemo.cs
+++ src/NodaTime.Demo/OffsetDemo.cs
@@ -61,6 +61,56 @@
             Offset offset = Snippet.For(Offset.FromTimeSpan(timespan));
             Assert.AreEqual(5400, offset.Seconds);
         }
+
+        [Test]
+        public void Add()
+        {
+            var leftHandOffset = Offset.FromHours(5);
+            var rightHandOffset = Offset.FromHours(6);
+
+            var result = Snippet.For(Offset.Add(leftHandOffset, rightHandOffset));
+
+            Assert.AreEqual(Offset.FromHours(11), result);
+        }
+
+        [Test]
+        public void Substract()
+        {
+            var leftHandOffset = Offset.FromHours(7);
+            var rightHandOffset = Offset.FromHours(5);
+
+            var result = Snippet.For(Offset.Subtract(leftHandOffset, rightHandOffset));
+
+            Assert.AreEqual(Offset.FromHours(2), result);
+        }
+
+        [Test]
+        public void CompareTo()
+        {
+            var smallerOffset = Offset.FromHours(3);
+            var largerOffset = Offset.FromHours(5);
+
+            var lessThan = Snippet.For(smallerOffset.CompareTo(largerOffset));
+            var equal = smallerOffset.CompareTo(smallerOffset);
+            var greaterThan = largerOffset.CompareTo(smallerOffset);
+
+            Assert.Less(lessThan, 0);
+            Assert.AreEqual(0, equal);
+            Assert.Greater(greaterThan, 0);
+        }
+
+        [Test]
+        public void Equals()
+        {
+            var offset1 = Offset.FromHoursAndMinutes(1, 30);
+            var inequalOffset = Offset.FromHours(2);
+
+            var isInequal = Snippet.For(offset1.Equals(inequalOffset));
+            var isEqual = offset1.Equals(offset1);
+
+            Assert.False(isInequal);
+            Assert.True(isEqual);
+        }

         [Test]
         public void Max()
@@ -71,6 +121,27 @@
             var result = Snippet.For(Offset.Max(smallerOffset, largerOffset));

             Assert.AreEqual(largerOffset, result);
+        }
+
+        [Test]
+        public void Min()
+        {
+            var smallerOffset = Offset.FromHours(3);
+            var largerOffset = Offset.FromHours(5);
+
+            var result = Snippet.For(Offset.Min(smallerOffset, largerOffset));
+
+            Assert.AreEqual(smallerOffset, result);
+        }
+
+        [Test]
+        public void Negate()
+        {
+            var offsetToNegate = Offset.FromHours(2);
+
+            var result = Snippet.For(Offset.Negate(offsetToNegate));
+
+            Assert.AreEqual(Offset.FromHours(-2), result);
         }

         [Test]
@@ -106,5 +177,6 @@

             Assert.AreEqual(expected, actual);
         }
+
     }
 }


get_class()

--- src/Peachpie.Library/Objects.cs
+++ src/Peachpie.Library/Objects.cs
@@ -32,6 +32,35 @@
         {
             var info = ctx.GetDeclaredType(ifaceName, autoload);
             return info != null && info.IsInterface;
+        }
+
+        /// <summary>
+        /// Returns the name of the class of which the object <paramref name="obj"/> is an instance.
+        /// </summary>
+        /// <param name="tctx">Current class context.</param>
+        /// <param name="obj">The object whose class is requested.</param>
+        /// <returns><paramref name="obj"/>'s class name or current class name if <paramref name="obj"/> is <B>null</B>.</returns>
+        [return: CastToFalse]
+        public static string get_class([ImportCallerClass]string tctx, PhpValue obj)
+        {
+            if (obj.IsSet)
+            {
+                if (obj.IsObject)
+                {
+                    return obj.Object.GetType().FullName.Replace('.', '\\');
+                }
+                else if (obj.IsAlias)
+                {
+                    return get_class(tctx, obj.Alias.Value);
+                }
+                else
+                {
+                    // TODO: E_WARNING
+                    throw new ArgumentException(nameof(obj));
+                }
+            }
+
+            return tctx;
         }

         /// <summary>


bin2hex, hex2bin updates

bin2hex, hex2bin updates

- parameters name as it is in php
- bin2hex() signature changed, accepts byte[] directly

--- src/Peachpie.Library/Strings.cs
+++ src/Peachpie.Library/Strings.cs
@@ -79,14 +79,13 @@
         /// <summary>
         /// Converts a string into hexadecimal representation.
         /// </summary>
-        /// <param name="ctx">Runtime context.</param>
         /// <param name="str">The string to be converted.</param>
         /// <returns>
         /// The concatenated two-characters long hexadecimal numbers each representing one character of <paramref name="str"/>.
         /// </returns>
-        public static string bin2hex(Context ctx, PhpString str)
-        {
-            if (str.IsEmpty)
+        public static string bin2hex(byte[] str)
+        {
+            if (str == null || str.Length == 0)
             {
                 return string.Empty;
             }
@@ -109,25 +108,25 @@

             //return result.ToString();

-            return StringUtils.BinToHex(str.ToBytes(ctx), null);
+            return StringUtils.BinToHex(str, null);
         }

         /// <summary>
         /// Decodes a hexadecimally encoded binary string.
         /// </summary>
-        public static PhpString hex2bin(string str)
-        {
-            if ((str.Length % 2) != 0)
+        public static PhpString hex2bin(string data)
+        {
+            if ((data.Length % 2) != 0)
             {
                 throw new ArgumentException();
             }

-            var result = new byte[str.Length / 2];
-
-            for (int i = 0, b = 0; i < str.Length; i += 2)
-            {
-                var x = StringUtils.HexToNumber(str[i]);
-                var y = StringUtils.HexToNumber(str[i + 1]);
+            var result = new byte[data.Length / 2];
+
+            for (int i = 0, b = 0; i < data.Length; i += 2)
+            {
+                var x = StringUtils.HexToNumber(data[i]);
+                var y = StringUtils.HexToNumber(data[i + 1]);

                 if ((x | y) < 0)
                 {


Remove namespace documentation now in nodatime.org

--- src/NodaTime.Serialization.JsonNet/NamespaceDoc.cs
+++ src/NodaTime.Serialization.JsonNet/NamespaceDoc.cs
@@ -1,21 +0,0 @@
-// Copyright 2012 The Noda Time Authors. All rights reserved.
-// Use of this source code is governed by the Apache License 2.0,
-// as found in the LICENSE.txt file.
-
-using System.Runtime.CompilerServices;
-
-namespace NodaTime.Serialization.JsonNet
-{
-    /// <summary>
-    /// <para>
-    /// The NodaTime.Serialization.JsonNet namespace contains support code to enable
-    /// JSON serialization for Noda Time types using <see href="http://json.net">Json.NET</see>.
-    /// </para>
-    /// <para>Code in this namespace is included in the NodaTime.Serialization.JsonNet NuGet package.</para>
-    /// </summary>
-    [CompilerGenerated]
-    internal static class NamespaceDoc
-    {
-        // No actual code here - it's just for the sake of documenting the namespace.
-    }
-}


Update DeviceClient.cs

Update DeviceClient.cs

Correct default protocol to HTTP1.
Can't be AMQP because we are at the HTTP client project and AMQP is not even implemented.

--- csharp/device/Microsoft.Azure.Devices.Client.NetMF/HttpClient_43/DeviceClient.cs
+++ csharp/device/Microsoft.Azure.Devices.Client.NetMF/HttpClient_43/DeviceClient.cs
@@ -55,7 +55,7 @@
         /// <returns>DeviceClient</returns>
         public static DeviceClient CreateFromConnectionString(string connectionString, string deviceId)
         {
-            return CreateFromConnectionString(connectionString, deviceId, TransportType.Amqp);
+            return CreateFromConnectionString(connectionString, deviceId, TransportType.Http1);
         }

         /// <summary>


implode() reports warning instead of exception

--- src/Peachpie.Library/Strings.cs
+++ src/Peachpie.Library/Strings.cs
@@ -812,10 +812,8 @@
             if ((enumerable = glue.AsObject() as IEnumerable) != null)
                 return ImplodeInternal(ctx, pieces, new PhpArray(enumerable));

-            ////
-            //PhpException.InvalidArgument("pieces");
-            //return null;
-            throw new ArgumentException();
+            PhpException.InvalidArgument("pieces");
+            return PhpString.Empty;  // ~ NULL
         }

         /// <summary>


Make Orchard.Core.Common.Utilities.LazyField<T> [Obsolete]

--- src/Orchard.Web/Core/Common/Utilities/LazyField.cs
+++ src/Orchard.Web/Core/Common/Utilities/LazyField.cs
@@ -1,6 +1,7 @@
 using System;

 namespace Orchard.Core.Common.Utilities {
+    [Obsolete("Use Orchard.ContentManagement.Utilities.LazyField instead.")]
     public class LazyField<T> {
         private T _value;
         private Func<T> _loader;


Fix for reporting of non-changetracking eager loading header

--- RawBencher/BenchController.cs
+++ RawBencher/BenchController.cs
@@ -97,7 +97,7 @@
 			BenchController.FetchKeysForIndividualFetches();

 			// Uncomment the line below if you want to profile a bencher. Specify the bencher instance and follow the guides on the screen.
-			//ProfileBenchers(RegisteredBenchers.FirstOrDefault(b => b.GetType() == typeof(HandCodedBencher)));
+			//ProfileBenchers(RegisteredBenchers.FirstOrDefault(b => b.GetType() == typeof(LINQ2DBNormalBencher)));
 			BenchController.RunRegisteredBenchers();
 			BenchController.ReportResultStatistics(autoExit);
 		}
@@ -672,7 +672,7 @@
 				var benchersToList = RegisteredBenchers.Where(b => b.SupportsEagerLoading && !b.UsesChangeTracking && !b.UsesCaching).OrderBy(b => b.EagerLoadFetchMean).ToList();
 				if(benchersToList.Count > 0)
 				{
-					Console.WriteLine("Non-change tracking fetches, eager load fetches, 3-node split graph, 1000 root elements ({0} runs), no caching", LoopAmount);
+					Console.WriteLine("\nNon-change tracking fetches, eager load fetches, 3-node split graph, 1000 root elements ({0} runs), no caching", LoopAmount);
 					Console.WriteLine("------------------------------------------------------------------------------");
 					foreach(var bencher in benchersToList)
 					{


refactor: WhiteSpaceItem treatment

refactor: WhiteSpaceItem treatment

--- src/Reni/TokenClasses/Whitespace/LinesAndSpaces.cs
+++ src/Reni/TokenClasses/Whitespace/LinesAndSpaces.cs
@@ -50,7 +50,8 @@
         get
         {
             var maximalLineBreakCount = T(Configuration.EmptyLineLimit ?? Lines.Length, Lines.Length).Min();
-            return T(Configuration.MinimalLineBreakCount, maximalLineBreakCount).Max();
+            var minimalLineBreakCount = IsLast? Configuration.MinimalLineBreakCount : 0;
+            return T(minimalLineBreakCount, maximalLineBreakCount).Max();
         }
     }


Refactored NativeMethods to reduce use of repetitive code pattern for returning the appropriate value if the native API is not installed.

--- src/SqlLocalDb/NativeMethods.cs
+++ src/SqlLocalDb/NativeMethods.cs
@@ -154,14 +154,10 @@
         /// <returns>The HRESULT returned by the LocalDB API.</returns>
         internal static int CreateInstance(string wszVersion, string pInstanceName, int dwFlags)
         {
-            var function = EnsureFunction("LocalDBCreateInstance", ref _localDBCreateInstance);
-
-            if (function == null)
-            {
-                return SqlLocalDbErrors.NotInstalled;
-            }
-
-            return function(wszVersion, pInstanceName, dwFlags);
+            return EnsureFunctionAndInvoke(
+                "LocalDBCreateInstance",
+                ref _localDBCreateInstance,
+                (function) => function(wszVersion, pInstanceName, dwFlags));
         }

         /// <summary>
@@ -172,14 +168,10 @@
         /// <returns>The HRESULT returned by the LocalDB API.</returns>
         internal static int DeleteInstance(string pInstanceName, int dwFlags)
         {
-            var function = EnsureFunction("LocalDBDeleteInstance", ref _localDBDeleteInstance);
-
-            if (function == null)
-            {
-                return SqlLocalDbErrors.NotInstalled;
-            }
-
-            return function(pInstanceName, dwFlags);
+            return EnsureFunctionAndInvoke(
+                "LocalDBDeleteInstance",
+                ref _localDBDeleteInstance,
+                (function) => function(pInstanceName, dwFlags));
         }

         /// <summary>
@@ -203,14 +195,10 @@
         /// <returns>The HRESULT returned by the LocalDB API.</returns>
         internal static int GetInstanceInfo(string wszInstanceName, IntPtr pInstanceInfo, int dwInstanceInfoSize)
         {
-            var function = EnsureFunction("LocalDBGetInstanceInfo", ref _localDBGetInstanceInfo);
-
-            if (function == null)
-            {
-                return SqlLocalDbErrors.NotInstalled;
-            }
-
-            return function(wszInstanceName, pInstanceInfo, dwInstanceInfoSize);
+            return EnsureFunctionAndInvoke(
+                "LocalDBGetInstanceInfo",
+                ref _localDBGetInstanceInfo,
+                (function) => function(wszInstanceName, pInstanceInfo, dwInstanceInfoSize));
         }

         /// <summary>
@@ -274,14 +262,10 @@
         /// <returns>The HRESULT returned by the LocalDB API.</returns>
         internal static int GetVersionInfo(string wszVersionName, IntPtr pVersionInfo, int dwVersionInfoSize)
         {
-            var function = EnsureFunction("LocalDBGetVersionInfo", ref _localDBGetVersionInfo);
-
-            if (function == null)
-            {
-                return SqlLocalDbErrors.NotInstalled;
-            }
-
-            return function(wszVersionName, pVersionInfo, dwVersionInfoSize);
+            return EnsureFunctionAndInvoke(
+                "LocalDBGetVersionInfo",
+                ref _localDBGetVersionInfo,
+                (function) => function(wszVersionName, pVersionInfo, dwVersionInfoSize));
         }

         /// <summary>
@@ -316,14 +300,10 @@
         /// <returns>The HRESULT returned by the LocalDB API.</returns>
         internal static int ShareInstance(IntPtr pOwnerSID, string pInstancePrivateName, string pInstanceSharedName, int dwFlags)
         {
-            var function = EnsureFunction("LocalDBShareInstance", ref _localDBShareInstance);
-
-            if (function == null)
-            {
-                return SqlLocalDbErrors.NotInstalled;
-            }
-
-            return function(pOwnerSID, pInstancePrivateName, pInstanceSharedName, dwFlags);
+            return EnsureFunctionAndInvoke(
+                "LocalDBShareInstance",
+                ref _localDBShareInstance,
+                (function) => function(pOwnerSID, pInstancePrivateName, pInstanceSharedName, dwFlags));
         }

         /// <summary>
@@ -357,14 +337,10 @@
         /// <returns>The HRESULT returned by the LocalDB API.</returns>
         internal static int StartTracing()
         {
-            var function = EnsureFunction("LocalDBStartTracing", ref _localDBStartTracing);
-
-            if (function == null)
-            {
-                return SqlLocalDbErrors.NotInstalled;
-            }
-
-            return function();
+            return EnsureFunctionAndInvoke(
+                "LocalDBStartTracing",
+                ref _localDBStartTracing,
+                (function) => function());
         }

         /// <summary>
@@ -379,14 +355,10 @@
         /// <returns>The HRESULT returned by the LocalDB API.</returns>
         internal static int StopInstance(string pInstanceName, StopInstanceOptions options, int ulTimeout)
         {
-            var function = EnsureFunction("LocalDBStopInstance", ref _localDBStopInstance);
-
-            if (function == null)
-            {
-                return SqlLocalDbErrors.NotInstalled;
-            }
-
-            return function(pInstanceName, (int)options, ulTimeout);
+            return EnsureFunctionAndInvoke(
+                "LocalDBStopInstance",
+                ref _localDBStopInstance,
+                (function) => function(pInstanceName, (int)options, ulTimeout));
         }

         /// <summary>
@@ -396,14 +368,10 @@
         /// <returns>The HRESULT returned by the LocalDB API.</returns>
         internal static int StopTracing()
         {
-            var function = EnsureFunction("LocalDBStopTracing", ref _localDBStopTracing);
-
-            if (function == null)
-            {
-                return SqlLocalDbErrors.NotInstalled;
-            }
-
-            return function();
+            return EnsureFunctionAndInvoke(
+                "LocalDBStopTracing",
+                ref _localDBStopTracing,
+                (function) => function());
         }

         /// <summary>
@@ -418,14 +386,10 @@
         /// <returns>The HRESULT returned by the LocalDB API.</returns>
         internal static int UnshareInstance(string pInstanceName, int dwFlags)
         {
-            var function = EnsureFunction("LocalDBUnshareInstance", ref _localDBUnshareInstance);
-
-            if (function == null)
-            {
-                return SqlLocalDbErrors.NotInstalled;
-            }
-
-            return function(pInstanceName, dwFlags);
+            return EnsureFunctionAndInvoke(
+                "LocalDBUnshareInstance",
+                ref _localDBUnshareInstance,
+                (function) => function(pInstanceName, dwFlags));
         }

         /// <summary>
@@ -489,6 +453,8 @@
         private static T EnsureFunction<T>(string functionName, ref T function)
             where T : class
         {
+            Debug.Assert(functionName != null, "functionName cannot be null.");
+
             if (function == null)
             {
                 lock (_syncRoot)
@@ -501,6 +467,27 @@
             }

             return function;
+        }
+
+        /// <summary>
+        /// Ensures that the specified delegate to an unmanaged function is initialized and invokes the specified callback delegate if it does.
+        /// </summary>
+        /// <typeparam name="T">The type of the delegate representing the unmanaged function.</typeparam>
+        /// <param name="functionName">The name of the unmanaged function to ensure is loaded.</param>
+        /// <param name="function">A reference to a location to ensure contains a delegate for the specified function name.</param>
+        /// <param name="callback">A delegate to a callback method to invoke with the function if initialized.</param>
+        /// <returns>
+        /// The <see cref="Int32"/> result of invoking <paramref name="callback"/>, if the function was
+        /// initialized; otherwise the value of <see cref="SqlLocalDbErrors.NotInstalled"/> is returned.
+        /// </returns>
+        private static int EnsureFunctionAndInvoke<T>(string functionName, ref T function, Func<T, int> callback)
+            where T : class
+        {
+            Debug.Assert(callback != null, "callback cannot be null.");
+
+            function = EnsureFunction<T>(functionName, ref function);
+
+            return function == null ? SqlLocalDbErrors.NotInstalled : callback(function);
         }

         /// <summary>
@@ -557,6 +544,8 @@
         private static T GetDelegate<T>(string functionName)
             where T : class
         {
+            Debug.Assert(functionName != null, "functionName cannot be null.");
+
             SafeLibraryHandle handle = EnsureLocalDBLoaded();

             if (handle == null)


docs: headerdocs Strict text

docs: headerdocs Strict text

--- src/Yaapii.Atoms/Text/Strict.cs
+++ src/Yaapii.Atoms/Text/Strict.cs
@@ -1,15 +1,20 @@
 using System;
 using System.Collections.Generic;
-using System.Text;
 using Yaapii.Atoms.Enumerable;
+using Yaapii.Atoms.Scalar;

 namespace Yaapii.Atoms.Text
 {
+    /// <summary>
+    /// A strict text which can only be one of the specified valid texts.
+    /// </summary>
     public sealed class Strict : TextEnvelope
     {
         /// <summary>
         /// A strict text which can only be one of the specified valid texts, ignoring case.
         /// </summary>
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="valid">The valid texts</param>
         public Strict(string candidate, params string[] valid) : this(
             candidate,
             new LiveMany<string>(valid)
@@ -19,6 +24,8 @@
         /// <summary>
         /// A strict text which can only be one of the specified valid texts, ignoring case.
         /// </summary>
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="valid">The valid texts</param>
         public Strict(string candidate, IEnumerable<string> valid) : this(
             candidate,
             true,
@@ -29,6 +36,9 @@
         /// <summary>
         /// A strict text which can only be one of the specified valid texts.
         /// </summary>
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="ignoreCase">Ignore case in the canidate and valid texts</param>
+        /// <param name="valid">The valid texts</param>
         public Strict(string candidate, bool ignoreCase, params string[] valid) : this(
             candidate, ignoreCase, new LiveMany<string>(valid)
         )
@@ -37,6 +47,9 @@
         /// <summary>
         /// A strict text which can only be one of the specified valid texts.
         /// </summary>
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="ignoreCase">Ignore case in the canidate and valid texts</param>
+        /// <param name="valid">The valid texts</param>
         public Strict(string candidate, bool ignoreCase, IEnumerable<string> valid) : this(
             new LiveText(candidate), ignoreCase, new Mapped<string, IText>((str) => new LiveText(str), valid)
         )
@@ -45,6 +58,8 @@
         /// <summary>
         /// A strict text which can only be one of the specified valid texts, ignoring case.
         /// </summary>
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="valid">The valid texts</param>
         public Strict(IText candidate, params string[] valid) : this(
             candidate, true, valid
         )
@@ -53,6 +68,9 @@
         /// <summary>
         /// A strict text which can only be one of the specified valid texts.
         /// </summary>
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="ignoreCase">Ignore case in the canidate and valid texts</param>
+        /// <param name="valid">The valid texts</param>
         public Strict(IText candidate, bool ignoreCase, params string[] valid) : this(
             candidate,
             ignoreCase,
@@ -61,14 +79,19 @@
         { }

         /// <summary>
-        /// A strict text which can only be one of the specified valid texts.
+        /// A strict text which can only be one of the specified valid texts, ignoring case.
         /// </summary>
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="valid">The valid texts</param>
         public Strict(IText candidate, params IText[] valid) : this(candidate, true, valid)
         { }

         /// <summary>
         /// A strict text which can only be one of the specified valid texts.
         /// </summary>
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="ignoreCase">Ignore case in the canidate and valid texts</param>
+        /// <param name="valid">The valid texts</param>
         public Strict(IText candidate, bool ignoreCase, params IText[] valid) : this(
             candidate,
             ignoreCase,
@@ -77,8 +100,10 @@
         { }

         /// <summary>
-        /// A strict text which can only be one of the specified valid texts.
+        /// A strict text which can only be one of the specified valid texts, ignoring case.
         /// </summary>
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="valid">The valid texts</param>
         public Strict(IText candidate, IEnumerable<IText> valid) : this(
             candidate,
             true,
@@ -89,27 +114,36 @@
         /// <summary>
         /// A strict text which can only be one of the specified valid texts.
         /// </summary>
-        public Strict(IText candidate, bool ignoreCase, IEnumerable<IText> allowed) : this(
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="ignoreCase">Ignore case in the canidate and valid texts</param>
+        /// <param name="valid">The valid texts</param>
+        public Strict(IText candidate, bool ignoreCase, IEnumerable<IText> valid) : this(
             candidate,
-            allowed,
-            () => ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal)
+            valid,
+            new ScalarOf<StringComparison>(() => ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal))
         { }

-        private Strict(IText candidate, IEnumerable<IText> allowed, Func<StringComparison> ignoreCase) : base(() =>
+        /// <summary>
+        /// A strict text which can only be one of the specified valid texts.
+        /// </summary>
+        /// <param name="candidate">The canidate to check for valid texts</param>
+        /// <param name="valid">The valid texts</param>
+        /// <param name="stringComparer">Ignore case in the canidate and valid texts</param>
+        private Strict(IText candidate, IEnumerable<IText> valid, IScalar<StringComparison> stringComparer) : base(() =>
         {
-            var valid = false;
+            var result = false;
             var str = candidate.AsString();
-            foreach (var txt in allowed)
+            foreach (var txt in valid)
             {
-                if (txt.AsString().Equals(str, ignoreCase()))
+                if (txt.AsString().Equals(str, stringComparer.Value()))
                 {
-                    valid = true;
+                    result = true;
                     break;
                 }
             }
-            if (!valid)
+            if (!result)
             {
-                throw new ArgumentException($"'{str}' is not valid here - expected: {new Joined(", ", allowed).AsString()}");
+                throw new ArgumentException($"'{str}' is not valid here - expected: {new Joined(", ", valid).AsString()}");
             }
             return str;
         }, false)


Making the PutFileToS3Storage public.

Making the PutFileToS3Storage public.

--- eFormCore/Core.cs
+++ eFormCore/Core.cs
@@ -5779,7 +5779,7 @@
             }
         }

-        private async Task PutFileToS3Storage(Stream stream, string fileName)
+        public async Task PutFileToS3Storage(Stream stream, string fileName)
         {
             string methodName = "Core.PutFileToS3Storage";
             string bucketName = await _sqlController.SettingRead(Settings.s3BucketName);


Excluding test from LightExpression build as 'AndAlso' is missing

--- test/FastExpressionCompiler.IssueTests/Issue_NumericComparisonsWithConversions.cs
+++ test/FastExpressionCompiler.IssueTests/Issue_NumericComparisonsWithConversions.cs
@@ -1,4 +1,5 @@
-using System;
+#if !LIGHT_EXPRESSION
+using System;
 using NUnit.Framework;
 using static System.Linq.Expressions.Expression;
 namespace FastExpressionCompiler.UnitTests
@@ -53,4 +54,5 @@
             public T Value { get; set; }
         }
     }
+#endif
 }


updated ShareShareUI to support message as well as text for WP8 linking

--- SharedSource/Helper.cs
+++ SharedSource/Helper.cs
@@ -163,12 +163,23 @@
         /// <param name="linkURL"></param>
         public void ShowShareUI(string text, string linkURL)
         {
+            ShowShareUI(text, text, linkURL);
+        }
+
+        /// <summary>
+        /// Show the Share UI with a link - WP8 only
+        /// </summary>
+        /// <param name="text"></param>
+        /// <param name="message"></param>
+        /// <param name="linkURL"></param>
+        public void ShowShareUI(string text, string message, string linkURL)
+        {
 #if NETFX_CORE
             throw new NotImplementedException("Not implemented for Windows Store Apps, use ShowShareUI() instead.");
 #elif WINDOWS_PHONE
             var task = new ShareLinkTask();
             task.Title = text;
-            task.Message = text;
+            task.Message = message;
             task.LinkUri = new Uri(linkURL);
             task.Show();
 #endif


fix errors caused by merge conflict resolution

--- AllReadyApp/Web-App/AllReady/Features/Notifications/NotifyAdminForUserUnenrolls.cs
+++ AllReadyApp/Web-App/AllReady/Features/Notifications/NotifyAdminForUserUnenrolls.cs
@@ -27,7 +27,7 @@
             // don't let problem with notification keep us from continuing
             try
             {
-            var model = _mediator.Send(new ActivityDetailForNotificationQuery {ActivityId = notification.ActivityId});
+                var notificationModel = _mediator.Send(new ActivityDetailForNotificationQuery { ActivityId = notification.ActivityId, UserId = notification.UserId });

                 var campaignContact = notificationModel.CampaignContacts.SingleOrDefault(tc => tc.ContactType == (int)ContactTypes.Primary);
                 var adminEmail = campaignContact?.Contact.Email;


Set the recttransform on Awake instead of Onvalidate, as suggested in a pr comment.  Also this fixes a bug which broke near interaction on device.

--- Assets/MixedRealityToolkit.Services/InputSystem/NearInteractionTouchableUnityUI.cs
+++ Assets/MixedRealityToolkit.Services/InputSystem/NearInteractionTouchableUnityUI.cs
@@ -33,10 +33,8 @@

         private static readonly List<NearInteractionTouchableUnityUI> instances = new List<NearInteractionTouchableUnityUI>();

-        protected override void OnValidate()
+        private void Awake()
         {
-            base.OnValidate();
-
             rectTransform = GetComponent<RectTransform>();
         }


refactor seed method

refactor seed method

--- BrockAllen.MembershipReboot/Repository/EF/EFMembershipRebootDatabaseInitializer.cs
+++ BrockAllen.MembershipReboot/Repository/EF/EFMembershipRebootDatabaseInitializer.cs
@@ -10,13 +10,19 @@
 {
     class EFMembershipRebootDatabaseInitializer : CreateDatabaseIfNotExists<EFMembershipRebootDatabase>
     {
-        protected override void Seed(EFMembershipRebootDatabase context)
+        public static void SeedContext(EFMembershipRebootDatabase context)
         {
+#if DEBUG
             var adminAccount = UserAccount.Create("default", "admin", "admin123", "brockallen@gmail.com");
             adminAccount.VerifyAccount(adminAccount.VerificationKey);
             adminAccount.AddClaim(ClaimTypes.Role, "Administrator");
             context.Users.Add(adminAccount);
+#endif
+        }

+        protected override void Seed(EFMembershipRebootDatabase context)
+        {
+            SeedContext(context);
             base.Seed(context);
         }
     }


Improve CustomPropertyMapping Validation and check if properties are empty to avoid Nullreference Exceptions.

--- CalDavSynchronizer/Ui/Options/ViewModels/Mapping/CustomPropertyMappingViewModel.cs
+++ CalDavSynchronizer/Ui/Options/ViewModels/Mapping/CustomPropertyMappingViewModel.cs
@@ -76,7 +76,12 @@

     public bool Validate(StringBuilder errorMessageBuilder)
     {
-      if (Mappings.Any(m => !m.DavProperty.StartsWith("X-")))
+      if (Mappings.Any(m => string.IsNullOrEmpty(m.OutlookProperty) || string.IsNullOrEmpty(m.DavProperty)))
+      {
+        errorMessageBuilder.AppendLine("- Custom properties must not be empty.");
+        return false;
+      }
+      if (Mappings.Any(m => !m.DavProperty.StartsWith ("X-")))
       {
         errorMessageBuilder.AppendLine("- DAV X-Attributes for manual mapped properties have to start with 'X-'");
         return false;


feat: add validate fail test

feat: add validate fail test

--- CopyDllsAfterBuildLocalTool/CopyDllsAfterBuildLocalToolUnitTest/E2E_CommandTest.cs
+++ CopyDllsAfterBuildLocalTool/CopyDllsAfterBuildLocalToolUnitTest/E2E_CommandTest.cs
@@ -8,7 +8,7 @@

 namespace CopyDllsAfterBuildLocalToolUnitTest
 {
-    public class E2E_CommandTest
+    public class E2E_CommandTest : IDisposable
     {
         private readonly string _basePath;
         private readonly string _projectDir;
@@ -56,8 +56,22 @@
         public void ValidateCommandTest()
         {
             var program = new Program();
+            // default settings must be valid
             program.Init(_projectDir);
             Assert.Equal(0, program.Validate(_projectDir));
+
+            // invalid settings should fail
+            var invalidJson = $@"
+{{
+  ""pattern"": ""../Dlls"",
+  ""excludes"": [
+    ""UnityEngine"",
+    ""UnityEditor""
+  ],
+  ""exclude_folders"": []
+}}";
+            File.WriteAllText(_settings, invalidJson, Encoding.UTF8);
+            Assert.Equal(1, program.Validate(_projectDir));
         }

         [Fact]
@@ -109,7 +123,6 @@
             // 1st run. copy to empty destination
             program.Run(_projectDir, _targetDir);
             var actual = getActual(destinationPath);
-            var i = 0;
             foreach (var item in actual.Keys)
             {
                 // File successfully copy


test reliability improvements

test reliability improvements

--- Core/OfficeDevPnP.Core.Tests/Framework/Functional/Validators/TermGroupValidator.cs
+++ Core/OfficeDevPnP.Core.Tests/Framework/Functional/Validators/TermGroupValidator.cs
@@ -135,6 +135,10 @@
                                 if (sourceTerm.Attribute("CustomSortOrder") == null)
                                 {
                                     DropAttribute(targetTerm, "CustomSortOrder");
+                                }
+                                if (sourceTerm.Attribute("Owner") == null)
+                                {
+                                    DropAttribute(targetTerm, "Owner");
                                 }
                                 if (sourceTerm.Attribute("SourceTermId") == null)
                                 {


Changed the category of the SIngleLinePropAccessor fix. Fixed a bug that occured when the accessor had no body.

--- Source/FormattingFixes/SingleGetStatementFix/PropertyAccessorSingleLineAnalyzer.cs
+++ Source/FormattingFixes/SingleGetStatementFix/PropertyAccessorSingleLineAnalyzer.cs
@@ -21,7 +21,7 @@
         private const string MessageFormat = "{0} accessor of {1} can be placed on one line";
         private const string Category = "Naming";

-        private static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Description, MessageFormat, Category, DiagnosticSeverity.Warning);
+        private static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Description, MessageFormat, Category, DiagnosticSeverity.Info);

         public ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
         {
@@ -41,6 +41,11 @@
             if (node is AccessorDeclarationSyntax)
             {
                 var accessorDeclr = node as AccessorDeclarationSyntax;
+
+                if (accessorDeclr.Body == null)
+                {
+                    return;
+                }

                 var block = accessorDeclr.Body;


updated a receive event statement unit test

--- Test/TestingServices.Tests.Unit/Feature2Stmts/DynamicError/ReceiveEventFailTest.cs
+++ Test/TestingServices.Tests.Unit/Feature2Stmts/DynamicError/ReceiveEventFailTest.cs
@@ -125,7 +125,9 @@

             var engine = TestingEngine.Create(configuration, TestProgram.Execute).Run();
             Assert.AreEqual(1, engine.NumOfFoundBugs);
-            var bugReport = "Machine Client(1) is waiting for an event that will not be received.";
+            var bugReport = "Livelock detected. Machine 'Microsoft.PSharp.TestingServices." +
+                "Tests.Unit.ReceiveEventFailTest+Client(0)' is waiting for an event, but " +
+                "no other machine is enabled.";
             Assert.AreEqual(bugReport, engine.BugReport);
         }
     }


More self-contained test setup for OracleErrorLog.Name, using a test provider instead of relying on system behavior

--- tests/OracleErrorLogTests.cs
+++ tests/OracleErrorLogTests.cs
@@ -31,9 +31,13 @@
         [Fact]
         public void NameReflectsDbProviderName()
         {
-            var dbProvider = DbProviderFactories.GetFactory("System.Data.OracleClient");
+            var dbProvider = new TestDbProviderFactory();
             var log = new OracleErrorLog("...", dbProvider);
-            Assert.Equal("Oracle Error Log (System.Data.OracleClient)", log.Name);
+            Assert.Equal("Oracle Error Log (Elmah.Tests)", log.Name);
+        }
+
+        sealed class TestDbProviderFactory : DbProviderFactory
+        {
         }
     }
 }


1160.1

--- a_mini/projects/PixelFarm/MiniAgg/04_Scanline/5_ScanlineRasToDestBitmapRenderer.cs
+++ a_mini/projects/PixelFarm/MiniAgg/04_Scanline/5_ScanlineRasToDestBitmapRenderer.cs
@@ -246,24 +246,16 @@
                     break;
                 case Agg.ScanlineRenderMode.SubPixelRendering:
                     {
+#if DEBUG
                         int dbugMinScanlineCount = 0;
+#endif
+
                         while (sclineRas.SweepScanline(scline))
                         {
-                            //render solid single scanline
-                            //if (dbugMinScanlineCount == 8)
-                            //{
-
-                            //}
                             SubPixRender(dest, scline, color);
-                            //if (dbugMinScanlineCount == 8)
-                            //{
-                            //    break;
-                            //}
+#if DEBUG
                             dbugMinScanlineCount++;
-                            //if (dbugMinScanlineCount > 2)
-                            //{
-                            //    break;
-                            //}
+#endif
                         }
                     }
                     break;


another attempt at fixing

another attempt at fixing

--- TeenageAshe/Program.cs
+++ TeenageAshe/Program.cs
@@ -17,7 +17,7 @@
         private static readonly Spell[] SpellArray = new Spell[4];

         private static Obj_AI_Hero player;
-        private static Orbwalking.Orbwalker orbwalker;
+        //private static Orbwalking.Orbwalker orbwalker;
         private static Spell q, w, e, r;
         private static Menu config;


Hm, fixed a potential bug in quantization

--- UIconEdit/IconFrame.cs
+++ UIconEdit/IconFrame.cs
@@ -470,8 +470,8 @@
                 for (int x = 0; x < _width; x++)
                 {
                     uint value = pFull[x] >> 24;
-                    if (isPng && value < _alphaThreshold)
-                        pFull[x] &= ~opaqueAlpha;
+                    if (value < _alphaThreshold)
+                        pFull[x] = isPng ? (pFull[x] & ~opaqueAlpha) : opaqueAlpha;
                     else
                         pFull[x] |= opaqueAlpha;
                 }


Resized mobFlags array. According to the POLUtils source, there can only be up to 4096 mobs in a zone.

--- Uematsu/ProcessChar.cs
+++ Uematsu/ProcessChar.cs
@@ -14,7 +14,7 @@
         [DllImport("kernel32.dll", SetLastError = true)]
         public static extern Int32 ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, ref IntPtr lpNumberOfBytesRead);
         ProcessModule ffximain;
-        byte[] mobFlags = new byte[65536];
+        byte[] mobFlags = new byte[4096*4];

         UInt16 currentTrack = 65535;

@@ -62,7 +62,7 @@
                 IntPtr mobPtrArraySize = new IntPtr();
                 ReadProcessMemory(pol.Handle, new IntPtr(ffximain.BaseAddress.ToInt32() + 0x8020c), mobPtrTmp, 4, ref mobPtrArraySize);
                 IntPtr mobPtr = new IntPtr(BitConverter.ToInt32(mobPtrTmp, 0));
-                ReadProcessMemory(pol.Handle, mobPtr, mobFlags, 65536, ref mobPtrArraySize);
+                ReadProcessMemory(pol.Handle, mobPtr, mobFlags, 4096*4, ref mobPtrArraySize);

                 m_Zone = _FFACE.Player.Zone;
                 execScripts = true;
@@ -168,7 +168,7 @@
             IntPtr mobPtrArraySize = new IntPtr();
             ReadProcessMemory(pol.Handle, new IntPtr(ffximain.BaseAddress.ToInt32() + 0x8020c), mobPtrTmp, 4, ref mobPtrArraySize);
             IntPtr mobPtr = new IntPtr(BitConverter.ToInt32(mobPtrTmp, 0));
-            ReadProcessMemory(pol.Handle, mobPtr, mobFlags, 65536, ref mobPtrArraySize);
+            ReadProcessMemory(pol.Handle, mobPtr, mobFlags, 4096*4, ref mobPtrArraySize);

             m_Zone = _FFACE.Player.Zone;
             uVanaHour = _FFACE.Timer.GetVanaTime().Hour;


performance

performance

--- Utility/Performance.cs
+++ Utility/Performance.cs
@@ -732,7 +732,7 @@

                                         for (var ii = 0; ii < skylineAttributeColumns.Length; ii++)
                                         {
-                                            dt.Columns.RemoveAt(0);
+                                            dtEntire.Columns.RemoveAt(0);
                                         }

                                         Dictionary<long, object[]> full =


destroy実装中

destroy実装中

--- VagrantWin/MainForm.cs
+++ VagrantWin/MainForm.cs
@@ -24,6 +24,7 @@
         }
         async private void ComSpecLines(string command)
         {
+            if (string.IsNullOrWhiteSpace(vagrantfileTextBox.Text)) return;
             commandGroupBox.Enabled = false;
             //Processオブジェクトを作成
             var p = new Process
@@ -34,34 +35,59 @@
                     WorkingDirectory = Path.GetDirectoryName(vagrantfileTextBox.Text),
                     UseShellExecute = false,
                     RedirectStandardOutput = true,
-                    RedirectStandardInput = false,
+                    RedirectStandardInput = true,
                     CreateNoWindow = true,
                     //コマンドラインを指定（"/c"は実行後閉じるために必要）
-                    Arguments = @"/c vagrant " + command,
+                    Arguments = (command != "destroy") ? @"/c vagrant " + command : "/v:on /e:off /k vagrant " + command,
+                    //Arguments = (command != "destroy") ? @"/c vagrant " + command : "",
                 }
             };
             //文字列を非同期で一行ずつ取得
-            p.OutputDataReceived += (s, e) => Task.Run(() =>
+            if (command != "destroy")
             {
-                var line = e.Data;
-                if (line == null) return;
-                Invoke(new Action(() =>
+                p.OutputDataReceived += (s, e) => Task.Run(() =>
                 {
-                    consoleTextBox.HideSelection = false;
-                    consoleTextBox.AppendText(line + Environment.NewLine);
-                    var vagrantData = VagrantData.GetVagrantDataParseLine(line);
-                    if (vagrantData != null)
+                    var line = e.Data;
+                    if (line == null) return;
+                    Invoke(new Action(() =>
                     {
-                        UpdaetVagrantData(vagrantData);
-                        commandGroupBox.Enabled = true;
-                    }
-                }));
-            });
+                        consoleTextBox.HideSelection = false;
+                        consoleTextBox.AppendText(line + Environment.NewLine);
+                        var vagrantData = VagrantData.GetVagrantDataParseLine(line);
+                        if (vagrantData != null)
+                        {
+                            UpdaetVagrantData(vagrantData);
+                            commandGroupBox.Enabled = true;
+                        }
+
+                    }));
+                });
+            }
             //実行
             await Task.Run(() =>
             {
                 p.Start();
-                p.BeginOutputReadLine();
+                if (command == "destroy")
+                {
+                    using (var sw = p.StandardInput)
+                    {
+                        if (sw.BaseStream.CanWrite)
+                        {
+                            //sw.WriteLine("N");
+                        }
+                        p.StandardInput.Close();
+                    }
+                    var all = p.StandardOutput.ReadToEnd();
+                    Invoke(new Action(() =>
+                    {
+                        consoleTextBox.HideSelection = false;
+                        consoleTextBox.AppendText(all + Environment.NewLine);
+                    }));
+                }
+                else
+                {
+                    p.BeginOutputReadLine();
+                }
                 p.WaitForExit();
                 p.Close();
             });


kill a C.WL

svn path=/trunk/gtk-sharp/; revision=33124

--- glib/Marshaller.cs
+++ glib/Marshaller.cs
@@ -170,7 +170,6 @@

 		public static DateTime time_tToDateTime (IntPtr time_t)
 		{
-			Console.WriteLine ("in time_tToDateTime from");
 			return local_epoch.AddSeconds ((int)time_t + utc_offset);
 		}


Update CertBuilder.cs (#809)

Update CertBuilder.cs (#809)

--- util/Setup/CertBuilder.cs
+++ util/Setup/CertBuilder.cs
@@ -36,7 +36,7 @@
                                   "appropriate directory before running 'start' (see docs for info).";
                     Helpers.ShowBanner(_context, "NOTE", message);
                 }
-                else if (Helpers.ReadQuestion("Do you want to generate a self-signed SSL certificate?"))
+                else if (Helpers.ReadQuestion("Do you want to generate a self-signed SSL certificate (encouraged)?"))
                 {
                     Directory.CreateDirectory($"/bitwarden/ssl/self/{_context.Install.Domain}/");
                     Helpers.WriteLine(_context, "Generating self signed SSL certificate.");