[packages,C] Fixes #521. Missed an OSX specification that assumed the presense of the MinorVersion

--- packages/C/bam/Scripts/Defaults/ICommonLinkerSettingsOSX.cs
+++ packages/C/bam/Scripts/Defaults/ICommonLinkerSettingsOSX.cs
@@ -41,7 +41,7 @@
             if (module is C.IDynamicLibrary)
             {
                 settings.InstallName = module.CreateTokenizedString("@rpath/@filename($(LinkOutput))");
-                var fullVersionNumber = module.CreateTokenizedString("$(MajorVersion).$(MinorVersion)#valid(.$(PatchVersion))");
+                var fullVersionNumber = module.CreateTokenizedString("$(MajorVersion)#valid(.$(MinorVersion)#valid(.$(PatchVersion)))");
                 settings.CurrentVersion = fullVersionNumber;
                 settings.CompatibilityVersion = fullVersionNumber;
             }


redundant suppress directive removed

redundant suppress directive removed

--- test/Selenium.WebDriver.Extensions.IntegrationTests/TestPage.cs
+++ test/Selenium.WebDriver.Extensions.IntegrationTests/TestPage.cs
@@ -5,8 +5,6 @@
     using JetBrains.Annotations;
     using OpenQA.Selenium;
     using OpenQA.Selenium.Support.PageObjects;
-    using static Suppress.Category;
-    using static Suppress.CodeCracker;

     [PublicAPI]
     [ExcludeFromCodeCoverage]
@@ -14,7 +12,6 @@
     {
         private IWebDriver _driver;

-        [SuppressMessage(CODE_CRACKER, CC0057)]
         public TestPage(IWebDriver driver)
         {
             _driver = driver ?? throw new ArgumentNullException(nameof(driver));


extended dealing for EventExecutorSpecs

extended dealing for EventExecutorSpecs

--- tests/Helios.FsCheck.Tests/Concurrency/EventExecutorSpecBase.cs
+++ tests/Helios.FsCheck.Tests/Concurrency/EventExecutorSpecBase.cs
@@ -176,7 +176,8 @@

                 SpinWait.SpinUntil(() => loopResult.IsCompleted, TimeSpan.FromMilliseconds(100));

-                var waitPeriod = TimeSpan.FromTicks(nextDelay).Add(TimeSpan.FromMilliseconds(20));
+                // need a longer timeout window due to CPU scheduling failing this spec on low-powered devices
+                var waitPeriod = TimeSpan.FromTicks(nextDelay).Add(TimeSpan.FromMilliseconds(200));
                 if (!Task.WhenAll(tasks).Wait(waitPeriod))
                     return
                         false.ToProperty()
@@ -238,7 +239,8 @@

                 SpinWait.SpinUntil(() => loopResult.IsCompleted, TimeSpan.FromMilliseconds(100));

-                var waitPeriod = TimeSpan.FromTicks(nextDelay).Add(TimeSpan.FromMilliseconds(20));
+                // need a longer timeout window due to CPU scheduling failing this spec on low-powered devices
+                var waitPeriod = TimeSpan.FromTicks(nextDelay).Add(TimeSpan.FromMilliseconds(200));
                 if (!Task.WhenAll(tasks).Wait(waitPeriod))
                     return false.ToProperty().Label($"TIMEOUT: {obj1.Executor} failed to execute {Sets.Length} within {waitPeriod.TotalMilliseconds}ms");


Fixed CiviSync unit tests.

Fixed CiviSync unit tests.

--- tools/Chiro.CiviSync/Chiro.CiviSync.Services.Test/TestHelper.cs
+++ tools/Chiro.CiviSync/Chiro.CiviSync.Services.Test/TestHelper.cs
@@ -87,7 +87,14 @@
                 .ForMember(dst => dst.WebsiteResult, opt => opt.Ignore())
                 .ForMember(dst => dst.ImResult, opt => opt.Ignore())
                 .ForMember(dst => dst.MembershipResult, opt => opt.Ignore())
-                .ForMember(dst => dst.RelationshipResult, opt => opt.Ignore());
+                .ForMember(dst => dst.RelationshipResult, opt => opt.Ignore())
+                // Onderstaande 3 velden zijn wel gemaakt in de results, omdat
+                // het intranet ze ophaalt, maar niet in de requests, omdat
+                // GAP er niets mee doet. Daarom ignoren we ze in deze mappings;
+                // het is toch maar om te testen.
+                .ForMember(dst => dst.StopgezetOp, opt => opt.Ignore())
+                .ForMember(dst => dst.Parochie, opt => opt.Ignore())
+                .ForMember(dst => dst.RedenStopzetting, opt => opt.Ignore());
             Mapper.CreateMap<RelationshipRequest, Relationship>()
                 .ForMember(dst => dst.ContactResult, opt => opt.Ignore());
             Mapper.CreateMap<LocBlockRequest, LocBlock>()


Moved the loader to a new thread, to improve performance.

--- Library/TweetLoader.cs
+++ Library/TweetLoader.cs
@@ -15,6 +15,7 @@
         private readonly int ToLoad = 1;
         public int TweetsToLoadPerRequest { get; set; }
         public bool Cached { get; set; }
+        public bool Threaded { get; set; }
         private int RequestsInProgress;
 	    protected TwitterResource _resource;
         private static DateTime RateResetTime;
@@ -51,6 +52,7 @@
             Source = new ObservableCollection<TweetSharp.ITweetable>();
             LastId = 0;
             Cached = true;
+            Threaded = false;
             RequestsInProgress = 0;
             if (RateResetTime == null)
                 RateResetTime = DateTime.MinValue;
@@ -77,6 +79,25 @@

         #region Loaders
         public void Load(bool Old = false)
+        {
+            if (Resource == null || _srv == null ||
+                RequestsInProgress >= 2 ||
+                RateResetTime > DateTime.Now)
+            {
+                if (LoadFinished != null)
+                    LoadFinished(this, new EventArgs());
+                return;
+            }
+
+            RequestsInProgress++;
+
+            if (Old)
+                LoadOld();
+            else
+                LoadNew();
+        }
+
+        protected void InternalLoad(bool Old = false)
         {
             if (Resource == null || _srv == null ||
                 RequestsInProgress >= 2 ||


Remove dead code

Remove dead code

--- src/Amazon.Route53.Tests/Actions/ChangeResourceRecordSetsRequest.cs
+++ src/Amazon.Route53.Tests/Actions/ChangeResourceRecordSetsRequest.cs
@@ -127,8 +127,6 @@

             byte[] bytes = Route53Serializer<ChangeResourceRecordSetsRequest>.SerializeToUtf8Bytes(request);

-            var text = Encoding.UTF8.GetString(bytes);
-
             Assert.Equal(@"<?xml version=""1.0"" encoding=""utf-8""?>
 <ChangeResourceRecordSetsRequest xmlns=""https://route53.amazonaws.com/doc/2013-04-01/"">
   <ChangeBatch>


Disable adding redundant arguments for getting machine id

--- src/BuildingBlocks.CopyManagement/SmartClientApplicationIdentity.cs
+++ src/BuildingBlocks.CopyManagement/SmartClientApplicationIdentity.cs
@@ -52,9 +52,7 @@

         private static string ComputeApplicationId()
         {
-            var exeFileName = System.Reflection.Assembly.GetEntryAssembly().Location;
-            var value = "EXE_PATH >> " + exeFileName + "\n" + ComputerId.Value;
-            return value.ToFingerPrintMd5Hash();
+            return ComputerId.Value.ToFingerPrintMd5Hash();
         }
     }
 }


Update grammar in StaticConstructorExceptionAnalyzer.cs #839

--- src/CSharp/CodeCracker/Design/StaticConstructorExceptionAnalyzer.cs
+++ src/CSharp/CodeCracker/Design/StaticConstructorExceptionAnalyzer.cs
@@ -10,13 +10,11 @@
     [DiagnosticAnalyzer(LanguageNames.CSharp)]
     public class StaticConstructorExceptionAnalyzer : DiagnosticAnalyzer
     {
-        internal const string Title = "Don't throw exception inside static constructors.";
-        internal const string MessageFormat = "Don't throw exception inside static constructors.";
+        internal const string Title = "Don't throw exceptions inside static constructors.";
+        internal const string MessageFormat = "Don't throw exceptions inside static constructors.";
         internal const string Category = SupportedCategories.Design;
-        const string Description = "Static constructor are called before the first time a class is used but the "
-            + "caller doesn't control when exactly.\r\n"
-            + "Exception thrown in this context force callers to use 'try' block around any useage of the class "
-            + "and should be avoided.";
+        const string Description = "Static constructors are called before a class is used for the first time. Exceptions thrown "
+            + "in static constructors force the use of a try block and should be avoided.";

         internal static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(
             DiagnosticId.StaticConstructorException.ToDiagnosticId(),
@@ -49,4 +47,4 @@
             context.ReportDiagnostic(Diagnostic.Create(Rule, @throw.GetLocation(), ctor.Identifier.Text));
         }
     }
-}+}


changed strategy of using SelectedPath and RootFolder

--- src/Catel.MVVM/Catel.MVVM.Shared/Services/SelectDirectoryService.cs
+++ src/Catel.MVVM/Catel.MVVM.Shared/Services/SelectDirectoryService.cs
@@ -72,17 +72,20 @@
         /// </remarks>
         public virtual bool DetermineDirectory()
         {
-            string initialDirectory = string.Empty;
+            string initialDirectory = string.Empty;
+
+            var browserDialog = new FolderBrowserDialog();
+            browserDialog.Description = Title;
+            browserDialog.ShowNewFolderButton = ShowNewFolderButton;
+
             if (!string.IsNullOrEmpty(InitialDirectory))
             {
-                initialDirectory = IO.Path.AppendTrailingSlash(InitialDirectory);
+                browserDialog.SelectedPath = IO.Path.AppendTrailingSlash(InitialDirectory);
+            }
+            else
+            {
+                browserDialog.RootFolder = System.Environment.SpecialFolder.MyComputer;
             }
-
-            var browserDialog = new FolderBrowserDialog();
-
-            browserDialog.Description = Title;
-            browserDialog.SelectedPath = initialDirectory;
-            browserDialog.ShowNewFolderButton = ShowNewFolderButton;

             bool result = browserDialog.ShowDialog() == DialogResult.OK;
             if (result)


Update CodeGenLocalFunctionTests.cs

Update CodeGenLocalFunctionTests.cs

--- src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenLocalFunctionTests.cs
+++ src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenLocalFunctionTests.cs
@@ -5511,7 +5511,7 @@
         }

         [Fact]
-        public void StaticLocalFunction_ConditionalAttribute_Unreferenced()
+        public void StaticLocalFunction_ConditionalAttribute_NoUnreferencedWarning()
         {
             var source = @"
 using System.Diagnostics;
@@ -5531,10 +5531,7 @@
     }
 }
 ";
-            CreateCompilation(source, parseOptions: TestOptions.Regular9).VerifyDiagnostics(
-                // (12,21): warning CS8321: The local function 'local1' is declared but never used
-                //         static void local1()
-                Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "local1").WithArguments("local1").WithLocation(12, 21));
+            CreateCompilation(source, parseOptions: TestOptions.Regular9).VerifyDiagnostics();

             CreateCompilation(source, parseOptions: TestOptions.Regular9.WithPreprocessorSymbols("DEBUG")).VerifyDiagnostics();
         }


forced commit in order to allow for merge from release

--- src/EPiServer.SocialAlloy.Web/Social/Models/CommentFormViewModel.cs
+++ src/EPiServer.SocialAlloy.Web/Social/Models/CommentFormViewModel.cs
@@ -39,6 +39,6 @@
         /// <summary>
         /// Gets or sets the reference link of the block containing the comment form.
         /// </summary>
-        public ContentReference CurrentBlockLink { get; set; }
+        public ContentReference CurrentBlockLink { get; set; }
     }
 }


Fixed error tracking bug on new series.

Fixed error tracking bug on new series.

--- MangaRack/Publisher.cs
+++ MangaRack/Publisher.cs
@@ -334,6 +334,11 @@
 		public void Publish(IEnumerable<string> BrokenPages) {
 			// Check if repair and error tracking is not disabled
 			if (!_Options.DisableRepairAndErrorTracking) {
+				// Check if the series directory does not exist.
+				if (!Directory.Exists(Path.GetDirectoryName(_FilePath))) {
+					// Create the directory for the series.
+					Directory.CreateDirectory(Path.GetDirectoryName(_FilePath));
+				}
 				// Set whether there are broken pages.
 				HasBrokenPages = true;
 				// Write broken page information.


Added an RGBA constructor to Color

Added an RGBA constructor to Color

--- Mapsui/Styles/Color.cs
+++ Mapsui/Styles/Color.cs
@@ -9,17 +9,25 @@

         public Color(Color color)
         {
-            A = color.A;
             R = color.R;
             G = color.G;
             B = color.B;
+            A = color.A;
         }

-        public int A { get; set; }
+        public Color(int red, int green, int blue, int alpha = 255)
+        {
+            R = red;
+            G = green;
+            B = blue;
+            A = alpha;
+        }
+
         public int R { get; set; }
         public int G { get; set; }
         public int B { get; set; }
-
+        public int A { get; set; }
+
         public static Color Transparent => new Color {A = 0, R = 255, G = 255, B = 255};
         public static Color Black => new Color {A = 255, R = 0, G = 0, B = 0};
         public static Color White => new Color {A = 255, R = 255, G = 255, B = 255};
@@ -37,8 +45,7 @@
         {
             return new Color {A = a, R = r, G = g, B = b};
         }
-
-
+
         public override bool Equals(object obj)
         {
             if (!(obj is Color))
@@ -48,16 +55,16 @@

         public bool Equals(Color color)
         {
-            if (A != color.A) return false;
             if (R != color.R) return false;
             if (G != color.G) return false;
             if (B != color.B) return false;
+            if (A != color.A) return false;
             return true;
         }

         public override int GetHashCode()
         {
-            return A.GetHashCode() ^ R.GetHashCode() ^ G.GetHashCode() ^ B.GetHashCode();
+            return R.GetHashCode() ^ G.GetHashCode() ^ B.GetHashCode() ^ A.GetHashCode();
         }

         public static bool operator ==(Color color1, Color color2)


ウェイトは入れなくてもよかった

ウェイトは入れなくてもよかった

--- Model/DownloadModel.cs
+++ Model/DownloadModel.cs
@@ -89,11 +89,14 @@
                 {
                     await nico.GetMusicFile(id, cancelToken);
                     if (cancelToken.IsCancellationRequested)
+                    {
                         break;
+                    }
                     else
+                    {
                         Progress(id, BatchDownloadProgressState.Complete, null);
+                    }
                     state_list[id] = true;
-                    await Task.Delay(1000 * 10);
                 }
                 catch (Exception ex)
                 {


Disable CompileTimeSolutionProvider

Disable CompileTimeSolutionProvider

--- src/Features/Core/Portable/Workspace/CompileTimeSolutionProvider.cs
+++ src/Features/Core/Portable/Workspace/CompileTimeSolutionProvider.cs
@@ -46,7 +46,9 @@
         public CompileTimeSolutionProvider(Workspace workspace)
         {
             _workspace = workspace;
-            _enabled = workspace.Services.GetRequiredService<IExperimentationService>().IsExperimentEnabled(WellKnownExperimentNames.RazorLspEditorFeatureFlag);
+            // TODO:
+            //_enabled = workspace.Services.GetRequiredService<IExperimentationService>().IsExperimentEnabled(WellKnownExperimentNames.RazorLspEditorFeatureFlag);
+            _enabled = false;

             workspace.WorkspaceChanged += (s, e) =>
             {


Update ref assemblies

Update ref assemblies

--- src/Mvc/Mvc.Core/ref/Microsoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs
+++ src/Mvc/Mvc.Core/ref/Microsoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs
@@ -960,6 +960,7 @@
     {
         public ProblemDetails() { }
         public string Detail { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
+        [System.Text.Json.Serialization.JsonExtensionDataAttribute]
         public System.Collections.Generic.IDictionary<string, object> Extensions { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
         public string Instance { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
         public int? Status { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }


Fix the x5c resolution logic used in the ExtractSigningKeys handler

--- src/OpenIddict.Validation/OpenIddictValidationHandlers.Discovery.cs
+++ src/OpenIddict.Validation/OpenIddictValidationHandlers.Discovery.cs
@@ -275,25 +275,42 @@
                             return default;
                         }

+                        // If the key is a RSA key, ensure the mandatory parameters are all present.
+                        if (string.Equals(key.Kty, JsonWebAlgorithmsKeyTypes.RSA, StringComparison.Ordinal) &&
+                           (string.IsNullOrEmpty(key.E) || string.IsNullOrEmpty(key.N)))
+                        {
+                            context.Reject(
+                                error: Errors.ServerError,
+                                description: context.Localizer[SR.ID3104]);
+
+                            return default;
+                        }
+
+                        // If the key is an EC key, ensure the mandatory parameters are all present.
+                        if (string.Equals(key.Kty, JsonWebAlgorithmsKeyTypes.EllipticCurve, StringComparison.Ordinal) &&
+                           (string.IsNullOrEmpty(key.Crv) || string.IsNullOrEmpty(key.X) || string.IsNullOrEmpty(key.Y)))
+                        {
+                            context.Reject(
+                                error: Errors.ServerError,
+                                description: context.Localizer[SR.ID3104]);
+
+                            return default;
+                        }
+
                         key.KeyId = (string?) keys[index][JsonWebKeyParameterNames.Kid];
                         key.X5t = (string?) keys[index][JsonWebKeyParameterNames.X5t];
                         key.X5tS256 = (string?) keys[index][JsonWebKeyParameterNames.X5tS256];

                         if (keys[index].TryGetNamedParameter(JsonWebKeyParameterNames.X5c, out var chain))
                         {
-                            foreach (var certificate in chain.GetNamedParameters())
+                            foreach (string? certificate in chain.GetUnnamedParameters())
                             {
-                                var value = (string?) certificate.Value;
-                                if (string.IsNullOrEmpty(value))
+                                if (string.IsNullOrEmpty(certificate))
                                 {
-                                    context.Reject(
-                                        error: Errors.ServerError,
-                                        description: context.Localizer[SR.ID3104]);
-
-                                    return default;
+                                    continue;
                                 }

-                                key.X5c.Add(value);
+                                key.X5c.Add(certificate);
                             }
                         }


Revert "Changed 'prefix' into 'suffix'."

This reverts commit 4bd5e60ca99393912ee89aa0ccf2b281be7e2b44.

Reason for "prefix" being correct: The URL consists of four parts, [scheme][host][path][query].
The prefix is added inside one of those parts, i.e. the [path] part, so it belongs to that part.
Since the value is added to the beginning of that part, it's a prefix.

--- src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/Add.cshtml
+++ src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/Add.cshtml
@@ -24,9 +24,9 @@
             @T("You may define multiple domains using the comma (,) as a separator. Use the '*.' prefix to map all subdomains.")

-             m.RequestUrlPrefix)">@T("URL suffix")
+             m.RequestUrlPrefix)">@T("URL prefix")
             @Html.TextBoxFor(m => m.RequestUrlPrefix, new { @class = "text medium" })
-            @T("(Optional) Example: If suffix is \"site1\", the tenant URL suffix is \"http://orchardproject.net/site1\"")
+            @T("(Optional) Example: If prefix is \"site1\", the tenant URL prefix is \"http://orchardproject.net/site1\"")

     </fieldset>
     <fieldset>


Windows C# quickstart: add commented-out code for adding offline support

--- windows-universal-cs/ZUMOAPPNAME/ZUMOAPPNAME.Shared/MainPage.cs
+++ windows-universal-cs/ZUMOAPPNAME/ZUMOAPPNAME.Shared/MainPage.cs
@@ -8,12 +8,19 @@
 using Windows.UI.Xaml.Controls;
 using Windows.UI.Xaml.Navigation;

+// To add offline sync support, add the NuGet package Microsoft.WindowsAzure.MobileServices.SQLiteStore
+// to your project. Then, uncomment the lines marked // offline sync
+// For more information, see: http://aka.ms/addofflinesync
+//using Microsoft.WindowsAzure.MobileServices.SQLiteStore;  // offline sync
+//using Microsoft.WindowsAzure.MobileServices.Sync;         // offline sync
+
 namespace ZUMOAPPNAME
 {
     sealed partial class MainPage: Page
     {
         private MobileServiceCollection<TodoItem, TodoItem> items;
         private IMobileServiceTable<TodoItem> todoTable = App.MobileService.GetTable<TodoItem>();
+        //private IMobileServiceSyncTable<TodoItem> todoTable = App.MobileService.GetSyncTable<TodoItem>(); // offline sync

         public MainPage()
         {
@@ -66,7 +73,12 @@

         private async void ButtonRefresh_Click(object sender, RoutedEventArgs e)
         {
+            ButtonRefresh.IsEnabled = false;
+
+            //await SyncAsync(); // offline sync
             await RefreshTodoItems();
+
+            ButtonRefresh.IsEnabled = true;
         }

         private async void ButtonSave_Click(object sender, RoutedEventArgs e)
@@ -84,7 +96,30 @@

         protected override async void OnNavigatedTo(NavigationEventArgs e)
         {
+            //await InitLocalStoreAsync(); // offline sync
             await RefreshTodoItems();
         }
+
+        #region Offline sync
+
+        //private async Task InitLocalStoreAsync()
+        //{
+        //    if (!App.MobileService.SyncContext.IsInitialized)
+        //    {
+        //        var store = new MobileServiceSQLiteStore("localstore.db");
+        //        store.DefineTable<TodoItem>();
+        //        await App.MobileService.SyncContext.InitializeAsync(store);
+        //    }
+        //
+        //    await SyncAsync();
+        //}
+
+        //private async Task SyncAsync()
+        //{
+        //    await App.MobileService.SyncContext.PushAsync();
+        //    await todoTable.PullAsync("todoItems", todoTable.CreateQuery());
+        //}
+
+        #endregion
     }
 }


Added the version controll to the constrcture

--- NBCAsm/NBCAssembler.cs
+++ NBCAsm/NBCAssembler.cs
@@ -12,6 +12,22 @@
         info,
         verbose
     }
+
+    public class NBCIncorrectVersionException : Exception
+    {
+        public NBCIncorrectVersionException(Version versionGiven) : base(
+            String.Format("Version expected: {0}. Version given: {1}", NBCAssembler.CurrentVersion, versionGiven)
+            )
+        { }
+    }
+    public class NBCNoArchGivenException : Exception
+    {
+        public NBCNoArchGivenException() : base("No architecture was given")
+        { }
+        public NBCNoArchGivenException(string message) : base(message)
+        { }
+    }
+
     public class NBCAssembler
     {
         public NBCArchitecture Architecture { get; set; }
@@ -19,7 +35,9 @@
         string[] lines = null;
         NBCLogVerbosityLevel verbosityLevel = NBCLogVerbosityLevel.error;
         public List<string> Log { get; }
+        public bool OutputLogToConsole { get; set; }
         public List<byte> Program { get; }
+        static public Version CurrentVersion { get { return new Version("1.0.0") ; } }
         public NBCAssembler(NBCArchitecture arch, string[] str)
         {
             Architecture = arch;
@@ -31,13 +49,36 @@
             verbosityLevel = level;
         }

+        private void addToLog(NBCLogVerbosityLevel verbosity, string str)
+        {
+            if (verbosityLevel <= verbosity)
+            {
+                Log.Add(str);
+                if (OutputLogToConsole)
+                    Console.WriteLine(str);
+            }
+        }
+
         public byte[] AssembleProgram()
         {
-            if (verbosityLevel == NBCLogVerbosityLevel.info)
-                Log.Add("Beginning Pass 1");
+            //Pass 1: Preprocessors
+            addToLog(NBCLogVerbosityLevel.info, "Starting Pass 1: Preprocessors");
+            bool archGiven = false;
+            bool versionGiven = false;
             foreach (string line in lines)
             {
-
+                if (line.StartsWith("."))
+                {
+                    addToLog(NBCLogVerbosityLevel.verbose, "Preprocessor: " + line);
+                    if (line.StartsWith(".nbcasm"))
+                    {
+                        if (line.Split(" ")[1] != CurrentVersion.ToString())
+                        {
+                            throw new NBCIncorrectVersionException(new Version(line.Split(" ")[1]));
+                        }
+                        versionGiven = true;
+                    }
+                }
             }
         }
     }


Rename local

Rename local

--- src/Scripting/Core/Hosting/ObjectFormatter/CommonObjectFormatter.cs
+++ src/Scripting/Core/Hosting/ObjectFormatter/CommonObjectFormatter.cs
@@ -25,8 +25,8 @@
                 throw new ArgumentNullException(nameof(options));
             }

-            var formatter = new Visitor(this, GetInternalBuilderOptions(options), GetPrimitiveOptions(options), GetTypeNameOptions(options), options.MemberDisplayFormat);
-            return formatter.FormatObject(obj);
+            var visitor = new Visitor(this, GetInternalBuilderOptions(options), GetPrimitiveOptions(options), GetTypeNameOptions(options), options.MemberDisplayFormat);
+            return visitor.FormatObject(obj);
         }

         protected virtual StackTraceRewriter StackTraceRewriter { get; } = new CommonStackTraceRewriter();


完善单元测试

完善单元测试

--- src/Senparc.Weixin.MP/Senparc.Weixin.MP/TenPayLibV3/TenPayV3Util.cs
+++ src/Senparc.Weixin.MP/Senparc.Weixin.MP/TenPayLibV3/TenPayV3Util.cs
@@ -51,6 +51,7 @@
     /// </summary>
     public class TenPayV3Util
     {
+        public static Random random = new Random();

         /// <summary>
         /// Noncestr
@@ -151,7 +152,7 @@
         {
             int num;

-            Random random = new Random();
+            lock (random)
             {
                 num = random.Next();
             }


添加  NETCOREAPP3_0 条件编译

添加  NETCOREAPP3_0 条件编译

--- src/Senparc.Weixin.WxOpen.Tests/AdvancedAPIs/WxApp/WxAppApiTests.cs
+++ src/Senparc.Weixin.WxOpen.Tests/AdvancedAPIs/WxApp/WxAppApiTests.cs
@@ -110,7 +110,7 @@
         public void CreateWxaQrCodeAsyncTest2()
         {
             var dt1 = SystemTime.Now;
-#if NETSTANDARD2_0 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2
+#if NETSTANDARD2_0 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2 || NETCOREAPP3_0
             var filePath = "../../../Config/qr-async2.jpg";
 #else
             var filePath = "../../Config/qr-async2.jpg";
@@ -136,7 +136,7 @@
         public void GetWxaCodeUnlimitTest()
         {
             Console.WriteLine("GetWxaCodeUnlimitTest开始");
-#if NETSTANDARD2_0 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2
+#if NETSTANDARD2_0 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2 || NETCOREAPP3_0
             var filePath = "../../../qr-wxopen.jpg";
 #else
             var filePath = "../../qr-wxopen.jpg";


BUGFIX: Import directory buffer size should be zero if no modules were imported.

--- src/AsmResolver.PE/Imports/Builder/ImportDirectoryBuffer.cs
+++ src/AsmResolver.PE/Imports/Builder/ImportDirectoryBuffer.cs
@@ -14,7 +14,6 @@
         public ImportDirectoryBuffer(bool is32Bit)
             : base(new HintNameTableBuffer(), is32Bit)
         {
-            _entriesLength = SerializedModuleImportEntry.ModuleImportSize;
             ImportAddressDirectory = new ImportAddressDirectoryBuffer(HintNameTable, is32Bit);
         }

@@ -29,6 +28,9 @@
         /// <inheritdoc />
         public override void AddModule(IModuleImportEntry module)
         {
+            if (_entriesLength == 0)
+                _entriesLength = SerializedModuleImportEntry.ModuleImportSize;
+
             _entriesLength += SerializedModuleImportEntry.ModuleImportSize;

             ImportAddressDirectory.AddModule(module);


Enable additional extension of SitecoreSerializationProvider

--- src/Unicorn/Serialization/Sitecore/SitecoreSerializationProvider.cs
+++ src/Unicorn/Serialization/Sitecore/SitecoreSerializationProvider.cs
@@ -94,7 +94,7 @@
 			return new SitecoreSerializedReference(physicalPath, this);
 		}

-		public ISerializedItem GetItemByPath(string database, string path)
+		public virtual ISerializedItem GetItemByPath(string database, string path)
 		{
 			var physicalPath = SerializationPathUtility.GetSerializedItemPath(_rootPath, database, path);

@@ -220,7 +220,7 @@
 			return fileNames.Select(ReadItemFromDisk).ToArray();
 		}

-		public bool IsStandardValuesItem(ISerializedItem item)
+		public virtual bool IsStandardValuesItem(ISerializedItem item)
 		{
 			Assert.ArgumentNotNull(item, "item");

@@ -453,7 +453,7 @@
 			}
 		}

-		protected IList<ISourceItem> GetDescendants(ISourceItem sourceItem)
+		protected virtual IList<ISourceItem> GetDescendants(ISourceItem sourceItem)
 		{
 			var descendants = sourceItem.Children.ToList();

@@ -526,7 +526,7 @@
 		/// <summary>
 		/// The root path on disk this provider writes its files to
 		/// </summary>
-		public string SerializationRoot { get { return _rootPath; } }
+		public virtual string SerializationRoot { get { return _rootPath; } }

 		public virtual string FriendlyName
 		{


Added support for TimeSpan to OracleQuoter

--- src/FluentMigrator.Runner/Generators/Oracle/OracleQuoter.cs
+++ src/FluentMigrator.Runner/Generators/Oracle/OracleQuoter.cs
@@ -39,6 +39,17 @@
 		{
 			return sequenceName;
 		}
+
+        public override string FromTimeSpan(TimeSpan value)
+        {
+            return String.Format("{0}{1} {2}:{3}:{4}.{5}{0}"
+                , ValueQuote
+                , value.Days
+                , value.Hours
+                , value.Minutes
+                , value.Seconds
+                , value.Milliseconds);
+        }
     }

 }


Include RunTests.exe and xunit.console.x86.exe in .NET event collection

(cherry picked from commit 264e9ee755599cc931fac2a6d6a80b1152db1b51)

--- src/VisualStudio/IntegrationTest/TestUtilities/EventLogCollector.cs
+++ src/VisualStudio/IntegrationTest/TestUtilities/EventLogCollector.cs
@@ -89,6 +89,7 @@
                 "MSBuildTaskHost.exe",
                 "mspdbsrv.exe",
                 "MStest.exe",
+                "RunTests.exe",
                 "ServiceHub.Host.CLR.exe",
                 "ServiceHub.Host.CLR.x64.exe",
                 "ServiceHub.Host.CLR.x86.exe",
@@ -107,6 +108,7 @@
                 "vstest.executionengine.clr20.exe",
                 "VSTest.executionEngine.exe",
                 "VSTest.executionEngine.x86.exe",
+                "xunit.console.x86.exe",
             };

         /// <summary>


Return PageNotFound() instead of erroring out if someone gave us a bad ID

--- App/StackExchange.DataExplorer/Controllers/QuerySetController.cs
+++ App/StackExchange.DataExplorer/Controllers/QuerySetController.cs
@@ -41,7 +41,15 @@
                 return PageNotFound();
             }

-            var revision = QueryUtil.GetFullQuerySet(querySetId).CurrentRevision;
+            var querySet = QueryUtil.GetFullQuerySet(querySetId);
+
+            if (querySet == null)
+            {
+                return PageNotFound();
+            }
+
+            var revision = querySet.CurrentRevision;
+
             return ShowCommon(revision, slug, true);
         }


Return null from AssemblyLoadContext on unknown

This allows the runtime to handle attempting to load the file in another ALC,
rather than forcing it to attempt to load it in the Default context.

--- src/GitVersionTask.MsBuild/LibGit2Sharp/GitLoaderContext.cs
+++ src/GitVersionTask.MsBuild/LibGit2Sharp/GitLoaderContext.cs
@@ -26,7 +26,7 @@
                 return LoadFromAssemblyPath(path);
             }

-            return Default.LoadFromAssemblyName(assemblyName);
+            return null;
         }

         protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)


Relax generic type constraint

Relax generic type constraint

--- Assets/FancyScrollView/Sources/Runtime/GridView/FancyGridView.cs
+++ Assets/FancyScrollView/Sources/Runtime/GridView/FancyGridView.cs
@@ -108,7 +108,7 @@
         /// <param name="cellTemplate">セルのテンプレート.</param>
         /// <typeparam name="TGroup">セルグループの型.</typeparam>
         protected virtual void Setup<TGroup>(FancyCell<TItemData, TContext> cellTemplate)
-            where TGroup : FancyCellGroup<TItemData, TContext>
+            where TGroup : FancyCell<TItemData[], TContext>
         {
             Context.CellTemplate = cellTemplate.gameObject;


Removed an unused property for this test

--- src/IntegrationTests/ProjectionOrder/ProjectionOrderTest.cs
+++ src/IntegrationTests/ProjectionOrder/ProjectionOrderTest.cs
@@ -14,8 +14,6 @@
         {
             public int Count { get; set; }
             public DateTime Date { get; set; }
-
-            public IEnumerable<ChildDestination> Children { get; set; }
         }

         public class ChildDestination


Moving Binder to Microsoft.Azure.WebJobs namespace

--- src/Microsoft.Azure.WebJobs.Host/Bindings/Runtime/Binder.cs
+++ src/Microsoft.Azure.WebJobs.Host/Bindings/Runtime/Binder.cs
@@ -7,9 +7,11 @@
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
+using Microsoft.Azure.WebJobs.Host.Bindings;
+using Microsoft.Azure.WebJobs.Host.Bindings.Runtime;
 using Microsoft.Azure.WebJobs.Host.Protocols;

-namespace Microsoft.Azure.WebJobs.Host.Bindings.Runtime
+namespace Microsoft.Azure.WebJobs
 {
     /// <summary>
     /// Class providing functionality for dynamically binding to WebJobs SDK attributes at runtime.


--- src/NUnitFramework/framework/Internal/Execution/WorkItem.cs
+++ src/NUnitFramework/framework/Internal/Execution/WorkItem.cs
@@ -317,6 +317,16 @@

             if (!thread.Join(timeout))
             {
+                // Don't enforce timeout when debugger is attached.
+                // We perform this check after the initial timeout has passed to
+                // give the user additional time to attach a debugger
+                // after the test has started execution
+                if (Debugger.IsAttached)
+                {
+                    thread.Join();
+                    return;
+                }
+
                 Thread tThread;
                 lock (threadLock)
                 {


Bugfix, autofac prioritizes last registration.

--- src/Nancy.Bootstrappers.Autofac/AutofacNancyBootstrapper.cs
+++ src/Nancy.Bootstrappers.Autofac/AutofacNancyBootstrapper.cs
@@ -92,7 +92,7 @@
             {
                 foreach (var implementationType in collectionTypeRegistration.ImplementationTypes)
                 {
-                    builder.RegisterType(implementationType).As(collectionTypeRegistration.RegistrationType).SingleInstance();
+                    builder.RegisterType(implementationType).As(collectionTypeRegistration.RegistrationType).PreserveExistingDefaults().SingleInstance();
                 }
             }
             builder.Update(container.ComponentRegistry);
@@ -167,4 +167,4 @@
             return container.Resolve<INancyModule>();
         }
     }
-}+}


Improved error logging for XML field formatting (and unformatting)

--- src/Rainbow/Formatting/FieldFormatters/XmlFieldFormatter.cs
+++ src/Rainbow/Formatting/FieldFormatters/XmlFieldFormatter.cs
@@ -3,6 +3,7 @@
 using System.Xml;
 using System.Xml.Linq;
 using Rainbow.Model;
+using Sitecore.Diagnostics;

 namespace Rainbow.Formatting.FieldFormatters
 {
@@ -17,8 +18,9 @@
 				XDocument doc = XDocument.Parse(field.Value);
 				return doc.ToString();
 			}
-			catch (Exception)
+			catch (Exception ex)
 			{
+				Log.Error($"Error while formatting XML field {field.FieldId} ({field.NameHint}). The raw value will be used instead.", ex, this);
 				return field.Value;
 			}
 		}
@@ -27,23 +29,31 @@
 		{
 			if (string.IsNullOrWhiteSpace(value)) return null;

-			var stringBuilder = new StringBuilder();
+			try
+			{
+				var stringBuilder = new StringBuilder();

-			var element = XElement.Parse(value);
+				var element = XElement.Parse(value);

-			var settings = new XmlWriterSettings
+				var settings = new XmlWriterSettings
+				{
+					OmitXmlDeclaration = true,
+					Indent = false,
+					NewLineOnAttributes = false
+				};
+
+				using (var xmlWriter = XmlWriter.Create(stringBuilder, settings))
+				{
+					element.Save(xmlWriter);
+				}
+
+				return stringBuilder.ToString();
+			}
+			catch (Exception ex)
 			{
-				OmitXmlDeclaration = true,
-				Indent = false,
-				NewLineOnAttributes = false
-			};
-
-			using (var xmlWriter = XmlWriter.Create(stringBuilder, settings))
-			{
-				element.Save(xmlWriter);
+				Log.Error($"Error while unformatting expected XML field {value}. The raw value will be used instead.", ex, this);
+				return value;
 			}
-
-			return stringBuilder.ToString();
 		}
 	}
 }


Fix to SQL on inserting tags to handle tag with apostrophe

--- src/Umbraco.Core/Persistence/Repositories/TagsRepository.cs
+++ src/Umbraco.Core/Persistence/Repositories/TagsRepository.cs
@@ -373,7 +373,7 @@
         /// <returns></returns>
         private static string GetTagSet(IEnumerable<ITag> tagsToInsert)
         {
-            var array = tagsToInsert.Select(tag => string.Format("select '{0}' as Tag, '{1}' as [Group]", tag.Text, tag.Group)).ToArray();
+            var array = tagsToInsert.Select(tag => string.Format("select '{0}' as Tag, '{1}' as [Group]", tag.Text.Replace("'", "''"), tag.Group)).ToArray();
             return "(" + string.Join(" union ", array).Replace("  ", " ") + ") as TagSet";
         }


Fix models mapping

Fix models mapping

--- src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs
+++ src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs
@@ -113,8 +113,13 @@
         {
             // Find position of tab from config
             var tabIndexForChildItems = 0;
-            if (listViewConfig["displayAtTabNumber"] != null && int.TryParse((string)listViewConfig["displayAtTabNumber"], out tabIndexForChildItems))
-            {
+            if (listViewConfig["displayAtTabNumber"] != null)
+            {
+                var o = listViewConfig["displayAtTabNumber"];
+                if (o is string s) tabIndexForChildItems = int.Parse(s);
+                else if (o is int i) tabIndexForChildItems = i;
+                else throw new Exception("panic");
+
                 // Tab position is recorded 1-based but we insert into collection 0-based
                 tabIndexForChildItems--;


Treat MSBuildWorkspace as a host workspace for indexing purposes

Command line testing of incremental analyzers and indexing, e.g. with
AnalyzerRunner, requires Roslyn build the index. These tools typically
use MSBuildWorkspace rather than a Host workspace, but are intended to
behave as a Host workspace here.

--- src/Workspaces/Core/Portable/Remote/RemoteFeatureOptions.cs
+++ src/Workspaces/Core/Portable/Remote/RemoteFeatureOptions.cs
@@ -25,6 +25,7 @@
                     return true;

                 case WorkspaceKind.Host:
+                case WorkspaceKind.MSBuild:
                     // Compute indices in the host workspace when OOP is disabled.
                     var remoteHostClientService = workspace.Services.GetService<IRemoteHostClientService>();
                     if (remoteHostClientService is null)


Add exception handling for show preferences

--- unity/EditorPlugin/PluginEntryPoint.cs
+++ unity/EditorPlugin/PluginEntryPoint.cs
@@ -315,7 +315,7 @@
           else
             model.ScriptCompilationDuringPlay.Set((int)PluginSettings.AssemblyReloadSettings);

-          AdviseShowPreferences(model, connectionLifetime);
+          AdviseShowPreferences(model, connectionLifetime, ourLogger);

           ourLogger.Verbose("UnityModel initialized.");
           var pair = new ModelWithLifetime(model, connectionLifetime);
@@ -330,7 +330,7 @@
       }
     }

-    private static void AdviseShowPreferences(EditorPluginModel model, Lifetime connectionLifetime)
+    private static void AdviseShowPreferences(EditorPluginModel model, Lifetime connectionLifetime, ILog log)
     {
       model.ShowPreferences.Advise(connectionLifetime, result =>
       {
@@ -338,19 +338,43 @@
         {
           MainThreadDispatcher.Instance.Queue(() =>
           {
-            var tab = UnityUtils.UnityVersion >= new Version(2018, 2) ? "_General" : "Rider";
-
-            var type = typeof(SceneView).Assembly.GetType("UnityEditor.SettingsService");
-            if (type != null)
+            try
             {
-              var method = type.GetMethod("OpenUserPreferences", BindingFlags.Static | BindingFlags.Public);
-              method?.Invoke(null, new object[] {$"Preferences/{tab}"});
+              var tab = UnityUtils.UnityVersion >= new Version(2018, 2) ? "_General" : "Rider";
+
+              var type = typeof(SceneView).Assembly.GetType("UnityEditor.SettingsService");
+              if (type != null)
+              {
+                var method = type.GetMethod("OpenUserPreferences", BindingFlags.Static | BindingFlags.Public);
+                method?.Invoke(null, new object[] {$"Preferences/{tab}"});
+
+                if (method == null)
+                {
+                  log.Error("'OpenUserPreferences' was not found");
+                }
+                else
+                {
+                  method.Invoke(null, new object[] {$"Preferences/{tab}"});
+                }
+              }
+              else
+              {
+                type = typeof(SceneView).Assembly.GetType("UnityEditor.PreferencesWindow");
+                var method = type?.GetMethod("ShowPreferencesWindow", BindingFlags.Static | BindingFlags.NonPublic);
+
+                if (method == null)
+                {
+                  log.Error("'ShowPreferencesWindow' was not found");
+                }
+                else
+                {
+                  method.Invoke(null, null);
+                }
+              }
             }
-            else
+            catch (Exception ex)
             {
-              type = typeof(SceneView).Assembly.GetType("UnityEditor.PreferencesWindow");
-              var method = type?.GetMethod("ShowPreferencesWindow", BindingFlags.Static | BindingFlags.NonPublic);
-              method?.Invoke(null, null);
+              log.Error("Show preferences " + ex);
             }
           });
         }


added listModel case, and RenderListModels method to render List models for those models used by methods that returns a list

--- generator/ClientApiGenerator/Render/RenderTarget.cs
+++ generator/ClientApiGenerator/Render/RenderTarget.cs
@@ -81,6 +81,11 @@
                         case TemplateType.enums:
                             RenderEnums(api, template);
                             break;
+
+                        // One file per model that is used by a CRUD method that returns a list (for Apex use)
+                        case TemplateType.listModels:
+                            RenderListModels(api, template);
+                            break;
                     }
                 }
             }
@@ -146,6 +151,28 @@
                 Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
                 var output = template.razor.ExecuteTemplate(api, null, model, null);
                 File.WriteAllText(outputPath, output);
+            }
+        }
+
+        private void RenderListModels(SwaggerInfo api, RenderTemplateTask template)
+        {
+            foreach (var method in api.Methods)
+            {
+                if (method.ResponseType == "array")
+                {
+                    string modelName = method.parseBracket(method.ResponseTypeName).Substring(4);
+                    foreach (var model in api.Models)
+                    {
+                        if (model.SchemaName.Contains(modelName))
+                        {
+                            var outputPath = Path.Combine(rootFolder, QuickStringMerge(template.output, model));
+                            Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
+                            var output = template.razor.ExecuteTemplate(api, null, model, null);
+                            File.WriteAllText(outputPath, output);
+                            break;
+                        }
+                    }
+                }
             }
         }


Added a secure option for the cookie.

Added a secure option for the cookie.

--- Persona/PersonaAuth.cs
+++ Persona/PersonaAuth.cs
@@ -30,6 +30,7 @@
             CookieDomain = "";
             CookiePath = "/";
             CookieName = "AuthToken";
+            CookieSecure = false;
             Timeout = TimeSpan.FromHours(1);
         }

@@ -47,6 +48,11 @@
         /// Gets or sets the value of the path of the authentication token cookie.
         /// </summary>
         public static string CookiePath { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether or not the authentication token cookie is only sent over HTTPS.
+        /// </summary>
+        public static bool CookieSecure { get; set; }

         /// <summary>
         /// Gets or sets the timeout of the authentication token cookie.
@@ -82,7 +88,7 @@
                     var remaining = result.Expires - DateTimeOffset.UtcNow;
                     if (result.Status == "okay" && result.Audience == audience && remaining > TimeSpan.Zero)
                     {
-                        if (remaining.TotalMilliseconds < Timeout.TotalMilliseconds / 2)
+                        if (CookieSecure && remaining.TotalMilliseconds < Timeout.TotalMilliseconds / 2)
                         {
                             result.Expires = DateTimeOffset.UtcNow + Timeout;
                             newCookie = MakeCookie(result);
@@ -176,7 +182,8 @@
                 Expires = DateTime.UtcNow.AddYears(-1),
                 Domain = CookieDomain,
                 Path = CookiePath,
-                HttpOnly = false,
+                HttpOnly = true,
+                Secure = false,
             };
         }

@@ -188,6 +195,7 @@
                 Domain = CookieDomain,
                 Path = CookiePath,
                 HttpOnly = true,
+                Secure = CookieSecure,
             };
         }


Update RiseSdk.cs

Update RiseSdk.cs

--- Plugins/ivy/RiseSdk.cs
+++ Plugins/ivy/RiseSdk.cs
@@ -1021,6 +1021,17 @@
     public void ResetGDPR () {
         if (_class != null) {
             _class.CallStatic ("resetGDPR");
+        }
+    }
+
+    /// <summary>
+    /// 玩家反馈
+    /// </summary>
+    /// <param name="email"></param>
+    /// <param name="data"></param>
+    public void Support (string email, string data) {
+        if (_class != null) {
+            _class.CallStatic ("support", email, data);
         }
     }

@@ -3619,4 +3630,4 @@
         public LinkedNode next = null;
     }

-}+}


NodeHandle: increase "giblet protection", document

--- ROS_Comm/NodeHandle.cs
+++ ROS_Comm/NodeHandle.cs
@@ -29,16 +29,15 @@
     [DebuggerStepThrough]
     public class NodeHandle : IDisposable
     {
-        public string Namespace = "", UnresolvedNamespace = "";
+        private string Namespace = "", UnresolvedNamespace = "";
         private CallbackQueue _callback;
         private bool _ok = true;
-        private nhparam _param;
-        public NodeHandleBackingCollection collection = new NodeHandleBackingCollection();
-        public int nh_refcount;
-        public object nh_refcount_mutex = new object();
-        public bool no_validate;
-        public bool node_started_by_nh;
-        public IDictionary remappings = new Hashtable(), unresolved_remappings = new Hashtable();
+        private NodeHandleBackingCollection collection = new NodeHandleBackingCollection();
+        private int nh_refcount;
+        private object nh_refcount_mutex = new object();
+        private bool no_validate;
+        private bool node_started_by_nh;
+        private IDictionary remappings = new Hashtable(), unresolved_remappings = new Hashtable();

         /// <summary>
         ///     Creates a new node
@@ -55,6 +54,10 @@
             initRemappings(remappings);
         }

+        /// <summary>
+        /// Create a new nodehandle that is a partial deep copy of another
+        /// </summary>
+        /// <param name="rhs">The nodehandle this new one aspires to be</param>
         public NodeHandle(NodeHandle rhs)
         {
             if (Process.GetCurrentProcess().ProcessName == "devenv")
@@ -99,23 +102,15 @@
         }

         /// <summary>
-        ///     Creates a new node
+        ///     Creates a new nodehandle
         /// </summary>
         public NodeHandle() : this(this_node.Namespace, null)
         {
         }

-        public nhparam param
-        {
-            get
-            {
-                if (_param == null) _param = new nhparam(this);
-                return _param;
-            }
-        }
-
-        /// <summary>
-        ///     Current callbacks in callback queue
+        /// <summary>
+        /// gets/sets this nodehandle's callbackqueue
+        /// get : if the private _callback is null, a new one is created and enabled
         /// </summary>
         public CallbackQueue Callback
         {
@@ -133,7 +128,7 @@
         }

         /// <summary>
-        ///     Management boolean, if ros is still running
+        ///  The conjunction of ROS.ok, and the ok-ness of this nodehandle
         /// </summary>
         public bool ok
         {
@@ -143,6 +138,9 @@

         #region IDisposable Members

+        /// <summary>
+        /// Like a piece of trash
+        /// </summary>
         public void Dispose()
         {
             destruct();
@@ -354,7 +352,14 @@
             return new Subscriber<M>();
         }

-
+        /// <summary>
+        /// Advertises a named ServiceServer
+        /// </summary>
+        /// <typeparam name="MReq">Request sub-srv type</typeparam>
+        /// <typeparam name="MRes">Response sub-srv type</typeparam>
+        /// <param name="service">The name of the service to advertise</param>
+        /// <param name="srv_func">The handler for the service</param>
+        /// <returns>The ServiceServer that will call the ServiceFunction on behalf of ServiceClients</returns>
         public ServiceServer advertiseService<MReq, MRes>(string service, ServiceFunction<MReq, MRes> srv_func)
             where MReq : IRosMessage, new()
             where MRes : IRosMessage, new()
@@ -362,6 +367,13 @@
             return advertiseService(new AdvertiseServiceOptions<MReq, MRes>(service, srv_func));
         }

+        /// <summary>
+        /// Advertises a ServiceServer with specified OPTIONS
+        /// </summary>
+        /// <typeparam name="MReq">Request sub-srv type</typeparam>
+        /// <typeparam name="MRes">Response sub-srv type</typeparam>
+        /// <param name="ops">isn't it obvious?</param>
+        /// <returns>The ServiceServer that will call the ServiceFunction on behalf of ServiceClients</returns>
         public ServiceServer advertiseService<MReq, MRes>(AdvertiseServiceOptions<MReq, MRes> ops)
             where MReq : IRosMessage, new()
             where MRes : IRosMessage, new()
@@ -414,7 +426,7 @@
             return new ServiceClient<MReq, MRes>(ops.service, ops.persistent, ops.header_values, ops.md5sum);
         }

-        public void construct(string ns, bool validate_name)
+        private void construct(string ns, bool validate_name)
         {
             if (!ROS.initialized)
                 ROS.FREAKOUT();
@@ -434,7 +446,7 @@
             }
         }

-        public void destruct()
+        private void destruct()
         {
             collection.Dispose();
             collection = null;
@@ -448,7 +460,7 @@
         }

         [DebuggerStepThrough]
-        public void initRemappings(IDictionary rms)
+        private void initRemappings(IDictionary rms)
         {
             foreach (object k in remappings.Keys)
             {
@@ -465,7 +477,7 @@
         }

         [DebuggerStepThrough]
-        public string remapName(string name)
+        private string remapName(string name)
         {
             string resolved = resolveName(name, false);
             if (resolved == null)
@@ -476,13 +488,13 @@
         }

         [DebuggerStepThrough]
-        public string resolveName(string name)
+        private string resolveName(string name)
         {
             return resolveName(name, true);
         }

         [DebuggerStepThrough]
-        public string resolveName(string name, bool remap)
+        private string resolveName(string name, bool remap)
         {
             string error = "";
             if (!names.validate(name, ref error))
@@ -491,7 +503,7 @@
         }

         [DebuggerStepThrough]
-        public string resolveName(string name, bool remap, bool novalidate)
+        private string resolveName(string name, bool remap, bool novalidate)
         {
             //EDB.WriteLine("resolveName(" + name + ")");
             if (name == "") return Namespace;
@@ -510,17 +522,12 @@
             return names.resolve(final, false);
         }

-        public Timer createTimer(TimeSpan period, TimerCallback tcb, bool oneshot)
-        {
-            return new Timer(tcb, null, 0, (int) Math.Floor(period.TotalMilliseconds));
-        }
-
         #region Nested type: NodeHandleBackingCollection

         [DebuggerStepThrough]
         public class NodeHandleBackingCollection : IDisposable
         {
-            public object mutex = new object();
+            public readonly object mutex = new object();
             public List<IPublisher> publishers = new List<IPublisher>();

             public List<IServiceClient> serviceclients = new List<IServiceClient>();
@@ -542,74 +549,5 @@
         }

         #endregion
-
-        public class nhparam
-        {
-            private NodeHandle parent;
-
-            public nhparam(NodeHandle p)
-            {
-                parent = p;
-            }
-
-            public void get(string key, ref bool dest)
-            {
-                Param.get(names.resolve(parent.Namespace, key), ref dest);
-            }
-
-            public void get(string key, ref bool dest, bool def)
-            {
-                Param.get(names.resolve(parent.Namespace, key), ref dest, def);
-            }
-
-            public void get(string key, ref int dest)
-            {
-                Param.get(names.resolve(parent.Namespace, key), ref dest);
-            }
-
-            public void get(string key, ref int dest, int def)
-            {
-                Param.get(names.resolve(parent.Namespace, key), ref dest, def);
-            }
-
-            public void get(string key, ref double dest)
-            {
-                Param.get(names.resolve(parent.Namespace, key), ref dest);
-            }
-
-            public void get(string key, ref double dest, double def)
-            {
-                Param.get(names.resolve(parent.Namespace, key), ref dest, def);
-            }
-
-            public void get(string key, ref string dest, string def = null)
-            {
-                Param.get(names.resolve(parent.Namespace, key), ref dest, def);
-            }
-
-            public bool has(string key)
-            {
-                return Param.has(names.resolve(parent.Namespace, key));
-            }
-
-            public bool del(string key)
-            {
-                return Param.del(names.resolve(parent.Namespace, key));
-            }
-
-            public void set<T>(string key, T value)
-            {
-                string resolved = names.resolve(parent.Namespace, key);
-                T t = default(T);
-                if (t is string)
-                {
-                    Param.set(resolved, value as string);
-                }
-                else
-                {
-                    Param.set(resolved, "" + value);
-                }
-            }
-        }
     }
 }


Silence is golden

Silence is golden

git-svn-id: 6b7e1e5d0861e268462ba7828ef63c1bcab52a9b@723 d3cde5d6-82b8-4669-8b62-43054d6781d8

--- Radio/StreamControl.cs
+++ Radio/StreamControl.cs
@@ -164,8 +164,13 @@

         private void PlayerFiller(float* buffer, int frameCount)
         {
-            var count = _audioStream.Read(buffer, 0, frameCount * 2);
+            var sampleCount = frameCount * 2;
+            var count = _audioStream.Read(buffer, 0, sampleCount);
             ScaleAudio(buffer, count);
+            for (var i = count; i < sampleCount; i++)
+            {
+                buffer[i] = 0.0f;
+            }
         }

         private void RecorderFiller(float* buffer, int frameCount)


Removed exception handling for assigning hotkeys.

--- Rusty/Core/Keyboard.cs
+++ Rusty/Core/Keyboard.cs
@@ -127,21 +127,16 @@
             }
             else
             {
-                try
-                {
-                    var method = FindLocalMethod(Label);
-                    if (method == null)
-                        throw new ArgumentNullException();
-                    key.Proc = (GenericFunction)Delegate.CreateDelegate(typeof(GenericFunction), method);
-                    key.Precondition = keyCondition;
-                }
-                catch (Exception)
+                var method = FindLocalMethod(Label);
+
+                if (method == null)
                 {
                     ErrorLevel = 1;
-                    if (!error)
-                        throw new ArgumentException();
                     return;
                 }
+
+                key.Proc = (GenericFunction)Delegate.CreateDelegate(typeof(GenericFunction), method);
+                key.Precondition = keyCondition;

                 hotkeys.Add(id, key);
                 keyboardHook.Add(key);


Extract ParseBoolean and ParseFunAbs methods from ParseFactor.

--- School/SchoolParser.cs
+++ School/SchoolParser.cs
@@ -115,31 +115,44 @@
                     break;
                 case SchoolLexer.KEYWORDS:
                     if (lookahead.Text == "true" || lookahead.Text == "false")
-                    {
-                        bool b = Boolean.Parse(lookahead.Text);
-                        expr = new Surface.Boolean(b);
-                        Consume();
-                    }
+                        expr = ParseBoolean();
                     else
-                    {
-                        MatchKeyword("fun");
-
-                        IList<Id> argIds = ParseArgIds();
-
-                        if (lookahead.Type != SchoolLexer.ARROW)
-                            throw new ParserException("expecting arrow; found " + lookahead);
-                        Consume();
-                        Surface.Expr bodyExpr = ParseExpr();
-                        expr = new Surface.FunAbs(argIds, bodyExpr);
-
-                        MatchKeyword("end");
-                    }
+                        expr = ParseFunAbs();
                     break;
                 default:
                     throw new ParserException("expecting number; found " + lookahead);
             }

             return expr;
+        }
+
+        private Surface.Expr ParseFunAbs()
+        {
+            Surface.Expr expr;
+
+            MatchKeyword("fun");
+
+            IList<Id> argIds = ParseArgIds();
+
+            if (lookahead.Type != SchoolLexer.ARROW)
+                throw new ParserException("expecting arrow; found " + lookahead);
+            Consume();
+            Surface.Expr bodyExpr = ParseExpr();
+            expr = new Surface.FunAbs(argIds, bodyExpr);
+
+            MatchKeyword("end");
+
+            return expr;
+        }
+
+        private Surface.Expr ParseBoolean()
+        {
+            if (lookahead.Text != "true" && lookahead.Text != "false")
+                throw new ParserException("expecting boolean; found " + lookahead);
+
+            bool b = Boolean.Parse(lookahead.Text);
+            Consume();
+            return new Surface.Boolean(b);
         }

         private IList<Id> ParseArgIds()


handle empty request list.(again).

handle empty request list.(again).

--- SharpOCSP/SharpOCSP.cs
+++ SharpOCSP/SharpOCSP.cs
@@ -68,6 +68,9 @@
 			}catch (System.ArgumentNullException e){
 				throw new OcspMalformedRequestException (e.Message);
 			}
+			if (request_list.Length <= 0){
+				throw new OcspMalformedRequestException ("Empty request list.");
+			}
 			//get first singleRequest
 			Req first_single_req = request_list[0];
 			IToken _token_a = GetIssuerForSingleRequest (first_single_req).caToken;


Cube.Image() initial implementation

Cube.Image() initial implementation

--- Siftables/Cube.xaml.cs
+++ Siftables/Cube.xaml.cs
@@ -11,6 +11,7 @@
 using System.Windows.Shapes;
 using System.Windows.Interactivity;
 using Siftables;
+using System.Windows.Media.Imaging;

 namespace Siftables
 {
@@ -19,6 +20,18 @@
         public enum Side { Top, Right, Bottom, Left, None };

         public static int dimension = 128;
+
+        public const int SCREEN_WIDTH = 128;
+
+        public const int SCREEN_HEIGHT = 128;
+
+        public const int SCREEN_MAX_X = SCREEN_WIDTH - 1;
+
+        public const int SCREEN_MAX_Y = SCREEN_HEIGHT - 1;
+
+        public const int SCREEN_MIN_X = 0;
+
+        public const int SCREEN_MIN_Y = 0;

         public Cube()
         {
@@ -40,24 +53,52 @@
             Rectangle r = new Rectangle();
             r.Fill = new SolidColorBrush(c);

-            if (x < 0)
+            if (x < SCREEN_MIN_X)
             {
                 w += x;
                 x = 0;
             }

-            if (y < 0)
+            if (y < SCREEN_MIN_Y)
             {
                 h += y;
                 y = 0;
             }

+            if (w > SCREEN_WIDTH)
+            {
+                w = SCREEN_WIDTH;
+            }
+
+            if (y > SCREEN_HEIGHT)
+            {
+                h = SCREEN_HEIGHT;
+            }
+
             r.Width = w;
             r.Height = h;
-            Canvas.SetTop(r, x);
-            Canvas.SetLeft(r, y);
+            Canvas.SetTop(r, y);
+            Canvas.SetLeft(r, x);

             this.screen.Children.Add(r);
         }
+
+        // scale and rotation not taken into account yet
+        public void Image(String name, int x = 0, int y = 0, int sourceX = 0, int sourceY = 0, int w = SCREEN_WIDTH, int h = SCREEN_HEIGHT, int scale = 1, int rotation = 0)
+        {
+            Image newImg = new Image();
+            newImg.Source = new BitmapImage(new Uri(@"/Siftables;component/Images/" + name, UriKind.RelativeOrAbsolute));
+            newImg.Width = w;
+            newImg.Height = h;
+            Canvas.SetLeft(newImg, x);
+            Canvas.SetTop(newImg, y);
+            RectangleGeometry clip = new RectangleGeometry();
+            clip.Rect = new Rect(sourceX, sourceY, w, h);
+            newImg.Clip = clip;
+
+            this.screen.Children.Add(newImg);
+        }
+
+
     }
 }


Fixed Duration position movement when starting timer (win)

--- src/ui/windows/TogglDesktop/TogglDesktop/TimerEditViewController.cs
+++ src/ui/windows/TogglDesktop/TogglDesktop/TimerEditViewController.cs
@@ -171,7 +171,6 @@
             comboBoxDescription.Text = "";

             linkLabelDuration.Top = textBoxDuration.Top;
-            linkLabelDuration.Left = textBoxDuration.Left;
             linkLabelDuration.Text = te.Duration;
             linkLabelDuration.Visible = true;


Corrected MaxPersonID

Corrected MaxPersonID

--- Tests/Linq/TestBase.cs
+++ Tests/Linq/TestBase.cs
@@ -492,7 +492,7 @@
 			}
 		}

-		protected const int MaxPersonID = 3;
+		protected const int MaxPersonID = 4;

 		private          List<Person> _person;
 		protected IEnumerable<Person>  Person


[master] Automatic command loading is not working because of dependency injection.

--- TicketTimer/Program.cs
+++ TicketTimer/Program.cs
@@ -1,7 +1,8 @@
 using System;
+using Autofac;
 using ManyConsole;
 using TicketTimer.Configuration;
-using TicketTimer.Core;
+using TicketTimer.Core.Commands;

 namespace TicketTimer
 {
@@ -13,7 +14,11 @@

             var commands = CommandsConfiguration.GetCommandsFromConfig(container);

-            commands.AddRange(ConsoleCommandDispatcher.FindCommandsInSameAssemblyAs(typeof(CoreModule)));
+            commands.Add(container.Resolve<StartCommand>());
+            commands.Add(container.Resolve<StopCommand>());
+            commands.Add(container.Resolve<ShowCommand>());
+            commands.Add(container.Resolve<StatusCommand>());
+            commands.Add(container.Resolve<ClearCommand>());

             return ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out);
         }


FixConnectivity() now removes unreachable areas

--- WangTiles/WangUtils.cs
+++ WangTiles/WangUtils.cs
@@ -469,7 +469,6 @@

         public void FixConnectivity()
         {
-
             // optional, detect isolate areas
             List<WangArea> areas = new List<WangArea>();
             for (int j = 0; j < Height; j++)
@@ -498,10 +497,32 @@
             HashSet<WangArea> areaSet = new HashSet<WangArea>();
             for (int k = 0; k < areas.Count; k++)
             {
-                JoinArea(null, areas[k], areaSet);
-                break;
-            }
-        }
+                var area = areas[k];
+                if (k == 0)
+                {
+                    JoinArea(null, area, areaSet);
+                }
+                else
+                if (!areaSet.Contains(area))
+                {
+                    DeleteArea(area);
+                }
+            }
+        }
+
+        private void DeleteArea(WangArea area)
+        {
+            for (int j = 0; j < _height; j++)
+            {
+                for (int i = 0; i < _width; i++)
+                {
+                    if (GetTileAt(i, j).areaID == area)
+                    {
+                        SetTileAt(i, j, 0);
+                    }
+                }
+            }
+       }

         public void Invert()
         {


Refs #3419 - unit test aanroep UpdateApi als AD-nummer fout bij nieuw lid.

--- tools/Chiro.CiviSync/Chiro.CiviSync.Services.Test/LidBewarenTest.cs
+++ tools/Chiro.CiviSync/Chiro.CiviSync.Services.Test/LidBewarenTest.cs
@@ -602,6 +602,50 @@
                                 r.IsActive == false && r.ContactIdA == persoon.Id && r.ContactIdB == ploeg.Id)), Times.AtLeastOnce);
         }

-
+        /// <summary>
+        /// Als CiviSync een lid moet maken met een ongeldig AD-nummer, dan moet dat AD-nummer als ongeldig
+        /// terug naar het GAP.
+        /// </summary>
+        [TestMethod]
+        public void LidBewarenOngeldigAdNummer()
+        {
+            // ARRANGE
+
+            const int adNummer = 2;
+
+            // Onze nepdatabase bevat 1 organisatie (TST/0000) en 1 contact (Kees Flodder)
+            var ploeg = new Contact {ExternalIdentifier = "TST/0001", Id = 1, ContactType = ContactType.Organization};
+
+            // We mocken ook GapUpdateHelper.
+
+            _updateHelperMock.Setup(src => src.OngeldigAdNaarGap(It.Is<Int32>(ad => ad == adNummer))).Verifiable();
+
+            _civiApiMock.Setup(
+                src =>
+                    src.ContactGetSingle(It.IsAny<string>(), It.IsAny<string>(),
+                        It.Is<ContactRequest>(r => r.ExternalIdentifier == ploeg.ExternalIdentifier))).Returns(ploeg);
+
+            // Imiteer het gedrag van de CiviCRM-API bij een niet-gevonden contact:
+            _civiApiMock.Setup(
+                src =>
+                    src.ContactGetSingle(It.IsAny<string>(), It.IsAny<string>(),
+                        It.Is<ContactRequest>(r => r.ExternalIdentifier == adNummer.ToString()))).Returns(new Contact());
+
+            var service = Factory.Maak<SyncService>();
+
+            // ACT
+
+            service.LidBewaren(adNummer, new LidGedoe
+            {
+                LidType = LidTypeEnum.Kind,
+                OfficieleAfdelingen = new[] {AfdelingEnum.Rakwis},
+                StamNummer = ploeg.ExternalIdentifier,
+                WerkJaar = HuidigWerkJaar
+            });
+
+            // ASSERT
+
+            _updateHelperMock.Verify(src => src.OngeldigAdNaarGap(It.Is<Int32>(ad => ad == adNummer)), Times.AtLeastOnce);
+        }
     }
 }


Class comment use csla stereotype names (changed was lost)

--- trunk/Solutions/CslaGenFork/CodeGen/CslaTemplateHelperCS.cs
+++ trunk/Solutions/CslaGenFork/CodeGen/CslaTemplateHelperCS.cs
@@ -3150,15 +3150,15 @@
                 case CslaObjectType.DynamicEditableRoot:
                     return "dynamic root object";
                 case CslaObjectType.EditableRootCollection:
-                    return "editable root collection";
+                    return "editable root list";
                 case CslaObjectType.DynamicEditableRootCollection:
-                    return "dynamic root collection";
+                    return "dynamic root list";
                 case CslaObjectType.EditableChildCollection:
-                    return "editable child collection";
+                    return "editable child list";
                 case CslaObjectType.ReadOnlyObject:
                     return "read only object";
                 case CslaObjectType.ReadOnlyCollection:
-                    return "read only collection";
+                    return "read only list";
                 case CslaObjectType.NameValueList:
                     return "name value list";
                 case CslaObjectType.UnitOfWork:


Work item #1272 "using" for DataAccess is missing when Utility class namespace is equal to Base namespace

--- trunk/Solutions/CslaGenFork/CodeGen/CslaTemplateHelperCS.cs
+++ trunk/Solutions/CslaGenFork/CodeGen/CslaTemplateHelperCS.cs
@@ -658,42 +658,22 @@

             var result = String.Empty;
             var silverlightLevel = 0;
-            if (usingNamespaces.Length == 0)
-            {
-                if (UseSilverlight())
-                {
-                    result += IfSilverlight(Conditional.NotSilverlight, 0, ref silverlightLevel, false, true);
-                    if (unit.GenerationParams.TargetFramework == TargetFramework.CSLA40DAL)
-                        result += GetDalInterfaceNamespaces(info, unit);
-
-                    result += IfSilverlight(Conditional.End, 0, ref silverlightLevel, false, true);
-                }
-                else
-                {
-                    if (unit.GenerationParams.TargetFramework == TargetFramework.CSLA40DAL)
-                        result += GetDalInterfaceNamespaces(info, unit);
-                }
-            }
-            else
-            {
+            if (usingNamespaces.Length != 0)
+            {
+                var cacheGetContextUtilitiesNamespace = GetContextUtilitiesNamespace(unit, step);
                 foreach (var namespaceName in usingNamespaces)
                 {
-                    if (namespaceName == GetContextUtilitiesNamespace(unit, step))
+                    if (namespaceName == cacheGetContextUtilitiesNamespace)
                     {
                         if (UseSilverlight())
                         {
                             result += IfSilverlight(Conditional.NotSilverlight, 0, ref silverlightLevel, false, true);
                             result += "using " + namespaceName + ";" + Environment.NewLine;
-                            if (unit.GenerationParams.TargetFramework == TargetFramework.CSLA40DAL)
-                                result += GetDalInterfaceNamespaces(info, unit);
-
                             result += IfSilverlight(Conditional.End, 0, ref silverlightLevel, false, true);
                         }
                         else
                         {
                             result += "using " + namespaceName + ";" + Environment.NewLine;
-                            if (unit.GenerationParams.TargetFramework == TargetFramework.CSLA40DAL)
-                                result += GetDalInterfaceNamespaces(info, unit) + Environment.NewLine;
                         }
                     }
                     else if (namespaceName == "Csla.Serialization")
@@ -708,6 +688,21 @@
                 }
             }

+            if (UseSilverlight())
+            {
+                result += IfSilverlight(Conditional.NotSilverlight, 0, ref silverlightLevel, false, true);
+                if (unit.GenerationParams.TargetFramework == TargetFramework.CSLA40DAL)
+                    result += GetDalInterfaceNamespaces(info, unit);
+
+                result += IfSilverlight(Conditional.End, 0, ref silverlightLevel, false, true);
+            }
+            else
+            {
+                if (unit.GenerationParams.TargetFramework == TargetFramework.CSLA40DAL)
+                    result += GetDalInterfaceNamespaces(info, unit);
+            }
+
+
             result = info.GetAllValueProperties().Where(p => p.PropertyType == TypeCodeEx.ByteArray && AllowNull(p)).Aggregate(result, (current, p) => current + ("using System.Linq; //Added for byte[] helpers" + Environment.NewLine));

             return result;
@@ -723,18 +718,21 @@
                     usesDb = true;

                 if (!usesDb)
+                {
+                    if(CurrentUnit.GenerationParams.TargetFramework == TargetFramework.CSLA40DAL && DalObjectUsesDTO(info))
+                        return "using " + GetContextObjectNamespace(info, unit, GenerationStep.DalInterface) + ";" + Environment.NewLine;
+
                     return string.Empty;
-            }
-
-            var result = string.Empty;
-
-            result += "using " +
-                GetContextObjectNamespace(info, unit, GenerationStep.DalInterface) + ";" + Environment.NewLine;
-
-            if (CurrentUnit.GenerationParams.UtilitiesNamespace != GetContextObjectNamespace(info, unit, GenerationStep.DalInterface) &&
+                }
+            }
+
+            var result = "using " + GetContextObjectNamespace(info, unit, GenerationStep.DalInterface) + ";" + Environment.NewLine;
+
+            if (CurrentUnit.GenerationParams.UtilitiesNamespace != CurrentUnit.GenerationParams.BaseNamespace &&
                 info.ObjectType != CslaObjectType.UnitOfWork)
-                result += "using " +
-                          GetContextUtilitiesNamespace(unit, GenerationStep.DalInterface) + ";" + Environment.NewLine;
+            {
+                result += "using " + GetContextUtilitiesNamespace(unit, GenerationStep.DalInterface) + ";" + Environment.NewLine;
+            }

             return result;
         }


...Need to work on the follow-through, oops

--- App/StackExchange.DataExplorer/Controllers/VoteController.cs
+++ App/StackExchange.DataExplorer/Controllers/VoteController.cs
@@ -75,12 +75,12 @@
                         Votes = Votes + @change
                     WHERE
                         RevisionId = @root AND
-                        OwnerId " + (ownerId.HasValue ? " = @owner" : " IS NULL"),
+                        OwnerId " + (revision.OwnerId != null ? " = @owner" : " IS NULL"),
                     new
                     {
                         change = vote == null ? 1 : -1,
                         root = id,
-                        owner = ownerId
+                        owner = revision.OwnerId
                     }
                 );
             }


deleted to solve conflicts

deleted to solve conflicts

--- Assets/SBSP-C3-manu-resources/_Scripts/Inventory/ItemData.cs
+++ Assets/SBSP-C3-manu-resources/_Scripts/Inventory/ItemData.cs
@@ -1,32 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.EventSystems;
-using System;
-
-public class ItemData : MonoBehaviour,  IPointerEnterHandler, IPointerExitHandler
-{
-    public InventoryModel inventoryModel;
-    public int amount;
-    public int slot;
-
-    private Inventory inv;
-    private ToolTip toolTip;
-    private Vector2 offset;
-
-    void Start()
-    {
-        inv = GameObject.Find("InventoryObject").GetComponent<Inventory>();
-        toolTip = inv.GetComponent<ToolTip>();
-    }
-
-    public void OnPointerEnter(PointerEventData eventData)
-    {
-        toolTip.Activate(inventoryModel);
-    }
-
-    public void OnPointerExit(PointerEventData eventData)
-    {
-        toolTip.Deactivate();
-    }
-}


big knight has test dialogue now

big knight has test dialogue now

--- Assets/Scripts/Game/Defined/Serialized/Brains/FieldBrains.cs
+++ Assets/Scripts/Game/Defined/Serialized/Brains/FieldBrains.cs
@@ -38,6 +38,13 @@
                     CastOnRandom(COUNTER),
                     CastOnRandom(ATTACK)
                 };
+        }
+
+        public override string StartOfRoundDialogue() {
+            if (currentBattle.TurnCount == 0) {
+                return "Stand and deliver!";
+            }
+            return string.Empty;
         }
     }


Home page- search

Home page- search

--- BikeMates/BikeMates.DataAccess/Repository/RouteRepository.cs
+++ BikeMates/BikeMates.DataAccess/Repository/RouteRepository.cs
@@ -13,18 +13,27 @@

         public IEnumerable<Route> Search(RouteSearchParameters searchParameters)
         {
-            IQueryable<Route> routes = this.Context.Routes.Where(route =>
-                (string.IsNullOrEmpty(searchParameters.Title) || route.Title.Contains(searchParameters.Title)) &&
-                (string.IsNullOrEmpty(searchParameters.Author) || route.Author.FirstName.Contains(searchParameters.Author)) &&
-                (string.IsNullOrEmpty(searchParameters.Author)) || route.Author.SecondName.Contains(searchParameters.Author) &&
-                (string.IsNullOrEmpty(searchParameters.MeetingPlace) || route.MeetingPlace.Contains(searchParameters.MeetingPlace)) &&
+
+            //IQueryable<Route> routes = this.Context.Routes.Where(route =>
+            //    (string.IsNullOrEmpty(searchParameters.Title) || route.Title.Contains(searchParameters.Title)) &&
+            //    (string.IsNullOrEmpty(searchParameters.Author) || route.Author.FirstName.Contains(searchParameters.Author)) &&
+            //    (string.IsNullOrEmpty(searchParameters.Author)) || route.Author.SecondName.Contains(searchParameters.Author) &&
+            //    (string.IsNullOrEmpty(searchParameters.MeetingPlace) || route.MeetingPlace.Contains(searchParameters.MeetingPlace)) &&
+            //    (string.IsNullOrEmpty(searchParameters.Description) || route.Description.Contains(searchParameters.Description)) &&
+            //    (!searchParameters.MinDistance.HasValue || route.Distance >= searchParameters.MinDistance) &&
+            //    (!searchParameters.MaxDistance.HasValue || route.Distance <= searchParameters.MaxDistance) &&
+            //    (!searchParameters.DateFrom.HasValue || route.Start >= searchParameters.DateFrom) &&
+            //    (!searchParameters.DateTo.HasValue || route.Start <= searchParameters.DateTo)
+            //    );
+
+            IQueryable<Route> routes = this.Context.Routes.Where(route => (string.IsNullOrEmpty(searchParameters.MeetingPlace) || route.MeetingPlace.Contains(searchParameters.MeetingPlace)) &&
                 (string.IsNullOrEmpty(searchParameters.Description) || route.Description.Contains(searchParameters.Description)) &&
                 (!searchParameters.MinDistance.HasValue || route.Distance >= searchParameters.MinDistance) &&
                 (!searchParameters.MaxDistance.HasValue || route.Distance <= searchParameters.MaxDistance) &&
                 (!searchParameters.DateFrom.HasValue || route.Start >= searchParameters.DateFrom) &&
                 (!searchParameters.DateTo.HasValue || route.Start <= searchParameters.DateTo)
                 );
-
+
             if (searchParameters.SortOrder == RouteSortOptions.Date)
             {
                 routes = routes.OrderBy(x => x.Start);


IB Brokerage Updates (#4900)

IB Brokerage Updates (#4900)

* Add RequestId to request information logging

* Use unique request id across all request types (orders, subscriptions, data queries)

- Previously we had three separate counters for request types and this was causing request information messages to be overwritten (different request types with same ids)

* Update GetContractDetails to log all contracts found

--- Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
+++ Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
@@ -54,13 +54,9 @@
         // Existing orders created in TWS can *only* be cancelled/modified when connected with ClientId = 0
         private const int ClientId = 0;

-        // next valid order id for this client
+        // next valid order id (or request id, or ticker id) for this client
         private int _nextValidId;
         private readonly object _nextValidIdLocker = new object();
-
-        // next valid request id for queries
-        private int _nextRequestId;
-        private int _nextTickerId;

         private readonly int _port;
         private readonly string _account;
@@ -399,7 +395,7 @@
                 {
                     var orderId = Parse.Int(id);

-                    _requestInformation[orderId] = "CancelOrder: " + order;
+                    _requestInformation[orderId] = $"[Id={orderId}] CancelOrder: " + order;

                     CheckRateLimiting();

@@ -606,9 +602,9 @@

             var manualResetEvent = new ManualResetEvent(false);

-            var requestId = GetNextRequestId();
-
-            _requestInformation[requestId] = "GetExecutions: " + symbol;
+            var requestId = GetNextId();
+
+            _requestInformation[requestId] = $"[Id={requestId}] GetExecutions: " + symbol;

             // define our event handlers
             EventHandler<IB.RequestEndEventArgs> clientOnExecutionDataEnd = (sender, args) =>
@@ -949,7 +945,7 @@
             if (needsNewId)
             {
                 // the order ids are generated for us by the SecurityTransactionManaer
-                var id = GetNextBrokerageOrderId();
+                var id = GetNextId();
                 order.BrokerId.Add(id.ToStringInvariant());
                 ibOrderId = id;
             }
@@ -963,7 +959,7 @@
                 throw new ArgumentException("Expected order with populated BrokerId for updating orders.");
             }

-            _requestInformation[ibOrderId] = $"IBPlaceOrder: {order.Symbol.Value} ({contract})";
+            _requestInformation[ibOrderId] = $"[Id={ibOrderId}] IBPlaceOrder: {order.Symbol.Value} ({GetContractDescription(contract)} )";

             CheckRateLimiting();

@@ -980,7 +976,12 @@

         private static string GetUniqueKey(Contract contract)
         {
-            return $"{contract} {contract.LastTradeDateOrContractMonth.ToStringInvariant()} {contract.Strike.ToStringInvariant()} {contract.Right}";
+            return $"{contract.ToString().ToUpperInvariant()} {contract.LastTradeDateOrContractMonth.ToStringInvariant()} {contract.Strike.ToStringInvariant()} {contract.Right}";
+        }
+
+        private static string GetContractDescription(Contract contract)
+        {
+            return $"{contract} {contract.PrimaryExch ?? string.Empty} {contract.LastTradeDateOrContractMonth.ToStringInvariant()} {contract.Strike.ToStringInvariant()} {contract.Right}";
         }

         private string GetPrimaryExchange(Contract contract, Symbol symbol)
@@ -1041,10 +1042,13 @@
         {
             const int timeout = 60; // sec

-            ContractDetails details = null;
-            var requestId = GetNextRequestId();
-
-            _requestInformation[requestId] = $"GetContractDetails: {symbol.Value} ({contract})";
+            var requestId = GetNextId();
+
+            var contractDetailsList = new List<ContractDetails>();
+
+            Log.Trace($"InteractiveBrokersBrokerage.GetContractDetails(): {symbol.Value} ({contract})");
+
+            _requestInformation[requestId] = $"[Id={requestId}] GetContractDetails: {symbol.Value} ({contract})";

             var manualResetEvent = new ManualResetEvent(false);

@@ -1052,14 +1056,28 @@
             EventHandler<IB.ContractDetailsEventArgs> clientOnContractDetails = (sender, args) =>
             {
                 // ignore other requests
-                if (args.RequestId != requestId) return;
-                details = args.ContractDetails;
-                var uniqueKey = GetUniqueKey(contract);
+                if (args.RequestId != requestId)
+                {
+                    return;
+                }
+
+                var details = args.ContractDetails;
+                contractDetailsList.Add(details);
+
+                var uniqueKey = GetUniqueKey(details.Contract);
                 _contractDetails.TryAdd(uniqueKey, details);
-                manualResetEvent.Set();
-                Log.Trace("InteractiveBrokersBrokerage.GetContractDetails(): clientOnContractDetails event: " + uniqueKey);
+
+                Log.Trace($"InteractiveBrokersBrokerage.GetContractDetails(): clientOnContractDetails event: {uniqueKey}");
             };

+            EventHandler<IB.RequestEndEventArgs> clientOnContractDetailsEnd = (sender, args) =>
+            {
+                if (args.RequestId == requestId)
+                {
+                    manualResetEvent.Set();
+                }
+            };
+
             EventHandler<IB.ErrorEventArgs> clientOnError = (sender, args) =>
             {
                 if (args.Id == requestId)
@@ -1069,6 +1087,7 @@
             };

             _client.ContractDetails += clientOnContractDetails;
+            _client.ContractDetailsEnd += clientOnContractDetailsEnd;
             _client.Error += clientOnError;

             CheckRateLimiting();
@@ -1083,9 +1102,12 @@

             // be sure to remove our event handlers
             _client.Error -= clientOnError;
+            _client.ContractDetailsEnd -= clientOnContractDetailsEnd;
             _client.ContractDetails -= clientOnContractDetails;

-            return details;
+            Log.Trace($"InteractiveBrokersBrokerage.GetContractDetails(): contracts found: {contractDetailsList.Count}");
+
+            return contractDetailsList.FirstOrDefault();
         }

         private string GetFuturesContractExchange(Contract contract, string ticker)
@@ -1106,9 +1128,9 @@
         {
             const int timeout = 60; // sec

-            var requestId = GetNextRequestId();
-
-            _requestInformation[requestId] = $"FindContracts: {ticker} ({contract})";
+            var requestId = GetNextId();
+
+            _requestInformation[requestId] = $"[Id={requestId}] FindContracts: {ticker} ({GetContractDescription(contract)})";

             var manualResetEvent = new ManualResetEvent(false);
             var contractDetails = new List<ContractDetails>();
@@ -2107,7 +2129,7 @@

                 default:
                     throw new NotSupportedException(
-                        $"An existing position or open order for an unsupported security type was found: {contract}. " +
+                        $"An existing position or open order for an unsupported security type was found: {GetContractDescription(contract)}. " +
                         "Please manually close the position or cancel the order before restarting the algorithm.");
             }
         }
@@ -2233,26 +2255,16 @@
         }

         /// <summary>
-        /// Handles the threading issues of creating an IB order ID
-        /// </summary>
-        /// <returns>The new IB ID</returns>
-        private int GetNextBrokerageOrderId()
+        /// Handles the threading issues of creating an IB OrderId/RequestId/TickerId
+        /// </summary>
+        /// <returns>The new IB OrderId/RequestId/TickerId</returns>
+        private int GetNextId()
         {
             lock (_nextValidIdLocker)
             {
                 // return the current value and increment
                 return _nextValidId++;
             }
-        }
-
-        private int GetNextRequestId()
-        {
-            return Interlocked.Increment(ref _nextRequestId);
-        }
-
-        private int GetNextTickerId()
-        {
-            return Interlocked.Increment(ref _nextTickerId);
         }

         private void HandleBrokerTime(object sender, IB.CurrentTimeUtcEventArgs e)
@@ -2322,10 +2334,10 @@
                                 return false;
                             }

-                            var id = GetNextTickerId();
+                            var id = GetNextId();
                             var contract = CreateContract(subscribeSymbol, false);

-                            _requestInformation[id] = $"Subscribe: {symbol.Value} ({contract})";
+                            _requestInformation[id] = $"[Id={id}] Subscribe: {symbol.Value} ({GetContractDescription(contract)})";

                             CheckRateLimiting();

@@ -2345,7 +2357,7 @@
                             _subscribedSymbols[symbol] = id;
                             _subscribedTickers[id] = new SubscriptionEntry { Symbol = subscribeSymbol };

-                            Log.Trace($"InteractiveBrokersBrokerage.Subscribe(): Subscribe Processed: {symbol.Value} ({contract}) # {id}");
+                            Log.Trace($"InteractiveBrokersBrokerage.Subscribe(): Subscribe Processed: {symbol.Value} ({GetContractDescription(contract)}) # {id}");
                             return true;
                         }
                     }
@@ -2833,7 +2845,7 @@
             var startTime = request.Resolution == Resolution.Daily ? request.StartTimeUtc.Date : request.StartTimeUtc;
             var endTime = request.Resolution == Resolution.Daily ? request.EndTimeUtc.Date : request.EndTimeUtc;

-            Log.Trace($"InteractiveBrokersBrokerage::GetHistory(): Submitting request: {request.Symbol.Value} ({contract}): {request.Resolution}/{request.TickType} {startTime} UTC -> {endTime} UTC");
+            Log.Trace($"InteractiveBrokersBrokerage::GetHistory(): Submitting request: {request.Symbol.Value} ({GetContractDescription(contract)}): {request.Resolution}/{request.TickType} {startTime} UTC -> {endTime} UTC");

             DateTimeZone exchangeTimeZone;
             if (!_symbolExchangeTimeZones.TryGetValue(request.Symbol, out exchangeTimeZone))
@@ -2878,7 +2890,7 @@
                 yield return bar;
             }

-            Log.Trace($"InteractiveBrokersBrokerage::GetHistory(): Download completed: {request.Symbol.Value} ({contract})");
+            Log.Trace($"InteractiveBrokersBrokerage::GetHistory(): Download completed: {request.Symbol.Value} ({GetContractDescription(contract)})");
         }

         private IEnumerable<TradeBar> GetHistory(
@@ -2904,9 +2916,9 @@
             {
                 var pacing = false;
                 var historyPiece = new List<TradeBar>();
-                var historicalTicker = GetNextTickerId();
-
-                _requestInformation[historicalTicker] = $"GetHistory: {request.Symbol.Value} ({contract})";
+                var historicalTicker = GetNextId();
+
+                _requestInformation[historicalTicker] = $"[Id={historicalTicker}] GetHistory: {request.Symbol.Value} ({GetContractDescription(contract)})";

                 EventHandler<IB.HistoricalDataEventArgs> clientOnHistoricalData = (sender, args) =>
                 {


Do not wait for timeout when error in GetContractDetails and FindContracts

--- Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
+++ Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
@@ -1083,7 +1083,16 @@
                 Log.Trace("InteractiveBrokersBrokerage.GetContractDetails(): clientOnContractDetails event: " + uniqueKey);
             };

+            EventHandler<IB.ErrorEventArgs> clientOnError = (sender, args) =>
+            {
+                if (args.Id == requestId)
+                {
+                    manualResetEvent.Set();
+                }
+            };
+
             _client.ContractDetails += clientOnContractDetails;
+            _client.Error += clientOnError;

             CheckRateLimiting();

@@ -1096,6 +1105,7 @@
             }

             // be sure to remove our event handlers
+            _client.Error -= clientOnError;
             _client.ContractDetails -= clientOnContractDetails;

             return details;
@@ -1127,14 +1137,33 @@
             var contractDetails = new List<ContractDetails>();

             // define our event handlers
-            EventHandler<IB.ContractDetailsEventArgs> clientOnContractDetails =
-                (sender, args) => contractDetails.Add(args.ContractDetails);
-
-            EventHandler<IB.RequestEndEventArgs> clientOnContractDetailsEnd =
-                (sender, args) => manualResetEvent.Set();
+            EventHandler<IB.ContractDetailsEventArgs> clientOnContractDetails = (sender, args) =>
+            {
+                if (args.RequestId == requestId)
+                {
+                    contractDetails.Add(args.ContractDetails);
+                }
+            };
+
+            EventHandler<IB.RequestEndEventArgs> clientOnContractDetailsEnd = (sender, args) =>
+            {
+                if (args.RequestId == requestId)
+                {
+                    manualResetEvent.Set();
+                }
+            };
+
+            EventHandler<IB.ErrorEventArgs> clientOnError = (sender, args) =>
+            {
+                if (args.Id == requestId)
+                {
+                    manualResetEvent.Set();
+                }
+            };

             _client.ContractDetails += clientOnContractDetails;
             _client.ContractDetailsEnd += clientOnContractDetailsEnd;
+            _client.Error += clientOnError;

             CheckRateLimiting();

@@ -1147,6 +1176,7 @@
             }

             // be sure to remove our event handlers
+            _client.Error -= clientOnError;
             _client.ContractDetailsEnd -= clientOnContractDetailsEnd;
             _client.ContractDetails -= clientOnContractDetails;

@@ -2984,8 +3014,6 @@
                 {
                     if (args.Id == historicalTicker)
                     {
-                        Log.Error($"InteractiveBrokersBrokerage::GetHistory(): OnError(): Id:{args.Id} Code:{args.Code} Message:{args.Message}");
-
                         if (args.Code == 162 && args.Message.Contains("pacing violation"))
                         {
                             // pacing violation happened


Do not attempt to reconnect after IBAutomater errors

--- Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
+++ Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
@@ -684,6 +684,13 @@
                 {
                     Log.Trace("InteractiveBrokersBrokerage.Connect(): Attempting to connect ({0}/{1}) ...", attempt, maxAttempts);

+                    // if we have errors from IBAutomater, exit immediately
+                    if (HasIbAutomaterErrors())
+                    {
+                        attempt = maxAttempts;
+                        CheckIbAutomaterErrors();
+                    }
+
                     // if message processing thread is still running, wait until it terminates
                     Disconnect();

@@ -3169,6 +3176,11 @@
             Log.Trace($"InteractiveBrokersBrokerage.OnIbAutomaterExited(): Exit code: {e.ExitCode}");
         }

+        private bool HasIbAutomaterErrors()
+        {
+            return _loginFailed || _existingSessionDetected || _securityDialogDetected;
+        }
+
         private void CheckIbAutomaterErrors()
         {
             if (_loginFailed)


Refactorings

Refactorings

--- Client/Systems/VesselUpdateSys/VesselUpdateMessageHandler.cs
+++ Client/Systems/VesselUpdateSys/VesselUpdateMessageHandler.cs
@@ -22,9 +22,16 @@
             var vessel = FlightGlobals.FindVessel(msgData.VesselId);
             if (vessel == null) return;

+            UpdateVesselFields(vessel, msgData);
+            UpdateActionGroups(vessel, msgData);
+            UpdateProtoVesselValues(vessel, msgData);
+        }
+
+        private static void UpdateVesselFields(Vessel vessel, VesselUpdateMsgData msgData)
+        {
             vessel.vesselName = msgData.Name;
-            vessel.vesselType = (VesselType)Enum.Parse(typeof(VesselType), msgData.Type);
-            vessel.situation = (Vessel.Situations)Enum.Parse(typeof(Vessel.Situations), msgData.Situation);
+            vessel.vesselType = (VesselType) Enum.Parse(typeof(VesselType), msgData.Type);
+            vessel.situation = (Vessel.Situations) Enum.Parse(typeof(Vessel.Situations), msgData.Situation);
             vessel.Landed = msgData.Landed;
             vessel.landedAt = msgData.LandedAt;
             vessel.displaylandedAt = msgData.DisplayLandedAt;
@@ -34,17 +41,20 @@
             vessel.lastUT = msgData.LastUt;
             vessel.isPersistent = msgData.Persistent;
             vessel.referenceTransformId = msgData.RefTransformId;
-
             if (vessel.IsControllable != msgData.Controllable)
             {
                 ControllableField.SetValue(vessel, msgData.Controllable);
                 vessel.protoVessel.wasControllable = vessel.IsControllable;
             }
+        }

+        private static void UpdateActionGroups(Vessel vessel, VesselUpdateMsgData msgData)
+        {
             for (var i = 0; i < 17; i++)
             {
                 //Ignore SAS if we are spectating as it will fight with the FI
-                if ((KSPActionGroup) (1 << (i & 31)) == KSPActionGroup.SAS && VesselCommon.IsSpectating && FlightGlobals.ActiveVessel?.id == vessel.id)
+                if ((KSPActionGroup) (1 << (i & 31)) == KSPActionGroup.SAS && VesselCommon.IsSpectating &&
+                    FlightGlobals.ActiveVessel?.id == vessel.id)
                 {
                     vessel.ActionGroups.groups[i] = false;
                     continue;
@@ -53,7 +63,10 @@
                 vessel.ActionGroups.groups[i] = msgData.ActionGroups[i].State;
                 vessel.ActionGroups.cooldownTimes[i] = msgData.ActionGroups[i].Time;
             }
+        }

+        private static void UpdateProtoVesselValues(Vessel vessel, VesselUpdateMsgData msgData)
+        {
             if (vessel.protoVessel != null)
             {
                 vessel.protoVessel.vesselName = vessel.name;