Uniform code style.

Uniform code style.

--- src/formulate.app/Helpers/JsonHelper.cs
+++ src/formulate.app/Helpers/JsonHelper.cs
@@ -57,15 +57,26 @@
             return result;
         }

+
         /// <summary>
-        /// Serializes a JSON string that log4net doesn't complain about (brackets are escaped). It also adds indenting for readability
+        /// Reserializes a JSON string that log4net doesn't complain about (brackets are escaped).
+        /// It also adds indenting for readability.
         /// </summary>
-        /// <param name="input">The JSON string</param>
-        /// <returns>Escaped, indented, JSON string for logging</returns>
+        /// <param name="input">
+        /// The JSON string to reserialize.
+        /// </param>
+        /// <returns>
+        /// Escaped, indented, camel-cased JSON string for logging.
+        /// </returns>
         public static string FormatJsonForLogging(string input)
         {
+
+            // Convert JSON string to object.
             var generic = JsonConvert.DeserializeObject<dynamic>(input);

+
+            // Convert back to JSON string with specific settings (e.g., indenting, camel casing).
+            // Then, escape curly braces.
             return JsonConvert.SerializeObject(generic,
                 Formatting.Indented,
                 new JsonSerializerSettings
@@ -74,6 +85,7 @@
                 })
                 .Replace("{", "{{")
                 .Replace("}", "}}");
+
         }

         #endregion


Fix for request url in HttpListenerRequest.cs

--- websocket-sharp/Net/HttpListenerRequest.cs
+++ websocket-sharp/Net/HttpListenerRequest.cs
@@ -579,43 +579,38 @@
         host = UserHostAddress;

       string path = null;
-      Uri rawUri;
-      if (_rawUrl == "*") {
-      }
-      else if (_rawUrl.StartsWith ("/")) {
+      if (_rawUrl.StartsWith ("/")) {
         path = HttpUtility.UrlDecode (_rawUrl);
       }
-      else if (_rawUrl.MaybeUri () && Uri.TryCreate (_rawUrl, UriKind.Absolute, out rawUri)) {
-        host = rawUri.Host;
-        path = rawUri.PathAndQuery;
+      else if (_rawUrl.MaybeUri ()) {
+        if (!Uri.TryCreate (_rawUrl, UriKind.Absolute, out _url) ||
+            !(_url.Scheme.StartsWith ("http") || _url.Scheme.StartsWith ("ws"))) {
+          _context.ErrorMessage = "Invalid request url: " + _rawUrl;
+          return;
+        }
+      }
+      else if (_rawUrl == "*") {
       }
       else {
-        var authority = HttpUtility.UrlDecode (_rawUrl);
-        var slash = authority.IndexOf ('/');
-        if (slash > -1) {
-          host = authority.Substring (0, slash);
-          path = authority.Substring (slash);
-        }
-        else {
-          host = authority;
-        }
-      }
-
-      var colon = host.IndexOf (':');
-      if (colon > -1)
-        host = host.Substring (0, colon);
-
-      var scheme = IsWebSocketRequest ? "ws" : "http";
-      var url = String.Format (
-        "{0}://{1}:{2}{3}",
-        IsSecureConnection ? scheme + "s" : scheme,
-        host,
-        LocalEndPoint.Port,
-        path);
-
-      if (!Uri.TryCreate (url, UriKind.Absolute, out _url)) {
-        _context.ErrorMessage = "Invalid request url: " + url;
-        return;
+        // As authority form
+        host = HttpUtility.UrlDecode (_rawUrl);
+      }
+
+      if (_url == null) {
+        var scheme = IsWebSocketRequest ? "ws" : "http";
+        var secure = IsSecureConnection;
+        if (secure)
+          scheme += "s";
+
+        var colon = host.IndexOf (':');
+        if (colon == -1)
+          host = String.Format ("{0}:{1}", host, secure ? 443 : 80);
+
+        var url = String.Format ("{0}://{1}{2}", scheme, host, path);
+        if (!Uri.TryCreate (url, UriKind.Absolute, out _url)) {
+          _context.ErrorMessage = "Invalid request url: " + url;
+          return;
+        }
       }

       _queryString = createQueryString (_url.Query);


[Modify] Remove it

[Modify] Remove it


Fix SSPIException serialization

Fix SSPIException serialization

It was failing due to a typo in a field name.

--- NSspi/SSPIException.cs
+++ NSspi/SSPIException.cs
@@ -35,7 +35,7 @@
         protected SSPIException( SerializationInfo info, StreamingContext context )
             : base( info, context )
         {
-            this.message = info.GetString( "messsage" );
+            this.message = info.GetString("message");
             this.errorCode = (SecurityStatus)info.GetUInt32( "errorCode" );
         }


Improve the PipelineExtension markup.

Improve the PipelineExtension markup.

--- Source/Accelerider.Windows.Resources/Converters/PipelineExtension.cs
+++ Source/Accelerider.Windows.Resources/Converters/PipelineExtension.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Globalization;
 using System.Linq;
@@ -10,23 +9,46 @@
 {
     /*
      * e.g.: Visibility={Binding BooleanValue, Converter={converters:Pipeline {StaticResource NotConverter}, {StaticResource BooleanToVisibilityConverter}}}
+     * But in ControlTemplate or DataTemplate, this syntax will throw an NullReferenceException, and must use the following syntax:
+     *
+     *    <Binding Path="Parent">
+     *         <Binding.Converter>
+     *             <converters:Pipeline>
+     *                 <converters:Pipeline.Converters>
+     *                     <converters:ConverterCollection>
+     *                         <StaticResource ResourceKey="IsNullOperator"/>
+     *                         <StaticResource ResourceKey="NotOperator" />
+     *                         <StaticResource ResourceKey="BooleanToVisibilityConverter"/>
+     *                     </converters:ConverterCollection>
+     *                 </converters:Pipeline.Converters>
+     *             </converters:Pipeline>
+     *         </Binding.Converter>
+     *     </Binding>
      */

     [MarkupExtensionReturnType(typeof(IValueConverter))]
-    public class PipelineExtension : MarkupExtension
+    public class PipelineExtension : MarkupExtension, IValueConverter
     {
-        private ConverterCollection Converters { get; set; }
+        [ConstructorArgument(nameof(Converters))]
+        public ConverterCollection Converters { get; set; } = new ConverterCollection();

         #region Ctors

         /*
          * Have to list these constructor overloads here,
          * because the stupid xaml does not support the "params" keyword.
-         * e.g.: ctor(params IValueConverter[] converters).
+         * e.g.: ctor(params IValueConverter[] converters) cannot be used.
          */

-        public PipelineExtension(IValueConverter converter1, IValueConverter converter2) =>
-            Converters = new ConverterCollection { converter1, converter2 };
+        public PipelineExtension()
+        {
+        }
+
+        public PipelineExtension(IValueConverter converter1, IValueConverter converter2)
+        {
+            Converters.Add(converter1);
+            Converters.Add(converter2);
+        }

         public PipelineExtension(IValueConverter converter1, IValueConverter converter2, IValueConverter converter3)
             : this(converter1, converter2) => Converters.Add(converter3);
@@ -39,20 +61,13 @@

         #endregion

-        public override object ProvideValue(IServiceProvider serviceProvider) => new ConverterAggregator(Converters);
+        public override object ProvideValue(IServiceProvider serviceProvider) => this;

-        private class ConverterAggregator : IValueConverter
-        {
-            private readonly IEnumerable<IValueConverter> _converters;
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
+            Converters.Aggregate(value, (current, converter) => converter.Convert(current, targetType, parameter, culture));

-            public ConverterAggregator(IEnumerable<IValueConverter> converters) => _converters = converters;
-
-            public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
-                _converters.Aggregate(value, (current, converter) => converter.Convert(current, targetType, parameter, culture));
-
-            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) =>
-                _converters.Aggregate(value, (current, converter) => converter.ConvertBack(current, targetType, parameter, culture));
-        }
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) =>
+            Converters.Aggregate(value, (current, converter) => converter.ConvertBack(current, targetType, parameter, culture));
     }

     public class ConverterCollection : Collection<IValueConverter>


Fix billboard char offset

Fix billboard char offset

--- Source/HelixToolkit.SharpDX.Shared/Model/Geometry/BillboardText3D.cs
+++ Source/HelixToolkit.SharpDX.Shared/Model/Geometry/BillboardText3D.cs
@@ -114,9 +114,7 @@
                         default:
                             Character data = bmpFont[character];
                             int kerning = bmpFont.GetKerning(previousCharacter, character);
-
-                            //DrawCharacter(data, x + data.Offset.X + kerning, y + data.Offset.Y, builder);
-                            DrawCharacter(data, new Vector3(x, y, 0), w, h, kerning, textInfo);
+                            DrawCharacter(data, new Vector3(x + data.Offset.X, y - data.Offset.Y, 0), w, h, kerning, textInfo);

                             x += data.XAdvance + kerning;
                             break;
@@ -134,8 +132,8 @@
             var ch = character.Bounds.Height;
             var cu = character.Bounds.Left;
             var cv = character.Bounds.Top;
-            var tl = new Vector2(origin.X + kerning, origin.Y + ch);
-            var br = new Vector2(origin.X + cw + kerning, origin.Y);
+            var tl = new Vector2(origin.X + kerning, origin.Y );
+            var br = new Vector2(origin.X + cw + kerning, origin.Y - ch);

             var uv_tl = new Vector2(cu / w, cv / h);
             var uv_br = new Vector2((cu + cw) / w, (cv + ch) / h);


fix carriage returns

fix carriage returns

--- Tharga.Influx-Capacitor.Collector/Entities/PerformanceCounterInfo.cs
+++ Tharga.Influx-Capacitor.Collector/Entities/PerformanceCounterInfo.cs
@@ -83,8 +83,8 @@
         /// </summary>
         public string FieldName { get { return _fieldName; } }

-        public string MachineName { get { return _performanceCounters == null ? null : _performanceCounters.MachineName; } }
-
+        public string MachineName { get { return _performanceCounters == null ? null : _performanceCounters.MachineName; } }
+
         public string Alias { get { return _alias; } }

         public IEnumerable<ITag> Tags { get { return _tags; } }


Fix audio task multi attaching

Fix audio task multi attaching

should improve memory

--- Agents/Audiotica.WindowsPhone.Player/AudioTask.cs
+++ Agents/Audiotica.WindowsPhone.Player/AudioTask.cs
@@ -133,7 +133,6 @@
             try
             {
                 //save state
-                AppSettingsHelper.Write(PlayerConstants.CurrentTrack, queueManager.CurrentTrack.SongId);
                 AppSettingsHelper.Write(PlayerConstants.Position,
                     BackgroundMediaPlayer.Current.Position.ToString());
                 AppSettingsHelper.Write(PlayerConstants.BackgroundTaskState,
@@ -145,10 +144,13 @@
                 //unsubscribe event handlers
                 _systemmediatransportcontrol.ButtonPressed -= systemmediatransportcontrol_ButtonPressed;
                 _systemmediatransportcontrol.PropertyChanged -= systemmediatransportcontrol_PropertyChanged;
-                queueManager.TrackChanged -= playList_TrackChanged;
-
-                //clear objects task cancellation can happen uninterrupted
-                _queueManager = null;
+
+                if (_queueManager != null)
+                {
+                    AppSettingsHelper.Write(PlayerConstants.CurrentTrack, queueManager.CurrentTrack.SongId);
+                    queueManager.TrackChanged -= playList_TrackChanged;
+                    _queueManager = null;
+                }
                 BackgroundMediaPlayer.Shutdown(); // shutdown media pipeline
             }
             catch (Exception ex)
@@ -347,7 +349,6 @@
                         //Foreground App process has signalled that it is ready for playback
                         Debug.WriteLine("Starting Playback");
                         _queueManager.RefreshTracks();
-                        queueManager.TrackChanged += playList_TrackChanged;
                         StartPlayback();
                         break;
                     case PlayerConstants.SkipNext: // User has chosen to skip track from app context.


Add error logging for ErrorDescriptorToBorderColorConverter.

--- WalletWasabi.Gui/Converters/ErrorDescriptorToBorderColorConverter.cs
+++ WalletWasabi.Gui/Converters/ErrorDescriptorToBorderColorConverter.cs
@@ -5,6 +5,7 @@
 using System.Globalization;
 using System.Linq;
 using WalletWasabi.Models;
+using WalletWasabi.Logging;

 namespace WalletWasabi.Gui.Converters
 {
@@ -24,6 +25,7 @@
 							descriptors.Add(ed);
 							break;
 						case Exception ex:
+							Logger.LogError(ex);
 							break;
 					}
 				}


made restriction more accurate

made restriction more accurate

--- source/Windows/StickyWindow.cs
+++ source/Windows/StickyWindow.cs
@@ -90,7 +90,7 @@
                 _watch = Stopwatch.StartNew();
             }

-            if (_watch.ElapsedMilliseconds > 32) // executes 30 times per second
+            if (_watch.ElapsedMilliseconds > 34) // executes 30 times per second
             {
                 if (BypassTopmost) PlaceAboveWindow(ParentWindowHandle);
                 FitToWindow(ParentWindowHandle, AttachToClientArea);


Debug overlay window ID is too common and may easily conflict with people's code. (#22)

Giving 0 for the window ID is probably what 6502% of people does when writing some GUI code. Changing it to an unlikely value vastly reduces this possibility. Maybe a good idea to document this on the library docs somewhere too.

--- Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs
+++ Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs
@@ -470,7 +470,8 @@
         {
             if (studioSystem.isValid() && isOverlayEnabled)
             {
-                windowRect = GUI.Window(0, windowRect, DrawDebugOverlay, "FMOD Studio Debug");
+                int window_id = ('F'+'M'+'O'+'D' + 'D'+'E'+'B'+'U'+'G' + 'O'+'V'+'E'+'R'+'L'+'A'+'Y') * 0xC001 ;
+                windowRect = GUI.Window(window_id, windowRect, DrawDebugOverlay, "FMOD Studio Debug");
             }
         }

@@ -1145,4 +1146,4 @@
         private static extern FMOD.RESULT FmodUnityNativePluginInit(IntPtr system);
         #endif
     }
-}+}


fix a bug in setting Tools.current

fix a bug in setting Tools.current

--- Assets/RagePixel2/Editor/RagePixelEditorWindow.cs
+++ Assets/RagePixel2/Editor/RagePixelEditorWindow.cs
@@ -354,7 +354,10 @@
 			Tools.current = Tool.None;
 		}
 		else
-			Tools.current = m_PreviousTool != Tool.None ? m_PreviousTool : Tool.Move;
+		{
+			if (Tools.current == Tool.None)
+				Tools.current = m_PreviousTool != Tool.None ? m_PreviousTool : Tool.Move;
+		}
 	}

 	[MenuItem("Window/RagePixel")]


Add stub for player constraints

Add stub for player constraints

--- Assets/Scripts/HarryPotterUnity/Cards/BaseCard.cs
+++ Assets/Scripts/HarryPotterUnity/Cards/BaseCard.cs
@@ -186,14 +186,17 @@

         private bool IsPlayableFromHand()
         {
-            bool meetsRequirements = _playRequirements.Count == 0 ||
+            bool meetsPlayRequirements = _playRequirements.Count == 0 ||
                                      _playRequirements.TrueForAll(req => req.MeetsRequirement());
-                                    //TODO: Check Player Constraints here
+
+            //TODO: Check Player Constraints here
+            //bool meetsPlayerConstraints = true;

             return Player.IsLocalPlayer &&
                    State == State.InHand &&
                    Player.CanUseActions(ActionCost) &&
-                   meetsRequirements &&
+                   meetsPlayRequirements &&
+                  // meetsPlayerConstraints &&
                    IsUnique() &&
                    MeetsAdditionalPlayRequirements();
         }


fix(PlayerObject): ensure player object check includes inactive objects

The `IsPlayerObject` method now also checks inactive game objects when
seeing if any of the ancestors are a player object.

--- Assets/VRTK/Scripts/Internal/VRTK_PlayerObject.cs
+++ Assets/VRTK/Scripts/Internal/VRTK_PlayerObject.cs
@@ -45,8 +45,14 @@
         /// <returns>Returns true if the object is a player object with the optional given type.</returns>
         public static bool IsPlayerObject(GameObject obj, ObjectTypes ofType = ObjectTypes.Null)
         {
-            var playerObject = obj.GetComponentInParent<VRTK_PlayerObject>();
-            return (playerObject && (ofType == ObjectTypes.Null || (ofType == playerObject.objectType)));
+            foreach (var playerObject in obj.GetComponentsInParent<VRTK_PlayerObject>(true))
+            {
+                if (ofType == ObjectTypes.Null || ofType == playerObject.objectType)
+                {
+                    return true;
+                }
+            }
+            return false;
         }
     }
 }


* Fixed ParseTree.

* Fixed ParseTree.

--- Assets/Watson/Widgets/Question/Facet/ParseTree.cs
+++ Assets/Watson/Widgets/Question/Facet/ParseTree.cs
@@ -19,6 +19,7 @@
 using UnityEngine;
 using System.Collections.Generic;
 using IBM.Watson.Logging;
+using IBM.Watson.Utilities;

 namespace IBM.Watson.Widgets.Question
 {
@@ -37,6 +38,9 @@
         private List<GameObject> m_POSList = new List<GameObject>();
         private List<ParseTreeTextItem> m_WordList = new List<ParseTreeTextItem>();
         private List<Vector3> m_PositionList = new List<Vector3>();
+
+        private Data.XRAY.ParseData m_ParseData = null;
+        private Data.XRAY.Questions m_QuestionData = null;

         private int m_WordIndex = 0;
         public int WordIndex
@@ -84,51 +88,74 @@
 			m_PositionList.Add(new Vector3(91f, -641f, 0f));
 		}

-        /// <summary>
-        /// Generates Parse tree on Initialization of data.
-        /// </summary>
-        override public void Init()
-        {
-			base.Init ();
-
+        private void OnEnable()
+        {
+            EventManager.Instance.RegisterEventReceiver( Constants.Event.ON_QUESTION_PARSE, OnParseData );
+            EventManager.Instance.RegisterEventReceiver( Constants.Event.ON_QUESTION, OnQuestionData );
+        }
+
+        private void OnDisable()
+        {
+            EventManager.Instance.UnregisterEventReceiver( Constants.Event.ON_QUESTION_PARSE, OnParseData );
+            EventManager.Instance.UnregisterEventReceiver( Constants.Event.ON_QUESTION, OnQuestionData );
+        }
+
+        private void OnParseData( object [] args )
+        {
+            m_ParseData = args != null && args.Length > 0 ? args[0] as Data.XRAY.ParseData : null;
             GenerateParseTree();
         }

+        private void OnQuestionData( object [] args )
+        {
+            m_QuestionData = args != null && args.Length > 0 ? args[0] as Data.XRAY.Questions : null;
+        }
+
         /// <summary>
         /// Generate parse tree from Parse Data.
         /// </summary>
         private void GenerateParseTree()
         {
-            for (int i = 0; i < m_Question.QuestionData.ParseDataObject.Words.Length; i++)
-            {
-                GameObject wordGameObject = Instantiate(m_ParseTreeTextItemPrefab) as GameObject;
-                RectTransform wordRectTransform = wordGameObject.GetComponent<RectTransform>();
-                wordRectTransform.SetParent(m_ParseCanvasRectTransform, false);
-
-                if (i < m_PositionList.Count)
-                {
-                    wordRectTransform.localPosition = m_PositionList[i];
-                }
-                else
-                {
-                    //	TODO fix this
-                    wordRectTransform.localPosition = new Vector3(5000f, 5000, 0f);
-                }
-                ParseTreeTextItem word = wordGameObject.GetComponent<ParseTreeTextItem>();
-                word.ParseTreeWord = m_Question.QuestionData.ParseDataObject.Words[i].Word;
-                word.POS = m_Question.QuestionData.ParseDataObject.Words[i].Pos.ToString();
-                word.Slot = m_Question.QuestionData.ParseDataObject.Words[i].Slot;
-
-                for (int j = 0; j < m_Question.QuestionData.ParseDataObject.Words[i].Features.Length; j++)
-                {
-                    word.m_Features.Add(m_Question.QuestionData.ParseDataObject.Words[i].Features[j]);
-                }
-
-                m_WordList.Add(word);
-            }
-
-            WordIndex = 0;
-            InvokeRepeating("CycleWords", 2f, 2f);
+            CancelInvoke();
+            while (m_WordList.Count > 0)
+            {
+                Destroy(m_WordList[0].gameObject);
+                m_WordList.RemoveAt( 0 );
+            }
+
+            if ( m_ParseData != null )
+            {
+                for (int i = 0; i < m_ParseData.Words.Length; i++)
+                {
+                    GameObject wordGameObject = Instantiate(m_ParseTreeTextItemPrefab) as GameObject;
+                    RectTransform wordRectTransform = wordGameObject.GetComponent<RectTransform>();
+                    wordRectTransform.SetParent(m_ParseCanvasRectTransform, false);
+
+                    if (i < m_PositionList.Count)
+                    {
+                        wordRectTransform.localPosition = m_PositionList[i];
+                    }
+                    else
+                    {
+                        //	TODO fix this
+                        wordRectTransform.localPosition = new Vector3(5000f, 5000, 0f);
+                    }
+                    ParseTreeTextItem word = wordGameObject.GetComponent<ParseTreeTextItem>();
+                    word.ParseTreeWord = m_ParseData.Words[i].Word;
+                    word.POS = m_ParseData.Words[i].Pos.ToString();
+                    word.Slot = m_ParseData.Words[i].Slot;
+
+                    for (int j = 0; j < m_ParseData.Words[i].Features.Length; j++)
+                    {
+                        word.m_Features.Add(m_ParseData.Words[i].Features[j]);
+                    }
+
+                    m_WordList.Add(word);
+                }
+
+                WordIndex = 0;
+                InvokeRepeating("CycleWords", 2f, 2f);
+            }
         }

         /// <summary>
@@ -136,12 +163,6 @@
         /// </summary>
         override protected void Clear()
         {
-            CancelInvoke();
-            while (m_WordList.Count != 0)
-            {
-                Destroy(m_WordList[0].gameObject);
-                m_WordList.Remove(m_WordList[0]);
-            }
         }

         /// <summary>
@@ -169,21 +190,28 @@
                 }
             }

-            if (m_Question.QuestionData.QuestionDataObject.questions[0].question.lat.Length == 0 && m_Question.QuestionData.QuestionDataObject.questions[0].question.focus.Length == 0) m_POSList[2].GetComponent<POSControl>().IsHighlighted = true;
-            if (m_Question.QuestionData.QuestionDataObject.questions[0].question.lat.Length > 0)
-            {
-                if (m_WordList[WordIndex].ParseTreeWord.ToLower() == m_Question.QuestionData.QuestionDataObject.questions[0].question.lat[0].ToLower())
-                {
-                    m_POSList[1].GetComponent<POSControl>().IsHighlighted = true;
-                }
-            }
-
-
-            if (m_Question.QuestionData.QuestionDataObject.questions[0].question.focus.Length > 0)
-            {
-                if (m_WordList[WordIndex].ParseTreeWord.ToLower() == m_Question.QuestionData.QuestionDataObject.questions[0].question.focus[0].ToLower())
-                {
-                    m_POSList[0].GetComponent<POSControl>().IsHighlighted = true;
+            if ( m_QuestionData != null && m_QuestionData.HasQuestion() )
+            {
+                if (m_QuestionData.questions[0].question.lat.Length == 0
+                    && m_QuestionData.questions[0].question.focus.Length == 0)
+                {
+                    m_POSList[2].GetComponent<POSControl>().IsHighlighted = true;
+                }
+                if (m_QuestionData.questions[0].question.lat.Length > 0)
+                {
+                    if (m_WordList[WordIndex].ParseTreeWord.ToLower() == m_QuestionData.questions[0].question.lat[0].ToLower())
+                    {
+                        m_POSList[1].GetComponent<POSControl>().IsHighlighted = true;
+                    }
+                }
+
+
+                if (m_QuestionData.questions[0].question.focus.Length > 0)
+                {
+                    if (m_WordList[WordIndex].ParseTreeWord.ToLower() == m_QuestionData.questions[0].question.focus[0].ToLower())
+                    {
+                        m_POSList[0].GetComponent<POSControl>().IsHighlighted = true;
+                    }
                 }
             }
         }


SearchParamDef for Slot extension

SearchParamDef for Slot extension

--- src/Spark.Engine/Model/SparkModelInfo.cs
+++ src/Spark.Engine/Model/SparkModelInfo.cs
@@ -22,6 +22,7 @@
             new SearchParamDefinition() {Resource = "Composition", Name = "custodian", Description = @"custom search parameter on Composition for generating $document", Type = SearchParamType.Reference, Path = new string[] {"Composition.custodian" }, XPath = "f:Composition/f:custodian", Expression = "Composition.custodian" }
             , new SearchParamDefinition() {Resource = "Composition", Name = "eventdetail", Description = @"custom search parameter on Composition for generating $document", Type = SearchParamType.Reference, Path = new string[] {"Composition.event.detail" }, XPath = "f:Composition/f:event/f:detail", Expression = "Composition.event.detail" }
             , new SearchParamDefinition() {Resource = "Encounter", Name = "serviceprovider", Description = @"Organization that provides the Encounter services.", Type = SearchParamType.Reference, Path = new[] {"Encounter.serviceProvider"}, XPath = "f:Encounter/f:serviceProvider",Expression = "Encounter.serviceProvider" }
+            , new SearchParamDefinition() {Resource = "Slot", Name = "provider", Description = @"Search Slot by provider extension", Type = SearchParamType.Reference, Path = new string[] { @"Slot.extension(url=http://fhir.blackpear.com/era/Slot/provider).valueReference" } }
         }).ToList();
     }
 }


Removed unused field

Removed unused field

--- src/Tools/EngineWeaver/AssemblyWeaver.cs
+++ src/Tools/EngineWeaver/AssemblyWeaver.cs
@@ -14,8 +14,6 @@
     {
         private string destAssemblyPath;
         private AssemblyDefinition destAssembly;
-
-        private List<CecilCopier> copiers;

         public AssemblyWeaver(string destAssemblyPath)
         {


#U4-5837 Fixed Due in version 7.2.0

#U4-5837 Fixed Due in version 7.2.0

Missing Indexes

--- src/Umbraco.Core/Models/Rdbms/NodeDto.cs
+++ src/Umbraco.Core/Models/Rdbms/NodeDto.cs
@@ -41,6 +41,7 @@

         [Column("uniqueID")]
         [NullSetting(NullSetting = NullSettings.Null)]
+        [Index(IndexTypes.NonClustered, Name = "IX_umbracoNodeUniqueID")]
         public Guid? UniqueId { get; set; }

         [Column("text")]


Fix build

Fix build

--- src/WebVRPano/Properties/AssemblyInfo.cs
+++ src/WebVRPano/Properties/AssemblyInfo.cs
@@ -1,23 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("AndroidPano")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("AndroidPano")]
-[assembly: AssemblyCopyright("Copyright ©  2015")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("f19cd54d-b837-4679-b4d3-f359c702f49c")]


Fix line endings on SmsMessage

Fix line endings on SmsMessage

--- source/messaging/SmsMessage.cs
+++ source/messaging/SmsMessage.cs
@@ -1,79 +1,79 @@
-using System;
-using System.Xml.Serialization;
-using com.esendex.sdk.core;
-
-namespace com.esendex.sdk.messaging
-{
-    /// <summary>
-    /// Represents an SMS message
-    /// </summary>
-    [Serializable]
-    [XmlRoot("message")]
-    public class SmsMessage : Message
-    {
-        /// <summary>
-        /// Initialises a new instance of the com.esendex.sdk.messaging.SmsMessage
-        /// </summary>
-        public SmsMessage() : base() { }
-
-        /// <summary>
-        /// Initialises a new instance of the com.esendex.sdk.messaging.SmsMessage
-        /// </summary>
-        /// <param name="recipients">A System.String instance that contains comma delimited string of recipients.</param>
-        /// <param name="body">A System.String instance that contains the message body text.</param>
-        /// <param name="accountReference">A System.String instance that contains the Esendex Account Reference.</param>
-        /// <exception cref="System.ArgumentNullException"></exception>
-        public SmsMessage(string recipients, string body, string accountReference)
-            : base(recipients, body, accountReference)
-        {
-        }
-
-        /// <summary>
-        /// Gets the message type
-        /// </summary>
-        [XmlElement("type")]
-        public override MessageType Type
-        {
-            get { return MessageType.SMS; }
-            set { }
-        }
-
+using System;
+using System.Xml.Serialization;
+using com.esendex.sdk.core;
+
+namespace com.esendex.sdk.messaging
+{
+    /// <summary>
+    /// Represents an SMS message
+    /// </summary>
+    [Serializable]
+    [XmlRoot("message")]
+    public class SmsMessage : Message
+    {
+        /// <summary>
+        /// Initialises a new instance of the com.esendex.sdk.messaging.SmsMessage
+        /// </summary>
+        public SmsMessage() : base() { }
+
+        /// <summary>
+        /// Initialises a new instance of the com.esendex.sdk.messaging.SmsMessage
+        /// </summary>
+        /// <param name="recipients">A System.String instance that contains comma delimited string of recipients.</param>
+        /// <param name="body">A System.String instance that contains the message body text.</param>
+        /// <param name="accountReference">A System.String instance that contains the Esendex Account Reference.</param>
+        /// <exception cref="System.ArgumentNullException"></exception>
+        public SmsMessage(string recipients, string body, string accountReference)
+            : base(recipients, body, accountReference)
+        {
+        }
+
+        /// <summary>
+        /// Gets the message type
+        /// </summary>
+        [XmlElement("type")]
+        public override MessageType Type
+        {
+            get { return MessageType.SMS; }
+            set { }
+        }
+
         /// <summary>
         /// Gets and sets the message character set
-        /// </summary>
-        [XmlElement("characterset")]
-        public CharacterSet CharacterSet { get; set; }
-
-        /// <summary>
-        /// Determines whether the specified System.Object are considered equal.
-        /// </summary>
-        /// <param name="obj">The System.Object to compare with the current System.Object</param>
-        /// <returns>true if the specified System.Object is equal to the current System.Object; otherwise, false.</returns>
-        public override bool Equals(object obj)
-        {
-            SmsMessage other = obj as SmsMessage;
-
-            if (other == null) return false;
-
-            return base.Equals(obj);
-        }
-
-        /// <summary>
-        /// Serves as a hash function for a particular type.
-        /// </summary>
-        /// <returns>A hash code for the current System.Object</returns>
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
+        /// </summary>
+        [XmlElement("characterset")]
+        public CharacterSet CharacterSet { get; set; }
+
+        /// <summary>
+        /// Determines whether the specified System.Object are considered equal.
+        /// </summary>
+        /// <param name="obj">The System.Object to compare with the current System.Object</param>
+        /// <returns>true if the specified System.Object is equal to the current System.Object; otherwise, false.</returns>
+        public override bool Equals(object obj)
+        {
+            SmsMessage other = obj as SmsMessage;
+
+            if (other == null) return false;
+
+            return base.Equals(obj);
+        }
+
+        /// <summary>
+        /// Serves as a hash function for a particular type.
+        /// </summary>
+        /// <returns>A hash code for the current System.Object</returns>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
         /// <summary>
         /// Dictates whether character set should be serialised.
         /// </summary>
         /// <returns>Whether character set should be serialised</returns>
-        public bool ShouldSerializeCharacterSet()
-        {
-            return CharacterSet != CharacterSet.Default;
-        }
-    }
-}
+        public bool ShouldSerializeCharacterSet()
+        {
+            return CharacterSet != CharacterSet.Default;
+        }
+    }
+}


Properly processing folders with more than 200 items inside

--- AmazonNodes.cs
+++ AmazonNodes.cs
@@ -31,9 +31,25 @@
         public async Task<IList<AmazonNode>> GetChildren(string id = null)
         {
             if (id == null) id = (await GetRoot()).id;
-            var url = string.Format("{0}nodes/{1}/children", await amazon.GetMetadataUrl(), id);
-            var children = await http.GetJsonAsync<Children>(url);
-            return children.data.Where(n => n.parents.Contains(id)).ToList(); // Hack for wrong Amazon output when file location was changed recently
+            var baseurl = string.Format("{0}nodes/{1}/children", await amazon.GetMetadataUrl(), id);
+            var result = new List<AmazonNode>();
+            string nextToken = null;
+            do
+            {
+                var url = string.IsNullOrWhiteSpace(nextToken) ? baseurl : baseurl + "?startToken=" + nextToken;
+                try
+                {
+                    var children = await http.GetJsonAsync<Children>(url);
+                    result.AddRange(children.data.Where(n => n.parents.Contains(id))); // Hack for wrong Amazon output when file location was changed recently
+                    nextToken = children.nextToken;
+                }
+                catch (HttpWebException ex)
+                {
+                    if (ex.StatusCode == System.Net.HttpStatusCode.NotFound) break;
+                    throw;
+                }
+            } while (!string.IsNullOrWhiteSpace(nextToken));
+            return result;
         }

         readonly static Regex filterEscapeChars = new Regex("[ \\+\\-&|!(){}[\\]^'\"~\\*\\?:\\\\]");


LN store config: fix a typo (#1285)

LN store config: fix a typo (#1285)

--- BTCPayServer/Views/Stores/AddLightningNode.cshtml
+++ BTCPayServer/Views/Stores/AddLightningNode.cshtml
@@ -67,7 +67,7 @@

Note that the certthumbprint to connect to your LND node can be obtained through this command line:

openssl x509 -noout -fingerprint -sha256 -inform pem -in /root/.lnd/tls.cert | sed -e 's/.*=//' -e 's/://g'

-
You can omit certthumbprint if you the certificate is trusted by your machine

+
You can omit certthumbprint if the certificate is trusted by your machine

You can set allowinsecure to true if your LND REST server is using HTTP or HTTPS with an untrusted certificate which you don't know the certthumbprint


Fixing the taggings part, so we don't make duplicates.

--- eFormCore/Persistance/SqlController.cs
+++ eFormCore/Persistance/SqlController.cs
@@ -472,7 +472,7 @@
                     if (check_list != null)
                     {
                         // Delete all not wanted taggings first
-                        List<taggings> cl_taggings = check_list.taggings.Where(x => !tagIds.Contains(x.id)).ToList();
+                        List<taggings> cl_taggings = check_list.taggings.Where(x => !tagIds.Contains((int)x.tag_id)).ToList();
                         int index = 0;
                         foreach (taggings tagging in cl_taggings)
                         {
@@ -486,7 +486,7 @@

                                 db.tagging_versions.Add(MapTaggingVersions(current_tagging));
                                 db.SaveChanges();
-                                tagIds.Remove(tagging.id); // TODO write tests to ensure this works. 9 may 2018
+                                //tagIds.Remove(tagging.id); // TODO write tests to ensure this works. 9 may 2018
                             }
                         }

@@ -496,18 +496,36 @@
                             tags tag = db.tags.Single(x => x.id == id);
                             if (tag != null)
                             {
-                                taggings tagging = new taggings();
-                                tagging.check_list_id = templateId;
-                                tagging.tag_id = tag.id;
-                                tagging.created_at = DateTime.Now;
-                                tagging.workflow_state = Constants.WorkflowStates.Created;
-                                tagging.version = 1;
-
-                                db.taggings.Add(tagging);
-                                db.SaveChanges();
-
-                                db.tagging_versions.Add(MapTaggingVersions(tagging));
-                                db.SaveChanges();
+
+                                taggings current_tagging = db.taggings.SingleOrDefault(x => x.tag_id == tag.id && x.check_list_id == templateId);
+
+                                if (current_tagging == null)
+                                {
+                                    taggings tagging = new taggings();
+                                    tagging.check_list_id = templateId;
+                                    tagging.tag_id = tag.id;
+                                    tagging.created_at = DateTime.Now;
+                                    tagging.updated_at = tagging.created_at;
+                                    tagging.workflow_state = Constants.WorkflowStates.Created;
+                                    tagging.version = 1;
+
+                                    db.taggings.Add(tagging);
+                                    db.SaveChanges();
+
+                                    db.tagging_versions.Add(MapTaggingVersions(tagging));
+                                    db.SaveChanges();
+                                } else {
+                                    if (current_tagging.workflow_state != Constants.WorkflowStates.Created)
+                                    {
+                                        current_tagging.version = check_list.version + 1;
+                                        current_tagging.updated_at = DateTime.Now;
+
+                                        current_tagging.workflow_state = Constants.WorkflowStates.Created;
+
+                                        db.tagging_versions.Add(MapTaggingVersions(current_tagging));
+                                        db.SaveChanges();
+                                    }
+                                }
                             }
                         }


Fixed Debug Build of Rendering Benchmark

--- Benchmarks/Mapsui.Rendering.Benchmarks/Program.cs
+++ Benchmarks/Mapsui.Rendering.Benchmarks/Program.cs
@@ -10,7 +10,7 @@
         renderPerformance.RenderRasterizingTilingSkp();
         renderPerformance.RenderRasterizingTilingPng();
         renderPerformance.RenderRasterizingTilingWebP();
-        renderPerformance.RenderRasterizingTiling();
+        renderPerformance.RenderDefault();
 #else
         var summary = BenchmarkRunner.Run(typeof(Program).Assembly);
 #endif


Fixed dumb dumb mistake.

Fixed dumb dumb mistake.

--- stellar-dotnetcore-sdk/xdr/generated/Uint64.cs
+++ stellar-dotnetcore-sdk/xdr/generated/Uint64.cs
@@ -10,11 +10,11 @@

 //  ===========================================================================
 public class Uint64  {
-  public int InnerValue {get; set;} = default(int);
+  public long InnerValue {get; set;} = default(long);

   public Uint64() {}

-  public Uint64(int value)
+  public Uint64(long value)
   {
     InnerValue = value;
   }


BUGGED but maybe this attempt will fix it..

--- Bend/LayerManager/RootMetadata/RangemapManager.cs
+++ Bend/LayerManager/RootMetadata/RangemapManager.cs
@@ -1189,7 +1189,9 @@
                             }
                             Console.WriteLine("stage(1) scanBack considered: {0}", rk);
                             if (segmentsWithRecordsTombstones.Contains(nextrec.Key) ||
-                                segmentsWithRecords.ContainsKey(rk)) {
+                                segmentsWithRecords.ContainsKey(rk) ||
+                                (segmentsWithRecords_ByGeneration[i].Key != null &&
+                                  segmentsWithRecords_ByGeneration[i].Key.CompareTo(rk) > 0)) {
                                 // this entry was tombstoned. We consider it tombstoned if
                                 // it's in "segmentsWithRecords", because that just means there was
                                 // another value of the exact same segment key above us
@@ -1200,22 +1202,19 @@
                                 if ((cmpval < 0) || (cmpval == 0 && equal_ok)) {
                                     var segment = this.segmentReaderFromRow(nextrec);
                                     segmentsWithRecords.Add(rk, segment);
-                                    if (segmentsWithRecords_ByGeneration[i].Key == null ||
-                                        segmentsWithRecords_ByGeneration[i].Key.CompareTo(rk) > 0) {
-                                        segmentsWithRecords_ByGeneration[i] =
-                                            new KeyValuePair<RangeKey, IScannable<RecordKey, RecordUpdate>>(rk, segment);
-                                    }
+
+                                    segmentsWithRecords_ByGeneration[i] =
+                                         new KeyValuePair<RangeKey, IScannable<RecordKey, RecordUpdate>>(rk, segment);
+
                                 }
                             } else {
                                 // really only need this if below doesn't find one?
                                 var segment = this.segmentReaderFromRow(nextrec);
                                 segmentsWithRecords.Add(rk, segment);

-                                if (segmentsWithRecords_ByGeneration[i].Key == null ||
-                                        segmentsWithRecords_ByGeneration[i].Key.CompareTo(rk) < 0) {
-                                    segmentsWithRecords_ByGeneration[i] =
-                                            new KeyValuePair<RangeKey, IScannable<RecordKey, RecordUpdate>>(rk, segment);
-                                }
+                                segmentsWithRecords_ByGeneration[i] =
+                                        new KeyValuePair<RangeKey, IScannable<RecordKey, RecordUpdate>>(rk, segment);
+
                             }
                             break; // stop once we found a real record
                         }
@@ -1240,7 +1239,9 @@
                             }
                             Console.WriteLine("stage(1) scanForeward considered: {0}", rk);
                             if (segmentsWithRecordsTombstones.Contains(nextrec.Key) ||
-                                segmentsWithRecords.ContainsKey(rk)) {
+                                segmentsWithRecords.ContainsKey(rk) ||
+                                (segmentsWithRecords_ByGeneration[i].Key != null &&
+                                 segmentsWithRecords_ByGeneration[i].Key.CompareTo(rk) < 0)) {
                                 // this entry was tombstoned. We consider it tombstoned if
                                 // it's in "segmentsWithRecords", because that just means there was
                                 // another value of the exact same segment key above us
@@ -1252,11 +1253,9 @@
                                     var segment = this.segmentReaderFromRow(nextrec);
                                     segmentsWithRecords.Add(rk, segment);

-                                    if (segmentsWithRecords_ByGeneration[i].Key == null ||
-                                        segmentsWithRecords_ByGeneration[i].Key.CompareTo(rk) < 0) {
-                                        segmentsWithRecords_ByGeneration[i] =
-                                            new KeyValuePair<RangeKey, IScannable<RecordKey, RecordUpdate>>(rk, segment);
-                                    }
+                                    segmentsWithRecords_ByGeneration[i] =
+                                          new KeyValuePair<RangeKey, IScannable<RecordKey, RecordUpdate>>(rk, segment);
+

                                 }
                             } else {


GetBoolを追加。

GetBoolを追加。

--- Sdx/Db/Record.cs
+++ Sdx/Db/Record.cs
@@ -216,6 +216,11 @@
     public string GetString(string key)
     {
       return Convert.ToString(this.GetValue(key));
+    }
+
+    public bool GetBool(string key)
+    {
+      return (bool)GetValue(key);
     }

     public bool ContainsColumn(string key)


Small fixes

Small fixes

--- BleLab/ViewModels/Characteristic/ReadViewModel.cs
+++ BleLab/ViewModels/Characteristic/ReadViewModel.cs
@@ -33,7 +33,7 @@

         public byte[] ReadValue
         {
-            get { return _readValue; }
+            get => _readValue;
             set
             {
                 if (Equals(value, _readValue)) return;
@@ -50,7 +50,7 @@

         public string ReadSource
         {
-            get { return _readSource; }
+            get => _readSource;
             set
             {
                 if (value == _readSource) return;
@@ -61,7 +61,7 @@

         public bool CanRead
         {
-            get { return _canRead; }
+            get => _canRead;
             set
             {
                 if (value == _canRead) return;
@@ -77,7 +77,7 @@

         public BytesDisplayFormatViewModel SelectedDisplayFormat
         {
-            get { return _selectedDisplayFormat; }
+            get => _selectedDisplayFormat;
             set
             {
                 if (value == _selectedDisplayFormat) return;
@@ -92,7 +92,7 @@

         public async void Read()
         {
-            await DoReadValue(FromCache);
+            await DoReadValue(FromCache).ConfigureAwait(true);
         }

         private async Task DoReadValue(bool cached, bool hideInConsole = false)
@@ -102,12 +102,12 @@
                 CanRead = false;
                 var result = await _commandRunner
                     .Enqueue(new ReadBytesCommand(_characteristicInfo, cached ? BluetoothCacheMode.Cached : BluetoothCacheMode.Uncached) { HideInConsole = hideInConsole })
-                    .AsTask();
+                    .AsTask().ConfigureAwait(true);

                 if (result.Status != CommandStatus.Succeeded)
                 {
                     ReadValue = null;
-                    ReadSource = "Device unreachable";
+                    ReadSource = "Operation unsuccessful";
                     return;
                 }


method rename

method rename

--- CassandraSharp/MadeSimple/ByteArrayNameOrValue.cs
+++ CassandraSharp/MadeSimple/ByteArrayNameOrValue.cs
@@ -22,7 +22,7 @@
         {
         }

-        public static INameOrValue FromObject(object obj)
+        public static INameOrValue FromNullable(object obj)
         {
             return null != obj
                        ? new ByteArrayNameOrValue((byte[]) obj)


this is literally opposite of what it should be

--- CompatBot/EventHandlers/MediaScreenshotMonitor.cs
+++ CompatBot/EventHandlers/MediaScreenshotMonitor.cs
@@ -28,7 +28,7 @@
             if (message == null)
                 return;

-            if (Config.Moderation.Channels.Contains(evt.Channel.Id) || evt.Channel.Name.Contains("help"))
+            if (!(Config.Moderation.Channels.Contains(evt.Channel.Id) || evt.Channel.Name.Contains("help")))
                 return;

 #if !DEBUG


Mark itemID for traitor uplink as an entityprototype (#5898)

--- Content.Shared/PDA/UplinkStoreListingPrototype.cs
+++ Content.Shared/PDA/UplinkStoreListingPrototype.cs
@@ -1,5 +1,6 @@
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.Manager.Attributes;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
 using Robust.Shared.Utility;
 using Robust.Shared.ViewVariables;

@@ -12,7 +13,7 @@
         [DataField("id", required: true)]
         public string ID { get; } = default!;

-        [DataField("itemId")]
+        [DataField("itemId", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
         public string ItemId { get; } = string.Empty;

         [DataField("price")]


NyaaSpam: Move feed opening/parsing to seperate method

--- NyaaSpam/FeedReader.cs
+++ NyaaSpam/FeedReader.cs
@@ -86,24 +86,9 @@

     void ReadFeed(object data)
     {
-        SyndicationFeed feed;
-        try
-        {
-            var feedUri = conf.Feed;
-
-            XmlReader reader = XmlReader.Create(feedUri.OriginalString);
-            feed = SyndicationFeed.Load(reader);
-        }
-        catch (System.Net.WebException ex)
-        {
-            log.Error("WebException in ReadFeed: " + ex.Message);
+        var feed = OpenFeed();
+        if (feed == null)
             return;
-        }
-        catch (XmlException ex)
-        {
-            log.Error("XmlException in ReadFeed: " + ex.Message);
-            return;
-        }

         bool latestItem = true;
         // Assign it a value, else the C# compiler thinks it will be unassigned once the loop exits. But it _does_ get
@@ -136,6 +121,29 @@
         dtFile.Write(latestPublish);
     }

+    SyndicationFeed OpenFeed()
+    {
+        SyndicationFeed feed = null;
+
+        try
+        {
+            var feedUri = conf.Feed;
+
+            XmlReader reader = XmlReader.Create(feedUri.OriginalString);
+            feed = SyndicationFeed.Load(reader);
+        }
+        catch (System.Net.WebException ex)
+        {
+            log.Error("WebException in ReadFeed: " + ex.Message);
+        }
+        catch (XmlException ex)
+        {
+            log.Error("XmlException in ReadFeed: " + ex.Message);
+        }
+
+        return feed;
+    }
+
     static bool Skip(SyndicationItem item, HashSet<string> skipCategories)
     {
         foreach (SyndicationCategory cat in item.Categories)


忘记更新程序版本标记了

忘记更新程序版本标记了

--- ZKWeb/Global.asax.cs
+++ ZKWeb/Global.asax.cs
@@ -45,7 +45,7 @@
 		/// <summary>
 		/// 框架的完整版本
 		/// </summary>
-		public static string FullVersion { get { return "0.9.3 testing"; } }
+		public static string FullVersion { get { return "0.9.4 testing"; } }
 		/// <summary>
 		/// 框架的数值版本
 		/// </summary>


Added commment

Added commment

--- DataStructures/Arrays/MaxSumContiguousSubarray.cs
+++ DataStructures/Arrays/MaxSumContiguousSubarray.cs
@@ -13,7 +13,7 @@
             int maxSum = 0;
             int currentSum = 0;
             bool areAllNegativeNumbers = true;
-            int biggestNegativeNumber = Int32.MinValue; //This case also handles all negative numbers.
+            int biggestNegativeNumber = Int32.MinValue; //This case also handles an array with all negative numbers. So it returns biggest negative number;
             for(int i=0; i<n; i++) // This is done using Kadane's algorithm which reduces the complexity to linear time. What an algo (y).
             {
                 if(A[i]>0)


Added XML documentation to AbstractAttachedProperty

--- src/AttachedProperties/AbstractAttachedProperty.cs
+++ src/AttachedProperties/AbstractAttachedProperty.cs
@@ -1,4 +1,4 @@
-#region License
+#region License
 // Copyright (c) Niklas Wendel
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,7 +20,7 @@
 {

     /// <summary>
-    ///
+    /// Abstract base class used to define <see cref="AttachedProperties"/>.
     /// </summary>
     public abstract class AbstractAttachedProperty
     {


Update UniformGridLayoutState.cs

Update UniformGridLayoutState.cs

Corrected implementation for
UniformGridLayout ItemsStretch Fill and Uniform

--- src/Avalonia.Base/Layout/UniformGridLayoutState.cs
+++ src/Avalonia.Base/Layout/UniformGridLayoutState.cs
@@ -117,12 +117,12 @@
             double extraMinorPixelsForEachItem = 0.0;
             if (!double.IsInfinity(availableSizeMinor))
             {
-                var numItemsPerColumn = Math.Min(
+                var numItemsPerColumn = (int)Math.Min(
                     maxItemsPerLine,
                     Math.Max(1.0, availableSizeMinor / (itemSizeMinor + minorItemSpacing)));
                 var usedSpace = (numItemsPerColumn * (itemSizeMinor + minorItemSpacing)) - minorItemSpacing;
-                var remainingSpace = ((int)(availableSizeMinor - usedSpace));
-                extraMinorPixelsForEachItem = remainingSpace / ((int)numItemsPerColumn);
+                var remainingSpace = availableSizeMinor - usedSpace;
+                extraMinorPixelsForEachItem = (int)(remainingSpace / numItemsPerColumn);
             }

             if (stretch == UniformGridLayoutItemsStretch.Fill)


Bring book up to date before computing hash in bulk upload (BL-9997)

This helps minimize re-uploading unchanged books.

--- src/BloomExe/WebLibraryIntegration/BulkUploader.cs
+++ src/BloomExe/WebLibraryIntegration/BulkUploader.cs
@@ -264,33 +264,8 @@
 				}
 				_collectionFoldersUploaded.Add(collectionPath);

-				// Compute the book hash file and compare it to the existing one for bulk upload.
-				var currentHashes = BookUpload.HashBookFolder(uploadParams.Folder);
-				progress.WriteMessage(currentHashes);
-				var pathToLocalHashInfoFromLastUpload = Path.Combine(uploadParams.Folder, HashInfoFromLastUpload);
-				if (!uploadParams.ForceUpload)
-				{
-					var canSkip = false;
-					if (Program.RunningUnitTests)
-					{
-						canSkip = _singleBookUploader.CheckAgainstLocalHashfile(currentHashes, pathToLocalHashInfoFromLastUpload);
-					}
-					else
-					{
-						canSkip = _singleBookUploader.CheckAgainstHashFileOnS3(currentHashes, uploadParams.Folder, progress);
-						RobustFile.WriteAllText(pathToLocalHashInfoFromLastUpload, currentHashes); // ensure local copy is saved
-					}
-					if (canSkip)
-					{
-						// local copy of hashes file is identical or has been saved
-						progress.WriteMessageWithColor("green", $"Skipping '{Path.GetFileName(uploadParams.Folder)}' because it has not changed since being uploaded.");
-						++_booksSkipped;
-						return; // skip this one; we already uploaded it earlier.
-					}
-				}
-				// save local copy of hashes file: it will be uploaded with the other book files
-				RobustFile.WriteAllText(pathToLocalHashInfoFromLastUpload, currentHashes);
-
+				// Get the book content as up to date as possible, without any unused files so that
+				// we can compute an accurate hash value.
 				if (context == null || context.SettingsPath != collectionPath)
 				{
 					context?.Dispose();
@@ -305,6 +280,35 @@
 				var bookInfo = new BookInfo(uploadParams.Folder, true);
 				var book = server.GetBookFromBookInfo(bookInfo);
 				book.BringBookUpToDate(new NullProgress());
+				book.Storage.CleanupUnusedSupportFiles(isForPublish: false); // we are publishing, but this is the real folder not a copy, so play safe.
+
+				// Compute the book hash file and compare it to the existing one for bulk upload.
+				var currentHashes = BookUpload.HashBookFolder(uploadParams.Folder);
+				progress.WriteMessage(currentHashes);
+				var pathToLocalHashInfoFromLastUpload = Path.Combine(uploadParams.Folder, HashInfoFromLastUpload);
+				if (!uploadParams.ForceUpload)
+				{
+					var canSkip = false;
+					if (Program.RunningUnitTests)
+					{
+						canSkip = _singleBookUploader.CheckAgainstLocalHashfile(currentHashes, pathToLocalHashInfoFromLastUpload);
+					}
+					else
+					{
+						canSkip = _singleBookUploader.CheckAgainstHashFileOnS3(currentHashes, uploadParams.Folder, progress);
+						RobustFile.WriteAllText(pathToLocalHashInfoFromLastUpload, currentHashes); // ensure local copy is saved
+					}
+					if (canSkip)
+					{
+						// local copy of hashes file is identical or has been saved
+						progress.WriteMessageWithColor("green", $"Skipping '{Path.GetFileName(uploadParams.Folder)}' because it has not changed since being uploaded.");
+						++_booksSkipped;
+						return; // skip this one; we already uploaded it earlier.
+					}
+				}
+				// save local copy of hashes file: it will be uploaded with the other book files
+				RobustFile.WriteAllText(pathToLocalHashInfoFromLastUpload, currentHashes);
+
 				bookInfo.Bookshelf = book.CollectionSettings.DefaultBookshelf;
 				var bookshelfName = String.IsNullOrWhiteSpace(book.CollectionSettings.DefaultBookshelf) ? "(none)" : book.CollectionSettings.DefaultBookshelf;
 				progress.WriteMessage($"Bookshelf is '{bookshelfName}'");


code gardening

code gardening

--- src/Boo.Lang.Compiler/Steps/ProcessMethodBodies.cs
+++ src/Boo.Lang.Compiler/Steps/ProcessMethodBodies.cs
@@ -3768,7 +3768,7 @@
 		private bool ProcessMetaMethodInvocation(MethodInvocationExpression node, bool resolvedArgs)
 		{
 			var targetEntity = node.Target.Entity;
-			if (null == targetEntity) return false;
+			if (targetEntity == null) return false;
 			if (!IsOrContainMetaMethod(targetEntity)) return false;

 			var arguments = GetMetaMethodInvocationArguments(node);
@@ -3804,7 +3804,8 @@

 		private static object[] GetMetaMethodInvocationArguments(MethodInvocationExpression node)
 		{
-			if (node.NamedArguments.Count == 0) return node.Arguments.ToArray();
+			if (node.NamedArguments.Count == 0)
+				return node.Arguments.ToArray();

 			var arguments = new List();
 			arguments.Add(node.NamedArguments.ToArray());
@@ -3831,7 +3832,7 @@
 			Visit(replacement);
 		}

-		private IEnumerable<System.Reflection.MethodInfo> EnumerateMetaMethods(IEntity entity)
+		private IEnumerable<MethodInfo> EnumerateMetaMethods(IEntity entity)
 		{
 			if (entity.EntityType == EntityType.Method)
 			{


Fix "Folder Watcher" not hiding on queue end

--- DesktopWidgets/Widgets/FolderWatcher/ViewModel.cs
+++ DesktopWidgets/Widgets/FolderWatcher/ViewModel.cs
@@ -122,7 +122,10 @@
         private void HandleDirectoryChange()
         {
             if (_notificationQueue.Count == 0)
-                return;
+            {
+                View.HideUi();
+                return;
+            }
             _isShowing = true;
             CurrentFilePath = _notificationQueue.Dequeue();


Initialize blank texture elements when loading fails

--- Source/CapCom.cs
+++ Source/CapCom.cs
@@ -78,13 +78,14 @@
 					}
 				}

+				Texture2D missionControlTexture = new Texture2D(original.width, original.height);
+
 				if (original == null)
 				{
 					LogFormatted("Error loading Mission Control Center Texture atlas; some CapCom UI elements will not appear correctly");
+					CapComSkins.texturesFromAtlas(missionControlTexture);
 					return;
 				}
-
-				Texture2D missionControlTexture = new Texture2D(original.width, original.height);

 				var rt = RenderTexture.GetTemporary(original.width, original.height, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.sRGB, 1);


initial commit

initial commit

--- DocumentDb.Pictures/Controllers/HomeController.cs
+++ DocumentDb.Pictures/Controllers/HomeController.cs
@@ -10,6 +10,7 @@
     {
         public IActionResult Index()
         {
+
             return View();
         }


Add blob removal in AzureBlob2

Add blob removal in AzureBlob2

--- src/CDrive/DriveInfo/AzureBlobServiceDriveInfo2.cs
+++ src/CDrive/DriveInfo/AzureBlobServiceDriveInfo2.cs
@@ -118,7 +118,11 @@
                     break;
                 case PathType.AzureBlobQuery:
                     var files = ListItems(path) as IEnumerable<IListBlobItem>;
-                    // TODO
+                    foreach(var file in files)
+                    {
+                        var blob = new CloudBlob(file.Uri, this.Client.Credentials);
+                        blob.Delete();
+                    }

                     break;
                 default:


fixed translation bug

fixed translation bug

--- Source/Matrix.cs
+++ Source/Matrix.cs
@@ -34,14 +34,10 @@
 				((mat1.M12 * vect1.X) + (mat1.M22 * vect1.Y) + mat1.M42));
 		}

-		public static void XPos(this Matrix mat1, float x)
+		public static void SetPosition(ref Matrix mat1, Vector2 pos)
 		{
-			mat1.M41 = x;
-		}
-
-		public static void YPos(this Matrix mat1, float y)
-		{
-			mat1.M42 = y;
+			mat1.M41 = pos.X;
+			mat1.M42 = pos.Y;
 		}

 		#endregion


Added consistency check when re-building index files.

--- Duplicati/Library/Main/Operation/RepairHandler.cs
+++ Duplicati/Library/Main/Operation/RepairHandler.cs
@@ -239,6 +239,8 @@
                                 var w = new IndexVolumeWriter(m_options);
                                 newEntry = w;
                                 w.SetRemoteFilename(n.Name);
+
+                                var h = System.Security.Cryptography.HashAlgorithm.Create(m_options.BlockHashAlgorithm);

                                 foreach(var blockvolume in db.GetBlockVolumesFromIndexName(n.Name))
                                 {
@@ -252,7 +254,13 @@

                                     if (m_options.IndexfilePolicy == Options.IndexFileStrategy.Full)
                                         foreach(var b in db.GetBlocklists(volumeid, m_options.Blocksize, hashsize))
+                                        {
+                                            var bh = Convert.ToBase64String(h.ComputeHash(b.Item2, 0, b.Item3));
+                                            if (bh != b.Item1)
+                                                throw new Exception(string.Format("Internal consistency check failed, generated index block has wrong hash, {0} vs {1}", bh, b.Item1));
+
                                             w.WriteBlocklist(b.Item1, b.Item2, 0, b.Item3);
+                                        }
                                 }

                                 w.Close();


Fix SetAllAsync not awaiting calls

Fix SetAllAsync not awaiting calls

--- src/Colore/Implementations/ChromaImplementation.cs
+++ src/Colore/Implementations/ChromaImplementation.cs
@@ -446,15 +446,14 @@
         /// Sets all Chroma devices to the specified <see cref="Color" />.
         /// </summary>
         /// <param name="color">The <see cref="Color" /> to set.</param>
-        public Task SetAllAsync(Color color)
-        {
-            Keyboard.SetAllAsync(color);
-            Mouse.SetAllAsync(color);
-            Mousepad.SetAllAsync(color);
-            Keypad.SetAllAsync(color);
-            Headset.SetAllAsync(color);
-            ChromaLink.SetAllAsync(color);
-            return Task.FromResult(0);
+        public async Task SetAllAsync(Color color)
+        {
+            await Keyboard.SetAllAsync(color).ConfigureAwait(false);
+            await Mouse.SetAllAsync(color).ConfigureAwait(false);
+            await Mousepad.SetAllAsync(color).ConfigureAwait(false);
+            await Keypad.SetAllAsync(color).ConfigureAwait(false);
+            await Headset.SetAllAsync(color).ConfigureAwait(false);
+            await ChromaLink.SetAllAsync(color).ConfigureAwait(false);
         }

         /// <summary>


Totals will be summed up when succession active

--- Sources/Form1.cs
+++ Sources/Form1.cs
@@ -199,21 +199,39 @@
             return false;
         }

-        private void GetCalculatedSums(ref int TotalHits, ref int TotalHitsWay, ref int TotalPB)
-        {
-            int Splits = pi.SplitCount;
-
-            TotalHits = TotalHitsWay = TotalPB = 0;
-            for (int i = 0; i < Splits; i++)
-            {
-                TotalHits += pi.GetSplitHits(i);
-                TotalHitsWay += pi.GetSplitWayHits(i);
-                TotalPB += pi.GetSplitPB(i);
-            }
-
-            TotalHits += (int)numHits.Value;
-            TotalHitsWay += (int)numHitsWay.Value;
-            TotalPB += (int)numPB.Value;
+        private void GetCalculatedSums(out int TotalSplits, out int TotalActiveSplit, out int TotalHits, out int TotalHitsWay, out int TotalPB)
+        {
+            bool ActiveProfileFound = false;
+            ProfileViewControl[] pvcs;
+            if (cbShowPredecessor.Checked) // Succession?
+                pvcs = ProfileViewControls; // Evaluate all tabs
+            else
+                pvcs = new ProfileViewControl[] { pvc }; // Use only the current one
+
+            TotalSplits = TotalActiveSplit = TotalHits = TotalHitsWay = TotalPB = 0;
+            foreach(ProfileViewControl pvc_tab in pvcs)
+            {
+                IProfileInfo pi_tab = pvc_tab.ProfileInfo;
+                int Splits = pi_tab.SplitCount;
+
+                TotalSplits += Splits;
+                for (int i = 0; i < Splits; i++)
+                {
+                    TotalHits += pi_tab.GetSplitHits(i);
+                    TotalHitsWay += pi_tab.GetSplitWayHits(i);
+                    TotalPB += pi_tab.GetSplitPB(i);
+                }
+
+                if (!ActiveProfileFound)
+                {
+                    if (pvc_tab == pvc) // Active profile tab found
+                    {
+                        TotalActiveSplit += pi.ActiveSplit;
+                        ActiveProfileFound = true;
+                    }
+                    else TotalActiveSplit += Splits; // Add all splits of preceeding profiles
+                }
+            }
         }

         private void DataGridView1_ProfileChanged(object sender, EventArgs e)
@@ -223,19 +241,9 @@

         private void UpdateProgressAndTotals()
         {
-            int TotalHits = 0;
-            int TotalHitsWay = 0;
-            int TotalPB = 0;
-            int Splits = pi.SplitCount;
-
-            if (Splits < 0) // Check for valid entries
-                lbl_progress.Text = "Progress:  ?? / ??  # " + pi.AttemptsCount.ToString("D3");
-            else
-            {
-                GetCalculatedSums(ref TotalHits, ref TotalHitsWay, ref TotalPB);
-                lbl_progress.Text = "Progress:  " + pi.ActiveSplit + " / " + Splits + "  # " + pi.AttemptsCount.ToString("D3");
-            }
-
+            int TotalSplits, TotalActiveSplit, TotalHits, TotalHitsWay, TotalPB;
+            GetCalculatedSums(out TotalSplits, out TotalActiveSplit, out TotalHits, out TotalHitsWay, out TotalPB);
+            lbl_progress.Text = "Progress:  " + TotalActiveSplit + " / " + TotalSplits + "  # " + pi.AttemptsCount.ToString("D3");
             lbl_totals.Text = "Total: " + (TotalHits + TotalHitsWay) + " Hits   " + TotalPB + " PB";

             om.Update();
@@ -435,12 +443,10 @@
             profs.LoadProfile(((ProfileViewControl)sender).SelectedProfile);
         }

-        private void BtnSuccessionProceed_Click(object sender, EventArgs e)
-        {
-            int TotalHits = 0;
-            int TotalHitsWay = 0;
-            int TotalPB = 0;
-            GetCalculatedSums(ref TotalHits, ref TotalHitsWay, ref TotalPB);
+        private void BtnSuccessionProceed_Click(object sender, EventArgs e) // TODO Update to tabs
+        {
+            int TotalSplits, TotalActiveSplit, TotalHits, TotalHitsWay, TotalPB;
+            GetCalculatedSums(out TotalSplits, out TotalActiveSplit, out TotalHits, out TotalHitsWay, out TotalPB);
             SetSuccession(TotalHits, TotalHitsWay, TotalPB);
             ShowSuccessionMenu(true);
             SuccessionChanged(null, null);


Implement ValuesGremlinStep.Resolve for mixed propertyKey and id-steps.

--- ExRam.Gremlinq/Gremlin/Steps/ValuesGremlinStep.cs
+++ ExRam.Gremlinq/Gremlin/Steps/ValuesGremlinStep.cs
@@ -37,9 +37,15 @@
                 .ToArray();

             if (numberOfIdSteps > 1 || numberOfIdSteps > 0 && propertyKeys.Length > 0)
-                throw new NotSupportedException();
-
-            if (numberOfIdSteps > 0)
+            {
+                yield return new MethodGremlinStep("union",
+                    GremlinQuery.Anonymous.AddStep(new MethodGremlinStep(
+                        "values",
+                        propertyKeys
+                            .ToImmutableList())),
+                    GremlinQuery.Anonymous.Id());
+            }
+            else if (numberOfIdSteps > 0)
                 yield return new MethodGremlinStep("id");
             else
             {


Add some comments for the host process

Add some comments for the host process

--- Examples/TestHttpCompositionConsoleApp/Program.cs
+++ Examples/TestHttpCompositionConsoleApp/Program.cs
@@ -19,7 +19,9 @@
              * Updatable TODO
              *
              */
-
+
+            // Sample host should minimal like that.
+            // Override templates or data from args before reaching the host execution
             new ApplicationHost(args).Execute(new RunAndBlock());
         }
     }


Add lang and meta attribute

Add lang and meta attribute

--- Fatec.Treinamento.Web/Views/Shared/_Layout.cshtml
+++ Fatec.Treinamento.Web/Views/Shared/_Layout.cshtml
@@ -1,13 +1,14 @@
 @using Microsoft.AspNet.Identity

 <!DOCTYPE html>
-<html>
+<html lang="pt-br">
 <head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>@ViewBag.Title - Fatec Treinamentos</title>
     @Styles.Render("~/Content/css")
     @Scripts.Render("~/bundles/modernizr")
+    <meta name="description" content="The description of my page" />
 </head>
 <body>
     <div class="navbar navbar-inverse navbar-fixed-top">


Tried for the last time to ri-pristinate the correct GuessOS.cs without Console debug code... what is that re-merge the wrong version?

--- Demos/Guess/GuessOS.cs
+++ Demos/Guess/GuessOS.cs
@@ -24,18 +24,6 @@
             //Cosmos.Core.HMI.Init();
             Console.WriteLine("Cursor size is " + Console.CursorSize);
             //Console.CursorSize = 75;
-#if false
-            try {
-                Console.CursorSize = 101;
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Excpeption caugt: " + e.Message);
-            }
-#endif
-
-            //Console.CursorVisible = false;
-            Console.WriteLine("The cursor is " + ((Console.CursorVisible == true) ? "visible" : "not visible"));
             Console.WriteLine("Guess Demo");
       Console.WriteLine("Please guess a number from 1 to 100.");
     }


Fix date format

Fix date format

--- Blog.Web/Areas/Admin/Views/Home/Edit.cshtml
+++ Blog.Web/Areas/Admin/Views/Home/Edit.cshtml
@@ -28,7 +28,7 @@

             Date de publication :
-            @Html.TextBoxFor(m => m.PublicationDate)
+            <input type="text" name="@Html.NameFor(m => m.PublicationDate)" value="@Model.PublicationDate?.ToString("MM/dd/yyyy")" />


#133554 Refactoring

#133554 Refactoring

--- Gigya.Microdot.ServiceProxy/Caching/AsyncCache.cs
+++ Gigya.Microdot.ServiceProxy/Caching/AsyncCache.cs
@@ -167,7 +167,7 @@

                 // If the caching settings specify we shouldn't cache responses when suppressed, then don't.
                 if (settings.CacheResponsesWhenSupressedBehavior == CacheResponsesWhenSupressedBehavior.Disabled)
-                    return await CallService(serviceMethod, metricsKeys);
+                    return await (await CallService(serviceMethod, metricsKeys)).response;

                 // ...otherwise we do put the response in the cache so that subsequent calls to the cache do not revert to the previously-cached value.
                 else return await TryFetchNewValue(key, serviceMethod, settings, metricsKeys, CallReason.Suppress);
@@ -178,7 +178,7 @@
             // condition with negligible negative effects so we can ignore it for the sake of the simplicity of the code.
             else if ((cached = (AsyncCacheItem)MemoryCache.Get(key)) != null)

-                // Response was revoked.
+                // Response was revoked and settings specify we should not use revoked responses
                 if (cached.IsRevoked && settings.RevokedResponseBehavior != RevokedResponseBehavior.KeepUsingRevokedResponse)

                     // The caching settings specify we should ignore revoked responses; issue a request.
@@ -276,34 +276,8 @@
             var tcs = new TaskCompletionSource<bool>();
             RecentRevokesCache.RegisterOutgoingRequest(tcs.Task, requestSendTime);

-            Task<object> response; // We capture the response from the service here, including if it was an exception
-            ResponseKinds responseKind;
-            try
-            {
-                // Call the service
-                response = Task.FromResult(await CallService(serviceMethod, metricsKeys));
-
-                // Determine the kind of response. We consider it null also in case we got a non-null Revocable<> with null inner Value
-                bool isNullResponse =    response.Result == null
-                                      || (   response.Result.GetType().IsGenericType
-                                          && response.Result.GetType().GetGenericTypeDefinition() == typeof(Revocable<>)
-                                          && response.Result.GetType().GetProperty("Value").GetValue(response.Result) == null);
-                responseKind = isNullResponse ? ResponseKinds.NullResponse : ResponseKinds.NonNullResponse;
-            }
-            catch (Exception e)
-            {
-                if (!(e is RequestException))
-                    Failed.Mark(metricsKeys);
-
-                // Determine the kind of exception
-                responseKind =   e is RequestException ? ResponseKinds.RequestException
-                               : e is EnvironmentException ? ResponseKinds.EnvironmentException
-                               : e is TimeoutException || e is TaskCanceledException ? ResponseKinds.TimeoutException
-                               : ResponseKinds.OtherExceptions;
-
-                response = Task.FromException<object>(e);
-                var observed = response.Exception; //dont remove this line as it prevents UnobservedTaskException to be thrown
-            }
+            // We capture the response from the service here, including if it was an exception
+            var (response, responseKind) = await CallService(serviceMethod, metricsKeys);

             string outcome = null;

@@ -328,21 +302,21 @@
                     outcome = "ignored_cachedValueDoesNotExist";

             else //Dont cache and dont ignore (i.e. return it)
-
-                // Outcome #4: Do not cache response and return it; remove previously-cached value
+            {
+                outcome = "notCachedNotIgnored";
+
+                // Outcome #4: Do not cache response and return it; remove previously-cached value (if exist)
                 if (settings.NotIgnoredResponseBehavior == NotIgnoredResponseBehavior.RemoveCachedResponse)
                 {
-                    outcome = "notCachedNotIgnored_cachedValueRemoved";
-                    MemoryCache.Remove(cacheKey);
+                    if (MemoryCache.Remove(cacheKey) != null)
+                        outcome = "notCachedNotIgnored_cachedValueRemoved";
                 }

                 // Outcome #5: Do not cache response and return it; leave old response cached
-                // If old response exist, set its refresh time to the (short) FailedRefreshDelay
+                // If old response is not null, set its refresh time to the (short) FailedRefreshDelay
                 else if (currentValue != null)
-                {
-                    outcome = "notCachedNotIgnored_cachedValuePreserved";
                     currentValue.NextRefreshTime = DateTime.UtcNow + settings.FailedRefreshDelay.Value;
-                }
+            }

             Log.Debug(x => x("Service call", unencryptedTags: new { cacheKey, callReason, responseKind, outcome }));

@@ -352,17 +326,46 @@

-        private async Task<object> CallService(Func<Task<object>> serviceMethod, string[] metricsKeys)
-        {
+        private async Task<(Task<object> response, ResponseKinds responseKind)> CallService(Func<Task<object>> serviceMethod, string[] metricsKeys)
+        {
+            Task<object> response;
+            ResponseKinds responseKind;
+
             try
             {
                 AwaitingResult.Increment(metricsKeys);
-                return await serviceMethod();
+
+                // Call the service
+                response = Task.FromResult(await serviceMethod());
+
+                // Determine the kind of response. We consider it null also in case we got a non-null Revocable<> with null inner Value
+                var isNullResponse =    response.Result == null
+                                     || (   response.Result.GetType().IsGenericType
+                                         && response.Result.GetType().GetGenericTypeDefinition() == typeof(Revocable<>)
+                                         && response.Result.GetType().GetProperty("Value").GetValue(response.Result) == null);
+
+                responseKind = isNullResponse ? ResponseKinds.NullResponse : ResponseKinds.NonNullResponse;
+            }
+            catch (Exception e)
+            {
+                if (!(e is RequestException))
+                    Failed.Mark(metricsKeys);
+
+                // Determine the kind of exception
+                responseKind =   e is RequestException ? ResponseKinds.RequestException
+                               : e is EnvironmentException ? ResponseKinds.EnvironmentException
+                               : e is TimeoutException || e is TaskCanceledException ? ResponseKinds.TimeoutException
+                               : ResponseKinds.OtherExceptions;
+
+                response = Task.FromException<object>(e);
+                var observed = response.Exception; //dont remove this line as it prevents UnobservedTaskException to be thrown
             }
             finally
             {
                 AwaitingResult.Decrement(metricsKeys);
             }
+
+            return (response, responseKind);
         }


ECDHE on windows seems to have issues

ECDHE on windows seems to have issues

--- test/Leto.WindowsFacts/ClientSslStreamFacts.cs
+++ test/Leto.WindowsFacts/ClientSslStreamFacts.cs
@@ -16,8 +16,8 @@
         [Theory]
         [InlineData(CipherSuites.PredefinedCipherSuites.PredefinedSuite.RSA_AES_128_GCM_SHA256)]
         [InlineData(CipherSuites.PredefinedCipherSuites.PredefinedSuite.RSA_AES_256_GCM_SHA384)]
-        [InlineData(CipherSuites.PredefinedCipherSuites.PredefinedSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256)]
-        [InlineData(CipherSuites.PredefinedCipherSuites.PredefinedSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384)]
+        //[InlineData(CipherSuites.PredefinedCipherSuites.PredefinedSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256)]
+        //[InlineData(CipherSuites.PredefinedCipherSuites.PredefinedSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384)]
         public async Task HandshakeCompletes(CipherSuites.PredefinedCipherSuites.PredefinedSuite suite)
         {
             using (var factory = new PipeFactory())


Added a scenario to "TrySetProperty" where a double (OADateTime) was expected but in some cases the type was a regular DateTime.

--- src/EPPlus.Core.Extensions/ExcelTableExtensions.cs
+++ src/EPPlus.Core.Extensions/ExcelTableExtensions.cs
@@ -300,12 +300,26 @@

             if (type.IsNumeric())
             {
-                itemType.InvokeMember(
-                    property.Name,
-                    BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty,
-                    null,
-                    item,
-                    new object[] { Convert.ChangeType(cell, type) });
+                if (cell.GetType() == typeof(DateTime))
+                {
+                    double newVal = ((DateTime)cell).ToOADate();
+
+                    itemType.InvokeMember(
+                        property.Name,
+                        BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty,
+                        null,
+                        item,
+                        new object[] { newVal });
+                }
+                else
+                {
+                    itemType.InvokeMember(
+                        property.Name,
+                        BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty,
+                        null,
+                        item,
+                        new object[] { Convert.ChangeType(cell, type) });
+                }
             }
         }
     }


Add group by test

Add group by test

--- test/SimpleStack.Orm.Tests/SelectCountTests.cs
+++ test/SimpleStack.Orm.Tests/SelectCountTests.cs
@@ -58,5 +58,34 @@
 				})); // SELECT COUNT (DISTINCT Age) FROM Person
 			}
 		}
+
+		[Test]
+		public void Can_select_count_with_group_by()
+		{
+			OpenDbConnection().Insert(new Person { Id = 1, Age = 5 });
+			OpenDbConnection().Insert(new Person { Id = 2, Age = 10 });
+			OpenDbConnection().Insert(new Person { Id = 3, Age = 10 });
+			OpenDbConnection().Insert(new Person { Id = 4, Age = 20 });
+			OpenDbConnection().Insert(new Person { Id = 5, Age = 20 });
+			OpenDbConnection().Insert(new Person { Id = 6, Age = 25 });
+
+			using (var conn = OpenDbConnection())
+			{
+				var rr = conn.Select<Person>(x =>
+				{
+					//x.Select(y => new {Age = y.Age, Id = Sql.Max(y.Id)});
+					x.Select(y => new Person{Age = y.Age, Id = Sql.Max(y.Id)});
+					//x.SelectAlso(y => Sql.Max(y.Id));
+					x.GroupBy(y => y.Age);
+				});
+
+
+				Assert.AreEqual(4, conn.Count<Person>(x =>
+				{
+					x.Distinct();
+					x.Select(y => y.Age);
+				})); // SELECT COUNT (DISTINCT Age) FROM Person
+			}
+		}
 	}
 }


InvalidOperationException in the OriginalFormat

--- DryWetMidi/MidiFile.cs
+++ DryWetMidi/MidiFile.cs
@@ -99,12 +99,13 @@
         /// created by constructor.
         /// </summary>
         /// <exception cref="UnknownFileFormatException">File format is unknown.</exception>
+        /// <exception cref="InvalidOperationException">Unable to get original format of the file.</exception>
         public MidiFileFormat? OriginalFormat
         {
             get
             {
                 if (_originalFormat == null)
-                    return null;
+                    throw new InvalidOperationException("Unable to get original format of the file.");

                 var formatValue = _originalFormat.Value;
                 if (!Enum.IsDefined(typeof(MidiFileFormat), formatValue))


Trim address fix

Trim address fix

--- EPPlus/ExcelAddress.cs
+++ EPPlus/ExcelAddress.cs
@@ -261,7 +261,8 @@

         protected internal void SetAddress(string address)
         {
-            if(address.StartsWith("'"))
+            address = address.Trim();
+            if (address.StartsWith("'"))
             {
                 int pos = address.IndexOf("'", 1);
                 while (pos < address.Length && address[pos + 1] == '\'')


version 1.13b

version 1.13b

--- FPSCamera/FPSCamera.cs
+++ FPSCamera/FPSCamera.cs
@@ -367,6 +367,11 @@
                     continue;
                 }

+                if (vmanager.m_vehicles.m_buffer[i].Info.m_vehicleAI is CarTrailerAI)
+                {
+                    continue;
+                }
+
                 if (!(vmanager.m_vehicles.m_buffer[i].Info.m_vehicleAI is CarAI))
                 {
                     continue;


syncopation test

syncopation test

--- Test/SongTest.cs
+++ Test/SongTest.cs
@@ -72,5 +72,31 @@
                 Thread.Sleep(numBeats * beatTime);
             }
         }
+
+        [TestMethod]
+        public void SyncopationTest()
+        {
+            using (var hub = new AudioHub())
+            {
+                IActorRef leftSpeaker = hub.NewSpeaker();
+                var song = new Song();
+                song.Tempo = 120;
+                var notes = new List<Note>
+                {
+                    new Note(NoteName.E, (Rational)3/2),
+                    new Note(NoteName.E, 1),
+                    new Note(NoteName.E, 1),
+                    new Note(NoteName.E, (Rational)1/4),
+                    new Note(NoteName.E, (Rational)1/4),
+                    new Note(NoteName.E, (Rational)1/2)
+                };
+                song.AddTrack(0, notes);
+
+                var numBeats = 5;
+                var beatTime = (int)Math.Round(1000 / (song.Tempo / 60.0));
+                leftSpeaker.Tell(song);
+                Thread.Sleep(numBeats * beatTime);
+            }
+        }
     }
 }


ensure scene is always disposed

ensure scene is always disposed

--- src/Avalonia.Visuals/Rendering/DeferredRenderer.cs
+++ src/Avalonia.Visuals/Rendering/DeferredRenderer.cs
@@ -256,9 +256,9 @@

                         var (scene, updated) = UpdateRenderLayersAndConsumeSceneIfNeeded(GetContext);

-                        if (scene?.Item != null)
+                        using (scene)
                         {
-                            using (scene)
+                            if (scene?.Item != null)
                             {
                                 var overlay = DrawDirtyRects || DrawFps;
                                 if (DrawDirtyRects)
@@ -267,7 +267,7 @@
                                     RenderOverlay(scene.Item, GetContext());
                                 if (updated || forceComposite || overlay)
                                     RenderComposite(scene.Item, GetContext());
-                            }
+                             }
                         }
                     }
                     finally


Fix a problem with displaying missing license info

--- src/BloomExe/Publish/BloomLibraryPublishControl.cs
+++ src/BloomExe/Publish/BloomLibraryPublishControl.cs
@@ -44,7 +44,7 @@
 			// This is usually redundant, but might not be on old books where the license was set before the new
 			// editing code was written.
 			book.UpdateLicenseMetdata(metadata);
-			if (string.IsNullOrEmpty(metadata.License.RightsStatement) && !(metadata.License is CreativeCommonsLicense))
+			if (string.IsNullOrEmpty(metadata.License.RightsStatement) && metadata.License is CreativeCommonsLicense)
 			{
 				// Don't do this for non-CC licences, since for them, if Rights is empty we want to display the "please fill this in" message.
 				_licenseNotesLabel.Text = metadata.License.GetDescription("en");


revert to join() again for now

revert to join() again for now

per exceptions caused by https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/667

ref #357

--- src/FilterLists.Services/Snapshot/SnapshotBatch.cs
+++ src/FilterLists.Services/Snapshot/SnapshotBatch.cs
@@ -32,7 +32,7 @@
         }

         private IQueryable<Rule> GetExistingRules() =>
-            dbContext.Rules.Where(r => lines.Contains(r.Raw));
+            dbContext.Rules.Join(lines, rule => rule.Raw, line => line, (rule, line) => rule);

         private List<Rule> CreateNewRules(IQueryable<Rule> existingRules) =>
             lines.Except(existingRules.Select(r => r.Raw)).Select(r => new Rule {Raw = r}).ToList();


Removed unnecessary override keyword from interface method implementations.

--- src/Generator/Generators/CLI/CLIHeadersTemplate.cs
+++ src/Generator/Generators/CLI/CLIHeadersTemplate.cs
@@ -248,8 +248,8 @@
             PushIndent();
             WriteLine("property System::IntPtr Instance");
             WriteStartBraceIndent();
-            WriteLine("virtual System::IntPtr get() override;");
-            WriteLine("virtual void set(System::IntPtr instance) override;");
+            WriteLine("virtual System::IntPtr get();");
+            WriteLine("virtual void set(System::IntPtr instance);");
             WriteCloseBraceIndent();
             NewLine();


Delete Register.cs

Delete Register.cs

--- IdentityDemo_EmailConfirmation/Models/Register.cs
+++ IdentityDemo_EmailConfirmation/Models/Register.cs
@@ -1,40 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Web;
-
-namespace IdentityDemo.Models
-{
-    public class Register
-    {
-        [Required]
-        [Display(Name = "First Name")]
-        public string FirstName { get; set; }
-        [Required]
-        [Display(Name = "Last Name")]
-        public string LastName { get; set; }
-
-        [Required]
-        [Display(Name = "Username")]
-        [MinLength(5, ErrorMessage = "Your password must be atleast 6 characters long.")]
-        [MaxLength(30, ErrorMessage = "Your password must be no longer than 16 characters long.")]
-        public string Username { get; set; }
-
-        [Required]
-        [Display(Name = "Email Address")]
-        public string EmailAddress { get; set; }
-
-        [Display(Name = "Password")]
-        [Required]
-        [MinLength(6, ErrorMessage = "Your password must be atleast 6 characters long.")]
-        [MaxLength(16, ErrorMessage = "Your password must be no longer than 16 characters long.")]
-        public string Password { get; set; }
-
-        [Display(Name = "Confirm Password")]
-        [Required]
-        [CompareAttribute("Password", ErrorMessage = "Passwords don't match.")]
-        public string ConfirmPassword { get; set; }
-
-    }
-}


pluralize histogram hack

pluralize histogram hack


Write the proxy stuff as part of the main source object

--- LINQToTTree/TTreeClassGenerator/ClassGenerator.cs
+++ LINQToTTree/TTreeClassGenerator/ClassGenerator.cs
@@ -125,7 +125,11 @@
                     output.WriteLine("  public class {0}", cls.Name);
                     output.WriteLine("  {");

+                    ///
                     /// These fields will never be set or accessed - so we turn off some warnings the compiler will generate.
+                    /// They are dummies so that intellisense works and we can do the translation properly.
+                    ///
+
                     output.WriteLine("#pragma warning disable 0649");

                     foreach (var item in cls.Items)
@@ -134,8 +138,6 @@
                     }

                     output.WriteLine("#pragma warning restore 0649");
-
-                    output.WriteLine("  }"); // End of the class

                     ///
                     /// Write out the info class that contains everything needed to process this.
@@ -143,8 +145,6 @@
                     /// end, so until there is a real reason, we'll do it this way.
                     ///

-                    output.WriteLine("  public static class {0}_info", cls.Name);
-                    output.WriteLine("  {");
                     output.WriteLine("    public static string _gProxyFile=@\"" + cls.NtupleProxyPath + "\";");
                     output.WriteLine("    public static string[] _gObjectFiles= {");
                     foreach (var item in classSpec.ClassImplimintationFiles)


Minor revisions to Program.Persistence class

Removed public Container and DataDirectory properties. There weren't
being used outside of the Persistence class.

Changed Container & data directory to be pulled from static readonly
fields.

--- LeavinsSoftware.Collection.Program/Persistence.cs
+++ LeavinsSoftware.Collection.Program/Persistence.cs
@@ -16,20 +16,26 @@
     /// </summary>
     public static class Persistence
     {
+        private static readonly DirectoryInfo ProgramDir = new DirectoryInfo(Path.Combine(
+            Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
+            InterfaceResources.CompanyName,
+            InterfaceResources.ProgramName));
+
+        private static readonly Container Container = new Container();
+
         public static UpdateNotifier UpdateNotifier { get; private set; }

         public static void Setup()
         {
             Profile defaultProfile = new Profile("default");
-            MigrationRunner.Run(DataDirectory, defaultProfile);
-
-            Container = new Container();
-            Container.RegisterSingle<IComicBookPersistence>(new ComicBookPersistence(DataDirectory, defaultProfile));
-            Container.RegisterSingle<IVideoGamePersistence>(new VideoGamePersistence(DataDirectory, defaultProfile));
-            Container.RegisterSingle<IProductPersistence>(new ProductPersistence(DataDirectory, defaultProfile));
-            Container.RegisterSingle<ICategoryPersistence>(new ItemCategoryPersistence(DataDirectory, defaultProfile));
+            MigrationRunner.Run(ProgramDir, defaultProfile);
+
+            Container.RegisterSingle<IComicBookPersistence>(new ComicBookPersistence(ProgramDir, defaultProfile));
+            Container.RegisterSingle<IVideoGamePersistence>(new VideoGamePersistence(ProgramDir, defaultProfile));
+            Container.RegisterSingle<IProductPersistence>(new ProductPersistence(ProgramDir, defaultProfile));
+            Container.RegisterSingle<ICategoryPersistence>(new ItemCategoryPersistence(ProgramDir, defaultProfile));
             Container.RegisterSingle<IProgramOptionsPersistence>(new ProgramOptionsPersistence(
-                new FileInfo(Path.Combine(DataDirectory.FullName, "options.xml"))));
+                new FileInfo(Path.Combine(ProgramDir.FullName, "options.xml"))));

             UpdateNotifier = new UpdateNotifier(GetInstance<IProgramOptionsPersistence>().Retrieve(),
                 Assembly.GetExecutingAssembly().GetName().Version,
@@ -40,28 +46,5 @@
         {
             return Container.GetInstance<TService>();
         }
-
-        public static DirectoryInfo DataDirectory
-        {
-            get
-            {
-                return dataDirectory.Value;
-            }
-        }
-
-        public static Container Container
-        {
-            get;
-            private set;
-        }
-
-        private static Lazy<DirectoryInfo> dataDirectory = new Lazy<DirectoryInfo>(() =>
-            {
-                string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
-                    InterfaceResources.CompanyName,
-                    InterfaceResources.ProgramName);
-
-                return new DirectoryInfo(path);
-            });
     }
 }


fix identation in unit test

fix identation in unit test

--- test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs
+++ test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs
@@ -890,25 +890,25 @@
         [Fact(Skip = "https://github.com/dotnet/sdk/issues/522")]
         public void WhenPassedAnUnknownProjectTypeItFails()
         {
-           var projectDirectory = TestAssets
-               .Get("SlnFileWithNoProjectReferencesAndUnknownProject")
-               .CreateInstance()
-               .WithSourceFiles()
-               .Root
-               .FullName;
-
-           var slnFullPath = Path.Combine(projectDirectory, "App.sln");
-           var contentBefore = File.ReadAllText(slnFullPath);
-
-           var projectToAdd = Path.Combine("UnknownProject", "UnknownProject.unknownproj");
-           var cmd = new DotnetCommand()
-               .WithWorkingDirectory(projectDirectory)
-               .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}");
-           cmd.Should().Fail();
-           cmd.StdErr.Should().BeVisuallyEquivalentTo("Unsupported project type. Please check with your sdk provider.");
-
-           File.ReadAllText(slnFullPath)
-               .Should().BeVisuallyEquivalentTo(contentBefore);
+            var projectDirectory = TestAssets
+                .Get("SlnFileWithNoProjectReferencesAndUnknownProject")
+                .CreateInstance()
+                .WithSourceFiles()
+                .Root
+                .FullName;
+
+            var slnFullPath = Path.Combine(projectDirectory, "App.sln");
+            var contentBefore = File.ReadAllText(slnFullPath);
+
+            var projectToAdd = Path.Combine("UnknownProject", "UnknownProject.unknownproj");
+            var cmd = new DotnetCommand()
+                .WithWorkingDirectory(projectDirectory)
+                .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}");
+            cmd.Should().Fail();
+            cmd.StdErr.Should().BeVisuallyEquivalentTo("Unsupported project type. Please check with your sdk provider.");
+
+            File.ReadAllText(slnFullPath)
+                .Should().BeVisuallyEquivalentTo(contentBefore);
         }

         [Theory]


Added documentation

Added documentation

--- LightBuzz.Archiver/LightBuzz.Archiver/Archiver.cs
+++ LightBuzz.Archiver/LightBuzz.Archiver/Archiver.cs
@@ -12,6 +12,9 @@

 namespace LightBuzz.Archiver
 {
+    /// <summary>
+    /// Compresses and decompresses single files and folders.
+    /// </summary>
     public class Archiver
     {
         /// <summary>
@@ -102,6 +105,8 @@

         /// <summary>
         /// Adds the specified folder, along with its files and sub-folders, to the specified archive.
+        /// Creadits to Jin Yanyun
+        /// http://www.rapidsnail.com/Tutorial/t/2012/116/40/23786/windows-and-development-winrt-to-zip-files-unzip-and-folder-zip-compression.aspx
         /// </summary>
         /// <param name="folder">The folder to add.</param>
         /// <param name="archive">The zip archive.</param>


Change test to allow for potentially single-frame delayed events firing

--- osu.Game.Tests/Online/TestSceneOnlinePlayBeatmapAvailabilityTracker.cs
+++ osu.Game.Tests/Online/TestSceneOnlinePlayBeatmapAvailabilityTracker.cs
@@ -128,7 +128,7 @@

         private void addAvailabilityCheckStep(string description, Func<BeatmapAvailability> expected)
         {
-            AddAssert(description, () => availabilityTracker.Availability.Value.Equals(expected.Invoke()));
+            AddUntilStep(description, () => availabilityTracker.Availability.Value.Equals(expected.Invoke()));
         }

         private static BeatmapInfo getTestBeatmapInfo(string archiveFile)