Removed Reset. It adds race conditions and has no real benefits

svn path=/trunk/bitsharp/; revision=97169

--- src/MonoTorrent/MonoTorrent.Tracker/Tracker.cs
+++ src/MonoTorrent/MonoTorrent.Tracker/Tracker.cs
@@ -279,13 +279,6 @@
             torrents.Remove(trackable.InfoHash);
         }

-        public void Reset()
-        {
-            Debug.WriteLine("Resetting tracker... ");
-            Debug.WriteLine("Flushing data from memory... COMPLETE");
-            torrents.Clear();
-        }
-
         public void UnregisterListener(ListenerBase listener)
         {
             if (listener == null)


Remove unnecessary clamp

Remove unnecessary clamp

Co-authored-by: Joseph Madamba <deb5e3a2371a81eb362def5dfce4787ebd8ff67d@outlook.com>

--- osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs
+++ osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs
@@ -56,7 +56,7 @@
                 var destination = e.MousePosition;

                 FlashlightPosition = Interpolation.ValueAt(
-                    Math.Clamp(Math.Abs(Clock.ElapsedFrameTime), 0, follow_delay), position, destination, 0, follow_delay, Easing.Out);
+                    Math.Min(Math.Abs(Clock.ElapsedFrameTime), follow_delay), position, destination, 0, follow_delay, Easing.Out);

                 return base.OnMouseMove(e);
             }


Introduced a new result type with error object. (#55)

--- CSharpFunctionalExtensions/Result.cs
+++ CSharpFunctionalExtensions/Result.cs
@@ -6,15 +6,15 @@

 namespace CSharpFunctionalExtensions
 {
-    internal sealed class ResultCommonLogic
+    internal sealed class ResultCommonLogic<TError> where TError : class
     {
         public bool IsFailure { get; }
         public bool IsSuccess => !IsFailure;

         [DebuggerBrowsable(DebuggerBrowsableState.Never)]
-        private readonly string _error;
-
-        public string Error
+        private readonly TError _error;
+
+        public TError Error
         {
             [DebuggerStepThrough]
             get
@@ -27,22 +27,62 @@
         }

         [DebuggerStepThrough]
-        public ResultCommonLogic(bool isFailure, string error)
+        public ResultCommonLogic(bool isFailure, TError error)
         {
             if (isFailure)
             {
-                if (string.IsNullOrEmpty(error))
-                    throw new ArgumentNullException(nameof(error), "There must be error message for failure.");
+                if (error == null)
+                    throw new ArgumentNullException(nameof(error), ResultMessages.ErrorObjectIsNotProvidedForFailure);
             }
             else
             {
                 if (error != null)
-                    throw new ArgumentException("There should be no error message for success.", nameof(error));
+                    throw new ArgumentException(nameof(error), ResultMessages.ErrorObjectIsProvidedForSuccess);
             }

             IsFailure = isFailure;
             _error = error;
         }
+ introducing-error-object
+    }
+
+    internal static class ResultCommonLogic
+    {
+        [DebuggerStepThrough]
+        public static ResultCommonLogic<string> Create(bool isFailure, string error)
+        {
+            if (isFailure)
+            {
+                if (string.IsNullOrEmpty(error))
+                    throw new ArgumentNullException(nameof(error), ResultMessages.ErrorMessageIsNotProvidedForFailure);
+            }
+            else
+            {
+                if (error != null)
+                    throw new ArgumentException(nameof(error), ResultMessages.ErrorMessageIsProvidedForSuccess);
+            }
+
+            return new ResultCommonLogic<string>(isFailure, error);
+        }
+    }
+
+    internal static class ResultMessages
+    {
+        public static readonly string ErrorObjectIsNotProvidedForFailure =
+            "You have tried to create a failure result, but error object appeared to be null, please review the code, generating error object.";
+
+        public static readonly string ErrorObjectIsProvidedForSuccess =
+            "You have tried to create a success result, but error object was also passed to the constructor, please try to review the code, creating a success result.";
+
+        public static readonly string ErrorMessageIsNotProvidedForFailure = "There must be error message for failure.";
+
+        public static readonly string ErrorMessageIsProvidedForSuccess = "There should be no error message for success.";
+    }
+
+
+    public struct Result : ISerializable
+    {
+        private static readonly Result OkResult = new Result(false, null);

         public void GetObjectData(SerializationInfo oInfo, StreamingContext oContext)
         {
@@ -65,7 +105,7 @@
         }

         [DebuggerBrowsable(DebuggerBrowsableState.Never)]
-        private readonly ResultCommonLogic _logic;
+        private readonly ResultCommonLogic<string> _logic;

         public bool IsFailure => _logic.IsFailure;
         public bool IsSuccess => _logic.IsSuccess;
@@ -74,7 +114,7 @@
         [DebuggerStepThrough]
         private Result(bool isFailure, string error)
         {
-            _logic = new ResultCommonLogic(isFailure, error);
+            _logic = ResultCommonLogic.Create(isFailure, error);
         }

         [DebuggerStepThrough]
@@ -99,6 +139,18 @@
         public static Result<T> Fail<T>(string error)
         {
             return new Result<T>(true, default(T), error);
+        }
+
+        [DebuggerStepThrough]
+        public static Result<TValue, TError> Ok<TValue, TError>(TValue value) where TError : class
+        {
+            return new Result<TValue, TError>(false, value, default(TError));
+        }
+
+        [DebuggerStepThrough]
+        public static Result<TValue, TError> Fail<TValue, TError>(TError error) where TError : class
+        {
+            return new Result<TValue, TError>(true, default(TValue), error);
         }

         /// <summary>
@@ -154,12 +206,11 @@
             return Combine(errorMessagesSeparator, untyped);
         }
     }
-
-
+
     public struct Result<T> : ISerializable
     {
         [DebuggerBrowsable(DebuggerBrowsableState.Never)]
-        private readonly ResultCommonLogic _logic;
+        private readonly ResultCommonLogic<string> _logic;

         public bool IsFailure => _logic.IsFailure;
         public bool IsSuccess => _logic.IsSuccess;
@@ -196,7 +247,7 @@
             if (!isFailure && value == null)
                 throw new ArgumentNullException(nameof(value));

-            _logic = new ResultCommonLogic(isFailure, error);
+            _logic = ResultCommonLogic.Create(isFailure, error);
             _value = value;
         }

@@ -208,4 +259,69 @@
                 return Result.Fail(result.Error);
         }
     }
+
+    public struct Result<TValue, TError> : ISerializable where TError : class
+    {
+        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+        private readonly ResultCommonLogic<TError> _logic;
+
+        public bool IsFailure => _logic.IsFailure;
+        public bool IsSuccess => _logic.IsSuccess;
+        public TError Error => _logic.Error;
+
+        void ISerializable.GetObjectData(SerializationInfo oInfo, StreamingContext oContext)
+        {
+            oInfo.AddValue("IsFailure", IsFailure);
+            oInfo.AddValue("IsSuccess", IsSuccess);
+            if (IsFailure)
+            {
+                oInfo.AddValue("Error", Error);
+            }
+            else
+            {
+                oInfo.AddValue("Value", Value);
+            }
+        }
+
+        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+        private readonly TValue _value;
+
+        public TValue Value
+        {
+            [DebuggerStepThrough]
+            get
+            {
+                if (!IsSuccess)
+                    throw new InvalidOperationException("There is no value for failure.");
+
+                return _value;
+            }
+        }
+
+        [DebuggerStepThrough]
+        internal Result(bool isFailure, TValue value, TError error)
+        {
+            if (!isFailure && value == null)
+                throw new ArgumentNullException(nameof(value));
+
+            _logic = new ResultCommonLogic<TError>(isFailure, error);
+            _value = value;
+        }
+
+        public static implicit operator Result(Result<TValue, TError> result)
+        {
+            if (result.IsSuccess)
+                return Result.Ok();
+            else
+                return Result.Fail(result.Error.ToString());
+        }
+
+        public static implicit operator Result<TValue>(Result<TValue, TError> result)
+        {
+            if (result.IsSuccess)
+                return Result.Ok(result.Value);
+            else
+                return Result.Fail<TValue>(result.Error.ToString());
+        }
+    }
 }


[gamemanager] Fix extra card crash

[gamemanager] Fix extra card crash

--- CardsAgainstIRC3/Game/GameManager.cs
+++ CardsAgainstIRC3/Game/GameManager.cs
@@ -44,7 +44,8 @@
                 cards = ChosenCards;

             foreach (var card in cards)
-                Cards[card] = null;
+                if (card < Cards.Count)
+                    Cards[card] = null;

             while (Cards.Count > NominalCardCount)
             {


Comment out setting "user-agent" to "me" via command line args, added note for future reference as an example to others.

--- CefSharp.Example/ExamplePresenter.cs
+++ CefSharp.Example/ExamplePresenter.cs
@@ -21,7 +21,8 @@
                 settings.BrowserSubprocessPath = "..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin\\x86\\Debug\\CefSharp.BrowserSubprocess.exe";
             }

-            settings.CefCommandLineArgs.Add("user-agent", "me");
+            //NOTE: Add command line args before Cef.Initialize() called
+            //settings.CefCommandLineArgs.Add("user-agent", "me");
             settings.RegisterScheme(new CefCustomScheme
             {
                 SchemeName = CefSharpSchemeHandlerFactory.SchemeName,


Added a more in-depth where-you-left-off.

--- Cix/Cix/Cix/AST/ExpressionElement.cs
+++ Cix/Cix/Cix/AST/ExpressionElement.cs
@@ -25,6 +25,23 @@
 				{
 					case TokenType.Identifier:
 						// WYLO: TYPECASTS AND FUNCTIONS, FOOL
+						/* Okay, but seriously now.
+						 * Names aren't particularly difficult if we keep a nametable and pass it around.
+						 * If we have a type name (including pointers), it can be resolved in two ways:
+						 * as a typecast (as LeftParen, Identifier, RightParen), or as a SizeOf operation
+						 * (OperatorSizeOf, which you must add, LeftParen, Identifier, RightParen). If we
+						 * know the size of our type, we can substitute in here as a numeric literal.
+						 *
+						 * If we have a function name (or a local variable with type func_ptr [which you
+						 * also must add]), it's either a dereference (OpDereference, Identifier) or it's
+						 * a call (Identifier, LeftParen, args, RightParen). Do some syntactic matching to
+						 * ensure our parentheses balance, split everything between the parens by commas,
+						 * create an ExpressionFunctionCall with the arguments ToElements-ed and parsed
+						 * properly.
+						 *
+						 * If we have a local variable, we can merely add it as a ExpressionMemberAccess.
+						 * Also, scope issues need to be taken care of.
+						 */
 						break;
 					case TokenType.OpenParen:
 						result.Add(new ExpressionParentheses(ParenthesesType.Left));


StringCollections fixes

StringCollections fixes

--- ClassExtensions/StringCollections.cs
+++ ClassExtensions/StringCollections.cs
@@ -37,7 +37,7 @@
         /// <returns></returns>
         public static string StringCollectionToString(this StringCollection stringCollection)
         {
-            string outputString = "";
+            var outputString = "";
             if (stringCollection != null && stringCollection.Count > 0)
             {
                 foreach (string inputString in stringCollection)
@@ -58,13 +58,14 @@
         public static void SaveToFile(this StringCollection sCollection, string sFile)
         {
             var fi = new FileInfo(sFile);
-            TextWriter writer = fi.CreateText();
-            StringEnumerator enu = sCollection.GetEnumerator();
-            while (enu.MoveNext())
-            {
-                writer.WriteLine(enu.Current);
-            }
-            writer.Close();
+            using (var writer = fi.CreateText())
+            {
+                var enu = sCollection.GetEnumerator();
+                while (enu.MoveNext())
+                {
+                    writer.WriteLine(enu.Current);
+                }
+            }
         }

         /// <summary>
@@ -75,14 +76,16 @@
         /// <exception cref="IOException">An I/O error occurs. </exception>
         public static void SaveToStream(this StringCollection sCollection, Stream sOutput)
         {
-            var writer = new StreamWriter(sOutput);
-            writer.AutoFlush = true;
-            StringEnumerator enu = sCollection.GetEnumerator();
-            while (enu.MoveNext())
-            {
-                writer.WriteLine(enu.Current);
-            }
-            writer.Flush();
+            using (var writer = new StreamWriter(sOutput))
+            {
+                writer.AutoFlush = true;
+                var enu = sCollection.GetEnumerator();
+                while (enu.MoveNext())
+                {
+                    writer.WriteLine(enu.Current);
+                }
+                writer.Flush();
+            }
             //writer.Close(); // nezavirat!
         }

@@ -97,23 +100,24 @@
         public static void SaveToFile(this ListView.ListViewItemCollection sCollection, string sFile)
         {
             var fi = new FileInfo(sFile);
-            TextWriter writer = fi.CreateText();
-            foreach (ListViewItem item in sCollection)
-            {
-                string s = "";
-                for (int i = 0; i < item.SubItems.Count; i++)
-                {
-                    s = s + item.SubItems[i];
-                    if (i < item.SubItems.Count - 1) s = s + " -> ";
-                    s = s.Replace("ListViewSubItem:", "");
-                    s = s.Replace("}", "");
-                    s = s.Replace("{", "");
-                }
-                //ListViewItemConverter k = new ListViewItemConverter();
-                //string s = k.ConvertToString(item);
-                writer.WriteLine(s);
-            }
-            writer.Close();
+            using (var writer = fi.CreateText())
+            {
+                foreach (ListViewItem item in sCollection)
+                {
+                    var s = "";
+                    for (var i = 0; i < item.SubItems.Count; i++)
+                    {
+                        s = s + item.SubItems[i];
+                        if (i < item.SubItems.Count - 1) s = s + " -> ";
+                        s = s.Replace("ListViewSubItem:", "");
+                        s = s.Replace("}", "");
+                        s = s.Replace("{", "");
+                    }
+                    //ListViewItemConverter k = new ListViewItemConverter();
+                    //string s = k.ConvertToString(item);
+                    writer.WriteLine(s);
+                }
+            }
         }

         /// <summary>
@@ -134,14 +138,15 @@
             string s;
             if (!souborInfo.Exists) return;
             // načíty načíty :-)
-            TextReader reader = souborInfo.OpenText();
-            if (!bAppend) sCollection.Clear();
-            while ((s = reader.ReadLine()) != null)
-            {
-                sCollection.Add(s);
-            }
-            // načteno
-            reader.Close();
+            using (var reader = souborInfo.OpenText())
+            {
+                if (!bAppend) sCollection.Clear();
+                while ((s = reader.ReadLine()) != null)
+                {
+                    sCollection.Add(s);
+                }
+                // načteno
+            }
         }

         /// <summary>
@@ -154,12 +159,14 @@
         /// <exception cref="OutOfMemoryException">There is insufficient memory to allocate a buffer for the returned string. </exception>
         public static void LoadFromStream(this StringCollection sCollection, Stream sInput, bool bAppend = false)
         {
-            var reader = new StreamReader(sInput);
-            string s;
-            if (!bAppend) sCollection.Clear();
-            while ((s = reader.ReadLine()) != null)
-            {
-                sCollection.Add(s);
+            using (var reader = new StreamReader(sInput))
+            {
+                string s;
+                if (!bAppend) sCollection.Clear();
+                while ((s = reader.ReadLine()) != null)
+                {
+                    sCollection.Add(s);
+                }
             }
             // reader.Close(); // nezavirat!
         }
@@ -198,12 +205,10 @@
                 listViewContent.Append(item.Text);
                 listViewContent.Append(Environment.NewLine);
             }
-
-            TextWriter tw = new StreamWriter(sFile);
-
-            tw.WriteLine(listViewContent.ToString());
-
-            tw.Close();
+            using (var tw = new StreamWriter(sFile))
+            {
+                tw.WriteLine(listViewContent.ToString());
+            }
         }
     }
 }


CancelationToken

CancelationToken

--- Signum.Engine.Extensions/Mailing/Pop3/Pop3ConfigurationLogic.cs
+++ Signum.Engine.Extensions/Mailing/Pop3/Pop3ConfigurationLogic.cs
@@ -13,12 +13,13 @@
 using Signum.Utilities;
 using Signum.Entities.Basics;
 using Signum.Engine.Extensions.Mailing.Pop3;
+using System.Threading;

 namespace Signum.Engine.Mailing.Pop3
 {
     public static class Pop3ConfigurationLogic
     {
-        public static bool GettingCancel = false;
+        public static CancellationToken CancelationToken;
         public static int MaxReceptionPerTime = 15;

         [AutoExpressionField]
@@ -202,7 +203,7 @@
                         string lastSuid = "";
                         foreach (var mi in messagesToSave)
                         {
-                            if (GettingCancel)
+                            if (CancelationToken.IsCancellationRequested)
                                 break;

                             var sent = SaveEmail(config, reception, client, mi, ref anomalousReception);


ModbusConfig: Improved sequence group count positioning and drag-drop selection validation.

--- Source/Applications/openMIC/openMIC/wwwroot/ModbusConfig.cshtml
+++ Source/Applications/openMIC/openMIC/wwwroot/ModbusConfig.cshtml
@@ -234,6 +234,12 @@
             -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083)";
             transform: rotate(-90.0deg);
         }
+
+        @@media screen and (min-width: 1200px) {
+            span.sequence-group-count {
+                margin-left: -44px;
+            }
+        }

         .form-group {
             padding-top: 5px;
@@ -710,7 +716,7 @@
                 if (expand)
                     $("#sequenceContent" + domIndex).collapse("show");

-                self.refreshSequenceCountWidths();
+                self.refreshSequenceGroupCountWidths();
             }

             self.sortSequenceRecords = function() {
@@ -742,7 +748,7 @@

             self.removeSequenceRecord = function(record) {
                 self.sequenceRecords.remove(record);
-                self.refreshSequenceCountWidths();
+                self.refreshSequenceGroupCountWidths();
             }

             self.refreshSequenceRecords = function() {
@@ -753,10 +759,10 @@
                 self.sequenceRecords([]);
                 self.sequenceRecords(records);

-                self.refreshSequenceCountWidths();
-            }
-
-            self.refreshSequenceCountWidths = function() {
+                self.refreshSequenceGroupCountWidths();
+            }
+
+            self.refreshSequenceGroupCountWidths = function() {
                 $(".sequence-group-count").each(function(classIndex, element) {
                     element.style.height = element.offsetWidth + "px";
                     element.style.width = element.offsetHeight + "px";
@@ -1037,60 +1043,64 @@

             // Wait a moment for ko processing to complete before validating selections
             setTimeout(function() {
-                const records = sequence.sequenceRecords();
-
-                if (!records)
-                    return;
-
-                // Validate selected record types match
-                let firstSelectedType = null;
-                let recordTypesMatch = true;
-
-                for (let i = 0; i < records.length; i++) {
-                    if (records[i].selected()) {
-                        if (firstSelectedType != null) {
-                            if (firstSelectedType !== records[i].recordType()) {
-                                recordTypesMatch = false;
-                                break;
-                            }
+                validateSelections(sequence, selectedIndex);
+            }, 250);
+        }
+
+        function validateSelections(sequence, selectedIndex) {
+            const records = sequence.sequenceRecords();
+
+            if (!records)
+                return;
+
+            // Validate selected record types match
+            let firstSelectedType = null;
+            let recordTypesMatch = true;
+
+            for (let i = 0; i < records.length; i++) {
+                if (records[i].selected()) {
+                    if (firstSelectedType != null) {
+                        if (firstSelectedType !== records[i].recordType()) {
+                            recordTypesMatch = false;
+                            break;
                         }
-                        else {
-                            firstSelectedType = records[i].recordType();
+                    }
+                    else {
+                        firstSelectedType = records[i].recordType();
+                    }
+                }
+            }
+
+            if (!recordTypesMatch) {
+                if (records[selectedIndex].selected())
+                    sequence.selectOne(selectedIndex);
+                else
+                    sequence.selectNone();
+            }
+
+            // Validate selected records are contiguous
+            let lastSelectedIndex = null;
+            let recordsAreContiguous = true;
+
+            for (let i = 0; i < records.length; i++) {
+                if (records[i].selected()) {
+                    if (lastSelectedIndex != null) {
+                        if (i !== lastSelectedIndex + 1) {
+                            recordsAreContiguous = false;
+                            break;
                         }
                     }
+
+                    lastSelectedIndex = i;
                 }
-
-                if (!recordTypesMatch) {
-                    if (records[selectedIndex].selected())
-                        sequence.selectOne(selectedIndex);
-                    else
-                        sequence.selectNone();
-                }
-
-                // Validate selected records are contiguous
-                let lastSelectedIndex = null;
-                let recordsAreContiguous = true;
-
-                for (let i = 0; i < records.length; i++) {
-                    if (records[i].selected()) {
-                        if (lastSelectedIndex != null) {
-                            if (i !== lastSelectedIndex + 1) {
-                                recordsAreContiguous = false;
-                                break;
-                            }
-                        }
-
-                        lastSelectedIndex = i;
-                    }
-                }
-
-                if (!recordsAreContiguous) {
-                    if (records[selectedIndex].selected())
-                        sequence.selectOne(selectedIndex);
-                    else
-                        sequence.selectNone();
-                }
-            }, 250);
+            }
+
+            if (!recordsAreContiguous) {
+                if (records[selectedIndex].selected())
+                    sequence.selectOne(selectedIndex);
+                else
+                    sequence.selectNone();
+            }
         }

         function getDerivedValueAddressExpression(sequence) {
@@ -1179,22 +1189,28 @@
             checkbox.on("dragover", function(event) {
                 event.preventDefault();

-                if (sourceCheckbox && event.target !== sourceCheckbox) {
-                    const record = records()[$(event.target).parents("tr")[0].rowIndex - 1];
-
-                    if (record.recordType() !== RecordType.DerivedValue)
+                if (sourceCheckbox && event.target !== sourceCheckbox && !$(event.target).prop("disabled")) {
+                    const index = $(event.target).parents("tr")[0].rowIndex - 1;
+                    const record = records()[index];
+
+                    if (record.recordType() !== RecordType.DerivedValue) {
                         record.selected(sourceCheckbox.checked);
+                        validateSelections(sequenceRecord.parent, index);
+                    }
                 }
             });

             parentCell.on("dragover", function(event) {
                 event.preventDefault();

-                if (sourceCheckbox && event.target !== sourceCheckbox && !event.target.disabled) {
-                    const record = records()[$(event.target).parents("tr")[0].rowIndex - 1];
-
-                    if (record.recordType() !== RecordType.DerivedValue)
+                if (sourceCheckbox && event.target !== sourceCheckbox && !$(event.target).find("input[type=checkbox]").prop("disabled")) {
+                    const index = $(event.target).parents("tr")[0].rowIndex - 1;
+                    const record = records()[index];
+
+                    if (record.recordType() !== RecordType.DerivedValue) {
                         record.selected(sourceCheckbox.checked);
+                        validateSelections(sequenceRecord.parent, index);
+                    }
                 }
             });


Updated from FerrSuite

Updated from FerrSuite

--- Assets/Ferr/Common/Scripts/LayerUtil.cs
+++ Assets/Ferr/Common/Scripts/LayerUtil.cs
@@ -1,13 +1,34 @@
-#if UNITY_EDITOR
+using UnityEngine;

-using UnityEngine;
+using System;
+using System.Collections.Generic;
+
+#if UNITY_EDITOR
 using UnityEditor;

-using System;
 using System.Collections;
 using System.Reflection;
+#endif

 namespace Ferr {
+	public static class RuntimeLayerUtil {
+		static List<int> mReservedLayers = null;
+
+		public static int  GetFreeLayer() {
+			for (int i = 16; i < 32; i += 1) {
+				if (LayerMask.LayerToName(i) == "" && (mReservedLayers == null || !mReservedLayers.Contains(i)))
+					return i;
+			}
+			Debug.LogError("Ferr is looking for an unnamed render layer after 15, but none are free!");
+			return -1;
+		}
+		public static void ReserveLayer(int aLayerID) {
+			if (mReservedLayers == null)
+				mReservedLayers = new List<int>();
+			mReservedLayers.Add(aLayerID);
+		}
+	}
+	#if UNITY_EDITOR
 	public static class LayerUtil {
 		static SerializedObject GetLayerManager() {
 			return new UnityEditor.SerializedObject(UnityEditor.AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/TagManager.asset")[0]);
@@ -85,6 +106,5 @@
 			return sortingLayerNames.GetValue(null, null) as string[];
 		}
 	}
-}
-
-#endif+	#endif
+}


revert

revert

--- Assets/JumpCommand/JumpCommandObject.cs
+++ Assets/JumpCommand/JumpCommandObject.cs
@@ -21,15 +21,6 @@
         Help    = help;
     }

-    [JumpCommandAttribute["speed","Change person speed"]]
-    public void SpeedAjust(float value) {
-        speed += value;
-    }
-
-    [JumpCommandAttribute["test","test command"]]
-    static public CommandTest(int i) {
-        Debug.Log(i.ToString());
-    }

     public bool Call(string[] paramStr, Object callee = null) {
         // create parameter list


Bump version to 3.0.2

Bump version to 3.0.2

--- Assets/NuGet/Editor/NugetPreferences.cs
+++ Assets/NuGet/Editor/NugetPreferences.cs
@@ -11,7 +11,7 @@
         /// <summary>
         /// The current version of NuGet for Unity.
         /// </summary>
-        public const string NuGetForUnityVersion = "3.0.1";
+        public const string NuGetForUnityVersion = "3.0.2";

         /// <summary>
         /// The current position of the scroll bar in the GUI.


Set new assembly version for release 1.1.0.0

--- AsterNET.ARI/Properties/AssemblyInfo.cs
+++ AsterNET.ARI/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("AsterNET.ARI")]
-[assembly: AssemblyCopyright("Copyright ©  2014")]
+[assembly: AssemblyCopyright("Copyright ©  2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.1.0.0")]
+[assembly: AssemblyFileVersion("1.1.0.0")]


CA-234628: Errors with no title in XenCenter

Set the suppressHistory flag to true for the parallel action that we run periodically to check the Health Check analysis result

Signed-off-by: Mihaela Stoica <be95049f8e30d921fc7e2579c00c48bd84c40606@citrix.com>

--- XenAdmin/Core/HealthCheck.cs
+++ XenAdmin/Core/HealthCheck.cs
@@ -64,7 +64,7 @@
             }
             else if (actions.Count > 1)
             {
-                var parallelAction = new ParallelAction(null, "", "", "", actions);
+                var parallelAction = new ParallelAction(null, "", "", "", actions, true, true);
                 parallelAction.Completed += actionCompleted;
                 parallelAction.RunAsync();
             }


Added null checks.

Added null checks.

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@681

--- src/NHibernate.DomainModel/StringComparator.cs
+++ src/NHibernate.DomainModel/StringComparator.cs
@@ -9,6 +9,17 @@

 		public int Compare(object x, object y)
 		{
+			if(x==null && y==null)
+			{
+				return 0;
+			}
+
+			if(x==null)
+			{
+				return -1;
+			}
+
+
 			return ( (String) x ).ToLower().CompareTo( ( (String) y ).ToLower() );
 		}


Changed type of Id from int to short. Everything in RSC uses a short for its Id (items, npcs, etc).

--- src/OpenClassic.Server/Domain/IIdentifiable.cs
+++ src/OpenClassic.Server/Domain/IIdentifiable.cs
@@ -2,6 +2,6 @@
 {
     public interface IIdentifiable
     {
-        int Id { get; set; }
+        short Id { get; set; }
     }
 }


#523 play quest music on load.

#523 play quest music on load.

--- unity/Assets/Scripts/Quest/Quest.cs
+++ unity/Assets/Scripts/Quest/Quest.cs
@@ -592,6 +592,14 @@
         // This happens anyway but we need it to be here before the following code is executed (also needed for loading saves)
         game.quest = this;

+        // Start quest music FIXME music state not saved
+        List<string> music = new List<string>();
+        foreach (AudioData ad in game.cd.audio.Values)
+        {
+            if (ad.ContainsTrait("quest")) music.Add(ad.file);
+        }
+        game.audioControl.Music(music);
+
         // Get state
         bool.TryParse(saveData.Get("Quest", "heroesSelected"), out heroesSelected);
         bool horror;


Clear votes on client disconnect.

Clear votes on client disconnect.

They would stay stuck open otherwise.

--- Content.Client/Voting/VoteManager.cs
+++ Content.Client/Voting/VoteManager.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using Content.Shared.Network.NetMessages;
+using Robust.Client;
 using Robust.Client.Console;
 using Robust.Client.UserInterface;
 using Robust.Shared.IoC;
@@ -27,6 +28,7 @@
         [Dependency] private readonly IClientNetManager _netManager = default!;
         [Dependency] private readonly IGameTiming _gameTiming = default!;
         [Dependency] private readonly IClientConsoleHost _console = default!;
+        [Dependency] private readonly IBaseClient _client = default!;

         private readonly Dictionary<int, ActiveVote> _votes = new();
         private readonly Dictionary<int, VotePopup> _votePopups = new();
@@ -39,6 +41,18 @@
         {
             _netManager.RegisterNetMessage<MsgVoteData>(MsgVoteData.NAME, ReceiveVoteData);
             _netManager.RegisterNetMessage<MsgVoteCanCall>(MsgVoteCanCall.NAME, ReceiveVoteCanCall);
+
+            _client.RunLevelChanged += ClientOnRunLevelChanged;
+        }
+
+        private void ClientOnRunLevelChanged(object? sender, RunLevelChangedEventArgs e)
+        {
+            // Clear votes on disconnect.
+            if (e.NewLevel == ClientRunLevel.Initialize)
+            {
+                ClearPopupContainer();
+                _votes.Clear();
+            }
         }

         public void ClearPopupContainer()


ObsoleteAttribute messages + exception comments

--- src/Portable.Syslog.Core/Core/SyslogMessage.cs
+++ src/Portable.Syslog.Core/Core/SyslogMessage.cs
@@ -21,13 +21,13 @@
         /// <summary>
         /// Default message facility.
         /// </summary>
-        [Obsolete]
+        [Obsolete("This field will be removed in a future version.")]
         public static Facility DefaultFacility = Facility.UserLevelMessages;

         /// <summary>
         /// Default message severity.
         /// </summary>
-        [Obsolete]
+        [Obsolete("This field will be removed in a future version.")]
         public static Severity DefaultSeverity = Severity.Informational;

         /// <summary>
@@ -41,9 +41,9 @@
             Severity severity,
             string appName,
             string message)
-#pragma warning disable 612
+#pragma warning disable 612, 618
             : this(DefaultFacility, severity, appName, message)
-#pragma warning restore 612
+#pragma warning restore 612, 618
         {
         }

@@ -77,6 +77,9 @@
         /// <param name="hostName">Host name.</param>
         /// <param name="appName">Application name.</param>
         /// <param name="message">Message text.</param>
+        /// <exception cref="ArgumentNullException">
+        /// Missing <paramref name="hostName"/> value.
+        /// </exception>
         public SyslogMessage(
             DateTimeOffset? dateTimeOffset,
             Facility facility,
@@ -109,6 +112,9 @@
         /// <param name="msgId">Message identifier.</param>
         /// <param name="message">Message text.</param>
         /// <param name="structuredDataElements">Structured data.</param>
+        /// <exception cref="ArgumentNullException">
+        /// Missing <paramref name="hostName"/> or <paramref name="structuredDataElements"/> value.
+        /// </exception>
         public SyslogMessage(
             DateTimeOffset? dateTimeOffset,
             Facility facility,


changed line style of m/z mode to fit request of user

--- Atreyu/ViewModels/MzSpectraViewModel.cs
+++ Atreyu/ViewModels/MzSpectraViewModel.cs
@@ -174,26 +174,12 @@
                 series.YAxis.Title = this.ShowMz ? "m/z" : "Bin";
             }

-            if (this.showMz)
-            {
-                series.MarkerType = MarkerType.Circle;
-                series.MarkerSize = 2.5;
-                //series.MarkerStrokeThickness = 2;
-                series.MarkerFill = OxyColors.Black;
-                series.BrokenLineColor = OxyColors.Automatic;
-                series.BrokenLineStyle = LineStyle.Dot;
-                series.BrokenLineThickness = 1;
-            }
             if (series != null)
             {
                 series.Points.Clear();
                 foreach (var d in frameData)
                 {
                     series.Points.Add(new DataPoint(d.Value, d.Key));
-                    if (this.showMz)
-                    {
-                        series.Points.Add(new DataPoint(double.NaN, double.NaN));
-                    }
                 }
             }


Radio id is int not string

Radio id is int not string

--- Audiotica.Data.Collection/Model/Song.cs
+++ Audiotica.Data.Collection/Model/Song.cs
@@ -116,7 +116,7 @@

         public bool IsTemp { get; set; }

-        public string RadioId { get; set; }
+        public int RadioId { get; set; }
     }

     public class AddableCollectionItem


Add AutoloadCoreData property to ApplicationOptions

--- Bindings/Portable/ApplicationOptions.cs
+++ Bindings/Portable/ApplicationOptions.cs
@@ -92,6 +92,8 @@

 		public bool DelayedStart { get; set; } = false;

+		public bool AutoloadCoreData { get; set; } = true;
+
 		public enum OrientationType
 		{
 			Landscape,
@@ -126,7 +128,9 @@
 #endif
 				builder.Append(" -s");

-			var resourcePathes = new[] {"CoreData"}.Concat(ResourcePaths ?? new string[0]);
+			string[] resourcePathes = new[] { "CoreData" }.Concat(ResourcePaths ?? new string[0]).ToArray();
+			if (!AutoloadCoreData)
+				resourcePathes = ResourcePaths ?? new string[0];
 			builder.AppendFormat(" -p \"{0}\"", string.Join(";", resourcePathes.Distinct()));

 			if (ResourcePackagesPaths?.Length > 0)


add timeout to replay test

add timeout to replay test

--- BitSharp.Core.Test/BlockReplayerTest.cs
+++ BitSharp.Core.Test/BlockReplayerTest.cs
@@ -20,6 +20,7 @@
         private const UInt64 SATOSHI_PER_BTC = 100 * 1000 * 1000;

         [TestMethod]
+        [Timeout(300000/*ms*/)]
         public void TestReplayBlock()
         {
             var logger = LogManager.CreateNullLogger();


use yield return with the observable's toenumerable, usings are clean again

--- BitSharp.Core/Builders/UtxoLookAhead.cs
+++ BitSharp.Core/Builders/UtxoLookAhead.cs
@@ -34,26 +34,21 @@

         public IEnumerable<BlockTx> LookAhead(IEnumerable<BlockTx> blockTxes, DeferredChainStateCursor deferredChainStateCursor)
         {
-            //TODO
-            var progress = new Progress();
-            try
+            using (var progress = new Progress())
             {
-                // create the observable source of each utxo entry to be warmed up: each input's previous transactions, and each new transaction
+                // create the observable source of each utxo entry to be warmed up: each input's previous transaction, and each new transaction
                 var utxoWarmupSource = this.blockTxesDispatcher.Create(CreateBlockTxesSource(progress, blockTxes));

                 // subscribe the utxo entries to be warmed up
-                progress.warmupSubscription = this.utxoReader.SubscribeObservers(utxoWarmupSource, CreateUtxoWarmer(progress, deferredChainStateCursor));
+                using (this.utxoReader.SubscribeObservers(utxoWarmupSource, CreateUtxoWarmer(progress, deferredChainStateCursor)))
+                {
+                    // create the observable source of warmed-up transactions, in the original block order
+                    var warmedTxesSource = this.blockTxesSorter.Create(CreateWarmedTxesSource(progress));

-                // create the observable source of warmed-up transactions, in the original block order
-                var warmedTxesSource = this.blockTxesSorter.Create(SubscribeWarmedTxes(progress));
-
-                // return the warmed-up transactions, in the original block order
-                return warmedTxesSource.ToEnumerable();
-            }
-            catch (Exception)
-            {
-                progress.Dispose();
-                throw;
+                    // return the warmed-up transactions, in the original block order
+                    foreach (var blockTx in warmedTxesSource.ToEnumerable())
+                        yield return blockTx;
+                }
             }
         }

@@ -96,7 +91,7 @@
                 });
         }

-        private IObservable<BlockTx> SubscribeWarmedTxes(Progress progress)
+        private IObservable<BlockTx> CreateWarmedTxesSource(Progress progress)
         {
             return Observable.Create<BlockTx>(
                 observer =>
@@ -114,7 +109,6 @@
                     }

                     observer.OnCompleted();
-                    progress.Dispose();

                     return Disposable.Empty;
                 });
@@ -126,13 +120,10 @@
             public AutoResetEvent txLoadedEvent = new AutoResetEvent(false);
             public ConcurrentQueue<Tuple<BlockTx, CompletionCount>> pendingWarmedTxes = new ConcurrentQueue<Tuple<BlockTx, CompletionCount>>();
             public bool completedAdding = false;
-            public IDisposable warmupSubscription;

             public void Dispose()
             {
                 txLoadedEvent.Dispose();
-                if (warmupSubscription != null)
-                    warmupSubscription.Dispose();
             }
         }
     }


changement des noms

changement des noms

--- BlackJacker/BlackJacker/Model/Joueur.cs
+++ BlackJacker/BlackJacker/Model/Joueur.cs
@@ -18,7 +18,7 @@
         {

         }
-        public void split()
+        public void Split()
         {

             if (listSimple[0].nom == listSimple[1].nom)
@@ -27,11 +27,11 @@
                 listSimple.Remove(listSimple[0]);
             }
         }
-        public void initialiserJeton()
+        public void InitialiserJeton()
         {
             jeton = 100;
         }
-        public void miserjeton(int valueMiser)
+        public void Miserjeton(int valueMiser)
         {
             mise = valueMiser;
             jeton -= mise;


new method

new method

--- ArrayAndListAlgorithms/ArrayAndListAlgorithms/SimpleAlgorithms.cs
+++ ArrayAndListAlgorithms/ArrayAndListAlgorithms/SimpleAlgorithms.cs
@@ -4,7 +4,7 @@
     using System;
     using System.Linq;
     using System.Collections.Generic;
-    using System.Text;
+

     public class Program
     {
@@ -23,11 +23,93 @@
             //AverageCharacterDelimiter();
             //SortArrayOfStrings();
             //ArrayHistogram();
+            //DecodeRadioFrequencies();
+            //Batteries();

-

             Console.WriteLine();
+        }
+
+        private static void Batteries()
+        {
+            var capacitiesOfBatteries = Console.ReadLine()
+                .Split(' ')
+                .Select(double.Parse)
+                .ToArray();
+
+            var usagePerHour = Console.ReadLine()
+                .Split(' ')
+                .Select(double.Parse)
+                .ToArray();
+
+            var stressTestHours = int.Parse(Console.ReadLine());
+
+            var testResulst = new List<int>();
+
+            for (int i = 0; i < capacitiesOfBatteries.Length; i++)
+            {
+                double drainedEnergy, restOfEnergy, percentage, lastHours;
+                int numOftestedBattery;
+                BatteryDiagnostic(capacitiesOfBatteries, usagePerHour, stressTestHours, i, out drainedEnergy, out numOftestedBattery, out restOfEnergy, out percentage, out lastHours);
+
+                if (capacitiesOfBatteries[i] % usagePerHour[i] > 0)
+                {
+                    lastHours++;
+                }
+
+                if (drainedEnergy > capacitiesOfBatteries[i])
+                {
+                    Console.WriteLine($"Battery {numOftestedBattery}: dead (lasted {(int)lastHours} hours)");
+                }
+                else
+                {
+                    Console.WriteLine($"Battery {numOftestedBattery}: {restOfEnergy} mAh ({percentage:F2})%");
+                }
+            }
+
+
+        }
+
+        private static void BatteryDiagnostic(double[] capacitiesOfBatteries, double[] usagePerHour, int stressTestHours, int i, out double drainedEnergy, out int numOftestedBattery, out double restOfEnergy, out double percentage, out double lastHours)
+        {
+            drainedEnergy = stressTestHours * usagePerHour[i];
+            numOftestedBattery = i + 1;
+            restOfEnergy = capacitiesOfBatteries[i] - drainedEnergy;
+            percentage = (restOfEnergy / capacitiesOfBatteries[i]) * 100;
+            lastHours = (int)capacitiesOfBatteries[i] / usagePerHour[i];
+        }
+
+        private static void DecodeRadioFrequencies()
+        {
+            var inputedNumbers = Console.ReadLine().Split(' ', '.').Select(int.Parse).ToArray();
+            var decodedStringFirst = new List<string>();
+            var decodedStringSecond = new List<string>();
+
+            for (int i = 0; i < inputedNumbers.Length; i++)
+            {
+                var currentChar = ((char)inputedNumbers[i]).ToString();
+
+                if (inputedNumbers[i] == 0)
+                {
+                    continue;
+                }
+                else
+                {
+                    if (i % 2 == 0)
+                    {
+                        decodedStringFirst.Add(currentChar);
+                    }
+                    else
+                    {
+                        decodedStringSecond.Insert(0, currentChar);
+                    }
+
+                }
+            }
+
+            Console.WriteLine(string.Join("", decodedStringFirst) + string.Join("", decodedStringSecond));
+
         }

         private static void ArrayHistogram()


add RefreshDistrictThemeInfos

add RefreshDistrictThemeInfos

--- BuildingThemes/BuildingThemesManager.cs
+++ BuildingThemes/BuildingThemesManager.cs
@@ -180,6 +180,20 @@
             }

             CompileDistrictThemes(districtId);
+        }
+
+        public void RefreshDistrictThemeInfos()
+        {
+            for (byte d = 0; d < districtThemeInfos.Length; d++)
+            {
+                var info = districtThemeInfos[d];
+                if(info == null) continue;
+
+                // Remove themes which are no longer listed in the configuration
+                info.themes.RemoveWhere(theme => !Configuration.themes.Contains(theme));
+
+                CompileDistrictThemes(d);
+            }
         }

         public void setThemeInfo(byte districtId, HashSet<Configuration.Theme> themes, bool blacklistMode)


Optimize hashing for APQ (#3186)

Optimize hashing for APQ (#3186)

--- src/GraphQL.MemoryCache/AutomaticPersistedQueries/AutomaticPersistedQueriesExecutionBase.cs
+++ src/GraphQL.MemoryCache/AutomaticPersistedQueries/AutomaticPersistedQueriesExecutionBase.cs
@@ -1,3 +1,5 @@
+using System.Buffers;
+using System.Diagnostics;
 using System.Security.Cryptography;
 using System.Text;
 using GraphQL.DI;
@@ -53,9 +55,22 @@
     /// </summary>
     protected virtual bool CheckHash(string hash, string query)
     {
-        var inputBytes = Encoding.UTF8.GetBytes(query);
+        var expected = Encoding.UTF8.GetByteCount(query);
+        var inputBytes = ArrayPool<byte>.Shared.Rent(expected);
+        var written = Encoding.UTF8.GetBytes(query, 0, query.Length, inputBytes, 0);
+        Debug.Assert(written == expected, $"Encoding.UTF8.GetBytes returned unexpected bytes: {written} instead of {expected}");
+
         var shaShared = Interlocked.Exchange(ref _sha256, null) ?? SHA256.Create();
-        var bytes = shaShared.ComputeHash(inputBytes);
+
+#if NET5_0_OR_GREATER
+        Span<byte> bytes = stackalloc byte[32];
+        if (!shaShared.TryComputeHash(inputBytes.AsSpan().Slice(0, written), bytes, out int bytesWritten))
+            throw new InvalidOperationException("Too small buffer for hash"); // should never happen
+#else
+        byte[] bytes = shaShared.ComputeHash(inputBytes, 0, written);
+#endif
+
+        ArrayPool<byte>.Shared.Return(inputBytes);
         Interlocked.CompareExchange(ref _sha256, shaShared, null);

 #if NET5_0_OR_GREATER


Get rid of unused variable

Get rid of unused variable

--- CPPCheckPlugin/CPPCheckPluginPackage.cs
+++ CPPCheckPlugin/CPPCheckPluginPackage.cs
@@ -117,7 +117,6 @@
 				return null;
 			}

-			List<SourceFile> files = new List<SourceFile>();
 			foreach (dynamic o in activeProjects)
 			{
 				dynamic project = o.Object;


Fixed a bug in match?

Fixed a bug in match?

--- Core/Loyc.Syntax/Lexing/BaseLexer.cs
+++ Core/Loyc.Syntax/Lexing/BaseLexer.cs
@@ -310,7 +310,7 @@
 		protected int Match(int a, int b)
 		{
 			int la = LA0;
-			if (la == a || la == b)
+            if (la != a && la != b)
 				Error(false, a, a, b, b);
 			else
 				InputPosition++;


Fixed loading of state file.

Fixed loading of state file.

--- src/Seq.App.FirstOfType/FirstOfTypeDetector.cs
+++ src/Seq.App.FirstOfType/FirstOfTypeDetector.cs
@@ -22,7 +22,7 @@
             {
                 var stateFile = Path.Combine(StoragePath, StateFilename);
                 if (File.Exists(stateFile))
-                    _filter = new UInt32BloomFilter(File.ReadAllBytes(StateFilename));
+                    _filter = new UInt32BloomFilter(File.ReadAllBytes(stateFile));
                 else
                     _filter = new UInt32BloomFilter();
             }


Increased timeout delay for session concurrency for 15 seconds

--- BlobCache/BlobCache/ConcurrencyModes/SessionConcurrencyHandler.cs
+++ BlobCache/BlobCache/ConcurrencyModes/SessionConcurrencyHandler.cs
@@ -17,7 +17,7 @@

         public SessionConcurrencyHandler()
         {
-            Timeout = 5000;
+            Timeout = 15000;
         }

         protected bool IsGlobal { get; set; } = false;


94: ExecuteNonQuery with nextAction

94: ExecuteNonQuery with nextAction

- also, invoke onComplete() when OpenConnection from ConnectionPool

--- src/SharpConnect.MySql/0_Public/MySqlClient.cs
+++ src/SharpConnect.MySql/0_Public/MySqlClient.cs
@@ -58,6 +58,7 @@
                 if (_conn != null)
                 {
                     FromConnectionPool = true;
+                    onComplete();
                 }
                 else
                 {
@@ -148,19 +149,21 @@
                 return reader;
             }
         }
-        public void ExecuteNonQuery()
-        {
+        public void ExecuteNonQuery(Action nextAction = null)
+        {
+
             if (_isPreparedStmt)
             {
-                _query.Execute();
+                _query.Execute(nextAction);
             }
             else
             {
                 _query = Connection.Conn.CreateQuery(CommandText, Parameters);
-                _query.Execute();
-            }
-        }
-        public uint LastInsertId
+                _query.Execute(nextAction);
+            }
+        }
+
+        public uint LastInsertedId
         {
             get
             {
@@ -181,10 +184,10 @@
             _query = Connection.Conn.CreateQuery(CommandText, Parameters);
             _query.Prepare();
         }
-    }
-
-
-
+
+
+
+    }

     public class MySqlDataReader
     {


Enable cors request from everywhere.

Enable cors request from everywhere.

--- CloudConfVarnaEdition4.0-RestAPI/Controllers/MatchesController.cs
+++ CloudConfVarnaEdition4.0-RestAPI/Controllers/MatchesController.cs
@@ -6,7 +6,8 @@

 namespace CloudConfVarnaEdition4._0_RestAPI.Controllers
 {
-    [EnableCors(origins: "http://cloudconfvarnamicroservices.azurewebsites.net", headers: "*", methods: "*")]
+    // Allow CORS for all origins. (Caution!)
+    [EnableCors(origins: "*", headers: "*", methods: "*")]
     public class MatchesController : ApiController
     {
         private static readonly MongoDbMatchRepository _repository = new MongoDbMatchRepository();


Annotated mandatory Batch application package upload parameters

--- src/ResourceManager/AzureBatch/Commands.Batch/Applications/UploadBatchApplicationCommand.cs
+++ src/ResourceManager/AzureBatch/Commands.Batch/Applications/UploadBatchApplicationCommand.cs
@@ -22,27 +22,27 @@
     [Cmdlet(VerbsCommon.New, Constants.AzureRmBatchApplicationPackage), OutputType(typeof(PSApplicationPackage))]
     public class UploadBatchApplicationCommand : BatchCmdletBase
     {
-        [Parameter(Position = 0, ValueFromPipelineByPropertyName = true)]
+        [Parameter(Position = 0, ValueFromPipelineByPropertyName = true, Mandatory = true)]
         [ValidateNotNullOrEmpty]
         public string AccountName { get; set; }

-        [Parameter(Position = 1, ValueFromPipelineByPropertyName = true)]
+        [Parameter(Position = 1, ValueFromPipelineByPropertyName = true, Mandatory = true)]
         [ValidateNotNullOrEmpty]
         public string ResourceGroupName { get; set; }

-        [Parameter(Position = 2, ValueFromPipelineByPropertyName = true)]
+        [Parameter(Position = 2, ValueFromPipelineByPropertyName = true, Mandatory = true)]
         [ValidateNotNullOrEmpty]
         public string ApplicationId { get; set; }

-        [Parameter(Position = 3, ValueFromPipelineByPropertyName = true)]
+        [Parameter(Position = 3, ValueFromPipelineByPropertyName = true, Mandatory = true)]
         [ValidateNotNullOrEmpty]
         public string ApplicationVersion { get; set; }

-        [Parameter(Position = 4, ValueFromPipelineByPropertyName = true)]
+        [Parameter(Position = 4, ValueFromPipelineByPropertyName = true, Mandatory = true)]
         [ValidateNotNullOrEmpty]
         public string FilePath { get; set; }

-        [Parameter(Position = 5, ValueFromPipelineByPropertyName = true)]
+        [Parameter(Position = 5, ValueFromPipelineByPropertyName = true, Mandatory = true)]
         [ValidateNotNullOrEmpty]
         public string Format { get; set; }


Use the new valid rename field tag id in integration tests

--- src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/InlineRenameDialog_OutOfProc.cs
+++ src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/InlineRenameDialog_OutOfProc.cs
@@ -1,5 +1,6 @@
 // Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

+using Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.HighlightTags;
 using Microsoft.CodeAnalysis.Shared.TestHooks;
 using Microsoft.VisualStudio.IntegrationTest.Utilities.Input;

@@ -9,7 +10,7 @@
     {
         private const string ChangeSignatureDialogAutomationId = "InlineRenameDialog";

-        public string ValidRenameTag => "RoslynRenameValidTag";
+        public string ValidRenameTag => RenameFieldBackgroundAndBorderTag.TagId;

         public InlineRenameDialog_OutOfProc(VisualStudioInstance visualStudioInstance)
             : base(visualStudioInstance)


Open character window centered (#3735)

Open character window centered (#3735)

--- Content.Client/GameObjects/Components/Actor/CharacterInterface.cs
+++ Content.Client/GameObjects/Components/Actor/CharacterInterface.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.Linq;
 using Content.Client.GameObjects.Components.Mobs;
 using Content.Client.UserInterface;
@@ -90,7 +90,7 @@
                         {
                             if (b)
                             {
-                                Window.Open();
+                                Window.OpenCentered();
                             }
                             else
                             {


TMPro Additions

TMPro Additions

- Exposing a couple of vars
- Running some xml number values through PlanetUnityOverride.processString()

--- PUTMPro.cs
+++ PUTMPro.cs
@@ -199,8 +199,10 @@
 	public string font;
 	public string fontStyle;
 	public int fontSize = 32;
+	public int lineSpacing = 0;
 	public Color fontColor = Color.white;
 	public TextAlignmentOptions alignment = TextAlignmentOptions.TopLeft;
+	public TextOverflowModes overflowMode = TextOverflowModes.Truncate;

 	public PUTMPro() {

@@ -252,7 +254,11 @@

 			attrib = reader.GetAttribute ("fontSize");
 			if (attrib != null) {
-				fontSize = int.Parse (attrib);
+				string testStr = PlanetUnityOverride.processString (_parent, attrib);
+				float testF = float.Parse (testStr);
+				int testI1 = (int)testF;
+				int testI2 = int.Parse (testStr);
+				fontSize = testI2;//int.Parse ();
 			}

 			attrib = reader.GetAttribute ("fontStyle");
@@ -262,12 +268,12 @@

 			attrib = reader.GetAttribute ("sizeToFit");
 			if (attrib != null) {
-				sizeToFit = bool.Parse (attrib);
+				sizeToFit = bool.Parse (PlanetUnityOverride.processString(_parent, attrib));
 			}

 			attrib = reader.GetAttribute ("maxSize");
 			if (attrib != null) {
-				maxSize = int.Parse (attrib);
+				maxSize = int.Parse (PlanetUnityOverride.processString(_parent, attrib));
 			}

 			attrib = reader.GetAttribute ("enableWordWrapping");
@@ -282,7 +288,7 @@

 			attrib = reader.GetAttribute ("minSize");
 			if (attrib != null) {
-				minSize = int.Parse (attrib);
+				minSize = int.Parse (PlanetUnityOverride.processString(_parent, attrib));
 			}

 			attrib = reader.GetAttribute ("alignment");
@@ -293,6 +299,16 @@
 			attrib = reader.GetAttribute ("fontColor");
 			if (attrib != null) {
 				fontColor = fontColor.PUParse (attrib);
+			}
+
+			attrib = reader.GetAttribute ("overflowMode");
+			if (attrib != null) {
+				overflowMode = (TextOverflowModes)Enum.Parse(typeof(TextOverflowModes), attrib);
+			}
+
+			attrib = reader.GetAttribute ("lineSpacing");
+			if (attrib != null) {
+				lineSpacing = (int)(float.Parse (PlanetUnityOverride.processString(_parent, attrib)));
 			}

 			value = reader.GetAttribute ("value");
@@ -341,13 +357,14 @@
 			textGUI.fontStyle = (FontStyles)Enum.Parse (typeof(FontStyles), fontStyle);
 		}
 		textGUI.fontSize = fontSize;
-		textGUI.OverflowMode = TextOverflowModes.Truncate;
+		textGUI.OverflowMode = overflowMode;
 		textGUI.extraPadding = true;

 		if (maxVisibleLines > 0) {
 			textGUI.maxVisibleLines = maxVisibleLines;
 		}
 		textGUI.enableAutoSizing = sizeToFit;
+		textGUI.lineSpacing = lineSpacing;
 		textGUI.fontSizeMin = minSize;
 		textGUI.fontSizeMax = maxSize;


Removed IO.Fix, added IO.Promote

Removed IO.Fix, added IO.Promote

--- ZedSharp/IO.cs
+++ ZedSharp/IO.cs
@@ -24,7 +24,7 @@

         public static IO<A> Flatten<A>(this IO<IO<A>> io)
         {
-            return IO.Of(() => io.Eval().Eval());
+            return Of(() => io.Eval().Eval());
         }

         public static IO<A> Sum<A>(this IEnumerable<IO<A>> seq)
@@ -34,12 +34,12 @@

         public static IO<IEnumerable<A>> Sequence<A>(this IEnumerable<IO<A>> seq)
         {
-            return IO.Of(() => seq.Select(Eval));
+            return Of(() => seq.Select(Eval));
         }

         public static IO<Unit> Sequence(this IEnumerable<IO<Unit>> seq)
         {
-            return IO.Of(() =>
+            return Of(() =>
             {
                 foreach (var io in seq)
                     io.Eval();
@@ -53,13 +53,13 @@
             return a => f(a).SelectMany(g);
         }

-        public static IO<A> Fix<A>(this Func<A, IO<A>> f)
+        public static IO<Func<A, B>> Promote<A, B>(Func<A, IO<B>> f)
         {
-            return f(Fix(f).Eval());
+            return Of<Func<A, B>>(() => a => f(a).Eval());
         }

-        public static readonly IO<DateTime> Now = IO.Of(() => DateTime.Now);
-        public static readonly IO<DateTime> UtcNow = IO.Of(() => DateTime.UtcNow);
+        public static readonly IO<DateTime> Now = Of(() => DateTime.Now);
+        public static readonly IO<DateTime> UtcNow = Of(() => DateTime.UtcNow);

         private static A Eval<A>(IO<A> io)
         {
@@ -118,6 +118,8 @@
         public IO<B> Forever<B>()
         {
             var me = this;
+
+            // ReSharper disable once FunctionNeverReturns
             return IO.Of<B>(() => { while (true) me.Eval(); });
         }


Working on fixing git trust issues.

Working on fixing git trust issues.

--- CitadelService/Services/TrustManager.cs
+++ CitadelService/Services/TrustManager.cs
@@ -76,6 +76,7 @@
                 if(File.Exists(gitPath))
                 {
                     installedGits.Add(gitPath);
+                    m_logger.Info("Found git.exe at {0}", gitPath);
                 }
             }

@@ -107,10 +108,6 @@
                         bundleBuilder.Append(cert.ExportToPem());
                         bundleBuilder.Append("\r\n");
                     }
-                    else
-                    {
-                        m_logger.Info("Found cert {0}", cert.SubjectName.Decode(X500DistinguishedNameFlags.None));
-                    }
                 }

                 File.WriteAllText(cloudVeilCertificateBundlePath, bundleBuilder.ToString());
@@ -134,26 +131,15 @@
             // Next, loop through installed git.exe's and set their CA bundle to use the one we just created.
             foreach(string gitExe in installedGits)
             {
-                Process process = Process.Start(gitExe, $"config --global http.sslCAInfo \"{gitCompatibleBundlePath}\"");
-                waitFor.Add(process);
-            }
-
-            // Wait for the git processes to close before allowing the filter to continue.
-            int timeout = 500;
-            Stopwatch timeoutStopwatch = Stopwatch.StartNew();
-            while (timeoutStopwatch.ElapsedMilliseconds < timeout && waitFor.Count > 0)
-            {
-                for(int i = 0; i < waitFor.Count; i++)
-                {
-                    waitFor[i].WaitForExit(10);
-
-                    if(waitFor[i].HasExited)
-                    {
-                        waitFor.RemoveAt(i);
-                        i--;
-                        continue;
-                    }
-                }
+                string arguments = $"config --global http.sslCAInfo \"{gitCompatibleBundlePath}\"";
+                //ProcessExtensions.StartProcessAsCurrentUser(gitExe, arguments, Path.GetDirectoryName(gitExe), false);
+                Process process = Process.Start(new ProcessStartInfo(gitExe, arguments)
+                {
+
+                });
+
+                process.WaitForExit(1000);
+                m_logger.Info("Git ran with {0}", process.ExitCode);
             }
         }


Update EntityObjectStore.cs

Update EntityObjectStore.cs

--- Core/NakedObjects.Persistor.Entity/Component/EntityObjectStore.cs
+++ Core/NakedObjects.Persistor.Entity/Component/EntityObjectStore.cs
@@ -914,7 +914,7 @@
                 catch (InvalidOperationException)
                 {
                     // not an EF recognised entity
-                    Log.Warn($"Attempting to 'Count' a non attached entity: {field.Id}");
+                    logger.LogWarning($"Attempting to 'Count' a non attached entity: {field.Id}");
                 }
             }


Issue #43: if a nupkg file already exists, overwrite it

--- src/Squirrel/UpdateManager.DownloadReleases.cs
+++ src/Squirrel/UpdateManager.DownloadReleases.cs
@@ -23,22 +23,27 @@
             {
                 progress = progress ?? (_ => { });
                 urlDownloader = urlDownloader ?? new FileDownloader();
+                var packagesDirectory = Path.Combine(rootAppDirectory, "packages");

                 int current = 0;
                 int toIncrement = (int)(100.0 / releasesToDownload.Count());

                 if (Utility.IsHttpUrl(updateUrlOrPath)) {
                     await releasesToDownload.ForEachAsync(async x => {
+                        var targetFile = Path.Combine(packagesDirectory, x.Filename);
+                        File.Delete(targetFile);
                         await urlDownloader.DownloadFile(
                             String.Format("{0}/{1}", updateUrlOrPath, x.Filename),
-                            Path.Combine(rootAppDirectory, "packages", x.Filename));
+                            targetFile);
                         lock (progress) progress(current += toIncrement);
                     });
                 } else {
                     await releasesToDownload.ForEachAsync(x => {
+                        var targetFile = Path.Combine(packagesDirectory, x.Filename);
                         File.Copy(
                             Path.Combine(updateUrlOrPath, x.Filename),
-                            Path.Combine(rootAppDirectory, "packages", x.Filename));
+                            targetFile,
+                            true);
                         lock (progress) progress(current += toIncrement);
                     });
                 }


Jordan/Simon 730/732 Added metadescription to eventshomepage

--- src/StockportContentApi/Model/EventHomepage.cs
+++ src/StockportContentApi/Model/EventHomepage.cs
@@ -14,6 +14,8 @@
         public IEnumerable<EventHomepageRow> Rows { get; }
         public IEnumerable<EventCategory> Categories { get; set; }

+        public string MetaDescription { get; set; }
+
         public EventHomepage(IEnumerable<EventHomepageRow> rows)
         {
             Rows = rows;


Me route should return JSON for HTML requests (fixes #26)

--- src/Stormpath.Owin.Middleware/Route/MeRoute.cs
+++ src/Stormpath.Owin.Middleware/Route/MeRoute.cs
@@ -32,6 +32,11 @@
 {
     public class MeRoute : AbstractRoute
     {
+        protected override Task<bool> GetHtmlAsync(IOwinEnvironment context, IClient client, CancellationToken cancellationToken)
+        {
+            return GetJsonAsync(context, client, cancellationToken);
+        }
+
         protected override async Task<bool> GetJsonAsync(IOwinEnvironment context, IClient client, CancellationToken cancellationToken)
         {
             Caching.AddDoNotCacheHeaders(context);


Add Sql Server BIGINT type mapping

Add Sql Server BIGINT type mapping

--- src/StrangerData.SqlServer/SqlServerDialect.cs
+++ src/StrangerData.SqlServer/SqlServerDialect.cs
@@ -108,6 +108,9 @@
                         case "SMALLINT":
                             tableColumnInfo.ColumnType = ColumnType.Int;
                             break;
+                        case "BIGINT":
+                            tableColumnInfo.ColumnType = ColumnType.Long;
+                            break;
                         case "UNIQUEIDENTIFIER":
                             tableColumnInfo.ColumnType = ColumnType.Guid;
                             break;


add twitter login actions

add twitter login actions

--- src/TBlockSharer/Controllers/HomeController.cs
+++ src/TBlockSharer/Controllers/HomeController.cs
@@ -26,5 +26,32 @@

             return View();
         }
+
+        public async Task<ActionResult> Login()
+        {
+            var auth = new MvcSignInAuthorizer
+            {
+                CredentialStore = new SessionStateCredentialStore
+                {
+                    ConsumerKey = ConfigurationManager.AppSettings["twitterConsumerKey"],
+                    ConsumerSecret = ConfigurationManager.AppSettings["twitterConsumerSecret"]
+                }
+            };
+
+            string callbackUrl = Request.Url.ToString().Replace("Login", "LoginComplete");
+            return await auth.BeginAuthorizationAsync(new Uri(callbackUrl));
+        }
+
+        public async Task<ActionResult> LoginComplete()
+        {
+            var auth = new MvcAuthorizer
+            {
+                CredentialStore = new SessionStateCredentialStore()
+            };
+
+            await auth.CompleteAuthorizeAsync(Request.Url);
+            //return View("Index", new Models.Index() { BlockedUsers = new string[] { "hello" } });
+            return RedirectToAction("Index");
+        }
     }
 }


Add reference to Duality on scripts

Add reference to Duality on scripts

--- CorePlugin/Python/ExecutionEngine.cs
+++ CorePlugin/Python/ExecutionEngine.cs
@@ -17,9 +17,29 @@
         private CompiledCode _code;
         private object _class;

-        public PythonExecutionEngine(string script, string className = "PyModule")
+        public PythonExecutionEngine(string source, string className = "PyModule")
         {
-            if (string.IsNullOrEmpty(script)) throw new ArgumentException("script");
+            if (string.IsNullOrEmpty(source)) throw new ArgumentException("script");
+            string[] requiredAssemblies = new string[]
+            {
+                System.IO.Path.Combine(Environment.CurrentDirectory, "OpenTK.dll"),
+                System.IO.Path.Combine(Environment.CurrentDirectory, "Duality.dll"),
+                System.IO.Path.Combine(Environment.CurrentDirectory, "DualityPrimitives.dll")
+            };
+
+            // Add reference to Duality binaries
+            var builder = new System.Text.StringBuilder();
+            builder.AppendLine("import sys");
+            builder.AppendLine("import clr");
+            builder.AppendLine();
+            foreach (string assembly in requiredAssemblies)
+                builder.AppendLine(string.Format("clr.AddReferenceToFileAndPath(r\"{0}\")", assembly));
+            builder.AppendLine();
+            builder.AppendLine("from Duality import Vector2");
+            builder.AppendLine();
+
+            string script = source.Insert(0, builder.ToString());
+            Console.WriteLine(script);

             _engine = Python.CreateEngine();
             _engine = Python.CreateEngine();


Try to fix byte to string encoding

Try to fix byte to string encoding

--- src/WeatherLink/Controllers/SlackController.cs
+++ src/WeatherLink/Controllers/SlackController.cs
@@ -124,15 +124,14 @@
                 && Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - timestamp) <= 60 * 5)
             {
                 var signature = $"v0:{timestamp}:{Request.Body.ToString()}";
-                var encoding = new UTF8Encoding();
-                using var hmac = new HMACSHA256(encoding.GetBytes(optionsAccessor.Value.SlackSigningSecret));
-                var hashedSignature = hmac.ComputeHash(encoding.GetBytes(signature));
-                var mySignature = $"v0={hashedSignature}";
+                using var hmac = new HMACSHA256(Encoding.Default.GetBytes(optionsAccessor.Value.SlackSigningSecret));
+                var hashedSignature = hmac.ComputeHash(Encoding.Default.GetBytes(signature));
+                var mySignature = $"v0={Encoding.Default.GetString(hashedSignature)}";

                 Console.WriteLine($"mySignature: {mySignature}");
                 Console.WriteLine($"slackSignature: {Request.Headers?["X-Slack-Signature"]}");

-                signatureMatch = encoding.GetBytes(mySignature) == encoding.GetBytes(Request.Headers?["X-Slack-Signature"]);
+                signatureMatch = Encoding.Default.GetBytes(mySignature) == Encoding.Default.GetBytes(Request.Headers?["X-Slack-Signature"]);
             }
             return signatureMatch;
         }


Fix action bar duplication (#12456)

Fix action bar duplication (#12456)

--- Content.Client/Actions/ActionsSystem.cs
+++ Content.Client/Actions/ActionsSystem.cs
@@ -87,6 +87,9 @@
                 added.Add(action);
             }

+            if (_playerManager.LocalPlayer?.ControlledEntity != uid)
+                return;
+
             foreach (var action in removed)
             {
                 ActionRemoved?.Invoke(action);


Reduce do_after allocations (#7439)

Reduce do_after allocations (#7439)

--- Content.Client/DoAfter/DoAfterSystem.cs
+++ Content.Client/DoAfter/DoAfterSystem.cs
@@ -175,9 +175,7 @@
         ///     Mark a DoAfter as cancelled and show a cancellation graphic.
         /// </summary>
         ///     Actual removal is handled by DoAfterEntitySystem.
-        /// <param name="id"></param>
-        /// <param name="currentTime"></param>
-        public void Cancel(DoAfterComponent component, byte id, TimeSpan? currentTime = null)
+        public void Cancel(DoAfterComponent component, byte id)
         {
             foreach (var (_, cancelled) in component.CancelledDoAfters)
             {
@@ -204,7 +202,7 @@
                 return;

             // ReSharper disable once ConvertToLocalFunction
-            var predicate = (EntityUid uid, (EntityUid compOwner, EntityUid? attachedEntity) data)
+            var predicate = static (EntityUid uid, (EntityUid compOwner, EntityUid? attachedEntity) data)
                 => uid == data.compOwner || uid == data.attachedEntity;

             var viewbox = _eyeManager.GetWorldViewport().Enlarged(2.0f);
@@ -213,7 +211,7 @@

             foreach (var (comp, xform) in EntityManager.EntityQuery<DoAfterComponent, TransformComponent>(true))
             {
-                var doAfters = comp.DoAfters.ToList();
+                var doAfters = comp.DoAfters;
                 var compPos = xform.MapPosition;

                 if (doAfters.Count == 0 ||
@@ -239,6 +237,7 @@
                 Enable(comp);

                 var userGrid = xform.Coordinates;
+                var toRemove = new RemQueue<ClientDoAfter>();

                 // Check cancellations / finishes
                 foreach (var (id, doAfter) in doAfters)
@@ -248,7 +247,7 @@
                     // If we've passed the final time (after the excess to show completion graphic) then remove.
                     if (elapsedTime > doAfter.Delay + ExcessTime)
                     {
-                        Remove(comp, doAfter);
+                        toRemove.Add(doAfter);
                         continue;
                     }

@@ -261,7 +260,7 @@
                     {
                         if (!userGrid.InRange(EntityManager, doAfter.UserGrid, doAfter.MovementThreshold))
                         {
-                            Cancel(comp, id, currentTime);
+                            Cancel(comp, id);
                             continue;
                         }
                     }
@@ -272,10 +271,15 @@
                             !Transform(doAfter.Target.Value).Coordinates.InRange(EntityManager, doAfter.TargetGrid,
                                 doAfter.MovementThreshold))
                         {
-                            Cancel(comp, id, currentTime);
+                            Cancel(comp, id);
                             continue;
                         }
                     }
+                }
+
+                foreach (var doAfter in toRemove)
+                {
+                    Remove(comp, doAfter);
                 }

                 var count = comp.CancelledDoAfters.Count;


update to show send local

update to show send local

--- Program.cs
+++ Program.cs
@@ -4,8 +4,10 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Timers;
 using Rebus.Activation;
 using Rebus.Config;
+using Rebus.Handlers;

 namespace RebusExample
 {
@@ -15,14 +17,33 @@
         {
             using (var activator = new BuiltinHandlerActivator())
             {
+                activator.Register(() => new PrintDateTime());
+
                 var connectionString = ConfigurationManager.AppSettings["serviceBus"];
                 Configure.With(activator)
                     .Transport(t => t.UseAzureServiceBus(connectionString, "rebusQueue")).Start();
+                var timer = new Timer();
+                timer.Elapsed += delegate
+                {
+                    activator.Bus.SendLocal(DateTime.Now).Wait();
+
+                };
+                timer.Interval = 1000;
+                timer.Start();
+
+                Console.ReadLine();
             }
-            Console.WriteLine("q");
-            Console.ReadLine();
+

         }
     }
+
+    internal class PrintDateTime : IHandleMessages<DateTime>
+    {
+        public async Task Handle(DateTime message)
+        {
+            Console.WriteLine("The time is {0}",message);
+        }
+    }
 }


Added shooting counter display.

Added shooting counter display.

--- Program.cs
+++ Program.cs
@@ -15,11 +15,14 @@
             var game = new RestApi();
             var gameId = game.CreateNewGame();
             GameState state;
+            var shoots = 0;
             do
             {
+                shoots++;
                 var coords = d.CellToAttack();
                 state = game.Shoot(gameId, coords.Item1, coords.Item2);
             } while (!state.IsFinished);
+            Console.WriteLine("Total shoots: " + shoots);
         }
     }
 }


Version++

Version++

--- Program.cs
+++ Program.cs
@@ -17,7 +17,7 @@
 {
     internal static class Program
     {
-        public const string Version = "210771";
+        public const string Version = "210780";
         public static Configuration Config;
         public static LanguageManager LanguageManager;
         public static ChatClient ChatServer;


Update Program.cs

Update Program.cs

lost order expression

--- Program.cs
+++ Program.cs
@@ -42,7 +42,7 @@
                     select y.last).
                     GroupBy(x => x)
                     .Select(group => new { name = group.Key, count = group.Count() })
-                    .OrderByDescending(x=> x.count);
+                    .OrderByDescending(x=> x.count).ThenBy(x=>x.name);
         }

         /// <summary>