Bug 17383 - Removed resolving of Nested Types because it's resolved sooner by new code This code is reached only when invalid name is evaluated e.g.("unexistingVariable") and because foreaching all namespaces(which is 600+ on big projects on Win32 and only few on Soft(this is why there is no time penalty)) takes a lot of time(30sec+) Also notice that Win32 debugger code didn't even work for this code(I removed new Type resolution to force this code to work and it didn't(it failed to create Type object) so it's never used 100%) Also notice that Soft debugger is only able to resolve loaded types in application so in HelloWorld application only type resolved is HelloWorld class but all others like System.XXX is never resolved which is wrong. This is just another proof this code was never used...

--- Mono.Debugging/Mono.Debugging.Evaluation/NRefactoryExpressionEvaluatorVisitor.cs
+++ Mono.Debugging/Mono.Debugging.Evaluation/NRefactoryExpressionEvaluatorVisitor.cs
@@ -590,31 +590,6 @@
 			vtype = ctx.Adapter.GetType (ctx, name);
 			if (vtype != null)
 				return new TypeValueReference (ctx, vtype);
-
-			// Look in nested types
-
-			if (type != null) {
-				foreach (object ntype in ctx.Adapter.GetNestedTypes (ctx, type)) {
-					if (TypeValueReference.GetTypeName (ctx.Adapter.GetTypeName (ctx, ntype)) == name)
-						return new TypeValueReference (ctx, ntype);
-				}
-
-				string[] namespaces = ctx.Adapter.GetImportedNamespaces (ctx);
-				if (namespaces.Length > 0) {
-					// Look in namespaces
-					foreach (string ns in namespaces) {
-						string nm = ns + "." + name;
-						vtype = ctx.Adapter.ForceLoadType (ctx, nm);
-						if (vtype != null)
-							return new TypeValueReference (ctx, vtype);
-					}
-
-					foreach (string ns in namespaces) {
-						if (ns == name || ns.StartsWith (name + ".", StringComparison.InvariantCulture))
-							return new NamespaceValueReference (ctx, name);
-					}
-				}
-			}

 			if (self == null && ctx.Adapter.HasMember (ctx, type, name, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)) {
 				string message = string.Format ("An object reference is required for the non-static field, method, or property '{0}.{1}'.",


[Evaluation] Avoid infinite loop when scanning base types

--- Mono.Debugging/Mono.Debugging.Evaluation/NRefactoryExpressionEvaluatorVisitor.cs
+++ Mono.Debugging/Mono.Debugging.Evaluation/NRefactoryExpressionEvaluatorVisitor.cs
@@ -731,7 +731,7 @@
 					if (xtypeArgs == null) {
 						// try to infer the generic type arguments from the type of the object...
 						object xtype = vtype;
-						while (!ctx.Adapter.IsGenericType (ctx, xtype))
+						while (xtype != null && !ctx.Adapter.IsGenericType (ctx, xtype))
 							xtype = ctx.Adapter.GetBaseType (ctx, xtype);

 						if (xtype != null)


* update version to 1.4.9.0

* update version to 1.4.9.0

--- Source/HtmlRenderer/Properties/AssemblyInfo.cs
+++ Source/HtmlRenderer/Properties/AssemblyInfo.cs
@@ -28,4 +28,4 @@
 //      Build Number
 //      Revision
 //
-[assembly: AssemblyVersion("1.4.8.1")]+[assembly: AssemblyVersion("1.4.9.0")]


Updated UserInfo static local account functions to accept AD users for local groups.

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

--- Source/Libraries/GSF.Core/Identity/UserInfo.cs
+++ Source/Libraries/GSF.Core/Identity/UserInfo.cs
@@ -266,8 +266,9 @@
             if (string.IsNullOrEmpty(loginID))
                 throw new ArgumentNullException("loginID");

-            string[] parts = loginID.Split('\\');
-            if (parts.Length != 2)
+            string[] accountParts = loginID.Split('\\');
+
+            if (accountParts.Length != 2)
             {
                 // Login ID is specified in 'username' format.
                 m_username = loginID;
@@ -275,8 +276,8 @@
             else
             {
                 // Login ID is specified in 'domain\username' format.
-                m_domain = parts[0];
-                m_username = parts[1];
+                m_domain = accountParts[0];
+                m_username = accountParts[1];
             }

             m_ldapPath = ldapPath;
@@ -1949,8 +1950,32 @@
         }

         // Determines if local account (e.g., user or group) exists using an existing directory entry
-        private static bool LocalAccountExists(DirectoryEntry localMachine, string accountName, string schemaType, out DirectoryEntry accountEntry)
-        {
+        private static bool LocalAccountExists(DirectoryEntry localMachine, string accountName, string schemaType, bool allowActiveDirectoryAccount, out DirectoryEntry accountEntry)
+        {
+            if (allowActiveDirectoryAccount && accountName.Contains("\\"))
+            {
+                string[] accountParts = accountName.Split('\\');
+
+                if (accountParts.Length == 2)
+                {
+                    string domain = accountParts[0].Trim();
+                    string account = accountParts[1].Trim();
+
+                    // Check for non-local domain name
+                    if (!string.IsNullOrEmpty(domain) &&
+                        string.Compare(domain, ".", StringComparison.OrdinalIgnoreCase) != 0 &&
+                        string.Compare(domain, Environment.MachineName, StringComparison.OrdinalIgnoreCase) != 0)
+                    {
+                        // AD accounts that exist in local groups can be referenced by name
+                        accountEntry = new DirectoryEntry(string.Format("WinNT://{0}/{1}", domain, account));
+                        return true;
+                    }
+
+                    // Remove domain prefix for local accounts
+                    accountName = account;
+                }
+            }
+
             try
             {
                 accountEntry = localMachine.Children.Find(accountName, schemaType);
@@ -1987,7 +2012,7 @@
                 DirectoryEntry userEntry;

                 // Determine if local user exists
-                bool userExists = LocalAccountExists(localMachine, userName, "user", out userEntry);
+                bool userExists = LocalAccountExists(localMachine, userName, "user", false, out userEntry);

                 if ((object)userEntry != null)
                     userEntry.Dispose();
@@ -2031,7 +2056,7 @@
                 try
                 {
                     // Determine if local user exists
-                    if (!LocalAccountExists(localMachine, userName, "user", out userEntry))
+                    if (!LocalAccountExists(localMachine, userName, "user", false, out userEntry))
                     {
                         using (DirectoryEntry newUserEntry = localMachine.Children.Add(userName, "user"))
                         {
@@ -2094,7 +2119,7 @@
                 try
                 {
                     // Determine if local user exists
-                    if (!LocalAccountExists(localMachine, userName, "user", out userEntry))
+                    if (!LocalAccountExists(localMachine, userName, "user", false, out userEntry))
                         throw new InvalidOperationException(string.Format("Cannot change password for local user \"{0}\": user does not exist.", userName));

                     userEntry.Invoke("SetPassword", new object[] { password });
@@ -2144,7 +2169,7 @@
                 try
                 {
                     // Determine if local user exists
-                    if (LocalAccountExists(localMachine, userName, "user", out userEntry))
+                    if (LocalAccountExists(localMachine, userName, "user", false, out userEntry))
                     {
                         localMachine.Children.Remove(userEntry);
                         return true;
@@ -2190,7 +2215,7 @@
                 DirectoryEntry groupEntry;

                 // Determine if local group exists
-                bool groupExists = LocalAccountExists(localMachine, groupName, "group", out groupEntry);
+                bool groupExists = LocalAccountExists(localMachine, groupName, "group", false, out groupEntry);

                 if ((object)groupEntry != null)
                     groupEntry.Dispose();
@@ -2232,7 +2257,7 @@
                 try
                 {
                     // Determine if local group exists
-                    if (!LocalAccountExists(localMachine, groupName, "group", out groupEntry))
+                    if (!LocalAccountExists(localMachine, groupName, "group", false, out groupEntry))
                     {
                         using (DirectoryEntry newGroupEntry = localMachine.Children.Add(groupName, "group"))
                         {
@@ -2290,7 +2315,7 @@
                 try
                 {
                     // Determine if local group exists
-                    if (LocalAccountExists(localMachine, groupName, "group", out groupEntry))
+                    if (LocalAccountExists(localMachine, groupName, "group", false, out groupEntry))
                     {
                         localMachine.Children.Remove(groupEntry);
                         return true;
@@ -2321,7 +2346,9 @@
         /// <exception cref="InvalidOperationException">Could not determine if user was in local group.</exception>
         /// <remarks>
         /// This function will handle Windows service virtual accounts by specifying the complete virtual account name,
-        /// such as <c>@"NT SERVICE\MyService"</c>, as the <paramref name="userName"/>.
+        /// such as <c>@"NT SERVICE\MyService"</c>, as the <paramref name="userName"/>. This function can also detect
+        /// Active Directory user accounts and groups that may exist in the local group when the <paramref name="userName"/>
+        /// is prefixed with a domain name and a backslash "\".
         /// </remarks>
         public static bool UserIsInLocalGroup(string groupName, string userName)
         {
@@ -2356,7 +2383,7 @@
                 try
                 {
                     // Determine if local group exists
-                    if (!LocalAccountExists(localMachine, groupName, "group", out groupEntry))
+                    if (!LocalAccountExists(localMachine, groupName, "group", false, out groupEntry))
                         throw new InvalidOperationException(string.Format("Cannot determine if user \"{0}\" is in local group \"{1}\": group does not exist.", userName, groupName));

                     // Check for Windows service virtual accounts
@@ -2367,7 +2394,7 @@
                     else
                     {
                         // Determine if local user exists
-                        if (!LocalAccountExists(localMachine, userName, "user", out userEntry))
+                        if (!LocalAccountExists(localMachine, userName, "user", true, out userEntry))
                             throw new InvalidOperationException(string.Format("Cannot determine if user \"{0}\" is in local group \"{1}\": user does not exist.", userName, groupName));

                         userPath = userEntry.Path;
@@ -2416,7 +2443,9 @@
         /// <exception cref="InvalidOperationException">Could not add user to local group.</exception>
         /// <remarks>
         /// This function will handle Windows service virtual accounts by specifying the complete virtual account name,
-        /// such as <c>@"NT SERVICE\MyService"</c>, as the <paramref name="userName"/>.
+        /// such as <c>@"NT SERVICE\MyService"</c>, as the <paramref name="userName"/>. This function can also add
+        /// Active Directory user accounts and groups to the local group the when the <paramref name="userName"/> is
+        /// prefixed with a domain name and a backslash "\".
         /// </remarks>
         public static bool AddUserToLocalGroup(string groupName, string userName)
         {
@@ -2451,7 +2480,7 @@
                 try
                 {
                     // Determine if local group exists
-                    if (!LocalAccountExists(localMachine, groupName, "group", out groupEntry))
+                    if (!LocalAccountExists(localMachine, groupName, "group", false, out groupEntry))
                         throw new InvalidOperationException(string.Format("Cannot add user \"{0}\" to local group \"{1}\": group does not exist.", userName, groupName));

                     // Check for Windows service virtual accounts
@@ -2462,7 +2491,7 @@
                     else
                     {
                         // Determine if user exists
-                        if (!LocalAccountExists(localMachine, userName, "user", out userEntry))
+                        if (!LocalAccountExists(localMachine, userName, "user", true, out userEntry))
                             throw new InvalidOperationException(string.Format("Cannot add user \"{0}\" to local group \"{1}\": user does not exist.", userName, groupName));

                         userPath = userEntry.Path;
@@ -2514,7 +2543,9 @@
         /// <exception cref="InvalidOperationException">Could not remove user from local group.</exception>
         /// <remarks>
         /// This function will handle Windows service virtual accounts by specifying the complete virtual account name,
-        /// such as <c>@"NT SERVICE\MyService"</c>, as the <paramref name="userName"/>.
+        /// such as <c>@"NT SERVICE\MyService"</c>, as the <paramref name="userName"/>. This function can also remove
+        /// Active Directory user accounts and groups from the local group the when the <paramref name="userName"/> is
+        /// prefixed with a domain name and a backslash "\".
         /// </remarks>
         public static bool RemoveUserFromLocalGroup(string groupName, string userName)
         {
@@ -2549,7 +2580,7 @@
                 try
                 {
                     // Determine if local group exists
-                    if (!LocalAccountExists(localMachine, groupName, "group", out groupEntry))
+                    if (!LocalAccountExists(localMachine, groupName, "group", false, out groupEntry))
                         throw new InvalidOperationException(string.Format("Cannot remove user \"{0}\" from local group \"{1}\": group does not exist.", userName, groupName));

                     // Check for Windows service virtual accounts
@@ -2560,7 +2591,7 @@
                     else
                     {
                         // Determine if user exists
-                        if (!LocalAccountExists(localMachine, userName, "user", out userEntry))
+                        if (!LocalAccountExists(localMachine, userName, "user", true, out userEntry))
                             throw new InvalidOperationException(string.Format("Cannot remove user \"{0}\" from local group \"{1}\": user does not exist.", userName, groupName));

                         userPath = userEntry.Path;


work on addmission form

work on addmission form

--- SmartSchoolManagementSystem/SmartSchoolManagementSystem/Newadmission.Designer.cs
+++ SmartSchoolManagementSystem/SmartSchoolManagementSystem/Newadmission.Designer.cs
@@ -2212,7 +2212,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.WhiteSmoke;
-            this.ClientSize = new System.Drawing.Size(1243, 741);
+            this.ClientSize = new System.Drawing.Size(1243, 847);
             this.Controls.Add(this.checkBox1);
             this.Controls.Add(this.label28);
             this.Controls.Add(this.label20);


4 segundos en el Selfie

4 segundos en el Selfie


[Core] blocking LoadAllPlugins only at startup

--- Oxide.Core/OxideMod.cs
+++ Oxide.Core/OxideMod.cs
@@ -199,7 +199,7 @@

             // Load all plugins
             LogInfo("Loading plugins...");
-            LoadAllPlugins();
+            LoadAllPlugins(true);

             // Hook all watchers
             foreach (var watcher in extensionmanager.GetPluginChangeWatchers())
@@ -274,7 +274,7 @@
         /// <summary>
         /// Scans for all available plugins and attempts to load them
         /// </summary>
-        public void LoadAllPlugins()
+        public void LoadAllPlugins(bool init = false)
         {
             var loaders = extensionmanager.GetPluginLoaders();
             // Load all core plugins first
@@ -303,6 +303,7 @@
             {
                 foreach (string name in loader.ScanDirectory(PluginDirectory)) LoadPlugin(name);
             }
+            if (!init) return;
             var lastCall = Now;
             foreach (var loader in extensionmanager.GetPluginLoaders())
             {


Fix null ref exception

Fix null ref exception

--- Source/PropertyTools.Wpf/Helpers/TypeHelper.cs
+++ Source/PropertyTools.Wpf/Helpers/TypeHelper.cs
@@ -208,7 +208,7 @@
         public static Type GetInnerTypeOfList(IList list)
         {
             var innerType = TypeHelper.GetInnerMostGenericType(list);
-            if (innerType.IsInterface)
+            if (innerType != null && innerType.IsInterface)
             {
                 if (list.Count > 0)
                 {


RigidBody Shape Layer Bugfixes #FIX: Fixed an exception in the RigidBody shape layer when attempting to render a polygon shape that is invalid.

--- Source/Plugins/EditorModules/CamView/CamViewLayers/RigidBodyShapeCamViewLayer.cs
+++ Source/Plugins/EditorModules/CamView/CamViewLayers/RigidBodyShapeCamViewLayer.cs
@@ -231,9 +231,12 @@
 		private void DrawShape(Canvas canvas, Transform transform, PolyShapeInfo shape, ColorRgba fillColor, ColorRgba outlineColor)
 		{
 			// Fill each convex polygon individually
-			foreach (Vector2[] polygon in shape.ConvexPolygons)
-			{
-				this.FillPolygon(canvas, transform, polygon, fillColor);
+			if (shape.ConvexPolygons != null)
+			{
+				foreach (Vector2[] polygon in shape.ConvexPolygons)
+				{
+					this.FillPolygon(canvas, transform, polygon, fillColor);
+				}
 			}

 			// Draw the polygon outline


added test for file header decoration

added test for file header decoration

--- StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1633UnitTests.cs
+++ StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1633UnitTests.cs
@@ -26,7 +26,21 @@
 }
 ";

+        private const string DecoratedXmlMultiLineHeaderTestSettings = @"
+{
+  ""settings"": {
+    ""documentationRules"": {
+      ""companyName"": ""FooCorp"",
+      ""copyrightText"": ""  Copyright (c) {companyName}. All rights reserved."",
+      ""headerDecoration"": ""-----------------------------------------------------------------------"",
+    }
+  }
+}
+";
+
         private bool useNoXmlSettings;
+
+        private bool useDecoratedXmlMultiLineHeaderTestSettings;

         /// <summary>
         /// Verifies that the analyzer will report <see cref="FileHeaderAnalyzers.SA1633DescriptorMissing"/> for
@@ -160,6 +174,36 @@
 {
 }
 ";
+
+            var expectedDiagnostic = this.CSharpDiagnostic(FileHeaderAnalyzers.SA1633DescriptorMissing).WithLocation(1, 1);
+            await this.VerifyCSharpDiagnosticAsync(testCode, expectedDiagnostic, CancellationToken.None).ConfigureAwait(false);
+            await this.VerifyCSharpDiagnosticAsync(fixedCode, EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
+            await this.VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(false);
+        }
+
+        /// <summary>
+        /// Verifies that a file without a header, but with leading trivia will produce the correct diagnostic message.
+        /// </summary>
+        /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
+        [Fact]
+        public async Task TestMissingFileHeaderWithDecorationAsync()
+        {
+            var testCode = @"namespace Foo
+{
+}
+";
+            var fixedCode = @"// -----------------------------------------------------------------------
+// <copyright file=""Test0.cs"" company=""FooCorp"">
+//   Copyright (c) FooCorp. All rights reserved.
+// </copyright>
+// -----------------------------------------------------------------------
+
+namespace Foo
+{
+}
+";
+
+            this.useDecoratedXmlMultiLineHeaderTestSettings = true;

             var expectedDiagnostic = this.CSharpDiagnostic(FileHeaderAnalyzers.SA1633DescriptorMissing).WithLocation(1, 1);
             await this.VerifyCSharpDiagnosticAsync(testCode, expectedDiagnostic, CancellationToken.None).ConfigureAwait(false);
@@ -308,6 +352,11 @@
                 return NoXmlMultiLineHeaderTestSettings;
             }

+            if (this.useDecoratedXmlMultiLineHeaderTestSettings)
+            {
+                return DecoratedXmlMultiLineHeaderTestSettings;
+            }
+
             return base.GetSettings();
         }


Corrected title bar text - the third number in the version is Build, not Revision.

--- POLUtils/POLUtilsUI.cs
+++ POLUtils/POLUtilsUI.cs
@@ -41,7 +41,7 @@
       this.Icon = Icons.POLViewer;
       {
       Version V = Assembly.GetExecutingAssembly().GetName().Version;
-	this.Text += String.Format(" {0}.{1}.{2}", V.Major, V.Minor, V.Revision);
+	this.Text += String.Format(" {0}.{1}.{2}", V.Major, V.Minor, V.Build);
       }
       this.cmbCultures.Items.AddRange(POLUtils.AvailableCultures.ToArray());
       this.cmbCultures.SelectedItem = CultureChoice.Current;


change constructor of abstract class to be protected

--- Src/Metrics/Reporters/HumanReadableReporter.cs
+++ Src/Metrics/Reporters/HumanReadableReporter.cs
@@ -5,7 +5,7 @@
     {
         private readonly int padding;

-        public HumanReadableReporter(int padding = 20)
+        protected HumanReadableReporter(int padding = 20)
         {
             this.padding = padding;
         }


Improved some test methods in order to communicate better their intent.

--- Src/SemanticComparisonUnitTest/LikenessTest.cs
+++ Src/SemanticComparisonUnitTest/LikenessTest.cs
@@ -1330,16 +1330,17 @@
             // Fixture setup
             var original = new ConcreteType
             {
-                 Property1 = "value1",
-                 Property2 = "value2"
+                Property1 = "value1",
+                Property2 = "value2"
             };

-            var sut = original.AsSource().OfLikeness<ConcreteType>()
+            var likeness = original.AsSource().OfLikeness<ConcreteType>()
                 .Without(x => x.Property1);
-            // Exercise system
-            var result = sut.CreateProxy().Equals(original);
-            // Verify outcome
-            var expected = sut.Equals(original);
+            var expected = likeness.Equals(original);
+            var sut = likeness.CreateProxy();
+            // Exercise system
+            var result = sut.Equals(original);
+            // Verify outcome
             Assert.Equal(expected, result);
             // Teardown
         }
@@ -1349,7 +1350,9 @@
         {
             // Fixture setup
             var expected = 3;
-            var value = new FieldHolder<int>() { Field = expected };
+            var value = new FieldHolder<int>();
+            value.Field = expected;
+
             var sut = value.AsSource().OfLikeness<FieldHolder<int>>()
                 .CreateProxy();
             // Exercise system
@@ -1362,21 +1365,23 @@
         [Fact]
         public void ProxyCanCorrectlyAssignsFieldValuesToTypeWithPublicFieldsAndProperties()
         {
+            // Fixture setup
             var value = new TypeWithPublicFieldsAndProperties();
             value.AutomaticProperty = 1m;
             value.Field = "2";
             value.Number = 3;
-
+
             var sut = value.AsSource()
                 .OfLikeness<TypeWithPublicFieldsAndProperties>()
                 .CreateProxy();
-
-            var result =
+            // Exercise system
+            var result =
                    value.AutomaticProperty == sut.AutomaticProperty
-                && value.Field  == sut.Field
+                && value.Field == sut.Field
                 && value.Number == sut.Number;
-
+            // Verify outcome
             Assert.True(result);
+            // Teardown
         }

         [Fact]
@@ -1410,7 +1415,7 @@
             // Exercise system
             var result =
                    value.AutomaticProperty == sut.AutomaticProperty
-                && value.Field  == sut.Field
+                && value.Field == sut.Field
                 && value.Number == sut.Number;
             // Verify outcome
             Assert.True(result);


notify available clickthru modes when detecting game version

--- TCC.Core/ViewModels/SettingsWindowViewModel.cs
+++ TCC.Core/ViewModels/SettingsWindowViewModel.cs
@@ -10,6 +10,7 @@
 using System.Windows.Interop;
 using System.Windows.Media;
 using System.Windows.Threading;
+using TCC.Analysis;
 using TCC.Data;
 using TCC.Data.Databases;
 using TCC.Interop;
@@ -20,6 +21,7 @@
 using TCC.Update;
 using TCC.Utilities;
 using TCC.Utils;
+using TeraPacketParser;
 using CaptureMode = TCC.Data.CaptureMode;
 using MessageBoxImage = TCC.Data.MessageBoxImage;

@@ -652,7 +654,7 @@
             get
             {
                 var ret = EnumUtils.ListFromEnum<ClickThruMode>();
-                if (!App.Settings.EnableProxy) ret.Remove(ClickThruMode.GameDriven);
+                if (!App.Settings.EnableProxy || PacketAnalyzer.Factory?.ReleaseVersion/100 >= 97) ret.Remove(ClickThruMode.GameDriven);
                 return ret;
             }
         }
@@ -744,7 +746,7 @@
             OpenWindowCommand = new RelayCommand(winType =>
             {
                 var t = (Type) winType;
-                if (TccWindow.IsCreated(t)) return;
+                if (TccWindow.Exists(t)) return;
                 var win = Activator.CreateInstance(t, null) as TccWindow;
                 win?.ShowWindow();
             });
@@ -772,6 +774,12 @@
             ClearChatCommand = new RelayCommand(_ => ChatManager.Instance.ClearMessages());

             MonsterDatabase.BlacklistChangedEvent += MonsterDatabase_BlacklistChangedEvent;
+            MessageFactory.ReleaseVersionChanged += OnReleaseVersionChanged;
+        }
+
+        private void OnReleaseVersionChanged(int obj)
+        {
+            N(nameof(ClickThruModes));
         }

         private void MonsterDatabase_BlacklistChangedEvent(uint arg1, uint arg2, bool arg3)


d

d

Signed-off-by: Emmanuel Mathot <367ff60fe70ac02365998fe620af37ff67ae3274@gmail.com>

--- Terradue.OpenSearch.Test/TestOpenSearchable.cs
+++ Terradue.OpenSearch.Test/TestOpenSearchable.cs
@@ -32,7 +32,7 @@
                 .ToArray();
             url.Query = string.Join("&", array);

-            MemoryOpenSearchRequest request = new MemoryOpenSearchRequest(new OpenSearchUrl(url.ToString()), type);
+            MemoryOpenSearchRequest request = new MemoryOpenSearchRequest(new OpenSearchUrl(url.Uri), type);

             Stream input = request.MemoryInputStream;


refs Falkonry/tracker#815

refs Falkonry/tracker#815

--- test/FalkonryTests.cs
+++ test/FalkonryTests.cs
@@ -763,8 +763,7 @@
      [TestClass()]
     public class TestAddHistoricalData
     {
-        //Falkonry _falkonry = new Falkonry("https://localhost:8080", "auth-token");
-        Falkonry _falkonry = new Falkonry("https://dev.falkonry.ai", "n4qlyqyl7eejz9i2sc1bpi5bz6ry3wvx");
+        Falkonry _falkonry = new Falkonry("https://localhost:8080", "auth-token");

         // Add narrow input data (json format) to multi thing Datastream
         [TestMethod()]
@@ -2094,7 +2093,7 @@
     // [TestClass()]
     public class GetDatastreamData
     {
-        //Falkonry _falkonry = new Falkonry("https://localhost:8080", "auth-token");
+        Falkonry _falkonry = new Falkonry("https://localhost:8080", "auth-token");

         [TestMethod()]
         public void getData()


扫码支持CODABAR格式

扫码支持CODABAR格式


Register google as default geocoder for example app

since it doesn't require an API key

--- examples/Example.Web/Global.asax.cs
+++ examples/Example.Web/Global.asax.cs
@@ -37,14 +37,14 @@
 			//http://developer.yahoo.com/boss/geo/BOSS_Signup.pdf
 			builder.Register(c => new YahooGeocoder("my-yahoo-consumer-key", "my-yahoo-consumer-secret")).As<IGeocoder>();

+			builder.Register(c => new MapQuestGeocoder("mapquest-key") { UseOSM = true }).As<IGeocoder>();
+
 			//https://developers.google.com/maps/documentation/javascript/tutorial#api_key
 			//a server key is optional with Google
 			builder.Register(c => new GoogleGeocoder
 			{
 				//ApiKey = "google-api-key-is-optional"
 			}).As<IGeocoder>();
-
-			builder.Register(c => new MapQuestGeocoder("mapquest-key") { UseOSM = true }).As<IGeocoder>();

 			return builder.Build();
 		}


Try up acomics test.

Try up acomics test.

--- Tests/Tests.Entities/Manga/AcomicsStructure.cs
+++ Tests/Tests.Entities/Manga/AcomicsStructure.cs
@@ -3,6 +3,8 @@
 using System.Threading.Tasks;
 using Acomics;
 using MangaReader.Core.Manga;
+using MangaReader.Core.NHibernate;
+using NHibernate.Linq;
 using NUnit.Framework;

 namespace Tests.Entities.Manga
@@ -60,9 +62,14 @@

     private async Task<Acomics.Acomics> GetManga(string uri)
     {
-      var manga = await Mangas.CreateFromWeb(new Uri(uri)).ConfigureAwait(false) as Acomics.Acomics;
+      var classUri = new Uri(uri);
+      using (var context = Repository.GetEntityContext())
+        foreach (var forDelete in await context.Get<Acomics.Acomics>().Where(m => m.Uri == classUri).ToListAsync().ConfigureAwait(false))
+          await context.Delete(forDelete).ConfigureAwait(false);
+
+      var manga = await Mangas.CreateFromWeb(classUri).ConfigureAwait(false) as Acomics.Acomics;
       await new Parser().UpdateContent(manga).ConfigureAwait(false);
       return manga;
     }
   }
-}+}


Made Read/Write methods of the MidiChunk internal

--- DryWetMidi/Chunks/MidiChunk.cs
+++ DryWetMidi/Chunks/MidiChunk.cs
@@ -78,7 +78,7 @@
         /// in its header.</exception>
         /// <exception cref="NotEnoughBytesException">Size of the chunk cannot be read since the reader's
         /// underlying stream doesn't have enough bytes.</exception>
-        public void Read(MidiReader reader, ReadingSettings settings)
+        internal void Read(MidiReader reader, ReadingSettings settings)
         {
             var size = reader.ReadDword();

@@ -108,7 +108,7 @@
         /// <exception cref="IOException">
         /// An I/O error occurred on the <paramref name="writer"/>'s underlying stream.
         /// </exception>
-        public void Write(MidiWriter writer, WritingSettings settings)
+        internal void Write(MidiWriter writer, WritingSettings settings)
         {
             writer.WriteString(ChunkId);


fixed search content

fixed search content

--- EDEngineer.Models/Blueprint.cs
+++ EDEngineer.Models/Blueprint.cs
@@ -195,7 +195,7 @@
             builder.Append(language.Translate(ShortenedType) + "|");
             builder.Append(language.Translate(Type) + "|");
             builder.Append(language.Translate(BlueprintName) + "|");
-            builder.Append(Prefix + "|");
+            builder.Append(Grade == null ? Prefix : $"G{Grade}" + "|");
             builder.Append(string.Join("|", Engineers) + "|");
             SearchableContent = builder.ToString().ToLowerInvariant();
         }


Improve exception message when object cannot be created

--- source/OpenMagic/Dummy.cs
+++ source/OpenMagic/Dummy.cs
@@ -81,7 +81,14 @@

         protected virtual object CreateObjectInstance(Type type)
         {
-            return Activator.CreateInstance(type);
+            try
+            {
+                return Activator.CreateInstance(type);
+            }
+            catch (Exception exception)
+            {
+                throw new Exception(string.Format("Cannot create instance of {0}.", type), exception);
+            }
         }
     }
 }


Removed non-used string format arguments

--- Core/OfficeDevPnP.Core/Framework/Provisioning/Model/ComposedLook.cs
+++ Core/OfficeDevPnP.Core/Framework/Provisioning/Model/ComposedLook.cs
@@ -60,11 +60,11 @@

         public override int GetHashCode()
         {
-            return (String.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|",
-                (this.BackgroundFile != null ? this.BackgroundFile.GetHashCode() : 0),
-                (this.ColorFile != null ? this.ColorFile.GetHashCode() : 0),
-                (this.FontFile != null ? this.FontFile.GetHashCode() : 0),
-                (this.Name != null ? this.Name.GetHashCode() : 0),
+            return (String.Format("{0}|{1}|{2}|{3}|{4}",
+                BackgroundFile?.GetHashCode() ?? 0,
+                ColorFile?.GetHashCode() ?? 0,
+                FontFile?.GetHashCode() ?? 0,
+                Name?.GetHashCode() ?? 0,
                 this.Version.GetHashCode()
             ).GetHashCode());
         }


Constructor receive <string>id as parameter.

--- Base/Resource.cs
+++ Base/Resource.cs
@@ -59,9 +59,9 @@
         public override string Email => (string)doc.GetProperty("email");
         public override string Phone => (string)doc.GetProperty("phone");

-        public SyncedUser (Dictionary<string, object> vals)
-        {
-            Id = (string)vals["id"];
+        public SyncedUser (string id)
+        {
+            Id = id;
             doc = database.GetDocument(Id);
         }
     }
@@ -159,9 +159,9 @@
             }
         }

-        public Course (Dictionary<string, object> vals)
-        {
-            Id = (string)vals["id"];
+        public Course (string id)
+        {
+            Id = id;
             doc = database.GetDocument(Id);
         }

@@ -199,9 +199,9 @@
         public string Title => (string)doc.GetProperty("title");
         public string Body => (string)doc.GetProperty("body");

-        public Announcement (Dictionary<string, object> vals)
-        {
-            Id = (string)vals["id"];
+        public Announcement (string id)
+        {
+            Id = id;
             doc = database.GetDocument(Id);
         }

@@ -242,9 +242,9 @@
         public int Size => (int)doc.GetProperty("size");
         public string DownloadUrl => (string)doc.GetProperty("download_url");

-        public File (Dictionary<string, object> vals)
-        {
-            Id = (string)vals["id"];
+        public File (string id)
+        {
+            Id = id;
             doc = database.GetDocument(Id);
         }

@@ -306,10 +306,10 @@
         public string Comment => (string)doc.GetProperty("comment");
 		public Attachment CommentAttachment => new Attachment((Dictionary<string, object>)doc.GetProperty("comment_attachment"));

-        public Submission (Dictionary<string, object> vals)
-        {
-            HomeworkId = (string)vals["homework_id"];
-            OwnerId = (string)vals["owner_id"];
+        public Submission (string homeworkId, string ownerId)
+        {
+            HomeworkId = homeworkId;
+            OwnerId = ownerId;
             doc = database.GetDocument(HomeworkId + ":" + OwnerId);
         }

@@ -363,9 +363,9 @@
             }
         }

-        public Homework(Dictionary<string, object> vals)
-        {
-            Id = (string)vals["id"];
+        public Homework(string id)
+        {
+            Id = id;
             doc = database.GetDocument(Id);
         }


An AddProcessing() call was left behind, AddProcessing() is now gone on the framework end.

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -40,18 +40,18 @@
                 Token = Config.Get<string>(OsuConfig.Token)
             };

-            //var req = new ListChannelsRequest();
-            //req.Success += content =>
-            //{
-            //};
-            //API.Queue(req);
+			//var req = new ListChannelsRequest();
+			//req.Success += content =>
+			//{
+			//};
+			//API.Queue(req);

-            AddProcessing(new RatioAdjust());
-
-            //Add(new FontTest());
-
-            Add(new MainMenu());
-            Add(new CursorContainer());
+			Add(new Drawable[]
+			{
+				new RatioAdjust(),
+				new MainMenu(),
+				new CursorContainer()
+			});
         }

         protected override void Dispose(bool isDisposing)


moved windowmode code to LoadComplete (?)

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -234,9 +234,6 @@

             SelectedMods.BindValueChanged(modsChanged);
             Beatmap.BindValueChanged(beatmapChanged, true);
-
-            windowMode = LocalConfig.GetBindable<WindowMode>(OsuSetting.WindowSetting);
-            frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode).Value = windowMode.Value;
         }

         private ExternalLinkOpener externalLinkOpener;
@@ -575,6 +572,9 @@
             BackButton.Receptor receptor;

             dependencies.CacheAs(idleTracker = new GameIdleTracker(6000));
+
+            windowMode = LocalConfig.GetBindable<WindowMode>(OsuSetting.WindowSetting);
+            frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode).Value = windowMode.Value;

             AddRange(new Drawable[]
             {


Fix null reference in release builds

Fix null reference in release builds

Intro may not be initialised yet

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -272,7 +272,7 @@
                 };
             }

-            Action<Visibility> stateChanged = delegate
+            void updateScreenOffset()
             {
                 float offset = 0;

@@ -281,11 +281,11 @@
                 if (notifications.State == Visibility.Visible)
                     offset -= ToolbarButton.WIDTH / 2;

-                intro.MoveToX(offset, SettingsOverlay.TRANSITION_LENGTH, Easing.OutQuint);
-            };
-
-            settings.StateChanged += stateChanged;
-            notifications.StateChanged += stateChanged;
+                screenStack.MoveToX(offset, SettingsOverlay.TRANSITION_LENGTH, Easing.OutQuint);
+            }
+
+            settings.StateChanged += _ => updateScreenOffset();
+            notifications.StateChanged += _ => updateScreenOffset();

             Cursor.State = Visibility.Hidden;
         }


clear

clear

--- Demos/CSharpGL.Demos/10RaycastVolumeRender/RaycastVolumeRenderer.cs
+++ Demos/CSharpGL.Demos/10RaycastVolumeRender/RaycastVolumeRenderer.cs
@@ -202,7 +202,6 @@
             this.backfaceRenderer.Render(arg);
             OpenGL.GetDelegateFor<OpenGL.glBindFramebufferEXT>()(OpenGL.GL_FRAMEBUFFER_EXT, 0);

-            OpenGL.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);
             this.raycastRenderer.Render(arg);
             // need or need not to resume the state of only one active texture unit?
             // glActiveTexture(GL_TEXTURE1);


Brace completion improvements

Brace completion improvements

--- IniLanguageService/AutomaticCompletion/IniBraceCompletionSession.cs
+++ IniLanguageService/AutomaticCompletion/IniBraceCompletionSession.cs
@@ -115,7 +115,8 @@
                 SnapshotPoint closingPoint = ClosingPoint.GetPoint(snapshot);

                 // check caret position
-                if (caret != closingPoint - 1)
+                SnapshotSpan inBetween = new SnapshotSpan(caret.Value, closingPoint - 1);
+                if (!String.IsNullOrWhiteSpace(inBetween.GetText()))
                     return;

                 // move caret after the closing brace


Handled back navigation on subreddit gallery

--- MonocleGiraffe/MonocleGiraffe/ViewModels/SubGalleryPageViewModel.cs
+++ MonocleGiraffe/MonocleGiraffe/ViewModels/SubGalleryPageViewModel.cs
@@ -64,6 +64,13 @@
             {
                 if (mode == NavigationMode.Back)
                 {
+                    if(galleryMetaInfo == null)
+                    {
+                        galleryMetaInfo = BootStrapper.Current.SessionState["GalleryInfo"] as GalleryMetaInfo;
+                        Images = galleryMetaInfo?.Gallery as IncrementalSubredditGallery;
+                        var sub = (await Reddits.SearchSubreddits(Images.Subreddit)).First(s => s.Data.DisplayName == Images.Subreddit);
+                        Sub = new SubredditItem(sub);
+                    }
                     ImageSelectedIndex = galleryMetaInfo?.SelectedIndex ?? 0;
                 }
                 else


Adding IWindowAware feature.

Adding IWindowAware feature.

--- MvvmMonkey.Wpf/MvvmMonkey.Wpf/Advanced/MultiWinWindowManagerImpl.cs
+++ MvvmMonkey.Wpf/MvvmMonkey.Wpf/Advanced/MultiWinWindowManagerImpl.cs
@@ -38,6 +38,11 @@
         {
             var win = (Window)Activator.CreateInstance(WindowType);
             win.DataContext = viewModel;
+            if (viewModel is IWindowAware)
+            {
+                win.Closing += Win_Closing;
+                win.Closed += Win_Closed;
+            }

             if (useViewModelAsContent)
             {
@@ -49,6 +54,26 @@
                 win.Owner = Application.Current.MainWindow;
             }
             return win.ShowDialog();
+        }
+
+        private void Win_Closed(object sender, EventArgs e)
+        {
+            var window = (Window) sender;
+            window.Closing -= Win_Closing;
+            window.Closed -= Win_Closed;
+            var windowAware = window.DataContext as IWindowAware;
+            windowAware?.WindowClosed();
+        }
+
+        private void Win_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+        {
+            var window = (Window)sender;
+            var windowAware = window.DataContext as IWindowAware;
+            if (windowAware != null)
+            {
+                e.Cancel = windowAware.CanWindowClose();
+
+            }
         }

         public void OpenNonModal(object viewModel, bool useViewModelAsContent = false)
@@ -63,4 +88,10 @@
             win.Show();
         }
     }
+
+    public interface IWindowAware
+    {
+        void WindowClosed();
+        bool CanWindowClose();
+    }
 }


Bots will be excluded from user and voice presence logging

--- NadekoBot.Core/Modules/Administration/Services/LogCommandService.cs
+++ NadekoBot.Core/Modules/Administration/Services/LogCommandService.cs
@@ -412,7 +412,7 @@
                     }

                     logChannel = null;
-                    if (logSetting.LogUserPresenceId != null && (logChannel = await TryGetLogChannel(before.Guild, logSetting, LogType.UserPresence)) != null)
+                    if (!before.IsBot && logSetting.LogUserPresenceId != null && (logChannel = await TryGetLogChannel(before.Guild, logSetting, LogType.UserPresence)) != null)
                     {
                         if (before.Status != after.Status)
                         {
@@ -571,7 +571,7 @@
                 try
                 {
                     var usr = iusr as IGuildUser;
-                    if (usr == null)
+                    if (usr == null || usr.IsBot)
                         return;

                     var beforeVch = before.VoiceChannel;


<appveyor debugging>

<appveyor debugging>

--- PS.Build.Tasks.Tests/Tests/Tasks/PreBuildAdaptationExecutionTask.cs
+++ PS.Build.Tasks.Tests/Tests/Tasks/PreBuildAdaptationExecutionTask.cs
@@ -54,7 +54,7 @@
                 builder.AppendLine($"Project {definitionProjectPath} compilation failed.");
                 foreach (var targetResult in result.ResultsByTarget)
                 {
-                    builder.AppendLine($"- Target({targetResult.Value.ResultCode}): {targetResult.Key}, {targetResult.Value.Exception.Message}");
+                    builder.AppendLine($"- Target({targetResult.Value.ResultCode}): {targetResult.Key}, {targetResult.Value.Exception?.Message}");
                 }

                 Assert.Fail(builder.ToString());


fixed up test

fixed up test

--- Palaso.Tests/WritingSystems/WritingSystemDefinitionPropertyTests.cs
+++ Palaso.Tests/WritingSystems/WritingSystemDefinitionPropertyTests.cs
@@ -236,7 +236,7 @@
 		public void LanguageName_Default_ReturnsUnknownLanguage()
 		{
 			var ws = new WritingSystemDefinition();
-			Assert.AreEqual("Unknown Language", ws.LanguageName);
+			Assert.AreEqual("Unlisted Language", ws.LanguageName);
 		}

 		[Test]


No more recursion then calculating references with trees of pair links. Removed logic duplication at LinksSourcesTreeMethods and LinksTargetsTreeMethods classes.

--- Platform/Platform.Data.Core/Pairs/LinksMemoryManager.TreeMethods.cs
+++ Platform/Platform.Data.Core/Pairs/LinksMemoryManager.TreeMethods.cs
@@ -1,66 +1,168 @@
 using System;
 using System.Runtime.CompilerServices;
 using Platform.Data.Core.Collections.Trees;
-using Platform.Helpers;

 namespace Platform.Data.Core.Pairs
 {
-    /// <remarks>
-    /// Устранить дублирование логики.
-    /// </remarks>
     unsafe partial class LinksMemoryManager
     {
-        private class LinksSourcesTreeMethods : SizeBalancedTreeMethods2
+        private abstract class LinksTreeMethodsBase : SizeBalancedTreeMethods2
         {
-            private readonly Link* _links;
-            private readonly LinksHeader* _header;
-
+            protected readonly Link* Links;
+            protected readonly LinksHeader* Header;
+
+            protected LinksTreeMethodsBase(LinksMemoryManager links, LinksHeader* header)
+            {
+                Links = links._links;
+                Header = header;
+            }
+
+            [MethodImpl(MethodImplOptions.AggressiveInlining)]
+            protected abstract ulong GetTreeRoot();
+
+            [MethodImpl(MethodImplOptions.AggressiveInlining)]
+            protected abstract ulong GetBasePartValue(ulong link);
+
+            /// <summary>
+            /// Подсчитывает и возвращает общее количество связей ссылающихся на связь с указанным индексом и "начинающихся" с этой связи (использующих её в качестве Source (начала)).
+            /// </summary>
+            /// <param name="link">Индекс связи.</param>
+            /// <returns>Общее количество связей, "начинающихся" с указанной связи.</returns>
+            public ulong CalculateReferences(ulong link)
+            {
+                var root = GetTreeRoot();
+                var total = GetSize(root);
+
+                var totalRightIgnore = 0UL;
+
+                while (root != 0)
+                {
+                    var @base = GetBasePartValue(root);
+
+                    if (@base <= link)
+                        root = *GetRight(root);
+                    else
+                    {
+                        var rootRight = *GetRight(root);
+                        totalRightIgnore += (rootRight != 0 ? GetSize(rootRight) : 0) + 1;
+
+                        root = *GetLeft(root);
+                    }
+                }
+
+                root = GetTreeRoot();
+
+                var totalLeftIgnore = 0UL;
+
+                while (root != 0)
+                {
+                    var @base = GetBasePartValue(root);
+
+                    if (@base >= link)
+                        root = *GetLeft(root);
+                    else
+                    {
+                        var rootLeft = *GetLeft(root);
+                        totalLeftIgnore += (rootLeft != 0 ? GetSize(rootLeft) : 0) + 1;
+
+                        root = *GetRight(root);
+                    }
+                }
+
+                return total - totalRightIgnore - totalLeftIgnore;
+            }
+
+            /// <summary>
+            /// Выполняет проход по всем связям, "начинающихся" с указанной связи.
+            /// </summary>
+            /// <param name="source">Индекс связи-начала.</param>
+            /// <param name="handler">Функция-обработчик, выполняющая необходимое действие над каждой связью-ссылкой.</param>
+            [MethodImpl(MethodImplOptions.AggressiveInlining)]
+            public bool EachReference(ulong source, Func<ulong, bool> handler)
+            {
+                return EachReferenceCore(source, GetTreeRoot(), handler);
+            }
+
+            // TODO: 1. Move target, handler to separate object. 2. Use stack or walker
+            private bool EachReferenceCore(ulong @base, ulong link, Func<ulong, bool> handler)
+            {
+                if (link == 0)
+                    return true;
+
+                var linkBase = GetBasePartValue(link);
+
+                if (linkBase > @base)
+                {
+                    if (EachReferenceCore(@base, *GetLeft(link), handler) == LinksConstants.Break)
+                        return false;
+                }
+                else if (linkBase < @base)
+                {
+                    if (EachReferenceCore(@base, *GetRight(link), handler) == LinksConstants.Break)
+                        return false;
+                }
+                else //if (linkSource == source)
+                {
+                    if (handler(link) == LinksConstants.Break)
+                        return false;
+
+                    if (EachReferenceCore(@base, *GetLeft(link), handler) == LinksConstants.Break)
+                        return false;
+                    if (EachReferenceCore(@base, *GetRight(link), handler) == LinksConstants.Break)
+                        return false;
+                }
+
+                return true;
+            }
+        }
+
+        private class LinksSourcesTreeMethods : LinksTreeMethodsBase
+        {
             public LinksSourcesTreeMethods(LinksMemoryManager links, LinksHeader* header)
-            {
-                _links = links._links;
-                _header = header;
+                : base(links, header)
+            {
             }

             protected override ulong* GetLeft(ulong node)
             {
-                return &_links[node].LeftAsSource;
+                return &Links[node].LeftAsSource;
             }

             protected override ulong* GetRight(ulong node)
             {
-                return &_links[node].RightAsSource;
+                return &Links[node].RightAsSource;
             }

             protected override ulong GetSize(ulong node)
             {
-                return _links[node].SizeAsSource;
+                return Links[node].SizeAsSource;
             }

             protected override void SetLeft(ulong node, ulong left)
             {
-                _links[node].LeftAsSource = left;
+                Links[node].LeftAsSource = left;
             }

             protected override void SetRight(ulong node, ulong right)
             {
-                _links[node].RightAsSource = right;
+                Links[node].RightAsSource = right;
             }

             protected override void SetSize(ulong node, ulong size)
             {
-                _links[node].SizeAsSource = size;
+                Links[node].SizeAsSource = size;
             }

             protected override bool FirstIsToTheLeftOfSecond(ulong first, ulong second)
             {
-                return _links[first].Source < _links[second].Source ||
-                       (_links[first].Source == _links[second].Source && _links[first].Target < _links[second].Target);
+                return Links[first].Source < Links[second].Source ||
+                       (Links[first].Source == Links[second].Source && Links[first].Target < Links[second].Target);
             }

             protected override bool FirstIsToTheRightOfSecond(ulong first, ulong second)
             {
-                return _links[first].Source > _links[second].Source ||
-                       (_links[first].Source == _links[second].Source && _links[first].Target > _links[second].Target);
+                return Links[first].Source > Links[second].Source ||
+                       (Links[first].Source == Links[second].Source && Links[first].Target > Links[second].Target);
             }

             private bool FirstIsToTheLeftOfSecond(ulong firstSource, ulong firstTarget, ulong secondSource,
@@ -73,6 +175,16 @@
                 ulong secondTarget)
             {
                 return firstSource > secondSource || (firstSource == secondSource && firstTarget > secondTarget);
+            }
+
+            protected override ulong GetTreeRoot()
+            {
+                return Header->FirstAsSource;
+            }
+
+            protected override ulong GetBasePartValue(ulong link)
+            {
+                return Links[link].Source;
             }

             /// <summary>
@@ -84,12 +196,12 @@
             /// <returns>Индекс искомой связи.</returns>
             public ulong Search(ulong source, ulong target)
             {
-                var root = _header->FirstAsSource;
+                var root = Header->FirstAsSource;

                 while (root != 0)
                 {
-                    var rootSource = _links[root].Source;
-                    var rootTarget = _links[root].Target;
+                    var rootSource = Links[root].Source;
+                    var rootTarget = Links[root].Target;

                     if (FirstIsToTheLeftOfSecond(source, target, rootSource, rootTarget)) // node.Key < root.Key
                         root = *GetLeft(root);
@@ -101,175 +213,65 @@

                 return 0;
             }
-
-            /// <summary>
-            /// Подсчитывает и возвращает общее количество связей ссылающихся на связь с указанным индексом и "начинающихся" с этой связи (использующих её в качестве Source (начала)).
-            /// </summary>
-            /// <param name="link">Индекс связи.</param>
-            /// <returns>Общее количество связей, "начинающихся" с указанной связи.</returns>
-            public ulong CalculateReferences(ulong link)
-            {
-                // TODO: Optimize Using node.Size
-
-                var counter = new Counter();
-                EachReference(link, counter.IncrementAndReturnTrue);
-                return counter.Count;
-            }
-
-            /// <summary>
-            /// Выполняет проход по всем связям, "начинающихся" с указанной связи.
-            /// </summary>
-            /// <param name="source">Индекс связи-начала.</param>
-            /// <param name="handler">Функция-обработчик, выполняющая необходимое действие над каждой связью-ссылкой.</param>
-            [MethodImpl(MethodImplOptions.AggressiveInlining)]
-            public bool EachReference(ulong source, Func<ulong, bool> handler)
-            {
-                return EachReferenceCore(source, _header->FirstAsSource, handler);
-            }
-
-            // TODO: 1. Move target, handler to separate object. 2. Use stack or walker
-            private bool EachReferenceCore(ulong source, ulong link, Func<ulong, bool> handler)
-            {
-                if (link == 0)
-                    return true;
-
-                // TODO: Replace with GetFirstKeyValue (so the logic will be united for both sources and targets)
-                var linkSource = _links[link].Source;
-
-                if (linkSource > source)
-                {
-                    if (EachReferenceCore(source, *GetLeft(link), handler) == LinksConstants.Break)
-                        return false;
-                }
-                else if (linkSource < source)
-                {
-                    if (EachReferenceCore(source, *GetRight(link), handler) == LinksConstants.Break)
-                        return false;
-                }
-                else //if (linkSource == source)
-                {
-                    if (handler(link) == LinksConstants.Break)
-                        return false;
-
-                    if (EachReferenceCore(source, *GetLeft(link), handler) == LinksConstants.Break)
-                        return false;
-                    if (EachReferenceCore(source, *GetRight(link), handler) == LinksConstants.Break)
-                        return false;
-                }
-
-                return true;
-            }
         }

-        private class LinksTargetsTreeMethods : SizeBalancedTreeMethods2
+        private class LinksTargetsTreeMethods : LinksTreeMethodsBase
         {
-            private readonly Link* _links;
-            private readonly LinksHeader* _header;
-
             public LinksTargetsTreeMethods(LinksMemoryManager links, LinksHeader* header)
-            {
-                _links = links._links;
-                _header = header;
+                : base(links, header)
+            {
             }

             protected override ulong* GetLeft(ulong node)
             {
-                return &_links[node].LeftAsTarget;
+                return &Links[node].LeftAsTarget;
             }

             protected override ulong* GetRight(ulong node)
             {
-                return &_links[node].RightAsTarget;
+                return &Links[node].RightAsTarget;
             }

             protected override ulong GetSize(ulong node)
             {
-                return _links[node].SizeAsTarget;
+                return Links[node].SizeAsTarget;
             }

             protected override void SetLeft(ulong node, ulong left)
             {
-                _links[node].LeftAsTarget = left;
+                Links[node].LeftAsTarget = left;
             }

             protected override void SetRight(ulong node, ulong right)
             {
-                _links[node].RightAsTarget = right;
+                Links[node].RightAsTarget = right;
             }

             protected override void SetSize(ulong node, ulong size)
             {
-                _links[node].SizeAsTarget = size;
+                Links[node].SizeAsTarget = size;
             }

             protected override bool FirstIsToTheLeftOfSecond(ulong first, ulong second)
             {
-                return _links[first].Target < _links[second].Target ||
-                       (_links[first].Target == _links[second].Target && _links[first].Source < _links[second].Source);
+                return Links[first].Target < Links[second].Target ||
+                       (Links[first].Target == Links[second].Target && Links[first].Source < Links[second].Source);
             }

             protected override bool FirstIsToTheRightOfSecond(ulong first, ulong second)
             {
-                return _links[first].Target > _links[second].Target ||
-                       (_links[first].Target == _links[second].Target && _links[first].Source > _links[second].Source);
-            }
-
-            /// <summary>
-            /// Подсчитывает и возвращает общее количество связей ссылающихся на связь с указанным индексом и "заканчивающихся" этой связью (использующих её в качестве Target (конца)).
-            /// </summary>
-            /// <param name="link">Индекс связи.</param>
-            /// <returns>Общее количество связей, "заканчивающихся" указанной связью.</returns>
-            public ulong CalculateReferences(ulong link)
-            {
-                // TODO: Optimize Using node.Size
-
-                var counter = new Counter();
-                EachReference(link, counter.IncrementAndReturnTrue);
-                return counter.Count;
-            }
-
-            /// <summary>
-            /// Выполняет проход по всем связям "заканчивающимся" указанной связью.
-            /// </summary>
-            /// <param name="target">Индекс связи-конца.</param>
-            /// <param name="handler">Функция-обработчик, выполняющая необходимое действие над каждой связью-ссылкой.</param>
-            [MethodImpl(MethodImplOptions.AggressiveInlining)]
-            public bool EachReference(ulong target, Func<ulong, bool> handler)
-            {
-                return EachReferenceCore(target, _header->FirstAsTarget, handler);
-            }
-
-            // TODO: 1. Move target, handler to separate object. 2. Use stack or walker
-            private bool EachReferenceCore(ulong target, ulong link, Func<ulong, bool> handler)
-            {
-                if (link == 0)
-                    return true;
-
-                // TODO: Replace with GetFirstKeyValue (so the logic will be united for both sources and targets)
-                var linkTarget = _links[link].Target;
-
-                if (linkTarget > target)
-                {
-                    if (EachReferenceCore(target, *GetLeft(link), handler) == LinksConstants.Break)
-                        return false;
-                }
-                else if (linkTarget < target)
-                {
-                    if (EachReferenceCore(target, *GetRight(link), handler) == LinksConstants.Break)
-                        return false;
-                }
-                else //if (linkTarget == target)
-                {
-                    if (handler(link) == LinksConstants.Break)
-                        return false;
-
-                    if (EachReferenceCore(target, *GetLeft(link), handler) == LinksConstants.Break)
-                        return false;
-                    if (EachReferenceCore(target, *GetRight(link), handler) == LinksConstants.Break)
-                        return false;
-                }
-
-                return true;
+                return Links[first].Target > Links[second].Target ||
+                       (Links[first].Target == Links[second].Target && Links[first].Source > Links[second].Source);
+            }
+
+            protected override ulong GetTreeRoot()
+            {
+                return Header->FirstAsTarget;
+            }
+
+            protected override ulong GetBasePartValue(ulong link)
+            {
+                return Links[link].Target;
             }
         }
     }


improved the switch response construction and reuse in multiple version switch receive filter

--- Protocols/WebSocket/ReceiveFilters/WebSocketReceiveFilterFactory.cs
+++ Protocols/WebSocket/ReceiveFilters/WebSocketReceiveFilterFactory.cs
@@ -43,29 +43,26 @@

     class MultipleProtocolSwitchReceiveFilterFactory : IWebSocketReceiveFilterFactory
     {
-        protected int[] m_Versions;
+        private byte[] m_SwitchResponse;

         public MultipleProtocolSwitchReceiveFilterFactory(int[] versions)
         {
-            m_Versions = versions;
+            var responseBuilder = new StringBuilder();
+
+            responseBuilder.AppendWithCrCf("HTTP/1.1 400 Bad Request");
+            responseBuilder.AppendWithCrCf("Upgrade: WebSocket");
+            responseBuilder.AppendWithCrCf("Connection: Upgrade");
+            responseBuilder.AppendWithCrCf("Sec-WebSocket-Version: " + string.Join(", ", versions.Select(i => i.ToString()).ToArray()));
+            responseBuilder.AppendWithCrCf();
+
+            m_SwitchResponse = Encoding.UTF8.GetBytes(responseBuilder.ToString());
         }

         public int Version { get { return 0; } }

         public bool TryHandshake(WebSocketContext context, out IWebSocketReceiveFilter filter)
         {
-            var responseBuilder = new StringBuilder();
-
-            responseBuilder.AppendWithCrCf("HTTP/1.1 400 Bad Request");
-            responseBuilder.AppendWithCrCf("Upgrade: WebSocket");
-            responseBuilder.AppendWithCrCf("Connection: Upgrade");
-            responseBuilder.AppendWithCrCf("Sec-WebSocket-Version: " + string.Join(", ", m_Versions.Select(i => i.ToString()).ToArray()));
-            responseBuilder.AppendWithCrCf();
-
-            var switchResponse = Encoding.UTF8.GetBytes(responseBuilder.ToString());
-
-            filter = new MultipleProtocolSwitchReceiveFilter(switchResponse);
-
+            filter = new MultipleProtocolSwitchReceiveFilter(m_SwitchResponse);
             return true;
         }
     }


#704 Generate Requirements.txt on Invalid Environment Handles FileNotFoundException when listing packages. Also disables generate/install requirements.txt commands when not able to install packages.

--- Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs
+++ Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs
@@ -1204,8 +1204,10 @@
                 switch ((int)cmd) {
                     case PythonConstants.OpenInteractiveForEnvironment:
                     case PythonConstants.InstallPythonPackage:
+                    case PythonConstants.InstallRequirementsTxt:
+                    case PythonConstants.GenerateRequirementsTxt:
                         var factory = GetInterpreterFactory();
-                        if (Interpreters.IsAvailable(factory) && File.Exists(factory.Configuration.InterpreterPath)) {
+                        if (factory.IsRunnable()) {
                             result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
                         } else {
                             result |= QueryStatusResult.INVISIBLE;
@@ -1888,7 +1890,7 @@
             if (selectedInterpreterFactory != null) {
                 GenerateRequirementsTxtAsync(selectedInterpreterFactory)
                     .SilenceException<OperationCanceledException>()
-                    .HandleAllExceptions(SR.ProductName)
+                    .HandleAllExceptions(SR.ProductName, GetType())
                     .DoNotWait();
             }
             return VSConstants.S_OK;
@@ -1897,6 +1899,23 @@
         private async Task GenerateRequirementsTxtAsync(IPythonInterpreterFactory factory) {
             var projectHome = ProjectHome;
             var txt = CommonUtils.GetAbsoluteFilePath(projectHome, "requirements.txt");
+
+            HashSet<string> items = null;
+
+            try {
+                items = await Pip.Freeze(factory);
+            } catch (FileNotFoundException ex) {
+                // Other exceptions should not occur, so let them propagate
+                var dlg = TaskDialog.ForException(
+                    Site,
+                    ex,
+                    SR.GetString(SR.MissingEnvironment, factory.Description, factory.Configuration.Version),
+                    IssueTrackerUrl
+                );
+                dlg.Title = SR.ProductName;
+                dlg.ShowModal();
+                return;
+            }

             string[] existing = null;
             bool addNew = false;
@@ -1946,8 +1965,6 @@
                 }
             }

-            var items = await Pip.Freeze(factory);
-
             if (File.Exists(txt) && !QueryEditFiles(false, txt)) {
                 return;
             }


fix wpf clipboard functionality (#1121)

fix wpf clipboard functionality (#1121)

--- ReactWindows/ReactNative.Net46/Modules/Clipboard/ClipboardModule.cs
+++ ReactWindows/ReactNative.Net46/Modules/Clipboard/ClipboardModule.cs
@@ -43,16 +43,18 @@
                 throw new ArgumentNullException(nameof(promise));
             }

-            if (_clipboard.ContainsText())
+            DispatcherHelpers.RunOnDispatcher(() =>
             {
-                var text = _clipboard.GetText();
-                promise.Resolve(text);
-            }
-            else
-            {
-                promise.Resolve("");
-            }
-
+                if (_clipboard.ContainsText())
+                {
+                    var text = _clipboard.GetText();
+                    promise.Resolve(text);
+                }
+                else
+                {
+                    promise.Resolve("");
+                }
+            });
         }

         /// <summary>
@@ -62,7 +64,10 @@
         [ReactMethod]
         public void setString(string text)
         {
-            _clipboard.SetText(text);
+            DispatcherHelpers.RunOnDispatcher(new Action(() =>
+            {
+                _clipboard.SetText(text);
+            }));
         }
     }
 }


ActivityInfo, CommentInfoでhtml読み込みに識別可能タグの漏れがあったので修正

--- SnkLib.MainLibrary/Web.GooglePlus/ActivityContent/ContentElement.cs
+++ SnkLib.MainLibrary/Web.GooglePlus/ActivityContent/ContentElement.cs
@@ -97,9 +97,27 @@
                 else
                     switch (contentHtml[idx + 1])
                     {
-                        case 's':
-                        case 'b':
-                        case 'i':
+                        case '/':
+                            var currentEleChildren = blocks.Pop().ToArray();
+                            switch (currentEleStack.Pop())
+                            {
+                                case 'b':
+                                    blocks.Peek().Add(new StyleElement(StyleType.Bold, currentEleChildren));
+                                    break;
+                                case 'i':
+                                    blocks.Peek().Add(new StyleElement(StyleType.Italic, currentEleChildren));
+                                    break;
+                                case 's':
+                                case 'd':
+                                    blocks.Peek().Add(new StyleElement(StyleType.Middle, currentEleChildren));
+                                    break;
+                                default:
+                                    blocks.Peek().Add(new StyleElement(StyleType.Unknown, currentEleChildren));
+                                    break;
+                            }
+                            nextReadIdx = Math.Max(nextReadIdx + 1, contentHtml.IndexOf('>', idx + 2) + 1);
+                            break;
+                        default:
                             startIdx = idx + 3;
                             var closeEleIdx = contentHtml.IndexOf("</", startIdx);
                             var otherStartEleIdx = contentHtml.IndexOf("<", startIdx);
@@ -117,7 +135,11 @@
                                         blocks.Peek().Add(new StyleElement(StyleType.Italic, elements));
                                         break;
                                     case 's':
+                                    case 'd':
                                         blocks.Peek().Add(new StyleElement(StyleType.Middle, elements));
+                                        break;
+                                    default:
+                                        blocks.Peek().Add(new StyleElement(StyleType.Unknown, elements));
                                         break;
                                 }
                                 nextReadIdx = closeEleIdx + 4;
@@ -134,22 +156,6 @@
                                 currentEleStack.Push(contentHtml[idx + 1]);
                                 nextReadIdx = otherStartEleIdx;
                             }
-                            break;
-                        case '/':
-                            var currentEleChildren = blocks.Pop().ToArray();
-                            switch (currentEleStack.Pop())
-                            {
-                                case 'b':
-                                    blocks.Peek().Add(new StyleElement(StyleType.Bold, currentEleChildren));
-                                    break;
-                                case 'i':
-                                    blocks.Peek().Add(new StyleElement(StyleType.Italic, currentEleChildren));
-                                    break;
-                                case 's':
-                                    blocks.Peek().Add(new StyleElement(StyleType.Middle, currentEleChildren));
-                                    break;
-                            }
-                            nextReadIdx = Math.Max(nextReadIdx + 1, contentHtml.IndexOf('>', idx + 2) + 1);
                             break;
                     }
             }
@@ -277,5 +283,5 @@
     }

     public enum ElementType { Text, Mension, Hyperlink, Style, Break }
-    public enum StyleType { Bold = 0, Italic = 1, Middle = 2, None = 3 }
+    public enum StyleType { Bold = 0, Italic = 1, Middle = 2, None = 3, Unknown = 4 }
 }


Skip NPM tests

Skip NPM tests

--- Tests/Boilerplate.FeatureSelection.FunctionalTest/MVC6SampleTest.cs
+++ Tests/Boilerplate.FeatureSelection.FunctionalTest/MVC6SampleTest.cs
@@ -156,7 +156,7 @@
             await this.tester.AssertDotnetBuildSucceeded();
         }

-        [Theory]
+        [Theory(Skip = "Skip NPM tests")]
         [InlineData(typeof(ApplicationInsightsFeature), true)]
         [InlineData(typeof(GooglePageSpeedFeature), true)]
         [InlineData(typeof(JavaScriptCodeStyleFeature), false)]


feat(CupLabeling): Consistency [Imperfect]

--- CV_Processing.cs
+++ CV_Processing.cs
@@ -86,7 +86,7 @@
 		    output.Draw( box, bgrRed, 2 );

         if ( frame != null && CV_Program.TrackCups)
-			    CvInvoke.PutText( frame, "[" + ( i + 1 ) + "]", new System.Drawing.Point( box.Location.X + 5, box.Location.Y - 10 ), FontFace.HersheyPlain, 1.25, new MCvScalar( 255, 0, 255 ), 2 );
+          CvInvoke.PutText( frame, "[" + ( GetCupNum(box) + 1 ) + "]", new System.Drawing.Point( box.Location.X + 5, box.Location.Y - 10 ), FontFace.HersheyPlain, 1.25, new MCvScalar( 255, 0, 255 ), 2 );
       }
     }

@@ -122,5 +122,41 @@
       CvInvoke.InRange( hsv_image, lower, upper, output );
     }

+    public static int GetCupNum( Rectangle Box )
+    {
+      int   n = -1;
+      float d = -1.0f;
+
+      for ( int i = 0; i < 3; i++ )
+      {
+        float newDist = GetDistance( Box, CV_Program.Cups[i].BoundingBox );
+        if ( newDist < d || d == -1.0f)
+        {
+          n = i;
+          d = newDist;
+        }
+      }
+
+      return n;
+    }
+
+    public static float GetDistance( Rectangle rect1, Rectangle rect2 )
+    {
+      Point center1 = Center( rect1 );
+      Point center2 = Center( rect2 );
+
+      float horizontalDistance = ( center2.X - center1.X );
+      float verticalDistance   = ( center2.Y - center1.Y );
+
+      float distance = (float) Math.Sqrt( ( horizontalDistance * horizontalDistance ) + ( verticalDistance * verticalDistance ) );
+
+	    return distance;
+    }
+
+    public static Point Center( Rectangle rect )
+    {
+      return new Point( rect.Left + rect.Width / 2, rect.Top + rect.Height / 2);
+    }
+
   }
 }


Update test.cs

Update test.cs

Commented code to point out that this function assumes that all points are in the first quadrant. The purpose of the function is to test a point against a polygon to see if its inside or outside by comparing a ray against the count of intersections. Adjust the ray if there are points that are negative.

--- GrinerTest/PolygonClip/test.cs
+++ GrinerTest/PolygonClip/test.cs
@@ -32,7 +32,12 @@
             Node aux, left, i;
             int type = 0;
             i = new Node();
-
+            /*
+             * Note that this create call uses '0' as the x value. This works fine
+             * as long as all points are in the first quadrant. If you have negative
+             * points this call should find a point larger or smaller than all
+             * points in the test polygon denoted by 'p'
+             */
             left = create(0, point.y, null,null,null,null , 0, 0, 0, 0);
             for (aux = p; aux.next != null; aux = aux.next)
             {


ShowGap Fix for TradeIndication 0930 -> 0915

ShowGap Fix for TradeIndication 0930 -> 0915

--- Indicator/ShowGap_Indicator.cs
+++ Indicator/ShowGap_Indicator.cs
@@ -209,7 +209,7 @@

 //09.15. - 09.30 Kerze
 //            else if (Bars.BarsSinceSession == 6 && existgap == true)
-            else if (Bars[0].Time.TimeOfDay == new TimeSpan(9,30,0))
+            else if (Bars[0].Time.TimeOfDay == new TimeSpan(9,15,0))
             {
 //Auswertung nach ShowGap Handelszeit (=09.30)
                 printAuswertung();


read and write users in dirs, not just single XML files

--- server/users.cs
+++ server/users.cs
@@ -35,6 +35,8 @@
         public bool verified = false;

         public int GUID = -1;
+
+        List<Player> players = new List<Player>();
     }

     public class Usermanager
@@ -118,9 +120,6 @@
             user.verified = false;

             users.Add(user);
-
-            //write user
-

             return true;
         }
@@ -130,7 +129,11 @@
             if (!dir.Exists)
                 return;

-            FileInfo f = new FileInfo(Path.Combine(dir.FullName, user.GUID.ToString() + ".xml"));
+            DirectoryInfo userDir = new DirectoryInfo(Path.Combine(dir.FullName, user.GUID.ToString()));
+            if (!userDir.Exists)
+                userDir.Create();
+
+            FileInfo f = new FileInfo(Path.Combine(userDir.FullName, "user.xml"));

             FileStream fs = f.OpenWrite();
             StreamWriter file = new StreamWriter(fs);
@@ -147,13 +150,13 @@
             if (!dir.Exists)
                 return false;

-            FileInfo f = new FileInfo(dir.FullName + "/" + user.GUID.ToString() + ".xml");
+            // blow out the dir
+            DirectoryInfo userDir = new DirectoryInfo(Path.Combine(dir.FullName, user.GUID.ToString()));
+            if (userDir.Exists)
+                userDir.Delete(true);

-            if (f.Exists)
-                f.Delete();
-
-            if (!users.Contains(user))
-                return false;
+            // purge games/players/etc..
+            // that others may be using before we kill it.

             users.Remove(user);


Fix covers being loaded even when off-screen

--- osu.Game/Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs
+++ osu.Game/Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs
@@ -25,23 +25,26 @@

         protected override Drawable CreateDrawable(BeatmapInfo model)
         {
-            Drawable drawable;
+            return new DelayedLoadUnloadWrapper(() => {
+                Drawable drawable;

-            var localBeatmap = beatmaps.GetWorkingBeatmap(model);
+                var localBeatmap = beatmaps.GetWorkingBeatmap(model);

-            if (localBeatmap.BeatmapInfo.ID == 0 && model?.BeatmapSet?.OnlineInfo != null)
-                drawable = new BeatmapSetCover(model.BeatmapSet);
-            else
-                drawable = new BeatmapBackgroundSprite(localBeatmap);
+                if (localBeatmap.BeatmapInfo.ID == 0 && model?.BeatmapSet?.OnlineInfo != null)
+                    drawable = new BeatmapSetCover(model.BeatmapSet);
+                else
+                    drawable = new BeatmapBackgroundSprite(localBeatmap);

-            drawable.RelativeSizeAxes = Axes.Both;
-            drawable.Anchor = Anchor.Centre;
-            drawable.Origin = Anchor.Centre;
-            drawable.FillMode = FillMode.Fill;
+                drawable.RelativeSizeAxes = Axes.Both;
+                drawable.Anchor = Anchor.Centre;
+                drawable.Origin = Anchor.Centre;
+                drawable.FillMode = FillMode.Fill;
+                drawable.OnLoadComplete = d => d.FadeInFromZero(400);

-            return drawable;
+                return drawable;
+            }, 500, 10000);
         }

-        protected override double FadeDuration => 400;
+        protected override double FadeDuration => 0;
     }
 }


Revert "Buffer the entire star rating range to fix overlapping alpha"

This reverts commit c680012523ff9f4a1e8ab10f788401a9f3b68986.

--- osu.Game/Screens/OnlinePlay/Components/StarRatingRangeDisplay.cs
+++ osu.Game/Screens/OnlinePlay/Components/StarRatingRangeDisplay.cs
@@ -33,41 +33,38 @@
         [BackgroundDependencyLoader]
         private void load()
         {
-            InternalChild = new BufferedContainer
+            InternalChildren = new Drawable[]
             {
-                AutoSizeAxes = Axes.Both,
-                Children = new Drawable[]
+                new Container
                 {
-                    new Container
+                    RelativeSizeAxes = Axes.Both,
+                    Masking = true,
+                    CornerRadius = 1,
+                    Children = new[]
                     {
-                        RelativeSizeAxes = Axes.Both,
-                        Padding = new MarginPadding { Vertical = 1 },
-                        Children = new[]
+                        minBackground = new Box
                         {
-                            minBackground = new Box
-                            {
-                                Anchor = Anchor.TopCentre,
-                                Origin = Anchor.TopCentre,
-                                RelativeSizeAxes = Axes.Both,
-                                Size = new Vector2(0.5f),
-                            },
-                            maxBackground = new Box
-                            {
-                                Anchor = Anchor.BottomCentre,
-                                Origin = Anchor.BottomCentre,
-                                RelativeSizeAxes = Axes.Both,
-                                Size = new Vector2(0.5f),
-                            },
-                        }
-                    },
-                    new FillFlowContainer
+                            Anchor = Anchor.TopCentre,
+                            Origin = Anchor.TopCentre,
+                            RelativeSizeAxes = Axes.Both,
+                            Size = new Vector2(0.5f),
+                        },
+                        maxBackground = new Box
+                        {
+                            Anchor = Anchor.BottomCentre,
+                            Origin = Anchor.BottomCentre,
+                            RelativeSizeAxes = Axes.Both,
+                            Size = new Vector2(0.5f),
+                        },
+                    }
+                },
+                new FillFlowContainer
+                {
+                    AutoSizeAxes = Axes.Both,
+                    Children = new Drawable[]
                     {
-                        AutoSizeAxes = Axes.Both,
-                        Children = new Drawable[]
-                        {
-                            minDisplay = new StarRatingDisplay(default),
-                            maxDisplay = new StarRatingDisplay(default)
-                        }
+                        minDisplay = new StarRatingDisplay(default),
+                        maxDisplay = new StarRatingDisplay(default)
                     }
                 }
             };


* Minor fix to CompressedUpdateHandler that I forgot

git-svn-id: baf6e02d125cf6f9bfcfe153b2eb83d6e1f5ace6@490 52acb1d6-8a22-11de-b505-999d5b087335

--- libsecondlife-cs/ObjectManager.cs
+++ libsecondlife-cs/ObjectManager.cs
@@ -553,6 +553,7 @@
                     {
                         //TODO: use this
                         LLVector3 Omega = new LLVector3(block.Data, i);
+                        i += 12;
                     }

                     if ((flags & 0x08) != 0)


Fix as per #455. Thx peter.

Fix as per #455. Thx peter.

git-svn-id: b16d2c2f79895eba805d8254311bfe28536746dd@1427 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife/InventoryManager.cs
+++ libsecondlife/InventoryManager.cs
@@ -1504,7 +1504,10 @@

         private void EndRequestFolderContents(IAsyncResult result)
         {
-            result.AsyncWaitHandle.WaitOne();
+            if (!(result is DescendantsResult))
+                throw new ArgumentException("result parameter must be the return value of InventoryManager.BeginRequestFolderContents");
+            DescendantsResult req = result as DescendantsResult;
+            req.AsyncWaitHandle.WaitOne();
         }

         private DescendantsResult InternalFolderContentsRequest(LLUUID folder, LLUUID owner, DescendantsResult parameters)
@@ -1570,7 +1573,13 @@
                             }
                         }
                         if (done)
-                            result.IsCompleted = true;
+                        {
+                             result.IsCompleted = true;
+                            if (result.Parent != null)
+                            {
+                                result.Parent.ChildComplete(result);
+                            }
+                        }
                     }
                     else
                     {
@@ -2073,10 +2082,15 @@
     class InventoryResultBase : IAsyncResult
     {
         private AsyncCallback Callback;
-        public InventoryResultBase(AsyncCallback callback)
-        {
-            Callback = callback;
-        }
+         public InventoryResultBase(AsyncCallback callback)
+         {
+            Callback = callback;
+        }
+        public InventoryResultBase(AsyncCallback callback, ManualResetEvent waitHandle)
+        {
+             Callback = callback;
+            _AsyncWaitHandle = waitHandle;
+         }

         private string[] path;

@@ -2171,7 +2185,7 @@
         #endregion Properties

         public DescendantsResult(AsyncCallback callback)
-            : base(callback) { }
+            : base(callback, new ManualResetEvent(false)) {}

         public void AddChild(DescendantsResult child)
         {
@@ -2188,7 +2202,13 @@
             {
                 _ChildrenWaiting.Remove(child);
                 if (_ChildrenWaiting.Count == 0)
-                    IsCompleted = true;
+                {
+                     IsCompleted = true;
+                    if (Parent != null)
+                    {
+                        Parent.ChildComplete(this);
+                    }
+                }
             }
         }
     }


Moved the official Umbraco upgrade guides further up the page

--- data/__template.cshtml
+++ data/__template.cshtml
@@ -125,6 +125,11 @@

Find out about upcoming releases, what features will be included and how to contribute on the Our Umbraco releases page.

Upgrade Paths

+
For official upgrade guidelines, see the following links on Our Umbraco:

+

+
Upgrading to version 7

+
Upgrading an existing Umbraco installation

+

The general recommended upgrade path is to go from the last patch release up to the next major version release:

                         2.1.x  » 3.0.0 » 3.0.6 » 4.0.1 » 4.0.4.2

@@ -148,7 +153,6 @@

April/May 2013 - two major vulnerabilities found. Read more on the Umbraco blog post.

Security patches for all Umbraco releases are available.

-

4.5.0     [mirror]

4.5.1     [mirror]

@@ -171,13 +175,6 @@

Cultiv: How to diagnose Umbraco upgrade problems

Blix: Follow the path: Upgrading Umbraco from V4 to V7

-                            Our Umbraco (new) docs:
-

-
Upgrading to version 7

-
Upgrading an existing Umbraco installation

-

-

-

                             Our Umbraco (old) wiki:

Upgrading an Umbraco installation


PlayerEngine: avoid spurious *Stream events

Since we merged GStreamer 1.0 support, MediaEngineTests
started failing. They highlighted some events being
received which didn't make much sense. After digging,
I found out that there's a subtle difference in the
order of events that we receive from GStreamer 1.x,
comparing it to the one we got from GStreamer 0.10.

This is from GStreamer 0.10:

[1 Debug 01:22:48.263] Player state change: Idle -> Loading
[1 Debug 01:22:48.346] Player state change: Loading -> Loaded
[1 Debug 01:22:48.352] (libbanshee:player) Triggering track-change signal
[1 Debug 01:22:48.360] Player state change: Loaded -> Playing

And this is from GStreamer 1.x:

[1 Debug 01:31:15.719] Player state change: Idle -> Loading
[1 Debug 01:31:15.793] (libbanshee:player) Triggering track-change signal
[1 Debug 01:31:15.804] Player state change: Loading -> Loaded
[1 Debug 01:31:15.810] Player state change: Loaded -> Playing

This shouldn't have much repercussion you might think, but it
turns out that our Gapless support was relying on this order:
if a track-change signal was received and we're *not* in Loaded
state, it means a transition: so we need to send an EndOfStream
event, a StartOfStream event, aaaand increment the playcount of
the previous song.

Now this code must take in account how GStreamer 1.x sends
events, so it needs to check against the Loading (not just
Loaded) state.

This may have caused subtle bugs, especially regarding the
playcount, and especially considering that some of our
lovely packagers of some distros decided to include the
GStreamer 1.x support patches as downstream patches. This
means, that I'm going to backport this fix as well to the
stable branch so we can keep things in order for upcoming
2.6.2 version.

This tests makes the test pass again when using the native
backend. I'm *not* modifying the GStreamerSharp (managed)
backend yet because other tests are still failing for that
one, and the code for this is slightly different there
(i.e. it doesn't have the GaplessEnabled check.

--- src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs
+++ src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs
@@ -423,7 +423,7 @@

                 // If the state is anything other than loaded, assume we were just playing a track and should
                 // EoS it and increment its playcount etc.
-                if (CurrentState != PlayerState.Loaded) {
+                if (CurrentState != PlayerState.Loaded && CurrentState != PlayerState.Loading) {
                     ServiceManager.PlayerEngine.IncrementLastPlayed (1.0);
                     OnEventChanged (PlayerEvent.EndOfStream);
                     OnEventChanged (PlayerEvent.StartOfStream);


New overloads of SPModelManager.Create

New overloads of SPModelManager.Create

--- src/Codeless.SharePoint/SharePoint/ObjectModel/SPModelManager.cs
+++ src/Codeless.SharePoint/SharePoint/ObjectModel/SPModelManager.cs
@@ -1,6 +1,7 @@
 using Microsoft.Office.Server.Search.Query;
 using Microsoft.SharePoint;
 using System.Collections.Generic;
+using System.IO;
 using System.Threading;

 namespace Codeless.SharePoint.ObjectModel {
@@ -245,6 +246,26 @@
     }

     /// <summary>
+    /// Creates an item of the associated content type.
+    /// If the content type derives from File or Folder, a random name is used. See <see cref="Create(string)"/>.
+    /// </summary>
+    /// <param name="modelType">Item type.</param>
+    /// <returns>An item of the specified content type.</returns>
+    public T Create(System.Type modelType) {
+      return Create(modelType, Path.GetRandomFileName());
+    }
+
+    /// <summary>
+    /// Creates an item of the associated content type with the given file or folder name.
+    /// </summary>
+    /// <param name="modelType">Item type.</param>
+    /// <param name="name">File or folder name.</param>
+    /// <returns>An item of the specified content type.</returns>
+    public new T Create(System.Type modelType, string name) {
+      return base.Create(modelType, name);
+    }
+
+    /// <summary>
     /// Deletes the specified item from a list.
     /// </summary>
     /// <param name="item">An item to be deleted.</param>


Comment IMetadataStringDecoderProvider

Comment IMetadataStringDecoderProvider

--- src/Common/src/TypeSystem/Ecma/IMetadataStringDecoderProvider.cs
+++ src/Common/src/TypeSystem/Ecma/IMetadataStringDecoderProvider.cs
@@ -6,6 +6,10 @@

 namespace Internal.TypeSystem.Ecma
 {
+    /// <summary>
+    /// Interface implemented by TypeSystemContext to provide MetadataStringDecoder
+    /// instance for MetadataReaders created by the type system.
+    /// </summary>
     public interface IMetadataStringDecoderProvider
     {
         MetadataStringDecoder GetMetadataStringDecoder();


fix a regression in issue #530. On machine without PS installed, dialog throws after installing a package. Work items: 530

--- src/Dialog/PackageManagerUI/BaseProvider/PackagesProviderBase.cs
+++ src/Dialog/PackageManagerUI/BaseProvider/PackagesProviderBase.cs
@@ -321,15 +321,21 @@
         }

         private void OnPackageInstalled(object sender, PackageOperationEventArgs e) {
-            _scriptExecutor.Execute(e.InstallPath, "init.ps1", e.Package, null, this);
+            if (e.Package.HasPowerShellScript(new string[] { "init.ps1" })) {
+                _scriptExecutor.Execute(e.InstallPath, "init.ps1", e.Package, null, this);
+            }
         }

         private void OnPackageReferenceAdded(object sender, PackageOperationEventArgs e) {
-            _scriptExecutor.Execute(e.InstallPath, "install.ps1", e.Package, _project, this);
+            if (e.Package.HasPowerShellScript(new string[] { "install.ps1" })) {
+                _scriptExecutor.Execute(e.InstallPath, "install.ps1", e.Package, _project, this);
+            }
         }

         private void OnPackageReferenceRemoving(object sender, PackageOperationEventArgs e) {
-            _scriptExecutor.Execute(e.InstallPath, "uninstall.ps1", e.Package, _project, this);
+            if (e.Package.HasPowerShellScript(new string[] { "uninstall.ps1" })) {
+                _scriptExecutor.Execute(e.InstallPath, "uninstall.ps1", e.Package, _project, this);
+            }
         }
     }
 }


Make ILSpan internal

Make ILSpan internal

--- src/ExpressionEvaluator/Core/Source/ExpressionCompiler/ILSpan.cs
+++ src/ExpressionEvaluator/Core/Source/ExpressionCompiler/ILSpan.cs
@@ -7,7 +7,7 @@
 namespace Microsoft.CodeAnalysis.ExpressionEvaluator
 {
     // TODO: use TextSpan?
-    public struct ILSpan : IEquatable<ILSpan>
+    internal struct ILSpan : IEquatable<ILSpan>
     {
         public static readonly ILSpan MaxValue = new ILSpan(0, uint.MaxValue);


Fixed some issues involving the new filter sets and the handling of inclusion and exclusion rules.

--- src/Extensions/NAnt/Gallio.NAntTasks.Tests/GallioTaskUnitTest.cs
+++ src/Extensions/NAnt/Gallio.NAntTasks.Tests/GallioTaskUnitTest.cs
@@ -51,7 +51,7 @@
             {
                 Assert.IsFalse(launcher.DoNotRun);
                 Assert.IsTrue(launcher.EchoResults);
-                Assert.IsInstanceOfType(typeof(AnyFilter<ITest>), launcher.TestExecutionOptions.FilterSet);
+                Assert.IsTrue(launcher.TestExecutionOptions.FilterSet.IsEmpty);
                 Assert.IsInstanceOfType(typeof(TaskLogger), launcher.Logger);
                 Assert.IsInstanceOfType(typeof(LogProgressMonitorProvider), launcher.ProgressMonitorProvider);
                 Assert.AreEqual("", launcher.ReportDirectory);