Datacache compare

Datacache compare

Can't use hashcode, so just checking if updatedate has changed since we
loaded it into our cache.

--- Jumoo.uSync.Core/Serializers/DataTypeSerializer.cs
+++ Jumoo.uSync.Core/Serializers/DataTypeSerializer.cs
@@ -309,7 +309,6 @@
                 }

                 node.Add(SerializePreValues(item, node));
-
                 UpdateDataTypeCache(item);

                 return SyncAttempt<XElement>.Succeed(item.Name, node, typeof(IDataTypeDefinition), ChangeType.Export);
@@ -441,7 +440,7 @@
                 {
                     var i = _dtdCache.FindIndex(x => x.Key == item.Key);

-                    if (_dtdCache[i].GetHashCode() != item.GetHashCode())
+                    if (_dtdCache[i].UpdateDate != item.UpdateDate)
                     {
                         _dtdCache[i] = item;
                     }


Fix for null reference exception in search

--- KryptPadWebApp/Controllers/ProfileApiController.cs
+++ KryptPadWebApp/Controllers/ProfileApiController.cs
@@ -471,7 +471,7 @@
         /// <returns></returns>
         [HttpPost]
         [Route("{id}/search")]
-        public IHttpActionResult GetItems(int id, [FromBody]string q)
+        public IHttpActionResult Search(int id, [FromBody]string q)
         {
             using (var ctx = new ApplicationDbContext())
             {
@@ -489,9 +489,9 @@
                     category.Items = (from i in category.Items
                                       where q == null
                                          || (
-                                             Encryption.DecryptFromString(i.Name, Passphrase).IndexOf(q, StringComparison.CurrentCultureIgnoreCase) >= 0
-                                             || (i.Notes != null && Encryption.DecryptFromString(i.Notes, Passphrase).IndexOf(q, StringComparison.CurrentCultureIgnoreCase) >= 0)
-                                             || i.Fields.Any(f => Encryption.DecryptFromString(f.Value, Passphrase).IndexOf(q, StringComparison.CurrentCultureIgnoreCase) >= 0)
+                                              (i.Name != null && Encryption.DecryptFromString(i.Name, Passphrase)?.IndexOf(q, StringComparison.CurrentCultureIgnoreCase) >= 0)
+                                             || (i.Notes != null && Encryption.DecryptFromString(i.Notes, Passphrase)?.IndexOf(q, StringComparison.CurrentCultureIgnoreCase) >= 0)
+                                             || (i.Fields != null && i.Fields.Any(f => f.Value != null && Encryption.DecryptFromString(f.Value, Passphrase)?.IndexOf(q, StringComparison.CurrentCultureIgnoreCase) >= 0))
                                       )
                                       select i).ToList();


Minor styling fix

Minor styling fix

--- src/MagicChunks/Helpers/XmlExtensions.cs
+++ src/MagicChunks/Helpers/XmlExtensions.cs
@@ -43,7 +43,7 @@
                 result = XName.Get(name, defaultNamespace);
             else
             {
-                var attributeNameParts = name.Split(':');
+                var attributeNameParts = name.Split(':');
                 var attributeNamespace = element.GetNamespaceOfPrefix(attributeNameParts[0]);
                 if (attributeNamespace != null)
                     result = XName.Get(attributeNameParts[1], attributeNamespace.NamespaceName);


fixed quotes bug in IniSettings class

fixed quotes bug in IniSettings class

--- phoenix/IniSettings.cs
+++ phoenix/IniSettings.cs
@@ -62,7 +62,13 @@
             if (!m_Settings.ContainsKey(Section))
                 m_Settings[Section] = new Dictionary<string, string>();

-            m_Settings[Section][Key] = value.ToString();
+            string to_be_stored = value.ToString();
+
+            // http://www.askingbox.com/question/windows-api-getprofilestring-and-getprivateprofilestring-clears-quotes
+            if (to_be_stored.StartsWith("\"") && to_be_stored.EndsWith("\""))
+                to_be_stored = string.Format("\"{0}\"", to_be_stored);
+
+            m_Settings[Section][Key] = to_be_stored;
         }

         /// <summary>


Use var instead.

Use var instead.

--- src/Magick.NET/Defines/DefinesCreator.cs
+++ src/Magick.NET/Defines/DefinesCreator.cs
@@ -111,7 +111,7 @@
                 return null;

             var values = new List<string>();
-            foreach (T val in value)
+            foreach (var val in value)
             {
                 if (val != null)
                     values.Add(val.ToString());


Remove unused enum

Remove unused enum

--- MCD.Interfaces/MTGColor.cs
+++ MCD.Interfaces/MTGColor.cs
@@ -1,12 +0,0 @@
-namespace MCD.Interfaces
-{
-    public enum MTGColor
-    {
-        Colorless,
-        Red,
-        Green,
-        Blue,
-        White,
-        Black
-    }
-}


Simplify

Simplify

--- MatterControl.Printing/Settings/PrinterSettings.cs
+++ MatterControl.Printing/Settings/PrinterSettings.cs
@@ -90,25 +90,13 @@

 		static PrinterSettings()
 		{
-			// Load settings
-			PrinterSettings.SettingsData = LoadAllSettings();
+			// Convert settings array into dictionary on initial load using settings key (SlicerConfigName)
+			PrinterSettings.SettingsData = SliceSettingsFields.AllSettings().ToDictionary(s => s.SlicerConfigName);

 			PrinterSettings.Layout = new SettingsLayout();

 			Empty = new PrinterSettings() { ID = "EmptyProfile" };
 			Empty.UserLayer[SettingsKey.printer_name] = "Empty Printer";
-		}
-
-		private static Dictionary<string, SliceSettingData> LoadAllSettings()
-		{
-			var settings = new Dictionary<string, SliceSettingData>();
-
-			foreach (var settingsData in SliceSettingsFields.AllSettings())
-			{
-				settings.Add(settingsData.SlicerConfigName, settingsData);
-			}
-
-			return settings;
 		}

 		//static SettingsOrganizerValidateAgainstJson()


logging

logging

--- Microphone.Core/ClusterProviders/ConsulProvider.cs
+++ Microphone.Core/ClusterProviders/ConsulProvider.cs
@@ -80,17 +80,18 @@

         public async Task RegisterServiceAsync(string serviceName, string serviceId, string version, Uri uri)
         {
-            Logger.Information($"Registering service at {_consulHost}:{_consulPort}");
             _serviceName = serviceName;
             _serviceId = serviceId;
             _version = version;
             _uri = uri;
+            var localIp = GetLocalIPAddress();
+            Logger.Information($"Registering service on {localIp} on Consul {_consulHost}:{_consulPort}");
             var payload = new
             {
                 ID = serviceId,
                 Name = serviceName,
                 Tags = new[] {$"urlprefix-/{serviceName}"},
-                Address = GetLocalIPAddress(),
+                Address = localIp,
                 // ReSharper disable once RedundantAnonymousTypePropertyName
                 Port = uri.Port,
                 Check = new
@@ -109,6 +110,10 @@
                 if (res.StatusCode != HttpStatusCode.OK)
                 {
                     throw new Exception("Could not register service");
+                }
+                else
+                {
+                    Logger.Information($"Registration successful");
                 }
             }
             StartReaper();


Start to use the message dispatcher in its new role.

--- Miles.MassTransit/TransactionalMessagePublisher.cs
+++ Miles.MassTransit/TransactionalMessagePublisher.cs
@@ -38,7 +38,7 @@

         // State
         private readonly Stack<PublisherStackInstance> publisherStack = new Stack<PublisherStackInstance>();
-        private readonly List<OutgoingMessageAndObject> pendingDispatchMessages = new List<OutgoingMessageAndObject>();
+        private List<OutgoingMessageForDispatch> pendingDispatchMessages = new List<OutgoingMessageForDispatch>();
         private readonly IActivityContext activityContext;

         /// <summary>
@@ -46,17 +46,15 @@
         /// </summary>
         /// <param name="transactionContext">The transaction context.</param>
         /// <param name="outgoingEventRepository">The outgoing event repository.</param>
-        /// <param name="time">The time.</param>
+        /// <param name="time">The time service.</param>
         /// <param name="activityContext">The activity context.</param>
-        /// <param name="commandDispatcher">The command dispatcher.</param>
-        /// <param name="eventDispatcher">The event dispatcher.</param>
+        /// <param name="messageDispatcher">The message dispatcher.</param>
         public TransactionalMessagePublisher(
             ITransactionContext transactionContext,
             IOutgoingMessageRepository outgoingEventRepository,
             ITime time,
             IActivityContext activityContext,
-            IMessageDispatcher commandDispatcher,
-            ConventionBasedMessageDispatcher eventDispatcher)
+            IMessageDispatcher messageDispatcher)
         {
             this.publisherStack.Push(new PublisherStackInstance(this));
             this.outgoingEventRepository = outgoingEventRepository;
@@ -67,22 +65,11 @@

             transactionContext.PostCommit.Register(async (s, e) =>
             {
-                foreach (var message in pendingDispatchMessages)
-                {
-                    // After commit try to dispatch the messages. Try to mark them as dispatched.
-                    try
-                    {
-                        var dispatcher = message.OutgoingMessage.MessageType == OutgoingMessageType.Command ? commandDispatcher : eventDispatcher;
-                        await dispatcher.DispatchAsync(message.MessageObject, message.OutgoingMessage).ConfigureAwait(false);
-                        message.OutgoingMessage.Dispatched(time.Now);
-                        await outgoingEventRepository.SaveAsync(message.OutgoingMessage, ignoreTransaction: true).ConfigureAwait(false);
-                    }
-                    catch
-                    {
-                        // TODO: Report the failure, but we are intentionally hiding this problem
-                    }
-                }
-                pendingDispatchMessages.Clear();
+                // relinquish control of the collection, let the dispatcher own it
+                var messagesForDispatch = pendingDispatchMessages;
+                pendingDispatchMessages = new List<OutgoingMessageForDispatch>();
+
+                await messageDispatcher.DispatchAsync(messagesForDispatch);
             });
         }


Groundwork for sprite loading/unloading

Groundwork for sprite loading/unloading

--- MonoGame/SMLimitless/SMLimitless/Sprites/Sprite.cs
+++ MonoGame/SMLimitless/SMLimitless/Sprites/Sprite.cs
@@ -328,6 +328,10 @@
 			return null;
 		}

+		public virtual void Activate() { }
+
+		public virtual void Deactivate() { }
+
 		#region Core Gameobject Methods
         /// <summary>
         /// Initializes this sprite.


starting breaking optimization changes

starting breaking optimization changes

--- Nez-PCL/ECS/Components/Renderables/LineRenderer.cs
+++ Nez-PCL/ECS/Components/Renderables/LineRenderer.cs
@@ -1,6 +1,5 @@
 using Microsoft.Xna.Framework.Graphics;
 using Microsoft.Xna.Framework;
-using System.Collections.Generic;
 using Nez.PhysicsShapes;
 using System.Runtime.CompilerServices;

@@ -24,6 +23,11 @@
 		}

 		/// <summary>
+		/// controls whether the lines are defined in world space or local
+		/// </summary>
+		public bool useWorldSpace { get; protected set; } = true;
+
+		/// <summary>
 		/// starting color of the ribbon
 		/// </summary>
 		Color _startColor = Color.White;
@@ -42,18 +46,24 @@
 		int _pointCount = 0;

 		Vector2[] _points;
-		VertexPositionColorTexture[] _vertices;
-		short[] _triangleIndices;
+		FastList<VertexPositionColorTexture> _vertices = new FastList<VertexPositionColorTexture>();
 		BasicEffect _basicEffect;
 		bool _areVertsDirty = true;

 		// state
 		Segment _firstSegment = new Segment();
 		Segment _secondSegment = new Segment();
-		List<short> _indices = new List<short>();
+		FastList<short> _indices = new FastList<short>();

 		#region configuration
+
+		public LineRenderer setUseWorldSpace( bool useWorldSpace )
+		{
+			this.useWorldSpace = useWorldSpace;
+			return this;
+		}
+

 		public LineRenderer setPointCount( int pointCount )
 		{
@@ -68,7 +78,9 @@
 			}

 			// we need 5 verts for each point except the last point which needs no verts
-			_vertices = new VertexPositionColorTexture[calculateTotalVerts()];
+			var mid = ( _pointCount - 2 ) * 6;
+			var caps = 2 * 5;
+			_vertices = new VertexPositionColorTexture[mid + caps];
 			_areVertsDirty = true;

 			return this;
@@ -119,47 +131,35 @@
 		#endregion

-		/// <summary>
-		/// Calculates the total verts
-		/// </summary>
-		/// <returns>The total verts.</returns>
-		int calculateTotalVerts()
-		{
-			var mid = ( _pointCount - 2 ) * 6;
-			var caps = 2 * 5;
-
-			return mid + caps;
-		}
-
-
-		public static float angle( Vector2 from, Vector2 to )
-		{
-			Vector2Ext.normalize( ref from );
-			Vector2Ext.normalize( ref to );
-			return Mathf.acos( Mathf.clamp( Vector2.Dot( from, to ), -1f, 1f ) ) * Mathf.rad2Deg;
-		}
-
-
 		void calculateVertices()
 		{
 			if( !_areVertsDirty || _pointCount == 0 )
 				return;

 			_areVertsDirty = false;
-			_indices.Clear();
+			_indices.clear();

 			var maxX = float.MinValue;
 			var minX = float.MaxValue;
 			var maxY = float.MinValue;
 			var minY = float.MaxValue;

-			// calculate line length first
+			// calculate line length first and simulataneously get our min/max points for the bounds
 			var lineLength = 0f;
+			var maxWidth = System.Math.Max( _startWidth, _endWidth ) * 0.5f;
 			for( var i = 0; i < _pointCount - 1; i++ )
 			{
-				var ang = angle( _points[i], _points[i + 1] );
 				lineLength += Vector2.Distance( _points[i], _points[i + 1] );
-			}
+				maxX = Mathf.maxOf( maxX, _points[i].X + maxWidth, _points[i + 1].X + maxWidth );
+				minX = Mathf.minOf( minX, _points[i].X - maxWidth, _points[i + 1].X - maxWidth );
+				maxY = Mathf.maxOf( maxY, _points[i].Y + maxWidth, _points[i + 1].Y + maxWidth );
+				minY = Mathf.minOf( minY, _points[i].Y - maxWidth, _points[i + 1].Y - maxWidth );
+			}
+
+			_bounds.x = minX;
+			_bounds.y = minY;
+			_bounds.width = maxX - minX;
+			_bounds.height = maxY - minY;

 			var distanceSoFar = 0f;
 			var fusedPoint = Vector2.Zero;
@@ -170,18 +170,6 @@
 			{
 				_firstSegment.setPoints( _points[0], _points[1], _startWidth, _endWidth );
 				addSingleSegmentLine( _firstSegment );
-				_triangleIndices = _indices.ToArray();
-
-				// update min/max for any visible verts
-				maxX = Mathf.maxOf( maxX, _firstSegment.tl.X, _firstSegment.tr.X, _firstSegment.br.X, _firstSegment.bl.X );
-				minX = Mathf.minOf( minX, _firstSegment.tl.X, _firstSegment.tr.X, _firstSegment.br.X, _firstSegment.bl.X );
-				maxY = Mathf.maxOf( maxY, _firstSegment.tl.Y, _firstSegment.tr.Y, _firstSegment.br.Y, _firstSegment.bl.Y );
-				minY = Mathf.minOf( minY, _firstSegment.tl.Y, _firstSegment.tr.Y, _firstSegment.br.Y, _firstSegment.bl.Y );
-
-				_bounds.x = minX;
-				_bounds.y = minY;
-				_bounds.width = maxX - minX;
-				_bounds.height = maxY - minY;
 				return;
 			}

@@ -234,33 +222,20 @@
 					addFirstSegment( _firstSegment, _secondSegment, ref vertIndex );
 				else
 					addSegment( _firstSegment, ref vertIndex );
-
-				// update min/max for any visible verts
-				maxX = Mathf.maxOf( maxX, _firstSegment.tl.X, _firstSegment.tr.X, _firstSegment.br.X, _firstSegment.bl.X );
-				minX = Mathf.minOf( minX, _firstSegment.tl.X, _firstSegment.tr.X, _firstSegment.br.X, _firstSegment.bl.X );
-				maxY = Mathf.maxOf( maxY, _firstSegment.tl.Y, _firstSegment.tr.Y, _firstSegment.br.Y, _firstSegment.bl.Y );
-				minY = Mathf.minOf( minY, _firstSegment.tl.Y, _firstSegment.tr.Y, _firstSegment.br.Y, _firstSegment.bl.Y );
-			}
-
-			_triangleIndices = _indices.ToArray();
-
-			_bounds.x = minX;
-			_bounds.y = minY;
-			_bounds.width = maxX - minX;
-			_bounds.height = maxY - minY;
+			}
 		}

 		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		void addSingleSegmentLine( Segment segment )
 		{
-			_indices.Add( 0 );
-			_indices.Add( 1 );
-			_indices.Add( 2 );
-
-			_indices.Add( 0 );
-			_indices.Add( 2 );
-			_indices.Add( 3 );
+			_indices.add( 0 );
+			_indices.add( 1 );
+			_indices.add( 2 );
+
+			_indices.add( 0 );
+			_indices.add( 2 );
+			_indices.add( 3 );

 			addVert( 0, segment.tl, new Vector2( 0, 1 ), _startColor );
 			addVert( 1, segment.tr, new Vector2( 1, 1 ), _endColor );
@@ -272,17 +247,17 @@
 		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		void addFirstSegment( Segment segment, Segment nextSegment, ref int vertIndex )
 		{
-			_indices.Add( 0 );
-			_indices.Add( 1 );
-			_indices.Add( 4 );
-
-			_indices.Add( 1 );
-			_indices.Add( 2 );
-			_indices.Add( 4 );
-
-			_indices.Add( 2 );
-			_indices.Add( 3 );
-			_indices.Add( 4 );
+			_indices.add( 0 );
+			_indices.add( 1 );
+			_indices.add( 4 );
+
+			_indices.add( 1 );
+			_indices.add( 2 );
+			_indices.add( 4 );
+
+			_indices.add( 2 );
+			_indices.add( 3 );
+			_indices.add( 4 );

 			addVert( vertIndex++, segment.tl, new Vector2( 0, 1 ), _startColor );

@@ -312,30 +287,30 @@
 			{
 				if( segment.shouldFuseBottom )
 				{
-					_indices.Add( (short)vertIndex );
-					_indices.Add( (short)( vertIndex + 4 ) );
-					_indices.Add( (short)( vertIndex - 4 ) );
+					_indices.add( (short)vertIndex );
+					_indices.add( (short)( vertIndex + 4 ) );
+					_indices.add( (short)( vertIndex - 4 ) );
 				}
 				else
 				{
 					var firstSegmentOffset = vertIndex == 5 ? 1 : 0;
-					_indices.Add( (short)( vertIndex - 3 + firstSegmentOffset ) );
-					_indices.Add( (short)( vertIndex + 4 ) );
-					_indices.Add( (short)( vertIndex + 3 ) );
+					_indices.add( (short)( vertIndex - 3 + firstSegmentOffset ) );
+					_indices.add( (short)( vertIndex + 4 ) );
+					_indices.add( (short)( vertIndex + 3 ) );
 				}
 			}

-			_indices.Add( (short)vertIndex );
-			_indices.Add( (short)( vertIndex + 1 ) );
-			_indices.Add( (short)( vertIndex + 2 ) );
-
-			_indices.Add( (short)( vertIndex + 4 ) );
-			_indices.Add( (short)vertIndex );
-			_indices.Add( (short)( vertIndex + 2 ) );
-
-			_indices.Add( (short)( vertIndex + 3 ) );
-			_indices.Add( (short)( vertIndex + 4 ) );
-			_indices.Add( (short)( vertIndex + 2 ) );
+			_indices.add( (short)vertIndex );
+			_indices.add( (short)( vertIndex + 1 ) );
+			_indices.add( (short)( vertIndex + 2 ) );
+
+			_indices.add( (short)( vertIndex + 4 ) );
+			_indices.add( (short)vertIndex );
+			_indices.add( (short)( vertIndex + 2 ) );
+
+			_indices.add( (short)( vertIndex + 3 ) );
+			_indices.add( (short)( vertIndex + 4 ) );
+			_indices.add( (short)( vertIndex + 2 ) );

 			if( segment.shouldFuseBottom )
 			{
@@ -381,6 +356,16 @@
 		}

+		public override void onEntityTransformChanged()
+		{
+			// we dont care if the transform changed if we are in world space
+			if( useWorldSpace )
+				return;
+
+			_bounds.calculateBounds( entity.transform.position, _localOffset, _origin, entity.transform.scale, entity.transform.rotation, width, height );
+		}
+
+
 		public override bool isVisibleFromCamera( Camera camera )
 		{
 			calculateVertices();
@@ -397,17 +382,19 @@
 			_basicEffect.View = camera.transformMatrix;
 			_basicEffect.CurrentTechnique.Passes[0].Apply();

-			//Core.graphicsDevice.RasterizerState = RasterizerState.CullNone;
-			//Core.graphicsDevice.DrawUserPrimitives( PrimitiveType.TriangleList, _vertices, 0, ( _pointCount - 1 ) * 2 );
-
-			var numVerts = _vertices.Length;
-			var primitiveCount = _triangleIndices.Length / 3;
-			Core.graphicsDevice.DrawUserIndexedPrimitives( PrimitiveType.TriangleList, _vertices, 0, numVerts, _triangleIndices, 0, primitiveCount );
+			if( !useWorldSpace )
+				_basicEffect.World = transform.localToWorldTransform;
+
+			var primitiveCount = _indices.length / 3;
+			Core.graphicsDevice.DrawUserIndexedPrimitives( PrimitiveType.TriangleList, _vertices, 0, _vertices.Length, _indices.buffer, 0, primitiveCount );
 		}

 		#endregion

+		/// <summary>
+		/// helper class used to store some data when calculating verts
+		/// </summary>
 		class Segment
 		{
 			public Vector2 tl, tr, br, bl;


validation decorator test fix

validation decorator test fix

--- NinjaHive.WebApp.Tests/ValidationDecoratorTests.cs
+++ NinjaHive.WebApp.Tests/ValidationDecoratorTests.cs
@@ -126,7 +126,7 @@
         }

         #region Mockups
-        private interface IFakeCommandInterface {}
+        public interface IFakeCommandInterface {}
         private class FakeDecoratee : ICommandHandler<IFakeCommandInterface>
         {
             public void Handle(IFakeCommandInterface command)


comment for failed test

comment for failed test

--- test/Pigeon.Tests/Serialization/SerializationSpec.cs
+++ test/Pigeon.Tests/Serialization/SerializationSpec.cs
@@ -19,6 +19,10 @@
         [TestMethod]
         public void CanSerializeActorRef()
         {
+            //TODO: this test fails when running all of the tests
+            //looks like we either need another serializer than fastJSON, or be able to make fastJSON context aware.
+            //(it blows up when trying to deserialze actorrefs since there have been multiple actor systems registering actorref as a custom type)
+
             var message = new SomeMessage
             {
                 ActorRef = testActor,


NH-3277 - Fix error when casting long to string with ToString method in LINQ

--- src/NHibernate/Dialect/MsSqlCeDialect.cs
+++ src/NHibernate/Dialect/MsSqlCeDialect.cs
@@ -43,6 +43,7 @@
 			RegisterColumnType(DbType.Time, "DATETIME");

 			RegisterFunction("substring", new EmulatedLengthSubstringFunction());
+			RegisterFunction("str", new SQLFunctionTemplate(NHibernateUtil.String, "cast(?1 as nvarchar)"));

 			DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.SqlServerCeDriver";
 			DefaultProperties[Environment.PrepareSql] = "false";


Deactivated m_lastAgentUpdateArgs.UseClientAgentPosition option.

Controls field should be used instead.

--- OpenSim/Region/ClientStack/OMP/WebSocket/Client.cs
+++ OpenSim/Region/ClientStack/OMP/WebSocket/Client.cs
@@ -230,7 +230,7 @@

                     // Use client agent's position.
                     m_lastAgentUpdateArgs.ClientAgentPosition = x.CameraCenter;
-                    m_lastAgentUpdateArgs.UseClientAgentPosition = true;
+                    m_lastAgentUpdateArgs.UseClientAgentPosition = false;

                     UpdateAgent handlerAgentUpdate = OnAgentUpdate;
                     UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate;


Fixing crash

Fixing crash

--- Glfw/GlfwPlatformWindow.cs
+++ Glfw/GlfwPlatformWindow.cs
@@ -579,11 +579,17 @@
 				}

 				lastMouseDownTime[button] = now;
-				WindowProvider.TopWindow.OnMouseDown(new MouseEventArgs(mouseButton, clickCount[button], mouseX, mouseY, 0));
+				if (clickCount.ContainsKey(button))
+				{
+					WindowProvider.TopWindow.OnMouseDown(new MouseEventArgs(mouseButton, clickCount[button], mouseX, mouseY, 0));
+				}
 			}
 			else if (state == InputState.Release)
 			{
-				WindowProvider.TopWindow.OnMouseUp(new MouseEventArgs(mouseButton, clickCount[button], mouseX, mouseY, 0));
+				if (clickCount.ContainsKey(button))
+				{
+					WindowProvider.TopWindow.OnMouseUp(new MouseEventArgs(mouseButton, clickCount[button], mouseX, mouseY, 0));
+				}
 			}
 		}


Changed REMOTE_URL_IDL_PREFIX

Changed REMOTE_URL_IDL_PREFIX

--- OpenSim/Region/ClientStack/OMP/WebSocket/Config.cs
+++ OpenSim/Region/ClientStack/OMP/WebSocket/Config.cs
@@ -4,7 +4,8 @@
 {
 	public class Config
 	{
-		public readonly static string REMOTE_URL_IDL_PREFIX = "http://yellow.cg.uni-saarland.de/home/kiara/idl/";
+        public readonly static string REMOTE_URL_IDL_PREFIX =
+            "http://yellow.cg.uni-saarland.de/home/omp-client/idl/";
 		//public readonly static string REMOTE_URL_IDL_PREFIX = "http://localhost:8080/idl/";
 	}
 }


Refactor OrchardException classes

Refactor OrchardException classes

All constructors now take a"LocalizedString" as the error message.

--HG--
branch : dev

--- src/Orchard/Commands/CommandHostAgent.cs
+++ src/Orchard/Commands/CommandHostAgent.cs
@@ -1,14 +1,14 @@
 using System;
 using System.Collections.Generic;
-using System.Collections.Specialized;
 using System.IO;
 using System.Linq;
-using System.Text;
 using System.Web.Mvc;
 using System.Web.Routing;
 using Autofac;
 using Orchard.Environment;
 using Orchard.Environment.Configuration;
+using Orchard.Localization;
+using Orchard.Logging;

 namespace Orchard.Commands {
     /// <summary>
@@ -18,6 +18,15 @@
     public class CommandHostAgent {
         private IContainer _hostContainer;
         private Dictionary<string, IStandaloneEnvironment> _tenants;
+
+        public CommandHostAgent() {
+            T = NullLocalizer.Instance;
+            Logger = NullLogger.Instance;
+        }
+
+        public Localizer T { get; set; }
+        public ILogger Logger { get; set; }
+

         public int RunSingleCommand(TextReader input, TextWriter output, string tenant, string[] args, Dictionary<string, string> switches) {
             int result = StartHost(input, output);
@@ -112,7 +121,7 @@
             if (settingsList.Any()) {
                 var settings = settingsList.SingleOrDefault(s => String.Equals(s.Name, tenant, StringComparison.OrdinalIgnoreCase));
                 if (settings == null) {
-                    throw new OrchardException(string.Format("Tenant {0} does not exist", tenant));
+                    throw new OrchardSystemException(T("Tenant {0} does not exist", tenant));
                 }

                 var env = host.CreateStandaloneEnvironment(settings);


Yay for languages without default parameter values

--- OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -2686,7 +2686,7 @@
                 //
                 foreach (SceneObjectGroup grp in m_attachments)
                 {
-                    m_scene.DeleteSceneObject(grp);
+                    m_scene.DeleteSceneObject(grp, false);
                 }
                 m_attachments.Clear();
             }


Added VariablesSetF list overload to CommandBuilder

--- src/Potato.Core.Shared/CommandBuilder.cs
+++ src/Potato.Core.Shared/CommandBuilder.cs
@@ -700,7 +700,43 @@
         /// <param name="name">The name of the variable to set</param>
         /// <param name="value">The value to assign to the variable</param>
         /// <returns>The built command to dispatch</returns>
+        public static ICommand VariablesSetF(String name, List<String> value) {
+            return new Command() {
+                CommandType = CommandType.VariablesSetF,
+                Parameters = new List<ICommandParameter>() {
+                    new CommandParameter() {
+                        Data = {
+                            Content = new List<String>() {
+                                name
+                            }
+                        }
+                    },
+                    new CommandParameter() {
+                        Data = {
+                            Content = value
+                        }
+                    }
+                }
+            };
+        }
+
+        /// <summary>
+        /// Builds a command to send a VariablesSetF
+        /// </summary>
+        /// <param name="name">The name of the variable to set</param>
+        /// <param name="value">The value to assign to the variable</param>
+        /// <returns>The built command to dispatch</returns>
         public static ICommand VariablesSetF(CommonVariableNames name, String value) {
+            return VariablesSetF(name.ToString(), value);
+        }
+
+        /// <summary>
+        /// Builds a command to send a VariablesSetF
+        /// </summary>
+        /// <param name="name">The name of the variable to set</param>
+        /// <param name="value">The value to assign to the variable</param>
+        /// <returns>The built command to dispatch</returns>
+        public static ICommand VariablesSetF(CommonVariableNames name, List<String> value) {
             return VariablesSetF(name.ToString(), value);
         }


Fix linking issue introduced in my earlier commit

--- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1970,8 +1970,17 @@
             List<SceneObjectPart> children = new List<SceneObjectPart>();
             SceneObjectPart root = GetSceneObjectPart(parentPrimId);

-            if (Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID))
-                return;
+            if (root == null)
+            {
+                m_log.DebugFormat("[LINK]: Can't find linkset root prim {0{", parentPrimId);
+                return;
+            }
+
+            if (!Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID))
+            {
+                m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim");
+                return;
+            }

             foreach (uint localID in childPrimIds)
             {
@@ -1990,7 +1999,16 @@
             // Must be all one owner
             //
             if (owners.Count > 1)
-                return;
+            {
+                m_log.DebugFormat("[LINK]: Refusing link. Too many owners");
+                return;
+            }
+
+            if (children.Count == 0)
+            {
+                m_log.DebugFormat("[LINK]: Refusing link. No permissions to link any of the children");
+                return;
+            }

             m_sceneGraph.LinkObjects(root, children);
         }


Detection of Cylinder and Prism for flexi prims

Signed-off-by: Mandarinka Tasty <b8202aaeb4000a3966a8ee62f55c085f56a0ffc3@gmail.com>
Signed-off-by: Diva Canto <75aee649a7ca5d11614c71284e842240b208603a@metaverseink.com>

--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3795,7 +3795,7 @@
             }
             else if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Circle)
             {
-                if (Shape.PathCurve == (byte)Extrusion.Straight)
+                if (Shape.PathCurve == (byte)Extrusion.Straight || Shape.PathCurve == (byte)Extrusion.Flexible)
                     return PrimType.CYLINDER;
                 // ProfileCurve seems to combine hole shape and profile curve so we need to only compare against the lower 3 bits
                 else if (Shape.PathCurve == (byte)Extrusion.Curve1)
@@ -3808,7 +3808,7 @@
             }
             else if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.EquilateralTriangle)
             {
-                if (Shape.PathCurve == (byte)Extrusion.Straight)
+                if (Shape.PathCurve == (byte)Extrusion.Straight || Shape.PathCurve == (byte)Extrusion.Flexible)
                     return PrimType.PRISM;
                 else if (Shape.PathCurve == (byte)Extrusion.Curve1)
                     return PrimType.RING;


Fix syntax error. Thanks to callmevlad and pete hurst.

--- HttpCompress/HttpModule.cs
+++ HttpCompress/HttpModule.cs
@@ -83,7 +83,7 @@
         }

         string realPath = app.Request.Path.Remove(0, app.Request.ApplicationPath.Length);
-        if(realPath.StartsWith("/") {
+        if(realPath.StartsWith("/")) {
           realPath = realPath.Substring(1);
         }
         if(settings.IsExcludedPath(realPath)){


tweak DataEncoder api

tweak DataEncoder api

--- Scripts/DapCore/data_/Encoder.cs
+++ Scripts/DapCore/data_/Encoder.cs
@@ -194,7 +194,7 @@
         protected override bool DoDecode(Data data, string key, out T val, bool isDebug = false) {
             Data valueData;
             if (data.TryGetData(key, out valueData, isDebug)) {
-                return DoDecodeValue(valueData, out val, isDebug);
+                return TryDecodeValue(valueData, out val, isDebug);
             }
             val = default(T);
             return false;
@@ -204,7 +204,7 @@
             return EncodeValue(DataCache.Take(typeof(T).FullName), val);
         }

-        protected abstract Data EncodeValue(Data valueData, T val);
-        protected abstract bool DoDecodeValue(Data valueData, out T val, bool isDebug = false);
+        public abstract Data EncodeValue(Data valueData, T val);
+        public abstract bool TryDecodeValue(Data valueData, out T val, bool isDebug = false);
     }
 }


BulletSim: reduce the zeroing threshold for rotational velocity. Sometimes settling of a vehicle from gravity introduces small velocities that need to be kept.

--- OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -1190,8 +1190,6 @@
         //     set directly on the vehicle.
         private void MoveAngular(float pTimestep)
         {
-            // VehicleRotationalVelocity = Vector3.Zero;
-
             ComputeAngularTurning(pTimestep);

             ComputeAngularVerticalAttraction();
@@ -1201,7 +1199,7 @@
             ComputeAngularBanking();

             // ==================================================================
-            if (VehicleRotationalVelocity.ApproxEquals(Vector3.Zero, 0.01f))
+            if (VehicleRotationalVelocity.ApproxEquals(Vector3.Zero, 0.0001f))
             {
                 // The vehicle is not adding anything angular wise.
                 VehicleRotationalVelocity = Vector3.Zero;


Fixed the Avatar height by correctly computing the half height of the capsule.

--- OpenSim/Region/Physics/PhysXPlugin/PxPhysObject.cs
+++ OpenSim/Region/Physics/PhysXPlugin/PxPhysObject.cs
@@ -479,7 +479,7 @@
             // sure to set initialized to true
             m_pxScene.PhysX.CreateCharacterCapsule(LocalID, Name,
                 m_rawPosition, m_orientation, m_shapeID, Friction, Friction,
-                Restitution,  m_currentSize.Z / 2.0f,
+                Restitution,  ComputeAvatarHalfHeight(),
                 Math.Min(m_currentSize.X, m_currentSize.Y) / 2.0f, Density,
                 true);

@@ -2499,7 +2499,7 @@
                     m_pxScene.PhysX.CreateCharacterCapsule(LocalID, Name,
                         m_rawPosition, m_orientation, m_shapeID, base.Friction,
                         base.Friction, base.Restitution,
-                        (m_currentSize.Z / 2.0f),
+                        ComputeAvatarHalfHeight(),
                         Math.Min(m_currentSize.X, m_currentSize.Y) / 2.0f,
                         Density, true);

@@ -2823,6 +2823,36 @@
             }
         }

+        /// <summary>
+        /// Adjust the avatar height to account for how PhysX creates avatar
+        /// capsules. This will remove the spheres at the edges of the capsule
+        /// and then cut the height in half.
+        /// </summary>
+        private float ComputeAvatarHalfHeight()
+        {
+            float halfHeight;
+
+            // Remove the sphere from the capsule height and then cut the
+            // height in half
+            halfHeight = (m_currentSize.Z - Math.Min(m_currentSize.X,
+                m_currentSize.Y)) / 2.0f;
+
+            // There is a small amount of jitter for small characters, if this
+            // is the same as Bullet then the spheres are larger than the
+            // cylinder, so the height can't go below a minimum of 0.685f to
+            // prevent this
+            // NOTE: The reasoning for this has not been looked at yet, but
+            // will be soon
+            if (halfHeight < 0.685f)
+            {
+                halfHeight = 0.685f;
+            }
+
+            // Return the half height that will be used to construct the
+            // character capsule geometry
+            return halfHeight;
+        }
+
         #endregion // Helper Methods
     }
 }


Time added to test that different exception messages end up in the same Sentry issue.

--- SentryDotNet.Test/ManualTests.cs
+++ SentryDotNet.Test/ManualTests.cs
@@ -54,7 +54,7 @@

         private void FailingMethod()
         {
-            throw new InvalidOperationException("It failed deliberately :-)");
+            throw new InvalidOperationException("It failed deliberately at " + DateTime.UtcNow.ToString("O"));
         }
     }
 }


Small memory fix for the RemoveAlpha method and using Capture Interval as delay.

--- HyperionScreenCap/Form1.cs
+++ HyperionScreenCap/Form1.cs
@@ -209,7 +209,7 @@
           ProtoClient.SendImageToServer(x);

           // Add small delay to reduce cpu usage (200FPS max)
-          Thread.Sleep(5);
+          Thread.Sleep(Settings.CaptureInterval);
         }
       }
       catch (Exception ex)
@@ -218,20 +218,24 @@
       }
     }

-    #endregion DXCapture
-
-    static byte[] RemoveAlpha(DataStream ia)
-    {
-      var newImage = new List<byte>();
-      while (ia.Position < ia.Length)
-      {
-        var a = new byte[4];
-        ia.Read(a, 0, 4);
-        newImage.Add(a[2]);
-        newImage.Add(a[1]);
-        newImage.Add(a[0]);
-      }
-      return newImage.ToArray();
-    }
-  }
+        #endregion DXCapture
+
+        private static byte[] RemoveAlpha(DataStream ia)
+        {
+            var newImage = new byte[(ia.Length * 3 / 4)];
+            int counter = 0;
+            while (ia.Position < ia.Length)
+            {
+                var a = new byte[4];
+                ia.Read(a, 0, 4);
+                newImage[counter] = (a[2]);
+                counter++;
+                newImage[counter] = (a[1]);
+                counter++;
+                newImage[counter] = (a[0]);
+                counter++;
+            }
+            return newImage;
+        }
+    }
 }


Add test for query param handling in React Router

--- tests/React.Tests/Router/HtmlHelperExtensionsTest.cs
+++ tests/React.Tests/Router/HtmlHelperExtensionsTest.cs
@@ -6,6 +6,7 @@
  */
 #if NET452

+using System.Collections.Specialized;
 using System.Web;
 using System.Web.Mvc;
 using Moq;
@@ -64,7 +65,7 @@
 			public Mock<HtmlHelper> htmlHelper;
 			public Mock<HttpResponseBase> httpResponse;

-			public HtmlHelperMocks()
+			public HtmlHelperMocks(HttpRequestBase request = null)
 			{
 				var viewDataContainer = new Mock<IViewDataContainer>();
 				var viewContext = new Mock<ViewContext>();
@@ -72,12 +73,13 @@
 				htmlHelper = new Mock<HtmlHelper>(viewContext.Object, viewDataContainer.Object);
 				var httpContextBase = new Mock<HttpContextBase>();
 				viewContext.Setup(x => x.HttpContext).Returns(httpContextBase.Object);
+				httpContextBase.Setup(x => x.Request).Returns(request);
 				httpContextBase.Setup(x => x.Response).Returns(httpResponse.Object);
 			}
 		}

 		/// <summary>
-		/// Mocks alot of common functionality related to rendering a
+		/// Mocks alot of common functionality related to rendering a
 		/// React Router component.
 		/// </summary>
 		class ReactRouterMocks
@@ -227,6 +229,46 @@
 			htmlHelperMock.httpResponse.VerifySet(x => x.StatusCode = 200);
 		}

+		[Theory]
+		[InlineData(false)]
+		[InlineData(true)]
+		public void ShouldHandleQueryParams(bool withOverriddenPath)
+		{
+			var mocks = ConfigureMockReactEnvironment();
+			ConfigureMockConfiguration();
+			ConfigureReactIdGenerator();
+
+			mocks.Engine.Setup(x => x.Evaluate<string>("JSON.stringify(context);"))
+						.Returns("{ status: 200 }");
+
+			var requestMock = new Mock<HttpRequestBase>();
+			requestMock.SetupGet(x => x.Path).Returns("/test");
+			var queryStringMock = new Mock<NameValueCollection>();
+			queryStringMock.Setup(x => x.ToString()).Returns("?a=1&b=2");
+			requestMock.SetupGet(x => x.QueryString).Returns(queryStringMock.Object);
+
+			var htmlHelperMock = new HtmlHelperMocks(requestMock.Object);
+
+			var result = HtmlHelperExtensions.ReactRouter(
+				htmlHelper: htmlHelperMock.htmlHelper.Object,
+				componentName: "ComponentName",
+				props: new { },
+				path: withOverriddenPath ? "/test2?b=1&c=2" : null,
+				contextHandler: (response, context) => response.StatusCode = context.status.Value
+			);
+
+			htmlHelperMock.httpResponse.VerifySet(x => x.StatusCode = 200);
+
+			if (withOverriddenPath)
+			{
+				mocks.Engine.Verify(x => x.Evaluate<string>(@"ReactDOMServer.renderToString(React.createElement(ComponentName, Object.assign({}, { location: '/test2?b=1&c=2', context: context })))"));
+			}
+			else
+			{
+				mocks.Engine.Verify(x => x.Evaluate<string>(@"ReactDOMServer.renderToString(React.createElement(ComponentName, Object.assign({}, { location: '/test?a=1&b=2', context: context })))"));
+			}
+		}
+
 		[Fact]
 		public void ShouldRedirectPermanent()
 		{


Lazily compile mip generation vertex shader

Quick workaround for missing shaders in nuget package. Will fail if you
actually try to use it!

--- src/ShaderUnit/Rendering/MipGenerator.cs
+++ src/ShaderUnit/Rendering/MipGenerator.cs
@@ -20,21 +20,12 @@
 	{
 		private readonly RenderDevice _device;
 		private readonly IWorkspace _workspace;
-		private readonly Shader _vertexShader;
+		private Shader _vertexShader;

 		public MipGenerator(RenderDevice device, IWorkspace workspace)
 		{
 			_device = device;
 			_workspace = workspace;
-
-			// Compile vertex shader.
-			_vertexShader = Shader.CompileFromFile(
-				_device.Device,
-				RenderUtils.GetShaderFilename("GenMipsVS.hlsl"),
-				"Main",
-				"vs_4_0",
-				RenderUtils.GetShaderFilename,
-				null);
 		}

 		// Do the generation.
@@ -52,6 +43,18 @@
 			if (resolvedShaderPath == null || !File.Exists(resolvedShaderPath))
 			{
 				throw new ShaderUnitException("Cannot find mip generation shader file: " + shaderFile);
+			}
+
+			if (_vertexShader == null)
+			{
+				// Compile vertex shader.
+				_vertexShader = Shader.CompileFromFile(
+					_device.Device,
+					RenderUtils.GetShaderFilename("GenMipsVS.hlsl"),
+					"Main",
+					"vs_4_0",
+					RenderUtils.GetShaderFilename,
+					null);
 			}

 			var isCubemap = (texture.Texture2D.Description.OptionFlags & ResourceOptionFlags.TextureCube) != 0;


78: renamed local var

78: renamed local var

--- src/SharpConnect.MySql/Internal/Query.cs
+++ src/SharpConnect.MySql/Internal/Query.cs
@@ -92,13 +92,14 @@

         public void Execute()
         {
-            //blocking mehod
+            //-------------------
+            //blocking method***
             //wait until execute finish
+            //-------------------
             _rowReadIndex = 0;
-            bool finish = false;
+            bool finished = false;
             if (_prepareContext != null)
             {
-                //blocking method
                 if (_cmdParams == null)
                 {
                     return;
@@ -106,19 +107,23 @@

                 ExecutePrepareQuery_A(() =>
                 {
-                    finish = true;
+                    finished = true;
                 });
             }
             else
             {
+                //TODO: review here
+
                 _prepareContext = null; //***
                 ExecuteNonPrepare_A(() =>
                 {
-                    finish = true;
+                    finished = true;
                 });
             }

-            while (!finish) ; //wait *** tight loop
+            //-------------------------------------------------------------
+            while (!finished) ; //wait *** tight loop
+            //-------------------------------------------------------------
         }

         void ExecuteNonPrepare_A(Action whenFinish)
@@ -137,10 +142,13 @@
             });
         }
         //-------------------------------------------------------------
-
+
         public void Prepare()
         {
-            //blocking method
+            //-------------------
+            //blocking method***
+            //wait until execute finish
+            //-------------------
             //prepare sql query
             _sqlParser.CurrentPacketParser = new PrepareResponsePacketParser(_conn.IsProtocol41);
             _prepareContext = null;
@@ -153,7 +161,8 @@
             string realSql = _sqlStrTemplate.BindValues(_cmdParams, true);
             ComPrepareStatementPacket preparePacket = new ComPrepareStatementPacket(realSql);
             preparePacket.WritePacket(_writer);
-            bool parseEnd = false;
+            //-------------------------------------------------------------
+            bool finished = false;
             SendPacketAsync(_writer.ToArray(), obj =>
             {
                 _conn.StartReceive(result =>
@@ -171,10 +180,12 @@
                     {
                         throw new Exception("Prepare Error");
                     }
-                    parseEnd = true;
+                    finished = true;
                 });
             });
-            while (!parseEnd) ;
+            //-------------------------------------------------------------
+            while (!finished) ;//wait *** tight loop
+            //-------------------------------------------------------------
         }
         void ExecutePrepareQuery_A(Action whenFinish)
         {
@@ -234,7 +245,7 @@
                 //The server will send a OK_Packet if the statement could be reset, a ERR_Packet if not.
             }
             else
-            {
+            {
                 nextAction();
             }
         }


Use correct way to close tcpclient connection

--- SimpleTwitchBot.Lib/IrcClient.cs
+++ SimpleTwitchBot.Lib/IrcClient.cs
@@ -10,7 +10,6 @@
 {
     public class IrcClient : IDisposable
     {
-        private readonly TcpClient _tcpClient = new TcpClient();
         private readonly List<string> _joinedChannels = new List<string>();

         public string Hostname { get; private set; }
@@ -20,7 +19,7 @@
         public bool IsConnected { get; private set; } = false;

         private bool _disposed = false;
-        private NetworkStream _stream;
+        private TcpClient _tcpClient;
         private StreamReader _inputStream;
         private StreamWriter _outputStream;

@@ -41,12 +40,12 @@
         public async Task ConnectAsync(string username, string password)
         {
             Username = username.ToLower();
-
+            _tcpClient = new TcpClient();
             await _tcpClient.ConnectAsync(Hostname, Port);

-            _stream = _tcpClient.GetStream();
-            _inputStream = new StreamReader(_stream);
-            _outputStream = new StreamWriter(_stream);
+            NetworkStream networkStream = _tcpClient.GetStream();
+            _inputStream = new StreamReader(networkStream);
+            _outputStream = new StreamWriter(networkStream);

             _outputStream.WriteLine($"PASS {password}");
             _outputStream.WriteLine($"NICK {username}");
@@ -58,7 +57,9 @@

         public void Disconnect()
         {
-            _tcpClient.Client.Shutdown(SocketShutdown.Both);
+            _tcpClient?.Close();
+            _inputStream?.Close();
+            _outputStream?.Close();
         }

         private async Task StartListenAsync()
@@ -68,7 +69,7 @@
                 string rawMessage = await _inputStream.ReadLineAsync();
                 if (string.IsNullOrEmpty(rawMessage))
                 {
-                    continue;
+                    break;
                 }

                 var ircMessage = new IrcMessage(rawMessage);
@@ -139,9 +140,12 @@

         protected virtual void OnDisconnected()
         {
-            IsConnected = false;
-            _joinedChannels.Clear();
-            Disconnected?.Invoke(this, EventArgs.Empty);
+            if (IsConnected)
+            {
+                IsConnected = false;
+                _joinedChannels.Clear();
+                Disconnected?.Invoke(this, EventArgs.Empty);
+            }
         }

         public void JoinChannel(string channel)
@@ -180,8 +184,7 @@
             }
             if (disposing)
             {
-                _tcpClient.Dispose();
-                _stream?.Dispose();
+                _tcpClient?.Dispose();
                 _inputStream?.Dispose();
                 _outputStream?.Dispose();
             }


Fixed an issue in JsonUtils with the "formatting" parameter not being used

--- src/Skybrud.Essentials/Json/JsonUtils.cs
+++ src/Skybrud.Essentials/Json/JsonUtils.cs
@@ -171,7 +171,7 @@
             if (String.IsNullOrWhiteSpace(path)) throw new ArgumentNullException(nameof(path));
             if (obj == null) throw new ArgumentNullException(nameof(obj));
             if (obj.JObject == null) throw new PropertyNotSetException(nameof(obj.JObject));
-            SaveJsonObject(path, obj.JObject, Formatting.None);
+            SaveJsonObject(path, obj.JObject, formatting);
         }

         /// <summary>
@@ -219,7 +219,7 @@
         public static void SaveJsonArray(string path, JArray array, Formatting formatting) {
             if (String.IsNullOrWhiteSpace(path)) throw new ArgumentNullException(nameof(path));
             if (array == null) throw new ArgumentNullException(nameof(array));
-            File.WriteAllText(path, array.ToString(), Encoding.UTF8);
+            File.WriteAllText(path, array.ToString(formatting), Encoding.UTF8);
         }

         /// <summary>


Just resharping

Just resharping

--- Mapsui/Layers/BaseLayer.cs
+++ Mapsui/Layers/BaseLayer.cs
@@ -50,7 +50,7 @@
         /// </summary>
         public object Tag
         {
-            get { return _tag; }
+            get => _tag;
             set
             {
                 _tag = value;
@@ -63,7 +63,7 @@
         /// </summary>
         public double MinVisible
         {
-            get { return _minVisible; }
+            get => _minVisible;
             set
             {
                 _minVisible = value;
@@ -76,7 +76,7 @@
         /// </summary>
         public double MaxVisible
         {
-            get { return _maxVisible; }
+            get => _maxVisible;
             set
             {
                 _maxVisible = value;
@@ -89,7 +89,7 @@
         /// </summary>
         public bool Enabled
         {
-            get{ return _enabled; }
+            get => _enabled;
             set
             {
                 if (_enabled == value) return;
@@ -103,7 +103,7 @@
         /// </summary>
         public string Name
         {
-            get { return _name; }
+            get => _name;
             set
             {
                 _name = value;
@@ -116,7 +116,7 @@
         /// </summary>
         public string CRS
         {
-            get { return _crs; }
+            get => _crs;
             set
             {
                 _crs = value;
@@ -126,7 +126,7 @@

         public bool Exclusive
         {
-            get { return _exclusive; }
+            get => _exclusive;
             set
             {
                 _exclusive = value;
@@ -136,7 +136,7 @@

         public double Opacity
         {
-            get { return _opacity; }
+            get => _opacity;
             set
             {
                 _opacity = value;
@@ -146,7 +146,7 @@

         public bool Busy
         {
-            get { return _busy; }
+            get => _busy;
             set
             {
                 if (_busy == value) return;
@@ -160,7 +160,7 @@
         /// </summary>
         public IStyle Style
         {
-            get { return _style; }
+            get => _style;
             set
             {
                 _style = value;
@@ -173,7 +173,7 @@
         /// </summary>
         public ITransformation Transformation
         {
-            get { return _transformation; }
+            get => _transformation;
             set
             {
                 _transformation = value;
@@ -220,7 +220,7 @@
         {
             if (layer == null) return new IStyle[0];
             var style = layer.Style as StyleCollection;
-            return style != null ? style.ToArray() : new[] { layer.Style };
+            return style?.ToArray() ?? new[] { layer.Style };
         }

         public Attribution Attribution { get; } = new Attribution();


JSON files should obviously be saved as UTF-8

--- src/Skybrud.Essentials/Json/JsonUtils.cs
+++ src/Skybrud.Essentials/Json/JsonUtils.cs
@@ -157,7 +157,7 @@
         public static void SaveJsonObject(string path, JObject obj, Formatting formatting) {
             if (String.IsNullOrWhiteSpace(path)) throw new ArgumentNullException("path");
             if (obj == null) throw new ArgumentNullException("obj");
-            File.WriteAllText(path, obj.ToString(formatting));
+            File.WriteAllText(path, obj.ToString(formatting), Encoding.UTF8);
         }

         /// <summary>
@@ -180,7 +180,7 @@
         public static void SaveJsonArray(string path, JArray array, Formatting formatting) {
             if (String.IsNullOrWhiteSpace(path)) throw new ArgumentNullException("path");
             if (array == null) throw new ArgumentNullException("array");
-            File.WriteAllText(path, array.ToString());
+            File.WriteAllText(path, array.ToString(), Encoding.UTF8);
         }

         /// <summary>
@@ -203,7 +203,7 @@
         public static void SaveJsonArray(string path, JToken[] array, Formatting formatting) {
             if (String.IsNullOrWhiteSpace(path)) throw new ArgumentNullException("path");
             if (array == null) throw new ArgumentNullException("array");
-            File.WriteAllText(path, JsonConvert.SerializeObject(array, formatting));
+            File.WriteAllText(path, JsonConvert.SerializeObject(array, formatting), Encoding.UTF8);
         }

         /// <summary>
@@ -226,7 +226,7 @@
         public static void SaveJsonArray(string path, JsonObjectBase[] array, Formatting formatting) {
             if (String.IsNullOrWhiteSpace(path)) throw new ArgumentNullException("path");
             if (array == null) throw new ArgumentNullException("array");
-            File.WriteAllText(path, JsonConvert.SerializeObject(from item in array select item == null ? null : item.JObject, formatting));
+            File.WriteAllText(path, JsonConvert.SerializeObject(from item in array select item == null ? null : item.JObject, formatting), Encoding.UTF8);
         }

     }


slight fix

slight fix

Former-commit-id: 4cc759815fb0517bff80ee3d16c0d047a6285623

--- MassTransit.Host/Parser.cs
+++ MassTransit.Host/Parser.cs
@@ -22,13 +22,12 @@

         public static Args ParseArgs(string[] args)
 		{
-			if (args == null)
-
-            {args = new string[0];
+            if (args == null) args = new string[0];
+            if(args.Length == 0)
                 _isDefault = true;
-            }
+

-			Args result = new Args();
+            Args result = new Args();
 			IArgumentMapFactory _argumentMapFactory = new ArgumentMapFactory();
 			IArgumentParser _argumentParser = new ArgumentParser();
 			IEnumerable<IArgument> arguments = _argumentParser.Parse(args);


Enabled HTTP compression

Enabled HTTP compression

--- PedroLamas.GDrive.WP7/Service/GoogleAuthService.cs
+++ PedroLamas.GDrive.WP7/Service/GoogleAuthService.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Net;
 using System.Net.Http;
 using System.Net.Http.Headers;
 using System.Threading;
@@ -90,14 +91,26 @@

         public HttpClient CreateRestClient(string baseUrl)
         {
-            var client = new HttpClient
+            var handler = new HttpClientHandler();
+
+            if (handler.SupportsAutomaticDecompression)
             {
-                BaseAddress = new Uri(baseUrl)
+                handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
+            }
+
+            var client = new HttpClient(handler)
+            {
+                BaseAddress = new Uri(baseUrl),
             };

-            //client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(new ProductHeaderValue("GDrive (gzip)")));
-            //client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip"));
-            client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(new ProductHeaderValue("GDrive")));
+            if (handler.SupportsAutomaticDecompression)
+            {
+                client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(new ProductHeaderValue("GDrive_gzip")));
+            }
+            else
+            {
+                client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(new ProductHeaderValue("GDrive")));
+            }

             return client;
         }


Removed "more" tab on items, show data in the General tab instead

--- PhoenixImperator/Pages/Entities/ItemPageBuilder.cs
+++ PhoenixImperator/Pages/Entities/ItemPageBuilder.cs
@@ -58,8 +58,6 @@

 			AddTechManual ();

-			AddMoreTab ();
-
 			AddMarketsTab ();

 		}
@@ -72,6 +70,12 @@
 			currentTab.AddProperty ("Sub Type", CurrentItem.SubType);
 			currentTab.AddProperty ("Mass Units", CurrentItem.MassUnits.ToString ());
 			currentTab.AddProperty ("Race", CurrentItem.Race);
+
+			if (CurrentItem.Properties.Count > 0) {
+				foreach (ItemProperty prop in CurrentItem.Properties.Values) {
+					currentTab.AddProperty (prop.Key, prop.Value);
+				}
+			}
 		}

 		private void AddProductionTab()
@@ -101,16 +105,6 @@
 			currentTab.AddLabel (CurrentItem.TechManual);
 		}

-		private void AddMoreTab()
-		{
-			if (CurrentItem.Properties.Count > 0) {
-				AddContentTab ("More", "icon_more.png");
-				foreach (ItemProperty prop in CurrentItem.Properties.Values) {
-					currentTab.AddProperty (prop.Key, prop.Value);
-				}
-			}
-		}
-
 		private void AddMarketsTab()
 		{
 			AddContentTab ("Markets", "icon_markets.png");


[Add] (#10) Nachrichten senden

[Add] (#10) Nachrichten senden

--- Proxer.API/Community/PrivateMessages/Conference.cs
+++ Proxer.API/Community/PrivateMessages/Conference.cs
@@ -172,6 +172,7 @@

                             this.Teilnehmer.Add(new User(lUserName, lUserID, this.senpai));
                         }
+                        this.Aktiv = true;
                     }
                 }
             }
@@ -239,6 +240,23 @@

             this.getMessagesTimer.Start();
         }
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="nachricht"></param>
+        public async void sendeNachricht(string nachricht)
+        {
+            if (senpai.LoggedIn)
+            {
+                Dictionary<string, string> lPostArgs = new Dictionary<string, string>
+                {
+                    {"message", nachricht}
+                };
+                string lResponse = await HttpUtility.PostWebRequestResponseAsync("https://proxer.me/messages?id=" + this.ID + "&format=json&json=answer", senpai.LoginCookies, lPostArgs);
+
+                this.getMessages(this.Nachrichten.Last().NachrichtID);
+            }
+        }

         /// <summary>
         ///


Revert "Fix null ref"

Revert "Fix null ref"

This reverts commit dc526d8d47754343897aa0349c1b0cc3ad008ebf.

--- Python/Product/Analysis/Values/BuiltinNamespace.cs
+++ Python/Product/Analysis/Values/BuiltinNamespace.cs
@@ -133,6 +133,6 @@
             return false;
         }

-        public override int GetHashCode() => new { hc1 = GetType().GetHashCode(), hc2 = _type?.GetHashCode() }.GetHashCode();
+        public override int GetHashCode() => new { hc1 = GetType().GetHashCode(), hc2 = _type.GetHashCode() }.GetHashCode();
     }
 }


Fix 'add folder' button not being added sometimes

Fixes #281

--- src/SyncTrayzor/Pages/ViewerViewModel.cs
+++ src/SyncTrayzor/Pages/ViewerViewModel.cs
@@ -146,19 +146,36 @@
             {
                 if (e.Frame.IsMain && e.Url != "about:blank")
                 {
-                    var addOpenFolder =
-                    @"$('#folders .panel-footer .pull-right').prepend(" +
-                    @"  '<button class=""btn btn-sm btn-default"" onclick=""callbackObject.openFolder(angular.element(this).scope().folder.id)"">" +
-                    @"      " +
-                    @"      " + Resources.ViewerView_OpenFolder + @"" +
-                    @"  </button>')";
-                    webBrowser.ExecuteScriptAsync(addOpenFolder);
-
-                    var addFolderBrowse =
+                    // I tried to do this using Syncthing's events, but it's very painful - the DOM is updated some time
+                    // after the event is fired. It's a lot easier to just watch for changes on the DOM.
+                    var addOpenFolderButton =
+                    @"var syncTrayzorAddOpenFolderButton = function(elem) {" +
+                    @"    var $buttonContainer = elem.find('.panel-footer .pull-right');" +
+                    @"    $buttonContainer.find('.panel-footer .synctrayzor-add-folder-button').remove();" +
+                    @"    $buttonContainer.prepend(" +
+                    @"      '<button class=""btn btn-sm btn-default synctrayzor-add-folder-button"" onclick=""callbackObject.openFolder(angular.element(this).scope().folder.id)"">" +
+                    @"          " +
+                    @"          " + Resources.ViewerView_OpenFolder + @"" +
+                    @"      </button>');" +
+                    @"};" +
+                    @"new MutationObserver(function(mutations, observer) {" +
+                    @"  for (var i = 0; i < mutations.length; i++) {" +
+                    @"    for (var j = 0; j < mutations[i].addedNodes.length; j++) {" +
+                    @"      syncTrayzorAddOpenFolderButton($(mutations[i].addedNodes[j]));" +
+                    @"    }" +
+                    @"  }" +
+                    @"}).observe(document.getElementById('folders'), {" +
+                    @"  childList: true" +
+                    @"});" +
+                    @"syncTrayzorAddOpenFolderButton($('#folders'));" +
+                    @"";
+                    webBrowser.ExecuteScriptAsync(addOpenFolderButton);
+
+                    var addFolderBrowse =
                     @"$('#folderPath').wrap($('
').css('display', 'flex'));" +
                     @"$('#folderPath').after(" +
                     @"  $('<button>').attr('id', 'folderPathBrowseButton')" +
-                    @"               .addClass('btn btn-sm btn-default')" +
+                    @"               .addClass('btn btn-sm btn-default')" +
                     @"               .html('" + Resources.ViewerView_BrowseToFolder + @"')" +
                     @"               .css({'flex-grow': 1, 'margin': '0 0 0 5px'})" +
                     @"               .on('click', function() { callbackObject.browseFolderPath() })" +


Remove Span(T[],int) ctor from System.Runtime (#23558)

--- src/System.Runtime/ref/System.Runtime.cs
+++ src/System.Runtime/ref/System.Runtime.cs
@@ -1836,7 +1836,6 @@
     {
         public static ReadOnlySpan<T> Empty { get { throw null; } }
         public ReadOnlySpan(T[] array) { throw null; }
-        public ReadOnlySpan(T[] array, int start) { throw null; }
         public ReadOnlySpan(T[] array, int start, int length) { throw null; }
         [CLSCompliant(false)]
         public unsafe ReadOnlySpan(void* pointer, int length) { throw null; }
@@ -2022,7 +2021,6 @@
     {
         public static Span<T> Empty { get { throw null; } }
         public Span(T[] array) { throw null; }
-        public Span(T[] array, int start) { throw null; }
         public Span(T[] array, int start, int length) { throw null; }
         [CLSCompliant(false)]
         public unsafe Span(void* pointer, int length) { throw null; }


Adding filter to PersonPartIndexProvider

--- Indexes/PersonPartIndex.cs
+++ Indexes/PersonPartIndex.cs
@@ -25,27 +25,24 @@
         // Notice that ContentItem is what we are describing the provider for not the part.
         public override void Describe(DescribeContext<ContentItem> context) =>
             context.For<PersonPartIndex>()
+                // Note that we can write any logic in here to determine when an index record should be created for a content item. Here we'll have a
+                // record for every content item possessing a PersonPart. However, we could e.g. only have an index for only published items (if you
+                // don't want to query on drafts; you can check contentItem.Published), or only on the latest ones (regardless of it being a draft or
+                // published version; contentItem.Latest shows this). Not cluttering up the index table with unnecessary rows can help with
+                // performance and makes managing the database easier overall.
+                .When(contentItem => contentItem.Has<PersonPart>())
+                // Note that there is a lot more to index providers than just Map() and When() (although these are what you need to use the most), see
+                // the YesSQL documentation: https://github.com/sebastienros/yessql/wiki/Tutorial
                 .Map(contentItem =>
                 {
                     var personPart = contentItem.As<PersonPart>();

-                    // Note that we can write any logic in here to determine when an index record should be created for
-                    // a content item. Here we'll have a record for every content item possessing a PersonPart.
-                    // However, we could e.g. only have an index for only published items (if you don't want to query
-                    // on drafts; you can check contentItem.Published), or only on the latest ones (regardless of it
-                    // being a draft or published version; contentItem.Latest shows this).
-                    // Not cluttering up the index table with unnecessary rows can help with performance and makes
-                    // managing the database easier overall.
-                    // Also note that there is a lot more to index providers than just Map() (although this is what you
-                    // need to use the most), see the YesSQL documentation: https://github.com/sebastienros/yessql/wiki/Tutorial
-                    return personPart == null
-                        ? null
-                        : new PersonPartIndex
-                        {
-                            ContentItemId = contentItem.ContentItemId,
-                            BirthDateUtc = personPart.BirthDateUtc,
-                            Handedness = personPart.Handedness,
-                        };
+                    return new PersonPartIndex
+                    {
+                        ContentItemId = contentItem.ContentItemId,
+                        BirthDateUtc = personPart.BirthDateUtc,
+                        Handedness = personPart.Handedness,
+                    };
                 });
     }


Automatic layout update when dependency properties changed

--- ResponsiveGrid.Shared/ResponsiveGrid.Properties.cs
+++ ResponsiveGrid.Shared/ResponsiveGrid.Properties.cs
@@ -25,19 +25,46 @@
             get { return (int)GetValue(MaxDivisionProperty); }
             set { SetValue(MaxDivisionProperty, value); }
         }
+#if WINDOWS_WPF
         // Using a DependencyProperty as the backing store for MaxDivision.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty MaxDivisionProperty =
-            DependencyProperty.Register("MaxDivision", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(12));
-
+            DependencyProperty.Register("MaxDivision",
+                                        typeof(int),
+                                        typeof(ResponsiveGrid),
+                                        new FrameworkPropertyMetadata(12, FrameworkPropertyMetadataOptions.AffectsMeasure));
+#elif WINDOWS_UWP
+        // Using a DependencyProperty as the backing store for MaxDivision.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty MaxDivisionProperty =
+            DependencyProperty.Register("MaxDivision", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(12, OnDependencyPropertyChanged));
+
+        private static void OnDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var element = d as FrameworkElement;
+            var parent = element?.Parent as ResponsiveGrid;
+            parent?.InvalidateMeasure();
+        }
+#else
+#endif

         public BreakPoints BreakPoints
         {
             get { return (BreakPoints)GetValue(BreakPointsProperty); }
             set { SetValue(BreakPointsProperty, value); }
         }
+#if WINDOWS_WPF
         // Using a DependencyProperty as the backing store for BreakPoints.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty BreakPointsProperty =
-            DependencyProperty.Register("BreakPoints", typeof(BreakPoints), typeof(ResponsiveGrid), new PropertyMetadata(null));
+            DependencyProperty.Register("BreakPoints",
+                                        typeof(BreakPoints),
+                                        typeof(ResponsiveGrid),
+                                        new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsMeasure));
+#elif WINDOWS_UWP
+        // Using a DependencyProperty as the backing store for BreakPoints.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty BreakPointsProperty =
+            DependencyProperty.Register("BreakPoints", typeof(BreakPoints), typeof(ResponsiveGrid), new PropertyMetadata(null, OnDependencyPropertyChanged));
+#else
+#endif
+
         #endregion

@@ -61,9 +88,9 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for XS.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty XSProperty =
-            DependencyProperty.RegisterAttached("XS", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
-
-        private static void OnPropChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+            DependencyProperty.RegisterAttached("XS", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
+
+        private static void OnAttachedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
         {
             var element = d as FrameworkElement;
             var parent = element?.Parent as ResponsiveGrid;
@@ -90,7 +117,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for SM.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty SMProperty =
-            DependencyProperty.RegisterAttached("SM", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("SM", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -112,7 +139,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for MD.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty MDProperty =
-            DependencyProperty.RegisterAttached("MD", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("MD", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -134,7 +161,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for LG.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty LGProperty =
-            DependencyProperty.RegisterAttached("LG", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("LG", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -159,7 +186,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for XS_Offset.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty XS_OffsetProperty =
-            DependencyProperty.RegisterAttached("XS_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("XS_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -181,7 +208,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for SM_Offset.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty SM_OffsetProperty =
-            DependencyProperty.RegisterAttached("SM_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("SM_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -203,7 +230,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for MD_Offset.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty MD_OffsetProperty =
-            DependencyProperty.RegisterAttached("MD_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("MD_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -225,7 +252,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for LG_Offset.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty LG_OffsetProperty =
-            DependencyProperty.RegisterAttached("LG_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("LG_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -251,7 +278,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for XS_Push.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty XS_PushProperty =
-            DependencyProperty.RegisterAttached("XS_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("XS_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -273,7 +300,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for SM_Push.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty SM_PushProperty =
-            DependencyProperty.RegisterAttached("SM_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("SM_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -295,7 +322,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for MD_Push.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty MD_PushProperty =
-            DependencyProperty.RegisterAttached("MD_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("MD_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -317,7 +344,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for LG_Push.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty LG_PushProperty =
-            DependencyProperty.RegisterAttached("LG_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("LG_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -343,7 +370,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for XS_Pull.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty XS_PullProperty =
-            DependencyProperty.RegisterAttached("XS_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("XS_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -365,7 +392,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for SM_Pull.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty SM_PullProperty =
-            DependencyProperty.RegisterAttached("SM_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("SM_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -387,7 +414,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for MD_Pull.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty MD_PullProperty =
-            DependencyProperty.RegisterAttached("MD_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("MD_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif

@@ -409,7 +436,7 @@
 #elif WINDOWS_UWP
         // Using a DependencyProperty as the backing store for LG_Pull.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty LG_PullProperty =
-            DependencyProperty.RegisterAttached("LG_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnPropChanged));
+            DependencyProperty.RegisterAttached("LG_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
 #else
 #endif


Dont call Thread.GetDomain() more than needed

--- src/Umbraco.Web/UmbracoContextFactory.cs
+++ src/Umbraco.Web/UmbracoContextFactory.cs
@@ -90,7 +90,8 @@

         public static HttpContextBase EnsureHttpContext(HttpContextBase httpContext = null)
         {
-            if (Thread.GetDomain().GetData(".appPath") is null || Thread.GetDomain().GetData(".appVPath") is null)
+            var domain = Thread.GetDomain();
+            if (domain.GetData(".appPath") is null || domain.GetData(".appVPath") is null)
             {
                 return httpContext ?? new HttpContextWrapper(HttpContext.Current ??
                                                              new HttpContext(new SimpleWorkerRequest("", "", "null.aspx", "", NullWriterInstance)));


Remove elevation check. Work items: 788

Remove elevation check.
Work items: 788

--- src/VisualStudio/ProductUpdateService.cs
+++ src/VisualStudio/ProductUpdateService.cs
@@ -11,8 +11,6 @@
     [Export(typeof(IProductUpdateService))]
     internal class ProductUpdateService : IProductUpdateService {
         private static readonly Guid ExtensionManagerCommandGuid = new Guid("{5dd0bb59-7076-4c59-88d3-de36931f63f0}");
-        private static readonly Lazy<bool> _isElevated = new Lazy<bool>(IsElevated);
-
         private const string NuGetVSIXId = "NuPackToolsVsix.Microsoft.67e54e40-0ae3-42c5-a949-fddf5739e7a5";
         private const int ExtensionManagerCommandId = (int)0xBB8;
         private readonly IMenuCommandService _menuCommandService;
@@ -35,7 +33,7 @@

         public void CheckForAvailableUpdateAsync() {
             // If the user isn't admin then they can't perform update check.
-            if (!_isElevated.Value || _updateDeclined || _updateAccepted) {
+            if (_updateDeclined || _updateAccepted) {
                 return;
             }

@@ -60,12 +58,6 @@
                 }

             });
-        }
-
-        private static bool IsElevated() {
-            WindowsIdentity identity = WindowsIdentity.GetCurrent();
-            var principal = new WindowsPrincipal(identity);
-            return principal.IsInRole(WindowsBuiltInRole.Administrator);
         }

         private void RaiseUpdateEvent(ProductUpdateAvailableEventArgs args) {


Remove unneeded Log.Template.cs

Remove unneeded Log.Template.cs

--- Source/LogBridge/Log.Template.cs
+++ Source/LogBridge/Log.Template.cs
@@ -1,228 +0,0 @@
-/// <summary>
-/// Logs the given message if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="message">The message.</param>
-/// <returns>A unique event id.</returns>
-public static Guid LOGLEVEL(string message)
-{
-    return Logger.LogEntry(null, null, Level.LOGLEVEL, null, message);
-}
-//-----
-/// <summary>
-/// Logs the Message property of the given exception if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="exception">The exception to log. If it is null <see cref="NullExceptionMessage "/> is logged.</param>
-/// <returns>A unique event id.</returns>
-public static Guid LOGLEVEL(Exception exception)
-{
-    return Logger.LogEntry(null, exception, Level.LOGLEVEL, null, ExceptionMessage(exception));
-}
-//-----
-/// <summary>
-/// Logs the given exception and message if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="exception">The exception to log. If it is null <see cref="NullExceptionMessage "/> is logged.</param>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Exception exception, string message, params object[] messageParameters)
-{
-    return Logger.LogEntry(null, exception, Level.LOGLEVEL, null, message, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given exception if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="correlationId">The correlation id for the log event.</param>
-/// <param name="exception">The exception to log. If it is null <see cref="NullExceptionMessage "/> is logged.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Guid correlationId, Exception exception)
-{
-    return Logger.LogEntry(correlationId, exception, Level.LOGLEVEL, null, exception == null ? NullExceptionMessage : exception.Message);
-}
-//-----
-/// <summary>
-/// Logs the given exception and message if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="correlationId">The correlation id for the log event.</param>
-/// <param name="exception">The exception to log. If it is null <see cref="NullExceptionMessage "/> is logged.</param>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Guid correlationId, Exception exception, string message, params object[] messageParameters)
-{
-    return Logger.LogEntry(correlationId, exception, Level.LOGLEVEL, null, message, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given exception and message if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="exception">The exception to log. If it is null <see cref="NullExceptionMessage "/> is logged.</param>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="firstMessageParameter">The first curly brace parameter (necessary due to overload resolution).</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Exception exception, string message, string firstMessageParameter, params object[] messageParameters)
-{
-    return Logger.LogEntry(null, exception, Level.LOGLEVEL, null, message, firstMessageParameter, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given exception and message if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="correlationId">The correlation id for the log event.</param>
-/// <param name="exception">The exception to log. If it is null <see cref="NullExceptionMessage "/> is logged.</param>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="firstMessageParameter">The first curly brace parameter (necessary due to overload resolution).</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Guid correlationId, Exception exception, string message, string firstMessageParameter, params object[] messageParameters)
-{
-    return Logger.LogEntry(correlationId, exception, Level.LOGLEVEL, null, message, firstMessageParameter, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given exception and extended properties object if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="exception">The exception to log. If it is null <see cref="NullExceptionMessage "/> is logged.</param>
-/// <param name="extendedProperties">Each property will be added to properties of the log event. If it is null, it is ignored.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Exception exception, object extendedProperties)
-{
-    return Logger.LogEntry(null, exception, Level.LOGLEVEL, extendedProperties, ExceptionMessage(exception));
-}
-//-----
-/// <summary>
-/// Logs the given exception and extended properties object if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="correlationId">The correlation id for the log event.</param>
-/// <param name="exception">The exception to log. If it is null <see cref="NullExceptionMessage "/> is logged.</param>
-/// <param name="extendedProperties">Each property will be added to properties of the log event. If it is null, it is ignored.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Guid correlationId, Exception exception, object extendedProperties)
-{
-    return Logger.LogEntry(correlationId, exception, Level.LOGLEVEL, extendedProperties, ExceptionMessage(exception));
-}
-
-/// <summary>
-/// Logs the given exception and extended properties object if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="exception">The exception to log. If it is null <see cref="NullExceptionMessage "/> is logged.</param>
-/// <param name="extendedProperties">Each property will be added to properties of the log event. If it is null, it is ignored.</param>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Exception exception, object extendedProperties, string message, params object[] messageParameters)
-{
-    return Logger.LogEntry(null, exception, Level.LOGLEVEL, extendedProperties, message, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given exception and extended properties object if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="correlationId">The correlation id for the log event.</param>
-/// <param name="exception">The exception to log. If it is null <see cref="NullExceptionMessage "/> is logged.</param>
-/// <param name="extendedProperties">Each property will be added to properties of the log event. If it is null, it is ignored.</param>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Guid correlationId, Exception exception, object extendedProperties, string message, params object[] messageParameters)
-{
-    return Logger.LogEntry(correlationId, exception, Level.LOGLEVEL, extendedProperties, message, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given message if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(string message, params object[] messageParameters)
-{
-    return Logger.LogEntry(null, null, Level.LOGLEVEL, null, message, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given message if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="correlationId">The correlation id for the log event.</param>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Guid correlationId, string message, params object[] messageParameters)
-{
-    return Logger.LogEntry(correlationId, null, Level.LOGLEVEL, null, message, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given message if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="firstMessageParameter">The first curly brace parameter (necessary due to overload resolution).</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(string message, string firstMessageParameter, params object[] messageParameters)
-{
-    return Logger.LogEntry(null, null, Level.LOGLEVEL, null, message, firstMessageParameter, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given message if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="correlationId">The correlation id for the log event.</param>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="firstMessageParameter">The first curly brace parameter (necessary due to overload resolution).</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Guid correlationId, string message, string firstMessageParameter, params object[] messageParameters)
-{
-    return Logger.LogEntry(correlationId, null, Level.LOGLEVEL, null, message, firstMessageParameter, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given extended properties object if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="extendedProperties">Each property will be added to properties of the log event.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(object extendedProperties)
-{
-    return Logger.LogEntry(null, null, Level.LOGLEVEL, extendedProperties, string.Empty);
-}
-//-----
-/// <summary>
-/// Logs the given extended properties object if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="correlationId">The correlation id for the log event.</param>
-/// <param name="extendedProperties">Each property will be added to properties of the log event.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Guid correlationId, object extendedProperties)
-{
-    return Logger.LogEntry(correlationId, null, Level.LOGLEVEL, extendedProperties, string.Empty);
-}
-//-----
-/// <summary>
-/// Logs the given message and extended properties object if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="extendedProperties">Each property will be added to properties of the log event.</param>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(object extendedProperties, string message, params object[] messageParameters)
-{
-    return Logger.LogEntry(null, null, Level.LOGLEVEL, extendedProperties, message, messageParameters);
-}
-//-----
-/// <summary>
-/// Logs the given message and extended properties object if LOGLEVEL level is enabled.
-/// </summary>
-/// <param name="correlationId">The correlation id for the log event.</param>
-/// <param name="extendedProperties">Each property will be added to properties of the log event.</param>
-/// <param name="message">The message with optional curly brace parameters.</param>
-/// <param name="messageParameters">Matching parameters for curly braces in message.</param>
-/// <returns>The unique event id.</returns>
-public static Guid LOGLEVEL(Guid correlationId, object extendedProperties, string message, params object[] messageParameters)
-{
-    return Logger.LogEntry(correlationId, null, Level.LOGLEVEL, extendedProperties, message, messageParameters);
-}
-//-----
-


[CFM_611] Bloodfury Potion

[CFM_611] Bloodfury Potion

--- SabberStoneCore/CardSets/Standard/GangsCardsGen.cs
+++ SabberStoneCore/CardSets/Standard/GangsCardsGen.cs
@@ -1546,11 +1546,13 @@
 			// - REQ_TARGET_TO_PLAY = 0
 			// --------------------------------------------------------
 			cards.Add("CFM_611", new List<Enchantment> {
-				// TODO [CFM_611] Bloodfury Potion && Test: Bloodfury Potion_CFM_611
-				new Enchantment
-				{
-					Activation = EnchantmentActivation.SPELL,
-					SingleTask = null,
+				new Enchantment
+				{
+					Activation = EnchantmentActivation.SPELL,
+					SingleTask = ComplexTask.Create(
+                        new SelfConditionTask(EntityType.TARGET, SelfCondition.IsRace(Race.DEMON)),
+                        new FlagTask(true, new BuffTask(Buffs.AttackHealth(3), EntityType.TARGET)),
+                        new FlagTask(false, new BuffTask(Buffs.Attack(3), EntityType.TARGET))),
 				},
 			});


Two helper methods added.

Two helper methods added.

--- SimpleServiceLocator/SimpleInjector.NET/Helpers.cs
+++ SimpleServiceLocator/SimpleInjector.NET/Helpers.cs
@@ -45,6 +45,16 @@
 #if !SILVERLIGHT
         private static long dynamicClassCounter;
 #endif
+        internal static Lazy<T> ToLazy<T>(T value)
+        {
+            return new Lazy<T>(() => value, LazyThreadSafetyMode.None);
+        }
+
+        internal static IEnumerable<T> Concat<T>(this IEnumerable<T> source, T element)
+        {
+            return source.Concat(Enumerable.Repeat(element, 1));
+        }
+
         internal static string ToCommaSeparatedText(this IEnumerable<string> values)
         {
             var names = values.ToArray();


Fix exception when there is a device without configuration

--- MultiMiner.Win/MainForm.cs
+++ MultiMiner.Win/MainForm.cs
@@ -422,10 +422,11 @@

                 foreach (DataGridViewCell gridCell in gridRow.Cells)
                 {
-                    if (deviceConfiguration.Enabled)
+                    //deviceConfiguration may be null - may be a device that hasn't been configured
+                    if ((deviceConfiguration != null) && !deviceConfiguration.Enabled)
+                        gridCell.Style.ForeColor = SystemColors.GrayText;
+                    else
                         gridCell.Style.ForeColor = SystemColors.WindowText;
-                    else
-                        gridCell.Style.ForeColor = SystemColors.GrayText;
                 }
             }
         }


Clear miner (temp, accepted, etc) stats when stopping mining

--- MultiMiner.Win/MainForm.cs
+++ MultiMiner.Win/MainForm.cs
@@ -453,8 +453,8 @@
             scryptRateLabel.Text = string.Empty;
             sha256RateLabel.Text = string.Empty;
             notifyIcon1.Text = "MultiMiner - Stopped";
-
             UpdateMiningButtons();
+            ClearMinerStats();
         }

         private void startButton_Click(object sender, EventArgs e)
@@ -538,16 +538,24 @@
                 return;

             foreach (DataGridViewRow row in deviceGridView.Rows)
-            {
                 if (row.Cells[coinColumn.Index].Value == null)
-                {
-                    row.Cells[temperatureColumn.Index].Value = null;
-                    row.Cells[hashRateColumn.Index].Value = null;
-                    row.Cells[acceptedColumn.Index].Value = null;
-                    row.Cells[rejectedColumn.Index].Value = null;
-                    row.Cells[errorsColumn.Index].Value = null;
-                }
-            }
+                    ClearMinerStatsForRow(row);
+        }
+
+        private void ClearMinerStatsForRow(DataGridViewRow row)
+        {
+            row.Cells[temperatureColumn.Index].Value = null;
+            row.Cells[hashRateColumn.Index].Value = null;
+            row.Cells[acceptedColumn.Index].Value = null;
+            row.Cells[rejectedColumn.Index].Value = null;
+            row.Cells[errorsColumn.Index].Value = null;
+            row.Cells[intensityColumn.Index].Value = null;
+        }
+
+        private void ClearMinerStats()
+        {
+            foreach (DataGridViewRow row in deviceGridView.Rows)
+                ClearMinerStatsForRow(row);
         }

         private void ClearCoinStatsForDisabledCoins()