BUG FIX prevent references to null scene (as happens on mesh uploads)

--- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -529,21 +529,21 @@
             set
             {
                 Vector3 val = value;
-
-                if (!IsAttachmentCheckFull() && !Scene.LoadingPrims &&
-                    ( Scene.TestBorderCross(val, Cardinals.E) ||
+                if (Scene != null && !IsAttachmentCheckFull()
+                    && !Scene.LoadingPrims &&
+                    (Scene.TestBorderCross(val, Cardinals.E) ||
                       Scene.TestBorderCross(val, Cardinals.W) ||
                       Scene.TestBorderCross(val, Cardinals.N) ||
                       Scene.TestBorderCross(val, Cardinals.S))
                     )
                 {
-                        if (!inTransit)
-                        {
-                            inTransit = true;
-                            SOGCrossDelegate d = CrossAsync;
-                            d.BeginInvoke(this, val, CrossAsyncCompleted, d);
-                        }
-                        return;
+                    if (!inTransit)
+                    {
+                        inTransit = true;
+                        SOGCrossDelegate d = CrossAsync;
+                        d.BeginInvoke(this, val, CrossAsyncCompleted, d);
+                    }
+                    return;
                 }

                 if (RootPart.GetStatusSandbox())
@@ -581,6 +581,7 @@
                 {
                     av.sitSOGmoved();
                 }
+

                 // now that position is changed tell it to scripts
                 if (triggerScriptEvent)
@@ -591,7 +592,9 @@
                     }
                 }

-                Scene.EventManager.TriggerParcelPrimCountTainted();
+                if (Scene != null)
+                    Scene.EventManager.TriggerParcelPrimCountTainted();
+
             }
         }

@@ -789,7 +792,7 @@
             {
                 if (agent.ParentUUID != UUID.Zero)
                 {
-                    agent.ClearControls();
+                    agent.HandleForceReleaseControls(agent.ControllingClient,agent.UUID);
                     agent.ParentPart = null;
 //                    agent.ParentPosition = Vector3.Zero;
 //                    agent.ParentUUID = UUID.Zero;


UI tweaks; tooltips; fix accept button

UI tweaks; tooltips; fix accept button

--- Source/CapComWindow.cs
+++ Source/CapComWindow.cs
@@ -72,6 +72,7 @@
 			ClampToScreenOffset = new RectOffset(-650, -650, -300, -300);
 			TooltipMouseOffset = new Vector2d(-10, -25);

+
 			currentList = 0;

 			CC_SkinsLibrary.SetCurrent("CCUnitySkin");
@@ -84,6 +85,7 @@
 			WindowRect.x = CapCom.Settings.windowPosX;
 			WindowRect.y = CapCom.Settings.windowPosY;
 			WindowRect.yMax = WindowRect.y + CapCom.Settings.windowHeight;
+			TooltipsEnabled = CapCom.Settings.tooltipsEnabled;
 		}

 		protected override void OnDestroy()
@@ -437,7 +439,7 @@
 		private void closeButton(int id)
 		{
 			Rect r = new Rect(WindowRect.width - 60, 1, 24, 24);
-			if (GUI.Button(r, CapComSkins.settingsIcon, CapComSkins.textureButton))
+			if (GUI.Button(r, new GUIContent(CapComSkins.settingsIcon, "Settings Menu"), CapComSkins.textureButton))
 			{
 				if (settings == null)
 					settings = gameObject.AddComponent<CapComSettingsWindow>();
@@ -461,14 +463,14 @@

 			toggleIcon(r, t, CapCom.Settings.sortMode == 0);

-			if (GUI.Button(t, "", CapComSkins.iconButton))
+			if (GUI.Button(t, new GUIContent("", "Sort By Difficulty"), CapComSkins.iconButton))
 			{
 				CapCom.Settings.sortMode = 0;
 				CapCom.Settings.Save();
 				sortContracts();
 			}

-			if (GUI.Button(r, CapComSkins.sortStars, CapComSkins.iconButton))
+			if (GUI.Button(r, new GUIContent(CapComSkins.sortStars, "Sort By Difficulty") , CapComSkins.iconButton))
 			{
 				CapCom.Settings.sortMode = 0;
 				CapCom.Settings.Save();
@@ -476,11 +478,13 @@
 			}

 			r.x += 180;
+			r.y += 4;
+			r.height = 40;
 			t.x += 180;

 			toggleIcon(r, t, CapCom.Settings.sortMode == 4);

-			if (GUI.Button(t, "", CapComSkins.iconButton))
+			if (GUI.Button(t, new GUIContent("", "Sort By Agency"), CapComSkins.iconButton))
 			{
 				CapCom.Settings.sortMode = 4;
 				CapCom.Settings.Save();
@@ -489,7 +493,7 @@

 			GUI.DrawTextureWithTexCoords(r, CapComSkins.missionControlTexture, CapComSkins.flagRect);

-			if (GUI.Button(r, CapComSkins.currentFlag, CapComSkins.iconButton))
+			if (GUI.Button(r, new GUIContent(CapComSkins.currentFlag, "Sort By Agency"), CapComSkins.iconButton))
 			{
 				CapCom.Settings.sortMode = 4;
 				CapCom.Settings.Save();
@@ -497,19 +501,20 @@
 			}

 			r.x -= 90;
+			r.y -= 4;
 			r.width = 58;
 			r.height = 48;
 			t.x -= 95;

 			toggleIcon(r, t, CapCom.Settings.sortMode == 1 || CapCom.Settings.sortMode == 2 || CapCom.Settings.sortMode == 3);

-			if (GUI.Button(t, "", CapComSkins.iconButton))
+			if (GUI.Button(t, new GUIContent("", "Sort By Rewards"), CapComSkins.iconButton))
 			{
 				dropdown = !dropdown;
 				sortMenu = !sortMenu;
 			}

-			if (GUI.Button(r, "", CapComSkins.iconButton))
+			if (GUI.Button(r, new GUIContent("", "Sort By Rewards"), CapComSkins.iconButton))
 			{
 				dropdown = !dropdown;
 				sortMenu = !sortMenu;
@@ -560,9 +565,9 @@
 			r.x = 270;
 			r.y = 26;
 			r.width = 60;
-			r.height = 38;
-
-			if (GUI.Button(r, CapCom.Settings.ascending ? CapComSkins.orderAsc : CapComSkins.orderDesc, CapComSkins.textureButton))
+			r.height = 45;
+
+			if (GUI.Button(r, new GUIContent(CapCom.Settings.ascending ? CapComSkins.orderAsc : CapComSkins.orderDesc, "Ascending/Descending Order"), CapComSkins.textureButton))
 			{
 				CapCom.Settings.ascending = !CapCom.Settings.ascending;
 				CapCom.Settings.Save();
@@ -675,16 +680,16 @@

 				bool active = !CapCom.Settings.activeLimit || ContractSystem.Instance.GetActiveContractCount() < GameVariables.Instance.GetActiveContractsLimit(ScenarioUpgradeableFacilities.GetFacilityLevel(SpaceCenterFacility.MissionControl));

-				if (GUI.Button(r, "", CapComSkins.iconButton))
+				if (GUI.Button(r, new GUIContent("", "Accept"), CapComSkins.iconButton))
 				{
 					if (active)
 						currentContract.Root.Accept();
 				}
-				drawTextureButton(r, CapComSkins.acceptButtonActive, CapComSkins.acceptButtonHover, CapComSkins.acceptButtonNormal, CapComSkins.acceptButtonInactive, CapComSkins.missionControlTexture, active);
+				drawTextureButton(r, CapComSkins.acceptButtonActive, CapComSkins.acceptButtonHover, CapComSkins.acceptButtonNormal, CapComSkins.acceptButtonInactive, CapComSkins.missionControlTexture, !active);

 				r.y += 65;

-				if (GUI.Button(r, "", CapComSkins.iconButton))
+				if (GUI.Button(r, new GUIContent("", "Decline"), CapComSkins.iconButton))
 				{
 					if (CapCom.Settings.forceDecline || currentContract.CanBeDeclined)
 					{
@@ -705,7 +710,7 @@

 				Rect r = new Rect(WindowRect.width - 60, 100, 44, 44);

-				if (GUI.Button(r, "", CapComSkins.iconButton))
+				if (GUI.Button(r, new GUIContent("", "Cancel"), CapComSkins.iconButton))
 				{
 					if (currentContract.CanBeCancelled)
 					{
@@ -835,8 +840,9 @@
 				if (CapCom.Settings.hideNotes)
 				{
 					Rect r = GUILayoutUtility.GetLastRect();
-					r.x += 120;
-					r.width = 13;
+					r.x += 100;
+					r.y += 2;
+					r.width = 16;
 					r.height = 16;
 					if (GUI.Button(r, currentContract.ShowNotes ? CapComSkins.notesMinusIcon : CapComSkins.notesPlusIcon, CapComSkins.textureButton))
 						currentContract.ShowNotes = !currentContract.ShowNotes;
@@ -902,7 +908,7 @@
 					{
 						b.x -= 28;
 						b.height = 16;
-						b.width = 13;
+						b.width = 16;
 						if (GUI.Button(b, cp.ShowNotes ? CapComSkins.notesMinusIcon :CapComSkins.notesPlusIcon, CapComSkins.textureButton))
 							cp.ShowNotes = !cp.ShowNotes;

@@ -916,8 +922,8 @@
 					{
 						b.x -= 14;
 						b.y += 4;
-						b.height = 10;
-						b.width = 10;
+						b.height = 12;
+						b.width = 12;
 						GUI.DrawTexture(b, parameterStateIcon(cp.Param));
 					}

@@ -1038,10 +1044,10 @@
 			{
 				if (sortMenu)
 				{
-					ddRect = new Rect(65, 100, 100, 100);
+					ddRect = new Rect(88, 68, 106, 100);
 					GUI.Box(ddRect, "");
-					Rect r = new Rect(ddRect.x + 5, ddRect.y + 5, 90, 20);
-					GUI.Label(r, "Sort Options:");
+					Rect r = new Rect(ddRect.x + 5, ddRect.y + 5, 100, 20);
+					GUI.Label(r, "Sort Options:", CapComSkins.titleText);
 					for (int i = 1; i < 4; i++)
 					{
 						r.y += 22;


remove redundant lastPhysGroupPos and lastPhysGroupRot checks  in SOG Update(). rootpart does more complet checks

--- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -307,9 +307,6 @@
             get { return RootPart.VolumeDetectActive; }
         }

-        private Vector3 lastPhysGroupPos;
-        private Quaternion lastPhysGroupRot;
-
         private bool m_isBackedUp;

         public bool IsBackedUp
@@ -2525,6 +2522,7 @@

         #endregion

+
         public override void Update()
         {
             // Check that the group was not deleted before the scheduled update
@@ -2543,19 +2541,8 @@
             // check to see if the physical position or rotation warrant an update.
             if (m_rootPart.UpdateFlag == UpdateRequired.NONE)
             {
-                bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
-
-                if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f))
-                {
-                    m_rootPart.UpdateFlag = UpdateRequired.TERSE;
-                    lastPhysGroupPos = AbsolutePosition;
-                }
-
-                if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
-                {
-                    m_rootPart.UpdateFlag = UpdateRequired.TERSE;
-                    lastPhysGroupRot = GroupRotation;
-                }
+                // rootpart SendScheduledUpdates will check if a update is needed
+                m_rootPart.UpdateFlag = UpdateRequired.TERSE;
             }

             SceneObjectPart[] parts = m_parts.GetArray();


Optimize UUID.Parse()

Optimize UUID.Parse()

--- Authentication.cs
+++ Authentication.cs
@@ -64,18 +64,16 @@

 		public static UUID Parse (string hex)
 		{
-			byte[] guidData = SaslClient.FromHex (hex);
-			if (guidData.Length != ByteLength)
+			if (hex.Length != ByteLength * 2)
 				throw new Exception ("Cannot parse UUID/GUID of invalid length");

 			UUID id = new UUID ();
-			//fixed (byte* bp = &guidData[0]) {
-			fixed (byte* bp = guidData) {
-				int* p = (int*)bp;
-				id.a = p[0];
-				id.b = p[1];
-				id.c = p[2];
-				id.d = p[3];
+
+			byte* result = (byte*)&id.a;
+			int n = 0, i = 0;
+			while (n < ByteLength) {
+				result[n] = (byte)(SaslClient.FromHexChar (hex[i++]) << 4);
+				result[n++] += SaslClient.FromHexChar (hex[i++]);
 			}

 			return id;
@@ -245,7 +243,7 @@
 		}

 		//From Mono.Security.Cryptography
-		static private byte FromHexChar (char c)
+		static public byte FromHexChar (char c)
 		{
 			if ((c >= 'a') && (c <= 'f'))
 				return (byte) (c - 'a' + 10);


Successfully switched to CRC-16-IBM :D

Successfully switched to CRC-16-IBM :D

--- Source/Fragment/CRC.cs
+++ Source/Fragment/CRC.cs
@@ -7,16 +7,6 @@
   ///   The CRC thing to check and generate checksums for fragments. Uses CRC-16.
   /// </summary>
   public static class CRC {
-
-    /// <summary>
-    /// CRC-16-IBM polynomial.
-    /// </summary>
-    private const ushort Polynomial = 0x8005;
-
-    /// <summary>
-    /// Testing polynomial.
-    /// </summary>
-    private const byte SimplePolynomial = 0xD5;

     /// <summary>
     ///   Generates a checksum and appends it to a fragment.
@@ -44,30 +34,44 @@
     /// <summary>
     ///   Generates a checksum.
     /// </summary>
-    private static byte GetChecksum(byte[] fragment) {
-      // TODO: Use CRC-16, ushort
-
+    /// <remarks>
+    ///   http://www.barrgroup.com/Embedded-Systems/How-To/CRC-Calculation-C-Code
+    /// </remarks>
+    private static ushort GetChecksum(byte[] fragment) {
       // the remainder
-      byte remainder = 0;
+      ushort remainder = 0;

       // iterate bytes
       foreach (var fragmentByte in fragment) {
         // bring the byte to the remainder
-        remainder ^= fragmentByte; // TODO: fragmentByte << 8
+        remainder ^= (ushort) (fragmentByte << 8);

         // perform division, a bit at a time
         for (short bit = 8; bit > 0; --bit) {
-          if ((remainder & (1 << 7)) > 0) // TODO: Use 1 << 15
-            remainder = (byte) ((remainder << 1) ^ SimplePolynomial);
+          if ((remainder & TopBit) != 0)
+            remainder = (ushort) ((remainder << 1) ^ Polynomial);
           else
-            remainder = (byte) (remainder << 1);
+            remainder = (ushort) (remainder << 1);
         }
       }
-
+
       // final remainder is the checksum
       return remainder;
     }

+    /// <summary>
+    ///   CRC-16-IBM polynomial.
+    /// </summary>
+    /// <remarks>
+    ///   https://en.wikipedia.org/wiki/Polynomial_representations_of_cyclic_redundancy_checks
+    /// </remarks>
+    private const ushort Polynomial = 0x8005;
+
+    /// <summary>
+    ///   Top bit used in the algorithm.
+    /// </summary>
+    private const int TopBit = 1 << 15;
+
   }

 }


changed type of Dictionary

changed type of Dictionary

--- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -303,7 +303,7 @@
         private bool m_scriptListens_atRotTarget;
         private bool m_scriptListens_notAtRotTarget;

-        internal Dictionary<UUID, string> m_savedScriptState;
+        internal ThreadedClasses.RwLockedDictionary<UUID, string> m_savedScriptState = new ThreadedClasses.RwLockedDictionary<UUID,string>();

         #region Properties

@@ -886,8 +886,6 @@
             XmlNodeList nodes = doc.GetElementsByTagName("SavedScriptState");
             if (nodes.Count > 0)
             {
-                if (m_savedScriptState == null)
-                    m_savedScriptState = new Dictionary<UUID, string>();
                 foreach (XmlNode node in nodes)
                 {
                     if (node.Attributes["UUID"] != null)


Simplify UUID

Simplify UUID

--- Authentication.cs
+++ Authentication.cs
@@ -12,27 +12,20 @@
 {
 	using Authentication;

+	//[StructLayout (LayoutKind.Sequential)]
 	unsafe struct UUID
 	{
-		// public to avoid a bizarre CS0649 warning
-		//private fixed int data[4];
-		public fixed int data[4];
-		//private int a, b, c, d;
+		private int a, b, c, d;
+		const int ByteLength = 16;

 		public static readonly UUID Zero = new UUID ();

 		public static bool operator == (UUID a, UUID b)
 		{
-			if (a.data[0] != b.data[0])
+			if (a.a == b.a && a.b == b.b && a.c == b.c && a.d == b.d)
+				return true;
+			else
 				return false;
-			if (a.data[1] != b.data[1])
-				return false;
-			if (a.data[2] != b.data[2])
-				return false;
-			if (a.data[3] != b.data[3])
-				return false;
-
-			return true;
 		}

 		public static bool operator != (UUID a, UUID b)
@@ -53,17 +46,16 @@

 		public override int GetHashCode ()
 		{
-			fixed (int* p = &data[0])
-				return p[0] ^ p[1] ^ p[2] ^ p[3];
+			return a ^ b ^ c ^ d;
 		}

 		public override string ToString ()
 		{
-			StringBuilder sb = new StringBuilder (16 * 2);
-
-			fixed (int* p = &data[0]) {
+			StringBuilder sb = new StringBuilder (ByteLength * 2);
+
+			fixed (int* p = &a) {
 					byte* bp = (byte*)p;
-					for (int i = 0 ; i != 16 ; i++)
+					for (int i = 0 ; i != ByteLength ; i++)
 						sb.Append (bp[i].ToString ("x2", CultureInfo.InvariantCulture));
 			}

@@ -73,14 +65,17 @@
 		public static UUID Parse (string hex)
 		{
 			byte[] guidData = SaslClient.FromHex (hex);
-			if (guidData.Length != 16)
+			if (guidData.Length != ByteLength)
 				throw new Exception ("Cannot parse UUID/GUID of invalid length");

 			UUID id = new UUID ();
-			fixed (byte* bp = &guidData[0]) {
+			//fixed (byte* bp = &guidData[0]) {
+			fixed (byte* bp = guidData) {
 				int* p = (int*)bp;
-				for (int i = 0 ; i != 4 ; i++)
-					id.data[i] = p[i];
+				id.a = p[0];
+				id.b = p[1];
+				id.c = p[2];
+				id.d = p[3];
 			}

 			return id;
@@ -91,13 +86,11 @@
 		{
 			UUID id = new UUID ();

-			fixed (int* p = &id.data[0]) {
-				p[0] = rand.Next ();
-				p[1] = rand.Next ();
-				p[2] = rand.Next ();
-			}
-
-			//p[3] is assigned to by Timestamp
+			id.a = rand.Next ();
+			id.b = rand.Next ();
+			id.c = rand.Next ();
+
+			//id.d is assigned to by Timestamp
 			id.Timestamp = timestamp;

 			return id;
@@ -113,7 +106,7 @@
 			get {
 				uint unixTime;

-				fixed (int* ip = &data[3]) {
+				fixed (int* ip = &d) {
 					if (BitConverter.IsLittleEndian) {
 						byte* p = (byte*)ip;
 						byte* bp = (byte*)&unixTime;
@@ -130,7 +123,7 @@
 			} set {
 				uint unixTime = value;

-				fixed (int* ip = &data[3]) {
+				fixed (int* ip = &d) {
 					if (BitConverter.IsLittleEndian) {
 						byte* p = (byte*)&unixTime;
 						byte* bp = (byte*)ip;


Use HasMore and NextOffset

Use HasMore and NextOffset

--- CrosspostSharp3/DeviantArt/DeviantArtFolderSelectionForm.cs
+++ CrosspostSharp3/DeviantArt/DeviantArtFolderSelectionForm.cs
@@ -29,8 +29,7 @@

 				var resp = await DeviantArtFs.Gallery.Folders.ExecuteAsync(_token, new DeviantArtFs.Gallery.FoldersRequest { });

-				int skip = 0;
-				while (resp.Results.Any()) {
+				while (true) {
 					foreach (var f in resp.Results) {
 						var chk = new CheckBox {
 							AutoSize = true,
@@ -46,9 +45,11 @@
 						};
 						flowLayoutPanel1.Controls.Add(chk);
 					}
-					skip += resp.Results.Count();
+
+					if (!resp.HasMore) break;
+
 					resp = await DeviantArtFs.Gallery.Folders.ExecuteAsync(_token, new DeviantArtFs.Gallery.FoldersRequest {
-						Offset = skip
+						Offset = resp.NextOffset.Value
 					});
 				}


updated iterations

updated iterations

--- ParticleSwarmOptimization/CocoClusterApp/Program.cs
+++ ParticleSwarmOptimization/CocoClusterApp/Program.cs
@@ -83,9 +83,8 @@
                         var restarts = -1;
                         FitnessFunction function;
                         if (!functionsToOptimize.Contains(Problem.FunctionNumber)) continue;
-                        var evaluations = 0L;
                         var settings = SetupOptimizer(psoParams, out function);
-                        var evauluations = settings.FunctionParameters.Dimension * budgetMultiplier;
+                        var evaluations = (long) settings.FunctionParameters.Dimension * budgetMultiplier;
                         var evaluationsLeft = evaluations;

                         do


Migrated RequestHandlerInvoker test for POST.

--- Piccolo.Tests/Request/RequestHandlerInvokerTests.cs
+++ Piccolo.Tests/Request/RequestHandlerInvokerTests.cs
@@ -54,6 +54,46 @@
 			}
 		}

+		[TestFixture]
+		public class when_executing_post_request : given_request_handler_invoker
+		{
+			private string _result;
+
+			[SetUp]
+			public void SetUp()
+			{
+				var routeParameters = new Dictionary<string, string> {{"route", "1"}};
+				var contextualParameters = new Dictionary<string, object>{{"context", 2}};
+				var queryParameters = new Dictionary<string, string> {{"query", "3"}};
+				var rawPayload = "4";
+
+				_result = Invoker.Execute(new PostResource(), "POST", routeParameters, queryParameters, contextualParameters, rawPayload, null).Content.ReadAsStringAsync().Result;
+			}
+
+			[Test]
+			public void it_should_bind_parameters()
+			{
+				_result.ShouldBe("route:1, context:2, query:3, payload:4");
+			}
+
+			[ExcludeFromCodeCoverage]
+			public class PostResource : IPost<string, string>
+			{
+				public int Route { get; set; }
+
+				[Contextual]
+				public int Context { get; set; }
+
+				[Optional]
+				public int Query { get; set; }
+
+				public HttpResponseMessage<string> Post(string parameters)
+				{
+					return new HttpResponseMessage<string>(new HttpResponseMessage { Content = new StringContent(string.Format("route:{0}, context:{1}, query:{2}, payload:{3}", Route, Context, Query, parameters)) });
+				}
+			}
+		}
+
 		public abstract class given_request_handler_invoker
 		{
 			protected RequestHandlerInvoker Invoker;


minor changes

minor changes

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS01]$/SharpMap/Trunk;C98998

--- Examples/SharpMap.Demo.Wms/Controllers/ProcessController.cs
+++ Examples/SharpMap.Demo.Wms/Controllers/ProcessController.cs
@@ -52,10 +52,14 @@
             throw new ArgumentException("invalid argument 'cut': ILineString expected");
         }

-        private ActionResult MakeResponse(IEnumerable<IGeometry> cleaned)
+        private ActionResult MakeResponse(IEnumerable<IGeometry> geometries)
         {
+            if (geometries == null)
+                throw new ArgumentNullException("geometries");
+
             // we should return a GeometryCollection object
-            IGeometryCollection result = this.factory.CreateGeometryCollection(cleaned.ToArray());
+            IGeometry[] array = geometries.ToArray();
+            IGeometryCollection result = this.factory.CreateGeometryCollection(array);
             StringWriter writer = new StringWriter();
             GeoJSONWriter.Write(result, writer);
             return this.Json(new { geo = writer.ToString() });
@@ -129,9 +133,7 @@
             Polygonizer polygonizer = new Polygonizer();
             polygonizer.Add(geoms);
             IList<IGeometry> polys = polygonizer.GetPolygons();
-
-            IGeometry[] array = GeometryFactory.ToPolygonArray(polys);
-            return geometry.Factory.CreateGeometryCollection(array);
+            return geometry.Factory.BuildGeometry(polys);
         }

         private static IEnumerable<IGeometry> DoSplit(IGeometryCollection coll, ILineString cut)


Show received/sent bytes in demo app

Show received/sent bytes in demo app

--- Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs
+++ Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs
@@ -155,7 +155,7 @@

             item.Request.RequestHeaders.AddHeaders(e.WebSession.Request.RequestHeaders);

-            if (e is TunnelConnectSessionEventArgs)
+            if (e is TunnelConnectSessionEventArgs || e.WebSession.Request.UpgradeToWebSocket)
             {
                 e.DataReceived += (sender, args) =>
                 {


Fix segment number

Fix segment number

Should fix this

https://github.com/mrklintscher/libfintx/issues/60

and this

https://github.com/mrklintscher/libfintx/issues/48

Please report back!


Add check if mainLog is null

Add check if mainLog is null

After pressing Enter, the bot crashes if the check is not there

--- SteamBot/BotManager.cs
+++ SteamBot/BotManager.cs
@@ -99,13 +99,16 @@
         /// </summary>
         public void StopBots()
         {
-            mainLog.Debug("Shutting down all bot processes.");
-            foreach (var botProc in botProcs)
-            {
-                botProc.Stop();
-            }
-
-            mainLog.Dispose();
+            if (mainLog != null)
+            {
+                mainLog.Debug("Shutting down all bot processes.");
+                foreach (var botProc in botProcs)
+                {
+                    botProc.Stop();
+                }
+
+                mainLog.Dispose();
+            }
             mainLog = null;
         }


Don't use await

Don't use await

--- SteamWebPipes/Steam.cs
+++ SteamWebPipes/Steam.cs
@@ -40,22 +40,14 @@

             while (IsRunning)
             {
+                if (IsLoggedOn)
+                {
+                    _ = Apps.PICSGetChangesSince(PreviousChangeNumber, true, true);
+                }
+
                 CallbackManager.RunWaitCallbacks(timeout);

-                if (!IsLoggedOn)
-                {
-                    continue;
-                }
-
-                try
-                {
-                    await Apps.PICSGetChangesSince(PreviousChangeNumber, true, true);
-                    await Task.Delay(random.Next(3000));
-                }
-                catch (Exception)
-                {
-                    // ignore
-                }
+                await Task.Delay(random.Next(3210));
             }
         }


Date parse handling

Date parse handling

--- mobile-services/Spending.App.Web/App_Start/Startup.MobileApp.cs
+++ mobile-services/Spending.App.Web/App_Start/Startup.MobileApp.cs
@@ -2,9 +2,9 @@
 using System.Configuration;
 using System.Data.Entity;
 using System.Web.Http;
-using Microsoft.Azure.Mobile.Server;
 using Microsoft.Azure.Mobile.Server.Authentication;
 using Microsoft.Azure.Mobile.Server.Config;
+using Newtonsoft.Json;
 using Owin;

 namespace Spending.App.Web
@@ -14,6 +14,10 @@
         public static void ConfigureMobileApp(IAppBuilder app)
         {
             var config = new HttpConfiguration();
+
+            config.Formatters.JsonFormatter.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;
+            config.Formatters.JsonFormatter.SerializerSettings.DateFormatHandling = DateFormatHandling.IsoDateFormat;
+            config.Formatters.JsonFormatter.SerializerSettings.DateParseHandling = DateParseHandling.DateTimeOffset;

             new MobileAppConfiguration()
                 .UseDefaultConfiguration()


FG-70 fixed parsing DateTime format

FG-70 fixed parsing DateTime format

--- src/LogViewer/Services/LogReaderService.cs
+++ src/LogViewer/Services/LogReaderService.cs
@@ -107,7 +107,7 @@
         {
             var dateTimeString = DateTimePattern.Match(line).Value;
             line = line.Substring(dateTimeString.Length + " => ".Length).TrimStart();
-            return DateTime.ParseExact(dateTimeString, new[] { "hh:mm:ss:fff", "yyyy-MM-dd hh:mm:ss:fff" }, null, DateTimeStyles.NoCurrentDateDefault);
+            return DateTime.ParseExact(dateTimeString, new[] { "HH:mm:ss:fff", "yyyy-MM-dd HH:mm:ss:fff" }, null, DateTimeStyles.NoCurrentDateDefault);
         }

         private LogEvent ExtractLogEventType(ref string line)


preparing release 0.16.7

preparing release 0.16.7

--- Source/lib/Properties/AssemblyInfo.cs
+++ Source/lib/Properties/AssemblyInfo.cs
@@ -90,9 +90,9 @@
 // You can specify all the values or you can default the Revision and Build Numbers
 // by using the '*' as shown below:

-[assembly: AssemblyVersion("0.16.6.0")]
+[assembly: AssemblyVersion("0.16.7.0")]
 #if !WindowsCE
-[assembly: AssemblyFileVersion("0.16.6.0")]
+[assembly: AssemblyFileVersion("0.16.7.0")]
 #endif

 [assembly: CLSCompliant(true)]


Update Client.cs

Update Client.cs

--- src/Hprose.RPC/Client.cs
+++ src/Hprose.RPC/Client.cs
@@ -114,8 +114,8 @@
         public async Task<Stream> Transport(Stream request, Context context) {
             var uri = new Uri((context as ClientContext).Uri);
             var scheme = uri.Scheme;
-            if (schemes.ContainsKey(scheme)) {
-                return await transports[schemes[scheme]].Transport(request, context);
+            if (schemes.TryGetValue(scheme, out string name)) {
+                return await transports[name].Transport(request, context);
             }
             throw new NotSupportedException("The protocol " + scheme + " is not supported.");
         }


Ignore IOException when the stream is disconnected by the client.

--- src/MagicOnion.Server/Hubs/StreamingHub.cs
+++ src/MagicOnion.Server/Hubs/StreamingHub.cs
@@ -1,7 +1,9 @@
 using Grpc.Core;
 using MessagePack;
 using System;
+using System.IO;
 using System.Threading.Tasks;
+using Microsoft.AspNetCore.Connections;

 namespace MagicOnion.Server.Hubs
 {
@@ -91,6 +93,11 @@
             {
                 await OnConnecting();
                 await HandleMessageAsync();
+            }
+            catch (IOException ex) when (ex.InnerException is ConnectionAbortedException)
+            {
+                // NOTE: If DuplexStreaming is disconnected by the client, IOException will be thrown.
+                //       However, such behavior is expected. the exception can be ignored.
             }
             finally
             {


Partially revert "Fixed NH-3132"

Partially revert "Fixed NH-3132"

This reverts commit fee54be26a0ec68d08d60c29c14b1929f32c96aa.

--- src/NHibernate/Properties/FieldAccessor.cs
+++ src/NHibernate/Properties/FieldAccessor.cs
@@ -3,9 +3,6 @@
 using System.Reflection;
 using System.Reflection.Emit;
 using NHibernate.Engine;
-using NHibernate.Intercept;
-using NHibernate.Proxy;
-using NHibernate.Proxy.DynamicProxy;
 using NHibernate.Util;

 namespace NHibernate.Properties
@@ -157,22 +154,6 @@
 			}
 		}

-		private static object GetTarget(object maybeProxy)
-		{
-			//wish there were an interface to unwrap with
-			var proxy = maybeProxy as IProxy;
-			if (proxy != null)
-			{
-				var fieldInterceptor = proxy.Interceptor as DefaultDynamicLazyFieldInterceptor;
-				if (fieldInterceptor != null)
-				{
-					return fieldInterceptor.TargetInstance;
-				}
-			}
-
-			return maybeProxy;
-		}
-
 		/// <summary>
 		/// An <see cref="IGetter"/> that uses a Field instead of the Property <c>get</c>.
 		/// </summary>
@@ -209,7 +190,7 @@
 			{
 				try
 				{
-					return field.GetValue(GetTarget(target));
+					return field.GetValue(target);
 				}
 				catch (Exception e)
 				{
@@ -294,7 +275,7 @@
 			{
 				try
 				{
-					field.SetValue(GetTarget(target), value);
+					field.SetValue(target, value);
 				}
 				catch (ArgumentException ae)
 				{


Limit Admin Menu for Content Limit the Content Menu item by whether you have the base Permission EditOwnContent. EditContent implies EditOwnContent so either permission (which you need at least one of to do any management of content be it create or edit) will allow this menu item to display.

--- src/Orchard.Web/Core/Contents/AdminMenu.cs
+++ src/Orchard.Web/Core/Contents/AdminMenu.cs
@@ -22,6 +22,7 @@
             var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name);
             builder.AddImageSet("content")
                 .Add(T("Content"), "1.4", menu => menu
+                    .Permission(Permissions.EditOwnContent)
                     .Add(T("Content Items"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }).LocalNav()));
             var contentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Creatable).OrderBy(ctd => ctd.DisplayName);
             if (contentTypes.Any()) {


Background logwriters should be disposed within LogManager.Stop() to prevent finalization.

--- src/LogJam/LogManager.cs
+++ src/LogJam/LogManager.cs
@@ -251,6 +251,7 @@
                 _logWriters.Values.SafeStop(SetupTracerFactory);
                 _logWriters.Clear();
                 _backgroundMultiLogWriters.SafeStop(SetupTracerFactory);
+                _backgroundMultiLogWriters.SafeDispose(SetupTracerFactory);
                 _backgroundMultiLogWriters.Clear();
             }
         }


Fixed a problem where 1. rows with no null values and 2. when querying for a data type that wasn't present in a row would throw a NullReferenceException (due to protocol buffers serializing empty collections as null)

--- src/ProtoBuf.Data/Internal/ProtoDataRow.cs
+++ src/ProtoBuf.Data/Internal/ProtoDataRow.cs
@@ -11,6 +11,25 @@
         // be deserializable because it lacks type information).
         //
         // * actually it can, but .NET type names use too much space)
+
+        public ProtoDataRow()
+        {
+            // Ensure collections aren't null (protocol buffers serializes
+            // empty collections as null)
+            StringValues = new List<string>();
+            DateTimeValues = new List<DateTime>();
+            Int32Values = new List<int>();
+            Int64Values = new List<long>();
+            Int16Values = new List<short>();
+            BoolValues = new List<bool>();
+            ByteValues = new List<byte>();
+            FloatValues = new List<float>();
+            DoubleValues = new List<double>();
+            GuidValues = new List<Guid>();
+            CharValues = new List<char>();
+            DecimalValues = new List<decimal>();
+            NullColumns = new List<bool>();
+        }

         [ProtoMember(1)]
         public List<string> StringValues;


Readded warning if no source directory is supplied

--- src/ReportGenerator.Core/Parser/Preprocessing/JaCoCoReportPreprocessor.cs
+++ src/ReportGenerator.Core/Parser/Preprocessing/JaCoCoReportPreprocessor.cs
@@ -43,6 +43,11 @@
         /// <param name="report">The report.</param>
         internal void Execute(XContainer report)
         {
+            if (this.sourceDirectories.Count == 0)
+            {
+                Logger.Warn("  " + Resources.NoSouceDirectories);
+            }
+
             var modules = report.Descendants("package")
                 .ToArray();

@@ -82,6 +87,7 @@
             fileName = fileName
                 .Replace('\\', Path.DirectorySeparatorChar)
                 .Replace('/', Path.DirectorySeparatorChar);
+
             if (!Path.IsPathRooted(fileName))
             {
                 var path = this.sourceDirectories


Rename and arrange tests

Rename and arrange tests

In preparation for adding further test cases.

--- src/Roslyn.Diagnostics.Analyzers/UnitTests/SymbolIsBannedAnalyzerTests.cs
+++ src/Roslyn.Diagnostics.Analyzers/UnitTests/SymbolIsBannedAnalyzerTests.cs
@@ -74,7 +74,7 @@
         }

         [Fact]
-        public void CSharp_DiagnosticReportedForTypeInSource()
+        public void CSharp_BannedApiFile_MessageIncludedInDiagnostic()
         {
             var source = @"
 namespace N
@@ -89,14 +89,13 @@
     }
 }";

-            var bannedText = @"
-T:N.Banned";
-
-            VerifyCSharp(source, bannedText, GetCSharpResultAt(9, 21, SymbolIsBannedAnalyzer.SymbolIsBannedRule, "Banned", ""));
-        }
-
-        [Fact]
-        public void CSharp_BannedApiFileLineWhiteSpace()
+            var bannedText = @"T:N.Banned;Use NonBanned instead";
+
+            VerifyCSharp(source, bannedText, GetCSharpResultAt(9, 21, SymbolIsBannedAnalyzer.SymbolIsBannedRule, "Banned", ": Use NonBanned instead"));
+        }
+
+        [Fact]
+        public void CSharp_BannedApiFile_WhiteSpace()
         {
             var source = @"
 namespace N
@@ -118,7 +117,7 @@
         }

         [Fact]
-        public void CSharp_DiagnosticReportedWithMessage()
+        public void CSharp_BannedApiFile_WhiteSpaceWithMessage()
         {
             var source = @"
 namespace N
@@ -133,13 +132,13 @@
     }
 }";

-            var bannedText = @"T:N.Banned;Use NonBanned instead";
+            var bannedText = @"T:N.Banned ; Use NonBanned instead ";

             VerifyCSharp(source, bannedText, GetCSharpResultAt(9, 21, SymbolIsBannedAnalyzer.SymbolIsBannedRule, "Banned", ": Use NonBanned instead"));
         }

         [Fact]
-        public void CSharp_DiagnosticReportedWithMessageAndMiscWhiteSpace()
+        public void CSharp_BannedApiFile_EmptyMessage()
         {
             var source = @"
 namespace N
@@ -154,13 +153,13 @@
     }
 }";

-            var bannedText = @"T:N.Banned ; Use NonBanned instead ";
-
-            VerifyCSharp(source, bannedText, GetCSharpResultAt(9, 21, SymbolIsBannedAnalyzer.SymbolIsBannedRule, "Banned", ": Use NonBanned instead"));
-        }
-
-        [Fact]
-        public void CSharp_DiagnosticReportedWithEmptyMessage()
+            var bannedText = @"T:N.Banned;";
+
+            VerifyCSharp(source, bannedText, GetCSharpResultAt(9, 21, SymbolIsBannedAnalyzer.SymbolIsBannedRule, "Banned", ""));
+        }
+
+        [Fact]
+        public void CSharp_BannedType_Constructor()
         {
             var source = @"
 namespace N
@@ -175,13 +174,14 @@
     }
 }";

-            var bannedText = @"T:N.Banned;";
+            var bannedText = @"
+T:N.Banned";

             VerifyCSharp(source, bannedText, GetCSharpResultAt(9, 21, SymbolIsBannedAnalyzer.SymbolIsBannedRule, "Banned", ""));
         }

         [Fact]
-        public void CSharp_DiagnosticReportedForGenericTypeFromMetadata()
+        public void CSharp_BannedGenericType_Constructor()
         {
             var source = @"
 class C
@@ -199,7 +199,7 @@
         }

         [Fact]
-        public void CSharp_DiagnosticReportedForNestedType()
+        public void CSharp_BannedNestedType_Constructor()
         {
             var source = @"
 class C
@@ -218,7 +218,7 @@
         }

         [Fact]
-        public void CSharp_DiagnosticReportedForNestedType2()
+        public void CSharp_BannedType_MethodOnNestedType()
         {
             var source = @"
 class C
@@ -243,7 +243,7 @@
         }

         [Fact]
-        public void CSharp_InvocationOfMethodOnInterface()
+        public void CSharp_BannedInterface_Method()
         {
             var source = @"
 interface I
@@ -265,7 +265,7 @@
         }

         [Fact]
-        public void CSharp_PropertyAccess()
+        public void CSharp_BannedClass_Property()
         {
             var source = @"
 class C
@@ -284,7 +284,7 @@
         }

         [Fact]
-        public void CSharp_FieldAccess()
+        public void CSharp_BannedClass_Field()
         {
             var source = @"
 class C
@@ -303,7 +303,7 @@
         }

         [Fact]
-        public void CSharp_EventAccess()
+        public void CSharp_BannedClass_Event()
         {
             var source = @"
 using System;
@@ -327,7 +327,7 @@
         }

         [Fact]
-        public void CSharp_MethodReference()
+        public void CSharp_BannedClass_MethodGroup()
         {
             var source = @"
 delegate void D();
@@ -346,7 +346,7 @@
         }

         [Fact]
-        public void CSharp_TypeAttributeUsage()
+        public void CSharp_BannedAttribute_UsageOnType()
         {
             var source = @"
 using System;
@@ -365,12 +365,13 @@
         }

         [Fact]
-        public void CSharp_MemberAttributeUsage()
+        public void CSharp_BannedAttribute_UsageOnMember()
         {
             var source = @"
 using System;

-[AttributeUsage(AttributeTargets.All, Inherited = true)] class BannedAttribute : Attribute { }
+[AttributeUsage(AttributeTargets.All, Inherited = true)]
+class BannedAttribute : Attribute { }

 class C
 {
@@ -381,18 +382,19 @@
             var bannedText = @"T:BannedAttribute";

             VerifyCSharp(source, bannedText,
-                GetCSharpResultAt(8, 6, SymbolIsBannedAnalyzer.SymbolIsBannedRule, "BannedAttribute", ""));
-        }
-
-        [Fact]
-        public void CSharp_AssemblyAttributeUsage()
+                GetCSharpResultAt(9, 6, SymbolIsBannedAnalyzer.SymbolIsBannedRule, "BannedAttribute", ""));
+        }
+
+        [Fact]
+        public void CSharp_BannedAttribute_UsageOnAssembly()
         {
             var source = @"
 using System;

 [assembly: BannedAttribute]

-[AttributeUsage(AttributeTargets.All, Inherited = true)] class BannedAttribute : Attribute { }
+[AttributeUsage(AttributeTargets.All, Inherited = true)]
+class BannedAttribute : Attribute { }
 ";

             var bannedText = @"T:BannedAttribute";
@@ -402,14 +404,15 @@
         }

         [Fact]
-        public void CSharp_ModuleAttributeUsage()
+        public void CSharp_BannedAttribute_UsageOnModule()
         {
             var source = @"
 using System;

 [module: BannedAttribute]

-[AttributeUsage(AttributeTargets.All, Inherited = true)] class BannedAttribute : Attribute { }
+[AttributeUsage(AttributeTargets.All, Inherited = true)]
+class BannedAttribute : Attribute { }
 ";

             var bannedText = @"T:BannedAttribute";
@@ -419,7 +422,7 @@
         }

         [Fact]
-        public void VisualBasic_DiagnosticReportedForTypeInSource()
+        public void VisualBasic_BannedType_Constructor()
         {
             var source = @"
 Namespace N
@@ -438,7 +441,7 @@
         }

         [Fact]
-        public void VisualBasic_DiagnosticReportedForGenericTypeFromMetadata()
+        public void VisualBasic_BannedGenericType_Constructor()
         {
             var source = @"
 Class C
@@ -454,7 +457,7 @@
         }

         [Fact]
-        public void VisualBasic_DiagnosticReportedForNestedType()
+        public void VisualBasic_BannedNestedType_Constructor()
         {
             var source = @"
 Class C
@@ -471,7 +474,7 @@
         }

         [Fact]
-        public void VisualBasic_DiagnosticReportedForNestedType2()
+        public void VisualBasic_BannedType_MethodOnNestedType()
         {
             var source = @"
 Class C
@@ -493,7 +496,7 @@
         }

         [Fact]
-        public void VisualBasic_InvocationOfMethodOnInterface()
+        public void VisualBasic_BannedInterface_Method()
         {
             var source = @"
 Interface I
@@ -512,7 +515,7 @@
         }

         [Fact]
-        public void VisualBasic_PropertyAccess()
+        public void VisualBasic_BannedClass_Property()
         {
             var source = @"
 Class C
@@ -529,7 +532,7 @@
         }

         [Fact]
-        public void VisualBasic_FieldAccess()
+        public void VisualBasic_BannedClass_Field()
         {
             var source = @"
 Class C
@@ -546,7 +549,7 @@
         }

         [Fact]
-        public void VisualBasic_EventAccess()
+        public void VisualBasic_BannedClass_Event()
         {
             var source = @"
 Imports System
@@ -568,7 +571,7 @@
         }

         [Fact]
-        public void VisualBasic_MethodReference()
+        public void VisualBasic_BannedClass_MethodGroup()
         {
             var source = @"
 Delegate Sub D()
@@ -584,7 +587,7 @@
         }

         [Fact]
-        public void VisualBasic_TypeAttributeUsage()
+        public void VisualBasic_BannedAttribute_UsageOnType()
         {
             var source = @"
 Imports System
@@ -608,7 +611,7 @@
         }

         [Fact]
-        public void VisualBasic_MemberAttributeUsage()
+        public void VisualBasic_BannedAttribute_UsageOnMember()
         {
             var source = @"
 Imports System
@@ -630,7 +633,7 @@
         }

         [Fact]
-        public void VisualBasic_AssemblyAttributeUsage()
+        public void VisualBasic_BannedAttribute_UsageOnAssembly()
         {
             var source = @"
 Imports System
@@ -650,7 +653,7 @@
         }

         [Fact]
-        public void VisualBasic_ModuleAttributeUsage()
+        public void VisualBasic_BannedAttribute_UsageOnModule()
         {
             var source = @"
 Imports System


Formatting

Formatting

--- src/SqlStreamStore.AcceptanceTests/SqlStreamStoreAcceptanceTestFixture.cs
+++ src/SqlStreamStore.AcceptanceTests/SqlStreamStoreAcceptanceTestFixture.cs
@@ -14,6 +14,7 @@
         {}

         public abstract long MinPosition { get; }
+
         public abstract int MaxSubscriptionCount { get; }
     }
 }


TODO tweak.

TODO tweak.

--- src/Splunk.Client/Splunk/Client/Service.cs
+++ src/Splunk.Client/Splunk/Client/Service.cs
@@ -16,7 +16,7 @@

 //// TODO:
 //// [O] Contracts
-//// [O] Documentation
+//// [O] Documentation (check all links!)
 //// [ ] Consider schema validation from schemas stored as resources.
 ////     See [XmlReaderSettings.Schemas Property](http://goo.gl/Syvj4V)
 //// [ ] Strong type and tests for Service.GetCapabilities


Caused a NRE since _producer was being initialized after the instance was subscribed and therefore not ready to receive messages just yet.

--- src/Transports/MassTransit.Transports.Msmq/MulticastSubscriptionClient.cs
+++ src/Transports/MassTransit.Transports.Msmq/MulticastSubscriptionClient.cs
@@ -49,15 +49,16 @@

             var consumerInstance = new SubscriptionMessageConsumer(_router, _network);

-            _unsubscribeAction = _subscriptionBus.SubscribeInstance(consumerInstance);
-            _unsubscribeAction += _subscriptionBus.SubscribeInstance(this);
-
             var msmqAddress = subscriptionBus.Endpoint.Address as IMsmqEndpointAddress;
             if (msmqAddress == null || msmqAddress.Uri.Scheme != MulticastMsmqTransportFactory.MulticastScheme)
                 throw new EndpointException(subscriptionBus.Endpoint.Address.Uri,
                     "The multicast subscription client must be used on a multicast MSMQ endpoint");

             _producer = new BusSubscriptionMessageProducer(router, subscriptionBus.Endpoint, msmqAddress.InboundUri);
+
+            _unsubscribeAction = _subscriptionBus.SubscribeInstance(consumerInstance);
+            _unsubscribeAction += _subscriptionBus.SubscribeInstance(this);
+
         }

         public void Consume(IConsumeContext<AddPeer> context)


Changed the services reference in the published value fall back via language implementation to constructor injection

--- src/Umbraco.Web/Models/PublishedContent/PublishedValueLanguageFallback.cs
+++ src/Umbraco.Web/Models/PublishedContent/PublishedValueLanguageFallback.cs
@@ -1,5 +1,4 @@
-using LightInject;
-using Umbraco.Core.Models;
+using Umbraco.Core.Models;
 using Umbraco.Core.Models.PublishedContent;
 using Umbraco.Core.Services;

@@ -14,11 +13,12 @@
     /// </remarks>
     public class PublishedValueLanguageFallback : PublishedValueFallback
     {
-        /// <summary>
-        /// Gets or sets the services context.
-        /// </summary>
-        [Inject]
-        public ServiceContext Services { get; set; }
+        private readonly ILocalizationService _localizationService;
+
+        public PublishedValueLanguageFallback(ILocalizationService localizationService)
+        {
+            _localizationService = localizationService;
+        }

         /// <inheritdoc />
         public override object GetValue(IPublishedProperty property, string culture, string segment, object defaultValue)
@@ -122,8 +122,7 @@
                 return false;
             }

-            var localizationService = Services.LocalizationService;
-            var language = localizationService.GetLanguageByIsoCode(culture);
+            var language = _localizationService.GetLanguageByIsoCode(culture);
             if (language.FallbackLanguage == null)
             {
                 value = defaultValue;
@@ -139,7 +138,7 @@
                     return true;
                 }

-                fallbackLanguage = GetNextFallbackLanguage(fallbackLanguage, localizationService);
+                fallbackLanguage = GetNextFallbackLanguage(fallbackLanguage);
             }

             value = defaultValue;
@@ -154,8 +153,7 @@
                 return false;
             }

-            var localizationService = Services.LocalizationService;
-            var language = localizationService.GetLanguageByIsoCode(culture);
+            var language = _localizationService.GetLanguageByIsoCode(culture);
             if (language.FallbackLanguage == null)
             {
                 value = defaultValue;
@@ -171,7 +169,7 @@
                     return true;
                 }

-                fallbackLanguage = GetNextFallbackLanguage(fallbackLanguage, localizationService);
+                fallbackLanguage = GetNextFallbackLanguage(fallbackLanguage);
             }

             value = defaultValue;
@@ -186,8 +184,7 @@
                 return false;
             }

-            var localizationService = Services.LocalizationService;
-            var language = localizationService.GetLanguageByIsoCode(culture);
+            var language = _localizationService.GetLanguageByIsoCode(culture);
             if (language.FallbackLanguage == null)
             {
                 value = defaultValue;
@@ -203,16 +200,18 @@
                     return true;
                 }

-                fallbackLanguage = GetNextFallbackLanguage(fallbackLanguage, localizationService);
+                fallbackLanguage = GetNextFallbackLanguage(fallbackLanguage);
             }

             value = defaultValue;
             return false;
         }

-        private static ILanguage GetNextFallbackLanguage(ILanguage fallbackLanguage, ILocalizationService localizationService)
-        {
-            fallbackLanguage = localizationService.GetLanguageById(fallbackLanguage.Id); // Ensures reference to next fall-back language is loaded if it exists
+        private ILanguage GetNextFallbackLanguage(ILanguage fallbackLanguage)
+        {
+            // Ensure reference to next fall-back language is loaded if it exists
+            fallbackLanguage = _localizationService.GetLanguageById(fallbackLanguage.Id);
+
             return fallbackLanguage.FallbackLanguage;
         }
     }


ScadaComm: Fix UDP reading

ScadaComm: Fix UDP reading

--- ScadaComm/ScadaCommCommon/Channels/UdpConnection.cs
+++ ScadaComm/ScadaCommCommon/Channels/UdpConnection.cs
@@ -172,7 +172,7 @@
                     {
                         int requiredCnt = count - readCnt; // осталось считать
                         int copyCnt = Math.Min(datagram.Length - readPos, requiredCnt);
-                        Array.Copy(datagram, readPos, buffer, readCnt, copyCnt);
+                        Array.Copy(datagram, readPos, buffer, readCnt + offset, copyCnt);
                         readCnt += copyCnt;
                         readPos += copyCnt;
                     }
@@ -241,7 +241,7 @@
                         // копирование полученных данных в заданный буфер
                         int requiredCnt = stopReceived ? stopCodeInd - readCnt + 1 : maxCount - readCnt;
                         int copyCnt = Math.Min(datagram.Length - readPos, requiredCnt);
-                        Array.Copy(datagram, readPos, buffer, readCnt, copyCnt);
+                        Array.Copy(datagram, readPos, buffer, readCnt + offset, copyCnt);
                         readCnt += copyCnt;
                         readPos += copyCnt;
                     }


Added xml namespace aliases for xaml-referenceable CLR namespaces.

--- SharpEssentials.Controls/Properties/AssemblyInfo.cs
+++ SharpEssentials.Controls/Properties/AssemblyInfo.cs
@@ -17,6 +17,7 @@
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Windows;
+using System.Windows.Markup;

 [assembly: AssemblyProduct("SharpEssentials.Controls")]
 [assembly: AssemblyCopyright("Copyright © Matt Hamilton 2015")]
@@ -38,6 +39,18 @@
 	// app, or any theme specific resource dictionaries)
 )]

+[assembly: XmlnsPrefix("https://github.com/mthamil/SharpEssentials/xaml", "se")]
+[assembly: XmlnsDefinition("https://github.com/mthamil/SharpEssentials/xaml", "SharpEssentials.Controls")]
+[assembly: XmlnsDefinition("https://github.com/mthamil/SharpEssentials/xaml", "SharpEssentials.Controls.Behaviors")]
+[assembly: XmlnsDefinition("https://github.com/mthamil/SharpEssentials/xaml", "SharpEssentials.Controls.Behaviors.Clickable")]
+[assembly: XmlnsDefinition("https://github.com/mthamil/SharpEssentials/xaml", "SharpEssentials.Controls.Behaviors.GridSplitterExpanderSupport")]
+[assembly: XmlnsDefinition("https://github.com/mthamil/SharpEssentials/xaml", "SharpEssentials.Controls.Behaviors.Interactivity")]
+[assembly: XmlnsDefinition("https://github.com/mthamil/SharpEssentials/xaml", "SharpEssentials.Controls.Commands")]
+[assembly: XmlnsDefinition("https://github.com/mthamil/SharpEssentials/xaml", "SharpEssentials.Controls.Converters")]
+[assembly: XmlnsDefinition("https://github.com/mthamil/SharpEssentials/xaml", "SharpEssentials.Controls.Markup")]
+[assembly: XmlnsDefinition("https://github.com/mthamil/SharpEssentials/xaml", "SharpEssentials.Controls.MultiKey")]
+[assembly: XmlnsDefinition("https://github.com/mthamil/SharpEssentials/xaml", "SharpEssentials.Controls.Selectors")]
+
 [assembly: InternalsVisibleTo("SharpEssentials.Tests.Unit")]

 #if DEBUG


(TFS CS 6203)

(TFS CS 6203)

--- Signum.Web.Extensions.Selenium/SeleniumTestClass.cs
+++ Signum.Web.Extensions.Selenium/SeleniumTestClass.cs
@@ -40,8 +40,11 @@
         {
             try
             {
-                selenium.Stop();
-                selenium.ShutDownSeleniumServer();
+                if (selenium != null)
+                {
+                    selenium.Stop();
+                    selenium.ShutDownSeleniumServer();
+                }
                 SeleniumExtensions.KillSelenium(seleniumServerProcess);
             }
             catch (Exception)


Lagt til Pullrequest #21

Lagt til Pullrequest #21

--- SikkerDigitalPost.Klient/SikkerDigitalPostKlient.cs
+++ SikkerDigitalPost.Klient/SikkerDigitalPostKlient.cs
@@ -6,6 +6,7 @@
 using SikkerDigitalPost.Domene.Entiteter.Aktører;
 using SikkerDigitalPost.Domene.Entiteter.Kvitteringer;
 using SikkerDigitalPost.Domene.Entiteter.Post;
+using SikkerDigitalPost.Domene.Exceptions;
 using SikkerDigitalPost.Klient.AsicE;
 using SikkerDigitalPost.Klient.Envelope;
 using SikkerDigitalPost.Klient.Security;
@@ -59,22 +60,23 @@
             var guidHandler = new GuidHandler();
             var arkiv = new AsicEArkiv(forsendelse, guidHandler, _databehandler.Sertifikat);

-            var forretingsmeldingEnvelope = new ForretningsmeldingEnvelope(new EnvelopeSettings(forsendelse, arkiv, _databehandler, guidHandler));
-
-            var soapContainer = new SoapContainer {Envelope = forretingsmeldingEnvelope, Action = "\"\""};
+            var forretningsmeldingEnvelope = new ForretningsmeldingEnvelope(new EnvelopeSettings(forsendelse, arkiv, _databehandler, guidHandler));
+
+            var soapContainer = new SoapContainer {Envelope = forretningsmeldingEnvelope, Action = "\"\""};
             soapContainer.Vedlegg.Add(arkiv);

             var response = SendSoapContainer(soapContainer);

-            FileUtility.WriteXmlToFileInBasePath(forretingsmeldingEnvelope.Xml().OuterXml, "Forretningsmelding.xml");
+            FileUtility.WriteXmlToFileInBasePath(forretningsmeldingEnvelope.Xml().OuterXml, "Forretningsmelding.xml");
             FileUtility.WriteXmlToFileInBasePath(response, "ForrigeKvittering.xml");

+            if(!ValiderSignatur(response))
+                throw new SendException("Signatur av respons fra Meldingsformidler var ikke gyldig.");
+
+            if(!ValiderDigests(response, forretningsmeldingEnvelope.Xml(), guidHandler))
+                throw new SendException("Hash av body og/eller dokumentpakke er ikke lik for sendte og mottatte dokumenter.");
+
             return KvitteringFactory.GetTransportkvittering(response);
-            //if(!ValiderSignatur(response))
-            //    throw new Exception("Signatur validerer ikke");
-
-            //if(!ValiderDigests(response, envelope.Xml(), guidHandler))
-            //    throw new Exception("Hash av body og/eller dokumentpakke er ikke lik for sendte og mottatte dokumenter.");
         }

         /// <summary>
@@ -182,17 +184,19 @@
             return data;
         }

-        private bool ValiderSignatur(XmlDocument response)
-        {
-            XmlNode responseRot = response.DocumentElement;
-            var responseMgr = new XmlNamespaceManager(response.NameTable);
+        private bool ValiderSignatur(string response)
+        {
+            XmlDocument document = new XmlDocument();
+            document.LoadXml(response);
+            XmlNode responseRot = document.DocumentElement;
+            var responseMgr = new XmlNamespaceManager(document.NameTable);
             responseMgr.AddNamespace("env", Navnerom.env);
             responseMgr.AddNamespace("ds", Navnerom.ds);

             try
             {
                 var signatureNode = (XmlElement)responseRot.SelectSingleNode("//ds:Signature", responseMgr);
-                var signed = new SignedXmlWithAgnosticId(response);
+                var signed = new SignedXmlWithAgnosticId(document);
                 signed.LoadXml(signatureNode);
                 return signed.CheckSignature();
             }
@@ -202,10 +206,13 @@
             }
         }

-        private bool ValiderDigests(XmlDocument response, XmlDocument envelope, GuidHandler guidHandler)
-        {
-            XmlNode responseRot = response.DocumentElement;
-            XmlNamespaceManager responseMgr = new XmlNamespaceManager(response.NameTable);
+        private bool ValiderDigests(string response, XmlDocument envelope, GuidHandler guidHandler)
+        {
+            XmlDocument document = new XmlDocument();
+            document.LoadXml(response);
+
+            XmlNode responseRot = document.DocumentElement;
+            XmlNamespaceManager responseMgr = new XmlNamespaceManager(document.NameTable);
             responseMgr.AddNamespace("env", Navnerom.env);
             responseMgr.AddNamespace("ns5", Navnerom.Ns5);


Changed route of FullContact webhook handler.

--- SlackCommander/SlackCommander.Web/WebhooksModule.cs
+++ SlackCommander/SlackCommander.Web/WebhooksModule.cs
@@ -13,7 +13,7 @@
         public WebhooksModule(IAppSettings appSettings, IPendingCommands pendingCommands)
             : base("/webhooks")
         {
-            Post["/fullcontact", runAsync: true] = async (_, ct) =>
+            Post["/fullcontact/person", runAsync: true] = async (_, ct) =>
             {
                 // TODO Deserialize JSON body and extract person info
                 var slackApi = RestService.For<ISlackApi>(appSettings.Get("slack:responseBaseUrl"));


Putting in location where the n extruder heat setting will go.

--- SlicerConfiguration/SlicerMapping/MappingClasses.cs
+++ SlicerConfiguration/SlicerMapping/MappingClasses.cs
@@ -144,9 +144,19 @@
             string extruderTemperature = ActiveSliceSettings.Instance.GetActiveValue("temperature");
             if (extruderTemperature != "0")
             {
+                bool printUsesExtruder2 = false;
+                if(ActiveSliceSettings.Instance.ExtruderCount > 1
+                    && printUsesExtruder2)
+                {
+                    // start heating the extra extruders
+                    //M104 T1 S190.000000
+                }
                 string setTempString = string.Format("M104 S{0}", extruderTemperature);
                 AddDefaultIfNotPresent(preStartGCode, setTempString, preStartGCodeLines, "set temperature");
             }
+            // make sure we are on extruder 0
+
+            AddDefaultIfNotPresent(preStartGCode, "T0", preStartGCodeLines, "set the active extruder to 0");
             preStartGCode.Add("; settings from start_gcode");

             return preStartGCode;
@@ -165,6 +175,16 @@
                 string setTempString = "M109 S{0}".FormatWith(extruderTemperature);
                 AddDefaultIfNotPresent(postStartGCode, setTempString, postStartGCodeLines, "wait for temperature");
             }
+            bool printUsesExtruder2 = false;
+            double extruder2Temp = 0;
+            if (ActiveSliceSettings.Instance.ExtruderCount > 1
+                && printUsesExtruder2
+                && extruder2Temp > 0)
+            {
+                // start heating the extra extruders
+                //M109 T1 S190.000000
+            }
+
             AddDefaultIfNotPresent(postStartGCode, "G90", postStartGCodeLines, "use absolute coordinates");
             postStartGCode.Add(string.Format("{0} ; {1}", "G92 E0", "reset the expected extruder position"));
             AddDefaultIfNotPresent(postStartGCode, "M82", postStartGCodeLines, "use absolute distance for extrusion");


add test handler for LogSendError events

--- sample/AmazonKinesisSample/Program.cs
+++ sample/AmazonKinesisSample/Program.cs
@@ -43,7 +43,8 @@
                     shardCount: shardCount,
                     period: TimeSpan.FromSeconds(2),
                     bufferLogShippingInterval: TimeSpan.FromSeconds(5),
-                    bufferBaseFilename: "./logs/kinesis-buffer"
+                    bufferBaseFilename: "./logs/kinesis-buffer",
+                    onLogSendError: OnLogSendError
                 );
             }

@@ -68,6 +69,10 @@

             Log.Fatal("That's all folks - and all done using {WorkingSet} bytes of RAM", Environment.WorkingSet);
             Console.ReadKey();
+        }
+
+        static void OnLogSendError(object sender, LogSendErrorEventArgs logSendErrorEventArgs) {
+            Console.WriteLine("Error: {0}", logSendErrorEventArgs.Message);
         }

         private static void LogStuff()


Test.

Test.

--- src/Tests/NativeInterop/TestGetTextKind.cs
+++ src/Tests/NativeInterop/TestGetTextKind.cs
@@ -77,6 +77,14 @@
     }

     [TestMethod]
+    public void GetTextKindForLargeBinaryFileWithSomeAsciiWorks() {
+      // Ensure minimum ratio of 90% is computed correctly. Create an binary sequence
+      // of about 60% ascii and 40% binary.
+      var bytes = CreateArray(1 * 1024 * 1024 /*1 MB*/, 0.60);
+      CheckKind(bytes, NativeMethods.TextKind.TextKind_ProbablyBinary);
+    }
+
+    [TestMethod]
     public void GetTextKindForBinaryFileWithMostlyAsciiWorks() {
       // Ensure minimum ratio of 90% is computed correctly. Create an binary sequence
       // of about 80% ascii and 20% binary.
@@ -96,7 +104,7 @@
     public void GetTextKindForBinaryFileWithMostlyBinaryWorks() {
       // Ensure minimum ratio of 90% is computed correctly. Create an binary sequence
       // of about 5% ascii and 9% binary.
-      var bytes = CreateArray(50, 0.05);
+      var bytes = CreateArray(100, 0.05);
       CheckKind(bytes, NativeMethods.TextKind.TextKind_ProbablyBinary);
     }


Changed the remaining/relavent properties on ContentTypeBase to use the SetPropertyValueAndDetectChanges to set property values.

--- src/Umbraco.Core/Models/ContentTypeBase.cs
+++ src/Umbraco.Core/Models/ContentTypeBase.cs
@@ -115,8 +115,11 @@
             get { return _name; }
             set
             {
-                _name = value;
-                OnPropertyChanged(NameSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _name = value;
+                    return _name;
+                }, _name, NameSelector);
             }
         }

@@ -129,8 +132,11 @@
             get { return _level; }
             set
             {
-                _level = value;
-                OnPropertyChanged(LevelSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _level = value;
+                    return _level;
+                }, _level, LevelSelector);
             }
         }

@@ -143,8 +149,11 @@
             get { return _path; }
             set
             {
-                _path = value;
-                OnPropertyChanged(PathSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _path = value;
+                    return _path;
+                }, _path, PathSelector);
             }
         }

@@ -174,8 +183,11 @@
             get { return _description; }
             set
             {
-                _description = value;
-                OnPropertyChanged(DescriptionSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _description = value;
+                    return _description;
+                }, _description, DescriptionSelector);
             }
         }

@@ -188,8 +200,11 @@
             get { return _sortOrder; }
             set
             {
-                _sortOrder = value;
-                OnPropertyChanged(SortOrderSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _sortOrder = value;
+                    return _sortOrder;
+                }, _sortOrder, SortOrderSelector);
             }
         }

@@ -202,8 +217,11 @@
             get { return _icon; }
             set
             {
-                _icon = value;
-                OnPropertyChanged(IconSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _icon = value;
+                    return _icon;
+                }, _icon, IconSelector);
             }
         }

@@ -216,8 +234,11 @@
             get { return _thumbnail; }
             set
             {
-                _thumbnail = value;
-                OnPropertyChanged(ThumbnailSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _thumbnail = value;
+                    return _thumbnail;
+                }, _thumbnail, ThumbnailSelector);
             }
         }

@@ -230,8 +251,11 @@
             get { return _creatorId; }
             set
             {
-                _creatorId = value;
-                OnPropertyChanged(CreatorIdSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _creatorId = value;
+                    return _creatorId;
+                }, _creatorId, CreatorIdSelector);
             }
         }

@@ -244,8 +268,11 @@
             get { return _allowedAsRoot; }
             set
             {
-                _allowedAsRoot = value;
-                OnPropertyChanged(AllowedAsRootSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _allowedAsRoot = value;
+                    return _allowedAsRoot;
+                }, _allowedAsRoot, AllowedAsRootSelector);
             }
         }

@@ -261,8 +288,11 @@
             get { return _isContainer; }
             set
             {
-                _isContainer = value;
-                OnPropertyChanged(IsContainerSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _isContainer = value;
+                    return _isContainer;
+                }, _isContainer, IsContainerSelector);
             }
         }

@@ -276,8 +306,11 @@
             get { return _trashed; }
             set
             {
-                _trashed = value;
-                OnPropertyChanged(TrashedSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _trashed = value;
+                    return _trashed;
+                }, _trashed, TrashedSelector);
             }
         }

@@ -290,8 +323,11 @@
             get { return _allowedContentTypes; }
             set
             {
-                _allowedContentTypes = value;
-                OnPropertyChanged(AllowedContentTypesSelector);
+                SetPropertyValueAndDetectChanges(o =>
+                {
+                    _allowedContentTypes = value;
+                    return _allowedContentTypes;
+                }, _allowedContentTypes, AllowedContentTypesSelector);
             }
         }


If a password is provided, then use this instead of an autogenerated one.

--- src/Umbraco.Web/Editors/PasswordChanger.cs
+++ src/Umbraco.Web/Editors/PasswordChanger.cs
@@ -43,7 +43,7 @@
         public async Task<Attempt<PasswordChangedModel>> ChangePasswordWithIdentityAsync(
             IUser currentUser,
             IUser savingUser,
-            ChangingPasswordModel passwordModel,
+            ChangingPasswordModel passwordModel,
             BackOfficeUserManager<BackOfficeIdentityUser> userMgr)
         {
             if (passwordModel == null) throw new ArgumentNullException("passwordModel");
@@ -101,7 +101,7 @@
                     _logger.Warn<PasswordChanger>(string.Format("Could not reset user password {0}", errors));
                     return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not reset password, errors: " + errors, new[] { "resetPassword" }) });
                 }
-
+
                 return Attempt.Succeed(new PasswordChangedModel());
             }

@@ -110,7 +110,7 @@
             if (passwordModel.NewPassword.IsNullOrWhiteSpace())
             {
                 return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Cannot set an empty password", new[] { "value" }) });
-            }
+            }

             //we cannot arbitrarily change the password without knowing the old one and no old password was supplied - need to return an error
             //TODO: What if the current user is admin? We should allow manually changing then?
@@ -130,7 +130,7 @@
                     _logger.Warn<PasswordChanger>(string.Format("Could not change user password {0}", errors));
                     return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not change password, errors: " + errors, new[] { "oldPassword" }) });
                 }
-                return Attempt.Succeed(new PasswordChangedModel());
+                return Attempt.Succeed(new PasswordChangedModel());
             }

             //We shouldn't really get here
@@ -143,10 +143,10 @@
         /// <param name="username">The username of the user having their password changed</param>
         /// <param name="passwordModel"></param>
         /// <param name="membershipProvider"></param>
-        /// <returns></returns>
+        /// <returns></returns>
         public Attempt<PasswordChangedModel> ChangePasswordWithMembershipProvider(string username, ChangingPasswordModel passwordModel, MembershipProvider membershipProvider)
         {
-            // YES! It is completely insane how many options you have to take into account based on the membership provider. yikes!
+            // YES! It is completely insane how many options you have to take into account based on the membership provider. yikes!

             if (passwordModel == null) throw new ArgumentNullException("passwordModel");
             if (membershipProvider == null) throw new ArgumentNullException("membershipProvider");
@@ -181,9 +181,17 @@
                 //ok, we should be able to reset it
                 try
                 {
-                    var newPass = membershipProvider.ResetPassword(
-                        username,
-                        membershipProvider.RequiresQuestionAndAnswer ? passwordModel.Answer : null);
+                    string newPass = passwordModel.NewPassword;
+                    if (newPass.IsNullOrWhiteSpace())
+                    {
+                        newPass = membershipProvider.ResetPassword(
+                            username,
+                            membershipProvider.RequiresQuestionAndAnswer ? passwordModel.Answer : null);
+                    }
+                    else
+                    {
+                        membershipProvider.ChangePassword(username, string.Empty, newPass);
+                    }

                     if (membershipProvider.IsUmbracoUsersProvider() && backofficeUserManager != null && userId >= 0)
                         backofficeUserManager.RaisePasswordResetEvent(userId);


Adds TODO note

Adds TODO note

--- src/Umbraco.Web/Routing/PublishedRouter.cs
+++ src/Umbraco.Web/Routing/PublishedRouter.cs
@@ -675,6 +675,9 @@
                 // TODO: When we remove the need for a database for templates, then this id should be irrelevant,
                 // not sure how were going to do this nicely.

+                // TODO: We need to limit altTemplate to only allow templates that are assigned to the current document type!
+                // if the template isn't assigned to the document type we should log a warning and return 404
+
                 var templateId = request.PublishedContent.TemplateId;
                 request.TemplateModel = GetTemplateModel(templateId);
             }


Update Merchant.cs

Update Merchant.cs

--- Cielo/Merchant.cs
+++ Cielo/Merchant.cs
@@ -7,7 +7,7 @@
         /// <summary>
         /// FIX: UTILIZAR A SUA CHAVE
         /// </summary>
-        public static readonly Merchant SANDBOX = new Merchant(Guid.Parse("00000000-0000-0000-0000-000000000000"), "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
+        public static readonly Merchant SANDBOX = new Merchant(Guid.Parse("d0274285-581c-4f35-a495-3314590b6642"), "UPVHCCVVUJRLXNYGJYKMVHTEATEPTPEPQOTRBDES");

         public Merchant(Guid id, string key)
         {


Accept HTTP POST for spam

Accept HTTP POST for spam

Accept HTTP POST requests for the spam filters.

--- src/Website/Controllers/ErrorController.cs
+++ src/Website/Controllers/ErrorController.cs
@@ -62,6 +62,7 @@
         /// </returns>
         [HttpGet]
         [HttpHead]
+        [HttpPost]
         [Route("account/login")]
         [Route("admin.php")]
         [Route("admin-console")]


maybe this is the bug but the game crashes on load

--- ksp_plugin_adapter/flight_planner.cs
+++ ksp_plugin_adapter/flight_planner.cs
@@ -299,11 +299,17 @@
                 }
               }
             }
+            TODO_REMOVE_activate_the_bug_ =
+                UnityEngine.GUILayout.Toggle(TODO_REMOVE_activate_the_bug_,
+                                             "Activate issue #1728");
+            var stock_orbit =
+                TODO_REMOVE_activate_the_bug_ ? vessel_.orbit
+                                              : guidance_node_.patch;
             Vector3d stock_velocity_at_node_time =
-                vessel_.orbit.getOrbitalVelocityAtUT(
+                stock_orbit.getOrbitalVelocityAtUT(
                                   manoeuvre.burn.initial_time).xzy;
             Vector3d stock_displacement_from_parent_at_node_time =
-                vessel_.orbit.getRelativePositionAtUT(
+                stock_orbit.getRelativePositionAtUT(
                                   manoeuvre.burn.initial_time).xzy;
             UnityEngine.Quaternion stock_frenet_frame_to_world =
                 UnityEngine.Quaternion.LookRotation(
@@ -376,6 +382,8 @@

   private const double Log10TimeLowerRate = 0.0;
   private const double Log10TimeUpperRate = 7.0;
+
+  private bool TODO_REMOVE_activate_the_bug_ = false;
 }

 }  // namespace ksp_plugin_adapter


removed unuse field

removed unuse field

--- TCC.Core/Data/Skill.cs
+++ TCC.Core/Data/Skill.cs
@@ -5,7 +5,6 @@
 {
     public class Skill
     {
-        Bitmap iconBitmap;
         public string IconName { get; set; }
         public uint Id { get; set; }
         public Class Class { get; set; }


Fix hit object placement not receiving input when outside playfield

The input area is vertical infinite, but horizontally restricted to the playfield due to `CatchPlayfield`'s `ReceivePositionalInputAt` override.

--- osu.Game.Rulesets.Catch/Edit/Blueprints/CatchPlacementBlueprint.cs
+++ osu.Game.Rulesets.Catch/Edit/Blueprints/CatchPlacementBlueprint.cs
@@ -6,6 +6,7 @@
 using osu.Game.Rulesets.Edit;
 using osu.Game.Rulesets.UI;
 using osu.Game.Rulesets.UI.Scrolling;
+using osuTK;

 namespace osu.Game.Rulesets.Catch.Edit.Blueprints
 {
@@ -23,5 +24,7 @@
             : base(new THitObject())
         {
         }
+
+        public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
     }
 }


Remove whitespace

Remove whitespace

--- osu.Game.Rulesets.Osu/Difficulty/Evaluators/FlashlightEvaluator.cs
+++ osu.Game.Rulesets.Osu/Difficulty/Evaluators/FlashlightEvaluator.cs
@@ -80,7 +80,7 @@

                     if (currentObj.Angle != null && osuCurrent.Angle != null) {
                         double roundedAngle = Math.Round(MathUtils.RadiansToDegrees(currentObj.Angle.Value) / 2.0) * 2.0;
-
+
                         if (roundedAngle == initialRoundedAngle)
                             angleRepeatCount++;
                     }


add support for Ulgrim the Unquiet wields (#3418)

--- Source/ACE.Server/WorldObjects/Monster_Inventory.cs
+++ Source/ACE.Server/WorldObjects/Monster_Inventory.cs
@@ -184,6 +184,14 @@
                     case WeenieType.Ammunition:

                         ammo.Add(item);
+                        break;
+
+                    default:
+
+                        // 70995 - Ulgrim the Unquiet wields => 27808 - Great Elariwood Idol
+                        if (IsNPC && item.ValidLocations == EquipMask.Held)
+                            allWeapons.Add(item);
+
                         break;
                 }
             }


Cleanup

Cleanup

--- Source/Code/Collections/ICodeSet/ICodeSetService.cs
+++ Source/Code/Collections/ICodeSet/ICodeSetService.cs
@@ -17,16 +17,6 @@
     public static class ICodeSetService {

         private const bool ThisMethodHandlesNull = true;
-
-        // TODO? Implement CodeXML1 as ienumerable of
-        // intersect full unicode range with Code.IsXml10Char && !Code.IsXml10Discouraged
-        // foreach(var code in CodeFull(Code.MinValue,Code.MaxValue) {
-        //      if (code.IsXml10Char && !Code.IsXml10Discouraged)
-        //          yield return code;
-
-        // TODO? implement CodeOver(laps) UnicodeBlock/Range over domain XML10 or UnicodeAssigned
-        // ATTN! CodeOver.First/Last CodeMask?
-        // ATTN? Do not optimize Code(Set)Over

         public const int UnitCount = 1;
         public const int PairCount = 2;
@@ -179,16 +169,12 @@

         [Pure] public static bool Overlaps (this ICodeSet self, ICodeSet that) {

-            // TODO? Check if both or one is of CodeBits type and then use that type operations
-
             switch (self.QuickSetEquals(that)) {
                     case true: return true;
-                    default: break;
             }
             switch (self.QuickSetOverlaps(that)) {
                     case false: return false;
                     case true: return true;
-                    default: break;
             }

             // Get overlap range
@@ -259,11 +245,12 @@
         /// <param name="that"></param>
         /// <returns></returns>
         [Pure] public static bool Equals (this ICodeSet self, ICodeSet that) {
-            switch (ICodeSetService.QuickSetEquals(self, that)) {
-                    case false: return false;
-                    case true: return true;
-                    default: break;
-            }
+			switch (self.QuickSetEquals(that)) {
+				case false:
+					return false;
+				case true:
+					return true;
+			}
             return self.SequenceEqual(that);
         }

@@ -342,7 +329,7 @@
             Contract.Requires<ArgumentNullException> (ThisMethodHandlesNull);

 			// ATTN! '==' operator can be overloaded to point indirectly here
-            // so using "CodeSet == CodeSet" here will create endless loop
+            // so using "ICodeSet == ICodeSet" here will create endless loop

             // Compare .Count(s)
             if ( (self.IsNull () || self.Count == 0) && (that.IsNull () || that.Count == 0) ) {
@@ -406,7 +393,8 @@

 			return self.IsNull() || self.Count == 0;
         }
-        [Pure] public static bool IsNullOrEmpty (this BitSetArray self) {
+
+		[Pure] public static bool IsNullOrEmpty (this BitSetArray self) {
             Contract.Requires<ArgumentNullException> (ThisMethodHandlesNull);

 			return self.IsNull() || self.Count == 0;
@@ -417,7 +405,8 @@

 			return !self.IsNull() && self.Count != 0 && self.Count == self.Length;
         }
-        [Pure] internal static bool IsFull (this BitSetArray self) {
+
+		[Pure] internal static bool IsFull (this BitSetArray self) {
             Contract.Requires<ArgumentNullException> (ThisMethodHandlesNull);

 			return !self.IsNull() && self.Count != 0 && self.Count == 1 + self.Last - self.First;


iOS: Always get the current shared application instance instead of storing it (it is now null)

--- Source/Eto.Platform.iOS/Forms/ApplicationHandler.cs
+++ Source/Eto.Platform.iOS/Forms/ApplicationHandler.cs
@@ -17,13 +17,18 @@
 			get { return Application.Instance.Handler as ApplicationHandler; }
 		}

+		public override UIApplication Control
+		{
+			get { return UIApplication.SharedApplication; }
+			protected set { }
+		}
+
 		public string DelegateClassName { get; set; }

 		public UIApplicationDelegate AppDelegate { get; private set; }

 		public ApplicationHandler()
 		{
-			Control = UIApplication.SharedApplication;
 			DelegateClassName = "EtoAppDelegate";
 			UIApplication.CheckForIllegalCrossThreadCalls = false;
 		}


Altering comment to make AppVeyor re-test (no idea why it failed)

--- Source/HelixToolkit.Wpf.SharpDX/Controls/Effects.cs
+++ Source/HelixToolkit.Wpf.SharpDX/Controls/Effects.cs
@@ -85,7 +85,7 @@

                 foreach (var item in f.Adapters)
                 {
-                    // nVidia Optimus Windows 10 fix
+                    // Windows 10 fix
                     if (item.Outputs == null || item.Outputs.Length == 0)
                     {
                         continue;


GSF.Historian: Fixed NullReferenceExceptions when writing to historic archive files.

--- Source/Libraries/GSF.Historian/Files/ArchiveFile.cs
+++ Source/Libraries/GSF.Historian/Files/ArchiveFile.cs
@@ -3553,6 +3553,11 @@
                     {
                         // Notify of the exception
                         OnDataWriteException(ex);
+
+                        // If we fail to open the historic file,
+                        // then we cannot write any of these data
+                        // points to it so we might as well move on
+                        continue;
                     }

                     // Calculate the number of additional data blocks needed to store all the data
@@ -3561,7 +3566,7 @@
                         try
                         {
                             ArchiveDataBlock lastDataBlock = historicFile.Fat.FindLastDataBlock(pointID);
-                            int blockCapacity = m_fat.DataBlockSize * 1024 / ArchiveDataPoint.FixedLength;
+                            int blockCapacity = historicFile.DataBlockSize * 1024 / ArchiveDataPoint.FixedLength;
                             int overflowPoints = sortedPointData[pointID].Count + (lastDataBlock?.SlotsUsed ?? 0) - (lastDataBlock?.Capacity ?? 0);
                             overflowBlocks += (overflowPoints + blockCapacity - 1) / blockCapacity;
                         }


added test case with invalid argument count (too many arguments)

--- Tests/FunctionTests.cs
+++ Tests/FunctionTests.cs
@@ -327,7 +327,8 @@
 		[TestCase("min(1,2,3)")]
 		[TestCase("if(1>2,,3)")]
 		[TestCase("if(1>2,3,)")]
-		public void InvalidArgumentCount_ThrowsArgumentCountException(string equation)
+        [TestCase("if(1>2,3,4,5)")]
+        public void InvalidArgumentCount_ThrowsArgumentCountException(string equation)
 		{
 			var compiler = new EquationCompiler(equation);
 			Assert.Throws<ArgumentCountException>(() => compiler.Calculate());


Safebooru fix

Safebooru fix

--- NadekoBot.Core/Modules/Searches/Common/SearchImageCacher.cs
+++ NadekoBot.Core/Modules/Searches/Common/SearchImageCacher.cs
@@ -117,7 +117,7 @@
             switch (type)
             {
                 case DapiSearchType.Safebooru:
-                    website = $"https://safebooru.org/index.php?page=dapi&s=post&q=index&limit=1000&tags=yuri+kissing&json=1";
+                    website = $"https://safebooru.org/index.php?page=dapi&s=post&q=index&limit=1000&tags={tag}&json=1";
                     break;
                 case DapiSearchType.E621:
                     website = $"https://e621.net/post/index.json?limit=1000&tags={tag}";


Add log to JobFactory

Add log to JobFactory

--- TaskProcessor/Utilities/JobFactory.cs
+++ TaskProcessor/Utilities/JobFactory.cs
@@ -1,4 +1,5 @@
-using Quartz;
+using Common.Logging;
+using Quartz;
 using Quartz.Spi;
 using System;

@@ -6,6 +7,8 @@
 {
     public class JobFactory : IJobFactory
     {
+        private static readonly ILog Log = LogManager.GetCurrentClassLogger();
+
         public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
         {
             // Configure your IoC container to return a job instance based on jobType
@@ -13,6 +16,8 @@
             var jobDetail = bundle.JobDetail;

             Type jobType = jobDetail.JobType;
+
+            Log.TraceFormat("Getting instance of job type {0}", jobType);

             throw new NotImplementedException();
         }


Cleaned up sample code

Cleaned up sample code

--- OSVR-Unity/Assets/OSVRUnity/Sample/Scripts/SampleImaging.cs
+++ OSVR-Unity/Assets/OSVRUnity/Sample/Scripts/SampleImaging.cs
@@ -33,9 +33,7 @@

     private Texture2D videoTexture;

-    private byte[] imageBytes;
     private Color32[] imageData;
-    private int[] colors;
     private bool videoChanged;
     private bool firstReport = false;

@@ -71,33 +69,13 @@
         }

         for (int i = 0; i < imageWidth * imageHeight; i++)
-        {
-            /*colors[i] = ((255 & 0xFF) << 24) | // alpha component
-                   Marshal.ReadByte(imageReport.data, i * 3 + 0) & 0xFF << 16 | // blue component
-                   Marshal.ReadByte(imageReport.data, i * 3 + 1) & 0xFF << 8 | // green component
-                   Marshal.ReadByte(imageReport.data, i * 3 + 2) & 0xFF << 0; // red component
-            */
+        {
+            byte r = Marshal.ReadByte(imageReport.data, i * 3 + 0);
+            byte g = Marshal.ReadByte(imageReport.data, i * 3 + 1);
             byte b = Marshal.ReadByte(imageReport.data, i * 3 + 2);
-            byte g = Marshal.ReadByte(imageReport.data, i * 3 + 1);
-            byte r = Marshal.ReadByte(imageReport.data, i * 3 + 0);
             imageData[i] = new Color32(r, g, b, 255);
         }
-       /* for (int x = 0; x < imageWidth; x++)
-        {
-            for (int y = 0; y < imageHeight; y++)
-            {
-                //int byteI = x + y * imageWidth;
-                //int colorI = (imageWidth - x - 1) + y * imageWidth;
-                byte b = Marshal.ReadByte(imageReport.data, colorI);
-                byte g = Marshal.ReadByte(imageReport.data, colorI + 1);
-                byte r = Marshal.ReadByte(imageReport.data, colorI + 2);
-
-                imageData[colorI] = new Color32(r, g, b, 255);
-            }
-        }*/
-
-
-
+
         videoChanged = true;
     }

@@ -105,41 +83,10 @@
     {
         imageHeight = (int)metadata.height;
         imageWidth = (int)metadata.width;
-        imageBytes = new byte[imageWidth * imageHeight];
         imageData = new Color32[imageWidth * imageHeight];
         videoTexture = new Texture2D(imageWidth, imageHeight, TextureFormat.BGRA32, false);
-        colors = new int[imageWidth * imageHeight];
         Material mat = GetComponent<MeshRenderer>().material;
         mat.mainTexture = videoTexture;
         //this.transform.localScale = new Vector3(1, (float)(imageHeight / imageWidth), 1) * .5f;
     }
-
-    public static Texture2D OpenCVImageToUnityTexture(byte[, ,] data, int width, int height, GameObject check)
-    {
-
-        Color32[] imgData = new Color32[width * height];
-
-        int index = 0;
-        byte alpha = 255;
-
-        for (int y = 0; y < width; y++)
-        {
-            for (int x = 0; x < height; x++)
-            {
-                imgData[index] = new Color32((data[x, y, 2]),
-                                               (data[x, y, 1]),
-                                               (data[x, y, 0]),
-                                               alpha);
-                check.SetActive(true);
-                index++;
-            }
-        }
-
-        Texture2D toReturn = new Texture2D(width, height, TextureFormat.RGBA32, false);
-        toReturn.SetPixels32(imgData);
-        toReturn.Apply();
-        toReturn.wrapMode = TextureWrapMode.Clamp;
-
-        return toReturn;
-    }
 }


Bitmaps are bitmaps not pngs, yeah?

Bitmaps are bitmaps not pngs, yeah?

--- OpenSim/Region/CoreModules/World/Terrain/FileLoaders/BMP.cs
+++ OpenSim/Region/CoreModules/World/Terrain/FileLoaders/BMP.cs
@@ -62,7 +62,7 @@
         {
             Bitmap colours = CreateGrayscaleBitmapFromMap(map);

-            colours.Save(stream, ImageFormat.Png);
+            colours.Save(stream, ImageFormat.Bmp);
         }

         /// <summary>


Improved reuse on the WorldMap/WorldMapModule.cs

--- OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -233,20 +233,8 @@
                 }
                 if (lookup)
                 {
-                    List<MapBlockData> mapBlocks = new List<MapBlockData>(); ;
-
-                    List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
-                        (int)(m_scene.RegionInfo.RegionLocX - 8) * (int)Constants.RegionSize,
-                        (int)(m_scene.RegionInfo.RegionLocX + 8) * (int)Constants.RegionSize,
-                        (int)(m_scene.RegionInfo.RegionLocY - 8) * (int)Constants.RegionSize,
-                        (int)(m_scene.RegionInfo.RegionLocY + 8) * (int)Constants.RegionSize);
-                    foreach (GridRegion r in regions)
-                    {
-                        MapBlockData block = new MapBlockData();
-                        MapBlockFromGridRegion(block, r);
-                        mapBlocks.Add(block);
-                    }
-                    avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0);
+                    List<MapBlockData> mapBlocks = GetAndSendBlocks(avatarPresence.ControllingClient, (int)(m_scene.RegionInfo.RegionLocX) - 4, (int)(m_scene.RegionInfo.RegionLocY) - 4,
+                            (int)(m_scene.RegionInfo.RegionLocX) + 4, (int)(m_scene.RegionInfo.RegionLocY) + 4, 0);

                     lock (cachedMapBlocks)
                         cachedMapBlocks = mapBlocks;
@@ -832,7 +820,7 @@
             }
         }

-        protected virtual void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
+        protected virtual List<MapBlockData> GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
         {
             List<MapBlockData> mapBlocks = new List<MapBlockData>();
             List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
@@ -847,6 +835,8 @@
                 mapBlocks.Add(block);
             }
             remoteClient.SendMapBlock(mapBlocks, 0);
+
+            return mapBlocks;
         }

         protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r)


Use double quotes for bytes representation (#775)

--- Src/IronPython/Runtime/Operations/IListOfByteOps.cs
+++ Src/IronPython/Runtime/Operations/IListOfByteOps.cs
@@ -8,6 +8,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Linq;
 using System.Text;

 namespace IronPython.Runtime.Operations {
@@ -608,9 +609,14 @@
             return -1;
         }

-        internal static string BytesRepr(this IList<byte> bytes) {
+        internal static string BytesRepr(this IReadOnlyList<byte> bytes) {
             StringBuilder res = new StringBuilder();
-            res.Append("b'");
+            res.Append('b');
+            char quote = '\'';
+            if (bytes.Any(b => b == '\'') && bytes.All(b => b != '\"')) {
+                quote = '\"';
+            }
+            res.Append(quote);
             for (int i = 0; i < bytes.Count; i++) {
                 byte ch = bytes[i];

@@ -619,12 +625,11 @@
                     case (byte)'\t': res.Append("\\t"); break;
                     case (byte)'\n': res.Append("\\n"); break;
                     case (byte)'\r': res.Append("\\r"); break;
-                    case (byte)'\'':
-                        res.Append('\\');
-                        res.Append('\'');
-                        break;
                     default:
-                        if (ch < ' ' || (ch >= 0x7f && ch <= 0xff)) {
+                        if (ch == quote) {
+                            res.Append('\\');
+                            res.Append((char)ch);
+                        } else if (ch < ' ' || (ch >= 0x7f && ch <= 0xff)) {
                             res.AppendFormat("\\x{0:x2}", ch);
                         } else {
                             res.Append((char)ch);
@@ -632,7 +637,7 @@
                         break;
                 }
             }
-            res.Append("'");
+            res.Append(quote);
             return res.ToString();
         }


P C String Fix

P C String Fix

--- Src/Pc/CompilerCore/Backend/Prt/PrtCodeGenerator.cs
+++ Src/Pc/CompilerCore/Backend/Prt/PrtCodeGenerator.cs
@@ -1056,7 +1056,9 @@
                     break;

                 case PrintStmt printStmt:
-                    WritePrintStmt(output, printStmt, function);
+                    context.Write(output, $"PrtPrintf(");
+                    WriteExpr(output, function, printStmt.Message);
+                    context.WriteLine(output, ");");
                     break;

                 case RaiseStmt raiseStmt:
@@ -1241,12 +1243,7 @@
             }

             context.WriteLine(output);
-        }
-
-
-        private void WritePrintStmt(TextWriter output, PrintStmt printStmt, Function function)
-        {
-            throw new NotImplementedException("Print statement support for the C runtime is currently broken, please contact the P developers!");
+
         }

         private void WriteLValue(TextWriter output, Function function, IPExpr expr)
@@ -1542,7 +1539,36 @@
                     break;

                 case StringExpr stringExpr:
-                    throw new NotImplementedException("String not fully supported in the C code gen");
+                    // format is {str0, n1, str1, n2, ..., nK, strK}
+                    object[] assignBaseParts = PrtTranslationUtils.ParsePrintMessage(stringExpr.BaseString);
+
+                    // Build parameter pack
+                    int k = (assignBaseParts.Length - 1) / 2;
+                    context.Write(output, "PrtMkStringValue(PrtFormatString(\"");
+                    context.Write(output, (string)assignBaseParts[0]);
+                    context.Write(output, "\", ");
+                    context.Write(output, stringExpr.Args.Count.ToString());
+                    foreach (IPExpr arg in stringExpr.Args)
+                    {
+                        context.Write(output, ", ");
+                        WriteExpr(output, function, arg);
+                    }
+
+                    context.Write(output, ", ");
+                    context.Write(output, k.ToString());
+                    for (int i = 0; i < k; i++)
+                    {
+                        int n = (int)assignBaseParts[1 + 2 * i];
+                        string s = (string)assignBaseParts[1 + 2 * i + 1];
+                        context.Write(output, ", ");
+                        context.Write(output, n.ToString());
+                        context.Write(output, ", \"");
+                        context.Write(output, s);
+                        context.Write(output, "\"");
+                    }
+
+                    context.WriteLine(output, "));");
+                    break;

                 case SizeofExpr sizeofExpr:
                     string sizeofFun = PLanguageType.TypeIsOfKind(sizeofExpr.Expr.Type, TypeKind.Map)


Refactored - Removed unused variable

Refactored - Removed unused variable

--- src/Articulate/Models/MasterModel.cs
+++ src/Articulate/Models/MasterModel.cs
@@ -55,7 +55,6 @@

         private string _pageTitle;
         private string _pageDescription;
-        private string _pageTags;

         public IPublishedContent BlogArchiveNode
         {


Reducing light spawn interval.

Reducing light spawn interval.

--- src/Assets/src/TestableCollisions.cs
+++ src/Assets/src/TestableCollisions.cs
@@ -50,7 +50,7 @@
         this.rand = rand;

         caller.callback = onSpawn;
-        caller.interval = new TimeSpan(0, 0, 3);
+        caller.interval = TimeSpan.FromSeconds(2);
         box.Obj.transform.localScale = new UnityEngine.Vector3(50, 1, 50);
     }


Fixed StyleCop violations in Program.cs in Stumps.Launcher.

--- src/main/dot-net/Stumps.Launcher/Program.cs
+++ src/main/dot-net/Stumps.Launcher/Program.cs
@@ -2,22 +2,22 @@
 {

     using System;
+    using System.Diagnostics;
     using System.IO;
     using Stumps.Server;
     using Stumps.Server.Data;
-    using System.Diagnostics;

     /// <summary>
     ///     A class that provides the primary entry point for the application.
     /// </summary>
-    static class Program
+    public static class Program
     {

         /// <summary>
         ///     The main entry point for the application.
         /// </summary>
         [STAThread]
-        static void Main()
+        public static void Main()
         {

             var configurationFile = Path.Combine(


make internal stored Info a strcut to optimize memory (pr note)

--- src/Avalonia.Layout/LayoutManager.cs
+++ src/Avalonia.Layout/LayoutManager.cs
@@ -17,7 +17,7 @@
     {
         private class LayoutQueue<T> : IReadOnlyCollection<T>
         {
-            private class Info
+            private struct Info
             {
                 public bool Active;
                 public int Count;
@@ -46,6 +46,7 @@
                 if (_loopQueueInfo.TryGetValue(result, out var info))
                 {
                     info.Active = false;
+                    _loopQueueInfo[result] = info;
                 }

                 return result;
@@ -53,16 +54,12 @@

             public void Enqueue(T item)
             {
-                if (!_loopQueueInfo.TryGetValue(item, out var info))
-                {
-                    _loopQueueInfo[item] = info = new Info();
-                }
+                _loopQueueInfo.TryGetValue(item, out var info);

                 if (!info.Active && info.Count < _maxEnqueueCountPerLoop)
                 {
                     _inner.Enqueue(item);
-                    info.Active = true;
-                    info.Count++;
+                    _loopQueueInfo[item] = new Info() { Active = true, Count = info.Count + 1 };
                 }
             }

@@ -83,9 +80,7 @@
                 {
                     if (_shouldEnqueue(item.Key))
                     {
-                        item.Value.Active = true;
-                        item.Value.Count++;
-                        _loopQueueInfo[item.Key] = item.Value;
+                        _loopQueueInfo[item.Key] = new Info() { Active = true, Count = item.Value.Count + 1 };
                         _inner.Enqueue(item.Key);
                     }
                 }


Remove redundant player ID check

Remove redundant player ID check

--- Client/Console.cs
+++ Client/Console.cs
@@ -63,8 +63,6 @@
                         goto default;

                     case ObjectType.AIShip:
-                        // don't draw the name for the local player ship
-                        if (obj.id == Player.id) goto default;
                         // draw ship name above it
                         Ship shipobj = obj as Ship;
                         Debug.Assert(shipobj != null);


Fix name of editor component.

Fix name of editor component.


Fix: Added support for Extension Methods

Made a small attribute to support the power and beauty of extension
methods in .NET 2.0! :)

--- Client/Program.cs
+++ Client/Program.cs
@@ -7,6 +7,15 @@
 using xClient.Core.Commands;
 using xClient.Core.Keylogger;
 using xClient.Core.Packets;
+
+namespace System.Runtime.CompilerServices
+{
+    // With this namespace defined along with this attribute stub, we now
+    // have access to the power of extension methods for the whole client!
+    // :)
+    [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
+    public sealed class ExtensionAttribute : Attribute { }
+}

 namespace xClient
 {