- Some refactoring in WorkContextImpl

- Some refactoring in WorkContextImpl

--HG--
branch : dev

--- src/Orchard/Environment/DefaultWorkContextAccessor.cs
+++ src/Orchard/Environment/DefaultWorkContextAccessor.cs
@@ -81,10 +81,9 @@
             return _lifetimeScope.BeginLifetimeScope("work", configurationAction);
         }

-
         class WorkContextImplementation : WorkContext {
             readonly IComponentContext _componentContext;
-            readonly ConcurrentDictionary<string, object> _state = new ConcurrentDictionary<string, object>();
+            readonly ConcurrentDictionary<string, Func<object>> _stateResolvers = new ConcurrentDictionary<string, Func<object>>();
             readonly IEnumerable<IWorkContextStateProvider> _workContextStateProviders;

             public WorkContextImplementation(IComponentContext componentContext) {
@@ -97,18 +96,26 @@
             }

             public override T GetState<T>(string name) {
-                return (T)_state.GetOrAdd(name, s => GetStateInternal<T>(s) == null ? default(T) : GetStateInternal<T>(s).Invoke());
+                var resolver = _stateResolvers.GetOrAdd(name, FindResolverForState<T>);
+                return (T)resolver();
             }

-            private Func<T> GetStateInternal<T>(string name) {
-                return _workContextStateProviders.Select(wcsp => wcsp.Get<T>(name))
+            Func<object> FindResolverForState<T>(string name) {
+                var resolver = _workContextStateProviders.Select(wcsp => wcsp.Get<T>(name))
                     .FirstOrDefault(value => !Equals(value, default(T)));
+
+                if (resolver == null) {
+                    return () => default(T);
+                }
+                return () => resolver();
             }

+
             public override void SetState<T>(string name, T value) {
-                _state[name] = value;
+                _stateResolvers[name] = () => value;
             }
         }
+

         class HttpContextScopeImplementation : IWorkContextScope {
             readonly WorkContext _workContext;


Fix test

Fix test

--- src/Picturepark.SDK.V1.Tests/Clients/ListItemTests.cs
+++ src/Picturepark.SDK.V1.Tests/Clients/ListItemTests.cs
@@ -164,7 +164,8 @@
         public async Task ShouldCreateComplexObjectWithHelper()
         {
             /// Arrange
-            await SchemaHelper.CreateSchemasIfNotExistentAsync<Person>(_client);
+            await SchemaHelper.CreateSchemasIfNotExistentAsync<SoccerPlayer>(_client);
+            await SchemaHelper.CreateSchemasIfNotExistentAsync<SoccerTrainer>(_client);

             // Reusable as reference
             var dog = new Dog


Ensure a valid file is selected if the desired file is missing. Useful when deleting the last file in the list

--- src/Radish.Support/Controllers/MediaListController.cs
+++ src/Radish.Support/Controllers/MediaListController.cs
@@ -90,6 +90,11 @@
                 return true;
             }

+            // Do the best we can, ensure a valid file is selected
+            if (CurrentIndex >= Count)
+            {
+                SetIndex(Count - 1);
+            }
             return false;
         }


1) Fixed bug where defines were not being generated correctly

--- scallion/Program.cs
+++ scallion/Program.cs
@@ -53,15 +53,21 @@
 		public string CreateDefinesString()
 		{
 			StringBuilder builder = new StringBuilder();
-			FieldInfo[] fields = this.GetType()
-				.GetFields(BindingFlags.Public | BindingFlags.Instance);
-			foreach (FieldInfo field in fields)
+			var fields = this.GetType()
+				.GetFields(BindingFlags.Public | BindingFlags.Instance)
+				.Cast<object>()
+				.Concat(this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Cast<object>());
+			foreach (var field in fields)
 			{
-				object value = field.GetValue(this);
-				if (value.GetType() == typeof(uint))
-					builder.AppendLine(string.Format("#define {0} {1}", field.Name, value));
-				if (value.GetType() == typeof(KernelType))
-					builder.AppendLine(string.Format("#define KT_{0}", value));
+				KeyValuePair<string, object> value = new KeyValuePair<string, object>();
+				if (field as FieldInfo != null)
+					value = new KeyValuePair<string, object>(((FieldInfo)field).Name, ((FieldInfo)field).GetValue(this));
+				else if (field as PropertyInfo != null)
+					value = new KeyValuePair<string, object>(((PropertyInfo)field).Name, ((PropertyInfo)field).GetValue(this, null));
+				if (value.Value.GetType() == typeof(uint))
+					builder.AppendLine(string.Format("#define {0} {1}", value.Key, value.Value));
+				if (value.Value.GetType() == typeof(KernelType))
+					builder.AppendLine(string.Format("#define KT_{0}", value.Key));
 			}
 			return builder.ToString();
 		}


Fix control catalog crash

Fix control catalog crash

--- samples/ControlCatalog/Pages/PointersPage.xaml.cs
+++ samples/ControlCatalog/Pages/PointersPage.xaml.cs
@@ -59,7 +59,7 @@
             e.Pointer.Capture(null);
             e.Handled = true;
         }
-        else
+        else if (e.Pointer.Captured is not null)
         {
             throw new InvalidOperationException("How?");
         }


remove userId parameter from GetCampaignsByUserId from functional test

--- test/Services/FunctionalTests/Services/Marketing/CampaignScenariosBase.cs
+++ test/Services/FunctionalTests/Services/Marketing/CampaignScenariosBase.cs
@@ -11,8 +11,8 @@
             public static string CampaignBy(int id)
                 => $"{CampaignsUrlBase}/{id}";

-            public static string UserCampaignsByUserId(Guid userId)
-                => $"{CampaignsUrlBase}/user/{userId}";
+            public static string UserCampaignsByUserId()
+                => $"{CampaignsUrlBase}/user";
         }

         public static class Post


Clean up

Clean up

--- src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs
+++ src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs
@@ -157,7 +157,7 @@
             HealthCheckResponse response = GetHealthCheckResponse(service, throwOnNotFound: false);
             await responseStream.WriteAsync(response);

-            // Channel is used to to marshell multiple callers updating status into a single queue.
+            // Channel is used to to marshall multiple callers updating status into a single queue.
             // This is required because IServerStreamWriter is not thread safe.
             // The channel will buffer up to XXX messages, after which it will drop the oldest messages.
             Channel<HealthCheckResponse> channel = Channel.CreateBounded<HealthCheckResponse>(new BoundedChannelOptions(capacity: 5) {


fix xp sharing in group - no longer gives xp group members on other maps, only distributes to those who are in range of creature killer.

--- hybrasyl/UserGroup.cs
+++ hybrasyl/UserGroup.cs
@@ -33,6 +33,8 @@

     public class UserGroup
     {
+
+        private List<User> _expShareInRange = new List<User>();

         // Group-related info
         public List<User> Members { get; private set; }
@@ -157,17 +159,11 @@
          * (b) really far away on the same map.
          */

-        private bool WithinRange(User user, User target)
-        {
-            if (user.Map.Id == target.Map.Id)
-            {
-                int xDelta = Math.Abs(user.Map.X - target.Map.X);
-                int yDelta = Math.Abs(user.Map.Y - target.Map.Y);
-
-                return (xDelta + yDelta < Constants.GROUP_SHARING_DISTANCE);
-            }
-
-            return false;
+        private List<User> MembersWithinRange(User user)
+        {
+            var inRange = user.Map.EntityTree.GetObjects(user.GetViewport()).OfType<User>();
+
+            return inRange.Intersect(Members).ToList();
         }

         /**
@@ -177,33 +173,34 @@
         public void ShareExperience(User source, uint experience, byte mobLevel)
         {
             Dictionary<uint, uint> share = ExperienceDistributionFunc(source, experience);
-
-            for (int i = 0; i < Members.Count; i++)
-            {
-                var absoluteLevel = (byte)Math.Abs(Members[i].Stats.Level - mobLevel);
+            var inRange = MembersWithinRange(source);
+
+            for (int i = 0; i < inRange.Count; i++)
+            {
+                var absoluteLevel = (byte)Math.Abs(inRange[i].Stats.Level - mobLevel);
                 if (absoluteLevel > 3)
                 {
                     switch (absoluteLevel)
                     {
                         case 4:
-                            share[Members[i].Id] = (uint)Math.Ceiling(share[Members[i].Id] * .8);
+                            share[inRange[i].Id] = (uint)Math.Ceiling(share[inRange[i].Id] * .8);
                             break;
                         case 5:
-                            share[Members[i].Id] = (uint)Math.Ceiling(share[Members[i].Id] * .6);
+                            share[inRange[i].Id] = (uint)Math.Ceiling(share[inRange[i].Id] * .6);
                             break;
                         case 6:
-                            share[Members[i].Id] = (uint)Math.Ceiling(share[Members[i].Id] * .4);
+                            share[inRange[i].Id] = (uint)Math.Ceiling(share[inRange[i].Id] * .4);
                             break;
                         case 7:
-                            share[Members[i].Id] = (uint)Math.Ceiling(share[Members[i].Id] * .2);
+                            share[inRange[i].Id] = (uint)Math.Ceiling(share[inRange[i].Id] * .2);
                             break;
                         default:
-                            share[Members[i].Id] = 1;
+                            share[inRange[i].Id] = 1;
                             break;
                     }
                 }
                 // Note: this will only work for positive numbers at this point.
-                Members[i].GiveExperience((uint)share[Members[i].Id]);
+                inRange[i].GiveExperience(share[inRange[i].Id]);
             }
         }

@@ -223,9 +220,9 @@
         {
             Dictionary<uint, uint> share = new Dictionary<uint, uint>();

-            foreach (var member in Members)
-            {
-                share[member.Id] = WithinRange(member, source) ? full : 0;
+            foreach (var member in MembersWithinRange(source))
+            {
+                share[member.Id] = full;
             }

             return share;
@@ -239,9 +236,12 @@
         private Dictionary<uint, uint> Distribution_AllClassBonus(User source, uint full)
         {
             // Check to see if at least one representative from each class is in the group.
-            if (ContainsAllClasses())
-            {
-                full = (uint) Math.Round(full* 1.10);
+            if (!ContainsAllClasses())
+            {
+                var inRange = MembersWithinRange(source).Count - 1; // will always be 1 when source is in range. set back to 0 to not penalize solo while grouped.
+                if (inRange > 5) inRange = 5; //limit to max 45% decrease
+
+                full = (uint)(full * (( 100 - (inRange * 7.5)) / 100));
             }

             return Distribution_Full(source, full);


Make field readonly

Make field readonly

--- osu.Framework.Benchmarks/BenchmarkBindableList.cs
+++ osu.Framework.Benchmarks/BenchmarkBindableList.cs
@@ -9,7 +9,7 @@
     [MemoryDiagnoser]
     public class BenchmarkBindableList
     {
-        private BindableList<int> list = new BindableList<int>();
+        private readonly BindableList<int> list = new BindableList<int>();

         [GlobalSetup]
         public void GlobalSetup()


Fix offset-based position transform not respecting previous transforms

--- osu.Framework/Graphics/TransformableExtensions.cs
+++ osu.Framework/Graphics/TransformableExtensions.cs
@@ -11,6 +11,7 @@
 using JetBrains.Annotations;
 using osu.Framework.Bindables;
 using osu.Framework.Graphics.Effects;
+using osu.Framework.Utils;

 namespace osu.Framework.Graphics
 {
@@ -666,8 +667,7 @@
         public static TransformSequence<T> MoveToOffset<T, TEasing>(this T drawable, Vector2 offset, double duration, in TEasing easing)
             where T : Drawable
             where TEasing : IEasingFunction
-            => drawable.MoveTo(((drawable.Transforms.LastOrDefault(t => t.TargetMember == nameof(drawable.Position)) as Transform<Vector2>)?.EndValue ?? drawable.Position) + offset, duration,
-                easing);
+            => drawable.TransformTo(drawable.PopulateTransform(new PositionOffsetTransform<TEasing>(offset), default, duration, easing));

         /// <summary>
         /// Smoothly adjusts <see cref="IContainer.RelativeChildSize"/> over time.
@@ -750,5 +750,34 @@
             => drawable.TransformTo(drawable.PopulateTransform(new TransformBindable<TValue, TEasing, T>(bindable), newValue, duration, easing));

         #endregion
+
+        private class PositionOffsetTransform<TEasing> : Transform<Vector2, TEasing, Drawable>
+            where TEasing : IEasingFunction
+        {
+            private readonly Vector2 offset;
+
+            public override string TargetMember => nameof(Drawable.Position);
+
+            public PositionOffsetTransform(Vector2 offset)
+            {
+                this.offset = offset;
+            }
+
+            private Vector2 positionAt(double time)
+            {
+                if (time < StartTime) return StartValue;
+                if (time >= EndTime) return EndValue;
+
+                return Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
+            }
+
+            protected override void Apply(Drawable d, double time) => d.Position = positionAt(time);
+
+            protected override void ReadIntoStartValue(Drawable d)
+            {
+                StartValue = d.Position;
+                EndValue = d.Position + offset;
+            }
+        }
     }
 }


Always return NormalizedValue = 1 when the slider bar has 0 range.

--- osu.Framework/Graphics/UserInterface/SliderBar.cs
+++ osu.Framework/Graphics/UserInterface/SliderBar.cs
@@ -55,6 +55,10 @@
                     return 0;
                 var min = Convert.ToSingle(CurrentNumber.MinValue);
                 var max = Convert.ToSingle(CurrentNumber.MaxValue);
+
+                if (max - min == 0)
+                    return 1;
+
                 var val = Convert.ToSingle(CurrentNumber.Value);
                 return (val - min) / (max - min);
             }


Reduce finalizer allocation log level

Reduce finalizer allocation log level

--- osu.Framework/Statistics/DotNetRuntimeListener.cs
+++ osu.Framework/Statistics/DotNetRuntimeListener.cs
@@ -95,7 +95,7 @@
                             Debug.Assert(finalizeMethod != null); // All objects have this.

                             if (finalizeMethod.DeclaringType != typeof(object))
-                                Logger.Log($"Allocated finalizable object: {name}", LoggingTarget.Performance, LogLevel.Important);
+                                Logger.Log($"Allocated finalizable object: {name}", LoggingTarget.Performance);

                             break;
                     }


Use writeline

Use writeline

--- osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs
+++ osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs
@@ -180,7 +180,7 @@
                 writer.Write(FormattableString.Invariant($"{tempHitSample.Volume},"));
                 writer.Write(FormattableString.Invariant($"{(timingPoint != null ? '1' : '0')},"));
                 writer.Write(FormattableString.Invariant($"{(int)effectFlags}"));
-                writer.Write("\n");
+                writer.WriteLine();
             }
         }

@@ -311,7 +311,7 @@
                 ? getSampleBank(hitObject.Samples, zeroBanks: true)
                 : getSampleBank(hitObject.Samples));

-            writer.Write(Environment.NewLine);
+            writer.WriteLine();
         }

         private void handleTaikoHitObject(TextWriter writer, HitObject hitObject) => throw new NotImplementedException();


Add generation comment

Add generation comment

--- osu.Game/Rulesets/Objects/SliderEventGenerator.cs
+++ osu.Game/Rulesets/Objects/SliderEventGenerator.cs
@@ -118,6 +118,7 @@
                 if (d >= length - minDistanceFromEnd)
                     break;

+                // Always generate ticks from the start of the path rather than the span to ensure that ticks in repeat spans are positioned identically to those in non-repeat spans
                 var pathProgress = d / length;
                 var timeProgress = reversed ? 1 - pathProgress : pathProgress;


Fix legacy beatmap encoding

Fix legacy beatmap encoding

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

                 if (point.Type.Value != null)
                 {
-                    if (point.Type.Value != lastType)
+                    // We've reached a new segment!
+
+                    // To preserve compatibility with osu-stable as much as possible, segments with the same type are converted to use implicit segments by duplicating the control point.
+                    // One exception to this is when the last control point of the last segment was itself a duplicate, which can't be supported by osu-stable.
+                    bool lastPointWasDuplicate = i > 1 && pathData.Path.ControlPoints[i - 1].Position.Value == pathData.Path.ControlPoints[i - 2].Position.Value;
+
+                    if (lastPointWasDuplicate || point.Type.Value != lastType)
                     {
                         switch (point.Type.Value)
                         {


Prepend sb:// to endpoint if not present

--- src/ServiceBusExplorer/Helpers/ServiceBusNamespace.cs
+++ src/ServiceBusExplorer/Helpers/ServiceBusNamespace.cs
@@ -63,6 +63,7 @@
         const string ServiceBusNamespaceIssuerNameIsNullOrEmpty = "The issuer name for the service bus namespace {0} is null or empty.";
         const string ServiceBusNamespaceIssuerSecretIsNullOrEmpty = "The issuer secret for the service bus namespace {0} is null or empty.";
         const string ServiceBusNamespaceEndpointIsNullOrEmpty = "The endpoint for the service bus namespace {0} is null or empty.";
+        const string ServiceBusNamespaceEndpointPrefixedWithSb = "The endpoint for the service bus namespace {0} is being automatically prefixed with \"sb://\".";
         const string ServiceBusNamespaceStsEndpointIsNullOrEmpty = "The sts endpoint for the service bus namespace {0} is null or empty.";
         const string ServiceBusNamespaceRuntimePortIsNullOrEmpty = "The runtime port for the service bus namespace {0} is null or empty.";
         const string ServiceBusNamespaceManagementPortIsNullOrEmpty = "The management port for the service bus namespace {0} is null or empty.";
@@ -269,6 +270,12 @@
                     return null;
                 }

+                if (!endpoint.Contains("://"))
+                {
+                    staticWriteToLog(string.Format(CultureInfo.CurrentCulture, ServiceBusNamespaceEndpointPrefixedWithSb, endpoint));
+                    endpoint = "sb://" + endpoint;
+                }
+
                 var stsEndpoint = parameters.ContainsKey(ConnectionStringStsEndpoint) ?
                                   parameters[ConnectionStringStsEndpoint] :
                                   null;


Create the font directory if it doesn't exist.

--- src/SwtorCaster/Core/Services/Settings/FontService.cs
+++ src/SwtorCaster/Core/Services/Settings/FontService.cs
@@ -22,6 +22,11 @@

         public void Initialize()
         {
+            if (!Directory.Exists(FontsFolder))
+            {
+                Directory.CreateDirectory(FontsFolder);
+            }
+
             fontFamilies = new DirectoryInfo(FontsFolder)
                 .EnumerateFiles("*.ttf")
                 .Select(x => new { Uri = new Uri(x.Directory.FullName + "/"), FamilyName = new GlyphTypeface(new Uri(x.FullName)).GetFamilyName() })


Fixed failing unit tests

Fixed failing unit tests

--- src/TicTacToe/TicTacToeCore.Tests/GameManagerTests.cs
+++ src/TicTacToe/TicTacToeCore.Tests/GameManagerTests.cs
@@ -44,10 +44,9 @@
         public void GameManager_CreateNewRandom_with_random_0_should_not_swap_players()
         {
             // Arrange
-            var gameManager = new GameManager(null);
+            var gameManager = new GameManager(new RandomProviderStubReturns0());
             var firstPlayer = Guid.NewGuid().ToString();
             var secondPlayer = Guid.NewGuid().ToString();
-            //gameManager.MakeRandomProviderOverride = () => new RandomProviderStubReturns0();

             // Act
             var game = gameManager.CreateNewRandom(firstPlayer, secondPlayer);
@@ -66,10 +65,9 @@
         public void GameManager_CreateNewRandom_with_random_1_should_swap_players()
         {
             // Arrange
-            var gameManager = new GameManager(null);
+            var gameManager = new GameManager(new RandomProviderStubReturns1());
             var firstPlayer = Guid.NewGuid().ToString();
             var secondPlayer = Guid.NewGuid().ToString();
-            //gameManager.MakeRandomProviderOverride = () => new RandomProviderStubReturns1();

             // Act
             var game = gameManager.CreateNewRandom(firstPlayer, secondPlayer);
@@ -88,12 +86,12 @@
         public void GameManager_CreateNewRandom_calls_RandomProvider()
         {
             // Arrange
-            var gameManager = new GameManager(null);
+            var expectedReturnValueForRandomProviderGet = 1;
+            var spy = new RandomProviderSpy(
+                new RandomProviderMock { GetOverride = maxValue => expectedReturnValueForRandomProviderGet });
+            var gameManager = new GameManager(spy);
             var firstPlayer = Guid.NewGuid().ToString();
             var secondPlayer = Guid.NewGuid().ToString();
-            var expectedReturnValueForRandomProviderGet = 1;
-            var spy = new RandomProviderSpy(new RandomProviderMock { GetOverride = maxValue => expectedReturnValueForRandomProviderGet });
-            //gameManager.MakeRandomProviderOverride = () => spy;

             // Act
             var game = gameManager.CreateNewRandom(firstPlayer, secondPlayer);
@@ -114,7 +112,7 @@
             var numNotSwapped = 0;
             var player1 = Guid.NewGuid().ToString();
             var player2 = Guid.NewGuid().ToString();
-            var gameManager = new GameManager(null);
+            var gameManager = new GameManager(new RandomProvider());

             for (var i = 0; i < testRuns; i++)
             {


Updated unit test name

Updated unit test name

--- src/Umbraco.Tests/Services/ContentTypeServiceTests.cs
+++ src/Umbraco.Tests/Services/ContentTypeServiceTests.cs
@@ -23,7 +23,7 @@
 		}

 		[Test]
-		public void Can_Bulk_Save_New_Hierarchy_Content()
+		public void Can_Bulk_Save_New_Hierarchy_Content_Types()
 		{
 			// Arrange
 			var contentTypeService = ServiceContext.ContentTypeService;


Update response headers middleware

Update response headers middleware

Remove the X-Request-Duration response header.
Fix incorrectly generated CSP report response header value.

--- src/Website/Middleware/CustomHttpHeadersMiddleware.cs
+++ src/Website/Middleware/CustomHttpHeadersMiddleware.cs
@@ -5,7 +5,6 @@
 {
     using System;
     using System.Collections.Generic;
-    using System.Diagnostics;
     using System.Globalization;
     using System.Linq;
     using System.Text;
@@ -42,6 +41,11 @@
         private readonly string _contentSecurityPolicy;

         /// <summary>
+        /// The current <c>Content-Security-Policy-Report-Only</c> HTTP response header value. This field is read-only.
+        /// </summary>
+        private readonly string _contentSecurityPolicyReportOnly;
+
+        /// <summary>
         /// The current <c>Public-Key-Pins</c> HTTP response header value. This field is read-only.
         /// </summary>
         private readonly string _publicKeyPins;
@@ -75,8 +79,10 @@

             _isProduction = environment.IsProduction();
             _environmentName = _isProduction ? null : environment.EnvironmentName;
-            _contentSecurityPolicy = BuildContentSecurityPolicy(_isProduction, options.Value);
             _publicKeyPins = BuildPublicKeyPins(options.Value);
+
+            _contentSecurityPolicy = BuildContentSecurityPolicy(_isProduction, false, options.Value);
+            _contentSecurityPolicyReportOnly = BuildContentSecurityPolicy(_isProduction, true, options.Value);
         }

         /// <summary>
@@ -88,14 +94,14 @@
         /// </returns>
         public async Task Invoke(HttpContext context)
         {
-            var stopwatch = Stopwatch.StartNew();
-
             context.Response.OnStarting(() =>
                 {
                     context.Response.Headers.Remove("Server");
                     context.Response.Headers.Remove("X-Powered-By");

                     context.Response.Headers.Add("Content-Security-Policy", _contentSecurityPolicy);
+                    context.Response.Headers.Add("Content-Security-Policy-Report-Only", _contentSecurityPolicyReportOnly);
+                    context.Response.Headers.Add("Referrer-Policy", "origin-when-cross-origin");
                     context.Response.Headers.Add("X-Content-Type-Options", "nosniff");
                     context.Response.Headers.Add("X-Download-Options", "noopen");
                     context.Response.Headers.Add("X-Frame-Options", "DENY");
@@ -126,14 +132,6 @@
                     context.Response.Headers.Add("X-Request-Id", context.TraceIdentifier);
                     context.Response.Headers.Add("X-Revision", GitMetadata.Commit);

-                    stopwatch.Stop();
-
-                    string duration = stopwatch.Elapsed.TotalMilliseconds.ToString(
-                        "0.00ms",
-                        CultureInfo.InvariantCulture);
-
-                    context.Response.Headers.Add("X-Request-Duration", duration);
-
                     return Task.CompletedTask;
                 });

@@ -144,11 +142,12 @@
         /// Builds the Content Security Policy to use for the website.
         /// </summary>
         /// <param name="isProduction">Whether the current environment is production.</param>
+        /// <param name="isReport">Whether the policy is being generated for the report.</param>
         /// <param name="options">The current site configuration options.</param>
         /// <returns>
         /// A <see cref="string"/> containing the Content Security Policy to use.
         /// </returns>
-        private static string BuildContentSecurityPolicy(bool isProduction, SiteOptions options)
+        private static string BuildContentSecurityPolicy(bool isProduction, bool isReport, SiteOptions options)
         {
             var cdn = GetCdnOriginForContentSecurityPolicy(options);

@@ -177,10 +176,9 @@
                 builder.Append(pair.Key);

                 IList<string> origins = pair.Value;
-                IList<string> configOrigins;

                 if (options.ContentSecurityPolicyOrigins != null &&
-                    options.ContentSecurityPolicyOrigins.TryGetValue(pair.Key, out configOrigins))
+                    options.ContentSecurityPolicyOrigins.TryGetValue(pair.Key, out IList<string> configOrigins))
                 {
                     origins = origins.Concat(configOrigins).ToList();
                 }
@@ -196,14 +194,14 @@
                 builder.Append(";");
             }

-            if (isProduction)
+            if (!isReport && isProduction)
             {
                 builder.Append("upgrade-insecure-requests;");
-
-                if (options?.ExternalLinks?.Reports?.ContentSecurityPolicy != null)
-                {
-                    builder.Append($"report-uri {options.ExternalLinks.Reports.ContentSecurityPolicy};");
-                }
+            }
+
+            if (options?.ExternalLinks?.Reports?.ContentSecurityPolicy != null)
+            {
+                builder.Append($"report-uri {options.ExternalLinks.Reports.ContentSecurityPolicy};");
             }

             return builder.ToString();


Fix typo

Fix typo

--- help/templates/indexpage.cshtml
+++ help/templates/indexpage.cshtml
@@ -48,7 +48,7 @@

-
Extendibility

+
Extensibility

Integrate your own modules

@@ -111,4 +111,4 @@

-
+


GSettingsSchemaExtractor: move Path property from GKey to GSchema struct

--- build/GSettingsSchemaExtractor.cs
+++ build/GSettingsSchemaExtractor.cs
@@ -168,6 +168,8 @@
     internal struct GSettingsSchema
     {
         internal string Id { get; private set; }
+        internal string Path { get { return Id.Replace ("org.gnome.", "/apps/").Replace (".", "/") + "/"; } }
+
         internal HashSet<GSettingsKey> Keys { get; private set; }

         internal GSettingsSchema (string id) : this ()
@@ -179,7 +181,7 @@
         public override string ToString ()
         {
             string result = String.Empty;
-            result += String.Format ("  <schema id=\"{0}\" path=\"{1}\" gettext-domain=\"banshee\">\n", Id, GetPath (Id));
+            result += String.Format ("  <schema id=\"{0}\" path=\"{1}\" gettext-domain=\"banshee\">\n", Id, Path);
             foreach (var key in Keys) {
                 result += key.ToString ();
             }
@@ -192,7 +194,6 @@
     internal struct GSettingsKey
     {
         internal GSettingsSchema ParentSchema { get; private set; }
-        internal string Path { get; private set; }
         internal string Default { get; private set; }
         internal string KeyName { get; private set; }
         internal string KeyType { get; private set; }
@@ -217,20 +218,18 @@
             var short_description = GetStringValueOfFieldNamed (schema, "ShortDescription");
             var long_description = GetStringValueOfFieldNamed (schema, "LongDescription");

-            var gsettings_key = new GSettingsKey (schemaSet, default_value, default_value_type, namespce, key, short_description, long_description);
-            return gsettings_key;
+            return new GSettingsKey (schemaSet, default_value, default_value_type, namespce, key, short_description, long_description);
         }

         private GSettingsKey (SchemaSet schemaSet, object defaultValue, Type defaultValueType,
                               string namespce, string key,
                               string short_desc, string long_desc) : this ()
         {
-            ParentSchema = schemaSet.RetrieveOrCreate (CreateId (namespce));
+            ParentSchema = schemaSet.RetrieveOrCreate (namespce);

             Default = GetDefault (defaultValue, defaultValueType);
             KeyName = key.Replace ("_", "-");
             KeyType = GetTypeAttrib (defaultValue, defaultValueType);
-            Path = GetPath (ParentSchema.Id);
             Summary = short_desc;
             Description = long_desc;

@@ -258,8 +257,14 @@

         internal Dictionary<string, GSettingsSchema> Schemas { get; private set; }

-        internal GSettingsSchema RetrieveOrCreate (string id)
-        {
+        private static string NamespaceToId (string namespce)
+        {
+            return "org.gnome.banshee." + CamelCaseToUnderScoreLowerCase (namespce);
+        }
+
+        internal GSettingsSchema RetrieveOrCreate (string namespce)
+        {
+            string id = NamespaceToId (namespce);
             GSettingsSchema schema;
             if (!Schemas.TryGetValue (id, out schema)) {
                 schema = new GSettingsSchema (id);
@@ -334,15 +339,5 @@

         return undercase;
     }
-
-    private static string CreateId (string namespce)
-    {
-        return "org.gnome.banshee." + CamelCaseToUnderScoreLowerCase (namespce);
-    }
-
-    private static string GetPath (string id)
-    {
-        return id.Replace ("org.gnome.", "/apps/").Replace (".", "/") + "/";
-    }
 }


DNN-8814: mark page isSecure by default when SSL is enforced

--- src/Modules/Content/Dnn.PersonaBar.Pages/Components/PagesControllerImpl.cs
+++ src/Modules/Content/Dnn.PersonaBar.Pages/Components/PagesControllerImpl.cs
@@ -971,7 +971,14 @@
             };

             pageSettings.TemplateId = _templateController.GetDefaultTemplateId(pageSettings.Templates);
-
+
+            var portalSettings = PortalController.Instance.GetCurrentPortalSettings();
+            if (PortalController.GetPortalSettingAsBoolean("SSLEnabled", portalSettings.PortalId, false) &&
+                PortalController.GetPortalSettingAsBoolean("SSLEnforced", portalSettings.PortalId, false))
+            {
+                pageSettings.IsSecure = true;
+            }
+
             return pageSettings;
         }


Now using the entry assembly for package framework compatibility since Wyam.Configuration target is different from the app assembly

--- src/core/Wyam.Configuration/NuGet/PackageInstaller.cs
+++ src/core/Wyam.Configuration/NuGet/PackageInstaller.cs
@@ -62,7 +62,8 @@

         private NuGetFramework GetCurrentFramework()
         {
-            string frameworkName = Assembly.GetExecutingAssembly().GetCustomAttributes(true)
+            Assembly assembly = Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly();
+            string frameworkName = assembly.GetCustomAttributes(true)
                 .OfType<System.Runtime.Versioning.TargetFrameworkAttribute>()
                 .Select(x => x.FrameworkName)
                 .FirstOrDefault();


update camera position reset logic

update camera position reset logic

--- Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputSystem.cs
+++ Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputSystem.cs
@@ -135,8 +135,6 @@
         /// </remarks>
         public override uint Priority => 1;

-        private bool isFirstInitialize = true;
-
         /// <inheritdoc />
         public override void Initialize()
         {
@@ -147,11 +145,9 @@
                 return;
             }

-            if (!Application.isPlaying || isFirstInitialize)
-            {
-                CameraCache.Main.transform.position = Vector3.zero;
-                CameraCache.Main.transform.rotation = Quaternion.identity;
-            }
+            // Ensure the camera starts at the origin.
+            CameraCache.Main.transform.position = Vector3.zero;
+            CameraCache.Main.transform.rotation = Quaternion.identity;

             BaseInputModule[] inputModules = UnityEngine.Object.FindObjectsOfType<BaseInputModule>();


Revert the purposely introduced bad code (intentionally tripping up validation) now that the PR looks good to go.

--- Assets/MixedRealityToolkit.Tests/PlayModeTests/ManipulationHandlerTests.cs
+++ Assets/MixedRealityToolkit.Tests/PlayModeTests/ManipulationHandlerTests.cs
@@ -24,9 +24,6 @@
 {
     public class ManipulationHandlerTests
     {
-        // Intentionally empty to show that validation still works, will
-        // delete after folks code review this.
-        /// <returns></returns>
         private readonly List<Action> cleanupAction = new List<Action>();

         [SetUp]


test(discovery-v2): tests are now disabled

--- test/Discovery.v2.IntegrationTests/DiscoveryIntegrationTests.cs
+++ test/Discovery.v2.IntegrationTests/DiscoveryIntegrationTests.cs
@@ -27,7 +27,7 @@

 namespace IBM.Watson.Discovery.v2.IntegrationTests
 {
-    [TestClass]
+    //[TestClass]
     public class DiscoveryIntegrationTests
     {
         private DiscoveryService service;


Updated to support processing multiple RawSourceFiles

--- CopaceticSoftware.CodeGenerator.StarterKit/ICodeGeneratorContextFactory.cs
+++ CopaceticSoftware.CodeGenerator.StarterKit/ICodeGeneratorContextFactory.cs
@@ -16,7 +16,9 @@
 // </copyright>
 //-----------------------------------------------------------------------

-using CopaceticSoftware.CodeGenerator.StarterKit.Infrastructure.VisualStudioSolution;
+
+using System.Collections.Generic;
+using System.Linq;
 using CopaceticSoftware.CodeGenerator.StarterKit.Infrastructure.VisualStudioSolution;
 using CopaceticSoftware.Common.Infrastructure;

@@ -24,32 +26,34 @@
 {
     public interface ICodeGeneratorContextFactory
     {
-        ICodeGeneratorContext GenerateContext(string sourceCode, string sourceFileName, string projectFilePath);
+        IEnumerable<ICodeGeneratorContext> GenerateContext(IEnumerable<RawSourceFile> rawSourceFiles);
     }

     public class CodeGeneratorContextFactory : ICodeGeneratorContextFactory
     {
-        private readonly ISolutionExtender _solutionExtender;
+        private readonly ISolutionManager _solutionManager;

-        public CodeGeneratorContextFactory(ISolutionExtender solutionExtender)
+        public CodeGeneratorContextFactory(ISolutionManager solutionManager)
         {
-            Ensure.ArgumentNotNull(solutionExtender, "solutionExtender");
+            Ensure.ArgumentNotNull(solutionManager, "solutionManager");

-            _solutionExtender = solutionExtender;
+            _solutionManager = solutionManager;
         }

-        public ICodeGeneratorContext GenerateContext(
-            string sourceCode, string sourceFileName, string projectFilePath)
+        public IEnumerable<ICodeGeneratorContext> GenerateContext(IEnumerable<RawSourceFile> rawSourceFiles)
         {
-            var sourceFile =
-                _solutionExtender.AddOrUpdateProjectItemFile(
-                    projectFilePath, sourceFileName, sourceCode);
+            if (null == rawSourceFiles)
+                return Enumerable.Empty<ICodeGeneratorContext>();

-            return new CodeGeneratorContext
-                       {
-                           Source = sourceFile,
-                           TypeResolver = sourceFile.CreateResolver()
-                       };
+            return
+                _solutionManager.LoadCSharpFiles(rawSourceFiles)
+                    .Select(
+                        csharpFile =>
+                            new CodeGeneratorContext
+                            {
+                                Source = csharpFile,
+                                TypeResolver = csharpFile.CreateResolver()
+                            });
         }
     }
 }


JimEvans: Adding test for finding elements by class when the name is surrounded by whitespace. .NET test for change introduced by r8377.

git-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@8380 07704840-8298-11de-bf8c-fd130f914ac9

--- common/test/csharp/webdriver-common-test/ElementFindingTest.cs
+++ common/test/csharp/webdriver-common-test/ElementFindingTest.cs
@@ -81,7 +81,7 @@

         [Test]
         [ExpectedException(typeof(NoSuchElementException))]
-        public void ShouldNotBeAbleTofindElementsBasedOnIdIfTheElementIsNotThere()
+        public void ShouldNotBeAbleToFindElementsBasedOnIdIfTheElementIsNotThere()
         {
             driver.Url = formsPage;

@@ -155,6 +155,25 @@
         }

         [Test]
+        public void ShouldFindElementByClassWhenItsNameIsSurroundedByWhitespace()
+        {
+            driver.Url = xhtmlTestPage;
+
+            IWebElement element = driver.FindElement(By.ClassName("spaceAround"));
+            Assert.AreEqual("Spaced out", element.Text);
+        }
+
+        [Test]
+        public void ShouldFindElementsByClassWhenItsNameIsSurroundedByWhitespace()
+        {
+            driver.Url = xhtmlTestPage;
+
+            ReadOnlyCollection<IWebElement> elements = driver.FindElements(By.ClassName("spaceAround"));
+            Assert.AreEqual(1, elements.Count);
+            Assert.AreEqual("Spaced out", elements[0].Text);
+        }
+
+        [Test]
         [ExpectedException(typeof(NoSuchElementException))]
         public void ShouldNotFindElementsByClassWhenTheNameQueriedIsShorterThanCandidateName()
         {
@@ -285,7 +304,7 @@
         }

         [Test]
-        public void ShouldfindAnElementBasedOnTagName()
+        public void ShouldFindAnElementBasedOnTagName()
         {
             driver.Url = formsPage;


!REVERT ME! Midlertidig disabling av sertifikatvalidering for debugging

--- Digipost.Signature.Api.Client.Direct.Tests/Smoke/DirectClientSmokeTests.cs
+++ Digipost.Signature.Api.Client.Direct.Tests/Smoke/DirectClientSmokeTests.cs
@@ -25,6 +25,8 @@
             {
                 LogRequestAndResponse = true
             };
+            clientConfig.CertificateValidationPreferences.ValidateSenderCertificate = false;
+            clientConfig.CertificateValidationPreferences.ValidateResponseCertificate = false;
             var client = new DirectClient(clientConfig);

             return client;


- fixed a unit test

- fixed a unit test

--- EntityFrameworkExtras.Tests/Integration/UserDefinedTableTypeColumnTests.cs
+++ EntityFrameworkExtras.Tests/Integration/UserDefinedTableTypeColumnTests.cs
@@ -63,7 +63,7 @@
                     {
                         NvarChar = "Theses Columns Names were Explicity Set",
                         BigInt = 1000,
-                        Binary = GetBytes("Mike Rodda")
+                        Binary = GetBytes("michael rodda")
                     }
                 };

@@ -71,7 +71,7 @@

             Assert.AreEqual("Theses Columns Names were Explicity Set", result.ParameterNvarChar);
             Assert.AreEqual(1000, result.ParameterBigInt);
-            Assert.AreEqual(GetBytes("Mike Rodda"), result.ParameterBinary);
+            Assert.AreEqual(GetBytes("michael rodda"), result.ParameterBinary);

         }
     }


Made the Enumerator of NotificationResultCollection a struct.

--- Expressions/Expressions/Execution/Parallel/NotificationResultCollection.cs
+++ Expressions/Expressions/Execution/Parallel/NotificationResultCollection.cs
@@ -118,7 +118,7 @@
             }
         }

-        private class Enumerator : IEnumerator<INotificationResult>
+        private struct Enumerator : IEnumerator<INotificationResult>
         {
             private readonly NotificationResultCollection collection;
             private Entry currentEntry;


Fixed variable display when a variable is set by states.

--- FRBDK/Glue/OfficialPlugins/PropertyGrid/NamedObjectVariableShowingLogic.cs
+++ FRBDK/Glue/OfficialPlugins/PropertyGrid/NamedObjectVariableShowingLogic.cs
@@ -20,6 +20,7 @@
 using FlatRedBall.Glue.Managers;
 using WpfDataUi.Controls;
 using FlatRedBall.Graphics.Animation;
+using FlatRedBall.Content.Instructions;

 namespace OfficialPlugins.VariableDisplay
 {
@@ -43,7 +44,7 @@
                 instance.UpdateCustomProperties();
             }

-            CreateCategoriesAndVariables(instance, container, categories, assetTypeInfo);
+            CreateCategoriesAndVariables(instance, container as GlueElement, categories, assetTypeInfo);

             if (assetTypeInfo != null)
             {
@@ -91,7 +92,7 @@
             }
         }

-        private static void CreateCategoriesAndVariables(NamedObjectSave instance, IElement container,
+        private static void CreateCategoriesAndVariables(NamedObjectSave instance, GlueElement container,
             List<MemberCategory> categories, AssetTypeInfo ati)
         {
             // May 13, 2017
@@ -190,7 +191,7 @@
             }
         }

-        private static void AddForTypedMember(NamedObjectSave instance, IElement container, List<MemberCategory> categories,
+        private static void AddForTypedMember(NamedObjectSave instance, GlueElement container, List<MemberCategory> categories,
             AssetTypeInfo ati, TypedMemberBase typedMember, VariableDefinition variableDefinition = null)
         {
             variableDefinition = variableDefinition ?? ati?.VariableDefinitions.FirstOrDefault(item => item.Name == typedMember.MemberName);
@@ -451,7 +452,7 @@
         }

         private static InstanceMember CreateInstanceMember(NamedObjectSave instance,
-            IElement container,
+            GlueElement container,
             // memberName is contained in typedMember, but we want to move away from TypedMemberBase so this extra
             // parameter will help that.
             string memberName,
@@ -566,7 +567,7 @@

                 instanceMember.IsDefault = instance.GetCustomVariable(memberName) == null;

-                AssignCustomGetEvent(instance, memberName, memberType, variableDefinition, instanceMember);
+                AssignCustomGetEvent(instance, container, memberName, memberType, variableDefinition, instanceMember);

                 instanceMember.CustomSetEvent += (owner, value) =>
                 {
@@ -672,7 +673,7 @@
             return instanceMember;
         }

-        private static void AssignCustomGetEvent(NamedObjectSave instance, string memberName, Type memberType, VariableDefinition variableDefinition, DataGridItem instanceMember)
+        private static void AssignCustomGetEvent(NamedObjectSave instance, GlueElement container, string memberName, Type memberType, VariableDefinition variableDefinition, DataGridItem instanceMember)
         {
             instanceMember.CustomGetEvent += (throwaway) =>
             {
@@ -682,14 +683,16 @@
                 if (instruction == null)
                 {
                     // Get the value for this variable from the base element.
-                    var element = ObjectFinder.Self.GetElement(instance);
-                    if(element != null)
-                    {
-                        var variable = element.GetCustomVariableRecursively(memberName);
-                        if(variable != null)
-                        {
-                            return variable.DefaultValue;
-                        }
+
+                    var getVariableResponse = GetVariableOnInstance(instance, container, memberName);
+
+                    if (getVariableResponse.customVariable != null)
+                    {
+                        return getVariableResponse.customVariable.DefaultValue;
+                    }
+                    else if(getVariableResponse.instructionOnState != null)
+                    {
+                        return getVariableResponse.instructionOnState.Value;
                     }

                     if (variableDefinition != null)
@@ -757,6 +760,80 @@
                     }
                 }
             };
+        }
+
+        private static (CustomVariable customVariable, InstructionSave instructionOnState) GetVariableOnInstance(NamedObjectSave instance, GlueElement container, string memberName)
+        {
+            CustomVariable foundVariable = null;
+            FlatRedBall.Content.Instructions.InstructionSave valueOnState = null;
+
+            var instanceElementType = ObjectFinder.Self.GetElement(instance);
+            if (instanceElementType != null)
+            {
+
+
+                foreach(var instructionOnObject in instance.InstructionSaves)
+                {
+                    var variableOnInstanceName = instructionOnObject.Member;
+                    var variableOnInstanceValue = instructionOnObject.Value;
+
+                    // is it a state?
+                    CustomVariable possibleStateCustomVariable = instanceElementType.GetCustomVariable(variableOnInstanceName);
+
+                    var matchingStateCategory = instanceElementType.GetStateCategory(possibleStateCustomVariable.Type);
+                    if (matchingStateCategory != null)
+                    {
+                        var matchingState = matchingStateCategory.GetState(variableOnInstanceValue as string);
+                        if (matchingState != null)
+                        {
+                            // does the state set the member?
+                            valueOnState = matchingState.InstructionSaves.Find(item => item.Member == memberName && item.Value != null);
+
+                        }
+                    }
+                    if (valueOnState != null)
+                    {
+                        break;
+                    }
+                }
+
+                if(valueOnState == null)
+                {
+                    // See if this variable is set by any states on the instance first
+                    var variablesOnThisInstance = container.CustomVariables.Where(item => item.SourceObject == instance.InstanceName);
+
+                    foreach(var variableOnInstance in variablesOnThisInstance)
+                    {
+                        var variableOnInstanceName = variableOnInstance.Name;
+                        var variableOnInstanceValue = variableOnInstance.DefaultValue;
+                        // is it a state?
+                        CustomVariable possibleStateCustomVariable = instanceElementType.GetCustomVariable(variableOnInstanceName);
+
+                        var matchingStateCategory = instanceElementType.GetStateCategory(possibleStateCustomVariable.Type);
+                        if(matchingStateCategory != null)
+                        {
+                            var matchingState = matchingStateCategory.GetState(variableOnInstanceValue as string);
+                            if(matchingState != null)
+                            {
+                                // does the state set the member?
+                                valueOnState = matchingState.InstructionSaves.Find(item => item.Member == memberName && item.Value != null);
+
+                            }
+                        }
+                        if(valueOnState != null)
+                        {
+                            break;
+                        }
+                    }
+                }
+
+                if(valueOnState == null)
+                {
+                    foundVariable = instanceElementType.GetCustomVariableRecursively(memberName);
+                }
+            }
+
+            return (foundVariable, valueOnState);
         }


Changed condition to successfully load plugins

--- src/framework/UUM.Engine/Services/PluginRepository.cs
+++ src/framework/UUM.Engine/Services/PluginRepository.cs
@@ -10,7 +10,7 @@
     {
         public void Initialize()
         {
-            if (Plugins.Any())
+            if (Plugins == null)
             {
                 // MEF loading of available plug-ins
                 var catalog = new DirectoryCatalog(".", "UUM.Plugin.*.dll");


Fix: image format

Fix: image format

--- test/asp.net_matrixcode_example/WebForm1.aspx.cs
+++ test/asp.net_matrixcode_example/WebForm1.aspx.cs
@@ -21,13 +21,13 @@

             byte[] imgBytes = ImageToByteArray(mCode.CodeImage);
             string imgString = Convert.ToBase64String(imgBytes);
-            PhotoTANString = String.Format("", imgString);
+            PhotoTANString = String.Format("", imgString);
         }

         public static byte[] ImageToByteArray(System.Drawing.Image img)
         {
             MemoryStream ms = new MemoryStream();
-            img.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
+            img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
             return ms.ToArray();
         }
     }


Add GetKey() in NonfungibleToken (#2199)

--- src/neo/SmartContract/Native/NonfungibleToken.cs
+++ src/neo/SmartContract/Native/NonfungibleToken.cs
@@ -62,9 +62,11 @@
             Manifest.Abi.Events = events.ToArray();
         }

+        protected virtual byte[] GetKey(byte[] tokenId) => tokenId;
+
         protected void Mint(ApplicationEngine engine, TokenState token)
         {
-            engine.Snapshot.Storages.Add(CreateStorageKey(Prefix_Token).Add(token.Id), new StorageItem(token));
+            engine.Snapshot.Storages.Add(CreateStorageKey(Prefix_Token).Add(GetKey(token.Id)), new StorageItem(token));
             NFTAccountState account = engine.Snapshot.Storages.GetAndChange(CreateStorageKey(Prefix_Account).Add(token.Owner), () => new StorageItem(new NFTAccountState())).GetInteroperable<NFTAccountState>();
             account.Add(token.Id);
             engine.Snapshot.Storages.GetAndChange(CreateStorageKey(Prefix_TotalSupply), () => new StorageItem(BigInteger.Zero)).Add(1);
@@ -73,7 +75,7 @@

         protected void Burn(ApplicationEngine engine, byte[] tokenId)
         {
-            StorageKey key_token = CreateStorageKey(Prefix_Token).Add(tokenId);
+            StorageKey key_token = CreateStorageKey(Prefix_Token).Add(GetKey(tokenId));
             TokenState token = engine.Snapshot.Storages.TryGet(key_token)?.GetInteroperable<TokenState>();
             if (token is null) throw new InvalidOperationException();
             engine.Snapshot.Storages.Delete(key_token);
@@ -96,13 +98,13 @@
         [ContractMethod(0_01000000, CallFlags.ReadStates)]
         public UInt160 OwnerOf(StoreView snapshot, byte[] tokenId)
         {
-            return snapshot.Storages[CreateStorageKey(Prefix_Token).Add(tokenId)].GetInteroperable<TokenState>().Owner;
+            return snapshot.Storages[CreateStorageKey(Prefix_Token).Add(GetKey(tokenId))].GetInteroperable<TokenState>().Owner;
         }

         [ContractMethod(0_01000000, CallFlags.ReadStates)]
         public JObject Properties(StoreView snapshot, byte[] tokenId)
         {
-            return snapshot.Storages[CreateStorageKey(Prefix_Token).Add(tokenId)].GetInteroperable<TokenState>().ToJson();
+            return snapshot.Storages[CreateStorageKey(Prefix_Token).Add(GetKey(tokenId))].GetInteroperable<TokenState>().ToJson();
         }

         [ContractMethod(0_01000000, CallFlags.ReadStates)]
@@ -132,7 +134,7 @@
         protected bool Transfer(ApplicationEngine engine, UInt160 to, byte[] tokenId)
         {
             if (to is null) throw new ArgumentNullException(nameof(to));
-            TokenState token = engine.Snapshot.Storages.GetAndChange(CreateStorageKey(Prefix_Token).Add(tokenId))?.GetInteroperable<TokenState>();
+            TokenState token = engine.Snapshot.Storages.GetAndChange(CreateStorageKey(Prefix_Token).Add(GetKey(tokenId)))?.GetInteroperable<TokenState>();
             if (token is null) throw new ArgumentException();
             UInt160 from = token.Owner;
             if (!from.Equals(engine.CallingScriptHash) && !engine.CheckWitnessInternal(from))


add SuppressLoginRedirectsForApiCalls helper

--- IdentityModel/Thinktecture.IdentityModel/Web/PassiveModuleConfiguration.cs
+++ IdentityModel/Thinktecture.IdentityModel/Web/PassiveModuleConfiguration.cs
@@ -8,6 +8,7 @@
 using System.Text;
 using System.Threading.Tasks;
 using System.Web;
+using System.Web.Mvc;

 namespace Thinktecture.IdentityModel.Web
 {
@@ -81,5 +82,32 @@
                     }
                 };
         }
+
+        private static string WebApiControllerName = "System.Web.Http.WebHost.HttpControllerHandler";
+
+        public static void SuppressLoginRedirectsForApiCalls()
+        {
+            var app = HttpContext.Current.ApplicationInstance;
+            app.PostMapRequestHandler +=
+                delegate
+                {
+                    var ctx = HttpContext.Current;
+                    var req = new HttpRequestWrapper(ctx.Request);
+                    var isApi = (req.IsAjaxRequest() ||
+                                 ctx.Handler.GetType().FullName == WebApiControllerName);
+                    ctx.Response.SuppressFormsAuthenticationRedirect = isApi;
+                };
+
+            var sam = FederatedAuthentication.WSFederationAuthenticationModule;
+            if (sam != null)
+            {
+                sam.AuthorizationFailed +=
+                    delegate(object sender, AuthorizationFailedEventArgs e)
+                    {
+                        var ctx = HttpContext.Current;
+                        e.RedirectToIdentityProvider = !ctx.Response.SuppressFormsAuthenticationRedirect;
+                    };
+            }
+        }
     }
 }


Modify deltablue to avoid gratuitous exception at runtime

--- tests/src/JIT/Performance/CodeQuality/V8/DeltaBlue/DeltaBlue.cs
+++ tests/src/JIT/Performance/CodeQuality/V8/DeltaBlue/DeltaBlue.cs
@@ -888,8 +888,8 @@
     public static int Main(String[] args)
     {
         deltablue d = new deltablue();
-        d.inst_main(args);
-        return 100;
+        bool result = d.inst_main(args);
+        return (result ? 100 : -1);
     }

     [Benchmark]
@@ -906,17 +906,22 @@
         }
     }

-    public void inst_main(String[] args)
+    public bool inst_main(String[] args)
     {
         int iterations = 200; // read iterations from arguments, walter 7/97
-        try
-        {   // read iterations from arguments, walter 7/97
-            iterations = Int32.Parse(args[0]);
-        }
-        catch (Exception)
-        {
-        }
+        if (args.Length > 0)
+        {
+            bool parsed = Int32.TryParse(args[0], out iterations);
+            if (!parsed)
+            {
+                Console.WriteLine("Error: expected iteration count, got '{0}'", args[0]);
+                return false;
+            }
+        }
+
         inst_inner(iterations, true);
+
+        return true;
     }

     public void inst_inner(int iterations, bool verbose)


fixed link to github as it cries about non-https

only one homepage apparantly as our org link was okay

--- src/htbox/Views/Shared/_Layout.cshtml
+++ src/htbox/Views/Shared/_Layout.cshtml
@@ -73,8 +73,8 @@

@CMS.FooterText()

-
Follow Humanitarian Toolbox on our Blog and at Twitter and GitHub.

-
Code for this website and our projects are hosted on Team Foundation Service and GitHub.

+
Follow Humanitarian Toolbox on our Blog and at Twitter and GitHub.

+
Code for this website and our projects are hosted on Team Foundation Service and GitHub.


Fixing property provider bug

Fixing property provider bug

As a result of the merge of 2.0 `AzureServiceBusQueueEndpointProvider` was passing through the `DefaultPropertyProvider<T>` instead of using `MessagePropertyProviderManager::GetMessagePropertyProviderFor`

--- Obvs.AzureServiceBus/Configuration/AzureServiceBusQueueEndpointProvider.cs
+++ Obvs.AzureServiceBus/Configuration/AzureServiceBusQueueEndpointProvider.cs
@@ -44,8 +44,8 @@
             return new ServiceEndpoint<TMessage, TCommand, TEvent, TRequest, TResponse>(
                new MessageSource<TRequest>(_messageClientEntityFactory.CreateMessageReceiver<TRequest>(), _deserializerFactory.Create<TRequest, TServiceMessage>(_assemblyFilter, _typeFilter)),
                new MessageSource<TCommand>(_messageClientEntityFactory.CreateMessageReceiver<TCommand>(), _deserializerFactory.Create<TCommand, TServiceMessage>(_assemblyFilter, _typeFilter)),
-               new MessagePublisher<TEvent>(_messageClientEntityFactory.CreateMessageSender<TEvent>(), _serializer, new DefaultPropertyProvider<TEvent>()),
-               new MessagePublisher<TResponse>(_messageClientEntityFactory.CreateMessageSender<TResponse>(), _serializer, new DefaultPropertyProvider<TResponse>()),
+               new MessagePublisher<TEvent>(_messageClientEntityFactory.CreateMessageSender<TEvent>(), _serializer, _messagePropertyProviderManager.GetMessagePropertyProviderFor<TEvent>()),
+               new MessagePublisher<TResponse>(_messageClientEntityFactory.CreateMessageSender<TResponse>(), _serializer, _messagePropertyProviderManager.GetMessagePropertyProviderFor<TResponse>()),
                typeof(TServiceMessage));
         }

@@ -55,8 +55,8 @@
             return new ServiceEndpointClient<TMessage, TCommand, TEvent, TRequest, TResponse>(
                new MessageSource<TEvent>(_messageClientEntityFactory.CreateMessageReceiver<TEvent>(), _deserializerFactory.Create<TEvent, TServiceMessage>(_assemblyFilter, _typeFilter)),
                new MessageSource<TResponse>(_messageClientEntityFactory.CreateMessageReceiver<TResponse>(), _deserializerFactory.Create<TResponse, TServiceMessage>(_assemblyFilter, _typeFilter)),
-               new MessagePublisher<TRequest>(_messageClientEntityFactory.CreateMessageSender<TRequest>(), _serializer, new DefaultPropertyProvider<TRequest>()),
-               new MessagePublisher<TCommand>(_messageClientEntityFactory.CreateMessageSender<TCommand>(), _serializer, new DefaultPropertyProvider<TCommand>()),
+               new MessagePublisher<TRequest>(_messageClientEntityFactory.CreateMessageSender<TRequest>(), _serializer, _messagePropertyProviderManager.GetMessagePropertyProviderFor<TRequest>()),
+               new MessagePublisher<TCommand>(_messageClientEntityFactory.CreateMessageSender<TCommand>(), _serializer, _messagePropertyProviderManager.GetMessagePropertyProviderFor<TCommand>()),
                typeof(TServiceMessage));
         }
     }


Removed unused usings

Removed unused usings

--- OfficeDevPnP.Core/OfficeDevPnP.Core/AppModelExtensions/TenantExtensions.cs
+++ OfficeDevPnP.Core/OfficeDevPnP.Core/AppModelExtensions/TenantExtensions.cs
@@ -1,6 +1,5 @@
 using Microsoft.Online.SharePoint.TenantAdministration;
 using Microsoft.Online.SharePoint.TenantManagement;
-using Microsoft.SharePoint.Client.UserProfiles;
 using OfficeDevPnP.Core;
 using OfficeDevPnP.Core.Entities;
 using OfficeDevPnP.Core.Utilities;
@@ -8,7 +7,6 @@
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Net;
-using System.Web.Profile;
 using System.Linq;

 namespace Microsoft.SharePoint.Client


Implemented drag and drop on dynamic bodies

--- tests/tests/classes/tests/Physics/PhysicsTest.cs
+++ tests/tests/classes/tests/Physics/PhysicsTest.cs
@@ -132,19 +132,88 @@
         public CCScene scene;

         CCTexture2D spriteTexture;
+        Dictionary<int, CCNode> mouses;

         protected override void AddedToScene()
         {
             base.AddedToScene();
+
+            mouses = new Dictionary<int, CCNode>();

             Scene.PhysicsWorld.DebugDrawMask = CCPhysicsWorld.DEBUGDRAW_SHAPE | CCPhysicsWorld.DEBUGDRAW_JOINT;
             //Scene.Position = Window.WindowSizeInPixels.Center;
             eTouch = new CCEventListenerTouchAllAtOnce();
+            eTouch.OnTouchesBegan = OnTouchesBegan;
+            eTouch.OnTouchesMoved = OnTouchesMoved;
             eTouch.OnTouchesEnded = OnTouchesEnded;
             AddEventListener(eTouch);

             eAccel = new CCEventListenerAccelerometer();
             eAccel.OnAccelerate = OnAccelerate;
+
+        }
+
+        public virtual void OnTouchesBegan(List<CCTouch> touches, CCEvent arg2)
+        {
+            CCTouch touch = touches.FirstOrDefault();
+            CCPoint location = touch.Location;
+
+            List<CCPhysicsShape> shapes = Scene.PhysicsWorld.GetShapes(location);
+
+
+            CCPhysicsBody body = null;
+
+            foreach (var obj in shapes)
+            {
+                if ((obj.Body.Tag & DRAG_BODYS_TAG) != 0)
+                {
+                    body = obj.Body;
+                    break;
+                }
+            }
+
+            if (body != null)
+            {
+                CCNode mouse = new CCNode();
+
+                mouse.PhysicsBody = new CCPhysicsBody();
+                mouse.PhysicsBody.SetDynamic(false);
+                mouse.Position = location;
+                AddChild(mouse);
+
+                CCPhysicsJointPin join = CCPhysicsJointPin.Construct(mouse.PhysicsBody, body, location);
+                join.SetMaxForce(5000 * body.GetMass());
+                Scene.PhysicsWorld.AddJoint(join);
+                mouses.Add(touch.Id, mouse);
+
+
+            }
+
+
+        }
+
+        public virtual void OnTouchesMoved(List<CCTouch> touches, CCEvent arg2)
+        {
+
+            var touch = touches.FirstOrDefault();
+            CCNode node;
+            if (mouses.TryGetValue(touch.Id, out node))
+            {
+                node.Position = touch.Location;
+            }
+
+        }
+
+        public virtual void OnTouchesEnded(List<CCTouch> touches, CCEvent e)
+        {
+            var touch = touches.FirstOrDefault();
+
+            CCNode it;
+            if (mouses.TryGetValue(touch.Id, out it))
+            {
+                RemoveChild(it);
+                mouses.Remove(touch.Id);
+            }

         }

@@ -163,11 +232,6 @@
             {
                 Scene.PhysicsWorld.Gravity = v;
             }
-        }
-
-        public virtual void OnTouchesEnded(List<CCTouch> touches, CCEvent e)
-        {
-
         }

         public CCSprite MakeBox(CCPoint point, CCSize size)


Fixed incorrect convention

Fixed incorrect convention

--- ShouldlyConvention.Tests/ShouldlyMethodsShouldHaveCustomMessageOverload.cs
+++ ShouldlyConvention.Tests/ShouldlyMethodsShouldHaveCustomMessageOverload.cs
@@ -31,7 +31,7 @@
         private bool HasNoCustomMessageOverload(IGrouping<string, MethodInfo> shouldlyMethod)
         {
             var hasFuncStringOverload = shouldlyMethod.Any(m => m.GetParameters().Any(IsCustomMessageParameter<Func<string>>));
-            var hasStringOverload = shouldlyMethod.Any(m => m.GetParameters().Any(IsCustomMessageParameter<Func<string>>));
+            var hasStringOverload = shouldlyMethod.Any(m => m.GetParameters().Any(IsCustomMessageParameter<string>));

             return !hasFuncStringOverload && !hasStringOverload;
         }


Minor changes.

Minor changes.

--- Source/Test/NProxy.Core.Test/Internal/Reflection/MemberTokenTestFixture.cs
+++ Source/Test/NProxy.Core.Test/Internal/Reflection/MemberTokenTestFixture.cs
@@ -36,10 +36,10 @@
             var secondMemberToken = new MemberToken(typeof (GenericReturnValue).GetMethod("GetHashCode"));

             // Act
-            var isEqual = firstMemberToken.Equals(secondMemberToken);
-
-            // Assert
-            Assert.That(isEqual, Is.True);
+            var equals = firstMemberToken.Equals(secondMemberToken);
+
+            // Assert
+            Assert.That(equals, Is.True);
         }

         [Test]
@@ -50,10 +50,10 @@
             var secondMemberToken = new MemberToken(typeof (GenericReturnValue).GetMethod("Equals", new[] {typeof (object)}));

             // Act
-            var isEqual = firstMemberToken.Equals(secondMemberToken);
-
-            // Assert
-            Assert.That(isEqual, Is.True);
+            var equals = firstMemberToken.Equals(secondMemberToken);
+
+            // Assert
+            Assert.That(equals, Is.True);
         }

         [Test]
@@ -64,10 +64,10 @@
             var secondMemberToken = new MemberToken(typeof (GenericReturnValue).GetMethod("ToString"));

             // Act
-            var isEqual = firstMemberToken.Equals(secondMemberToken);
-
-            // Assert
-            Assert.That(isEqual, Is.True);
+            var equals = firstMemberToken.Equals(secondMemberToken);
+
+            // Assert
+            Assert.That(equals, Is.True);
         }

         [Test]
@@ -78,10 +78,10 @@
             var secondMemberToken = new MemberToken(typeof (IGenericParameter).GetMethod("Method"));

             // Act
-            var isEqual = firstMemberToken.Equals(secondMemberToken);
-
-            // Assert
-            Assert.That(isEqual, Is.True);
+            var equals = firstMemberToken.Equals(secondMemberToken);
+
+            // Assert
+            Assert.That(equals, Is.True);
         }

         [Test]
@@ -92,10 +92,10 @@
             var secondMemberToken = new MemberToken(typeof (IGenericReturnValue).GetMethod("Method"));

             // Act
-            var isEqual = firstMemberToken.Equals(secondMemberToken);
-
-            // Assert
-            Assert.That(isEqual, Is.True);
+            var equals = firstMemberToken.Equals(secondMemberToken);
+
+            // Assert
+            Assert.That(equals, Is.True);
         }

         [Test]
@@ -106,10 +106,10 @@
             var secondMemberToken = new MemberToken(typeof (IGenericEvent<string>).GetMethod("add_Event"));

             // Act
-            var isEqual = firstMemberToken.Equals(secondMemberToken);
-
-            // Assert
-            Assert.That(isEqual, Is.False);
+            var equals = firstMemberToken.Equals(secondMemberToken);
+
+            // Assert
+            Assert.That(equals, Is.False);
         }

         [Test]
@@ -120,10 +120,10 @@
             var secondMemberToken = new MemberToken(typeof (IGenericProperty<string>).GetMethod("get_Property"));

             // Act
-            var isEqual = firstMemberToken.Equals(secondMemberToken);
-
-            // Assert
-            Assert.That(isEqual, Is.False);
+            var equals = firstMemberToken.Equals(secondMemberToken);
+
+            // Assert
+            Assert.That(equals, Is.False);
         }

         [Test]
@@ -134,10 +134,10 @@
             var secondMemberToken = new MemberToken(typeof (IGenericMethod<string>).GetMethod("Method"));

             // Act
-            var isEqual = firstMemberToken.Equals(secondMemberToken);
-
-            // Assert
-            Assert.That(isEqual, Is.False);
+            var equals = firstMemberToken.Equals(secondMemberToken);
+
+            // Assert
+            Assert.That(equals, Is.False);
         }

         [Test]
@@ -191,10 +191,10 @@

                         // Act
                         // Implicitly check equality.
-                        var isEqual = !memberTokens.Add(memberToken);
+                        var equals = !memberTokens.Add(memberToken);

                         // Assert
-                        Assert.That(isEqual, Is.False);
+                        Assert.That(equals, Is.False);
                     }
                 }
             }


Fix ambiguous ctrs. Named binding now requires you to specify either type and scope, or scope along with name, due to ambiguity with object naming

--- StrangeIoC/scripts/strange/extensions/implicitBind/ImplementorAttribute.cs
+++ StrangeIoC/scripts/strange/extensions/implicitBind/ImplementorAttribute.cs
@@ -28,26 +28,49 @@
                 Inherited = true)]
 public class Implements: Attribute
 {
+    /// <summary>
+    /// Concretely bind to own type
+    /// </summary>
     public Implements() {  }
-    public Implements(object name) { Name = name; }
+
+    /// <summary>
+    /// Concretely bind to own type and specify scope
+    /// </summary>
+    /// <param name="scope"></param>
+    public Implements(InjectionBindingScope scope) { Scope = scope; }
+
+    /// <summary>
+    /// Bind to an interface, specify the scope if necessary
+    /// </summary>
+    /// <param name="t">Interface to bind to</param>
+    /// <param name="scope">Single Context(default) or Cross Context.</param>
     public Implements(Type t, InjectionBindingScope scope = InjectionBindingScope.SINGLE_CONTEXT)
     {
         DefaultInterface = t;
         Scope = scope;
     }

-    public Implements(Type t, object name, InjectionBindingScope scope = InjectionBindingScope.SINGLE_CONTEXT)
+    /// <summary>
+    /// Bind concretely, specifying a scope and object name
+    /// </summary>
+    /// <param name="scope"></param>
+    /// <param name="name"></param>
+    public Implements(InjectionBindingScope scope, object name)
+    {
+        Scope = scope;
+        Name = name;
+    }
+    /// <summary>
+    /// Bind to an interface, specifying a scope and object name
+    /// </summary>
+    /// <param name="t">Interface to bind to</param>
+    /// <param name="scope">Single Context or Cross Context</param>
+    /// <param name="name">Name to bind to</param>
+    public Implements(Type t, InjectionBindingScope scope, object name)
     {
         DefaultInterface = t;
         Name = name;
         Scope = scope;
-    }
-
-    public Implements(InjectionBindingScope scope) { Scope = scope; }
-    public Implements(InjectionBindingScope scope, object name)
-    {
-        Scope = scope;
-        Name = name;
     }

 	public object Name {get; set;}
@@ -64,6 +87,11 @@
                 Inherited = true)]
 public class ImplementedBy : Attribute
 {
+    /// <summary>
+    /// Bind this interface to a default type t
+    /// </summary>
+    /// <param name="t">Default Type</param>
+    /// <param name="scope">Single Context(default) or Cross Context</param>
     public ImplementedBy(Type t, InjectionBindingScope scope = InjectionBindingScope.SINGLE_CONTEXT)
     {
         DefaultType = t;
@@ -82,6 +110,10 @@
                 Inherited = true)]
 public class MediatedBy : Attribute
 {
+    /// <summary>
+    /// Bind this view to a Mediator
+    /// </summary>
+    /// <param name="t">Mediator Type</param>
     public MediatedBy(Type t) { MediatorType = t; }

     public Type MediatorType { get; set; }
@@ -95,6 +127,10 @@
                 Inherited = true)]
 public class Mediates : Attribute
 {
+    /// <summary>
+    /// Bind this Mediator to a view
+    /// </summary>
+    /// <param name="t">View Type</param>
     public Mediates(Type t) { ViewType = t; }

     public Type ViewType { get; set; }


Closes #1350 - probleem als geen nieuwe gebruikersnaam gemaakt kan wrdn.

Als combinatie voornaam-familienaam al bestaat, dan plakken we gewoon een
getal achter de voornaam.

Hetzelfde voor bestaande logins. Als Barts truc (minder letters van de
familienaam, meer van de voornaam) niet meer werkt, dan proberen we ook
met cijfers.

Nadeel: Hoe meer dubbels, hoe langer het duurt vooraleer een nieuwe login
gevonden. Dit kan waarschijnlijk wel performanter.

--- tools/LoginService/Chiro.Ad.Domain/Chirologin.cs
+++ tools/LoginService/Chiro.Ad.Domain/Chirologin.cs
@@ -225,18 +225,41 @@

             if (_gebruiker == null)
             {
-
-
-                for (int i = 0; i < 4; i++)
-                {
-                    string login = LoginSuggereren(voornaam, familienaam, familienaamSeed - i, voornaamSeed + i);
-
-                    // Controleer of er nog geen account bestaat met die login
-                    // Als we niets vinden, kunnen we hiermee verder.
-                    if (LdapHelper.ZoekenUniek(Domein, string.Concat("sAMAccountName=", login)) == null)
+                // Er bestaat nog geen gebruiker. Nu moeten we nakijken of er al een andere gebruiker bestaat met dezelfde
+                // naam, want daar kan Active Directory niet mee lachen. In dat laatste geval foefelen we wat, tot we toch
+                // verder kunnen. (foefelen in de zin van cijfers aan de voornaam plakken)
+
+                int teller = 0;
+                string oorspronkelijkeVoornaam = voornaam;
+
+                while (
+                    LdapHelper.ZoekenUniek(Domein, string.Format("(&(givenName={0})(sn={1}))", voornaam, familienaam)) !=
+                    null)
+                {
+                    voornaam = String.Format("{0}{1}", oorspronkelijkeVoornaam, ++teller);
+                }
+
+                // Dan zou het nog kunnen dat we ergens een dubbele login hebben, en dat kan ook niet. Bart had hiervoor
+                // al een truuk, namelijk minder letters gebruiken van de familienaam, en meer van de voornaam. Maar voor het
+                // geval dat niet moest volstaan, plakken we daar ook een nummer achter
+
+                int teller2 = 0;
+                bool accountGemaakt = false;
+
+                while (!accountGemaakt)
+                {
+                    for (int i = 0; !accountGemaakt && i < 4; i++)
                     {
-                        // Tweede controle: bestaat er al iemand met die naam? Kan anders namelijk niet toegevoegd worden.
-                        if (LdapHelper.ZoekenUniek(Domein, string.Format("(&(givenName={0})(sn={1}))", voornaam, familienaam)) == null)
+                        string login = LoginSuggereren(voornaam, familienaam, familienaamSeed - i, voornaamSeed + i);
+
+                        if (teller2 > 0)
+                        {
+                            login = String.Format("{0}{1}", login, teller2);
+                        }
+
+                        // Controleer of er nog geen account bestaat met die login
+                        // Als we niets vinden, kunnen we hiermee verder.
+                        if (LdapHelper.ZoekenUniek(Domein, string.Concat("sAMAccountName=", login)) == null)
                         {
                             // Zoek de 'organisational unit' op waar de account in terecht moet komen en zet de account erin.
                             ou = new DirectoryEntry(Domein + ouPad);
@@ -256,19 +279,10 @@
                             _gebruiker.Properties["description"].Value = _gebruiker.Path;

                             Opslaan();
-                            break;
-                        }
-                        else
-                        {
-                            throw new ArgumentException("We hebben al een account voor iemand met dezelfde naam");
+                            accountGemaakt = true;
                         }
                     }
-                    else if (i == 3)
-                    {
-                        // We vinden iemand, maar het is iemand anders, en we zitten in de laatste loop.
-                        throw new InvalidOperationException(
-                            "We kunnen die persoon geen login meer geven met de automatische procedure. Neem contact op met het nationaal secretariaat voor manuele verwerking.");
-                    }
+                    ++teller2;
                 }
             }
         }


Update help message for Web Design

Update help message for Web Design

- Web Design now includes !clarify in help message (Needs to be manually updated, still)

--- TwitchPlaysAssembly/Src/ComponentSolvers/Helpers/ComponentSolverFactory.cs
+++ TwitchPlaysAssembly/Src/ComponentSolvers/Helpers/ComponentSolverFactory.cs
@@ -308,7 +308,7 @@
 		ModComponentSolverInformation["TheBulbModule"] = new ModuleInformation { moduleScore = 7, helpText = "Press O with !{0} press O. Press I with !{0} press I. Unscrew the bulb with !{0} unscrew. Screw in the bulb with !{0} screw.", DoesTheRightThing = false };
 		ModComponentSolverInformation["TheClockModule"] = new ModuleInformation { moduleScore = 9, helpText = "Submit a time with !{0} set 12:34 am. Command must include a 12-hour time followed by AM/PM.", DoesTheRightThing = true };
 		ModComponentSolverInformation["TheGamepadModule"] = new ModuleInformation { moduleScore = 9 };
-		ModComponentSolverInformation["webDesign"] = new ModuleInformation { moduleScore = 9, helpText = "Accept the design with !{0} acc. Consider the design with !{0} con. Reject the design with !{0} reject." };
+		ModComponentSolverInformation["webDesign"] = new ModuleInformation { moduleScore = 9, helpText = "Accept the design with !{0} acc. Consider the design with !{0} con. Reject the design with !{0} reject. Make the text bigger with !{0} clarify" };
 		ModComponentSolverInformation["WirePlacementModule"] = new ModuleInformation { moduleScore = 6, helpText = "Cut the correct wires with !{0} cut A2 B4 D3." };
 		ModComponentSolverInformation["WordSearchModule"] = new ModuleInformation { moduleScore = 6, helpText = "Select the word starting at column B row 3, and ending at column C row 4, with !{0} select B3 C4.", DoesTheRightThing = false };
 		ModComponentSolverInformation["XRayModule"] = new ModuleInformation { moduleScore = 12 };


Update tools/LuminoBuild/Tasks/BuildExternalProjects.cs

--- tools/LuminoBuild/Tasks/BuildExternalProjects.cs
+++ tools/LuminoBuild/Tasks/BuildExternalProjects.cs
@@ -125,8 +125,8 @@
             }
             if (!Directory.Exists("libpng"))
             {
-                Utils.CallProcess("git", "clone --progress --depth 1 -b v1.6.9 git://git.code.sf.net/p/libpng/code libpng");
-                //Utils.CallProcess("git", "clone --progress --depth 1 -b libpng17 https://github.com/glennrp/libpng.git libpng");
+                //Utils.CallProcess("git", "clone --progress --depth 1 -b v1.6.9 git://git.code.sf.net/p/libpng/code libpng");
+                Utils.CallProcess("git", "clone --progress --depth 1 -b libpng17 https://github.com/glennrp/libpng.git libpng");

 #if false
                 var zip = Path.Combine(reposDir, "lpng1635.zip");


Fix APC Powered Device Hook

Fix APC Powered Device Hook

--- UnityProject/Assets/Scripts/Electricity/PoweredDevices/APCPoweredDevice.cs
+++ UnityProject/Assets/Scripts/Electricity/PoweredDevices/APCPoweredDevice.cs
@@ -109,10 +109,10 @@
 		{
 			Logger.LogTraceFormat("{0}({1}) state changing {2} to {3}", Category.Electrical, name, transform.position.To2Int(), State, _State);
 		}
-
+
 		if (Powered != null)
 		{
-			Powered.StateUpdate(State);
+			Powered.StateUpdate(_State);
 		}
 	}
 }


Made the NSubstitute assert specifically check for the thrown DivideByZeroException instead of any odd exception.

--- src/tests/SharpRaven.Nancy.WebTest/NancyTests.cs
+++ src/tests/SharpRaven.Nancy.WebTest/NancyTests.cs
@@ -56,15 +56,18 @@
                     container.AutoRegister(new[] { typeof(SentryRequestStartup).Assembly }, type => true);
                 });
             });
-
-
+
             TestDelegate throwing = () => browser.Post("/");

             var exception = Assert.Throws<Exception>(throwing);
             Assert.That(exception.InnerException, Is.Not.Null);
-            Assert.That(exception.InnerException.Message, Is.StringContaining("Oh noes!"));
+
+            var divideByZeroException = exception.InnerException.InnerException;

-            ravenClient.Received(1).CaptureException(Arg.Any<Exception>());
+            Assert.That(divideByZeroException, Is.Not.Null);
+            Assert.That(divideByZeroException, Is.TypeOf<DivideByZeroException>());
+
+            ravenClient.Received(1).CaptureException(divideByZeroException);
         }
     }
 }


9660.1: ctor

9660.1: ctor

--- a_mini/projects/PixelFarm/Typography/Typography.GlyphLayout/GlyphLayout.cs
+++ a_mini/projects/PixelFarm/Typography/Typography.GlyphLayout/GlyphLayout.cs
@@ -203,8 +203,7 @@
                 //this is original value WITHOUT fit-to-grid adjust
                 _glyphPositions.Add(new GlyphPos(
                     glyIndex,
-                    orgGlyph,
-                    typeface.GetHAdvanceWidthFromGlyphIndex(glyIndex))
+                    orgGlyph)
                    );
             }
             PositionTechnique posTech = this.PositionTechnique;


delete useless comment

delete useless comment

--- fluent/src/Cake.Storm.Fluent.iOS/Models/PListTransformation.cs
+++ fluent/src/Cake.Storm.Fluent.iOS/Models/PListTransformation.cs
@@ -115,7 +115,6 @@

 			UpdateUrlSchemes(configuration, document);

-			//if bundle name is null we do not modify plist value
 			if (_isBundleNameSet)
 			{
 				GetValueElementForKey(document, BUNDLE_DISPLAY_NAME)?.SetValue(_bundleName);
@@ -195,4 +194,4 @@
 			return null;
 		}
 	}
-}+}


Fix UnitOfWorkRegistrar interception logic

--- src/Abp/Domain/Uow/UnitOfWorkRegistrar.cs
+++ src/Abp/Domain/Uow/UnitOfWorkRegistrar.cs
@@ -2,7 +2,6 @@
 using System.Reflection;
 using Abp.Dependency;
 using Castle.Core;
-using Castle.MicroKernel;

 namespace Abp.Domain.Uow
 {
@@ -21,39 +20,30 @@
             {
                 var implementationType = handler.ComponentModel.Implementation.GetTypeInfo();

-                // TODO: This might cause double interception ???
-
-                HandleTypesWithUnitOfWorkAttribute(implementationType, handler);
-                HandleConventionalUnitOfWorkTypes(iocManager, implementationType, handler);
+                if (ShouldIntercept(iocManager, implementationType))
+                {
+                    handler.ComponentModel.Interceptors.Add(
+                        new InterceptorReference(typeof(AbpAsyncDeterminationInterceptor<UnitOfWorkInterceptor>))
+                    );
+                }
             };
         }

-        private static void HandleTypesWithUnitOfWorkAttribute(TypeInfo implementationType, IHandler handler)
+        private static bool ShouldIntercept(IIocManager iocManager, TypeInfo implementationType)
         {
             if (IsUnitOfWorkType(implementationType) || AnyMethodHasUnitOfWork(implementationType))
             {
-                handler.ComponentModel.Interceptors.Add(
-                    new InterceptorReference(typeof(AbpAsyncDeterminationInterceptor<UnitOfWorkInterceptor>))
-                );
+                return true;
             }
-        }
-
-        private static void HandleConventionalUnitOfWorkTypes(IIocManager iocManager, TypeInfo implementationType,
-            IHandler handler)
-        {
+
             if (!iocManager.IsRegistered<IUnitOfWorkDefaultOptions>())
             {
-                return;
+                return false;
             }

             var uowOptions = iocManager.Resolve<IUnitOfWorkDefaultOptions>();

-            if (uowOptions.IsConventionalUowClass(implementationType.AsType()))
-            {
-                handler.ComponentModel.Interceptors.Add(
-                    new InterceptorReference(typeof(AbpAsyncDeterminationInterceptor<UnitOfWorkInterceptor>))
-                );
-            }
+            return uowOptions.IsConventionalUowClass(implementationType.AsType());
         }

         private static bool IsUnitOfWorkType(TypeInfo implementationType)


CodeDom: Missed some spaces vs. tabs replacements...

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

--- src/DbMetal/Generator/CodeDomGenerator.cs
+++ src/DbMetal/Generator/CodeDomGenerator.cs
@@ -388,12 +388,12 @@
             if (Provider is CSharpCodeProvider)
             {
                 startIf = string.Format("Start {0}{1}#if {0}{1}", condition, Environment.NewLine);
-                elseIf  = string.Format("End {0}{1}    #endregion{1}#else     // {0}", condition, Environment.NewLine);
+                elseIf  = string.Format("End {0}{1}\t#endregion{1}#else     // {0}", condition, Environment.NewLine);
             }
             if (Provider is VBCodeProvider)
             {
                 startIf = string.Format("Start {0}\"{1}#If {0} Then{1}    '", condition, Environment.NewLine);
-                elseIf  = string.Format("End {0}\"{1}    #End Region{1}#Else     ' {0}", condition, Environment.NewLine);
+                elseIf  = string.Format("End {0}\"{1}\t#End Region{1}#Else     ' {0}", condition, Environment.NewLine);
             }
             if (startIf != null && elseIf != null)
             {
@@ -407,11 +407,11 @@
             string endIf = null;
             if (Provider is CSharpCodeProvider)
             {
-                endIf   = string.Format("End Not {0}{1}    #endregion{1}#endif     // {0}", condition, Environment.NewLine);
+                endIf   = string.Format("End Not {0}{1}\t#endregion{1}#endif     // {0}", condition, Environment.NewLine);
             }
             if (Provider is VBCodeProvider)
             {
-                endIf   = string.Format("End Not {0}\"{1}    #End Region{1}#End If     ' {0}", condition, Environment.NewLine);
+                endIf   = string.Format("End Not {0}\"{1}\t#End Region{1}#End If     ' {0}", condition, Environment.NewLine);
             }
             if (endIf != null)
             {


Removed whitespace

Removed whitespace

--- src/Dotnet.Script.Core/ScriptPublisher.cs
+++ src/Dotnet.Script.Core/ScriptPublisher.cs
@@ -38,7 +38,7 @@
         }

         public void CreateAssembly<TReturn, THost>(ScriptContext context, LogFactory logFactory, string assemblyFileName = null)
-        {
+        {
             Directory.CreateDirectory(context.WorkingDirectory);
             Directory.CreateDirectory(Path.Combine(context.WorkingDirectory, "obj"));

@@ -78,7 +78,7 @@
             CopyProgramTemplate(tempProjectDirecory);

             var commandRunner = new CommandRunner(logFactory);
-            // todo: may want to add ability to return dotnet.exe errors
+            // todo: may want to add ability to return dotnet.exe errors
             var exitcode = commandRunner.Execute("dotnet", $"publish \"{tempProjectPath}\" -c Release -r {runtimeIdentifier} -o {context.WorkingDirectory}");
             if (exitcode != 0) throw new Exception($"dotnet publish failed with result '{exitcode}'");
             _scriptConsole.Out.WriteLine($"Published {context.FilePath} (executable) to {context.WorkingDirectory}");
@@ -94,7 +94,7 @@
                     throw new CompilationErrorException("One or more errors occurred when emitting the assembly", emitResult.Diagnostics);
                 }

-                var assemblyPath = Path.Combine(outputDirectory, $"{assemblyFileName}.dll");
+                var assemblyPath = Path.Combine(outputDirectory, $"{assemblyFileName}.dll");
                 using (var peFileStream = new FileStream(assemblyPath, FileMode.Create))
                 using (emitResult.PeStream)
                 {


build: addresses some code-analysis warnings.

--- src/Experiment.Idioms/IdiomaticMembers.cs
+++ src/Experiment.Idioms/IdiomaticMembers.cs
@@ -11,6 +11,7 @@
     /// Represents members of a certain <see cref="Type"/> which will be
     /// verified by idiomatic assertions.
     /// </summary>
+    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "The main responsibility of this class isn't to be a 'collection' (which, by the way, it isn't - it's just an Iterator).")]
     public class IdiomaticMembers : IEnumerable<MemberInfo>
     {
         private const BindingFlags _bindingFlags =
@@ -46,6 +47,7 @@
         /// <summary>
         /// Gets a value indicating the type to enumerate members.
         /// </summary>
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "This name is desirable to indicate the target type.")]
         public Type Type
         {
             get


Allow backslashes in attribute values for regex validation

--- src/Facility.Definition/Fsd/FsdParsers.cs
+++ src/Facility.Definition/Fsd/FsdParsers.cs
@@ -40,7 +40,7 @@
 			parser.Bracketed(PunctuationParser(openBracket), PunctuationParser(closeBracket));

 		private static IParser<Match> AttributeParameterValueParser { get; } =
-			Parser.Regex(@"""(([^""\\]+|\\[""\\/bfnrt]|\\u[0-9a-fA-f]{4})*)""|([0-9a-zA-Z.+_-]+)");
+			Parser.Regex(@"""(([^""]+|\\[""\\/bfnrt]|\\u[0-9a-fA-f]{4})*)""|([0-9a-zA-Z.+_-]+)");

 		private static IParser<ServiceAttributeParameterInfo> AttributeParameterParser(Context context) =>
 			from name in NameParser.Named("parameter name")


Added ScrollPatternConstants with NoScroll which can be used in SetScrollPercent

--- src/FlaUI.Core/Patterns/IScrollPattern.cs
+++ src/FlaUI.Core/Patterns/IScrollPattern.cs
@@ -4,6 +4,11 @@

 namespace FlaUI.Core.Patterns
 {
+    public class ScrollPatternConstants
+    {
+        public const double NoScroll = -1.0;
+    }
+
     public interface IScrollPattern : IPatternWithInformation<IScrollPatternInformation>
     {
         IScrollPatternProperties Properties { get; }


Add missing XML comment.

Add missing XML comment.

--- src/Humanizer/Inflections/Vocabularies.cs
+++ src/Humanizer/Inflections/Vocabularies.cs
@@ -1,5 +1,8 @@
 namespace Humanizer.Inflections
 {
+    /// <summary>
+    /// Container for registered Vocabularies.  At present, only a single vocabulary is supported: Default.
+    /// </summary>
     public class Vocabularies
     {
         private static Vocabulary _default;


GitHubSync update

GitHubSync update

--- deployment/cake/apps-wpf-tasks.cake
+++ deployment/cake/apps-wpf-tasks.cake
@@ -251,26 +251,12 @@
             // Note: we need to set OverridableOutputPath because we need to be able to respect
             // AppendTargetFrameworkToOutputPath which isn't possible for global properties (which
             // are properties passed in using the command line)
-            var outputDirectory = string.Format("{0}/{1}/", BuildContext.General.OutputRootDirectory, wpfApp);
+            var outputDirectory = GetProjectOutputDirectory(BuildContext, wpfApp);
             CakeContext.Information("Output directory: '{0}'", outputDirectory);
             msBuildSettings.WithProperty("OverridableOutputPath", outputDirectory);
             msBuildSettings.WithProperty("PackageOutputPath", BuildContext.General.OutputRootDirectory);

             CakeContext.MSBuild(projectFileName, msBuildSettings);
-
-            CakeContext.Information("Deleting unnecessary files for WPF app '{0}'", wpfApp);
-
-            var extensionsToDelete = new [] { ".pdb", ".RoslynCA.json" };
-
-            foreach (var extensionToDelete in extensionsToDelete)
-            {
-                var searchPattern = string.Format("{0}**/*{1}", outputDirectory, extensionToDelete);
-                var filesToDelete = CakeContext.GetFiles(searchPattern);
-
-                CakeContext.Information("Deleting '{0}' files using search pattern '{1}'", filesToDelete.Count, searchPattern);
-
-                CakeContext.DeleteFiles(filesToDelete);
-            }
         }
     }

@@ -315,6 +301,21 @@

         foreach (var wpfApp in BuildContext.Wpf.Items)
         {
+            CakeContext.Information("Deleting unnecessary files for WPF app '{0}'", wpfApp);
+
+            var outputDirectory = GetProjectOutputDirectory(BuildContext, wpfApp);
+            var extensionsToDelete = new [] { ".pdb", ".RoslynCA.json" };
+
+            foreach (var extensionToDelete in extensionsToDelete)
+            {
+                var searchPattern = string.Format("{0}**/*{1}", outputDirectory, extensionToDelete);
+                var filesToDelete = CakeContext.GetFiles(searchPattern);
+
+                CakeContext.Information("Deleting '{0}' files using search pattern '{1}'", filesToDelete.Count, searchPattern);
+
+                CakeContext.DeleteFiles(filesToDelete);
+            }
+
             foreach (var channel in channels)
             {
                 CakeContext.Information("Packaging WPF app '{0}' for channel '{1}'", wpfApp, channel);


fixed unit test bug

fixed unit test bug

--- test/Luno.Test.LunoClient/Models/Test/Profile.cs
+++ test/Luno.Test.LunoClient/Models/Test/Profile.cs
@@ -4,13 +4,13 @@
 {
 	public class Profile
 	{
-		[JsonProperty("field_1", NullValueHandling = NullValueHandling.Ignore)]
+		[JsonProperty("field_1")]
 		public string Field1 { get; set; }

-		[JsonProperty("field_2", NullValueHandling = NullValueHandling.Ignore)]
+		[JsonProperty("field_2")]
 		public string Field2 { get; set; }

-		[JsonProperty("field_3", NullValueHandling = NullValueHandling.Ignore)]
+		[JsonProperty("field_3")]
 		public string Field3 { get; set; }
 	}
 }


fix csharp test

fix csharp test

--- tests/Persimmon.Dried.CSharp.Tests/CSharpTest.cs
+++ tests/Persimmon.Dried.CSharp.Tests/CSharpTest.cs
@@ -8,13 +8,13 @@

 namespace Persimmon.Dried.CSharp.Tests
 {
-    public class CSharpTest
+    public static class CSharpTest
     {
-        public TestCase<Unit> syntaxCheck()
+        public static TestCase<Unit> syntaxCheck()
         {
             return Property.Default
                 .Add(Syntax.Prop.ForAll(Arb.Int, i =>
-                    (new Lazy<bool>(() => (i + 1) % 2 != 0)).When(i % 2 == 9)));
+                    (new Lazy<bool>(() => (i + 1) % 2 != 0)).When(i % 2 == 0)));
         }
     }
 }


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Net/HttpListenerRequest.cs
+++ websocket-sharp/Net/HttpListenerRequest.cs
@@ -723,9 +723,16 @@
       }

       if (_httpMethod == "POST" || _httpMethod == "PUT") {
-        if (_contentLength <= 0 && !_chunked) {
+        if (_contentLength == -1 && !_chunked) {
           _context.ErrorStatusCode = 411;
-          _context.ErrorMessage = "Valid Content-Length header required";
+          _context.ErrorMessage = "Content-Length header required";
+
+          return;
+        }
+
+        if (_contentLength == 0 && !_chunked) {
+          _context.ErrorStatusCode = 411;
+          _context.ErrorMessage = "Invalid Content-Length header";

           return;
         }


[Modify] Remove it

[Modify] Remove it

--- websocket-sharp/Net/WebHeaderCollection.cs
+++ websocket-sharp/Net/WebHeaderCollection.cs
@@ -797,23 +797,6 @@
       }
     }

-    private void checkAllowed (string name)
-    {
-      if (_state == HttpHeaderType.Unspecified)
-        return;
-
-      var headerType = getHeaderType (name);
-
-      if (headerType == HttpHeaderType.Unspecified)
-        return;
-
-      if (headerType != _state) {
-        var msg = "This instance does not allow the header.";
-
-        throw new InvalidOperationException (msg);
-      }
-    }
-
     private static string checkName (string name)
     {
       if (name == null)


Implement constants

Implement constants

--- windows/RNDeviceInfo/RNDeviceInfoModule.cs
+++ windows/RNDeviceInfo/RNDeviceInfoModule.cs
@@ -9,6 +9,7 @@
 using Windows.Networking;
 using Windows.Networking.Connectivity;
 using System.Linq;
+using Newtonsoft.Json.Linq;

 namespace RNDeviceInfo
 {
@@ -24,6 +25,26 @@
             get
             {
                 return "RNDeviceInfo";
+            }
+        }
+
+        public override JObject ModuleConstants
+        {
+            get
+            {
+                return new JObject
+                {
+                    { "uniqueId", getUniqueIdSync() },
+                    { "deviceId", getDeviceIdSync() },
+                    { "bundleId", getBundleIdSync() },
+                    { "systemVersion", getSystemVersionSync() },
+                    { "appVersion", getAppVersionSync() },
+                    { "buildNumber", getBuildNumberSync() },
+                    { "isTablet", isTabletSync() },
+                    { "appName", getAppNameSync() },
+                    { "brand", getBrandSync() },
+                    { "model", getModelSync() },
+                };
             }
         }