Add Card.SpellSchool helper

Add Card.SpellSchool helper

--- HearthDb/Card.cs
+++ HearthDb/Card.cs
@@ -91,6 +91,8 @@

 		public int Armor => Entity.GetTag(ARMOR);

+		public int SpellSchool => Entity.GetTag(SPELL_SCHOOL);
+
 		public string[] Mechanics
 		{
 			get


Fix missing import in tests

Fix missing import in tests

--- HearthDb.Tests/UnitTest1.cs
+++ HearthDb.Tests/UnitTest1.cs
@@ -2,6 +2,7 @@

 using HearthDb.Enums;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System.Linq;

 #endregion


added text

--- MessageBoxGithubDing/MessageBoxGithubDing/Form1.cs
+++ MessageBoxGithubDing/MessageBoxGithubDing/Form1.cs
@@ -24,17 +24,17 @@

         private void btnMessageEenMaSt_Click(object sender, EventArgs e)
         {
-            DisplayMessage("*Insert Message 1 Here");
+            DisplayMessage("I want to play a game.");
         }

         private void btnMessageTweeMaSt_Click(object sender, EventArgs e)
         {
-            DisplayMessage("*Insert Message 2 Here");
+            DisplayMessage("Marco.....");
         }

         private void btnMessageDrieMaSt_Click(object sender, EventArgs e)
         {
-            DisplayMessage("*Insert Message 3 Here");
+            DisplayMessage("Polo");
         }
     }
 }


reveretd calls to async last in buildUserLookyp

--- ITSWebMgmt/UserInfo.aspx.cs
+++ ITSWebMgmt/UserInfo.aspx.cs
@@ -593,14 +593,14 @@
                 Session["adpath"] = adpath;

                 //Async
-                await buildBasicInfoSegment(userDE);
-                await BuildSCSMSegment(userDE);
+                var task1 = buildBasicInfoSegment(userDE);
+                var task2 = BuildSCSMSegment(userDE);

                 //Build GUI
                 var rawbuilder = new RawADGridGenerator();
                 var rawsegment = rawbuilder.buildRawSegment(userDE);
                 labelRawdata.Text = rawsegment;
-
+
                 buildComputerInformation(userDE);
                 buildWarningSegment(userDE);
                 buildGroupsSegments(userDE);
@@ -608,12 +608,14 @@
                 buildLoginscript(userDE);
                 buildPrint(userDE); // XXX make async?

+                await System.Threading.Tasks.Task.WhenAll(task1, task2);
+
                 //Save user in session
                 ResultDiv.Visible = true;
                 errordiv.Visible = false;

                 watch.Stop();
-                System.Diagnostics.Debug.WriteLine("buildUserLookup took: "+  watch.ElapsedMilliseconds);
+                System.Diagnostics.Debug.WriteLine("buildUserLookup took: " + watch.ElapsedMilliseconds);
             }
         }


[V2] Fixing where the change the C++ language standard in the C++11 test

--- testpackages/Cxx11Test1/dev/Cxx11Test1.cs
+++ testpackages/Cxx11Test1/dev/Cxx11Test1.cs
@@ -21,7 +21,7 @@
 namespace Cxx11Test1
 {
     public sealed class TestProgV2 :
-        C.V2.ConsoleApplication
+        C.Cxx.V2.ConsoleApplication
     {
         protected override void Init(Bam.Core.V2.Module parent)
         {
@@ -32,11 +32,9 @@

             source.PrivatePatch(settings =>
                 {
-                    var compiler = settings as C.V2.ICommonCompilerOptions;
-                    compiler.LanguageStandard = C.ELanguageStandard.Cxx11;
-
                     var cxxCompiler = settings as C.V2.ICxxOnlyCompilerOptions;
                     cxxCompiler.ExceptionHandler = C.Cxx.EExceptionHandler.Synchronous;
+                    cxxCompiler.LanguageStandard = C.Cxx.ELanguageStandard.Cxx11;
                 });

             if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows) &&


Fixed problems in Windows OS with file access

--- IO/DataStream.cs
+++ IO/DataStream.cs
@@ -57,7 +57,12 @@
 		}

 		public DataStream(string filePath, FileMode mode, FileAccess access)
-			: this(File.Open(filePath, mode, access), 0, -1)
+			: this(new FileStream(filePath, mode, access), 0, -1)
+		{
+		}
+
+		public DataStream(string filePath, FileMode mode, FileAccess access, FileShare share)
+			: this(new FileStream(filePath, mode, access, share), 0, -1)
 		{
 		}


args are now serialized correctly

args are now serialized correctly

--- Joueur/Client.cs
+++ Joueur/Client.cs
@@ -329,6 +329,8 @@
                 }
             }

+            Console.WriteLine("Game is over. " + (won ? "I won!" : "I Lost :(") + " because " + reason);
+
             try
             {
                 this.AI.Ended(won, reason);
@@ -361,11 +363,21 @@

         public T RunOnServer<T>(BaseGameObject caller, string functionName, IDictionary<string, object> args = null)
         {
+            IDictionary<string, object> serialized = null;
+            if (args != null)
+            {
+                serialized = new Dictionary<string, object>();
+                foreach (string key in args.Keys)
+                {
+                    serialized.Add(key, Client.Instance.GameManager.SerializeSafe(args[key]));
+                }
+            }
+
             this.Send("run", new ServerMessages.RunMessage()
                 {
                     caller = this.GameManager.SerializeGameObject(caller),
                     functionName = functionName,
-                    args = args
+                    args = serialized
                 }
             );


Use new constructor

Use new constructor

--- AngleSharp.Samples.App/ViewModels/MainViewModel.cs
+++ AngleSharp.Samples.App/ViewModels/MainViewModel.cs
@@ -39,7 +39,7 @@
         public MainViewModel()
         {
             var events = new EventAggregator();
-            var config = new Configuration { Events = events }.WithCss().WithDefaultLoader(m =>
+            var config = new Configuration(events: events).WithCss().WithDefaultLoader(m =>
             {
                 m.IsNavigationEnabled = true;
                 m.IsResourceLoadingEnabled = true;


Implemented RotrateAround. TODO: Destroy flying objects after passing

--- Assets/NinjaGame/Scripts/MovingRigidbodyPhysics.cs
+++ Assets/NinjaGame/Scripts/MovingRigidbodyPhysics.cs
@@ -53,7 +53,7 @@
             Body.transform.LookAt(target);
             //Sword sword = FindObjectOfType<Sword>();
             //TODO: We want event mnessaging here
-            //if (sword.IsGrabbed())
+            //if (sword.IsGrabbed())
             if (Time.realtimeSinceStartup > 5)
                 Body.AddRelativeForce(Vector3.forward * speed, ForceMode.Force);
         }


Use TaskEx everywhere

Use TaskEx everywhere

--- AngleSharp/Extensions/ElementExtensions.cs
+++ AngleSharp/Extensions/ElementExtensions.cs
@@ -637,11 +637,7 @@
             if (document != null)
                 return document.Tasks.Add(element, creator);

-#if LEGACY || SILVERLIGHT
             return TaskEx.FromResult(default(T));
-#else
-            return Task.FromResult(default(T));
-#endif
         }

         /// <summary>


ChartLegend example

ChartLegend example

--- ApiExamples/CSharp/ApiExamples/ExCharts.cs
+++ ApiExamples/CSharp/ApiExamples/ExCharts.cs
@@ -13,6 +13,7 @@
         public void ChartSeries()
         {
             //ExStart
+            //ExFor:Charts.Chart
             //ExFor:Charts.Chart.Title
             //ExFor:Charts.ChartTitle
             //ExFor:Charts.ChartTitle.Overlay
@@ -214,5 +215,34 @@
             doc.Save(ArtifactsDir + "Charts.AxisBound.docx");
             //ExEnd
         }
+
+        [Test]
+        public void ChartLegend()
+        {
+            //ExStart
+            //ExFor:Charts.Chart.Legend
+            //ExFor:Charts.ChartLegend
+            //ExFor:Charts.ChartLegend.Overlay
+            //ExFor:Charts.ChartLegend.Position
+            //ExSummary:Shows how to edit the appearance of a chart's legend.
+            Document doc = new Document();
+            DocumentBuilder builder = new DocumentBuilder(doc);
+
+            // Insert a line graph
+            Shape chartShape = builder.InsertChart(ChartType.Line, 450, 300);
+            Chart chart = chartShape.Chart;
+
+            // Get its legend
+            ChartLegend legend = chart.Legend;
+
+            // By default, other elements of a chart will not overlap with its legend
+            Assert.False(legend.Overlay);
+
+            // We can move its position by setting this attribute
+            legend.Position = LegendPosition.TopRight;
+
+            doc.Save(ArtifactsDir + "Charts.ChartLegend.docx");
+            //ExEnd
+        }
     }
 }


Fix Access Denied in ForegroundProcess (fixes #36)

Makes use of a Vista+ API which provides partial information access to
restricted processes querying elevated ones. Should solve the issue
Alpha-Kilo was experiencing.

--- Articulate/Components/ForegroundProcess.cs
+++ Articulate/Components/ForegroundProcess.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
@@ -20,6 +21,71 @@
 		[DllImport("user32.dll")]
 		static extern IntPtr GetForegroundWindow();

+
+		#region Native API
+
+		[Flags]
+		enum ProcessAccessFlags : uint
+		{
+			All = 0x001F0FFF,
+			Terminate = 0x00000001,
+			CreateThread = 0x00000002,
+			VMOperation = 0x00000008,
+			VMRead = 0x00000010,
+			VMWrite = 0x00000020,
+			DupHandle = 0x00000040,
+			SetInformation = 0x00000200,
+			QueryInformation = 0x00000400,
+			QueryLimitedInformation = 0x1000,
+			Synchronize = 0x00100000
+		}
+
+		private static string GetExecutablePath(Process Process)
+		{
+			//If running on Vista or later use the new function
+			if (Environment.OSVersion.Version.Major >= 6)
+			{
+				return GetExecutablePathAboveVista(Process.Id);
+			}
+
+			return Process.MainModule.FileName;
+		}
+
+		private static string GetExecutablePathAboveVista(int ProcessId)
+		{
+			var buffer = new StringBuilder(1024);
+			IntPtr hprocess = OpenProcess(ProcessAccessFlags.QueryLimitedInformation,
+										  false, ProcessId);
+			if (hprocess != IntPtr.Zero)
+			{
+				try
+				{
+					int size = buffer.Capacity;
+					if (QueryFullProcessImageName(hprocess, 0, buffer, out size))
+					{
+						return buffer.ToString();
+					}
+				}
+				finally
+				{
+					CloseHandle(hprocess);
+				}
+			}
+			throw new Win32Exception(Marshal.GetLastWin32Error());
+		}
+
+		[DllImport("kernel32.dll")]
+		private static extern bool QueryFullProcessImageName(IntPtr hprocess, int dwFlags,
+					   StringBuilder lpExeName, out int size);
+		[DllImport("kernel32.dll")]
+		private static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess,
+					   bool bInheritHandle, int dwProcessId);
+
+		[DllImport("kernel32.dll", SetLastError = true)]
+		private static extern bool CloseHandle(IntPtr hHandle);
+
+		#endregion
+
 		/// <summary>
 		/// Gets the Full Path to the current foreground window's executable file
 		/// </summary>
@@ -30,8 +96,10 @@
 				IntPtr processID;
 				GetWindowThreadProcessId(GetForegroundWindow(), out processID);

+				if (Environment.OSVersion.Version.Major >= 6)
+					return GetExecutablePathAboveVista((int)processID);
+
 				Process p = Process.GetProcessById((int)processID);
-
 				return p.MainModule.FileName;
 			}
 		}
@@ -47,4 +115,4 @@
 			}
 		}
 	}
-}
+}


Support additional properties. Skip unregistered extensions.

--- Assets/GLTF/Scripts/Schema/GLTFProperty.cs
+++ Assets/GLTF/Scripts/Schema/GLTFProperty.cs
@@ -28,7 +28,53 @@
                     Extras = reader.ReadAsObjectDictionary();
                     break;
                 default:
-                    throw new Exception(string.Format("Unexpected property: {0} at: {1}", reader.Value, reader.Path));
+                    SkipValue(reader);
+                    break;
+            }
+        }
+
+        private void SkipValue(JsonReader reader)
+        {
+            if (!reader.Read())
+            {
+                throw new Exception("No value found.");
+            }
+
+            if (reader.TokenType == JsonToken.StartObject)
+            {
+                SkipObject(reader);
+            }
+            else if (reader.TokenType == JsonToken.StartArray)
+            {
+                SkipArray(reader);
+            }
+        }
+
+        private void SkipObject(JsonReader reader)
+        {
+            while (reader.Read() && reader.TokenType != JsonToken.EndObject) {
+                if (reader.TokenType == JsonToken.StartArray)
+                {
+                    SkipArray(reader);
+                }
+                else if (reader.TokenType == JsonToken.StartObject)
+                {
+                    SkipObject(reader);
+                }
+            }
+        }
+
+        private void SkipArray(JsonReader reader)
+        {
+            while (reader.Read() && reader.TokenType != JsonToken.EndArray) {
+                if (reader.TokenType == JsonToken.StartArray)
+                {
+                    SkipArray(reader);
+                }
+                else if (reader.TokenType == JsonToken.StartObject)
+                {
+                    SkipObject(reader);
+                }
             }
         }

@@ -52,7 +98,7 @@
                 }
                 else
                 {
-                    reader.ReadAsObjectDictionary();
+                    SkipValue(reader);
                 }
             }


Update caches systems references to be actual caches and not an additional 0(n) lookup (#10606)

* Microsoft mandatory file (#10599)

Co-authored-by: microsoft-github-policy-service[bot] <1f8e8ea10a323d226e6dc5b190a289fd191eca73@users.noreply.github.com>

* Update caches systems references to be actual caches and not an additional 0n lookup

* Updated Reset cache implementations to also clear the individual cache references, as per request

Co-authored-by: microsoft-github-policy-service[bot] <1f8e8ea10a323d226e6dc5b190a289fd191eca73@users.noreply.github.com>
Co-authored-by: Kurtis <601750f99a611216e3b3536e5835b26dc3c9b459@microsoft.com>

--- Assets/MRTK/Core/Utilities/CoreServices.cs
+++ Assets/MRTK/Core/Utilities/CoreServices.cs
@@ -20,64 +20,94 @@
     /// </summary>
     public static class CoreServices
     {
+        private static IMixedRealityBoundarySystem boundarySystem;
+
         /// <summary>
         /// Cached reference to the active instance of the boundary system.
         /// If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
         /// </summary>
-        public static IMixedRealityBoundarySystem BoundarySystem => GetService<IMixedRealityBoundarySystem>();
+        public static IMixedRealityBoundarySystem BoundarySystem => boundarySystem ?? (boundarySystem = GetService<IMixedRealityBoundarySystem>());
+
+        private static IMixedRealityCameraSystem cameraSystem;

         /// <summary>
         /// Cached reference to the active instance of the camera system.
         /// If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
         /// </summary>
-        public static IMixedRealityCameraSystem CameraSystem => GetService<IMixedRealityCameraSystem>();
+        public static IMixedRealityCameraSystem CameraSystem => cameraSystem ?? (cameraSystem = GetService<IMixedRealityCameraSystem>());
+
+        private static IMixedRealityDiagnosticsSystem diagnosticsSystem;

         /// <summary>
         /// Cached reference to the active instance of the diagnostics system.
         /// If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
         /// </summary>
-        public static IMixedRealityDiagnosticsSystem DiagnosticsSystem => GetService<IMixedRealityDiagnosticsSystem>();
+        public static IMixedRealityDiagnosticsSystem DiagnosticsSystem => diagnosticsSystem ?? (diagnosticsSystem = GetService<IMixedRealityDiagnosticsSystem>());
+
+        private static IMixedRealityFocusProvider focusProvider;

         /// <summary>
         /// Cached reference to the active instance of the focus provider.
         /// If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
         /// </summary>
-        public static IMixedRealityFocusProvider FocusProvider => GetService<IMixedRealityFocusProvider>();
+        public static IMixedRealityFocusProvider FocusProvider => focusProvider ?? (focusProvider = GetService<IMixedRealityFocusProvider>());
+
+        private static IMixedRealityInputSystem inputSystem;

         /// <summary>
         /// Cached reference to the active instance of the input system.
         /// If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
         /// </summary>
-        public static IMixedRealityInputSystem InputSystem => GetService<IMixedRealityInputSystem>();
+        public static IMixedRealityInputSystem InputSystem => inputSystem ?? (inputSystem = GetService<IMixedRealityInputSystem>());
+
+        private static IMixedRealityRaycastProvider raycastProvider;

         /// <summary>
         /// Cached reference to the active instance of the raycast provider.
         /// If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
         /// </summary>
-        public static IMixedRealityRaycastProvider RaycastProvider => GetService<IMixedRealityRaycastProvider>();
+        public static IMixedRealityRaycastProvider RaycastProvider => raycastProvider ?? (raycastProvider = GetService<IMixedRealityRaycastProvider>());
+
+        private static IMixedRealitySceneSystem sceneSystem;

         /// <summary>
         /// Cached reference to the active instance of the scene system.
         /// If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
         /// </summary>
-        public static IMixedRealitySceneSystem SceneSystem => GetService<IMixedRealitySceneSystem>();
+        public static IMixedRealitySceneSystem SceneSystem => sceneSystem ?? (sceneSystem = GetService<IMixedRealitySceneSystem>());
+
+        private static IMixedRealitySpatialAwarenessSystem spatialAwarenessSystem;

         /// <summary>
         /// Cached reference to the active instance of the spatial awareness system.
         /// If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
         /// </summary>
-        public static IMixedRealitySpatialAwarenessSystem SpatialAwarenessSystem => GetService<IMixedRealitySpatialAwarenessSystem>();
+        public static IMixedRealitySpatialAwarenessSystem SpatialAwarenessSystem => spatialAwarenessSystem ?? (spatialAwarenessSystem = GetService<IMixedRealitySpatialAwarenessSystem>());
+
+        private static IMixedRealityTeleportSystem teleportSystem;

         /// <summary>
         /// Cached reference to the active instance of the teleport system.
         /// If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
         /// </summary>
-        public static IMixedRealityTeleportSystem TeleportSystem => GetService<IMixedRealityTeleportSystem>();
+        public static IMixedRealityTeleportSystem TeleportSystem => teleportSystem ?? (teleportSystem = GetService<IMixedRealityTeleportSystem>());

         /// <summary>
         /// Resets all cached system references to null
         /// </summary>
-        public static void ResetCacheReferences() => serviceCache.Clear();
+        public static void ResetCacheReferences()
+        {
+            serviceCache.Clear();
+            boundarySystem = null;
+            cameraSystem = null;
+            diagnosticsSystem = null;
+            focusProvider = null;
+            inputSystem = null;
+            raycastProvider = null;
+            sceneSystem = null;
+            spatialAwarenessSystem = null;
+            teleportSystem = null;
+        }

         /// <summary>
         /// Clears the cache of the reference with key of given type if present and applicable
@@ -91,6 +121,7 @@
                 if (serviceCache.ContainsKey(serviceType))
                 {
                     serviceCache.Remove(serviceType);
+                    ResetCacheReferenceFromType(serviceType);
                     return true;
                 }
             }
@@ -100,6 +131,46 @@
             }

             return false;
+        }
+
+        private static void ResetCacheReferenceFromType(Type serviceType)
+        {
+            if (typeof(IMixedRealityBoundarySystem).IsAssignableFrom(serviceType))
+            {
+                boundarySystem = null;
+            }
+            if (typeof(IMixedRealityCameraSystem).IsAssignableFrom(serviceType))
+            {
+                cameraSystem = null;
+            }
+            if (typeof(IMixedRealityDiagnosticsSystem).IsAssignableFrom(serviceType))
+            {
+                diagnosticsSystem = null;
+            }
+            if (typeof(IMixedRealityFocusProvider).IsAssignableFrom(serviceType))
+            {
+                focusProvider = null;
+            }
+            if (typeof(IMixedRealityInputSystem).IsAssignableFrom(serviceType))
+            {
+                inputSystem = null;
+            }
+            if (typeof(IMixedRealityRaycastProvider).IsAssignableFrom(serviceType))
+            {
+                raycastProvider = null;
+            }
+            if (typeof(IMixedRealitySceneSystem).IsAssignableFrom(serviceType))
+            {
+                sceneSystem = null;
+            }
+            if (typeof(IMixedRealitySpatialAwarenessSystem).IsAssignableFrom(serviceType))
+            {
+                sceneSystem = null;
+            }
+            if (typeof(IMixedRealityTeleportSystem).IsAssignableFrom(serviceType))
+            {
+                teleportSystem = null;
+            }
         }

         /// <summary>
@@ -147,7 +218,7 @@
         // We do not want to keep a service around so use WeakReference
         private static readonly Dictionary<Type, WeakReference<IMixedRealityService>> serviceCache = new Dictionary<Type, WeakReference<IMixedRealityService>>();

-        private static T GetService<T>() where T : IMixedRealityService
+        private static T GetService<T>() where T : IMixedRealityService
         {
             Type serviceType = typeof(T);

@@ -176,4 +247,4 @@
             return service;
         }
     }
-}
+}


Inimigos não colidem mais com power ups

Inimigos não colidem mais com power ups

--- Assets/Scripts/MainGame/SceneController.cs
+++ Assets/Scripts/MainGame/SceneController.cs
@@ -17,10 +17,10 @@
     {
         playerInitPos = beginningOfWorld.position.x;
         playerEndPos = playerInitPos + distanceToWin;
+        Physics2D.IgnoreLayerCollision(LayerMask.NameToLayer("Enemies"), LayerMask.NameToLayer("PowerUps"));
+    }

-	}
-
-	void Update ()
+    void Update ()
     {
         ProgressBar();
         UpdateDifficulty(); // Por enquanto, só funciona para o minigame da ira.


Fix certification error that can occur on Windows (#302)


Add number formatting in crowdfund app

Add number formatting in crowdfund app

--- BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml
+++ BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml
@@ -65,7 +65,7 @@
                     {

-                                <span class="badge bg-info px-3" v-text="`${srvModel.targetAmount} ${targetCurrency}`">@Math.Round(Model.TargetAmount.GetValueOrDefault(0)) @Model.TargetCurrency
+                                <span class="badge bg-info px-3" v-text="`${new Intl.NumberFormat().format(srvModel.targetAmount)} ${targetCurrency}`">@Math.Round(Model.TargetAmount.GetValueOrDefault(0)) @Model.TargetCurrency

                             @if (Model.ResetEveryAmount > 0 && !Model.NeverReset)
                             {
@@ -123,7 +123,7 @@

-                            <h3 v-text="`${raisedAmount} ${targetCurrency}`">@Math.Round(Model.Info.CurrentAmount + Model.Info.CurrentPendingAmount) @Model.TargetCurrency

+                            <h3 v-text="`${new Intl.NumberFormat().format(raisedAmount)} ${targetCurrency}`">@Math.Round(Model.Info.CurrentAmount + Model.Info.CurrentPendingAmount) @Model.TargetCurrency

Raised

                              0" class="only-for-js">

@@ -143,7 +143,7 @@

-
@Model.Info.TotalContributors

+
@Model.Info.TotalContributors

Contributors

                         @if (Model.StartDate.HasValue || Model.EndDate.HasValue)
@@ -327,7 +327,7 @@
                         {{perk.title? perk.title : perk.id}}

                             <template v-if="perk.price && perk.price.value">
-                                {{perk.price.value.noExponents()}}
+                                {{new Intl.NumberFormat().format(perk.price.value.noExponents())}}
                                 {{targetCurrency}}
                                 <template v-if="perk.price.type == 1">or more</template>
                             </template>
@@ -366,10 +366,10 @@

-                     0" class="text-center text-muted">{{perk.inventory}} left
+                     0" class="text-center text-muted">{{new Intl.NumberFormat().format(perk.inventory)}} left
                     <span v-if="perk.inventory != null && perk.inventory <= 0" class="text-center text-muted">Sold out
-                    {{perk.sold}} Contributor{{perk.sold === 1 ? "": "s"}}
-                    {{perk.value}} {{targetCurrency}} total
+                    {{new Intl.NumberFormat().format(perk.sold)}} Contributor{{perk.sold === 1 ? "": "s"}}
+                    {{new Intl.NumberFormat().format(perk.value)}} {{targetCurrency}} total

             </form>


Fixes #66 and #67

Fixes #66 and #67

--- Battery-Commander.Web/Models/UnitStatsViewModel.cs
+++ Battery-Commander.Web/Models/UnitStatsViewModel.cs
@@ -22,7 +22,7 @@

             public int NotTested { get; set; }

-            public Decimal PercentPass => Passed / Assigned;
+            public Decimal PercentPass => Assigned == 0 ? 0 : Passed / Assigned;
         }
     }
 }


Improved summaries - closes #27

Improved summaries - closes #27

--- NotifyPropertyChangedBase/NotifyPropertyChanged.cs
+++ NotifyPropertyChangedBase/NotifyPropertyChanged.cs
@@ -33,7 +33,7 @@
 namespace NotifyPropertyChangedBase
 {
     /// <summary>
-    /// Abstract class implementing the <see cref="INotifyPropertyChanged"/> interface.
+    /// Abstract base class implementing the <see cref="INotifyPropertyChanged"/> interface.
     /// </summary>
     public abstract class NotifyPropertyChanged : INotifyPropertyChanged
     {
@@ -41,13 +41,11 @@

         /// <summary>
         /// Gets or sets the value indicating whether the <see cref="PropertyChanged"/> event should be invoked
-        /// from the <see cref="SetValue(object, string)"/> and <see cref="ForceSetValue(object, string)"/> methods
         /// when a property changes. The default value is <c>true</c>.
         /// </summary>
         protected bool IsPropertyChangedEventInvokingEnabled { get; set; }
         /// <summary>
-        /// Gets or sets the value indicating whether the <see cref="PropertyChangedCallbackHandler"/> specific for each property should be invoked
-        /// from the <see cref="SetValue(object, string)"/> and <see cref="ForceSetValue(object, string)"/> methods
+        /// Gets or sets the value indicating whether registered <see cref="PropertyChangedCallbackHandler"/>s should be invoked
         /// when a property changes. The default value is <c>true</c>.
         /// </summary>
         protected bool IsPropertyChangedCallbackInvokingEnabled { get; set; }
@@ -67,7 +65,7 @@
         }

         /// <summary>
-        /// Registers a new property for the actual instance of <see cref="NotifyPropertyChanged"/>.
+        /// Registers a new property in the actual instance of <see cref="NotifyPropertyChanged"/>.
         /// </summary>
         /// <param name="name">Name of the registered property.</param>
         /// <param name="type">Type of the registered property.</param>
@@ -77,10 +75,10 @@
         ///         Parameter <paramref name="name"/> is <c>null</c> or white space.
         ///     </para>
         ///     <para>
-        ///         Value of <paramref name="defaultValue"/> cannot be assigned to a property of type in <paramref name="type"/>.
-        ///     </para>
-        ///     <para>
-        ///         Instance already contains registered property named as specified in parameter <paramref name="name"/>.
+        ///         Value of <paramref name="defaultValue"/> cannot be assigned to a property of type specified in the <paramref name="type"/> parameter.
+        ///     </para>
+        ///     <para>
+        ///         Instance already contains a registered property named the same as specified in parameter <paramref name="name"/>.
         ///     </para>
         /// </exception>
         /// <exception cref="ArgumentNullException">Parameter <paramref name="type"/> is <c>null</c>.</exception>
@@ -90,7 +88,7 @@
         }

         /// <summary>
-        /// Registers a new property for the actual instance of <see cref="NotifyPropertyChanged"/>.
+        /// Registers a new property in the actual instance of <see cref="NotifyPropertyChanged"/>.
         /// </summary>
         /// <param name="name">Name of the registered property.</param>
         /// <param name="type">Type of the registered property.</param>
@@ -101,10 +99,10 @@
         ///         Parameter <paramref name="name"/> is <c>null</c> or white space.
         ///     </para>
         ///     <para>
-        ///         Value of <paramref name="defaultValue"/> cannot be assigned to a property of type in <paramref name="type"/>.
-        ///     </para>
-        ///     <para>
-        ///         Instance already contains registered property named as specified in parameter <paramref name="name"/>.
+        ///         Value of <paramref name="defaultValue"/> cannot be assigned to a property of type specified in the <paramref name="type"/> parameter.
+        ///     </para>
+        ///     <para>
+        ///         Instance already contains a registered property named the same as specified in parameter <paramref name="name"/>.
         ///     </para>
         /// </exception>
         /// <exception cref="ArgumentNullException">Parameter <paramref name="type"/> is <c>null</c>.</exception>
@@ -123,7 +121,7 @@
         }

         /// <summary>
-        /// Registers the <paramref name="propertyChangedCallback"/> as a <see cref="PropertyChangedCallbackHandler"/> to a registered property.
+        /// Registers the <paramref name="propertyChangedCallback"/> to be invoked when the property with the specified name changes.
         /// </summary>
         /// <param name="propertyName">Name of the property.</param>
         /// <param name="propertyChangedCallback"><see cref="PropertyChangedCallbackHandler"/> to be registered.</param>
@@ -132,7 +130,7 @@
         ///         Parameter <paramref name="propertyName"/> is <c>null</c> or white space.
         ///     </para>
         ///     <para>
-        ///         Actual instance does not contain registered property with name specified in the <paramref name="propertyName"/> parameter.
+        ///         Actual instance does not contain registered property with the specified name.
         ///     </para>
         ///     <para>
         ///         Parameter <paramref name="propertyChangedCallback"/> is <c>null</c>.
@@ -145,7 +143,7 @@
         }

         /// <summary>
-        /// Unregisters the <paramref name="propertyChangedCallback"/> from a registered property.
+        /// Unregisters the <paramref name="propertyChangedCallback"/> so it will NOT be invoked when the property with the specified name changes.
         /// </summary>
         /// <param name="propertyName">Name of the property.</param>
         /// <param name="propertyChangedCallback"><see cref="PropertyChangedCallbackHandler"/> to be unregistered.</param>
@@ -154,7 +152,7 @@
         ///         Parameter <paramref name="propertyName"/> is <c>null</c> or white space.
         ///     </para>
         ///     <para>
-        ///         Actual instance does not contain registered property with name specified in the <paramref name="propertyName"/> parameter.
+        ///         Actual instance does not contain registered property with the specified name.
         ///     </para>
         ///     <para>
         ///         Parameter <paramref name="propertyChangedCallback"/> is <c>null</c>.
@@ -176,7 +174,7 @@
         ///         Parameter <paramref name="propertyName"/> is <c>null</c> or white space.
         ///     </para>
         ///     <para>
-        ///         Actual instance does not contain registered property with name specified in the <paramref name="propertyName"/> parameter.
+        ///         Actual instance does not contain registered property with the specified name.
         ///     </para>
         /// </exception>
 #if NET_40
@@ -191,20 +189,19 @@
         /// <summary>
         /// Sets new value to a registered property even if it is equal to its current value and invokes the <see cref="PropertyChangedCallbackHandler"/>
         /// for the property if specified before and if the value of <see cref="IsPropertyChangedCallbackInvokingEnabled"/> is <c>true</c>
-        /// and also invokes the <see cref="PropertyChanged"/> event
-        /// if value of <see cref="IsPropertyChangedEventInvokingEnabled"/> is <c>true</c>.
+        /// and also invokes the <see cref="PropertyChanged"/> event if value of <see cref="IsPropertyChangedEventInvokingEnabled"/> is <c>true</c>.
         /// </summary>
         /// <param name="value">New value for the property.</param>
         /// <param name="propertyName">Name of the property.</param>
         /// <exception cref="ArgumentException">
         ///     <para>
-        ///         Value of the <paramref name="value"/> parameter cannot be assigned to the type of property with name specified in the <paramref name="propertyName"/> parameter.
-        ///     </para>
-        ///     <para>
-        ///         Parameter <paramref name="propertyName"/> is <c>null</c> or white space.
-        ///     </para>
-        ///     <para>
-        ///         Actual instance does not contain registered property with name specified in the <paramref name="propertyName"/> parameter.
+        ///         Value cannot be assigned to the property with the specified name because of its type.
+        ///     </para>
+        ///     <para>
+        ///         Parameter <paramref name="propertyName"/> is <c>null</c> or white space.
+        ///     </para>
+        ///     <para>
+        ///         Actual instance does not contain registered property with the specified name.
         ///     </para>
         /// </exception>
 #if NET_40
@@ -219,20 +216,19 @@
         /// <summary>
         /// Sets a new value to a registered property if it's not equal to its current value and invokes the <see cref="PropertyChangedCallbackHandler"/>
         /// for the property if specified before and if the value of <see cref="IsPropertyChangedCallbackInvokingEnabled"/> is <c>true</c>
-        /// and also invokes the <see cref="PropertyChanged"/> event
-        /// if value of <see cref="IsPropertyChangedEventInvokingEnabled"/> is <c>true</c>.
+        /// and also invokes the <see cref="PropertyChanged"/> event if value of <see cref="IsPropertyChangedEventInvokingEnabled"/> is <c>true</c>.
         /// </summary>
         /// <param name="value">New value for the property.</param>
         /// <param name="propertyName">Name of the property.</param>
         /// <exception cref="ArgumentException">
         ///     <para>
-        ///         Value of the <paramref name="value"/> parameter cannot be assigned to the type of property with name specified in the <paramref name="propertyName"/> parameter.
-        ///     </para>
-        ///     <para>
-        ///         Parameter <paramref name="propertyName"/> is <c>null</c> or white space.
-        ///     </para>
-        ///     <para>
-        ///         Actual instance does not contain registered property with name specified in the <paramref name="propertyName"/> parameter.
+        ///         Value cannot be assigned to the property with the specified name because of its type.
+        ///     </para>
+        ///     <para>
+        ///         Parameter <paramref name="propertyName"/> is <c>null</c> or white space.
+        ///     </para>
+        ///     <para>
+        ///         Actual instance does not contain registered property with the specified name.
         ///     </para>
         /// </exception>
 #if NET_40
@@ -339,9 +335,9 @@
     }

     /// <summary>
-    /// Represents the callback that is invoked when a registered property value of the <see cref="NotifyPropertyChanged"/> class changes before the <see cref="NotifyPropertyChanged.PropertyChanged"/> event.
+    /// Represents the callback that is invoked when a property registered in the <see cref="NotifyPropertyChanged"/> class changes.
     /// </summary>
-    /// <param name="sender">Instance of the <see cref="NotifyPropertyChanged"/> class that invoked this callback.</param>
+    /// <param name="sender">Object that invoked this callback.</param>
     /// <param name="e">Callback data containing info about the changed property.</param>
     public delegate void PropertyChangedCallbackHandler(NotifyPropertyChanged sender, PropertyChangedCallbackArgs e);


Resharper code

Resharper code

--- GitAutoUpdateGUI/FormMain.cs
+++ GitAutoUpdateGUI/FormMain.cs
@@ -44,10 +44,6 @@

     readonly Dictionary<string, string> _languageDicoEn = new Dictionary<string, string>();
     readonly Dictionary<string, string> _languageDicoFr = new Dictionary<string, string>();
-    private const string OneSpace = " ";
-    //private const string Punctuation.Period = ".";
-    private const string Backslash = "\\";
-    private static readonly string Crlf = Environment.NewLine;
     private string _currentLanguage = "english";

     private void QuitToolStripMenuItem_Click(object sender, EventArgs e)
@@ -619,9 +615,9 @@
       if (tb != ActiveControl) return;
       if (tb.Text == string.Empty)
       {
-        DisplayMessageOk(Translate("ThereIs") + OneSpace +
-          Translate(errorMessage) + OneSpace +
-          Translate("ToCut") + OneSpace, Translate(errorMessage),
+        DisplayMessageOk(Translate("ThereIs") + Punctuation.OneSpace +
+          Translate(errorMessage) + Punctuation.OneSpace +
+          Translate("ToCut") + Punctuation.OneSpace, Translate(errorMessage),
           MessageBoxButtons.OK);
         return;
       }
@@ -642,7 +638,7 @@
       if (tb != ActiveControl) return;
       if (tb.Text == string.Empty)
       {
-        DisplayMessageOk(Translate("ThereIsNothingToCopy") + OneSpace,
+        DisplayMessageOk(Translate("ThereIsNothingToCopy") + Punctuation.OneSpace,
           Translate(message), MessageBoxButtons.OK);
         return;
       }
@@ -738,7 +734,7 @@
       if (listViewVSProjects.Items.Count == 0)
       {
         DisplayMessageOk(Translate("The list doesn't have any Visual Studio project to update") +
-          Punctuation.Period + Crlf + Translate("Enter a correct path and search project again"),
+          Punctuation.Period + Punctuation.CrLf + Translate("Enter a correct path and search project again"),
           Translate("List empty"), MessageBoxButtons.OK);
         Logger.Add(textBoxLog, Translate("The list doesn't have any Visual Studio project to update"));
         return;
@@ -748,7 +744,7 @@
       if (selectedProjects.Count == 0)
       {
         DisplayMessageOk(Translate("No project has been selected") +
-          Punctuation.Period + Crlf + Translate("Select at least one project"),
+          Punctuation.Period + Punctuation.CrLf + Translate("Select at least one project"),
           Translate("No selection"), MessageBoxButtons.OK);
         Logger.Add(textBoxLog, Translate("No project has been selected"));
         return;
@@ -783,7 +779,7 @@
       {
         var projectName = selectedProj.Text;
         AddGitPullToScript(updateScript, projectName);
-        Logger.Add(textBoxLog, Translate("Adding the selected project") + OneSpace + projectName);
+        Logger.Add(textBoxLog, Translate("Adding the selected project") + Punctuation.OneSpace + projectName);
       }

       AddPauseToFile(updateScript);
@@ -888,7 +884,7 @@

     private static string AddAtTheEndOfFileName(string fileName, string textToBeAdded)
     {
-      string result = GetDirectoryFileNameAndExtension(fileName)[0] + Backslash
+      string result = GetDirectoryFileNameAndExtension(fileName)[0] + Punctuation.Backslash
                                  + GetDirectoryFileNameAndExtension(fileName)[1]
                                  + textToBeAdded
                                  + GetDirectoryFileNameAndExtension(fileName)[2];
@@ -902,7 +898,7 @@
       if (textBoxVSProjectPath.Text == string.Empty)
       {
         DisplayMessageOk(Translate("The Visual Studio project directory path is empty") +
-          Punctuation.Period + Crlf + Translate("Enter a correct path"),
+          Punctuation.Period + Punctuation.CrLf + Translate("Enter a correct path"),
           Translate("Directory empty"), MessageBoxButtons.OK);
         Logger.Add(textBoxLog, Translate("The Visual Studio project directory path is empty"));
         return;
@@ -911,7 +907,7 @@
       if (!Directory.Exists(textBoxVSProjectPath.Text))
       {
         DisplayMessageOk(Translate("The Visual Studio project directory path doesn't exist") +
-          Punctuation.Period + Crlf + Translate("Enter a correct path"),
+          Punctuation.Period + Punctuation.CrLf + Translate("Enter a correct path"),
           Translate("Wrong Directory"), MessageBoxButtons.OK);
         Logger.Add(textBoxLog, Translate("The Visual Studio project directory path doesn't exist"));
         return;
@@ -920,7 +916,7 @@
       if (!Directory.EnumerateDirectories(textBoxVSProjectPath.Text).Any())
       {
         DisplayMessageOk(Translate("The Visual Studio project directory is empty") +
-          Punctuation.Period + Crlf + Translate("Enter a correct path"),
+          Punctuation.Period + Punctuation.CrLf + Translate("Enter a correct path"),
           Translate("Directory empty"), MessageBoxButtons.OK);
         Logger.Add(textBoxLog, Translate("The Visual Studio project directory is empty"));
         return;
@@ -930,7 +926,7 @@
       if (textBoxGitBashBinariesPath.Text == string.Empty)
       {
         DisplayMessageOk(Translate("The GitBash directory path is empty") +
-          Punctuation.Period + Crlf + Translate("Enter a correct path"),
+          Punctuation.Period + Punctuation.CrLf + Translate("Enter a correct path"),
           Translate("Directory empty"), MessageBoxButtons.OK);
         Logger.Add(textBoxLog, Translate("The GitBash directory path is empty"));
         return;
@@ -939,7 +935,7 @@
       if (!File.Exists(textBoxGitBashBinariesPath.Text))
       {
         DisplayMessageOk(Translate("The executable GitBash directory path doesn't exist") +
-          Punctuation.Period + Crlf + Translate("Enter a correct path"),
+          Punctuation.Period + Punctuation.CrLf + Translate("Enter a correct path"),
           Translate("Wrong Directory"), MessageBoxButtons.OK);
         Logger.Add(textBoxLog, Translate("The executable GitBash directory path doesn't exist"));
         return;
@@ -1010,8 +1006,8 @@
         }
       }

-      Logger.Add(textBoxLog, projectCount + OneSpace + Translate("project") + Plural(projectCount) +
-        OneSpace + Translate(Plural(projectCount, "has")) + OneSpace +
+      Logger.Add(textBoxLog, projectCount + Punctuation.OneSpace + Translate("project") + Plural(projectCount) +
+        Punctuation.OneSpace + Translate(Plural(projectCount, "has")) + Punctuation.OneSpace +
         Translate("been found") + FrenchPlural(projectCount, _currentLanguage));
       buttonUpdateVSProjects.Enabled = true;
     }
@@ -1328,7 +1324,7 @@
       Application.DoEvents();

       DisplayMessageOk(Translate("The process may take several minutes or several hours depending on the number of folder inside my document directory") +
-        Crlf + Translate("A window will pop up at the end of the process"),
+        Punctuation.CrLf + Translate("A window will pop up at the end of the process"),
         Translate("Lenghty process"), MessageBoxButtons.OK);
       string mydoc = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
       IEnumerable<string> listOfDir = GetAllDirectories(mydoc, ".git", SearchOption.AllDirectories);
@@ -1367,14 +1363,14 @@
         projectCount++;
       }

-      Logger.Add(textBoxLog, projectCount + OneSpace + Translate("project") + Plural(projectCount) +
-        OneSpace + Translate(Plural(projectCount, "has")) + OneSpace +
+      Logger.Add(textBoxLog, projectCount + Punctuation.OneSpace + Translate("project") + Plural(projectCount) +
+        Punctuation.OneSpace + Translate(Plural(projectCount, "has")) + Punctuation.OneSpace +
         Translate("been found") + FrenchPlural(projectCount, _currentLanguage));
       buttonUpdateVSProjects.Enabled = true;
       chrono.Stop();
       TimeSpan ts = chrono.Elapsed;
-      DisplayMessageOk(Translate("The process is over") + Crlf +
-        Translate("It took") + OneSpace + DisplayElapseTime(ts),
+      DisplayMessageOk(Translate("The process is over") + Punctuation.CrLf +
+        Translate("It took") + Punctuation.OneSpace + DisplayElapseTime(ts),
         Translate("Process over"), MessageBoxButtons.OK);
     }

@@ -1541,7 +1537,7 @@
       if (textBoxGitBashBinariesPath.Text == string.Empty)
       {
         DisplayMessageOk(Translate("The GitBash directory path is empty") +
-          Punctuation.Period + Crlf + Translate("Enter a correct path"),
+          Punctuation.Period + Punctuation.CrLf + Translate("Enter a correct path"),
           Translate("Directory empty"), MessageBoxButtons.OK);
         Logger.Add(textBoxLog, Translate("The GitBash directory path is empty"));
         return;
@@ -1550,7 +1546,7 @@
       if (!File.Exists(textBoxGitBashBinariesPath.Text))
       {
         DisplayMessageOk(Translate("The executable GitBash directory path doesn't exist") +
-          Punctuation.Period + Crlf + Translate("Enter a correct path"),
+          Punctuation.Period + Punctuation.CrLf + Translate("Enter a correct path"),
           Translate("Wrong Directory"), MessageBoxButtons.OK);
         Logger.Add(textBoxLog, Translate("The executable GitBash directory path doesn't exist"));
         return;


Made RefUpdateTest.testRefsCacheAfterUpdateLoosOnly() pass.

--- GitSharp.Core/RefDatabase.cs
+++ GitSharp.Core/RefDatabase.cs
@@ -130,7 +130,7 @@
 		{
 			lock (locker)
 			{
-				_looseRefs[name] = new Ref(Ref.Storage.Loose, origName, name, id);
+				_looseRefs[name] = new Ref(Ref.Storage.Loose, name, name, id);
 				_looseRefsMTime[name] = time;
 				SetModified();
 			}


Corrected bugs with KeepCenteredBehavior.

--- BazamWPF/Behaviors/KeepCenteredBehavior.cs
+++ BazamWPF/Behaviors/KeepCenteredBehavior.cs
@@ -10,21 +10,23 @@
     public class KeepCenteredBehavior : Behavior<Window>
     {
         private bool _DoShit = true;
-        private Point _ScreenMidpoint;
+
+        private Point GetMidPoint()
+        {
+            Screen screen = Screen.FromHandle(new WindowInteropHelper(AssociatedObject).Handle);
+            double screenHeight = screen.WorkingArea.Height;
+            double screenWidth = screen.WorkingArea.Width;
+            return new Point(screenWidth / 2, screen.Bounds.Y + (screenHeight / 2));
+        }

         protected override void OnAttached()
         {
-            var screen = Screen.FromHandle(new WindowInteropHelper(AssociatedObject).Handle);
-            double screenHeight = screen.WorkingArea.Height;
-            double screenWidth = screen.WorkingArea.Width;
-            _ScreenMidpoint = new Point(screenWidth / 2, screenHeight / 2);
-
             AssociatedObject.SizeChanged += (omg, soAwesome) => {
                 if (_DoShit && AssociatedObject.DesiredSize.Height > 0) {
                     _DoShit = false;
-
-                    double newLeft = _ScreenMidpoint.X - (AssociatedObject.DesiredSize.Width / 2);
-                    double newTop = _ScreenMidpoint.Y - (AssociatedObject.DesiredSize.Height / 2);
+
+                    Point midpoint = GetMidPoint();
+                    double newTop = midpoint.Y - (AssociatedObject.DesiredSize.Height / 2);

                     Storyboard sb = new Storyboard();
                     DoubleAnimation anim = new DoubleAnimation(AssociatedObject.Top, newTop, new Duration(TimeSpan.FromMilliseconds(150)));
@@ -35,6 +37,7 @@
                     Storyboard.SetTarget(anim, AssociatedObject);
                     sb.Children.Add(anim);
                     sb.Completed += (fuck, it) => {
+                        AssociatedObject.Top = newTop;
                         _DoShit = true;
                         sb.Stop();
                     };
@@ -43,4 +46,4 @@
             };
         }
     }
-}
+}


Fix other places when saving scripts or notecards in prim inventories where messages should be transient without an OK button

--- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -326,7 +326,7 @@
             // Update item with new asset
             item.AssetID = asset.FullID;
             if (group.UpdateInventoryItem(item))
-                remoteClient.SendAgentAlertMessage("Script saved", false);
+                remoteClient.SendAlertMessage("Script saved");

             part.SendPropertiesToClient(remoteClient);

@@ -342,7 +342,7 @@
             }
             else
             {
-                remoteClient.SendAgentAlertMessage("Script saved", false);
+                remoteClient.SendAlertMessage("Script saved");
             }

             // Tell anyone managing scripts that a script has been reloaded/changed
@@ -1616,11 +1616,11 @@
                             remoteClient, part, transactionID, currentItem);

                         if ((InventoryType)itemInfo.InvType == InventoryType.Notecard)
-                            remoteClient.SendAgentAlertMessage("Notecard saved", false);
+                            remoteClient.SendAlertMessage("Notecard saved");
                         else if ((InventoryType)itemInfo.InvType == InventoryType.LSL)
-                            remoteClient.SendAgentAlertMessage("Script saved", false);
+                            remoteClient.SendAlertMessage("Script saved");
                         else
-                            remoteClient.SendAgentAlertMessage("Item saved", false);
+                            remoteClient.SendAlertMessage("Item saved");
                     }

                     // Base ALWAYS has move


Delete TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs


failing tests for #257 & #275

failing tests for #257 & #275

--- JilTests/SerializeTests.cs
+++ JilTests/SerializeTests.cs
@@ -9678,5 +9678,35 @@

             Assert.AreEqual("{\"EnumMap\":{\"Zero\":0,\"One\":1,\"Two\":2,\"One,Two\":3}}", json);
         }
+
+        struct _Issue257 : IEnumerable<object>
+        {
+            public IEnumerator<object> GetEnumerator()
+            {
+                yield break;
+            }
+            IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator();
+        }
+
+        [TestMethod]
+        public void Issue257()
+        {
+            _Issue257? enumerable = new _Issue257();
+            var res = JSON.Serialize(enumerable);
+            Assert.AreEqual("[]", res);
+        }
+
+        [JilPrimitiveWrapper]
+        class _Issue275
+        {
+            public int Val { get; }
+        }
+
+        [TestMethod]
+        public void Issue275()
+        {
+            var res = JSON.Serialize(new _Issue275[0]);
+            Assert.AreEqual("[]", res);
+        }
     }
 }


One more buglet fixed related to mantis #4841 -- auto-returns were still chocking on a null pointer exception.

--- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1597,7 +1597,7 @@
             }

             // Handle god perms
-            if (Permissions.IsGod(remoteClient.AgentId))
+            if ((remoteClient != null) && Permissions.IsGod(remoteClient.AgentId))
             {
                 permissionToTake = true;
                 permissionToTakeCopy = true;


Removed comment.  I know, heavy-lifting over here.

--- BrewLab.Scripts.RecipeGenerator/Program.cs
+++ BrewLab.Scripts.RecipeGenerator/Program.cs
@@ -24,7 +24,6 @@

                 string log = string.Format("Recipe {0} created.", id);

-                //Writing to console is thread-safe.
                 Console.WriteLine(log);
             }


inclusão do meio de pagamento Getnet no ProviderEnum.

--- BraspagApiDotNetSdk/Contracts/Enum/ProviderEnum.cs
+++ BraspagApiDotNetSdk/Contracts/Enum/ProviderEnum.cs
@@ -30,6 +30,7 @@
         ItauShopline,
         Banese,
         GlobalPayments,
-        FirstData
+        FirstData,
+        Getnet
     }
 }


remove redundant PhysActor.IsPhysical call from SOP.UpdatePrimFlags() as its done immediately afterwards in DoPhysicsPropertyUpdate()

--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4334,9 +4334,7 @@
             bool wasVD = VolumeDetectActive;

             if ((UsePhysics == wasUsingPhysics) && (wasTemporary == SetTemporary) && (wasPhantom == SetPhantom) && (SetVD == wasVD))
-            {
                 return;
-            }

             // Special cases for VD. VD can only be called from a script
             // and can't be combined with changes to other states. So we can rely
@@ -4450,8 +4448,6 @@
                 }
                 else // it already has a physical representation
                 {
-                    PhysActor.IsPhysical = UsePhysics;
-
                     DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim

                     if (!m_parentGroup.IsDeleted)


Add date restriction to disallow reconciliations more frequently than every 4 weeks

--- BudgetAnalyser.Engine/Ledger/LedgerBook.cs
+++ BudgetAnalyser.Engine/Ledger/LedgerBook.cs
@@ -16,7 +16,8 @@
         private List<LedgerEntryLine> datedEntries;
         private List<LedgerColumn> ledgersColumns = new List<LedgerColumn>();

-        public LedgerBook() : this(null)
+        public LedgerBook()
+            : this(null)
         {
         }

@@ -29,7 +30,8 @@
         public IEnumerable<LedgerEntryLine> DatedEntries
         {
             get { return this.datedEntries; }
-            [UsedImplicitly] private set { this.datedEntries = value.ToList(); }
+            [UsedImplicitly]
+            private set { this.datedEntries = value.ToList(); }
         }

         public string FileName { get; internal set; }
@@ -229,15 +231,23 @@
                 throw new InvalidOperationException("Ledger book is currently in an invalid state. Cannot add new entries.\n" + messages);
             }

+            if (statement == null)
+            {
+                return;
+            }
+
             LedgerEntryLine recentEntry = DatedEntries.FirstOrDefault();
-            if (recentEntry != null && date <= recentEntry.Date)
-            {
-                throw new InvalidOperationException("The date entered is before the previous ledger entry.");
-            }
-
-            if (statement == null)
-            {
-                return;
+            if (recentEntry != null)
+            {
+                if (date <= recentEntry.Date)
+                {
+                    throw new InvalidOperationException("The date entered is before the previous ledger entry.");
+                }
+
+                if (recentEntry.Date.AddDays(7 * 4) > date)
+                {
+                    throw new InvalidOperationException("The date entered is not at least 4 weeks after the previous reconciliation. ");
+                }
             }

             DateTime startDate = date.AddMonths(-1);


Remove unneceserry class

Remove unneceserry class

--- C#Development/BashSoft/BashSoft/IO/OutputWriter.cs
+++ C#Development/BashSoft/BashSoft/IO/OutputWriter.cs
@@ -52,7 +52,7 @@

         public static void PrintStudent(KeyValuePair<string, List<int>> student)
         {
-            OutputWriter.WriteMessageOnNewLine($"{student.Key} - {string.Join(", ", student.Value)}");
+            WriteMessageOnNewLine($"{student.Key} - {string.Join(", ", student.Value)}");
         }
     }
 }


integrating opensim-git 8d6628484107e3ebe2c29b2b754e43c164545cf1:

BulletSim: implement VEHICLE_REFERENCE_FRAME.

Signed-off-by: ft <d352dbdf6170085acaf7ed62197a4de1452a0073@noemail>

--- OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -923,7 +923,7 @@
         {
             get
             {
-                return VehicleVelocity * Quaternion.Inverse(Quaternion.Normalize(VehicleOrientation));
+                return VehicleVelocity * Quaternion.Inverse(Quaternion.Normalize(VehicleFrameOrientation));
             }
         }

@@ -932,6 +932,14 @@
             get
             {
                 return VehicleForwardVelocity.X;
+            }
+        }
+
+        private Quaternion VehicleFrameOrientation
+        {
+            get
+            {
+                return VehicleOrientation * m_referenceFrame;
             }
         }

@@ -1043,7 +1051,7 @@
             linearMotorCorrectionV -= (currentVelV * frictionFactorV);

             // Motor is vehicle coordinates. Rotate it to world coordinates
-            Vector3 linearMotorVelocityW = linearMotorCorrectionV * VehicleOrientation;
+            Vector3 linearMotorVelocityW = linearMotorCorrectionV * VehicleFrameOrientation;

             // If we're a ground vehicle, don't add any upward Z movement
             if ((m_flags & VehicleFlag.LIMIT_MOTOR_UP) != 0)
@@ -1085,7 +1093,7 @@
                 linearDeflectionV *= new Vector3(1, -1, -1);

                 // Correction is vehicle relative. Convert to world coordinates.
-                Vector3 linearDeflectionW = linearDeflectionV * VehicleOrientation;
+                Vector3 linearDeflectionW = linearDeflectionV * VehicleFrameOrientation;

                 // Optionally, if not colliding, don't effect world downward velocity. Let falling things fall.
                 if (BSParam.VehicleLinearDeflectionNotCollidingNoZ && !m_controllingPrim.HasSomeCollision)
@@ -1282,14 +1290,14 @@

                     /*
                     // If we're pointed up into the air, we should nose down
-                    Vector3 pointingDirection = Vector3.UnitX * VehicleOrientation;
+                    Vector3 pointingDirection = Vector3.UnitX * VehicleFrameOrientation;
                     // The rotation around the Y axis is pitch up or down
                     if (pointingDirection.Y > 0.01f)
                     {
                         float angularCorrectionForce = -(float)Math.Asin(pointingDirection.Y);
                         Vector3 angularCorrectionVector = new Vector3(0f, angularCorrectionForce, 0f);
                         // Rotate into world coordinates and apply to vehicle
-                        angularCorrectionVector *= VehicleOrientation;
+                        angularCorrectionVector *= VehicleFrameOrientation;
                         VehicleAddAngularForce(angularCorrectionVector);
                         VDetailLog("{0},  MoveLinear,limitMotorUp,newVel={1},pntDir={2},corrFrc={3},aCorr={4}",
                                     Prim.LocalID, VehicleVelocity, pointingDirection, angularCorrectionForce, angularCorrectionVector);
@@ -1381,7 +1389,7 @@
         {
             // The user wants this many radians per second angular change?
             Vector3 origVehicleRotationalVelocity = VehicleRotationalVelocity;      // DEBUG DEBUG
-            Vector3 currentAngularV = VehicleRotationalVelocity * Quaternion.Inverse(VehicleOrientation);
+            Vector3 currentAngularV = VehicleRotationalVelocity * Quaternion.Inverse(VehicleFrameOrientation);
             Vector3 angularMotorContributionV = m_angularMotor.Step(pTimestep, currentAngularV);

             // ==================================================================
@@ -1402,7 +1410,7 @@
             Vector3 frictionFactorW = ComputeFrictionFactor(m_angularFrictionTimescale, pTimestep);
             angularMotorContributionV -= (currentAngularV * frictionFactorW);

-            Vector3 angularMotorContributionW = angularMotorContributionV * VehicleOrientation;
+            Vector3 angularMotorContributionW = angularMotorContributionV * VehicleFrameOrientation;
             VehicleRotationalVelocity += angularMotorContributionW;

             VDetailLog("{0},  MoveAngular,angularTurning,curAngVelV={1},origVehRotVel={2},vehRotVel={3},frictFact={4}, angContribV={5},angContribW={6}",
@@ -1423,7 +1431,7 @@
             // If vertical attaction timescale is reasonable
             if (BSParam.VehicleEnableAngularVerticalAttraction && m_verticalAttractionTimescale < m_verticalAttractionCutoff)
             {
-                Vector3 vehicleUpAxis = Vector3.UnitZ * VehicleOrientation;
+                Vector3 vehicleUpAxis = Vector3.UnitZ * VehicleFrameOrientation;
                 switch (BSParam.VehicleAngularVerticalAttractionAlgorithm)
                 {
                     case 0:
@@ -1444,7 +1452,7 @@

                             if ((m_flags & VehicleFlag.LIMIT_ROLL_ONLY) != 0)
                             {
-                                Vector3 vehicleForwardAxis = Vector3.UnitX * VehicleOrientation;
+                                Vector3 vehicleForwardAxis = Vector3.UnitX * VehicleFrameOrientation;
                                 torqueVector = ProjectVector(torqueVector, vehicleForwardAxis);
                             }

@@ -1469,13 +1477,13 @@

                             // Create a rotation that is only the vehicle's rotation around Z
                             Vector3 currentEulerW = Vector3.Zero;
-                            VehicleOrientation.GetEulerAngles(out currentEulerW.X, out currentEulerW.Y, out currentEulerW.Z);
+                            VehicleFrameOrientation.GetEulerAngles(out currentEulerW.X, out currentEulerW.Y, out currentEulerW.Z);
                             Quaternion justZOrientation = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, currentEulerW.Z);

                             // Create the axis that is perpendicular to the up vector and the rotated up vector.
-                            Vector3 differenceAxisW = Vector3.Cross(Vector3.UnitZ * justZOrientation, Vector3.UnitZ * VehicleOrientation);
+                            Vector3 differenceAxisW = Vector3.Cross(Vector3.UnitZ * justZOrientation, Vector3.UnitZ * VehicleFrameOrientation);
                             // Compute the angle between those to vectors.
-                            double differenceAngle = Math.Acos((double)Vector3.Dot(Vector3.UnitZ, Vector3.Normalize(Vector3.UnitZ * VehicleOrientation)));
+                            double differenceAngle = Math.Acos((double)Vector3.Dot(Vector3.UnitZ, Vector3.Normalize(Vector3.UnitZ * VehicleFrameOrientation)));
                             // 'differenceAngle' is the angle to rotate and 'differenceAxis' is the plane to rotate in to get the vehicle vertical

                             // Reduce the change by the time period it is to change in. Timestep is handled when velocity is applied.
@@ -1508,7 +1516,7 @@
                             Vector3 origRotVelW = VehicleRotationalVelocity;        // DEBUG DEBUG

                             // Take a vector pointing up and convert it from world to vehicle relative coords.
-                            Vector3 verticalError = Vector3.Normalize(Vector3.UnitZ * VehicleOrientation);
+                            Vector3 verticalError = Vector3.Normalize(Vector3.UnitZ * VehicleFrameOrientation);

                             // If vertical attraction correction is needed, the vector that was pointing up (UnitZ)
                             //    is now:
@@ -1539,7 +1547,7 @@
                             vertContributionV /= m_verticalAttractionTimescale;

                             // Rotate the vehicle rotation to the world coordinates.
-                            VehicleRotationalVelocity += (vertContributionV * VehicleOrientation);
+                            VehicleRotationalVelocity += (vertContributionV * VehicleFrameOrientation);

                             VDetailLog("{0},  MoveAngular,verticalAttraction,,upAxis={1},origRotVW={2},vertError={3},unscaledV={4},eff={5},ts={6},vertContribV={7}",
                                             ControllingPrim.LocalID,
@@ -1580,7 +1588,7 @@
                 movingDirection *= Math.Sign(VehicleForwardSpeed);

                 // The direction the vehicle is pointing
-                Vector3 pointingDirection = Vector3.UnitX * VehicleOrientation;
+                Vector3 pointingDirection = Vector3.UnitX * VehicleFrameOrientation;
                 //Predict where the Vehicle will be pointing after AngularVelocity change is applied. This will keep
                 //   from overshooting and allow this correction to merge with the Vertical Attraction peacefully.
                 Vector3 predictedPointingDirection = pointingDirection * Quaternion.CreateFromAxisAngle(VehicleRotationalVelocity, 0f);
@@ -1605,7 +1613,7 @@
                 deflectContributionV = (-deflectionError) * ClampInRange(0, m_angularDeflectionEfficiency/m_angularDeflectionTimescale,1f);
                 //deflectContributionV /= m_angularDeflectionTimescale;

-               // VehicleRotationalVelocity += deflectContributionV * VehicleOrientation;
+                // VehicleRotationalVelocity += deflectContributionV * VehicleFrameOrientation;
                 VehicleRotationalVelocity += deflectContributionV;
                 VDetailLog("{0},  MoveAngular,Deflection,movingDir={1},pointingDir={2},deflectError={3},ret={4}",
                     ControllingPrim.LocalID, movingDirection, pointingDirection, deflectionError, deflectContributionV);
@@ -1654,7 +1662,7 @@
                 // Rotate a UnitZ vector (pointing up) to how the vehicle is oriented.
                 // As the vehicle rolls to the right or left, the Y value will increase from
                 //     zero (straight up) to 1 or -1 (full tilt right  or left)
-                Vector3 rollComponents = Vector3.UnitZ * VehicleOrientation;
+                Vector3 rollComponents = Vector3.UnitZ * VehicleFrameOrientation;

                 // Figure out the yaw value for this much roll.
                 float yawAngle = m_angularMotorDirection.X * m_bankingEfficiency;
@@ -1671,7 +1679,7 @@
                 // Don't do it all at once. Fudge because 1 second is too fast with most user defined roll as PI*4.
                 bankingContributionV /= m_bankingTimescale * BSParam.VehicleAngularBankingTimescaleFudge;

-                //VehicleRotationalVelocity += bankingContributionV * VehicleOrientation;
+                //VehicleRotationalVelocity += bankingContributionV * VehicleFrameOrientation;
                 VehicleRotationalVelocity += bankingContributionV;


remove extra line

remove extra line

--- ChessDotNet.Variants.Tests/AtomicChessGameTests.cs
+++ ChessDotNet.Variants.Tests/AtomicChessGameTests.cs
@@ -292,7 +292,6 @@
             Assert.Throws<NotImplementedException>(() => game.Undo());
         }

-
         [Test]
         public static void ValidateThatEmptyCannotMove()
         {


Fix a bug that only packets for both directions get tracked

--- Pdelvo.Minecraft.Protocol/Helper/ProtocolHelper.cs
+++ Pdelvo.Minecraft.Protocol/Helper/ProtocolHelper.cs
@@ -53,7 +53,7 @@
             {
                 var usage = item.GetCustomAttribute<PacketUsageAttribute>();

-                if ((usage.PacketUsage & PacketUsage.Both) == PacketUsage.Both)
+                if ((usage.PacketUsage & packetUsage) == packetUsage)
                 {
                     var packet = (Packet)Activator.CreateInstance(item);


Fixed a typo.

Fixed a typo.

--- PlayOnline.FFXI.Utils.ItemComparison/MainWindow.cs
+++ PlayOnline.FFXI.Utils.ItemComparison/MainWindow.cs
@@ -39,7 +39,7 @@
       this.EnableNavigation();
     }

-    // If possible, ive the window that nice gradient look
+    // If possible, give the window that nice gradient look
     protected override void OnPaintBackground(PaintEventArgs e) {
       if (VisualStyleRenderer.IsSupported) {
       VisualStyleRenderer VSR = new VisualStyleRenderer(VisualStyleElement.Tab.Body.Normal);


Check that window is visible on restore (win)

Check that window is visible on any screen when restoring window size
and location. If its not visible on any screen, move it to the primary
screen work area. Should fix #577, fix #583

--- src/ui/windows/TogglDesktop/TogglDesktop/Utils.cs
+++ src/ui/windows/TogglDesktop/TogglDesktop/Utils.cs
@@ -27,7 +27,23 @@
             {
                 f.Location = Properties.Settings.Default.Location;
                 f.Size = Properties.Settings.Default.Size;
+            }
+            if (!visibleOnAnyScreen(f))
+            {
+                f.Location = Screen.PrimaryScreen.WorkingArea.Location;
             }
+        }
+
+        private static bool visibleOnAnyScreen(Form f)
+        {
+            foreach(Screen s in Screen.AllScreens)
+            {
+                if (s.WorkingArea.IntersectsWith(f.DesktopBounds))
+                {
+                    return true;
+                }
+            }
+            return false;
         }

         public static void SaveWindowLocation(Form f)


- Core Changes to allow for XNAResourceManager to handle image loading

git-svn-id: 53f2a8ff3606f182ef4420064c1f4a5cdcbe6bb1@2112 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Projects/Axiom/Engine/Core/ResourceGroupManager.cs
+++ Projects/Axiom/Engine/Core/ResourceGroupManager.cs
@@ -2529,7 +2529,7 @@
 			}
 		}

-		public bool Initialize( params object[] args )
+		public virtual bool Initialize( params object[] args )
 		{
 			// Create the 'General' group
 			CreateResourceGroup( DefaultResourceGroupName );


fixed merge issue with LinkedFileTests.cs

--- Common/Tests/SharedProjectTests/LinkedFileTests.cs
+++ Common/Tests/SharedProjectTests/LinkedFileTests.cs
@@ -16,7 +16,7 @@
 using System.Diagnostics;
 using System.IO;
 using System.Reflection;
-using System.Text.RegularExpressions;
+using System.Text.RegularExpressions;
 using System.Threading;
 using EnvDTE;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
@@ -686,46 +686,46 @@
                 }
             }
         }
-
-        /// <summary>
-        /// Test linked files with a project home set (done by save as in this test)
-        /// https://nodejstools.codeplex.com/workitem/1511
-        /// </summary>
-        [TestMethod, Priority(0), TestCategory("Core")]
-        [HostType("VSTestHost")]
-        public void TestLinkedWithProjectHome() {
-            foreach (var projectType in ProjectTypes) {
-                using (var solution = MultiProjectLinkedFiles(projectType).ToVs()) {
-                    var project = solution.Project;
-
-                    // save the project to an odd location.  This will result in project home being set.
-                    var newProjName = "TempFile";
-                    try {
-                        project.SaveAs(Path.GetTempPath() +  newProjName + projectType.ProjectExtension);
-                    } catch (UnauthorizedAccessException) {
-                        Assert.Inconclusive("Couldn't save the file");
-                    }
-
-                    // create a temporary file and add a link to it in the project
-                    solution.FindItem(newProjName).Select();
-                    var tempFile  = Path.GetTempFileName();
-                    using (var addExistingDlg = AddExistingItemDialog.FromDte(solution.App)) {
-                        addExistingDlg.FileName = tempFile;
-                        addExistingDlg.AddLink();
-                    }
-
-                    // Save the project to commit that link to the project file
-                    project.Save();
-
-                    // verify that the project file contains the correct text for Link
-                    var fileText = File.ReadAllText(project.FullName);
-                    var pattern = string.Format(
-                        @"<Content Include=""{0}"">\s*<Link>{1}</Link>\s*</Content>",
-                        Regex.Escape(tempFile),
-                        Regex.Escape(Path.GetFileName(tempFile)));
-                    AssertUtil.AreEqual(new Regex(pattern), fileText);
-                }
-            }
-        }
+
+        /// <summary>
+        /// Test linked files with a project home set (done by save as in this test)
+        /// https://nodejstools.codeplex.com/workitem/1511
+        /// </summary>
+        [TestMethod, Priority(0), TestCategory("Core")]
+        [HostType("VSTestHost")]
+        public void TestLinkedWithProjectHome() {
+            foreach (var projectType in ProjectTypes) {
+                using (var solution = MultiProjectLinkedFiles(projectType).ToVs()) {
+                    var project = (solution as VisualStudioInstance).Project;
+
+                    // save the project to an odd location.  This will result in project home being set.
+                    var newProjName = "TempFile";
+                    try {
+                        project.SaveAs(Path.GetTempPath() +  newProjName + projectType.ProjectExtension);
+                    } catch (UnauthorizedAccessException) {
+                        Assert.Inconclusive("Couldn't save the file");
+                    }
+
+                    // create a temporary file and add a link to it in the project
+                    solution.FindItem(newProjName).Select();
+                    var tempFile  = Path.GetTempFileName();
+                    using (var addExistingDlg = AddExistingItemDialog.FromDte((solution as VisualStudioInstance).App)) {
+                        addExistingDlg.FileName = tempFile;
+                        addExistingDlg.AddLink();
+                    }
+
+                    // Save the project to commit that link to the project file
+                    project.Save();
+
+                    // verify that the project file contains the correct text for Link
+                    var fileText = File.ReadAllText(project.FullName);
+                    var pattern = string.Format(
+                        @"<Content Include=""{0}"">\s*<Link>{1}</Link>\s*</Content>",
+                        Regex.Escape(tempFile),
+                        Regex.Escape(Path.GetFileName(tempFile)));
+                    AssertUtil.AreEqual(new Regex(pattern), fileText);
+                }
+            }
+        }
     }
 }


Update Program.cs

Update Program.cs

--- ConsoleApplication1/ConsoleApplication1/Program.cs
+++ ConsoleApplication1/ConsoleApplication1/Program.cs
@@ -11,6 +11,7 @@
         static void Main(string[] args)
         {
             //Code was Edited in Git Hub
+            //hello
         }
     }
 }


Update ComicGenerator.cs

Update ComicGenerator.cs

--- Coremero/Coremero.Plugin.Classic/ComicGenerator.cs
+++ Coremero/Coremero.Plugin.Classic/ComicGenerator.cs
@@ -38,9 +38,25 @@

     public class ComicGenerator : IPlugin
     {
+        private Random _rnd = new Random();
+
         [Command("comic", Arguments = "Title", Help = "Creates a comic using the last random lines of chat.")]
         public async Task<IMessage> GenerateComic(IInvocationContext context, string title)
         {
+            int panels = _rnd.Next(1, 4);
+
+            title = title?.Trim() ?? "";
+            if(!string.IsNullOrEmpty(title))
+            {
+                string panelCount = title.Split().LastOrDefault();
+                if(int.TryParse(panelCount, out panels)) {
+                    title = title.Replace(panelCount, "").Trim();
+                    if(panelCount >= 6) {
+                        panelCount = 6;
+                    }
+                }
+            }
+
             if (string.IsNullOrEmpty(title))
             {
                 // Force title to null to ensure the payload goes through fine.
@@ -51,9 +67,6 @@
                 List<IBufferedMessage> messages = await bufferedChannel.GetLatestMessagesAsync(30);
                 messages = messages.Where(x => !x.Text.IsCommand() && !string.IsNullOrEmpty(x.Text)).ToList();

-                Random rnd = new Random();
-                int panels = rnd.Next(2, 4);
-
                 ComicPayload payload = new ComicPayload() { Title = title };

                 for (int i = 0; i < panels; i++)
@@ -62,10 +75,13 @@
                     {
                         break;
                     }
+
+                    string curMsg = messages[i].Text;
+                    curMsg = string.Join(" ", curMsg.Split().Where(x => !x.StartsWith("<@") && !x.EndsWith(">"))).Trim();

                     payload.Messages.Add(new ComicMessage()
                     {
-                        Message = messages[i].Text,
+                        Message = curMsg,
                         Timestamp = messages[i].Timestamp.Ticks,
                         User = messages[i].User.Name
                     });
@@ -84,4 +100,4 @@
             throw new Exception("Not a buffered channel.");
         }
     }
-}+}


Yet another DataRecord value caster.

Yet another DataRecord value caster.

--- Repo2.Core.ns11/Extensions/SystemDataExtensions.cs
+++ Repo2.Core.ns11/Extensions/SystemDataExtensions.cs
@@ -50,11 +50,11 @@
             }
         }

-
         public static long ToLong(this IDataRecord rec, int i, long defaultVal = 0)
             => ToLong_(rec, i) ?? defaultVal;

+
         public static double? ToDouble_(this IDataRecord rec, int i)
         {
             if (rec.IsDBNull(i)) return null;
@@ -74,6 +74,9 @@
                     return null;
             }
         }
+
+        public static double ToDouble(this IDataRecord rec, int i, double defaultVal = 0)
+            => rec.ToDouble_(i) ?? defaultVal;

         public static decimal? ToDecimal_(this IDataRecord rec, int i)


DataTransfer: ExitTunnel updated, added locking for disconnect methods

--- CustomBlocks/DataTransfer/ExitTunnel/ExitTunnel.cs
+++ CustomBlocks/DataTransfer/ExitTunnel/ExitTunnel.cs
@@ -33,10 +33,11 @@
 	{
 		private readonly AsyncRunner readRunner = new AsyncRunner();
 		private readonly AsyncRunner writeRunner = new AsyncRunner();
-		private readonly AsyncRunner disconnectRunner = new AsyncRunner();
+		private readonly AsyncRunner stateChangeRunner = new AsyncRunner();
+		private readonly AsyncRWLock stateChangeLock = new AsyncRWLock();
 		private readonly ITunnel upstream;
+		private volatile bool isDisconnected = false;
 		private int isDisposed = 0;
-		private int isDisconnected = 0;

 		public ExitTunnel(ITunnel upstream)
 		{
@@ -45,7 +46,7 @@

 		private async Task<int> WriteDataWorkerAsync(int sz, byte[] buffer, int offset)
 		{
-			if(Interlocked.CompareExchange(ref isDisconnected, 0, 0) != 0)
+			if(isDisconnected)
 				throw new TunnelEofException();
 			try
 			{
@@ -53,7 +54,7 @@
 			}
 			catch
 			{
-				if(Interlocked.CompareExchange(ref isDisconnected, 0, 0) != 0)
+				if(isDisconnected)
 					throw new TunnelEofException();
 				throw;
 			}
@@ -67,7 +68,7 @@
 			}
 			catch
 			{
-				if(Interlocked.CompareExchange(ref isDisconnected, 0, 0) != 0)
+				if(isDisconnected)
 					throw new TunnelEofException();
 				throw;
 			}
@@ -93,23 +94,43 @@
 			return await WriteDataWorkerAsync(sz, buffer, offset);
 		}

+		private async Task DisconnectAsyncWorker()
+		{
+			if(isDisconnected)
+				return;
+			await upstream.DisconnectAsync();
+			isDisconnected = true;
+		}
+
 		public void Disconnect()
 		{
-			if(Interlocked.CompareExchange(ref isDisconnected, 1, 0) != 0)
-				return;
-			disconnectRunner.ExecuteTask(upstream.DisconnectAsync);
+			stateChangeLock.EnterWriteLock();
+			try
+			{
+				stateChangeRunner.ExecuteTask(DisconnectAsyncWorker);
+			}
+			finally
+			{
+				stateChangeLock.ExitWriteLock();
+			}
 		}

 		public async Task DisconnectAsync()
 		{
-			if(Interlocked.CompareExchange(ref isDisconnected, 1, 0) != 0)
-				return;
-			await upstream.DisconnectAsync();
+			await stateChangeLock.EnterWriteLockAsync();
+			try
+			{
+				await DisconnectAsyncWorker();
+			}
+			finally
+			{
+				stateChangeLock.ExitWriteLock();
+			}
 		}

 		public void Dispose()
 		{
-			if (Interlocked.CompareExchange(ref isDisposed, 1, 0) != 0)
+			if(Interlocked.CompareExchange(ref isDisposed, 1, 0) != 0)
 				return;
 			Disconnect();
 			upstream.Dispose();


[UDP] Integrate MRM into the send pipeline

This eliminates a race condition between the endpoints where, since the
message was being sent (after moving to MessageResponseManager) before
registering the ID with the MRM, the response might arrive before
registration too. This would result in the response never being seen.

--- Desktop/Tempest/Providers/Network/UdpConnection.cs
+++ Desktop/Tempest/Providers/Network/UdpConnection.cs
@@ -110,18 +110,22 @@
 			return SendCore (message);
 		}

-		public Task<TResponse> SendFor<TResponse> (Message message, int timeout = 0)
-			where TResponse : Message
+		public Task<Message> SendFor (Message message, int timeout = 0)
 		{
 			if (message == null)
 				throw new ArgumentNullException ("message");
 			if (!message.MustBeReliable && !message.PreferReliable)
 				throw new NotSupportedException ("Sending unreliable messages for a response is not supported");

-			Task<bool> sendTask = SendCore (message);
-
-			return this.responses.Value.SendFor (message, sendTask, timeout)
-				.ContinueWith (t => (TResponse)t.Result, TaskScheduler.Default);
+			Task<Message> responseTask;
+			SendCore (message, false, true, timeout, out responseTask);
+			return responseTask;
+		}
+
+		public Task<TResponse> SendFor<TResponse> (Message message, int timeout = 0)
+			where TResponse : Message
+		{
+			return SendFor (message, timeout).ContinueWith (t => (TResponse)t.Result, TaskScheduler.Default);
 		}

 		public Task<bool> SendResponseAsync (Message originalMessage, Message response)
@@ -192,6 +196,11 @@
 			get;
 		}

+		protected MessageResponseManager Responses
+		{
+			get { return this.responses.Value; }
+		}
+
 		private void SetMessageId (Message message)
 		{
 			if (message.MustBeReliable || message.PreferReliable)
@@ -202,9 +211,17 @@

 		protected Task<bool> SendCore (Message message, bool dontSetId = false)
 		{
+			Task<Message> messageTask;
+			return SendCore (message, dontSetId, false, 0, out messageTask);
+		}
+
+		protected Task<bool> SendCore (Message message, bool dontSetId, bool responseRequested, int timeout, out Task<Message> responseTask)
+		{
 			if (message == null)
 				throw new ArgumentNullException ("message");

+			responseTask = null;
+
 			Socket sock = this.socket;
 			MessageSerializer mserialzier = this.serializer;

@@ -213,14 +230,25 @@
 			if (sock == null || mserialzier == null || (!IsConnected && !IsConnecting))
 			{
 				tcs.TrySetResult (false);
+
+				if (responseRequested) {
+					var responseTcs = new TaskCompletionSource<Message>();
+					responseTcs.SetCanceled();
+					responseTask = responseTcs.Task;
+				}
+
 				return tcs.Task;
 			}

 			if (message.Header == null)
 				message.Header = new MessageHeader();

-			if (!dontSetId)
+			if (!dontSetId) {
 				SetMessageId (message);
+
+				if (responseRequested)
+					responseTask = Responses.SendFor (message, tcs.Task, timeout);
+			}

 			int length;
 			byte[] buffer = mserialzier.GetBytes (message, out length, new byte[2048]);


added keyboard mode

added keyboard mode

--- SeeingSoundwaves/Assets/Resources/Scripts/Flyer.cs
+++ SeeingSoundwaves/Assets/Resources/Scripts/Flyer.cs
@@ -5,7 +5,7 @@

     Camera Cam;
     public float lookSensitivity = 1;
-    public float topspeed;
+    public float topspeed = 4.0f;
     public float defaultSpeedDecay = 0.01f;
     public float triggeredSpeedDecay = 0.05f;

@@ -63,10 +63,14 @@
         }
         else
         {
-            //mouse
+            //keyboard
+            if (Input.GetKey("a"))
+                xVelocity += 1.0f;
+            else if (Input.GetKey("d"))
+                xVelocity -= defaultSpeedDecay; //slerpen nog, nu is het nog niet erg soepel.
         }
-
-        xVelocity = Mathf.Clamp(xVelocity, 0.0f, topspeed);
+
+        xVelocity = Mathf.Clamp(xVelocity, 0.0f, topspeed); //clamp het naar de topspeed

         transform.position += transform.forward * (xVelocity / 10) ;
 	}


Clarify docs.

Clarify docs.

--- Sensus.Shared/DataStores/Remote/RemoteDataStore.cs
+++ Sensus.Shared/DataStores/Remote/RemoteDataStore.cs
@@ -90,8 +90,8 @@
         }

         /// <summary>
-        /// Whether to initiate data upload when the device is plugged in to external
-        /// power. This will still respect the other settings (e.g., <see cref="RequireWiFi"/>).
+        /// Whether to initiate an additional data upload each time the device is plugged in to external
+        /// power. These additional uploads will respect the other settings (e.g., <see cref="RequireWiFi"/>).
         /// </summary>
         /// <value><c>true</c> to upload when plugged in, otherwise <c>false</c>.</value>
         [OnOffUiProperty("Write on Power Connect:", true, 52)]


rename GenerateWordTemplates -> GenerateDefaultTemplates

--- Signum.Engine.Extensions/Word/WordTemplateLogic.cs
+++ Signum.Engine.Extensions/Word/WordTemplateLogic.cs
@@ -574,7 +574,7 @@
             return result;
         }

-        public static void GenerateWordTemplates()
+        public static void GenerateDefaultTemplates()
         {
             var wordModels = Database.Query<WordModelEntity>().Where(se => !se.WordTemplates().Any()).ToList();


fix ReactCodeGenerator

fix ReactCodeGenerator

--- Signum.Engine/CodeGeneration/ReactCodeGenerator.cs
+++ Signum.Engine/CodeGeneration/ReactCodeGenerator.cs
@@ -106,7 +106,7 @@

         protected virtual string BaseFileName(Module m)
         {
-            return Path.Combine(GetProjectFolder(), "Modules\\" + m.ModuleName + "\\");
+            return Path.Combine(GetProjectFolder(), "App\\" + m.ModuleName + "\\");
         }

         protected virtual IEnumerable<Module> GetModules()
@@ -275,24 +275,7 @@

         protected virtual string WriteTypingsFile(Module mod)
         {
-            var fra = FrameworkRelativePath(false);
-            var era = ExtensonsRelativePath(false);
-
-            StringBuilder sb = new StringBuilder();
-            sb.AppendLine("//Assembly: " + mod.Types.First().Assembly.GetName().Name + ".dll");
-            sb.AppendLine("import { MessageKey, QueryKey, Type, EnumType, registerSymbol } from '" + fra + "Signum.React/Scripts/Reflection'");
-            sb.AppendLine();
-            sb.AppendLine("//Entities.Assembly: Signum.Entities.dll");
-            sb.AppendLine("import * as Entities from '" + fra + "Signum.React/Scripts/Signum.Entities'");
-            sb.AppendLine();
-            foreach (var m in GetTypingsImports())
-            {
-                sb.AppendLine($"//{m}.Assembly: Signum.Entities.Extensions.dll");
-                sb.AppendLine($"import * as {m} from '{era}Signum.React.Extensions/{m}/Signum.Entities.{m}'");
-                sb.AppendLine();
-            }
-
-            return sb.ToString();
+            return "";
         }

         private static string[] GetTypingsImports()
@@ -352,7 +335,7 @@
         {
             var v = GetVarName(type);

-            return "Navigator.addSettings(new EntitySettings({0}, {1} => new Promise(resolve => require(['./Templates/{2}'], resolve))));".FormatWith(
+            return "Navigator.addSettings(new EntitySettings({0}, {1} => new ViewPromise(resolve => require(['./Templates/{2}'], resolve))));".FormatWith(
                 type.Name, v, GetViewName(type));
         }


Fixed Refresh button staying selected after being pressed

--- MainPage.xaml.cs
+++ MainPage.xaml.cs
@@ -648,7 +648,7 @@
             App.OnCheckMouseBack(sender, e, () => { OnBackRequested(); });
         }

-        private void NavMenuList_ItemInvoked(object sender, ListViewItem listViewItem)
+        private async void NavMenuList_ItemInvoked(object sender, ListViewItem listViewItem)
         {
             var navListSender = sender as NavMenuListView;
             var item = navListSender.ItemFromContainer(listViewItem) as NavMenuItem;
@@ -657,6 +657,8 @@
             {
                 if (!item.OnInvoked(frame, sender))
                 {
+                    // ugly, but immediately updating the navlist status was not working, so...
+                    await Task.Delay(50);
                     SelectNavEntryMatching(frame.CurrentSourcePageType);
                 }
             }


Issue #154

Issue #154

--- SitecoreIntegrations/Applications/PowerShellIse.cs
+++ SitecoreIntegrations/Applications/PowerShellIse.cs
@@ -248,12 +248,13 @@
             if (mruItems.Count == 0 || !(mruItems[0]["Message"].Contains(id)))
             {
                 Item openedScript = mruItems.FirstOrDefault(mruItem => mruItem["Message"].Contains(id)) ??
-                                    mruMenu.Add(name, new TemplateID(ID.Parse("{998B965E-6AB8-4568-810F-8101D60D0CC3}")));
+                                    mruMenu.Add(Guid.NewGuid().ToString("n"), new TemplateID(ID.Parse("{998B965E-6AB8-4568-810F-8101D60D0CC3}")));
                 openedScript.Edit(args =>
                 {
                     openedScript["Message"] = string.Format("ise:mruopen(id={0},db={1})", id, db);
                     openedScript["Icon"] = icon;
                     openedScript["Display name"] = name;
+                    openedScript["__Display name"] = name;
                     openedScript[FieldIDs.Sortorder] = "0";
                 });


Use latest REST API

Use latest REST API

This allows to use the alphanumeric projects ids derived from the
project name rather than the internal TC ids (which are no longer
visible in the TC UI in version 9).

--- BuildDependencyLib/TeamCity/TeamCityApi.cs
+++ BuildDependencyLib/TeamCity/TeamCityApi.cs
@@ -24,7 +24,7 @@

 		private string BaseUrl
 		{
-			get { return string.Format("{0}/guestAuth/app/rest/7.0", Url); }
+			get { return string.Format("{0}/guestAuth/app/rest/latest", Url); }
 		}

 		public string BaseRepoUrl


GSF.TimeSeries: Fixed null reference exception in ServiceHostBase.ServiceStartingHandler.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/gsf/Main;C82727

--- Source/Libraries/GSF.TimeSeries/ServiceHostBase.cs
+++ Source/Libraries/GSF.TimeSeries/ServiceHostBase.cs
@@ -372,7 +372,7 @@
             m_configurationBackups = systemSettings["ConfigurationBackups"].ValueAs<int>(DefaultConfigurationBackups);
             m_uniqueAdapterIDs = systemSettings["UniqueAdaptersIDs"].ValueAsBoolean(true);
             m_allowRemoteRestart = systemSettings["AllowRemoteRestart"].ValueAsBoolean(true);
-            m_preferCachedConfiguration = systemSettings["ConfigurationSerializationFormat"].ValueAsBoolean(false);
+            m_preferCachedConfiguration = systemSettings["PreferCachedConfiguration"].ValueAsBoolean(false);
             m_configurationCacheComplete = new AutoResetEvent(true);
             m_queuedConfigurationCachePending = new object();


when select buffer is not long enough.

when select buffer is not long enough.

--- CSharpGL4/Scene/Scene.PickRendererBases.cs
+++ CSharpGL4/Scene/Scene.PickRendererBases.cs
@@ -16,9 +16,9 @@
         /// </summary>
         /// <param name="x">Left Down is (0, 0)</param>
         /// <param name="y">Left Down is (0, 0)</param>
-        /// <param name="geometryType"></param>
+        /// <param name="selectBufferLength"></param>
         /// <returns></returns>
-        public List<RendererBase> Pick(int x, int y)
+        public List<RendererBase> Pick(int x, int y, int selectBufferLength = 512)
         {
             //	Create a select buffer.
             var selectBuffer = new uint[512];
@@ -41,24 +41,33 @@
             //	Flush commands.
             GL.Instance.Flush();

+            List<RendererBase> pickedRenderer = null;
             //	End selection.
             int hits = GL.Instance.RenderMode(GL.GL_RENDER);
-            //  Create  result set.
-            var pickedRenderer = new List<RendererBase>();
-            uint posinarray = 0;
-            //  Go through each name.
-            for (int hit = 0; hit < hits; hit++)
+            if (hits < 0)// select buffer is not long enough.
             {
-                uint nameCount = selectBuffer[posinarray];
-                posinarray += 3;
+                pickedRenderer = this.Pick(x, y, selectBufferLength * 2);
+            }
+            else
+            {
+                pickedRenderer = new List<RendererBase>();
+                //  Create  result set.
+                uint posinarray = 0;
+                //  Go through each name.
+                for (int hit = 0; hit < hits; hit++)
+                {
+                    uint nameCount = selectBuffer[posinarray++];
+                    uint zNear = selectBuffer[posinarray++];
+                    uint zFar = selectBuffer[posinarray++];

-                if (nameCount == 0) { continue; }
+                    if (nameCount == 0) { continue; }

-                //	Add each hit element to the result set to the array.
-                for (int i = 0; i < nameCount; i++)
-                {
-                    uint hitName = selectBuffer[posinarray++];
-                    pickedRenderer.Add(arg.hitMap[hitName]);
+                    //	Add each hit element to the result set to the array.
+                    for (int i = 0; i < nameCount; i++)
+                    {
+                        uint hitName = selectBuffer[posinarray++];
+                        pickedRenderer.Add(arg.hitMap[hitName]);
+                    }
                 }
             }


Update ObjectTests.cs

Update ObjectTests.cs

--- JsResx.Test/ObjectTests.cs
+++ JsResx.Test/ObjectTests.cs
@@ -54,5 +54,11 @@
             Assert.IsTrue(result.Contains(@"Data.basicCodes="));
             Assert.IsTrue(result.Contains(@"{ ""Large"":""L"", ""Medium"":""M"", ""Small"":""S"" };"));
         }
+
+        [TestMethod]
+        public void FailingTest()
+        {
+            Assert.IsTrue(false);
+        }
     }
 }


GSF.TimeSeries.UI.WPF: Fixed an issue in TsfPopup where clicking on the popup would not activate the application window, and keyboard focus would still be on the previously active window.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/gsf/Main;C88839

--- Source/Libraries/GSF.TimeSeries/UI/WPF/TsfPopup.cs
+++ Source/Libraries/GSF.TimeSeries/UI/WPF/TsfPopup.cs
@@ -29,7 +29,9 @@
 using System.Runtime.InteropServices;
 using System.Windows;
 using System.Windows.Controls.Primitives;
+using System.Windows.Input;
 using System.Windows.Interop;
+using System.Windows.Media;

 namespace GSF.TimeSeries.UI
 {
@@ -49,6 +51,18 @@
             public readonly int Top;
             public readonly int Right;
             public readonly int Bottom;
+        }
+
+        #endregion
+
+        #region [ Constructors ]
+
+        /// <summary>
+        /// Creates a new instance of the <see cref="TsfPopup"/> class.
+        /// </summary>
+        public TsfPopup()
+        {
+            PreviewMouseDown += TsfPopup_PreviewMouseDown;
         }

         #endregion
@@ -81,7 +95,10 @@

         private static void OnTopmostChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
         {
-            (obj as TsfPopup).UpdateWindow();
+            TsfPopup tsfPopup = obj as TsfPopup;
+
+            if ((object)tsfPopup != null)
+                tsfPopup.UpdateWindow();
         }

         /// <summary>
@@ -95,11 +112,39 @@

         private void UpdateWindow()
         {
-            IntPtr hwnd = ((HwndSource)PresentationSource.FromVisual(this.Child)).Handle;
+            HwndSource hwndSource;
+            IntPtr hwnd;
             RECT rect;

-            if (GetWindowRect(hwnd, out rect))
-                SetWindowPos(hwnd, Topmost ? -1 : -2, rect.Left, rect.Top, (int)this.Width, (int)this.Height, 0);
+            // Get the source of the window handle
+            hwndSource = PresentationSource.FromVisual(Child) as HwndSource;
+
+            if ((object)hwndSource != null)
+            {
+                // Get the window handle
+                hwnd = hwndSource.Handle;
+
+                // Set the position of the window
+                if (GetWindowRect(hwnd, out rect))
+                    SetWindowPos(hwnd, Topmost ? -1 : -2, rect.Left, rect.Top, (int)Width, (int)Height, 0);
+            }
+        }
+
+        private void TsfPopup_PreviewMouseDown(object sender, MouseButtonEventArgs mouseButtonEventArgs)
+        {
+            DependencyObject parent = VisualTreeHelper.GetParent(this);
+            Window window = parent as Window;
+
+            // Find the parent window of this popup
+            while ((object)parent != null && (object)window == null)
+            {
+                parent = VisualTreeHelper.GetParent(parent);
+                window = parent as Window;
+            }
+
+            // Make sure the window is active
+            if ((object)window != null)
+                window.Activate();
         }

         #endregion


Minor changes.

Minor changes.

--- Source/Main/NProxy.Core/ProxyTypeBuilderFactory.cs
+++ Source/Main/NProxy.Core/ProxyTypeBuilderFactory.cs
@@ -88,7 +88,7 @@
             // Define dynamic module.
             _moduleBuilder = _assemblyBuilder.DefineDynamicModule(DynamicModuleName);

-            _nextTypeId = 0;
+            _nextTypeId = -1;
         }

         /// <summary>
@@ -168,7 +168,7 @@
         public TypeBuilder DefineType(string typeName, Type parentType)
         {
             var typeId = Interlocked.Increment(ref _nextTypeId);
-            var uniqueTypeName = String.Format("{0}{1}${2}{3:x}", DynamicAssemblyName, Type.Delimiter, typeName, typeId);
+            var uniqueTypeName = String.Format("{0}{1}{2}${3:x}", DynamicAssemblyName, Type.Delimiter, typeName, typeId);

             return _moduleBuilder.DefineType(
                 uniqueTypeName,


Configuration Setup Utility: Updated SqliteConfigv2 string to be readonly.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/siegate/Feature Development;C93672

--- Source/Tools/ConfigurationSetupUtility/App.xaml.cs
+++ Source/Tools/ConfigurationSetupUtility/App.xaml.cs
@@ -51,7 +51,7 @@
         public const string ManagerExe = "SIEGateManager.exe";
         public const string ManagerConfig = "SIEGateManager.exe.config";
         public const string BaseSqliteConfig = "SIEGate.db";
-        public static string SqliteConfigv2 = "SIEGate" + DatabaseVersionSuffix + ".db";
+        public readonly static string SqliteConfigv2 = "SIEGate" + DatabaseVersionSuffix + ".db";
         public const string SqliteSampleData = "SIEGate-SampleDataSet.db";
         public const string SqliteInitialData = "SIEGate-InitialDataSet.db";
         private readonly ErrorLogger m_errorLogger;