Changed my mind, GetPart() should not call handler(null) for errors. Only for part-not-found

--- Model/dbmodel.cs
+++ Model/dbmodel.cs
@@ -69,15 +69,16 @@
                     handler(partEntry);
                 });
                 if (errMsg != null) {
-                    Console.WriteLine("Warning: Failed to execut query '{0}'. Error returned: {1}", sql, errMsg);
+                    Console.WriteLine("Warning: Failed to execute query '{0}'. Error returned: {1}", sql, errMsg);
                     errMsg = null;
-                    handler(null);
                 }
+            } else {
+                // Part doesn't exist, call handler with null
+                handler(null);
             }
         });
         if (errMsg != null) {
-            Console.WriteLine("Warning: Failed to execut query '{0}'. Error returned: {1}", sql, errMsg);
-            handler(null);
+            Console.WriteLine("Warning: Failed to execute query '{0}'. Error returned: {1}", sql, errMsg);
         }
     }


Working on documentation.

Working on documentation.

--- Sources/Accord.Audio/Windows/RaisedCosineWindow.cs
+++ Sources/Accord.Audio/Windows/RaisedCosineWindow.cs
@@ -55,6 +55,7 @@
         /// <summary>
         ///   Constructs a new Raised Cosine Window
         /// </summary>
+        ///
         public RaisedCosineWindow(double alpha, int length)
             : this(alpha, length,0)
         {
@@ -63,6 +64,7 @@
         /// <summary>
         ///   Constructs a new Raised Cosine Window
         /// </summary>
+        ///
         public RaisedCosineWindow(double alpha, int length, int sampleRate)
             : base(length, sampleRate)
         {
@@ -77,6 +79,7 @@
         /// <summary>
         ///   Creates a new Hamming Window.
         /// </summary>
+        ///
         public static RaisedCosineWindow Hamming(int length)
         {
             return new RaisedCosineWindow(0.46, length);
@@ -85,6 +88,7 @@
         /// <summary>
         ///   Creates a new Hann Window.
         /// </summary>
+        ///
         public static RaisedCosineWindow Hann(int length)
         {
             return new RaisedCosineWindow(0.5, length);
@@ -93,6 +97,7 @@
         /// <summary>
         ///   Creates a new Hann Window.
         /// </summary>
+        ///
         public static RaisedCosineWindow Hann(double length, int sampleRate)
         {
             return new RaisedCosineWindow(0.5, length, sampleRate);
@@ -101,13 +106,13 @@
         /// <summary>
         ///   Creates a new Rectangular Window.
         /// </summary>
-        /// <param name="length"></param>
-        /// <returns></returns>
+        ///
+        /// <param name="length">The size of the window.</param>
+        ///
         public static RaisedCosineWindow Rectangular(int length)
         {
             return new RaisedCosineWindow(0, length);
         }

-
     }
 }


Improving test for code coverage

Improving test for code coverage

--- Src/BlockchainSharp.Tests/Core/BlockBranchTests.cs
+++ Src/BlockchainSharp.Tests/Core/BlockBranchTests.cs
@@ -33,9 +33,13 @@
         public void TryToConnectEmptyBranches()
         {
             BlockBranch branch = new BlockBranch();
+            BlockBranch branch1 = new BlockBranch();
+            branch1.TryToAddFirst(new Block(40, new Hash()));

             Assert.IsFalse(branch.IsConnected());
             Assert.IsFalse(branch.TryToConnect(branch));
+            Assert.IsFalse(branch.TryToConnect(branch1));
+            Assert.IsFalse(branch1.TryToConnect(branch));
             Assert.IsFalse(branch.IsConnected());
         }


implement LongCount().

implement LongCount().

--- System.Reactive/System.Reactive.Linq/Observable.cs
+++ System.Reactive/System.Reactive.Linq/Observable.cs
@@ -818,7 +818,13 @@
 		{ throw new NotImplementedException (); }

 		public static IObservable<long> LongCount<TSource> (this IObservable<TSource> source)
-		{ throw new NotImplementedException (); }
+		{
+			var sub = new Subject<long> ();
+			IDisposable dis = null;
+			long count = 0;
+			dis = source.Subscribe ((s) => count++, () => { sub.OnNext (count); sub.OnCompleted (); dis.Dispose (); });
+			return sub;
+		}

 		public static IObservable<Notification<TSource>> Materialize<TSource> (this IObservable<TSource> source)
 		{ throw new NotImplementedException (); }


Support for Unity 5.0-5.2.

Support for Unity 5.0-5.2.

--- UnityBuild-AssetBundle/Editor/BuildAssetBundles.cs
+++ UnityBuild-AssetBundle/Editor/BuildAssetBundles.cs
@@ -14,7 +14,12 @@
     public string baseBuildPath = Path.Combine("bin", "bundles");

     public string innerBuildPath = Path.Combine("$PLATFORM", "$ARCHITECTURE");
-    public BuildAssetBundleOptions options = BuildAssetBundleOptions.ChunkBasedCompression;
+
+#if UNITY_5_3 || UNITY_5_4_OR_NEWER
+    BuildAssetBundleOptions options = BuildAssetBundleOptions.ChunkBasedCompression;
+#else
+    BuildAssetBundleOptions options = BuildAssetBundleOptions.None;
+#endif

     #endregion


Use a ReadOnlySpanList for JsonMultiValueSyntax.ValueNodes.

--- Eutherion/Shared/Text/Json/JsonMultiValueSyntax.cs
+++ Eutherion/Shared/Text/Json/JsonMultiValueSyntax.cs
@@ -19,10 +19,8 @@
 **********************************************************************************/
 #endregion

-using Eutherion.Utils;
 using System;
 using System.Collections.Generic;
-using System.Linq;

 namespace Eutherion.Text.Json
 {
@@ -87,7 +85,7 @@
         /// <summary>
         /// Gets the non-empty list of value nodes.
         /// </summary>
-        public ReadOnlyList<JsonValueWithBackgroundSyntax> ValueNodes { get; }
+        public ReadOnlySpanList<JsonValueWithBackgroundSyntax> ValueNodes { get; }

         /// <summary>
         /// Gets the background after the value nodes.
@@ -97,7 +95,7 @@
         /// <summary>
         /// Gets the length of the text span corresponding with this node.
         /// </summary>
-        public int Length { get; }
+        public int Length => ValueNodes.Length + BackgroundAfter.Length;

         /// <summary>
         /// Initializes a new instance of <see cref="JsonMultiValueSyntax"/>.
@@ -116,7 +114,7 @@
         /// </exception>
         public JsonMultiValueSyntax(IEnumerable<JsonValueWithBackgroundSyntax> valueNodes, JsonBackgroundSyntax backgroundAfter)
         {
-            ValueNodes = ReadOnlyList<JsonValueWithBackgroundSyntax>.Create(valueNodes);
+            ValueNodes = ReadOnlySpanList<JsonValueWithBackgroundSyntax>.Create(valueNodes);

             if (ValueNodes.Count == 0)
             {
@@ -124,7 +122,6 @@
             }

             BackgroundAfter = backgroundAfter ?? throw new ArgumentNullException(nameof(backgroundAfter));
-            Length = ValueNodes.Sum(x => x.Length) + BackgroundAfter.Length;
         }
     }
 }


Implement IReadOnlyList<TObject> with SafeLazyObjectCollection.

--- Eutherion/Shared/Utils/SafeLazyObjectCollection.cs
+++ Eutherion/Shared/Utils/SafeLazyObjectCollection.cs
@@ -20,6 +20,8 @@
 #endregion

 using System;
+using System.Collections;
+using System.Collections.Generic;
 using System.Threading;

 namespace Eutherion.Utils
@@ -30,7 +32,7 @@
     /// <typeparam name="TObject">
     /// The type of objects to create.
     /// </typeparam>
-    public class SafeLazyObjectCollection<TObject> where TObject : class
+    public class SafeLazyObjectCollection<TObject> : IReadOnlyList<TObject> where TObject : class
     {
         private readonly TObject[] Arr;
         private readonly Func<int, TObject> ElementConstructor;
@@ -85,5 +87,15 @@
                 return Arr[index];
             }
         }
+
+        /// <summary>
+        /// Returns an enumerator that iterates through the list.
+        /// </summary>
+        /// <returns>
+        /// A <see cref="IEnumerator{T}"/> that can be used to iterate through the list.
+        /// </returns>
+        public IEnumerator<TObject> GetEnumerator() => ((ICollection<TObject>)Arr).GetEnumerator();
+
+        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
     }
 }


Use AssemblyName constructor to retrieve assembly version

--- EvilDICOM.Core/EvilDICOM.Core/Helpers/Constants.cs
+++ EvilDICOM.Core/EvilDICOM.Core/Helpers/Constants.cs
@@ -9,7 +9,7 @@
     public static class Constants
     {
         public static string EVIL_DICOM_IMP_UID = "1.2.598.0.1.2851334.2.1865.1";
-        public static string EVIL_DICOM_IMP_VERSION = Assembly.GetCallingAssembly().FullName.Split(new[] { '=', ',' }).ElementAt(2);
+        public static string EVIL_DICOM_IMP_VERSION = new AssemblyName(Assembly.GetCallingAssembly().FullName).Version.ToString();
         //APPLICATION CONTEXT
         public static string DEFAULT_APPLICATION_CONTEXT = "1.2.840.10008.3.1.1.1";
     }


Cache identifier when serializing.

Cache identifier when serializing.

--- ExRam.Gremlinq.Core/Extensions/ObjectExtensions.cs
+++ ExRam.Gremlinq.Core/Extensions/ObjectExtensions.cs
@@ -11,7 +11,7 @@
 {
     internal static class ObjectExtensions
     {
-        private static readonly ConditionalWeakTable<IImmutableDictionary<MemberInfo, PropertyMetadata>, ConcurrentDictionary<Type, (PropertyInfo propertyInfo, SerializationBehaviour serializationBehaviour)[]>> TypeProperties = new ConditionalWeakTable<IImmutableDictionary<MemberInfo, PropertyMetadata>, ConcurrentDictionary<Type, (PropertyInfo, SerializationBehaviour)[]>>();
+        private static readonly ConditionalWeakTable<IImmutableDictionary<MemberInfo, PropertyMetadata>, ConcurrentDictionary<Type, (PropertyInfo propertyInfo, object identifier, SerializationBehaviour serializationBehaviour)[]>> TypeProperties = new ConditionalWeakTable<IImmutableDictionary<MemberInfo, PropertyMetadata>, ConcurrentDictionary<Type, (PropertyInfo, object, SerializationBehaviour)[]>>();

         public static IEnumerable<(PropertyInfo property, object identifier, object value)> Serialize(this object obj)
         {
@@ -27,13 +27,17 @@
                     type => type
                         .GetTypeHierarchy()
                         .SelectMany(typeInHierarchy => typeInHierarchy.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly))
-                        .Select(p => (property: p, serializationBehaviour: model.Metadata.GetValueOrDefault(p, PropertyMetadata.Default).SerializationBehaviour))
+                        .Select(p => (
+                            property: p,
+                            identifier: model.GetIdentifier(p),
+                            serializationBehaviour: model.Metadata
+                                .GetValueOrDefault(p, PropertyMetadata.Default)
+                                .SerializationBehaviour))
                         .OrderBy(x => x.property.Name)
                         .ToArray());

-            foreach (var (propertyInfo, serializationBehaviour) in propertyInfoTuples)
+            foreach (var (propertyInfo, identifier, serializationBehaviour) in propertyInfoTuples)
             {
-                var identifier = model.GetIdentifier(propertyInfo);
                 var actualSerializationBehaviour = serializationBehaviour;

                 if (identifier is T t)


Update more fields on Loan

Update more fields on Loan

--- LCAPI/LCAPI/Models/Loan.cs
+++ LCAPI/LCAPI/Models/Loan.cs
@@ -359,133 +359,133 @@
         /// Number of tax liens
         /// </summary>
         [DeserializeAs("taxLiens")]
-        public int taxLiens { get; set; } //nullable: Yes
+        public int? TaxLiens { get; set; } //nullable: Yes

         /// <summary>
         /// Months since most recent 90-day or worse rating.
         /// </summary>
         [DeserializeAs("mthsSinceLastMajorDerog")]
-        public int mthsSinceLastMajorDerog { get; set; } //nullable: Yes
+        public int? MonthsSinceLastMajorDerogatory { get; set; } //nullable: Yes

         /// <summary>
         /// Number of satisfactory accounts
         /// </summary>
         [DeserializeAs("numSats")]
-        public int numSats { get; set; } //nullable: Yes
+        public int? SatisfactoryAccounts { get; set; } //nullable: Yes

         /// <summary>
         /// Number of accounts opened in past 12 months
         /// </summary>
         [DeserializeAs("numTlOpPast12m")]
-        public int numTlOpPast12m { get; set; } //nullable: Yes
+        public int? AccountsOpenedPast12Months { get; set; } //nullable: Yes

         /// <summary>
         /// Months since most recent account opened
         /// </summary>
         [DeserializeAs("moSinRcntTl")]
-        public int moSinRcntTl { get; set; } //nullable: Yes
+        public int? MonthsSinceMostRecentAccount { get; set; } //nullable: Yes

         /// <summary>
         /// Total high credit/credit limit
         /// </summary>
         [DeserializeAs("totHiCredLim")]
-        public int totHiCredLim { get; set; } //nullable: Yes
+        public int? TotalHighCreditLimit { get; set; } //nullable: Yes

         /// <summary>
         /// Total current balance of all accounts
         /// </summary>
         [DeserializeAs("totCurBal")]
-        public int totCurBal { get; set; } //nullable: Yes
+        public int? TotalCurrentBalance { get; set; } //nullable: Yes

         /// <summary>
         /// Average current balance of all accounts
         /// </summary>
         [DeserializeAs("avgCurBal")]
-        public int avgCurBal { get; set; } //nullable: Yes
+        public int? AverageCurrentBalance { get; set; } //nullable: Yes

         /// <summary>
         /// Number of bankcard accounts
         /// </summary>
         [DeserializeAs("numBcTl")]
-        public int numBcTl { get; set; } //nullable: Yes
+        public int? BankcardAccounts { get; set; } //nullable: Yes

         /// <summary>
         /// Number of currently active bankcard accounts
         /// </summary>
         [DeserializeAs("numActvBcTl")]
-        public int numActvBcTl { get; set; } //nullable: Yes
+        public int? BankcardAccountsActive { get; set; } //nullable: Yes

         /// <summary>
         /// Number of satisfactory bankcard accounts
         /// </summary>
         [DeserializeAs("numBcSats")]
-        public int numBcSats { get; set; } //nullable: Yes
+        public int? BankcardAccountsSatisfactory { get; set; } //nullable: Yes

         /// <summary>
         /// Percent of trades never delinquent
         /// </summary>
         [DeserializeAs("pctTlNvrDlq")]
-        public int pctTlNvrDlq { get; set; } //nullable: Yes
+        public int? PercentageTradesNeverDelinquent { get; set; } //nullable: Yes

         /// <summary>
         /// Number of accounts 90 or more days past due in last 24 months
         /// </summary>
         [DeserializeAs("numTl90gDpd24m")]
-        public int numTl90gDpd24m { get; set; } //nullable: Yes
+        public int? Accounts90PastDuePast24Months { get; set; } //nullable: Yes

         /// <summary>
         /// Number of accounts currently 30 days past due (updated in past 2 months)
         /// </summary>
         [DeserializeAs("numTl30dpd")]
-        public int numTl30dpd { get; set; } //nullable: Yes
+        public int? Accounts30PastDue { get; set; } //nullable: Yes

         /// <summary>
         /// Number of accounts currently 120 days past due (updated in past 2 months)
         /// </summary>
         [DeserializeAs("numTl120dpd2m")]
-        public int numTl120dpd2m { get; set; } //nullable: Yes
+        public int? Accounts120PastDue { get; set; } //nullable: Yes

         /// <summary>
         /// Number of installment accounts
         /// </summary>
         [DeserializeAs("numIlTl")]
-        public int numIlTl { get; set; } //nullable: Yes
+        public int? InstallmentAccounts { get; set; } //nullable: Yes

         /// <summary>
         /// Months since oldest installment account opened
         /// </summary>
         [DeserializeAs("moSinOldIlAcct")]
-        public int moSinOldIlAcct { get; set; } //nullable: Yes
+        public int? MonthsSinceOldestInstallmentAccount { get; set; } //nullable: Yes

         /// <summary>
         /// Number of currently active revolving trades
         /// </summary>
         [DeserializeAs("numActvRevTl")]
-        public int numActvRevTl { get; set; } //nullable: Yes
+        public int? RevolvingTradesActive { get; set; } //nullable: Yes

         /// <summary>
         /// Months since oldest revolving account opened
         /// </summary>
         [DeserializeAs("moSinOldRevTlOp")]
-        public int moSinOldRevTlOp { get; set; } //nullable: Yes
+        public int? MonthsSinceOldestRevolvingAccount { get; set; } //nullable: Yes

         /// <summary>
         /// Months since most recent revolving account opened
         /// </summary>
         [DeserializeAs("moSinRcntRevTlOp")]
-        public int moSinRcntRevTlOp { get; set; } //nullable: Yes
+        public int? MonthsSinceRecentRevolvingAccount { get; set; } //nullable: Yes

         /// <summary>
         /// Total revolving high credit/credit limit
         /// </summary>
         [DeserializeAs("totalRevHiLim")]
-        public int totalRevHiLim { get; set; } //nullable: Yes
+        public int? RevolvingHighCreditLimit { get; set; } //nullable: Yes

         /// <summary>
         /// Number of revolving trades with balance > 0
         /// </summary>
         [DeserializeAs("numRevTlBalGt0")]
-        public int numRevTlBalGt0 { get; set; } //nullable: Yes
+        public int? RevolvingTradesWithBalance { get; set; } //nullable: Yes

         /// <summary>
         /// Number of open revolving accounts


try skip

try skip

--- test/OpenCvSharp.Tests/imgcodecs/ImgCodecsTest.cs
+++ test/OpenCvSharp.Tests/imgcodecs/ImgCodecsTest.cs
@@ -415,7 +415,7 @@
             ShowImagesWhenDebugMode(mat);
         }

-        [Fact]
+        [Fact(Skip = "_")]
         public void ImDecodeSpan()
         {
             var imageBytes = File.ReadAllBytes("_data/image/mandrill.png");


Fix UpdateStatus method

Fix UpdateStatus method

--- Libraries/WakeableTimer.cs
+++ Libraries/WakeableTimer.cs
@@ -418,8 +418,6 @@
                 case PowerModes.Resume:
                     Resume();
                     break;
-                case PowerModes.StatusChange:
-                    break;
                 case PowerModes.Suspend:
                     Suspend();
                     break;


NetPeer.GetConnection() made public

NetPeer.GetConnection() made public

--- Lidgren.Network/NetPeer.cs
+++ Lidgren.Network/NetPeer.cs
@@ -132,10 +132,10 @@
 			Thread.Sleep(10);
 		}

-		internal NetConnection GetConnection(IPEndPoint ep)
+		public NetConnection GetConnection(IPEndPoint ep)
 		{
 			NetConnection retval;
-			m_connectionLookup.TryGetValue(ep, out retval);
+			m_connectionLookup.TryGetValue(ep, out retval); // this should not pose a threading problem, afaict
 			return retval;
 		}


Extracted Keypad detection code into isNumKey(KeyCode) method.

--- KerbalImprovedSaveSystem.cs
+++ KerbalImprovedSaveSystem.cs
@@ -173,25 +173,9 @@
 		/// </summary>
 		private void DetectInput()
 		{
-			KeyCode[] numKeys = {
-				KeyCode.Keypad0,
-				KeyCode.Keypad1,
-				KeyCode.Keypad2,
-				KeyCode.Keypad3,
-				KeyCode.Keypad4,
-				KeyCode.Keypad5,
-				KeyCode.Keypad6,
-				KeyCode.Keypad7,
-				KeyCode.Keypad8,
-				KeyCode.Keypad9,
-				KeyCode.KeypadDivide,
-				KeyCode.KeypadEquals,
-				KeyCode.KeypadMinus,
-				KeyCode.KeypadMultiply,
-				KeyCode.KeypadPlus,
-				KeyCode.KeypadPeriod
-			};
-
+
+
+			// check for every possible key if it was pressed.
 			foreach (KeyCode vkey in System.Enum.GetValues(typeof(KeyCode)))
 			{
 				// do not alow the use of modifier keys, because that makes everything way more difficult
@@ -218,7 +202,7 @@
 							// ignore this key, so user has to press it again (like accents on german keyboard) or press another key.
 							continue;
 						}
-						if ((kissKeyChar == '\0') || (numKeys.IndexOf(vkey) > -1) || Char.IsDigit(kissKeyChar) || Char.IsWhiteSpace(kissKeyChar))
+						if ((kissKeyChar == '\0') || isNumKey(vkey) || Char.IsDigit(kissKeyChar) || Char.IsWhiteSpace(kissKeyChar))
 							kissKeyCaption = Enum.GetName(typeof(KeyCode), kissKeyCode);
 						else
 							kissKeyCaption = (kissKeyChar + "").ToUpper();
@@ -235,6 +219,33 @@
 					}
 				}
 			}
+		}
+
+		/// <summary>
+		/// Check if the pressed key was on the numeric keyboard to always
+		/// label them with their Keypad name regardless of current NumLock state.
+		/// </summary>
+		/// <param name="vkey">The key that has been pressed.</param>
+		/// <returns>True - if vkey is on the numeric keyboard.
+		/// False - for all other keys.</returns>
+		private bool isNumKey(KeyCode vkey)
+		{
+			// array of all the Keypad Keycodes.
+			KeyCode[] numKeys = {KeyCode.Keypad0,
+				KeyCode.Keypad1, KeyCode.Keypad2, KeyCode.Keypad3,
+				KeyCode.Keypad4, KeyCode.Keypad5, KeyCode.Keypad6,
+				KeyCode.Keypad7, KeyCode.Keypad8, KeyCode.Keypad9,
+				KeyCode.KeypadDivide,
+				KeyCode.KeypadMultiply,
+				KeyCode.KeypadMinus,
+				KeyCode.KeypadPlus,
+				KeyCode.KeypadPeriod,
+				KeyCode.KeypadEquals,
+				KeyCode.KeypadEnter,
+				KeyCode.Numlock
+			};
+
+			return (numKeys.IndexOf(vkey) > -1);
 		}


Switch to MIT license in the source file

--- JsonSubTypes/JsonSubtypes.cs
+++ JsonSubTypes/JsonSubtypes.cs
@@ -8,17 +8,27 @@

 namespace JsonSubTypes
 {
-    //  Copyright 2017 Emmanuel Counasse
+    //  MIT License
     //
-    //  Licensed under the Apache License, Version 2.0 (the "License");
-    //  you may not use this file except in compliance with the License.
-    //  You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
-
-    //  Unless required by applicable law or agreed to in writing, software
-    //  distributed under the License is distributed on an "AS IS" BASIS,
-    //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    //  See the License for the specific language governing permissions and
-    //  limitations under the License.
+    //  Copyright (c) 2017 Emmanuel Counasse
+    //
+    //  Permission is hereby granted, free of charge, to any person obtaining a copy
+    //  of this software and associated documentation files (the "Software"), to deal
+    //  in the Software without restriction, including without limitation the rights
+    //  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    //  copies of the Software, and to permit persons to whom the Software is
+    //  furnished to do so, subject to the following conditions:
+    //
+    //  The above copyright notice and this permission notice shall be included in all
+    //  copies or substantial portions of the Software.
+    //
+    //  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    //  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    //  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+    //  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+    //  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+    //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+    //  SOFTWARE.

     public class JsonSubtypes : JsonConverter
     {
@@ -289,4 +299,4 @@
             }
         }
     }
-}+}


Minor changes

Minor changes

--- CoCSharp/Networking/NetworkManagerAsync.cs
+++ CoCSharp/Networking/NetworkManagerAsync.cs
@@ -215,7 +215,10 @@
                                 PacketReceived(args, packets[i]); // pass it to the handler
                         }
                         catch (Exception ex)
-                        { PacketReceivedFailed(args, ex); }
+                        {
+                            if (PacketReceivedFailed != null)
+                                PacketReceivedFailed(args, ex);
+                        }

                         StartReceive();
                         ReceiveEventPool.Push(args);


Fix test

Fix test

--- CodeJam.Main.Tests/Assertions/CodeTests.cs
+++ CodeJam.Main.Tests/Assertions/CodeTests.cs
@@ -36,7 +36,7 @@

 				var logOutput = logWriter.ToString();
 				Assert.That(logOutput, Does.Contain(ex.Message));
-				Assert.That(logOutput, Does.Contain(nameof(TestNotNull)));
+				Assert.That(logOutput, Does.Contain(nameof(TestLogging)));

 				Assert.DoesNotThrow(() => Code.NotNull<object>("Hello!", "arg00"));
 				logOutput = logWriter.ToString();


Added methods for Setting object quotes on StoredProcedure.

--- CodeOnlyStoredProcedure/StoredProcedure.cs
+++ CodeOnlyStoredProcedure/StoredProcedure.cs
@@ -354,6 +354,21 @@
         /// <remarks>Make sure your connection supports multiple active result sets, or concurrent calls will throw
         /// an exception.</remarks>
         public static void DisableConnectionCloningForEachCall() => GlobalSettings.Instance.CloneConnectionForEachCall = false;
+
+        /// <summary>
+        /// Allows you to change the default behavior of the object quoting syntax. If not set, the default style is
+        /// <see cref="ObjectQuoteStyle.Brackets"/>.
+        /// </summary>
+        /// <param name="style">THe <see cref="ObjectQuoteStyle"/> to use to define the object quote style.</param>
+        public static void SetObjectQuoteStyle(ObjectQuoteStyle style) => GlobalSettings.Instance.SetObjectQuoteStyle(style);
+
+        /// <summary>
+        /// Allows you to change the default behavior of the object quoting syntax. If not set, the open quote is "[",
+        /// and the close quote is "]".
+        /// </summary>
+        /// <param name="openQuote">The string to use to start an object quote.</param>
+        /// <param name="closeQuote">The string to use to close an object quote.</param>
+        public static void SetObjectQuoteStyle(string openQuote, string closeQuote) => GlobalSettings.Instance.SetObjectQuoteStyle(openQuote, closeQuote);
         #endregion

         /// <summary>


Remove beta name from title

Remove beta name from title

--- KraxbotOSS/Form1.Designer.cs
+++ KraxbotOSS/Form1.Designer.cs
@@ -175,7 +175,7 @@
             this.Name = "Form1";
             this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "KraxbotOSS: Open Beta";
+            this.Text = "Kraxbot: Open Source";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
             this.groupBox1.ResumeLayout(false);
             this.groupBox2.ResumeLayout(false);


Range sum - accepted

Range sum - accepted

--- LeetCode/remote/range_sum.cs
+++ LeetCode/remote/range_sum.cs
@@ -9,6 +9,12 @@
 // sumRange(0, 2) -> 1
 // sumRange(2, 5) -> -1
 // sumRange(0, 5) -> -3
+//
+// 16 / 16 test cases passed.
+//  Status: Accepted
+//  Runtime: 512 ms
+//
+//      Submitted: 0 minutes ago
 //

 using System;


Improved GetRegistrySetting, SetRegistrySetting

--- LeftosCommonLibrary/Tools.cs
+++ LeftosCommonLibrary/Tools.cs
@@ -28,7 +28,6 @@
     using System.Linq;
     using System.Security.Cryptography;
     using System.Text;
-    using System.Windows;
     using System.Windows.Controls;

     using Microsoft.Win32;
@@ -48,37 +47,46 @@
         /// <typeparam name="T"></typeparam>
         /// <param name="setting">The setting.</param>
         /// <param name="value">The value.</param>
-        /// <exception cref="System.Exception">Couldn't access or create application's registry key.</exception>
+        /// <exception cref="System.Exception">KeyCreateError: Thrown if the key could neither be opened nor created.</exception>
         public static void SetRegistrySetting<T>(string setting, T value)
         {
+            SetRegistrySetting(AppRegistryKey, setting, value);
+        }
+
+        /// Sets a registry setting using a user-defined key.
+        /// <typeparam name="T"></typeparam>
+        /// <param name="key">The key.</param>
+        /// <param name="setting">The setting.</param>
+        /// <param name="value">The value.</param>
+        /// <exception cref="System.Exception">KeyCreateError: Thrown if the key could neither be opened nor created.</exception>
+        public static void SetRegistrySetting<T>(string key, string setting, T value)
+        {
+            var rk = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64);
             try
             {
-                var rk = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64);
-                try
-                {
-                    rk = rk.OpenSubKey(AppRegistryKey, true);
+                rk = rk.OpenSubKey(key, true);
+                if (rk == null)
+                {
+                    rk = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);
+                    rk = rk.OpenSubKey(key, true);
                     if (rk == null)
                     {
                         throw new Exception();
                     }
                 }
-                catch (Exception)
-                {
-                    rk = Registry.CurrentUser;
-                    rk.CreateSubKey(AppRegistryKey);
-                    rk = rk.OpenSubKey(AppRegistryKey, true);
-                    if (rk == null)
-                    {
-                        throw new Exception("Couldn't access or create application's registry key.");
-                    }
-                }
-
-                rk.SetValue(setting, value);
-            }
-            catch
-            {
-                MessageBox.Show("Couldn't save setting " + setting + ".", AppName, MessageBoxButton.OK, MessageBoxImage.Error);
-            }
+            }
+            catch (Exception)
+            {
+                rk = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64);
+                rk.CreateSubKey(key);
+                rk = rk.OpenSubKey(key, true);
+                if (rk == null)
+                {
+                    throw new Exception("KeyCreateError");
+                }
+            }
+
+            rk.SetValue(setting, value);
         }

         /// Gets a registry setting using the AppRegistryKey field as the key.
@@ -86,20 +94,49 @@
         /// <param name="setting">The setting.</param>
         /// <param name="defaultValue">The default value.</param>
         /// <returns>The registry setting's value.</returns>
-        /// <exception cref="System.Exception">The application doesn't have access to HKEY_CURRENT_USER.</exception>
+        /// <exception cref="System.Exception">KeyOpenError: Thrown if the key couldn't be opened.</exception>
         public static T GetRegistrySetting<T>(string setting, T defaultValue)
+        {
+            return GetRegistrySetting(AppRegistryKey, setting, defaultValue);
+        }
+
+        /// Gets a registry setting using the AppRegistryKey field as the key.
+        /// <typeparam name="T"></typeparam>
+        /// <param name="key">The key.</param>
+        /// <param name="setting">The setting.</param>
+        /// <param name="defaultValue">The default value.</param>
+        /// <returns>The registry setting's value.</returns>
+        /// <exception cref="System.Exception">KeyOpenError: Thrown if the key couldn't be opened.</exception>
+        public static T GetRegistrySetting<T>(string key, string setting, T defaultValue)
         {
             var settingValue = defaultValue;
             try
             {
                 var rk = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64);
-                rk = rk.OpenSubKey(AppRegistryKey);
+                rk = rk.OpenSubKey(key);
                 if (rk != null)
                 {
                     settingValue = (T) (Convert.ChangeType(rk.GetValue(setting, defaultValue), typeof(T)));
                 }
-            }
-            catch
+                else
+                {
+                    rk = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);
+                    rk = rk.OpenSubKey(key);
+                    if (rk != null)
+                    {
+                        settingValue = (T) (Convert.ChangeType(rk.GetValue(setting, defaultValue), typeof(T)));
+                    }
+                    else
+                    {
+                        throw new Exception("KeyOpenError");
+                    }
+                }
+            }
+            catch (InvalidCastException)
+            {
+                settingValue = defaultValue;
+            }
+            catch (FormatException)
             {
                 settingValue = defaultValue;
             }


Updated log services

Updated log services

--- Log.Service/LogServices.cs
+++ Log.Service/LogServices.cs
@@ -2,7 +2,6 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using System.Threading.Tasks;

 namespace Log.Service
@@ -25,10 +24,7 @@

         public async Task<IEnumerable<LogEntry>> GetEntries()
         {
-            if(_logItem == null)
-            {
-                _logItem = new LogItem { Entries = (await _logProvider.GetEntries()).ToList() };
-            }
+            _logItem = new LogItem { Entries = (await _logProvider.GetEntries()).ToList() };

             return _logItem.Entries;
         }


Claim enum moved back to server, close #32

--- KotoriCore/Helpers/Enums.cs
+++ KotoriCore/Helpers/Enums.cs
@@ -5,21 +5,6 @@
     /// </summary>
     public static class Enums
     {
-        /// <summary>
-        /// Claim types.
-        /// </summary>
-        public enum ClaimType
-        {
-            /// <summary>
-            /// The master.
-            /// </summary>
-            Master = 0,
-            /// <summary>
-            /// The project.
-            /// </summary>
-            Project = 1
-        }
-
         /// <summary>
         /// Document types.
         /// </summary>


Beheer return fixes

Beheer return fixes

--- ICT4RealsWebForms/ICT4RealsWebForms/Beheer.aspx.cs
+++ ICT4RealsWebForms/ICT4RealsWebForms/Beheer.aspx.cs
@@ -703,6 +703,7 @@
                     if (tram.DeleteTram(Convert.ToInt32(tbDetailsName.Text)) == true)
                     {
                         refreshGUI(); //not sure
+                        return;
                     }
                     ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Kan tram niet verwijderen')",
                         true);
@@ -742,6 +743,7 @@
                             Convert.ToInt32(ddlDetailsLocation.SelectedItem.Text), status))
                     {
                         refreshGUI(); //not sure
+                        return;
                     }
                     ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Kan tram niet aanpassen')", true);
                 }
@@ -787,6 +789,7 @@
                             tramOnRail))
                     {
                         refreshGUI(); //not sure
+                        return;
                     }
                     ClientScript.RegisterStartupScript(GetType(), "myalert", "alert('Kan tram niet toevoegen')", true);
                 }
@@ -858,6 +861,7 @@
                     Convert.ToInt32(ddlDriveInLocation.SelectedItem.Text), 1))
                 {
                     refreshGUI(); //not sure
+                    return;
                 }
                 ClientScript.RegisterStartupScript(GetType(), "myalert", "alert('Kan tram niet verplaatsen')", true);
             }