Logs reformatting

Logs reformatting

--- Assets/Editor/AdjustEditor.cs
+++ Assets/Editor/AdjustEditor.cs
@@ -36,8 +36,8 @@
         // If user disabled it, oh well, we won't do a thing.
         if (!isPostProcessingEnabled)
         {
-            UnityEngine.Debug.Log("adjust: You have forbidden the adjust SDK to perform post processing tasks.");
-            UnityEngine.Debug.Log("adjust: Skipping post processing tasks.");
+            UnityEngine.Debug.Log("Adjust: You have forbidden the adjust SDK to perform post processing tasks.");
+            UnityEngine.Debug.Log("Adjust: Skipping post processing tasks.");
             return;
         }

@@ -48,13 +48,13 @@
     {
         if (target == BuildTarget.Android)
         {
-            UnityEngine.Debug.Log("adjust: Starting to perform post build tasks for Android platform.");
+            UnityEngine.Debug.Log("Adjust: Starting to perform post build tasks for Android platform.");
             RunPostProcessTasksAndroid();
         }
         else if (target == BuildTarget.iOS)
         {
 #if UNITY_IOS
-            UnityEngine.Debug.Log("adjust: Starting to perform post build tasks for iOS platform.");
+            UnityEngine.Debug.Log("Adjust: Starting to perform post build tasks for iOS platform.");

             string xcodeProjectPath = projectPath + "/Unity-iPhone.xcodeproj/project.pbxproj";

@@ -67,29 +67,29 @@

             string xcodeTarget = xcodeProject.TargetGuidByName("Unity-iPhone");

-            UnityEngine.Debug.Log("adjust: Adding AdSupport.framework to Xcode project.");
+            UnityEngine.Debug.Log("Adjust: Adding AdSupport.framework to Xcode project.");
             xcodeProject.AddFrameworkToProject(xcodeTarget, "AdSupport.framework", true);
-            UnityEngine.Debug.Log("adjust: AdSupport.framework added successfully.");
-
-            UnityEngine.Debug.Log("adjust: Adding iAd.framework to Xcode project.");
+            UnityEngine.Debug.Log("Adjust: AdSupport.framework added successfully.");
+
+            UnityEngine.Debug.Log("Adjust: Adding iAd.framework to Xcode project.");
             xcodeProject.AddFrameworkToProject(xcodeTarget, "iAd.framework", true);
-            UnityEngine.Debug.Log("adjust: iAd.framework added successfully.");
+            UnityEngine.Debug.Log("Adjust: iAd.framework added successfully.");

             // The adjust SDK needs to have Obj-C exceptions enabled.
             // GCC_ENABLE_OBJC_EXCEPTIONS=YES

-            UnityEngine.Debug.Log("adjust: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES.");
+            UnityEngine.Debug.Log("Adjust: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES.");
             xcodeProject.AddBuildProperty(xcodeTarget, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES");

-            UnityEngine.Debug.Log("adjust: Obj-C exceptions enabled successfully.");
+            UnityEngine.Debug.Log("Adjust: Obj-C exceptions enabled successfully.");

             // The adjust SDK needs to have -ObjC flag set in other linker flags section because of it's categories.
             // OTHER_LDFLAGS -ObjC

-            UnityEngine.Debug.Log("adjust: Adding -ObjC flag to other linker flags (OTHER_LDFLAGS).");
+            UnityEngine.Debug.Log("Adjust: Adding -ObjC flag to other linker flags (OTHER_LDFLAGS).");
             xcodeProject.AddBuildProperty(xcodeTarget, "OTHER_LDFLAGS", "-ObjC");

-            UnityEngine.Debug.Log("adjust: -ObjC successfully added to other linker flags.");
+            UnityEngine.Debug.Log("Adjust: -ObjC successfully added to other linker flags.");

             // Save the changes to Xcode project file.
             xcodeProject.WriteToFile(xcodeProjectPath);
@@ -118,12 +118,12 @@
             isAdjustManifestUsed = true;
             File.Copy(adjustManifestPath, appManifestPath);

-            UnityEngine.Debug.Log("adjust: User defined AndroidManifest.xml file not found in Plugins/Android folder.");
-            UnityEngine.Debug.Log("adjust: Creating default app's AndroidManifest.xml from AdjustAndroidManifest.xml file.");
+            UnityEngine.Debug.Log("Adjust: User defined AndroidManifest.xml file not found in Plugins/Android folder.");
+            UnityEngine.Debug.Log("Adjust: Creating default app's AndroidManifest.xml from AdjustAndroidManifest.xml file.");
         }
         else
         {
-            UnityEngine.Debug.Log("adjust: User defined AndroidManifest.xml file located in Plugins/Android folder.");
+            UnityEngine.Debug.Log("Adjust: User defined AndroidManifest.xml file located in Plugins/Android folder.");
         }

         // If adjust manifest is used, we have already set up everything in it so that
@@ -150,8 +150,8 @@
             // Clean the manifest file.
             CleanManifestFile(appManifestPath);

-            UnityEngine.Debug.Log("adjust: App's AndroidManifest.xml file check and potential modification completed.");
-            UnityEngine.Debug.Log("adjust: Please check if any error message was displayed during this process "
+            UnityEngine.Debug.Log("Adjust: App's AndroidManifest.xml file check and potential modification completed.");
+            UnityEngine.Debug.Log("Adjust: Please check if any error message was displayed during this process "
                 + "and make sure to fix all issues in order to properly use the adjust SDK in your app.");
         }
     }
@@ -162,7 +162,7 @@
         // <uses-permission android:name="android.permission.INTERNET" />
         // <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

-        UnityEngine.Debug.Log("adjust: Checking if all permissions needed for the adjust SDK are present in the app's AndroidManifest.xml file.");
+        UnityEngine.Debug.Log("Adjust: Checking if all permissions needed for the adjust SDK are present in the app's AndroidManifest.xml file.");

         bool hasInternetPermission = false;
         bool hasAccessWifiStatePermission = false;
@@ -194,11 +194,11 @@
             XmlElement element = manifest.CreateElement("uses-permission");
             element.SetAttribute("android__name", "android.permission.INTERNET");
             manifestRoot.AppendChild(element);
-            UnityEngine.Debug.Log("adjust: android.permission.INTERNET permission successfully added to your app's AndroidManifest.xml file.");
+            UnityEngine.Debug.Log("Adjust: android.permission.INTERNET permission successfully added to your app's AndroidManifest.xml file.");
         }
         else
         {
-            UnityEngine.Debug.Log("adjust: Your app's AndroidManifest.xml file already contains android.permission.INTERNET permission.");
+            UnityEngine.Debug.Log("Adjust: Your app's AndroidManifest.xml file already contains android.permission.INTERNET permission.");
         }

         // If android.permission.ACCESS_WIFI_STATE permission is missing, add it.
@@ -207,11 +207,11 @@
             XmlElement element = manifest.CreateElement("uses-permission");
             element.SetAttribute("android__name", "android.permission.ACCESS_WIFI_STATE");
             manifestRoot.AppendChild(element);
-            UnityEngine.Debug.Log("adjust: android.permission.ACCESS_WIFI_STATE permission successfully added to your app's AndroidManifest.xml file.");
+            UnityEngine.Debug.Log("Adjust: android.permission.ACCESS_WIFI_STATE permission successfully added to your app's AndroidManifest.xml file.");
         }
         else
         {
-            UnityEngine.Debug.Log("adjust: Your app's AndroidManifest.xml file already contains android.permission.ACCESS_WIFI_STATE permission.");
+            UnityEngine.Debug.Log("Adjust: Your app's AndroidManifest.xml file already contains android.permission.ACCESS_WIFI_STATE permission.");
         }
     }

@@ -246,7 +246,7 @@
         //     <uses-permission android:name="android.permission.INTERNET" />
         // </manifest>

-        UnityEngine.Debug.Log("adjust: Checking if app's AndroidManifest.xml file contains receiver for INSTALL_REFERRER intent.");
+        UnityEngine.Debug.Log("Adjust: Checking if app's AndroidManifest.xml file contains receiver for INSTALL_REFERRER intent.");

         XmlElement manifestRoot = manifest.DocumentElement;
         XmlNode applicationNode = null;
@@ -264,8 +264,8 @@
         // If there's no applicatio node, something is really wrong with your AndroidManifest.xml.
         if (applicationNode == null)
         {
-            UnityEngine.Debug.LogError("adjust: Your app's AndroidManifest.xml file does not contain \"<application>\" node.");
-            UnityEngine.Debug.LogError("adjust: Unable to add the adjust broadcast receiver to AndroidManifest.xml.");
+            UnityEngine.Debug.LogError("Adjust: Your app's AndroidManifest.xml file does not contain \"<application>\" node.");
+            UnityEngine.Debug.LogError("Adjust: Unable to add the adjust broadcast receiver to AndroidManifest.xml.");
             return;
         }

@@ -320,8 +320,8 @@
         // Let's see what we have found so far.
         if (isThereAnyCustomBroadcastReiver)
         {
-            UnityEngine.Debug.Log("adjust: It seems like you are using your own broadcast receiver.");
-            UnityEngine.Debug.Log("adjust: Please, add the calls to the adjust broadcast receiver like described in here: https://github.com/adjust/android_sdk/blob/master/doc/english/referrer.md");
+            UnityEngine.Debug.Log("Adjust: It seems like you are using your own broadcast receiver.");
+            UnityEngine.Debug.Log("Adjust: Please, add the calls to the adjust broadcast receiver like described in here: https://github.com/adjust/android_sdk/blob/master/doc/english/referrer.md");
         }
         else
         {
@@ -338,7 +338,7 @@
             receiverElement.AppendChild(intentFilterElement);
             applicationNode.AppendChild(receiverElement);

-            UnityEngine.Debug.Log("adjust: Adjust broadcast receiver successfully added to your app's AndroidManifest.xml file.");
+            UnityEngine.Debug.Log("Adjust: Adjust broadcast receiver successfully added to your app's AndroidManifest.xml file.");
         }
     }

@@ -364,6 +364,7 @@
     {
         int unityVersion;
         Int32.TryParse(Application.unityVersion[0].ToString(), out unityVersion);
+
         return unityVersion;
     }
 }


Dev in progress...

Dev in progress...

Dev in progress...

--- DevelopmentInProgress.DipMapper/DipMapper.cs
+++ DevelopmentInProgress.DipMapper/DipMapper.cs
@@ -1,9 +1,11 @@
 using System;
+using System.CodeDom;
 using System.Collections;
 using System.Collections.Generic;
 using System.Data;
 using System.Data.SqlClient;
 using System.Linq;
+using System.Net.Mail;
 using System.Reflection;
 using System.Runtime.CompilerServices;

@@ -37,7 +39,19 @@
                     while (reader.Read())
                     {
                         var t = CreateNew<T>();
-
+                        for (int i = 0; i < reader.FieldCount + 1; i ++)
+                        {
+                            var propertyInfo = propertyInfos.FirstOrDefault(p => p.Name == reader.GetName(i));
+                            if (propertyInfo == null)
+                            {
+                                throw new Exception("DipMapper exception : Unable to map field " + reader.GetName(i) +
+                                                    " to object " + t.GetType().Name);
+                            }
+
+                            propertyInfo.SetValue(t, reader[i]);
+                        }
+
+                        result.Add(t);
                     }

                     reader.Close();
@@ -145,7 +159,7 @@
             return where;
         }

-        internal static IList<PropertyInfo> GetPropertyInfos<T>(IEnumerable<string> ignore = null)
+        internal static IEnumerable<PropertyInfo> GetPropertyInfos<T>(IEnumerable<string> ignore = null)
         {
             if (ignore == null)
             {


Fixing a small merge conflict

Fixing a small merge conflict

--- Assets/Scripts/EnemyAttack.cs
+++ Assets/Scripts/EnemyAttack.cs
@@ -71,7 +71,7 @@
                 case Phase.IDLE:
                     if (timeleft <= 0)
                     {
-                        target = mgr.player.transform.position;
+                        target = mgr.playerPosition;
                         _phase = Phase.TELLING;
                         UpdateLine();

@@ -117,7 +117,6 @@

     private void UpdateLine()
     {
-        Vector3 playerPosition = mgr.playerPosition;
         lr.SetPositions(new Vector3[] {
             transform.position,
             target


Fixed sorting errors

Fixed sorting errors

--- Assets/Scripts/ShopManager.cs
+++ Assets/Scripts/ShopManager.cs
@@ -133,11 +133,18 @@
     public void OnClickSortPrice()

     {
+        if (CurrentState == State.masteryascending || CurrentState == State.masterydescending)
+        {
+            CurrentState = State.none;
+            Text textMastery = transform.Find("Sort by Mastery").GetComponentInChildren<Text>();
+            textMastery.text = "Sort by Mastery";
+        }
+
         if (CurrentState == State.AZ || CurrentState == State.ZA)
         {
             CurrentState = State.none;
-            Text text = transform.Find("Sort by Name").GetComponentInChildren<Text>();
-            text.text = "Sort by Name";
+            Text textName = transform.Find("Sort by Name").GetComponentInChildren<Text>();
+            textName.text = "Sort by Name";
         }

         if (CurrentState == State.priceascending)
@@ -163,80 +170,81 @@
         OnFilterClicked();
     }

-
+
     public void OnClickSortName()
     {
         if (CurrentState == State.masteryascending || CurrentState == State.masterydescending)
         {
-            Text textName = transform.Find("Sort by Mastery").GetComponentInChildren<Text>();
-            textName.text = "Sort by Mastery";
-            CurrentState = State.none;
-
-            if (CurrentState == State.priceascending || CurrentState == State.pricedescending)
+            Text textmastery = transform.Find("Sort by Mastery").GetComponentInChildren<Text>();
+            textmastery.text = "Sort by Mastery";
+            CurrentState = State.none;
+        }
+
+        if (CurrentState == State.priceascending || CurrentState == State.pricedescending)
+        {
+             CurrentState = State.none;
+             Text text = transform.Find("SortByPrice").GetComponentInChildren<Text>();
+             text.text = "Sort by Price";
+        }
+
+        if (CurrentState == State.none || CurrentState == State.AZ)
+        {
+            Text textName = transform.Find("Sort by Name").GetComponentInChildren<Text>();
+            textName.text = "Sort by Name (Z-A)";
+            CurrentState = State.ZA;
+        }
+
+        else if (CurrentState == State.ZA)
+        {
+            Text textName = transform.Find("Sort by Name").GetComponentInChildren<Text>();
+            textName.text = "Sort by Name (A-Z)";
+            CurrentState = State.AZ;
+        }
+
+        else if (CurrentState == State.AZ)
+        {
+            Text textName = transform.Find("Sort by Name").GetComponentInChildren<Text>();
+            textName.text = "Sort by Name";
+            CurrentState = State.ZA;
+        }
+
+            OnFilterClicked();
+    }
+
+    public void OnClickSortMastery()
+    {
+        if (CurrentState == State.AZ || CurrentState == State.ZA)
+        {
+            CurrentState = State.none;
+            Text textName = transform.Find("Sort by Name").GetComponentInChildren<Text>();
+            textName.text = "Sort by Name";
+        }
+
+        if (CurrentState == State.priceascending || CurrentState == State.pricedescending)
         {
             CurrentState = State.none;
             Text text = transform.Find("SortByPrice").GetComponentInChildren<Text>();
             text.text = "Sort by Price";
         }

-        if (CurrentState == State.none || CurrentState == State.AZ)
-        {
-            Text textName = transform.Find("Sort by Name").GetComponentInChildren<Text>();
-            textName.text = "Sort by Name (Z-A)";
-            CurrentState = State.ZA;
-        }
-
-        else if (CurrentState == State.ZA)
-        {
-            Text textName = transform.Find("Sort by Name").GetComponentInChildren<Text>();
-            textName.text = "Sort by Name (A-Z)";
-            CurrentState = State.AZ;
-        }
-
-        else if (CurrentState == State.AZ)
-        {
-            Text textName = transform.Find("Sort by Name").GetComponentInChildren<Text>();
-            textName.text = "Sort by Name";
-            CurrentState = State.ZA;
-        }
-
-        OnFilterClicked();
-    }
-
-    public void OnClickSortMastery()
-    {
-        if (CurrentState == State.AZ || CurrentState == State.ZA)
-        {
-            CurrentState = State.none;
-            Text text = transform.Find("Sort by Name").GetComponentInChildren<Text>();
-            text.text = "Sort by Name";
-        }
-
-        if (CurrentState == State.priceascending || CurrentState == State.pricedescending)
-        {
-            CurrentState = State.none;
-            Text text = transform.Find("SortByPrice").GetComponentInChildren<Text>();
-            text.text = "Sort by Price";
-        }
-
         if (CurrentState == State.none)
         {
-            Text textName = transform.Find("Sort by Mastery").GetComponentInChildren<Text>();
-            textName.text = "Sort by Mastery (DSC)";
+            Text textMastery = transform.Find("Sort by Mastery").GetComponentInChildren<Text>();
+            textMastery.text = "Sort by Mastery (DSC)";
             CurrentState = State.masterydescending;
         }

         else if (CurrentState == State.masterydescending)
         {
-            Text textName = transform.Find("Sort by Mastery").GetComponentInChildren<Text>();
-            textName.text = "Sort by Mastery (ASC)";
+            Text textMastery = transform.Find("Sort by Mastery").GetComponentInChildren<Text>();
+            textMastery.text = "Sort by Mastery (ASC)";
             CurrentState = State.masteryascending;
         }

         else if (CurrentState == State.masteryascending)
         {
-            Text textName = transform.Find("Sort by Mastery").GetComponentInChildren<Text>();
-            textName.text = "Sort by Mastery";
+            Text textMastery = transform.Find("Sort by Mastery").GetComponentInChildren<Text>();
+            textMastery.text = "Sort by Mastery";
             CurrentState = State.none;
         }


Revert "Removed alternate (#32)" This commit is causing a build error, since the boolean is being used in sample, hence reverting the change. This reverts commit 9bd692f9de0e1cc163a1c31d5785358a87262a9a.

--- AudioGenerator/AppDelegate.cs
+++ AudioGenerator/AppDelegate.cs
@@ -12,6 +12,7 @@
     {
         double sampleRate;
         const int numBuffers = 3;
+        bool alternate;
         private NSError error;

         public override bool FinishedLaunching(UIApplication app, NSDictionary options)


Capture exception when token renewal fails #32 #56

--- AzureBot/ContextExtensions.cs
+++ AzureBot/ContextExtensions.cs
@@ -18,12 +18,19 @@

                 if (DateTime.UtcNow >= expires)
                 {
-                    var result = await AzureActiveDirectoryHelper.GetToken(authResult.UserUniqueId);
+                    try
+                    {
+                        var result = await AzureActiveDirectoryHelper.GetToken(authResult.UserUniqueId);

-                    authResult.AccessToken = result.AccessToken;
-                    authResult.ExpiresOnUtcTicks = result.ExpiresOn.UtcTicks;
+                        authResult.AccessToken = result.AccessToken;
+                        authResult.ExpiresOnUtcTicks = result.ExpiresOn.UtcTicks;

-                    context.StoreAuthResult(authResult);
+                        context.StoreAuthResult(authResult);
+                    }
+                    catch (Exception ex)
+                    {
+                        await context.PostAsync(ex.Message);
+                    }
                 }

                 return authResult.AccessToken;


Unity can now be built from Jenkins.

Unity can now be built from Jenkins.

--- targets/csharp-unity/source/Uunit/Editor/UUnitTestRunner.cs
+++ targets/csharp-unity/source/Uunit/Editor/UUnitTestRunner.cs
@@ -24,7 +24,15 @@
             suite.RunAllTests();
             UUnitTestResult result = suite.GetResults();

-            Debug.Log(result.Summary());
+            if (!result.AllTestsPassed())
+            {
+                Debug.LogWarning(result.Summary());
+                throw new Exception("Not all tests passed.");
+            }
+            else
+            {
+                Debug.Log(result.Summary());
+            }
         }

         /*[MenuItem("UUnit/Run Tests Incrementally")] Not quite ready for prime-time*/


udpated matching logic / error handling on bad command

--- BasicCad/BasicCAD.Designer.cs
+++ BasicCad/BasicCAD.Designer.cs
@@ -137,7 +137,7 @@
             this.ZoomIn.UseVisualStyleBackColor = false;
             this.ZoomIn.Click += new System.EventHandler(this.button2_Click);
             //
-            // BasicCad
+            // BasicCad_Form
             //
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
@@ -149,7 +149,8 @@
             this.Controls.Add(this.Container_Control);
             this.MaximumSize = new System.Drawing.Size(1920, 1080);
             this.MinimumSize = new System.Drawing.Size(961, 950);
-            this.Name = "BasicCad";
+            this.Name = "BasicCad_Form";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "BasicCAD";
             this.Load += new System.EventHandler(this.BasicCad_Load);
             this.ResizeEnd += new System.EventHandler(this.BasicCad_ResizeEnd);


Change BString value type to ReadOnlyMemory<byte>

--- BencodeNET/Objects/BString.cs
+++ BencodeNET/Objects/BString.cs
@@ -1,9 +1,10 @@
 using System;
-using System.Collections.Generic;
 using System.IO;
 using System.IO.Pipelines;
-using System.Linq;
 using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using BencodeNET.IO;

 namespace BencodeNET.Objects
 {
@@ -14,7 +15,7 @@
     /// <remarks>
     /// The underlying value is a <see cref="byte"/> array.
     /// </remarks>
-    public sealed class BString : BObject<IReadOnlyList<byte>>, IComparable<BString>
+    public sealed class BString : BObject<ReadOnlyMemory<byte>>, IComparable<BString>
     {
         /// <summary>
         /// The maximum number of digits that can be handled as the length part of a bencoded string.
@@ -24,13 +25,12 @@
         /// <summary>
         /// The underlying bytes of the string.
         /// </summary>
-        public override IReadOnlyList<byte> Value => _value;
-        private readonly byte[] _value;
+        public override ReadOnlyMemory<byte> Value { get; }

         /// <summary>
         /// Gets the length of the string in bytes.
         /// </summary>
-        public int Length => _value.Length;
+        public int Length => Value.Length;

         private static readonly Encoding DefaultEncoding = Encoding.UTF8;

@@ -58,12 +58,10 @@
         /// </summary>
         /// <param name="bytes">The bytes representing the data.</param>
         /// <param name="encoding">The encoding of the bytes. Defaults to <see cref="System.Text.Encoding.UTF8"/>.</param>
-        public BString(IEnumerable<byte> bytes, Encoding encoding = null)
+        public BString(byte[] bytes, Encoding encoding = null)
         {
-            if (bytes == null) throw new ArgumentNullException(nameof(bytes));
-
+            Value = bytes ?? throw new ArgumentNullException(nameof(bytes));
             _encoding = encoding ?? DefaultEncoding;
-            _value = bytes as byte[] ?? bytes.ToArray();
         }

         /// <summary>
@@ -75,20 +73,31 @@
         public BString(string str, Encoding encoding = null)
         {
             _encoding = encoding ?? DefaultEncoding;
-            _value = string.IsNullOrEmpty(str)
-                ? Array.Empty<byte>()
-                : _encoding.GetBytes(str);
+
+            if (string.IsNullOrEmpty(str))
+            {
+                Value = Array.Empty<byte>();
+            }
+            else
+            {
+                var maxByteCount = _encoding.GetMaxByteCount(str.Length);
+                var span = new byte[maxByteCount].AsSpan();
+
+                var length = _encoding.GetBytes(str.AsSpan(), span);
+
+                Value = span.Slice(0, length).ToArray();
+            }
         }

         /// <inheritdoc/>
-        public override int GetSizeInBytes() => _value.Length + 1 + _value.Length.DigitCount();
+        public override int GetSizeInBytes() => Value.Length + 1 + Value.Length.DigitCount();

         /// <inheritdoc/>
         protected override void EncodeObject(Stream stream)
         {
-            stream.Write(_value.Length);
+            stream.Write(Value.Length);
             stream.Write(':');
-            stream.Write(_value);
+            stream.Write(Value.Span);
         }

         /// <inheritdoc/>
@@ -98,26 +107,14 @@
             var size = GetSizeInBytes();
             var buffer = writer.GetSpan(size);

-#if NETCOREAPP
             // Write length
-            var writtenBytes = Encoding.GetBytes(_value.Length.ToString().AsSpan(), buffer);
+            var writtenBytes = Encoding.GetBytes(Value.Length.ToString().AsSpan(), buffer);

             // Write ':'
             buffer[writtenBytes] = (byte) ':';

             // Write value
-            _value.AsSpan().CopyTo(buffer.Slice(writtenBytes + 1));
-#else
-            // Write length
-            var lengthBytes = Encoding.GetBytes(_value.Length.ToString());
-            lengthBytes.CopyTo(buffer);
-
-            // Write ':'
-            buffer[lengthBytes.Length] = (byte) ':';
-
-            // Write value
-            _value.AsSpan().CopyTo(buffer.Slice(lengthBytes.Length + 1));
-#endif
+            Value.Span.CopyTo(buffer.Slice(writtenBytes + 1));

             // Commit
             writer.Advance(size);
@@ -128,26 +125,26 @@

         public static bool operator ==(BString first, BString second)
         {
-            if (ReferenceEquals(first, null))
-                return ReferenceEquals(second, null);
+            if (first is null)
+                return second is null;

             return first.Equals(second);
         }

         public static bool operator !=(BString first, BString second) => !(first == second);

-        public override bool Equals(object other) => other is BString bstring && Value.SequenceEqual(bstring.Value);
+        public override bool Equals(object other) => other is BString bstring && Value.Span.SequenceEqual(bstring.Value.Span);

-        public bool Equals(BString bstring) => bstring != null && Value.SequenceEqual(bstring.Value);
+        public bool Equals(BString bstring) => bstring != null && Value.Span.SequenceEqual(bstring.Value.Span);

         public override int GetHashCode()
         {
-            var bytesToHash = Math.Min(Value.Count, 32);
+            var bytesToHash = Math.Min(Value.Length, 32);

             long hashValue = 0;
             for (var i = 0; i < bytesToHash; i++)
             {
-                hashValue = (37 * hashValue + Value[i]) % int.MaxValue;
+                hashValue = (37 * hashValue + Value.Span[i]) % int.MaxValue;
             }

             return (int)hashValue;
@@ -155,29 +152,7 @@

         public int CompareTo(BString other)
         {
-            if (other == null)
-                return 1;
-
-            var maxLength = Math.Max(this.Length, other.Length);
-
-            for (var i = 0; i < maxLength; i++)
-            {
-                // This is shorter and thereby this is "less than" the other
-                if (i >= this.Length)
-                    return -1;
-
-                // The other is shorter and thereby this is "greater than" the other
-                if (i >= other.Length)
-                    return 1;
-
-                if (this.Value[i] > other.Value[i])
-                    return 1;
-
-                if (this.Value[i] < other.Value[i])
-                    return -1;
-            }
-
-            return 0;
+            return Value.Span.SequenceCompareTo(other.Value.Span);
         }
 #pragma warning restore 1591

@@ -189,11 +164,7 @@
         /// </returns>
         public override string ToString()
         {
-#if NETCOREAPP
-            return _encoding.GetString(_value.AsSpan());
-#else
-            return _encoding.GetString(_value);
-#endif
+            return _encoding.GetString(Value.Span);
         }

         /// <summary>
@@ -206,11 +177,7 @@
         public string ToString(Encoding encoding)
         {
             encoding = encoding ?? _encoding;
-#if NETCOREAPP
-            return encoding.GetString(_value.AsSpan());
-#else
-            return encoding.GetString(_value);
-#endif
+            return encoding.GetString(Value.Span);
         }
     }
 }


Add ServerFeatures.Timeout to more tests.

Signed-off-by: Bradley Grainger <dae7ff431bf350b84a58dc5360c13b9e7c97b48a@gmail.com>

--- tests/SideBySide/CommandTimeoutTests.cs
+++ tests/SideBySide/CommandTimeoutTests.cs
@@ -61,7 +61,7 @@
 			}
 		}

-		[Fact]
+		[SkippableFact(ServerFeatures.Timeout)]
 		public void CommandTimeoutWithSleepSync()
 		{
 			using (var cmd = new MySqlCommand("SELECT SLEEP(120);", m_connection))
@@ -87,7 +87,7 @@
 			Assert.Equal(ConnectionState.Closed, m_connection.State);
 		}

-		[Fact]
+		[SkippableFact(ServerFeatures.Timeout)]
 		public async Task CommandTimeoutWithSleepAsync()
 		{
 			using (var cmd = new MySqlCommand("SELECT SLEEP(120);", m_connection))
@@ -113,7 +113,7 @@
 			Assert.Equal(ConnectionState.Closed, m_connection.State);
 		}

-		[SkippableFact(Baseline = "https://bugs.mysql.com/bug.php?id=87307")]
+		[SkippableFact(ServerFeatures.Timeout, Baseline = "https://bugs.mysql.com/bug.php?id=87307")]
 		public void MultipleCommandTimeoutWithSleepSync()
 		{
 			var csb = new MySqlConnectionStringBuilder(m_connection.ConnectionString);
@@ -153,7 +153,7 @@
 			Assert.Equal(ConnectionState.Closed, m_connection.State);
 		}

-		[SkippableFact(Baseline = "https://bugs.mysql.com/bug.php?id=87307")]
+		[SkippableFact(ServerFeatures.Timeout, Baseline = "https://bugs.mysql.com/bug.php?id=87307")]
 		public async Task MultipleCommandTimeoutWithSleepAsync()
 		{
 			var csb = new MySqlConnectionStringBuilder(m_connection.ConnectionString);
@@ -192,7 +192,7 @@
 			Assert.Equal(ConnectionState.Closed, m_connection.State);
 		}

-		[SkippableFact(Baseline = "https://bugs.mysql.com/bug.php?id=88124")]
+		[SkippableFact(ServerFeatures.Timeout, Baseline = "https://bugs.mysql.com/bug.php?id=88124")]
 		public void CommandTimeoutResetsOnReadSync()
 		{
 			var csb = new MySqlConnectionStringBuilder(m_connection.ConnectionString);
@@ -214,7 +214,7 @@
 			Assert.Equal(ConnectionState.Open, m_connection.State);
 		}

-		[SkippableFact(Baseline = "https://bugs.mysql.com/bug.php?id=88124")]
+		[SkippableFact(ServerFeatures.Timeout, Baseline = "https://bugs.mysql.com/bug.php?id=88124")]
 		public async Task CommandTimeoutResetsOnReadAsync()
 		{
 			var csb = new MySqlConnectionStringBuilder(m_connection.ConnectionString);
@@ -237,7 +237,7 @@
 		}

-		[Fact]
+		[SkippableFact(ServerFeatures.Timeout)]
 		public void TransactionCommandTimeoutWithSleepSync()
 		{
 			using (var transaction = m_connection.BeginTransaction())
@@ -264,7 +264,7 @@
 			Assert.Equal(ConnectionState.Closed, m_connection.State);
 		}

-		[Fact]
+		[SkippableFact(ServerFeatures.Timeout)]
 		public async Task TransactionCommandTimeoutWithSleepAsync()
 		{
 			using (var transaction = await m_connection.BeginTransactionAsync())


Fixed formatting of test fixture to follow BSD style

--- test/Superpower.Tests/Combinators/BetweenCombinatorTests.cs
+++ test/Superpower.Tests/Combinators/BetweenCombinatorTests.cs
@@ -25,27 +25,32 @@
         }

         [Fact]
-        public void BetweenSucceedsIfAllParsersSucceed() {
+        public void BetweenSucceedsIfAllParsersSucceed()
+        {
             AssertParser.SucceedsWith( Character.EqualTo( 'a' ).Between( Character.EqualTo( '(' ), Character.EqualTo( ')' ) ), "(a)", 'a' );
         }

         [Fact]
-        public void TokenBetweenFailsIfLeftParserFails() {
+        public void TokenBetweenFailsIfLeftParserFails()
+        {
             AssertParser.Fails( Token.EqualTo( 'a' ).Between( Token.EqualTo( '(' ), Token.EqualTo( ')' ) ), "{a)" );
         }

         [Fact]
-        public void TokenBetweenFailsIfRightParserFails() {
+        public void TokenBetweenFailsIfRightParserFails()
+        {
             AssertParser.Fails( Token.EqualTo( 'a' ).Between( Token.EqualTo( '(' ), Token.EqualTo( ')' ) ), "(a}" );
         }

         [Fact]
-        public void TokenBetweenFailsIfMiddleParserFails() {
+        public void TokenBetweenFailsIfMiddleParserFails()
+        {
             AssertParser.Fails( Token.EqualTo( 'a' ).Between( Token.EqualTo( '(' ), Token.EqualTo( ')' ) ), "(b)" );
         }

         [Fact]
-        public void TokenBetweenSucceedsIfAllParsersSucceed() {
+        public void TokenBetweenSucceedsIfAllParsersSucceed()
+        {
             AssertParser.SucceedsWith( Token.EqualTo( 'a' ).Between( Token.EqualTo( '(' ), Token.EqualTo( ')' ) ), "(a)", 'a' );
         }
     }


Fix minor release build script

Fix minor release build script

--- src/build.cake
+++ src/build.cake
@@ -59,6 +59,10 @@
 1. Setup the personal data in `PersonalTokens.config` file
 2. run `.\build.ps1 -Target ""Release"" -Configuration ""Release""`

+Example with parameters:
+------------------------
+run `.\build.ps1 -Target ""DryRunRelease"" -isMinorRelease=true`
+
 Available tasks:");
 	StartProcess("cake.exe", "build.cake -showdescription");
 });
@@ -74,9 +78,19 @@
 	.Does(() =>
 {
 	var version = GitVersion();
-	var tagVersion = version.Major + "." + (version.Minor + 1);
-	var tag =  "v" + tagVersion;
-	var nextVersion = tagVersion + ".0";
+	string nextVersion;
+	string tag;
+	if(!IsMinorRelease)
+	{
+		var tagVersion = version.Major + "." + (version.Minor + 1);
+		tag =  "v" + tagVersion;
+		nextVersion = tagVersion + ".0";
+	}
+	else
+	{
+		nextVersion = version.Major + "." + version.Minor + "." + version.CommitsSinceVersionSource;
+		tag =  "v" + nextVersion;
+	}
 	Information("Next version will be:" + nextVersion);

 	if(!IsDryRun)
@@ -91,7 +105,7 @@

 			GitAdd(".", newReleaseNotePath);
 			GitRemove(".", false, ReleaseNotesPath);
-			var releaseNoteCommit = GitCommit(".", @"Git-tfs release bot", "no-reply@git-tfs.com", "Prepare release v" + tag);
+			var releaseNoteCommit = GitCommit(".", @"Git-tfs release bot", "no-reply@git-tfs.com", "Prepare release " + tag);
 			Information("Release note commit created:" + releaseNoteCommit.Sha);

 			ReleaseNotesPath = newReleaseNotePath;
@@ -105,7 +119,14 @@
 	}
 	else
 	{
-		Information("[DryRun] Should create the release tag: " + tag);
+		if(!IsMinorRelease)
+		{
+			Information("[DryRun] Should create the release tag: " + tag);
+		}
+		else
+		{
+			Information("[DryRun] Minor release => Should not create a release tag");
+		}
 	}
 });

@@ -570,6 +591,7 @@
 }

 Task("Chocolatey").Description("Generate the chocolatey package")
+	.IsDependentOn("TagVersion")
 	.IsDependentOn("Package")
 	.Does(() =>
 {


Fix CurrentRuntimeIsProperlyRecognized for NETFRAMEWORK case on Linux/macOS

--- tests/BenchmarkDotNet.Tests/RuntimeVersionDetectionTests.cs
+++ tests/BenchmarkDotNet.Tests/RuntimeVersionDetectionTests.cs
@@ -110,7 +110,10 @@
             var runtime = RuntimeInformation.GetCurrentRuntime();

 #if NETFRAMEWORK
-            Assert.True(runtime is ClrRuntime);
+            if (RuntimeInformation.IsWindows())
+                Assert.True(runtime is ClrRuntime);
+            else
+                Assert.True(runtime is MonoRuntime);
 #elif NETCOREAPP2_1
             Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.TargetFrameworkMoniker == TargetFrameworkMoniker.NetCoreApp21);
 #elif NETCOREAPP2_2


Fixed some code documentation and an issue with the content-type checker

--- Ceen.Common/RequestUtility.cs
+++ Ceen.Common/RequestUtility.cs
@@ -73,6 +73,10 @@
         }
     }

+    /// <summary>
+    /// Helper methods for performing various common operations
+    /// on a request instance
+    /// </summary>
     public static class RequestUtility
     {
 		/// <summary>
@@ -219,6 +223,22 @@
             return IsContentType(contenttype, "multipart/form-data");
 		}

+        /// <summary>
+        /// Returns a value indicating if the content type is of a certain type
+        /// </summary>
+        /// <param name="request">The request to evaluate the content type for</param>
+        /// <param name="test">The type to test for</param>
+        /// <returns><c>true</c> if the content-type matches the test type; <c>false</c> otherwise</returns>
+        public static bool IsContentType(this IHttpRequest request, string test)
+            => IsContentType(request.ContentType, test);
+
+
+        /// <summary>
+        /// Returns a value indicating if the content type is of a certain type
+        /// </summary>
+        /// <param name="contenttype">The content-type string</param>
+        /// <param name="test">The type to test for</param>
+        /// <returns><c>true</c> if the content-type matches the test type; <c>false</c> otherwise</returns>
         public static bool IsContentType(string contenttype, string test)
         {
             if (string.IsNullOrWhiteSpace(contenttype))
@@ -226,15 +246,23 @@

             var firstdelim = contenttype.IndexOfAny(new char[] { ';', ' ', ',' });
             if (firstdelim < 0)
-                firstdelim = contenttype.Length - 1;
+                firstdelim = contenttype.Length;

             return string.Equals(contenttype.Substring(0, firstdelim), test, StringComparison.OrdinalIgnoreCase);
         }

 		/// <summary>
-		/// Returns a value indicating if the request is a multi-part request
-		/// </summary>
-		/// <returns><c>true</c>, if multi-part was used, <c>false</c> otherwise.</returns>
+		/// Returns a value indicating if the content type is indicating Json data
+		/// </summary>
+		/// <returns><c>true</c>, if the content type is json, <c>false</c> otherwise.</returns>
+		/// <param name="request">The request instance.</param>
+		public static bool IsJsonRequest(this IHttpRequest request)
+            => IsJsonRequest(request.ContentType);
+
+		/// <summary>
+		/// Returns a value indicating if the content type is indicating Json data
+		/// </summary>
+		/// <returns><c>true</c>, if the content type is json, <c>false</c> otherwise.</returns>
 		/// <param name="contenttype">The request contenttype to examine.</param>
 		public static bool IsJsonRequest(string contenttype)
 		{


[Test] remove unnecessary check from SystemTest

--- CodeSearcherTests/SystemTests/BookCountOfMonteCristoTests.cs
+++ CodeSearcherTests/SystemTests/BookCountOfMonteCristoTests.cs
@@ -92,7 +92,6 @@
                     }
                 }
                 Assert.That(counter, Is.EqualTo(1957));
-                Assert.That(_stream.Length, Is.EqualTo(121472));
             }
         }
         #endregion


Changed welcome message

Changed welcome message

--- Coop_Listing_Site/Coop_Listing_Site/Views/Login/Index.cshtml
+++ Coop_Listing_Site/Coop_Listing_Site/Views/Login/Index.cshtml
@@ -5,8 +5,8 @@
     Layout = "~/Views/Shared/_Layout.cshtml";
 }

-
Welcome to the Lane Community College Co-op Listing website

-
The Lane Community College Co-op Portal

+
Welcome to the Lane Community College Co-op Portal

+
This is the hub for all co-op opportunities

Login


Refactored PopulateCheckboxList and PopulateSelectListItems method

--- CmsEngine/Services/Service.cs
+++ CmsEngine/Services/Service.cs
@@ -288,40 +288,32 @@

         private IEnumerable<CheckboxEditModel> PopulateCheckboxList<T>(IEnumerable<string> selectedItems = null) where T : BaseModel
         {
-            var itemList = _unitOfWork.GetRepository<T>().GetReadOnly(q => q.IsDeleted == false);
-            var checkBoxList = new List<CheckboxEditModel>();
-
-            foreach (var item in itemList)
-            {
-                checkBoxList.Add(new CheckboxEditModel
-                {
-                    Label = item.GetType().GetProperty("Name").GetValue(item).ToString(),
-                    Value = item.VanityId.ToString(),
-                    Enabled = true,
-                    Selected = (selectedItems == null ? false : selectedItems.Contains(item.VanityId.ToString()))
-                });
-            }
+            var checkBoxList = _unitOfWork.GetRepository<T>()
+                                          .GetReadOnly(q => q.IsDeleted == false)
+                                          .Select(x => new CheckboxEditModel
+                                          {
+                                              Label = x.GetType().GetProperty("Name").GetValue(x).ToString(),
+                                              Value = x.VanityId.ToString(),
+                                              Enabled = true,
+                                              Selected = (selectedItems?.Contains(x.VanityId.ToString()) ?? false)
+                                          });

             return checkBoxList.OrderBy(o => o.Label);
         }

         private IEnumerable<SelectListItem> PopulateSelectListItems<T>(IEnumerable<string> selectedItems = null) where T : BaseModel
         {
-            var itemList = _unitOfWork.GetRepository<T>().GetReadOnly(q => q.IsDeleted == false);
-            var selectListItems = new List<SelectListItem>();
-
-            foreach (var item in itemList)
-            {
-                selectListItems.Add(new SelectListItem
-                {
-                    Text = item.GetType().GetProperty("Name").GetValue(item).ToString(),
-                    Value = item.VanityId.ToString(),
-                    Disabled = false,
-                    Selected = (selectedItems == null ? false : selectedItems.Contains(item.VanityId.ToString()))
-                });
-            }
-
-            return selectListItems;
+            var selectListItems = _unitOfWork.GetRepository<T>()
+                                      .GetReadOnly(q => q.IsDeleted == false)
+                                      .Select(x => new SelectListItem
+                                      {
+                                          Text = x.GetType().GetProperty("Name").GetValue(x).ToString(),
+                                          Value = x.VanityId.ToString(),
+                                          Disabled = false,
+                                          Selected = (selectedItems?.Contains(x.VanityId.ToString()) ?? false)
+                                      });
+
+            return selectListItems.OrderBy(o => o.Text);
         }

         private IEnumerable<T> GetAllReadOnly<T>(int count = 0) where T : BaseModel


Oops! Make sure we await within the using that disposes the stream, or it will get disposed before the awaitable code gets done :D

--- Code/IPFilter/Cli/FileNode.cs
+++ Code/IPFilter/Cli/FileNode.cs
@@ -17,11 +17,11 @@

         public string FullName => file.FullName;

-        internal Task<DataFormat> DetectFormat()
+        internal async Task<DataFormat> DetectFormat()
         {
             using (var stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.Read))
             {
-                return FormatDetector.DetectFormat(stream);
+                return await FormatDetector.DetectFormat(stream);
             }
         }


Reordered usings

Reordered usings

--- ConsoleInteraction/Program.cs
+++ ConsoleInteraction/Program.cs
@@ -1,15 +1,15 @@
 using System;
+using System.Text;
+using System.Net.Http;
+using System.Resources;
 using System.Diagnostics;
-using System.Net.Http;
+using System.Globalization;
 using AngleSharp;
+using AngleSharp.Css;
 using AngleSharp.DOM.Html;
-using AngleSharp.DOM.Collections;
-using AngleSharp.Css;
-using System.Text;
 using AngleSharp.DOM.Css;
 using AngleSharp.DOM.Xml;
-using System.Resources;
-using System.Globalization;
+using AngleSharp.DOM.Collections;
 using ConsoleInteraction.Assets;
 using AngleSharp.Html;
 using System.Threading.Tasks;


Add test skipping for 0.5.2

Add test skipping for 0.5.2

--- Consul.Test/CoordinateTest.cs
+++ Consul.Test/CoordinateTest.cs
@@ -11,6 +11,13 @@
         {
             var client = new Client();

+            var info = client.Agent.Self();
+
+            if (!info.Response.ContainsKey("Coord"))
+            {
+                Assert.Inconclusive("This version of Consul does not support the coordinate API");
+            }
+
             var datacenters = client.Coordinate.Datacenters();

             Assert.IsNotNull(datacenters.Response);
@@ -22,6 +29,13 @@
         {
             var client = new Client();

+            var info = client.Agent.Self();
+
+            if (!info.Response.ContainsKey("Coord"))
+            {
+                Assert.Inconclusive("This version of Consul does not support the coordinate API");
+            }
+
             var nodes = client.Coordinate.Nodes();

             Assert.IsNotNull(nodes.Response);


Fix PropertyBridge not updating properly

--- Core/Bridge/PropertyBridge.cs
+++ Core/Bridge/PropertyBridge.cs
@@ -8,25 +8,25 @@

         public static string GenerateScript(Environment environment){
             string Bool(bool value){
-                return value ? "true," : "false,";
+                return value ? "true;" : "false;";
             }

-            StringBuilder build = new StringBuilder().Append("window.$TDX={");
+            StringBuilder build = new StringBuilder().Append("(function(x){");

-            build.Append("expandLinksOnHover:").Append(Bool(Program.UserConfig.ExpandLinksOnHover));
+            build.Append("x.expandLinksOnHover=").Append(Bool(Program.UserConfig.ExpandLinksOnHover));

             if (environment == Environment.Browser){
-                build.Append("switchAccountSelectors:").Append(Bool(Program.UserConfig.SwitchAccountSelectors));
-                build.Append("muteNotifications:").Append(Bool(Program.UserConfig.MuteNotifications));
-                build.Append("hasCustomNotificationSound:").Append(Bool(Program.UserConfig.NotificationSoundPath.Length > 0));
-                build.Append("notificationMediaPreviews:").Append(Bool(Program.UserConfig.NotificationMediaPreviews));
+                build.Append("x.switchAccountSelectors=").Append(Bool(Program.UserConfig.SwitchAccountSelectors));
+                build.Append("x.muteNotifications=").Append(Bool(Program.UserConfig.MuteNotifications));
+                build.Append("x.hasCustomNotificationSound=").Append(Bool(Program.UserConfig.NotificationSoundPath.Length > 0));
+                build.Append("x.notificationMediaPreviews=").Append(Bool(Program.UserConfig.NotificationMediaPreviews));
             }

             if (environment == Environment.Notification){
-                build.Append("skipOnLinkClick:").Append(Bool(Program.UserConfig.NotificationSkipOnLinkClick));
+                build.Append("x.skipOnLinkClick=").Append(Bool(Program.UserConfig.NotificationSkipOnLinkClick));
             }

-            return build.Append("}").ToString();
+            return build.Append("})(window.$TDX=window.$TDX||{})").ToString();
         }
     }
 }


Make sure the settings are loaded before trying to reconnect.

--- DMPServerListReporter/Main.cs
+++ DMPServerListReporter/Main.cs
@@ -28,12 +28,14 @@
         //Last message send time
         private long lastMessageSendTime = long.MinValue;
         //Whether we are connected to the reporting server
+        private bool loadedSettings;
         private bool connectedStatus;
         //Actual TCP connection
         private TcpClient connection;
         //Uses explicit threads - The async methods whack out for some people in some rare cases it seems.
         //Plus, we can explicitly terminate the thread to kill the connection upon shutdown.
         private Thread connectThread;
+        private Thread loadThread;
         private Thread sendThread;
         private AutoResetEvent sendEvent = new AutoResetEvent(false);
         private Queue<byte[]> sendMessages = new Queue<byte[]>();
@@ -44,7 +46,17 @@

         public Main()
         {
-            LoadSettings();
+            loadThread = new Thread(new ThreadStart(LoadSettings));
+            loadThread.Start();
+            CommandHandler.RegisterCommand("reloadreporter", ReloadSettings, "Reload the reporting plugin settings");
+        }
+
+        private void ReloadSettings(string args)
+        {
+            loadedSettings = false;
+            DisconnectFromServer();
+            loadThread = new Thread(new ThreadStart(LoadSettings));
+            loadThread.Start();
         }

         private void LoadSettings()
@@ -80,113 +92,86 @@
             bool reloadSettings = false;
             using (StreamReader sr = new StreamReader(settingsFileFullPath))
             {
+                bool readingDescription = false;
                 string currentLine;

                 while ((currentLine = sr.ReadLine()) != null)
                 {
-                    try
+                    if (!readingDescription)
                     {
-                        string key = currentLine.Substring(0, currentLine.IndexOf("=")).Trim();
-                        string value = currentLine.Substring(currentLine.IndexOf("=") + 1).Trim();
-                        switch (key)
-                        {
-                            case "reporting":
-                                {
-                                    string address = value.Substring(0, value.LastIndexOf(":"));
-                                    string port = value.Substring(value.LastIndexOf(":") + 1);
-                                    IPAddress reportingIP;
-                                    int reportingPort = 0;
-                                    if (Int32.TryParse(port, out reportingPort))
+                        try
+                        {
+                            string key = currentLine.Substring(0, currentLine.IndexOf("=")).Trim();
+                            string value = currentLine.Substring(currentLine.IndexOf("=") + 1).Trim();
+                            switch (key)
+                            {
+                                case "reporting":
                                     {
-                                        if (reportingPort > 0 && reportingPort < 65535)
+                                        string address = value.Substring(0, value.LastIndexOf(":"));
+                                        string port = value.Substring(value.LastIndexOf(":") + 1);
+                                        IPAddress reportingIP;
+                                        int reportingPort = 0;
+                                        if (Int32.TryParse(port, out reportingPort))
                                         {
-                                            //Try parsing the address directly before trying a DNS lookup
-                                            if (!IPAddress.TryParse(address, out reportingIP))
+                                            if (reportingPort > 0 && reportingPort < 65535)
                                             {
-                                                IPHostEntry entry = Dns.GetHostEntry(address);
-                                                reportingIP = entry.AddressList[0];
+                                                //Try parsing the address directly before trying a DNS lookup
+                                                if (!IPAddress.TryParse(address, out reportingIP))
+                                                {
+                                                    IPHostEntry entry = Dns.GetHostEntry(address);
+                                                    reportingIP = entry.AddressList[0];
+                                                }
+                                                settingsStore.reportingEndpoint = new IPEndPoint(reportingIP, reportingPort);
                                             }
-                                            settingsStore.reportingEndpoint = new IPEndPoint(reportingIP, reportingPort);
                                         }
                                     }
-                                }
-                                break;
-                            case "gameAddress":
-                                settingsStore.gameAddress = value;
-                                break;
-                            case "banner":
-                                settingsStore.banner = value;
-                                break;
-                            case "homepage":
-                                settingsStore.homepage = value;
-                                break;
-                            case "admin":
-                                settingsStore.admin = value;
-                                break;
-                            case "team":
-                                settingsStore.team = value;
-                                break;
-                            case "location":
-                                settingsStore.location = value;
-                                break;
-                            case "fixedIP":
-                                settingsStore.fixedIP = (value == "true");
-                                break;
-                            case "description":
-                                settingsStore.description = value;
-                                break;
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        DarkLog.Error("Error reading settings file, Exception " + e);
-                    }
-                }
-            }
-            /*
-            try
-            {
-
-                string[] connectionParts = connectionAddress.Split(':');
-                string address = connectionParts[0];
-                string port = connectionParts[1];
-                IPAddress reportingIP;
-                int reportingPort;
-                //Make sure the port is correct
-                if (Int32.TryParse(port, out reportingPort))
-                {
-                    if (reportingPort > 0 && reportingPort < 65535)
-                    {
-                        //Try parsing the address directly before trying a DNS lookup
-                        if (!IPAddress.TryParse(address, out reportingIP))
-                        {
-                            IPHostEntry entry = Dns.GetHostEntry(address);
-                            reportingIP = entry.AddressList[0];
-                        }
-                        reportingEndpoint = new IPEndPoint(reportingIP, reportingPort);
+                                    break;
+                                case "gameAddress":
+                                    settingsStore.gameAddress = value;
+                                    break;
+                                case "banner":
+                                    settingsStore.banner = value;
+                                    break;
+                                case "homepage":
+                                    settingsStore.homepage = value;
+                                    break;
+                                case "admin":
+                                    settingsStore.admin = value;
+                                    break;
+                                case "team":
+                                    settingsStore.team = value;
+                                    break;
+                                case "location":
+                                    settingsStore.location = value;
+                                    break;
+                                case "fixedIP":
+                                    settingsStore.fixedIP = (value == "true");
+                                    break;
+                                case "description":
+                                    readingDescription = true;
+                                    settingsStore.description = value;
+                                    break;
+                            }
+                        }
+                        catch (Exception e)
+                        {
+                            DarkLog.Error("Error reading settings file, Exception " + e);
+                        }
                     }
                     else
                     {
-                        reloadSettings = true;
+                        //Reading description
+                        settingsStore.description += "\n" + currentLine;
                     }
-
-                }
-                else
-                {
-                    reloadSettings = true;
-                }
-            }
-            catch
-            {
-                reloadSettings = true;
-            }
-            */
+                }
+            }
             if (reloadSettings)
             {
                 //Load with the default settings if anything is incorrect.
                 File.Delete(settingsFileFullPath);
                 LoadSettings();
             }
+            loadedSettings = true;
         }

         public static string CalculateSHA256Hash(string text)
@@ -208,7 +193,7 @@

         public override void OnUpdate()
         {
-            if (!connectedStatus && (Server.serverClock.ElapsedMilliseconds > (lastConnectionTry + CONNECTION_RETRY)))
+            if (!connectedStatus && loadedSettings && Server.serverRunning && (Server.serverClock.ElapsedMilliseconds > (lastConnectionTry + CONNECTION_RETRY)))
             {
                 lastConnectionTry = Server.serverClock.ElapsedMilliseconds;
                 connectThread = new Thread(new ThreadStart(ConnectToServer));
@@ -226,6 +211,11 @@
         {
             connectedPlayers.Remove(client.playerName);
             ReportData();
+        }
+
+        public override void OnServerStop()
+        {
+            DisconnectFromServer();
         }

         private void ConnectToServer()
@@ -248,6 +238,14 @@
             {
                 DarkLog.Debug("Error connecting to reporting server: " + e);
             }
+        }
+
+        private void DisconnectFromServer()
+        {
+            lastConnectionTry = long.MinValue;
+            sendThread.Abort();
+            connection.Close();
+            connectedStatus = false;
         }

         private void SendThreadMain()


update tests

update tests

--- DQuery.UnitTests/UnitTest1.cs
+++ DQuery.UnitTests/UnitTest1.cs
@@ -11,7 +11,7 @@
     {
         private List<QueryClause> GetClauses()
         {
-            return QueryClauseParser.Parse("[{\"operator\": \"<>\",\"condition\": \"\",\"value\": \"001\",\"valueType\": \"string\",\"fieldname\": \"cuscd\"}, {\"Operator\":\"<>\",\"Condition\":\"and\",\"Value\":\"101\",\"ValueType\":\"string\",\"FieldName\":\"cuscd\",\"items\":[{\"operator\": \"<>\",\"condition\": \"\",\"value\": \"001\",\"valueType\": \"string\",\"fieldname\": \"cuscd\"},{\"operator\": \"<>\",\"condition\": \"\",\"value\": \"001\",\"valueType\": \"string\",\"fieldname\": \"cuscd\"}]}]");
+            return QueryClauseParser.Parse("[{\"operator\": \"<>\",\"condition\": \"\",\"value\": \"001\",\"valueType\": \"string\",\"fieldname\": \"cuscd\"}, {\"Operator\":\"<>\",\"Condition\":\"and\",\"Value\":\"101\",\"ValueType\":\"string\",\"FieldName\":\"cuscd\",\"items\":[{\"operator\": \"<>\",\"condition\": \"\",\"value\": \"001\",\"valueType\": \"string\",\"fieldname\": \"cuscd\"},{\"operator\": \"<>\",\"condition\": \"and\",\"value\": \"001\",\"valueType\": \"string\",\"fieldname\": \"cuscd\"}]}]");
         }

         [TestMethod]
@@ -30,7 +30,6 @@
         {
             var clauses = GetClauses();
             var lambda = ExpressionBuilder.Build<SampleEntity>(clauses, new SampleFunctions());
-
         }
     }


Bring back DarkButton hover highlight to Light

--- DarkUI/Controls/DarkButton.cs
+++ DarkUI/Controls/DarkButton.cs
@@ -335,7 +335,7 @@
             var textColor = Colors.LightText;
             var borderColor = Colors.GreySelection;
             var fillColor = _useGenericBackColor ? (_isDefault ? Colors.DarkBlueBackground : Colors.LightBackground) : BackColor;
-            var hoverColor = _useGenericBackColor ? (_isDefault ? Colors.BlueBackground : Colors.LighterBackground) : ControlPaint.Dark(BackColor);
+            var hoverColor = _useGenericBackColor ? (_isDefault ? Colors.BlueBackground : Colors.LighterBackground) : ControlPaint.Light(BackColor);

             if (Enabled)
             {


really wrap the exception so that the stacktrace information is not lost

git-svn-id: 1b52f0a7ed2a8098cb721f3b9b4408691a7bfc16@979 c93b7781-d36b-0e4d-be4f-9d94f2a838be

--- Dataphor/DAE/Server/Engine.cs
+++ Dataphor/DAE/Server/Engine.cs
@@ -620,7 +620,7 @@
 			if (FLogErrors)
 				LogError(AException);

-			return AException;
+			return new Exception("Wrapped Exception: "+AException.Message,AException);
 		}

 		#endregion


Adding missing names to Log4Net appenders

--- DefaultLog4NetConfigurator.cs
+++ DefaultLog4NetConfigurator.cs
@@ -32,11 +32,13 @@
             patternLayout.ActivateOptions();

             var debugFileAppender = BaseFileAppender(patternLayout);
+            debugFileAppender.Name = "debug-file";
             debugFileAppender.File = Path.Combine(logFilesFolderPath, "orchard-debug");
             debugFileAppender.ActivateOptions();
             hierarchy.Root.AddAppender(debugFileAppender);

             var errorFileAppender = BaseFileAppender(patternLayout);
+            errorFileAppender.Name = "error-file";
             errorFileAppender.File = Path.Combine(logFilesFolderPath, "orchard-error");
             var levelFilter = new LevelRangeFilter { LevelMin = Level.Error };
             levelFilter.ActivateOptions();
@@ -47,6 +49,7 @@
             var simpleLayout = new SimpleLayout();
             simpleLayout.ActivateOptions();
             var debuggerAppender = new DebugAppender();
+            debuggerAppender.Name = "debugger";
             debuggerAppender.ImmediateFlush = true;
             debuggerAppender.Layout = simpleLayout;
             debuggerAppender.ActivateOptions();


Cleanup

Cleanup

--- Derby/Views/Pack/Index.cshtml
+++ Derby/Views/Pack/Index.cshtml
@@ -51,7 +51,6 @@
             {
                 @Html.ActionLink("Details", "Details", new {id = pack.Id}, new {@class = "btn btn-xs btn-default"})

-
                 if (pack.Membership.AccessLevel == OwnershipType.Owner || pack.Membership.AccessLevel == OwnershipType.Contributor)
                 {
                     @: |
@@ -59,8 +58,6 @@
                     @: |
                     @Html.ActionLink("New Competition", "create", "Competition", new { packId = pack.Id }, new { @class = "btn btn-xs btn-info" })
                 }
-
-
             }
         </td>
     </tr>


fix typo

fix typo

--- hybrasyl/Scripting/HybrasylUser.cs
+++ hybrasyl/Scripting/HybrasylUser.cs
@@ -717,7 +717,7 @@
         public bool GiveItem(HybrasylWorldObject obj)
         {
             if (obj.Obj is ItemObject io)
-                return User.AddItem((io.Name, 1);
+                return User.AddItem(io.Name, 1);
             else
             {
                 GameLog.ScriptingError("GiveItem: {user} - object (first argument) was either null, or not an item", User.Name);


Fix signatures and remove default .ctor from NSPropertyListSerialization

--- src/foundation.cs
+++ src/foundation.cs
@@ -6218,6 +6218,7 @@
 	}

 	[BaseType (typeof(NSObject))]
+	[DisableDefaultCtor]
 	public interface NSPropertyListSerialization {
 		[Static, Export ("dataWithPropertyList:format:options:error:")]
 		NSData DataWithPropertyList (NSObject plist, NSPropertyListFormat format,
@@ -6229,11 +6230,11 @@

 		[Static, Export ("propertyListWithData:options:format:error:")]
 		NSObject PropertyListWithData (NSData data, NSPropertyListReadOptions options,
-			NSPropertyListFormat format, out NSError error);
+			ref NSPropertyListFormat format, out NSError error);

 		[Static, Export ("propertyListWithStream:options:format:error:")]
 		NSObject PropertyListWithStream (NSInputStream stream, NSPropertyListReadOptions options,
-			NSPropertyListFormat format, out NSError error);
+			ref NSPropertyListFormat format, out NSError error);

 		[Static, Export ("propertyList:isValidForFormat:")]
 		bool IsValidForFormat (NSObject plist, NSPropertyListFormat format);


Update Itrash.cs

Update Itrash.cs

--- hw-control/Itrash.cs
+++ hw-control/Itrash.cs
@@ -80,11 +80,6 @@
                 input = Console.ReadLine();
             }

-            /*for (int i = 0; i < ifKit.outputs.Count; i++)
-            {
-                ifKit.outputs[i] = false;
-            }*/
-
             Thread.Sleep(SLEEP_TIME_MS);
             closeCanOnExit();
             Thread.Sleep(SLEEP_TIME_MS);
@@ -201,11 +196,6 @@
             }

             // Clean up
-            /*ifKit.outputs[LED_GREEN] = true;
-            ifKit.outputs[LED_RED] = false;
-            ifKit.outputs[LED_PAPER] = true;
-            ifKit.outputs[LED_PET] = false;
-            ifKit.outputs[LED_BURN] = true;*/
             updateTrashLEDs(ifKit.sensors[SENSOR_ROTATION_ID].Value);
             servo.servos[0].Position = SERVO_START_POS;
         }


Adding GA tracking script

Adding GA tracking script

--- input/_Bottom.cshtml
+++ input/_Bottom.cshtml
@@ -5,3 +5,15 @@
     };
 </script>
 <script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
+
+<!-- Google Analytics -->
+<script>
+    (function (i, s, o, g, r, a, m) {
+        i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
+            (i[r].q = i[r].q || []).push(arguments)
+        }, i[r].l = 1 * new Date(); a = s.createElement(o),
+            m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
+    })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
+    ga('create', 'UA-60516413-1', 'auto');
+    ga('send', 'pageview');
+</script>


Fixed meld foward bug

Fixed meld foward bug

Fixed a bug where an update wouldn't meld correctly.

--- ioSS/CDataArray3D.cs
+++ ioSS/CDataArray3D.cs
@@ -422,8 +422,8 @@

                 CompData frontStrip = new CompData(workBlock.Data, workBlock.count - 1);

+                DataBlock[dataIndex] = newStrip;
                 DataBlock.Insert(dataIndex, frontStrip);
-                DataBlock[dataIndex] = newStrip;
                 Meld(dataIndex, MeldDir.Back);

                 return true;


Fix test failure due to uninitialised drawable hit object

--- osu.Game.Rulesets.Taiko.Tests/TestSceneHits.cs
+++ osu.Game.Rulesets.Taiko.Tests/TestSceneHits.cs
@@ -174,7 +174,9 @@

         private void addMissJudgement()
         {
-            ((TaikoPlayfield)drawableRuleset.Playfield).OnNewResult(new DrawableTestHit(new Hit()), new JudgementResult(new HitObject(), new TaikoJudgement()) { Type = HitResult.Miss });
+            DrawableTestHit h;
+            Add(h = new DrawableTestHit(new Hit(), HitResult.Miss));
+            ((TaikoPlayfield)drawableRuleset.Playfield).OnNewResult(h, new JudgementResult(new HitObject(), new TaikoJudgement()) { Type = HitResult.Miss });
         }

         private void addBarLine(bool major, double delay = scroll_time)


Disable Hidden mod for osu!taiko (until it is implemented) (#5201)

Disable Hidden mod for osu!taiko (until it is implemented)

--- osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs
+++ osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs
@@ -9,5 +9,6 @@
     {
         public override string Description => @"Beats fade out before you hit them!";
         public override double ScoreMultiplier => 1.06;
+        public override bool HasImplementation => false;
     }
 }


make it only look for files instead of directories

--- osu.Game/Beatmaps/IO/LegacyFilesystemReader.cs
+++ osu.Game/Beatmaps/IO/LegacyFilesystemReader.cs
@@ -26,7 +26,7 @@
             // no-op
         }

-        public override IEnumerable<string> Filenames => Directory.GetDirectories(path).Select(Path.GetFileName).ToArray();
+        public override IEnumerable<string> Filenames => Directory.GetFiles(path, "*", SearchOption.AllDirectories).Select(Path.GetFileName).ToArray();

         public override Stream GetUnderlyingStream() => null;
     }


Revert unintended change

Revert unintended change

--- osu.Game/IO/Serialization/IJsonSerializable.cs
+++ osu.Game/IO/Serialization/IJsonSerializable.cs
@@ -16,7 +16,7 @@

         public static T Deserialize<T>(this string objString) => JsonConvert.DeserializeObject<T>(objString, CreateGlobalSettings());

-        public static void DeserializeInto<T>(this string objString, T target) => JsonConvert.DeserializeAnonymousType(objString, target, CreateGlobalSettings());
+        public static void DeserializeInto<T>(this string objString, T target) => JsonConvert.PopulateObject(objString, target, CreateGlobalSettings());

         public static T DeepClone<T>(this T obj) where T : IJsonSerializable => Deserialize<T>(Serialize(obj));


Rename EntityStructBuilder to EntityViewStructBuilder

--- Svelto.ECS/ECS/EntityViewBuilder.cs
+++ Svelto.ECS/ECS/EntityViewBuilder.cs
@@ -54,19 +54,19 @@
         readonly Type _entityViewType = typeof(EntityViewType);
     }

-    public class EntityStructBuilder<EntityViewType> : IEntityViewBuilder where EntityViewType : struct, IEntityStruct
+    public class EntityViewStructBuilder<EntityViewType> : IEntityViewBuilder where EntityViewType : struct, IEntityStruct
     {
         public void BuildEntityViewAndAddToList(ref ITypeSafeList list, int entityID, out IEntityView entityView)
         {
-            var lentityView = default(EntityViewType);
-            lentityView.ID = entityID;
+            var structEntityView = default(EntityViewType);
+            structEntityView.ID = entityID;

             if (list == null)
                 list = new TypeSafeFasterListForECSForStructs<EntityViewType>();

             var castedList = list as TypeSafeFasterListForECSForStructs<EntityViewType>;

-            castedList.Add(lentityView);
+            castedList.Add(structEntityView);

             entityView = null;
         }


CP-36392: Avoid multiple enumerations in `LicenseStatus.cs`

Signed-off-by: Danilo Del Busso <766dc0f994b57f2d2e98930ecfa5ee8fb1091a62@citrix.com>

--- XenAdmin/Dialogs/LicenseManager/LicenseStatus.cs
+++ XenAdmin/Dialogs/LicenseManager/LicenseStatus.cs
@@ -207,13 +207,13 @@
                 if (freeCount == 0 || freeCount < xenObject.Connection.Cache.Hosts.Length)
                     return false;

-                var expiryGroups = from Host h in xenObject.Connection.Cache.Hosts
+                var expiryGroups = (from Host h in xenObject.Connection.Cache.Hosts
                                    let exp = h.LicenseExpiryUTC()
                                    group h by exp
                                    into g
-                                   select new { ExpiryDate = g.Key, Hosts = g };
-
-                if (expiryGroups.Count() > 1)
+                                   select new { ExpiryDate = g.Key, Hosts = g }).ToList();
+
+                if (expiryGroups.Count > 1)
                 {
                     expiryGroups = expiryGroups.OrderBy(g => g.ExpiryDate).ToList();
                     if ((expiryGroups.ElementAt(1).ExpiryDate - expiryGroups.ElementAt(0).ExpiryDate).TotalDays > 30)


Add translations for statistics

Add translations for statistics

--- MyFavoriteQuotes/FormMain.cs
+++ MyFavoriteQuotes/FormMain.cs
@@ -1921,12 +1921,14 @@
       textBoxStatQuotes.Text += $"{totalQuotes}{Punctuation.OneSpace}{Translate("quote")}{Punctuation.Plural(totalQuotes)}{Punctuation.OneSpace}{Translate("in total")}{Environment.NewLine}";

       int frenchQuotes = GetQuotesByLanguage(Language.French).Count();
-      textBoxStatQuotes.Text += $"{frenchQuotes}{Punctuation.OneSpace}{Translate("quote")}{Punctuation.Plural(frenchQuotes)}{Punctuation.OneSpace}in French{Environment.NewLine}";
+      textBoxStatQuotes.Text += $"{frenchQuotes}{Punctuation.OneSpace}{Translate("quote")}{Punctuation.Plural(frenchQuotes)}{Punctuation.OneSpace}{Translate("in French")}{Environment.NewLine}";

       int englishQuotes = GetQuotesByLanguage().Count();
-      textBoxStatQuotes.Text +=
-        $"{englishQuotes} quote{Punctuation.Plural(englishQuotes)} in English{Environment.NewLine}";
-      AddLine(dashLine);
+      textBoxStatQuotes.Text += $"{englishQuotes}{Punctuation.OneSpace}{Translate("quote")}{Punctuation.Plural(englishQuotes)}{Punctuation.OneSpace}{Translate("in English")}{Environment.NewLine}";
+
+      int tmpLenght = $"{englishQuotes}{Punctuation.OneSpace}{Translate("quote")}{Punctuation.Plural(englishQuotes)}{Punctuation.OneSpace}{Translate("in English")}{Environment.NewLine}".Length;
+      CreateDashLine(tmpLenght);
+
       Dictionary <string, int> allQuotes = GetQuotesByAuthor(Language.All);
       IEnumerable<Quote> tmpQuotes = GetDuplicateQuotes(_allQuotes.ToList());
       if (tmpQuotes.Count() != 0)


Add code for combobox List change item

Add code for combobox List change item

--- MyFavoriteQuotes/FormMain.cs
+++ MyFavoriteQuotes/FormMain.cs
@@ -944,9 +944,19 @@

     private void DisplayQuotes(string author)
     {
-      IEnumerable<Quote> result3 = from node in AllQuotes.ToList()
-                                   where node.Author == author
-                                   select node;
+      IEnumerable<Quote> result3;
+      if (author.ToLower() == "all")
+      {
+        result3 = from node in AllQuotes.ToList()
+                  select node;
+      }
+      else
+      {
+        result3 = from node in AllQuotes.ToList()
+                                     where node.Author == author
+                                     select node;
+      }
+
       textBoxListQuotes.Text = string.Empty;
       foreach (var quote in result3)
       {
@@ -986,6 +996,7 @@

       textBoxListQuotes.Text = string.Empty;
       comboBoxListAuthor.Items.Clear();
+      comboBoxListAuthor.Items.Add("All");
       foreach (var quote in result3)
       {
         textBoxListQuotes.Text += quote.Sentence + " - " + quote.Author + Environment.NewLine;


(TFS CS 4284)

(TFS CS 4284)

--- Signum.Utilities/StringExtensions.cs
+++ Signum.Utilities/StringExtensions.cs
@@ -273,8 +273,9 @@

         public static string SpacePascal(this string pascalStr, bool preserveUppercase)
         {
+
             StringBuilder sb = new StringBuilder();
-            if (pascalStr.Length > 1)
+            if (pascalStr.Length > 0)
                 sb.Append(pascalStr[0]);

             for (int i = 1; i < pascalStr.Length; i++)


Weather: HERE: tryParse some values in Condition

--- SimpleWeather/WeatherData/Weather.cs
+++ SimpleWeather/WeatherData/Weather.cs
@@ -19,7 +19,7 @@

         [TextBlob(nameof(locationblob))]
         public Location location { get; set; }
-        [Ignore]
+        [Ignore]
         // Doesn't store this in db
         // For DateTimeOffset, offset isn't stored when saving to db
         // Store as string (blob) instead
@@ -1512,13 +1512,43 @@
         public Condition(HERE.Observation observation)
         {
             weather = observation.description.ToPascalCase();
-            temp_f = float.Parse(observation.temperature);
-            temp_c = float.Parse(ConversionMethods.FtoC(observation.temperature));
-            wind_degrees = int.Parse(observation.windDirection);
-            wind_mph = float.Parse(observation.windSpeed);
-            wind_kph = float.Parse(ConversionMethods.MphToKph(observation.windSpeed));
-            feelslike_f = float.Parse(observation.comfort);
-            feelslike_c = float.Parse(ConversionMethods.FtoC(observation.comfort));
+            if (float.TryParse(observation.temperature, out float tempF))
+            {
+                temp_f = tempF;
+                temp_c = float.Parse(ConversionMethods.FtoC(tempF.ToString()));
+            }
+            else
+            {
+                temp_f = 0.00f;
+                temp_c = 0.00f;
+            }
+
+            if (int.TryParse(observation.windDirection, out int windDegrees))
+                wind_degrees = windDegrees;
+            else
+                wind_degrees = 0;
+
+            if (float.TryParse(observation.windSpeed, out float wind_Speed))
+            {
+                wind_mph = wind_Speed;
+                wind_kph = float.Parse(ConversionMethods.MphToKph(observation.windSpeed));
+            }
+            else
+            {
+                wind_mph = 0.00f;
+                wind_kph = 0.00f;
+            }
+
+            if (float.TryParse(observation.comfort, out float comfortTempF))
+            {
+                feelslike_f = comfortTempF;
+                feelslike_c = float.Parse(ConversionMethods.FtoC(comfortTempF.ToString()));
+            }
+            else
+            {
+                feelslike_f = 0.00f;
+                feelslike_c = 0.00f;
+            }
             icon = WeatherManager.GetProvider(WeatherAPI.Here)
                    .GetWeatherIcon(string.Format("{0}_{1}", observation.daylight, observation.iconName));
         }


Follow the style set in TMDbClientMovies/GetMovie

--- TMDbLib/Client/TMDbClientTvShows.cs
+++ TMDbLib/Client/TMDbClientTvShows.cs
@@ -40,12 +40,13 @@

             IRestResponse<TvShow> response = _client.Get<TvShow>(req);

-            // Patch up response with id's
-            if (response.Data != null)
-            {
-                if (response.Data.Translations != null)
-                    response.Data.Translations.Id = id;
-            }
+            // No data to patch up so return
+            if (response.Data == null)
+                return null;
+
+            // Patch up data, so that the end user won't notice that we share objects between request-types.
+            if (response.Data.Translations != null)
+                response.Data.Translations.Id = id;

             return response.Data;
         }


whitespace

whitespace

--- NJasmine.Tests/SampleTest.cs
+++ NJasmine.Tests/SampleTest.cs
@@ -20,7 +20,9 @@
     forEach(delegate()
     {
         return new Song[] {new Song(), new OggSong(), new Mp3Song()};
-    }, delegate(Song song) {
+    },
+    delegate(Song song)
+    {

         it("should be able to play a song", delegate()
         {


Delete TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs


Updated String.replace

Updated String.replace

--- NiL.JS/BaseLibrary/String.cs
+++ NiL.JS/BaseLibrary/String.cs
@@ -409,77 +409,79 @@
         {
             if (args == null || args.length == 0)
                 return self;
-            if ((args[0] ?? @null)._valueType == JSValueType.Object
-                && (args[0] ?? @null).Value != null
-                && args[0].Value.GetType() == typeof(RegExp))
-            {
-                var f = args[1]._oValue as Function;
-                if (args.length > 1 && f != null)
-                {
-                    string temp = self._oValue.ToString();
+
+            var a0 = args[0];
+            var regex = a0?.Value as RegExp;
+
+            var a1 = args[1];
+            var f = a1?.Value as Function;
+
+            var selfStr = self.ToString();
+
+            if (regex != null)
+            {
+                var re = regex._regex;
+                if (f != null)
+                {
+                    var str = new String(selfStr);
                     var match = new String();
-                    var margs = new Arguments();
-                    match._oValue = (args[0]._oValue as RegExp)._Regex.Replace(self.ToString(),
+                    var fArgs = new Arguments();
+                    return re.Replace(
+                        selfStr,
                         (m) =>
                         {
-                            self._oValue = temp;
-                            self._valueType = JSValueType.String;
-                            margs.length = m.Groups.Count + 2;
-
-                            JSValue t;
+                            str._oValue = selfStr;
+                            str._valueType = JSValueType.String;
+                            match._oValue = m.Value;
+                            match._valueType = JSValueType.String;
+
+                            fArgs.length = m.Groups.Count + 2;
+                            fArgs[0] = match;
+
                             for (int i = 1; i < m.Groups.Count; i++)
-                            {
-                                t = m.Groups[i].Value;
-                                margs[i] = t;
-                            }
-
-                            t = m.Index;
-                            match._oValue = m.Value;
-                            margs[0] = match;
-                            margs[margs.length - 2] = t;
-                            margs[margs.length - 1] = self;
-
-                            return f.Call(margs).ToString();
-                        }, (args[0].Value as RegExp)._global ? int.MaxValue : 1);
-                    self._oValue = temp;
-                    self._valueType = JSValueType.String;
-                    return match;
+                                fArgs[i] = m.Groups[i].Value;
+
+                            fArgs[fArgs.length - 2] = m.Index;
+                            fArgs[fArgs.length - 1] = str;
+
+                            return f.Call(fArgs).ToString();
+                        },
+                        regex._global ? int.MaxValue : 1);
                 }
                 else
                 {
-                    return (args[0].Value as RegExp)._Regex.Replace(self.ToString(), args.Length > 1 ? args[1].ToString() : "undefined", (args[0].Value as RegExp)._global ? int.MaxValue : 1);
+                    string replacement = args.Length > 1 ? (a1 ?? "").ToString() : "undefined";
+                    return re.Replace(selfStr, replacement, regex._global ? int.MaxValue : 1);
                 }
             }
             else
             {
-                string pattern = args.Length > 0 ? args[0].ToString() : "";
-                var f = args[1]._oValue as Function;
-                if (args.Length > 1 && f != null)
-                {
-                    string othis = self._oValue.ToString();
-                    var margs = new Arguments();
-                    margs.length = 3;
-                    margs[0] = pattern;
-                    margs[2] = self;
-                    int index = self.ToString().IndexOf(pattern);
+                string pattern = (a0 ?? "").ToString();
+                if (f != null)
+                {
+                    int index = selfStr.IndexOf(pattern);
                     if (index == -1)
-                        return self;
-                    margs[1] = index;
-                    var res = othis.Substring(0, index) + f.Call(margs).ToString() + othis.Substring(index + pattern.Length);
-                    self._oValue = othis;
-                    self._valueType = JSValueType.String;
-                    return res;
+                        return selfStr;
+
+                    var fArgs = new Arguments();
+                    fArgs.length = 3;
+                    fArgs[0] = pattern;
+                    fArgs[1] = index;
+                    fArgs[2] = self;
+
+                    return selfStr.Substring(0, index) + f.Call(fArgs).ToString() + selfStr.Substring(index + pattern.Length);
                 }
                 else
                 {
-                    string replace = args.Length > 1 ? args[1].ToString() : "undefined";
-                    if (string.IsNullOrEmpty(pattern))
-                        return replace + self;
-                    var str = self.ToString();
-                    var index = str.IndexOf(pattern);
+                    string replacement = args.Length > 1 ? (a1 ?? "").ToString() : "undefined";
+                    if (pattern.Length == 0)
+                        return replacement + selfStr;
+
+                    var index = selfStr.IndexOf(pattern);
                     if (index == -1)
-                        return self;
-                    return str.Substring(0, index) + replace + str.Substring(index + pattern.Length);
+                        return selfStr;
+
+                    return selfStr.Substring(0, index) + replacement + selfStr.Substring(index + pattern.Length);
                 }
             }
         }


Better support for cancellation during work item transformation

--- TeamProjectManager.Modules.WorkItemConfiguration/WorkItemConfigurationTransformationViewModel.cs
+++ TeamProjectManager.Modules.WorkItemConfiguration/WorkItemConfigurationTransformationViewModel.cs
@@ -377,10 +377,18 @@
                             {
                                 throw new ArgumentException("The Work Item Configuration Item Type is unknown: " + transformation.WorkItemConfigurationItemType.ToString());
                             }
+                            if (task.IsCanceled)
+                            {
+                                break;
+                            }
                         }

                         // Only apply the transformations if they all succeeded (i.e. there was no exception).
-                        if (simulate)
+                        if (task.IsCanceled)
+                        {
+                            break;
+                        }
+                        else if (simulate)
                         {
                             foreach (var transformedItem in transformedItems)
                             {


IniReader: Added IDisposable implementation for proper disposal of resources. Dispose: IDisposable implementation methods. IniReader: Now calls Dispose method.

--- Nini/Source/Ini/IniReader.cs
+++ Nini/Source/Ini/IniReader.cs
@@ -15,6 +15,7 @@

 namespace Nini.Ini
 {
+	#region IniReadState enumeration
 	/// <include file='IniReader.xml' path='//Enum[@name="IniReadState"]/docs/*' />
 	public enum IniReadState : int
 	{
@@ -29,7 +30,9 @@
 		/// <include file='IniReader.xml' path='//Enum[@name="IniReadState"]/Value[@name="Interactive"]/docs/*' />
 		Interactive
 	};
-
+	#endregion
+
+	#region IniType enumeration
 	/// <include file='IniReader.xml' path='//Enum[@name="IniType"]/docs/*' />
 	public enum IniType : int
 	{
@@ -40,9 +43,10 @@
 		/// <include file='IniReader.xml' path='//Enum[@name="IniType"]/Value[@name="Empty"]/docs/*' />
 		Empty
 	}
+	#endregion

 	/// <include file='IniReader.xml' path='//Class[@name="IniReader"]/docs/*' />
-	public class IniReader
+	public class IniReader : IDisposable
 	{
 		#region Private variables
 		int lineNumber = 1;
@@ -57,6 +61,7 @@
 		Hashtable keyList = new Hashtable ();
 		Hashtable sectionList = new Hashtable ();
 		bool hasComment = false;
+		bool disposed = false;
 		#endregion

 		#region Public properties
@@ -193,15 +198,36 @@
 				textReader.Close ();
 			}
 		}
+
+		/// <include file='IniReader.xml' path='//Method[@name="Dispose"]/docs/*' />
+		public void Dispose ()
+		{
+			Dispose (true);
+		}
 		#endregion

+		#region Protected methods
+		/// <include file='IniReader.xml' path='//Method[@name="DisposeBoolean"]/docs/*' />
+		protected virtual void Dispose (bool disposing)
+		{
+			if (!disposed) {
+				textReader.Close ();
+				disposed = true;
+
+				if (disposing) {
+					GC.SuppressFinalize (this);
+				}
+			}
+		}
+		#endregion
+
 		#region Private methods
 		/// <summary>
 		/// Destructor.
 		/// </summary>
 		~IniReader ()
 		{
-			Close ();
+			Dispose (false);
 		}

 		/// <summary>


Don't remove the socket from the clients list on detatch

--- NotLiteCode/Server/Server.cs
+++ NotLiteCode/Server/Server.cs
@@ -101,8 +101,6 @@
       Socket.OnNetworkClientDisconnected -= NetworkClientDisconnected;
       Socket.OnNetworkExceptionOccurred -= NetworkExceptionOccurred;
       Socket.OnNetworkMessageReceived -= BeingReceiveMessage;
-
-      Clients.Remove(Socket.BaseSocket.RemoteEndPoint);
     }

     private void BeingReceiveMessage(object sender, OnNetworkMessageReceivedEventArgs e)


git-svn-id: 21cdf44b51306c1f0753fc51e774ecf5fc1851ba@1085 a61f9e97-bd4c-0410-8c65-85b29eaa70ff

--- Dorian/Examples/Test_TextureArray/Program.cs
+++ Dorian/Examples/Test_TextureArray/Program.cs
@@ -148,7 +148,7 @@
 			_text.Angle = 45.0f;
 			_text.Anchor = new Vector2(_text.Size.X / 2.0f, _text.Size.Y / 2.0f);

-            GorgonAnimationClip anim = _sprite.CreateAnimation("Position", 3000.0f);
+            GorgonAnimation anim = _sprite.CreateAnimation("Position", 3000.0f);

             _sprite.Position = new Vector2(_swap.Settings.Width / 2.0f, _swap.Settings.Height / 2.0f);


Fix 'help --include' and 'help --exclude' - these shouldn't throw a null reference exception due to the value being null.

--- Duplicati/Library/Utility/FilterCollector.cs
+++ Duplicati/Library/Utility/FilterCollector.cs
@@ -41,12 +41,19 @@
             return Library.Utility.CommandLineParser.ExtractOptions(args, (key, value) => {
                 if (key.Equals("include", StringComparison.InvariantCultureIgnoreCase))
                 {
-                    m_filters.Add(new Library.Utility.FilterExpression(Library.Utility.Utility.ExpandEnvironmentVariables(value), true));
-                    return false;
+                    if (!string.IsNullOrEmpty(value))
+                    {
+                        m_filters.Add(new Library.Utility.FilterExpression(Library.Utility.Utility.ExpandEnvironmentVariables(value), true));
+                        return false;
+                    }
                 }
                 else if (key.Equals("exclude", StringComparison.InvariantCultureIgnoreCase))
                 {
-                    m_filters.Add(new Library.Utility.FilterExpression(Library.Utility.Utility.ExpandEnvironmentVariables(value), false));
+                    if (!string.IsNullOrEmpty(value))
+                    {
+                        m_filters.Add(new Library.Utility.FilterExpression(Library.Utility.Utility.ExpandEnvironmentVariables(value), false));
+                        return false;
+                    }
                     return false;
                 }

@@ -56,12 +63,12 @@
                 return true;
             });
         }
-
+
         public static Tuple<Dictionary<string, string>, Library.Utility.IFilter> ExtractOptions(List<string> args, Func<string, string, bool> callbackHandler = null)
         {
             var fc = new FilterCollector();
             var opts = fc.DoExtractOptions(args, callbackHandler);
             return new Tuple<Dictionary<string, string>, Library.Utility.IFilter>(opts, fc.Filter);
         }
-    }}
-
+    }
+}


Renamed _mCopyUri to _CopyUri for private fields

--- Edi/SimpleControls/Hyperlink/WebHyperlink.cs
+++ Edi/SimpleControls/Hyperlink/WebHyperlink.cs
@@ -21,7 +21,7 @@
         private static readonly DependencyProperty TextProperty =
           DependencyProperty.Register("Text", typeof(string), typeof(WebHyperlink));

-        private static readonly RoutedCommand _mCopyUri;
+        private static readonly RoutedCommand _CopyUri;
         private static readonly RoutedCommand _mNavigateToUri;

         private System.Windows.Documents.Hyperlink _mHypLink;
@@ -33,10 +33,10 @@
             DefaultStyleKeyProperty.OverrideMetadata(typeof(WebHyperlink),
                       new FrameworkPropertyMetadata(typeof(WebHyperlink)));

-            _mCopyUri = new RoutedCommand("CopyUri", typeof(WebHyperlink));
+            _CopyUri = new RoutedCommand("CopyUri", typeof(WebHyperlink));

-            CommandManager.RegisterClassCommandBinding(typeof(WebHyperlink), new CommandBinding(_mCopyUri, CopyHyperlinkUri));
-            CommandManager.RegisterClassInputBinding(typeof(WebHyperlink), new InputBinding(_mCopyUri, new KeyGesture(Key.C, ModifierKeys.Control, "Ctrl-C")));
+            CommandManager.RegisterClassCommandBinding(typeof(WebHyperlink), new CommandBinding(_CopyUri, CopyHyperlinkUri));
+            CommandManager.RegisterClassInputBinding(typeof(WebHyperlink), new InputBinding(_CopyUri, new KeyGesture(Key.C, ModifierKeys.Control, "Ctrl-C")));

             _mNavigateToUri = new RoutedCommand("NavigateToUri", typeof(WebHyperlink));
             CommandManager.RegisterClassCommandBinding(typeof(WebHyperlink), new CommandBinding(_mNavigateToUri, Hyperlink_CommandNavigateTo));
@@ -50,7 +50,7 @@
         #endregion constructor

         #region properties
-        public static RoutedCommand CopyUri => _mCopyUri;
+        public static RoutedCommand CopyUri => _CopyUri;

         public static RoutedCommand NavigateToUri => _mNavigateToUri;


Improved message bus warmup with a background task

--- TinyIpc/Messaging/TinyMessageBus.cs
+++ TinyIpc/Messaging/TinyMessageBus.cs
@@ -13,7 +13,7 @@
 {
 	public class TinyMessageBus : IDisposable, ITinyMessageBus
 	{
-		private readonly long messageOverhead;
+		private long messageOverhead;
 		private readonly Guid instanceId = Guid.NewGuid();
 		private readonly ConcurrentQueue<Entry> publishQueue = new ConcurrentQueue<Entry>();
 		private readonly TimeSpan minMessageAge;
@@ -58,39 +58,46 @@

 		public TinyMessageBus(ITinyMemoryMappedFile memoryMappedFile, TimeSpan minMessageAge)
 		{
+			this.minMessageAge = minMessageAge;
+			this.memoryMappedFile = memoryMappedFile;
+
+			memoryMappedFile.FileUpdated += HandleIncomingMessages;
+
+			publishTasks = new []{ Task.Factory.StartNew(Warmup) };
+		}
+
+		public void Dispose()
+		{
+			memoryMappedFile.FileUpdated -= HandleIncomingMessages;
+
+			lock (publishTasksLock)
+			{
+				Task.WaitAll(publishTasks);
+			}
+
+			if (shouldDisposeFile && memoryMappedFile is TinyMemoryMappedFile)
+			{
+				(memoryMappedFile as TinyMemoryMappedFile).Dispose();
+			}
+		}
+
+		private void Warmup()
+		{
 			Serializer.PrepareSerializer<Entry>();
-
 			using (var memoryStream = new MemoryStream())
 			{
 				Serializer.Serialize(memoryStream, new Entry { Id = long.MaxValue, Instance = instanceId, Timestamp = DateTime.UtcNow });
 				messageOverhead = memoryStream.Length;
 			}

-			this.minMessageAge = minMessageAge;
-			this.memoryMappedFile = memoryMappedFile;
-
 			var lastEntry = DeserializeLog(memoryMappedFile.Read()).LastOrDefault();
 			if (lastEntry != null)
 			{
 				lastEntryId = lastEntry.Id;
 			}

-			memoryMappedFile.FileUpdated += HandleIncomingMessages;
-		}
-
-		public void Dispose()
-		{
-			memoryMappedFile.FileUpdated -= HandleIncomingMessages;
-
-			lock (publishTasksLock)
-			{
-				Task.WaitAll(publishTasks);
-			}
-
-			if (shouldDisposeFile && memoryMappedFile is TinyMemoryMappedFile)
-			{
-				(memoryMappedFile as TinyMemoryMappedFile).Dispose();
-			}
+			publishQueue.Enqueue(new Entry { Instance = instanceId, Message = new byte[0] });
+			ProcessPublishQueue();
 		}

 		/// <summary>
@@ -108,6 +115,9 @@
 		/// <param name="message"></param>
 		public void PublishAsync(byte[] message)
 		{
+			if (message == null || message.Length == 0)
+				throw new ArgumentException("Message can not be empty", "message");
+
 			publishQueue.Enqueue(new Entry { Instance = instanceId, Message = message });

 			if (waitingPublishers > 0)
@@ -199,7 +209,7 @@
 				{
 					lastEntryId = entry.Id;

-					if (entry.Instance == instanceId)
+					if (entry.Instance == instanceId || entry.Message == null || entry.Message.Length == 0)
 						continue;

 					if (MessageReceived != null)


Bump v1.0.12.4803

Bump v1.0.12.4803

--- TinySato/Properties/AssemblyInfo.cs
+++ TinySato/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
 //
 // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
 // 既定値にすることができます:
-[assembly: AssemblyVersion("1.0.12.*")]
+[assembly: AssemblyVersion("1.0.12.4803")]
 [assembly: AssemblyFileVersion("1.0.12")]


Implement the read/write xml data

Implement the read/write xml data

This is done using the XML serializer class to automatically write and
read xml to a file, and back to the list of notes.

--- Todo-List/Todo-List/XMLDataSaver.cs
+++ Todo-List/Todo-List/XMLDataSaver.cs
@@ -16,6 +16,18 @@
         /// </summary>
         public static void ReadXMLFile()
         {
+            try
+            {
+                using (TextReader tr = new StreamReader("TodoListData.xml"))
+                {
+                    XmlSerializer xs = new XmlSerializer(typeof(List<Note>));
+                    NoteSorter.Notes = (List<Note>)xs.Deserialize(tr);
+                }
+            }
+            catch (FileNotFoundException)
+            {
+                // File not found so don't read anything
+            }
         }

         /// <summary>
@@ -23,6 +35,11 @@
         /// </summary>
         public static void SaveXMLFile()
         {
+            using (TextWriter tw = new StreamWriter("TodoListData.xml"))
+            {
+                XmlSerializer xs = new XmlSerializer(typeof(List<Note>));
+                xs.Serialize(tw, NoteSorter.Notes);
+            }
         }
     }
 }