Softmaxをリファクタリング

Softmaxをリファクタリング

--- KelpNet/Functions/Activations/Softmax.cs
+++ KelpNet/Functions/Activations/Softmax.cs
@@ -17,15 +17,17 @@
         {
             Real[] y = new Real[x.Data.Length];

+            int indexOffset = 0;
+
             for (int b = 0; b < x.BatchCount; b++)
             {
-                Real maxval = x.Data[b * x.Length];
+                Real maxval = x.Data[indexOffset];

                 for (int i = 1; i < x.Length; i++)
                 {
-                    if (maxval < x.Data[i + b * x.Length])
+                    if (maxval < x.Data[indexOffset + i])
                     {
-                        maxval = x.Data[i + b * x.Length];
+                        maxval = x.Data[indexOffset + i];
                     }
                 }

@@ -33,14 +35,16 @@

                 for (int i = 0; i < x.Length; i++)
                 {
-                    y[i + b * x.Length] = Math.Exp(x.Data[i + b * x.Length] - maxval);
-                    sumval += y[i + b * x.Length];
+                    y[indexOffset + i] = Math.Exp(x.Data[indexOffset + i] - maxval);
+                    sumval += y[indexOffset + i];
                 }

                 for (int i = 0; i < x.Length; i++)
                 {
-                    y[i + b * x.Length] /= sumval;
+                    y[indexOffset + i] /= sumval;
                 }
+
+                indexOffset += x.Length;
             }

             return NdArray.Convert(y, x.Shape, x.BatchCount, this);
@@ -50,20 +54,24 @@
         {
             Real[] gx = new Real[y.Grad.Length];

+            int indexOffset = 0;
+
             for (int b = 0; b < y.BatchCount; b++)
             {
                 Real sumdx = 0;

                 for (int i = 0; i < y.Length; i++)
                 {
-                    gx[i + b * y.Length] = y.Data[i + b * y.Length] * y.Data[i + b * y.Length];
-                    sumdx += gx[i + b * y.Length];
+                    gx[indexOffset + i] = y.Data[indexOffset + i] * y.Data[indexOffset + i];
+                    sumdx += gx[indexOffset + i];
                 }

                 for (int i = 0; i < y.Length; i++)
                 {
-                    gx[i + b * y.Length] -= y.Data[i + b * y.Length] * sumdx;
+                    gx[indexOffset + i] -= y.Data[indexOffset + i] * sumdx;
                 }
+
+                indexOffset += y.Length;
             }

             for (int i = 0; i < x.Grad.Length; i++)


Litte fix

Litte fix

--- PressureTool/Tasks.cs
+++ PressureTool/Tasks.cs
@@ -178,17 +178,17 @@
             if (Time.CompareTo(endTime) > 0)
             {
                 TimeSpan duration = endTime - startTime;
-                MainWindow.onStopLogging("Logging stopped: Duration of " + duration.ToString() + " reached");
+                MainWindow.onStopLogging("Duration of " + duration.ToString() + " reached");
                 return;
             }
             if (p1 > maxP1 || p1 < minP1)
             {
-                MainWindow.onStopLogging("Logging stopped: Pressure P1=" + p1.ToString("0.0000E+00") + " exceeded limit: " + minP1.ToString("0.0000E+00") + " / " + maxP1.ToString("0.0000E+00"));
+                MainWindow.onStopLogging("Pressure P1=" + p1.ToString("0.0000E+00") + " exceeded limit: " + minP1.ToString("0.0000E+00") + " / " + maxP1.ToString("0.0000E+00"));
                 return;
             }
             if (p2 > maxP2 || p2 < minP2)
             {
-                MainWindow.onStopLogging("Logging stopped: Pressure P2=" + p2.ToString("0.0000E+00") + " exceeded limit: " + minP2.ToString("0.0000E+00") + " / " + maxP2.ToString("0.0000E+00"));
+                MainWindow.onStopLogging("Pressure P2=" + p2.ToString("0.0000E+00") + " exceeded limit: " + minP2.ToString("0.0000E+00") + " / " + maxP2.ToString("0.0000E+00"));
                 return;
             }


AppVeyor chorão

AppVeyor chorão

--- TopGearApi.DataAccess/CarroDA.cs
+++ TopGearApi.DataAccess/CarroDA.cs
@@ -39,12 +39,12 @@
         {
             using (var context = GetContext())
             {
-                var carros = from c in context.Set<Carro>()
+                IQueryable<Carro> carros = from c in context.Set<Carro>()
                         select c;

-                var carrosDisponiveis = new List<Carro>();
+                List<Carro> carrosDisponiveis = new List<Carro>();

-                foreach(var c in carros)
+                foreach(Carro c in carros)
                 {
                     var l = LocacaoDA.GetAtivaByCarro(c.Id, inicial, final);


Adding Zing to nunit runner

Adding Zing to nunit runner

--- Tst/UnitTests/RegressionTests.cs
+++ Tst/UnitTests/RegressionTests.cs
@@ -40,6 +40,8 @@
             throw new FileNotFoundException();
         });

+        private const string NewLinePattern = @"\r\n|\n\r|\n|\r";
+
         private static string TestDirectory => Path.Combine(SolutionDirectory.Value, "Tst");

         private static Lazy<string> TestResultsDirectory { get; } =
@@ -53,6 +55,10 @@
             var curTest = new Uri(testDir.FullName);
             Uri relativePath = testRoot.MakeRelativeUri(curTest);
             string destinationDir = Path.GetFullPath(Path.Combine(TestResultsDirectory.Value, relativePath.OriginalString));
+            if (Directory.Exists(destinationDir))
+            {
+                Directory.Delete(destinationDir, true);
+            }
             DeepCopy(testDir, destinationDir);
             return new DirectoryInfo(destinationDir);
         }
@@ -79,16 +85,6 @@

         private void TestPc(TestConfig config, TextWriter tmpWriter, DirectoryInfo workDirectory, string activeDirectory)
         {
-            // Clean up any remaining generated files
-            foreach (FileInfo file in workDirectory.EnumerateFiles())
-            {
-                if (file.Extension == ".c" || file.Extension == ".h" || file.Extension == ".4ml" || file.Extension == ".zing" ||
-                    file.Extension == ".dll")
-                {
-                    file.Delete();
-                }
-            }
-
             WriteHeader(tmpWriter);

             List<string> pFiles = workDirectory.EnumerateFiles("*.p").Select(pFile => pFile.FullName).ToList();
@@ -146,14 +142,9 @@
             }
             using (PCompiler.Profiler.Start("compile zing", inputFileName))
             {
-                if (!PCompiler.Compile(compilerOutput, compileArgs))
-                {
-                    tmpWriter.WriteLine("EXIT: -1");
-                    return;
-                }
-            }
-
-            tmpWriter.WriteLine("EXIT: 0");
+                int zingResult = PCompiler.Compile(compilerOutput, compileArgs) ? 0 : -1;
+                tmpWriter.WriteLine($"EXIT: {zingResult}");
+            }
         }

         private static void WriteHeader(TextWriter tmpWriter)
@@ -165,7 +156,53 @@

         private void TestZing(TestConfig config, StringWriter tmpWriter, DirectoryInfo workDirectory, string activeDirectory)
         {
-            Debug.WriteLine("TODO: Zing not implemented");
+            // Find Zing tool
+            string zingFilePath = Path.Combine(SolutionDirectory.Value, "Bld", "Drops", BuildSettings.Configuration,
+                                               BuildSettings.Platform, "Binaries", "zinger.exe");
+
+            // Find DLL input to Zing
+            string zingDllName = (from fileName in workDirectory.EnumerateFiles()
+                                  where fileName.Extension == ".dll" && !fileName.Name.Contains("linker")
+                                  select fileName.FullName).FirstOrDefault();
+            if (zingDllName == null)
+            {
+                throw new Exception("Could not find Zinger input.");
+            }
+
+            // Run Zing tool
+            var arguments = new List<string>(config.Arguments) {zingDllName};
+            string stdout, stderr;
+            int exitCode = RunWithOutput(zingFilePath, activeDirectory, arguments, out stdout, out stderr);
+            tmpWriter.Write(stdout);
+            tmpWriter.Write(stderr);
+            tmpWriter.WriteLine($"EXIT: {exitCode}");
+
+            // Append includes
+            foreach (string include in config.Includes)
+            {
+                tmpWriter.WriteLine();
+                tmpWriter.WriteLine("=================================");
+                tmpWriter.WriteLine(include);
+                tmpWriter.WriteLine("=================================");
+
+                try
+                {
+                    using (var sr = new StreamReader(Path.Combine(activeDirectory, include)))
+                    {
+                        while (!sr.EndOfStream)
+                        {
+                            tmpWriter.WriteLine(sr.ReadLine());
+                        }
+                    }
+                }
+                catch (FileNotFoundException)
+                {
+                    if (!include.EndsWith("trace"))
+                    {
+                        throw;
+                    }
+                }
+            }
         }

         private void TestPrt(TestConfig config, StringWriter tmpWriter, DirectoryInfo workDirectory, string activeDirectory)
@@ -188,22 +225,9 @@
             // run the harness
             using (PCompiler.Profiler.Start("run prttester", workDirectory.FullName))
             {
-                var psi = new ProcessStartInfo
-                {
-                    CreateNoWindow = true,
-                    UseShellExecute = false,
-                    RedirectStandardInput = true,
-                    RedirectStandardOutput = true,
-                    RedirectStandardError = true,
-                    WorkingDirectory = activeDirectory,
-                    Arguments = string.Join(" ", config.Arguments),
-                    FileName = testerExePath
-                };
-
                 WriteHeader(tmpWriter);
-
                 string stdout, stderr;
-                int exitCode = RunWithOutput(psi, out stdout, out stderr);
+                int exitCode = RunWithOutput(testerExePath, activeDirectory, config.Arguments, out stdout, out stderr);
                 tmpWriter.Write(stdout);
                 tmpWriter.Write(stderr);
                 tmpWriter.WriteLine($"EXIT: {exitCode}");
@@ -212,7 +236,24 @@

         private void BuildTester(string prtTesterProj, string activeDirectory, bool clean)
         {
-            var startInfo = new ProcessStartInfo("msbuild.exe")
+            var argumentList = new[]
+            {
+                prtTesterProj, clean ? "/t:Clean" : "/t:Build",
+                $"/p:Configuration={BuildSettings.Configuration}", $"/p:Platform={BuildSettings.Platform}",
+                "/nologo"
+            };
+
+            string stdout, stderr;
+            if (RunWithOutput("msbuild.exe", activeDirectory, argumentList, out stdout, out stderr) != 0)
+            {
+                throw new Exception($"Failed to build {prtTesterProj}\nOutput:\n{stdout}\n\nErrors:\n{stderr}\n");
+            }
+        }
+
+        private static int RunWithOutput(string exeName, string activeDirectory, IEnumerable<string> argumentList, out string stdout,
+                                         out string stderr)
+        {
+            var psi = new ProcessStartInfo(exeName)
             {
                 CreateNoWindow = true,
                 UseShellExecute = false,
@@ -220,28 +261,17 @@
                 RedirectStandardInput = true,
                 RedirectStandardOutput = true,
                 WorkingDirectory = activeDirectory,
-                Arguments = string.Join(" ", prtTesterProj, clean ? "/t:Clean" : "/t:Build",
-                                        $"/p:Configuration={BuildSettings.Configuration}", $"/p:Platform={BuildSettings.Platform}",
-                                        "/nologo")
-            };
-
-            string stdout, stderr;
-            if (RunWithOutput(startInfo, out stdout, out stderr) != 0)
-            {
-                throw new Exception($"Failed to build {prtTesterProj}\nOutput:\n{stdout}\n\nErrors:\n{stderr}\n");
-            }
-        }
-
-        private static int RunWithOutput(ProcessStartInfo startInfo, out string stdout, out string stderr)
-        {
-            string m_stdout = "", m_stderr = "";
-
-            var proc = new Process {StartInfo = startInfo};
+                Arguments = string.Join(" ", argumentList)
+            };
+
+            string mStdout = "", mStderr = "";
+
+            var proc = new Process {StartInfo = psi};
             proc.OutputDataReceived += (s, e) =>
             {
                 string line = $"OUT: {e.Data}\n";
                 Debug.WriteLine(line);
-                m_stdout += line;
+                mStdout += line;
             };

             proc.ErrorDataReceived += (s, e) =>
@@ -252,15 +282,15 @@
                 }
                 string line = $"ERROR: {e.Data}\n";
                 Debug.WriteLine(line);
-                m_stderr += line;
+                mStderr += line;
             };

             proc.Start();
             proc.BeginErrorReadLine();
             proc.BeginOutputReadLine();
             proc.WaitForExit();
-            stdout = m_stdout;
-            stderr = m_stderr;
+            stdout = mStdout;
+            stderr = mStderr;
             return proc.ExitCode;
         }

@@ -300,16 +330,18 @@
                             TestPrt(config, tmpWriter, workDirectory, activeDirectory);
                             break;
                         case TestType.Zing:
+                            TestZing(config, tmpWriter, workDirectory, activeDirectory);
                             return;
                         default:
                             throw new ArgumentOutOfRangeException();
                     }
                 }

-                string correctText = File.ReadAllText(Path.Combine(activeDirectory, "acc_0.txt"));
-                correctText = Regex.Replace(correctText, @"\r\n|\n\r|\n|\r", "\n");
+                string correctOutputPath = Path.Combine(activeDirectory, "acc_0.txt");
+                string correctText = File.ReadAllText(correctOutputPath);
+                correctText = Regex.Replace(correctText, NewLinePattern, Environment.NewLine);
                 string actualText = sb.ToString();
-                actualText = Regex.Replace(actualText, @"\r\n|\n\r|\n|\r", "\n");
+                actualText = Regex.Replace(actualText, NewLinePattern, Environment.NewLine);
                 Assert.AreEqual(correctText, actualText);
                 Debug.WriteLine(actualText);
             }


Added HtmlUtils surrogate pair tests

Added HtmlUtils surrogate pair tests

--- UnitTests/Text/HtmlUtilsTests.cs
+++ UnitTests/Text/HtmlUtilsTests.cs
@@ -26,6 +26,7 @@

 using System;
 using System.IO;
+using System.Text;

 using NUnit.Framework;

@@ -50,8 +51,10 @@

 			Assert.Throws<ArgumentNullException> (() => HtmlUtils.HtmlAttributeEncode (null, text));
 			Assert.Throws<ArgumentNullException> (() => HtmlUtils.HtmlAttributeEncode (writer, (string) null));
+			Assert.Throws<ArgumentException> (() => HtmlUtils.HtmlAttributeEncode (writer, text, 'x'));
+
+			Assert.Throws<ArgumentNullException> (() => HtmlUtils.HtmlAttributeEncode (null, text.AsSpan ()));
 			Assert.Throws<ArgumentNullException> (() => HtmlUtils.HtmlAttributeEncode (writer, (ReadOnlySpan<char>) null));
-			Assert.Throws<ArgumentException> (() => HtmlUtils.HtmlAttributeEncode (writer, text, 'x'));
 			Assert.Throws<ArgumentException> (() => HtmlUtils.HtmlAttributeEncode (writer, text.AsSpan (), 'x'));

 			Assert.Throws<ArgumentNullException> (() => HtmlUtils.HtmlAttributeEncode ((string) null, 0, 0));
@@ -214,6 +217,18 @@
 		}

 		[Test]
+		public void TestEncodeSurrogatePairs ()
+		{
+			const string attributeValue = "\"This emoji (😱) contains a surrogate pair.\"";
+			const string encoded = "This emoji (😱) contains a surrogate pair.";
+			var emoji = Encoding.UTF8.GetString (Convert.FromBase64String ("8J+YsQ=="));
+			var text = $"This emoji ({emoji}) contains a surrogate pair.";
+
+			AssertHtmlAttributeEncode (text, attributeValue);
+			AssertHtmlEncode (text, encoded);
+		}
+
+		[Test]
 		public void TestHtmlDecode ()
 		{
 			const string encoded = "<£€¢¥ ©®>";


Removed setter on SupportedTags.

Removed setter on SupportedTags.

--- Pvc.Core/PvcPlugin.cs
+++ Pvc.Core/PvcPlugin.cs
@@ -20,7 +20,7 @@
             PvcPlugin.registeredNamespaces.AddRange(namespaces);
         }

-        public virtual string[] SupportedTags { get; set; }
+        public virtual string[] SupportedTags { get; }

         public abstract IEnumerable<PvcStream> Execute(IEnumerable<PvcStream> inputStreams);
     }


-Upgrade to 1.6.0

-Upgrade to 1.6.0

--- MailChimp.Net/Properties/AssemblyInfo.cs
+++ MailChimp.Net/Properties/AssemblyInfo.cs
@@ -37,5 +37,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.4")]
+[assembly: AssemblyVersion("1.6.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]


Adapt test

Adapt test

--- ManagedNativeWifi.Test/NativeWifiTest.cs
+++ ManagedNativeWifi.Test/NativeWifiTest.cs
@@ -92,69 +92,81 @@
 		/// Detects channels of 2.4GHz.
 		/// </summary>
 		[TestMethod]
-		public void DetectChannel24000Test()
+		public void TryDetectChannel24000Test()
 		{
 			// Valid cases
-			Assert.AreEqual(1, NativeWifi.DetectChannel(2412000));
-			Assert.AreEqual(2, NativeWifi.DetectChannel(2417000));
-			Assert.AreEqual(5, NativeWifi.DetectChannel(2432000));
-			Assert.AreEqual(6, NativeWifi.DetectChannel(2437000));
-			Assert.AreEqual(12, NativeWifi.DetectChannel(2467000));
-			Assert.AreEqual(13, NativeWifi.DetectChannel(2472000));
-			Assert.AreEqual(14, NativeWifi.DetectChannel(2484000));
+			TryDetectChannelValidTestBase(2_412_000, 2.4F, 1);
+			TryDetectChannelValidTestBase(2_417_000, 2.4F, 2);
+			TryDetectChannelValidTestBase(2_432_000, 2.4F, 5);
+			TryDetectChannelValidTestBase(2_437_000, 2.4F, 6);
+			TryDetectChannelValidTestBase(2_467_000, 2.4F, 12);
+			TryDetectChannelValidTestBase(2_472_000, 2.4F, 13);
+			TryDetectChannelValidTestBase(2_484_000, 2.4F, 14);

 			// Invalid cases
-			Assert.AreEqual(0, NativeWifi.DetectChannel(2411000));
-			Assert.AreEqual(0, NativeWifi.DetectChannel(2485000));
-			Assert.AreEqual(0, NativeWifi.DetectChannel(2453000));
+			TryDetectChannelInvalidTestBase(2_411_000);
+			TryDetectChannelInvalidTestBase(2_485_000);
+			TryDetectChannelInvalidTestBase(2_453_000);
 		}

 		/// <summary>
 		/// Detects channels of 3.6GHz.
 		/// </summary>
 		[TestMethod]
-		public void DetectChannel36000Test()
+		public void TryDetectChannel36000Test()
 		{
-			// Valid cases
-			Assert.AreEqual(131, NativeWifi.DetectChannel(3657500));
-			Assert.AreEqual(132, NativeWifi.DetectChannel(3660000));
-			Assert.AreEqual(132, NativeWifi.DetectChannel(3662500));
-			Assert.AreEqual(133, NativeWifi.DetectChannel(3665000));
-			Assert.AreEqual(133, NativeWifi.DetectChannel(3667500));
-			Assert.AreEqual(135, NativeWifi.DetectChannel(3675000));
-			Assert.AreEqual(135, NativeWifi.DetectChannel(3677500));
-			Assert.AreEqual(138, NativeWifi.DetectChannel(3690000));
-			Assert.AreEqual(138, NativeWifi.DetectChannel(3692500));
+			// Valid cases
+			TryDetectChannelValidTestBase(3_657_500, 3.6F, 131);
+			TryDetectChannelValidTestBase(3_660_000, 3.6F, 132);
+			TryDetectChannelValidTestBase(3_662_500, 3.6F, 132);
+			TryDetectChannelValidTestBase(3_665_000, 3.6F, 133);
+			TryDetectChannelValidTestBase(3_667_500, 3.6F, 133);
+			TryDetectChannelValidTestBase(3_675_000, 3.6F, 135);
+			TryDetectChannelValidTestBase(3_677_500, 3.6F, 135);
+			TryDetectChannelValidTestBase(3_690_000, 3.6F, 138);
+			TryDetectChannelValidTestBase(3_692_500, 3.6F, 138);

 			// Invalid cases
-			Assert.AreEqual(0, NativeWifi.DetectChannel(3657000));
-			Assert.AreEqual(0, NativeWifi.DetectChannel(3695000));
-			Assert.AreEqual(0, NativeWifi.DetectChannel(3673000));
+			TryDetectChannelInvalidTestBase(3_657_000);
+			TryDetectChannelInvalidTestBase(3_695_000);
+			TryDetectChannelInvalidTestBase(3_673_000);
 		}

 		/// <summary>
 		/// Detects channels of 5GHz.
 		/// </summary>
 		[TestMethod]
-		public void DetectChannel50000Test()
+		public void TryDetectChannel50000Test()
 		{
 			// Valid cases
-			Assert.AreEqual(34, NativeWifi.DetectChannel(5170000));
-			Assert.AreEqual(36, NativeWifi.DetectChannel(5180000));
-			Assert.AreEqual(40, NativeWifi.DetectChannel(5200000));
-			Assert.AreEqual(52, NativeWifi.DetectChannel(5260000));
-			Assert.AreEqual(56, NativeWifi.DetectChannel(5280000));
-			Assert.AreEqual(140, NativeWifi.DetectChannel(5700000));
-			Assert.AreEqual(144, NativeWifi.DetectChannel(5720000));
-			Assert.AreEqual(149, NativeWifi.DetectChannel(5745000));
-			Assert.AreEqual(151, NativeWifi.DetectChannel(5755000));
-			Assert.AreEqual(161, NativeWifi.DetectChannel(5805000));
-			Assert.AreEqual(165, NativeWifi.DetectChannel(5825000));
+			TryDetectChannelValidTestBase(5_170_000, 5F, 34);
+			TryDetectChannelValidTestBase(5_180_000, 5F, 36);
+			TryDetectChannelValidTestBase(5_200_000, 5F, 40);
+			TryDetectChannelValidTestBase(5_260_000, 5F, 52);
+			TryDetectChannelValidTestBase(5_280_000, 5F, 56);
+			TryDetectChannelValidTestBase(5_700_000, 5F, 140);
+			TryDetectChannelValidTestBase(5_720_000, 5F, 144);
+			TryDetectChannelValidTestBase(5_745_000, 5F, 149);
+			TryDetectChannelValidTestBase(5_755_000, 5F, 151);
+			TryDetectChannelValidTestBase(5_805_000, 5F, 161);
+			TryDetectChannelValidTestBase(5_825_000, 5F, 165);

 			// Invalid cases
-			Assert.AreEqual(0, NativeWifi.DetectChannel(5160000));
-			Assert.AreEqual(0, NativeWifi.DetectChannel(5850000));
-			Assert.AreEqual(0, NativeWifi.DetectChannel(5651000));
+			TryDetectChannelInvalidTestBase(5_160_000);
+			TryDetectChannelInvalidTestBase(5_850_000);
+			TryDetectChannelInvalidTestBase(5_651_000);
+		}
+
+		private void TryDetectChannelValidTestBase(uint frequency, float expectedBand, int expectedChannel)
+		{
+			Assert.IsTrue(NativeWifi.TryDetectBandChannel(frequency, out var band, out var channel));
+			Assert.AreEqual(expectedBand, band);
+			Assert.AreEqual(expectedChannel, channel);
+		}
+
+		private void TryDetectChannelInvalidTestBase(uint frequency)
+		{
+			Assert.IsFalse(NativeWifi.TryDetectBandChannel(frequency, out _, out _));
 		}

 		#endregion


- Fixed bugs from last commit

- Fixed bugs from last commit

git-svn-id: 61c3ae23f3a6520e9bc357b51591209af2ede9d8@544 45b04e34-05f1-4d87-a130-40a8491d5c8b

--- Mosa/Platforms/x86/MachineCodeEmitter.cs
+++ Mosa/Platforms/x86/MachineCodeEmitter.cs
@@ -1905,22 +1905,7 @@
 		///
 		/// Section: Standard x86
 		/// </summary>
-		private static readonly CodeDef[] cd_mov = new CodeDef[] {
-			// --- Originals ---
-			// C7 /0 MOV r/m16, imm16 Valid Valid Move imm16 to r/m16.
-			// C7 /0 MOV r/m32, imm32 Valid Valid Move imm32 to r/m32.
-			new CodeDef(typeof(RegisterOperand),    typeof(ConstantOperand),    new byte[] { 0xC7 }, 0),
-			new CodeDef(typeof(MemoryOperand),      typeof(ConstantOperand),    new byte[] { 0xC7 }, 0),
-
-			// 8B /r MOV r16,r/m16 Valid Valid Move r/m16 to r16.
-			// 8B /r MOV r32,r/m32 Valid Valid Move r/m32 to r32.
-			new CodeDef(typeof(RegisterOperand),    typeof(RegisterOperand),    new byte[] { 0x8B }, null),
-			new CodeDef(typeof(RegisterOperand),    typeof(MemoryOperand),      new byte[] { 0x8B }, null),
-
-			// 89 /r MOV r/m16,r16 Valid Valid Move r16 to r/m16.
-			// 89 /r MOV r/m32,r32 Valid Valid Move r32 to r/m32.
-			new CodeDef(typeof(MemoryOperand),      typeof(RegisterOperand),    new byte[] { 0x89 }, null),
-
+		private static readonly CodeDef[] cd_mov = new CodeDef[] {
 			// --- Updated ---

 			// C6 /0 MOV r/m8, imm8 Valid Valid Move imm8 to r/m8.


Zoeken nooit hoofdlettergevoelig

Zoeken nooit hoofdlettergevoelig

--- Mvc.Datatables/Processing/TypeFilters.cs
+++ Mvc.Datatables/Processing/TypeFilters.cs
@@ -196,7 +196,12 @@
                 //return string.Format("{0} ==  {1}", columnname, parameterArg);
                 return
                     string.Format(
-                        "({0} != null && {0} != \"\" && ({0} ==  {1} || {0}.StartsWith({1}) || {0}.Contains({1})))",
+                    /*
+                     * Gewijzigd door Wietze Sttrik
+                     * Case insensite gemaakt
+                     */
+                    //"({0} != null && {0} != \"\" && ({0} ==  {1} || {0}.StartsWith({1}) || {0}.Contains({1})))",
+                        "({0} != null && {0} != \"\" && ({0} ==  {1} || {0}.StartsWith({1}) || {0}.ToLower().Contains(({1}).ToLower())))",
                         columnname, parameterArg);
             }
         }


Added more Fluent StateInfo to unit tests

--- Navigation.Test/FluentStateInfoConfig.cs
+++ Navigation.Test/FluentStateInfoConfig.cs
@@ -41,6 +41,38 @@
 					.Transition("t0", d => d.s2, d => d.s3)
 					.Transition("t1", d => d.s2, d => d.s4)
 					.Transition("t0", d => d.s3, d => d.s4)
+				.Dialog("d1", new
+				{
+					s0 = new WebFormsState("", "~/d1/s0.aspx")
+							.Title("s0"),
+					s1 = new WebFormsState("", "~/d1/s1.aspx")
+							.Title("s1"),
+					s2 = new WebFormsState("", "~/d1/s2.aspx")
+							.Title("s2")
+							.Attributes(new { masters = "!@" }),
+					s3 = new WebFormsState("", "~/d1/s3.aspx")
+							.Title("s3")
+							.Attributes(new { mobileTheme = " test  ", mobileMasters = " test1 ,  test2" }),
+					s4 = new WebFormsState("", "~/d1/s4.aspx")
+							.Title("s4")
+							.Attributes(new { mobileMasters = "," }),
+					s5 = new WebFormsState("", "~/d1/s5.aspx")
+							.Title("s5")
+							.Attributes(new { mobileMasters = "!@" }),
+				}, d => d.s0)
+					.Title("d1")
+					.Attributes(new { path = "d1" })
+					.Transition("t0", d => d.s0, d => d.s1)
+					.Transition("t0", d => d.s1, d => d.s2)
+					.Transition("t0", d => d.s2, d => d.s3)
+					.Transition("t0", d => d.s3, d => d.s4)
+					.Transition("t0", d => d.s4, d => d.s5)
+					.Transition("t0", d => d.s4, d => d.s5)
+					.Transition("t0", d => d.s5, d => d.s0)
+					.Transition("t1", d => d.s5, d => d.s1)
+					.Transition("t2", d => d.s5, d => d.s2)
+					.Transition("t3", d => d.s5, d => d.s3)
+					.Transition("t4", d => d.s5, d => d.s4)
 				.Build();
 		}
 	}


Fixed #229: Config transform does not appear to work on web.debug.config file
- Made project item lookup, check 2 levels of depth for nested files in VS

--HG--
extra : rebase_source : 9f313acb2f5bfcf535c52a955a258946b60e0520

--- NuPack.VisualStudio/ProjectExtensions.cs
+++ NuPack.VisualStudio/ProjectExtensions.cs
@@ -30,7 +30,7 @@

             ProjectItem projectItem;
             // If we couldn't get the folder, or the file doesn't exist, return null
-            if (container == null || !container.TryGetProjectItem(fileName, out projectItem)) {
+            if (container == null || !container.TryGetFile(fileName, out projectItem)) {
                 return null;
             }

@@ -47,12 +47,37 @@
             return true;
         }

-        public static bool TryGetProjectItem(this ProjectItems projectItems, string name, out ProjectItem projectItem) {
-            projectItem = (from ProjectItem p in projectItems
-                           where p.Name.Equals(name, StringComparison.OrdinalIgnoreCase)
-                           select p).FirstOrDefault();
+        public static bool TryGetFolder(this ProjectItems projectItems, string name, out ProjectItem projectItem) {
+            return TryGetProjectItem(projectItems, name, new[] { VSConstants.VsProjectItemKindPhysicalFolder }, out projectItem);
+        }
+
+        public static bool TryGetFile(this ProjectItems projectItems, string name, out ProjectItem projectItem) {
+            return TryGetProjectItem(projectItems, name, new[] { VSConstants.VsProjectItemKindPhysicalFile }, out projectItem);
+        }
+
+        public static bool TryGetProjectItem(this ProjectItems projectItems, string name, IEnumerable<string> kinds, out ProjectItem projectItem) {
+            projectItem = GetProjectItem(projectItems, name);
+
+            if (projectItem == null) {
+                // If we didn't find the project item at the top level, then we look one more level down.
+                // In VS files can have other nested files like aspx and aspx.cs. These are actually top level files in the file system
+                // but are represented as nested project items in VS.
+                projectItem = (from ProjectItem item in projectItems
+                               where kinds.Contains(item.Kind) &&
+                                     item.ProjectItems != null &&
+                                     item.ProjectItems.Count > 0
+                               select GetProjectItem(item.ProjectItems, name) into item
+                               where item != null
+                               select item).FirstOrDefault();
+            }

             return projectItem != null;
+        }
+
+        private static ProjectItem GetProjectItem(ProjectItems projectItems, string name) {
+            return (from ProjectItem item in projectItems
+                    where item.Name.Equals(name, StringComparison.OrdinalIgnoreCase)
+                    select item).FirstOrDefault();
         }

         public static IEnumerable<ProjectItem> GetChildItems(this Project project, string path, string filter, params string[] kinds) {
@@ -92,7 +117,7 @@
             }

             ProjectItem subFolder;
-            if (projectItems.TryGetProjectItem(folderName, out subFolder)) {
+            if (projectItems.TryGetFolder(folderName, out subFolder)) {
                 // Get the sub folder
                 return subFolder.ProjectItems;
             }


Web Changes

Web Changes

--- NutzCode.CloudFileSystem/OAuth2/OAuth.cs
+++ NutzCode.CloudFileSystem/OAuth2/OAuth.cs
@@ -185,7 +185,7 @@
                     nm.Add("Authorization", "Bearer " + Token.AccessToken);
                     pars.Headers = nm;
                 }
-                using (WebStream w = await WebStream.CreateStream(pars))
+                using (WebStream w = await WebStreamFactory.Instance.CreateStreamAsync(pars))
                 {
                     if ((w.StatusCode == HttpStatusCode.OK) || (w.StatusCode == HttpStatusCode.Created) || (w.StatusCode == HttpStatusCode.Accepted))
                     {


For a Hypergrid user, delay estate access checks until NewUserConnection() so that they work.

This is necessary because the hypergrid groups checks (as referenced by estates) require an agent circuit to be present to construct the hypergrid ID.
However, this is not around until Scene.NewUserConnection(), as called by CreateAgent() in EntityTransferModule.
Therefore, if we're dealing with a hypergrid user, delay the check until NewUserConnection()/CreateAgent()
The entity transfer impact should be minimal since CreateAgent() is the next significant call after NewUserConnection()
However, to preserve the accuracy of query access we will only relax the check for HG users.

--- OpenSim/Region/Framework/Scenes/Scene.cs
+++ OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5739,9 +5739,13 @@

             try
             {
-                if (!AuthorizeUser(aCircuit, false, out reason))
-                {
-                    // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID);
+                // If this is a hypergrid user, then we can't perform a successful groups access check here since this
+                // currently relies on a circuit being present in the AuthenticateHandler to construct a Hypergrid ID.
+                // This is only present in NewUserConnection() which entity transfer calls very soon after QueryAccess().
+                // Therefore, we'll defer to the check in NewUserConnection() instead.
+                if (!AuthorizeUser(aCircuit, !UserManagementModule.IsLocalGridUser(agentID), out reason))
+                {
+                    //m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID);
                     return false;
                 }
             }


Fix for lookups (IndexOutOfRangeException with some older lookup formats)

--- OpenSlx.Lib/Web/Controls/SimpleLookup.cs
+++ OpenSlx.Lib/Web/Controls/SimpleLookup.cs
@@ -262,7 +262,7 @@
                 {
                     Path = fields[0],
                     Caption = fields[2],
-                    Format = fields[5]
+                    Format = fields.Length > 5 ? fields[5] : ""
                 };
             }
         }


Added IInitializeCommand support with corresponding properties CommandName and Properties

--- Windows.Shell/ShellDropTarget.cs
+++ Windows.Shell/ShellDropTarget.cs
@@ -3,6 +3,7 @@
 using System.Windows.Forms;
 using Vanara.PInvoke;
 using static Vanara.PInvoke.Ole32;
+using static Vanara.PInvoke.Shell32;
 using IDataObject = System.Runtime.InteropServices.ComTypes.IDataObject;
 using IDropTarget = Vanara.PInvoke.Ole32.IDropTarget;

@@ -98,7 +99,7 @@
 	///}</remarks>
 	/// <seealso cref="Vanara.Windows.Shell.ComObject"/>
 	/// <seealso cref="Vanara.PInvoke.Ole32.IDropTarget"/>
-	public abstract class ShellDropTarget : ComObject, IDropTarget
+	public abstract class ShellDropTarget : ComObject, IDropTarget, IInitializeCommand
 	{
 		private DataObject lastDataObject;
 		private DROPEFFECT lastEffect = DROPEFFECT.DROPEFFECT_NONE;
@@ -125,6 +126,20 @@
 		/// communicate the effect of the drop back to the source.
 		///
 		public event DragEventHandler DragOver;
+
+		/// Gets the name of the command returned by <c>IInitializeCommand.Initialize</c>.
+		/// <value>
+		/// The name of the command as found in the registry. This value is <see langword="null"/> until <c>IInitializeCommand.Initialize</c>
+		/// is called by the host.
+		/// </value>
+		public string CommandName { get; private set; }
+
+		/// Gets the properties exposed through <c>IInitializeCommand.Initialize</c>.
+		/// <value>
+		/// Gets a <see cref="PropertyBag"/> instance. This value is <see langword="null"/> until <c>IInitializeCommand.Initialize</c> is
+		/// called by the host.
+		/// </value>
+		public PropertyBag Properties { get; private set; }

 		/// <inheritdoc/>
 		HRESULT IDropTarget.DragEnter(IDataObject pDataObj, uint grfKeyState, Point pt, ref DROPEFFECT pdwEffect)
@@ -165,6 +180,14 @@
 			return HRESULT.S_OK;
 		}

+		/// <inheritdoc/>
+		HRESULT IInitializeCommand.Initialize(string pszCommandName, IPropertyBag ppb)
+		{
+			CommandName = pszCommandName;
+			Properties = new PropertyBag(ppb);
+			return HRESULT.S_OK;
+		}
+
 		private DragEventArgs CreateDragEventArgs(IDataObject pDataObj, uint grfKeyState, Point pt, DROPEFFECT pdwEffect)
 		{
 			var data = pDataObj == null ? lastDataObject : new DataObject(pDataObj);


more work on interaction volumes

more work on interaction volumes

--- PartPreviewWindow/View3D/View3DWidget.cs
+++ PartPreviewWindow/View3D/View3DWidget.cs
@@ -73,6 +73,16 @@
             }
         }

+        public override void OnMouseDown(MouseEvent3DArgs mouseEvent3D)
+        {
+            base.OnMouseDown(mouseEvent3D);
+        }
+
+        public override void OnMouseMove(MouseEvent3DArgs mouseEvent3D)
+        {
+            base.OnMouseMove(mouseEvent3D);
+        }
+
         public void SetPosition()
         {
             Matrix4X4 transform = MeshViewerToDrawWith.SelectedMeshGroupTransform.TotalTransform;


fixed root param name to be "headers"

fixed root param name to be "headers"

--- ZencoderWrapper/OutputSetting.cs
+++ ZencoderWrapper/OutputSetting.cs
@@ -22,7 +22,7 @@
         public string audio_codec { get; set; }
         public int? audio_quality { get; set; }
         public ThumbnailSetting thumbnails { get; set; }
-        public S3HeadersSetting s3_headers { get; set; }
+        public S3HeadersSetting headers { get; set; }
         public string deinterlace { get; set; }
         public decimal? max_frame_rate { get; set; }
         public decimal? frame_rate { get; set; }


Fix case when project directory already exists

--- src/dotnet-new2/ProjectCreator.cs
+++ src/dotnet-new2/ProjectCreator.cs
@@ -10,15 +10,24 @@
         {
             Directory.CreateDirectory(path);

+            if (Directory.GetFileSystemEntries(path).Length > 0)
+            {
+                // Files already exist in the directory
+                Console.WriteLine($"Directory {path} already contains files. Please specify a different project name.");
+                return false;
+            }
+
             foreach (var file in template.Files)
             {
                 var dest = Path.Combine(path, file.DestPath);
+
                 File.Copy(file.SourcePath, dest);
                 ProcessFile(dest, name);
             }

             Console.WriteLine();
             Console.WriteLine($"Created \"{name}\" in {path}");
+            Console.WriteLine();

             return true;
         }


Fixes Issue #55 - Incorrect XML comments for CollectionAssert.IsSubsetOf

I modified the summaries and parameters for all of the CollectionAssert.IsSubsetOf and IsNotSubsetOf methods.

--- src/framework/CollectionAssert.cs
+++ src/framework/CollectionAssert.cs
@@ -468,20 +468,20 @@
 		#region IsNotSubsetOf

 		/// <summary>
-		/// Asserts that superset is not a subject of subset.
-		/// </summary>
-		/// <param name="subset">The IEnumerable superset to be considered</param>
-		/// <param name="superset">The IEnumerable subset to be considered</param>
+		/// Asserts that the superset does not contain the subset
+		/// </summary>
+      /// <param name="subset">The IEnumerable subset to be considered</param>
+      /// <param name="superset">The IEnumerable superset to be considered</param>
 		public static void IsNotSubsetOf (IEnumerable subset, IEnumerable superset)
 		{
 			IsNotSubsetOf(subset, superset, string.Empty, null);
 		}

 		/// <summary>
-		/// Asserts that superset is not a subject of subset.
-		/// </summary>
-		/// <param name="subset">The IEnumerable superset to be considered</param>
-		/// <param name="superset">The IEnumerable subset to be considered</param>
+		/// Asserts that the superset does not contain the subset
+		/// </summary>
+      /// <param name="subset">The IEnumerable subset to be considered</param>
+      /// <param name="superset">The IEnumerable superset to be considered</param>
 		/// <param name="message">The message that will be displayed on failure</param>
 		public static void IsNotSubsetOf (IEnumerable subset, IEnumerable superset, string message)
 		{
@@ -489,10 +489,10 @@
 		}

 		/// <summary>
-		/// Asserts that superset is not a subject of subset.
-		/// </summary>
-		/// <param name="subset">The IEnumerable superset to be considered</param>
-		/// <param name="superset">The IEnumerable subset to be considered</param>
+		/// Asserts that the superset does not contain the subset
+		/// </summary>
+      /// <param name="subset">The IEnumerable subset to be considered</param>
+      /// <param name="superset">The IEnumerable superset to be considered</param>
 		/// <param name="message">The message that will be displayed on failure</param>
 		/// <param name="args">Arguments to be used in formatting the message</param>
 		public static void IsNotSubsetOf (IEnumerable subset, IEnumerable superset, string message, params object[] args)
@@ -504,20 +504,20 @@
 		#region IsSubsetOf

 		/// <summary>
-		/// Asserts that superset is a subset of subset.
-		/// </summary>
-		/// <param name="subset">The IEnumerable superset to be considered</param>
-		/// <param name="superset">The IEnumerable subset to be considered</param>
+		/// Asserts that the superset contains the subset.
+		/// </summary>
+      /// <param name="subset">The IEnumerable subset to be considered</param>
+      /// <param name="superset">The IEnumerable superset to be considered</param>
 		public static void IsSubsetOf (IEnumerable subset, IEnumerable superset)
 		{
 			IsSubsetOf(subset, superset, string.Empty, null);
 		}

 		/// <summary>
-		/// Asserts that superset is a subset of subset.
-		/// </summary>
-		/// <param name="subset">The IEnumerable superset to be considered</param>
-		/// <param name="superset">The IEnumerable subset to be considered</param>
+		/// Asserts that the superset contains the subset.
+		/// </summary>
+      /// <param name="subset">The IEnumerable subset to be considered</param>
+      /// <param name="superset">The IEnumerable superset to be considered</param>
 		/// <param name="message">The message that will be displayed on failure</param>
 		public static void IsSubsetOf (IEnumerable subset, IEnumerable superset, string message)
 		{
@@ -525,10 +525,10 @@
 		}

 		/// <summary>
-		/// Asserts that superset is a subset of subset.
-		/// </summary>
-		/// <param name="subset">The IEnumerable superset to be considered</param>
-		/// <param name="superset">The IEnumerable subset to be considered</param>
+		/// Asserts that the superset contains the subset.
+		/// </summary>
+      /// <param name="subset">The IEnumerable subset to be considered</param>
+      /// <param name="superset">The IEnumerable superset to be considered</param>
 		/// <param name="message">The message that will be displayed on failure</param>
 		/// <param name="args">Arguments to be used in formatting the message</param>
 		public static void IsSubsetOf (IEnumerable subset, IEnumerable superset, string message, params object[] args)


Fix typo in comment (#13089)

Fix typo in comment (#13089)

integeter -> integer

--- src/mscorlib/shared/System/DateTime.cs
+++ src/mscorlib/shared/System/DateTime.cs
@@ -129,7 +129,7 @@
         private const String TicksField = "ticks"; // Do not rename (binary serialization)
         private const String DateDataField = "dateData"; // Do not rename (binary serialization)

-        // The data is stored as an unsigned 64-bit integeter
+        // The data is stored as an unsigned 64-bit integer
         //   Bits 01-62: The value of 100-nanosecond ticks where 0 represents 1/1/0001 12:00am, up until the value
         //               12/31/9999 23:59:59.9999999
         //   Bits 63-64: A four-state value that describes the DateTimeKind value of the date time, with a 2nd


player one is index 0

player one is index 0

--- Main.cs
+++ Main.cs
@@ -19,7 +19,7 @@
                 new ArgParser.Argument(new string[] {"-s", "--server"}, "server", "the url to the server you want to connect to e.g. locahost:3000", false, "127.0.0.1"),
                 new ArgParser.Argument(new string[] {"-p", "--port"}, "port", "the port to connect to on the server. Can be defined on the server arg via server:port", false, 3000),
                 new ArgParser.Argument(new string[] {"-n", "--name"}, "name", "the name you want to use as your AI\'s player name. This over-rides the name you set in your code"),
-                new ArgParser.Argument(new string[] {"-i", "--index"}, "index", "the player number you want to be, with 1 being the first player", false, -1),
+                new ArgParser.Argument(new string[] {"-i", "--index"}, "index", "the player number you want to be, with 0 being the first player", false, -1),
                 new ArgParser.Argument(new string[] {"-r", "--session"}, "requestedSession", "the requested game session you want to play on the server", false, "*"),
                 new ArgParser.Argument(new string[] {"-w", "--password"}, "password", "the password required for authentication on official servers"),
                 new ArgParser.Argument(new string[] {"--gameSettings"}, "gameSettings", "Any settings for the game server to force. Must be url parms formatted (key=value&otherKey=otherValue)"),


changed name

changed name

--- Main.cs
+++ Main.cs
@@ -55,7 +55,7 @@
         trackRider.meshGenerator.customColors = colors;
         trackRider.setDisplayName("MineTrain Coaster");
         trackRider.price = 3600;
-        trackRider.name = "Corkscrew_coaster_GO";
+        trackRider.name = "mine_train_coaster_GO";
         AssetManager.Instance.registerObject (trackRider);
         registeredObjects.Add (trackRider);


Replace hack implementation of "sort rules" with tree edit implementation. https://github.com/kaby76/AntlrVSIX/issues/40

--- LanguageServer/Transform.cs
+++ LanguageServer/Transform.cs
@@ -1093,106 +1093,8 @@

             // Find new order of rules.
             string old_code = document.Code;
-            List<Pair<int, int>> reorder = new List<Pair<int, int>>();
-            if (type == LspAntlr.ReorderType.DFS)
-            {
-                Digraph<string> graph = new Digraph<string>();
-                foreach (TableOfRules.Row r in table.rules)
-                {
-                    if (!r.is_parser_rule)
-                    {
-                        continue;
-                    }
-
-                    graph.AddVertex(r.LHS);
-                }
-                foreach (TableOfRules.Row r in table.rules)
-                {
-                    if (!r.is_parser_rule)
-                    {
-                        continue;
-                    }
-
-                    List<string> j = r.RHS;
-                    //j.Reverse();
-                    foreach (string rhs in j)
-                    {
-                        TableOfRules.Row sym = table.rules.Where(t => t.LHS == rhs).FirstOrDefault();
-                        if (!sym.is_parser_rule)
-                        {
-                            continue;
-                        }
-
-                        DirectedEdge<string> e = new DirectedEdge<string>(r.LHS, rhs);
-                        graph.AddEdge(e);
-                    }
-                }
-                List<string> starts = new List<string>();
-                foreach (TableOfRules.Row r in table.rules)
-                {
-                    if (r.is_parser_rule && r.is_start)
-                    {
-                        starts.Add(r.LHS);
-                    }
-                }
-                Algorithms.DepthFirstOrder<string, DirectedEdge<string>> sort = new DepthFirstOrder<string, DirectedEdge<string>>(graph, starts);
-                List<string> ordered = sort.ToList();
-                foreach (string s in ordered)
-                {
-                    TableOfRules.Row row = table.rules[table.nt_to_index[s]];
-                    reorder.Add(new Pair<int, int>(row.start_index, row.end_index));
-                }
-            }
-            else if (type == LspAntlr.ReorderType.BFS)
-            {
-                Digraph<string> graph = new Digraph<string>();
-                foreach (TableOfRules.Row r in table.rules)
-                {
-                    if (!r.is_parser_rule)
-                    {
-                        continue;
-                    }
-
-                    graph.AddVertex(r.LHS);
-                }
-                foreach (TableOfRules.Row r in table.rules)
-                {
-                    if (!r.is_parser_rule)
-                    {
-                        continue;
-                    }
-
-                    List<string> j = r.RHS;
-                    //j.Reverse();
-                    foreach (string rhs in j)
-                    {
-                        TableOfRules.Row sym = table.rules.Where(t => t.LHS == rhs).FirstOrDefault();
-                        if (!sym.is_parser_rule)
-                        {
-                            continue;
-                        }
-
-                        DirectedEdge<string> e = new DirectedEdge<string>(r.LHS, rhs);
-                        graph.AddEdge(e);
-                    }
-                }
-                List<string> starts = new List<string>();
-                foreach (TableOfRules.Row r in table.rules)
-                {
-                    if (r.is_parser_rule && r.is_start)
-                    {
-                        starts.Add(r.LHS);
-                    }
-                }
-                Algorithms.BreadthFirstOrder<string, DirectedEdge<string>> sort = new BreadthFirstOrder<string, DirectedEdge<string>>(graph, starts);
-                List<string> ordered = sort.ToList();
-                foreach (string s in ordered)
-                {
-                    TableOfRules.Row row = table.rules[table.nt_to_index[s]];
-                    reorder.Add(new Pair<int, int>(row.start_index, row.end_index));
-                }
-            }
-            else if (type == LspAntlr.ReorderType.Alphabetically)
+            List<IParseTree> reorder = new List<IParseTree>();
+            if (type == LspAntlr.ReorderType.Alphabetically)
             {
                 List<string> ordered = table.rules
                     .Where(r => r.is_parser_rule)
@@ -1201,46 +1103,105 @@
                 foreach (string s in ordered)
                 {
                     TableOfRules.Row row = table.rules[table.nt_to_index[s]];
-                    reorder.Add(new Pair<int, int>(row.start_index, row.end_index));
+                    reorder.Add(row.rule);
                 }
             }
             else
             {
+                Digraph<string> graph = new Digraph<string>();
+                foreach (TableOfRules.Row r in table.rules)
+                {
+                    if (!r.is_parser_rule)
+                    {
+                        continue;
+                    }
+                    graph.AddVertex(r.LHS);
+                }
+                foreach (TableOfRules.Row r in table.rules)
+                {
+                    if (!r.is_parser_rule)
+                    {
+                        continue;
+                    }
+                    List<string> j = r.RHS;
+                    //j.Reverse();
+                    foreach (string rhs in j)
+                    {
+                        TableOfRules.Row sym = table.rules.Where(t => t.LHS == rhs).FirstOrDefault();
+                        if (!sym.is_parser_rule)
+                        {
+                            continue;
+                        }
+
+                        DirectedEdge<string> e = new DirectedEdge<string>(r.LHS, rhs);
+                        graph.AddEdge(e);
+                    }
+                }
+                List<string> starts = new List<string>();
+                foreach (TableOfRules.Row r in table.rules)
+                {
+                    if (r.is_parser_rule && r.is_start)
+                    {
+                        starts.Add(r.LHS);
+                    }
+                }
+                List<string> ordered;
+                if (type == LspAntlr.ReorderType.DFS)
+                {
+                    Algorithms.DepthFirstOrder<string, DirectedEdge<string>> sort = new DepthFirstOrder<string, DirectedEdge<string>>(graph, starts);
+                    ordered = sort.ToList();
+                }
+                else if (type == LspAntlr.ReorderType.BFS)
+                {
+                    Algorithms.BreadthFirstOrder<string, DirectedEdge<string>> sort = new BreadthFirstOrder<string, DirectedEdge<string>>(graph, starts);
+                    ordered = sort.ToList();
+                }
+                else
+                {
+                    return result;
+                }
+                foreach (string s in ordered)
+                {
+                    TableOfRules.Row row = table.rules[table.nt_to_index[s]];
+                    reorder.Add(row.rule);
+                }
+            }
+            foreach (TableOfRules.Row r in table.rules)
+            {
+                if (r.is_parser_rule) continue;
+                reorder.Add(r.rule);
+            }
+            bool has_new_order = false;
+            for (int i = 0; i < table.rules.Count; ++i)
+            {
+                TableOfRules.Row r = table.rules[i];
+                if (reorder[i] != r.rule)
+                {
+                    has_new_order = true;
+                    break;
+                }
+            }
+            if (!has_new_order)
+            {
+                // No changes, no error.
                 return result;
             }

+            // Get all intertoken text immediately for source reconstruction.
+            var (text_before, other) = TreeEdits.TextToLeftOfLeaves(pd_parser.TokStream, pd_parser.ParseTree);
+
+            ANTLRv4Parser.RulesContext rules;
+            {
+                var first = reorder.First();
+                var rule = first as ANTLRv4Parser.ParserRuleSpecContext;
+                var rs = rule.Parent as ANTLRv4Parser.RuleSpecContext;
+                rules = rs.Parent as ANTLRv4Parser.RulesContext;
+                rules.children = reorder.Select(t => t.Parent).ToArray();
+            }
+
             StringBuilder sb = new StringBuilder();
-            int previous = 0;
-            {
-                int index_start = table.rules[0].start_index;
-                int len = 0;
-                string pre = old_code.Substring(previous, index_start - previous);
-                sb.Append(pre);
-                previous = index_start + len;
-            }
-            foreach (Pair<int, int> l in reorder)
-            {
-                int index_start = l.a;
-                int len = l.b - l.a;
-                string add = old_code.Substring(index_start, len);
-                sb.Append(add);
-            }
-            // Now add all non-parser rules.
-            foreach (TableOfRules.Row r in table.rules)
-            {
-                if (r.is_parser_rule)
-                {
-                    continue;
-                }
-
-                int index_start = r.start_index;
-                int len = r.end_index - r.start_index;
-                string add = old_code.Substring(index_start, len);
-                sb.Append(add);
-            }
-            //string rest = old_code.Substring(previous);
-            //sb.Append(rest);
-            string new_code = sb.ToString();
+            TreeEdits.Reconstruct(sb, pd_parser.ParseTree, text_before);
+            var new_code = sb.ToString();
             if (new_code != pd_parser.Code)
             {
                 result.Add(document.FullPath, new_code);


Attemp to hack around TypeRegistry

Attemp to hack around TypeRegistry

--- src/DotVVM.Compiler/StaticViewCompiler.cs
+++ src/DotVVM.Compiler/StaticViewCompiler.cs
@@ -4,11 +4,13 @@
 using System.Collections.Immutable;
 using System.IO;
 using System.Linq;
+using System.Linq.Expressions;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using DotVVM.CommandLine;
 using DotVVM.Framework.Binding;
 using DotVVM.Framework.Compilation;
+using DotVVM.Framework.Compilation.Binding;
 using DotVVM.Framework.Compilation.ControlTree;
 using DotVVM.Framework.Compilation.ControlTree.Resolved;
 using DotVVM.Framework.Compilation.Parser.Dothtml.Parser;
@@ -58,6 +60,7 @@
             Assembly dotvvmProjectAssembly,
             string dotvvmProjectDir)
         {
+            ReplaceDefaultTypeRegistry(dotvvmProjectAssembly);
             InitializeDotvvmControls(dotvvmProjectAssembly);
             return DotvvmProject.GetConfiguration(dotvvmProjectAssembly, dotvvmProjectDir, services =>
             {
@@ -268,12 +271,36 @@
         }

         /// <summary>
-        /// HACK: In 2.4.0, TypeRegistry uses ReflectionUtils.FindType. It therefore assumes that DotVVM is running the
-        ///       Default DependencyContext, which in Compiler it is not. This function replaces to
+        /// HACK: In 2.4.0, TypeRegistry uses ReflectionUtils.FindType. It therefore assumes that DotVVM is running in
+        ///       the Default DependencyContext, which in Compiler it is not. This function replaces the Default
+        ///       TypeRegistry with a custom one that searches the non-default DependencyContext as well.
         /// </summary>
-        private static void ReplaceDefaultTypeRegistry()
-        {
-
+        private static ImmutableArray<Assembly> projectReferences;
+        private static void ReplaceDefaultTypeRegistry(Assembly projectAssembly)
+        {
+#if NET461
+            return;
+#else
+            var projectContext = Microsoft.Extensions.DependencyModel.DependencyContext.Load(projectAssembly);
+            var builder = ImmutableArray.CreateBuilder<Assembly>();
+            builder.Add(projectAssembly);
+            builder.AddRange(Microsoft.Extensions.DependencyModel.DependencyContextExtensions
+                .GetDefaultAssemblyNames(projectContext)
+                .Select(Assembly.Load));
+            projectReferences = builder.ToImmutable();
+            var registryType = typeof(TypeRegistry);
+            var resolversField = registryType
+                .GetField("resolvers", BindingFlags.Instance | BindingFlags.NonPublic)!;
+            var resolvers = (ImmutableList<Func<string, Expression>>)resolversField
+                .GetValue(TypeRegistry.Default)!;
+            resolvers = resolvers.Add(typeName =>
+            {
+                var type = projectReferences.Select(a => a.GetType(typeName))
+                    .FirstOrDefault(t => t is object);
+                return TypeRegistry.CreateStatic(type);
+            });
+            resolversField.SetValue(TypeRegistry.Default, resolvers);
+#endif
         }

         private static ImmutableArray<MetadataReference> GetBaseReferences(DotvvmConfiguration configuration)


added nav links in the footer.

added nav links in the footer.

--- Forum3/Views/Shared/_Footer.cshtml
+++ Forum3/Views/Shared/_Footer.cshtml
@@ -12,6 +12,14 @@
 }

+	@if (User.Identity.IsAuthenticated) {
+

+
All Topics

+
Unread

+
Replies

+

+	}
+

Theme @Constants.Versions.Theme | Code @Constants.Versions.Code @timerOutput

Bringing disorder to chaos for @siteAge years.


The ClientRepeater doesn't override transport maximum packet sizes, by default.  Thus although a CR can receive any packet size, this choice means that it can only relay packets below a transport's max packet size.  This patch changes the CR to, by default, use a 4M default packet size.  This can be overridden on the command line.

--- GTServer/ClientRepeater/Program.cs
+++ GTServer/ClientRepeater/Program.cs
@@ -62,6 +62,13 @@
         {
             // Sleep at most 1 ms between updates
             this.TickInterval = TimeSpan.FromMilliseconds(1);
+
+            // default to a large default packet size: although this value doesn't
+            // prevent the CR from *receiving* large messages from other systems,
+            // it does put a cap on what size packets it can *send* (i.e., relay
+            // in the CR's case)
+            this.MaximumPacketSize = 4 * 1024 * 1024;
+
         }

         override public Server BuildServer()
@@ -176,7 +183,7 @@
         {
             int port = (int)DefaultPort;
             uint verbose = DefaultVerbosity;
-            uint maxPacketSize = 0;
+            int maxPacketSize = -1;
             int sessionChannelId = DefaultSessionChannelId;
             TimeSpan timeout = DefaultInactiveTimeout;

@@ -199,8 +206,8 @@
                             prop["level"] = opt.Argument;
                             LogManager.Adapter = new ConsoleOutLoggerFactoryAdapter(prop);
                             break;
-                        case 'm':
-                            maxPacketSize = uint.Parse(opt.Argument);
+                        case 'm':   // use uint as it shouldn't be negative
+                            maxPacketSize = (int)uint.Parse(opt.Argument);
                             break;
                         case 'b':
                             sessionChannelId = int.Parse(opt.Argument);
@@ -244,7 +251,10 @@
                 LogManager.GetLogger(typeof (ClientRepeater)).Info(String.Format("Starting server on port {0}", port));
             }
             RepeaterConfiguration config = new RepeaterConfiguration(port);
-            config.MaximumPacketSize = maxPacketSize;
+            if (maxPacketSize >= 0)
+            {
+                config.MaximumPacketSize = (uint)maxPacketSize;
+            }
             ClientRepeater cr = new ClientRepeater(config);
             cr.SessionChangesChannelId = sessionChannelId;
             cr.Verbose = verbose;


Fix big fat doofus typo in last commit

Fix big fat doofus typo in last commit

Git lets you commit changes selectively line by line, which can be
useful, as long as you watch out for use of the comma separator.

--- Quinstance/Program.cs
+++ Quinstance/Program.cs
@@ -483,7 +483,6 @@

             List<string> lines_out = new List<string>();
             for (int i = 0; i < lines_in.Count; ++i) {
-                string line_in = lines_in[i],
                 string line_in = Quinstance.Util.StripComment(lines_in[i]),
                        trimmed = line_in.Trim();


use regex

use regex

--- Recurly/BaseClient.cs
+++ Recurly/BaseClient.cs
@@ -76,7 +76,7 @@

         protected string InterpolatePath(string path, Dictionary<string, object> urlParams) {
           var regex = new Regex("{(.*)}");
-          return regex.Replace(path, m => urlParams[m]);
+          return regex.Replace(path, m => urlParams[m.Value]);
         }

         protected string ApiVersion() {


Use regex to parse link-header

Use regex to parse link-header

New behavior will extract value, but assumes exact format. Might make sense to be more lenient with parsing.
Needs more testing...

--- src/Site/Infrastructure/GitHub/Release.cs
+++ src/Site/Infrastructure/GitHub/Release.cs
@@ -3,6 +3,7 @@
 using Newtonsoft.Json;
 using System.Linq;
 using Microsoft.AspNet.WebUtilities;
+using System.Text.RegularExpressions;

 namespace RimDev.Releases.Infrastructure.GitHub
 {
@@ -36,10 +37,9 @@
                 {
                     var values = x.Split(';');
                     Console.WriteLine(values[0]);
-                    var uri = new Uri(values[0].Replace("<", "").Replace(">", ""));
-                    var queryDictionary = QueryHelpers.ParseQuery(uri.Query);
-
-                    return new { rel = values[1], querystring = QueryHelpers.ParseQuery(uri.Query) };
+                    var uri = new Uri(Regex.Match(values[0], "<(.*?)>", RegexOptions.Compiled).Groups[1].Value);
+
+                    return new { rel = Regex.Match(values[1], "rel=\"(.*?)\"", RegexOptions.Compiled).Groups[1].Value, querystring = QueryHelpers.ParseQuery(uri.Query) };
                 })
                 .ToList();


bug: AuthUriBuilder: auth method is never set

--- src/Solomobro.Instagram/AuthUriBuilder.cs
+++ src/Solomobro.Instagram/AuthUriBuilder.cs
@@ -25,6 +25,7 @@
             _clientId = clientId;
             _clientSecret = clientSecret;
             _redirectUri = redirectUri;
+            _authMethod = method;
             _scopes = scopes;
         }


Brought back authorization for venue admins

--- PompeiiSquare/PompeiiSquare.Server/Areas/VenueAdministrator/Controllers/BaseVenueAdministratorController.cs
+++ PompeiiSquare/PompeiiSquare.Server/Areas/VenueAdministrator/Controllers/BaseVenueAdministratorController.cs
@@ -9,7 +9,7 @@
     using PompeiiSquare.Data.UnitOfWork;
     using PompeiiSquare.Server.Controllers;

-    //[Authorize(Roles = "VenueAdministrator")] TODO: Uncomment this later!
+    [Authorize(Roles = "VenueAdministrator")]
     public abstract class BaseVenueAdministratorController : BaseController
     {
         protected BaseVenueAdministratorController(IPompeiiSquareData data)


Treat "reached recursion bound" as a failure.

--- SVX/LocalCertifier.cs
+++ SVX/LocalCertifier.cs
@@ -134,16 +134,18 @@
             process.Start();

             // There should be a library for this...
-            var output = new StringBuilder();
+            var outputBuilder = new StringBuilder();
             string line;
             while ((line = process.StandardOutput.ReadLine()) != null)
             {
                 Console.WriteLine(line);
-                output.AppendLine(line);
+                outputBuilder.AppendLine(line);
             }
+            string output = outputBuilder.ToString();
             process.WaitForExit();

-            if (output.ToString().IndexOf("Program has no bugs") > 0)
+            // XXX Maybe Corral should have a flag to treat "reached recursion bound" as a failure.
+            if (output.Contains("Program has no bugs") && !output.Contains("Reached recursion bound"))
                 return true;
             else
                 return false;


Fix tabs

Fix tabs

--- Scripts/Blackboard.cs
+++ Scripts/Blackboard.cs
@@ -86,7 +86,7 @@
                 }
                 else
                 {
-					if((this.data[key] == null && value != null)|| !this.data[key].Equals(value))
+                    if((this.data[key] == null && value != null)|| !this.data[key].Equals(value))
                     {
                         this.data[key] = value;
                         this.notifications.Add(new Notification(key, Type.CHANGE, value));
@@ -323,4 +323,4 @@
             return observers;
         }
     }
-}+}


Set AssemblyConfiguration details

Set AssemblyConfiguration details

--- SharedAssemblyInfo.cs
+++ SharedAssemblyInfo.cs
@@ -5,12 +5,17 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.

-[assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Steven Liekens")]
 [assembly: AssemblyProduct("TextFx")]
 [assembly: AssemblyCopyright("The MIT License (MIT)")]
 [assembly: AssemblyTrademark("")]
 [assembly: NeutralResourcesLanguage("en")]
+
+#if DEBUG
+[assembly: AssemblyConfiguration("Debug")]
+#else
+[assembly: AssemblyConfiguration("Release")]
+# endif

 // Version information for an assembly consists of the following four values:
 //      Major Version
@@ -23,4 +28,4 @@

 [assembly: AssemblyVersion("1.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: AssemblyInformationalVersion("1.0.0")]+[assembly: AssemblyInformationalVersion("1.0.0")]


SimQL.Test commit

SimQL.Test commit

--- SimQL/SimQLProgram.cs
+++ SimQL/SimQLProgram.cs
@@ -12,17 +12,30 @@
 		static void Main(string[] args)
 		{
 			var json = Console.In.ReadToEnd();
-			foreach (var result in ExecuteQueries(json))
-				Console.WriteLine(result);
+		    foreach (var parsedResult in ExecuteQueries(json))
+		    {
+		        try
+		        {
+		            var result = int.Parse(parsedResult);
+		            Console.WriteLine(result);
+		        }
+		        catch
+		        {
+                    var result = double.Parse(parsedResult);
+                    Console.WriteLine(result);
+                }
+		    }
 		}

 		public static IEnumerable<string> ExecuteQueries(string json)
 		{
 			var jObject = JObject.Parse(json);
-			var data = (JObject)jObject["data"];
-			var queries = jObject["queries"].ToObject<string[]>();
+            //var data = (JObject)jObject["data"];
+            var data = (JArray)jObject["data"];
+            var queries = jObject["queries"].ToObject<string[]>();
 			// TODO
-			return queries.Select(q => "TODO");
+			return queries.Select(q => "0");
 		}
+
 	}
 }


Introduced Methods<T>.Select() for methods with return values

--- Src/Albedo/Methods.cs
+++ Src/Albedo/Methods.cs
@@ -90,5 +90,11 @@

             return methodCallExp.Method;
         }
+
+        public MethodInfo Select<TResult>(
+            Expression<Func<T, TResult>> methodSelector)
+        {
+            throw new NotImplementedException();
+        }
     }
 }


Set the working directory on startup. Add parts that are double clicked to the queue.

--- MatterControlApplication.cs
+++ MatterControlApplication.cs
@@ -278,7 +278,7 @@
                 {
                     if (Path.GetExtension(arg).ToUpper() == ".STL")
                     {
-                        new PartPreviewMainWindow(new PrintItemWrapper(new DataStorage.PrintItem(Path.GetFileName(arg), Path.GetFullPath(arg))), View3DTransformPart.AutoRotate.Enabled);
+                        QueueData.Instance.AddItem(new PrintItemWrapper(new DataStorage.PrintItem(Path.GetFileName(arg), Path.GetFullPath(arg))));
                     }
                 }
             }
@@ -301,6 +301,9 @@
         [STAThread]
         public static void Main()
         {
+            // Make sure we have the right woring directory as we assume everything relative to the executable.
+            Directory.SetCurrentDirectory(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location));
+
             Datastore.Instance.Initialize();

             // try and open our window matching the last size that we had for it.


Deleting unnecessary using

Deleting unnecessary using

--HG--
branch : issue/OSOE-26

--- Models/YouTubeEmbedField.cs
+++ Models/YouTubeEmbedField.cs
@@ -1,6 +1,5 @@
 using Orchard.ContentManagement;
 using Orchard.Environment.Extensions;
-using System;

 /* Just like with content part development, we'll start with creating a model class.
  * We don't need anything too complex, just store a string for a YouTube video ID, which will be used to identify YouTube


fixed a bug where appender list was constructed incorrectly

--- NLog/src/NLog/LogManager.cs
+++ NLog/src/NLog/LogManager.cs
@@ -305,6 +305,7 @@
         internal static AppenderWithFilterChain[]GetAppendersByLevelForLogger(string name, LoggingConfiguration config)
         {
             AppenderWithFilterChain[]appendersByLevel = new AppenderWithFilterChain[(int)LogLevel.MaxLevel + 1];
+            AppenderWithFilterChain[]lastAppendersByLevel = new AppenderWithFilterChain[(int)LogLevel.MaxLevel + 1];

             if (config != null)
             {
@@ -319,26 +320,18 @@
                         {
                             if (rule.IsLoggingEnabledForLevel((LogLevel)i))
                             {
-                                // first cache the current appender
-                                AppenderWithFilterChain awfcCurrent = appendersByLevel[i];
-
                                 foreach (Appender appender in rule.Appenders)
                                 {
                                     AppenderWithFilterChain awf = new AppenderWithFilterChain(appender, rule.Filters);
-                                    // instead use the local for the current position
-                                    if (awfcCurrent != null)
+                                    if (lastAppendersByLevel[i] != null)
                                     {
-                                        // as before, but using the temp
-                                        awfcCurrent.Next = awf;
+                                        lastAppendersByLevel[i].Next = awf;
                                     }
                                     else
                                     {
-                                        // for the null case, set the temp and ensure the appender list is also updated
-                                        appendersByLevel[i] = awfcCurrent = awf;
+                                        appendersByLevel[i] = awf;
                                     }
-
-                                    // now adjust the temp
-                                    awfcCurrent = awf;
+                                    lastAppendersByLevel[i] = awf;
                                 }
                             }
                         }


Ensure that fileinfo is up-to-date when restarting

--- NetLogMonitor/LogMonitor.cs
+++ NetLogMonitor/LogMonitor.cs
@@ -57,7 +57,6 @@
                 }
                 else
                 {
-                    fileInfo.Refresh();
                     long thisSize = fileInfo.Length;
                     long seekPos = 0;
                     int readLen = 0;
@@ -112,7 +111,10 @@
             var directory = new DirectoryInfo(path);
             try
             {
-                return directory.GetFiles().Where(f => filter == null || filter.IsMatch(f.Name)).OrderByDescending(f => f.LastWriteTime).FirstOrDefault();
+                FileInfo info = directory.GetFiles().Where(f => filter == null || filter.IsMatch(f.Name)).OrderByDescending(f => f.LastWriteTime).FirstOrDefault();
+                // This info can be cached so force a refresh
+                info.Refresh();
+                return info;
             }
             catch
             {


adde properties to hinge joint.

adde properties to hinge joint.

--- NewtonPlugin/NewtonHinge.cs
+++ NewtonPlugin/NewtonHinge.cs
@@ -25,20 +25,9 @@

         Stiffness = m_stiffness;
         EnableLimits = m_enableLimits;
-    }
-/*
-    void SetLimits ()
-    {
-        dNewtonHinge hinge = (dNewtonHinge)m_joint;
-        hinge.SetLimits(m_enableLimits, m_minLimit, m_maxLimit);
-    }
-
-    void SetAsSpringDamper()
-    {
-        dNewtonHinge hinge = (dNewtonHinge)m_joint;
-        hinge.SetAsSpringDamper(m_setSpringDamper, m_springDamperForceMixing, m_springConstant, m_damperConstant);
-    }
-*/
+        SetSpringDamper = m_setSpringDamper;
+    }
+
     void OnDrawGizmosSelected()
     {
         Matrix4x4 bodyMatrix = Matrix4x4.identity;
@@ -105,6 +94,74 @@
             {
                 dNewtonHinge hinge = (dNewtonHinge)m_joint;
                 hinge.SetLimits(m_enableLimits, m_minLimit, m_maxLimit);
+            }
+        }
+    }
+
+    public bool SetSpringDamper
+    {
+        get
+        {
+            return m_setSpringDamper;
+        }
+        set
+        {
+            m_setSpringDamper = value;
+            if (m_joint != null)
+            {
+                dNewtonHinge hinge = (dNewtonHinge)m_joint;
+                hinge.SetAsSpringDamper(m_setSpringDamper, m_springDamperForceMixing, m_springConstant, m_damperConstant);
+            }
+        }
+    }
+
+    public float SpringDamperForceMixing
+    {
+        get
+        {
+            return m_springDamperForceMixing;
+        }
+        set
+        {
+            m_springDamperForceMixing = value;
+            if (m_joint != null)
+            {
+                dNewtonHinge hinge = (dNewtonHinge)m_joint;
+                hinge.SetAsSpringDamper(m_setSpringDamper, m_springDamperForceMixing, m_springConstant, m_damperConstant);
+            }
+        }
+    }
+
+    public float SpringConstant
+    {
+        get
+        {
+            return m_springConstant;
+        }
+        set
+        {
+            m_springConstant = value;
+            if (m_joint != null)
+            {
+                dNewtonHinge hinge = (dNewtonHinge)m_joint;
+                hinge.SetAsSpringDamper(m_setSpringDamper, m_springDamperForceMixing, m_springConstant, m_damperConstant);
+            }
+        }
+    }
+
+    public float DamperConstant
+    {
+        get
+        {
+            return m_damperConstant;
+        }
+        set
+        {
+            m_damperConstant = value;
+            if (m_joint != null)
+            {
+                dNewtonHinge hinge = (dNewtonHinge)m_joint;
+                hinge.SetAsSpringDamper(m_setSpringDamper, m_springDamperForceMixing, m_springConstant, m_damperConstant);
             }
         }
     }
@@ -139,8 +196,6 @@
         {
             m_joint = new dNewtonHingeActuator(floatsPtr, child.GetBody().GetBody(), m_otherBody.GetBody().GetBody());
         }
-
-
     }


Added some secure boot policies.

Added some secure boot policies.

--- NtApiDotNet/NtSystemInfo.cs
+++ NtApiDotNet/NtSystemInfo.cs
@@ -208,6 +208,23 @@
         public byte Policy;
     }

+    public class SecureBootPolicy
+    {
+        public Guid PolicyPublisher { get; private set; }
+        public int PolicyVersion { get; private set; }
+        public int PolicyOptions { get; private set; }
+        public byte[] Policy { get; private set; }
+
+        internal SecureBootPolicy(SafeStructureInOutBuffer<SystemSecurebootPolicyFullInformation> policy)
+        {
+            SystemSecurebootPolicyFullInformation policy_struct = policy.Result;
+            PolicyPublisher = policy_struct.PolicyInformation.PolicyPublisher;
+            PolicyVersion = policy_struct.PolicyInformation.PolicyVersion;
+            PolicyOptions = policy_struct.PolicyInformation.PolicyOptions;
+            Policy = policy.Data.ReadBytes(policy_struct.PolicySize);
+        }
+    }
+
     [Flags]
     public enum CodeIntegrityOptions
     {
@@ -231,15 +248,10 @@
     }

     [StructLayout(LayoutKind.Sequential)]
-    public class SystemCodeIntegrityInformation
+    public struct SystemCodeIntegrityInformation
     {
         public int Length;
         public CodeIntegrityOptions CodeIntegrityOptions;
-
-        public SystemCodeIntegrityInformation()
-        {
-            Length = Marshal.SizeOf(this);
-        }
     }

     [StructLayout(LayoutKind.Sequential)]
@@ -799,6 +811,22 @@
             }
         }

+        private static T QuerySystemInfo<T>(T data, SystemInformationClass info_class) where T : struct
+        {
+            using (var buffer = data.ToBuffer())
+            {
+                int ret_length;
+                NtSystemCalls.NtQuerySystemInformation(info_class, buffer,
+                    buffer.Length, out ret_length).ToNtException();
+                return buffer.Result;
+            }
+        }
+
+        private static T QuerySystemInfo<T>(SystemInformationClass info_class) where T : struct
+        {
+            return QuerySystemInfo<T>(new T(), info_class);
+        }
+
         /// <summary>
         /// Get current code integrity option settings.
         /// </summary>
@@ -806,12 +834,8 @@
         {
             get
             {
-                using (var buffer = new SystemCodeIntegrityInformation().ToBuffer())
-                {
-                    int ret_length;
-                    NtSystemCalls.NtQuerySystemInformation(SystemInformationClass.SystemCodeIntegrityInformation, buffer, buffer.Length, out ret_length).ToNtException();
-                    return buffer.Result.CodeIntegrityOptions;
-                }
+                return QuerySystemInfo(new SystemCodeIntegrityInformation() { Length = Marshal.SizeOf(typeof(SystemCodeIntegrityInformation)) },
+                    SystemInformationClass.SystemCodeIntegrityInformation).CodeIntegrityOptions;
             }
         }

@@ -881,5 +905,51 @@
                 }
             }
         }
+
+        /// <summary>
+        /// Get whether secure boot is enabled.
+        /// </summary>
+        public static bool SecureBootEnabled
+        {
+            get
+            {
+                return QuerySystemInfo<SystemSecurebootInformation>(SystemInformationClass.SystemSecureBootInformation).SecureBootEnabled;
+            }
+        }
+
+        /// <summary>
+        /// Get whether system supports secure boot.
+        /// </summary>
+        public static bool SecureBootCapable
+        {
+            get
+            {
+                return QuerySystemInfo<SystemSecurebootInformation>(SystemInformationClass.SystemSecureBootInformation).SecureBootCapable;
+            }
+        }
+
+        /// <summary>
+        /// Extract the secure boot policy.
+        /// </summary>
+        public static SecureBootPolicy SecureBootPolicy
+        {
+            get
+            {
+                int ret_length;
+                NtStatus status = NtSystemCalls.NtQuerySystemInformation(SystemInformationClass.SystemSecureBootPolicyFullInformation,
+                    SafeHGlobalBuffer.Null, 0, out ret_length);
+                if (status != NtStatus.STATUS_INFO_LENGTH_MISMATCH)
+                {
+                    throw new NtException(status);
+                }
+
+                using (var buffer = new SafeStructureInOutBuffer<SystemSecurebootPolicyFullInformation>(ret_length, true))
+                {
+                    NtSystemCalls.NtQuerySystemInformation(SystemInformationClass.SystemSecureBootPolicyFullInformation,
+                        buffer, buffer.Length, out ret_length).ToNtException();
+                    return new SecureBootPolicy(buffer);
+                }
+            }
+        }
     }
 }


1. change some of the markdown component inherit CompositeDrawable

--- osu.Framework/Graphics/Containers/MarkdownContainer.cs
+++ osu.Framework/Graphics/Containers/MarkdownContainer.cs
@@ -51,13 +51,13 @@
             set => markdownContainer.Spacing = new Vector2(value);
         }

-        public virtual MarginPadding MarkdownMargin
+        public MarginPadding MarkdownMargin
         {
             get => markdownContainer.Margin;
             set => markdownContainer.Margin = value;
         }

-        public virtual MarginPadding MarkdownPadding
+        public MarginPadding MarkdownPadding
         {
             get => markdownContainer.Padding;
             set => markdownContainer.Padding = value;
@@ -197,31 +197,26 @@
     }

     /// <summary>
-    /// NotExistMarkdown :
-    /// shows the <see cref="IMarkdownObject" /> does not implement in drawable object
-    /// </summary>
-    public class NotImplementedMarkdown : SpriteText
+    /// Visualises a message when a <see cref="IMarkdownObject"/> doesn't have a visual implementation.
+    /// </summary>
+    public class NotImplementedMarkdown : CompositeDrawable
     {
         public NotImplementedMarkdown(IMarkdownObject markdownObject)
         {
-            Colour = new Color4(255, 0, 0, 255);
-            TextSize = 21;
-            Text = markdownObject?.GetType() + " Not implemented.";
-        }
-    }
-
-    /// <summary>
-    /// MarkdownTable :
-    /// |Operator            | Description
-    /// |--------------------|------------
-    /// | `<left/> + <right/>` | add left to right number
-    /// | `<left/> - <right/>` | substract right number from left
-    /// | `<left/> * <right/>` | multiply left by right number
-    /// | `<left/> / <right/>` | divide left by right number
-    /// | `<left/> // <right/>`| divide left by right number and round to an integer
-    /// | `<left/> % <right/>` | calculates the modulus of left by right
-    /// </summary>
-    public class MarkdownTable : Container
+            AutoSizeAxes = Axes.Y;
+            InternalChildren = new SpriteText
+            {
+                Colour = new Color4(255, 0, 0, 255),
+                TextSize = 21,
+                Text = markdownObject?.GetType() + " Not implemented."
+            };
+        }
+    }
+
+    /// <summary>
+    /// Visualises a markdown table, containing <see cref="MarkdownTableCell"/>s.
+    /// </summary>
+    public class MarkdownTable : CompositeDrawable
     {
         private readonly MarkdownTableContainer tableContainer;
         private readonly List<List<MarkdownTableCell>> listContainerArray = new List<List<MarkdownTableCell>>();
@@ -253,14 +248,11 @@
                 listContainerArray.Add(rows);
             }

-            Children = new Drawable[]
-            {
-                tableContainer = new MarkdownTableContainer
-                {
-                    AutoSizeAxes = Axes.Y,
-                    RelativeSizeAxes = Axes.X,
-                    Content = listContainerArray.Select(x=>x.Select(y=>(Drawable)y).ToArray()).ToArray(),
-                }
+            InternalChild = tableContainer = new MarkdownTableContainer
+            {
+                AutoSizeAxes = Axes.Y,
+                RelativeSizeAxes = Axes.X,
+                Content = listContainerArray.Select(x => x.Select(y => (Drawable)y).ToArray()).ToArray(),
             };
         }

@@ -270,13 +262,13 @@
             if (lastDrawSize != DrawSize)
             {
                 lastDrawSize = DrawSize;
-                UpdateColumnDefinitions();
-                UpdateRowDefinitions();
+                updateColumnDefinitions();
+                updateRowDefinitions();
             }
             base.Update();
         }

-        protected virtual void UpdateColumnDefinitions()
+        private void updateColumnDefinitions()
         {
             var totalColumn = listContainerArray.Max(x => x.Count);
             var totalRows = listContainerArray.Count;
@@ -321,7 +313,7 @@
             tableContainer.ColumnDimensions = columnDimensions;
         }

-        protected virtual void UpdateRowDefinitions()
+        private void updateRowDefinitions()
         {
             tableContainer.RowDimensions = listContainerArray.Select(x => new Dimension(GridSizeMode.Absolute, x.Max(y => y.TextFlowContainer.DrawHeight + 10))).ToArray();
         }
@@ -335,7 +327,7 @@
             }
         }

-        public class MarkdownTableCell : Container
+        public class MarkdownTableCell : CompositeDrawable
         {
             public MarkdownTextFlowContainer TextFlowContainer => textFlowContainer;
             private readonly MarkdownTextFlowContainer textFlowContainer;
@@ -343,7 +335,7 @@
             protected virtual MarkdownTextFlowContainer CreateMarkdownTextFlowContainer() =>
                 new MarkdownTextFlowContainer
                 {
-                    Margin = new MarginPadding { Left = 5, Right = 5, Top = 5, Bottom = 5 }
+                    Padding = new MarginPadding { Left = 5, Right = 5, Top = 5, Bottom = 0 }
                 };

             public MarkdownTableCell(TableCell cell, TableColumnDefinition definition, int rowNumber)
@@ -361,7 +353,7 @@
                     backgroundAlpha = 0.4f;
                 }

-                Children = new Drawable[]
+                InternalChildren = new Drawable[]
                 {
                     new Box
                     {
@@ -385,8 +377,7 @@
                         break;

                     case TableColumnAlign.Right:
-                        //TODO : make this work
-                        //textFlowContainer.TextAnchor = Anchor.TopRight;
+                        textFlowContainer.TextAnchor = Anchor.TopRight;
                         break;

                     default:
@@ -403,7 +394,7 @@
     /// foo
     /// ```
     /// </summary>
-    public class MarkdownFencedCodeBlock : Container
+    public class MarkdownFencedCodeBlock : CompositeDrawable
     {
         public MarkdownFencedCodeBlock(FencedCodeBlock fencedCodeBlock)
         {
@@ -411,7 +402,7 @@
             RelativeSizeAxes = Axes.X;

             TextFlowContainer textFlowContainer;
-            Children = new Drawable[]
+            InternalChildren = new Drawable[]
             {
                 new Box
                 {
@@ -443,7 +434,7 @@
     /// ###Heading3
     /// ###3Heading4
     /// </summary>
-    public class MarkdownHeading : Container
+    public class MarkdownHeading : CompositeDrawable
     {
         protected virtual MarkdownTextFlowContainer CreateMarkdownTextFlowContainer() =>
             new MarkdownTextFlowContainer();
@@ -455,7 +446,7 @@

             MarkdownTextFlowContainer textFlowContainer;

-            Children = new Drawable[]
+            InternalChildren = new Drawable[]
             {
                 textFlowContainer = CreateMarkdownTextFlowContainer()
             };
@@ -488,7 +479,7 @@
     /// MarkdownQuoteBlock :
     /// > NOTE: This document does not describe the `liquid` language.
     /// </summary>
-    public class MarkdownQuoteBlock : Container
+    public class MarkdownQuoteBlock : CompositeDrawable
     {
         protected virtual MarkdownTextFlowContainer CreateMarkdownTextFlowContainer() =>
             new MarkdownTextFlowContainer
@@ -503,7 +494,7 @@

             MarkdownTextFlowContainer textFlowContainer;

-            Children = new Drawable[]
+            InternalChildren = new Drawable[]
             {
                 new Box
                 {
@@ -525,25 +516,29 @@
     /// MarkdownSeperator :
     /// (spacing)
     /// </summary>
-    public class MarkdownSeperator : Box
+    public class MarkdownSeperator : CompositeDrawable
     {
         public MarkdownSeperator()
         {
+            Height = 1;
             RelativeSizeAxes = Axes.X;
-            Height = 1;
-            Colour = Color4.Gray;
+            InternalChild = new Box();
+            {
+                RelativeSizeAxes = Axes.X;
+                Colour = Color4.Gray;
+            }
         }
     }

     /// <summary>
     /// Load image from url
     /// </summary>
-    public class MarkdownImage : Container
+    public class MarkdownImage : CompositeDrawable
     {
         private readonly Box background;
         public MarkdownImage(string url)
         {
-            Children = new Drawable[]
+            InternalChildren = new Drawable[]
             {
                 background = new Box
                 {
@@ -576,7 +571,7 @@
             imageContainer.FadeInFromZero(300, Easing.OutQuint);
         }

-        protected class ImageContainer : Container
+        protected class ImageContainer : CompositeDrawable
         {
             private readonly string imageUrl;
             private readonly Sprite image;
@@ -586,7 +581,7 @@
             public ImageContainer(string url)
             {
                 imageUrl = url;
-                Children = new Drawable[]
+                InternalChildren = new Drawable[]
                 {
                     image = new Sprite
                     {
@@ -729,7 +724,7 @@
         protected virtual void AddBoldText(string text, LiteralInline literalInline)
         {
             //TODO : make real "Bold text"
-            AddDrawanle(new SpriteText
+            AddDrawable(new SpriteText
             {
                 Text = text,
                 Colour = Color4.LightGray
@@ -772,7 +767,7 @@
             });
         }

-        protected IEnumerable<SpriteText> AddDrawanle(Drawable drawable)
+        protected IEnumerable<SpriteText> AddDrawable(Drawable drawable)
         {
             var imageIndex = AddPlaceholder(drawable);
             return base.AddText("[" + imageIndex + "]");


Remove unnecessary double suffixes

Remove unnecessary double suffixes

--- osu.Game.Rulesets.Catch/Skinning/LegacyComboCounter.cs
+++ osu.Game.Rulesets.Catch/Skinning/LegacyComboCounter.cs
@@ -86,16 +86,16 @@
                 return;
             }

-            counter.ScaleTo(1.5f).ScaleTo(0.8f, 250.0, Easing.Out)
+            counter.ScaleTo(1.5f).ScaleTo(0.8f, 250, Easing.Out)
                    .OnComplete(c => c.SetCountWithoutRolling(combo));

-            counter.Delay(250.0).ScaleTo(1f).ScaleTo(1.1f, 60.0).Then().ScaleTo(1f, 30.0);
+            counter.Delay(250).ScaleTo(1f).ScaleTo(1.1f, 60).Then().ScaleTo(1f, 30);

             explosion.Colour = hitObjectColour ?? Color4.White;

             explosion.SetCountWithoutRolling(combo);
-            explosion.ScaleTo(1.5f).ScaleTo(1.9f, 400.0, Easing.Out)
-                     .FadeOutFromOne(400.0);
+            explosion.ScaleTo(1.5f).ScaleTo(1.9f, 400, Easing.Out)
+                     .FadeOutFromOne(400);
         }
     }
 }


[050dev] Command line processor to handle arbitrary environment variables.

--- packages/CommandLineProcessor/dev/Scripts/Processor.cs
+++ packages/CommandLineProcessor/dev/Scripts/Processor.cs
@@ -48,6 +48,22 @@
                 string pathEnv = path.ToString().TrimEnd(new char[] { System.IO.Path.PathSeparator });
                 processStartInfo.EnvironmentVariables["PATH"] = pathEnv;
                 //Opus.Core.Log.DebugMessage("Path is '{0}'", pathEnv);
+            }
+
+            if (tool is Opus.Core.IToolEnvironmentVariables)
+            {
+                System.Collections.Generic.Dictionary<string, Opus.Core.StringArray> variables = (tool as Opus.Core.IToolEnvironmentVariables).Variables(target);
+                foreach (string key in variables.Keys)
+                {
+                    System.Text.StringBuilder paths = new System.Text.StringBuilder();
+                    foreach (string path in variables[key])
+                    {
+                        paths.AppendFormat("{0}{1}", path, System.IO.Path.PathSeparator);
+                    }
+
+                    string pathEnv = paths.ToString().TrimEnd(new char[] { System.IO.Path.PathSeparator });
+                    processStartInfo.EnvironmentVariables[key] = pathEnv;
+                }
             }

             if (tool is Opus.Core.IToolSupportsResponseFile)


[trunk] CommandLineProcessor.Execute now takes an optional 'hostApplication' parameter, should the executable require a hosting environment to run.

--- packages/CommandLineProcessor/dev/Scripts/Processor.cs
+++ packages/CommandLineProcessor/dev/Scripts/Processor.cs
@@ -9,10 +9,24 @@
     {
         public static int Execute(Opus.Core.DependencyNode node, Opus.Core.ITool tool, Opus.Core.StringArray commandLineBuilder)
         {
+            return Execute (node, tool, commandLineBuilder, null);
+        }
+
+        public static int Execute(Opus.Core.DependencyNode node, Opus.Core.ITool tool, Opus.Core.StringArray commandLineBuilder, string hostApplication)
+        {
             Opus.Core.Target target = node.Target;
             string executablePath = tool.Executable(target);

             System.Diagnostics.ProcessStartInfo processStartInfo = new System.Diagnostics.ProcessStartInfo();
+            if (null != hostApplication)
+            {
+                processStartInfo.Arguments = executablePath + " ";
+                executablePath = hostApplication;
+            }
+            else
+            {
+                processStartInfo.Arguments = string.Empty;
+            }
             processStartInfo.FileName = executablePath;
             processStartInfo.ErrorDialog = true;

@@ -81,11 +95,11 @@
                     writer.WriteLine(commandLineBuilder.ToString('\n'));
                 }

-                processStartInfo.Arguments = System.String.Format("{0}{1}", responseFileOption, responseFile);
+                processStartInfo.Arguments += System.String.Format("{0}{1}", responseFileOption, responseFile);
             }
             else
             {
-                processStartInfo.Arguments = commandLineBuilder.ToString(' ');
+                processStartInfo.Arguments += commandLineBuilder.ToString(' ');
             }

             Opus.Core.Log.Detail("{0} {1}", executablePath, processStartInfo.Arguments);


Change sceneRootFolderName

Change sceneRootFolderName

--- Assets/Meow/Components/MainGame.cs
+++ Assets/Meow/Components/MainGame.cs
@@ -18,7 +18,7 @@
         public string VersionFileName;
         public string LuaBundleName;
         public string LuaScriptRootFolderName;
-        public string MainSceneRootFolderPath;
+        public string SceneRootFolderPath;

         public Text SingleSizeText;
         public Slider SingleSlider;
@@ -77,7 +77,7 @@
             StartGameButton.gameObject.SetActive(true);
             StartGameButton.onClick.AddListener(() =>
             {
-                _resourceLoader.LoadLevelAsync(Path.Combine(MainSceneRootFolderPath, "01Main.unity"));
+                _resourceLoader.LoadLevelAsync(Path.Combine(SceneRootFolderPath, "01Main.unity"));
             });
         }


Properly commit Game.cs

Properly commit Game.cs

Ugh.

--- Assets/Scripts/System/Data/Game.cs
+++ Assets/Scripts/System/Data/Game.cs
@@ -116,10 +116,13 @@
         }
         else if (gameType == GameType.PICO8)
         {
+            GM.dbug.Log("GAME: Loading default PICO8 screenshot ");
+            screenshotTex = Resources.Load<Texture2D>("default_images/pico8") as Texture2D;
         }
         else
         {
             GM.dbug.Log("GAME: Loading default screenshot");
+            screenshotTex = Resources.Load<Texture2D>("default_images/exe") as Texture2D;
         }

         // Turn the Texture2D into a sprite