1.0.1

--- src/GlobalAssemblyInfo.cs
+++ src/GlobalAssemblyInfo.cs
@@ -10,8 +10,8 @@
 [assembly: AssemblyCulture("")]
 [assembly: ComVisible(false)]
 [assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0")]
-[assembly: AssemblyInformationalVersion("1.0.0")]
+[assembly: AssemblyFileVersion("1.0.1")]
+[assembly: AssemblyInformationalVersion("1.0.1")]

 #if ASSEMBLYSIGNED
 [assembly:


updated to version 1.5.7

updated to version 1.5.7

--- src/GlobalAssemblyInfo.cs
+++ src/GlobalAssemblyInfo.cs
@@ -27,4 +27,4 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:

-[ assembly : AssemblyVersion( "1.5.6.0" ) ]+[ assembly : AssemblyVersion( "1.5.7.0" ) ]


Add support for BG3 int/int64/float const casting

--- LSLib/LS/Story/Compiler/Compiler.cs
+++ LSLib/LS/Story/Compiler/Compiler.cs
@@ -28,6 +28,14 @@
         {
             if (param.Type.IntrinsicTypeId != value.Type.IntrinsicTypeId)
             {
+                // BG3 allows promoting integer constants to float
+                if (Game == TargetGame.BG3 && value is IRConstant
+                    && (param.Type.IntrinsicTypeId == Value.Type.Float || param.Type.IntrinsicTypeId == Value.Type.Integer64)
+                    && value.Type.IntrinsicTypeId == Value.Type.Integer)
+                {
+                    return;
+                }
+
                 object paramName = (param.Name != null) ? (object)param.Name : paramIndex;
                 Context.Log.Error(value.Location,
                     DiagnosticCode.LocalTypeMismatch,


Basic calculator - fixed

Basic calculator - fixed

--- LeetCode/remote/basic_calculator.cs
+++ LeetCode/remote/basic_calculator.cs
@@ -11,6 +11,16 @@
 using System.Text;

 public class Solution {
+    //
+    //  Submission Details
+    //  37 / 37 test cases passed.
+    //      Status: Accepted
+    //      Runtime: 184 ms
+    //
+    //          Submitted: 0 minutes ago
+    //
+    //          https://leetcode.com/submissions/detail/49069534/
+    //
     public int Calculate(string s) {
         var operands = new Stack<int>();
         var operators = new Stack<String>();
@@ -18,28 +28,34 @@
         {
             switch (token)
             {
-                case "(" :
+                case "(" : operators.Push(token); break;
                 case "+" :
-                case "-" : operators.Push(token); break;
-                case ")" : Evaluate(operators, operands); break;
+                case "-" : Evaluate(operators, operands, token);
+                           operators.Push(token);
+                           break;
+                case ")" : Evaluate(operators, operands, token); break;
                 default : operands.Push(int.Parse(token));
-                          Evaluate(operators, operands);
                           break;
             }
         }

         while (operators.Count != 0)
         {
-            Evaluate(operators, operands);
+            Evaluate(operators, operands, String.Empty);
         }

         return operands.Pop();
     }

-    public void Evaluate(Stack<String> operators, Stack<int> operands)
+    public void Evaluate(Stack<String> operators, Stack<int> operands, String current)
     {
         while (operators.Count != 0)
         {
+            if (current != ")" && operators.Peek() == "(")
+            {
+                return;
+            }
+
             var op = operators.Pop();
             if (op == "(")
             {
@@ -94,5 +110,6 @@
         Console.WriteLine(s.Calculate(" 2-1 + 2 "));
         Console.WriteLine(s.Calculate("(1+(4+5+2)-3)+(6+8)"));
         Console.WriteLine(s.Calculate("(1+(4+5+2)-3)+(6+89)"));
+        Console.WriteLine(s.Calculate("2-4-(8+2-6+(8+4-(1)+8-10))"));
     }
 }


Task 11 updated (random email added)

Task 11 updated (random email added)

--- Lesson2/LiteCart/LiteCart/Task11.cs
+++ Lesson2/LiteCart/LiteCart/Task11.cs
@@ -44,7 +44,8 @@
             var province = wait.Until(ExpectedConditions.ElementToBeClickable(By.CssSelector("select[name=zone_code]")));
             new SelectElement(province).SelectByText("Ontario");

-            driver.FindElement(By.Name("email")).SendKeys("john.smith.canada@gmail.com");
+            string email = "john.smith.canada" + new Random().Next(1000).ToString() + "@gmail.com";
+            driver.FindElement(By.Name("email")).SendKeys(email);
             driver.FindElement(By.Name("phone")).SendKeys("+15198000808");
             driver.FindElement(By.Name("password")).SendKeys("11111");
             driver.FindElement(By.Name("confirmed_password")).SendKeys("11111");
@@ -54,7 +55,7 @@
             wait.Until(ExpectedConditions.ElementExists(By.CssSelector("div#box-account li:last-child > a[href*=logout]"))).Click();

             IWebElement loginform = wait.Until(ExpectedConditions.ElementExists(By.CssSelector("div#box-account-login")));
-            loginform.FindElement(By.Name("email")).SendKeys("john.smith.canada@gmail.com");
+            loginform.FindElement(By.Name("email")).SendKeys(email);
             loginform.FindElement(By.Name("password")).SendKeys("11111");
             loginform.FindElement(By.Name("login")).Click();


Test reflog writing when HEAD is detached

--- LibGit2Sharp.Tests/ReflogFixture.cs
+++ LibGit2Sharp.Tests/ReflogFixture.cs
@@ -102,5 +102,36 @@
                 Assert.Equal(string.Format("commit (initial): {0}", commitMessage), repo.Refs.Log("HEAD").First().Message);
             }
         }
+
+        [Fact]
+        public void CommitOnDetachedHeadShouldInsertReflogEntry()
+        {
+            string repoPath = CloneStandardTestRepo();
+
+            using (var repo = new Repository(repoPath))
+            {
+                Assert.False(repo.Info.IsHeadDetached);
+
+                var parentCommit = repo.Head.Tip.Parents.First();
+                repo.Checkout(parentCommit.Sha);
+                Assert.True(repo.Info.IsHeadDetached);
+
+                const string relativeFilepath = "new.txt";
+                string filePath = Path.Combine(repo.Info.WorkingDirectory, relativeFilepath);
+
+                File.WriteAllText(filePath, "content\n");
+                repo.Index.Stage(relativeFilepath);
+
+                var author = DummySignature;
+                const string commitMessage = "Commit on detached head";
+                var commit = repo.Commit(commitMessage, author, author);
+
+                // Assert a reflog entry is created on HEAD
+                var reflogEntry = repo.Refs.Log("HEAD").First();
+                Assert.Equal(author, reflogEntry.Commiter);
+                Assert.Equal(commit.Id, reflogEntry.To);
+                Assert.Equal(string.Format("commit: {0}", commitMessage), repo.Refs.Log("HEAD").First().Message);
+            }
+        }
     }
 }


fix calculated Superblock fields

fix calculated Superblock fields

--- Library/DiscUtils.Xfs/SuperBlock.cs
+++ Library/DiscUtils.Xfs/SuperBlock.cs
@@ -408,13 +408,12 @@
                 ProjectQuotaInode = Utilities.ToUInt64BigEndian(buffer, offset + 0x18);
                 Lsn = Utilities.ToInt64BigEndian(buffer, offset + 0x20);
                 MetaUuid = Utilities.ToGuidBigEndian(buffer, offset + 0x28);
-
-                var agOffset = AgBlocksLog2 + InodesPerBlockLog2;
-                RelativeInodeMask = 0xffffffff >> (32 - agOffset);
-                AgInodeMask = ~RelativeInodeMask;
-
-                DirBlockSize = Blocksize << DirBlockLog2;
             }
+            var agOffset = AgBlocksLog2 + InodesPerBlockLog2;
+            RelativeInodeMask = 0xffffffff >> (32 - agOffset);
+            AgInodeMask = ~RelativeInodeMask;
+
+            DirBlockSize = Blocksize << DirBlockLog2;
             return Size;
         }


Precisions on GUI about coastal filtering.

--- src/TabTerrain.cs
+++ src/TabTerrain.cs
@@ -198,11 +198,12 @@
              * Coastal rotation
              */
             var filterCoastalRotation = _gameData.UserData.CoastalRotation.Use;
-            ListingStandard.CheckboxLabeled("Use Coastal Rotation", ref filterCoastalRotation);
+            ListingStandard.CheckboxLabeled("Use Coastal Rotation", ref filterCoastalRotation,
+                "Allow to search for coastal tiles which have a coast facing a specific direction.");
             _gameData.UserData.CoastalRotation.Use = filterCoastalRotation;

             // "Select" button
-            if (ListingStandard.ButtonText("Select Rotation"))
+            if (ListingStandard.ButtonText("Select Coast Rotation"))
             {
                 var floatMenuOptions = new List<FloatMenuOption>();

@@ -237,7 +238,7 @@
             var rightLabel = _gameData.UserData.CoastalRotation.Use /*&& _gameData.UserData.CoastalRotation.Selected != Rot4.Invalid*/
                 ? ("HasCoast" + _gameData.UserData.CoastalRotation.Selected).Translate().CapitalizeFirst()
                 : "None";
-            ListingStandard.LabelDouble("Coast Rotation:", rightLabel);
+            ListingStandard.LabelDouble("Selected Coast Rotation:", rightLabel);
         }

         protected void DrawElevationSelection()


Added extra aliases for weight names.

Added extra aliases for weight names.


Run as network service

Run as network service

--- src/Lighthouse/Program.cs
+++ src/Lighthouse/Program.cs
@@ -30,8 +30,8 @@
                 x.SetServiceName("Lighthouse");
                 x.SetDisplayName("Lighthouse Service Discovery");
                 x.SetDescription("Lighthouse Service Discovery for Akka.NET Clusters");
-
-                x.RunAsLocalSystem();
+
+                x.RunAsNetworkService();
                 x.StartAutomatically();
                 x.UseNLog();
                 x.EnableServiceRecovery(r => r.RestartService(1));


Update Player.cs

Update Player.cs

--- src/MiNET/MiNET/Player.cs
+++ src/MiNET/MiNET/Player.cs
@@ -180,7 +180,7 @@
 			// no sensible default for MiNET.
 		}

-		protected Form CurrentForm = null;
+		protected Form CurrentForm { get; set; } = null;

 		public void HandleMcpeModalFormResponse(McpeModalFormResponse message)
 		{


NETCLIENT-3: make blob response handling RFC 6266 compliant

--- src/NuxeoClient/Client.cs
+++ src/NuxeoClient/Client.cs
@@ -631,7 +631,8 @@
                 else
                 {
                     FileInfo tmpFile = IOHelper.CreateTempFile(result);
-                    entity = new Blob(response.Content.Headers.ContentDisposition.FileName).SetFile(tmpFile);
+                    entity = new Blob(response.Content.Headers.ContentDisposition.FileNameStar ??
+                                      response.Content.Headers.ContentDisposition.FileName).SetFile(tmpFile);
                 }
             }
             else if (response.Content.IsMimeMultipartContent())


Change logging of cocos2d to CocosSharp, more

--- cocos2d/sprite_nodes/CCAnimationCache.cs
+++ cocos2d/sprite_nodes/CCAnimationCache.cs
@@ -141,7 +141,7 @@
                 if (frameNames == null)
                 {
                     CCLog.Log(
-                        "cocos2d: CCAnimationCache: Animation '{0}' found in dictionary without any frames - cannot add to animation cache.",
+                        "CocosSharp: CCAnimationCache: Animation '{0}' found in dictionary without any frames - cannot add to animation cache.",
                         pElement.Key);
                     continue;
                 }
@@ -168,14 +168,14 @@
                 if (frames.Count == 0)
                 {
                     CCLog.Log(
-                        "cocos2d: CCAnimationCache: None of the frames for animation '{0}' were found in the CCSpriteFrameCache. Animation is not being added to the Animation Cache.",
+                        "CocosSharp: CCAnimationCache: None of the frames for animation '{0}' were found in the CCSpriteFrameCache. Animation is not being added to the Animation Cache.",
                         pElement.Key);
                     continue;
                 }
                 else if (frames.Count != frameNames.Count)
                 {
                     CCLog.Log(
-                        "cocos2d: CCAnimationCache: An animation in your dictionary refers to a frame which is not in the CCSpriteFrameCache. Some or all of the frames for the animation '{0}' may be missing.",
+                        "CocosSharp: CCAnimationCache: An animation in your dictionary refers to a frame which is not in the CCSpriteFrameCache. Some or all of the frames for the animation '{0}' may be missing.",
                         pElement.Key);
                 }

@@ -202,7 +202,7 @@
                 if (frameArray == null)
                 {
                     CCLog.Log(
-                        "cocos2d: CCAnimationCache: Animation '{0}' found in dictionary without any frames - cannot add to animation cache.",
+                        "CocosSharp: CCAnimationCache: Animation '{0}' found in dictionary without any frames - cannot add to animation cache.",
                         name);
                     continue;
                 }


Allow setting the levels explicitely

Allow setting the levels explicitely

...and some other cleanup.

--- code/R3/R3.Core/Drawing/TextureHelper.cs
+++ code/R3/R3.Core/Drawing/TextureHelper.cs
@@ -4,14 +4,17 @@
 	using R3.Math;
 	using System.Collections.Generic;
 	using System.Diagnostics;
-	using System.Linq;
 	using Math = System.Math;

 	public class TextureHelper
 	{
 		public TextureHelper()
 		{
-			int levels = 3;
+			SetLevels( 3 );
+		}
+
+		public static void SetLevels( int levels )
+		{
 			m_maxSubdivisions = (int)Math.Pow( 2, levels );
 		}

@@ -50,31 +53,6 @@

 			points.Add( seg1.P2 );
 			return points.ToArray();
-		}
-
-		private static Vector3D[] CalcPointsUsingRecursion( int level, Vector3D p1, Vector3D p2, Vector3D p3, Geometry g )
-		{
-			List<Vector3D> result = new List<Vector3D>();
-			result.Add( p1 );
-			result.Add( p2 );
-			result.Add( p3 );
-
-			if( level >= 3 )
-				return result.ToArray();
-
-			level++;
-
-			int divisions = 2;
-			Vector3D[] list1 = SubdivideSegmentInGeometry( p1, p2, divisions, g );
-			Vector3D[] list2 = SubdivideSegmentInGeometry( p2, p3, divisions, g );
-			Vector3D[] list3 = SubdivideSegmentInGeometry( p3, p1, divisions, g );
-
-			result.AddRange( CalcPointsUsingRecursion( level, list1[0], list1[1], list3[1], g ) );
-			result.AddRange( CalcPointsUsingRecursion( level, list1[1], list1[2], list2[1], g ) );
-			result.AddRange( CalcPointsUsingRecursion( level, list1[1], list2[1], list3[1], g ) );
-			result.AddRange( CalcPointsUsingRecursion( level, list2[1], list2[2], list3[1], g ) );
-
-			return result.Distinct().ToArray();
 		}

 		private static Vector3D[] CalcViaProjections( Vector3D p1, Vector3D p2, Vector3D p3, int divisions, Geometry g )
@@ -146,9 +124,10 @@

 		/////////////////////////////////////////////////////////////////

+
+
 		/// <summary>
 		/// Helper to generate a set of texture coordinates.
-		/// ZZZ - make this a non-euclidean calc?
 		/// </summary>
 		public static Vector3D[] TextureCoords( Polygon poly, Geometry g, bool doGeodesicDome = false )
 		{
@@ -163,24 +142,7 @@
 			bool doGeodesicSaddles = doGeodesicDome;
 			if( 3 == poly.Segments.Count && doGeodesicSaddles )
 			{
-				Vector3D[] t1 = CalcPointsUsingTwoSegments( poly.Segments[0], poly.Segments[1], divisions, g );
-				Vector3D[] t2 = CalcPointsUsingTwoSegments( poly.Segments[1], poly.Segments[2], divisions, g );
-				Vector3D[] t3 = CalcPointsUsingTwoSegments( poly.Segments[2], poly.Segments[0], divisions, g );
-
-				Vector3D[] r = CalcPointsUsingRecursion( 0, poly.Segments[0].P1, poly.Segments[1].P1, poly.Segments[2].P1, g );
-				Vector3D[] proj = CalcViaProjections( poly.Segments[0].P1, poly.Segments[1].P1, poly.Segments[2].P1, divisions, g );
-
-				foreach( Vector3D v1 in t1 )
-				{
-					Vector3D v2 = FindClosestPoint( v1, t2 );
-					Vector3D v3 = FindClosestPoint( v1, t3 );
-					Vector3D add = ( v1 + v2 + v3 ) / 3;
-					//Vector3D add = FindClosestPoint( v1, r );
-					//Vector3D add = v1;
-					points.Add( add );
-				}
-
-				return proj;
+				return CalcViaProjections( poly.Segments[0].P1, poly.Segments[1].P1, poly.Segments[2].P1, divisions, g );
 			}
 			else
 			{


Move feature ideas to GitHub issue tracker

--- ChatRelay/Program.cs
+++ ChatRelay/Program.cs
@@ -51,25 +51,3 @@
         }
     }
 }
-
-// TODO: The adapters use a Connect() Disconnect() naming convention,
-// but right now they don't support reconnecting as Disconnect() is treated as more of a Dispose.
-// Should probably change the naming structure or code layout to fix this. Maybe Connect/Open and Dispose?
-// Alternatively, actually support disconnecting and reconnecting though more error handling is required.
-
-// TODO: Relay emotes.
-
-// TODO: Bot commands.
-// Request that the bot tell you who is in the room in another service (reply via DM).
-// Request information on the other services, mainly URL.
-// Tell you how many people are on the other services (status?).
-
-// TODO: Test on Mono.
-
-// TODO: Logging. Would be good to basically have two log providers, rotating file on disk and console output.
-// Ex, replace Console.WriteLine calls with logging calls.
-
-// TODO: Connection monitoring. Heartbeat? IRC has Ping/Pong.
-
-// TODO: Really think through error handling and resiliency in terms of disconnects/reconnects.
-// May have to look for an alternative to the Slack API library we're using as it doesn't handling things like this well.


Increase version to 2.4.2

Increase version to 2.4.2

--- src/Properties/Version.cs
+++ src/Properties/Version.cs
@@ -25,5 +25,5 @@
 //      Revision
 //
 [assembly: AssemblyVersion("2.1.0")]
-[assembly: AssemblyFileVersion("2.4.1")]
-[assembly: AssemblyInformationalVersion("2.4.1")]
+[assembly: AssemblyFileVersion("2.4.2")]
+[assembly: AssemblyInformationalVersion("2.4.2")]


Minor text update to description

Minor text update to description

--- Dinero.Tools.Difference/Dinero.Tools.Difference.Web/Views/Shared/_Layout.cshtml
+++ Dinero.Tools.Difference/Dinero.Tools.Difference.Web/Views/Shared/_Layout.cshtml
@@ -11,7 +11,7 @@

     <title>@ViewBag.Title</title>

-    <meta name="description" content="Find differencen ved bankafstemning i Dinero.dk.">
+    <meta name="description" content="Få hjælp til at finde differencen og derved de manglende bilag ved bankafstemning i Dinero.dk.">
     <meta name="keywords" content="Dinero,Dinero.dk,bankafstemning,Hjælp,Tool,Værktøj">
     <meta name="author" content="Mads Laumann">
     <link rel="icon" type="image/x-icon" href="/img/favicon.ico">


minor

minor

--- InfrastructureAsCode.Powershell/Commands/Development/AddIaCEnableSideLoading.cs
+++ InfrastructureAsCode.Powershell/Commands/Development/AddIaCEnableSideLoading.cs
@@ -1,18 +1,12 @@
-using System;
-using System.Collections.Generic;
+using InfrastructureAsCode.Core.Extensions;
+using InfrastructureAsCode.Powershell.CmdLets;
+using Microsoft.SharePoint.Client;
+using System;
 using System.Linq;
 using System.Management.Automation;
-using System.Text;
-using System.Threading.Tasks;

 namespace InfrastructureAsCode.Powershell.Commands.Development
 {
-    using InfrastructureAsCode.Powershell.CmdLets;
-    using OfficeDevPnP.Core.AppModelExtensions;
-    using OfficeDevPnP.Core.Extensions;
-    using OfficeDevPnP.Core.Utilities;
-    using Microsoft.SharePoint.Client;
-
     /// <summary>
     /// Enables Development Site Collection capabilities to deploy add-ins
     /// </summary>
@@ -26,11 +20,11 @@
         {
             base.ExecuteCmdlet();

-            LogVerbose("Enables SharePoint app sideLoading");

             var sideLoadingGuid = OfficeDevPnP.Core.Constants.FeatureId_Site_AppSideLoading;
-            var siteurl = this.ClientContext.Url;
-            var outfilepath = siteurl.Replace(':', '_').Replace('/', '_');
+            var siteurl = this.ClientContext.Url.EnsureTrailingSlashLowered();
+            LogVerbose($"Enables SharePoint app sideLoading for {siteurl}");
+

             try
             {


Ticked version to 2.1.2

Ticked version to 2.1.2

--- src/SharedAssemblyInfo.cs
+++ src/SharedAssemblyInfo.cs
@@ -4,7 +4,7 @@

 [assembly: AssemblyProduct("Rainbow")]
 [assembly: ComVisible(false)]
-[assembly: AssemblyVersion("2.1.1.0")]
-[assembly: AssemblyFileVersion("2.1.1.0")]
-[assembly: AssemblyInformationalVersion("2.1.1")]
+[assembly: AssemblyVersion("2.1.2.0")]
+[assembly: AssemblyFileVersion("2.1.2.0")]
+[assembly: AssemblyInformationalVersion("2.1.2")]
 [assembly: CLSCompliant(false)]


various fixes to the EditorPage.cs

various fixes to the EditorPage.cs

svn path=/trunk/; revision=4389

--- src/Widgets/EditorPage.cs
+++ src/Widgets/EditorPage.cs
@@ -65,9 +65,10 @@

 		public EditorPageWidget () {
 			editors = new List<Editor> ();
+			editor_buttons = new Dictionary<Editor, Button> ();
+			ShowTools ();
 			AddinManager.AddExtensionNodeHandler ("/FSpot/Editors", OnExtensionChanged);

-			ShowTools ();
 		}

 		private void OnExtensionChanged (object s, ExtensionNodeEventArgs args) {
@@ -78,6 +79,7 @@
 				editor.ProcessingStep += OnProcessingStep;
 				editor.ProcessingFinished += OnProcessingFinished;
 				editors.Add (editor);
+				PackButton (editor);
 			}
 		}

@@ -102,11 +104,20 @@
 		internal void ChangeButtonVisibility () {
 			foreach (Editor editor in editors) {
 				Button button;
-				editor_buttons.TryGetValue (editor, out button);
-
-				bool visible = Page.InPhotoView || editor.CanHandleMultiple;
-				button.Visible = visible;
-			}
+				if (editor_buttons.TryGetValue (editor, out button))
+					button.Visible = Page.InPhotoView || editor.CanHandleMultiple;
+			}
+		}
+
+		void PackButton (Editor editor)
+		{
+			Button button = new Button (editor.Label);
+			if (editor.IconName != null)
+				button.Image = new Image (GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, editor.IconName, 22, (Gtk.IconLookupFlags)0));
+			button.Clicked += delegate (object o, EventArgs e) { ChooseEditor (editor); };
+			button.Show ();
+			buttons.Add (button);
+			editor_buttons.Add (editor, button);
 		}

 		public void ShowTools () {
@@ -141,17 +152,8 @@
 			buttons.Spacing = 5;
 			buttons.LayoutStyle = ButtonBoxStyle.Start;

-			editor_buttons = new Dictionary<Editor, Button> ();
-			foreach (Editor editor in editors) {
-				// Build sidebar button and add it to the sidebar.
-				Editor current = editor;
-				Button button = new Button (editor.Label);
-				button.Image = new Image (GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, editor.IconName, 22, (Gtk.IconLookupFlags)0));
-				button.Clicked += delegate (object o, EventArgs e) { ChooseEditor (current); };
-				button.Show ();
-				buttons.Add (button);
-				editor_buttons.Add (editor, button);
-			}
+			foreach (Editor editor in editors)
+				PackButton (editor);

 			buttons.Show ();
 			widgets.Add (buttons);


Rerouting check also considers any

Rerouting check also considers any

--- redshift-tray/Common.cs
+++ redshift-tray/Common.cs
@@ -74,7 +74,7 @@
           returnValue.Errortext = string.Format("Location provider is not reachable.{0}Please make sure that your internet connection works properly and try again in a few minutes.", Environment.NewLine);
           return returnValue;
         }
-        if(IPAddress.IsLoopback(pingReply.Address))
+        if(IPAddress.IsLoopback(pingReply.Address) || pingReply.Address.Equals(IPAddress.Any))
         {
           Main.WriteLogMessage("API is routed to localhost.", DebugConsole.LogType.Error);
           returnValue.Success = false;


Enforce .gma file extension.

Enforce .gma file extension.

--- src/addoncreator/Addon.cs
+++ src/addoncreator/Addon.cs
@@ -161,7 +161,13 @@
         /// <param name="path">The output file path, should be pointing to a writable location ending with ".gma".</param>
         public void Export(string path)
         {
-            // TODO: Enforce .gma file extension
+            // Enforce .gma extension
+            if (!path.EndsWith(".gma", StringComparison.OrdinalIgnoreCase))
+            {
+                var pathSplit = path.Split('.');
+                pathSplit[pathSplit.Length - 1] = "gma";
+                path = string.Join(".", pathSplit);
+            }

             // Checking for existing addon.json
             if (!Files.ContainsKey("addon.json"))
@@ -306,6 +312,4 @@
             Version = 1;
         }
     }
-
-    // TODO: Newtonsoft.Json reference
 }


Added overload for VerifyApiConnection

Added overload for VerifyApiConnection

--- Src/FcsClient.cs
+++ Src/FcsClient.cs
@@ -303,6 +303,10 @@
             return this.ServiceClient.Get(domains, headers, null);
         }

+        public bool VerifyApiConnection() {
+            return this.VerifyApiConnection(new VerifyApiConnectRequest());
+        }
+
         public bool VerifyApiConnection(VerifyApiConnectRequest verifyApiConnect) {
             this.Auth();
             var headers = this.GetHeaders();


forgot one namespace

forgot one namespace

--- TaskUtilities.cs
+++ TaskUtilities.cs
@@ -27,8 +27,8 @@
 using Tomboy;
 using System.Collections.Generic;

-namespace Tomboy.TaskManager
-{
+namespace Tomboy.TaskManager {
+
 	public enum Priority {
 		VERY_LOW = 1,
 		LOW,


force 1080p on the embeded screencast

force 1080p on the embeded screencast

--- Web/index.cshtml
+++ Web/index.cshtml
@@ -36,6 +36,6 @@

Boxstarter, The Movie

-
+


chore :Ajout des commentaires

chore :Ajout des commentaires

--- api-core.net/src/api-core.net/Daos/QuizDao.cs
+++ api-core.net/src/api-core.net/Daos/QuizDao.cs
@@ -7,20 +7,37 @@

 namespace api_core.net.Daos
 {
+    /**
+  * Dialogue Applicaiton / Base de données pour la classe Quiz
+  **/
     public class QuizDao
     {
+        // On récupère la connexion à la base
         private BaseDao baseDao = BaseDao.Instance;

+        /**
+         * Trouver un quiz existant
+         *
+         * @param id : l'ID du quiz à trouver
+         * @return un objet Quiz
+         **/
         public Quiz GetQuiz(ObjectId id)
         {
+            // On récupère dans la base le quiz correspondant à l'ID avec un filtre
             var filter = Builders<Quiz>.Filter.Eq(q => q.Id, id);
+            // On retourne l'objet quiz trouvé
             return baseDao.db.GetCollection<Quiz>("Quiz").Find(filter).First();
         }
-
+        /**
+       * Trouver tous les quiz existants
+       *
+       * @return Une liste d'objet Quiz
+       **/
         public IEnumerable<BaseQuiz> GetAllQuiz()
         {
+            // On récupère tous les quiz
             var projection = Builders<Quiz>.Projection.Exclude("questions");
-
+            // Pour chacun des quiz on le "transforme" en BaseQuiz, c'est-à-dire, sans les questions
             IEnumerable<Quiz> list = baseDao.db.GetCollection<Quiz>("Quiz").Find(_ => true).ToList();

             IEnumerable<BaseQuiz> baseList = from quiz in list
@@ -32,19 +49,32 @@
                                                  Title = quiz.Title
                                              };

+            // On retourne la liste
             return baseList;
         }
-
+        /**
+         * Créer un quiz
+         *
+         * @param quiz : un objet Quiz
+         **/
         public async Task Create(Quiz quiz)
         {
+            // On insert directement l'objet dans la base
             await baseDao.db.GetCollection<Quiz>("Quiz").InsertOneAsync(quiz);
         }
-
+        /**
+        * Mise à jour d'un quiz existant
+        *
+        * @param id : l'ID du quiz à éditer
+        * @param quiz : les nouvelles valeurs à attribuer
+        **/
         public async Task Update(ObjectId id, Quiz quiz)
         {
+            // On assigne au quizl'id reçu
             quiz.Id = id;
-
+            // On récupère dans la base le quiz correspondant à l'ID avec un filtre
             var filter = Builders<Quiz>.Filter.Eq(p => p.Id, id);
+            // On remplace l'objet présent par le nouveau
             await baseDao.db.GetCollection<Quiz>("Quiz").ReplaceOneAsync(filter, quiz);
         }
     }


Partial fix for bug 742: Double clicking on Event in PI for the second time does not navigate to code behind in an IronPython application.

This fixes a problem in VS2012 where double-clicking on an event handler would generate multiple copies of the event handler, if the event handler didn't follow a certain naming convention. This fix removes the naming convention assumption, and uses the parameter count to recognize compatible event handler functions.

--- Release/Product/Python/PythonTools/PythonTools/Designer/WpfEventBindingProvider.cs
+++ Release/Product/Python/PythonTools/PythonTools/Designer/WpfEventBindingProvider.cs
@@ -14,6 +14,7 @@

 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Text;
 using Microsoft.PythonTools.Analysis;
 using Microsoft.PythonTools.Parsing.Ast;
@@ -150,10 +151,18 @@
             SuiteStatement suite = classDef.Body as SuiteStatement;

             if (suite != null) {
+                int requiredParamCount = eventDescription.Parameters.Count() + 1;
                 foreach (var methodCandidate in suite.Statements) {
                     FunctionDefinition funcDef = methodCandidate as FunctionDefinition;
                     if (funcDef != null) {
-                        if (funcDef.Name.EndsWith("_" + eventDescription.Name)) {
+                        // Given that event handlers can be given any arbitrary
+                        // name, it is important to not rely on the default naming
+                        // to detect compatible methods.  Instead we look at the
+                        // event parameters. We don't have param types in Python,
+                        // so really the only thing that can be done is look at
+                        // the method parameter count, which should be one more than
+                        // the event parameter count (to account for the self param).
+                        if (funcDef.Parameters.Count == requiredParamCount) {
                             yield return funcDef.Name;
                         }
                     }


provision a blank powerapp

provision a blank powerapp

--- Source/Actions/Microsoft.Deployment.Actions.AzureCustom/PowerApp/DeployPowerApp.cs
+++ Source/Actions/Microsoft.Deployment.Actions.AzureCustom/PowerApp/DeployPowerApp.cs
@@ -1,6 +1,8 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.ComponentModel.Composition;
 using System.Net.Http;
+using System.Text;
 using System.Threading.Tasks;

 using Newtonsoft.Json.Linq;
@@ -14,8 +16,11 @@
     [Export(typeof(IAction))]
     public class DeployPowerApp : BaseAction
     {
-        private string BASE_POWER_APPS_URL = "https://management.azure.com/providers/Microsoft.PowerApps";
-        private string CREATE_POWER_APPS_URL = "https://create.powerapps.com/v2.0.610.0/api";
+        private const string BASE_POWER_APPS_URL = "https://management.azure.com/providers/Microsoft.PowerApps";
+        private const string CREATE_POWER_APPS_URL = "https://create.powerapps.com/v2.0.610.0/api";
+        private const string POWER_APP_GUID_CHARACTERS = "0123456789abcdef";
+
+        private readonly int[] POWER_APP_GUID_LENGTHS = { 8, 4, 4, 4, 12 };

         public override async Task<ActionResponse> ExecuteActionAsync(ActionRequest request)
         {
@@ -23,6 +28,7 @@

             AzureHttpClient client = new AzureHttpClient(azureToken);

+            string applicationId = GetNewPowerAppGuid();
             string applicationName = "TwitterTemplate" + RandomGenerator.GetDateStamp();
             string environmentId = request.DataStore.GetValue("PowerAppEnvironment");
             string objectId = JsonUtility.GetWebToken(azureToken, "oid");
@@ -42,16 +48,31 @@
             await clientPA.ExecuteGenericRequestWithHeaderAsync(HttpMethod.Post, $"{CREATE_POWER_APPS_URL}/authoringsession/newinstance?requestedLocation=unitedstates", string.Empty);
             await clientPA.ExecuteGenericRequestWithHeaderAsync(HttpMethod.Get, $"{CREATE_POWER_APPS_URL}/document/util/createdocumentandloadcontext?apptype=0&locale=en-US", string.Empty);
             await clientPA.ExecuteGenericRequestWithHeaderAsync(HttpMethod.Get, $"{CREATE_POWER_APPS_URL}/document/2/getpublishinfo", string.Empty);
-
-            string applicationId = (await clientPA.ExecuteGenericRequestWithHeaderAndReadAsync(HttpMethod.Get, $"{CREATE_POWER_APPS_URL}/document/2/propertiesgetappid?appname=App", string.Empty)).Trim('"');
-
             await clientPA.ExecuteGenericRequestWithHeaderAsync(HttpMethod.Post, $"{CREATE_POWER_APPS_URL}/document/2/setpublishinfo", $"{{\"applicationName\":\"{applicationName}\",\"backgroundColorString\":\"RGBA(0,176,240,1)\",\"logoFile\":{{\"_path\":\"default_icon.png\"}},\"logoFileName\":\"default_icon.png\",\"publishDataLocally\":false,\"publishResourcesLocally\":false,\"publishTarget\":null}}");
             await clientPA.ExecuteGenericRequestWithHeaderAsync(HttpMethod.Post, $"{CREATE_POWER_APPS_URL}/document/2/publishtoblobasync", $"{{\"blobURI\":\"{sharedAccessSignature}\",\"docName\":\"{applicationName}\",\"documentSienaUri\":\"/document.msapp\",\"logoSmallUri\":\"/logoSmallFile\"}}");
-
-            var response = await clientPA.ExecuteGenericRequestWithHeaderAsync(HttpMethod.Post, $"{BASE_POWER_APPS_URL}/apps?api-version=2016-11-01", $"{{\"properties\":{{\"appUris\":{{\"documentUri\":{{\"value\":\"{documentUri}\"}},\"description\":\"\",\"backgroundColor\":\"RGBA(0,176,240,1)\",\"minClientVersion\":{{\"major\":2,\"minor\":0,\"build\":610,\"majorRevision\":0,\"minorRevision\":0,\"revision\":0}},\"createdByClientVersion\":{{\"major\":2,\"minor\":0,\"build\":610,\"majorRevision\":0,\"minorRevision\":0,\"revision\":0}},\"backgroundImageUri\":\"{backgroundImageUri}\",\"displayName\":\"{applicationName}\",\"environment\":{{\"id\":\"/providers/Microsoft.PowerApps/environments/{environmentId}\",\"name\":\"{environmentId}\"}}}},\"tags\":{{\"sienaVersion\":\"687bdfbb-4a77-8384-ecba-80840af4d06a\",\"deviceCapabilities\":\"\",\"supportsPortrait\":\"false\",\"supportsLandscape\":\"true\",\"primaryFormFactor\":\"Tablet\",\"primaryDeviceWidth\":\"1366\",\"primaryDeviceHeight\":\"768\",\"publisherVersion\":\"2.0.610\",\"minimumRequiredApiVersion\":\"2.1.0\"}},\"name\":\"{applicationId}\"}}");
-            var responseString = await response.Content.ReadAsStringAsync();
+            await clientPA.ExecuteGenericRequestWithHeaderAsync(HttpMethod.Post, $"{BASE_POWER_APPS_URL}/apps?api-version=2016-11-01", $"{{\"properties\":{{\"appUris\":{{\"documentUri\":{{\"value\":\"{documentUri}\"}}}},\"description\":\"\",\"backgroundColor\":\"RGBA(0,176,240,1)\",\"minClientVersion\":{{\"major\":2,\"minor\":0,\"build\":610,\"majorRevision\":0,\"minorRevision\":0,\"revision\":0}},\"createdByClientVersion\":{{\"major\":2,\"minor\":0,\"build\":610,\"majorRevision\":0,\"minorRevision\":0,\"revision\":0}},\"backgroundImageUri\":\"{backgroundImageUri}\",\"displayName\":\"{applicationName}\",\"environment\":{{\"id\":\"/providers/Microsoft.PowerApps/environments/{environmentId}\",\"name\":\"{environmentId}\"}}}},\"tags\":{{\"sienaVersion\":\"{GetNewPowerAppGuid()}\",\"deviceCapabilities\":\"\",\"supportsPortrait\":\"false\",\"supportsLandscape\":\"true\",\"primaryFormFactor\":\"Tablet\",\"primaryDeviceWidth\":\"1366\",\"primaryDeviceHeight\":\"768\",\"publisherVersion\":\"2.0.610\",\"minimumRequiredApiVersion\":\"2.1.0\"}},\"name\":\"{applicationId}\"}}");

             return new ActionResponse(ActionStatus.Success, JsonUtility.GetEmptyJObject());
         }
+
+        private string GetNewPowerAppGuid()
+        {
+            Random randy = new Random();
+            StringBuilder sb = new StringBuilder();
+
+            for (int i = 0; i < POWER_APP_GUID_LENGTHS.Length; i++)
+            {
+                for (int j = 0; j < POWER_APP_GUID_LENGTHS[i]; j++)
+                {
+                    sb.Append(POWER_APP_GUID_CHARACTERS[randy.Next(POWER_APP_GUID_CHARACTERS.Length)]);
+                }
+                if (i < POWER_APP_GUID_LENGTHS.Length - 1)
+                {
+                    sb.Append('-');
+                }
+            }
+
+            return sb.ToString();
+        }
     }
 }


Actually invoking the reply callback's when we dispatch.

The only huge problem we have with this is that if a reply never comes back
then we've leaked a value because the entry in the dictionary will never
get removed. Not sure the best way to handle this, some kind of timeout
or something? I don't think NSB even takes are of that scenario.

--- Source/Extensions/Machine.MassTransitExtensions/LowerLevelMessageBus/MessageBus.cs
+++ Source/Extensions/Machine.MassTransitExtensions/LowerLevelMessageBus/MessageBus.cs
@@ -121,6 +121,10 @@
         TransportMessage transportMessage = (TransportMessage)obj;
         using (CurrentMessageContext currentMessageContext = CurrentMessageContext.Open(transportMessage))
         {
+          if (transportMessage.CorrelationId != Guid.Empty)
+          {
+            _asyncCallbackMap.InvokeAndRemove(transportMessage.CorrelationId);
+          }
           ICollection<IMessage> messages = _transportMessageBodySerializer.Deserialize(transportMessage.Body);
           foreach (IMessage message in messages)
           {
@@ -227,14 +231,16 @@

     public void InvokeAndRemove(Guid id)
     {
+      MessageBusAsyncResult ar;
       lock (_map)
       {
-        MessageBusAsyncResult ar;
-        if (_map.TryGetValue(id, out ar))
+        if (!_map.TryGetValue(id, out ar))
         {
-          ar.Complete();
+          return;
         }
-      }
+        _map.Remove(id);
+      }
+      ar.Complete();
     }
   }
 }


Fixed PostgreSQL operation for assigning existing database

--- Source/Tools/ConfigurationSetupUtility/Screens/PostgresDatabaseSetupScreen.xaml.cs
+++ Source/Tools/ConfigurationSetupUtility/Screens/PostgresDatabaseSetupScreen.xaml.cs
@@ -5,10 +5,10 @@
 //
 //  Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
 //  the NOTICE file distributed with this work for additional information regarding copyright ownership.
-//  The GPA licenses this file to you under the Eclipse Public License -v 1.0 (the "License"); you may
+//  The GPA licenses this file to you under the MIT License (MIT), the "License"; you may
 //  not use this file except in compliance with the License. You may obtain a copy of the License at:
 //
-//      http://www.opensource.org/licenses/eclipse-1.0.php
+//      http://opensource.org/licenses/MIT
 //
 //  Unless agreed to in writing, the subject software distributed under the License is distributed on an
 //  "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
@@ -158,20 +158,6 @@
                     return false;
                 }

-                if (string.IsNullOrEmpty(m_roleNameTextBox.Text))
-                {
-                    MessageBox.Show("Please enter a valid name for the role to grant permissions to.");
-                    m_roleNameTextBox.Focus();
-                    return false;
-                }
-
-                if (m_rolePasswordTextBox.SecurePassword.Length == 0)
-                {
-                    MessageBox.Show("Please enter a valid password for the role to grant permissions to.");
-                    m_rolePasswordTextBox.Focus();
-                    return false;
-                }
-
                 bool existing = Convert.ToBoolean(m_state["existing"]);
                 bool migrate = existing && Convert.ToBoolean(m_state["updateConfiguration"]);

@@ -201,6 +187,22 @@
                     finally
                     {
                         connection?.Dispose();
+                    }
+                }
+                else
+                {
+                    if (string.IsNullOrEmpty(m_roleNameTextBox.Text))
+                    {
+                        MessageBox.Show("Please enter a valid name for the role to grant permissions to.");
+                        m_roleNameTextBox.Focus();
+                        return false;
+                    }
+
+                    if (m_rolePasswordTextBox.SecurePassword.Length == 0)
+                    {
+                        MessageBox.Show("Please enter a valid password for the role to grant permissions to.");
+                        m_rolePasswordTextBox.Focus();
+                        return false;
                     }
                 }


Build system doesn't have a default profile to use so removing the check in the test

--- Tools/LambdaTestTool/tests/Amazon.Lambda.TestTool.Tests.Shared/NoUiStartupTests.cs
+++ Tools/LambdaTestTool/tests/Amazon.Lambda.TestTool.Tests.Shared/NoUiStartupTests.cs
@@ -70,7 +70,6 @@

             TestToolStartup.Startup("Unit Tests", null, new string[] { "--path", buildPath, "--no-ui", "--payload", "\"hello WORLD\"" }, runConfiguration);
             Assert.Contains("HELLO WORLD", runConfiguration.OutputWriter.ToString());
-            Assert.Contains("Setting AWS_PROFILE environment variable to default.", runConfiguration.OutputWriter.ToString());
             Assert.Contains("Setting AWS_REGION environment variable to us-west-2.", runConfiguration.OutputWriter.ToString());
         }


Dummy Commit

Dummy Commit

--- Server/src/SERVERAPI/Utility/ChemicalBalanceMessage.cs
+++ Server/src/SERVERAPI/Utility/ChemicalBalanceMessage.cs
@@ -156,7 +156,7 @@
                 chemicalBalances.balance_CropK2O += Convert.ToInt16(m.potassium);
             }

-            if (crps.Count > 0) //display balance messages when at least one crop has been added
+            if (crps.Count > 0) //display balance messages when at least one Crop has been added
                 displayBalances = true;

             return chemicalBalances;


allow nulls in ColumnDescriptionFactory.OverrideIsAllowed

--- Signum.Engine/DynamicQuery/ColumnDescriptionFactory.cs
+++ Signum.Engine/DynamicQuery/ColumnDescriptionFactory.cs
@@ -13,7 +13,7 @@
     {
         readonly internal Meta? Meta;
         public Func<string>? OverrideDisplayName { get; set; }
-        public Func<string>? OverrideIsAllowed { get; set; }
+        public Func<string?>? OverrideIsAllowed { get; set; }

         public string Name { get; internal set; }
         public Type Type { get; internal set; }


1127: remove unused parameter

1127: remove unused parameter

--- a_mini/projects/PixelFarm/PixelFarm.Typography/3_FontFaceImpl/TextureFontLoader.cs
+++ a_mini/projects/PixelFarm/PixelFarm.Typography/3_FontFaceImpl/TextureFontLoader.cs
@@ -33,13 +33,12 @@
             {
                 var reader = new OpenFontReader();
                 Typeface typeface = reader.Read(fs);
-                return LoadFont(typeface, fontfile, creationParams, out fontAtlas);
+                return LoadFont(typeface, creationParams, out fontAtlas);
             }
         }

         public static FontFace LoadFont(
             Typeface typeface,
-            string fontFile,
             TextureFontCreationParams creationParams,
             out SimpleFontAtlas fontAtlas)
         {
@@ -389,11 +388,11 @@
                 //create glyph img
                 ActualImage img = new Agg.ActualImage(w, h, PixelFormat.ARGB32);
                 ImageGraphics2D imgCanvas2d = new Agg.ImageGraphics2D(img);
-                AggCanvasPainter painter = new Agg.AggCanvasPainter(imgCanvas2d);
+                AggCanvasPainter painter = new Agg.AggCanvasPainter(imgCanvas2d);
                 //we use white glyph on black bg for this texture
                 painter.Clear(Color.Black); //fill with black
                 painter.FillColor = Color.White;
-                painter.StrokeColor = Color.White;
+                painter.StrokeColor = Color.White;
                 //--------------------------------------------

                 painter.UseSubPixelRendering = true;


Remove foo() method

Remove foo() method

--- test/MathParser.Tests/InfixToPostfixConverterTest.cs
+++ test/MathParser.Tests/InfixToPostfixConverterTest.cs
@@ -50,10 +50,5 @@

             result.Should().Be("3 4 2 * 1 5 - 2 3 ^ ^ / +");
         }
-
-        private string Foo()
-        {
-            return "Bar";
-        }
     }
 }


[red] Document behavior for exception in call filter and description

--- tests/FakeItEasy.Specs/UserCallbackExceptionSpecs.cs
+++ tests/FakeItEasy.Specs/UserCallbackExceptionSpecs.cs
@@ -172,6 +172,72 @@
                 .x(() => exception.InnerException.Should().BeAnExceptionOfType<MyException>().Which.Message.Should().Be("Oops"));
         }

+        [Scenario]
+        public void ExceptionInWherePredicate(IFoo fake, Exception exception)
+        {
+            "Given a fake"
+                .x(() => fake = A.Fake<IFoo>());
+
+            "And calls configured on this fake with a call filter predicate that throws an exception"
+                .x(() => A.CallTo(fake).Where(call => ThrowException()).DoesNothing());
+
+            "When a call to any method of the fake is made"
+                .x(() => exception = Record.Exception(() => fake.Bar(0)));
+
+            "Then a UserCallbackException should be thrown"
+                .x(() => exception.Should().BeAnExceptionOfType<UserCallbackException>());
+
+            "And its message should describe where the exception was thrown from"
+                .x(() => exception.Message.Should().Be("Call filter <call => ThrowException()> threw an exception. See inner exception for details."));
+
+            "And the inner exception should be the original exception"
+                .x(() => exception.InnerException.Should().BeAnExceptionOfType<MyException>().Which.Message.Should().Be("Oops"));
+        }
+
+        [Scenario]
+        public void ExceptionInWhereDescription(IFoo fake, Exception exception)
+        {
+            "Given a fake"
+                .x(() => fake = A.Fake<IFoo>());
+
+            "And no call to the fake is made"
+                .x(() => { });
+
+            "When an assertion is made with a call filter whose description throws an exception"
+                .x(() => exception = Record.Exception(() => A.CallTo(fake).Where(call => true, o => o.Write(ThrowException())).MustHaveHappened()));
+
+            "Then a UserCallbackException should be thrown"
+                .x(() => exception.Should().BeAnExceptionOfType<UserCallbackException>());
+
+            "And its message should describe where the exception was thrown from"
+                .x(() => exception.Message.Should().Be("Call filter description threw an exception. See inner exception for details."));
+
+            "And the inner exception should be the original exception"
+                .x(() => exception.InnerException.Should().BeAnExceptionOfType<MyException>().Which.Message.Should().Be("Oops"));
+        }
+
+        [Scenario]
+        public void ExceptionInWherePredicateAndInDescription(IFoo fake, Exception exception)
+        {
+            "Given a fake"
+                .x(() => fake = A.Fake<IFoo>());
+
+            "And calls configured on this fake with a call filter predicate that throws an exception and whose description also throws an exception"
+                .x(() => A.CallTo(fake).Where(call => ThrowException(), o => o.Write(ThrowException())).DoesNothing());
+
+            "When a call to any method of the fake is made"
+                .x(() => exception = Record.Exception(() => fake.Bar(0)));
+
+            "Then a UserCallbackException should be thrown"
+                .x(() => exception.Should().BeAnExceptionOfType<UserCallbackException>());
+
+            "And its message should describe where the exception was thrown from"
+                .x(() => exception.Message.Should().Be("Call filter description threw an exception. See inner exception for details."));
+
+            "And the inner exception should be the original exception"
+                .x(() => exception.InnerException.Should().BeAnExceptionOfType<MyException>().Which.Message.Should().Be("Oops"));
+        }
+
         private static bool ThrowException()
         {
             throw new MyException("Oops");


Update tests for CCRepeat and CCPlace to not use Copy() for the Repeat, RepeatForever and CCPlace tests.

--- tests/tests/classes/tests/ActionsTest/ActionsTest.cs
+++ tests/tests/classes/tests/ActionsTest/ActionsTest.cs
@@ -21,7 +21,7 @@
         ACTION_BLINK_LAYER,
         ACTION_FADE_LAYER,
         ACTION_TINT_LAYER,
-        ACTION_ANIMATE_LAYER,
+		//ACTION_ANIMATE_LAYER,
         ACTION_SEQUENCE_LAYER,
         ACTION_SEQUENCE2_LAYER,
         ACTION_SPAWN_LAYER,
@@ -108,9 +108,9 @@
                 case (int) ActionTest.ACTION_TINT_LAYER:
                     pLayer = new ActionTint();
                     break;
-                case (int) ActionTest.ACTION_ANIMATE_LAYER:
-                    pLayer = new ActionAnimate();
-                    break;
+//                case (int) ActionTest.ACTION_ANIMATE_LAYER:
+//                    pLayer = new ActionAnimate();
+//                    break;
                 case (int) ActionTest.ACTION_SEQUENCE_LAYER:
                     pLayer = new ActionSequence();
                     break;
@@ -1147,9 +1147,9 @@

             var act1 = new CCRotateTo (1, 90);
             var act2 = new CCRotateTo (1, 0);
-            var seq = (new CCSequence(act1, act2));
-            var rep1 = new CCRepeatForever ((CCActionInterval)seq);
-            var rep2 = new CCRepeat ((CCFiniteTimeAction)(seq.Copy()), 10);
+            var seq = new CCSequence(act1, act2);
+            var rep1 = new CCRepeatForever (seq);
+            var rep2 = new CCRepeat (seq, 10);

             m_tamara.RunAction(rep1);
             m_kathia.RunAction(rep2);
@@ -1296,11 +1296,11 @@
                 new CCSequence(new CCPlace(new CCPoint(60, 60)), a1),
                 3);
             var action2 = new CCRepeatForever (
-                (new CCSequence((CCActionInterval) (a1.Copy()), a1.Reverse()))
+                (new CCSequence(a1, a1.Reverse()))
                 );

             m_kathia.RunAction(action1);
-            m_tamara.RunAction(action2);
+			m_tamara.RunAction(action2);
         }

         public override string subtitle()


Fix formatting and baseaddress const

Fix formatting and baseaddress const

--- webapi-odata-testing-example.Tests/SimpleGetTests.cs
+++ webapi-odata-testing-example.Tests/SimpleGetTests.cs
@@ -17,8 +17,7 @@
     [TestClass]
     public class SimpleGetTests
     {
-        //private const string BaseAddress = "http://localhost:19001/";
-        private const string BaseAddress = "http://DCLLEN5QA-2:19001/";
+        private const string BaseAddress = "http://localhost:19001/";

         private static Fixture Fixture
         {
@@ -64,7 +63,6 @@
             var service = new Mock<ICarService>();
             service.Setup( m => m.Find( It.IsAny<int>() ) ).ReturnsAsync( Fixture.Create<Car>() );

-            // Bind our mock with Ninject
             var kernel = new StandardKernel();
             kernel.Bind<ICarService>().ToConstant( service.Object );
             var container = new ExampleContainer( new Uri( BaseAddress ) );
@@ -87,33 +85,30 @@
         {
             // Arrange
             var service = new Mock<ICarService>();
-            service.Setup(m => m.Find(It.IsAny<int>())).ReturnsAsync( null );
+            service.Setup( m => m.Find( It.IsAny<int>() ) ).ReturnsAsync( null );

-            // Bind our mock with Ninject
             var kernel = new StandardKernel();
-            kernel.Bind<ICarService>().ToConstant(service.Object);
-            var container = new ExampleContainer(new Uri(BaseAddress));
+            kernel.Bind<ICarService>().ToConstant( service.Object );
+            var container = new ExampleContainer( new Uri( BaseAddress ) );

-            using (WebApp.Start(BaseAddress, app => TestHelpers.ConfigureWebApi(app, kernel))
+            using ( WebApp.Start( BaseAddress, app => TestHelpers.ConfigureWebApi( app, kernel ) )
                     )
             {
                 // Act
                 try
                 {
-                    container.Cars.ByKey(50).GetValue();
+                    container.Cars.ByKey( 50 ).GetValue();
                 }
                 catch ( DataServiceQueryException exception )
                 {
                     // Assert
-                    Assert.IsNotNull(exception.InnerException);
-                    Assert.IsInstanceOfType( exception.InnerException, typeof(DataServiceClientException)  );
-                    Assert.AreEqual( 404, ((DataServiceClientException)exception.InnerException).StatusCode);
+                    Assert.IsNotNull( exception.InnerException );
+                    Assert.IsInstanceOfType( exception.InnerException, typeof (DataServiceClientException) );
+                    Assert.AreEqual( 404, ( (DataServiceClientException) exception.InnerException ).StatusCode );
                     return;
                 }
-
-                Assert.Fail("Exception not caught.");

-
+                Assert.Fail( "Exception not caught." );
             }
         }
     }


Vendors and shipping addresses were not filtered to ignore inactive.

--- Purchasing.Web/Controllers/OrderController.cs
+++ Purchasing.Web/Controllers/OrderController.cs
@@ -1142,8 +1142,8 @@
                 Workgroup = workgroup,
                 Units = _repositoryFactory.UnitOfMeasureRepository.Queryable.Cache().ToList(),
                 Accounts = _repositoryFactory.WorkgroupAccountRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id).Select(x => x.Account).ToFuture(),
-                Vendors = _repositoryFactory.WorkgroupVendorRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id).ToFuture(),
-                Addresses = _repositoryFactory.WorkgroupAddressRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id).ToFuture(),
+                Vendors = _repositoryFactory.WorkgroupVendorRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id && x.IsActive).ToFuture(),
+                Addresses = _repositoryFactory.WorkgroupAddressRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id && x.IsActive).ToFuture(),
                 ShippingTypes = _repositoryFactory.ShippingTypeRepository.Queryable.Cache().ToList(),
                 Approvers = _repositoryFactory.WorkgroupPermissionRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id && x.Role.Id == Role.Codes.Approver).Select(x => x.User).ToFuture(),
                 AccountManagers = _repositoryFactory.WorkgroupPermissionRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id && x.Role.Id == Role.Codes.AccountManager).Select(x => x.User).ToFuture(),


Initialize Reverse Proxy in constructor

Initialize Reverse Proxy in constructor

--- Quasar.Server/Messages/ReverseProxyHandler.cs
+++ Quasar.Server/Messages/ReverseProxyHandler.cs
@@ -17,7 +17,7 @@
         /// <summary>
         /// The reverse proxy server to accept & serve SOCKS5 connections.
         /// </summary>
-        private ReverseProxyServer _socksServer;
+        private readonly ReverseProxyServer _socksServer;

         /// <summary>
         /// Initializes a new instance of the <see cref="ReverseProxyHandler"/> class using the given clients.
@@ -25,6 +25,7 @@
         /// <param name="clients">The associated clients.</param>
         public ReverseProxyHandler(Client[] clients) : base(true)
         {
+            _socksServer = new ReverseProxyServer();
             _clients = clients;
         }

@@ -59,7 +60,6 @@
         /// <param name="port">The port to listen on.</param>
         public void StartReverseProxyServer(ushort port)
         {
-            _socksServer = new ReverseProxyServer();
             _socksServer.OnConnectionEstablished += socksServer_onConnectionEstablished;
             _socksServer.OnUpdateConnection += socksServer_onUpdateConnection;
             _socksServer.StartServer(_clients, "0.0.0.0", port);


commenting out the line of code that acctually writes messages on the connection is bad, mmmmkkk?

--- ROS#/EricIsAMAZING/TransportSubscriberLink.cs
+++ ROS#/EricIsAMAZING/TransportSubscriberLink.cs
@@ -159,15 +159,15 @@
                     m = outbox.Dequeue();
                 }
             }
-            /*if (m != null)
+            if (m != null)
             {
                 byte[] M = m.Serialize();
-                string s = m.type.ToString() + ":\t";
+                /*string s = m.type.ToString() + ":\t";
                 for (int i = 0; i < M.Length; i++)
                     s += (M[i] < 16 ? "0" : "") + M[i].ToString("x") + " ";
-                Console.WriteLine(s);
+                Console.WriteLine(s);*/
                 connection.write(M, M.Length, onMessageWritten, immediate_write);
-            }*/
+            }
         }
     }
 }


Fix wrong send method in SendMessageCommand

--- moisture-bot/MoistureBot.Commands/SendMessageCommand.cs
+++ moisture-bot/MoistureBot.Commands/SendMessageCommand.cs
@@ -69,7 +69,7 @@

 			if (room) {
 				Console.WriteLine ("Sending chat message to room '{0}'...", id);
-				bot.SendChatMessage (message, id);
+				bot.SendChatRoomMessage (message, id);
 			}

 			return false;


Remove contracts

Remove contracts

--- ResXManager.Model/ResourceEntityExtensions.cs
+++ ResXManager.Model/ResourceEntityExtensions.cs
@@ -2,7 +2,6 @@
 {
     using System;
     using System.Collections.Generic;
-    using System.Diagnostics.Contracts;
     using System.Globalization;
     using System.Linq;

@@ -29,9 +28,6 @@
         [ItemNotNull]
         public static IList<IList<string>> ToTable([NotNull][ItemNotNull] this ICollection<ResourceTableEntry> entries)
         {
-            Contract.Requires(entries != null);
-            Contract.Ensures(Contract.Result<IList<IList<string>>>() != null);
-
             var languages = entries.SelectMany(e => e.Container.Languages)
                 .Select(l => l.CultureKey)
                 .Distinct()
@@ -46,8 +42,6 @@
         [CanBeNull]
         private static IEnumerable<string> GetTableLanguageColumnHeaders([NotNull] this CultureKey cultureKey)
         {
-            Contract.Requires(cultureKey != null);
-
             var cultureName = cultureKey.ToString();

             yield return CommentHeaderPrefix + cultureName;
@@ -58,8 +52,6 @@
         [CanBeNull]
         private static IEnumerable<string> GetTableDataColumns([NotNull] this ResourceTableEntry entry, [CanBeNull] CultureKey cultureKey)
         {
-            Contract.Requires(entry != null);
-
             yield return entry.Comments.GetValue(cultureKey);
             yield return entry.Values.GetValue(cultureKey);
         }
@@ -72,9 +64,6 @@
         [NotNull, ItemNotNull]
         private static IEnumerable<IList<string>> GetTableHeaderLines([NotNull, ItemNotNull] this IEnumerable<CultureKey> languages)
         {
-            Contract.Requires(languages != null);
-            Contract.Ensures(Contract.Result<IEnumerable<IList<string>>>() != null);
-
             var languageColumns = languages.SelectMany(l => l.GetTableLanguageColumnHeaders());

             yield return _fixedColumnHeaders.Concat(languageColumns).ToArray();
@@ -90,10 +79,6 @@
         [ItemNotNull]
         private static IEnumerable<IList<string>> GetTableDataLines([NotNull][ItemNotNull] this IEnumerable<ResourceTableEntry> entries, [NotNull][ItemNotNull] IEnumerable<CultureKey> languages)
         {
-            Contract.Requires(entries != null);
-            Contract.Requires(languages != null);
-            Contract.Ensures(Contract.Result<IEnumerable<IList<string>>>() != null);
-
             return entries.Select(entry => entry.GetTableLine(languages).ToArray());
         }

@@ -109,19 +94,12 @@
         [ItemNotNull]
         private static IEnumerable<string> GetTableLine([NotNull] this ResourceTableEntry entry, [NotNull][ItemNotNull] IEnumerable<CultureKey> languages)
         {
-            Contract.Requires(entry != null);
-            Contract.Requires(languages != null);
-            Contract.Ensures(Contract.Result<IEnumerable<string>>() != null);
-
             return new[] { entry.Key }.Concat(languages.SelectMany(entry.GetTableDataColumns));
         }

         [NotNull]
         private static string GetLanguageName([NotNull] string dataColumnHeader)
         {
-            Contract.Requires(dataColumnHeader != null);
-            Contract.Ensures(Contract.Result<string>() != null);
-
             var languageName = dataColumnHeader.StartsWith(CommentHeaderPrefix, StringComparison.OrdinalIgnoreCase)
                 ? dataColumnHeader.Substring(CommentHeaderPrefix.Length) : dataColumnHeader;
             return languageName;
@@ -130,32 +108,23 @@
         [CanBeNull]
         private static CultureInfo ExtractCulture([NotNull] this string dataColumnHeader)
         {
-            Contract.Requires(dataColumnHeader != null);
-
             return GetLanguageName(dataColumnHeader).ToCulture();
         }

         [CanBeNull]
         private static CultureKey ExtractCultureKey([NotNull] this string dataColumnHeader)
         {
-            Contract.Requires(dataColumnHeader != null);
-
             return GetLanguageName(dataColumnHeader).ToCultureKey();
         }

         private static ColumnKind GetColumnKind([NotNull] this string dataColumnHeader)
         {
-            Contract.Requires(dataColumnHeader != null);
-
             return dataColumnHeader.StartsWith(CommentHeaderPrefix, StringComparison.OrdinalIgnoreCase) ? ColumnKind.Comment : ColumnKind.Text;
         }

         [CanBeNull]
         private static string GetEntryData([NotNull] this ResourceTableEntry entry, [NotNull] CultureKey culture, ColumnKind columnKind)
         {
-            Contract.Requires(entry != null);
-            Contract.Requires(culture != null);
-
             var snapshot = entry.Snapshot;

             if (snapshot != null)
@@ -191,8 +160,6 @@

         private static bool SetEntryData([NotNull] this ResourceTableEntry entry, [CanBeNull] CultureInfo culture, ColumnKind columnKind, [CanBeNull] string text)
         {
-            Contract.Requires(entry != null);
-
             if (!entry.CanEdit(culture))
                 return false;

@@ -216,23 +183,16 @@
         /// <param name="table">The text.</param>
         public static void ImportTable([NotNull] this ResourceEntity entity, [NotNull][ItemNotNull] IList<IList<string>> table)
         {
-            Contract.Requires(entity != null);
-            Contract.Requires(table != null);
-
             entity.ImportTable(_fixedColumnHeaders, table).Apply();
         }

         public static bool Apply([NotNull] this EntryChange change)
         {
-            Contract.Requires(change != null);
-
             return change.Entry.SetEntryData(change.Culture, change.ColumnKind, change.Text);
         }

         public static void Apply([NotNull][ItemNotNull] this ICollection<EntryChange> changes)
         {
-            Contract.Requires(changes != null);
-
             var acceptedChanges = changes
                 .TakeWhile(change => change.Apply())
                 .ToArray();
@@ -247,11 +207,6 @@
         [ItemNotNull]
         public static ICollection<EntryChange> ImportTable([NotNull] this ResourceEntity entity, [NotNull][ItemNotNull] ICollection<string> fixedColumnHeaders, [NotNull][ItemNotNull] IList<IList<string>> table)
         {
-            Contract.Requires(entity != null);
-            Contract.Requires(fixedColumnHeaders != null);
-            Contract.Requires(table != null);
-            Contract.Ensures(Contract.Result<ICollection<EntryChange>>() != null);
-
             if (!table.Any())
                 return new EntryChange[0];

@@ -299,14 +254,7 @@
         [ItemNotNull]
         private static IList<string> GetHeaderColumns([NotNull][ItemNotNull] ICollection<IList<string>> table, [NotNull][ItemNotNull] ICollection<string> fixedColumnHeaders)
         {
-            Contract.Requires(table != null);
-            Contract.Requires(table.Count > 0);
-            Contract.Requires(fixedColumnHeaders != null);
-            Contract.Ensures(Contract.Result<IList<string>>() != null);
-            Contract.Ensures(table.Count() == Contract.OldValue(table.Count()));
-
             var headerColumns = table.First();
-            Contract.Assume(headerColumns != null);

             var fixedColumnHeadersCount = fixedColumnHeaders.Count;

@@ -322,13 +270,10 @@
         [System.Diagnostics.Contracts.Pure]
         public static bool HasValidTableHeaderRow([NotNull, ItemNotNull] this IList<IList<string>> table)
         {
-            Contract.Requires(table != null);
-
             if (table.Count == 0)
                 return false;

             var headerColumns = table.First();
-            Contract.Assume(headerColumns != null);

             if (headerColumns.Count < 2)
                 return false;
@@ -346,9 +291,6 @@

         private static void VerifyCultures([NotNull] ResourceEntity entity, [NotNull][ItemNotNull] IEnumerable<CultureInfo> languages)
         {
-            Contract.Requires(entity != null);
-            Contract.Requires(languages != null);
-
             var undefinedLanguages = languages.Where(outer => entity.Languages.All(inner => !Equals(outer, inner.Culture))).ToArray();

             var lockedLanguage = undefinedLanguages.FirstOrDefault(language => !entity.CanEdit(language));


Fix creation of a dir for transformed images

--- RestImageResize.EpiServer/VirtualFileStore.cs
+++ RestImageResize.EpiServer/VirtualFileStore.cs
@@ -43,7 +43,7 @@

             if (!Directory.Exists(_storePath))
             {
-                Directory.CreateDirectory(storePath);
+                Directory.CreateDirectory(_storePath);
             }
         }


[mscorlib] Equality comparers fixes

[mscorlib] Equality comparers fixes

--- mscorlib/system/collections/generic/equalitycomparer.cs
+++ mscorlib/system/collections/generic/equalitycomparer.cs
@@ -73,7 +73,7 @@
                 RuntimeType u = (RuntimeType)t.GetGenericArguments()[0];
                 if (typeof(IEquatable<>).MakeGenericType(u).IsAssignableFrom(u)) {
 #if MONO
-                    return (EqualityComparer<T>)RuntimeType.CreateInstanceForAnotherGenericParameter (typeof(NullableEqualityComparer<>), t);
+                    return (EqualityComparer<T>)RuntimeType.CreateInstanceForAnotherGenericParameter (typeof(NullableEqualityComparer<>), u);
 #else
                     return (EqualityComparer<T>)RuntimeTypeHandle.CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(NullableEqualityComparer<int>), u);
 #endif
@@ -423,7 +423,6 @@
         }
     }

-#if MOBILE
     [Serializable]
     sealed class InternalStringComparer : EqualityComparer<string> {

@@ -456,7 +455,6 @@
             return -1;
         }
     }
-#endif

 #if FEATURE_RANDOMIZED_STRING_HASHING
     // This type is not serializeable by design.  It does not exist in previous versions and will be removed


Changed back color to white for the about window

--- SAMP_Ex/SAMP_Ex/Forms/aboutWindow.Designer.cs
+++ SAMP_Ex/SAMP_Ex/Forms/aboutWindow.Designer.cs
@@ -36,6 +36,7 @@
             //
             // richText_about
             //
+            this.richText_about.BackColor = System.Drawing.Color.White;
             this.richText_about.BorderStyle = System.Windows.Forms.BorderStyle.None;
             this.richText_about.Cursor = System.Windows.Forms.Cursors.Default;
             this.richText_about.Location = new System.Drawing.Point(63, 157);
@@ -63,6 +64,7 @@
             //
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.Color.White;
             this.ClientSize = new System.Drawing.Size(434, 261);
             this.Controls.Add(this.pictureBox1);
             this.Controls.Add(this.richText_about);


Allow LoginUrl to be read by functionsportal

--- SimpleWAWS/Authentication/BaseAuthProvider.cs
+++ SimpleWAWS/Authentication/BaseAuthProvider.cs
@@ -28,6 +28,9 @@
                         if (context.IsAjaxRequest() || context.IsFunctionsPortalRequest())
                         {
                             context.Response.Headers["LoginUrl"] = GetLoginUrl(context);
+                            if (context.IsFunctionsPortalRequest())
+                                context.Response.Headers["Access-Control-Expose-Headers"] = "LoginUrl";
+
                             context.Response.StatusCode = 403; // Forbidden
                         }
                         else


TSI-788 Fixed Invalid TCM URI exception in PageController.Resolve.  ILinkResolver.ResolveLink now expects a well-formed TCM URI and PageController.Resolve created a pseudo TCM URI.

--- Site/Areas/Core/Controllers/PageController.cs
+++ Site/Areas/Core/Controllers/PageController.cs
@@ -2,10 +2,12 @@
 using System.Web;
 using System.Web.Mvc;
 using Sdl.Web.Common.Configuration;
+using Sdl.Web.Common.Logging;
 using Sdl.Web.Common.Models;
 using Sdl.Web.Mvc.Configuration;
 using Sdl.Web.Mvc.Controllers;
 using Sdl.Web.Mvc.Formats;
+using Sdl.Web.Tridion.ContentManager;

 namespace Sdl.Web.Site.Areas.Core.Controllers
 {
@@ -48,10 +50,13 @@
         /// <returns>null - response is redirected if the URL can be resolved</returns>
         public virtual ActionResult Resolve(string itemId, int localizationId, string defaultItemId = null, string defaultPath = null)
         {
-            string url = SiteConfiguration.LinkResolver.ResolveLink("tcm:" + itemId, localizationId);
+            // TODO TSI-801: Assuming here that itemId/defaultItemId is Item Reference ID (integer) of a Page.
+            TcmUri tcmUri = new TcmUri(Convert.ToInt32(itemId), ItemType.Page, localizationId);
+            string url = SiteConfiguration.LinkResolver.ResolveLink(tcmUri.ToString());
             if (url == null && defaultItemId != null)
             {
-                url = SiteConfiguration.LinkResolver.ResolveLink("tcm:" + defaultItemId, localizationId);
+                tcmUri = new TcmUri(Convert.ToInt32(defaultItemId), ItemType.Page, localizationId);
+                url = SiteConfiguration.LinkResolver.ResolveLink(tcmUri.ToString());
             }
             if (url == null)
             {
@@ -67,9 +72,11 @@
         [FormatData]
         public virtual ActionResult NotFound()
         {
-            PageModel pageModel = ContentProvider.GetPageModel(WebRequestContext.Localization.Path + "/error-404");
+            string notFoundPageUrl = WebRequestContext.Localization.Path + "/error-404";
+            PageModel pageModel = ContentProvider.GetPageModel(notFoundPageUrl);
             if (pageModel == null)
             {
+                Log.Error("Cannot get Page Model for Not Found Page (URL '{0}'); returning raw HTTP 404 response.", notFoundPageUrl);
                 throw new HttpException(404, "Page Not Found");
             }
             SetupViewData(pageModel);


Prevent crash and log issue with HousePortal.SetLinkProperties (#3849)

--- Source/ACE.Server/WorldObjects/HousePortal.cs
+++ Source/ACE.Server/WorldObjects/HousePortal.cs
@@ -36,6 +36,18 @@

         public override void SetLinkProperties(WorldObject wo)
         {
+            if (House == null)
+            {
+                log.Warn($"[HOUSE] HousePortal.SetLinkProperties({(wo != null ? $"{wo.Name}:0x{wo.Guid}:{wo.WeenieClassId}" : "null")}): House is null for HousePortal 0x{Guid} at {Location.ToLOCString()}");
+                return;
+            }
+
+            if (wo == null)
+            {
+                log.Warn($"[HOUSE] HousePortal.SetLinkProperties(null): WorldObject is null for HousePortal 0x{Guid} at {Location.ToLOCString()} | {(House != null ? $"House = {House.Name}:0x{House.Guid}:{House.WeenieClassId}" : "House is null")}");
+                return;
+            }
+
             // get properties from parent?
             wo.HouseId = House.HouseId;
             wo.HouseOwner = House.HouseOwner;


Fixed potential memory leak when the last ItemsSource subscribed to via the CollectionChanged event remains in memory after the control should be cleaned up.

--- Source/PropertyTools.Wpf/DataGrid/DataGrid.cs
+++ Source/PropertyTools.Wpf/DataGrid/DataGrid.cs
@@ -50,7 +50,7 @@
     [TemplatePart(Name = PartAutoFillSelection, Type = typeof(Border))]
     [TemplatePart(Name = PartAutoFillBox, Type = typeof(Border))]
     [TemplatePart(Name = PartTopLeft, Type = typeof(Border))]
-    public partial class DataGrid : Control
+    public partial class DataGrid : Control, IWeakEventListener
     {
         /// <summary>
         /// Identifies the <see cref="CreateColumnHeader"/> dependency property.
@@ -1993,6 +1993,18 @@
                 Math.Max(columnMax, columnMin + columns - 1));
         }

+        public bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
+        {
+            if(managerType == typeof(CollectionChangedEventManager) && sender == subcribedCollection)
+            {
+                OnItemsCollectionChanged(sender, e as NotifyCollectionChangedEventArgs);
+
+                return true;
+            }
+
+            return false;
+        }
+
         /// <summary>
         /// Scroll the specified cell into view.
         /// </summary>
@@ -4135,7 +4147,7 @@
             var collection = this.ItemsSource as INotifyCollectionChanged;
             if (collection != null)
             {
-                collection.CollectionChanged += this.OnItemsCollectionChanged;
+                CollectionChangedEventManager.AddListener(collection, this);
             }

             this.subcribedCollection = this.ItemsSource;
@@ -4149,7 +4161,7 @@
             var ncc = this.subcribedCollection as INotifyCollectionChanged;
             if (ncc != null)
             {
-                ncc.CollectionChanged -= this.OnItemsCollectionChanged;
+                CollectionChangedEventManager.RemoveListener(ncc, this);
             }

             this.subcribedCollection = null;


Naming fixes

Naming fixes

--- osu.Framework/Graphics/UserInterface/ContextMenuItem.cs
+++ osu.Framework/Graphics/UserInterface/ContextMenuItem.cs
@@ -8,8 +8,8 @@
 {
     public class ContextMenuItem : MenuItem
     {
-        private readonly Container textContainer;
-        protected virtual Container CreateTextContainer(string title) => new Container
+        private readonly Container contentContainer;
+        protected virtual Container CreateContentContainer(string title) => new Container
         {
             AutoSizeAxes = Axes.Both,
             Anchor = Anchor.CentreLeft,
@@ -26,11 +26,11 @@
             }
         };

-        public new float DrawWidth => textContainer.DrawWidth;
+        public new float DrawWidth => contentContainer.DrawWidth;

         public ContextMenuItem(string title)
         {
-            Add(textContainer = CreateTextContainer(title));
+            Add(contentContainer = CreateContentContainer(title));
         }
     }
 }


Removed methode "GetNameAndComment"

Removed methode "GetNameAndComment"

--- SpirvSpecToJson/SpirvSpecToJson/Extensions.cs
+++ SpirvSpecToJson/SpirvSpecToJson/Extensions.cs
@@ -163,33 +163,5 @@
             return st.ToString();
         }

-        /// <summary>
-        /// Gets the name and the comment of an string like this:
-        /// "Name\nComment"
-        /// </summary>
-        /// <param name="t"></param>
-        /// <returns></returns>
-        public static string[] GetNameAndComment(this string t)
-        {
-            var a = new string[2];
-
-            // Format:
-            //
-            // "Name
-            // \nComment"
-
-            var index = t.IndexOf("\n");
-
-            if (index != -1)
-            {
-                a[0] = t.Substring(0, index).Trim();
-                a[1] = t.Substring(index).Trim();
-            }
-            else
-                a[0] = t.Trim();
-
-
-            return a;
-        }
     }
 }


Additional test: UInt32.MaxValue twice

Additional test: UInt32.MaxValue twice

--- Src/EthSharp.Vm.Core.Tests/Integer256Tests.cs
+++ Src/EthSharp.Vm.Core.Tests/Integer256Tests.cs
@@ -50,6 +50,17 @@
             AreEqual(result, new byte[] { 0x01, 0x00, 0x00, 0x00, 0x00 });
         }

+        [TestMethod]
+        public void MaxUInt32TwiceToBytes()
+        {
+            Integer256 value = new Integer256();
+
+            var newvalue = value.Add(UInt32.MaxValue).Add(UInt32.MaxValue);
+            var result = newvalue.ToBytes();
+
+            AreEqual(result, new byte[] { 0x01, 0xff, 0xff, 0xff, 0xfe });
+        }
+
         private static void AreEqual(byte[] values, byte[] expected)
         {
             Assert.IsNotNull(values);


ハッピー数関連の追加

ハッピー数関連の追加

--- Src/LoveWholeNumber/LoveWholeNumber/Class1.cs
+++ Src/LoveWholeNumber/LoveWholeNumber/Class1.cs
@@ -34,7 +34,7 @@
         /// </summary>
         /// <param name="n">判定したい自然数</param>
         /// <returns>何番目かを返す 素数でない場合は-1</returns>
-        public static int NumOfPrime(int n)
+        public static int GetNumOfPrime(int n)
         {
             if (n == 2 || n == 3)
                 return n - 1;
@@ -60,6 +60,14 @@
             }
             return -1;
         }
+        /*
+        public static int GetNthPrime(int nth)
+        {
+            if (nth == 1 || nth == 2)
+                return nth + 1;
+
+
+        }*/

         /// <summary>
         /// 双子素数判定(p, p + 2のうちpであるか判定)
@@ -376,7 +384,7 @@
         /// <returns>スーパー素数ならtrue でないならfalse</returns>
         public static bool IsSuperPrime(int n)
         {
-            if (IsPrime(n) && IsPrime(NumOfPrime(n)))
+            if (IsPrime(n) && IsPrime(GetNumOfPrime(n)))
                 return true;

             return false;
@@ -649,6 +657,61 @@
             return false;
         }

-
+        /// <summary>
+        /// ハッピー関数
+        /// </summary>
+        /// <param name="n">引数</param>
+        /// <returns>各桁の平方数の和</returns>
+        public static int HappyFunction(int n)
+        {
+            int length = n.ToString("D").Length;
+            List<int> digitList = new List<int>();
+
+            for (int i = 0; i < length; i++)
+            {
+                digitList.Add(n % 10);
+                n /= 10;
+            }
+
+            int result = 0;
+
+            foreach (var i in digitList)
+            {
+                result += i * i;
+            }
+
+            return result;
+        }
+
+        /// <summary>
+        /// ハッピー数判定
+        /// </summary>
+        /// <param name="n">判定したい自然数</param>
+        /// <returns>ハッピー数ならtrue でないならfalse</returns>
+        public static bool IsHappyNumber(int n)
+        {
+            while (n.ToString("D").Length != 1)
+            {
+                HappyFunction(n);
+            }
+
+            if (n == 1)
+                return true;
+
+            return false;
+        }
+
+        /// <summary>
+        /// ハッピー素数判定
+        /// </summary>
+        /// <param name="n">判定したい自然数</param>
+        /// <returns>ハッピー素数ならtrue でないならfalse</returns>
+        public static bool IsHappyPrime(int n)
+        {
+            if (IsPrime(n) && IsHappyNumber(n))
+                return true;
+
+            return false;
+        }
     }
 }


Adding and fixing comments to have proper XML doc

Also contains code style fixes

--- Stratis.Bitcoin/Utilities/ReaderWriterLock.cs
+++ Stratis.Bitcoin/Utilities/ReaderWriterLock.cs
@@ -6,31 +6,54 @@
 using System.Threading.Tasks;

 namespace Stratis.Bitcoin.Utilities
-{
-	internal class ReaderWriterLock
-	{
-		ReaderWriterLockSlim @lock = new ReaderWriterLockSlim();
+{
+    /// <summary>
+    /// Wraps ReaderWriterLockSlim with disposable interface so that
+    /// it is possible to use using construct to avoid forgotten lock releases.
+    /// </summary>
+    internal class ReaderWriterLock
+    {
+        /// <summary>Internal lock object that the class wraps around.</summary>
+        private ReaderWriterLockSlim rwLock = new ReaderWriterLockSlim();

-		public IDisposable LockRead()
-		{
-			return new ActionDisposable(() => this.@lock.EnterReadLock(), () => this.@lock.ExitReadLock());
-		}
-		public IDisposable LockWrite()
-		{
-			return new ActionDisposable(() => this.@lock.EnterWriteLock(), () => this.@lock.ExitWriteLock());
-		}
+        /// <summary>
+        /// Enters the reader's lock.
+        /// </summary>
+        /// <returns>Disposable interface to enable using construct. Disposing it releases the lock.</returns>
+        /// <seealso cref="ReaderWriterLockSlim.EnterReadLock"/>
+        /// <seealso cref="ReaderWriterLockSlim.ExitReadLock"/>
+        public IDisposable LockRead()
+        {
+            return new ActionDisposable(() => this.rwLock.EnterReadLock(), () => this.rwLock.ExitReadLock());
+        }

-		internal bool TryLockWrite(out IDisposable locked)
-		{
-			locked = null;
-			if(this.@lock.TryEnterWriteLock(0))
-			{
-				locked = new ActionDisposable(() =>
-				{
-				}, () => this.@lock.ExitWriteLock());
-				return true;
-			}
-			return false;
-		}
-	}
+        /// <summary>
+        /// Enters the writer's lock.
+        /// </summary>
+        /// <returns>Disposable interface to enable using construct. Disposing it releases the lock.</returns>
+        /// <seealso cref="ReaderWriterLockSlim.EnterWriteLock"/>
+        /// <seealso cref="ReaderWriterLockSlim.ExitWriteLock"/>
+        public IDisposable LockWrite()
+        {
+            return new ActionDisposable(() => this.rwLock.EnterWriteLock(), () => this.rwLock.ExitWriteLock());
+        }
+
+        /// <summary>
+        /// Enters the writer's lock.
+        /// </summary>
+        /// <returns>Disposable interface to enable using construct.</returns>
+        /// <seealso cref="ReaderWriterLockSlim.EnterReadLock"/>
+        internal bool TryLockWrite(out IDisposable locked)
+        {
+            locked = null;
+            if (this.rwLock.TryEnterWriteLock(0))
+            {
+                locked = new ActionDisposable(() =>
+                {
+                }, () => this.rwLock.ExitWriteLock());
+                return true;
+            }
+            return false;
+        }
+    }
 }


Channels rejoined after successful reconnect after timeout.

--- StreamChatSharp/StreamChatSharp/ChatClient.cs
+++ StreamChatSharp/StreamChatSharp/ChatClient.cs
@@ -48,7 +48,7 @@

         private Connection connection;
         private List<ChatChannel> channels = new List<ChatChannel>();
-
+        private bool connectionTimedOut = false;
         private bool disposed = false;

         /// <summary>
@@ -270,6 +270,11 @@

         private void OnDisconnected(object sender, DisconnectedEventArgs e)
         {
+            if(e.Reason == DisconnectedEventArgs.DisconnectReason.TimedOut)
+            {
+                this.connectionTimedOut = true;
+            }
+
             if(this.Disconnected != null)
             {
                 Disconnected(sender, e);
@@ -278,6 +283,17 @@

         private void OnRegisteredWithServer(object sender, EventArgs e)
         {
+            // If we are connecting after a timeout we need to rejoin all of the channels we are supposed to be in.
+            if(connectionTimedOut)
+            {
+                connectionTimedOut = false;
+
+                foreach(ChatChannel channel in this.channels)
+                {
+                    SendChatMessage(new ChatMessage("JOIN", channel.ChannelName), true);
+                }
+            }
+
             if(this.RegisteredWithServer != null)
             {
                 this.RegisteredWithServer(sender, e);


Updated StreamCommit

Updated StreamCommit

* fixed crash on startup with a fresh App.config

--- StreamCommit/StreamCommit/StreamCommitForm.cs
+++ StreamCommit/StreamCommit/StreamCommitForm.cs
@@ -58,6 +58,9 @@
         private void ToggleRun(object sender, EventArgs e)
         {
             if (!IsReadyToRun)
+                return;
+
+            if (!Repository.IsValid(Settings.FolderToWatch))
                 return;

             if (_committer == null)
@@ -135,7 +138,10 @@
             lblLoggedIn.Text = $"User: {(string.IsNullOrWhiteSpace(Settings.GitUsername) ? "-" : Settings.GitUsername)}";
             tbCommitInterval.Text = (Settings.CommitInterval / 1000).ToString();
             _committer = new Committer();
-            _committer.Path = Settings.FolderToWatch;
+            if(Repository.IsValid(Settings.FolderToWatch))
+            {
+                _committer.Path = Settings.FolderToWatch;
+            }
             _committer.CommitInterval = Settings.CommitInterval;
             _committer.StatusChanged += StatusChanged;


[system] Remove windows api dependency from Timer

--- System/services/timers/system/timers/Timer.cs
+++ System/services/timers/system/timers/Timer.cs
@@ -302,10 +302,13 @@
             if (!this.autoReset) {
                 enabled = false;
             }
-
+#if MONO
+            ElapsedEventArgs elapsedEventArgs = new ElapsedEventArgs(DateTime.Now);
+#else
             FILE_TIME filetime = new FILE_TIME();
             GetSystemTimeAsFileTime(ref filetime);
             ElapsedEventArgs elapsedEventArgs = new ElapsedEventArgs(filetime.ftTimeLow, filetime.ftTimeHigh);
+#endif
             try {
                 // To avoid ---- between remove handler and raising the event
                 ElapsedEventHandler intervalElapsed = this.onIntervalElapsed;
@@ -319,7 +322,7 @@
             catch {
             }
         }
-
+#if !MONO
         [StructLayout(LayoutKind.Sequential)]
         internal struct FILE_TIME {
             internal int ftTimeLow;
@@ -329,6 +332,7 @@
         [ResourceExposure(ResourceScope.None)]
         [DllImport(ExternDll.Kernel32), SuppressUnmanagedCodeSecurityAttribute()]
         internal static extern void GetSystemTimeAsFileTime(ref FILE_TIME lpSystemTimeAsFileTime);
+#endif
     }
 }


Added broader exception catching to the dispatcher to tighten up the gasket keeping exceptions from leaking out.

--- Take2/NuLog/Dispatchers/StandardDispatcher.cs
+++ Take2/NuLog/Dispatchers/StandardDispatcher.cs
@@ -67,27 +67,47 @@

         public void DispatchNow(ILogEvent logEvent)
         {
-            // Ask our tag router which targets we send to
-            var targetNames = tagRouter.Route(logEvent.Tags);
-
-            // For each target to dispatch to, do it
-            foreach (var targetName in targetNames)
-            {
-                // Try to find the target by name
-                var target = targets.FirstOrDefault(t => string.Equals(targetName, t.Name, StringComparison.OrdinalIgnoreCase));
-                if (target != null)
+            try
+            {
+                // Ask our tag router which targets we send to
+                var targetNames = tagRouter.Route(logEvent.Tags);
+
+                // For each target to dispatch to, do it
+                foreach (var targetName in targetNames)
                 {
-                    try
+                    // Try to find the target by name
+                    var target = targets.FirstOrDefault(t => string.Equals(targetName, t.Name, StringComparison.OrdinalIgnoreCase));
+                    if (target != null)
                     {
-                        // We found it, tell the log event to write itself to the target
-                        logEvent.WriteTo(target);
-                    }
-                    catch (Exception cause)
-                    {
-                        // There was a problem writing to the target, report the error
-                        FallbackLog(cause, target, logEvent);
+                        try
+                        {
+                            // We found it, tell the log event to write itself to the target
+                            logEvent.WriteTo(target);
+                        }
+                        catch (Exception cause)
+                        {
+                            // There was a problem writing to the target, report the error
+                            FallbackLog(cause, target, logEvent);
+                        }
                     }
                 }
+            }
+            catch (Exception cause)
+            {
+                // A general failure, likely in the router, or in finding the target
+                FallbackLog("Failure dispatching log event: {0}", cause);
+            }
+        }
+
+        private void FallbackLog(string message, params object[] args)
+        {
+            try
+            {
+                this.fallbackLogger.Log(message, args);
+            }
+            catch (Exception cause)
+            {
+                Trace.TraceError("Failure writing message to fallback logger for cause: {0}", cause);
             }
         }


another ubuntu test fail

another ubuntu test fail

not flurl's concern so don't bother asserting it

--- Test/Flurl.Test/UrlBuilder/UrlParsingTests.cs
+++ Test/Flurl.Test/UrlBuilder/UrlParsingTests.cs
@@ -92,7 +92,6 @@
 			var url = new Url(s);
 			var uri = url.ToUri();
 			Assert.AreEqual(s, uri.OriginalString);
-			Assert.AreEqual(isAbsolute, uri.IsAbsoluteUri);
 		}

 		[Test]


[packages,boost,1.60.0] Some work towards VS2017 support

--- packages/boost_1_60_0/bam/Scripts/GenericBoostModule.cs
+++ packages/boost_1_60_0/bam/Scripts/GenericBoostModule.cs
@@ -73,8 +73,10 @@
             {
                 var visualC = Bam.Core.Graph.Instance.Packages.First(item => item.Name == "VisualC");
                 string vcVer = string.Empty;
-                if (visualC.Version == "14.0")
+                if (visualC.Version == "14.0" ||
+                    visualC.Version == "15.0")
                 {
+                    // VS 2017 is backward compatible with VS2015
                     vcVer = "140";
                 }
                 else if (visualC.Version == "12.0")


Removing duplicate code causing issue with parameter extraction

--- MonoCross.Navigation/MXContainer.cs
+++ MonoCross.Navigation/MXContainer.cs
@@ -2,8 +2,6 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Reflection;
-using System.Text.RegularExpressions;
-using System.Threading;

 namespace MonoCross.Navigation
 {
@@ -398,7 +396,7 @@
             LastNavigationUrl = url;

             // initialize parameter dictionary if not provided
-            parameters = (parameters ?? new Dictionary<string, string>());
+            parameters = parameters ?? new Dictionary<string, string>();

             // for debug
             // Console.WriteLine("Navigating to: " + url);
@@ -410,24 +408,10 @@
             if (navigation != null)
             {
                 controller = navigation.Controller;
-
-                // Now that we know which mapping the URL matches, determine the parameter names for any Values in URL string
-                Match match = Regex.Match(url, navigation.RegexPattern());
-                MatchCollection args = Regex.Matches(navigation.Pattern, @"{(?<Name>\w+)}*");
-
-                // If there are any parameters in the URL string, add them to the parameters dictionary
-                if (args.Count > 0)
-                {
-                    foreach (Match arg in args)
-                    {
-                        if (parameters.ContainsKey(arg.Groups["Name"].Value))
-                            parameters.Remove(arg.Groups["Name"].Value);
-                        parameters.Add(arg.Groups["Name"].Value, match.Groups[arg.Groups["Name"].Value].Value);
-                    }
-                }
+                navigation.ExtractParameters(url, parameters);

                 //Add default view parameters without overwriting current ones
-                if (navigation.Parameters.Count > 0)
+                if (navigation.Parameters != null)
                 {
                     foreach (var param in navigation.Parameters)
                     {


cleanup setup form

cleanup setup form

--- NexStar/SetupDialogForm.designer.cs
+++ NexStar/SetupDialogForm.designer.cs
@@ -157,9 +157,9 @@
             this.label4.AutoSize = true;
             this.label4.Location = new System.Drawing.Point(72, 110);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(29, 13);
+            this.label4.Size = new System.Drawing.Size(26, 13);
             this.label4.TabIndex = 9;
-            this.label4.Text = " mm";
+            this.label4.Text = "mm";
             //
             // checkBox1
             //


Fix potential NullReferenceException for unresolved attribute types

--- src/PublicApiGenerator/ApiGenerator.cs
+++ src/PublicApiGenerator/ApiGenerator.cs
@@ -407,7 +407,7 @@
         static bool ShouldIncludeAttribute(CustomAttribute attribute)
         {
             var attributeTypeDefinition = attribute.AttributeType.Resolve();
-            return !SkipAttributeNames.Contains(attribute.AttributeType.FullName) && attributeTypeDefinition.IsPublic;
+            return attributeTypeDefinition != null && !SkipAttributeNames.Contains(attribute.AttributeType.FullName) && attributeTypeDefinition.IsPublic;
         }

         static CodeExpression CreateInitialiserExpression(CustomAttributeArgument attributeArgument)


GetProperties

GetProperties

--- src/ReflectionUtils/ReflectionUtils.cs
+++ src/ReflectionUtils/ReflectionUtils.cs
@@ -170,6 +170,15 @@
             return null;
         }

+        public static IEnumerable<PropertyInfo> GetProperties(Type type)
+        {
+#if REFLECTION_UTILS_TYPEINFO
+            return type.GetTypeInfo().DeclaredProperties;
+#else
+            return type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
+#endif
+        }
+
         public static ConstructorDelegate GetContructorByReflection(ConstructorInfo constructorInfo)
         {
             return delegate(object[] args) { return constructorInfo.Invoke(args); };
@@ -207,6 +216,12 @@
             ConstructorInfo constructorInfo = GetConstructorInfo(type, argsType);
             return constructorInfo == null ? null : GetConstructorByExpression(constructorInfo);
         }
+
+#endif
+
+#if REFLECTION_UTILS_REFLECTION_EMIT
+
+

 #endif


ThreadSafeDictionary partially implements IDictionary<TKey, TValue>

--- src/ReflectionUtils/ReflectionUtils.cs
+++ src/ReflectionUtils/ReflectionUtils.cs
@@ -384,7 +384,7 @@
         }
 #endif

-        public sealed class ThreadSafeDictionary<TKey, TValue>
+        public sealed class ThreadSafeDictionary<TKey, TValue> : IDictionary<TKey, TValue>
         {
             private readonly object _lock = new object();
             private readonly ThreadSafeDictionaryValueFactory<TKey, TValue> _valueFactory;
@@ -395,7 +395,7 @@
                 _valueFactory = valueFactory;
             }

-            public TValue Get(TKey key)
+            private TValue Get(TKey key)
             {
                 if (_dictionary == null)
                     return AddValue(key);
@@ -427,6 +427,87 @@
                 }
                 return value;
             }
+
+            public void Add(TKey key, TValue value)
+            {
+                throw new NotImplementedException();
+            }
+
+            public bool ContainsKey(TKey key)
+            {
+                return _dictionary.ContainsKey(key);
+            }
+
+            public ICollection<TKey> Keys
+            {
+                get { return _dictionary.Keys; }
+            }
+
+            public bool Remove(TKey key)
+            {
+                throw new NotImplementedException();
+            }
+
+            public bool TryGetValue(TKey key, out TValue value)
+            {
+                throw new NotImplementedException();
+            }
+
+            public ICollection<TValue> Values
+            {
+                get { return _dictionary.Values; }
+            }
+
+            public TValue this[TKey key]
+            {
+                get { return Get(key); }
+                set { throw new NotImplementedException(); }
+            }
+
+            public void Add(KeyValuePair<TKey, TValue> item)
+            {
+                throw new NotImplementedException();
+            }
+
+            public void Clear()
+            {
+                throw new NotImplementedException();
+            }
+
+            public bool Contains(KeyValuePair<TKey, TValue> item)
+            {
+                throw new NotImplementedException();
+            }
+
+            public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
+            {
+                throw new NotImplementedException();
+            }
+
+            public int Count
+            {
+                get { return _dictionary.Count; }
+            }
+
+            public bool IsReadOnly
+            {
+                get { throw new NotImplementedException(); }
+            }
+
+            public bool Remove(KeyValuePair<TKey, TValue> item)
+            {
+                throw new NotImplementedException();
+            }
+
+            public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
+            {
+                return _dictionary.GetEnumerator();
+            }
+
+            System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+            {
+                return _dictionary.GetEnumerator();
+            }
         }

     }


modificacon x3

modificacon x3

--- NURCON/DataAccessLayer/PacienteDAL.cs
+++ NURCON/DataAccessLayer/PacienteDAL.cs
@@ -58,11 +58,14 @@
             return db.Pacientes.Where(m => m.Matricula == mat).Count()>0;
         }

-        public static bool actualizar(Paciente p)
+       // actualizacion /////////////////////
+
+        public static bool actualizar (Paciente p)
         {
             db.Pacientes.Attach(p);
-            db.Entry(p).State = EntityState.Modified; //actualizacion
+            db.Entry(p).State = EntityState.Modified;
             return db.SaveChanges() > 0;
         }
+        // actualizacion//////////////////////////
     }
 }