Changing internal name of embedded resources in .NET assemblies

--- dotnet/src/webdriver/Remote/RemoteWebElement.cs
+++ dotnet/src/webdriver/Remote/RemoteWebElement.cs
@@ -189,7 +189,7 @@
             {
                 Response commandResponse = null;
                 Dictionary<string, object> parameters = new Dictionary<string, object>();
-                string atom = GetAtom("isDisplayed.js");
+                string atom = GetAtom("is-displayed.js");
                 parameters.Add("script", atom);
                 parameters.Add("args", new object[] { this.ToElementReference().ToDictionary() });
                 commandResponse = this.Execute(DriverCommand.ExecuteScript, parameters);
@@ -383,7 +383,7 @@
             Response commandResponse = null;
             string attributeValue = string.Empty;
             Dictionary<string, object> parameters = new Dictionary<string, object>();
-            string atom = GetAtom("getAttribute.js");
+            string atom = GetAtom("get-attribute.js");
             parameters.Add("script", atom);
             parameters.Add("args", new object[] { this.ToElementReference().ToDictionary(), attributeName });
             commandResponse = this.Execute(DriverCommand.ExecuteScript, parameters);


Handled Null Values of Column

Handled Null Values of Column

--- ExportCSV/ExportToCSV.cs
+++ ExportCSV/ExportToCSV.cs
@@ -58,7 +58,7 @@
                 foreach (var innerPropInfo in propInfoArrayInner)
                 {
                     loopCount += 1;
-                    var columnValue = innerPropInfo.GetValue(item).ToString();
+                    var columnValue = innerPropInfo.GetValue(item) == null ? "" : innerPropInfo.GetValue(item).ToString();
                     sb.Append(sanitizeCommaAndQuotes(columnValue));
                     if (loopCount == propertyCount)
                     {
@@ -162,7 +162,7 @@
                 foreach (var innerPropInfo in propInfoArrayInner)
                 {
                     loopCount += 1;
-                    var columnValue = innerPropInfo.GetValue(item).ToString();
+                    var columnValue = innerPropInfo.GetValue(item) == null ? "" : innerPropInfo.GetValue(item).ToString();
                     sb.Append(sanitizeCommaAndQuotes(columnValue));
                     if (loopCount == propertyCount)
                     {


Prevent worker threads from blocking process exit for timeout duration.

--- Framework/WorkerQueue.cs
+++ Framework/WorkerQueue.cs
@@ -10,19 +10,13 @@
 	public class WorkerQueue
 	{
 		/// <summary> This is the longest this worker will hold on to an inactive thread. </summary>
-		/// <remarks> The shorter this is, the less potential thread reuse.  The longer, the greater the time to shut-down or release the thread back. </remarks>
+		/// <remarks> The shorter this is, the less potential thread reuse.  The longer, the more time unused thread handles are held on to. </remarks>
 		private const int ReuseThreadInterval = 20000;	// 20seconds

 		private Queue<System.Action> _asyncQueue = new Queue<System.Action>();
 		private volatile Thread _asyncThread;
 		private ManualResetEvent _asyncEvent = new ManualResetEvent(false);
 		private ThreadPriority _priority;
-
-		/// <summary> Event which is executed (on the async thread) each time the async operation queue becomes empty. </summary>
-		public event EventHandler AsyncOperationsComplete;
-
-		/// <summary> Event which is executed (on the async thread) each time the async operation queue begins to be serviced. </summary>
-		public event EventHandler AsyncOperationsStarted;

 		public ThreadPriority Priority
 		{
@@ -53,6 +47,7 @@
 					if (_asyncThread == null)
 					{
 						_asyncThread = new Thread(new ThreadStart(AsyncQueueServiceThread));
+						_asyncThread.IsBackground = true;	// Don't block process exit
 						_asyncThread.Priority = _priority;
 						_asyncThread.Start();
 					}


remove tabs from file

remove tabs from file

--- GiTracker/Bootstraper.cs
+++ GiTracker/Bootstraper.cs
@@ -20,14 +20,14 @@
             return Container.Resolve<MainPage>();
         }

-        protected override void RegisterTypes()
-		{
+        protected override void RegisterTypes()
+        {
             Container.RegisterInstance(Container);

             Container.RegisterTypeForNavigation<IssueList, IssueListViewModel>();
-            Container.RegisterTypeForNavigation<IssueDetails, IssueDetailsViewModel>();
-
-			Container.RegisterType<Loader>();
+            Container.RegisterTypeForNavigation<IssueDetails, IssueDetailsViewModel>();
+
+            Container.RegisterType<Loader>();

             Container.RegisterType<IIssueService, IssueService>();
             Container.RegisterType<IDatabaseService, DatabaseService>();
@@ -35,7 +35,7 @@
             Container.RegisterType<IRestService, RestService>();

             Container.RegisterType<IGitApiProvider, GitHubApiProvider>();
-            Container.RegisterType<IHttpClientProvider, DefaultHttpClientProvider> ();
+            Container.RegisterType<IHttpClientProvider, DefaultHttpClientProvider>();
         }
     }
 }


Add protected notification of menu open state

--- Gui/Menu/DropDownList.cs
+++ Gui/Menu/DropDownList.cs
@@ -225,10 +225,20 @@
 			{
 				menuVisible = false;
 				mainControlText.Text = selectedIndex == -1 ? this.noSelectionString : MenuItems[SelectedIndex].Text;
+				this.OnMenuClose();
 				this.Focus();
 			};

+			this.OnMenuOpen();
 			this.Invalidate();
+		}
+
+		protected virtual void OnMenuOpen()
+		{
+		}
+
+		protected virtual void OnMenuClose()
+		{
 		}

 		private void ApplyFilter()


Reading TjMax for each core on Intel Core i3/i5/i7 CPUs.

--- Hardware/CPU/IntelCPU.cs
+++ Hardware/CPU/IntelCPU.cs
@@ -87,6 +87,13 @@
     private static extern bool GetProcessAffinityMask(IntPtr handle,
       out IntPtr processMask, out IntPtr systemMask);

+    private float[] Floats(float f) {
+      float[] result = new float[coreCount];
+      for (int i = 0; i < coreCount; i++)
+        result[i] = f;
+      return result;
+    }
+
     public IntelCPU(string name, uint family, uint model, uint stepping,
       uint[,] cpuidData, uint[,] cpuidExtData) {

@@ -146,7 +153,7 @@

       coreCount = logicalProcessors / logicalProcessorsPerCore;

-      float tjMax;
+      float[] tjMax;
       switch (family) {
         case 0x06: {
             switch (model) {
@@ -155,53 +162,59 @@
                   case 0x06: // B2
                     switch (coreCount) {
                       case 2:
-                        tjMax = 80 + 10; break;
+                        tjMax = Floats(80 + 10); break;
                       case 4:
-                        tjMax = 90 + 10; break;
+                        tjMax = Floats(90 + 10); break;
                       default:
-                        tjMax = 85 + 10; break;
+                        tjMax = Floats(85 + 10); break;
                     }
-                    tjMax = 80 + 10; break;
+                    tjMax = Floats(80 + 10); break;
                   case 0x0B: // G0
-                    tjMax = 90 + 10; break;
+                    tjMax = Floats(90 + 10); break;
                   case 0x0D: // M0
-                    tjMax = 85 + 10; break;
+                    tjMax = Floats(85 + 10); break;
                   default:
-                    tjMax = 85 + 10; break;
+                    tjMax = Floats(85 + 10); break;
                 } break;
               case 0x17: // Intel Core (45nm)
-                tjMax = 100; break;
+                tjMax = Floats(100); break;
               case 0x1C: // Intel Atom
-                tjMax = 90; break;
+                tjMax = Floats(90); break;
               case 0x1A: // Intel Core i7 LGA1366 (45nm)
               case 0x1E: // Intel Core i5, i7 LGA1156 (45nm)
               case 0x25: // Intel Core i3, i5, i7 LGA1156 (32nm)
                 uint eax, edx;
-                if (WinRing0.Rdmsr(IA32_TEMPERATURE_TARGET, out eax, out edx)) {
-                  tjMax = (eax >> 16) & 0xFF;
-                } else {
-                  tjMax = 100;
+                tjMax = new float[coreCount];
+                for (int i = 0; i < coreCount; i++) {
+                  if (WinRing0.RdmsrTx(IA32_TEMPERATURE_TARGET, out eax,
+                    out edx, (UIntPtr)(
+                    1 << (int)(logicalProcessorsPerCore * i))))
+                  {
+                    tjMax[i] = (eax >> 16) & 0xFF;
+                  } else {
+                    tjMax[i] = 100;
+                  }
                 }
                 if (WinRing0.Rdmsr(MSR_PLATFORM_INFO, out eax, out edx)) {
                   maxNehalemMultiplier = (eax >> 8) & 0xff;
                 }
                 break;
               default:
-                tjMax = 100; break;
+                tjMax = Floats(100); break;
             }
           } break;
-        default: tjMax = 100; break;
+        default: tjMax = Floats(100); break;
       }

       // check if processor supports a digital thermal sensor
       if (cpuidData.GetLength(0) > 6 && (cpuidData[6, 0] & 1) != 0) {
         coreTemperatures = new Sensor[coreCount];
         for (int i = 0; i < coreTemperatures.Length; i++) {
-          coreTemperatures[i] = new Sensor(CoreString(i), i, tjMax,
+          coreTemperatures[i] = new Sensor(CoreString(i), i, tjMax[i],
             SensorType.Temperature, this, new ParameterDescription[] {
               new ParameterDescription(
                 "TjMax", "TjMax temperature of the core.\n" +
-                "Temperature = TjMax - TSlope * Value.", tjMax),
+                "Temperature = TjMax - TSlope * Value.", tjMax[i]),
               new ParameterDescription(
                 "TSlope", "Temperature slope of the digital thermal sensor.\n" +
                 "Temperature = TjMax - TSlope * Value.", 1)});


Applied patch for S06Setdata

Applied patch for S06Setdata

--- HedgeLib/Sets/SetData.cs
+++ HedgeLib/Sets/SetData.cs
@@ -272,7 +272,7 @@
                 // Generate Parameters Element
                 SetObjectTypeParam p;
                 var paramsElem = new XElement("Parameters");
-                var template = (objectTemplates.ContainsKey(obj.ObjectType)) ?
+                var template = (objectTemplates != null && objectTemplates.ContainsKey(obj.ObjectType)) ?
                     objectTemplates[obj.ObjectType] : null;

                 for (int i = 0; i < obj.Parameters.Count; ++i)


had a plus sign for some reason

had a plus sign for some reason

--- DrillTime/CallWebApis/Program.cs
+++ DrillTime/CallWebApis/Program.cs
@@ -5,7 +5,7 @@
 using System.Threading.Tasks;
 using DrillTime.DomainClasses;

-namespace HttpClientSample
+namespace HttpClientSample
 {


Removed the planning item parameters to the methods of the PQAsserter. Instead the planning item is set during construction.

--- ESAPIX/Constraints/PQAsserter.cs
+++ ESAPIX/Constraints/PQAsserter.cs
@@ -11,8 +11,19 @@

 namespace ESAPIX.Constraints
 {
+    /// <summary>
+    /// The Plan Quality Asserter verifies a planning item meets certain criteria, before constraining to a
+    /// particular constraint. It is designed to help with the IConstraint.CanConstrain(pi) method.
+    /// </summary>
     public class PQAsserter
     {
+        private PlanningItem _pi;
+
+        public PQAsserter(PlanningItem pi)
+        {
+            _pi = pi;
+        }
+
         public List<ConstraintResult> Results { get; set; } = new List<ConstraintResult>();

         /// <summary>
@@ -32,16 +43,15 @@
         /// <summary>
         /// Asserts the input assertion. Upon failure returns a Action Level 3 contraint result
         /// </summary>
-        /// <param name="pi">the planning item to be evaluated</param>
         /// <param name="assertion">the assertion that if not passed, returns an "not applicable" result</param>
         /// <param name="failedMessage">the message to show in case of failure</param>
         /// <returns>the plan quality asserter</returns>
-        public PQAsserter Assert(PlanningItem pi, Func<PlanningItem, bool> assertion, string failedMessage)
+        public PQAsserter Assert(Func<PlanningItem, bool> assertion, string failedMessage)
         {
             bool passed = false;
             try
             {
-                passed = assertion(pi);
+                passed = assertion(_pi);
             }
             catch (Exception e) { failedMessage += $" => Exception thrown : {e.Message}"; }

@@ -52,16 +62,15 @@
         /// <summary>
         /// Asserts the input assertion. Upon failure returns a Action Level 3 contraint result
         /// </summary>
-        /// <param name="pi">the planning item to be evaluated</param>
         /// <param name="assertion">the assertion that if not passed, returns an Action level 3 result</param>
         /// <param name="failedMessage">the message to show in case of failure</param>
         /// <returns>the plan quality asserter</returns>
-        public PQAsserter AssertCriticalPriority(PlanningItem pi, Func<PlanningItem, bool> assertion, string failedMessage)
+        public PQAsserter AssertCriticalPriority(Func<PlanningItem, bool> assertion, string failedMessage)
         {
             bool passed = false;
             try
             {
-                passed = assertion(pi);
+                passed = assertion(_pi);
             }
             catch (Exception e) { failedMessage += $" => Exception thrown : {e.Message}"; }
             Results.Add(new ConstraintResult(null, passed ? ResultType.PASSED : ResultType.ACTION_LEVEL_3, failedMessage));
@@ -71,16 +80,15 @@
         /// <summary>
         /// Asserts the input assertion. Upon failure returns a Action Level 3 contraint result
         /// </summary>
-        /// <param name="pi">the planning item to be evaluated</param>
         /// <param name="assertion">the assertion that if not passed, returns an Action level 2 result</param>
         /// <param name="failedMessage">the message to show in case of failure</param>
         /// <returns>the plan quality asserter</returns>
-        public PQAsserter AssertMidPriority(PlanningItem pi, Func<PlanningItem, bool> assertion, string failedMessage)
+        public PQAsserter AssertMidPriority(Func<PlanningItem, bool> assertion, string failedMessage)
         {
             bool passed = false;
             try
             {
-                passed = assertion(pi);
+                passed = assertion(_pi);
             }
             catch (Exception e) { failedMessage += $" => Exception thrown : {e.Message}"; }
             Results.Add(new ConstraintResult(null, passed ? ResultType.PASSED : ResultType.ACTION_LEVEL_2, failedMessage));
@@ -90,31 +98,30 @@
         /// <summary>
         /// Asserts the input assertion. Upon failure returns a Action Level 1 contraint result
         /// </summary>
-        /// <param name="pi">the planning item to be evaluated</param>
         /// <param name="assertion">the assertion that if not passed, returns an Action level 3 result</param>
         /// <param name="failedMessage">the message to show in case of failure</param>
         /// <returns>the plan quality asserter</returns>
-        public PQAsserter AssertLowPriority(PlanningItem pi, Func<PlanningItem, bool> assertion, string failedMessage)
+        public PQAsserter AssertLowPriority(Func<PlanningItem, bool> assertion, string failedMessage)
         {
             bool passed = false;
             try
             {
-                passed = assertion(pi);
+                passed = assertion(_pi);
             }
             catch (Exception e) { failedMessage += $" => Exception thrown : {e.Message}"; }
             Results.Add(new ConstraintResult(null, passed ? ResultType.PASSED : ResultType.ACTION_LEVEL_1, failedMessage));
             return this;
         }

-        public PQAsserter ContainsValidFractionNum(PlanningItem pi)
+        public PQAsserter ContainsValidFractionNum()
         {
             int? numFx = 0;
-            if (pi is PlanSum)
-            {
-                numFx = (pi as PlanSum).PlanSetups.Sum(p => p?.NumberOfFractions());
-            }
-            else
-                numFx = (pi as PlanSetup)?.NumberOfFractions();
+            if (_pi is PlanSum)
+            {
+                numFx = (_pi as PlanSum).PlanSetups.Sum(p => p?.NumberOfFractions());
+            }
+            else
+                numFx = (_pi as PlanSetup)?.NumberOfFractions();

             Results.Add(new ConstraintResult(null, numFx != null ? ResultType.PASSED : ResultType.NOT_APPLICABLE, "Not valid fraction number", string.Empty));
             return this;
@@ -123,11 +130,10 @@
         /// <summary>
         /// Asserts contains image (not null)
         /// </summary>
-        /// <param name="pi">the planing item</param>
-        /// <returns>the asserter object</returns>
-        public PQAsserter HasImage(PlanningItem pi)
-        {
-            if (pi.GetImage() == null)
+        /// <returns>the asserter object</returns>
+        public PQAsserter HasImage()
+        {
+            if (_pi.GetImage() == null)
                 Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "No image", string.Empty));
             else
                 Results.Add(new ConstraintResult(null, PASSED, string.Empty));
@@ -137,12 +143,11 @@
         /// <summary>
         /// Asserts contains structure set (not null)
         /// </summary>
-        /// <param name="pi">the planing item</param>
-        /// <returns>the asserter object</returns>
-        public PQAsserter HasStructureSet(PlanningItem pi)
+        /// <returns>the asserter object</returns>
+        public PQAsserter HasStructureSet()
         {
             // Check for structure set. If plan does not have a structure set, test is not applicable
-            if (pi.GetStructures() == null)
+            if (_pi.GetStructures() == null)
                 Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "No structure set.", string.Empty));
             else
                 Results.Add(new ConstraintResult(null, PASSED, string.Empty));
@@ -152,12 +157,11 @@
         /// <summary>
         /// Asserts planning item is plan setup type
         /// </summary>
-        /// <param name="pi">the planing item</param>
-        /// <returns>the asserter object</returns>
-        public PQAsserter IsPlanSetup(PlanningItem pi)
+        /// <returns>the asserter object</returns>
+        public PQAsserter IsPlanSetup()
         {
             // Check for structure set. If plan does not have a structure set, test is not applicable
-            if (pi is PlanSum)
+            if (_pi is PlanSum)
                 Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "Must be plan setup only", string.Empty));
             else Results.Add(new ConstraintResult(null, PASSED, string.Empty, string.Empty));

@@ -167,18 +171,17 @@
         /// <summary>
         /// Asserts is plan setup AND contains electron fields
         /// </summary>
-        /// <param name="pi">the planing item</param>
-        /// <returns>the asserter object</returns>
-        public PQAsserter ContainsOneOrMoreElectronBeams(PlanningItem pi)
-        {
-            var isPlanSetup = IsPlanSetup(pi).Results.Last();
+        /// <returns>the asserter object</returns>
+        public PQAsserter ContainsOneOrMoreElectronBeams()
+        {
+            var isPlanSetup = IsPlanSetup().Results.Last();
             if (!isPlanSetup.IsSuccess)
             {
                 Results.Add(isPlanSetup);
                 return this;
             }

-            var ps = pi as PlanSetup;
+            var ps = _pi as PlanSetup;
             var ens = ps.Beams.Select(b => b.EnergyModeDisplayName).ToList();
             var containsElectrons = ens.Any(e => e.EndsWith("E"));

@@ -194,16 +197,16 @@
         /// </summary>
         /// <param name="structureIds">the ids required for the plan</param>
         /// <returns>the asserter object</returns>
-        public PQAsserter ContainsNonEmptyStructuresById(PlanningItem pi, params string[] structureIds)
-        {
-            var structures = pi.GetStructures();
+        public PQAsserter ContainsNonEmptyStructuresById(params string[] structureIds)
+        {
+            var structures = _pi.GetStructures();
             if (structures == null)
             {
                 Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "No structure set", string.Empty));
                 return this;
             }
             foreach (var id in structureIds)
-                if (!pi.ContainsStructure(id))
+                if (!_pi.ContainsStructure(id))
                 {
                     Results.Add(new ConstraintResult(null, NOT_APPLICABLE, $"Missing {id}, or {id} is empty",
                         string.Empty));
@@ -218,9 +221,9 @@
         /// </summary>
         /// <param name="structureIds">the ids required for the plan</param>
         /// <returns>the asserter object</returns>
-        public PQAsserter ContainsOneOrMoreNonEmptyStructureById(PlanningItem pi, params string[] structureIds)
-        {
-            var structures = pi.GetStructures();
+        public PQAsserter ContainsOneOrMoreNonEmptyStructureById(params string[] structureIds)
+        {
+            var structures = _pi.GetStructures();
             if (structures == null)
             {
                 Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "No structure set", string.Empty));
@@ -228,7 +231,7 @@
             }
             foreach (var id in structureIds)
             {
-                if (pi.ContainsStructure(id))
+                if (_pi.ContainsStructure(id))
                 {
                     Results.Add(new ConstraintResult(null, PASSED, string.Empty, string.Empty));
                     return this;
@@ -245,9 +248,9 @@
         /// </summary>
         /// <param name="dicomTypes">the required DICOM types for this plan</param>
         /// <returns>the asserter object</returns>
-        public PQAsserter ContainsNonEmptyStructuresByDICOMType(PlanningItem pi, params string[] dicomTypes)
-        {
-            var structures = pi.GetStructures();
+        public PQAsserter ContainsNonEmptyStructuresByDICOMType(params string[] dicomTypes)
+        {
+            var structures = _pi.GetStructures();
             if (structures == null)
             {
                 Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "No structure set", string.Empty));
@@ -272,9 +275,9 @@
         /// </summary>
         /// <param name="dicomTypes">the required DICOM types for this plan</param>
         /// <returns>the asserter object</returns>
-        public PQAsserter ContainsOneOrMoreNonEmptyStructuresByDICOMType(PlanningItem pi, params string[] dicomTypes)
-        {
-            var structures = pi.GetStructures();
+        public PQAsserter ContainsOneOrMoreNonEmptyStructuresByDICOMType(params string[] dicomTypes)
+        {
+            var structures = _pi.GetStructures();
             if (structures == null)
             {
                 Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "No structure set", string.Empty));
@@ -299,9 +302,9 @@
         /// </summary>
         /// <param name="mType">the MLC type which all beams must have</param>
         /// <returns>the asserter object</returns>
-        public PQAsserter ContainsTreatmentBeamsByMLCPlanType(PlanningItem pi, VMS.TPS.Common.Model.Types.MLCPlanType mType)
-        {
-            var beams = pi.GetBeams();
+        public PQAsserter ContainsTreatmentBeamsByMLCPlanType(VMS.TPS.Common.Model.Types.MLCPlanType mType)
+        {
+            var beams = _pi.GetBeams();
             if (beams == null || !beams.Any())
             {
                 Results.Add(new ConstraintResult(null, NOT_APPLICABLE,
@@ -326,9 +329,9 @@
         /// </summary>
         /// <param name="mType">the MLC type which all beams must have</param>
         /// <returns>the asserter object</returns>
-        public PQAsserter ContainsOneOrMoreTreatmentBeamsByMLCPlanType(PlanningItem pi, VMS.TPS.Common.Model.Types.MLCPlanType mType)
-        {
-            var beams = pi.GetBeams();
+        public PQAsserter ContainsOneOrMoreTreatmentBeamsByMLCPlanType(VMS.TPS.Common.Model.Types.MLCPlanType mType)
+        {
+            var beams = _pi.GetBeams();
             if (beams == null || !beams.Any())
             {
                 Results.Add(new ConstraintResult(null, NOT_APPLICABLE,
@@ -355,16 +358,16 @@
         /// </summary>
         /// <param name="mType">the MLC type which all beams must have</param>
         /// <returns>the asserter object</returns>
-        public PQAsserter ContainsOneOrMorePhotonBeams(PlanningItem pi)
-        {
-            var isPlanSetup = IsPlanSetup(pi).Results.Last();
+        public PQAsserter ContainsOneOrMorePhotonBeams()
+        {
+            var isPlanSetup = IsPlanSetup().Results.Last();
             if (!isPlanSetup.IsSuccess)
             {
                 Results.Add(isPlanSetup);
                 return this;
             }

-            var ps = pi as PlanSetup;
+            var ps = _pi as PlanSetup;
             var ens = ps.Beams.Select(b => b.EnergyModeDisplayName).ToList();
             var containsPhotons = ens.Any(e => e.EndsWith("X"));

@@ -380,16 +383,16 @@
         /// </summary>
         /// <param name="mType">the MLC type which all beams must have</param>
         /// <returns>the asserter object</returns>
-        public PQAsserter ContainsOneOrMoreProtonBeams(PlanningItem pi)
-        {
-            var isPlanSetup = IsPlanSetup(pi).Results.Last();
+        public PQAsserter ContainsOneOrMoreProtonBeams()
+        {
+            var isPlanSetup = IsPlanSetup().Results.Last();
             if (!isPlanSetup.IsSuccess)
             {
                 Results.Add(isPlanSetup);
                 return this;
             }

-            var ps = pi as PlanSetup;
+            var ps = _pi as PlanSetup;
             var ens = ps.Beams.Select(b => b.EnergyModeDisplayName).ToList();
             var containsProtons = ens.Any(e => e.EndsWith("P"));


Update the TryGetJointPose docs to accurately describe the set of inputs it can take.

These functions only work if you pass in the specific Handedness.Left or Handedness.Right. They should be documented as such.

--- Assets/MixedRealityToolkit/Providers/Hands/HandJointUtils.cs
+++ Assets/MixedRealityToolkit/Providers/Hands/HandJointUtils.cs
@@ -8,8 +8,11 @@
     public static class HandJointUtils
     {
         /// <summary>
-        /// Try to find the first matching hand controller and return the pose of the requested joint for that hand.
+        /// Tries to get the the pose of the requested joint for the first controller with the specified handedness.
         /// </summary>
+        /// <param name="joint">The requested joint</param>
+        /// <param name="handedness">The specific hand of interest. This should be either Handedness.Left or Handedness.Right</param>
+        /// <param name="pose">The output pose data</param>
         public static bool TryGetJointPose(TrackedHandJoint joint, Handedness handedness, out MixedRealityPose pose)
         {
             IMixedRealityHand hand = FindHand(handedness);
@@ -25,6 +28,9 @@
         /// <summary>
         /// Find the first detected hand controller with matching handedness.
         /// </summary>
+        /// <remarks>
+        /// The given handeness should be either Handedness.Left or Handedness.Right.
+        /// </remarks>
         public static IMixedRealityHand FindHand(Handedness handedness)
         {
             foreach (var detectedController in MixedRealityToolkit.InputSystem.DetectedControllers)


Try to style the left-table correctlt.

Try to style the left-table correctlt.

--- BassUtils.NetCore/Middleware/RuntimeInformationMiddleware.cs
+++ BassUtils.NetCore/Middleware/RuntimeInformationMiddleware.cs
@@ -109,9 +109,9 @@
                                 table tbody tr:nth-of-type(even) {
                                     background-color: lightgrey;
                                 }
-                                table tbody tr:active-row {
-                                    font-weight: bold;
-                                    color: #009879;
+                                .left-table td:nth-child(1) {
+                                    background-color: black;
+                                    color: white;
                                 }
                               </style>
                             ");
@@ -208,9 +208,9 @@
             sb.AppendLine("    Informational Version	");
             sb.AppendLine("    Configuration	");
             sb.AppendLine("    Framework Name	");
-            sb.AppendLine("    Full Name	");
             sb.AppendLine("    Location 	");
             sb.AppendLine("    Meta Data	");
+            sb.AppendLine("    Full Name	");
             sb.AppendLine("
");
             sb.AppendLine("
");
         }
@@ -224,11 +224,10 @@
             sb.AppendFormat("    {0}	\n", info.InformationalVersion);
             sb.AppendFormat("    {0}	\n", info.Configuration);
             sb.AppendFormat("    {0}	\n", info.FrameworkName);
-            sb.AppendFormat("    {0}	\n", info.FullName);
             sb.AppendFormat("    {0}	\n", info.Location);
             sb.AppendFormat("    {0}	\n", string.Join(" ", info.MetaData));
+            sb.AppendFormat("    {0}	\n", info.FullName);
             sb.AppendLine("
");
         }
-
     }
 }


Improve IB brokerage error reporting for failed logins and security dialog

--- Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
+++ Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
@@ -50,6 +50,7 @@
     {
         private readonly IBAutomater.IBAutomater _ibAutomater;
         private readonly AutoResetEvent _ibAutomaterInitializeEvent = new AutoResetEvent(false);
+        private bool _loginFailed;
         private bool _existingSessionDetected;
         private bool _securityDialogDetected;

@@ -2824,6 +2825,13 @@

             Log.Trace($"InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): {e.Data}");

+            // login failed
+            if (e.Data.Contains("Login failed"))
+            {
+                _loginFailed = true;
+                _ibAutomaterInitializeEvent.Set();
+            }
+
             // an existing session was detected and IBAutomater clicked the "Exit Application" button
             if (e.Data.Contains("Existing session detected"))
             {
@@ -2832,7 +2840,9 @@
             }

             // a security dialog (2FA/code card) was detected by IBAutomater
-            if (e.Data.Contains("Second Factor Authentication") || e.Data.Contains("Security Code Card Authentication"))
+            if (e.Data.Contains("Second Factor Authentication") ||
+                e.Data.Contains("Security Code Card Authentication") ||
+                e.Data.Contains("Enter security code"))
             {
                 _securityDialogDetected = true;
                 _ibAutomaterInitializeEvent.Set();
@@ -2859,6 +2869,14 @@

         private void CheckIbAutomaterErrors()
         {
+            if (_loginFailed)
+            {
+                throw new Exception(
+                    "InteractiveBrokersBrokerage.CheckIbAutomaterErrors(): " +
+                    "Login failed. " +
+                    "Please check the validity of your login credentials.");
+            }
+
             if (_existingSessionDetected)
             {
                 throw new Exception(
@@ -2866,6 +2884,7 @@
                     "An existing session was detected and will not be automatically disconnected. " +
                     "Please close the existing session manually.");
             }
+
             if (_securityDialogDetected)
             {
                 throw new Exception(


Added delete subscription method to IFitbitClient interface

--- Fitbit.Portable/IFitbitClient.cs
+++ Fitbit.Portable/IFitbitClient.cs
@@ -33,5 +33,6 @@

         Task<List<ApiSubscription>> GetSubscriptionsAsync();
         Task<ApiSubscription> AddSubscriptionAsync(APICollectionType apiCollectionType, string uniqueSubscriptionId, string subscriberId = default(string));
+        Task DeleteSubscriptionAsync(APICollectionType collection, string uniqueSubscriptionId, string subscriberId = null);
     }
 }


Cast on list was redundant

Cast on list was redundant

--- Fluent.Ribbon/Controls/Ribbon.cs
+++ Fluent.Ribbon/Controls/Ribbon.cs
@@ -1363,10 +1363,11 @@
             if (e.NewValue is ObservableCollection<KeyGesture> newCollection)
             {
                 newCollection.CollectionChanged += ribbon.KeyCollection_CollectionChanged;
+
                 if (ribbon.keyTipService != null)
                 {
                     ribbon.keyTipService.KeyTipKeys.Clear();
-                    newCollection.Cast<KeyGesture>().ToList().ForEach(x => ribbon.keyTipService.KeyTipKeys.Add(x));
+                    newCollection.ToList().ForEach(x => ribbon.keyTipService.KeyTipKeys.Add(x));
                 }
             }
         }


added collection assertion

added collection assertion

--- Checkout.ApiClient.Tests/ChargeService/ChargeServiceTests.cs
+++ Checkout.ApiClient.Tests/ChargeService/ChargeServiceTests.cs
@@ -225,7 +225,7 @@

              response.Should().NotBeNull();
              response.HttpStatusCode.Should().Be(HttpStatusCode.OK);
-             response.Model.Charges.Count.Should().Be(2);
+             response.Model.Charges.Should().HaveCount(2);

              response.Model.Charges[0].Id.Should().Be(voidResponse.Model.Id);
              response.Model.Charges[1].Id.Should().Be(chargeResponse.Model.Id);
@@ -250,7 +250,7 @@

             response.Should().NotBeNull();
             response.HttpStatusCode.Should().Be(HttpStatusCode.OK);
-            response.Model.Charges.Count.Should().Be(3);
+            response.Model.Charges.Should().HaveCount(3);

             response.Model.Charges[0].Id.Should().Be(refundResponse.Model.Id);
             response.Model.Charges[1].Id.Should().Be(captureResponse.Model.Id);


Moving datamember for PhysicsBody UpdateOrder to property.

--- Framework/Physics/PhysicsBody.cs
+++ Framework/Physics/PhysicsBody.cs
@@ -62,7 +62,6 @@
     [Display(Name = "Physics Body")]
     [Category("Body")]
     public abstract class PhysicsBody : Entity, IPhysicsBody {
-        [DataMember]
         private int _updateOrder;

         /// <inheritdoc />
@@ -83,6 +82,7 @@
         public PhysicsMaterial PhysicsMaterial { get; set; } = PhysicsMaterial.Default;

         /// <inheritdoc />
+        [DataMember]
         public int UpdateOrder {
             get => this._updateOrder;
             set => this.Set(ref this._updateOrder, value);


one more case for nvidia opengl adapter name

--- CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs
+++ CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs
@@ -364,6 +364,7 @@

             if (gpuName.EndsWith("(intel)", StringComparison.OrdinalIgnoreCase)
                 || gpuName.EndsWith("(nvidia)", StringComparison.OrdinalIgnoreCase)
+                || gpuName.EndsWith(" corporation)", StringComparison.OrdinalIgnoreCase)
                 || gpuName.EndsWith("(amd)", StringComparison.OrdinalIgnoreCase)
                 || gpuName.EndsWith(" inc.)", StringComparison.OrdinalIgnoreCase) // ati
                 || gpuName.EndsWith("(apple)", StringComparison.OrdinalIgnoreCase)
@@ -372,8 +373,10 @@
             {
                 var idx = gpuName.LastIndexOf('(');
                 if (idx > 0)
-                    return gpuName[..idx].TrimEnd();
-            }
+                    gpuName = gpuName[..idx].TrimEnd();
+            }
+            if (gpuName.EndsWith("/PCIe/SSE2"))
+                gpuName = gpuName[..^10];
             return gpuName;
         }
         if (items["vulkan_initialized_device"] != null)


added comment

added comment

--- Game-Engine/Game-Engine/Form1.cs
+++ Game-Engine/Game-Engine/Form1.cs
@@ -45,7 +45,7 @@

         private void timer1_Tick(object sender, EventArgs e) //every tick
         {
-            x += 10;
+            x += 10;//This changes x by 10
             screen.Invalidate(); //This renders the screen avery frame (which is evcery 33 miliseconds, if you check the timer 1 object in the Design viewer for this class
         }
     }


Removed not used field

Removed not used field

--- Core/System/Runtime/CompilerServices/ExecutionScope.net30.cs
+++ Core/System/Runtime/CompilerServices/ExecutionScope.net30.cs
@@ -20,8 +20,6 @@

     public partial class ExecutionScope
     {
-        private readonly int _compilationUnit;
-
         public Delegate CreateDelegate(int indexLambda, object[] locals)
         {
             throw new NotSupportedException();


Player update packet reading bug.

Player update packet reading bug.

--- Games3Project2/NetworkManager.cs
+++ Games3Project2/NetworkManager.cs
@@ -332,7 +332,7 @@
             NetworkGamer gamer = findGamerWithTag(tag);
             Vector3 newPos = reader.ReadVector3();
             Vector3 newVel = reader.ReadVector3();
-            LocalPlayer player = gamer.Tag as LocalPlayer;
+            RemotePlayer player = gamer.Tag as RemotePlayer;
             player.Position = newPos;
             player.Velocity = newVel;
         }


Added other retry strategies to demonstrate them.  (fixed, interval, and exponential backoff)

--- Demo.TransientFaults.WebApi.Tests/ReliableHttpClientTests.cs
+++ Demo.TransientFaults.WebApi.Tests/ReliableHttpClientTests.cs
@@ -64,7 +64,9 @@
         [Test]
         public void given_call_to_service_with_incremental_retry_strategy_should_succeed_and_return_content()
         {
-            var retryStrategy = new Incremental(5, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2));
+            //var retryStrategy = new FixedInterval(5, TimeSpan.FromSeconds(1));
+            //var retryStrategy = new Incremental(5, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1));
+            var retryStrategy = new ExponentialBackoff(5, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(1));
             var retryPolicy = new RetryPolicy<HttpClientTransientErrorDetectionStrategy>(retryStrategy);
             retryPolicy.Retrying += TraceRetries;

@@ -117,7 +119,7 @@
                 {
                     Singleton.Instance.Counter++;

-                    if (Singleton.Instance.Counter.IsMultipleOf(4))
+                    if (Singleton.Instance.Counter.IsMultipleOf(6))
                     {
                         return Negotiate
                             .WithStatusCode(HttpStatusCode.OK)


Update UnhidingRowsAndColumns.cs

Update UnhidingRowsAndColumns.cs

--- Examples/CSharp/RowsColumns/Hiding/UnhidingRowsAndColumns.cs
+++ Examples/CSharp/RowsColumns/Hiding/UnhidingRowsAndColumns.cs
@@ -8,6 +8,7 @@
     {
         public static void Main(string[] args)
         {
+            //ExStart:1
             // The path to the documents directory.
             string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

@@ -32,7 +33,8 @@

             //Closing the file stream to free all resources
             fstream.Close();
+            //ExEnd:1

         }
     }
-}+}


Increase toggle switch thumb width

Increase toggle switch thumb width

--- Gui/ToggleSwitch/ToggleSwitch.cs
+++ Gui/ToggleSwitch/ToggleSwitch.cs
@@ -89,7 +89,7 @@
 				this.Checked = startValue;

 				var thumbHeight = height;
-				var thumbWidth = 12;
+				var thumbWidth = 14;

 				InteriorColor = interiorColor;
 				ExteriorColor = exteriorColor;


Reduce border contrast when disabled

Reduce border contrast when disabled

- Issue MatterHackers/MCCentral#2687
Inconsistent disabled styling

--- Gui/ToggleSwitch/ToggleSwitch.cs
+++ Gui/ToggleSwitch/ToggleSwitch.cs
@@ -84,6 +84,8 @@

 			private Color borderColor;

+			private Color disabledBorderColor;
+
 			internal SwitchView(double width, double height, bool startValue, Color backgroundColor, Color interiorColor, Color thumbColor, Color exteriorColor, Color borderColor)
 			{
 				this.Checked = startValue;
@@ -95,6 +97,8 @@
 				ExteriorColor = exteriorColor;

 				this.borderColor = borderColor;
+
+				disabledBorderColor = new Color(borderColor, 50);

 				ThumbColor = thumbColor;
 				LocalBounds = new RectangleDouble(0, 0, width, height);
@@ -128,7 +132,7 @@
 				}

 				// Draw border
-				graphics2D.Rectangle(borderRect, borderColor, 1);
+				graphics2D.Rectangle(borderRect, (this.Enabled) ? borderColor : disabledBorderColor, 1);

 				var thumbBounds = (this.Checked) ? checkedThumbBounds : uncheckedThumbBounds;
 				graphics2D.FillRectangle(thumbBounds, this.ThumbColor);


Updated CloseableReference usage and exception.

--- ImagePipeline/FBCore/Common/References/CloseableReference.cs
+++ ImagePipeline/FBCore/Common/References/CloseableReference.cs
@@ -73,8 +73,9 @@
         }

         /// <summary>
-        /// Constructs a CloseableReference.
-        ///
+        /// Constructs a CloseableReference. The argument must derive from IDisposable so that
+        /// it can re-use the default closable releaser.
+        ///
         /// <para />Returns null if the parameter is null.
         /// </summary>
         public static CloseableReference<T> of(T t)
@@ -85,13 +86,9 @@
             }
             else
             {
-                try
-                {
-                    IDisposable disposable = (IDisposable)t;
-                }
-                catch (InvalidCastException)
-                {
-                    throw new InvalidCastException("Argument isn't derived from IDisposable");
+                if (!(t is IDisposable))
+                {
+                    throw new ArgumentException("Argument is not IDisposable");
                 }

                 return new CloseableReference<T>(t, DEFAULT_CLOSEABLE_RELEASER);


Update the Empty module template.

Update the Empty module template.

--- Kooboo.CMS/Kooboo.CMS.ModuleArea/Areas/Empty/ModuleAction.cs
+++ Kooboo.CMS/Kooboo.CMS.ModuleArea/Areas/Empty/ModuleAction.cs
@@ -16,7 +16,7 @@
 using Kooboo.CMS.ModuleArea.Areas.SampleModule.Models;
 namespace Kooboo.CMS.ModuleArea.Areas.Empty
 {
-    [Kooboo.CMS.Common.Runtime.Dependency.Dependency(typeof(IModuleAction), Key = SampleAreaRegistration.ModuleName)]
+    [Kooboo.CMS.Common.Runtime.Dependency.Dependency(typeof(IModuleAction), Key = ModuleAreaRegistration.ModuleName)]
     public class ModuleAction : IModuleAction
     {
         public void OnExcluded(Sites.Models.Site site)
@@ -31,16 +31,7 @@

         public void OnInstalling(ControllerContext controllerContext)
-        {
-            var moduleInfo = ModuleInfo.Get(SampleAreaRegistration.ModuleName);
-            var installModel = new InstallModel();
-            Kooboo.CMS.Sites.Extension.PagePluginHelper.BindModel<InstallModel>(installModel, controllerContext);
-
-            moduleInfo.DefaultSettings.CustomSettings["DatabaseServer"] = installModel.DatabaseServer;
-            moduleInfo.DefaultSettings.CustomSettings["UserName"] = installModel.UserName;
-            moduleInfo.DefaultSettings.CustomSettings["Password"] = installModel.Password;
-            ModuleInfo.Save(moduleInfo);
-
+        {
             // Add code here that will be executed when the module installing.
         }


post-merge fix for Preview constructor

post-merge fix for Preview constructor

--- RelhaxModpack/RelhaxModpack/Windows/ModSelectionList.xaml.cs
+++ RelhaxModpack/RelhaxModpack/Windows/ModSelectionList.xaml.cs
@@ -1695,7 +1695,7 @@
             }
             else
             {
-                previewWindow = new Preview()
+                previewWindow = new Preview(this.ModpackSettings)
                 {
                     ComboBoxItemsInsideMode = comboboxItemsInside,
                     Medias = spc.Medias,


fix handling of entries in hash db. Always check (after entry up to date check) for the hash to match the hash of the local file. Flag for re-download if they don't match

--- RelhaxModpack/RelhaxModpack/Windows/ModSelectionList.xaml.cs
+++ RelhaxModpack/RelhaxModpack/Windows/ModSelectionList.xaml.cs
@@ -528,17 +528,14 @@
                         throw new BadMemeException("A '-1' means the file doesn't exist. But it does. Or at least it should at this point.");
                     md5DatabaseManager.UpdateFileEntry(package.ZipFile, File.GetLastWriteTime(zipFile), hash);
                 }
-                else
-                {
-                    //the file entry is up to date in the database, but it may be out of date with the modpack database
-                    string hashInDb = md5DatabaseManager.GetMd5HashFileEntry(package.ZipFile, File.GetLastWriteTime(zipFile));
-                    if (!package.CRC.Equals(hashInDb))
-                    {
-                        Logging.Info("Zip file {0} reports up to date by filetime, but local hash {1} does not match online hash {2}. Flag for re-download", package.ZipFile, hashInDb, package.CRC);
-                        package.DownloadFlag = true;
-                    }
-                }
-
+
+                //the file entry is up to date in the database, but it may be out of date with the modpack database
+                string hashInDb = md5DatabaseManager.GetMd5HashFileEntry(package.ZipFile, File.GetLastWriteTime(zipFile));
+                if (!package.CRC.Equals(hashInDb))
+                {
+                    Logging.Warning("Zip file {0} reports up to date by filetime, but local hash {1} does not match online hash {2}. Flag for re-download", package.ZipFile, hashInDb, package.CRC);
+                    package.DownloadFlag = true;
+                }
             }

             //and save the file


Added one more binary test for [US#49]

Added one more binary test for [US#49]

--- SoftwareForge.Mvc/SoftwareForge.TfsService/FileTypeReader.cs
+++ SoftwareForge.Mvc/SoftwareForge.TfsService/FileTypeReader.cs
@@ -48,7 +48,7 @@
                     ".xaml",
                     ".css"
                 };
-            List<string> blacklist = new List<string> { ".pdf", ".exe", ".zip", ".doc", ".docx", ".dot" };
+            List<string> blacklist = new List<string> { ".pdf", ".exe", ".zip", ".doc", ".docx", ".dot", ".png" };
             string extension = Path.GetExtension(path);
             if (whitelist.Contains(extension))
             {
@@ -58,15 +58,14 @@
             {
                 return false;
             }
-            //TODO check if binary file wihtout blacklist
-            return false;
+            return true;
         }

         /// <summary>
         /// Reads a file line by line
         /// </summary>
         /// <param name="path">file path</param>
-        /// <returns>a list of strings</returns>
+        /// <returns>a list of strings which each includes a line</returns>
         public List<string> GetFilesFromPath(string path)
         {
             if (File.Exists(path))
@@ -81,6 +80,9 @@

                     while ((line = reader.ReadLine()) != null)
                     {
+                        if (line.Contains("\0\0"))
+                            throw new Exception(path + " seems to be a binary file. Found 2 consecutive \0\0");
+
                         list.Add(line);
                     }
                     open.Close();
@@ -88,7 +90,7 @@
                     return list;

                 }
-                throw new Exception(path + " seems to be a binary file");
+                throw new Exception(path + " seems to be a binary file. Found this file extension on the blacklist");
             }
             throw new Exception(path + " seems to be not existing");
         }


Make all methods in GlassMapperSc virtual

--- Source/Glass.Mapper.Sc/Pipelines/Initialize/GlassMapperSc.cs
+++ Source/Glass.Mapper.Sc/Pipelines/Initialize/GlassMapperSc.cs
@@ -15,12 +15,12 @@
 {
 	public class GlassMapperSc
 	{
-		public void Process(PipelineArgs args)
+		public virtual void Process(PipelineArgs args)
 		{
-			GlassMapperSc.Start();
+			Start();
 		}

-		public static void Start()
+		public virtual void Start()
 		{
 			//install the custom services
 			var resolver = CreateResolver();
@@ -37,7 +37,7 @@
 			//EditFrameBuilder.EditFrameItemPrefix = "Glass-";
         }

-		public static IDependencyResolver CreateResolver()
+		public virtual IDependencyResolver CreateResolver()
 		{
 			var createResolverArgs = new CreateResolverPipelineArgs
 			{
@@ -47,7 +47,7 @@
 			return createResolverArgs.DependencyResolver;
 		}

-		public static IConfigurationLoader[] GetGlassLoaders()
+		public virtual IConfigurationLoader[] GetGlassLoaders()
 		{
 			var getGlassLoadersArgs = new GetGlassLoadersPipelineArgs
 			{
@@ -57,7 +57,7 @@
 			return getGlassLoadersArgs.GlassLoaders.ToArray();
 		}

-		public static void LoadConfigurationMaps(IDependencyResolver resolver, Glass.Mapper.Context context)
+		public virtual void LoadConfigurationMaps(IDependencyResolver resolver, Glass.Mapper.Context context)
         {
             var dependencyResolver = resolver as DependencyResolver;
             if (dependencyResolver == null)
@@ -75,13 +75,13 @@
             context.Load(configurationLoader);
         }

-		public static void AddMaps(IConfigFactory<IGlassMap> mapsConfigFactory)
+		public virtual void AddMaps(IConfigFactory<IGlassMap> mapsConfigFactory)
 		{
 			var pipelineArgs = new AddMapsPipelineArgs { MapsConfigFactory = mapsConfigFactory };
 			AddMapsPipeline.Run(pipelineArgs);
 		}

-		public static void PostLoad(IDependencyResolver dependencyResolver)
+		public virtual void PostLoad(IDependencyResolver dependencyResolver)
 		{
 			var postLoadArgs = new PostLoadPipelineArgs
 			{


Synchrophasor: Fixed PhasorDataSourceValidation for SQLite.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C68824

--- Source/Libraries/TVA.PhasorProtocols/CommonPhasorServices.cs
+++ Source/Libraries/TVA.PhasorProtocols/CommonPhasorServices.cs
@@ -1134,8 +1134,8 @@
                 configFile.Save();

                 // Get the needed statistic related IDs
-                int statSignalTypeID = (int)connection.ExecuteScalar("SELECT ID FROM SignalType WHERE Acronym='STAT';");
-                int statHistorianID = (int)connection.ExecuteScalar(string.Format("SELECT ID FROM Historian WHERE Acronym='STAT' AND NodeID={0};", nodeIDQueryString));
+                int statSignalTypeID = Convert.ToInt32(connection.ExecuteScalar("SELECT ID FROM SignalType WHERE Acronym='STAT';"));
+                int statHistorianID = Convert.ToInt32(connection.ExecuteScalar(string.Format("SELECT ID FROM Historian WHERE Acronym='STAT' AND NodeID={0};", nodeIDQueryString)));
                 object nodeCompanyID = connection.ExecuteScalar(string.Format("SELECT CompanyID FROM Node WHERE ID={0};", nodeIDQueryString));

                 // Load the defined system statistics


Synchrophasor: Modified CommonPhasorServices.PhasorDataSourceValidation to use parameterized queries for insert statements.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C54775

--- Source/Libraries/TVA.PhasorProtocols/CommonPhasorServices.cs
+++ Source/Libraries/TVA.PhasorProtocols/CommonPhasorServices.cs
@@ -1769,7 +1769,8 @@
                             pointTag = string.Format("{0}_{1}:ST{2}", company, acronym, signalIndex);
                             description = string.Format("{0} {1} Statistic for {2}", device.Field<string>("Name"), vendorDevice, statistic.Field<string>("Description"));

-                            connection.ExecuteNonQuery(string.Format("INSERT INTO Measurement(HistorianID, DeviceID, PointTag, SignalTypeID, PhasorSourceIndex, SignalReference, Description, Enabled) VALUES({0}, {1}, '{2}', {3}, NULL, '{4}', '{5}', 1);", statHistorianID, device.Field<int>("ID"), pointTag, statSignalTypeID, signalReference, description));
+                            IDbCommand command = CreateParameterizedCommand(connection, "INSERT INTO Measurement(HistorianID, DeviceID, PointTag, SignalTypeID, PhasorSourceIndex, SignalReference, Description, Enabled) VALUES(@statHistorianID, @deviceID, @pointTag, @statSignalTypeID, NULL, @signalReference, @description, 1);", statHistorianID, device.Field<int>("ID"), pointTag, statSignalTypeID, signalReference, description);
+                            command.ExecuteNonQuery();
                         }
                     }
                 }
@@ -1792,7 +1793,8 @@
                             pointTag = string.Format("{0}_{1}:ST{2}", company, acronym, signalIndex);
                             description = string.Format("{0} {1} Statistic for {2}", inputStream.Field<string>("Name"), vendorDevice, statistic.Field<string>("Description"));

-                            connection.ExecuteNonQuery(string.Format("INSERT INTO Measurement(HistorianID, DeviceID, PointTag, SignalTypeID, PhasorSourceIndex, SignalReference, Description, Enabled) VALUES({0}, {1}, '{2}', {3}, NULL, '{4}', '{5}', 1);", statHistorianID, inputStream.Field<int>("ID"), pointTag, statSignalTypeID, signalReference, description));
+                            IDbCommand command = CreateParameterizedCommand(connection, "INSERT INTO Measurement(HistorianID, DeviceID, PointTag, SignalTypeID, PhasorSourceIndex, SignalReference, Description, Enabled) VALUES(@statHistorianID, @deviceID, @pointTag, @statSignalTypeID, NULL, @signalReference, @description, 1);", statHistorianID, inputStream.Field<int>("ID"), pointTag, statSignalTypeID, signalReference, description);
+                            command.ExecuteNonQuery();
                         }
                     }
                 }
@@ -1818,11 +1820,45 @@
                             pointTag = string.Format("{0}_{1}:ST{2}", company, acronym, signalIndex);
                             description = string.Format("{0} Statistic for {1}", outputStream.Field<string>("Name"), statistic.Field<string>("Description"));

-                            connection.ExecuteNonQuery(string.Format("INSERT INTO Measurement(HistorianID, DeviceID, PointTag, SignalTypeID, PhasorSourceIndex, SignalReference, Description, Enabled) VALUES({0}, NULL, '{1}', {2}, NULL, '{3}', '{4}', 1);", statHistorianID, pointTag, statSignalTypeID, signalReference, description));
+                            IDbCommand command = CreateParameterizedCommand(connection, "INSERT INTO Measurement(HistorianID, DeviceID, PointTag, SignalTypeID, PhasorSourceIndex, SignalReference, Description, Enabled) VALUES(@statHistorianID, NULL, @pointTag, @statSignalTypeID, NULL, @signalReference, @description, 1);", statHistorianID, pointTag, statSignalTypeID, signalReference, description);
+                            command.ExecuteNonQuery();
                         }
                     }
                 }
             }
+        }
+
+        /// <summary>
+        /// Creates and returns a parameterized SQL command. Parameter names are embedded in the SQL statement
+        /// passed as a parameter to this method. This method does very rudimentary parsing of the SQL statement so parameter
+        /// names should start with the '@' character and should be surrounded by either spaces, parentheses, or commas.
+        /// </summary>
+        /// <param name="connection">The database connection.</param>
+        /// <param name="sql">The SQL statement.</param>
+        /// <param name="args">The parameters for the command in the order that they appear in the SQL statement.</param>
+        /// <returns>The parameterized command.</returns>
+        private static IDbCommand CreateParameterizedCommand(IDbConnection connection, string sql, params object[] args)
+        {
+            string[] tokens = sql.Split(' ', '(', ')', ',');
+            IDbCommand command = connection.CreateCommand();
+            int i = 0;
+
+            foreach (string token in tokens)
+            {
+                if (token.StartsWith("@") && !command.Parameters.Contains(token))
+                {
+                    IDbDataParameter parameter = command.CreateParameter();
+
+                    parameter.ParameterName = token;
+                    parameter.Value = args[i++];
+                    parameter.Direction = ParameterDirection.Input;
+
+                    command.Parameters.Add(parameter);
+                }
+            }
+
+            command.CommandText = sql;
+            return command;
         }

         /// <summary>


Fixed storage queue race condition

Fixed storage queue race condition

Sometimes, TryPublishQueuedMessageAsync would try to remove a message from the storage queue before PublishAsync added it to the storage queue, resulting in a message being stuck in the storage queue forever.  Switched the message queue lock to an async lock and synchronized the storage queue updates with the message queue updates.

--- Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs
+++ Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs
@@ -24,6 +24,8 @@

         private readonly IMqttClient _mqttClient;
         private readonly IMqttNetChildLogger _logger;
+
+        private readonly AsyncLock _messageQueueLock = new AsyncLock();

         private CancellationTokenSource _connectionCancellationToken;
         private CancellationTokenSource _publishingCancellationToken;
@@ -147,7 +149,7 @@

             try
             {
-                lock (_messageQueue)
+                using (await _messageQueueLock.WaitAsync(CancellationToken.None).ConfigureAwait(false))
                 {
                     if (_messageQueue.Count >= Options.MaxPendingMessages)
                     {
@@ -167,6 +169,16 @@
                     }

                     _messageQueue.Enqueue(applicationMessage);
+
+                    if (_storageManager != null)
+                    {
+                        if (removedMessage != null)
+                        {
+                            await _storageManager.RemoveAsync(removedMessage).ConfigureAwait(false);
+                        }
+
+                        await _storageManager.AddAsync(applicationMessage).ConfigureAwait(false);
+                    }
                 }
             }
             finally
@@ -180,16 +192,6 @@
                     }
                 }

-            }
-
-            if (_storageManager != null)
-            {
-                if (removedMessage != null)
-                {
-                    await _storageManager.RemoveAsync(removedMessage).ConfigureAwait(false);
-                }
-
-                await _storageManager.AddAsync(applicationMessage).ConfigureAwait(false);
             }
         }

@@ -377,7 +379,7 @@
             {
                 await _mqttClient.PublishAsync(message.ApplicationMessage).ConfigureAwait(false);

-                lock (_messageQueue) //lock to avoid conflict with this.PublishAsync
+                using (await _messageQueueLock.WaitAsync(CancellationToken.None).ConfigureAwait(false)) //lock to avoid conflict with this.PublishAsync
                 {
                     // While publishing this message, this.PublishAsync could have booted this
                     // message off the queue to make room for another (when using a cap
@@ -386,11 +388,11 @@
                     // it from the queue.  If not, that means this.PublishAsync has already
                     // removed it, in which case we don't want to do anything.
                     _messageQueue.RemoveFirst(i => i.Id.Equals(message.Id));
-                }
-
-                if (_storageManager != null)
-                {
-                    await _storageManager.RemoveAsync(message).ConfigureAwait(false);
+
+                    if (_storageManager != null)
+                    {
+                        await _storageManager.RemoveAsync(message).ConfigureAwait(false);
+                    }
                 }
             }
             catch (MqttCommunicationException exception)
@@ -408,14 +410,14 @@
                     //contradict the expected behavior of QoS 1 and 2, that's also true
                     //for the usage of a message queue cap, so it's still consistent
                     //with prior behavior in that way.
-                    lock (_messageQueue) //lock to avoid conflict with this.PublishAsync
+                    using (await _messageQueueLock.WaitAsync(CancellationToken.None).ConfigureAwait(false)) //lock to avoid conflict with this.PublishAsync
                     {
                         _messageQueue.RemoveFirst(i => i.Id.Equals(message.Id));
-                    }
-
-                    if (_storageManager != null)
-                    {
-                        await _storageManager.RemoveAsync(message).ConfigureAwait(false);
+
+                        if (_storageManager != null)
+                        {
+                            await _storageManager.RemoveAsync(message).ConfigureAwait(false);
+                        }
                     }
                 }
             }
@@ -533,4 +535,4 @@
             _connectionCancellationToken = null;
         }
     }
-}+}


Add unit test

Add unit test

--- TestProjectCoreUseFulFunctions/UnitTestFunctionsMathPrime.cs
+++ TestProjectCoreUseFulFunctions/UnitTestFunctionsMathPrime.cs
@@ -8,7 +8,6 @@
   {
     /*
   Liste des nombres premiers allant de 1 à 10000
-    19,
     23,
     29,
     31,
@@ -23,6 +22,7 @@
     [DataRow(11)]
     [DataRow(13)]
     [DataRow(17)]
+    [DataRow(19)]
     [DataRow(2819)]
     [DataRow(2833)]
     [DataRow(2837)]


Add unit test

Add unit test


Added function to the constructor to allow for DateTime configuration

--- Testing-001/solution/Solution.MyApplication/PersonService.cs
+++ Testing-001/solution/Solution.MyApplication/PersonService.cs
@@ -15,12 +15,20 @@
         /// </value>
         public IValidation PersonValidator { get; set; }

+        public Func<DateTime> GetTodaysDate { get; set; }
+
         /// <summary>
         /// Initializes a new instance of the <see cref="PersonService"/> class.
         /// </summary>
-        public PersonService(IValidation personValidator)
+        /// <param name="personValidator">The person validator.</param>
+        /// <param name="retrieveCurrentDate">
+        /// Returns the current date. NB: Not supported by Unity, but can be done with Castle.
+        /// This functionality could be contained within a DateManager class (or use Noda time!)
+        /// </param>
+        public PersonService(IValidation personValidator, Func<DateTime> retrieveCurrentDate )
         {
             PersonValidator = personValidator;
+            GetTodaysDate = retrieveCurrentDate;

             // Ideally this would be a DB call
             AgeGroupMap = new Dictionary<int,AgeGroup>();
@@ -75,7 +83,7 @@
         {
             // NB: should really be in a utility class, but it's here for the purpose of the workshop!
             DateTime zeroTime = new DateTime(1, 1, 1);
-            int age = (zeroTime + (DateTime.Today - dateOfBirth)).Year - 1;
+            int age = (zeroTime + (GetTodaysDate().Date - dateOfBirth)).Year - 1;

             return age;
         }


delete MEssenger

delete MEssenger

--- Demo_MvvmLight/MEssenger/ButtonMessage.cs
+++ Demo_MvvmLight/MEssenger/ButtonMessage.cs
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Demo_MvvmLight.MEssenger
-{
-    public class ButtonMessage
-    {public string ButtonText { get;private set; }
-        public ButtonMessage(string bt )
-        {
-            ButtonText = bt;
-        }
-
-    }
-}


Fix copyright year

Fix copyright year

--- DesktopWidgets/Properties/AssemblyInfo.cs
+++ DesktopWidgets/Properties/AssemblyInfo.cs
@@ -11,7 +11,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Daniel Chalmers Software")]
 [assembly: AssemblyProduct("DesktopWidgets")]
-[assembly: AssemblyCopyright("© Daniel Chalmers 2015")]
+[assembly: AssemblyCopyright("© Daniel Chalmers 2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 [assembly: Guid("D7E6B136-3765-4938-8ACA-EED3473CE3A0")]


Send message to correct channel

Send message to correct channel

--- DiscordBotNew/Commands/GeneralCommands.cs
+++ DiscordBotNew/Commands/GeneralCommands.cs
@@ -679,7 +679,9 @@
                 Description = content
             };

-            return new SuccessResult(text, embed: builder.Build());
+            await ((ITextChannel)channel).SendMessageAsync(text, embed: builder.Build());
+
+            return new SuccessResult();
         }
     }
 }


Slight tweak to try to make this test stop being flaky

--- Domain.Sql.Tests/ReadModelCatchupTests.cs
+++ Domain.Sql.Tests/ReadModelCatchupTests.cs
@@ -954,7 +954,11 @@
         {
             Events.Write(10);

-            using (var catchup = CreateReadModelCatchup(Projector.Create<IEvent>(e => { })))
+            using (var catchup = CreateReadModelCatchup(Projector.Create<IEvent>(e =>
+            {
+                // slow this down just enough for the batch to still be running when we await below
+                Thread.Sleep(2);
+            })))
             {
                 Task.Run(() => catchup.Run());
                 var status = await catchup.SingleBatchAsync();


add Id to NotFound

add Id to NotFound

--- WebApiExtensions/Extensions/HttpRequestMessageExtensions.cs
+++ WebApiExtensions/Extensions/HttpRequestMessageExtensions.cs
@@ -182,11 +182,12 @@
                 additionalInfo["Format"] = format;
             return request.CreateErrorCodeResponse(HttpStatusCode.BadRequest, "Input value is incorrect format", additionalInfo);
         }
-        public static HttpResponseMessage CreateNotFoundResponse(this HttpRequestMessage request, string type)
+        public static HttpResponseMessage CreateNotFoundResponse(this HttpRequestMessage request, string type, string id)
         {
             var additionalInfo = new JObject
             {
                 { "Type", type },
+                { "Id", id },
             };
             return request.CreateErrorCodeResponse(HttpStatusCode.NotFound, "Object is not found", additionalInfo);
         }


Update ExceptionTest.cs

Update ExceptionTest.cs

--- test/NatashaUT/ExceptionTest.cs
+++ test/NatashaUT/ExceptionTest.cs
@@ -50,6 +50,7 @@
             Assert.Equal(OopType.Struct ,builder.OopTypeEnum);
             Assert.Null(type);
             Assert.Equal(ComplieError.Syntax, builder.Complier.ComplieException.ErrorFlag);
+            Assert.Equal(ComplieError.Syntax, builder.Complier.SyntaxExceptions[0].ErrorFlag);
         }

@@ -71,6 +72,7 @@

             Assert.Null(delegateAction);
             Assert.Equal(ComplieError.Syntax, builder.Complier.ComplieException.ErrorFlag);
+            Assert.Equal(ComplieError.Syntax, builder.Complier.SyntaxExceptions[0].ErrorFlag);
         }

     }


Fix param name.

Fix param name.

--- test/TestApp/FileSystemTests.cs
+++ test/TestApp/FileSystemTests.cs
@@ -45,7 +45,7 @@
 		public void Run ()
 		{
 			long length = new FileInfo ("TestRunner.exe").Length;
-			TestRunner.RunTest ("/FileSystemTests/FileLength?file=TestRunner.exe", "/FileSystemTests/FileLength?file=TestRunner.exe", length.ToString ());
+			TestRunner.RunTest ("/FileSystemTests/FileLength?filename=TestRunner.exe", "/FileSystemTests/FileLength?file=TestRunner.exe", length.ToString ());
 		}
 	}
 }


Fixes to paging on GetRecentContacts

Fixes to paging on GetRecentContacts

--- HubSpot.Net/HubSpotNet.cs
+++ HubSpot.Net/HubSpotNet.cs
@@ -141,7 +141,7 @@
         public async Task<List<HubSpotContactModel>> GetRecentContacts(string apiKey, DateTime timeOffset, List<string> properties = null)
         {
             // add an array of query string params that can be iterated through
-            var uri = new UriBuilder(HubSpotBaseUrl + "/contacts/v1/lists/recently_updated/contacts/recent?hapikey=" + apiKey + "&propertyMode=value_and_history");
+            var uri = new UriBuilder(HubSpotBaseUrl + "/contacts/v1/lists/recently_updated/contacts/recent?hapikey=" + apiKey + "&count=100&propertyMode=value_and_history");

             if(properties != null && properties.Any())
             {
@@ -155,9 +155,22 @@
                 var responseTimeOffset = DateTime.MaxValue;
                 var uriOriginalString = uri.Uri.ToString();
                 var uriString = uriOriginalString;
-
-                while (!string.IsNullOrEmpty(uriString))
-                {
+                var firstPass = true;
+
+                while (firstPass || contactsModel.HasMore)
+                {
+                    // append time and vid offset if not the first pass
+                    if (!firstPass)
+                    {
+                        uri = new UriBuilder(HubSpotBaseUrl + "/contacts/v1/lists/recently_updated/contacts/recent?hapikey=" + apiKey + "&count=100&propertyMode=value_and_history"
+                            + string.Format("&vidOffset={0}&timeOffset={1}", contactsModel.VidOffset, contactsModel.TimeOffSet));
+
+                        if (properties != null && properties.Any())
+                        {
+                            uri.Query = uri.Query.Substring(1) + "&property=" + string.Join("&property=", properties);
+                        }
+                    }
+
                     var response = await client.GetAsync(uri.Uri);
                     var result = await response.Content.ReadAsStringAsync();

@@ -178,7 +191,10 @@
                         uriString = uriOriginalString + "&vidOffset=" + contactsModel.VidOffset + "&timeOffset=" + contactsModel.TimeOffSet.ToString();
                     }
                     else
-                        uriString = string.Empty;
+                        uriString = string.Empty;
+
+                    if (firstPass)
+                        firstPass = false;
                 }

                 return contactList;
@@ -304,6 +320,8 @@
         public async Task BatchUpdateContactsByEmail(string apiKey, List<HubSpotUpdateContactModel> model)
         {
             var uri = new UriBuilder(HubSpotBaseUrl + "contacts/v1/contact/batch/?hapikey=" + apiKey);
+
+            var modelArray = model.ToArray();

             var content = new StringContent(JsonConvert.SerializeObject(model.ToArray(), Formatting.None, new JsonSerializerSettings
             { NullValueHandling = NullValueHandling.Ignore }), Encoding.UTF8, "application/json");


Fixing tests back to master

Fixing tests back to master

--- AdmoTests/ApplicationHandlerTests.cs
+++ AdmoTests/ApplicationHandlerTests.cs
@@ -35,7 +35,7 @@
                 Z = (float)1
             };

-            var newPoint = ApplicationHandler.FilterPoint(point, fillpoint, (float) 0.5);
+            var newPoint = ApplicationHandler.FilterPoint(point, fillpoint, (float)0.5);

             var test = new SkeletonPoint
             {
@@ -44,37 +44,37 @@
                 Z = (float)5.5
             };

-            Assert.AreEqual(test,newPoint);
+            Assert.AreEqual(test, newPoint);
         }
-
+
         [TestMethod]
         public void Scaling()
         {

             //test will break if default scaling parameters change
             var point = new SkeletonPoint
-                {
-                    X = (float)0.294321,
-                    Y = (float)0.134594,
-                    Z = (float)0.6999
-                };
+            {
+                X = (float)0.294321,
+                Y = (float)0.134594,
+                Z = (float)0.6999
+            };

             var colorpoint = new ColorImagePoint
-                {
-                    X = 555,
-                    Y = 132,
-                };
+            {
+                X = 555,
+                Y = 132,
+            };

             var newPos = ApplicationHandler.ScaleCoordinates(point, colorpoint);

             var checkPos = new Position
-                {
-                    X = 640,
-                    Xmm = (float)0.294321,
-                    Y = 99,
-                    Ymm = (float)0.13459,
-                    Z = 699
-                };
+            {
+                X = 640,
+                Xmm = (float)0.294321,
+                Y = 99,
+                Ymm = (float)0.13459,
+                Z = 699
+            };
             Assert.AreEqual(newPos.X, checkPos.X);
             Assert.AreEqual(newPos.Y, checkPos.Y);
             Assert.AreEqual(newPos.Z, checkPos.Z);
@@ -93,10 +93,10 @@
             //Still fast because sequentially accessing elements however still
             //readable

-            const int height = 480;
-
+            const int width = 640;

-            depthData[200*height + 300] = 500*8;
+
+            depthData[200 + 300 * width] = 500 * 8;

             var myState2 = myAppHandler.FindPlayer(
                 depthData, 480, 640);
@@ -105,29 +105,29 @@
             //check if switching to phase 2 fails.
             // Regression
             //Check if correct phase
-            Assert.AreEqual(myState2.Phase, 1);
+            Assert.AreEqual(1, myState2.Phase);

-
+
             var myState = myAppHandler.FindPlayer(
                 new short[307200], 480, 640);

-           // var
+            // var

             var defaultState = new KinectState();
-            Assert.AreEqual(myState.Head.X,defaultState.Head.X);
+            Assert.AreEqual(myState.Head.X, defaultState.Head.X);

         }
         [TestMethod]
         public void Stages()
         {
             var myAppHandler = new ApplicationHandler();
-            var stage2 = myAppHandler.GetStage((float)0.6);
-            var stage1 = myAppHandler.GetStage((float)0.8);
+            var stage1 = myAppHandler.GetStage((float)0.6);
+            var stage2 = myAppHandler.GetStage((float)0.8);

-            Assert.AreEqual(1,stage2);
-            Assert.AreEqual(2, stage1);
+            Assert.AreEqual(1, stage1);
+            Assert.AreEqual(2, stage2);
         }
-
+
     }
-}
+}


Add using for Template class.

Add using for Template class.

--- ExoWeb.UnitTests.Server/ExoWebTest.cs
+++ ExoWeb.UnitTests.Server/ExoWebTest.cs
@@ -1,10 +1,8 @@
-using ExoWeb;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System;
-using System.Collections.Generic;
-using ExoWeb.Templates;
+using System;
 using System.IO;
 using System.Linq;
+using ExoWeb.Templates.MicrosoftAjax;
+using Microsoft.VisualStudio.TestTools.UnitTesting;

 namespace ExoWeb.UnitTests.Server
 {


Refactored linq expression.

Refactored linq expression.

--- FerroJson/JsonSchemaV4/V4Validator.cs
+++ FerroJson/JsonSchemaV4/V4Validator.cs
@@ -16,12 +16,9 @@

         public bool CanValidate(ParseTree jsonSchema)
         {
-            var schemaIdentifier = jsonSchema.Root.ChildNodes.FirstOrDefault(x => x.ChildNodes.Any(y => y.Token.ValueString == "$schema"));
-
-            if (null == schemaIdentifier) return false;
-
-            var schemaIdentifierProperty = schemaIdentifier.ChildNodes.FirstOrDefault(y => y.Token.ValueString != "$schema");
-            return null != schemaIdentifierProperty && schemaIdentifierProperty.Token.ValueString == SchemaIdentifier;
+            //Does this need to be a better check? Right now we only look for the existence of a property value that matches the schema identifier.
+            var schemaIdentifier = jsonSchema.Root.ChildNodes.SelectMany(x => x.ChildNodes).FirstOrDefault(y => y.Token.ValueString == SchemaIdentifier);
+            return null != schemaIdentifier;
         }

         public bool Validate(ParseTree jsonDoc, ParseTree jsonSchema)


Final commit

Final commit

--- HelloWorld/HelloWorld/Program.cs
+++ HelloWorld/HelloWorld/Program.cs
@@ -8,10 +8,11 @@
 {
     class Program
     {
+        //Add comment make unbuildable...
+        haaaah
+
         static void Main(string[] args)
         {
-            Console.WriteLine("Enzo is great!");
-            Console.WriteLine("Paul is great!");
             Console.WriteLine("Hello World");
         }
     }


game-manager: fix brothersDiedAction

game-manager: fix brothersDiedAction

--- Unity/ludum-dare-32-PixelStuff/Assets/Scripts/GameManager.cs
+++ Unity/ludum-dare-32-PixelStuff/Assets/Scripts/GameManager.cs
@@ -44,8 +44,9 @@
 	void Start(){
 		if (brothersManager == null) {
 			brothersManager = GameObject.FindGameObjectWithTag ("Player").GetComponent<BrothersManager> ();
-			brothersManager.brothersDiedAction += BrothersDied;
 		}
+
+		brothersManager.brothersDiedAction += BrothersDied;

 		if (beaversManager == null) {
 			beaversManager = GameObject.FindGameObjectWithTag ("BeaversManager").GetComponent<BeaversManager> ();


* Altered AccessErrorLog so that the temporary VBS script is created in the same folder as the resulting database to ease problems with security permissions in Medium trust.

--- src/Elmah/AccessErrorLog.cs
+++ src/Elmah/AccessErrorLog.cs
@@ -342,9 +342,11 @@

                 //
                 // Create a temporary copy of the mkmdb.vbs script
-                //
-
-                string tempVbsFile = Path.GetTempPath() + ScriptResourceName;
+                // We do this in the same directory as the resulting database for security permission purposes
+                //
+
+                string tempVbsFile = Path.Combine(Path.GetDirectoryName(dbFilePath), ScriptResourceName);
+
                 using (FileStream vbsFileStream = new FileStream(tempVbsFile, FileMode.Create, FileAccess.Write))
                 {
                     ManifestResourceHelper.WriteResourceToStream(vbsFileStream, ScriptResourceName);


Handled an early exit case with an error.

--- ArkeOS.Tools.KohlCompiler/Program.cs
+++ ArkeOS.Tools.KohlCompiler/Program.cs
@@ -7,7 +7,7 @@
         public static void Main(string[] args) {
             var source = "1 * (2 + 3) - 9 * 7 / (4 - -3) + +3 ^ (12 + 3 + (5 % 1) / (6 - -(2 - 3)) * 3)"; //387,420,485

-            source = "4 + 10 - 3 * 4 / 38 % 6 ^ 2";
+            source = "4 + 10 - 3 * 4 / 38 % 6 ^ 2"; //8

             var lexer = new Lexer(source);
             var tokens = lexer.Lex();
@@ -180,7 +180,14 @@

         public Parser(IReadOnlyList<Token> tokens) => (this.tokens, this.length) = (tokens, tokens.Count);

-        public Node Parse() => this.ReadExpression();
+        public Node Parse() {
+            var res = this.ReadExpression();
+
+            if (this.index != this.length)
+                throw new InvalidOperationException("Unexpected end.");
+
+            return res;
+        }

         private Node ReadExpression() {
             if (this.Read(out var token) && token.Type == TokenType.Number) {


Fixed #237

Fixed #237

--- AssetStudio/Classes/AnimationClip.cs
+++ AssetStudio/Classes/AnimationClip.cs
@@ -322,7 +322,7 @@
             int numDoFs = reader.ReadInt32();
             m_DoFArray = reader.ReadSingleArray(numDoFs);

-            if (version[0] >= 5)//5.0 and up
+            if (version[0] > 5 || (version[0] == 5 && version[1] >= 2))//5.2 and up
             {
                 int numTDof = reader.ReadInt32();
                 m_TDoFArray = new object[numTDof];


Added some protection just in case there's no GameMap

--- Assets/CameraScripts/MapSelection.cs
+++ Assets/CameraScripts/MapSelection.cs
@@ -28,7 +28,7 @@
     //Handle mouse dragging here.
     void Update()
     {
-        if (!DFConnection.Connected || !gameMap.enabled) return;
+        if (!DFConnection.Connected || gameMap == null || !gameMap.enabled) return;

         //mouseWorldPosition = GetMouseWorldPosition(Input.mousePosition);

@@ -120,7 +120,7 @@
     // (For now)
     void OnPostRender()
     {
-        if (!DFConnection.Connected || !gameMap.enabled) return;
+        if (!DFConnection.Connected || gameMap == null || !gameMap.enabled) return;
         Ray mouseRay = GetComponent<Camera>().ScreenPointToRay(Input.mousePosition);

         DFCoord currentTarget;


[Update][Script] Drag and Drop

[Update][Script] Drag and Drop

--- Assets/Source/Manager/DragAndDrop.cs
+++ Assets/Source/Manager/DragAndDrop.cs
@@ -2,22 +2,31 @@
 using System.Collections.Generic;
 using UnityEngine;

-/**
- * Attach this script to a GameObject to be able to Drag&Drop him.
- **/
 public class DragAndDrop : MonoBehaviour {

     // Private attributes
     private bool dragging = false;
     private float distance;
+    private GameObject target;
+    private Vector3 screenPosition;
+    private Vector3 offset;

     private void onClick()
     {
+
         // /!\ TODO : Map the correct button here
         if (Input.GetMouseButtonDown(0) == true)
         {
-            this.distance = Vector3.Distance(transform.position, Camera.main.transform.position);
-            this.dragging = true;
+            RaycastHit hitInfo;
+           this.target = ReturnClickedObject(out hitInfo);
+            if (this.target != null)
+            {
+                this.dragging = true;
+
+                //Convert world position to screen position.
+                this.screenPosition = Camera.main.WorldToScreenPoint(this.target.transform.position);
+                this.offset = target.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, this.screenPosition.z));
+            }
         }
     }

@@ -37,15 +46,31 @@

 	// Update is called once per frame
 	void Update () {
-        this.onClick();
-        this.onRelease();
-        if(this.dragging == true)
+         this.onClick();
+         this.onRelease();
+
+        if (this.dragging)
         {
-            // /!\ TODO : Use the transform of the crosshair instead of the mousePosition
-            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
+            //track mouse position.
+            Vector3 currentScreenSpace = new Vector3(Input.mousePosition.x, Input.mousePosition.y, this.screenPosition.z);

-            Vector3 rayPoint = ray.GetPoint(this.distance);
-            transform.position = rayPoint;
-        }
-	}
+            //convert screen position to world position with offset changes.
+            Vector3 currentPosition = Camera.main.ScreenToWorldPoint(currentScreenSpace) + this.offset;
+
+            //It will update target gameobject's current postion.
+            this.target.transform.position = currentPosition;
+        }
+    }
+
+    GameObject ReturnClickedObject(out RaycastHit hit)
+    {
+        GameObject target = null;
+        // /!\ TODO : Use the transform of the crosshair instead of the mousePosition
+        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
+        if (Physics.Raycast(ray.origin, ray.direction * 10, out hit))
+        {
+            target = hit.collider.gameObject;
+        }
+        return target;
+    }
 }


fire via net

fire via net

--- Assets/_Scripts/PlayerNetworkMove.cs
+++ Assets/_Scripts/PlayerNetworkMove.cs
@@ -60,6 +60,7 @@
 			worldMousePosition.z = 10.0f;
 			worldMousePosition = Camera.main.ScreenToWorldPoint(worldMousePosition);
 			Fire (worldMousePosition);
+			CmdFire (worldMousePosition);
 		}
 	}


Last update. Merging states now fixed.

Last update. Merging states now fixed.

--- Assets/new_multiplayer/NewSpawner.cs
+++ Assets/new_multiplayer/NewSpawner.cs
@@ -345,7 +345,9 @@
 					if (mergeGroup.elapsedTime > 1f) {
 						if (mergeGroup.owner != null) {
 							NewGameUnit unit = mergeGroup.owner.gameObject.GetComponent<NewGameUnit>();
-							this.changes = unit.CurrentProperty();;
+							this.changes = unit.CurrentProperty();
+							this.changes.isMerging = false;
+							this.changes.isSelected = false;
 							changes.newLevel = unit.properties.level + 1;
 							unit.NewProperty(changes);
 						}


Mess with footer

Mess with footer

--- AzureMap/Views/Shared/_Layout.cshtml
+++ AzureMap/Views/Shared/_Layout.cshtml
@@ -31,7 +31,7 @@
         @RenderBody()

-
••• © @DateTime.Now.Year •••

+
• © @DateTime.Now.Year •


Additional Dialog pieces - Traffic Manager

Starting to add other dialog pieces. Work in progress. Not sure how I
want the end flow to be yet.

--- messages/CheckerDialog.csx
+++ messages/CheckerDialog.csx
@@ -9,15 +9,11 @@
 [Serializable]
 public class CheckerDialog : IDialog<object>
 {
-    protected bool StartOfChecker;
-
     public Task StartAsync(IDialogContext context)
     {
         try
         {
-            StartOfChecker = true;
             context.Wait(CheckAppServiceType);
-            //context.Wait(MessageReceivedAsync);
         }
         catch (OperationCanceledException error)
         {
@@ -31,6 +27,92 @@
         return Task.CompletedTask;
     }

+    // This is the entry point for the dialog, but I'm not sure if that will stay. Work in progress
+    public async Task CheckAppServiceType(IDialogContext context, IAwaitable<IMessageActivity> argument)
+    {
+        await context.PostAsync("Let's check for the type of App Service you are using.");
+
+        List<String> AppServiceOptions = new List<String>();
+        AppServiceOptions.Add("App Service Environment");
+        AppServiceOptions.Add("Traditional App Service");
+        PromptDialog.Choice(
+            context,
+            AfterAppServiceChoiceAsync,
+            AppServiceOptions,
+            "Is your App Service in an App Service Environment or is it a traditional App Service?",
+            promptStyle: PromptStyle.Auto);
+    }
+
+    public async Task AfterAppServiceChoiceAsync(IDialogContext context, IAwaitable<string> argument)
+    {
+        var message = await argument;
+        if (message == "App Service Environment")
+        {
+            await context.PostAsync("You're using an ASE. Let's continue with that.");
+
+            PromptDialog.Text(
+                context,
+                GetAppServiceEnvironmentName,
+                "What's the name of your App Service Environment?",
+                "Please enter the name of your App Service Environment.");
+        }
+        else
+        {
+            await context.PostAsync("You're using a regular App Service.");
+
+            // Have a similar prompt here to ask for the App Service Name. Need to figure this out better.
+
+            await CheckForTrafficManager(context);
+        }
+
+    }
+
+    public async Task GetAppServiceEnvironmentName(IDialogContext context, IAwaitable<string> argument)
+    {
+        var message = await argument;
+
+        // do some checks on the name. Shouldn't have periods. Can have dashes, letters, and numbers
+
+        // Might want to use a "confirm" prompt here to be sure they entered it right. If not, we'll have to loop back somewhere for them to re-enter the name
+        await context.PostAsync($"The name of your ASE is {message}");
+
+        // Should probably go to "CheckForTrafficManager" next. Need to figure out the best way to do this
+
+        context.Wait(MessageReceivedAsync);
+    }
+
+    /* Need to figure out if I should have one of these for each type, ASE or traditional App Service.
+     * This way I can create a single instance of a class like ASEAppService, TradAppService, ASEAppServiceWithTM, and TradAppServiceWithTM. Still working on that
+     * */
+    public async Task CheckForTrafficManager(IDialogContext context)
+    {
+        await context.PostAsync("Let's check if you are using Traffic Manager.");
+
+        PromptDialog.Confirm(
+                context,
+                AfterCheckForTrafficManager,
+                "Is your App Service an endpoint of a Traffic Manager?",
+                "I'm sorry, I didn't understand that. Are you using Traffic Manager for this App Service?",
+                promptStyle: PromptStyle.Auto);
+    }
+
+    public async Task AfterCheckForTrafficManager(IDialogContext context, IAwaitable<bool> argument)
+    {
+        var confirm = await argument;
+        if (confirm)
+        {
+            await context.PostAsync("Your App Service is an endpoint of a Traffic Manager.");
+            // Insert path to go to after this
+        }
+        else
+        {
+            await context.PostAsync("Your App Service is not an endpoint of a Traffic Manager.");
+            // Insert path to go to after this
+        }
+        context.Wait(MessageReceivedAsync);
+    }
+
+    // This is my default end point for now. Might have to insert this in other parts of the dialog to allow the user to restart after certain steps
     public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> argument)
     {
         var message = await argument;
@@ -50,42 +132,12 @@

         }
     }
-
-    public async Task CheckAppServiceType(IDialogContext context, IAwaitable<IMessageActivity> argument)
-    {
-        List<String> AppServiceOptions = new List<String>();
-        AppServiceOptions.Add("App Service Environment");
-        AppServiceOptions.Add("Traditional App Service");
-        PromptDialog.Choice(
-            context,
-            AfterAppServiceChoiceAsync,
-            AppServiceOptions,
-            "Is your App Service in an App Service Environment or is it a traditional App Service?",
-            promptStyle: PromptStyle.Auto);
-    }
-
-    public async Task AfterAppServiceChoiceAsync(IDialogContext context, IAwaitable<string> argument)
-    {
-        var message = await argument;
-        this.StartOfChecker = false;
-        if (message == "App Service Environment")
-        {
-            await context.PostAsync("You're using an ASE. Let's continue with that.");
-        }
-        else
-        {
-            await context.PostAsync("You're using a regular App Service.");
-        }
-        context.Wait(MessageReceivedAsync);
-    }
-

     public async Task AfterRestartAsync(IDialogContext context, IAwaitable<bool> argument)
     {
         var confirm = await argument;
         if (confirm)
         {
-            this.StartOfChecker = true;
             await context.PostAsync("Let's restart.");
             await CheckAppServiceType(context, null);
         }


Kill autogenerated doc strings

Kill autogenerated doc strings

--- IntegrationTests/BuiltinTests.cs
+++ IntegrationTests/BuiltinTests.cs
@@ -5,23 +5,11 @@

     using NUnit.Framework;

-    /// <summary>
-    /// The builtin tests.
-    /// </summary>
     [TestFixture]
     public class BuiltinTests
     {
         #region Public Methods and Operators

-        /// <summary>
-        /// The add.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(+)", "0")]
         [TestCase("(+ 1)", "1")]
         [TestCase("(+ 1 2)", "3")]
@@ -35,15 +23,6 @@
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The apply.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(apply + nil)", "0")]
         [TestCase("(apply + '(1))", "1")]
         [TestCase("(apply + 1 '(2))", "3")]
@@ -54,15 +33,6 @@
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The atom.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(atom nil)", "T")]
         [TestCase("(atom 'x)", "T")]
         [TestCase("(atom 1)", "T")]
@@ -75,15 +45,6 @@
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The car.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(car nil)", "NIL")]
         [TestCase("(car '(a))", "A")]
         [TestCase("(car '((1 2) 3))", "(1 2)")]
@@ -92,15 +53,6 @@
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The cdr.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(cdr nil)", "NIL")]
         [TestCase("(cdr (cons 1 2))", "2")]
         [TestCase("(cdr '(1 2))", "(2)")]
@@ -111,15 +63,6 @@
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The cons.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(cons 1 2)", "(1 . 2)")]
         [TestCase("(cons 1 nil)", "(1)")]
         [TestCase("(cons nil 2)", "(NIL . 2)")]
@@ -132,15 +75,6 @@
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The consp.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(consp nil)", "NIL")]
         [TestCase("(consp 1)", "NIL")]
         [TestCase("(consp (lambda () t))", "NIL")]
@@ -150,15 +84,6 @@
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The eq.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(eq nil nil)", "T")]
         [TestCase("(eq t t)", "T")]
         [TestCase("(eq nil t)", "NIL")]
@@ -177,15 +102,6 @@
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The eval.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(eval nil)", "NIL")]
         [TestCase("(eval t)", "T")]
         [TestCase("(eval '(+ 1 2))", "3")]
@@ -194,30 +110,12 @@
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The eval.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(define x 2) (eval 'x)", "X", "2")]
         public void Eval(string input, params string[] output)
         {
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The subtract.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
-        /// <param name="output">
-        /// The output.
-        /// </param>
         [TestCase("(- 1)", "-1")]
         [TestCase("(- 4000000000)", "-4000000000")]
         [TestCase("(- 6 3 2 1)", "0")]
@@ -228,12 +126,6 @@
             new IntegrationTest().Test(input, output);
         }

-        /// <summary>
-        /// The wiggle.
-        /// </summary>
-        /// <param name="input">
-        /// The input.
-        /// </param>
         [TestCase("1")]
         [TestCase("0.0625")]
         public void Wiggle(string input)


fix tabs not working on account details page due to malformed html

--- JabbR/Views/Account/index.cshtml
+++ JabbR/Views/Account/index.cshtml
@@ -54,7 +54,7 @@
                         }

-

+

                             <form class="form-horizontal">
                                 <fieldset>
                                     <legend>@LanguageResources.Administration_GeneralSettings</legend>


Fix loader pushing children screens before it is displayed itself

--- osu.Game/Screens/Loader.cs
+++ osu.Game/Screens/Loader.cs
@@ -5,11 +5,14 @@
 using osu.Framework.Graphics;
 using osu.Game.Screens.Menu;
 using OpenTK;
+using osu.Framework.Screens;

 namespace osu.Game.Screens
 {
     public class Loader : OsuScreen
     {
+        private bool showDisclaimer;
+
         public override bool ShowOverlays => false;

         public Loader()
@@ -21,21 +24,40 @@
         {
             base.LogoArriving(logo, resuming);

-            logo.RelativePositionAxes = Axes.Both;
+            logo.RelativePositionAxes = Axes.None;
             logo.Triangles = false;
-            logo.Position = new Vector2(0.9f);
+            logo.Origin = Anchor.BottomRight;
+            logo.Anchor = Anchor.BottomRight;
+            logo.Position = new Vector2(-40);
             logo.Scale = new Vector2(0.2f);

             logo.FadeInFromZero(5000, Easing.OutQuint);
         }

-        [BackgroundDependencyLoader]
-        private void load(OsuGameBase game)
+        protected override void OnEntering(Screen last)
         {
-            if (game.IsDeployedBuild)
+            base.OnEntering(last);
+
+            if (showDisclaimer)
                 LoadComponentAsync(new Disclaimer(), d => Push(d));
             else
                 LoadComponentAsync(new Intro(), d => Push(d));
         }
+
+        protected override void LogoSuspending(OsuLogo logo)
+        {
+            base.LogoSuspending(logo);
+            logo.FadeOut(100).OnComplete(l =>
+            {
+                l.Anchor = Anchor.TopLeft;
+                l.Origin = Anchor.Centre;
+            });
+        }
+
+        [BackgroundDependencyLoader]
+        private void load(OsuGameBase game)
+        {
+            showDisclaimer = game.IsDeployedBuild;
+        }
     }
 }


Minor changes to aminoacidpolymer copy constructor

--- CSMSL/Proteomics/AminoAcidPolymer.cs
+++ CSMSL/Proteomics/AminoAcidPolymer.cs
@@ -88,6 +88,9 @@

         public AminoAcidPolymer(AminoAcidPolymer aminoAcidPolymer, int firstResidue, int length, bool includeModifications = true)
         {
+            if (firstResidue < 0 || firstResidue > aminoAcidPolymer.Length)
+                throw new IndexOutOfRangeException(string.Format("The first residue index is outside the valid range [{0}-{1}]", 0, aminoAcidPolymer.Length));
+
             if (length + firstResidue > aminoAcidPolymer.Length)
                 length = aminoAcidPolymer.Length - firstResidue;
             _aminoAcids = new IAminoAcid[length];